@owox/web 0.18.0-next-20260127130221 → 0.18.0-next-20260129084308
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-DYJAzLqI.js +869 -0
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/index-CSorzK6f.js +0 -869
|
@@ -0,0 +1,869 @@
|
|
|
1
|
+
var EL=Object.defineProperty;var wL=(e,t,n)=>t in e?EL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var io=(e,t,n)=>wL(e,typeof t!="symbol"?t+"":t,n);function RL(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 TA(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var K0={exports:{}},Ef={};/**
|
|
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 Wj;function jL(){if(Wj)return Ef;Wj=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 Ef.Fragment=t,Ef.jsx=n,Ef.jsxs=n,Ef}var Zj;function TL(){return Zj||(Zj=1,K0.exports=jL()),K0.exports}var a=TL(),W0={exports:{}},At={};/**
|
|
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 Yj;function _L(){if(Yj)return At;Yj=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"),x=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),y=Symbol.iterator;function v(z){return z===null||typeof z!="object"?null:(z=y&&z[y]||z["@@iterator"],typeof z=="function"?z:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,E={};function j(z,$,P){this.props=z,this.context=$,this.refs=E,this.updater=P||C}j.prototype.isReactComponent={},j.prototype.setState=function(z,$){if(typeof z!="object"&&typeof z!="function"&&z!=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,z,$,"setState")},j.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function R(){}R.prototype=j.prototype;function T(z,$,P){this.props=z,this.context=$,this.refs=E,this.updater=P||C}var N=T.prototype=new R;N.constructor=T,S(N,j.prototype),N.isPureReactComponent=!0;var A=Array.isArray;function I(){}var _={H:null,A:null,T:null,S:null},M=Object.prototype.hasOwnProperty;function G(z,$,P){var K=P.ref;return{$$typeof:e,type:z,key:$,ref:K!==void 0?K:null,props:P}}function H(z,$){return G(z.type,$,z.props)}function L(z){return typeof z=="object"&&z!==null&&z.$$typeof===e}function q(z){var $={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(P){return $[P]})}var W=/\/+/g;function B(z,$){return typeof z=="object"&&z!==null&&z.key!=null?q(""+z.key):$.toString(36)}function V(z){switch(z.status){case"fulfilled":return z.value;case"rejected":throw z.reason;default:switch(typeof z.status=="string"?z.then(I,I):(z.status="pending",z.then(function($){z.status==="pending"&&(z.status="fulfilled",z.value=$)},function($){z.status==="pending"&&(z.status="rejected",z.reason=$)})),z.status){case"fulfilled":return z.value;case"rejected":throw z.reason}}throw z}function D(z,$,P,K,Y){var se=typeof z;(se==="undefined"||se==="boolean")&&(z=null);var Q=!1;if(z===null)Q=!0;else switch(se){case"bigint":case"string":case"number":Q=!0;break;case"object":switch(z.$$typeof){case e:case t:Q=!0;break;case x:return Q=z._init,D(Q(z._payload),$,P,K,Y)}}if(Q)return Y=Y(z),Q=K===""?"."+B(z,0):K,A(Y)?(P="",Q!=null&&(P=Q.replace(W,"$&/")+"/"),D(Y,$,P,"",function(be){return be})):Y!=null&&(L(Y)&&(Y=H(Y,P+(Y.key==null||z&&z.key===Y.key?"":(""+Y.key).replace(W,"$&/")+"/")+Q)),$.push(Y)),1;Q=0;var le=K===""?".":K+":";if(A(z))for(var pe=0;pe<z.length;pe++)K=z[pe],se=le+B(K,pe),Q+=D(K,$,P,se,Y);else if(pe=v(z),typeof pe=="function")for(z=pe.call(z),pe=0;!(K=z.next()).done;)K=K.value,se=le+B(K,pe++),Q+=D(K,$,P,se,Y);else if(se==="object"){if(typeof z.then=="function")return D(V(z),$,P,K,Y);throw $=String(z),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return Q}function F(z,$,P){if(z==null)return z;var K=[],Y=0;return D(z,K,"","",function(se){return $.call(P,se,Y++)}),K}function U(z){if(z._status===-1){var $=z._result;$=$(),$.then(function(P){(z._status===0||z._status===-1)&&(z._status=1,z._result=P)},function(P){(z._status===0||z._status===-1)&&(z._status=2,z._result=P)}),z._status===-1&&(z._status=0,z._result=$)}if(z._status===1)return z._result.default;throw z._result}var ee=typeof reportError=="function"?reportError:function(z){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var $=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof z=="object"&&z!==null&&typeof z.message=="string"?String(z.message):String(z),error:z});if(!window.dispatchEvent($))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",z);return}console.error(z)},he={map:F,forEach:function(z,$,P){F(z,function(){$.apply(this,arguments)},P)},count:function(z){var $=0;return F(z,function(){$++}),$},toArray:function(z){return F(z,function($){return $})||[]},only:function(z){if(!L(z))throw Error("React.Children.only expected to receive a single React element child.");return z}};return At.Activity=g,At.Children=he,At.Component=j,At.Fragment=n,At.Profiler=s,At.PureComponent=T,At.StrictMode=r,At.Suspense=f,At.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=_,At.__COMPILER_RUNTIME={__proto__:null,c:function(z){return _.H.useMemoCache(z)}},At.cache=function(z){return function(){return z.apply(null,arguments)}},At.cacheSignal=function(){return null},At.cloneElement=function(z,$,P){if(z==null)throw Error("The argument must be a React element, but you passed "+z+".");var K=S({},z.props),Y=z.key;if($!=null)for(se in $.key!==void 0&&(Y=""+$.key),$)!M.call($,se)||se==="key"||se==="__self"||se==="__source"||se==="ref"&&$.ref===void 0||(K[se]=$[se]);var se=arguments.length-2;if(se===1)K.children=P;else if(1<se){for(var Q=Array(se),le=0;le<se;le++)Q[le]=arguments[le+2];K.children=Q}return G(z.type,Y,K)},At.createContext=function(z){return z={$$typeof:c,_currentValue:z,_currentValue2:z,_threadCount:0,Provider:null,Consumer:null},z.Provider=z,z.Consumer={$$typeof:i,_context:z},z},At.createElement=function(z,$,P){var K,Y={},se=null;if($!=null)for(K in $.key!==void 0&&(se=""+$.key),$)M.call($,K)&&K!=="key"&&K!=="__self"&&K!=="__source"&&(Y[K]=$[K]);var Q=arguments.length-2;if(Q===1)Y.children=P;else if(1<Q){for(var le=Array(Q),pe=0;pe<Q;pe++)le[pe]=arguments[pe+2];Y.children=le}if(z&&z.defaultProps)for(K in Q=z.defaultProps,Q)Y[K]===void 0&&(Y[K]=Q[K]);return G(z,se,Y)},At.createRef=function(){return{current:null}},At.forwardRef=function(z){return{$$typeof:u,render:z}},At.isValidElement=L,At.lazy=function(z){return{$$typeof:x,_payload:{_status:-1,_result:z},_init:U}},At.memo=function(z,$){return{$$typeof:m,type:z,compare:$===void 0?null:$}},At.startTransition=function(z){var $=_.T,P={};_.T=P;try{var K=z(),Y=_.S;Y!==null&&Y(P,K),typeof K=="object"&&K!==null&&typeof K.then=="function"&&K.then(I,ee)}catch(se){ee(se)}finally{$!==null&&P.types!==null&&($.types=P.types),_.T=$}},At.unstable_useCacheRefresh=function(){return _.H.useCacheRefresh()},At.use=function(z){return _.H.use(z)},At.useActionState=function(z,$,P){return _.H.useActionState(z,$,P)},At.useCallback=function(z,$){return _.H.useCallback(z,$)},At.useContext=function(z){return _.H.useContext(z)},At.useDebugValue=function(){},At.useDeferredValue=function(z,$){return _.H.useDeferredValue(z,$)},At.useEffect=function(z,$){return _.H.useEffect(z,$)},At.useEffectEvent=function(z){return _.H.useEffectEvent(z)},At.useId=function(){return _.H.useId()},At.useImperativeHandle=function(z,$,P){return _.H.useImperativeHandle(z,$,P)},At.useInsertionEffect=function(z,$){return _.H.useInsertionEffect(z,$)},At.useLayoutEffect=function(z,$){return _.H.useLayoutEffect(z,$)},At.useMemo=function(z,$){return _.H.useMemo(z,$)},At.useOptimistic=function(z,$){return _.H.useOptimistic(z,$)},At.useReducer=function(z,$,P){return _.H.useReducer(z,$,P)},At.useRef=function(z){return _.H.useRef(z)},At.useState=function(z){return _.H.useState(z)},At.useSyncExternalStore=function(z,$,P){return _.H.useSyncExternalStore(z,$,P)},At.useTransition=function(){return _.H.useTransition()},At.version="19.2.3",At}var Xj;function LS(){return Xj||(Xj=1,W0.exports=_L()),W0.exports}var h=LS();const re=TA(h),Ch=RL({__proto__:null,default:re},[h]);var Z0={exports:{}},wf={},Y0={exports:{}},X0={};/**
|
|
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 Qj;function NL(){return Qj||(Qj=1,(function(e){function t(D,F){var U=D.length;D.push(F);e:for(;0<U;){var ee=U-1>>>1,he=D[ee];if(0<s(he,F))D[ee]=F,D[U]=he,U=ee;else break e}}function n(D){return D.length===0?null:D[0]}function r(D){if(D.length===0)return null;var F=D[0],U=D.pop();if(U!==F){D[0]=U;e:for(var ee=0,he=D.length,z=he>>>1;ee<z;){var $=2*(ee+1)-1,P=D[$],K=$+1,Y=D[K];if(0>s(P,U))K<he&&0>s(Y,P)?(D[ee]=Y,D[K]=U,ee=K):(D[ee]=P,D[$]=U,ee=$);else if(K<he&&0>s(Y,U))D[ee]=Y,D[K]=U,ee=K;else break e}}return F}function s(D,F){var U=D.sortIndex-F.sortIndex;return U!==0?U:D.id-F.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=[],x=1,g=null,y=3,v=!1,C=!1,S=!1,E=!1,j=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function N(D){for(var F=n(m);F!==null;){if(F.callback===null)r(m);else if(F.startTime<=D)r(m),F.sortIndex=F.expirationTime,t(f,F);else break;F=n(m)}}function A(D){if(S=!1,N(D),!C)if(n(f)!==null)C=!0,I||(I=!0,q());else{var F=n(m);F!==null&&V(A,F.startTime-D)}}var I=!1,_=-1,M=5,G=-1;function H(){return E?!0:!(e.unstable_now()-G<M)}function L(){if(E=!1,I){var D=e.unstable_now();G=D;var F=!0;try{e:{C=!1,S&&(S=!1,R(_),_=-1),v=!0;var U=y;try{t:{for(N(D),g=n(f);g!==null&&!(g.expirationTime>D&&H());){var ee=g.callback;if(typeof ee=="function"){g.callback=null,y=g.priorityLevel;var he=ee(g.expirationTime<=D);if(D=e.unstable_now(),typeof he=="function"){g.callback=he,N(D),F=!0;break t}g===n(f)&&r(f),N(D)}else r(f);g=n(f)}if(g!==null)F=!0;else{var z=n(m);z!==null&&V(A,z.startTime-D),F=!1}}break e}finally{g=null,y=U,v=!1}F=void 0}}finally{F?q():I=!1}}}var q;if(typeof T=="function")q=function(){T(L)};else if(typeof MessageChannel<"u"){var W=new MessageChannel,B=W.port2;W.port1.onmessage=L,q=function(){B.postMessage(null)}}else q=function(){j(L,0)};function V(D,F){_=j(function(){D(e.unstable_now())},F)}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(D){D.callback=null},e.unstable_forceFrameRate=function(D){0>D||125<D?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<D?Math.floor(1e3/D):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(D){switch(y){case 1:case 2:case 3:var F=3;break;default:F=y}var U=y;y=F;try{return D()}finally{y=U}},e.unstable_requestPaint=function(){E=!0},e.unstable_runWithPriority=function(D,F){switch(D){case 1:case 2:case 3:case 4:case 5:break;default:D=3}var U=y;y=D;try{return F()}finally{y=U}},e.unstable_scheduleCallback=function(D,F,U){var ee=e.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?ee+U:ee):U=ee,D){case 1:var he=-1;break;case 2:he=250;break;case 5:he=1073741823;break;case 4:he=1e4;break;default:he=5e3}return he=U+he,D={id:x++,callback:F,priorityLevel:D,startTime:U,expirationTime:he,sortIndex:-1},U>ee?(D.sortIndex=U,t(m,D),n(f)===null&&D===n(m)&&(S?(R(_),_=-1):S=!0,V(A,U-ee))):(D.sortIndex=he,t(f,D),C||v||(C=!0,I||(I=!0,q()))),D},e.unstable_shouldYield=H,e.unstable_wrapCallback=function(D){var F=y;return function(){var U=y;y=F;try{return D.apply(this,arguments)}finally{y=U}}}})(X0)),X0}var Jj;function AL(){return Jj||(Jj=1,Y0.exports=NL()),Y0.exports}var Q0={exports:{}},Qr={};/**
|
|
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 eT;function DL(){if(eT)return Qr;eT=1;var e=LS();function t(f){var m="https://react.dev/errors/"+f;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var x=2;x<arguments.length;x++)m+="&args[]="+encodeURIComponent(arguments[x])}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,x){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:x}}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 Qr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Qr.createPortal=function(f,m){var x=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,x)},Qr.flushSync=function(f){var m=c.T,x=r.p;try{if(c.T=null,r.p=2,f)return f()}finally{c.T=m,r.p=x,r.d.f()}},Qr.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))},Qr.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},Qr.preinit=function(f,m){if(typeof f=="string"&&m&&typeof m.as=="string"){var x=m.as,g=u(x,m.crossOrigin),y=typeof m.integrity=="string"?m.integrity:void 0,v=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;x==="style"?r.d.S(f,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:g,integrity:y,fetchPriority:v}):x==="script"&&r.d.X(f,{crossOrigin:g,integrity:y,fetchPriority:v,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},Qr.preinitModule=function(f,m){if(typeof f=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var x=u(m.as,m.crossOrigin);r.d.M(f,{crossOrigin:x,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)},Qr.preload=function(f,m){if(typeof f=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var x=m.as,g=u(x,m.crossOrigin);r.d.L(f,x,{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})}},Qr.preloadModule=function(f,m){if(typeof f=="string")if(m){var x=u(m.as,m.crossOrigin);r.d.m(f,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:x,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else r.d.m(f)},Qr.requestFormReset=function(f){r.d.r(f)},Qr.unstable_batchedUpdates=function(f,m){return f(m)},Qr.useFormState=function(f,m,x){return c.H.useFormState(f,m,x)},Qr.useFormStatus=function(){return c.H.useHostTransitionStatus()},Qr.version="19.2.3",Qr}var tT;function _A(){if(tT)return Q0.exports;tT=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(),Q0.exports=DL(),Q0.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 nT;function OL(){if(nT)return wf;nT=1;var e=AL(),t=LS(),n=_A();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 O=!1,k=b.child;k;){if(k===d){O=!0,d=b,p=w;break}if(k===p){O=!0,p=b,d=w;break}k=k.sibling}if(!O){for(k=w.child;k;){if(k===d){O=!0,d=w,p=b;break}if(k===p){O=!0,p=w,d=b;break}k=k.sibling}if(!O)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 x(o){var l=o.tag;if(l===5||l===26||l===27||l===6)return o;for(o=o.child;o!==null;){if(l=x(o),l!==null)return l;o=o.sibling}return null}var g=Object.assign,y=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"),j=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),T=Symbol.for("react.context"),N=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),G=Symbol.for("react.activity"),H=Symbol.for("react.memo_cache_sentinel"),L=Symbol.iterator;function q(o){return o===null||typeof o!="object"?null:(o=L&&o[L]||o["@@iterator"],typeof o=="function"?o:null)}var W=Symbol.for("react.client.reference");function B(o){if(o==null)return null;if(typeof o=="function")return o.$$typeof===W?null:o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case S:return"Fragment";case j:return"Profiler";case E:return"StrictMode";case A:return"Suspense";case I:return"SuspenseList";case G:return"Activity"}if(typeof o=="object")switch(o.$$typeof){case C:return"Portal";case T:return o.displayName||"Context";case R:return(o._context.displayName||"Context")+".Consumer";case N:var l=o.render;return o=o.displayName,o||(o=l.displayName||l.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case _:return l=o.displayName||null,l!==null?l:B(o.type)||"Memo";case M:l=o._payload,o=o._init;try{return B(o(l))}catch{}}return null}var V=Array.isArray,D=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U={pending:!1,data:null,method:null,action:null},ee=[],he=-1;function z(o){return{current:o}}function $(o){0>he||(o.current=ee[he],ee[he]=null,he--)}function P(o,l){he++,ee[he]=o.current,o.current=l}var K=z(null),Y=z(null),se=z(null),Q=z(null);function le(o,l){switch(P(se,l),P(Y,o),P(K,null),l.nodeType){case 9:case 11:o=(o=l.documentElement)&&(o=o.namespaceURI)?xj(o):0;break;default:if(o=l.tagName,l=l.namespaceURI)l=xj(l),o=yj(l,o);else switch(o){case"svg":o=1;break;case"math":o=2;break;default:o=0}}$(K),P(K,o)}function pe(){$(K),$(Y),$(se)}function be(o){o.memoizedState!==null&&P(Q,o);var l=K.current,d=yj(l,o.type);l!==d&&(P(Y,o),P(K,d))}function ze(o){Y.current===o&&($(K),$(Y)),Q.current===o&&($(Q),vf._currentValue=U)}var Re,Ge;function ot(o){if(Re===void 0)try{throw Error()}catch(d){var l=d.stack.trim().match(/\n( *(at )?)/);Re=l&&l[1]||"",Ge=-1<d.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<d.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+Re+o+Ge}var Vt=!1;function He(o,l){if(!o||Vt)return"";Vt=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var p={DetermineComponentFrameRoot:function(){try{if(l){var Ee=function(){throw Error()};if(Object.defineProperty(Ee.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ee,[])}catch(ye){var me=ye}Reflect.construct(o,[],Ee)}else{try{Ee.call()}catch(ye){me=ye}o.call(Ee.prototype)}}else{try{throw Error()}catch(ye){me=ye}(Ee=o())&&typeof Ee.catch=="function"&&Ee.catch(function(){})}}catch(ye){if(ye&&me&&typeof ye.stack=="string")return[ye.stack,me.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(),O=w[0],k=w[1];if(O&&k){var J=O.split(`
|
|
44
|
+
`),fe=k.split(`
|
|
45
|
+
`);for(b=p=0;p<J.length&&!J[p].includes("DetermineComponentFrameRoot");)p++;for(;b<fe.length&&!fe[b].includes("DetermineComponentFrameRoot");)b++;if(p===J.length||b===fe.length)for(p=J.length-1,b=fe.length-1;1<=p&&0<=b&&J[p]!==fe[b];)b--;for(;1<=p&&0<=b;p--,b--)if(J[p]!==fe[b]){if(p!==1||b!==1)do if(p--,b--,0>b||J[p]!==fe[b]){var ve=`
|
|
46
|
+
`+J[p].replace(" at new "," at ");return o.displayName&&ve.includes("<anonymous>")&&(ve=ve.replace("<anonymous>",o.displayName)),ve}while(1<=p&&0<=b);break}}}finally{Vt=!1,Error.prepareStackTrace=d}return(d=o?o.displayName||o.name:"")?ot(d):""}function Xt(o,l){switch(o.tag){case 26:case 27:case 5:return ot(o.type);case 16:return ot("Lazy");case 13:return o.child!==l&&l!==null?ot("Suspense Fallback"):ot("Suspense");case 19:return ot("SuspenseList");case 0:case 15:return He(o.type,!1);case 11:return He(o.type.render,!1);case 1:return He(o.type,!0);case 31:return ot("Activity");default:return""}}function gn(o){try{var l="",d=null;do l+=Xt(o,d),d=o,o=o.return;while(o);return l}catch(p){return`
|
|
47
|
+
Error generating stack: `+p.message+`
|
|
48
|
+
`+p.stack}}var ke=Object.prototype.hasOwnProperty,It=e.unstable_scheduleCallback,Z=e.unstable_cancelCallback,ae=e.unstable_shouldYield,ge=e.unstable_requestPaint,Te=e.unstable_now,Oe=e.unstable_getCurrentPriorityLevel,je=e.unstable_ImmediatePriority,Ve=e.unstable_UserBlockingPriority,lt=e.unstable_NormalPriority,dt=e.unstable_LowPriority,vn=e.unstable_IdlePriority,Wn=e.log,$n=e.unstable_setDisableYieldValue,La=null,bn=null;function Qn(o){if(typeof Wn=="function"&&$n(o),bn&&typeof bn.setStrictMode=="function")try{bn.setStrictMode(La,o)}catch{}}var Vn=Math.clz32?Math.clz32:kr,_s=Math.log,ls=Math.LN2;function kr(o){return o>>>=0,o===0?32:31-(_s(o)/ls|0)|0}var Pa=256,Ns=262144,_n=4194304;function Ln(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 Xe(o,l,d){var p=o.pendingLanes;if(p===0)return 0;var b=0,w=o.suspendedLanes,O=o.pingedLanes;o=o.warmLanes;var k=p&134217727;return k!==0?(p=k&~w,p!==0?b=Ln(p):(O&=k,O!==0?b=Ln(O):d||(d=k&~o,d!==0&&(b=Ln(d))))):(k=p&~w,k!==0?b=Ln(k):O!==0?b=Ln(O):d||(d=p&~o,d!==0&&(b=Ln(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 nn(o,l){return(o.pendingLanes&~(o.suspendedLanes&~o.pingedLanes)&l)===0}function cn(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 rn(){var o=_n;return _n<<=1,(_n&62914560)===0&&(_n=4194304),o}function Gn(o){for(var l=[],d=0;31>d;d++)l.push(o);return l}function dn(o,l){o.pendingLanes|=l,l!==268435456&&(o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0)}function un(o,l,d,p,b,w){var O=o.pendingLanes;o.pendingLanes=d,o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0,o.expiredLanes&=d,o.entangledLanes&=d,o.errorRecoveryDisabledLanes&=d,o.shellSuspendCounter=0;var k=o.entanglements,J=o.expirationTimes,fe=o.hiddenUpdates;for(d=O&~d;0<d;){var ve=31-Vn(d),Ee=1<<ve;k[ve]=0,J[ve]=-1;var me=fe[ve];if(me!==null)for(fe[ve]=null,ve=0;ve<me.length;ve++){var ye=me[ve];ye!==null&&(ye.lane&=-536870913)}d&=~Ee}p!==0&&Lr(o,p,0),w!==0&&b===0&&o.tag!==0&&(o.suspendedLanes|=w&~(O&~l))}function Lr(o,l,d){o.pendingLanes|=l,o.suspendedLanes&=~l;var p=31-Vn(l);o.entangledLanes|=l,o.entanglements[p]=o.entanglements[p]|1073741824|d&261930}function X(o,l){var d=o.entangledLanes|=l;for(o=o.entanglements;d;){var p=31-Vn(d),b=1<<p;b&l|o[p]&l&&(o[p]|=l),d&=~b}}function te(o,l){var d=l&-l;return d=(d&42)!==0?1:ue(d),(d&(o.suspendedLanes|l))!==0?0:d}function ue(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 Ce(o){return o&=-o,2<o?8<o?(o&134217727)!==0?32:268435456:8:2}function Ne(){var o=F.p;return o!==0?o:(o=window.event,o===void 0?32:Hj(o.type))}function Ke(o,l){var d=F.p;try{return F.p=o,l()}finally{F.p=d}}var Be=Math.random().toString(36).slice(2),Le="__reactFiber$"+Be,Pe="__reactProps$"+Be,Qe="__reactContainer$"+Be,wt="__reactEvents$"+Be,nt="__reactListeners$"+Be,Ot="__reactHandles$"+Be,Kt="__reactResources$"+Be,Zn="__reactMarker$"+Be;function Jn(o){delete o[Le],delete o[Pe],delete o[wt],delete o[nt],delete o[Ot]}function er(o){var l=o[Le];if(l)return l;for(var d=o.parentNode;d;){if(l=d[Qe]||d[Le]){if(d=l.alternate,l.child!==null||d!==null&&d.child!==null)for(o=Rj(o);o!==null;){if(d=o[Le])return d;o=Rj(o)}return l}o=d,d=o.parentNode}return null}function an(o){if(o=o[Le]||o[Qe]){var l=o.tag;if(l===5||l===6||l===13||l===31||l===26||l===27||l===3)return o}return null}function Pr(o){var l=o.tag;if(l===5||l===26||l===27||l===6)return o.stateNode;throw Error(r(33))}function Sa(o){var l=o[Kt];return l||(l=o[Kt]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function Bn(o){o[Zn]=!0}var As=new Set,Ua={};function Ds(o,l){cs(o,l),cs(o+"Capture",l)}function cs(o,l){for(Ua[o]=l,o=0;o<l.length;o++)As.add(l[o])}var Po=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]*$"),$l={},Vl={};function sn(o){return ke.call(Vl,o)?!0:ke.call($l,o)?!1:Po.test(o)?Vl[o]=!0:($l[o]=!0,!1)}function ir(o,l,d){if(sn(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 Os(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 $r(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 on(o){switch(typeof o){case"bigint":case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function Gl(o){var l=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function Em(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(O){d=""+O,w.call(this,O)}}),Object.defineProperty(o,l,{enumerable:p.enumerable}),{getValue:function(){return d},setValue:function(O){d=""+O},stopTracking:function(){o._valueTracker=null,delete o[l]}}}}function Md(o){if(!o._valueTracker){var l=Gl(o)?"checked":"value";o._valueTracker=Em(o,l,""+o[l])}}function u2(o){if(!o)return!1;var l=o._valueTracker;if(!l)return!0;var d=l.getValue(),p="";return o&&(p=Gl(o)?o.checked?"true":"false":o.value),o=p,o!==d?(l.setValue(o),!0):!1}function wm(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 x8=/[\n"\\]/g;function us(o){return o.replace(x8,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function Hy(o,l,d,p,b,w,O,k){o.name="",O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"?o.type=O:o.removeAttribute("type"),l!=null?O==="number"?(l===0&&o.value===""||o.value!=l)&&(o.value=""+on(l)):o.value!==""+on(l)&&(o.value=""+on(l)):O!=="submit"&&O!=="reset"||o.removeAttribute("value"),l!=null?$y(o,O,on(l)):d!=null?$y(o,O,on(d)):p!=null&&o.removeAttribute("value"),b==null&&w!=null&&(o.defaultChecked=!!w),b!=null&&(o.checked=b&&typeof b!="function"&&typeof b!="symbol"),k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?o.name=""+on(k):o.removeAttribute("name")}function d2(o,l,d,p,b,w,O,k){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)){Md(o);return}d=d!=null?""+on(d):"",l=l!=null?""+on(l):d,k||l===o.value||(o.value=l),o.defaultValue=l}p=p??b,p=typeof p!="function"&&typeof p!="symbol"&&!!p,o.checked=k?o.checked:!!p,o.defaultChecked=!!p,O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"&&(o.name=O),Md(o)}function $y(o,l,d){l==="number"&&wm(o.ownerDocument)===o||o.defaultValue===""+d||(o.defaultValue=""+d)}function Xc(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=""+on(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 f2(o,l,d){if(l!=null&&(l=""+on(l),l!==o.value&&(o.value=l),d==null)){o.defaultValue!==l&&(o.defaultValue=l);return}o.defaultValue=d!=null?""+on(d):""}function h2(o,l,d,p){if(l==null){if(p!=null){if(d!=null)throw Error(r(92));if(V(p)){if(1<p.length)throw Error(r(93));p=p[0]}d=p}d==null&&(d=""),l=d}d=on(l),o.defaultValue=d,p=o.textContent,p===d&&p!==""&&p!==null&&(o.value=p),Md(o)}function Qc(o,l){if(l){var d=o.firstChild;if(d&&d===o.lastChild&&d.nodeType===3){d.nodeValue=l;return}}o.textContent=l}var y8=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 m2(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||y8.has(l)?l==="float"?o.cssFloat=d:o[l]=(""+d).trim():o[l]=d+"px"}function p2(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&&m2(o,b,p)}else for(var w in l)l.hasOwnProperty(w)&&m2(o,w,l[w])}function Vy(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 v8=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"]]),b8=/^[\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 Rm(o){return b8.test(""+o)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":o}function Uo(){}var Gy=null;function By(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var Jc=null,eu=null;function g2(o){var l=an(o);if(l&&(o=l.stateNode)){var d=o[Pe]||null;e:switch(o=l.stateNode,l.type){case"input":if(Hy(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="'+us(""+l)+'"][type="radio"]'),l=0;l<d.length;l++){var p=d[l];if(p!==o&&p.form===o.form){var b=p[Pe]||null;if(!b)throw Error(r(90));Hy(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&&u2(p)}break e;case"textarea":f2(o,d.value,d.defaultValue);break e;case"select":l=d.value,l!=null&&Xc(o,!!d.multiple,l,!1)}}}var qy=!1;function x2(o,l,d){if(qy)return o(l,d);qy=!0;try{var p=o(l);return p}finally{if(qy=!1,(Jc!==null||eu!==null)&&(fp(),Jc&&(l=Jc,o=eu,eu=Jc=null,g2(l),o)))for(l=0;l<o.length;l++)g2(o[l])}}function kd(o,l){var d=o.stateNode;if(d===null)return null;var p=d[Pe]||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 zo=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ky=!1;if(zo)try{var Ld={};Object.defineProperty(Ld,"passive",{get:function(){Ky=!0}}),window.addEventListener("test",Ld,Ld),window.removeEventListener("test",Ld,Ld)}catch{Ky=!1}var Di=null,Wy=null,jm=null;function y2(){if(jm)return jm;var o,l=Wy,d=l.length,p,b="value"in Di?Di.value:Di.textContent,w=b.length;for(o=0;o<d&&l[o]===b[o];o++);var O=d-o;for(p=1;p<=O&&l[d-p]===b[w-p];p++);return jm=b.slice(o,1<p?1-p:void 0)}function Tm(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 _m(){return!0}function v2(){return!1}function Ca(o){function l(d,p,b,w,O){this._reactName=d,this._targetInst=b,this.type=p,this.nativeEvent=w,this.target=O,this.currentTarget=null;for(var k in o)o.hasOwnProperty(k)&&(d=o[k],this[k]=d?d(w):w[k]);return this.isDefaultPrevented=(w.defaultPrevented!=null?w.defaultPrevented:w.returnValue===!1)?_m:v2,this.isPropagationStopped=v2,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=_m)},stopPropagation:function(){var d=this.nativeEvent;d&&(d.stopPropagation?d.stopPropagation():typeof d.cancelBubble!="unknown"&&(d.cancelBubble=!0),this.isPropagationStopped=_m)},persist:function(){},isPersistent:_m}),l}var Bl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Nm=Ca(Bl),Pd=g({},Bl,{view:0,detail:0}),S8=Ca(Pd),Zy,Yy,Ud,Am=g({},Pd,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Qy,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!==Ud&&(Ud&&o.type==="mousemove"?(Zy=o.screenX-Ud.screenX,Yy=o.screenY-Ud.screenY):Yy=Zy=0,Ud=o),Zy)},movementY:function(o){return"movementY"in o?o.movementY:Yy}}),b2=Ca(Am),C8=g({},Am,{dataTransfer:0}),E8=Ca(C8),w8=g({},Pd,{relatedTarget:0}),Xy=Ca(w8),R8=g({},Bl,{animationName:0,elapsedTime:0,pseudoElement:0}),j8=Ca(R8),T8=g({},Bl,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),_8=Ca(T8),N8=g({},Bl,{data:0}),S2=Ca(N8),A8={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},D8={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"},O8={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function I8(o){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(o):(o=O8[o])?!!l[o]:!1}function Qy(){return I8}var M8=g({},Pd,{key:function(o){if(o.key){var l=A8[o.key]||o.key;if(l!=="Unidentified")return l}return o.type==="keypress"?(o=Tm(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?D8[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Qy,charCode:function(o){return o.type==="keypress"?Tm(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?Tm(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),k8=Ca(M8),L8=g({},Am,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),C2=Ca(L8),P8=g({},Pd,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Qy}),U8=Ca(P8),z8=g({},Bl,{propertyName:0,elapsedTime:0,pseudoElement:0}),F8=Ca(z8),H8=g({},Am,{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}),$8=Ca(H8),V8=g({},Bl,{newState:0,oldState:0}),G8=Ca(V8),B8=[9,13,27,32],Jy=zo&&"CompositionEvent"in window,zd=null;zo&&"documentMode"in document&&(zd=document.documentMode);var q8=zo&&"TextEvent"in window&&!zd,E2=zo&&(!Jy||zd&&8<zd&&11>=zd),w2=" ",R2=!1;function j2(o,l){switch(o){case"keyup":return B8.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function T2(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var tu=!1;function K8(o,l){switch(o){case"compositionend":return T2(l);case"keypress":return l.which!==32?null:(R2=!0,w2);case"textInput":return o=l.data,o===w2&&R2?null:o;default:return null}}function W8(o,l){if(tu)return o==="compositionend"||!Jy&&j2(o,l)?(o=y2(),jm=Wy=Di=null,tu=!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 E2&&l.locale!=="ko"?null:l.data;default:return null}}var Z8={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 _2(o){var l=o&&o.nodeName&&o.nodeName.toLowerCase();return l==="input"?!!Z8[o.type]:l==="textarea"}function N2(o,l,d,p){Jc?eu?eu.push(p):eu=[p]:Jc=p,l=vp(l,"onChange"),0<l.length&&(d=new Nm("onChange","change",null,d,p),o.push({event:d,listeners:l}))}var Fd=null,Hd=null;function Y8(o){dj(o,0)}function Dm(o){var l=Pr(o);if(u2(l))return o}function A2(o,l){if(o==="change")return l}var D2=!1;if(zo){var ev;if(zo){var tv="oninput"in document;if(!tv){var O2=document.createElement("div");O2.setAttribute("oninput","return;"),tv=typeof O2.oninput=="function"}ev=tv}else ev=!1;D2=ev&&(!document.documentMode||9<document.documentMode)}function I2(){Fd&&(Fd.detachEvent("onpropertychange",M2),Hd=Fd=null)}function M2(o){if(o.propertyName==="value"&&Dm(Hd)){var l=[];N2(l,Hd,o,By(o)),x2(Y8,l)}}function X8(o,l,d){o==="focusin"?(I2(),Fd=l,Hd=d,Fd.attachEvent("onpropertychange",M2)):o==="focusout"&&I2()}function Q8(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return Dm(Hd)}function J8(o,l){if(o==="click")return Dm(l)}function e9(o,l){if(o==="input"||o==="change")return Dm(l)}function t9(o,l){return o===l&&(o!==0||1/o===1/l)||o!==o&&l!==l}var za=typeof Object.is=="function"?Object.is:t9;function $d(o,l){if(za(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(!ke.call(l,b)||!za(o[b],l[b]))return!1}return!0}function k2(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function L2(o,l){var d=k2(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=k2(d)}}function P2(o,l){return o&&l?o===l?!0:o&&o.nodeType===3?!1:l&&l.nodeType===3?P2(o,l.parentNode):"contains"in o?o.contains(l):o.compareDocumentPosition?!!(o.compareDocumentPosition(l)&16):!1:!1}function U2(o){o=o!=null&&o.ownerDocument!=null&&o.ownerDocument.defaultView!=null?o.ownerDocument.defaultView:window;for(var l=wm(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=wm(o.document)}return l}function nv(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 n9=zo&&"documentMode"in document&&11>=document.documentMode,nu=null,rv=null,Vd=null,av=!1;function z2(o,l,d){var p=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;av||nu==null||nu!==wm(p)||(p=nu,"selectionStart"in p&&nv(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}),Vd&&$d(Vd,p)||(Vd=p,p=vp(rv,"onSelect"),0<p.length&&(l=new Nm("onSelect","select",null,l,d),o.push({event:l,listeners:p}),l.target=nu)))}function ql(o,l){var d={};return d[o.toLowerCase()]=l.toLowerCase(),d["Webkit"+o]="webkit"+l,d["Moz"+o]="moz"+l,d}var ru={animationend:ql("Animation","AnimationEnd"),animationiteration:ql("Animation","AnimationIteration"),animationstart:ql("Animation","AnimationStart"),transitionrun:ql("Transition","TransitionRun"),transitionstart:ql("Transition","TransitionStart"),transitioncancel:ql("Transition","TransitionCancel"),transitionend:ql("Transition","TransitionEnd")},sv={},F2={};zo&&(F2=document.createElement("div").style,"AnimationEvent"in window||(delete ru.animationend.animation,delete ru.animationiteration.animation,delete ru.animationstart.animation),"TransitionEvent"in window||delete ru.transitionend.transition);function Kl(o){if(sv[o])return sv[o];if(!ru[o])return o;var l=ru[o],d;for(d in l)if(l.hasOwnProperty(d)&&d in F2)return sv[o]=l[d];return o}var H2=Kl("animationend"),$2=Kl("animationiteration"),V2=Kl("animationstart"),r9=Kl("transitionrun"),a9=Kl("transitionstart"),s9=Kl("transitioncancel"),G2=Kl("transitionend"),B2=new Map,ov="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(" ");ov.push("scrollEnd");function Is(o,l){B2.set(o,l),Ds(l,[o])}var Om=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)},ds=[],au=0,iv=0;function Im(){for(var o=au,l=iv=au=0;l<o;){var d=ds[l];ds[l++]=null;var p=ds[l];ds[l++]=null;var b=ds[l];ds[l++]=null;var w=ds[l];if(ds[l++]=null,p!==null&&b!==null){var O=p.pending;O===null?b.next=b:(b.next=O.next,O.next=b),p.pending=b}w!==0&&q2(d,b,w)}}function Mm(o,l,d,p){ds[au++]=o,ds[au++]=l,ds[au++]=d,ds[au++]=p,iv|=p,o.lanes|=p,o=o.alternate,o!==null&&(o.lanes|=p)}function lv(o,l,d,p){return Mm(o,l,d,p),km(o)}function Wl(o,l){return Mm(o,null,null,l),km(o)}function q2(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-Vn(d),o=w.hiddenUpdates,p=o[b],p===null?o[b]=[l]:p.push(l),l.lane=d|536870912),w):null}function km(o){if(50<ff)throw ff=0,x0=null,Error(r(185));for(var l=o.return;l!==null;)o=l,l=o.return;return o.tag===3?o.stateNode:null}var su={};function o9(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 Fa(o,l,d,p){return new o9(o,l,d,p)}function cv(o){return o=o.prototype,!(!o||!o.isReactComponent)}function Fo(o,l){var d=o.alternate;return d===null?(d=Fa(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 K2(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 Lm(o,l,d,p,b,w){var O=0;if(p=o,typeof o=="function")cv(o)&&(O=1);else if(typeof o=="string")O=dL(o,d,K.current)?26:o==="html"||o==="head"||o==="body"?27:5;else e:switch(o){case G:return o=Fa(31,d,l,b),o.elementType=G,o.lanes=w,o;case S:return Zl(d.children,b,w,l);case E:O=8,b|=24;break;case j:return o=Fa(12,d,l,b|2),o.elementType=j,o.lanes=w,o;case A:return o=Fa(13,d,l,b),o.elementType=A,o.lanes=w,o;case I:return o=Fa(19,d,l,b),o.elementType=I,o.lanes=w,o;default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case T:O=10;break e;case R:O=9;break e;case N:O=11;break e;case _:O=14;break e;case M:O=16,p=null;break e}O=29,d=Error(r(130,o===null?"null":typeof o,"")),p=null}return l=Fa(O,d,l,b),l.elementType=o,l.type=p,l.lanes=w,l}function Zl(o,l,d,p){return o=Fa(7,o,p,l),o.lanes=d,o}function uv(o,l,d){return o=Fa(6,o,null,l),o.lanes=d,o}function W2(o){var l=Fa(18,null,null,0);return l.stateNode=o,l}function dv(o,l,d){return l=Fa(4,o.children!==null?o.children:[],o.key,l),l.lanes=d,l.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},l}var Z2=new WeakMap;function fs(o,l){if(typeof o=="object"&&o!==null){var d=Z2.get(o);return d!==void 0?d:(l={value:o,source:l,stack:gn(l)},Z2.set(o,l),l)}return{value:o,source:l,stack:gn(l)}}var ou=[],iu=0,Pm=null,Gd=0,hs=[],ms=0,Oi=null,ro=1,ao="";function Ho(o,l){ou[iu++]=Gd,ou[iu++]=Pm,Pm=o,Gd=l}function Y2(o,l,d){hs[ms++]=ro,hs[ms++]=ao,hs[ms++]=Oi,Oi=o;var p=ro;o=ao;var b=32-Vn(p)-1;p&=~(1<<b),d+=1;var w=32-Vn(l)+b;if(30<w){var O=b-b%5;w=(p&(1<<O)-1).toString(32),p>>=O,b-=O,ro=1<<32-Vn(l)+b|d<<b|p,ao=w+o}else ro=1<<w|d<<b|p,ao=o}function fv(o){o.return!==null&&(Ho(o,1),Y2(o,1,0))}function hv(o){for(;o===Pm;)Pm=ou[--iu],ou[iu]=null,Gd=ou[--iu],ou[iu]=null;for(;o===Oi;)Oi=hs[--ms],hs[ms]=null,ao=hs[--ms],hs[ms]=null,ro=hs[--ms],hs[ms]=null}function X2(o,l){hs[ms++]=ro,hs[ms++]=ao,hs[ms++]=Oi,ro=l.id,ao=l.overflow,Oi=o}var Vr=null,Pn=null,ln=!1,Ii=null,ps=!1,mv=Error(r(519));function Mi(o){var l=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Bd(fs(l,o)),mv}function Q2(o){var l=o.stateNode,d=o.type,p=o.memoizedProps;switch(l[Le]=o,l[Pe]=p,d){case"dialog":Zt("cancel",l),Zt("close",l);break;case"iframe":case"object":case"embed":Zt("load",l);break;case"video":case"audio":for(d=0;d<mf.length;d++)Zt(mf[d],l);break;case"source":Zt("error",l);break;case"img":case"image":case"link":Zt("error",l),Zt("load",l);break;case"details":Zt("toggle",l);break;case"input":Zt("invalid",l),d2(l,p.value,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name,!0);break;case"select":Zt("invalid",l);break;case"textarea":Zt("invalid",l),h2(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||pj(l.textContent,d)?(p.popover!=null&&(Zt("beforetoggle",l),Zt("toggle",l)),p.onScroll!=null&&Zt("scroll",l),p.onScrollEnd!=null&&Zt("scrollend",l),p.onClick!=null&&(l.onclick=Uo),l=!0):l=!1,l||Mi(o,!0)}function J2(o){for(Vr=o.return;Vr;)switch(Vr.tag){case 5:case 31:case 13:ps=!1;return;case 27:case 3:ps=!0;return;default:Vr=Vr.return}}function lu(o){if(o!==Vr)return!1;if(!ln)return J2(o),ln=!0,!1;var l=o.tag,d;if((d=l!==3&&l!==27)&&((d=l===5)&&(d=o.type,d=!(d!=="form"&&d!=="button")||O0(o.type,o.memoizedProps)),d=!d),d&&Pn&&Mi(o),J2(o),l===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));Pn=wj(o)}else if(l===31){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));Pn=wj(o)}else l===27?(l=Pn,Wi(o.type)?(o=P0,P0=null,Pn=o):Pn=l):Pn=Vr?xs(o.stateNode.nextSibling):null;return!0}function Yl(){Pn=Vr=null,ln=!1}function pv(){var o=Ii;return o!==null&&(ja===null?ja=o:ja.push.apply(ja,o),Ii=null),o}function Bd(o){Ii===null?Ii=[o]:Ii.push(o)}var gv=z(null),Xl=null,$o=null;function ki(o,l,d){P(gv,l._currentValue),l._currentValue=d}function Vo(o){o._currentValue=gv.current,$(gv)}function xv(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 yv(o,l,d,p){var b=o.child;for(b!==null&&(b.return=o);b!==null;){var w=b.dependencies;if(w!==null){var O=b.child;w=w.firstContext;e:for(;w!==null;){var k=w;w=b;for(var J=0;J<l.length;J++)if(k.context===l[J]){w.lanes|=d,k=w.alternate,k!==null&&(k.lanes|=d),xv(w.return,d,o),p||(O=null);break e}w=k.next}}else if(b.tag===18){if(O=b.return,O===null)throw Error(r(341));O.lanes|=d,w=O.alternate,w!==null&&(w.lanes|=d),xv(O,d,o),O=null}else O=b.child;if(O!==null)O.return=b;else for(O=b;O!==null;){if(O===o){O=null;break}if(b=O.sibling,b!==null){b.return=O.return,O=b;break}O=O.return}b=O}}function cu(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 O=b.alternate;if(O===null)throw Error(r(387));if(O=O.memoizedProps,O!==null){var k=b.type;za(b.pendingProps.value,O.value)||(o!==null?o.push(k):o=[k])}}else if(b===Q.current){if(O=b.alternate,O===null)throw Error(r(387));O.memoizedState.memoizedState!==b.memoizedState.memoizedState&&(o!==null?o.push(vf):o=[vf])}b=b.return}o!==null&&yv(l,o,d,p),l.flags|=262144}function Um(o){for(o=o.firstContext;o!==null;){if(!za(o.context._currentValue,o.memoizedValue))return!0;o=o.next}return!1}function Ql(o){Xl=o,$o=null,o=o.dependencies,o!==null&&(o.firstContext=null)}function Gr(o){return ew(Xl,o)}function zm(o,l){return Xl===null&&Ql(o),ew(o,l)}function ew(o,l){var d=l._currentValue;if(l={context:l,memoizedValue:d,next:null},$o===null){if(o===null)throw Error(r(308));$o=l,o.dependencies={lanes:0,firstContext:l},o.flags|=524288}else $o=$o.next=l;return d}var i9=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()})}},l9=e.unstable_scheduleCallback,c9=e.unstable_NormalPriority,hr={$$typeof:T,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function vv(){return{controller:new i9,data:new Map,refCount:0}}function qd(o){o.refCount--,o.refCount===0&&l9(c9,function(){o.controller.abort()})}var Kd=null,bv=0,uu=0,du=null;function u9(o,l){if(Kd===null){var d=Kd=[];bv=0,uu=E0(),du={status:"pending",value:void 0,then:function(p){d.push(p)}}}return bv++,l.then(tw,tw),l}function tw(){if(--bv===0&&Kd!==null){du!==null&&(du.status="fulfilled");var o=Kd;Kd=null,uu=0,du=null;for(var l=0;l<o.length;l++)(0,o[l])()}}function d9(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 nw=D.S;D.S=function(o,l){zR=Te(),typeof l=="object"&&l!==null&&typeof l.then=="function"&&u9(o,l),nw!==null&&nw(o,l)};var Jl=z(null);function Sv(){var o=Jl.current;return o!==null?o:Mn.pooledCache}function Fm(o,l){l===null?P(Jl,Jl.current):P(Jl,l.pool)}function rw(){var o=Sv();return o===null?null:{parent:hr._currentValue,pool:o}}var fu=Error(r(460)),Cv=Error(r(474)),Hm=Error(r(542)),$m={then:function(){}};function aw(o){return o=o.status,o==="fulfilled"||o==="rejected"}function sw(o,l,d){switch(d=o[d],d===void 0?o.push(l):d!==l&&(l.then(Uo,Uo),l=d),l.status){case"fulfilled":return l.value;case"rejected":throw o=l.reason,iw(o),o;default:if(typeof l.status=="string")l.then(Uo,Uo);else{if(o=Mn,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,iw(o),o}throw tc=l,fu}}function ec(o){try{var l=o._init;return l(o._payload)}catch(d){throw d!==null&&typeof d=="object"&&typeof d.then=="function"?(tc=d,fu):d}}var tc=null;function ow(){if(tc===null)throw Error(r(459));var o=tc;return tc=null,o}function iw(o){if(o===fu||o===Hm)throw Error(r(483))}var hu=null,Wd=0;function Vm(o){var l=Wd;return Wd+=1,hu===null&&(hu=[]),sw(hu,o,l)}function Zd(o,l){l=l.props.ref,o.ref=l!==void 0?l:null}function Gm(o,l){throw l.$$typeof===y?Error(r(525)):(o=Object.prototype.toString.call(l),Error(r(31,o==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":o)))}function lw(o){function l(ie,ne){if(o){var de=ie.deletions;de===null?(ie.deletions=[ne],ie.flags|=16):de.push(ne)}}function d(ie,ne){if(!o)return null;for(;ne!==null;)l(ie,ne),ne=ne.sibling;return null}function p(ie){for(var ne=new Map;ie!==null;)ie.key!==null?ne.set(ie.key,ie):ne.set(ie.index,ie),ie=ie.sibling;return ne}function b(ie,ne){return ie=Fo(ie,ne),ie.index=0,ie.sibling=null,ie}function w(ie,ne,de){return ie.index=de,o?(de=ie.alternate,de!==null?(de=de.index,de<ne?(ie.flags|=67108866,ne):de):(ie.flags|=67108866,ne)):(ie.flags|=1048576,ne)}function O(ie){return o&&ie.alternate===null&&(ie.flags|=67108866),ie}function k(ie,ne,de,Se){return ne===null||ne.tag!==6?(ne=uv(de,ie.mode,Se),ne.return=ie,ne):(ne=b(ne,de),ne.return=ie,ne)}function J(ie,ne,de,Se){var it=de.type;return it===S?ve(ie,ne,de.props.children,Se,de.key):ne!==null&&(ne.elementType===it||typeof it=="object"&&it!==null&&it.$$typeof===M&&ec(it)===ne.type)?(ne=b(ne,de.props),Zd(ne,de),ne.return=ie,ne):(ne=Lm(de.type,de.key,de.props,null,ie.mode,Se),Zd(ne,de),ne.return=ie,ne)}function fe(ie,ne,de,Se){return ne===null||ne.tag!==4||ne.stateNode.containerInfo!==de.containerInfo||ne.stateNode.implementation!==de.implementation?(ne=dv(de,ie.mode,Se),ne.return=ie,ne):(ne=b(ne,de.children||[]),ne.return=ie,ne)}function ve(ie,ne,de,Se,it){return ne===null||ne.tag!==7?(ne=Zl(de,ie.mode,Se,it),ne.return=ie,ne):(ne=b(ne,de),ne.return=ie,ne)}function Ee(ie,ne,de){if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return ne=uv(""+ne,ie.mode,de),ne.return=ie,ne;if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case v:return de=Lm(ne.type,ne.key,ne.props,null,ie.mode,de),Zd(de,ne),de.return=ie,de;case C:return ne=dv(ne,ie.mode,de),ne.return=ie,ne;case M:return ne=ec(ne),Ee(ie,ne,de)}if(V(ne)||q(ne))return ne=Zl(ne,ie.mode,de,null),ne.return=ie,ne;if(typeof ne.then=="function")return Ee(ie,Vm(ne),de);if(ne.$$typeof===T)return Ee(ie,zm(ie,ne),de);Gm(ie,ne)}return null}function me(ie,ne,de,Se){var it=ne!==null?ne.key:null;if(typeof de=="string"&&de!==""||typeof de=="number"||typeof de=="bigint")return it!==null?null:k(ie,ne,""+de,Se);if(typeof de=="object"&&de!==null){switch(de.$$typeof){case v:return de.key===it?J(ie,ne,de,Se):null;case C:return de.key===it?fe(ie,ne,de,Se):null;case M:return de=ec(de),me(ie,ne,de,Se)}if(V(de)||q(de))return it!==null?null:ve(ie,ne,de,Se,null);if(typeof de.then=="function")return me(ie,ne,Vm(de),Se);if(de.$$typeof===T)return me(ie,ne,zm(ie,de),Se);Gm(ie,de)}return null}function ye(ie,ne,de,Se,it){if(typeof Se=="string"&&Se!==""||typeof Se=="number"||typeof Se=="bigint")return ie=ie.get(de)||null,k(ne,ie,""+Se,it);if(typeof Se=="object"&&Se!==null){switch(Se.$$typeof){case v:return ie=ie.get(Se.key===null?de:Se.key)||null,J(ne,ie,Se,it);case C:return ie=ie.get(Se.key===null?de:Se.key)||null,fe(ne,ie,Se,it);case M:return Se=ec(Se),ye(ie,ne,de,Se,it)}if(V(Se)||q(Se))return ie=ie.get(de)||null,ve(ne,ie,Se,it,null);if(typeof Se.then=="function")return ye(ie,ne,de,Vm(Se),it);if(Se.$$typeof===T)return ye(ie,ne,de,zm(ne,Se),it);Gm(ne,Se)}return null}function We(ie,ne,de,Se){for(var it=null,xn=null,Je=ne,Pt=ne=0,Jt=null;Je!==null&&Pt<de.length;Pt++){Je.index>Pt?(Jt=Je,Je=null):Jt=Je.sibling;var yn=me(ie,Je,de[Pt],Se);if(yn===null){Je===null&&(Je=Jt);break}o&&Je&&yn.alternate===null&&l(ie,Je),ne=w(yn,ne,Pt),xn===null?it=yn:xn.sibling=yn,xn=yn,Je=Jt}if(Pt===de.length)return d(ie,Je),ln&&Ho(ie,Pt),it;if(Je===null){for(;Pt<de.length;Pt++)Je=Ee(ie,de[Pt],Se),Je!==null&&(ne=w(Je,ne,Pt),xn===null?it=Je:xn.sibling=Je,xn=Je);return ln&&Ho(ie,Pt),it}for(Je=p(Je);Pt<de.length;Pt++)Jt=ye(Je,ie,Pt,de[Pt],Se),Jt!==null&&(o&&Jt.alternate!==null&&Je.delete(Jt.key===null?Pt:Jt.key),ne=w(Jt,ne,Pt),xn===null?it=Jt:xn.sibling=Jt,xn=Jt);return o&&Je.forEach(function(Ji){return l(ie,Ji)}),ln&&Ho(ie,Pt),it}function ft(ie,ne,de,Se){if(de==null)throw Error(r(151));for(var it=null,xn=null,Je=ne,Pt=ne=0,Jt=null,yn=de.next();Je!==null&&!yn.done;Pt++,yn=de.next()){Je.index>Pt?(Jt=Je,Je=null):Jt=Je.sibling;var Ji=me(ie,Je,yn.value,Se);if(Ji===null){Je===null&&(Je=Jt);break}o&&Je&&Ji.alternate===null&&l(ie,Je),ne=w(Ji,ne,Pt),xn===null?it=Ji:xn.sibling=Ji,xn=Ji,Je=Jt}if(yn.done)return d(ie,Je),ln&&Ho(ie,Pt),it;if(Je===null){for(;!yn.done;Pt++,yn=de.next())yn=Ee(ie,yn.value,Se),yn!==null&&(ne=w(yn,ne,Pt),xn===null?it=yn:xn.sibling=yn,xn=yn);return ln&&Ho(ie,Pt),it}for(Je=p(Je);!yn.done;Pt++,yn=de.next())yn=ye(Je,ie,Pt,yn.value,Se),yn!==null&&(o&&yn.alternate!==null&&Je.delete(yn.key===null?Pt:yn.key),ne=w(yn,ne,Pt),xn===null?it=yn:xn.sibling=yn,xn=yn);return o&&Je.forEach(function(CL){return l(ie,CL)}),ln&&Ho(ie,Pt),it}function Dn(ie,ne,de,Se){if(typeof de=="object"&&de!==null&&de.type===S&&de.key===null&&(de=de.props.children),typeof de=="object"&&de!==null){switch(de.$$typeof){case v:e:{for(var it=de.key;ne!==null;){if(ne.key===it){if(it=de.type,it===S){if(ne.tag===7){d(ie,ne.sibling),Se=b(ne,de.props.children),Se.return=ie,ie=Se;break e}}else if(ne.elementType===it||typeof it=="object"&&it!==null&&it.$$typeof===M&&ec(it)===ne.type){d(ie,ne.sibling),Se=b(ne,de.props),Zd(Se,de),Se.return=ie,ie=Se;break e}d(ie,ne);break}else l(ie,ne);ne=ne.sibling}de.type===S?(Se=Zl(de.props.children,ie.mode,Se,de.key),Se.return=ie,ie=Se):(Se=Lm(de.type,de.key,de.props,null,ie.mode,Se),Zd(Se,de),Se.return=ie,ie=Se)}return O(ie);case C:e:{for(it=de.key;ne!==null;){if(ne.key===it)if(ne.tag===4&&ne.stateNode.containerInfo===de.containerInfo&&ne.stateNode.implementation===de.implementation){d(ie,ne.sibling),Se=b(ne,de.children||[]),Se.return=ie,ie=Se;break e}else{d(ie,ne);break}else l(ie,ne);ne=ne.sibling}Se=dv(de,ie.mode,Se),Se.return=ie,ie=Se}return O(ie);case M:return de=ec(de),Dn(ie,ne,de,Se)}if(V(de))return We(ie,ne,de,Se);if(q(de)){if(it=q(de),typeof it!="function")throw Error(r(150));return de=it.call(de),ft(ie,ne,de,Se)}if(typeof de.then=="function")return Dn(ie,ne,Vm(de),Se);if(de.$$typeof===T)return Dn(ie,ne,zm(ie,de),Se);Gm(ie,de)}return typeof de=="string"&&de!==""||typeof de=="number"||typeof de=="bigint"?(de=""+de,ne!==null&&ne.tag===6?(d(ie,ne.sibling),Se=b(ne,de),Se.return=ie,ie=Se):(d(ie,ne),Se=uv(de,ie.mode,Se),Se.return=ie,ie=Se),O(ie)):d(ie,ne)}return function(ie,ne,de,Se){try{Wd=0;var it=Dn(ie,ne,de,Se);return hu=null,it}catch(Je){if(Je===fu||Je===Hm)throw Je;var xn=Fa(29,Je,null,ie.mode);return xn.lanes=Se,xn.return=ie,xn}finally{}}}var nc=lw(!0),cw=lw(!1),Li=!1;function Ev(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function wv(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 Pi(o){return{lane:o,tag:0,payload:null,callback:null,next:null}}function Ui(o,l,d){var p=o.updateQueue;if(p===null)return null;if(p=p.shared,(Sn&2)!==0){var b=p.pending;return b===null?l.next=l:(l.next=b.next,b.next=l),p.pending=l,l=km(o),q2(o,null,d),l}return Mm(o,p,l,d),km(o)}function Yd(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,X(o,d)}}function Rv(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 O={lane:d.lane,tag:d.tag,payload:d.payload,callback:null,next:null};w===null?b=w=O:w=w.next=O,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 jv=!1;function Xd(){if(jv){var o=du;if(o!==null)throw o}}function Qd(o,l,d,p){jv=!1;var b=o.updateQueue;Li=!1;var w=b.firstBaseUpdate,O=b.lastBaseUpdate,k=b.shared.pending;if(k!==null){b.shared.pending=null;var J=k,fe=J.next;J.next=null,O===null?w=fe:O.next=fe,O=J;var ve=o.alternate;ve!==null&&(ve=ve.updateQueue,k=ve.lastBaseUpdate,k!==O&&(k===null?ve.firstBaseUpdate=fe:k.next=fe,ve.lastBaseUpdate=J))}if(w!==null){var Ee=b.baseState;O=0,ve=fe=J=null,k=w;do{var me=k.lane&-536870913,ye=me!==k.lane;if(ye?(Qt&me)===me:(p&me)===me){me!==0&&me===uu&&(jv=!0),ve!==null&&(ve=ve.next={lane:0,tag:k.tag,payload:k.payload,callback:null,next:null});e:{var We=o,ft=k;me=l;var Dn=d;switch(ft.tag){case 1:if(We=ft.payload,typeof We=="function"){Ee=We.call(Dn,Ee,me);break e}Ee=We;break e;case 3:We.flags=We.flags&-65537|128;case 0:if(We=ft.payload,me=typeof We=="function"?We.call(Dn,Ee,me):We,me==null)break e;Ee=g({},Ee,me);break e;case 2:Li=!0}}me=k.callback,me!==null&&(o.flags|=64,ye&&(o.flags|=8192),ye=b.callbacks,ye===null?b.callbacks=[me]:ye.push(me))}else ye={lane:me,tag:k.tag,payload:k.payload,callback:k.callback,next:null},ve===null?(fe=ve=ye,J=Ee):ve=ve.next=ye,O|=me;if(k=k.next,k===null){if(k=b.shared.pending,k===null)break;ye=k,k=ye.next,ye.next=null,b.lastBaseUpdate=ye,b.shared.pending=null}}while(!0);ve===null&&(J=Ee),b.baseState=J,b.firstBaseUpdate=fe,b.lastBaseUpdate=ve,w===null&&(b.shared.lanes=0),Vi|=O,o.lanes=O,o.memoizedState=Ee}}function uw(o,l){if(typeof o!="function")throw Error(r(191,o));o.call(l)}function dw(o,l){var d=o.callbacks;if(d!==null)for(o.callbacks=null,o=0;o<d.length;o++)uw(d[o],l)}var mu=z(null),Bm=z(0);function fw(o,l){o=Qo,P(Bm,o),P(mu,l),Qo=o|l.baseLanes}function Tv(){P(Bm,Qo),P(mu,mu.current)}function _v(){Qo=Bm.current,$(mu),$(Bm)}var Ha=z(null),gs=null;function zi(o){var l=o.alternate;P(lr,lr.current&1),P(Ha,o),gs===null&&(l===null||mu.current!==null||l.memoizedState!==null)&&(gs=o)}function Nv(o){P(lr,lr.current),P(Ha,o),gs===null&&(gs=o)}function hw(o){o.tag===22?(P(lr,lr.current),P(Ha,o),gs===null&&(gs=o)):Fi()}function Fi(){P(lr,lr.current),P(Ha,Ha.current)}function $a(o){$(Ha),gs===o&&(gs=null),$(lr)}var lr=z(0);function qm(o){for(var l=o;l!==null;){if(l.tag===13){var d=l.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||k0(d)||L0(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 Go=0,Mt=null,Nn=null,mr=null,Km=!1,pu=!1,rc=!1,Wm=0,Jd=0,gu=null,f9=0;function tr(){throw Error(r(321))}function Av(o,l){if(l===null)return!1;for(var d=0;d<l.length&&d<o.length;d++)if(!za(o[d],l[d]))return!1;return!0}function Dv(o,l,d,p,b,w){return Go=w,Mt=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,D.H=o===null||o.memoizedState===null?Yw:qv,rc=!1,w=d(p,b),rc=!1,pu&&(w=pw(l,d,p,b)),mw(o),w}function mw(o){D.H=nf;var l=Nn!==null&&Nn.next!==null;if(Go=0,mr=Nn=Mt=null,Km=!1,Jd=0,gu=null,l)throw Error(r(300));o===null||pr||(o=o.dependencies,o!==null&&Um(o)&&(pr=!0))}function pw(o,l,d,p){Mt=o;var b=0;do{if(pu&&(gu=null),Jd=0,pu=!1,25<=b)throw Error(r(301));if(b+=1,mr=Nn=null,o.updateQueue!=null){var w=o.updateQueue;w.lastEffect=null,w.events=null,w.stores=null,w.memoCache!=null&&(w.memoCache.index=0)}D.H=Xw,w=l(d,p)}while(pu);return w}function h9(){var o=D.H,l=o.useState()[0];return l=typeof l.then=="function"?ef(l):l,o=o.useState()[0],(Nn!==null?Nn.memoizedState:null)!==o&&(Mt.flags|=1024),l}function Ov(){var o=Wm!==0;return Wm=0,o}function Iv(o,l,d){l.updateQueue=o.updateQueue,l.flags&=-2053,o.lanes&=~d}function Mv(o){if(Km){for(o=o.memoizedState;o!==null;){var l=o.queue;l!==null&&(l.pending=null),o=o.next}Km=!1}Go=0,mr=Nn=Mt=null,pu=!1,Jd=Wm=0,gu=null}function da(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return mr===null?Mt.memoizedState=mr=o:mr=mr.next=o,mr}function cr(){if(Nn===null){var o=Mt.alternate;o=o!==null?o.memoizedState:null}else o=Nn.next;var l=mr===null?Mt.memoizedState:mr.next;if(l!==null)mr=l,Nn=o;else{if(o===null)throw Mt.alternate===null?Error(r(467)):Error(r(310));Nn=o,o={memoizedState:Nn.memoizedState,baseState:Nn.baseState,baseQueue:Nn.baseQueue,queue:Nn.queue,next:null},mr===null?Mt.memoizedState=mr=o:mr=mr.next=o}return mr}function Zm(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ef(o){var l=Jd;return Jd+=1,gu===null&&(gu=[]),o=sw(gu,o,l),l=Mt,(mr===null?l.memoizedState:mr.next)===null&&(l=l.alternate,D.H=l===null||l.memoizedState===null?Yw:qv),o}function Ym(o){if(o!==null&&typeof o=="object"){if(typeof o.then=="function")return ef(o);if(o.$$typeof===T)return Gr(o)}throw Error(r(438,String(o)))}function kv(o){var l=null,d=Mt.updateQueue;if(d!==null&&(l=d.memoCache),l==null){var p=Mt.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=Zm(),Mt.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]=H;return l.index++,d}function Bo(o,l){return typeof l=="function"?l(o):l}function Xm(o){var l=cr();return Lv(l,Nn,o)}function Lv(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 O=b.next;b.next=w.next,w.next=O}l.baseQueue=b=w,p.pending=null}if(w=o.baseState,b===null)o.memoizedState=w;else{l=b.next;var k=O=null,J=null,fe=l,ve=!1;do{var Ee=fe.lane&-536870913;if(Ee!==fe.lane?(Qt&Ee)===Ee:(Go&Ee)===Ee){var me=fe.revertLane;if(me===0)J!==null&&(J=J.next={lane:0,revertLane:0,gesture:null,action:fe.action,hasEagerState:fe.hasEagerState,eagerState:fe.eagerState,next:null}),Ee===uu&&(ve=!0);else if((Go&me)===me){fe=fe.next,me===uu&&(ve=!0);continue}else Ee={lane:0,revertLane:fe.revertLane,gesture:null,action:fe.action,hasEagerState:fe.hasEagerState,eagerState:fe.eagerState,next:null},J===null?(k=J=Ee,O=w):J=J.next=Ee,Mt.lanes|=me,Vi|=me;Ee=fe.action,rc&&d(w,Ee),w=fe.hasEagerState?fe.eagerState:d(w,Ee)}else me={lane:Ee,revertLane:fe.revertLane,gesture:fe.gesture,action:fe.action,hasEagerState:fe.hasEagerState,eagerState:fe.eagerState,next:null},J===null?(k=J=me,O=w):J=J.next=me,Mt.lanes|=Ee,Vi|=Ee;fe=fe.next}while(fe!==null&&fe!==l);if(J===null?O=w:J.next=k,!za(w,o.memoizedState)&&(pr=!0,ve&&(d=du,d!==null)))throw d;o.memoizedState=w,o.baseState=O,o.baseQueue=J,p.lastRenderedState=w}return b===null&&(p.lanes=0),[o.memoizedState,p.dispatch]}function Pv(o){var l=cr(),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 O=b=b.next;do w=o(w,O.action),O=O.next;while(O!==b);za(w,l.memoizedState)||(pr=!0),l.memoizedState=w,l.baseQueue===null&&(l.baseState=w),d.lastRenderedState=w}return[w,p]}function gw(o,l,d){var p=Mt,b=cr(),w=ln;if(w){if(d===void 0)throw Error(r(407));d=d()}else d=l();var O=!za((Nn||b).memoizedState,d);if(O&&(b.memoizedState=d,pr=!0),b=b.queue,Fv(vw.bind(null,p,b,o),[o]),b.getSnapshot!==l||O||mr!==null&&mr.memoizedState.tag&1){if(p.flags|=2048,xu(9,{destroy:void 0},yw.bind(null,p,b,d,l),null),Mn===null)throw Error(r(349));w||(Go&127)!==0||xw(p,l,d)}return d}function xw(o,l,d){o.flags|=16384,o={getSnapshot:l,value:d},l=Mt.updateQueue,l===null?(l=Zm(),Mt.updateQueue=l,l.stores=[o]):(d=l.stores,d===null?l.stores=[o]:d.push(o))}function yw(o,l,d,p){l.value=d,l.getSnapshot=p,bw(l)&&Sw(o)}function vw(o,l,d){return d(function(){bw(l)&&Sw(o)})}function bw(o){var l=o.getSnapshot;o=o.value;try{var d=l();return!za(o,d)}catch{return!0}}function Sw(o){var l=Wl(o,2);l!==null&&Ta(l,o,2)}function Uv(o){var l=da();if(typeof o=="function"){var d=o;if(o=d(),rc){Qn(!0);try{d()}finally{Qn(!1)}}}return l.memoizedState=l.baseState=o,l.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bo,lastRenderedState:o},l}function Cw(o,l,d,p){return o.baseState=d,Lv(o,Nn,typeof p=="function"?p:Bo)}function m9(o,l,d,p,b){if(ep(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(O){w.listeners.push(O)}};D.T!==null?d(!0):w.isTransition=!1,p(w),d=l.pending,d===null?(w.next=l.pending=w,Ew(l,w)):(w.next=d.next,l.pending=d.next=w)}}function Ew(o,l){var d=l.action,p=l.payload,b=o.state;if(l.isTransition){var w=D.T,O={};D.T=O;try{var k=d(b,p),J=D.S;J!==null&&J(O,k),ww(o,l,k)}catch(fe){zv(o,l,fe)}finally{w!==null&&O.types!==null&&(w.types=O.types),D.T=w}}else try{w=d(b,p),ww(o,l,w)}catch(fe){zv(o,l,fe)}}function ww(o,l,d){d!==null&&typeof d=="object"&&typeof d.then=="function"?d.then(function(p){Rw(o,l,p)},function(p){return zv(o,l,p)}):Rw(o,l,d)}function Rw(o,l,d){l.status="fulfilled",l.value=d,jw(l),o.state=d,l=o.pending,l!==null&&(d=l.next,d===l?o.pending=null:(d=d.next,l.next=d,Ew(o,d)))}function zv(o,l,d){var p=o.pending;if(o.pending=null,p!==null){p=p.next;do l.status="rejected",l.reason=d,jw(l),l=l.next;while(l!==p)}o.action=null}function jw(o){o=o.listeners;for(var l=0;l<o.length;l++)(0,o[l])()}function Tw(o,l){return l}function _w(o,l){if(ln){var d=Mn.formState;if(d!==null){e:{var p=Mt;if(ln){if(Pn){t:{for(var b=Pn,w=ps;b.nodeType!==8;){if(!w){b=null;break t}if(b=xs(b.nextSibling),b===null){b=null;break t}}w=b.data,b=w==="F!"||w==="F"?b:null}if(b){Pn=xs(b.nextSibling),p=b.data==="F!";break e}}Mi(p)}p=!1}p&&(l=d[0])}}return d=da(),d.memoizedState=d.baseState=l,p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Tw,lastRenderedState:l},d.queue=p,d=Kw.bind(null,Mt,p),p.dispatch=d,p=Uv(!1),w=Bv.bind(null,Mt,!1,p.queue),p=da(),b={state:l,dispatch:null,action:o,pending:null},p.queue=b,d=m9.bind(null,Mt,b,w,d),b.dispatch=d,p.memoizedState=o,[l,d,!1]}function Nw(o){var l=cr();return Aw(l,Nn,o)}function Aw(o,l,d){if(l=Lv(o,l,Tw)[0],o=Xm(Bo)[0],typeof l=="object"&&l!==null&&typeof l.then=="function")try{var p=ef(l)}catch(O){throw O===fu?Hm:O}else p=l;l=cr();var b=l.queue,w=b.dispatch;return d!==l.memoizedState&&(Mt.flags|=2048,xu(9,{destroy:void 0},p9.bind(null,b,d),null)),[p,w,o]}function p9(o,l){o.action=l}function Dw(o){var l=cr(),d=Nn;if(d!==null)return Aw(l,d,o);cr(),l=l.memoizedState,d=cr();var p=d.queue.dispatch;return d.memoizedState=o,[l,p,!1]}function xu(o,l,d,p){return o={tag:o,create:d,deps:p,inst:l,next:null},l=Mt.updateQueue,l===null&&(l=Zm(),Mt.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 Ow(){return cr().memoizedState}function Qm(o,l,d,p){var b=da();Mt.flags|=o,b.memoizedState=xu(1|l,{destroy:void 0},d,p===void 0?null:p)}function Jm(o,l,d,p){var b=cr();p=p===void 0?null:p;var w=b.memoizedState.inst;Nn!==null&&p!==null&&Av(p,Nn.memoizedState.deps)?b.memoizedState=xu(l,w,d,p):(Mt.flags|=o,b.memoizedState=xu(1|l,w,d,p))}function Iw(o,l){Qm(8390656,8,o,l)}function Fv(o,l){Jm(2048,8,o,l)}function g9(o){Mt.flags|=4;var l=Mt.updateQueue;if(l===null)l=Zm(),Mt.updateQueue=l,l.events=[o];else{var d=l.events;d===null?l.events=[o]:d.push(o)}}function Mw(o){var l=cr().memoizedState;return g9({ref:l,nextImpl:o}),function(){if((Sn&2)!==0)throw Error(r(440));return l.impl.apply(void 0,arguments)}}function kw(o,l){return Jm(4,2,o,l)}function Lw(o,l){return Jm(4,4,o,l)}function Pw(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 Uw(o,l,d){d=d!=null?d.concat([o]):null,Jm(4,4,Pw.bind(null,l,o),d)}function Hv(){}function zw(o,l){var d=cr();l=l===void 0?null:l;var p=d.memoizedState;return l!==null&&Av(l,p[1])?p[0]:(d.memoizedState=[o,l],o)}function Fw(o,l){var d=cr();l=l===void 0?null:l;var p=d.memoizedState;if(l!==null&&Av(l,p[1]))return p[0];if(p=o(),rc){Qn(!0);try{o()}finally{Qn(!1)}}return d.memoizedState=[p,l],p}function $v(o,l,d){return d===void 0||(Go&1073741824)!==0&&(Qt&261930)===0?o.memoizedState=l:(o.memoizedState=d,o=HR(),Mt.lanes|=o,Vi|=o,d)}function Hw(o,l,d,p){return za(d,l)?d:mu.current!==null?(o=$v(o,d,p),za(o,l)||(pr=!0),o):(Go&42)===0||(Go&1073741824)!==0&&(Qt&261930)===0?(pr=!0,o.memoizedState=d):(o=HR(),Mt.lanes|=o,Vi|=o,l)}function $w(o,l,d,p,b){var w=F.p;F.p=w!==0&&8>w?w:8;var O=D.T,k={};D.T=k,Bv(o,!1,l,d);try{var J=b(),fe=D.S;if(fe!==null&&fe(k,J),J!==null&&typeof J=="object"&&typeof J.then=="function"){var ve=d9(J,p);tf(o,l,ve,Ba(o))}else tf(o,l,p,Ba(o))}catch(Ee){tf(o,l,{then:function(){},status:"rejected",reason:Ee},Ba())}finally{F.p=w,O!==null&&k.types!==null&&(O.types=k.types),D.T=O}}function x9(){}function Vv(o,l,d,p){if(o.tag!==5)throw Error(r(476));var b=Vw(o).queue;$w(o,b,l,U,d===null?x9:function(){return Gw(o),d(p)})}function Vw(o){var l=o.memoizedState;if(l!==null)return l;l={memoizedState:U,baseState:U,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bo,lastRenderedState:U},next:null};var d={};return l.next={memoizedState:d,baseState:d,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bo,lastRenderedState:d},next:null},o.memoizedState=l,o=o.alternate,o!==null&&(o.memoizedState=l),l}function Gw(o){var l=Vw(o);l.next===null&&(l=o.alternate.memoizedState),tf(o,l.next.queue,{},Ba())}function Gv(){return Gr(vf)}function Bw(){return cr().memoizedState}function qw(){return cr().memoizedState}function y9(o){for(var l=o.return;l!==null;){switch(l.tag){case 24:case 3:var d=Ba();o=Pi(d);var p=Ui(l,o,d);p!==null&&(Ta(p,l,d),Yd(p,l,d)),l={cache:vv()},o.payload=l;return}l=l.return}}function v9(o,l,d){var p=Ba();d={lane:p,revertLane:0,gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},ep(o)?Ww(l,d):(d=lv(o,l,d,p),d!==null&&(Ta(d,o,p),Zw(d,l,p)))}function Kw(o,l,d){var p=Ba();tf(o,l,d,p)}function tf(o,l,d,p){var b={lane:p,revertLane:0,gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null};if(ep(o))Ww(l,b);else{var w=o.alternate;if(o.lanes===0&&(w===null||w.lanes===0)&&(w=l.lastRenderedReducer,w!==null))try{var O=l.lastRenderedState,k=w(O,d);if(b.hasEagerState=!0,b.eagerState=k,za(k,O))return Mm(o,l,b,0),Mn===null&&Im(),!1}catch{}finally{}if(d=lv(o,l,b,p),d!==null)return Ta(d,o,p),Zw(d,l,p),!0}return!1}function Bv(o,l,d,p){if(p={lane:2,revertLane:E0(),gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},ep(o)){if(l)throw Error(r(479))}else l=lv(o,d,p,2),l!==null&&Ta(l,o,2)}function ep(o){var l=o.alternate;return o===Mt||l!==null&&l===Mt}function Ww(o,l){pu=Km=!0;var d=o.pending;d===null?l.next=l:(l.next=d.next,d.next=l),o.pending=l}function Zw(o,l,d){if((d&4194048)!==0){var p=l.lanes;p&=o.pendingLanes,d|=p,l.lanes=d,X(o,d)}}var nf={readContext:Gr,use:Ym,useCallback:tr,useContext:tr,useEffect:tr,useImperativeHandle:tr,useLayoutEffect:tr,useInsertionEffect:tr,useMemo:tr,useReducer:tr,useRef:tr,useState:tr,useDebugValue:tr,useDeferredValue:tr,useTransition:tr,useSyncExternalStore:tr,useId:tr,useHostTransitionStatus:tr,useFormState:tr,useActionState:tr,useOptimistic:tr,useMemoCache:tr,useCacheRefresh:tr};nf.useEffectEvent=tr;var Yw={readContext:Gr,use:Ym,useCallback:function(o,l){return da().memoizedState=[o,l===void 0?null:l],o},useContext:Gr,useEffect:Iw,useImperativeHandle:function(o,l,d){d=d!=null?d.concat([o]):null,Qm(4194308,4,Pw.bind(null,l,o),d)},useLayoutEffect:function(o,l){return Qm(4194308,4,o,l)},useInsertionEffect:function(o,l){Qm(4,2,o,l)},useMemo:function(o,l){var d=da();l=l===void 0?null:l;var p=o();if(rc){Qn(!0);try{o()}finally{Qn(!1)}}return d.memoizedState=[p,l],p},useReducer:function(o,l,d){var p=da();if(d!==void 0){var b=d(l);if(rc){Qn(!0);try{d(l)}finally{Qn(!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=v9.bind(null,Mt,o),[p.memoizedState,o]},useRef:function(o){var l=da();return o={current:o},l.memoizedState=o},useState:function(o){o=Uv(o);var l=o.queue,d=Kw.bind(null,Mt,l);return l.dispatch=d,[o.memoizedState,d]},useDebugValue:Hv,useDeferredValue:function(o,l){var d=da();return $v(d,o,l)},useTransition:function(){var o=Uv(!1);return o=$w.bind(null,Mt,o.queue,!0,!1),da().memoizedState=o,[!1,o]},useSyncExternalStore:function(o,l,d){var p=Mt,b=da();if(ln){if(d===void 0)throw Error(r(407));d=d()}else{if(d=l(),Mn===null)throw Error(r(349));(Qt&127)!==0||xw(p,l,d)}b.memoizedState=d;var w={value:d,getSnapshot:l};return b.queue=w,Iw(vw.bind(null,p,w,o),[o]),p.flags|=2048,xu(9,{destroy:void 0},yw.bind(null,p,w,d,l),null),d},useId:function(){var o=da(),l=Mn.identifierPrefix;if(ln){var d=ao,p=ro;d=(p&~(1<<32-Vn(p)-1)).toString(32)+d,l="_"+l+"R_"+d,d=Wm++,0<d&&(l+="H"+d.toString(32)),l+="_"}else d=f9++,l="_"+l+"r_"+d.toString(32)+"_";return o.memoizedState=l},useHostTransitionStatus:Gv,useFormState:_w,useActionState:_w,useOptimistic:function(o){var l=da();l.memoizedState=l.baseState=o;var d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return l.queue=d,l=Bv.bind(null,Mt,!0,d),d.dispatch=l,[o,l]},useMemoCache:kv,useCacheRefresh:function(){return da().memoizedState=y9.bind(null,Mt)},useEffectEvent:function(o){var l=da(),d={impl:o};return l.memoizedState=d,function(){if((Sn&2)!==0)throw Error(r(440));return d.impl.apply(void 0,arguments)}}},qv={readContext:Gr,use:Ym,useCallback:zw,useContext:Gr,useEffect:Fv,useImperativeHandle:Uw,useInsertionEffect:kw,useLayoutEffect:Lw,useMemo:Fw,useReducer:Xm,useRef:Ow,useState:function(){return Xm(Bo)},useDebugValue:Hv,useDeferredValue:function(o,l){var d=cr();return Hw(d,Nn.memoizedState,o,l)},useTransition:function(){var o=Xm(Bo)[0],l=cr().memoizedState;return[typeof o=="boolean"?o:ef(o),l]},useSyncExternalStore:gw,useId:Bw,useHostTransitionStatus:Gv,useFormState:Nw,useActionState:Nw,useOptimistic:function(o,l){var d=cr();return Cw(d,Nn,o,l)},useMemoCache:kv,useCacheRefresh:qw};qv.useEffectEvent=Mw;var Xw={readContext:Gr,use:Ym,useCallback:zw,useContext:Gr,useEffect:Fv,useImperativeHandle:Uw,useInsertionEffect:kw,useLayoutEffect:Lw,useMemo:Fw,useReducer:Pv,useRef:Ow,useState:function(){return Pv(Bo)},useDebugValue:Hv,useDeferredValue:function(o,l){var d=cr();return Nn===null?$v(d,o,l):Hw(d,Nn.memoizedState,o,l)},useTransition:function(){var o=Pv(Bo)[0],l=cr().memoizedState;return[typeof o=="boolean"?o:ef(o),l]},useSyncExternalStore:gw,useId:Bw,useHostTransitionStatus:Gv,useFormState:Dw,useActionState:Dw,useOptimistic:function(o,l){var d=cr();return Nn!==null?Cw(d,Nn,o,l):(d.baseState=o,[o,d.queue.dispatch])},useMemoCache:kv,useCacheRefresh:qw};Xw.useEffectEvent=Mw;function Kv(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 Wv={enqueueSetState:function(o,l,d){o=o._reactInternals;var p=Ba(),b=Pi(p);b.payload=l,d!=null&&(b.callback=d),l=Ui(o,b,p),l!==null&&(Ta(l,o,p),Yd(l,o,p))},enqueueReplaceState:function(o,l,d){o=o._reactInternals;var p=Ba(),b=Pi(p);b.tag=1,b.payload=l,d!=null&&(b.callback=d),l=Ui(o,b,p),l!==null&&(Ta(l,o,p),Yd(l,o,p))},enqueueForceUpdate:function(o,l){o=o._reactInternals;var d=Ba(),p=Pi(d);p.tag=2,l!=null&&(p.callback=l),l=Ui(o,p,d),l!==null&&(Ta(l,o,d),Yd(l,o,d))}};function Qw(o,l,d,p,b,w,O){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(p,w,O):l.prototype&&l.prototype.isPureReactComponent?!$d(d,p)||!$d(b,w):!0}function Jw(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&&Wv.enqueueReplaceState(l,l.state,null)}function ac(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 eR(o){Om(o)}function tR(o){console.error(o)}function nR(o){Om(o)}function tp(o,l){try{var d=o.onUncaughtError;d(l.value,{componentStack:l.stack})}catch(p){setTimeout(function(){throw p})}}function rR(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 Zv(o,l,d){return d=Pi(d),d.tag=3,d.payload={element:null},d.callback=function(){tp(o,l)},d}function aR(o){return o=Pi(o),o.tag=3,o}function sR(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(){rR(l,d,p)}}var O=d.stateNode;O!==null&&typeof O.componentDidCatch=="function"&&(o.callback=function(){rR(l,d,p),typeof b!="function"&&(Gi===null?Gi=new Set([this]):Gi.add(this));var k=p.stack;this.componentDidCatch(p.value,{componentStack:k!==null?k:""})})}function b9(o,l,d,p,b){if(d.flags|=32768,p!==null&&typeof p=="object"&&typeof p.then=="function"){if(l=d.alternate,l!==null&&cu(l,d,b,!0),d=Ha.current,d!==null){switch(d.tag){case 31:case 13:return gs===null?hp():d.alternate===null&&nr===0&&(nr=3),d.flags&=-257,d.flags|=65536,d.lanes=b,p===$m?d.flags|=16384:(l=d.updateQueue,l===null?d.updateQueue=new Set([p]):l.add(p),b0(o,p,b)),!1;case 22:return d.flags|=65536,p===$m?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)),b0(o,p,b)),!1}throw Error(r(435,d.tag))}return b0(o,p,b),hp(),!1}if(ln)return l=Ha.current,l!==null?((l.flags&65536)===0&&(l.flags|=256),l.flags|=65536,l.lanes=b,p!==mv&&(o=Error(r(422),{cause:p}),Bd(fs(o,d)))):(p!==mv&&(l=Error(r(423),{cause:p}),Bd(fs(l,d))),o=o.current.alternate,o.flags|=65536,b&=-b,o.lanes|=b,p=fs(p,d),b=Zv(o.stateNode,p,b),Rv(o,b),nr!==4&&(nr=2)),!1;var w=Error(r(520),{cause:p});if(w=fs(w,d),df===null?df=[w]:df.push(w),nr!==4&&(nr=2),l===null)return!0;p=fs(p,d),d=l;do{switch(d.tag){case 3:return d.flags|=65536,o=b&-b,d.lanes|=o,o=Zv(d.stateNode,p,o),Rv(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"&&(Gi===null||!Gi.has(w))))return d.flags|=65536,b&=-b,d.lanes|=b,b=aR(b),sR(b,o,d,p),Rv(d,b),!1}d=d.return}while(d!==null);return!1}var Yv=Error(r(461)),pr=!1;function Br(o,l,d,p){l.child=o===null?cw(l,null,d,p):nc(l,o.child,d,p)}function oR(o,l,d,p,b){d=d.render;var w=l.ref;if("ref"in p){var O={};for(var k in p)k!=="ref"&&(O[k]=p[k])}else O=p;return Ql(l),p=Dv(o,l,d,O,w,b),k=Ov(),o!==null&&!pr?(Iv(o,l,b),qo(o,l,b)):(ln&&k&&fv(l),l.flags|=1,Br(o,l,p,b),l.child)}function iR(o,l,d,p,b){if(o===null){var w=d.type;return typeof w=="function"&&!cv(w)&&w.defaultProps===void 0&&d.compare===null?(l.tag=15,l.type=w,lR(o,l,w,p,b)):(o=Lm(d.type,null,p,l,l.mode,b),o.ref=l.ref,o.return=l,l.child=o)}if(w=o.child,!a0(o,b)){var O=w.memoizedProps;if(d=d.compare,d=d!==null?d:$d,d(O,p)&&o.ref===l.ref)return qo(o,l,b)}return l.flags|=1,o=Fo(w,p),o.ref=l.ref,o.return=l,l.child=o}function lR(o,l,d,p,b){if(o!==null){var w=o.memoizedProps;if($d(w,p)&&o.ref===l.ref)if(pr=!1,l.pendingProps=p=w,a0(o,b))(o.flags&131072)!==0&&(pr=!0);else return l.lanes=o.lanes,qo(o,l,b)}return Xv(o,l,d,p,b)}function cR(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 uR(o,l,w,d,p)}if((d&536870912)!==0)l.memoizedState={baseLanes:0,cachePool:null},o!==null&&Fm(l,w!==null?w.cachePool:null),w!==null?fw(l,w):Tv(),hw(l);else return p=l.lanes=536870912,uR(o,l,w!==null?w.baseLanes|d:d,d,p)}else w!==null?(Fm(l,w.cachePool),fw(l,w),Fi(),l.memoizedState=null):(o!==null&&Fm(l,null),Tv(),Fi());return Br(o,l,b,d),l.child}function rf(o,l){return o!==null&&o.tag===22||l.stateNode!==null||(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.sibling}function uR(o,l,d,p,b){var w=Sv();return w=w===null?null:{parent:hr._currentValue,pool:w},l.memoizedState={baseLanes:d,cachePool:w},o!==null&&Fm(l,null),Tv(),hw(l),o!==null&&cu(o,l,p,!0),l.childLanes=b,null}function np(o,l){return l=ap({mode:l.mode,children:l.children},o.mode),l.ref=o.ref,o.child=l,l.return=o,l}function dR(o,l,d){return nc(l,o.child,null,d),o=np(l,l.pendingProps),o.flags|=2,$a(l),l.memoizedState=null,o}function S9(o,l,d){var p=l.pendingProps,b=(l.flags&128)!==0;if(l.flags&=-129,o===null){if(ln){if(p.mode==="hidden")return o=np(l,p),l.lanes=536870912,rf(null,o);if(Nv(l),(o=Pn)?(o=Ej(o,ps),o=o!==null&&o.data==="&"?o:null,o!==null&&(l.memoizedState={dehydrated:o,treeContext:Oi!==null?{id:ro,overflow:ao}:null,retryLane:536870912,hydrationErrors:null},d=W2(o),d.return=l,l.child=d,Vr=l,Pn=null)):o=null,o===null)throw Mi(l);return l.lanes=536870912,null}return np(l,p)}var w=o.memoizedState;if(w!==null){var O=w.dehydrated;if(Nv(l),b)if(l.flags&256)l.flags&=-257,l=dR(o,l,d);else if(l.memoizedState!==null)l.child=o.child,l.flags|=128,l=null;else throw Error(r(558));else if(pr||cu(o,l,d,!1),b=(d&o.childLanes)!==0,pr||b){if(p=Mn,p!==null&&(O=te(p,d),O!==0&&O!==w.retryLane))throw w.retryLane=O,Wl(o,O),Ta(p,o,O),Yv;hp(),l=dR(o,l,d)}else o=w.treeContext,Pn=xs(O.nextSibling),Vr=l,ln=!0,Ii=null,ps=!1,o!==null&&X2(l,o),l=np(l,p),l.flags|=4096;return l}return o=Fo(o.child,{mode:p.mode,children:p.children}),o.ref=l.ref,l.child=o,o.return=l,o}function rp(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 Xv(o,l,d,p,b){return Ql(l),d=Dv(o,l,d,p,void 0,b),p=Ov(),o!==null&&!pr?(Iv(o,l,b),qo(o,l,b)):(ln&&p&&fv(l),l.flags|=1,Br(o,l,d,b),l.child)}function fR(o,l,d,p,b,w){return Ql(l),l.updateQueue=null,d=pw(l,p,d,b),mw(o),p=Ov(),o!==null&&!pr?(Iv(o,l,w),qo(o,l,w)):(ln&&p&&fv(l),l.flags|=1,Br(o,l,d,w),l.child)}function hR(o,l,d,p,b){if(Ql(l),l.stateNode===null){var w=su,O=d.contextType;typeof O=="object"&&O!==null&&(w=Gr(O)),w=new d(p,w),l.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,w.updater=Wv,l.stateNode=w,w._reactInternals=l,w=l.stateNode,w.props=p,w.state=l.memoizedState,w.refs={},Ev(l),O=d.contextType,w.context=typeof O=="object"&&O!==null?Gr(O):su,w.state=l.memoizedState,O=d.getDerivedStateFromProps,typeof O=="function"&&(Kv(l,d,O,p),w.state=l.memoizedState),typeof d.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(O=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),O!==w.state&&Wv.enqueueReplaceState(w,w.state,null),Qd(l,p,w,b),Xd(),w.state=l.memoizedState),typeof w.componentDidMount=="function"&&(l.flags|=4194308),p=!0}else if(o===null){w=l.stateNode;var k=l.memoizedProps,J=ac(d,k);w.props=J;var fe=w.context,ve=d.contextType;O=su,typeof ve=="object"&&ve!==null&&(O=Gr(ve));var Ee=d.getDerivedStateFromProps;ve=typeof Ee=="function"||typeof w.getSnapshotBeforeUpdate=="function",k=l.pendingProps!==k,ve||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(k||fe!==O)&&Jw(l,w,p,O),Li=!1;var me=l.memoizedState;w.state=me,Qd(l,p,w,b),Xd(),fe=l.memoizedState,k||me!==fe||Li?(typeof Ee=="function"&&(Kv(l,d,Ee,p),fe=l.memoizedState),(J=Li||Qw(l,d,J,p,me,fe,O))?(ve||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=fe),w.props=p,w.state=fe,w.context=O,p=J):(typeof w.componentDidMount=="function"&&(l.flags|=4194308),p=!1)}else{w=l.stateNode,wv(o,l),O=l.memoizedProps,ve=ac(d,O),w.props=ve,Ee=l.pendingProps,me=w.context,fe=d.contextType,J=su,typeof fe=="object"&&fe!==null&&(J=Gr(fe)),k=d.getDerivedStateFromProps,(fe=typeof k=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(O!==Ee||me!==J)&&Jw(l,w,p,J),Li=!1,me=l.memoizedState,w.state=me,Qd(l,p,w,b),Xd();var ye=l.memoizedState;O!==Ee||me!==ye||Li||o!==null&&o.dependencies!==null&&Um(o.dependencies)?(typeof k=="function"&&(Kv(l,d,k,p),ye=l.memoizedState),(ve=Li||Qw(l,d,ve,p,me,ye,J)||o!==null&&o.dependencies!==null&&Um(o.dependencies))?(fe||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(p,ye,J),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(p,ye,J)),typeof w.componentDidUpdate=="function"&&(l.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof w.componentDidUpdate!="function"||O===o.memoizedProps&&me===o.memoizedState||(l.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||O===o.memoizedProps&&me===o.memoizedState||(l.flags|=1024),l.memoizedProps=p,l.memoizedState=ye),w.props=p,w.state=ye,w.context=J,p=ve):(typeof w.componentDidUpdate!="function"||O===o.memoizedProps&&me===o.memoizedState||(l.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||O===o.memoizedProps&&me===o.memoizedState||(l.flags|=1024),p=!1)}return w=p,rp(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=nc(l,o.child,null,b),l.child=nc(l,null,d,b)):Br(o,l,d,b),l.memoizedState=w.state,o=l.child):o=qo(o,l,b),o}function mR(o,l,d,p){return Yl(),l.flags|=256,Br(o,l,d,p),l.child}var Qv={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Jv(o){return{baseLanes:o,cachePool:rw()}}function e0(o,l,d){return o=o!==null?o.childLanes&~d:0,l&&(o|=Ga),o}function pR(o,l,d){var p=l.pendingProps,b=!1,w=(l.flags&128)!==0,O;if((O=w)||(O=o!==null&&o.memoizedState===null?!1:(lr.current&2)!==0),O&&(b=!0,l.flags&=-129),O=(l.flags&32)!==0,l.flags&=-33,o===null){if(ln){if(b?zi(l):Fi(),(o=Pn)?(o=Ej(o,ps),o=o!==null&&o.data!=="&"?o:null,o!==null&&(l.memoizedState={dehydrated:o,treeContext:Oi!==null?{id:ro,overflow:ao}:null,retryLane:536870912,hydrationErrors:null},d=W2(o),d.return=l,l.child=d,Vr=l,Pn=null)):o=null,o===null)throw Mi(l);return L0(o)?l.lanes=32:l.lanes=536870912,null}var k=p.children;return p=p.fallback,b?(Fi(),b=l.mode,k=ap({mode:"hidden",children:k},b),p=Zl(p,b,d,null),k.return=l,p.return=l,k.sibling=p,l.child=k,p=l.child,p.memoizedState=Jv(d),p.childLanes=e0(o,O,d),l.memoizedState=Qv,rf(null,p)):(zi(l),t0(l,k))}var J=o.memoizedState;if(J!==null&&(k=J.dehydrated,k!==null)){if(w)l.flags&256?(zi(l),l.flags&=-257,l=n0(o,l,d)):l.memoizedState!==null?(Fi(),l.child=o.child,l.flags|=128,l=null):(Fi(),k=p.fallback,b=l.mode,p=ap({mode:"visible",children:p.children},b),k=Zl(k,b,d,null),k.flags|=2,p.return=l,k.return=l,p.sibling=k,l.child=p,nc(l,o.child,null,d),p=l.child,p.memoizedState=Jv(d),p.childLanes=e0(o,O,d),l.memoizedState=Qv,l=rf(null,p));else if(zi(l),L0(k)){if(O=k.nextSibling&&k.nextSibling.dataset,O)var fe=O.dgst;O=fe,p=Error(r(419)),p.stack="",p.digest=O,Bd({value:p,source:null,stack:null}),l=n0(o,l,d)}else if(pr||cu(o,l,d,!1),O=(d&o.childLanes)!==0,pr||O){if(O=Mn,O!==null&&(p=te(O,d),p!==0&&p!==J.retryLane))throw J.retryLane=p,Wl(o,p),Ta(O,o,p),Yv;k0(k)||hp(),l=n0(o,l,d)}else k0(k)?(l.flags|=192,l.child=o.child,l=null):(o=J.treeContext,Pn=xs(k.nextSibling),Vr=l,ln=!0,Ii=null,ps=!1,o!==null&&X2(l,o),l=t0(l,p.children),l.flags|=4096);return l}return b?(Fi(),k=p.fallback,b=l.mode,J=o.child,fe=J.sibling,p=Fo(J,{mode:"hidden",children:p.children}),p.subtreeFlags=J.subtreeFlags&65011712,fe!==null?k=Fo(fe,k):(k=Zl(k,b,d,null),k.flags|=2),k.return=l,p.return=l,p.sibling=k,l.child=p,rf(null,p),p=l.child,k=o.child.memoizedState,k===null?k=Jv(d):(b=k.cachePool,b!==null?(J=hr._currentValue,b=b.parent!==J?{parent:J,pool:J}:b):b=rw(),k={baseLanes:k.baseLanes|d,cachePool:b}),p.memoizedState=k,p.childLanes=e0(o,O,d),l.memoizedState=Qv,rf(o.child,p)):(zi(l),d=o.child,o=d.sibling,d=Fo(d,{mode:"visible",children:p.children}),d.return=l,d.sibling=null,o!==null&&(O=l.deletions,O===null?(l.deletions=[o],l.flags|=16):O.push(o)),l.child=d,l.memoizedState=null,d)}function t0(o,l){return l=ap({mode:"visible",children:l},o.mode),l.return=o,o.child=l}function ap(o,l){return o=Fa(22,o,null,l),o.lanes=0,o}function n0(o,l,d){return nc(l,o.child,null,d),o=t0(l,l.pendingProps.children),o.flags|=2,l.memoizedState=null,o}function gR(o,l,d){o.lanes|=l;var p=o.alternate;p!==null&&(p.lanes|=l),xv(o.return,l,d)}function r0(o,l,d,p,b,w){var O=o.memoizedState;O===null?o.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:p,tail:d,tailMode:b,treeForkCount:w}:(O.isBackwards=l,O.rendering=null,O.renderingStartTime=0,O.last=p,O.tail=d,O.tailMode=b,O.treeForkCount=w)}function xR(o,l,d){var p=l.pendingProps,b=p.revealOrder,w=p.tail;p=p.children;var O=lr.current,k=(O&2)!==0;if(k?(O=O&1|2,l.flags|=128):O&=1,P(lr,O),Br(o,l,p,d),p=ln?Gd:0,!k&&o!==null&&(o.flags&128)!==0)e:for(o=l.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&gR(o,d,l);else if(o.tag===19)gR(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&&qm(o)===null&&(b=d),d=d.sibling;d=b,d===null?(b=l.child,l.child=null):(b=d.sibling,d.sibling=null),r0(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&&qm(o)===null){l.child=b;break}o=b.sibling,b.sibling=d,d=b,b=o}r0(l,!0,d,null,w,p);break;case"together":r0(l,!1,null,null,void 0,p);break;default:l.memoizedState=null}return l.child}function qo(o,l,d){if(o!==null&&(l.dependencies=o.dependencies),Vi|=l.lanes,(d&l.childLanes)===0)if(o!==null){if(cu(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=Fo(o,o.pendingProps),l.child=d,d.return=l;o.sibling!==null;)o=o.sibling,d=d.sibling=Fo(o,o.pendingProps),d.return=l;d.sibling=null}return l.child}function a0(o,l){return(o.lanes&l)!==0?!0:(o=o.dependencies,!!(o!==null&&Um(o)))}function C9(o,l,d){switch(l.tag){case 3:le(l,l.stateNode.containerInfo),ki(l,hr,o.memoizedState.cache),Yl();break;case 27:case 5:be(l);break;case 4:le(l,l.stateNode.containerInfo);break;case 10:ki(l,l.type,l.memoizedProps.value);break;case 31:if(l.memoizedState!==null)return l.flags|=128,Nv(l),null;break;case 13:var p=l.memoizedState;if(p!==null)return p.dehydrated!==null?(zi(l),l.flags|=128,null):(d&l.child.childLanes)!==0?pR(o,l,d):(zi(l),o=qo(o,l,d),o!==null?o.sibling:null);zi(l);break;case 19:var b=(o.flags&128)!==0;if(p=(d&l.childLanes)!==0,p||(cu(o,l,d,!1),p=(d&l.childLanes)!==0),b){if(p)return xR(o,l,d);l.flags|=128}if(b=l.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),P(lr,lr.current),p)break;return null;case 22:return l.lanes=0,cR(o,l,d,l.pendingProps);case 24:ki(l,hr,o.memoizedState.cache)}return qo(o,l,d)}function yR(o,l,d){if(o!==null)if(o.memoizedProps!==l.pendingProps)pr=!0;else{if(!a0(o,d)&&(l.flags&128)===0)return pr=!1,C9(o,l,d);pr=(o.flags&131072)!==0}else pr=!1,ln&&(l.flags&1048576)!==0&&Y2(l,Gd,l.index);switch(l.lanes=0,l.tag){case 16:e:{var p=l.pendingProps;if(o=ec(l.elementType),l.type=o,typeof o=="function")cv(o)?(p=ac(o,p),l.tag=1,l=hR(null,l,o,p,d)):(l.tag=0,l=Xv(null,l,o,p,d));else{if(o!=null){var b=o.$$typeof;if(b===N){l.tag=11,l=oR(null,l,o,p,d);break e}else if(b===_){l.tag=14,l=iR(null,l,o,p,d);break e}}throw l=B(o)||o,Error(r(306,l,""))}}return l;case 0:return Xv(o,l,l.type,l.pendingProps,d);case 1:return p=l.type,b=ac(p,l.pendingProps),hR(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,wv(o,l),Qd(l,p,null,d);var O=l.memoizedState;if(p=O.cache,ki(l,hr,p),p!==w.cache&&yv(l,[hr],d,!0),Xd(),p=O.element,w.isDehydrated)if(w={element:p,isDehydrated:!1,cache:O.cache},l.updateQueue.baseState=w,l.memoizedState=w,l.flags&256){l=mR(o,l,p,d);break e}else if(p!==b){b=fs(Error(r(424)),l),Bd(b),l=mR(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=xs(o.firstChild),Vr=l,ln=!0,Ii=null,ps=!0,d=cw(l,null,p,d),l.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling}else{if(Yl(),p===b){l=qo(o,l,d);break e}Br(o,l,p,d)}l=l.child}return l;case 26:return rp(o,l),o===null?(d=Nj(l.type,null,l.pendingProps,null))?l.memoizedState=d:ln||(d=l.type,o=l.pendingProps,p=bp(se.current).createElement(d),p[Le]=l,p[Pe]=o,qr(p,d,o),Bn(p),l.stateNode=p):l.memoizedState=Nj(l.type,o.memoizedProps,l.pendingProps,o.memoizedState),null;case 27:return be(l),o===null&&ln&&(p=l.stateNode=jj(l.type,l.pendingProps,se.current),Vr=l,ps=!0,b=Pn,Wi(l.type)?(P0=b,Pn=xs(p.firstChild)):Pn=b),Br(o,l,l.pendingProps.children,d),rp(o,l),o===null&&(l.flags|=4194304),l.child;case 5:return o===null&&ln&&((b=p=Pn)&&(p=Q9(p,l.type,l.pendingProps,ps),p!==null?(l.stateNode=p,Vr=l,Pn=xs(p.firstChild),ps=!1,b=!0):b=!1),b||Mi(l)),be(l),b=l.type,w=l.pendingProps,O=o!==null?o.memoizedProps:null,p=w.children,O0(b,w)?p=null:O!==null&&O0(b,O)&&(l.flags|=32),l.memoizedState!==null&&(b=Dv(o,l,h9,null,null,d),vf._currentValue=b),rp(o,l),Br(o,l,p,d),l.child;case 6:return o===null&&ln&&((o=d=Pn)&&(d=J9(d,l.pendingProps,ps),d!==null?(l.stateNode=d,Vr=l,Pn=null,o=!0):o=!1),o||Mi(l)),null;case 13:return pR(o,l,d);case 4:return le(l,l.stateNode.containerInfo),p=l.pendingProps,o===null?l.child=nc(l,null,p,d):Br(o,l,p,d),l.child;case 11:return oR(o,l,l.type,l.pendingProps,d);case 7:return Br(o,l,l.pendingProps,d),l.child;case 8:return Br(o,l,l.pendingProps.children,d),l.child;case 12:return Br(o,l,l.pendingProps.children,d),l.child;case 10:return p=l.pendingProps,ki(l,l.type,p.value),Br(o,l,p.children,d),l.child;case 9:return b=l.type._context,p=l.pendingProps.children,Ql(l),b=Gr(b),p=p(b),l.flags|=1,Br(o,l,p,d),l.child;case 14:return iR(o,l,l.type,l.pendingProps,d);case 15:return lR(o,l,l.type,l.pendingProps,d);case 19:return xR(o,l,d);case 31:return S9(o,l,d);case 22:return cR(o,l,d,l.pendingProps);case 24:return Ql(l),p=Gr(hr),o===null?(b=Sv(),b===null&&(b=Mn,w=vv(),b.pooledCache=w,w.refCount++,w!==null&&(b.pooledCacheLanes|=d),b=w),l.memoizedState={parent:p,cache:b},Ev(l),ki(l,hr,b)):((o.lanes&d)!==0&&(wv(o,l),Qd(l,null,null,d),Xd()),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),ki(l,hr,p)):(p=w.cache,ki(l,hr,p),p!==b.cache&&yv(l,[hr],d,!0))),Br(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 s0(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(BR())o.flags|=8192;else throw tc=$m,Cv}else o.flags&=-16777217}function vR(o,l){if(l.type!=="stylesheet"||(l.state.loading&4)!==0)o.flags&=-16777217;else if(o.flags|=16777216,!Mj(l))if(BR())o.flags|=8192;else throw tc=$m,Cv}function sp(o,l){l!==null&&(o.flags|=4),o.flags&16384&&(l=o.tag!==22?rn():536870912,o.lanes|=l,Su|=l)}function af(o,l){if(!ln)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 E9(o,l,d){var p=l.pendingProps;switch(hv(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),Vo(hr),pe(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),(o===null||o.child===null)&&(lu(l)?Ko(l):o===null||o.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,pv())),Un(l),null;case 26:var b=l.type,w=l.memoizedState;return o===null?(Ko(l),w!==null?(Un(l),vR(l,w)):(Un(l),s0(l,b,null,p,d))):w?w!==o.memoizedState?(Ko(l),Un(l),vR(l,w)):(Un(l),l.flags&=-16777217):(o=o.memoizedProps,o!==p&&Ko(l),Un(l),s0(l,b,o,p,d)),null;case 27:if(ze(l),d=se.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=K.current,lu(l)?Q2(l):(o=jj(b,p,d),l.stateNode=o,Ko(l))}return Un(l),null;case 5:if(ze(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=K.current,lu(l))Q2(l);else{var O=bp(se.current);switch(w){case 1:w=O.createElementNS("http://www.w3.org/2000/svg",b);break;case 2:w=O.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;default:switch(b){case"svg":w=O.createElementNS("http://www.w3.org/2000/svg",b);break;case"math":w=O.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;case"script":w=O.createElement("div"),w.innerHTML="<script><\/script>",w=w.removeChild(w.firstChild);break;case"select":w=typeof p.is=="string"?O.createElement("select",{is:p.is}):O.createElement("select"),p.multiple?w.multiple=!0:p.size&&(w.size=p.size);break;default:w=typeof p.is=="string"?O.createElement(b,{is:p.is}):O.createElement(b)}}w[Le]=l,w[Pe]=p;e:for(O=l.child;O!==null;){if(O.tag===5||O.tag===6)w.appendChild(O.stateNode);else if(O.tag!==4&&O.tag!==27&&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}l.stateNode=w;e:switch(qr(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),s0(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=se.current,lu(l)){if(o=l.stateNode,d=l.memoizedProps,p=null,b=Vr,b!==null)switch(b.tag){case 27:case 5:p=b.memoizedProps}o[Le]=l,o=!!(o.nodeValue===d||p!==null&&p.suppressHydrationWarning===!0||pj(o.nodeValue,d)),o||Mi(l,!0)}else o=bp(o).createTextNode(p),o[Le]=l,l.stateNode=o}return Un(l),null;case 31:if(d=l.memoizedState,o===null||o.memoizedState!==null){if(p=lu(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[Le]=l}else Yl(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Un(l),o=!1}else d=pv(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=d),o=!0;if(!o)return l.flags&256?($a(l),l):($a(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=lu(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[Le]=l}else Yl(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Un(l),b=!1}else b=pv(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=b),b=!0;if(!b)return l.flags&256?($a(l),l):($a(l),null)}return $a(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),sp(l,l.updateQueue),Un(l),null);case 4:return pe(),o===null&&T0(l.stateNode.containerInfo),Un(l),null;case 10:return Vo(l.type),Un(l),null;case 19:if($(lr),p=l.memoizedState,p===null)return Un(l),null;if(b=(l.flags&128)!==0,w=p.rendering,w===null)if(b)af(p,!1);else{if(nr!==0||o!==null&&(o.flags&128)!==0)for(o=l.child;o!==null;){if(w=qm(o),w!==null){for(l.flags|=128,af(p,!1),o=w.updateQueue,l.updateQueue=o,sp(l,o),l.subtreeFlags=0,o=d,d=l.child;d!==null;)K2(d,o),d=d.sibling;return P(lr,lr.current&1|2),ln&&Ho(l,p.treeForkCount),l.child}o=o.sibling}p.tail!==null&&Te()>up&&(l.flags|=128,b=!0,af(p,!1),l.lanes=4194304)}else{if(!b)if(o=qm(w),o!==null){if(l.flags|=128,b=!0,o=o.updateQueue,l.updateQueue=o,sp(l,o),af(p,!0),p.tail===null&&p.tailMode==="hidden"&&!w.alternate&&!ln)return Un(l),null}else 2*Te()-p.renderingStartTime>up&&d!==536870912&&(l.flags|=128,b=!0,af(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=Te(),o.sibling=null,d=lr.current,P(lr,b?d&1|2:d&1),ln&&Ho(l,p.treeForkCount),o):(Un(l),null);case 22:case 23:return $a(l),_v(),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&&sp(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&&$(Jl),null;case 24:return d=null,o!==null&&(d=o.memoizedState.cache),l.memoizedState.cache!==d&&(l.flags|=2048),Vo(hr),Un(l),null;case 25:return null;case 30:return null}throw Error(r(156,l.tag))}function w9(o,l){switch(hv(l),l.tag){case 1:return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 3:return Vo(hr),pe(),o=l.flags,(o&65536)!==0&&(o&128)===0?(l.flags=o&-65537|128,l):null;case 26:case 27:case 5:return ze(l),null;case 31:if(l.memoizedState!==null){if($a(l),l.alternate===null)throw Error(r(340));Yl()}return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 13:if($a(l),o=l.memoizedState,o!==null&&o.dehydrated!==null){if(l.alternate===null)throw Error(r(340));Yl()}return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 19:return $(lr),null;case 4:return pe(),null;case 10:return Vo(l.type),null;case 22:case 23:return $a(l),_v(),o!==null&&$(Jl),o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 24:return Vo(hr),null;case 25:return null;default:return null}}function bR(o,l){switch(hv(l),l.tag){case 3:Vo(hr),pe();break;case 26:case 27:case 5:ze(l);break;case 4:pe();break;case 31:l.memoizedState!==null&&$a(l);break;case 13:$a(l);break;case 19:$(lr);break;case 10:Vo(l.type);break;case 22:case 23:$a(l),_v(),o!==null&&$(Jl);break;case 24:Vo(hr)}}function sf(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,O=d.inst;p=w(),O.destroy=p}d=d.next}while(d!==b)}}catch(k){Rn(l,l.return,k)}}function Hi(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 O=p.inst,k=O.destroy;if(k!==void 0){O.destroy=void 0,b=l;var J=d,fe=k;try{fe()}catch(ve){Rn(b,J,ve)}}}p=p.next}while(p!==w)}}catch(ve){Rn(l,l.return,ve)}}function SR(o){var l=o.updateQueue;if(l!==null){var d=o.stateNode;try{dw(l,d)}catch(p){Rn(o,o.return,p)}}}function CR(o,l,d){d.props=ac(o.type,o.memoizedProps),d.state=o.memoizedState;try{d.componentWillUnmount()}catch(p){Rn(o,l,p)}}function of(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){Rn(o,l,b)}}function so(o,l){var d=o.ref,p=o.refCleanup;if(d!==null)if(typeof p=="function")try{p()}catch(b){Rn(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){Rn(o,l,b)}else d.current=null}function ER(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){Rn(o,o.return,b)}}function o0(o,l,d){try{var p=o.stateNode;q9(p,o.type,d,l),p[Pe]=l}catch(b){Rn(o,o.return,b)}}function wR(o){return o.tag===5||o.tag===3||o.tag===26||o.tag===27&&Wi(o.type)||o.tag===4}function i0(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||wR(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&&Wi(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 l0(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=Uo));else if(p!==4&&(p===27&&Wi(o.type)&&(d=o.stateNode,l=null),o=o.child,o!==null))for(l0(o,l,d),o=o.sibling;o!==null;)l0(o,l,d),o=o.sibling}function op(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&&Wi(o.type)&&(d=o.stateNode),o=o.child,o!==null))for(op(o,l,d),o=o.sibling;o!==null;)op(o,l,d),o=o.sibling}function RR(o){var l=o.stateNode,d=o.memoizedProps;try{for(var p=o.type,b=l.attributes;b.length;)l.removeAttributeNode(b[0]);qr(l,p,d),l[Le]=o,l[Pe]=d}catch(w){Rn(o,o.return,w)}}var Wo=!1,gr=!1,c0=!1,jR=typeof WeakSet=="function"?WeakSet:Set,Ur=null;function R9(o,l){if(o=o.containerInfo,A0=Tp,o=U2(o),nv(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 O=0,k=-1,J=-1,fe=0,ve=0,Ee=o,me=null;t:for(;;){for(var ye;Ee!==d||b!==0&&Ee.nodeType!==3||(k=O+b),Ee!==w||p!==0&&Ee.nodeType!==3||(J=O+p),Ee.nodeType===3&&(O+=Ee.nodeValue.length),(ye=Ee.firstChild)!==null;)me=Ee,Ee=ye;for(;;){if(Ee===o)break t;if(me===d&&++fe===b&&(k=O),me===w&&++ve===p&&(J=O),(ye=Ee.nextSibling)!==null)break;Ee=me,me=Ee.parentNode}Ee=ye}d=k===-1||J===-1?null:{start:k,end:J}}else d=null}d=d||{start:0,end:0}}else d=null;for(D0={focusedElem:o,selectionRange:d},Tp=!1,Ur=l;Ur!==null;)if(l=Ur,o=l.child,(l.subtreeFlags&1028)!==0&&o!==null)o.return=l,Ur=o;else for(;Ur!==null;){switch(l=Ur,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 We=ac(d.type,b);o=p.getSnapshotBeforeUpdate(We,w),p.__reactInternalSnapshotBeforeUpdate=o}catch(ft){Rn(d,d.return,ft)}}break;case 3:if((o&1024)!==0){if(o=l.stateNode.containerInfo,d=o.nodeType,d===9)M0(o);else if(d===1)switch(o.nodeName){case"HEAD":case"HTML":case"BODY":M0(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,Ur=o;break}Ur=l.return}}function TR(o,l,d){var p=d.flags;switch(d.tag){case 0:case 11:case 15:Yo(o,d),p&4&&sf(5,d);break;case 1:if(Yo(o,d),p&4)if(o=d.stateNode,l===null)try{o.componentDidMount()}catch(O){Rn(d,d.return,O)}else{var b=ac(d.type,l.memoizedProps);l=l.memoizedState;try{o.componentDidUpdate(b,l,o.__reactInternalSnapshotBeforeUpdate)}catch(O){Rn(d,d.return,O)}}p&64&&SR(d),p&512&&of(d,d.return);break;case 3:if(Yo(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{dw(o,l)}catch(O){Rn(d,d.return,O)}}break;case 27:l===null&&p&4&&RR(d);case 26:case 5:Yo(o,d),l===null&&p&4&&ER(d),p&512&&of(d,d.return);break;case 12:Yo(o,d);break;case 31:Yo(o,d),p&4&&AR(o,d);break;case 13:Yo(o,d),p&4&&DR(o,d),p&64&&(o=d.memoizedState,o!==null&&(o=o.dehydrated,o!==null&&(d=M9.bind(null,d),eL(o,d))));break;case 22:if(p=d.memoizedState!==null||Wo,!p){l=l!==null&&l.memoizedState!==null||gr,b=Wo;var w=gr;Wo=p,(gr=l)&&!w?Xo(o,d,(d.subtreeFlags&8772)!==0):Yo(o,d),Wo=b,gr=w}break;case 30:break;default:Yo(o,d)}}function _R(o){var l=o.alternate;l!==null&&(o.alternate=null,_R(l)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(l=o.stateNode,l!==null&&Jn(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 qn=null,Ea=!1;function Zo(o,l,d){for(d=d.child;d!==null;)NR(o,l,d),d=d.sibling}function NR(o,l,d){if(bn&&typeof bn.onCommitFiberUnmount=="function")try{bn.onCommitFiberUnmount(La,d)}catch{}switch(d.tag){case 26:gr||so(d,l),Zo(o,l,d),d.memoizedState?d.memoizedState.count--:d.stateNode&&(d=d.stateNode,d.parentNode.removeChild(d));break;case 27:gr||so(d,l);var p=qn,b=Ea;Wi(d.type)&&(qn=d.stateNode,Ea=!1),Zo(o,l,d),gf(d.stateNode),qn=p,Ea=b;break;case 5:gr||so(d,l);case 6:if(p=qn,b=Ea,qn=null,Zo(o,l,d),qn=p,Ea=b,qn!==null)if(Ea)try{(qn.nodeType===9?qn.body:qn.nodeName==="HTML"?qn.ownerDocument.body:qn).removeChild(d.stateNode)}catch(w){Rn(d,l,w)}else try{qn.removeChild(d.stateNode)}catch(w){Rn(d,l,w)}break;case 18:qn!==null&&(Ea?(o=qn,Sj(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,d.stateNode),Nu(o)):Sj(qn,d.stateNode));break;case 4:p=qn,b=Ea,qn=d.stateNode.containerInfo,Ea=!0,Zo(o,l,d),qn=p,Ea=b;break;case 0:case 11:case 14:case 15:Hi(2,d,l),gr||Hi(4,d,l),Zo(o,l,d);break;case 1:gr||(so(d,l),p=d.stateNode,typeof p.componentWillUnmount=="function"&&CR(d,l,p)),Zo(o,l,d);break;case 21:Zo(o,l,d);break;case 22:gr=(p=gr)||d.memoizedState!==null,Zo(o,l,d),gr=p;break;default:Zo(o,l,d)}}function AR(o,l){if(l.memoizedState===null&&(o=l.alternate,o!==null&&(o=o.memoizedState,o!==null))){o=o.dehydrated;try{Nu(o)}catch(d){Rn(l,l.return,d)}}}function DR(o,l){if(l.memoizedState===null&&(o=l.alternate,o!==null&&(o=o.memoizedState,o!==null&&(o=o.dehydrated,o!==null))))try{Nu(o)}catch(d){Rn(l,l.return,d)}}function j9(o){switch(o.tag){case 31:case 13:case 19:var l=o.stateNode;return l===null&&(l=o.stateNode=new jR),l;case 22:return o=o.stateNode,l=o._retryCache,l===null&&(l=o._retryCache=new jR),l;default:throw Error(r(435,o.tag))}}function ip(o,l){var d=j9(o);l.forEach(function(p){if(!d.has(p)){d.add(p);var b=k9.bind(null,o,p);p.then(b,b)}})}function wa(o,l){var d=l.deletions;if(d!==null)for(var p=0;p<d.length;p++){var b=d[p],w=o,O=l,k=O;e:for(;k!==null;){switch(k.tag){case 27:if(Wi(k.type)){qn=k.stateNode,Ea=!1;break e}break;case 5:qn=k.stateNode,Ea=!1;break e;case 3:case 4:qn=k.stateNode.containerInfo,Ea=!0;break e}k=k.return}if(qn===null)throw Error(r(160));NR(w,O,b),qn=null,Ea=!1,w=b.alternate,w!==null&&(w.return=null),b.return=null}if(l.subtreeFlags&13886)for(l=l.child;l!==null;)OR(l,o),l=l.sibling}var Ms=null;function OR(o,l){var d=o.alternate,p=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:wa(l,o),Ra(o),p&4&&(Hi(3,o,o.return),sf(3,o),Hi(5,o,o.return));break;case 1:wa(l,o),Ra(o),p&512&&(gr||d===null||so(d,d.return)),p&64&&Wo&&(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=Ms;if(wa(l,o),Ra(o),p&512&&(gr||d===null||so(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[Zn]||w[Le]||w.namespaceURI==="http://www.w3.org/2000/svg"||w.hasAttribute("itemprop"))&&(w=b.createElement(p),b.head.insertBefore(w,b.querySelector("head > title"))),qr(w,p,d),w[Le]=o,Bn(w),p=w;break e;case"link":var O=Oj("link","href",b).get(p+(d.href||""));if(O){for(var k=0;k<O.length;k++)if(w=O[k],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)){O.splice(k,1);break t}}w=b.createElement(p),qr(w,p,d),b.head.appendChild(w);break;case"meta":if(O=Oj("meta","content",b).get(p+(d.content||""))){for(k=0;k<O.length;k++)if(w=O[k],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)){O.splice(k,1);break t}}w=b.createElement(p),qr(w,p,d),b.head.appendChild(w);break;default:throw Error(r(468,p))}w[Le]=o,Bn(w),p=w}o.stateNode=p}else Ij(b,o.type,o.stateNode);else o.stateNode=Dj(b,p,o.memoizedProps);else w!==p?(w===null?d.stateNode!==null&&(d=d.stateNode,d.parentNode.removeChild(d)):w.count--,p===null?Ij(b,o.type,o.stateNode):Dj(b,p,o.memoizedProps)):p===null&&o.stateNode!==null&&o0(o,o.memoizedProps,d.memoizedProps)}break;case 27:wa(l,o),Ra(o),p&512&&(gr||d===null||so(d,d.return)),d!==null&&p&4&&o0(o,o.memoizedProps,d.memoizedProps);break;case 5:if(wa(l,o),Ra(o),p&512&&(gr||d===null||so(d,d.return)),o.flags&32){b=o.stateNode;try{Qc(b,"")}catch(We){Rn(o,o.return,We)}}p&4&&o.stateNode!=null&&(b=o.memoizedProps,o0(o,b,d!==null?d.memoizedProps:b)),p&1024&&(c0=!0);break;case 6:if(wa(l,o),Ra(o),p&4){if(o.stateNode===null)throw Error(r(162));p=o.memoizedProps,d=o.stateNode;try{d.nodeValue=p}catch(We){Rn(o,o.return,We)}}break;case 3:if(Ep=null,b=Ms,Ms=Sp(l.containerInfo),wa(l,o),Ms=b,Ra(o),p&4&&d!==null&&d.memoizedState.isDehydrated)try{Nu(l.containerInfo)}catch(We){Rn(o,o.return,We)}c0&&(c0=!1,IR(o));break;case 4:p=Ms,Ms=Sp(o.stateNode.containerInfo),wa(l,o),Ra(o),Ms=p;break;case 12:wa(l,o),Ra(o);break;case 31:wa(l,o),Ra(o),p&4&&(p=o.updateQueue,p!==null&&(o.updateQueue=null,ip(o,p)));break;case 13:wa(l,o),Ra(o),o.child.flags&8192&&o.memoizedState!==null!=(d!==null&&d.memoizedState!==null)&&(cp=Te()),p&4&&(p=o.updateQueue,p!==null&&(o.updateQueue=null,ip(o,p)));break;case 22:b=o.memoizedState!==null;var J=d!==null&&d.memoizedState!==null,fe=Wo,ve=gr;if(Wo=fe||b,gr=ve||J,wa(l,o),gr=ve,Wo=fe,Ra(o),p&8192)e:for(l=o.stateNode,l._visibility=b?l._visibility&-2:l._visibility|1,b&&(d===null||J||Wo||gr||sc(o)),d=null,l=o;;){if(l.tag===5||l.tag===26){if(d===null){J=d=l;try{if(w=J.stateNode,b)O=w.style,typeof O.setProperty=="function"?O.setProperty("display","none","important"):O.display="none";else{k=J.stateNode;var Ee=J.memoizedProps.style,me=Ee!=null&&Ee.hasOwnProperty("display")?Ee.display:null;k.style.display=me==null||typeof me=="boolean"?"":(""+me).trim()}}catch(We){Rn(J,J.return,We)}}}else if(l.tag===6){if(d===null){J=l;try{J.stateNode.nodeValue=b?"":J.memoizedProps}catch(We){Rn(J,J.return,We)}}}else if(l.tag===18){if(d===null){J=l;try{var ye=J.stateNode;b?Cj(ye,!0):Cj(J.stateNode,!1)}catch(We){Rn(J,J.return,We)}}}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,ip(o,d))));break;case 19:wa(l,o),Ra(o),p&4&&(p=o.updateQueue,p!==null&&(o.updateQueue=null,ip(o,p)));break;case 30:break;case 21:break;default:wa(l,o),Ra(o)}}function Ra(o){var l=o.flags;if(l&2){try{for(var d,p=o.return;p!==null;){if(wR(p)){d=p;break}p=p.return}if(d==null)throw Error(r(160));switch(d.tag){case 27:var b=d.stateNode,w=i0(o);op(o,w,b);break;case 5:var O=d.stateNode;d.flags&32&&(Qc(O,""),d.flags&=-33);var k=i0(o);op(o,k,O);break;case 3:case 4:var J=d.stateNode.containerInfo,fe=i0(o);l0(o,fe,J);break;default:throw Error(r(161))}}catch(ve){Rn(o,o.return,ve)}o.flags&=-3}l&4096&&(o.flags&=-4097)}function IR(o){if(o.subtreeFlags&1024)for(o=o.child;o!==null;){var l=o;IR(l),l.tag===5&&l.flags&1024&&l.stateNode.reset(),o=o.sibling}}function Yo(o,l){if(l.subtreeFlags&8772)for(l=l.child;l!==null;)TR(o,l.alternate,l),l=l.sibling}function sc(o){for(o=o.child;o!==null;){var l=o;switch(l.tag){case 0:case 11:case 14:case 15:Hi(4,l,l.return),sc(l);break;case 1:so(l,l.return);var d=l.stateNode;typeof d.componentWillUnmount=="function"&&CR(l,l.return,d),sc(l);break;case 27:gf(l.stateNode);case 26:case 5:so(l,l.return),sc(l);break;case 22:l.memoizedState===null&&sc(l);break;case 30:sc(l);break;default:sc(l)}o=o.sibling}}function Xo(o,l,d){for(d=d&&(l.subtreeFlags&8772)!==0,l=l.child;l!==null;){var p=l.alternate,b=o,w=l,O=w.flags;switch(w.tag){case 0:case 11:case 15:Xo(b,w,d),sf(4,w);break;case 1:if(Xo(b,w,d),p=w,b=p.stateNode,typeof b.componentDidMount=="function")try{b.componentDidMount()}catch(fe){Rn(p,p.return,fe)}if(p=w,b=p.updateQueue,b!==null){var k=p.stateNode;try{var J=b.shared.hiddenCallbacks;if(J!==null)for(b.shared.hiddenCallbacks=null,b=0;b<J.length;b++)uw(J[b],k)}catch(fe){Rn(p,p.return,fe)}}d&&O&64&&SR(w),of(w,w.return);break;case 27:RR(w);case 26:case 5:Xo(b,w,d),d&&p===null&&O&4&&ER(w),of(w,w.return);break;case 12:Xo(b,w,d);break;case 31:Xo(b,w,d),d&&O&4&&AR(b,w);break;case 13:Xo(b,w,d),d&&O&4&&DR(b,w);break;case 22:w.memoizedState===null&&Xo(b,w,d),of(w,w.return);break;case 30:break;default:Xo(b,w,d)}l=l.sibling}}function u0(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&&qd(d))}function d0(o,l){o=null,l.alternate!==null&&(o=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==o&&(l.refCount++,o!=null&&qd(o))}function ks(o,l,d,p){if(l.subtreeFlags&10256)for(l=l.child;l!==null;)MR(o,l,d,p),l=l.sibling}function MR(o,l,d,p){var b=l.flags;switch(l.tag){case 0:case 11:case 15:ks(o,l,d,p),b&2048&&sf(9,l);break;case 1:ks(o,l,d,p);break;case 3:ks(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&&qd(o)));break;case 12:if(b&2048){ks(o,l,d,p),o=l.stateNode;try{var w=l.memoizedProps,O=w.id,k=w.onPostCommit;typeof k=="function"&&k(O,l.alternate===null?"mount":"update",o.passiveEffectDuration,-0)}catch(J){Rn(l,l.return,J)}}else ks(o,l,d,p);break;case 31:ks(o,l,d,p);break;case 13:ks(o,l,d,p);break;case 23:break;case 22:w=l.stateNode,O=l.alternate,l.memoizedState!==null?w._visibility&2?ks(o,l,d,p):lf(o,l):w._visibility&2?ks(o,l,d,p):(w._visibility|=2,yu(o,l,d,p,(l.subtreeFlags&10256)!==0||!1)),b&2048&&u0(O,l);break;case 24:ks(o,l,d,p),b&2048&&d0(l.alternate,l);break;default:ks(o,l,d,p)}}function yu(o,l,d,p,b){for(b=b&&((l.subtreeFlags&10256)!==0||!1),l=l.child;l!==null;){var w=o,O=l,k=d,J=p,fe=O.flags;switch(O.tag){case 0:case 11:case 15:yu(w,O,k,J,b),sf(8,O);break;case 23:break;case 22:var ve=O.stateNode;O.memoizedState!==null?ve._visibility&2?yu(w,O,k,J,b):lf(w,O):(ve._visibility|=2,yu(w,O,k,J,b)),b&&fe&2048&&u0(O.alternate,O);break;case 24:yu(w,O,k,J,b),b&&fe&2048&&d0(O.alternate,O);break;default:yu(w,O,k,J,b)}l=l.sibling}}function lf(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:lf(d,p),b&2048&&u0(p.alternate,p);break;case 24:lf(d,p),b&2048&&d0(p.alternate,p);break;default:lf(d,p)}l=l.sibling}}var cf=8192;function vu(o,l,d){if(o.subtreeFlags&cf)for(o=o.child;o!==null;)kR(o,l,d),o=o.sibling}function kR(o,l,d){switch(o.tag){case 26:vu(o,l,d),o.flags&cf&&o.memoizedState!==null&&fL(d,Ms,o.memoizedState,o.memoizedProps);break;case 5:vu(o,l,d);break;case 3:case 4:var p=Ms;Ms=Sp(o.stateNode.containerInfo),vu(o,l,d),Ms=p;break;case 22:o.memoizedState===null&&(p=o.alternate,p!==null&&p.memoizedState!==null?(p=cf,cf=16777216,vu(o,l,d),cf=p):vu(o,l,d));break;default:vu(o,l,d)}}function LR(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 uf(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];Ur=p,UR(p,o)}LR(o)}if(o.subtreeFlags&10256)for(o=o.child;o!==null;)PR(o),o=o.sibling}function PR(o){switch(o.tag){case 0:case 11:case 15:uf(o),o.flags&2048&&Hi(9,o,o.return);break;case 3:uf(o);break;case 12:uf(o);break;case 22:var l=o.stateNode;o.memoizedState!==null&&l._visibility&2&&(o.return===null||o.return.tag!==13)?(l._visibility&=-3,lp(o)):uf(o);break;default:uf(o)}}function lp(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];Ur=p,UR(p,o)}LR(o)}for(o=o.child;o!==null;){switch(l=o,l.tag){case 0:case 11:case 15:Hi(8,l,l.return),lp(l);break;case 22:d=l.stateNode,d._visibility&2&&(d._visibility&=-3,lp(l));break;default:lp(l)}o=o.sibling}}function UR(o,l){for(;Ur!==null;){var d=Ur;switch(d.tag){case 0:case 11:case 15:Hi(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:qd(d.memoizedState.cache)}if(p=d.child,p!==null)p.return=d,Ur=p;else e:for(d=o;Ur!==null;){p=Ur;var b=p.sibling,w=p.return;if(_R(p),p===d){Ur=null;break e}if(b!==null){b.return=w,Ur=b;break e}Ur=w}}}var T9={getCacheForType:function(o){var l=Gr(hr),d=l.data.get(o);return d===void 0&&(d=o(),l.data.set(o,d)),d},cacheSignal:function(){return Gr(hr).controller.signal}},_9=typeof WeakMap=="function"?WeakMap:Map,Sn=0,Mn=null,Wt=null,Qt=0,wn=0,Va=null,$i=!1,bu=!1,f0=!1,Qo=0,nr=0,Vi=0,oc=0,h0=0,Ga=0,Su=0,df=null,ja=null,m0=!1,cp=0,zR=0,up=1/0,dp=null,Gi=null,Er=0,Bi=null,Cu=null,Jo=0,p0=0,g0=null,FR=null,ff=0,x0=null;function Ba(){return(Sn&2)!==0&&Qt!==0?Qt&-Qt:D.T!==null?E0():Ne()}function HR(){if(Ga===0)if((Qt&536870912)===0||ln){var o=Ns;Ns<<=1,(Ns&3932160)===0&&(Ns=262144),Ga=o}else Ga=536870912;return o=Ha.current,o!==null&&(o.flags|=32),Ga}function Ta(o,l,d){(o===Mn&&(wn===2||wn===9)||o.cancelPendingCommit!==null)&&(Eu(o,0),qi(o,Qt,Ga,!1)),dn(o,d),((Sn&2)===0||o!==Mn)&&(o===Mn&&((Sn&2)===0&&(oc|=d),nr===4&&qi(o,Qt,Ga,!1)),oo(o))}function $R(o,l,d){if((Sn&6)!==0)throw Error(r(327));var p=!d&&(l&127)===0&&(l&o.expiredLanes)===0||nn(o,l),b=p?D9(o,l):v0(o,l,!0),w=p;do{if(b===0){bu&&!p&&qi(o,l,0,!1);break}else{if(d=o.current.alternate,w&&!N9(d)){b=v0(o,l,!1),w=!1;continue}if(b===2){if(w=l,o.errorRecoveryDisabledLanes&w)var O=0;else O=o.pendingLanes&-536870913,O=O!==0?O:O&536870912?536870912:0;if(O!==0){l=O;e:{var k=o;b=df;var J=k.current.memoizedState.isDehydrated;if(J&&(Eu(k,O).flags|=256),O=v0(k,O,!1),O!==2){if(f0&&!J){k.errorRecoveryDisabledLanes|=w,oc|=w,b=4;break e}w=ja,ja=b,w!==null&&(ja===null?ja=w:ja.push.apply(ja,w))}b=O}if(w=!1,b!==2)continue}}if(b===1){Eu(o,0),qi(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:qi(p,l,Ga,!$i);break e;case 2:ja=null;break;case 3:case 5:break;default:throw Error(r(329))}if((l&62914560)===l&&(b=cp+300-Te(),10<b)){if(qi(p,l,Ga,!$i),Xe(p,0,!0)!==0)break e;Jo=l,p.timeoutHandle=vj(VR.bind(null,p,d,ja,dp,m0,l,Ga,oc,Su,$i,w,"Throttled",-0,0),b);break e}VR(p,d,ja,dp,m0,l,Ga,oc,Su,$i,w,null,-0,0)}}break}while(!0);oo(o)}function VR(o,l,d,p,b,w,O,k,J,fe,ve,Ee,me,ye){if(o.timeoutHandle=-1,Ee=l.subtreeFlags,Ee&8192||(Ee&16785408)===16785408){Ee={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Uo},kR(l,w,Ee);var We=(w&62914560)===w?cp-Te():(w&4194048)===w?zR-Te():0;if(We=hL(Ee,We),We!==null){Jo=w,o.cancelPendingCommit=We(XR.bind(null,o,l,w,d,p,b,O,k,J,ve,Ee,null,me,ye)),qi(o,w,O,!fe);return}}XR(o,l,w,d,p,b,O,k,J)}function N9(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(!za(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 qi(o,l,d,p){l&=~h0,l&=~oc,o.suspendedLanes|=l,o.pingedLanes&=~l,p&&(o.warmLanes|=l),p=o.expirationTimes;for(var b=l;0<b;){var w=31-Vn(b),O=1<<w;p[w]=-1,b&=~O}d!==0&&Lr(o,d,l)}function fp(){return(Sn&6)===0?(hf(0),!1):!0}function y0(){if(Wt!==null){if(wn===0)var o=Wt.return;else o=Wt,$o=Xl=null,Mv(o),hu=null,Wd=0,o=Wt;for(;o!==null;)bR(o.alternate,o),o=o.return;Wt=null}}function Eu(o,l){var d=o.timeoutHandle;d!==-1&&(o.timeoutHandle=-1,Z9(d)),d=o.cancelPendingCommit,d!==null&&(o.cancelPendingCommit=null,d()),Jo=0,y0(),Mn=o,Wt=d=Fo(o.current,null),Qt=l,wn=0,Va=null,$i=!1,bu=nn(o,l),f0=!1,Su=Ga=h0=oc=Vi=nr=0,ja=df=null,m0=!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-Vn(p),w=1<<b;l|=o[b],p&=~w}return Qo=l,Im(),d}function GR(o,l){Mt=null,D.H=nf,l===fu||l===Hm?(l=ow(),wn=3):l===Cv?(l=ow(),wn=4):wn=l===Yv?8:l!==null&&typeof l=="object"&&typeof l.then=="function"?6:1,Va=l,Wt===null&&(nr=1,tp(o,fs(l,o.current)))}function BR(){var o=Ha.current;return o===null?!0:(Qt&4194048)===Qt?gs===null:(Qt&62914560)===Qt||(Qt&536870912)!==0?o===gs:!1}function qR(){var o=D.H;return D.H=nf,o===null?nf:o}function KR(){var o=D.A;return D.A=T9,o}function hp(){nr=4,$i||(Qt&4194048)!==Qt&&Ha.current!==null||(bu=!0),(Vi&134217727)===0&&(oc&134217727)===0||Mn===null||qi(Mn,Qt,Ga,!1)}function v0(o,l,d){var p=Sn;Sn|=2;var b=qR(),w=KR();(Mn!==o||Qt!==l)&&(dp=null,Eu(o,l)),l=!1;var O=nr;e:do try{if(wn!==0&&Wt!==null){var k=Wt,J=Va;switch(wn){case 8:y0(),O=6;break e;case 3:case 2:case 9:case 6:Ha.current===null&&(l=!0);var fe=wn;if(wn=0,Va=null,wu(o,k,J,fe),d&&bu){O=0;break e}break;default:fe=wn,wn=0,Va=null,wu(o,k,J,fe)}}A9(),O=nr;break}catch(ve){GR(o,ve)}while(!0);return l&&o.shellSuspendCounter++,$o=Xl=null,Sn=p,D.H=b,D.A=w,Wt===null&&(Mn=null,Qt=0,Im()),O}function A9(){for(;Wt!==null;)WR(Wt)}function D9(o,l){var d=Sn;Sn|=2;var p=qR(),b=KR();Mn!==o||Qt!==l?(dp=null,up=Te()+500,Eu(o,l)):bu=nn(o,l);e:do try{if(wn!==0&&Wt!==null){l=Wt;var w=Va;t:switch(wn){case 1:wn=0,Va=null,wu(o,l,w,1);break;case 2:case 9:if(aw(w)){wn=0,Va=null,ZR(l);break}l=function(){wn!==2&&wn!==9||Mn!==o||(wn=7),oo(o)},w.then(l,l);break e;case 3:wn=7;break e;case 4:wn=5;break e;case 7:aw(w)?(wn=0,Va=null,ZR(l)):(wn=0,Va=null,wu(o,l,w,7));break;case 5:var O=null;switch(Wt.tag){case 26:O=Wt.memoizedState;case 5:case 27:var k=Wt;if(O?Mj(O):k.stateNode.complete){wn=0,Va=null;var J=k.sibling;if(J!==null)Wt=J;else{var fe=k.return;fe!==null?(Wt=fe,mp(fe)):Wt=null}break t}}wn=0,Va=null,wu(o,l,w,5);break;case 6:wn=0,Va=null,wu(o,l,w,6);break;case 8:y0(),nr=6;break e;default:throw Error(r(462))}}O9();break}catch(ve){GR(o,ve)}while(!0);return $o=Xl=null,D.H=p,D.A=b,Sn=d,Wt!==null?0:(Mn=null,Qt=0,Im(),nr)}function O9(){for(;Wt!==null&&!ae();)WR(Wt)}function WR(o){var l=yR(o.alternate,o,Qo);o.memoizedProps=o.pendingProps,l===null?mp(o):Wt=l}function ZR(o){var l=o,d=l.alternate;switch(l.tag){case 15:case 0:l=fR(d,l,l.pendingProps,l.type,void 0,Qt);break;case 11:l=fR(d,l,l.pendingProps,l.type.render,l.ref,Qt);break;case 5:Mv(l);default:bR(d,l),l=Wt=K2(l,Qo),l=yR(d,l,Qo)}o.memoizedProps=o.pendingProps,l===null?mp(o):Wt=l}function wu(o,l,d,p){$o=Xl=null,Mv(l),hu=null,Wd=0;var b=l.return;try{if(b9(o,b,l,d,Qt)){nr=1,tp(o,fs(d,o.current)),Wt=null;return}}catch(w){if(b!==null)throw Wt=b,w;nr=1,tp(o,fs(d,o.current)),Wt=null;return}l.flags&32768?(ln||p===1?o=!0:bu||(Qt&536870912)!==0?o=!1:($i=o=!0,(p===2||p===9||p===3||p===6)&&(p=Ha.current,p!==null&&p.tag===13&&(p.flags|=16384))),YR(l,o)):mp(l)}function mp(o){var l=o;do{if((l.flags&32768)!==0){YR(l,$i);return}o=l.return;var d=E9(l.alternate,l,Qo);if(d!==null){Wt=d;return}if(l=l.sibling,l!==null){Wt=l;return}Wt=l=o}while(l!==null);nr===0&&(nr=5)}function YR(o,l){do{var d=w9(o.alternate,o);if(d!==null){d.flags&=32767,Wt=d;return}if(d=o.return,d!==null&&(d.flags|=32768,d.subtreeFlags=0,d.deletions=null),!l&&(o=o.sibling,o!==null)){Wt=o;return}Wt=o=d}while(o!==null);nr=6,Wt=null}function XR(o,l,d,p,b,w,O,k,J){o.cancelPendingCommit=null;do pp();while(Er!==0);if((Sn&6)!==0)throw Error(r(327));if(l!==null){if(l===o.current)throw Error(r(177));if(w=l.lanes|l.childLanes,w|=iv,un(o,d,w,O,k,J),o===Mn&&(Wt=Mn=null,Qt=0),Cu=l,Bi=o,Jo=d,p0=w,g0=b,FR=p,(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?(o.callbackNode=null,o.callbackPriority=0,L9(lt,function(){return nj(),null})):(o.callbackNode=null,o.callbackPriority=0),p=(l.flags&13878)!==0,(l.subtreeFlags&13878)!==0||p){p=D.T,D.T=null,b=F.p,F.p=2,O=Sn,Sn|=4;try{R9(o,l,d)}finally{Sn=O,F.p=b,D.T=p}}Er=1,QR(),JR(),ej()}}function QR(){if(Er===1){Er=0;var o=Bi,l=Cu,d=(l.flags&13878)!==0;if((l.subtreeFlags&13878)!==0||d){d=D.T,D.T=null;var p=F.p;F.p=2;var b=Sn;Sn|=4;try{OR(l,o);var w=D0,O=U2(o.containerInfo),k=w.focusedElem,J=w.selectionRange;if(O!==k&&k&&k.ownerDocument&&P2(k.ownerDocument.documentElement,k)){if(J!==null&&nv(k)){var fe=J.start,ve=J.end;if(ve===void 0&&(ve=fe),"selectionStart"in k)k.selectionStart=fe,k.selectionEnd=Math.min(ve,k.value.length);else{var Ee=k.ownerDocument||document,me=Ee&&Ee.defaultView||window;if(me.getSelection){var ye=me.getSelection(),We=k.textContent.length,ft=Math.min(J.start,We),Dn=J.end===void 0?ft:Math.min(J.end,We);!ye.extend&&ft>Dn&&(O=Dn,Dn=ft,ft=O);var ie=L2(k,ft),ne=L2(k,Dn);if(ie&&ne&&(ye.rangeCount!==1||ye.anchorNode!==ie.node||ye.anchorOffset!==ie.offset||ye.focusNode!==ne.node||ye.focusOffset!==ne.offset)){var de=Ee.createRange();de.setStart(ie.node,ie.offset),ye.removeAllRanges(),ft>Dn?(ye.addRange(de),ye.extend(ne.node,ne.offset)):(de.setEnd(ne.node,ne.offset),ye.addRange(de))}}}}for(Ee=[],ye=k;ye=ye.parentNode;)ye.nodeType===1&&Ee.push({element:ye,left:ye.scrollLeft,top:ye.scrollTop});for(typeof k.focus=="function"&&k.focus(),k=0;k<Ee.length;k++){var Se=Ee[k];Se.element.scrollLeft=Se.left,Se.element.scrollTop=Se.top}}Tp=!!A0,D0=A0=null}finally{Sn=b,F.p=p,D.T=d}}o.current=l,Er=2}}function JR(){if(Er===2){Er=0;var o=Bi,l=Cu,d=(l.flags&8772)!==0;if((l.subtreeFlags&8772)!==0||d){d=D.T,D.T=null;var p=F.p;F.p=2;var b=Sn;Sn|=4;try{TR(o,l.alternate,l)}finally{Sn=b,F.p=p,D.T=d}}Er=3}}function ej(){if(Er===4||Er===3){Er=0,ge();var o=Bi,l=Cu,d=Jo,p=FR;(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?Er=5:(Er=0,Cu=Bi=null,tj(o,o.pendingLanes));var b=o.pendingLanes;if(b===0&&(Gi=null),Ce(d),l=l.stateNode,bn&&typeof bn.onCommitFiberRoot=="function")try{bn.onCommitFiberRoot(La,l,void 0,(l.current.flags&128)===128)}catch{}if(p!==null){l=D.T,b=F.p,F.p=2,D.T=null;try{for(var w=o.onRecoverableError,O=0;O<p.length;O++){var k=p[O];w(k.value,{componentStack:k.stack})}}finally{D.T=l,F.p=b}}(Jo&3)!==0&&pp(),oo(o),b=o.pendingLanes,(d&261930)!==0&&(b&42)!==0?o===x0?ff++:(ff=0,x0=o):ff=0,hf(0)}}function tj(o,l){(o.pooledCacheLanes&=l)===0&&(l=o.pooledCache,l!=null&&(o.pooledCache=null,qd(l)))}function pp(){return QR(),JR(),ej(),nj()}function nj(){if(Er!==5)return!1;var o=Bi,l=p0;p0=0;var d=Ce(Jo),p=D.T,b=F.p;try{F.p=32>d?32:d,D.T=null,d=g0,g0=null;var w=Bi,O=Jo;if(Er=0,Cu=Bi=null,Jo=0,(Sn&6)!==0)throw Error(r(331));var k=Sn;if(Sn|=4,PR(w.current),MR(w,w.current,O,d),Sn=k,hf(0,!1),bn&&typeof bn.onPostCommitFiberRoot=="function")try{bn.onPostCommitFiberRoot(La,w)}catch{}return!0}finally{F.p=b,D.T=p,tj(o,l)}}function rj(o,l,d){l=fs(d,l),l=Zv(o.stateNode,l,2),o=Ui(o,l,2),o!==null&&(dn(o,2),oo(o))}function Rn(o,l,d){if(o.tag===3)rj(o,o,d);else for(;l!==null;){if(l.tag===3){rj(l,o,d);break}else if(l.tag===1){var p=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&(Gi===null||!Gi.has(p))){o=fs(d,o),d=aR(2),p=Ui(l,d,2),p!==null&&(sR(d,p,l,o),dn(p,2),oo(p));break}}l=l.return}}function b0(o,l,d){var p=o.pingCache;if(p===null){p=o.pingCache=new _9;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)||(f0=!0,b.add(d),o=I9.bind(null,o,l,d),l.then(o,o))}function I9(o,l,d){var p=o.pingCache;p!==null&&p.delete(l),o.pingedLanes|=o.suspendedLanes&d,o.warmLanes&=~d,Mn===o&&(Qt&d)===d&&(nr===4||nr===3&&(Qt&62914560)===Qt&&300>Te()-cp?(Sn&2)===0&&Eu(o,0):h0|=d,Su===Qt&&(Su=0)),oo(o)}function aj(o,l){l===0&&(l=rn()),o=Wl(o,l),o!==null&&(dn(o,l),oo(o))}function M9(o){var l=o.memoizedState,d=0;l!==null&&(d=l.retryLane),aj(o,d)}function k9(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),aj(o,d)}function L9(o,l){return It(o,l)}var gp=null,Ru=null,S0=!1,xp=!1,C0=!1,Ki=0;function oo(o){o!==Ru&&o.next===null&&(Ru===null?gp=Ru=o:Ru=Ru.next=o),xp=!0,S0||(S0=!0,U9())}function hf(o,l){if(!C0&&xp){C0=!0;do for(var d=!1,p=gp;p!==null;){if(o!==0){var b=p.pendingLanes;if(b===0)var w=0;else{var O=p.suspendedLanes,k=p.pingedLanes;w=(1<<31-Vn(42|o)+1)-1,w&=b&~(O&~k),w=w&201326741?w&201326741|1:w?w|2:0}w!==0&&(d=!0,lj(p,w))}else w=Qt,w=Xe(p,p===Mn?w:0,p.cancelPendingCommit!==null||p.timeoutHandle!==-1),(w&3)===0||nn(p,w)||(d=!0,lj(p,w));p=p.next}while(d);C0=!1}}function P9(){sj()}function sj(){xp=S0=!1;var o=0;Ki!==0&&W9()&&(o=Ki);for(var l=Te(),d=null,p=gp;p!==null;){var b=p.next,w=oj(p,l);w===0?(p.next=null,d===null?gp=b:d.next=b,b===null&&(Ru=d)):(d=p,(o!==0||(w&3)!==0)&&(xp=!0)),p=b}Er!==0&&Er!==5||hf(o),Ki!==0&&(Ki=0)}function oj(o,l){for(var d=o.suspendedLanes,p=o.pingedLanes,b=o.expirationTimes,w=o.pendingLanes&-62914561;0<w;){var O=31-Vn(w),k=1<<O,J=b[O];J===-1?((k&d)===0||(k&p)!==0)&&(b[O]=cn(k,l)):J<=l&&(o.expiredLanes|=k),w&=~k}if(l=Mn,d=Qt,d=Xe(o,o===l?d:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),p=o.callbackNode,d===0||o===l&&(wn===2||wn===9)||o.cancelPendingCommit!==null)return p!==null&&p!==null&&Z(p),o.callbackNode=null,o.callbackPriority=0;if((d&3)===0||nn(o,d)){if(l=d&-d,l===o.callbackPriority)return l;switch(p!==null&&Z(p),Ce(d)){case 2:case 8:d=Ve;break;case 32:d=lt;break;case 268435456:d=vn;break;default:d=lt}return p=ij.bind(null,o),d=It(d,p),o.callbackPriority=l,o.callbackNode=d,l}return p!==null&&p!==null&&Z(p),o.callbackPriority=2,o.callbackNode=null,2}function ij(o,l){if(Er!==0&&Er!==5)return o.callbackNode=null,o.callbackPriority=0,null;var d=o.callbackNode;if(pp()&&o.callbackNode!==d)return null;var p=Qt;return p=Xe(o,o===Mn?p:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),p===0?null:($R(o,p,l),oj(o,Te()),o.callbackNode!=null&&o.callbackNode===d?ij.bind(null,o):null)}function lj(o,l){if(pp())return null;$R(o,l,!0)}function U9(){Y9(function(){(Sn&6)!==0?It(je,P9):sj()})}function E0(){if(Ki===0){var o=uu;o===0&&(o=Pa,Pa<<=1,(Pa&261888)===0&&(Pa=256)),Ki=o}return Ki}function cj(o){return o==null||typeof o=="symbol"||typeof o=="boolean"?null:typeof o=="function"?o:Rm(""+o)}function uj(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 z9(o,l,d,p,b){if(l==="submit"&&d&&d.stateNode===b){var w=cj((b[Pe]||null).action),O=p.submitter;O&&(l=(l=O[Pe]||null)?cj(l.formAction):O.getAttribute("formAction"),l!==null&&(w=l,O=null));var k=new Nm("action","action",null,p,b);o.push({event:k,listeners:[{instance:null,listener:function(){if(p.defaultPrevented){if(Ki!==0){var J=O?uj(b,O):new FormData(b);Vv(d,{pending:!0,data:J,method:b.method,action:w},null,J)}}else typeof w=="function"&&(k.preventDefault(),J=O?uj(b,O):new FormData(b),Vv(d,{pending:!0,data:J,method:b.method,action:w},w,J))},currentTarget:b}]})}}for(var w0=0;w0<ov.length;w0++){var R0=ov[w0],F9=R0.toLowerCase(),H9=R0[0].toUpperCase()+R0.slice(1);Is(F9,"on"+H9)}Is(H2,"onAnimationEnd"),Is($2,"onAnimationIteration"),Is(V2,"onAnimationStart"),Is("dblclick","onDoubleClick"),Is("focusin","onFocus"),Is("focusout","onBlur"),Is(r9,"onTransitionRun"),Is(a9,"onTransitionStart"),Is(s9,"onTransitionCancel"),Is(G2,"onTransitionEnd"),cs("onMouseEnter",["mouseout","mouseover"]),cs("onMouseLeave",["mouseout","mouseover"]),cs("onPointerEnter",["pointerout","pointerover"]),cs("onPointerLeave",["pointerout","pointerover"]),Ds("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ds("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ds("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ds("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ds("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ds("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var mf="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(" "),$9=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(mf));function dj(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 O=p.length-1;0<=O;O--){var k=p[O],J=k.instance,fe=k.currentTarget;if(k=k.listener,J!==w&&b.isPropagationStopped())break e;w=k,b.currentTarget=fe;try{w(b)}catch(ve){Om(ve)}b.currentTarget=null,w=J}else for(O=0;O<p.length;O++){if(k=p[O],J=k.instance,fe=k.currentTarget,k=k.listener,J!==w&&b.isPropagationStopped())break e;w=k,b.currentTarget=fe;try{w(b)}catch(ve){Om(ve)}b.currentTarget=null,w=J}}}}function Zt(o,l){var d=l[wt];d===void 0&&(d=l[wt]=new Set);var p=o+"__bubble";d.has(p)||(fj(l,o,2,!1),d.add(p))}function j0(o,l,d){var p=0;l&&(p|=4),fj(d,o,p,l)}var yp="_reactListening"+Math.random().toString(36).slice(2);function T0(o){if(!o[yp]){o[yp]=!0,As.forEach(function(d){d!=="selectionchange"&&($9.has(d)||j0(d,!1,o),j0(d,!0,o))});var l=o.nodeType===9?o:o.ownerDocument;l===null||l[yp]||(l[yp]=!0,j0("selectionchange",!1,l))}}function fj(o,l,d,p){switch(Hj(l)){case 2:var b=gL;break;case 8:b=xL;break;default:b=$0}d=b.bind(null,l,d,o),b=void 0,!Ky||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 _0(o,l,d,p,b){var w=p;if((l&1)===0&&(l&2)===0&&p!==null)e:for(;;){if(p===null)return;var O=p.tag;if(O===3||O===4){var k=p.stateNode.containerInfo;if(k===b)break;if(O===4)for(O=p.return;O!==null;){var J=O.tag;if((J===3||J===4)&&O.stateNode.containerInfo===b)return;O=O.return}for(;k!==null;){if(O=er(k),O===null)return;if(J=O.tag,J===5||J===6||J===26||J===27){p=w=O;continue e}k=k.parentNode}}p=p.return}x2(function(){var fe=w,ve=By(d),Ee=[];e:{var me=B2.get(o);if(me!==void 0){var ye=Nm,We=o;switch(o){case"keypress":if(Tm(d)===0)break e;case"keydown":case"keyup":ye=k8;break;case"focusin":We="focus",ye=Xy;break;case"focusout":We="blur",ye=Xy;break;case"beforeblur":case"afterblur":ye=Xy;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":ye=b2;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ye=E8;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ye=U8;break;case H2:case $2:case V2:ye=j8;break;case G2:ye=F8;break;case"scroll":case"scrollend":ye=S8;break;case"wheel":ye=$8;break;case"copy":case"cut":case"paste":ye=_8;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ye=C2;break;case"toggle":case"beforetoggle":ye=G8}var ft=(l&4)!==0,Dn=!ft&&(o==="scroll"||o==="scrollend"),ie=ft?me!==null?me+"Capture":null:me;ft=[];for(var ne=fe,de;ne!==null;){var Se=ne;if(de=Se.stateNode,Se=Se.tag,Se!==5&&Se!==26&&Se!==27||de===null||ie===null||(Se=kd(ne,ie),Se!=null&&ft.push(pf(ne,Se,de))),Dn)break;ne=ne.return}0<ft.length&&(me=new ye(me,We,null,d,ve),Ee.push({event:me,listeners:ft}))}}if((l&7)===0){e:{if(me=o==="mouseover"||o==="pointerover",ye=o==="mouseout"||o==="pointerout",me&&d!==Gy&&(We=d.relatedTarget||d.fromElement)&&(er(We)||We[Qe]))break e;if((ye||me)&&(me=ve.window===ve?ve:(me=ve.ownerDocument)?me.defaultView||me.parentWindow:window,ye?(We=d.relatedTarget||d.toElement,ye=fe,We=We?er(We):null,We!==null&&(Dn=i(We),ft=We.tag,We!==Dn||ft!==5&&ft!==27&&ft!==6)&&(We=null)):(ye=null,We=fe),ye!==We)){if(ft=b2,Se="onMouseLeave",ie="onMouseEnter",ne="mouse",(o==="pointerout"||o==="pointerover")&&(ft=C2,Se="onPointerLeave",ie="onPointerEnter",ne="pointer"),Dn=ye==null?me:Pr(ye),de=We==null?me:Pr(We),me=new ft(Se,ne+"leave",ye,d,ve),me.target=Dn,me.relatedTarget=de,Se=null,er(ve)===fe&&(ft=new ft(ie,ne+"enter",We,d,ve),ft.target=de,ft.relatedTarget=Dn,Se=ft),Dn=Se,ye&&We)t:{for(ft=V9,ie=ye,ne=We,de=0,Se=ie;Se;Se=ft(Se))de++;Se=0;for(var it=ne;it;it=ft(it))Se++;for(;0<de-Se;)ie=ft(ie),de--;for(;0<Se-de;)ne=ft(ne),Se--;for(;de--;){if(ie===ne||ne!==null&&ie===ne.alternate){ft=ie;break t}ie=ft(ie),ne=ft(ne)}ft=null}else ft=null;ye!==null&&hj(Ee,me,ye,ft,!1),We!==null&&Dn!==null&&hj(Ee,Dn,We,ft,!0)}}e:{if(me=fe?Pr(fe):window,ye=me.nodeName&&me.nodeName.toLowerCase(),ye==="select"||ye==="input"&&me.type==="file")var xn=A2;else if(_2(me))if(D2)xn=e9;else{xn=Q8;var Je=X8}else ye=me.nodeName,!ye||ye.toLowerCase()!=="input"||me.type!=="checkbox"&&me.type!=="radio"?fe&&Vy(fe.elementType)&&(xn=A2):xn=J8;if(xn&&(xn=xn(o,fe))){N2(Ee,xn,d,ve);break e}Je&&Je(o,me,fe),o==="focusout"&&fe&&me.type==="number"&&fe.memoizedProps.value!=null&&$y(me,"number",me.value)}switch(Je=fe?Pr(fe):window,o){case"focusin":(_2(Je)||Je.contentEditable==="true")&&(nu=Je,rv=fe,Vd=null);break;case"focusout":Vd=rv=nu=null;break;case"mousedown":av=!0;break;case"contextmenu":case"mouseup":case"dragend":av=!1,z2(Ee,d,ve);break;case"selectionchange":if(n9)break;case"keydown":case"keyup":z2(Ee,d,ve)}var Pt;if(Jy)e:{switch(o){case"compositionstart":var Jt="onCompositionStart";break e;case"compositionend":Jt="onCompositionEnd";break e;case"compositionupdate":Jt="onCompositionUpdate";break e}Jt=void 0}else tu?j2(o,d)&&(Jt="onCompositionEnd"):o==="keydown"&&d.keyCode===229&&(Jt="onCompositionStart");Jt&&(E2&&d.locale!=="ko"&&(tu||Jt!=="onCompositionStart"?Jt==="onCompositionEnd"&&tu&&(Pt=y2()):(Di=ve,Wy="value"in Di?Di.value:Di.textContent,tu=!0)),Je=vp(fe,Jt),0<Je.length&&(Jt=new S2(Jt,o,null,d,ve),Ee.push({event:Jt,listeners:Je}),Pt?Jt.data=Pt:(Pt=T2(d),Pt!==null&&(Jt.data=Pt)))),(Pt=q8?K8(o,d):W8(o,d))&&(Jt=vp(fe,"onBeforeInput"),0<Jt.length&&(Je=new S2("onBeforeInput","beforeinput",null,d,ve),Ee.push({event:Je,listeners:Jt}),Je.data=Pt)),z9(Ee,o,fe,d,ve)}dj(Ee,l)})}function pf(o,l,d){return{instance:o,listener:l,currentTarget:d}}function vp(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=kd(o,d),b!=null&&p.unshift(pf(o,b,w)),b=kd(o,l),b!=null&&p.push(pf(o,b,w))),o.tag===3)return p;o=o.return}return[]}function V9(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5&&o.tag!==27);return o||null}function hj(o,l,d,p,b){for(var w=l._reactName,O=[];d!==null&&d!==p;){var k=d,J=k.alternate,fe=k.stateNode;if(k=k.tag,J!==null&&J===p)break;k!==5&&k!==26&&k!==27||fe===null||(J=fe,b?(fe=kd(d,w),fe!=null&&O.unshift(pf(d,fe,J))):b||(fe=kd(d,w),fe!=null&&O.push(pf(d,fe,J)))),d=d.return}O.length!==0&&o.push({event:l,listeners:O})}var G9=/\r\n?/g,B9=/\u0000|\uFFFD/g;function mj(o){return(typeof o=="string"?o:""+o).replace(G9,`
|
|
49
|
+
`).replace(B9,"")}function pj(o,l){return l=mj(l),mj(o)===l}function An(o,l,d,p,b,w){switch(d){case"children":typeof p=="string"?l==="body"||l==="textarea"&&p===""||Qc(o,p):(typeof p=="number"||typeof p=="bigint")&&l!=="body"&&Qc(o,""+p);break;case"className":Os(o,"class",p);break;case"tabIndex":Os(o,"tabindex",p);break;case"dir":case"role":case"viewBox":case"width":case"height":Os(o,d,p);break;case"style":p2(o,p,w);break;case"data":if(l!=="object"){Os(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=Rm(""+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"&&An(o,l,"name",b.name,b,null),An(o,l,"formEncType",b.formEncType,b,null),An(o,l,"formMethod",b.formMethod,b,null),An(o,l,"formTarget",b.formTarget,b,null)):(An(o,l,"encType",b.encType,b,null),An(o,l,"method",b.method,b,null),An(o,l,"target",b.target,b,null)));if(p==null||typeof p=="symbol"||typeof p=="boolean"){o.removeAttribute(d);break}p=Rm(""+p),o.setAttribute(d,p);break;case"onClick":p!=null&&(o.onclick=Uo);break;case"onScroll":p!=null&&Zt("scroll",o);break;case"onScrollEnd":p!=null&&Zt("scrollend",o);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(r(61));if(d=p.__html,d!=null){if(b.children!=null)throw Error(r(60));o.innerHTML=d}}break;case"multiple":o.multiple=p&&typeof p!="function"&&typeof p!="symbol";break;case"muted":o.muted=p&&typeof p!="function"&&typeof p!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(p==null||typeof p=="function"||typeof p=="boolean"||typeof p=="symbol"){o.removeAttribute("xlink:href");break}d=Rm(""+p),o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",d);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":p!=null&&typeof p!="function"&&typeof p!="symbol"?o.setAttribute(d,""+p):o.removeAttribute(d);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":p&&typeof p!="function"&&typeof p!="symbol"?o.setAttribute(d,""):o.removeAttribute(d);break;case"capture":case"download":p===!0?o.setAttribute(d,""):p!==!1&&p!=null&&typeof p!="function"&&typeof p!="symbol"?o.setAttribute(d,p):o.removeAttribute(d);break;case"cols":case"rows":case"size":case"span":p!=null&&typeof p!="function"&&typeof p!="symbol"&&!isNaN(p)&&1<=p?o.setAttribute(d,p):o.removeAttribute(d);break;case"rowSpan":case"start":p==null||typeof p=="function"||typeof p=="symbol"||isNaN(p)?o.removeAttribute(d):o.setAttribute(d,p);break;case"popover":Zt("beforetoggle",o),Zt("toggle",o),ir(o,"popover",p);break;case"xlinkActuate":$r(o,"http://www.w3.org/1999/xlink","xlink:actuate",p);break;case"xlinkArcrole":$r(o,"http://www.w3.org/1999/xlink","xlink:arcrole",p);break;case"xlinkRole":$r(o,"http://www.w3.org/1999/xlink","xlink:role",p);break;case"xlinkShow":$r(o,"http://www.w3.org/1999/xlink","xlink:show",p);break;case"xlinkTitle":$r(o,"http://www.w3.org/1999/xlink","xlink:title",p);break;case"xlinkType":$r(o,"http://www.w3.org/1999/xlink","xlink:type",p);break;case"xmlBase":$r(o,"http://www.w3.org/XML/1998/namespace","xml:base",p);break;case"xmlLang":$r(o,"http://www.w3.org/XML/1998/namespace","xml:lang",p);break;case"xmlSpace":$r(o,"http://www.w3.org/XML/1998/namespace","xml:space",p);break;case"is":ir(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=v8.get(d)||d,ir(o,d,p))}}function N0(o,l,d,p,b,w){switch(d){case"style":p2(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"?Qc(o,p):(typeof p=="number"||typeof p=="bigint")&&Qc(o,""+p);break;case"onScroll":p!=null&&Zt("scroll",o);break;case"onScrollEnd":p!=null&&Zt("scrollend",o);break;case"onClick":p!=null&&(o.onclick=Uo);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ua.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[Pe]||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,""):ir(o,d,p)}}}function qr(o,l,d){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Zt("error",o),Zt("load",o);var p=!1,b=!1,w;for(w in d)if(d.hasOwnProperty(w)){var O=d[w];if(O!=null)switch(w){case"src":p=!0;break;case"srcSet":b=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:An(o,l,w,O,d,null)}}b&&An(o,l,"srcSet",d.srcSet,d,null),p&&An(o,l,"src",d.src,d,null);return;case"input":Zt("invalid",o);var k=w=O=b=null,J=null,fe=null;for(p in d)if(d.hasOwnProperty(p)){var ve=d[p];if(ve!=null)switch(p){case"name":b=ve;break;case"type":O=ve;break;case"checked":J=ve;break;case"defaultChecked":fe=ve;break;case"value":w=ve;break;case"defaultValue":k=ve;break;case"children":case"dangerouslySetInnerHTML":if(ve!=null)throw Error(r(137,l));break;default:An(o,l,p,ve,d,null)}}d2(o,w,k,J,fe,O,b,!1);return;case"select":Zt("invalid",o),p=O=w=null;for(b in d)if(d.hasOwnProperty(b)&&(k=d[b],k!=null))switch(b){case"value":w=k;break;case"defaultValue":O=k;break;case"multiple":p=k;default:An(o,l,b,k,d,null)}l=w,d=O,o.multiple=!!p,l!=null?Xc(o,!!p,l,!1):d!=null&&Xc(o,!!p,d,!0);return;case"textarea":Zt("invalid",o),w=b=p=null;for(O in d)if(d.hasOwnProperty(O)&&(k=d[O],k!=null))switch(O){case"value":p=k;break;case"defaultValue":b=k;break;case"children":w=k;break;case"dangerouslySetInnerHTML":if(k!=null)throw Error(r(91));break;default:An(o,l,O,k,d,null)}h2(o,p,b,w);return;case"option":for(J in d)if(d.hasOwnProperty(J)&&(p=d[J],p!=null))switch(J){case"selected":o.selected=p&&typeof p!="function"&&typeof p!="symbol";break;default:An(o,l,J,p,d,null)}return;case"dialog":Zt("beforetoggle",o),Zt("toggle",o),Zt("cancel",o),Zt("close",o);break;case"iframe":case"object":Zt("load",o);break;case"video":case"audio":for(p=0;p<mf.length;p++)Zt(mf[p],o);break;case"image":Zt("error",o),Zt("load",o);break;case"details":Zt("toggle",o);break;case"embed":case"source":case"link":Zt("error",o),Zt("load",o);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(fe in d)if(d.hasOwnProperty(fe)&&(p=d[fe],p!=null))switch(fe){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:An(o,l,fe,p,d,null)}return;default:if(Vy(l)){for(ve in d)d.hasOwnProperty(ve)&&(p=d[ve],p!==void 0&&N0(o,l,ve,p,d,void 0));return}}for(k in d)d.hasOwnProperty(k)&&(p=d[k],p!=null&&An(o,l,k,p,d,null))}function q9(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,O=null,k=null,J=null,fe=null,ve=null;for(ye in d){var Ee=d[ye];if(d.hasOwnProperty(ye)&&Ee!=null)switch(ye){case"checked":break;case"value":break;case"defaultValue":J=Ee;default:p.hasOwnProperty(ye)||An(o,l,ye,null,p,Ee)}}for(var me in p){var ye=p[me];if(Ee=d[me],p.hasOwnProperty(me)&&(ye!=null||Ee!=null))switch(me){case"type":w=ye;break;case"name":b=ye;break;case"checked":fe=ye;break;case"defaultChecked":ve=ye;break;case"value":O=ye;break;case"defaultValue":k=ye;break;case"children":case"dangerouslySetInnerHTML":if(ye!=null)throw Error(r(137,l));break;default:ye!==Ee&&An(o,l,me,ye,p,Ee)}}Hy(o,O,k,J,fe,ve,w,b);return;case"select":ye=O=k=me=null;for(w in d)if(J=d[w],d.hasOwnProperty(w)&&J!=null)switch(w){case"value":break;case"multiple":ye=J;default:p.hasOwnProperty(w)||An(o,l,w,null,p,J)}for(b in p)if(w=p[b],J=d[b],p.hasOwnProperty(b)&&(w!=null||J!=null))switch(b){case"value":me=w;break;case"defaultValue":k=w;break;case"multiple":O=w;default:w!==J&&An(o,l,b,w,p,J)}l=k,d=O,p=ye,me!=null?Xc(o,!!d,me,!1):!!p!=!!d&&(l!=null?Xc(o,!!d,l,!0):Xc(o,!!d,d?[]:"",!1));return;case"textarea":ye=me=null;for(k in d)if(b=d[k],d.hasOwnProperty(k)&&b!=null&&!p.hasOwnProperty(k))switch(k){case"value":break;case"children":break;default:An(o,l,k,null,p,b)}for(O in p)if(b=p[O],w=d[O],p.hasOwnProperty(O)&&(b!=null||w!=null))switch(O){case"value":me=b;break;case"defaultValue":ye=b;break;case"children":break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(r(91));break;default:b!==w&&An(o,l,O,b,p,w)}f2(o,me,ye);return;case"option":for(var We in d)if(me=d[We],d.hasOwnProperty(We)&&me!=null&&!p.hasOwnProperty(We))switch(We){case"selected":o.selected=!1;break;default:An(o,l,We,null,p,me)}for(J in p)if(me=p[J],ye=d[J],p.hasOwnProperty(J)&&me!==ye&&(me!=null||ye!=null))switch(J){case"selected":o.selected=me&&typeof me!="function"&&typeof me!="symbol";break;default:An(o,l,J,me,p,ye)}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 ft in d)me=d[ft],d.hasOwnProperty(ft)&&me!=null&&!p.hasOwnProperty(ft)&&An(o,l,ft,null,p,me);for(fe in p)if(me=p[fe],ye=d[fe],p.hasOwnProperty(fe)&&me!==ye&&(me!=null||ye!=null))switch(fe){case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(r(137,l));break;default:An(o,l,fe,me,p,ye)}return;default:if(Vy(l)){for(var Dn in d)me=d[Dn],d.hasOwnProperty(Dn)&&me!==void 0&&!p.hasOwnProperty(Dn)&&N0(o,l,Dn,void 0,p,me);for(ve in p)me=p[ve],ye=d[ve],!p.hasOwnProperty(ve)||me===ye||me===void 0&&ye===void 0||N0(o,l,ve,me,p,ye);return}}for(var ie in d)me=d[ie],d.hasOwnProperty(ie)&&me!=null&&!p.hasOwnProperty(ie)&&An(o,l,ie,null,p,me);for(Ee in p)me=p[Ee],ye=d[Ee],!p.hasOwnProperty(Ee)||me===ye||me==null&&ye==null||An(o,l,Ee,me,p,ye)}function gj(o){switch(o){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function K9(){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,O=b.initiatorType,k=b.duration;if(w&&k&&gj(O)){for(O=0,k=b.responseEnd,p+=1;p<d.length;p++){var J=d[p],fe=J.startTime;if(fe>k)break;var ve=J.transferSize,Ee=J.initiatorType;ve&&gj(Ee)&&(J=J.responseEnd,O+=ve*(J<k?1:(k-fe)/(J-fe)))}if(--p,l+=8*(w+O)/(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 A0=null,D0=null;function bp(o){return o.nodeType===9?o:o.ownerDocument}function xj(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 yj(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 O0(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 I0=null;function W9(){var o=window.event;return o&&o.type==="popstate"?o===I0?!1:(I0=o,!0):(I0=null,!1)}var vj=typeof setTimeout=="function"?setTimeout:void 0,Z9=typeof clearTimeout=="function"?clearTimeout:void 0,bj=typeof Promise=="function"?Promise:void 0,Y9=typeof queueMicrotask=="function"?queueMicrotask:typeof bj<"u"?function(o){return bj.resolve(null).then(o).catch(X9)}:vj;function X9(o){setTimeout(function(){throw o})}function Wi(o){return o==="head"}function Sj(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),Nu(l);return}p--}else if(d==="$"||d==="$?"||d==="$~"||d==="$!"||d==="&")p++;else if(d==="html")gf(o.ownerDocument.documentElement);else if(d==="head"){d=o.ownerDocument.head,gf(d);for(var w=d.firstChild;w;){var O=w.nextSibling,k=w.nodeName;w[Zn]||k==="SCRIPT"||k==="STYLE"||k==="LINK"&&w.rel.toLowerCase()==="stylesheet"||d.removeChild(w),w=O}}else d==="body"&&gf(o.ownerDocument.body);d=b}while(d);Nu(l)}function Cj(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 M0(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":M0(d),Jn(d);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(d.rel.toLowerCase()==="stylesheet")continue}o.removeChild(d)}}function Q9(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[Zn])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=xs(o.nextSibling),o===null)break}return null}function J9(o,l,d){if(l==="")return null;for(;o.nodeType!==3;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!d||(o=xs(o.nextSibling),o===null))return null;return o}function Ej(o,l){for(;o.nodeType!==8;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!l||(o=xs(o.nextSibling),o===null))return null;return o}function k0(o){return o.data==="$?"||o.data==="$~"}function L0(o){return o.data==="$!"||o.data==="$?"&&o.ownerDocument.readyState!=="loading"}function eL(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 xs(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 P0=null;function wj(o){o=o.nextSibling;for(var l=0;o;){if(o.nodeType===8){var d=o.data;if(d==="/$"||d==="/&"){if(l===0)return xs(o.nextSibling);l--}else d!=="$"&&d!=="$!"&&d!=="$?"&&d!=="$~"&&d!=="&"||l++}o=o.nextSibling}return null}function Rj(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 jj(o,l,d){switch(l=bp(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 gf(o){for(var l=o.attributes;l.length;)o.removeAttributeNode(l[0]);Jn(o)}var ys=new Map,Tj=new Set;function Sp(o){return typeof o.getRootNode=="function"?o.getRootNode():o.nodeType===9?o:o.ownerDocument}var ei=F.d;F.d={f:tL,r:nL,D:rL,C:aL,L:sL,m:oL,X:lL,S:iL,M:cL};function tL(){var o=ei.f(),l=fp();return o||l}function nL(o){var l=an(o);l!==null&&l.tag===5&&l.type==="form"?Gw(l):ei.r(o)}var ju=typeof document>"u"?null:document;function _j(o,l,d){var p=ju;if(p&&typeof l=="string"&&l){var b=us(l);b='link[rel="'+o+'"][href="'+b+'"]',typeof d=="string"&&(b+='[crossorigin="'+d+'"]'),Tj.has(b)||(Tj.add(b),o={rel:o,crossOrigin:d,href:l},p.querySelector(b)===null&&(l=p.createElement("link"),qr(l,"link",o),Bn(l),p.head.appendChild(l)))}}function rL(o){ei.D(o),_j("dns-prefetch",o,null)}function aL(o,l){ei.C(o,l),_j("preconnect",o,l)}function sL(o,l,d){ei.L(o,l,d);var p=ju;if(p&&o&&l){var b='link[rel="preload"][as="'+us(l)+'"]';l==="image"&&d&&d.imageSrcSet?(b+='[imagesrcset="'+us(d.imageSrcSet)+'"]',typeof d.imageSizes=="string"&&(b+='[imagesizes="'+us(d.imageSizes)+'"]')):b+='[href="'+us(o)+'"]';var w=b;switch(l){case"style":w=Tu(o);break;case"script":w=_u(o)}ys.has(w)||(o=g({rel:"preload",href:l==="image"&&d&&d.imageSrcSet?void 0:o,as:l},d),ys.set(w,o),p.querySelector(b)!==null||l==="style"&&p.querySelector(xf(w))||l==="script"&&p.querySelector(yf(w))||(l=p.createElement("link"),qr(l,"link",o),Bn(l),p.head.appendChild(l)))}}function oL(o,l){ei.m(o,l);var d=ju;if(d&&o){var p=l&&typeof l.as=="string"?l.as:"script",b='link[rel="modulepreload"][as="'+us(p)+'"][href="'+us(o)+'"]',w=b;switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":w=_u(o)}if(!ys.has(w)&&(o=g({rel:"modulepreload",href:o},l),ys.set(w,o),d.querySelector(b)===null)){switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(d.querySelector(yf(w)))return}p=d.createElement("link"),qr(p,"link",o),Bn(p),d.head.appendChild(p)}}}function iL(o,l,d){ei.S(o,l,d);var p=ju;if(p&&o){var b=Sa(p).hoistableStyles,w=Tu(o);l=l||"default";var O=b.get(w);if(!O){var k={loading:0,preload:null};if(O=p.querySelector(xf(w)))k.loading=5;else{o=g({rel:"stylesheet",href:o,"data-precedence":l},d),(d=ys.get(w))&&U0(o,d);var J=O=p.createElement("link");Bn(J),qr(J,"link",o),J._p=new Promise(function(fe,ve){J.onload=fe,J.onerror=ve}),J.addEventListener("load",function(){k.loading|=1}),J.addEventListener("error",function(){k.loading|=2}),k.loading|=4,Cp(O,l,p)}O={type:"stylesheet",instance:O,count:1,state:k},b.set(w,O)}}}function lL(o,l){ei.X(o,l);var d=ju;if(d&&o){var p=Sa(d).hoistableScripts,b=_u(o),w=p.get(b);w||(w=d.querySelector(yf(b)),w||(o=g({src:o,async:!0},l),(l=ys.get(b))&&z0(o,l),w=d.createElement("script"),Bn(w),qr(w,"link",o),d.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},p.set(b,w))}}function cL(o,l){ei.M(o,l);var d=ju;if(d&&o){var p=Sa(d).hoistableScripts,b=_u(o),w=p.get(b);w||(w=d.querySelector(yf(b)),w||(o=g({src:o,async:!0,type:"module"},l),(l=ys.get(b))&&z0(o,l),w=d.createElement("script"),Bn(w),qr(w,"link",o),d.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},p.set(b,w))}}function Nj(o,l,d,p){var b=(b=se.current)?Sp(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=Tu(d.href),d=Sa(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=Tu(d.href);var w=Sa(b).hoistableStyles,O=w.get(o);if(O||(b=b.ownerDocument||b,O={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},w.set(o,O),(w=b.querySelector(xf(o)))&&!w._p&&(O.instance=w,O.state.loading=5),ys.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},ys.set(o,d),w||uL(b,o,d,O.state))),l&&p===null)throw Error(r(528,""));return O}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=_u(d),d=Sa(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 Tu(o){return'href="'+us(o)+'"'}function xf(o){return'link[rel="stylesheet"]['+o+"]"}function Aj(o){return g({},o,{"data-precedence":o.precedence,precedence:null})}function uL(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}),qr(l,"link",d),Bn(l),o.head.appendChild(l))}function _u(o){return'[src="'+us(o)+'"]'}function yf(o){return"script[async]"+o}function Dj(o,l,d){if(l.count++,l.instance===null)switch(l.type){case"style":var p=o.querySelector('style[data-href~="'+us(d.href)+'"]');if(p)return l.instance=p,Bn(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"),Bn(p),qr(p,"style",b),Cp(p,d.precedence,o),l.instance=p;case"stylesheet":b=Tu(d.href);var w=o.querySelector(xf(b));if(w)return l.state.loading|=4,l.instance=w,Bn(w),w;p=Aj(d),(b=ys.get(b))&&U0(p,b),w=(o.ownerDocument||o).createElement("link"),Bn(w);var O=w;return O._p=new Promise(function(k,J){O.onload=k,O.onerror=J}),qr(w,"link",p),l.state.loading|=4,Cp(w,d.precedence,o),l.instance=w;case"script":return w=_u(d.src),(b=o.querySelector(yf(w)))?(l.instance=b,Bn(b),b):(p=d,(b=ys.get(w))&&(p=g({},d),z0(p,b)),o=o.ownerDocument||o,b=o.createElement("script"),Bn(b),qr(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,Cp(p,d.precedence,o));return l.instance}function Cp(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,O=0;O<p.length;O++){var k=p[O];if(k.dataset.precedence===l)w=k;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 U0(o,l){o.crossOrigin==null&&(o.crossOrigin=l.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=l.referrerPolicy),o.title==null&&(o.title=l.title)}function z0(o,l){o.crossOrigin==null&&(o.crossOrigin=l.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=l.referrerPolicy),o.integrity==null&&(o.integrity=l.integrity)}var Ep=null;function Oj(o,l,d){if(Ep===null){var p=new Map,b=Ep=new Map;b.set(d,p)}else b=Ep,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[Zn]||w[Le]||o==="link"&&w.getAttribute("rel")==="stylesheet")&&w.namespaceURI!=="http://www.w3.org/2000/svg"){var O=w.getAttribute(l)||"";O=o+O;var k=p.get(O);k?k.push(w):p.set(O,[w])}}return p}function Ij(o,l,d){o=o.ownerDocument||o,o.head.insertBefore(d,l==="title"?o.querySelector("head > title"):null)}function dL(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 Mj(o){return!(o.type==="stylesheet"&&(o.state.loading&3)===0)}function fL(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=Tu(p.href),w=l.querySelector(xf(b));if(w){l=w._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(o.count++,o=wp.bind(o),l.then(o,o)),d.state.loading|=4,d.instance=w,Bn(w);return}w=l.ownerDocument||l,p=Aj(p),(b=ys.get(b))&&U0(p,b),w=w.createElement("link"),Bn(w);var O=w;O._p=new Promise(function(k,J){O.onload=k,O.onerror=J}),qr(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=wp.bind(o),l.addEventListener("load",d),l.addEventListener("error",d))}}var F0=0;function hL(o,l){return o.stylesheets&&o.count===0&&jp(o,o.stylesheets),0<o.count||0<o.imgCount?function(d){var p=setTimeout(function(){if(o.stylesheets&&jp(o,o.stylesheets),o.unsuspend){var w=o.unsuspend;o.unsuspend=null,w()}},6e4+l);0<o.imgBytes&&F0===0&&(F0=62500*K9());var b=setTimeout(function(){if(o.waitingForImages=!1,o.count===0&&(o.stylesheets&&jp(o,o.stylesheets),o.unsuspend)){var w=o.unsuspend;o.unsuspend=null,w()}},(o.imgBytes>F0?50:800)+l);return o.unsuspend=d,function(){o.unsuspend=null,clearTimeout(p),clearTimeout(b)}}:null}function wp(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)jp(this,this.stylesheets);else if(this.unsuspend){var o=this.unsuspend;this.unsuspend=null,o()}}}var Rp=null;function jp(o,l){o.stylesheets=null,o.unsuspend!==null&&(o.count++,Rp=new Map,l.forEach(mL,o),Rp=null,wp.call(o))}function mL(o,l){if(!(l.state.loading&4)){var d=Rp.get(o);if(d)var p=d.get(null);else{d=new Map,Rp.set(o,d);for(var b=o.querySelectorAll("link[data-precedence],style[data-precedence]"),w=0;w<b.length;w++){var O=b[w];(O.nodeName==="LINK"||O.getAttribute("media")!=="not all")&&(d.set(O.dataset.precedence,O),p=O)}p&&d.set(null,p)}b=l.instance,O=b.getAttribute("data-precedence"),w=d.get(O)||p,w===p&&d.set(null,b),d.set(O,b),this.count++,p=wp.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 vf={$$typeof:T,Provider:null,Consumer:null,_currentValue:U,_currentValue2:U,_threadCount:0};function pL(o,l,d,p,b,w,O,k,J){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=Gn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Gn(0),this.hiddenUpdates=Gn(null),this.identifierPrefix=p,this.onUncaughtError=b,this.onCaughtError=w,this.onRecoverableError=O,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=J,this.incompleteTransitions=new Map}function kj(o,l,d,p,b,w,O,k,J,fe,ve,Ee){return o=new pL(o,l,d,O,J,fe,ve,Ee,k),l=1,w===!0&&(l|=24),w=Fa(3,null,null,l),o.current=w,w.stateNode=o,l=vv(),l.refCount++,o.pooledCache=l,l.refCount++,w.memoizedState={element:p,isDehydrated:d,cache:l},Ev(w),o}function Lj(o){return o?(o=su,o):su}function Pj(o,l,d,p,b,w){b=Lj(b),p.context===null?p.context=b:p.pendingContext=b,p=Pi(l),p.payload={element:d},w=w===void 0?null:w,w!==null&&(p.callback=w),d=Ui(o,p,l),d!==null&&(Ta(d,o,l),Yd(d,o,l))}function Uj(o,l){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var d=o.retryLane;o.retryLane=d!==0&&d<l?d:l}}function H0(o,l){Uj(o,l),(o=o.alternate)&&Uj(o,l)}function zj(o){if(o.tag===13||o.tag===31){var l=Wl(o,67108864);l!==null&&Ta(l,o,67108864),H0(o,67108864)}}function Fj(o){if(o.tag===13||o.tag===31){var l=Ba();l=ue(l);var d=Wl(o,l);d!==null&&Ta(d,o,l),H0(o,l)}}var Tp=!0;function gL(o,l,d,p){var b=D.T;D.T=null;var w=F.p;try{F.p=2,$0(o,l,d,p)}finally{F.p=w,D.T=b}}function xL(o,l,d,p){var b=D.T;D.T=null;var w=F.p;try{F.p=8,$0(o,l,d,p)}finally{F.p=w,D.T=b}}function $0(o,l,d,p){if(Tp){var b=V0(p);if(b===null)_0(o,l,p,_p,d),$j(o,p);else if(vL(b,o,l,d,p))p.stopPropagation();else if($j(o,p),l&4&&-1<yL.indexOf(o)){for(;b!==null;){var w=an(b);if(w!==null)switch(w.tag){case 3:if(w=w.stateNode,w.current.memoizedState.isDehydrated){var O=Ln(w.pendingLanes);if(O!==0){var k=w;for(k.pendingLanes|=2,k.entangledLanes|=2;O;){var J=1<<31-Vn(O);k.entanglements[1]|=J,O&=~J}oo(w),(Sn&6)===0&&(up=Te()+500,hf(0))}}break;case 31:case 13:k=Wl(w,2),k!==null&&Ta(k,w,2),fp(),H0(w,2)}if(w=V0(p),w===null&&_0(o,l,p,_p,d),w===b)break;b=w}b!==null&&p.stopPropagation()}else _0(o,l,p,null,d)}}function V0(o){return o=By(o),G0(o)}var _p=null;function G0(o){if(_p=null,o=er(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 _p=o,null}function Hj(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(Oe()){case je:return 2;case Ve:return 8;case lt:case dt:return 32;case vn:return 268435456;default:return 32}default:return 32}}var B0=!1,Zi=null,Yi=null,Xi=null,bf=new Map,Sf=new Map,Qi=[],yL="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 $j(o,l){switch(o){case"focusin":case"focusout":Zi=null;break;case"dragenter":case"dragleave":Yi=null;break;case"mouseover":case"mouseout":Xi=null;break;case"pointerover":case"pointerout":bf.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":Sf.delete(l.pointerId)}}function Cf(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=an(l),l!==null&&zj(l)),o):(o.eventSystemFlags|=p,l=o.targetContainers,b!==null&&l.indexOf(b)===-1&&l.push(b),o)}function vL(o,l,d,p,b){switch(l){case"focusin":return Zi=Cf(Zi,o,l,d,p,b),!0;case"dragenter":return Yi=Cf(Yi,o,l,d,p,b),!0;case"mouseover":return Xi=Cf(Xi,o,l,d,p,b),!0;case"pointerover":var w=b.pointerId;return bf.set(w,Cf(bf.get(w)||null,o,l,d,p,b)),!0;case"gotpointercapture":return w=b.pointerId,Sf.set(w,Cf(Sf.get(w)||null,o,l,d,p,b)),!0}return!1}function Vj(o){var l=er(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,Ke(o.priority,function(){Fj(d)});return}}else if(l===31){if(l=u(d),l!==null){o.blockedOn=l,Ke(o.priority,function(){Fj(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=V0(o.nativeEvent);if(d===null){d=o.nativeEvent;var p=new d.constructor(d.type,d);Gy=p,d.target.dispatchEvent(p),Gy=null}else return l=an(d),l!==null&&zj(l),o.blockedOn=d,!1;l.shift()}return!0}function Gj(o,l,d){Np(o)&&d.delete(l)}function bL(){B0=!1,Zi!==null&&Np(Zi)&&(Zi=null),Yi!==null&&Np(Yi)&&(Yi=null),Xi!==null&&Np(Xi)&&(Xi=null),bf.forEach(Gj),Sf.forEach(Gj)}function Ap(o,l){o.blockedOn===l&&(o.blockedOn=null,B0||(B0=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,bL)))}var Dp=null;function Bj(o){Dp!==o&&(Dp=o,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Dp===o&&(Dp=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(G0(p||d)===null)continue;break}var w=an(d);w!==null&&(o.splice(l,3),l-=3,Vv(w,{pending:!0,data:b,method:d.method,action:p},p,b))}}))}function Nu(o){function l(J){return Ap(J,o)}Zi!==null&&Ap(Zi,o),Yi!==null&&Ap(Yi,o),Xi!==null&&Ap(Xi,o),bf.forEach(l),Sf.forEach(l);for(var d=0;d<Qi.length;d++){var p=Qi[d];p.blockedOn===o&&(p.blockedOn=null)}for(;0<Qi.length&&(d=Qi[0],d.blockedOn===null);)Vj(d),d.blockedOn===null&&Qi.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],O=b[Pe]||null;if(typeof w=="function")O||Bj(d);else if(O){var k=null;if(w&&w.hasAttribute("formAction")){if(b=w,O=w[Pe]||null)k=O.formAction;else if(G0(b)!==null)continue}else k=O.action;typeof k=="function"?d[p+1]=k:(d.splice(p,3),p-=3),Bj(d)}}}function qj(){function o(w){w.canIntercept&&w.info==="react-transition"&&w.intercept({handler:function(){return new Promise(function(O){return b=O})},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 q0(o){this._internalRoot=o}Op.prototype.render=q0.prototype.render=function(o){var l=this._internalRoot;if(l===null)throw Error(r(409));var d=l.current,p=Ba();Pj(d,p,o,l,null,null)},Op.prototype.unmount=q0.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var l=o.containerInfo;Pj(o.current,2,null,o,null,null),fp(),l[Qe]=null}};function Op(o){this._internalRoot=o}Op.prototype.unstable_scheduleHydration=function(o){if(o){var l=Ne();o={blockedOn:null,target:o,priority:l};for(var d=0;d<Qi.length&&l!==0&&l<Qi[d].priority;d++);Qi.splice(d,0,o),d===0&&Vj(o)}};var Kj=t.version;if(Kj!=="19.2.3")throw Error(r(527,Kj,"19.2.3"));F.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?x(o):null,o=o===null?null:o.stateNode,o};var SL={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:D,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ip=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ip.isDisabled&&Ip.supportsFiber)try{La=Ip.inject(SL),bn=Ip}catch{}}return wf.createRoot=function(o,l){if(!s(o))throw Error(r(299));var d=!1,p="",b=eR,w=tR,O=nR;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&&(O=l.onRecoverableError)),l=kj(o,1,!1,null,null,d,p,null,b,w,O,qj),o[Qe]=l.current,T0(o),new q0(l)},wf.hydrateRoot=function(o,l,d){if(!s(o))throw Error(r(299));var p=!1,b="",w=eR,O=tR,k=nR,J=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&&(O=d.onCaughtError),d.onRecoverableError!==void 0&&(k=d.onRecoverableError),d.formState!==void 0&&(J=d.formState)),l=kj(o,1,!0,l,d??null,p,b,J,w,O,k,qj),l.context=Lj(null),d=l.current,p=Ba(),p=ue(p),b=Pi(p),b.callback=null,Ui(d,b,p),d=p,l.current.lanes=d,dn(l,d),oo(l),o[Qe]=l.current,T0(o),new Op(l)},wf.version="19.2.3",wf}var rT;function IL(){if(rT)return Z0.exports;rT=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(),Z0.exports=OL(),Z0.exports}var ML=IL();/**
|
|
50
|
+
* react-router v7.12.0
|
|
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 NA=e=>{throw TypeError(e)},kL=(e,t,n)=>t.has(e)||NA("Cannot "+n),J0=(e,t,n)=>(kL(e,t,"read from private field"),n?n.call(e):t.get(e)),LL=(e,t,n)=>t.has(e)?NA("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),aT="popstate";function PL(e={}){function t(r,s){let{pathname:i,search:c,hash:u}=r.location;return nh("",{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:To(s)}return zL(t,n,null,e)}function Bt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Xn(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function UL(){return Math.random().toString(36).substring(2,10)}function sT(e,t){return{usr:e.state,key:e.key,idx:t}}function nh(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?wl(t):t,state:n,key:t&&t.key||r||UL()}}function To({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 wl(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 zL(e,t,n,r={}){let{window:s=document.defaultView,v5Compat:i=!1}=r,c=s.history,u="POP",f=null,m=x();m==null&&(m=0,c.replaceState({...c.state,idx:m},""));function x(){return(c.state||{idx:null}).idx}function g(){u="POP";let E=x(),j=E==null?null:E-m;m=E,f&&f({action:u,location:S.location,delta:j})}function y(E,j){u="PUSH";let R=nh(S.location,E,j);m=x()+1;let T=sT(R,m),N=S.createHref(R);try{c.pushState(T,"",N)}catch(A){if(A instanceof DOMException&&A.name==="DataCloneError")throw A;s.location.assign(N)}i&&f&&f({action:u,location:S.location,delta:1})}function v(E,j){u="REPLACE";let R=nh(S.location,E,j);m=x();let T=sT(R,m),N=S.createHref(R);c.replaceState(T,"",N),i&&f&&f({action:u,location:S.location,delta:0})}function C(E){return AA(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(aT,g),f=E,()=>{s.removeEventListener(aT,g),f=null}},createHref(E){return t(s,E)},createURL:C,encodeLocation(E){let j=C(E);return{pathname:j.pathname,search:j.search,hash:j.hash}},push:y,replace:v,go(E){return c.go(E)}};return S}function AA(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Bt(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:To(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}var Uf,oT=class{constructor(e){if(LL(this,Uf,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(J0(this,Uf).has(e))return J0(this,Uf).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){J0(this,Uf).set(e,t)}};Uf=new WeakMap;var FL=new Set(["lazy","caseSensitive","path","id","index","children"]);function HL(e){return FL.has(e)}var $L=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function VL(e){return $L.has(e)}function GL(e){return e.index===!0}function rh(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(Bt(i.index!==!0||!i.children,"Cannot specify children on an index route"),Bt(s||!r[f],`Found a route id collision on id "${f}". Route id's must be globally unique within Data Router usages`),GL(i)){let m={...i,id:f};return r[f]=iT(m,t(m)),m}else{let m={...i,id:f,children:void 0};return r[f]=iT(m,t(m)),i.children&&(m.children=rh(i.children,t,u,r,s)),m}})}function iT(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function ol(e,t,n="/"){return zf(e,t,n,!1)}function zf(e,t,n,r){let s=typeof t=="string"?wl(t):t,i=Es(s.pathname||"/",n);if(i==null)return null;let c=DA(e);qL(c);let u=null;for(let f=0;u==null&&f<c.length;++f){let m=r7(i);u=t7(c[f],m,r)}return u}function BL(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 DA(e,t=[],n=[],r="",s=!1){let i=(c,u,f=s,m)=>{let x={relativePath:m===void 0?c.path||"":m,caseSensitive:c.caseSensitive===!0,childrenIndex:u,route:c};if(x.relativePath.startsWith("/")){if(!x.relativePath.startsWith(r)&&f)return;Bt(x.relativePath.startsWith(r),`Absolute route path "${x.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),x.relativePath=x.relativePath.slice(r.length)}let g=bo([r,x.relativePath]),y=n.concat(x);c.children&&c.children.length>0&&(Bt(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),DA(c.children,t,y,g,f)),!(c.path==null&&!c.index)&&t.push({path:g,score:JL(g,c.index),routesMeta:y})};return e.forEach((c,u)=>{var f;if(c.path===""||!((f=c.path)!=null&&f.includes("?")))i(c,u);else for(let m of OA(c.path))i(c,u,!0,m)}),t}function OA(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=OA(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 qL(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:e7(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var KL=/^:[\w-]+$/,WL=3,ZL=2,YL=1,XL=10,QL=-2,lT=e=>e==="*";function JL(e,t){let n=e.split("/"),r=n.length;return n.some(lT)&&(r+=QL),t&&(r+=ZL),n.filter(s=>!lT(s)).reduce((s,i)=>s+(KL.test(i)?WL:i===""?YL:XL),r)}function e7(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 t7(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,x=i==="/"?t:t.slice(i.length)||"/",g=jg({path:f.relativePath,caseSensitive:f.caseSensitive,end:m},x),y=f.route;if(!g&&m&&n&&!r[r.length-1].route.index&&(g=jg({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},x)),!g)return null;Object.assign(s,g.params),c.push({params:s,pathname:bo([i,g.pathname]),pathnameBase:o7(bo([i,g.pathnameBase])),route:y}),g.pathnameBase!=="/"&&(i=bo([i,g.pathnameBase]))}return c}function jg(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=n7(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:x,isOptional:g},y)=>{if(x==="*"){let C=u[y]||"";c=i.slice(0,i.length-C.length).replace(/(.)\/+$/,"$1")}const v=u[y];return g&&!v?m[x]=void 0:m[x]=(v||"").replace(/%2F/g,"/"),m},{}),pathname:i,pathnameBase:c,pattern:e}}function n7(e,t=!1,n=!0){Xn(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 r7(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Xn(!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 Es(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 a7({basename:e,pathname:t}){return t==="/"?e:bo([e,t])}var IA=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,yx=e=>IA.test(e);function s7(e,t="/"){let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?wl(e):e,i;if(n)if(yx(n))i=n;else{if(n.includes("//")){let c=n;n=n.replace(/\/\/+/g,"/"),Xn(!1,`Pathnames cannot have embedded double slashes - normalizing ${c} -> ${n}`)}n.startsWith("/")?i=cT(n.substring(1),"/"):i=cT(n,t)}else i=t;return{pathname:i,search:i7(r),hash:l7(s)}}function cT(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 eb(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 MA(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function vx(e){let t=MA(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function bx(e,t,n,r=!1){let s;typeof e=="string"?s=wl(e):(s={...e},Bt(!s.pathname||!s.pathname.includes("?"),eb("?","pathname","search",s)),Bt(!s.pathname||!s.pathname.includes("#"),eb("#","pathname","hash",s)),Bt(!s.search||!s.search.includes("#"),eb("#","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 y=c.split("/");for(;y[0]==="..";)y.shift(),g-=1;s.pathname=y.join("/")}u=g>=0?t[g]:"/"}let f=s7(s,u),m=c&&c!=="/"&&c.endsWith("/"),x=(i||c===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(m||x)&&(f.pathname+="/"),f}var bo=e=>e.join("/").replace(/\/\/+/g,"/"),o7=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),i7=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,l7=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Eh=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 ah(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function wh(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var kA=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function LA(e,t){let n=e;if(typeof n!="string"||!IA.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,s=!1;if(kA)try{let i=new URL(window.location.href),c=n.startsWith("//")?new URL(i.protocol+n):new URL(n),u=Es(c.pathname,t);c.origin===i.origin&&u!=null?n=u+c.search+c.hash:s=!0}catch{Xn(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:s,to:n}}var dl=Symbol("Uninstrumented");function c7(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=qu(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=qu(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[dl]??i,u=qu(n[s],c,(...f)=>uT(f[0]));u&&(s==="loader"&&c.hydrate===!0&&(u.hydrate=!0),u[dl]=c,r[s]=u)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(s=>{let i=s[dl]??s,c=qu(n.middleware,i,(...u)=>uT(u[0]));return c?(c[dl]=i,c):s})),r}function u7(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[dl]??e.navigate,s=qu(n.navigate,r,(...i)=>{let[c,u]=i;return{to:typeof c=="number"||typeof c=="string"?c:c?To(c):".",...dT(e,u??{})}});s&&(s[dl]=r,e.navigate=s)}if(n.fetch.length>0){let r=e.fetch[dl]??e.fetch,s=qu(n.fetch,r,(...i)=>{let[c,,u,f]=i;return{href:u??".",fetcherKey:c,...dT(e,f??{})}});s&&(s[dl]=r,e.fetch=s)}return e}function qu(e,t,n){return e.length===0?null:async(...r)=>{let s=await PA(e,n(...r),()=>t(...r),e.length-1);if(s.type==="error")throw s.value;return s.value}}async function PA(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=PA(e,t,n,r-1),i=await c,Bt(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 uT(e){let{request:t,context:n,params:r,unstable_pattern:s}=e;return{request:d7(t),params:{...r},unstable_pattern:s,context:f7(n)}}function dT(e,t){return{currentUrl:To(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 d7(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function f7(e){if(m7(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var h7=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function m7(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")===h7}var UA=["POST","PUT","PATCH","DELETE"],p7=new Set(UA),g7=["GET",...UA],x7=new Set(g7),zA=new Set([301,302,303,307,308]),y7=new Set([307,308]),tb={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},v7={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Rf={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},b7=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),FA="remix-router-transitions",HA=Symbol("ResetLoaderData");function S7(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";Bt(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let r=e.hydrationRouteProperties||[],s=e.mapRouteProperties||b7,i=s;if(e.unstable_instrumentations){let X=e.unstable_instrumentations;i=te=>({...s(te),...c7(X.map(ue=>ue.route).filter(Boolean),te)})}let c={},u=rh(e.routes,i,void 0,c),f,m=e.basename||"/";m.startsWith("/")||(m=`/${m}`);let x=e.dataStrategy||j7,g={...e.future},y=null,v=new Set,C=null,S=null,E=null,j=e.hydrationData!=null,R=ol(u,e.history.location,m),T=!1,N=null,A;if(R==null&&!e.patchRoutesOnNavigation){let X=vs(404,{pathname:e.history.location.pathname}),{matches:te,route:ue}=Mp(u);A=!0,R=te,N={[ue.id]:X}}else if(R&&!e.hydrationData&&rn(R,u,e.history.location.pathname).active&&(R=null),R)if(R.some(X=>X.route.lazy))A=!1;else if(!R.some(X=>PS(X.route)))A=!0;else{let X=e.hydrationData?e.hydrationData.loaderData:null,te=e.hydrationData?e.hydrationData.errors:null;if(te){let ue=R.findIndex(Ce=>te[Ce.route.id]!==void 0);A=R.slice(0,ue+1).every(Ce=>!m1(Ce.route,X,te))}else A=R.every(ue=>!m1(ue.route,X,te))}else{A=!1,R=[];let X=rn(null,u,e.history.location.pathname);X.active&&X.matches&&(T=!0,R=X.matches)}let I,_={historyAction:e.history.action,location:e.history.location,matches:R,initialized:A,navigation:tb,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||N,fetchers:new Map,blockers:new Map},M="POP",G=null,H=!1,L,q=!1,W=new Map,B=null,V=!1,D=!1,F=new Set,U=new Map,ee=0,he=-1,z=new Map,$=new Set,P=new Map,K=new Map,Y=new Set,se=new Map,Q,le=null;function pe(){if(y=e.history.listen(({action:X,location:te,delta:ue})=>{if(Q){Q(),Q=void 0;return}Xn(se.size===0||ue!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let Ce=Ns({currentLocation:_.location,nextLocation:te,historyAction:X});if(Ce&&ue!=null){let Ne=new Promise(Ke=>{Q=Ke});e.history.go(ue*-1),Pa(Ce,{state:"blocked",location:te,proceed(){Pa(Ce,{state:"proceeding",proceed:void 0,reset:void 0,location:te}),Ne.then(()=>e.history.go(ue))},reset(){let Ke=new Map(_.blockers);Ke.set(Ce,Rf),Re({blockers:Ke})}}),G==null||G.resolve(),G=null;return}return He(X,te)}),n){G7(t,W);let X=()=>B7(t,W);t.addEventListener("pagehide",X),B=()=>t.removeEventListener("pagehide",X)}return _.initialized||He("POP",_.location,{initialHydration:!0}),I}function be(){y&&y(),B&&B(),v.clear(),L&&L.abort(),_.fetchers.forEach((X,te)=>$n(te)),_.blockers.forEach((X,te)=>kr(te))}function ze(X){return v.add(X),()=>v.delete(X)}function Re(X,te={}){X.matches&&(X.matches=X.matches.map(Ne=>{let Ke=c[Ne.route.id],Be=Ne.route;return Be.element!==Ke.element||Be.errorElement!==Ke.errorElement||Be.hydrateFallbackElement!==Ke.hydrateFallbackElement?{...Ne,route:Ke}:Ne})),_={..._,...X};let ue=[],Ce=[];_.fetchers.forEach((Ne,Ke)=>{Ne.state==="idle"&&(Y.has(Ke)?ue.push(Ke):Ce.push(Ke))}),Y.forEach(Ne=>{!_.fetchers.has(Ne)&&!U.has(Ne)&&ue.push(Ne)}),[...v].forEach(Ne=>Ne(_,{deletedFetchers:ue,newErrors:X.errors??null,viewTransitionOpts:te.viewTransitionOpts,flushSync:te.flushSync===!0})),ue.forEach(Ne=>$n(Ne)),Ce.forEach(Ne=>_.fetchers.delete(Ne))}function Ge(X,te,{flushSync:ue}={}){var wt,nt;let Ce=_.actionData!=null&&_.navigation.formMethod!=null&&ea(_.navigation.formMethod)&&_.navigation.state==="loading"&&((wt=X.state)==null?void 0:wt._isRedirect)!==!0,Ne;te.actionData?Object.keys(te.actionData).length>0?Ne=te.actionData:Ne=null:Ce?Ne=_.actionData:Ne=null;let Ke=te.loaderData?ST(_.loaderData,te.loaderData,te.matches||[],te.errors):_.loaderData,Be=_.blockers;Be.size>0&&(Be=new Map(Be),Be.forEach((Ot,Kt)=>Be.set(Kt,Rf)));let Le=V?!1:cn(X,te.matches||_.matches),Pe=H===!0||_.navigation.formMethod!=null&&ea(_.navigation.formMethod)&&((nt=X.state)==null?void 0:nt._isRedirect)!==!0;f&&(u=f,f=void 0),V||M==="POP"||(M==="PUSH"?e.history.push(X,X.state):M==="REPLACE"&&e.history.replace(X,X.state));let Qe;if(M==="POP"){let Ot=W.get(_.location.pathname);Ot&&Ot.has(X.pathname)?Qe={currentLocation:_.location,nextLocation:X}:W.has(X.pathname)&&(Qe={currentLocation:X,nextLocation:_.location})}else if(q){let Ot=W.get(_.location.pathname);Ot?Ot.add(X.pathname):(Ot=new Set([X.pathname]),W.set(_.location.pathname,Ot)),Qe={currentLocation:_.location,nextLocation:X}}Re({...te,actionData:Ne,loaderData:Ke,historyAction:M,location:X,initialized:!0,navigation:tb,revalidation:"idle",restoreScrollPosition:Le,preventScrollReset:Pe,blockers:Be},{viewTransitionOpts:Qe,flushSync:ue===!0}),M="POP",H=!1,q=!1,V=!1,D=!1,G==null||G.resolve(),G=null,le==null||le.resolve(),le=null}async function ot(X,te){if(G==null||G.resolve(),G=null,typeof X=="number"){G||(G=RT());let Kt=G.promise;return e.history.go(X),Kt}let ue=h1(_.location,_.matches,m,X,te==null?void 0:te.fromRouteId,te==null?void 0:te.relative),{path:Ce,submission:Ne,error:Ke}=fT(!1,ue,te),Be=_.location,Le=nh(_.location,Ce,te&&te.state);Le={...Le,...e.history.encodeLocation(Le)};let Pe=te&&te.replace!=null?te.replace:void 0,Qe="PUSH";Pe===!0?Qe="REPLACE":Pe===!1||Ne!=null&&ea(Ne.formMethod)&&Ne.formAction===_.location.pathname+_.location.search&&(Qe="REPLACE");let wt=te&&"preventScrollReset"in te?te.preventScrollReset===!0:void 0,nt=(te&&te.flushSync)===!0,Ot=Ns({currentLocation:Be,nextLocation:Le,historyAction:Qe});if(Ot){Pa(Ot,{state:"blocked",location:Le,proceed(){Pa(Ot,{state:"proceeding",proceed:void 0,reset:void 0,location:Le}),ot(X,te)},reset(){let Kt=new Map(_.blockers);Kt.set(Ot,Rf),Re({blockers:Kt})}});return}await He(Qe,Le,{submission:Ne,pendingError:Ke,preventScrollReset:wt,replace:te&&te.replace,enableViewTransition:te&&te.viewTransition,flushSync:nt,callSiteDefaultShouldRevalidate:te&&te.unstable_defaultShouldRevalidate})}function Vt(){le||(le=RT()),Ve(),Re({revalidation:"loading"});let X=le.promise;return _.navigation.state==="submitting"?X:_.navigation.state==="idle"?(He(_.historyAction,_.location,{startUninterruptedRevalidation:!0}),X):(He(M||_.historyAction,_.navigation.location,{overrideNavigation:_.navigation,enableViewTransition:q===!0}),X)}async function He(X,te,ue){L&&L.abort(),L=null,M=X,V=(ue&&ue.startUninterruptedRevalidation)===!0,nn(_.location,_.matches),H=(ue&&ue.preventScrollReset)===!0,q=(ue&&ue.enableViewTransition)===!0;let Ce=f||u,Ne=ue&&ue.overrideNavigation,Ke=ue!=null&&ue.initialHydration&&_.matches&&_.matches.length>0&&!T?_.matches:ol(Ce,te,m),Be=(ue&&ue.flushSync)===!0;if(Ke&&_.initialized&&!D&&M7(_.location,te)&&!(ue&&ue.submission&&ea(ue.submission.formMethod))){Ge(te,{matches:Ke},{flushSync:Be});return}let Le=rn(Ke,Ce,te.pathname);if(Le.active&&Le.matches&&(Ke=Le.matches),!Ke){let{error:Jn,notFoundMatches:er,route:an}=_n(te.pathname);Ge(te,{matches:er,loaderData:{},errors:{[an.id]:Jn}},{flushSync:Be});return}L=new AbortController;let Pe=Uu(e.history,te,L.signal,ue&&ue.submission),Qe=e.getContext?await e.getContext():new oT,wt;if(ue&&ue.pendingError)wt=[il(Ke).route.id,{type:"error",error:ue.pendingError}];else if(ue&&ue.submission&&ea(ue.submission.formMethod)){let Jn=await Xt(Pe,te,ue.submission,Ke,Qe,Le.active,ue&&ue.initialHydration===!0,{replace:ue.replace,flushSync:Be});if(Jn.shortCircuited)return;if(Jn.pendingActionResult){let[er,an]=Jn.pendingActionResult;if(Wa(an)&&ah(an.error)&&an.error.status===404){L=null,Ge(te,{matches:Jn.matches,loaderData:{},errors:{[er]:an.error}});return}}Ke=Jn.matches||Ke,wt=Jn.pendingActionResult,Ne=nb(te,ue.submission),Be=!1,Le.active=!1,Pe=Uu(e.history,Pe.url,Pe.signal)}let{shortCircuited:nt,matches:Ot,loaderData:Kt,errors:Zn}=await gn(Pe,te,Ke,Qe,Le.active,Ne,ue&&ue.submission,ue&&ue.fetcherSubmission,ue&&ue.replace,ue&&ue.initialHydration===!0,Be,wt,ue&&ue.callSiteDefaultShouldRevalidate);nt||(L=null,Ge(te,{matches:Ot||Ke,...CT(wt),loaderData:Kt,errors:Zn}))}async function Xt(X,te,ue,Ce,Ne,Ke,Be,Le={}){Ve();let Pe=$7(te,ue);if(Re({navigation:Pe},{flushSync:Le.flushSync===!0}),Ke){let nt=await Gn(Ce,te.pathname,X.signal);if(nt.type==="aborted")return{shortCircuited:!0};if(nt.type==="error"){if(nt.partialMatches.length===0){let{matches:Kt,route:Zn}=Mp(u);return{matches:Kt,pendingActionResult:[Zn.id,{type:"error",error:nt.error}]}}let Ot=il(nt.partialMatches).route.id;return{matches:nt.partialMatches,pendingActionResult:[Ot,{type:"error",error:nt.error}]}}else if(nt.matches)Ce=nt.matches;else{let{notFoundMatches:Ot,error:Kt,route:Zn}=_n(te.pathname);return{matches:Ot,pendingActionResult:[Zn.id,{type:"error",error:Kt}]}}}let Qe,wt=ug(Ce,te);if(!wt.route.action&&!wt.route.lazy)Qe={type:"error",error:vs(405,{method:X.method,pathname:te.pathname,routeId:wt.route.id})};else{let nt=Zu(i,c,X,Ce,wt,Be?[]:r,Ne),Ot=await Oe(X,nt,Ne,null);if(Qe=Ot[wt.route.id],!Qe){for(let Kt of Ce)if(Ot[Kt.route.id]){Qe=Ot[Kt.route.id];break}}if(X.signal.aborted)return{shortCircuited:!0}}if(mc(Qe)){let nt;return Le&&Le.replace!=null?nt=Le.replace:nt=yT(Qe.response.headers.get("Location"),new URL(X.url),m,e.history)===_.location.pathname+_.location.search,await Te(X,Qe,!0,{submission:ue,replace:nt}),{shortCircuited:!0}}if(Wa(Qe)){let nt=il(Ce,wt.route.id);return(Le&&Le.replace)!==!0&&(M="PUSH"),{matches:Ce,pendingActionResult:[nt.route.id,Qe,wt.route.id]}}return{matches:Ce,pendingActionResult:[wt.route.id,Qe]}}async function gn(X,te,ue,Ce,Ne,Ke,Be,Le,Pe,Qe,wt,nt,Ot){let Kt=Ke||nb(te,Be),Zn=Be||Le||wT(Kt),Jn=!V&&!Qe;if(Ne){if(Jn){let ir=ke(nt);Re({navigation:Kt,...ir!==void 0?{actionData:ir}:{}},{flushSync:wt})}let sn=await Gn(ue,te.pathname,X.signal);if(sn.type==="aborted")return{shortCircuited:!0};if(sn.type==="error"){if(sn.partialMatches.length===0){let{matches:Os,route:$r}=Mp(u);return{matches:Os,loaderData:{},errors:{[$r.id]:sn.error}}}let ir=il(sn.partialMatches).route.id;return{matches:sn.partialMatches,loaderData:{},errors:{[ir]:sn.error}}}else if(sn.matches)ue=sn.matches;else{let{error:ir,notFoundMatches:Os,route:$r}=_n(te.pathname);return{matches:Os,loaderData:{},errors:{[$r.id]:ir}}}}let er=f||u,{dsMatches:an,revalidatingFetchers:Pr}=hT(X,Ce,i,c,e.history,_,ue,Zn,te,Qe?[]:r,Qe===!0,D,F,Y,P,$,er,m,e.patchRoutesOnNavigation!=null,nt,Ot);if(he=++ee,!e.dataStrategy&&!an.some(sn=>sn.shouldLoad)&&!an.some(sn=>sn.route.middleware&&sn.route.middleware.length>0)&&Pr.length===0){let sn=Vn();return Ge(te,{matches:ue,loaderData:{},errors:nt&&Wa(nt[1])?{[nt[0]]:nt[1].error}:null,...CT(nt),...sn?{fetchers:new Map(_.fetchers)}:{}},{flushSync:wt}),{shortCircuited:!0}}if(Jn){let sn={};if(!Ne){sn.navigation=Kt;let ir=ke(nt);ir!==void 0&&(sn.actionData=ir)}Pr.length>0&&(sn.fetchers=It(Pr)),Re(sn,{flushSync:wt})}Pr.forEach(sn=>{bn(sn.key),sn.controller&&U.set(sn.key,sn.controller)});let Sa=()=>Pr.forEach(sn=>bn(sn.key));L&&L.signal.addEventListener("abort",Sa);let{loaderResults:Bn,fetcherResults:As}=await je(an,Pr,X,Ce);if(X.signal.aborted)return{shortCircuited:!0};L&&L.signal.removeEventListener("abort",Sa),Pr.forEach(sn=>U.delete(sn.key));let Ua=kp(Bn);if(Ua)return await Te(X,Ua.result,!0,{replace:Pe}),{shortCircuited:!0};if(Ua=kp(As),Ua)return $.add(Ua.key),await Te(X,Ua.result,!0,{replace:Pe}),{shortCircuited:!0};let{loaderData:Ds,errors:cs}=bT(_,ue,Bn,nt,Pr,As);Qe&&_.errors&&(cs={..._.errors,...cs});let Po=Vn(),$l=_s(he),Vl=Po||$l||Pr.length>0;return{matches:ue,loaderData:Ds,errors:cs,...Vl?{fetchers:new Map(_.fetchers)}:{}}}function ke(X){if(X&&!Wa(X[1]))return{[X[0]]:X[1].data};if(_.actionData)return Object.keys(_.actionData).length===0?null:_.actionData}function It(X){return X.forEach(te=>{let ue=_.fetchers.get(te.key),Ce=jf(void 0,ue?ue.data:void 0);_.fetchers.set(te.key,Ce)}),new Map(_.fetchers)}async function Z(X,te,ue,Ce){bn(X);let Ne=(Ce&&Ce.flushSync)===!0,Ke=f||u,Be=h1(_.location,_.matches,m,ue,te,Ce==null?void 0:Ce.relative),Le=ol(Ke,Be,m),Pe=rn(Le,Ke,Be);if(Pe.active&&Pe.matches&&(Le=Pe.matches),!Le){dt(X,te,vs(404,{pathname:Be}),{flushSync:Ne});return}let{path:Qe,submission:wt,error:nt}=fT(!0,Be,Ce);if(nt){dt(X,te,nt,{flushSync:Ne});return}let Ot=e.getContext?await e.getContext():new oT,Kt=(Ce&&Ce.preventScrollReset)===!0;if(wt&&ea(wt.formMethod)){await ae(X,te,Qe,Le,Ot,Pe.active,Ne,Kt,wt,Ce&&Ce.unstable_defaultShouldRevalidate);return}P.set(X,{routeId:te,path:Qe}),await ge(X,te,Qe,Le,Ot,Pe.active,Ne,Kt,wt)}async function ae(X,te,ue,Ce,Ne,Ke,Be,Le,Pe,Qe){Ve(),P.delete(X);let wt=_.fetchers.get(X);lt(X,V7(Pe,wt),{flushSync:Be});let nt=new AbortController,Ot=Uu(e.history,ue,nt.signal,Pe);if(Ke){let on=await Gn(Ce,new URL(Ot.url).pathname,Ot.signal,X);if(on.type==="aborted")return;if(on.type==="error"){dt(X,te,on.error,{flushSync:Be});return}else if(on.matches)Ce=on.matches;else{dt(X,te,vs(404,{pathname:ue}),{flushSync:Be});return}}let Kt=ug(Ce,ue);if(!Kt.route.action&&!Kt.route.lazy){let on=vs(405,{method:Pe.formMethod,pathname:ue,routeId:te});dt(X,te,on,{flushSync:Be});return}U.set(X,nt);let Zn=ee,Jn=Zu(i,c,Ot,Ce,Kt,r,Ne),er=await Oe(Ot,Jn,Ne,X),an=er[Kt.route.id];if(!an){for(let on of Jn)if(er[on.route.id]){an=er[on.route.id];break}}if(Ot.signal.aborted){U.get(X)===nt&&U.delete(X);return}if(Y.has(X)){if(mc(an)||Wa(an)){lt(X,si(void 0));return}}else{if(mc(an))if(U.delete(X),he>Zn){lt(X,si(void 0));return}else return $.add(X),lt(X,jf(Pe)),Te(Ot,an,!1,{fetcherSubmission:Pe,preventScrollReset:Le});if(Wa(an)){dt(X,te,an.error);return}}let Pr=_.navigation.location||_.location,Sa=Uu(e.history,Pr,nt.signal),Bn=f||u,As=_.navigation.state!=="idle"?ol(Bn,_.navigation.location,m):_.matches;Bt(As,"Didn't find any matches after fetcher action");let Ua=++ee;z.set(X,Ua);let Ds=jf(Pe,an.data);_.fetchers.set(X,Ds);let{dsMatches:cs,revalidatingFetchers:Po}=hT(Sa,Ne,i,c,e.history,_,As,Pe,Pr,r,!1,D,F,Y,P,$,Bn,m,e.patchRoutesOnNavigation!=null,[Kt.route.id,an],Qe);Po.filter(on=>on.key!==X).forEach(on=>{let Gl=on.key,Em=_.fetchers.get(Gl),Md=jf(void 0,Em?Em.data:void 0);_.fetchers.set(Gl,Md),bn(Gl),on.controller&&U.set(Gl,on.controller)}),Re({fetchers:new Map(_.fetchers)});let $l=()=>Po.forEach(on=>bn(on.key));nt.signal.addEventListener("abort",$l);let{loaderResults:Vl,fetcherResults:sn}=await je(cs,Po,Sa,Ne);if(nt.signal.aborted)return;if(nt.signal.removeEventListener("abort",$l),z.delete(X),U.delete(X),Po.forEach(on=>U.delete(on.key)),_.fetchers.has(X)){let on=si(an.data);_.fetchers.set(X,on)}let ir=kp(Vl);if(ir)return Te(Sa,ir.result,!1,{preventScrollReset:Le});if(ir=kp(sn),ir)return $.add(ir.key),Te(Sa,ir.result,!1,{preventScrollReset:Le});let{loaderData:Os,errors:$r}=bT(_,As,Vl,void 0,Po,sn);_s(Ua),_.navigation.state==="loading"&&Ua>he?(Bt(M,"Expected pending action"),L&&L.abort(),Ge(_.navigation.location,{matches:As,loaderData:Os,errors:$r,fetchers:new Map(_.fetchers)})):(Re({errors:$r,loaderData:ST(_.loaderData,Os,As,$r),fetchers:new Map(_.fetchers)}),D=!1)}async function ge(X,te,ue,Ce,Ne,Ke,Be,Le,Pe){let Qe=_.fetchers.get(X);lt(X,jf(Pe,Qe?Qe.data:void 0),{flushSync:Be});let wt=new AbortController,nt=Uu(e.history,ue,wt.signal);if(Ke){let an=await Gn(Ce,new URL(nt.url).pathname,nt.signal,X);if(an.type==="aborted")return;if(an.type==="error"){dt(X,te,an.error,{flushSync:Be});return}else if(an.matches)Ce=an.matches;else{dt(X,te,vs(404,{pathname:ue}),{flushSync:Be});return}}let Ot=ug(Ce,ue);U.set(X,wt);let Kt=ee,Zn=Zu(i,c,nt,Ce,Ot,r,Ne),er=(await Oe(nt,Zn,Ne,X))[Ot.route.id];if(U.get(X)===wt&&U.delete(X),!nt.signal.aborted){if(Y.has(X)){lt(X,si(void 0));return}if(mc(er))if(he>Kt){lt(X,si(void 0));return}else{$.add(X),await Te(nt,er,!1,{preventScrollReset:Le});return}if(Wa(er)){dt(X,te,er.error);return}lt(X,si(er.data))}}async function Te(X,te,ue,{submission:Ce,fetcherSubmission:Ne,preventScrollReset:Ke,replace:Be}={}){ue||(G==null||G.resolve(),G=null),te.response.headers.has("X-Remix-Revalidate")&&(D=!0);let Le=te.response.headers.get("Location");Bt(Le,"Expected a Location header on the redirect Response"),Le=yT(Le,new URL(X.url),m,e.history);let Pe=nh(_.location,Le,{_isRedirect:!0});if(n){let Zn=!1;if(te.response.headers.has("X-Remix-Reload-Document"))Zn=!0;else if(yx(Le)){const Jn=AA(Le,!0);Zn=Jn.origin!==t.location.origin||Es(Jn.pathname,m)==null}if(Zn){Be?t.location.replace(Le):t.location.assign(Le);return}}L=null;let Qe=Be===!0||te.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:wt,formAction:nt,formEncType:Ot}=_.navigation;!Ce&&!Ne&&wt&&nt&&Ot&&(Ce=wT(_.navigation));let Kt=Ce||Ne;if(y7.has(te.response.status)&&Kt&&ea(Kt.formMethod))await He(Qe,Pe,{submission:{...Kt,formAction:Le},preventScrollReset:Ke||H,enableViewTransition:ue?q:void 0});else{let Zn=nb(Pe,Ce);await He(Qe,Pe,{overrideNavigation:Zn,fetcherSubmission:Ne,preventScrollReset:Ke||H,enableViewTransition:ue?q:void 0})}}async function Oe(X,te,ue,Ce){var Be;let Ne,Ke={};try{Ne=await _7(x,X,te,Ce,ue,!1)}catch(Le){return te.filter(Pe=>Pe.shouldLoad).forEach(Pe=>{Ke[Pe.route.id]={type:"error",error:Le}}),Ke}if(X.signal.aborted)return Ke;if(!ea(X.method))for(let Le of te){if(((Be=Ne[Le.route.id])==null?void 0:Be.type)==="error")break;!Ne.hasOwnProperty(Le.route.id)&&!_.loaderData.hasOwnProperty(Le.route.id)&&(!_.errors||!_.errors.hasOwnProperty(Le.route.id))&&Le.shouldCallHandler()&&(Ne[Le.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${Le.route.id}`)})}for(let[Le,Pe]of Object.entries(Ne))if(U7(Pe)){let Qe=Pe.result;Ke[Le]={type:"redirect",response:O7(Qe,X,Le,te,m)}}else Ke[Le]=await D7(Pe);return Ke}async function je(X,te,ue,Ce){let Ne=Oe(ue,X,Ce,null),Ke=Promise.all(te.map(async Pe=>{if(Pe.matches&&Pe.match&&Pe.request&&Pe.controller){let wt=(await Oe(Pe.request,Pe.matches,Ce,Pe.key))[Pe.match.route.id];return{[Pe.key]:wt}}else return Promise.resolve({[Pe.key]:{type:"error",error:vs(404,{pathname:Pe.path})}})})),Be=await Ne,Le=(await Ke).reduce((Pe,Qe)=>Object.assign(Pe,Qe),{});return{loaderResults:Be,fetcherResults:Le}}function Ve(){D=!0,P.forEach((X,te)=>{U.has(te)&&F.add(te),bn(te)})}function lt(X,te,ue={}){_.fetchers.set(X,te),Re({fetchers:new Map(_.fetchers)},{flushSync:(ue&&ue.flushSync)===!0})}function dt(X,te,ue,Ce={}){let Ne=il(_.matches,te);$n(X),Re({errors:{[Ne.route.id]:ue},fetchers:new Map(_.fetchers)},{flushSync:(Ce&&Ce.flushSync)===!0})}function vn(X){return K.set(X,(K.get(X)||0)+1),Y.has(X)&&Y.delete(X),_.fetchers.get(X)||v7}function Wn(X,te){bn(X,te==null?void 0:te.reason),lt(X,si(null))}function $n(X){let te=_.fetchers.get(X);U.has(X)&&!(te&&te.state==="loading"&&z.has(X))&&bn(X),P.delete(X),z.delete(X),$.delete(X),Y.delete(X),F.delete(X),_.fetchers.delete(X)}function La(X){let te=(K.get(X)||0)-1;te<=0?(K.delete(X),Y.add(X)):K.set(X,te),Re({fetchers:new Map(_.fetchers)})}function bn(X,te){let ue=U.get(X);ue&&(ue.abort(te),U.delete(X))}function Qn(X){for(let te of X){let ue=vn(te),Ce=si(ue.data);_.fetchers.set(te,Ce)}}function Vn(){let X=[],te=!1;for(let ue of $){let Ce=_.fetchers.get(ue);Bt(Ce,`Expected fetcher: ${ue}`),Ce.state==="loading"&&($.delete(ue),X.push(ue),te=!0)}return Qn(X),te}function _s(X){let te=[];for(let[ue,Ce]of z)if(Ce<X){let Ne=_.fetchers.get(ue);Bt(Ne,`Expected fetcher: ${ue}`),Ne.state==="loading"&&(bn(ue),z.delete(ue),te.push(ue))}return Qn(te),te.length>0}function ls(X,te){let ue=_.blockers.get(X)||Rf;return se.get(X)!==te&&se.set(X,te),ue}function kr(X){_.blockers.delete(X),se.delete(X)}function Pa(X,te){let ue=_.blockers.get(X)||Rf;Bt(ue.state==="unblocked"&&te.state==="blocked"||ue.state==="blocked"&&te.state==="blocked"||ue.state==="blocked"&&te.state==="proceeding"||ue.state==="blocked"&&te.state==="unblocked"||ue.state==="proceeding"&&te.state==="unblocked",`Invalid blocker state transition: ${ue.state} -> ${te.state}`);let Ce=new Map(_.blockers);Ce.set(X,te),Re({blockers:Ce})}function Ns({currentLocation:X,nextLocation:te,historyAction:ue}){if(se.size===0)return;se.size>1&&Xn(!1,"A router only supports one blocker at a time");let Ce=Array.from(se.entries()),[Ne,Ke]=Ce[Ce.length-1],Be=_.blockers.get(Ne);if(!(Be&&Be.state==="proceeding")&&Ke({currentLocation:X,nextLocation:te,historyAction:ue}))return Ne}function _n(X){let te=vs(404,{pathname:X}),ue=f||u,{matches:Ce,route:Ne}=Mp(ue);return{notFoundMatches:Ce,route:Ne,error:te}}function Ln(X,te,ue){if(C=X,E=te,S=ue||null,!j&&_.navigation===tb){j=!0;let Ce=cn(_.location,_.matches);Ce!=null&&Re({restoreScrollPosition:Ce})}return()=>{C=null,E=null,S=null}}function Xe(X,te){return S&&S(X,te.map(Ce=>BL(Ce,_.loaderData)))||X.key}function nn(X,te){if(C&&E){let ue=Xe(X,te);C[ue]=E()}}function cn(X,te){if(C){let ue=Xe(X,te),Ce=C[ue];if(typeof Ce=="number")return Ce}return null}function rn(X,te,ue){if(e.patchRoutesOnNavigation)if(X){if(Object.keys(X[0].params).length>0)return{active:!0,matches:zf(te,ue,m,!0)}}else return{active:!0,matches:zf(te,ue,m,!0)||[]};return{active:!1,matches:null}}async function Gn(X,te,ue,Ce){if(!e.patchRoutesOnNavigation)return{type:"success",matches:X};let Ne=X;for(;;){let Ke=f==null,Be=f||u,Le=c;try{await e.patchRoutesOnNavigation({signal:ue,path:te,matches:Ne,fetcherKey:Ce,patch:(wt,nt)=>{ue.aborted||mT(wt,nt,Be,Le,i,!1)}})}catch(wt){return{type:"error",error:wt,partialMatches:Ne}}finally{Ke&&!ue.aborted&&(u=[...u])}if(ue.aborted)return{type:"aborted"};let Pe=ol(Be,te,m),Qe=null;if(Pe){if(Object.keys(Pe[0].params).length===0)return{type:"success",matches:Pe};if(Qe=zf(Be,te,m,!0),!(Qe&&Ne.length<Qe.length&&dn(Ne,Qe.slice(0,Ne.length))))return{type:"success",matches:Pe}}if(Qe||(Qe=zf(Be,te,m,!0)),!Qe||dn(Ne,Qe))return{type:"success",matches:null};Ne=Qe}}function dn(X,te){return X.length===te.length&&X.every((ue,Ce)=>ue.route.id===te[Ce].route.id)}function un(X){c={},f=rh(X,i,void 0,c)}function Lr(X,te,ue=!1){let Ce=f==null;mT(X,te,f||u,c,i,ue),Ce&&(u=[...u],Re({}))}return I={get basename(){return m},get future(){return g},get state(){return _},get routes(){return u},get window(){return t},initialize:pe,subscribe:ze,enableScrollRestoration:Ln,navigate:ot,fetch:Z,revalidate:Vt,createHref:X=>e.history.createHref(X),encodeLocation:X=>e.history.encodeLocation(X),getFetcher:vn,resetFetcher:Wn,deleteFetcher:La,dispose:be,getBlocker:ls,deleteBlocker:kr,patchRoutes:Lr,_internalFetchControllers:U,_internalSetRoutes:un,_internalSetStateDoNotUseOrYouWillBreakYourApp(X){Re(X)}},e.unstable_instrumentations&&(I=u7(I,e.unstable_instrumentations.map(X=>X.router).filter(Boolean))),I}function C7(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function h1(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=bx(r||".",vx(c),Es(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=zS(f.search);if(u.route.index&&!m)f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index";else if(!u.route.index&&m){let x=new URLSearchParams(f.search),g=x.getAll("index");x.delete("index"),g.filter(v=>v).forEach(v=>x.append("index",v));let y=x.toString();f.search=y?`?${y}`:""}}return n!=="/"&&(f.pathname=a7({basename:n,pathname:f.pathname})),To(f)}function fT(e,t,n){if(!n||!C7(n))return{path:t};if(n.formMethod&&!H7(n.formMethod))return{path:t,error:vs(405,{method:n.formMethod})};let r=()=>({path:t,error:vs(400,{type:"invalid-body"})}),i=(n.formMethod||"get").toUpperCase(),c=KA(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!ea(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((y,[v,C])=>`${y}${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(!ea(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()}}}Bt(typeof FormData=="function","FormData is not available in this environment");let u,f;if(n.formData)u=g1(n.formData),f=n.formData;else if(n.body instanceof FormData)u=g1(n.body),f=n.body;else if(n.body instanceof URLSearchParams)u=n.body,f=vT(u);else if(n.body==null)u=new URLSearchParams,f=new FormData;else try{u=new URLSearchParams(n.body),f=vT(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(ea(m.formMethod))return{path:t,submission:m};let x=wl(t);return e&&x.search&&zS(x.search)&&u.append("index",""),x.search=`?${u}`,{path:To(x),submission:m}}function hT(e,t,n,r,s,i,c,u,f,m,x,g,y,v,C,S,E,j,R,T,N){var V;let A=T?Wa(T[1])?T[1].error:T[1].data:void 0,I=s.createURL(i.location),_=s.createURL(f),M;if(x&&i.errors){let D=Object.keys(i.errors)[0];M=c.findIndex(F=>F.route.id===D)}else if(T&&Wa(T[1])){let D=T[0];M=c.findIndex(F=>F.route.id===D)-1}let G=T?T[1].statusCode:void 0,H=G&&G>=400,L={currentUrl:I,currentParams:((V=i.matches[0])==null?void 0:V.params)||{},nextUrl:_,nextParams:c[0].params,...u,actionResult:A,actionStatus:G},q=wh(c),W=c.map((D,F)=>{let{route:U}=D,ee=null;if(M!=null&&F>M?ee=!1:U.lazy?ee=!0:PS(U)?x?ee=m1(U,i.loaderData,i.errors):E7(i.loaderData,i.matches[F],D)&&(ee=!0):ee=!1,ee!==null)return p1(n,r,e,q,D,m,t,ee);let he=!1;typeof N=="boolean"?he=N:H?he=!1:(g||I.pathname+I.search===_.pathname+_.search||I.search!==_.search||w7(i.matches[F],D))&&(he=!0);let z={...L,defaultShouldRevalidate:he},$=qf(D,z);return p1(n,r,e,q,D,m,t,$,z,N)}),B=[];return C.forEach((D,F)=>{if(x||!c.some(Y=>Y.route.id===D.routeId)||v.has(F))return;let U=i.fetchers.get(F),ee=U&&U.state!=="idle"&&U.data===void 0,he=ol(E,D.path,j);if(!he){if(R&&ee)return;B.push({key:F,routeId:D.routeId,path:D.path,matches:null,match:null,request:null,controller:null});return}if(S.has(F))return;let z=ug(he,D.path),$=new AbortController,P=Uu(s,D.path,$.signal),K=null;if(y.has(F))y.delete(F),K=Zu(n,r,P,he,z,m,t);else if(ee)g&&(K=Zu(n,r,P,he,z,m,t));else{let Y;typeof N=="boolean"?Y=N:H?Y=!1:Y=g;let se={...L,defaultShouldRevalidate:Y};qf(z,se)&&(K=Zu(n,r,P,he,z,m,t,se))}K&&B.push({key:F,routeId:D.routeId,path:D.path,matches:K,match:z,request:P,controller:$})}),{dsMatches:W,revalidatingFetchers:B}}function PS(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function m1(e,t,n){if(e.lazy)return!0;if(!PS(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 E7(e,t,n){let r=!t||n.route.id!==t.route.id,s=!e.hasOwnProperty(n.route.id);return r||s}function w7(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function qf(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function mT(e,t,n,r,s,i){let c;if(e){let m=r[e];Bt(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 x=c.find(g=>$A(m,g));x?f.push({existingRoute:x,newRoute:m}):u.push(m)}),u.length>0){let m=rh(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:x,newRoute:g}=f[m],y=x,[v]=rh([g],s,[],{},!0);Object.assign(y,{element:v.element?v.element:y.element,errorElement:v.errorElement?v.errorElement:y.errorElement,hydrateFallbackElement:v.hydrateFallbackElement?v.hydrateFallbackElement:y.hydrateFallbackElement})}}function $A(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=>$A(n,i))}):!1}var pT=new WeakMap,VA=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let s=n[t.id];if(Bt(s,"No route found in manifest"),!s.lazy||typeof s.lazy!="object")return;let i=s.lazy[e];if(!i)return;let c=pT.get(s);c||(c={},pT.set(s,c));let u=c[e];if(u)return u;let f=(async()=>{let m=HL(e),g=s[e]!==void 0&&e!=="hasErrorBoundary";if(m)Xn(!m,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),c[e]=Promise.resolve();else if(g)Xn(!1,`Route "${s.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let y=await i();y!=null&&(Object.assign(s,{[e]:y}),Object.assign(s,r(s)))}typeof s.lazy=="object"&&(s.lazy[e]=void 0,Object.values(s.lazy).every(y=>y===void 0)&&(s.lazy=void 0))})();return c[e]=f,f},gT=new WeakMap;function R7(e,t,n,r,s){let i=n[e.id];if(Bt(i,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let x=gT.get(i);if(x)return{lazyRoutePromise:x,lazyHandlerPromise:x};let g=(async()=>{Bt(typeof e.lazy=="function","No lazy route function found");let y=await e.lazy(),v={};for(let C in y){let S=y[C];if(S===void 0)continue;let E=VL(C),R=i[C]!==void 0&&C!=="hasErrorBoundary";E?Xn(!E,"Route property "+C+" is not a supported property to be returned from a lazy route function. This property will be ignored."):R?Xn(!R,`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 gT.set(i,g),g.catch(()=>{}),{lazyRoutePromise:g,lazyHandlerPromise:g}}let c=Object.keys(e.lazy),u=[],f;for(let x of c){if(s&&s.includes(x))continue;let g=VA({key:x,route:e,manifest:n,mapRouteProperties:r});g&&(u.push(g),x===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 xT(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 j7(e){return e.matches.some(t=>t.route.middleware)?GA(e,()=>xT(e)):xT(e)}function GA(e,t){return T7(e,t,r=>{if(F7(r))throw r;return r},L7,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=il(c,c[u].route.id).route.id;return Promise.resolve({[f]:{type:"error",result:r}})}}}async function T7(e,t,n,r,s){let{matches:i,request:c,params:u,context:f,unstable_pattern:m}=e,x=i.flatMap(y=>y.route.middleware?y.route.middleware.map(v=>[y.route.id,v]):[]);return await BA({request:c,params:u,context:f,unstable_pattern:m},x,t,n,r,s)}async function BA(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,x]=f,g,y=async()=>{if(g)throw new Error("You may only call `next()` once per middleware");try{return g={value:await BA(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 x(e,y),C=v!=null?r(v):void 0;return s(C)?C:g?C??g.value:(g={value:await y()},g.value)}catch(v){return await i(v,m,g)}}function qA(e,t,n,r,s){let i=VA({key:"middleware",route:r.route,manifest:t,mapRouteProperties:e}),c=R7(r.route,ea(n.method)?"action":"loader",t,e,s);return{middleware:i,route:c.lazyRoutePromise,handler:c.lazyHandlerPromise}}function p1(e,t,n,r,s,i,c,u,f=null,m){let x=!1,g=qA(e,t,n,s,i);return{...s,_lazyPromises:g,shouldLoad:u,shouldRevalidateArgs:f,shouldCallHandler(y){return x=!0,f?typeof m=="boolean"?qf(s,{...f,defaultShouldRevalidate:m}):typeof y=="boolean"?qf(s,{...f,defaultShouldRevalidate:y}):qf(s,f):u},resolve(y){let{lazy:v,loader:C,middleware:S}=s.route,E=x||u||y&&!ea(n.method)&&(v||C),j=S&&S.length>0&&!C&&!v;return E&&(ea(n.method)||!j)?N7({request:n,unstable_pattern:r,match:s,lazyHandlerPromise:g==null?void 0:g.handler,lazyRoutePromise:g==null?void 0:g.route,handlerOverride:y,scopedContext:c}):Promise.resolve({type:"data",result:void 0})}}}function Zu(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:qA(e,t,n,f,i),resolve:()=>Promise.resolve({type:"data",result:void 0})}:p1(e,t,n,wh(r),f,i,c,!0,u))}async function _7(e,t,n,r,s,i){n.some(m=>{var x;return(x=m._lazyPromises)==null?void 0:x.middleware})&&await Promise.all(n.map(m=>{var x;return(x=m._lazyPromises)==null?void 0:x.middleware}));let c={request:t,unstable_pattern:wh(n),params:n[0].params,context:s,matches:n},f=await e({...c,fetcherKey:r,runClientMiddleware:m=>{let x=c;return GA(x,()=>m({...x,fetcherKey:r,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(n.flatMap(m=>{var x,g;return[(x=m._lazyPromises)==null?void 0:x.handler,(g=m._lazyPromises)==null?void 0:g.route]}))}catch{}return f}async function N7({request:e,unstable_pattern:t,match:n,lazyHandlerPromise:r,lazyRoutePromise:s,handlerOverride:i,scopedContext:c}){let u,f,m=ea(e.method),x=m?"action":"loader",g=y=>{let v,C=new Promise((j,R)=>v=R);f=()=>v(),e.signal.addEventListener("abort",f);let S=j=>typeof y!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${x}" [routeId: ${n.route.id}]`)):y({request:e,unstable_pattern:t,params:n.params,context:c},...j!==void 0?[j]:[]),E=(async()=>{try{return{type:"data",result:await(i?i(R=>S(R)):S())}}catch(j){return{type:"error",result:j}}})();return Promise.race([E,C])};try{let y=m?n.route.action:n.route.loader;if(r||s)if(y){let v,[C]=await Promise.all([g(y).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(x==="action"){let C=new URL(e.url),S=C.pathname+C.search;throw vs(405,{method:e.method,pathname:S,routeId:n.route.id})}else return{type:"data",result:void 0}}else if(y)u=await g(y);else{let v=new URL(e.url),C=v.pathname+v.search;throw vs(404,{pathname:C})}}catch(y){return{type:"error",result:y}}finally{f&&e.signal.removeEventListener("abort",f)}return u}async function A7(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 D7(e){var r,s,i,c,u;let{result:t,type:n}=e;if(US(t)){let f;try{f=await A7(t)}catch(m){return{type:"error",error:m}}return n==="error"?{type:"error",error:new Eh(t.status,t.statusText,f),statusCode:t.status,headers:t.headers}:{type:"data",data:f,statusCode:t.status,headers:t.headers}}return n==="error"?ET(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:k7(t),statusCode:ah(t)?t.status:void 0,headers:(i=t.init)!=null&&i.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:ah(t)?t.status:void 0}:ET(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 O7(e,t,n,r,s){let i=e.headers.get("Location");if(Bt(i,"Redirects returned/thrown from loaders/actions must have a Location header"),!yx(i)){let c=r.slice(0,r.findIndex(u=>u.route.id===n)+1);i=h1(new URL(t.url),c,s,i),e.headers.set("Location",i)}return e}function yT(e,t,n,r){let s=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(yx(e)){let i=e,c=i.startsWith("//")?new URL(t.protocol+i):new URL(i);if(s.includes(c.protocol))throw new Error("Invalid redirect location");let u=Es(c.pathname,n)!=null;if(c.origin===t.origin&&u)return c.pathname+c.search+c.hash}try{let i=r.createURL(e);if(s.includes(i.protocol))throw new Error("Invalid redirect location")}catch{}return e}function Uu(e,t,n,r){let s=e.createURL(KA(t)).toString(),i={signal:n};if(r&&ea(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=g1(r.formData):i.body=r.formData}return new Request(s,i)}function g1(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function vT(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function I7(e,t,n,r=!1,s=!1){let i={},c=null,u,f=!1,m={},x=n&&Wa(n[1])?n[1].error:void 0;return e.forEach(g=>{if(!(g.route.id in t))return;let y=g.route.id,v=t[y];if(Bt(!mc(v),"Cannot handle redirect results in processLoaderData"),Wa(v)){let C=v.error;if(x!==void 0&&(C=x,x=void 0),c=c||{},s)c[y]=C;else{let S=il(e,y);c[S.route.id]==null&&(c[S.route.id]=C)}r||(i[y]=HA),f||(f=!0,u=ah(v.error)?v.error.status:500),v.headers&&(m[y]=v.headers)}else i[y]=v.data,v.statusCode&&v.statusCode!==200&&!f&&(u=v.statusCode),v.headers&&(m[y]=v.headers)}),x!==void 0&&n&&(c={[n[0]]:x},n[2]&&(i[n[2]]=void 0)),{loaderData:i,errors:c,statusCode:u||200,loaderHeaders:m}}function bT(e,t,n,r,s,i){let{loaderData:c,errors:u}=I7(t,n,r);return s.filter(f=>!f.matches||f.matches.some(m=>m.shouldLoad)).forEach(f=>{let{key:m,match:x,controller:g}=f;if(g&&g.signal.aborted)return;let y=i[m];if(Bt(y,"Did not find corresponding fetcher result"),Wa(y)){let v=il(e.matches,x==null?void 0:x.route.id);u&&u[v.route.id]||(u={...u,[v.route.id]:y.error}),e.fetchers.delete(m)}else if(mc(y))Bt(!1,"Unhandled fetcher revalidation redirect");else{let v=si(y.data);e.fetchers.set(m,v)}}),{loaderData:c,errors:u}}function ST(e,t,n,r){let s=Object.entries(t).filter(([,i])=>i!==HA).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 CT(e){return e?Wa(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function il(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 Mp(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 vs(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 Eh(e||500,c,new Error(u),!0)}function kp(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,s]=t[n];if(mc(s))return{key:r,result:s}}}function KA(e){let t=typeof e=="string"?wl(e):e;return To({...t,hash:""})}function M7(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function k7(e){var t,n;return new Eh(((t=e.init)==null?void 0:t.status)??500,((n=e.init)==null?void 0:n.statusText)??"Internal Server Error",e.data)}function L7(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,n])=>typeof t=="string"&&P7(n))}function P7(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function U7(e){return US(e.result)&&zA.has(e.result.status)}function Wa(e){return e.type==="error"}function mc(e){return(e&&e.type)==="redirect"}function ET(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function US(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function z7(e){return zA.has(e)}function F7(e){return US(e)&&z7(e.status)&&e.headers.has("Location")}function H7(e){return x7.has(e.toUpperCase())}function ea(e){return p7.has(e.toUpperCase())}function zS(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function ug(e,t){let n=typeof t=="string"?wl(t).search:t.search;if(e[e.length-1].route.index&&zS(n||""))return e[e.length-1];let r=MA(e);return r[r.length-1]}function wT(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 nb(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 $7(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 jf(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 V7(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 si(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 G7(e,t){try{let n=e.sessionStorage.getItem(FA);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 B7(e,t){if(t.size>0){let n={};for(let[r,s]of t)n[r]=[...s];try{e.sessionStorage.setItem(FA,JSON.stringify(n))}catch(r){Xn(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function RT(){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 kc=h.createContext(null);kc.displayName="DataRouter";var Rh=h.createContext(null);Rh.displayName="DataRouterState";var WA=h.createContext(!1);function q7(){return h.useContext(WA)}var FS=h.createContext({isTransitioning:!1});FS.displayName="ViewTransition";var ZA=h.createContext(new Map);ZA.displayName="Fetchers";var K7=h.createContext(null);K7.displayName="Await";var as=h.createContext(null);as.displayName="Navigation";var Sx=h.createContext(null);Sx.displayName="Location";var Rs=h.createContext({outlet:null,matches:[],isDataRoute:!1});Rs.displayName="Route";var HS=h.createContext(null);HS.displayName="RouteError";var YA="REACT_ROUTER_ERROR",W7="REDIRECT",Z7="ROUTE_ERROR_RESPONSE";function Y7(e){if(e.startsWith(`${YA}:${W7}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function X7(e){if(e.startsWith(`${YA}:${Z7}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new Eh(t.status,t.statusText,t.data)}catch{}}function Q7(e,{relative:t}={}){Bt(gd(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=h.useContext(as),{hash:s,pathname:i,search:c}=jh(e,{relative:t}),u=i;return n!=="/"&&(u=i==="/"?n:bo([n,i])),r.createHref({pathname:u,search:c,hash:s})}function gd(){return h.useContext(Sx)!=null}function Qs(){return Bt(gd(),"useLocation() may be used only in the context of a <Router> component."),h.useContext(Sx).location}var XA="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function QA(e){h.useContext(as).static||h.useLayoutEffect(e)}function Lc(){let{isDataRoute:e}=h.useContext(Rs);return e?fP():J7()}function J7(){Bt(gd(),"useNavigate() may be used only in the context of a <Router> component.");let e=h.useContext(kc),{basename:t,navigator:n}=h.useContext(as),{matches:r}=h.useContext(Rs),{pathname:s}=Qs(),i=JSON.stringify(vx(r)),c=h.useRef(!1);return QA(()=>{c.current=!0}),h.useCallback((f,m={})=>{if(Xn(c.current,XA),!c.current)return;if(typeof f=="number"){n.go(f);return}let x=bx(f,JSON.parse(i),s,m.relative==="path");e==null&&t!=="/"&&(x.pathname=x.pathname==="/"?t:bo([t,x.pathname])),(m.replace?n.replace:n.push)(x,m.state,m)},[t,n,i,s,e])}var JA=h.createContext(null);function js(){return h.useContext(JA)}function eP(e){let t=h.useContext(Rs).outlet;return h.useMemo(()=>t&&h.createElement(JA.Provider,{value:e},t),[t,e])}function Cx(){let{matches:e}=h.useContext(Rs),t=e[e.length-1];return t?t.params:{}}function jh(e,{relative:t}={}){let{matches:n}=h.useContext(Rs),{pathname:r}=Qs(),s=JSON.stringify(vx(n));return h.useMemo(()=>bx(e,JSON.parse(s),r,t==="path"),[e,s,r,t])}function tP(e,t,n,r,s){Bt(gd(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=h.useContext(as),{matches:c}=h.useContext(Rs),u=c[c.length-1],f=u?u.params:{},m=u?u.pathname:"/",x=u?u.pathnameBase:"/",g=u&&u.route;{let R=g&&g.path||"";t4(m,!g||R.endsWith("*")||R.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${m}" (under <Route path="${R}">) 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="${R}"> to <Route path="${R==="/"?"*":`${R}/*`}">.`)}let y=Qs(),v;v=y;let C=v.pathname||"/",S=C;if(x!=="/"){let R=x.replace(/^\//,"").split("/");S="/"+C.replace(/^\//,"").split("/").slice(R.length).join("/")}let E=ol(e,{pathname:S});return Xn(g||E!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),Xn(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.`),oP(E&&E.map(R=>Object.assign({},R,{params:Object.assign({},f,R.params),pathname:bo([x,i.encodeLocation?i.encodeLocation(R.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathname]),pathnameBase:R.pathnameBase==="/"?x:bo([x,i.encodeLocation?i.encodeLocation(R.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathnameBase])})),c,n,r,s)}function nP(){let e=dP(),t=ah(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 rP=h.createElement(nP,null),e4=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(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=X7(e.digest);n&&(e=n)}let t=e!==void 0?h.createElement(Rs.Provider,{value:this.props.routeContext},h.createElement(HS.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?h.createElement(aP,{error:e},t):t}};e4.contextType=WA;var rb=new WeakMap;function aP({children:e,error:t}){let{basename:n}=h.useContext(as);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=Y7(t.digest);if(r){let s=rb.get(t);if(s)throw s;let i=LA(r.location,n);if(kA&&!rb.get(t))if(i.isExternal||r.reloadDocument)window.location.href=i.absoluteURL||i.to;else{const c=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:r.replace}));throw rb.set(t,c),c}return h.createElement("meta",{httpEquiv:"refresh",content:`0;url=${i.absoluteURL||i.to}`})}}return e}function sP({routeContext:e,match:t,children:n}){let r=h.useContext(kc);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),h.createElement(Rs.Provider,{value:e},n)}function oP(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 x=i.findIndex(g=>g.route.id&&(c==null?void 0:c[g.route.id])!==void 0);Bt(x>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(c).join(",")}`),i=i.slice(0,Math.min(i.length,x+1))}let u=!1,f=-1;if(n)for(let x=0;x<i.length;x++){let g=i[x];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(f=x),g.route.id){let{loaderData:y,errors:v}=n,C=g.route.loader&&!y.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?(x,g)=>{var y,v;r(x,{location:n.location,params:((v=(y=n.matches)==null?void 0:y[0])==null?void 0:v.params)??{},unstable_pattern:wh(n.matches),errorInfo:g})}:void 0;return i.reduceRight((x,g,y)=>{let v,C=!1,S=null,E=null;n&&(v=c&&g.route.id?c[g.route.id]:void 0,S=g.route.errorElement||rP,u&&(f<0&&y===0?(t4("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),C=!0,E=null):f===y&&(C=!0,E=g.route.hydrateFallbackElement||null)));let j=t.concat(i.slice(0,y+1)),R=()=>{let T;return v?T=S:C?T=E:g.route.Component?T=h.createElement(g.route.Component,null):g.route.element?T=g.route.element:T=x,h.createElement(sP,{match:g,routeContext:{outlet:x,matches:j,isDataRoute:n!=null},children:T})};return n&&(g.route.ErrorBoundary||g.route.errorElement||y===0)?h.createElement(e4,{location:n.location,revalidation:n.revalidation,component:S,error:v,children:R(),routeContext:{outlet:null,matches:j,isDataRoute:!0},onError:m}):R()},null)}function $S(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function iP(e){let t=h.useContext(kc);return Bt(t,$S(e)),t}function lP(e){let t=h.useContext(Rh);return Bt(t,$S(e)),t}function cP(e){let t=h.useContext(Rs);return Bt(t,$S(e)),t}function VS(e){let t=cP(e),n=t.matches[t.matches.length-1];return Bt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function uP(){return VS("useRouteId")}function dP(){var r;let e=h.useContext(HS),t=lP("useRouteError"),n=VS("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function fP(){let{router:e}=iP("useNavigate"),t=VS("useNavigate"),n=h.useRef(!1);return QA(()=>{n.current=!0}),h.useCallback(async(s,i={})=>{Xn(n.current,XA),n.current&&(typeof s=="number"?await e.navigate(s):await e.navigate(s,{fromRouteId:t,...i}))},[e,t])}var jT={};function t4(e,t,n){!t&&!jT[e]&&(jT[e]=!0,Xn(!1,n))}var TT={};function _T(e,t){!e&&!TT[t]&&(TT[t]=!0,console.warn(t))}var hP="useOptimistic",NT=Ch[hP],mP=()=>{};function pP(e){return NT?NT(e):[e,mP]}function gP(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&Xn(!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&&Xn(!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&&Xn(!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 xP=["HydrateFallback","hydrateFallbackElement"],yP=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 vP({router:e,flushSync:t,onError:n,unstable_useTransitions:r}){r=q7()||r;let[i,c]=h.useState(e.state),[u,f]=pP(i),[m,x]=h.useState(),[g,y]=h.useState({isTransitioning:!1}),[v,C]=h.useState(),[S,E]=h.useState(),[j,R]=h.useState(),T=h.useRef(new Map),N=h.useCallback((M,{deletedFetchers:G,newErrors:H,flushSync:L,viewTransitionOpts:q})=>{H&&n&&Object.values(H).forEach(B=>{var V;return n(B,{location:M.location,params:((V=M.matches[0])==null?void 0:V.params)??{},unstable_pattern:wh(M.matches)})}),M.fetchers.forEach((B,V)=>{B.data!==void 0&&T.current.set(V,B.data)}),G.forEach(B=>T.current.delete(B)),_T(L===!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 W=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(_T(q==null||W,"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."),!q||!W){t&&L?t(()=>c(M)):r===!1?c(M):h.startTransition(()=>{r===!0&&f(B=>AT(B,M)),c(M)});return}if(t&&L){t(()=>{S&&(v==null||v.resolve(),S.skipTransition()),y({isTransitioning:!0,flushSync:!0,currentLocation:q.currentLocation,nextLocation:q.nextLocation})});let B=e.window.document.startViewTransition(()=>{t(()=>c(M))});B.finished.finally(()=>{t(()=>{C(void 0),E(void 0),x(void 0),y({isTransitioning:!1})})}),t(()=>E(B));return}S?(v==null||v.resolve(),S.skipTransition(),R({state:M,currentLocation:q.currentLocation,nextLocation:q.nextLocation})):(x(M),y({isTransitioning:!0,flushSync:!1,currentLocation:q.currentLocation,nextLocation:q.nextLocation}))},[e.window,t,S,v,r,f,n]);h.useLayoutEffect(()=>e.subscribe(N),[e,N]),h.useEffect(()=>{g.isTransitioning&&!g.flushSync&&C(new yP)},[g]),h.useEffect(()=>{if(v&&m&&e.window){let M=m,G=v.promise,H=e.window.document.startViewTransition(async()=>{r===!1?c(M):h.startTransition(()=>{r===!0&&f(L=>AT(L,M)),c(M)}),await G});H.finished.finally(()=>{C(void 0),E(void 0),x(void 0),y({isTransitioning:!1})}),E(H)}},[m,v,e.window,r,f]),h.useEffect(()=>{v&&m&&u.location.key===m.location.key&&v.resolve()},[v,S,u.location,m]),h.useEffect(()=>{!g.isTransitioning&&j&&(x(j.state),y({isTransitioning:!0,flushSync:!1,currentLocation:j.currentLocation,nextLocation:j.nextLocation}),R(void 0))},[g.isTransitioning,j]);let A=h.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:M=>e.navigate(M),push:(M,G,H)=>e.navigate(M,{state:G,preventScrollReset:H==null?void 0:H.preventScrollReset}),replace:(M,G,H)=>e.navigate(M,{replace:!0,state:G,preventScrollReset:H==null?void 0:H.preventScrollReset})}),[e]),I=e.basename||"/",_=h.useMemo(()=>({router:e,navigator:A,static:!1,basename:I,onError:n}),[e,A,I,n]);return h.createElement(h.Fragment,null,h.createElement(kc.Provider,{value:_},h.createElement(Rh.Provider,{value:u},h.createElement(ZA.Provider,{value:T.current},h.createElement(FS.Provider,{value:g},h.createElement(EP,{basename:I,location:u.location,navigationType:u.historyAction,navigator:A,unstable_useTransitions:r},h.createElement(bP,{routes:e.routes,future:e.future,state:u,onError:n})))))),null)}function AT(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 bP=h.memo(SP);function SP({routes:e,future:t,state:n,onError:r}){return tP(e,void 0,n,r,t)}function CP({to:e,replace:t,state:n,relative:r}){Bt(gd(),"<Navigate> may be used only in the context of a <Router> component.");let{static:s}=h.useContext(as);Xn(!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(Rs),{pathname:c}=Qs(),u=Lc(),f=bx(e,vx(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 GS(e){return eP(e.context)}function EP({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:s,static:i=!1,unstable_useTransitions:c}){Bt(!gd(),"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=wl(n));let{pathname:m="/",search:x="",hash:g="",state:y=null,key:v="default"}=n,C=h.useMemo(()=>{let S=Es(m,u);return S==null?null:{location:{pathname:S,search:x,hash:g,state:y,key:v},navigationType:r}},[u,m,x,g,y,v,r]);return Xn(C!=null,`<Router basename="${u}"> is not able to match the URL "${m}${x}${g}" because it does not start with the basename, so the <Router> won't render anything.`),C==null?null:h.createElement(as.Provider,{value:f},h.createElement(Sx.Provider,{children:t,value:C}))}var dg="get",fg="application/x-www-form-urlencoded";function Ex(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function wP(e){return Ex(e)&&e.tagName.toLowerCase()==="button"}function RP(e){return Ex(e)&&e.tagName.toLowerCase()==="form"}function jP(e){return Ex(e)&&e.tagName.toLowerCase()==="input"}function TP(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function _P(e,t){return e.button===0&&(!t||t==="_self")&&!TP(e)}function x1(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 NP(e,t){let n=x1(e);return t&&t.forEach((r,s)=>{n.has(s)||t.getAll(s).forEach(i=>{n.append(s,i)})}),n}var Lp=null;function AP(){if(Lp===null)try{new FormData(document.createElement("form"),0),Lp=!1}catch{Lp=!0}return Lp}var DP=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function ab(e){return e!=null&&!DP.has(e)?(Xn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${fg}"`),null):e}function OP(e,t){let n,r,s,i,c;if(RP(e)){let u=e.getAttribute("action");r=u?Es(u,t):null,n=e.getAttribute("method")||dg,s=ab(e.getAttribute("enctype"))||fg,i=new FormData(e)}else if(wP(e)||jP(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?Es(f,t):null,n=e.getAttribute("formmethod")||u.getAttribute("method")||dg,s=ab(e.getAttribute("formenctype"))||ab(u.getAttribute("enctype"))||fg,i=new FormData(u,e),!AP()){let{name:m,type:x,value:g}=e;if(x==="image"){let y=m?`${m}.`:"";i.append(`${y}x`,"0"),i.append(`${y}y`,"0")}else m&&i.append(m,g)}}else{if(Ex(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=dg,r=null,s=fg,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 BS(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function IP(e,t,n,r){let s=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?s.pathname.endsWith("/")?s.pathname=`${s.pathname}_.${r}`:s.pathname=`${s.pathname}.${r}`:s.pathname==="/"?s.pathname=`_root.${r}`:t&&Es(s.pathname,t)==="/"?s.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:s.pathname=`${s.pathname.replace(/\/$/,"")}.${r}`,s}async function MP(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 kP(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 LP(e,t,n){let r=await Promise.all(e.map(async s=>{let i=t.routes[s.route.id];if(i){let c=await MP(i,n);return c.links?c.links():[]}return[]}));return FP(r.flat(1).filter(kP).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function DT(e,t,n,r,s,i){let c=(f,m)=>n[m]?f.route.id!==n[m].route.id:!0,u=(f,m)=>{var x;return n[m].pathname!==f.pathname||((x=n[m].route.path)==null?void 0:x.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 x=r.routes[f.route.id];if(!x||!x.hasLoader)return!1;if(c(f,m)||u(f,m))return!0;if(f.route.shouldRevalidate){let y=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 y=="boolean")return y}return!0}):[]}function PP(e,t,{includeHydrateFallback:n}={}){return UP(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 UP(e){return[...new Set(e)]}function zP(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function FP(e,t){let n=new Set;return new Set(t),e.reduce((r,s)=>{let i=JSON.stringify(zP(s));return n.has(i)||(n.add(i),r.push({key:i,link:s})),r},[])}function n4(){let e=h.useContext(kc);return BS(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function HP(){let e=h.useContext(Rh);return BS(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var qS=h.createContext(void 0);qS.displayName="FrameworkContext";function r4(){let e=h.useContext(qS);return BS(e,"You must render this element inside a <HydratedRouter> element"),e}function $P(e,t){let n=h.useContext(qS),[r,s]=h.useState(!1),[i,c]=h.useState(!1),{onFocus:u,onBlur:f,onMouseEnter:m,onMouseLeave:x,onTouchStart:g}=t,y=h.useRef(null);h.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let S=j=>{j.forEach(R=>{c(R.isIntersecting)})},E=new IntersectionObserver(S,{threshold:.5});return y.current&&E.observe(y.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,y,{}]:[i,y,{onFocus:Tf(u,v),onBlur:Tf(f,C),onMouseEnter:Tf(m,v),onMouseLeave:Tf(x,C),onTouchStart:Tf(g,v)}]:[!1,y,{}]}function Tf(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function VP({page:e,...t}){let{router:n}=n4(),r=h.useMemo(()=>ol(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?h.createElement(BP,{page:e,matches:r,...t}):null}function GP(e){let{manifest:t,routeModules:n}=r4(),[r,s]=h.useState([]);return h.useEffect(()=>{let i=!1;return LP(e,t,n).then(c=>{i||s(c)}),()=>{i=!0}},[e,t,n]),r}function BP({page:e,matches:t,...n}){let r=Qs(),{future:s,manifest:i,routeModules:c}=r4(),{basename:u}=n4(),{loaderData:f,matches:m}=HP(),x=h.useMemo(()=>DT(e,t,m,i,r,"data"),[e,t,m,i,r]),g=h.useMemo(()=>DT(e,t,m,i,r,"assets"),[e,t,m,i,r]),y=h.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let S=new Set,E=!1;if(t.forEach(R=>{var N;let T=i.routes[R.route.id];!T||!T.hasLoader||(!x.some(A=>A.route.id===R.route.id)&&R.route.id in f&&((N=c[R.route.id])!=null&&N.shouldRevalidate)||T.hasClientLoader?E=!0:S.add(R.route.id))}),S.size===0)return[];let j=IP(e,u,s.unstable_trailingSlashAwareDataRequests,"data");return E&&S.size>0&&j.searchParams.set("_routes",t.filter(R=>S.has(R.route.id)).map(R=>R.route.id).join(",")),[j.pathname+j.search]},[u,s.unstable_trailingSlashAwareDataRequests,f,r,i,x,t,e,c]),v=h.useMemo(()=>PP(g,i),[g,i]),C=GP(g);return h.createElement(h.Fragment,null,y.map(S=>h.createElement("link",{key:S,rel:"prefetch",as:"fetch",href:S,...n})),v.map(S=>h.createElement("link",{key:S,rel:"modulepreload",href:S,...n})),C.map(({key:S,link:E})=>h.createElement("link",{key:S,nonce:n.nonce,...E})))}function qP(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var KP=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{KP&&(window.__reactRouterVersion="7.12.0")}catch{}function WP(e,t){return S7({basename:t==null?void 0:t.basename,getContext:t==null?void 0:t.getContext,future:t==null?void 0:t.future,history:PL({window:t==null?void 0:t.window}),hydrationData:ZP(),routes:e,mapRouteProperties:gP,hydrationRouteProperties:xP,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 ZP(){let e=window==null?void 0:window.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:YP(e.errors)}),e}function YP(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 Eh(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 a4=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Nr=h.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:s,reloadDocument:i,replace:c,state:u,target:f,to:m,preventScrollReset:x,viewTransition:g,unstable_defaultShouldRevalidate:y,...v},C){let{basename:S,unstable_useTransitions:E}=h.useContext(as),j=typeof m=="string"&&a4.test(m),R=LA(m,S);m=R.to;let T=Q7(m,{relative:s}),[N,A,I]=$P(r,v),_=JP(m,{replace:c,state:u,target:f,preventScrollReset:x,relative:s,viewTransition:g,unstable_defaultShouldRevalidate:y,unstable_useTransitions:E});function M(H){t&&t(H),H.defaultPrevented||_(H)}let G=h.createElement("a",{...v,...I,href:R.absoluteURL||T,onClick:R.isExternal||i?t:M,ref:qP(C,A),target:f,"data-discover":!j&&n==="render"?"true":void 0});return N&&!j?h.createElement(h.Fragment,null,G,h.createElement(VP,{page:T})):G});Nr.displayName="Link";var Th=h.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:s=!1,style:i,to:c,viewTransition:u,children:f,...m},x){let g=jh(c,{relative:m.relative}),y=Qs(),v=h.useContext(Rh),{navigator:C,basename:S}=h.useContext(as),E=v!=null&&aU(g)&&u===!0,j=C.encodeLocation?C.encodeLocation(g).pathname:g.pathname,R=y.pathname,T=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;n||(R=R.toLowerCase(),T=T?T.toLowerCase():null,j=j.toLowerCase()),T&&S&&(T=Es(T,S)||T);const N=j!=="/"&&j.endsWith("/")?j.length-1:j.length;let A=R===j||!s&&R.startsWith(j)&&R.charAt(N)==="/",I=T!=null&&(T===j||!s&&T.startsWith(j)&&T.charAt(j.length)==="/"),_={isActive:A,isPending:I,isTransitioning:E},M=A?t:void 0,G;typeof r=="function"?G=r(_):G=[r,A?"active":null,I?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let H=typeof i=="function"?i(_):i;return h.createElement(Nr,{...m,"aria-current":M,className:G,ref:x,style:H,to:c,viewTransition:u},typeof f=="function"?f(_):f)});Th.displayName="NavLink";var XP=h.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:s,state:i,method:c=dg,action:u,onSubmit:f,relative:m,preventScrollReset:x,viewTransition:g,unstable_defaultShouldRevalidate:y,...v},C)=>{let{unstable_useTransitions:S}=h.useContext(as),E=nU(),j=rU(u,{relative:m}),R=c.toLowerCase()==="get"?"get":"post",T=typeof u=="string"&&a4.test(u),N=A=>{if(f&&f(A),A.defaultPrevented)return;A.preventDefault();let I=A.nativeEvent.submitter,_=(I==null?void 0:I.getAttribute("formmethod"))||c,M=()=>E(I||A.currentTarget,{fetcherKey:t,method:_,navigate:n,replace:s,state:i,relative:m,preventScrollReset:x,viewTransition:g,unstable_defaultShouldRevalidate:y});S&&n!==!1?h.startTransition(()=>M()):M()};return h.createElement("form",{ref:C,method:R,action:j,onSubmit:r?f:N,...v,"data-discover":!T&&e==="render"?"true":void 0})});XP.displayName="Form";function QP(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function s4(e){let t=h.useContext(kc);return Bt(t,QP(e)),t}function JP(e,{target:t,replace:n,state:r,preventScrollReset:s,relative:i,viewTransition:c,unstable_defaultShouldRevalidate:u,unstable_useTransitions:f}={}){let m=Lc(),x=Qs(),g=jh(e,{relative:i});return h.useCallback(y=>{if(_P(y,t)){y.preventDefault();let v=n!==void 0?n:To(x)===To(g),C=()=>m(e,{replace:v,state:r,preventScrollReset:s,relative:i,viewTransition:c,unstable_defaultShouldRevalidate:u});f?h.startTransition(()=>C()):C()}},[x,m,g,n,r,t,e,s,i,c,u,f])}function o4(e){Xn(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(x1(e)),n=h.useRef(!1),r=Qs(),s=h.useMemo(()=>NP(r.search,n.current?null:t.current),[r.search]),i=Lc(),c=h.useCallback((u,f)=>{const m=x1(typeof u=="function"?u(new URLSearchParams(s)):u);n.current=!0,i("?"+m,f)},[i,s]);return[s,c]}var eU=0,tU=()=>`__${String(++eU)}__`;function nU(){let{router:e}=s4("useSubmit"),{basename:t}=h.useContext(as),n=uP(),r=e.fetch,s=e.navigate;return h.useCallback(async(i,c={})=>{let{action:u,method:f,encType:m,formData:x,body:g}=OP(i,t);if(c.navigate===!1){let y=c.fetcherKey||tU();await r(y,n,c.action||u,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:x,body:g,formMethod:c.method||f,formEncType:c.encType||m,flushSync:c.flushSync})}else await s(c.action||u,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:x,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 rU(e,{relative:t}={}){let{basename:n}=h.useContext(as),r=h.useContext(Rs);Bt(r,"useFormAction must be used inside a RouteContext");let[s]=r.matches.slice(-1),i={...jh(e||".",{relative:t})},c=Qs();if(e==null){i.search=c.search;let u=new URLSearchParams(i.search),f=u.getAll("index");if(f.some(x=>x==="")){u.delete("index"),f.filter(g=>g).forEach(g=>u.append("index",g));let x=u.toString();i.search=x?`?${x}`:""}}return(!e||e===".")&&s.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(i.pathname=i.pathname==="/"?n:bo([n,i.pathname])),To(i)}function aU(e,{relative:t}={}){let n=h.useContext(FS);Bt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=s4("useViewTransitionState"),s=jh(e,{relative:t});if(!n.isTransitioning)return!1;let i=Es(n.currentLocation.pathname,r)||n.currentLocation.pathname,c=Es(n.nextLocation.pathname,r)||n.nextLocation.pathname;return jg(s.pathname,c)!=null||jg(s.pathname,i)!=null}var Gs=_A();const i4=TA(Gs);function sU(e){return h.createElement(vP,{flushSync:Gs.flushSync,...e})}function OT(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function aa(...e){return t=>{let n=!1;const r=e.map(s=>{const i=OT(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():OT(e[s],null)}}}}function Rt(...e){return h.useCallback(aa(...e),e)}var oU=Symbol.for("react.lazy"),Tg=Ch[" use ".trim().toString()];function iU(e){return typeof e=="object"&&e!==null&&"then"in e}function l4(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===oU&&"_payload"in e&&iU(e._payload)}function KS(e){const t=lU(e),n=h.forwardRef((r,s)=>{let{children:i,...c}=r;l4(i)&&typeof Tg=="function"&&(i=Tg(i._payload));const u=h.Children.toArray(i),f=u.find(uU);if(f){const m=f.props.children,x=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,x):null})}return a.jsx(t,{...c,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}var _h=KS("Slot");function lU(e){const t=h.forwardRef((n,r)=>{let{children:s,...i}=n;if(l4(s)&&typeof Tg=="function"&&(s=Tg(s._payload)),h.isValidElement(s)){const c=fU(s),u=dU(i,s.props);return s.type!==h.Fragment&&(u.ref=r?aa(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 cU=Symbol("radix.slottable");function uU(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===cU}function dU(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 fU(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 c4(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=c4(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function u4(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=c4(e))&&(r&&(r+=" "),r+=t);return r}const IT=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,MT=u4,Pc=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return MT(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 x=n==null?void 0:n[m],g=i==null?void 0:i[m];if(x===null)return null;const y=IT(x)||IT(g);return s[m][y]}),u=n&&Object.entries(n).reduce((m,x)=>{let[g,y]=x;return y===void 0||(m[g]=y),m},{}),f=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((m,x)=>{let{class:g,className:y,...v}=x;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,y]:m},[]);return MT(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 hU=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),d4=(...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 mU={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 pU=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,...mU,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:d4("lucide",s),...u},[...c.map(([m,x])=>h.createElement(m,x)),...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 _e=(e,t)=>{const n=h.forwardRef(({className:r,...s},i)=>h.createElement(pU,{ref:i,iconNode:t,className:d4(`lucide-${hU(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 gU=[["path",{d:"M5 17H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-1",key:"ns4c3b"}],["path",{d:"m12 15 5 6H7Z",key:"14qnn2"}]],sb=_e("Airplay",gU);/**
|
|
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 xU=[["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"}]],WS=_e("ArchiveRestore",xU);/**
|
|
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 yU=[["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"}]],kT=_e("ArrowDownZA",yU);/**
|
|
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 vU=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],bU=_e("ArrowLeft",vU);/**
|
|
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 SU=[["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"}]],CU=_e("ArrowRightLeft",SU);/**
|
|
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 EU=[["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"}]],LT=_e("ArrowUpAZ",EU);/**
|
|
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 wU=[["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"}]],PT=_e("ArrowUpDown",wU);/**
|
|
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 RU=[["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"}]],jU=_e("Asterisk",RU);/**
|
|
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 TU=[["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"}]],_U=_e("BadgeAlert",TU);/**
|
|
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 NU=[["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"}]],AU=_e("Blocks",NU);/**
|
|
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 DU=[["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"}]],OU=_e("BookOpen",DU);/**
|
|
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 IU=[["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"}]],_g=_e("Box",IU);/**
|
|
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 MU=[["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"}]],kU=_e("BriefcaseBusiness",MU);/**
|
|
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 LU=[["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"}]],wx=_e("CalendarClock",LU);/**
|
|
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 PU=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Ia=_e("Check",PU);/**
|
|
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 UU=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ss=_e("ChevronDown",UU);/**
|
|
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 zU=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],f4=_e("ChevronLeft",zU);/**
|
|
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 FU=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],ba=_e("ChevronRight",FU);/**
|
|
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 HU=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Ng=_e("ChevronUp",HU);/**
|
|
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 $U=[["path",{d:"m7 20 5-5 5 5",key:"13a0gw"}],["path",{d:"m7 4 5 5 5-5",key:"1kwcof"}]],VU=_e("ChevronsDownUp",$U);/**
|
|
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 GU=[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]],BU=_e("ChevronsLeft",GU);/**
|
|
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 qU=[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]],KU=_e("ChevronsRight",qU);/**
|
|
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 WU=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],ZS=_e("ChevronsUpDown",WU);/**
|
|
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 ZU=[["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"}]],Nh=_e("CircleAlert",ZU);/**
|
|
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 YU=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],XU=_e("CircleCheckBig",YU);/**
|
|
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 QU=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Ah=_e("CircleCheck",QU);/**
|
|
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 JU=[["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"}]],Kf=_e("CircleX",JU);/**
|
|
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 ez=[["path",{d:"M20.2 6 3 11l-.9-2.4c-.3-1.1.3-2.2 1.3-2.5l13.5-4c1.1-.3 2.2.3 2.5 1.3Z",key:"1tn4o7"}],["path",{d:"m6.2 5.3 3.1 3.9",key:"iuk76l"}],["path",{d:"m12.4 3.4 3.1 4",key:"6hsd6n"}],["path",{d:"M3 11h18v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z",key:"ltgou9"}]],tz=_e("Clapperboard",ez);/**
|
|
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 nz=[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]],YS=_e("Code",nz);/**
|
|
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 rz=[["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"}]],az=_e("Columns3",rz);/**
|
|
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 sz=[["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"}]],od=_e("Copy",sz);/**
|
|
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 oz=[["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"}]],h4=_e("DatabaseZap",oz);/**
|
|
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 iz=[["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"}]],Sc=_e("Database",iz);/**
|
|
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 lz=[["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"}]],cz=_e("Download",lz);/**
|
|
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 uz=[["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"}]],m4=_e("EllipsisVertical",uz);/**
|
|
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 dz=[["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"}]],Do=_e("Ellipsis",dz);/**
|
|
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 fz=[["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"}]],yi=_e("ExternalLink",fz);/**
|
|
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 hz=[["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"}]],mz=_e("EyeOff",hz);/**
|
|
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 pz=[["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"}]],p4=_e("Eye",pz);/**
|
|
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 gz=[["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"}]],xz=_e("FilePenLine",gz);/**
|
|
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 yz=[["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"}]],vz=_e("FileScan",yz);/**
|
|
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 bz=[["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"}]],g4=_e("FileText",bz);/**
|
|
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 Sz=[["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"}]],Cz=_e("FlaskConical",Sz);/**
|
|
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 Ez=[["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"}]],wz=_e("FolderTree",Ez);/**
|
|
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 Rz=[["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"}]],UT=_e("Gem",Rz);/**
|
|
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 jz=[["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"}]],Tz=_e("Goal",jz);/**
|
|
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 _z=[["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"}]],Nz=_e("GraduationCap",_z);/**
|
|
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 Az=[["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"}]],Dz=_e("Grid2x2Check",Az);/**
|
|
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 Oz=[["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"}]],x4=_e("GripVertical",Oz);/**
|
|
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 Iz=[["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"}]],Mz=_e("Grip",Iz);/**
|
|
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 kz=[["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"}]],Lz=_e("Group",kz);/**
|
|
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 Pz=[["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"}]],Uz=_e("History",Pz);/**
|
|
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 zz=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],_r=_e("Info",zz);/**
|
|
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 Fz=[["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"}]],y1=_e("KeyRound",Fz);/**
|
|
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 Hz=[["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"}]],$z=_e("Layers",Hz);/**
|
|
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 Vz=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],Gz=_e("Lightbulb",Vz);/**
|
|
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 Bz=[["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"}]],qz=_e("ListChecks",Bz);/**
|
|
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 Kz=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Uc=_e("LoaderCircle",Kz);/**
|
|
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 Wz=[["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"}]],Zz=_e("Lock",Wz);/**
|
|
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 Yz=[["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"}]],Xz=_e("LogOut",Yz);/**
|
|
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 Qz=[["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"}]],Jz=_e("Menu",Qz);/**
|
|
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 eF=[["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"}]],y4=_e("MessageCircleQuestion",eF);/**
|
|
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 tF=[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]],nF=_e("MessageCircle",tF);/**
|
|
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 rF=[["path",{d:"M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z",key:"p1xzt8"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1",key:"1cx29u"}]],aF=_e("MessagesSquare",rF);/**
|
|
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 sF=[["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"}]],v4=_e("Monitor",sF);/**
|
|
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 oF=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],b4=_e("Moon",oF);/**
|
|
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 iF=[["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"}]],lF=_e("Network",iF);/**
|
|
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 cF=[["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"}]],uF=_e("OctagonAlert",cF);/**
|
|
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 dF=[["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"}]],S4=_e("OctagonX",dF);/**
|
|
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 fF=[["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"}]],hF=_e("PackageSearch",fF);/**
|
|
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 mF=[["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"}]],pF=_e("PenLine",mF);/**
|
|
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 gF=[["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"}]],xd=_e("Pencil",gF);/**
|
|
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 xF=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],Dh=_e("Play",xF);/**
|
|
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 yF=[["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"}]],XS=_e("Plug",yF);/**
|
|
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 vF=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],sa=_e("Plus",vF);/**
|
|
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 bF=[["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"}]],SF=_e("RefreshCw",bF);/**
|
|
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 CF=[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]],EF=_e("Rocket",CF);/**
|
|
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 wF=[["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"}]],RF=_e("Route",wF);/**
|
|
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 jF=[["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"}]],TF=_e("Scale",jF);/**
|
|
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 _F=[["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"}]],NF=_e("ScanSearch",_F);/**
|
|
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 AF=[["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"}]],DF=_e("ScanText",AF);/**
|
|
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 OF=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],zc=_e("Search",OF);/**
|
|
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 IF=[["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"}]],MF=_e("Send",IF);/**
|
|
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 kF=[["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"}]],C4=_e("Settings",kF);/**
|
|
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 LF=[["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"}]],Xa=_e("Sparkles",LF);/**
|
|
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 PF=[["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"}]],UF=_e("SquareChartGantt",PF);/**
|
|
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 zF=[["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"}]],FF=_e("SquareCheckBig",zF);/**
|
|
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 HF=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"m9 8 6 4-6 4Z",key:"f1r3lt"}]],E4=_e("SquarePlay",HF);/**
|
|
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 $F=[["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"}]],w4=_e("Sun",$F);/**
|
|
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 VF=[["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"}]],GF=_e("SwatchBook",VF);/**
|
|
532
|
+
* @license lucide-react v0.475.0 - ISC
|
|
533
|
+
*
|
|
534
|
+
* This source code is licensed under the ISC license.
|
|
535
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
536
|
+
*/const BF=[["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"}]],R4=_e("Table",BF);/**
|
|
537
|
+
* @license lucide-react v0.475.0 - ISC
|
|
538
|
+
*
|
|
539
|
+
* This source code is licensed under the ISC license.
|
|
540
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
541
|
+
*/const qF=[["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"}]],KF=_e("Telescope",qF);/**
|
|
542
|
+
* @license lucide-react v0.475.0 - ISC
|
|
543
|
+
*
|
|
544
|
+
* This source code is licensed under the ISC license.
|
|
545
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
546
|
+
*/const WF=[["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"}]],os=_e("Trash2",WF);/**
|
|
547
|
+
* @license lucide-react v0.475.0 - ISC
|
|
548
|
+
*
|
|
549
|
+
* This source code is licensed under the ISC license.
|
|
550
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
551
|
+
*/const ZF=[["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"}]],Oh=_e("TriangleAlert",ZF);/**
|
|
552
|
+
* @license lucide-react v0.475.0 - ISC
|
|
553
|
+
*
|
|
554
|
+
* This source code is licensed under the ISC license.
|
|
555
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
556
|
+
*/const YF=[["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"}]],sh=_e("Unplug",YF);/**
|
|
557
|
+
* @license lucide-react v0.475.0 - ISC
|
|
558
|
+
*
|
|
559
|
+
* This source code is licensed under the ISC license.
|
|
560
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
561
|
+
*/const XF=[["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"}]],zT=_e("Users",XF);/**
|
|
562
|
+
* @license lucide-react v0.475.0 - ISC
|
|
563
|
+
*
|
|
564
|
+
* This source code is licensed under the ISC license.
|
|
565
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
566
|
+
*/const QF=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Cc=_e("X",QF),ob=768;function JF(){const[e,t]=h.useState(void 0);return h.useEffect(()=>{const n=window.matchMedia(`(max-width: ${ob-1}px)`),r=()=>{t(window.innerWidth<ob)};return n.addEventListener("change",r),t(window.innerWidth<ob),()=>n.removeEventListener("change",r)},[]),!!e}const eH=(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},tH=(e,t)=>({classGroupId:e,validator:t}),j4=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Ag="-",FT=[],nH="arbitrary..",rH=e=>{const t=sH(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:c=>{if(c.startsWith("[")&&c.endsWith("]"))return aH(c);const u=c.split(Ag),f=u[0]===""&&u.length>1?1:0;return T4(u,f,t)},getConflictingClassGroupIds:(c,u)=>{if(u){const f=r[c],m=n[c];return f?m?eH(m,f):f:m||FT}return n[c]||FT}}},T4=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],i=n.nextPart.get(s);if(i){const m=T4(e,t+1,i);if(m)return m}const c=n.validators;if(c===null)return;const u=t===0?e.join(Ag):e.slice(t).join(Ag),f=c.length;for(let m=0;m<f;m++){const x=c[m];if(x.validator(u))return x.classGroupId}},aH=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?nH+r:void 0})(),sH=e=>{const{theme:t,classGroups:n}=e;return oH(n,t)},oH=(e,t)=>{const n=j4();for(const r in e){const s=e[r];QS(s,n,r,t)}return n},QS=(e,t,n,r)=>{const s=e.length;for(let i=0;i<s;i++){const c=e[i];iH(c,t,n,r)}},iH=(e,t,n,r)=>{if(typeof e=="string"){lH(e,t,n);return}if(typeof e=="function"){cH(e,t,n,r);return}uH(e,t,n,r)},lH=(e,t,n)=>{const r=e===""?t:_4(t,e);r.classGroupId=n},cH=(e,t,n,r)=>{if(dH(e)){QS(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(tH(n,e))},uH=(e,t,n,r)=>{const s=Object.entries(e),i=s.length;for(let c=0;c<i;c++){const[u,f]=s[c];QS(f,_4(t,u),n,r)}},_4=(e,t)=>{let n=e;const r=t.split(Ag),s=r.length;for(let i=0;i<s;i++){const c=r[i];let u=n.nextPart.get(c);u||(u=j4(),n.nextPart.set(c,u)),n=u}return n},dH=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,fH=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)}}},v1="!",HT=":",hH=[],$T=(e,t,n,r,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),mH=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=s=>{const i=[];let c=0,u=0,f=0,m;const x=s.length;for(let S=0;S<x;S++){const E=s[S];if(c===0&&u===0){if(E===HT){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 y=g,v=!1;g.endsWith(v1)?(y=g.slice(0,-1),v=!0):g.startsWith(v1)&&(y=g.slice(1),v=!0);const C=m&&m>f?m-f:void 0;return $T(i,v,y,C)};if(t){const s=t+HT,i=r;r=c=>c.startsWith(s)?i(c.slice(s.length)):$T(hH,!1,c,void 0,!0)}if(n){const s=r;r=i=>n({className:i,parseClassName:s})}return r},pH=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}},gH=e=>({cache:fH(e.cacheSize),parseClassName:mH(e),sortModifiers:pH(e),...rH(e)}),xH=/\s+/,yH=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i}=t,c=[],u=e.trim().split(xH);let f="";for(let m=u.length-1;m>=0;m-=1){const x=u[m],{isExternal:g,modifiers:y,hasImportantModifier:v,baseClassName:C,maybePostfixModifierPosition:S}=n(x);if(g){f=x+(f.length>0?" "+f:f);continue}let E=!!S,j=r(E?C.substring(0,S):C);if(!j){if(!E){f=x+(f.length>0?" "+f:f);continue}if(j=r(C),!j){f=x+(f.length>0?" "+f:f);continue}E=!1}const R=y.length===0?"":y.length===1?y[0]:i(y).join(":"),T=v?R+v1:R,N=T+j;if(c.indexOf(N)>-1)continue;c.push(N);const A=s(j,E);for(let I=0;I<A.length;++I){const _=A[I];c.push(T+_)}f=x+(f.length>0?" "+f:f)}return f},vH=(...e)=>{let t=0,n,r,s="";for(;t<e.length;)(n=e[t++])&&(r=N4(n))&&(s&&(s+=" "),s+=r);return s},N4=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=N4(e[r]))&&(n&&(n+=" "),n+=t);return n},bH=(e,...t)=>{let n,r,s,i;const c=f=>{const m=t.reduce((x,g)=>g(x),e());return n=gH(m),r=n.cache.get,s=n.cache.set,i=u,u(f)},u=f=>{const m=r(f);if(m)return m;const x=yH(f,n);return s(f,x),x};return i=c,(...f)=>i(vH(...f))},SH=[],wr=e=>{const t=n=>n[e]||SH;return t.isThemeGetter=!0,t},A4=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,D4=/^\((?:(\w[\w-]*):)?(.+)\)$/i,CH=/^\d+\/\d+$/,EH=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,wH=/\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$/,RH=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,jH=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,TH=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Au=e=>CH.test(e),Gt=e=>!!e&&!Number.isNaN(Number(e)),el=e=>!!e&&Number.isInteger(Number(e)),ib=e=>e.endsWith("%")&&Gt(e.slice(0,-1)),ti=e=>EH.test(e),_H=()=>!0,NH=e=>wH.test(e)&&!RH.test(e),O4=()=>!1,AH=e=>jH.test(e),DH=e=>TH.test(e),OH=e=>!Ze(e)&&!Ye(e),IH=e=>yd(e,k4,O4),Ze=e=>A4.test(e),ic=e=>yd(e,L4,NH),lb=e=>yd(e,UH,Gt),VT=e=>yd(e,I4,O4),MH=e=>yd(e,M4,DH),Pp=e=>yd(e,P4,AH),Ye=e=>D4.test(e),_f=e=>vd(e,L4),kH=e=>vd(e,zH),GT=e=>vd(e,I4),LH=e=>vd(e,k4),PH=e=>vd(e,M4),Up=e=>vd(e,P4,!0),yd=(e,t,n)=>{const r=A4.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},vd=(e,t,n=!1)=>{const r=D4.exec(e);return r?r[1]?t(r[1]):n:!1},I4=e=>e==="position"||e==="percentage",M4=e=>e==="image"||e==="url",k4=e=>e==="length"||e==="size"||e==="bg-size",L4=e=>e==="length",UH=e=>e==="number",zH=e=>e==="family-name",P4=e=>e==="shadow",FH=()=>{const e=wr("color"),t=wr("font"),n=wr("text"),r=wr("font-weight"),s=wr("tracking"),i=wr("leading"),c=wr("breakpoint"),u=wr("container"),f=wr("spacing"),m=wr("radius"),x=wr("shadow"),g=wr("inset-shadow"),y=wr("text-shadow"),v=wr("drop-shadow"),C=wr("blur"),S=wr("perspective"),E=wr("aspect"),j=wr("ease"),R=wr("animate"),T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],N=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],A=()=>[...N(),Ye,Ze],I=()=>["auto","hidden","clip","visible","scroll"],_=()=>["auto","contain","none"],M=()=>[Ye,Ze,f],G=()=>[Au,"full","auto",...M()],H=()=>[el,"none","subgrid",Ye,Ze],L=()=>["auto",{span:["full",el,Ye,Ze]},el,Ye,Ze],q=()=>[el,"auto",Ye,Ze],W=()=>["auto","min","max","fr",Ye,Ze],B=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],V=()=>["start","end","center","stretch","center-safe","end-safe"],D=()=>["auto",...M()],F=()=>[Au,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...M()],U=()=>[e,Ye,Ze],ee=()=>[...N(),GT,VT,{position:[Ye,Ze]}],he=()=>["no-repeat",{repeat:["","x","y","space","round"]}],z=()=>["auto","cover","contain",LH,IH,{size:[Ye,Ze]}],$=()=>[ib,_f,ic],P=()=>["","none","full",m,Ye,Ze],K=()=>["",Gt,_f,ic],Y=()=>["solid","dashed","dotted","double"],se=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Q=()=>[Gt,ib,GT,VT],le=()=>["","none",C,Ye,Ze],pe=()=>["none",Gt,Ye,Ze],be=()=>["none",Gt,Ye,Ze],ze=()=>[Gt,Ye,Ze],Re=()=>[Au,"full",...M()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ti],breakpoint:[ti],color:[_H],container:[ti],"drop-shadow":[ti],ease:["in","out","in-out"],font:[OH],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ti],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ti],shadow:[ti],spacing:["px",Gt],text:[ti],"text-shadow":[ti],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Au,Ze,Ye,E]}],container:["container"],columns:[{columns:[Gt,Ze,Ye,u]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"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:I()}],"overflow-x":[{"overflow-x":I()}],"overflow-y":[{"overflow-y":I()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:G()}],"inset-x":[{"inset-x":G()}],"inset-y":[{"inset-y":G()}],start:[{start:G()}],end:[{end:G()}],top:[{top:G()}],right:[{right:G()}],bottom:[{bottom:G()}],left:[{left:G()}],visibility:["visible","invisible","collapse"],z:[{z:[el,"auto",Ye,Ze]}],basis:[{basis:[Au,"full","auto",u,...M()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Gt,Au,"auto","initial","none",Ze]}],grow:[{grow:["",Gt,Ye,Ze]}],shrink:[{shrink:["",Gt,Ye,Ze]}],order:[{order:[el,"first","last","none",Ye,Ze]}],"grid-cols":[{"grid-cols":H()}],"col-start-end":[{col:L()}],"col-start":[{"col-start":q()}],"col-end":[{"col-end":q()}],"grid-rows":[{"grid-rows":H()}],"row-start-end":[{row:L()}],"row-start":[{"row-start":q()}],"row-end":[{"row-end":q()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":W()}],"auto-rows":[{"auto-rows":W()}],gap:[{gap:M()}],"gap-x":[{"gap-x":M()}],"gap-y":[{"gap-y":M()}],"justify-content":[{justify:[...B(),"normal"]}],"justify-items":[{"justify-items":[...V(),"normal"]}],"justify-self":[{"justify-self":["auto",...V()]}],"align-content":[{content:["normal",...B()]}],"align-items":[{items:[...V(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...V(),{baseline:["","last"]}]}],"place-content":[{"place-content":B()}],"place-items":[{"place-items":[...V(),"baseline"]}],"place-self":[{"place-self":["auto",...V()]}],p:[{p:M()}],px:[{px:M()}],py:[{py:M()}],ps:[{ps:M()}],pe:[{pe:M()}],pt:[{pt:M()}],pr:[{pr:M()}],pb:[{pb:M()}],pl:[{pl:M()}],m:[{m:D()}],mx:[{mx:D()}],my:[{my:D()}],ms:[{ms:D()}],me:[{me:D()}],mt:[{mt:D()}],mr:[{mr:D()}],mb:[{mb:D()}],ml:[{ml:D()}],"space-x":[{"space-x":M()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":M()}],"space-y-reverse":["space-y-reverse"],size:[{size:F()}],w:[{w:[u,"screen",...F()]}],"min-w":[{"min-w":[u,"screen","none",...F()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[c]},...F()]}],h:[{h:["screen","lh",...F()]}],"min-h":[{"min-h":["screen","lh","none",...F()]}],"max-h":[{"max-h":["screen","lh",...F()]}],"font-size":[{text:["base",n,_f,ic]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Ye,lb]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ib,Ze]}],"font-family":[{font:[kH,Ze,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,Ye,Ze]}],"line-clamp":[{"line-clamp":[Gt,"none",Ye,lb]}],leading:[{leading:[i,...M()]}],"list-image":[{"list-image":["none",Ye,Ze]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ye,Ze]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:U()}],"text-color":[{text:U()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Y(),"wavy"]}],"text-decoration-thickness":[{decoration:[Gt,"from-font","auto",Ye,ic]}],"text-decoration-color":[{decoration:U()}],"underline-offset":[{"underline-offset":[Gt,"auto",Ye,Ze]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ye,Ze]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ye,Ze]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ee()}],"bg-repeat":[{bg:he()}],"bg-size":[{bg:z()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},el,Ye,Ze],radial:["",Ye,Ze],conic:[el,Ye,Ze]},PH,MH]}],"bg-color":[{bg:U()}],"gradient-from-pos":[{from:$()}],"gradient-via-pos":[{via:$()}],"gradient-to-pos":[{to:$()}],"gradient-from":[{from:U()}],"gradient-via":[{via:U()}],"gradient-to":[{to:U()}],rounded:[{rounded:P()}],"rounded-s":[{"rounded-s":P()}],"rounded-e":[{"rounded-e":P()}],"rounded-t":[{"rounded-t":P()}],"rounded-r":[{"rounded-r":P()}],"rounded-b":[{"rounded-b":P()}],"rounded-l":[{"rounded-l":P()}],"rounded-ss":[{"rounded-ss":P()}],"rounded-se":[{"rounded-se":P()}],"rounded-ee":[{"rounded-ee":P()}],"rounded-es":[{"rounded-es":P()}],"rounded-tl":[{"rounded-tl":P()}],"rounded-tr":[{"rounded-tr":P()}],"rounded-br":[{"rounded-br":P()}],"rounded-bl":[{"rounded-bl":P()}],"border-w":[{border:K()}],"border-w-x":[{"border-x":K()}],"border-w-y":[{"border-y":K()}],"border-w-s":[{"border-s":K()}],"border-w-e":[{"border-e":K()}],"border-w-t":[{"border-t":K()}],"border-w-r":[{"border-r":K()}],"border-w-b":[{"border-b":K()}],"border-w-l":[{"border-l":K()}],"divide-x":[{"divide-x":K()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":K()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Y(),"hidden","none"]}],"divide-style":[{divide:[...Y(),"hidden","none"]}],"border-color":[{border:U()}],"border-color-x":[{"border-x":U()}],"border-color-y":[{"border-y":U()}],"border-color-s":[{"border-s":U()}],"border-color-e":[{"border-e":U()}],"border-color-t":[{"border-t":U()}],"border-color-r":[{"border-r":U()}],"border-color-b":[{"border-b":U()}],"border-color-l":[{"border-l":U()}],"divide-color":[{divide:U()}],"outline-style":[{outline:[...Y(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Gt,Ye,Ze]}],"outline-w":[{outline:["",Gt,_f,ic]}],"outline-color":[{outline:U()}],shadow:[{shadow:["","none",x,Up,Pp]}],"shadow-color":[{shadow:U()}],"inset-shadow":[{"inset-shadow":["none",g,Up,Pp]}],"inset-shadow-color":[{"inset-shadow":U()}],"ring-w":[{ring:K()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:U()}],"ring-offset-w":[{"ring-offset":[Gt,ic]}],"ring-offset-color":[{"ring-offset":U()}],"inset-ring-w":[{"inset-ring":K()}],"inset-ring-color":[{"inset-ring":U()}],"text-shadow":[{"text-shadow":["none",y,Up,Pp]}],"text-shadow-color":[{"text-shadow":U()}],opacity:[{opacity:[Gt,Ye,Ze]}],"mix-blend":[{"mix-blend":[...se(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":se()}],"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":[Gt]}],"mask-image-linear-from-pos":[{"mask-linear-from":Q()}],"mask-image-linear-to-pos":[{"mask-linear-to":Q()}],"mask-image-linear-from-color":[{"mask-linear-from":U()}],"mask-image-linear-to-color":[{"mask-linear-to":U()}],"mask-image-t-from-pos":[{"mask-t-from":Q()}],"mask-image-t-to-pos":[{"mask-t-to":Q()}],"mask-image-t-from-color":[{"mask-t-from":U()}],"mask-image-t-to-color":[{"mask-t-to":U()}],"mask-image-r-from-pos":[{"mask-r-from":Q()}],"mask-image-r-to-pos":[{"mask-r-to":Q()}],"mask-image-r-from-color":[{"mask-r-from":U()}],"mask-image-r-to-color":[{"mask-r-to":U()}],"mask-image-b-from-pos":[{"mask-b-from":Q()}],"mask-image-b-to-pos":[{"mask-b-to":Q()}],"mask-image-b-from-color":[{"mask-b-from":U()}],"mask-image-b-to-color":[{"mask-b-to":U()}],"mask-image-l-from-pos":[{"mask-l-from":Q()}],"mask-image-l-to-pos":[{"mask-l-to":Q()}],"mask-image-l-from-color":[{"mask-l-from":U()}],"mask-image-l-to-color":[{"mask-l-to":U()}],"mask-image-x-from-pos":[{"mask-x-from":Q()}],"mask-image-x-to-pos":[{"mask-x-to":Q()}],"mask-image-x-from-color":[{"mask-x-from":U()}],"mask-image-x-to-color":[{"mask-x-to":U()}],"mask-image-y-from-pos":[{"mask-y-from":Q()}],"mask-image-y-to-pos":[{"mask-y-to":Q()}],"mask-image-y-from-color":[{"mask-y-from":U()}],"mask-image-y-to-color":[{"mask-y-to":U()}],"mask-image-radial":[{"mask-radial":[Ye,Ze]}],"mask-image-radial-from-pos":[{"mask-radial-from":Q()}],"mask-image-radial-to-pos":[{"mask-radial-to":Q()}],"mask-image-radial-from-color":[{"mask-radial-from":U()}],"mask-image-radial-to-color":[{"mask-radial-to":U()}],"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":N()}],"mask-image-conic-pos":[{"mask-conic":[Gt]}],"mask-image-conic-from-pos":[{"mask-conic-from":Q()}],"mask-image-conic-to-pos":[{"mask-conic-to":Q()}],"mask-image-conic-from-color":[{"mask-conic-from":U()}],"mask-image-conic-to-color":[{"mask-conic-to":U()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ee()}],"mask-repeat":[{mask:he()}],"mask-size":[{mask:z()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ye,Ze]}],filter:[{filter:["","none",Ye,Ze]}],blur:[{blur:le()}],brightness:[{brightness:[Gt,Ye,Ze]}],contrast:[{contrast:[Gt,Ye,Ze]}],"drop-shadow":[{"drop-shadow":["","none",v,Up,Pp]}],"drop-shadow-color":[{"drop-shadow":U()}],grayscale:[{grayscale:["",Gt,Ye,Ze]}],"hue-rotate":[{"hue-rotate":[Gt,Ye,Ze]}],invert:[{invert:["",Gt,Ye,Ze]}],saturate:[{saturate:[Gt,Ye,Ze]}],sepia:[{sepia:["",Gt,Ye,Ze]}],"backdrop-filter":[{"backdrop-filter":["","none",Ye,Ze]}],"backdrop-blur":[{"backdrop-blur":le()}],"backdrop-brightness":[{"backdrop-brightness":[Gt,Ye,Ze]}],"backdrop-contrast":[{"backdrop-contrast":[Gt,Ye,Ze]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Gt,Ye,Ze]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Gt,Ye,Ze]}],"backdrop-invert":[{"backdrop-invert":["",Gt,Ye,Ze]}],"backdrop-opacity":[{"backdrop-opacity":[Gt,Ye,Ze]}],"backdrop-saturate":[{"backdrop-saturate":[Gt,Ye,Ze]}],"backdrop-sepia":[{"backdrop-sepia":["",Gt,Ye,Ze]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":M()}],"border-spacing-x":[{"border-spacing-x":M()}],"border-spacing-y":[{"border-spacing-y":M()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ye,Ze]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Gt,"initial",Ye,Ze]}],ease:[{ease:["linear","initial",j,Ye,Ze]}],delay:[{delay:[Gt,Ye,Ze]}],animate:[{animate:["none",R,Ye,Ze]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,Ye,Ze]}],"perspective-origin":[{"perspective-origin":A()}],rotate:[{rotate:pe()}],"rotate-x":[{"rotate-x":pe()}],"rotate-y":[{"rotate-y":pe()}],"rotate-z":[{"rotate-z":pe()}],scale:[{scale:be()}],"scale-x":[{"scale-x":be()}],"scale-y":[{"scale-y":be()}],"scale-z":[{"scale-z":be()}],"scale-3d":["scale-3d"],skew:[{skew:ze()}],"skew-x":[{"skew-x":ze()}],"skew-y":[{"skew-y":ze()}],transform:[{transform:[Ye,Ze,"","none","gpu","cpu"]}],"transform-origin":[{origin:A()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Re()}],"translate-x":[{"translate-x":Re()}],"translate-y":[{"translate-y":Re()}],"translate-z":[{"translate-z":Re()}],"translate-none":["translate-none"],accent:[{accent:U()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:U()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ye,Ze]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ye,Ze]}],fill:[{fill:["none",...U()]}],"stroke-w":[{stroke:[Gt,_f,ic,lb]}],stroke:[{stroke:["none",...U()]}],"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"]}},HH=bH(FH);function oe(...e){return HH(u4(e))}const JS=Pc("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-white/4 dark:hover:bg-white/8",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-white/8",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function we({className:e,variant:t,size:n,asChild:r=!1,...s}){const i=r?_h:"button";return a.jsx(i,{"data-slot":"button",className:oe(JS({variant:t,size:n,className:e})),...s})}function ct({className:e,type:t,...n}){return a.jsx("input",{type:t,"data-slot":"input",className:oe("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...n})}var $H=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],VH=$H.reduce((e,t)=>{const n=KS(`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}},{}),GH="Separator",BT="horizontal",BH=["horizontal","vertical"],U4=h.forwardRef((e,t)=>{const{decorative:n,orientation:r=BT,...s}=e,i=qH(r)?r:BT,u=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return a.jsx(VH.div,{"data-orientation":i,...u,...s,ref:t})});U4.displayName=GH;function qH(e){return BH.includes(e)}var KH=U4;function eC({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return a.jsx(KH,{"data-slot":"separator",decorative:n,orientation:t,className:oe("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...r})}function Me(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 WH(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 Dr(e,t=[]){let n=[];function r(i,c){const u=h.createContext(c),f=n.length;n=[...n,c];const m=g=>{var j;const{scope:y,children:v,...C}=g,S=((j=y==null?void 0:y[e])==null?void 0:j[f])||u,E=h.useMemo(()=>C,Object.values(C));return a.jsx(S.Provider,{value:E,children:v})};m.displayName=i+"Provider";function x(g,y){var S;const v=((S=y==null?void 0:y[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,x]}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,ZH(s,...t)]}function ZH(...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 Zr=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{},YH=Ch[" useId ".trim().toString()]||(()=>{}),XH=0;function ar(e){const[t,n]=h.useState(YH());return Zr(()=>{n(r=>r??String(XH++))},[e]),e||(t?`radix-${t}`:"")}var QH=Ch[" useInsertionEffect ".trim().toString()]||Zr;function ya({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,i,c]=JH({defaultProp:t,onChange:n}),u=e!==void 0,f=u?e:s;{const x=h.useRef(e!==void 0);h.useEffect(()=>{const g=x.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.`),x.current=u},[u,r])}const m=h.useCallback(x=>{var g;if(u){const y=e$(x)?x(e):x;y!==e&&((g=c.current)==null||g.call(c,y))}else i(x)},[u,e,i,c]);return[f,m]}function JH({defaultProp:e,onChange:t}){const[n,r]=h.useState(e),s=h.useRef(n),i=h.useRef(t);return QH(()=>{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 e$(e){return typeof e=="function"}function t$(e){const t=n$(e),n=h.forwardRef((r,s)=>{const{children:i,...c}=r,u=h.Children.toArray(i),f=u.find(a$);if(f){const m=f.props.children,x=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,x):null})}return a.jsx(t,{...c,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function n$(e){const t=h.forwardRef((n,r)=>{const{children:s,...i}=n;if(h.isValidElement(s)){const c=o$(s),u=s$(i,s.props);return s.type!==h.Fragment&&(u.ref=r?aa(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 r$=Symbol("radix.slottable");function a$(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===r$}function s$(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 o$(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 i$=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],tt=i$.reduce((e,t)=>{const n=t$(`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 z4(e,t){e&&Gs.flushSync(()=>e.dispatchEvent(t))}function Ws(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 l$(e,t=globalThis==null?void 0:globalThis.document){const n=Ws(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 c$="DismissableLayer",b1="dismissableLayer.update",u$="dismissableLayer.pointerDownOutside",d$="dismissableLayer.focusOutside",qT,F4=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Fc=h.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:c,onDismiss:u,...f}=e,m=h.useContext(F4),[x,g]=h.useState(null),y=(x==null?void 0:x.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,v]=h.useState({}),C=Rt(t,_=>g(_)),S=Array.from(m.layers),[E]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),j=S.indexOf(E),R=x?S.indexOf(x):-1,T=m.layersWithOutsidePointerEventsDisabled.size>0,N=R>=j,A=m$(_=>{const M=_.target,G=[...m.branches].some(H=>H.contains(M));!N||G||(s==null||s(_),c==null||c(_),_.defaultPrevented||u==null||u())},y),I=p$(_=>{const M=_.target;[...m.branches].some(H=>H.contains(M))||(i==null||i(_),c==null||c(_),_.defaultPrevented||u==null||u())},y);return l$(_=>{R===m.layers.size-1&&(r==null||r(_),!_.defaultPrevented&&u&&(_.preventDefault(),u()))},y),h.useEffect(()=>{if(x)return n&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(qT=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(x)),m.layers.add(x),KT(),()=>{n&&m.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=qT)}},[x,y,n,m]),h.useEffect(()=>()=>{x&&(m.layers.delete(x),m.layersWithOutsidePointerEventsDisabled.delete(x),KT())},[x,m]),h.useEffect(()=>{const _=()=>v({});return document.addEventListener(b1,_),()=>document.removeEventListener(b1,_)},[]),a.jsx(tt.div,{...f,ref:C,style:{pointerEvents:T?N?"auto":"none":void 0,...e.style},onFocusCapture:Me(e.onFocusCapture,I.onFocusCapture),onBlurCapture:Me(e.onBlurCapture,I.onBlurCapture),onPointerDownCapture:Me(e.onPointerDownCapture,A.onPointerDownCapture)})});Fc.displayName=c$;var f$="DismissableLayerBranch",h$=h.forwardRef((e,t)=>{const n=h.useContext(F4),r=h.useRef(null),s=Rt(t,r);return h.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),a.jsx(tt.div,{...e,ref:s})});h$.displayName=f$;function m$(e,t=globalThis==null?void 0:globalThis.document){const n=Ws(e),r=h.useRef(!1),s=h.useRef(()=>{});return h.useEffect(()=>{const i=u=>{if(u.target&&!r.current){let f=function(){H4(u$,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 p$(e,t=globalThis==null?void 0:globalThis.document){const n=Ws(e),r=h.useRef(!1);return h.useEffect(()=>{const s=i=>{i.target&&!r.current&&H4(d$,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 KT(){const e=new CustomEvent(b1);document.dispatchEvent(e)}function H4(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?z4(s,i):s.dispatchEvent(i)}var cb="focusScope.autoFocusOnMount",ub="focusScope.autoFocusOnUnmount",WT={bubbles:!1,cancelable:!0},g$="FocusScope",Ih=h.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...c}=e,[u,f]=h.useState(null),m=Ws(s),x=Ws(i),g=h.useRef(null),y=Rt(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(T){if(v.paused||!u)return;const N=T.target;u.contains(N)?g.current=N:nl(g.current,{select:!0})},E=function(T){if(v.paused||!u)return;const N=T.relatedTarget;N!==null&&(u.contains(N)||nl(g.current,{select:!0}))},j=function(T){if(document.activeElement===document.body)for(const A of T)A.removedNodes.length>0&&nl(u)};document.addEventListener("focusin",S),document.addEventListener("focusout",E);const R=new MutationObserver(j);return u&&R.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",E),R.disconnect()}}},[r,u,v.paused]),h.useEffect(()=>{if(u){YT.add(v);const S=document.activeElement;if(!u.contains(S)){const j=new CustomEvent(cb,WT);u.addEventListener(cb,m),u.dispatchEvent(j),j.defaultPrevented||(x$(C$($4(u)),{select:!0}),document.activeElement===S&&nl(u))}return()=>{u.removeEventListener(cb,m),setTimeout(()=>{const j=new CustomEvent(ub,WT);u.addEventListener(ub,x),u.dispatchEvent(j),j.defaultPrevented||nl(S??document.body,{select:!0}),u.removeEventListener(ub,x),YT.remove(v)},0)}}},[u,m,x,v]);const C=h.useCallback(S=>{if(!n&&!r||v.paused)return;const E=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,j=document.activeElement;if(E&&j){const R=S.currentTarget,[T,N]=y$(R);T&&N?!S.shiftKey&&j===N?(S.preventDefault(),n&&nl(T,{select:!0})):S.shiftKey&&j===T&&(S.preventDefault(),n&&nl(N,{select:!0})):j===R&&S.preventDefault()}},[n,r,v.paused]);return a.jsx(tt.div,{tabIndex:-1,...c,ref:y,onKeyDown:C})});Ih.displayName=g$;function x$(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(nl(r,{select:t}),document.activeElement!==n)return}function y$(e){const t=$4(e),n=ZT(t,e),r=ZT(t.reverse(),e);return[n,r]}function $4(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 ZT(e,t){for(const n of e)if(!v$(n,{upTo:t}))return n}function v$(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 b$(e){return e instanceof HTMLInputElement&&"select"in e}function nl(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&b$(e)&&t&&e.select()}}var YT=S$();function S$(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=XT(e,t),e.unshift(t)},remove(t){var n;e=XT(e,t),(n=e[0])==null||n.resume()}}}function XT(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function C$(e){return e.filter(t=>t.tagName!=="A")}var E$="Portal",Hc=h.forwardRef((e,t)=>{var u;const{container:n,...r}=e,[s,i]=h.useState(!1);Zr(()=>i(!0),[]);const c=n||s&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return c?i4.createPortal(a.jsx(tt.div,{...r,ref:t}),c):null});Hc.displayName=E$;function w$(e,t){return h.useReducer((n,r)=>t[n][r]??n,e)}var Xr=e=>{const{present:t,children:n}=e,r=R$(t),s=typeof n=="function"?n({present:r.isPresent}):h.Children.only(n),i=Rt(r.ref,j$(s));return typeof n=="function"||r.isPresent?h.cloneElement(s,{ref:i}):null};Xr.displayName="Presence";function R$(e){const[t,n]=h.useState(),r=h.useRef(null),s=h.useRef(e),i=h.useRef("none"),c=e?"mounted":"unmounted",[u,f]=w$(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const m=zp(r.current);i.current=u==="mounted"?m:"none"},[u]),Zr(()=>{const m=r.current,x=s.current;if(x!==e){const y=i.current,v=zp(m);e?f("MOUNT"):v==="none"||(m==null?void 0:m.display)==="none"?f("UNMOUNT"):f(x&&y!==v?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,f]),Zr(()=>{if(t){let m;const x=t.ownerDocument.defaultView??window,g=v=>{const S=zp(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=x.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=E)})}},y=v=>{v.target===t&&(i.current=zp(r.current))};return t.addEventListener("animationstart",y),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{x.clearTimeout(m),t.removeEventListener("animationstart",y),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 zp(e){return(e==null?void 0:e.animationName)||"none"}function j$(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 db=0;function Rx(){h.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??QT()),document.body.insertAdjacentElement("beforeend",e[1]??QT()),db++,()=>{db===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),db--}},[])}function QT(){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 go=function(){return go=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},go.apply(this,arguments)};function V4(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 T$(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 hg="right-scroll-bar-position",mg="width-before-scroll-bar",_$="with-scroll-bars-hidden",N$="--removed-body-scroll-bar-size";function fb(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function A$(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 D$=typeof window<"u"?h.useLayoutEffect:h.useEffect,JT=new WeakMap;function O$(e,t){var n=A$(null,function(r){return e.forEach(function(s){return fb(s,r)})});return D$(function(){var r=JT.get(n);if(r){var s=new Set(r),i=new Set(e),c=n.current;s.forEach(function(u){i.has(u)||fb(u,null)}),i.forEach(function(u){s.has(u)||fb(u,c)})}JT.set(n,e)},[e]),n}function I$(e){return e}function M$(e,t){t===void 0&&(t=I$);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 x=c;c=[],x.forEach(i)},m=function(){return Promise.resolve().then(f)};m(),n={push:function(x){c.push(x),m()},filter:function(x){return c=c.filter(x),n}}}};return s}function k$(e){e===void 0&&(e={});var t=M$(null);return t.options=go({async:!0,ssr:!1},e),t}var G4=function(e){var t=e.sideCar,n=V4(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,go({},n))};G4.isSideCarExport=!0;function L$(e,t){return e.useMedium(t),G4}var B4=k$(),hb=function(){},jx=h.forwardRef(function(e,t){var n=h.useRef(null),r=h.useState({onScrollCapture:hb,onWheelCapture:hb,onTouchMoveCapture:hb}),s=r[0],i=r[1],c=e.forwardProps,u=e.children,f=e.className,m=e.removeScrollBar,x=e.enabled,g=e.shards,y=e.sideCar,v=e.noRelative,C=e.noIsolation,S=e.inert,E=e.allowPinchZoom,j=e.as,R=j===void 0?"div":j,T=e.gapMode,N=V4(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),A=y,I=O$([n,t]),_=go(go({},N),s);return h.createElement(h.Fragment,null,x&&h.createElement(A,{sideCar:B4,removeScrollBar:m,shards:g,noRelative:v,noIsolation:C,inert:S,setCallbacks:i,allowPinchZoom:!!E,lockRef:n,gapMode:T}),c?h.cloneElement(h.Children.only(u),go(go({},_),{ref:I})):h.createElement(R,go({},_,{className:f,ref:I}),u))});jx.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};jx.classNames={fullWidth:mg,zeroRight:hg};var P$=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function U$(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=P$();return t&&e.setAttribute("nonce",t),e}function z$(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function F$(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var H$=function(){var e=0,t=null;return{add:function(n){e==0&&(t=U$())&&(z$(t,n),F$(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},$$=function(){var e=H$();return function(t,n){h.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},q4=function(){var e=$$(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},V$={left:0,top:0,right:0,gap:0},mb=function(e){return parseInt(e||"",10)||0},G$=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[mb(n),mb(r),mb(s)]},B$=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return V$;var t=G$(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])}},q$=q4(),Yu="data-scroll-locked",K$=function(e,t,n,r){var s=e.left,i=e.top,c=e.right,u=e.gap;return n===void 0&&(n="margin"),`
|
|
567
|
+
.`.concat(_$,` {
|
|
568
|
+
overflow: hidden `).concat(r,`;
|
|
569
|
+
padding-right: `).concat(u,"px ").concat(r,`;
|
|
570
|
+
}
|
|
571
|
+
body[`).concat(Yu,`] {
|
|
572
|
+
overflow: hidden `).concat(r,`;
|
|
573
|
+
overscroll-behavior: contain;
|
|
574
|
+
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
575
|
+
padding-left: `.concat(s,`px;
|
|
576
|
+
padding-top: `).concat(i,`px;
|
|
577
|
+
padding-right: `).concat(c,`px;
|
|
578
|
+
margin-left:0;
|
|
579
|
+
margin-top:0;
|
|
580
|
+
margin-right: `).concat(u,"px ").concat(r,`;
|
|
581
|
+
`),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
.`).concat(hg,` {
|
|
585
|
+
right: `).concat(u,"px ").concat(r,`;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
.`).concat(mg,` {
|
|
589
|
+
margin-right: `).concat(u,"px ").concat(r,`;
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
.`).concat(hg," .").concat(hg,` {
|
|
593
|
+
right: 0 `).concat(r,`;
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
.`).concat(mg," .").concat(mg,` {
|
|
597
|
+
margin-right: 0 `).concat(r,`;
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
body[`).concat(Yu,`] {
|
|
601
|
+
`).concat(N$,": ").concat(u,`px;
|
|
602
|
+
}
|
|
603
|
+
`)},e_=function(){var e=parseInt(document.body.getAttribute(Yu)||"0",10);return isFinite(e)?e:0},W$=function(){h.useEffect(function(){return document.body.setAttribute(Yu,(e_()+1).toString()),function(){var e=e_()-1;e<=0?document.body.removeAttribute(Yu):document.body.setAttribute(Yu,e.toString())}},[])},Z$=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;W$();var i=h.useMemo(function(){return B$(s)},[s]);return h.createElement(q$,{styles:K$(i,!t,s,n?"":"!important")})},S1=!1;if(typeof window<"u")try{var Fp=Object.defineProperty({},"passive",{get:function(){return S1=!0,!0}});window.addEventListener("test",Fp,Fp),window.removeEventListener("test",Fp,Fp)}catch{S1=!1}var Du=S1?{passive:!1}:!1,Y$=function(e){return e.tagName==="TEXTAREA"},K4=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Y$(e)&&n[t]==="visible")},X$=function(e){return K4(e,"overflowY")},Q$=function(e){return K4(e,"overflowX")},t_=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=W4(e,r);if(s){var i=Z4(e,r),c=i[1],u=i[2];if(c>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},J$=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},eV=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},W4=function(e,t){return e==="v"?X$(t):Q$(t)},Z4=function(e,t){return e==="v"?J$(t):eV(t)},tV=function(e,t){return e==="h"&&t==="rtl"?-1:1},nV=function(e,t,n,r,s){var i=tV(e,window.getComputedStyle(t).direction),c=i*r,u=n.target,f=t.contains(u),m=!1,x=c>0,g=0,y=0;do{if(!u)break;var v=Z4(e,u),C=v[0],S=v[1],E=v[2],j=S-E-i*C;(C||j)&&W4(e,u)&&(g+=j,y+=C);var R=u.parentNode;u=R&&R.nodeType===Node.DOCUMENT_FRAGMENT_NODE?R.host:R}while(!f&&u!==document.body||f&&(t.contains(u)||t===u));return(x&&Math.abs(g)<1||!x&&Math.abs(y)<1)&&(m=!0),m},Hp=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},n_=function(e){return[e.deltaX,e.deltaY]},r_=function(e){return e&&"current"in e?e.current:e},rV=function(e,t){return e[0]===t[0]&&e[1]===t[1]},aV=function(e){return`
|
|
604
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
605
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
606
|
+
`)},sV=0,Ou=[];function oV(e){var t=h.useRef([]),n=h.useRef([0,0]),r=h.useRef(),s=h.useState(sV++)[0],i=h.useState(q4)[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=T$([e.lockRef.current],(e.shards||[]).map(r_),!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 j=Hp(S),R=n.current,T="deltaX"in S?S.deltaX:R[0]-j[0],N="deltaY"in S?S.deltaY:R[1]-j[1],A,I=S.target,_=Math.abs(T)>Math.abs(N)?"h":"v";if("touches"in S&&_==="h"&&I.type==="range")return!1;var M=window.getSelection(),G=M&&M.anchorNode,H=G?G===I||G.contains(I):!1;if(H)return!1;var L=t_(_,I);if(!L)return!0;if(L?A=_:(A=_==="v"?"h":"v",L=t_(_,I)),!L)return!1;if(!r.current&&"changedTouches"in S&&(T||N)&&(r.current=A),!A)return!0;var q=r.current||A;return nV(q,E,S,q==="h"?T:N)},[]),f=h.useCallback(function(S){var E=S;if(!(!Ou.length||Ou[Ou.length-1]!==i)){var j="deltaY"in E?n_(E):Hp(E),R=t.current.filter(function(A){return A.name===E.type&&(A.target===E.target||E.target===A.shadowParent)&&rV(A.delta,j)})[0];if(R&&R.should){E.cancelable&&E.preventDefault();return}if(!R){var T=(c.current.shards||[]).map(r_).filter(Boolean).filter(function(A){return A.contains(E.target)}),N=T.length>0?u(E,T[0]):!c.current.noIsolation;N&&E.cancelable&&E.preventDefault()}}},[]),m=h.useCallback(function(S,E,j,R){var T={name:S,delta:E,target:j,should:R,shadowParent:iV(j)};t.current.push(T),setTimeout(function(){t.current=t.current.filter(function(N){return N!==T})},1)},[]),x=h.useCallback(function(S){n.current=Hp(S),r.current=void 0},[]),g=h.useCallback(function(S){m(S.type,n_(S),S.target,u(S,e.lockRef.current))},[]),y=h.useCallback(function(S){m(S.type,Hp(S),S.target,u(S,e.lockRef.current))},[]);h.useEffect(function(){return Ou.push(i),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:y}),document.addEventListener("wheel",f,Du),document.addEventListener("touchmove",f,Du),document.addEventListener("touchstart",x,Du),function(){Ou=Ou.filter(function(S){return S!==i}),document.removeEventListener("wheel",f,Du),document.removeEventListener("touchmove",f,Du),document.removeEventListener("touchstart",x,Du)}},[]);var v=e.removeScrollBar,C=e.inert;return h.createElement(h.Fragment,null,C?h.createElement(i,{styles:aV(s)}):null,v?h.createElement(Z$,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function iV(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const lV=L$(B4,oV);var Mh=h.forwardRef(function(e,t){return h.createElement(jx,go({},e,{ref:t,sideCar:lV}))});Mh.classNames=jx.classNames;var cV=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Iu=new WeakMap,$p=new WeakMap,Vp={},pb=0,Y4=function(e){return e&&(e.host||Y4(e.parentNode))},uV=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Y4(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})},dV=function(e,t,n,r){var s=uV(t,Array.isArray(e)?e:[e]);Vp[n]||(Vp[n]=new WeakMap);var i=Vp[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 x=function(g){!g||f.has(g)||Array.prototype.forEach.call(g.children,function(y){if(u.has(y))x(y);else try{var v=y.getAttribute(r),C=v!==null&&v!=="false",S=(Iu.get(y)||0)+1,E=(i.get(y)||0)+1;Iu.set(y,S),i.set(y,E),c.push(y),S===1&&C&&$p.set(y,!0),E===1&&y.setAttribute(n,"true"),C||y.setAttribute(r,"true")}catch(j){console.error("aria-hidden: cannot operate on ",y,j)}})};return x(t),u.clear(),pb++,function(){c.forEach(function(g){var y=Iu.get(g)-1,v=i.get(g)-1;Iu.set(g,y),i.set(g,v),y||($p.has(g)||g.removeAttribute(r),$p.delete(g)),v||g.removeAttribute(n)}),pb--,pb||(Iu=new WeakMap,Iu=new WeakMap,$p=new WeakMap,Vp={})}},Tx=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=cV(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),dV(r,s,n,"aria-hidden")):function(){return null}};function fV(e){const t=hV(e),n=h.forwardRef((r,s)=>{const{children:i,...c}=r,u=h.Children.toArray(i),f=u.find(pV);if(f){const m=f.props.children,x=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,x):null})}return a.jsx(t,{...c,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function hV(e){const t=h.forwardRef((n,r)=>{const{children:s,...i}=n;if(h.isValidElement(s)){const c=xV(s),u=gV(i,s.props);return s.type!==h.Fragment&&(u.ref=r?aa(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 mV=Symbol("radix.slottable");function pV(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===mV}function gV(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 xV(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 _x="Dialog",[X4,Q4]=Dr(_x),[yV,Js]=X4(_x),J4=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,x]=ya({prop:r,defaultProp:s??!1,onChange:i,caller:_x});return a.jsx(yV,{scope:t,triggerRef:u,contentRef:f,contentId:ar(),titleId:ar(),descriptionId:ar(),open:m,onOpenChange:x,onOpenToggle:h.useCallback(()=>x(g=>!g),[x]),modal:c,children:n})};J4.displayName=_x;var e3="DialogTrigger",t3=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Js(e3,n),i=Rt(t,s.triggerRef);return a.jsx(tt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":rC(s.open),...r,ref:i,onClick:Me(e.onClick,s.onOpenToggle)})});t3.displayName=e3;var tC="DialogPortal",[vV,n3]=X4(tC,{forceMount:void 0}),r3=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,i=Js(tC,t);return a.jsx(vV,{scope:t,forceMount:n,children:h.Children.map(r,c=>a.jsx(Xr,{present:n||i.open,children:a.jsx(Hc,{asChild:!0,container:s,children:c})}))})};r3.displayName=tC;var Dg="DialogOverlay",a3=h.forwardRef((e,t)=>{const n=n3(Dg,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,i=Js(Dg,e.__scopeDialog);return i.modal?a.jsx(Xr,{present:r||i.open,children:a.jsx(SV,{...s,ref:t})}):null});a3.displayName=Dg;var bV=fV("DialogOverlay.RemoveScroll"),SV=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Js(Dg,n);return a.jsx(Mh,{as:bV,allowPinchZoom:!0,shards:[s.contentRef],children:a.jsx(tt.div,{"data-state":rC(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Ec="DialogContent",s3=h.forwardRef((e,t)=>{const n=n3(Ec,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,i=Js(Ec,e.__scopeDialog);return a.jsx(Xr,{present:r||i.open,children:i.modal?a.jsx(CV,{...s,ref:t}):a.jsx(EV,{...s,ref:t})})});s3.displayName=Ec;var CV=h.forwardRef((e,t)=>{const n=Js(Ec,e.__scopeDialog),r=h.useRef(null),s=Rt(t,n.contentRef,r);return h.useEffect(()=>{const i=r.current;if(i)return Tx(i)},[]),a.jsx(o3,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Me(e.onCloseAutoFocus,i=>{var c;i.preventDefault(),(c=n.triggerRef.current)==null||c.focus()}),onPointerDownOutside:Me(e.onPointerDownOutside,i=>{const c=i.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0;(c.button===2||u)&&i.preventDefault()}),onFocusOutside:Me(e.onFocusOutside,i=>i.preventDefault())})}),EV=h.forwardRef((e,t)=>{const n=Js(Ec,e.__scopeDialog),r=h.useRef(!1),s=h.useRef(!1);return a.jsx(o3,{...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()}})}),o3=h.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,...c}=e,u=Js(Ec,n),f=h.useRef(null),m=Rt(t,f);return Rx(),a.jsxs(a.Fragment,{children:[a.jsx(Ih,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:a.jsx(Fc,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":rC(u.open),...c,ref:m,onDismiss:()=>u.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(RV,{titleId:u.titleId}),a.jsx(TV,{contentRef:f,descriptionId:u.descriptionId})]})]})}),nC="DialogTitle",i3=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Js(nC,n);return a.jsx(tt.h2,{id:s.titleId,...r,ref:t})});i3.displayName=nC;var l3="DialogDescription",c3=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Js(l3,n);return a.jsx(tt.p,{id:s.descriptionId,...r,ref:t})});c3.displayName=l3;var u3="DialogClose",d3=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Js(u3,n);return a.jsx(tt.button,{type:"button",...r,ref:t,onClick:Me(e.onClick,()=>s.onOpenChange(!1))})});d3.displayName=u3;function rC(e){return e?"open":"closed"}var f3="DialogTitleWarning",[wV,h3]=WH(f3,{contentName:Ec,titleName:nC,docsSlug:"dialog"}),RV=({titleId:e})=>{const t=h3(f3),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
607
|
+
|
|
608
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
609
|
+
|
|
610
|
+
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},jV="DialogDescriptionWarning",TV=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${h3(jV).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},Nx=J4,_V=t3,Ax=r3,Dx=a3,Ox=s3,aC=i3,sC=c3,Ix=d3;function Ei({...e}){return a.jsx(Nx,{"data-slot":"sheet",...e})}function NV({...e}){return a.jsx(Ax,{"data-slot":"sheet-portal",...e})}function AV({className:e,...t}){return a.jsx(Dx,{"data-slot":"sheet-overlay",className:oe("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function wi({className:e,children:t,side:n="right",...r}){return a.jsxs(NV,{children:[a.jsx(AV,{}),a.jsxs(Ox,{"data-slot":"sheet-content",className:oe("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-0 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",n==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full min-w-[100%] border-l sm:max-w-sm sm:min-w-[600px]",n==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full min-w-[100%] border-r sm:max-w-sm sm:min-w-[600px]",n==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",n==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",e),...r,children:[t,a.jsxs(Ix,{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(Cc,{className:"size-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Ri({className:e,...t}){return a.jsx("div",{"data-slot":"sheet-header",className:oe("flex flex-col gap-1 border-b p-4",e),...t})}function ji({className:e,...t}){return a.jsx(aC,{"data-slot":"sheet-title",className:oe("text-foreground font-semibold",e),...t})}function Rl({className:e,...t}){return a.jsx(sC,{"data-slot":"sheet-description",className:oe("text-muted-foreground text-sm",e),...t})}function Kr({className:e,...t}){return a.jsx("div",{"data-slot":"skeleton",className:oe("bg-accent animate-pulse rounded-md",e),...t})}const DV=["top","right","bottom","left"],vl=Math.min,Qa=Math.max,Og=Math.round,Gp=Math.floor,So=e=>({x:e,y:e}),OV={left:"right",right:"left",bottom:"top",top:"bottom"},IV={start:"end",end:"start"};function C1(e,t,n){return Qa(e,vl(t,n))}function vi(e,t){return typeof e=="function"?e(t):e}function bi(e){return e.split("-")[0]}function bd(e){return e.split("-")[1]}function oC(e){return e==="x"?"y":"x"}function iC(e){return e==="y"?"height":"width"}const MV=new Set(["top","bottom"]);function xo(e){return MV.has(bi(e))?"y":"x"}function lC(e){return oC(xo(e))}function kV(e,t,n){n===void 0&&(n=!1);const r=bd(e),s=lC(e),i=iC(s);let c=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(c=Ig(c)),[c,Ig(c)]}function LV(e){const t=Ig(e);return[E1(e),t,E1(t)]}function E1(e){return e.replace(/start|end/g,t=>IV[t])}const a_=["left","right"],s_=["right","left"],PV=["top","bottom"],UV=["bottom","top"];function zV(e,t,n){switch(e){case"top":case"bottom":return n?t?s_:a_:t?a_:s_;case"left":case"right":return t?PV:UV;default:return[]}}function FV(e,t,n,r){const s=bd(e);let i=zV(bi(e),n==="start",r);return s&&(i=i.map(c=>c+"-"+s),t&&(i=i.concat(i.map(E1)))),i}function Ig(e){return e.replace(/left|right|bottom|top/g,t=>OV[t])}function HV(e){return{top:0,right:0,bottom:0,left:0,...e}}function m3(e){return typeof e!="number"?HV(e):{top:e,right:e,bottom:e,left:e}}function Mg(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 o_(e,t,n){let{reference:r,floating:s}=e;const i=xo(t),c=lC(t),u=iC(c),f=bi(t),m=i==="y",x=r.x+r.width/2-s.width/2,g=r.y+r.height/2-s.height/2,y=r[u]/2-s[u]/2;let v;switch(f){case"top":v={x,y:r.y-s.height};break;case"bottom":v={x,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(bd(t)){case"start":v[c]-=y*(n&&m?-1:1);break;case"end":v[c]+=y*(n&&m?-1:1);break}return v}const $V=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:g}=o_(m,r,f),y=r,v={},C=0;for(let S=0;S<u.length;S++){const{name:E,fn:j}=u[S],{x:R,y:T,data:N,reset:A}=await j({x,y:g,initialPlacement:r,placement:y,strategy:s,middlewareData:v,rects:m,platform:c,elements:{reference:e,floating:t}});x=R??x,g=T??g,v={...v,[E]:{...v[E],...N}},A&&C<=50&&(C++,typeof A=="object"&&(A.placement&&(y=A.placement),A.rects&&(m=A.rects===!0?await c.getElementRects({reference:e,floating:t,strategy:s}):A.rects),{x,y:g}=o_(m,y,f)),S=-1)}return{x,y:g,placement:y,strategy:s,middlewareData:v}};async function oh(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:x="viewport",elementContext:g="floating",altBoundary:y=!1,padding:v=0}=vi(t,e),C=m3(v),E=u[y?g==="floating"?"reference":"floating":g],j=Mg(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:x,strategy:f})),R=g==="floating"?{x:r,y:s,width:c.floating.width,height:c.floating.height}:c.reference,T=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u.floating)),N=await(i.isElement==null?void 0:i.isElement(T))?await(i.getScale==null?void 0:i.getScale(T))||{x:1,y:1}:{x:1,y:1},A=Mg(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:R,offsetParent:T,strategy:f}):R);return{top:(j.top-A.top+C.top)/N.y,bottom:(A.bottom-j.bottom+C.bottom)/N.y,left:(j.left-A.left+C.left)/N.x,right:(A.right-j.right+C.right)/N.x}}const VV=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:x=0}=vi(e,t)||{};if(m==null)return{};const g=m3(x),y={x:n,y:r},v=lC(s),C=iC(v),S=await c.getDimensions(m),E=v==="y",j=E?"top":"left",R=E?"bottom":"right",T=E?"clientHeight":"clientWidth",N=i.reference[C]+i.reference[v]-y[v]-i.floating[C],A=y[v]-i.reference[v],I=await(c.getOffsetParent==null?void 0:c.getOffsetParent(m));let _=I?I[T]:0;(!_||!await(c.isElement==null?void 0:c.isElement(I)))&&(_=u.floating[T]||i.floating[C]);const M=N/2-A/2,G=_/2-S[C]/2-1,H=vl(g[j],G),L=vl(g[R],G),q=H,W=_-S[C]-L,B=_/2-S[C]/2+M,V=C1(q,B,W),D=!f.arrow&&bd(s)!=null&&B!==V&&i.reference[C]/2-(B<q?H:L)-S[C]/2<0,F=D?B<q?B-q:B-W:0;return{[v]:y[v]+F,data:{[v]:V,centerOffset:B-V-F,...D&&{alignmentOffset:F}},reset:D}}}),GV=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:x=!0,crossAxis:g=!0,fallbackPlacements:y,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:C="none",flipAlignment:S=!0,...E}=vi(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const j=bi(s),R=xo(u),T=bi(u)===u,N=await(f.isRTL==null?void 0:f.isRTL(m.floating)),A=y||(T||!S?[Ig(u)]:LV(u)),I=C!=="none";!y&&I&&A.push(...FV(u,S,C,N));const _=[u,...A],M=await oh(t,E),G=[];let H=((r=i.flip)==null?void 0:r.overflows)||[];if(x&&G.push(M[j]),g){const B=kV(s,c,N);G.push(M[B[0]],M[B[1]])}if(H=[...H,{placement:s,overflows:G}],!G.every(B=>B<=0)){var L,q;const B=(((L=i.flip)==null?void 0:L.index)||0)+1,V=_[B];if(V&&(!(g==="alignment"?R!==xo(V):!1)||H.every(U=>xo(U.placement)===R?U.overflows[0]>0:!0)))return{data:{index:B,overflows:H},reset:{placement:V}};let D=(q=H.filter(F=>F.overflows[0]<=0).sort((F,U)=>F.overflows[1]-U.overflows[1])[0])==null?void 0:q.placement;if(!D)switch(v){case"bestFit":{var W;const F=(W=H.filter(U=>{if(I){const ee=xo(U.placement);return ee===R||ee==="y"}return!0}).map(U=>[U.placement,U.overflows.filter(ee=>ee>0).reduce((ee,he)=>ee+he,0)]).sort((U,ee)=>U[1]-ee[1])[0])==null?void 0:W[0];F&&(D=F);break}case"initialPlacement":D=u;break}if(s!==D)return{reset:{placement:D}}}return{}}}};function i_(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function l_(e){return DV.some(t=>e[t]>=0)}const BV=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...s}=vi(e,t);switch(r){case"referenceHidden":{const i=await oh(t,{...s,elementContext:"reference"}),c=i_(i,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:l_(c)}}}case"escaped":{const i=await oh(t,{...s,altBoundary:!0}),c=i_(i,n.floating);return{data:{escapedOffsets:c,escaped:l_(c)}}}default:return{}}}}},p3=new Set(["left","top"]);async function qV(e,t){const{placement:n,platform:r,elements:s}=e,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),c=bi(n),u=bd(n),f=xo(n)==="y",m=p3.has(c)?-1:1,x=i&&f?-1:1,g=vi(t,e);let{mainAxis:y,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*x,y:y*m}:{x:y*m,y:v*x}}const KV=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 qV(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}}}}},WV=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:j,y:R}=E;return{x:j,y:R}}},...f}=vi(e,t),m={x:n,y:r},x=await oh(t,f),g=xo(bi(s)),y=oC(g);let v=m[y],C=m[g];if(i){const E=y==="y"?"top":"left",j=y==="y"?"bottom":"right",R=v+x[E],T=v-x[j];v=C1(R,v,T)}if(c){const E=g==="y"?"top":"left",j=g==="y"?"bottom":"right",R=C+x[E],T=C-x[j];C=C1(R,C,T)}const S=u.fn({...t,[y]:v,[g]:C});return{...S,data:{x:S.x-n,y:S.y-r,enabled:{[y]:i,[g]:c}}}}}},ZV=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}=vi(e,t),x={x:n,y:r},g=xo(s),y=oC(g);let v=x[y],C=x[g];const S=vi(u,t),E=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(f){const T=y==="y"?"height":"width",N=i.reference[y]-i.floating[T]+E.mainAxis,A=i.reference[y]+i.reference[T]-E.mainAxis;v<N?v=N:v>A&&(v=A)}if(m){var j,R;const T=y==="y"?"width":"height",N=p3.has(bi(s)),A=i.reference[g]-i.floating[T]+(N&&((j=c.offset)==null?void 0:j[g])||0)+(N?0:E.crossAxis),I=i.reference[g]+i.reference[T]+(N?0:((R=c.offset)==null?void 0:R[g])||0)-(N?E.crossAxis:0);C<A?C=A:C>I&&(C=I)}return{[y]:v,[g]:C}}}},YV=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}=vi(e,t),x=await oh(t,m),g=bi(s),y=bd(s),v=xo(s)==="y",{width:C,height:S}=i.floating;let E,j;g==="top"||g==="bottom"?(E=g,j=y===(await(c.isRTL==null?void 0:c.isRTL(u.floating))?"start":"end")?"left":"right"):(j=g,E=y==="end"?"top":"bottom");const R=S-x.top-x.bottom,T=C-x.left-x.right,N=vl(S-x[E],R),A=vl(C-x[j],T),I=!t.middlewareData.shift;let _=N,M=A;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(M=T),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(_=R),I&&!y){const H=Qa(x.left,0),L=Qa(x.right,0),q=Qa(x.top,0),W=Qa(x.bottom,0);v?M=C-2*(H!==0||L!==0?H+L:Qa(x.left,x.right)):_=S-2*(q!==0||W!==0?q+W:Qa(x.top,x.bottom))}await f({...t,availableWidth:M,availableHeight:_});const G=await c.getDimensions(u.floating);return C!==G.width||S!==G.height?{reset:{rects:!0}}:{}}}};function Mx(){return typeof window<"u"}function Sd(e){return g3(e)?(e.nodeName||"").toLowerCase():"#document"}function es(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Oo(e){var t;return(t=(g3(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function g3(e){return Mx()?e instanceof Node||e instanceof es(e).Node:!1}function Zs(e){return Mx()?e instanceof Element||e instanceof es(e).Element:!1}function _o(e){return Mx()?e instanceof HTMLElement||e instanceof es(e).HTMLElement:!1}function c_(e){return!Mx()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof es(e).ShadowRoot}const XV=new Set(["inline","contents"]);function kh(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=Ys(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!XV.has(s)}const QV=new Set(["table","td","th"]);function JV(e){return QV.has(Sd(e))}const eG=[":popover-open",":modal"];function kx(e){return eG.some(t=>{try{return e.matches(t)}catch{return!1}})}const tG=["transform","translate","scale","rotate","perspective"],nG=["transform","translate","scale","rotate","perspective","filter"],rG=["paint","layout","strict","content"];function cC(e){const t=uC(),n=Zs(e)?Ys(e):e;return tG.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)||nG.some(r=>(n.willChange||"").includes(r))||rG.some(r=>(n.contain||"").includes(r))}function aG(e){let t=bl(e);for(;_o(t)&&!id(t);){if(cC(t))return t;if(kx(t))return null;t=bl(t)}return null}function uC(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const sG=new Set(["html","body","#document"]);function id(e){return sG.has(Sd(e))}function Ys(e){return es(e).getComputedStyle(e)}function Lx(e){return Zs(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function bl(e){if(Sd(e)==="html")return e;const t=e.assignedSlot||e.parentNode||c_(e)&&e.host||Oo(e);return c_(t)?t.host:t}function x3(e){const t=bl(e);return id(t)?e.ownerDocument?e.ownerDocument.body:e.body:_o(t)&&kh(t)?t:x3(t)}function ih(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=x3(e),i=s===((r=e.ownerDocument)==null?void 0:r.body),c=es(s);if(i){const u=w1(c);return t.concat(c,c.visualViewport||[],kh(s)?s:[],u&&n?ih(u):[])}return t.concat(s,ih(s,[],n))}function w1(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function y3(e){const t=Ys(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=_o(e),i=s?e.offsetWidth:n,c=s?e.offsetHeight:r,u=Og(n)!==i||Og(r)!==c;return u&&(n=i,r=c),{width:n,height:r,$:u}}function dC(e){return Zs(e)?e:e.contextElement}function Xu(e){const t=dC(e);if(!_o(t))return So(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:i}=y3(t);let c=(i?Og(n.width):n.width)/r,u=(i?Og(n.height):n.height)/s;return(!c||!Number.isFinite(c))&&(c=1),(!u||!Number.isFinite(u))&&(u=1),{x:c,y:u}}const oG=So(0);function v3(e){const t=es(e);return!uC()||!t.visualViewport?oG:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function iG(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==es(e)?!1:t}function wc(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),i=dC(e);let c=So(1);t&&(r?Zs(r)&&(c=Xu(r)):c=Xu(e));const u=iG(i,n,r)?v3(i):So(0);let f=(s.left+u.x)/c.x,m=(s.top+u.y)/c.y,x=s.width/c.x,g=s.height/c.y;if(i){const y=es(i),v=r&&Zs(r)?es(r):r;let C=y,S=w1(C);for(;S&&r&&v!==C;){const E=Xu(S),j=S.getBoundingClientRect(),R=Ys(S),T=j.left+(S.clientLeft+parseFloat(R.paddingLeft))*E.x,N=j.top+(S.clientTop+parseFloat(R.paddingTop))*E.y;f*=E.x,m*=E.y,x*=E.x,g*=E.y,f+=T,m+=N,C=es(S),S=w1(C)}}return Mg({width:x,height:g,x:f,y:m})}function Px(e,t){const n=Lx(e).scrollLeft;return t?t.left+n:wc(Oo(e)).left+n}function b3(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Px(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function lG(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const i=s==="fixed",c=Oo(r),u=t?kx(t.floating):!1;if(r===c||u&&i)return n;let f={scrollLeft:0,scrollTop:0},m=So(1);const x=So(0),g=_o(r);if((g||!g&&!i)&&((Sd(r)!=="body"||kh(c))&&(f=Lx(r)),_o(r))){const v=wc(r);m=Xu(r),x.x=v.x+r.clientLeft,x.y=v.y+r.clientTop}const y=c&&!g&&!i?b3(c,f):So(0);return{width:n.width*m.x,height:n.height*m.y,x:n.x*m.x-f.scrollLeft*m.x+x.x+y.x,y:n.y*m.y-f.scrollTop*m.y+x.y+y.y}}function cG(e){return Array.from(e.getClientRects())}function uG(e){const t=Oo(e),n=Lx(e),r=e.ownerDocument.body,s=Qa(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Qa(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let c=-n.scrollLeft+Px(e);const u=-n.scrollTop;return Ys(r).direction==="rtl"&&(c+=Qa(t.clientWidth,r.clientWidth)-s),{width:s,height:i,x:c,y:u}}const u_=25;function dG(e,t){const n=es(e),r=Oo(e),s=n.visualViewport;let i=r.clientWidth,c=r.clientHeight,u=0,f=0;if(s){i=s.width,c=s.height;const x=uC();(!x||x&&t==="fixed")&&(u=s.offsetLeft,f=s.offsetTop)}const m=Px(r);if(m<=0){const x=r.ownerDocument,g=x.body,y=getComputedStyle(g),v=x.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,C=Math.abs(r.clientWidth-g.clientWidth-v);C<=u_&&(i-=C)}else m<=u_&&(i+=m);return{width:i,height:c,x:u,y:f}}const fG=new Set(["absolute","fixed"]);function hG(e,t){const n=wc(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,i=_o(e)?Xu(e):So(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 d_(e,t,n){let r;if(t==="viewport")r=dG(e,n);else if(t==="document")r=uG(Oo(e));else if(Zs(t))r=hG(t,n);else{const s=v3(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Mg(r)}function S3(e,t){const n=bl(e);return n===t||!Zs(n)||id(n)?!1:Ys(n).position==="fixed"||S3(n,t)}function mG(e,t){const n=t.get(e);if(n)return n;let r=ih(e,[],!1).filter(u=>Zs(u)&&Sd(u)!=="body"),s=null;const i=Ys(e).position==="fixed";let c=i?bl(e):e;for(;Zs(c)&&!id(c);){const u=Ys(c),f=cC(c);!f&&u.position==="fixed"&&(s=null),(i?!f&&!s:!f&&u.position==="static"&&!!s&&fG.has(s.position)||kh(c)&&!f&&S3(e,c))?r=r.filter(x=>x!==c):s=u,c=bl(c)}return t.set(e,r),r}function pG(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const c=[...n==="clippingAncestors"?kx(t)?[]:mG(t,this._c):[].concat(n),r],u=c[0],f=c.reduce((m,x)=>{const g=d_(t,x,s);return m.top=Qa(g.top,m.top),m.right=vl(g.right,m.right),m.bottom=vl(g.bottom,m.bottom),m.left=Qa(g.left,m.left),m},d_(t,u,s));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function gG(e){const{width:t,height:n}=y3(e);return{width:t,height:n}}function xG(e,t,n){const r=_o(t),s=Oo(t),i=n==="fixed",c=wc(e,!0,i,t);let u={scrollLeft:0,scrollTop:0};const f=So(0);function m(){f.x=Px(s)}if(r||!r&&!i)if((Sd(t)!=="body"||kh(s))&&(u=Lx(t)),r){const v=wc(t,!0,i,t);f.x=v.x+t.clientLeft,f.y=v.y+t.clientTop}else s&&m();i&&!r&&s&&m();const x=s&&!r&&!i?b3(s,u):So(0),g=c.left+u.scrollLeft-f.x-x.x,y=c.top+u.scrollTop-f.y-x.y;return{x:g,y,width:c.width,height:c.height}}function gb(e){return Ys(e).position==="static"}function f_(e,t){if(!_o(e)||Ys(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Oo(e)===n&&(n=n.ownerDocument.body),n}function C3(e,t){const n=es(e);if(kx(e))return n;if(!_o(e)){let s=bl(e);for(;s&&!id(s);){if(Zs(s)&&!gb(s))return s;s=bl(s)}return n}let r=f_(e,t);for(;r&&JV(r)&&gb(r);)r=f_(r,t);return r&&id(r)&&gb(r)&&!cC(r)?n:r||aG(e)||n}const yG=async function(e){const t=this.getOffsetParent||C3,n=this.getDimensions,r=await n(e.floating);return{reference:xG(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function vG(e){return Ys(e).direction==="rtl"}const bG={convertOffsetParentRelativeRectToViewportRelativeRect:lG,getDocumentElement:Oo,getClippingRect:pG,getOffsetParent:C3,getElementRects:yG,getClientRects:cG,getDimensions:gG,getScale:Xu,isElement:Zs,isRTL:vG};function E3(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function SG(e,t){let n=null,r;const s=Oo(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:x,top:g,width:y,height:v}=m;if(u||t(),!y||!v)return;const C=Gp(g),S=Gp(s.clientWidth-(x+y)),E=Gp(s.clientHeight-(g+v)),j=Gp(x),T={rootMargin:-C+"px "+-S+"px "+-E+"px "+-j+"px",threshold:Qa(0,vl(1,f))||1};let N=!0;function A(I){const _=I[0].intersectionRatio;if(_!==f){if(!N)return c();_?c(!1,_):r=setTimeout(()=>{c(!1,1e-7)},1e3)}_===1&&!E3(m,e.getBoundingClientRect())&&c(),N=!1}try{n=new IntersectionObserver(A,{...T,root:s.ownerDocument})}catch{n=new IntersectionObserver(A,T)}n.observe(e)}return c(!0),i}function CG(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=dC(e),x=s||i?[...m?ih(m):[],...ih(t)]:[];x.forEach(j=>{s&&j.addEventListener("scroll",n,{passive:!0}),i&&j.addEventListener("resize",n)});const g=m&&u?SG(m,n):null;let y=-1,v=null;c&&(v=new ResizeObserver(j=>{let[R]=j;R&&R.target===m&&v&&(v.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var T;(T=v)==null||T.observe(t)})),n()}),m&&!f&&v.observe(m),v.observe(t));let C,S=f?wc(e):null;f&&E();function E(){const j=wc(e);S&&!E3(S,j)&&n(),S=j,C=requestAnimationFrame(E)}return n(),()=>{var j;x.forEach(R=>{s&&R.removeEventListener("scroll",n),i&&R.removeEventListener("resize",n)}),g==null||g(),(j=v)==null||j.disconnect(),v=null,f&&cancelAnimationFrame(C)}}const EG=KV,wG=WV,RG=GV,jG=YV,TG=BV,h_=VV,_G=ZV,NG=(e,t,n)=>{const r=new Map,s={platform:bG,...n},i={...s.platform,_c:r};return $V(e,t,{...s,platform:i})};var AG=typeof document<"u",DG=function(){},pg=AG?h.useLayoutEffect:DG;function kg(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(!kg(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)&&!kg(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function w3(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function m_(e,t){const n=w3(e);return Math.round(t*n)/n}function xb(e){const t=h.useRef(e);return pg(()=>{t.current=e}),t}function OG(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,[x,g]=h.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[y,v]=h.useState(r);kg(y,r)||v(r);const[C,S]=h.useState(null),[E,j]=h.useState(null),R=h.useCallback(U=>{U!==I.current&&(I.current=U,S(U))},[]),T=h.useCallback(U=>{U!==_.current&&(_.current=U,j(U))},[]),N=i||C,A=c||E,I=h.useRef(null),_=h.useRef(null),M=h.useRef(x),G=f!=null,H=xb(f),L=xb(s),q=xb(m),W=h.useCallback(()=>{if(!I.current||!_.current)return;const U={placement:t,strategy:n,middleware:y};L.current&&(U.platform=L.current),NG(I.current,_.current,U).then(ee=>{const he={...ee,isPositioned:q.current!==!1};B.current&&!kg(M.current,he)&&(M.current=he,Gs.flushSync(()=>{g(he)}))})},[y,t,n,L,q]);pg(()=>{m===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,g(U=>({...U,isPositioned:!1})))},[m]);const B=h.useRef(!1);pg(()=>(B.current=!0,()=>{B.current=!1}),[]),pg(()=>{if(N&&(I.current=N),A&&(_.current=A),N&&A){if(H.current)return H.current(N,A,W);W()}},[N,A,W,H,G]);const V=h.useMemo(()=>({reference:I,floating:_,setReference:R,setFloating:T}),[R,T]),D=h.useMemo(()=>({reference:N,floating:A}),[N,A]),F=h.useMemo(()=>{const U={position:n,left:0,top:0};if(!D.floating)return U;const ee=m_(D.floating,x.x),he=m_(D.floating,x.y);return u?{...U,transform:"translate("+ee+"px, "+he+"px)",...w3(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ee,top:he}},[n,u,D.floating,x.x,x.y]);return h.useMemo(()=>({...x,update:W,refs:V,elements:D,floatingStyles:F}),[x,W,V,D,F])}const IG=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?h_({element:r.current,padding:s}).fn(n):{}:r?h_({element:r,padding:s}).fn(n):{}}}},MG=(e,t)=>({...EG(e),options:[e,t]}),kG=(e,t)=>({...wG(e),options:[e,t]}),LG=(e,t)=>({..._G(e),options:[e,t]}),PG=(e,t)=>({...RG(e),options:[e,t]}),UG=(e,t)=>({...jG(e),options:[e,t]}),zG=(e,t)=>({...TG(e),options:[e,t]}),FG=(e,t)=>({...IG(e),options:[e,t]});var HG="Arrow",R3=h.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...i}=e;return a.jsx(tt.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"})})});R3.displayName=HG;var $G=R3;function fC(e){const[t,n]=h.useState(void 0);return Zr(()=>{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 hC="Popper",[j3,Io]=Dr(hC),[VG,T3]=j3(hC),_3=e=>{const{__scopePopper:t,children:n}=e,[r,s]=h.useState(null);return a.jsx(VG,{scope:t,anchor:r,onAnchorChange:s,children:n})};_3.displayName=hC;var N3="PopperAnchor",A3=h.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,i=T3(N3,n),c=h.useRef(null),u=Rt(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(tt.div,{...s,ref:u})});A3.displayName=N3;var mC="PopperContent",[GG,BG]=j3(mC),D3=h.forwardRef((e,t)=>{var Q,le,pe,be,ze,Re;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:i="center",alignOffset:c=0,arrowPadding:u=0,avoidCollisions:f=!0,collisionBoundary:m=[],collisionPadding:x=0,sticky:g="partial",hideWhenDetached:y=!1,updatePositionStrategy:v="optimized",onPlaced:C,...S}=e,E=T3(mC,n),[j,R]=h.useState(null),T=Rt(t,Ge=>R(Ge)),[N,A]=h.useState(null),I=fC(N),_=(I==null?void 0:I.width)??0,M=(I==null?void 0:I.height)??0,G=r+(i!=="center"?"-"+i:""),H=typeof x=="number"?x:{top:0,right:0,bottom:0,left:0,...x},L=Array.isArray(m)?m:[m],q=L.length>0,W={padding:H,boundary:L.filter(KG),altBoundary:q},{refs:B,floatingStyles:V,placement:D,isPositioned:F,middlewareData:U}=OG({strategy:"fixed",placement:G,whileElementsMounted:(...Ge)=>CG(...Ge,{animationFrame:v==="always"}),elements:{reference:E.anchor},middleware:[MG({mainAxis:s+M,alignmentAxis:c}),f&&kG({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?LG():void 0,...W}),f&&PG({...W}),UG({...W,apply:({elements:Ge,rects:ot,availableWidth:Vt,availableHeight:He})=>{const{width:Xt,height:gn}=ot.reference,ke=Ge.floating.style;ke.setProperty("--radix-popper-available-width",`${Vt}px`),ke.setProperty("--radix-popper-available-height",`${He}px`),ke.setProperty("--radix-popper-anchor-width",`${Xt}px`),ke.setProperty("--radix-popper-anchor-height",`${gn}px`)}}),N&&FG({element:N,padding:u}),WG({arrowWidth:_,arrowHeight:M}),y&&zG({strategy:"referenceHidden",...W})]}),[ee,he]=M3(D),z=Ws(C);Zr(()=>{F&&(z==null||z())},[F,z]);const $=(Q=U.arrow)==null?void 0:Q.x,P=(le=U.arrow)==null?void 0:le.y,K=((pe=U.arrow)==null?void 0:pe.centerOffset)!==0,[Y,se]=h.useState();return Zr(()=>{j&&se(window.getComputedStyle(j).zIndex)},[j]),a.jsx("div",{ref:B.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:F?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Y,"--radix-popper-transform-origin":[(be=U.transformOrigin)==null?void 0:be.x,(ze=U.transformOrigin)==null?void 0:ze.y].join(" "),...((Re=U.hide)==null?void 0:Re.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx(GG,{scope:n,placedSide:ee,onArrowChange:A,arrowX:$,arrowY:P,shouldHideArrow:K,children:a.jsx(tt.div,{"data-side":ee,"data-align":he,...S,ref:T,style:{...S.style,animation:F?void 0:"none"}})})})});D3.displayName=mC;var O3="PopperArrow",qG={top:"bottom",right:"left",bottom:"top",left:"right"},I3=h.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,i=BG(O3,r),c=qG[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($G,{...s,ref:n,style:{...s.style,display:"block"}})})});I3.displayName=O3;function KG(e){return e!==null}var WG=e=>({name:"transformOrigin",options:e,fn(t){var E,j,R;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,x]=M3(n),g={start:"0%",center:"50%",end:"100%"}[x],y=(((j=s.arrow)==null?void 0:j.x)??0)+u/2,v=(((R=s.arrow)==null?void 0:R.y)??0)+f/2;let C="",S="";return m==="bottom"?(C=c?g:`${y}px`,S=`${-f}px`):m==="top"?(C=c?g:`${y}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 M3(e){const[t,n="center"]=e.split("-");return[t,n]}var Cd=_3,Ed=A3,Lh=D3,Ph=I3,ZG=Symbol("radix.slottable");function YG(e){const t=({children:n})=>a.jsx(a.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=ZG,t}var k3=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"}),XG="VisuallyHidden",L3=h.forwardRef((e,t)=>a.jsx(tt.span,{...e,ref:t,style:{...k3,...e.style}}));L3.displayName=XG;var QG=L3,[Ux]=Dr("Tooltip",[Io]),zx=Io(),P3="TooltipProvider",JG=700,R1="tooltip.open",[eB,pC]=Ux(P3),U3=e=>{const{__scopeTooltip:t,delayDuration:n=JG,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(eB,{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})};U3.displayName=P3;var lh="Tooltip",[tB,Uh]=Ux(lh),z3=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:s,onOpenChange:i,disableHoverableContent:c,delayDuration:u}=e,f=pC(lh,e.__scopeTooltip),m=zx(t),[x,g]=h.useState(null),y=ar(),v=h.useRef(0),C=c??f.disableHoverableContent,S=u??f.delayDuration,E=h.useRef(!1),[j,R]=ya({prop:r,defaultProp:s??!1,onChange:_=>{_?(f.onOpen(),document.dispatchEvent(new CustomEvent(R1))):f.onClose(),i==null||i(_)},caller:lh}),T=h.useMemo(()=>j?E.current?"delayed-open":"instant-open":"closed",[j]),N=h.useCallback(()=>{window.clearTimeout(v.current),v.current=0,E.current=!1,R(!0)},[R]),A=h.useCallback(()=>{window.clearTimeout(v.current),v.current=0,R(!1)},[R]),I=h.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>{E.current=!0,R(!0),v.current=0},S)},[S,R]);return h.useEffect(()=>()=>{v.current&&(window.clearTimeout(v.current),v.current=0)},[]),a.jsx(Cd,{...m,children:a.jsx(tB,{scope:t,contentId:y,open:j,stateAttribute:T,trigger:x,onTriggerChange:g,onTriggerEnter:h.useCallback(()=>{f.isOpenDelayedRef.current?I():N()},[f.isOpenDelayedRef,I,N]),onTriggerLeave:h.useCallback(()=>{C?A():(window.clearTimeout(v.current),v.current=0)},[A,C]),onOpen:N,onClose:A,disableHoverableContent:C,children:n})})};z3.displayName=lh;var j1="TooltipTrigger",F3=h.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=Uh(j1,n),i=pC(j1,n),c=zx(n),u=h.useRef(null),f=Rt(t,u,s.onTriggerChange),m=h.useRef(!1),x=h.useRef(!1),g=h.useCallback(()=>m.current=!1,[]);return h.useEffect(()=>()=>document.removeEventListener("pointerup",g),[g]),a.jsx(Ed,{asChild:!0,...c,children:a.jsx(tt.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:f,onPointerMove:Me(e.onPointerMove,y=>{y.pointerType!=="touch"&&!x.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),x.current=!0)}),onPointerLeave:Me(e.onPointerLeave,()=>{s.onTriggerLeave(),x.current=!1}),onPointerDown:Me(e.onPointerDown,()=>{s.open&&s.onClose(),m.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:Me(e.onFocus,()=>{m.current||s.onOpen()}),onBlur:Me(e.onBlur,s.onClose),onClick:Me(e.onClick,s.onClose)})})});F3.displayName=j1;var gC="TooltipPortal",[nB,rB]=Ux(gC,{forceMount:void 0}),H3=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:s}=e,i=Uh(gC,t);return a.jsx(nB,{scope:t,forceMount:n,children:a.jsx(Xr,{present:n||i.open,children:a.jsx(Hc,{asChild:!0,container:s,children:r})})})};H3.displayName=gC;var ld="TooltipContent",$3=h.forwardRef((e,t)=>{const n=rB(ld,e.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...i}=e,c=Uh(ld,e.__scopeTooltip);return a.jsx(Xr,{present:r||c.open,children:c.disableHoverableContent?a.jsx(V3,{side:s,...i,ref:t}):a.jsx(aB,{side:s,...i,ref:t})})}),aB=h.forwardRef((e,t)=>{const n=Uh(ld,e.__scopeTooltip),r=pC(ld,e.__scopeTooltip),s=h.useRef(null),i=Rt(t,s),[c,u]=h.useState(null),{trigger:f,onClose:m}=n,x=s.current,{onPointerInTransitChange:g}=r,y=h.useCallback(()=>{u(null),g(!1)},[g]),v=h.useCallback((C,S)=>{const E=C.currentTarget,j={x:C.clientX,y:C.clientY},R=lB(j,E.getBoundingClientRect()),T=cB(j,R),N=uB(S.getBoundingClientRect()),A=fB([...T,...N]);u(A),g(!0)},[g]);return h.useEffect(()=>()=>y(),[y]),h.useEffect(()=>{if(f&&x){const C=E=>v(E,x),S=E=>v(E,f);return f.addEventListener("pointerleave",C),x.addEventListener("pointerleave",S),()=>{f.removeEventListener("pointerleave",C),x.removeEventListener("pointerleave",S)}}},[f,x,v,y]),h.useEffect(()=>{if(c){const C=S=>{const E=S.target,j={x:S.clientX,y:S.clientY},R=(f==null?void 0:f.contains(E))||(x==null?void 0:x.contains(E)),T=!dB(j,c);R?y():T&&(y(),m())};return document.addEventListener("pointermove",C),()=>document.removeEventListener("pointermove",C)}},[f,x,c,m,y]),a.jsx(V3,{...e,ref:i})}),[sB,oB]=Ux(lh,{isInside:!1}),iB=YG("TooltipContent"),V3=h.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:c,...u}=e,f=Uh(ld,n),m=zx(n),{onClose:x}=f;return h.useEffect(()=>(document.addEventListener(R1,x),()=>document.removeEventListener(R1,x)),[x]),h.useEffect(()=>{if(f.trigger){const g=y=>{const v=y.target;v!=null&&v.contains(f.trigger)&&x()};return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[f.trigger,x]),a.jsx(Fc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:c,onFocusOutside:g=>g.preventDefault(),onDismiss:x,children:a.jsxs(Lh,{"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(iB,{children:r}),a.jsx(sB,{scope:n,isInside:!0,children:a.jsx(QG,{id:f.contentId,role:"tooltip",children:s||r})})]})})});$3.displayName=ld;var G3="TooltipArrow",B3=h.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=zx(n);return oB(G3,n).isInside?null:a.jsx(Ph,{...s,...r,ref:t})});B3.displayName=G3;function lB(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 cB(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 uB(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 dB(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,x=u.y,g=f.x,y=f.y;x>r!=y>r&&n<(g-m)*(r-x)/(y-x)+m&&(s=!s)}return s}function fB(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),hB(t)}function hB(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 mB=U3,pB=z3,gB=F3,xB=H3,yB=$3,vB=B3;function ga({delayDuration:e=0,...t}){return a.jsx(mB,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function rt({...e}){return a.jsx(ga,{children:a.jsx(pB,{"data-slot":"tooltip",...e})})}function at({...e}){return a.jsx(gB,{"data-slot":"tooltip-trigger",...e})}function st({className:e,sideOffset:t=0,children:n,...r}){return a.jsx(xB,{children:a.jsxs(yB,{"data-slot":"tooltip-content",sideOffset:t,className:oe("animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-[--radix-tooltip-content-transform-origin] rounded-md bg-black px-3 py-1.5 text-xs text-balance text-white dark:bg-white dark:text-black",e),...r,children:[n,a.jsx(vB,{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 bB="sidebar_state",SB=3600*24*7,CB="16rem",EB="18rem",wB="3rem",RB="b",q3=h.createContext(null);function zh(){const e=h.useContext(q3);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function jB({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:s,children:i,...c}){const u=JF(),[f,m]=h.useState(!1),[x,g]=h.useState(e),y=t??x,v=h.useCallback(j=>{const R=typeof j=="function"?j(y):j;n?n(R):g(R),document.cookie=`${bB}=${R}; path=/; max-age=${SB}`},[n,y]),C=h.useCallback(()=>u?m(j=>!j):v(j=>!j),[u,v,m]);h.useEffect(()=>{const j=R=>{R.key===RB&&(R.metaKey||R.ctrlKey)&&(R.preventDefault(),C())};return window.addEventListener("keydown",j),()=>window.removeEventListener("keydown",j)},[C]);const S=y?"expanded":"collapsed",E=h.useMemo(()=>({state:S,open:y,setOpen:v,isMobile:u,openMobile:f,setOpenMobile:m,toggleSidebar:C}),[S,y,v,u,f,m,C]);return a.jsx(q3.Provider,{value:E,children:a.jsx(ga,{delayDuration:0,children:a.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":CB,"--sidebar-width-icon":wB,...s},className:oe("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",r),...c,children:i})})})}function TB({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:s,...i}){const{isMobile:c,state:u,openMobile:f,setOpenMobile:m}=zh();return n==="none"?a.jsx("div",{"data-slot":"sidebar",className:oe("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",r),...i,children:s}):c?a.jsx(Ei,{open:f,onOpenChange:m,...i,children:a.jsxs(wi,{"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":EB},side:e,children:[a.jsxs(Ri,{className:"sr-only",children:[a.jsx(ji,{children:"Sidebar"}),a.jsx(Rl,{children:"Displays the mobile sidebar."})]}),a.jsx("div",{className:"flex h-full w-full flex-col",children:s})]})}):a.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":u,"data-collapsible":u==="collapsed"?n:"","data-variant":t,"data-side":e,"data-slot":"sidebar",children:[a.jsx("div",{"data-slot":"sidebar-gap",className:oe("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),a.jsx("div",{"data-slot":"sidebar-container",className:oe("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",r),...i,children:a.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:s})})]})}function _B({className:e,onClick:t,...n}){const{toggleSidebar:r}=zh();return a.jsx("div",{className:"absolute top-4 left-0 z-10 md:hidden",children:a.jsxs(we,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:oe("size-7",e),onClick:s=>{t==null||t(s),r()},...n,children:[a.jsx(Jz,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})})}function NB({className:e,...t}){const{toggleSidebar:n}=zh();return a.jsx("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:n,title:"Toggle Sidebar",className:oe("hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})}function AB({className:e,...t}){return a.jsx("main",{"data-slot":"sidebar-inset",className:oe("bg-background relative flex w-full flex-1 flex-col","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",e),...t})}function DB({className:e,...t}){return a.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:oe("flex flex-col gap-2 p-2",e),...t})}function OB({className:e,...t}){return a.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:oe("flex flex-col gap-2 p-2",e),...t})}function IB({className:e,...t}){return a.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:oe("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function p_({className:e,...t}){return a.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:oe("relative flex w-full min-w-0 flex-col p-2",e),...t})}function g_({className:e,...t}){return a.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:oe("w-full text-sm",e),...t})}function MB({className:e,...t}){return a.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:oe("flex w-full min-w-0 flex-col gap-1",e),...t})}function kB({className:e,...t}){return a.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:oe("group/menu-item relative",e),...t})}const LB=Pc("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 PB({asChild:e=!1,isActive:t=!1,variant:n="default",size:r="default",tooltip:s,className:i,...c}){const u=e?_h:"button",{isMobile:f,state:m}=zh(),x=a.jsx(u,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":r,"data-active":t,className:oe(LB({variant:n,size:r}),i),...c});return s?(typeof s=="string"&&(s={children:s}),a.jsxs(rt,{children:[a.jsx(at,{asChild:!0,children:x}),a.jsx(st,{side:"right",align:"center",hidden:m!=="collapsed"||f,...s})]})):x}function T1(e){const t=UB(e),n=h.forwardRef((r,s)=>{const{children:i,...c}=r,u=h.Children.toArray(i),f=u.find(FB);if(f){const m=f.props.children,x=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,x):null})}return a.jsx(t,{...c,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function UB(e){const t=h.forwardRef((n,r)=>{const{children:s,...i}=n;if(h.isValidElement(s)){const c=$B(s),u=HB(i,s.props);return s.type!==h.Fragment&&(u.ref=r?aa(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 zB=Symbol("radix.slottable");function FB(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===zB}function HB(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 $B(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]=Dr(t),[s,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=S=>{const{scope:E,children:j}=S,R=re.useRef(null),T=re.useRef(new Map).current;return a.jsx(s,{scope:E,itemMap:T,collectionRef:R,children:j})};c.displayName=t;const u=e+"CollectionSlot",f=T1(u),m=re.forwardRef((S,E)=>{const{scope:j,children:R}=S,T=i(u,j),N=Rt(E,T.collectionRef);return a.jsx(f,{ref:N,children:R})});m.displayName=u;const x=e+"CollectionItemSlot",g="data-radix-collection-item",y=T1(x),v=re.forwardRef((S,E)=>{const{scope:j,children:R,...T}=S,N=re.useRef(null),A=Rt(E,N),I=i(x,j);return re.useEffect(()=>(I.itemMap.set(N,{ref:N,...T}),()=>void I.itemMap.delete(N))),a.jsx(y,{[g]:"",ref:A,children:R})});v.displayName=x;function C(S){const E=i(e+"CollectionConsumer",S);return re.useCallback(()=>{const R=E.collectionRef.current;if(!R)return[];const T=Array.from(R.querySelectorAll(`[${g}]`));return Array.from(E.itemMap.values()).sort((I,_)=>T.indexOf(I.ref.current)-T.indexOf(_.ref.current))},[E.collectionRef,E.itemMap])}return[{Provider:c,Slot:m,ItemSlot:v},C,r]}var GB=h.createContext(void 0);function Fh(e){const t=h.useContext(GB);return e||t||"ltr"}function x_(e){const t=BB(e),n=h.forwardRef((r,s)=>{const{children:i,...c}=r,u=h.Children.toArray(i),f=u.find(KB);if(f){const m=f.props.children,x=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,x):null})}return a.jsx(t,{...c,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function BB(e){const t=h.forwardRef((n,r)=>{const{children:s,...i}=n;if(h.isValidElement(s)){const c=ZB(s),u=WB(i,s.props);return s.type!==h.Fragment&&(u.ref=r?aa(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 qB=Symbol("radix.slottable");function KB(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===qB}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 ZB(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 YB(e){const t=e+"CollectionProvider",[n,r]=Dr(t),[s,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=S=>{const{scope:E,children:j}=S,R=re.useRef(null),T=re.useRef(new Map).current;return a.jsx(s,{scope:E,itemMap:T,collectionRef:R,children:j})};c.displayName=t;const u=e+"CollectionSlot",f=x_(u),m=re.forwardRef((S,E)=>{const{scope:j,children:R}=S,T=i(u,j),N=Rt(E,T.collectionRef);return a.jsx(f,{ref:N,children:R})});m.displayName=u;const x=e+"CollectionItemSlot",g="data-radix-collection-item",y=x_(x),v=re.forwardRef((S,E)=>{const{scope:j,children:R,...T}=S,N=re.useRef(null),A=Rt(E,N),I=i(x,j);return re.useEffect(()=>(I.itemMap.set(N,{ref:N,...T}),()=>void I.itemMap.delete(N))),a.jsx(y,{[g]:"",ref:A,children:R})});v.displayName=x;function C(S){const E=i(e+"CollectionConsumer",S);return re.useCallback(()=>{const R=E.collectionRef.current;if(!R)return[];const T=Array.from(R.querySelectorAll(`[${g}]`));return Array.from(E.itemMap.values()).sort((I,_)=>T.indexOf(I.ref.current)-T.indexOf(_.ref.current))},[E.collectionRef,E.itemMap])}return[{Provider:c,Slot:m,ItemSlot:v},C,r]}var yb="rovingFocusGroup.onEntryFocus",XB={bubbles:!1,cancelable:!0},Hh="RovingFocusGroup",[_1,K3,QB]=YB(Hh),[JB,Fx]=Dr(Hh,[QB]),[eq,tq]=JB(Hh),W3=h.forwardRef((e,t)=>a.jsx(_1.Provider,{scope:e.__scopeRovingFocusGroup,children:a.jsx(_1.Slot,{scope:e.__scopeRovingFocusGroup,children:a.jsx(nq,{...e,ref:t})})}));W3.displayName=Hh;var nq=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:i,currentTabStopId:c,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:f,onEntryFocus:m,preventScrollOnEntryFocus:x=!1,...g}=e,y=h.useRef(null),v=Rt(t,y),C=Fh(i),[S,E]=ya({prop:c,defaultProp:u??null,onChange:f,caller:Hh}),[j,R]=h.useState(!1),T=Ws(m),N=K3(n),A=h.useRef(!1),[I,_]=h.useState(0);return h.useEffect(()=>{const M=y.current;if(M)return M.addEventListener(yb,T),()=>M.removeEventListener(yb,T)},[T]),a.jsx(eq,{scope:n,orientation:r,dir:C,loop:s,currentTabStopId:S,onItemFocus:h.useCallback(M=>E(M),[E]),onItemShiftTab:h.useCallback(()=>R(!0),[]),onFocusableItemAdd:h.useCallback(()=>_(M=>M+1),[]),onFocusableItemRemove:h.useCallback(()=>_(M=>M-1),[]),children:a.jsx(tt.div,{tabIndex:j||I===0?-1:0,"data-orientation":r,...g,ref:v,style:{outline:"none",...e.style},onMouseDown:Me(e.onMouseDown,()=>{A.current=!0}),onFocus:Me(e.onFocus,M=>{const G=!A.current;if(M.target===M.currentTarget&&G&&!j){const H=new CustomEvent(yb,XB);if(M.currentTarget.dispatchEvent(H),!H.defaultPrevented){const L=N().filter(D=>D.focusable),q=L.find(D=>D.active),W=L.find(D=>D.id===S),V=[q,W,...L].filter(Boolean).map(D=>D.ref.current);X3(V,x)}}A.current=!1}),onBlur:Me(e.onBlur,()=>R(!1))})})}),Z3="RovingFocusGroupItem",Y3=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:i,children:c,...u}=e,f=ar(),m=i||f,x=tq(Z3,n),g=x.currentTabStopId===m,y=K3(n),{onFocusableItemAdd:v,onFocusableItemRemove:C,currentTabStopId:S}=x;return h.useEffect(()=>{if(r)return v(),()=>C()},[r,v,C]),a.jsx(_1.ItemSlot,{scope:n,id:m,focusable:r,active:s,children:a.jsx(tt.span,{tabIndex:g?0:-1,"data-orientation":x.orientation,...u,ref:t,onMouseDown:Me(e.onMouseDown,E=>{r?x.onItemFocus(m):E.preventDefault()}),onFocus:Me(e.onFocus,()=>x.onItemFocus(m)),onKeyDown:Me(e.onKeyDown,E=>{if(E.key==="Tab"&&E.shiftKey){x.onItemShiftTab();return}if(E.target!==E.currentTarget)return;const j=sq(E,x.orientation,x.dir);if(j!==void 0){if(E.metaKey||E.ctrlKey||E.altKey||E.shiftKey)return;E.preventDefault();let T=y().filter(N=>N.focusable).map(N=>N.ref.current);if(j==="last")T.reverse();else if(j==="prev"||j==="next"){j==="prev"&&T.reverse();const N=T.indexOf(E.currentTarget);T=x.loop?oq(T,N+1):T.slice(N+1)}setTimeout(()=>X3(T))}}),children:typeof c=="function"?c({isCurrentTabStop:g,hasTabStop:S!=null}):c})})});Y3.displayName=Z3;var rq={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function aq(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function sq(e,t,n){const r=aq(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return rq[r]}function X3(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function oq(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Q3=W3,J3=Y3,N1=["Enter"," "],iq=["ArrowDown","PageUp","Home"],eD=["ArrowUp","PageDown","End"],lq=[...iq,...eD],cq={ltr:[...N1,"ArrowRight"],rtl:[...N1,"ArrowLeft"]},uq={ltr:["ArrowLeft"],rtl:["ArrowRight"]},$h="Menu",[ch,dq,fq]=VB($h),[$c,tD]=Dr($h,[fq,Io,Fx]),Vh=Io(),nD=Fx(),[rD,jl]=$c($h),[hq,Gh]=$c($h),aD=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:i,modal:c=!0}=e,u=Vh(t),[f,m]=h.useState(null),x=h.useRef(!1),g=Ws(i),y=Fh(s);return h.useEffect(()=>{const v=()=>{x.current=!0,document.addEventListener("pointerdown",C,{capture:!0,once:!0}),document.addEventListener("pointermove",C,{capture:!0,once:!0})},C=()=>x.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(Cd,{...u,children:a.jsx(rD,{scope:t,open:n,onOpenChange:g,content:f,onContentChange:m,children:a.jsx(hq,{scope:t,onClose:h.useCallback(()=>g(!1),[g]),isUsingKeyboardRef:x,dir:y,modal:c,children:r})})})};aD.displayName=$h;var mq="MenuAnchor",xC=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=Vh(n);return a.jsx(Ed,{...s,...r,ref:t})});xC.displayName=mq;var yC="MenuPortal",[pq,sD]=$c(yC,{forceMount:void 0}),oD=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,i=jl(yC,t);return a.jsx(pq,{scope:t,forceMount:n,children:a.jsx(Xr,{present:n||i.open,children:a.jsx(Hc,{asChild:!0,container:s,children:r})})})};oD.displayName=yC;var Cs="MenuContent",[gq,vC]=$c(Cs),iD=h.forwardRef((e,t)=>{const n=sD(Cs,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,i=jl(Cs,e.__scopeMenu),c=Gh(Cs,e.__scopeMenu);return a.jsx(ch.Provider,{scope:e.__scopeMenu,children:a.jsx(Xr,{present:r||i.open,children:a.jsx(ch.Slot,{scope:e.__scopeMenu,children:c.modal?a.jsx(xq,{...s,ref:t}):a.jsx(yq,{...s,ref:t})})})})}),xq=h.forwardRef((e,t)=>{const n=jl(Cs,e.__scopeMenu),r=h.useRef(null),s=Rt(t,r);return h.useEffect(()=>{const i=r.current;if(i)return Tx(i)},[]),a.jsx(bC,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Me(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),yq=h.forwardRef((e,t)=>{const n=jl(Cs,e.__scopeMenu);return a.jsx(bC,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),vq=T1("MenuContent.ScrollLock"),bC=h.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:c,disableOutsidePointerEvents:u,onEntryFocus:f,onEscapeKeyDown:m,onPointerDownOutside:x,onFocusOutside:g,onInteractOutside:y,onDismiss:v,disableOutsideScroll:C,...S}=e,E=jl(Cs,n),j=Gh(Cs,n),R=Vh(n),T=nD(n),N=dq(n),[A,I]=h.useState(null),_=h.useRef(null),M=Rt(t,_,E.onContentChange),G=h.useRef(0),H=h.useRef(""),L=h.useRef(0),q=h.useRef(null),W=h.useRef("right"),B=h.useRef(0),V=C?Mh:h.Fragment,D=C?{as:vq,allowPinchZoom:!0}:void 0,F=ee=>{var Q,le;const he=H.current+ee,z=N().filter(pe=>!pe.disabled),$=document.activeElement,P=(Q=z.find(pe=>pe.ref.current===$))==null?void 0:Q.textValue,K=z.map(pe=>pe.textValue),Y=Dq(K,he,P),se=(le=z.find(pe=>pe.textValue===Y))==null?void 0:le.ref.current;(function pe(be){H.current=be,window.clearTimeout(G.current),be!==""&&(G.current=window.setTimeout(()=>pe(""),1e3))})(he),se&&setTimeout(()=>se.focus())};h.useEffect(()=>()=>window.clearTimeout(G.current),[]),Rx();const U=h.useCallback(ee=>{var z,$;return W.current===((z=q.current)==null?void 0:z.side)&&Iq(ee,($=q.current)==null?void 0:$.area)},[]);return a.jsx(gq,{scope:n,searchRef:H,onItemEnter:h.useCallback(ee=>{U(ee)&&ee.preventDefault()},[U]),onItemLeave:h.useCallback(ee=>{var he;U(ee)||((he=_.current)==null||he.focus(),I(null))},[U]),onTriggerLeave:h.useCallback(ee=>{U(ee)&&ee.preventDefault()},[U]),pointerGraceTimerRef:L,onPointerGraceIntentChange:h.useCallback(ee=>{q.current=ee},[]),children:a.jsx(V,{...D,children:a.jsx(Ih,{asChild:!0,trapped:s,onMountAutoFocus:Me(i,ee=>{var he;ee.preventDefault(),(he=_.current)==null||he.focus({preventScroll:!0})}),onUnmountAutoFocus:c,children:a.jsx(Fc,{asChild:!0,disableOutsidePointerEvents:u,onEscapeKeyDown:m,onPointerDownOutside:x,onFocusOutside:g,onInteractOutside:y,onDismiss:v,children:a.jsx(Q3,{asChild:!0,...T,dir:j.dir,orientation:"vertical",loop:r,currentTabStopId:A,onCurrentTabStopIdChange:I,onEntryFocus:Me(f,ee=>{j.isUsingKeyboardRef.current||ee.preventDefault()}),preventScrollOnEntryFocus:!0,children:a.jsx(Lh,{role:"menu","aria-orientation":"vertical","data-state":wD(E.open),"data-radix-menu-content":"",dir:j.dir,...R,...S,ref:M,style:{outline:"none",...S.style},onKeyDown:Me(S.onKeyDown,ee=>{const z=ee.target.closest("[data-radix-menu-content]")===ee.currentTarget,$=ee.ctrlKey||ee.altKey||ee.metaKey,P=ee.key.length===1;z&&(ee.key==="Tab"&&ee.preventDefault(),!$&&P&&F(ee.key));const K=_.current;if(ee.target!==K||!lq.includes(ee.key))return;ee.preventDefault();const se=N().filter(Q=>!Q.disabled).map(Q=>Q.ref.current);eD.includes(ee.key)&&se.reverse(),Nq(se)}),onBlur:Me(e.onBlur,ee=>{ee.currentTarget.contains(ee.target)||(window.clearTimeout(G.current),H.current="")}),onPointerMove:Me(e.onPointerMove,uh(ee=>{const he=ee.target,z=B.current!==ee.clientX;if(ee.currentTarget.contains(he)&&z){const $=ee.clientX>B.current?"right":"left";W.current=$,B.current=ee.clientX}}))})})})})})})});iD.displayName=Cs;var bq="MenuGroup",SC=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return a.jsx(tt.div,{role:"group",...r,ref:t})});SC.displayName=bq;var Sq="MenuLabel",lD=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return a.jsx(tt.div,{...r,ref:t})});lD.displayName=Sq;var Lg="MenuItem",y_="menu.itemSelect",Hx=h.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,i=h.useRef(null),c=Gh(Lg,e.__scopeMenu),u=vC(Lg,e.__scopeMenu),f=Rt(t,i),m=h.useRef(!1),x=()=>{const g=i.current;if(!n&&g){const y=new CustomEvent(y_,{bubbles:!0,cancelable:!0});g.addEventListener(y_,v=>r==null?void 0:r(v),{once:!0}),z4(g,y),y.defaultPrevented?m.current=!1:c.onClose()}};return a.jsx(cD,{...s,ref:f,disabled:n,onClick:Me(e.onClick,x),onPointerDown:g=>{var y;(y=e.onPointerDown)==null||y.call(e,g),m.current=!0},onPointerUp:Me(e.onPointerUp,g=>{var y;m.current||(y=g.currentTarget)==null||y.click()}),onKeyDown:Me(e.onKeyDown,g=>{const y=u.searchRef.current!=="";n||y&&g.key===" "||N1.includes(g.key)&&(g.currentTarget.click(),g.preventDefault())})})});Hx.displayName=Lg;var cD=h.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...i}=e,c=vC(Lg,n),u=nD(n),f=h.useRef(null),m=Rt(t,f),[x,g]=h.useState(!1),[y,v]=h.useState("");return h.useEffect(()=>{const C=f.current;C&&v((C.textContent??"").trim())},[i.children]),a.jsx(ch.ItemSlot,{scope:n,disabled:r,textValue:s??y,children:a.jsx(J3,{asChild:!0,...u,focusable:!r,children:a.jsx(tt.div,{role:"menuitem","data-highlighted":x?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:m,onPointerMove:Me(e.onPointerMove,uh(C=>{r?c.onItemLeave(C):(c.onItemEnter(C),C.defaultPrevented||C.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Me(e.onPointerLeave,uh(C=>c.onItemLeave(C))),onFocus:Me(e.onFocus,()=>g(!0)),onBlur:Me(e.onBlur,()=>g(!1))})})})}),Cq="MenuCheckboxItem",uD=h.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return a.jsx(pD,{scope:e.__scopeMenu,checked:n,children:a.jsx(Hx,{role:"menuitemcheckbox","aria-checked":Pg(n)?"mixed":n,...s,ref:t,"data-state":wC(n),onSelect:Me(s.onSelect,()=>r==null?void 0:r(Pg(n)?!0:!n),{checkForDefaultPrevented:!1})})})});uD.displayName=Cq;var dD="MenuRadioGroup",[Eq,wq]=$c(dD,{value:void 0,onValueChange:()=>{}}),fD=h.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,i=Ws(r);return a.jsx(Eq,{scope:e.__scopeMenu,value:n,onValueChange:i,children:a.jsx(SC,{...s,ref:t})})});fD.displayName=dD;var hD="MenuRadioItem",mD=h.forwardRef((e,t)=>{const{value:n,...r}=e,s=wq(hD,e.__scopeMenu),i=n===s.value;return a.jsx(pD,{scope:e.__scopeMenu,checked:i,children:a.jsx(Hx,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":wC(i),onSelect:Me(r.onSelect,()=>{var c;return(c=s.onValueChange)==null?void 0:c.call(s,n)},{checkForDefaultPrevented:!1})})})});mD.displayName=hD;var CC="MenuItemIndicator",[pD,Rq]=$c(CC,{checked:!1}),gD=h.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,i=Rq(CC,n);return a.jsx(Xr,{present:r||Pg(i.checked)||i.checked===!0,children:a.jsx(tt.span,{...s,ref:t,"data-state":wC(i.checked)})})});gD.displayName=CC;var jq="MenuSeparator",xD=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return a.jsx(tt.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});xD.displayName=jq;var Tq="MenuArrow",yD=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=Vh(n);return a.jsx(Ph,{...s,...r,ref:t})});yD.displayName=Tq;var EC="MenuSub",[_q,vD]=$c(EC),bD=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:s}=e,i=jl(EC,t),c=Vh(t),[u,f]=h.useState(null),[m,x]=h.useState(null),g=Ws(s);return h.useEffect(()=>(i.open===!1&&g(!1),()=>g(!1)),[i.open,g]),a.jsx(Cd,{...c,children:a.jsx(rD,{scope:t,open:r,onOpenChange:g,content:m,onContentChange:x,children:a.jsx(_q,{scope:t,contentId:ar(),triggerId:ar(),trigger:u,onTriggerChange:f,children:n})})})};bD.displayName=EC;var Ff="MenuSubTrigger",SD=h.forwardRef((e,t)=>{const n=jl(Ff,e.__scopeMenu),r=Gh(Ff,e.__scopeMenu),s=vD(Ff,e.__scopeMenu),i=vC(Ff,e.__scopeMenu),c=h.useRef(null),{pointerGraceTimerRef:u,onPointerGraceIntentChange:f}=i,m={__scopeMenu:e.__scopeMenu},x=h.useCallback(()=>{c.current&&window.clearTimeout(c.current),c.current=null},[]);return h.useEffect(()=>x,[x]),h.useEffect(()=>{const g=u.current;return()=>{window.clearTimeout(g),f(null)}},[u,f]),a.jsx(xC,{asChild:!0,...m,children:a.jsx(cD,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":wD(n.open),...e,ref:aa(t,s.onTriggerChange),onClick:g=>{var y;(y=e.onClick)==null||y.call(e,g),!(e.disabled||g.defaultPrevented)&&(g.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Me(e.onPointerMove,uh(g=>{i.onItemEnter(g),!g.defaultPrevented&&!e.disabled&&!n.open&&!c.current&&(i.onPointerGraceIntentChange(null),c.current=window.setTimeout(()=>{n.onOpenChange(!0),x()},100))})),onPointerLeave:Me(e.onPointerLeave,uh(g=>{var v,C;x();const y=(v=n.content)==null?void 0:v.getBoundingClientRect();if(y){const S=(C=n.content)==null?void 0:C.dataset.side,E=S==="right",j=E?-5:5,R=y[E?"left":"right"],T=y[E?"right":"left"];i.onPointerGraceIntentChange({area:[{x:g.clientX+j,y:g.clientY},{x:R,y:y.top},{x:T,y:y.top},{x:T,y:y.bottom},{x:R,y:y.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:Me(e.onKeyDown,g=>{var v;const y=i.searchRef.current!=="";e.disabled||y&&g.key===" "||cq[r.dir].includes(g.key)&&(n.onOpenChange(!0),(v=n.content)==null||v.focus(),g.preventDefault())})})})});SD.displayName=Ff;var CD="MenuSubContent",ED=h.forwardRef((e,t)=>{const n=sD(Cs,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,i=jl(Cs,e.__scopeMenu),c=Gh(Cs,e.__scopeMenu),u=vD(CD,e.__scopeMenu),f=h.useRef(null),m=Rt(t,f);return a.jsx(ch.Provider,{scope:e.__scopeMenu,children:a.jsx(Xr,{present:r||i.open,children:a.jsx(ch.Slot,{scope:e.__scopeMenu,children:a.jsx(bC,{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:x=>{var g;c.isUsingKeyboardRef.current&&((g=f.current)==null||g.focus()),x.preventDefault()},onCloseAutoFocus:x=>x.preventDefault(),onFocusOutside:Me(e.onFocusOutside,x=>{x.target!==u.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:Me(e.onEscapeKeyDown,x=>{c.onClose(),x.preventDefault()}),onKeyDown:Me(e.onKeyDown,x=>{var v;const g=x.currentTarget.contains(x.target),y=uq[c.dir].includes(x.key);g&&y&&(i.onOpenChange(!1),(v=u.trigger)==null||v.focus(),x.preventDefault())})})})})})});ED.displayName=CD;function wD(e){return e?"open":"closed"}function Pg(e){return e==="indeterminate"}function wC(e){return Pg(e)?"indeterminate":e?"checked":"unchecked"}function Nq(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Aq(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Dq(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=Aq(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 Oq(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,x=u.y,g=f.x,y=f.y;x>r!=y>r&&n<(g-m)*(r-x)/(y-x)+m&&(s=!s)}return s}function Iq(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Oq(n,t)}function uh(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Mq=aD,kq=xC,Lq=oD,Pq=iD,Uq=SC,zq=lD,Fq=Hx,Hq=uD,$q=fD,Vq=mD,Gq=gD,Bq=xD,qq=yD,Kq=bD,Wq=SD,Zq=ED,$x="DropdownMenu",[Yq]=Dr($x,[tD]),ua=tD(),[Xq,RD]=Yq($x),jD=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:s,defaultOpen:i,onOpenChange:c,modal:u=!0}=e,f=ua(t),m=h.useRef(null),[x,g]=ya({prop:s,defaultProp:i??!1,onChange:c,caller:$x});return a.jsx(Xq,{scope:t,triggerId:ar(),triggerRef:m,contentId:ar(),open:x,onOpenChange:g,onOpenToggle:h.useCallback(()=>g(y=>!y),[g]),modal:u,children:a.jsx(Mq,{...f,open:x,onOpenChange:g,dir:r,modal:u,children:n})})};jD.displayName=$x;var TD="DropdownMenuTrigger",_D=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...s}=e,i=RD(TD,n),c=ua(n);return a.jsx(kq,{asChild:!0,...c,children:a.jsx(tt.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:aa(t,i.triggerRef),onPointerDown:Me(e.onPointerDown,u=>{!r&&u.button===0&&u.ctrlKey===!1&&(i.onOpenToggle(),i.open||u.preventDefault())}),onKeyDown:Me(e.onKeyDown,u=>{r||(["Enter"," "].includes(u.key)&&i.onOpenToggle(),u.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})});_D.displayName=TD;var Qq="DropdownMenuPortal",ND=e=>{const{__scopeDropdownMenu:t,...n}=e,r=ua(t);return a.jsx(Lq,{...r,...n})};ND.displayName=Qq;var AD="DropdownMenuContent",DD=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=RD(AD,n),i=ua(n),c=h.useRef(!1);return a.jsx(Pq,{id:s.contentId,"aria-labelledby":s.triggerId,...i,...r,ref:t,onCloseAutoFocus:Me(e.onCloseAutoFocus,u=>{var f;c.current||(f=s.triggerRef.current)==null||f.focus(),c.current=!1,u.preventDefault()}),onInteractOutside:Me(e.onInteractOutside,u=>{const f=u.detail.originalEvent,m=f.button===0&&f.ctrlKey===!0,x=f.button===2||m;(!s.modal||x)&&(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)"}})});DD.displayName=AD;var Jq="DropdownMenuGroup",eK=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=ua(n);return a.jsx(Uq,{...s,...r,ref:t})});eK.displayName=Jq;var tK="DropdownMenuLabel",nK=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=ua(n);return a.jsx(zq,{...s,...r,ref:t})});nK.displayName=tK;var rK="DropdownMenuItem",OD=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=ua(n);return a.jsx(Fq,{...s,...r,ref:t})});OD.displayName=rK;var aK="DropdownMenuCheckboxItem",sK=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=ua(n);return a.jsx(Hq,{...s,...r,ref:t})});sK.displayName=aK;var oK="DropdownMenuRadioGroup",iK=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=ua(n);return a.jsx($q,{...s,...r,ref:t})});iK.displayName=oK;var lK="DropdownMenuRadioItem",cK=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=ua(n);return a.jsx(Vq,{...s,...r,ref:t})});cK.displayName=lK;var uK="DropdownMenuItemIndicator",dK=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=ua(n);return a.jsx(Gq,{...s,...r,ref:t})});dK.displayName=uK;var fK="DropdownMenuSeparator",ID=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=ua(n);return a.jsx(Bq,{...s,...r,ref:t})});ID.displayName=fK;var hK="DropdownMenuArrow",mK=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=ua(n);return a.jsx(qq,{...s,...r,ref:t})});mK.displayName=hK;var pK=e=>{const{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:s,defaultOpen:i}=e,c=ua(t),[u,f]=ya({prop:r,defaultProp:i??!1,onChange:s,caller:"DropdownMenuSub"});return a.jsx(Kq,{...c,open:u,onOpenChange:f,children:n})},gK="DropdownMenuSubTrigger",MD=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=ua(n);return a.jsx(Wq,{...s,...r,ref:t})});MD.displayName=gK;var xK="DropdownMenuSubContent",kD=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=ua(n);return a.jsx(Zq,{...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)"}})});kD.displayName=xK;var yK=jD,vK=_D,LD=ND,bK=DD,SK=OD,CK=ID,EK=pK,wK=MD,RK=kD;function Or({...e}){return a.jsx(yK,{"data-slot":"dropdown-menu",...e})}function jK({...e}){return a.jsx(LD,{"data-slot":"dropdown-menu-portal",...e})}function Ir({...e}){return a.jsx(vK,{"data-slot":"dropdown-menu-trigger",...e})}function Mr({className:e,sideOffset:t=4,...n}){return a.jsx(LD,{children:a.jsx(bK,{"data-slot":"dropdown-menu-content",sideOffset:t,className:oe("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...n})})}function Ut({className:e,inset:t,variant:n="default",...r}){return a.jsx(SK,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:oe("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r})}function ns({className:e,...t}){return a.jsx(CK,{"data-slot":"dropdown-menu-separator",className:oe("bg-border -mx-1 my-1 h-px",e),...t})}function Vx({...e}){return a.jsx(EK,{"data-slot":"dropdown-menu-sub",...e})}function Gx({className:e,inset:t,children:n,...r}){return a.jsxs(wK,{"data-slot":"dropdown-menu-sub-trigger","data-inset":t,className:oe("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",e),...r,children:[n,a.jsx(ba,{className:"ml-auto size-4"})]})}function Bx({className:e,...t}){return a.jsx(RK,{"data-slot":"dropdown-menu-sub-content",className:oe("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-lg",e),...t})}const TK="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",_K=({width:e=45,height:t=36,className:n=""})=>a.jsx("img",{src:TK,alt:"OWOX Logo",width:e,height:t,className:n}),PD=h.createContext(null),UD=h.createContext(()=>{});function zD(){return h.useContext(UD)}function dh(e){const t=h.useContext(PD);if(t==null)throw new Error("useAppSelector must be used within StoreProvider");return e(t)}function FD(){return dh(e=>e.project)}function wd(){const{data:e,callState:t,error:n}=dh(r=>r.flags);return{flags:e,callState:t,error:n}}function NK({isOpen:e}){const{title:t}=FD();return a.jsx(Ir,{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(_K,{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(ss,{className:`ml-auto size-4 transition-transform duration-200 ${e?"-rotate-90":""}`})]})})}var ra=(e=>(e.LOADING="loading",e.AUTHENTICATED="authenticated",e.UNAUTHENTICATED="unauthenticated",e.ERROR="error",e))(ra||{});function HD(e,t){return function(){return e.apply(t,arguments)}}const{toString:AK}=Object.prototype,{getPrototypeOf:RC}=Object,{iterator:qx,toStringTag:$D}=Symbol,Kx=(e=>t=>{const n=AK.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),eo=e=>(e=e.toLowerCase(),t=>Kx(t)===e),Wx=e=>t=>typeof t===e,{isArray:Rd}=Array,cd=Wx("undefined");function Bh(e){return e!==null&&!cd(e)&&e.constructor!==null&&!cd(e.constructor)&&Da(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const VD=eo("ArrayBuffer");function DK(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&VD(e.buffer),t}const OK=Wx("string"),Da=Wx("function"),GD=Wx("number"),qh=e=>e!==null&&typeof e=="object",IK=e=>e===!0||e===!1,gg=e=>{if(Kx(e)!=="object")return!1;const t=RC(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!($D in e)&&!(qx in e)},MK=e=>{if(!qh(e)||Bh(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},kK=eo("Date"),LK=eo("File"),PK=eo("Blob"),UK=eo("FileList"),zK=e=>qh(e)&&Da(e.pipe),FK=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Da(e.append)&&((t=Kx(e))==="formdata"||t==="object"&&Da(e.toString)&&e.toString()==="[object FormData]"))},HK=eo("URLSearchParams"),[$K,VK,GK,BK]=["ReadableStream","Request","Response","Headers"].map(eo),qK=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Kh(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),Rd(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{if(Bh(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 BD(e,t){if(Bh(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 pc=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,qD=e=>!cd(e)&&e!==pc;function A1(){const{caseless:e,skipUndefined:t}=qD(this)&&this||{},n={},r=(s,i)=>{const c=e&&BD(n,i)||i;gg(n[c])&&gg(s)?n[c]=A1(n[c],s):gg(s)?n[c]=A1({},s):Rd(s)?n[c]=s.slice():(!t||!cd(s))&&(n[c]=s)};for(let s=0,i=arguments.length;s<i;s++)arguments[s]&&Kh(arguments[s],r);return n}const KK=(e,t,n,{allOwnKeys:r}={})=>(Kh(t,(s,i)=>{n&&Da(s)?e[i]=HD(s,n):e[i]=s},{allOwnKeys:r}),e),WK=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),ZK=(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)},YK=(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&&RC(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},XK=(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},QK=e=>{if(!e)return null;if(Rd(e))return e;let t=e.length;if(!GD(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},JK=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&RC(Uint8Array)),eW=(e,t)=>{const r=(e&&e[qx]).call(e);let s;for(;(s=r.next())&&!s.done;){const i=s.value;t.call(e,i[0],i[1])}},tW=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},nW=eo("HTMLFormElement"),rW=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),v_=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),aW=eo("RegExp"),KD=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Kh(n,(s,i)=>{let c;(c=t(s,i,e))!==!1&&(r[i]=c||s)}),Object.defineProperties(e,r)},sW=e=>{KD(e,(t,n)=>{if(Da(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Da(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+"'")})}})},oW=(e,t)=>{const n={},r=s=>{s.forEach(i=>{n[i]=!0})};return Rd(e)?r(e):r(String(e).split(t)),n},iW=()=>{},lW=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function cW(e){return!!(e&&Da(e.append)&&e[$D]==="FormData"&&e[qx])}const uW=e=>{const t=new Array(10),n=(r,s)=>{if(qh(r)){if(t.indexOf(r)>=0)return;if(Bh(r))return r;if(!("toJSON"in r)){t[s]=r;const i=Rd(r)?[]:{};return Kh(r,(c,u)=>{const f=n(c,s+1);!cd(f)&&(i[u]=f)}),t[s]=void 0,i}}return r};return n(e,0)},dW=eo("AsyncFunction"),fW=e=>e&&(qh(e)||Da(e))&&Da(e.then)&&Da(e.catch),WD=((e,t)=>e?setImmediate:t?((n,r)=>(pc.addEventListener("message",({source:s,data:i})=>{s===pc&&i===n&&r.length&&r.shift()()},!1),s=>{r.push(s),pc.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Da(pc.postMessage)),hW=typeof queueMicrotask<"u"?queueMicrotask.bind(pc):typeof process<"u"&&process.nextTick||WD,mW=e=>e!=null&&Da(e[qx]),xe={isArray:Rd,isArrayBuffer:VD,isBuffer:Bh,isFormData:FK,isArrayBufferView:DK,isString:OK,isNumber:GD,isBoolean:IK,isObject:qh,isPlainObject:gg,isEmptyObject:MK,isReadableStream:$K,isRequest:VK,isResponse:GK,isHeaders:BK,isUndefined:cd,isDate:kK,isFile:LK,isBlob:PK,isRegExp:aW,isFunction:Da,isStream:zK,isURLSearchParams:HK,isTypedArray:JK,isFileList:UK,forEach:Kh,merge:A1,extend:KK,trim:qK,stripBOM:WK,inherits:ZK,toFlatObject:YK,kindOf:Kx,kindOfTest:eo,endsWith:XK,toArray:QK,forEachEntry:eW,matchAll:tW,isHTMLForm:nW,hasOwnProperty:v_,hasOwnProp:v_,reduceDescriptors:KD,freezeMethods:sW,toObjectSet:oW,toCamelCase:rW,noop:iW,toFiniteNumber:lW,findKey:BD,global:pc,isContextDefined:qD,isSpecCompliantForm:cW,toJSONObject:uW,isAsyncFn:dW,isThenable:fW,setImmediate:WD,asap:hW,isIterable:mW};function Lt(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)}xe.inherits(Lt,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:xe.toJSONObject(this.config),code:this.code,status:this.status}}});const ZD=Lt.prototype,YD={};["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=>{YD[e]={value:e}});Object.defineProperties(Lt,YD);Object.defineProperty(ZD,"isAxiosError",{value:!0});Lt.from=(e,t,n,r,s,i)=>{const c=Object.create(ZD);xe.toFlatObject(e,c,function(x){return x!==Error.prototype},m=>m!=="isAxiosError");const u=e&&e.message?e.message:"Error",f=t==null&&e?e.code:t;return Lt.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 pW=null;function D1(e){return xe.isPlainObject(e)||xe.isArray(e)}function XD(e){return xe.endsWith(e,"[]")?e.slice(0,-2):e}function b_(e,t,n){return e?e.concat(t).map(function(s,i){return s=XD(s),!n&&i?"["+s+"]":s}).join(n?".":""):t}function gW(e){return xe.isArray(e)&&!e.some(D1)}const xW=xe.toFlatObject(xe,{},null,function(t){return/^is[A-Z]/.test(t)});function Zx(e,t,n){if(!xe.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=xe.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(S,E){return!xe.isUndefined(E[S])});const r=n.metaTokens,s=n.visitor||x,i=n.dots,c=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&xe.isSpecCompliantForm(t);if(!xe.isFunction(s))throw new TypeError("visitor must be a function");function m(C){if(C===null)return"";if(xe.isDate(C))return C.toISOString();if(xe.isBoolean(C))return C.toString();if(!f&&xe.isBlob(C))throw new Lt("Blob is not supported. Use a Buffer instead.");return xe.isArrayBuffer(C)||xe.isTypedArray(C)?f&&typeof Blob=="function"?new Blob([C]):Buffer.from(C):C}function x(C,S,E){let j=C;if(C&&!E&&typeof C=="object"){if(xe.endsWith(S,"{}"))S=r?S:S.slice(0,-2),C=JSON.stringify(C);else if(xe.isArray(C)&&gW(C)||(xe.isFileList(C)||xe.endsWith(S,"[]"))&&(j=xe.toArray(C)))return S=XD(S),j.forEach(function(T,N){!(xe.isUndefined(T)||T===null)&&t.append(c===!0?b_([S],N,i):c===null?S:S+"[]",m(T))}),!1}return D1(C)?!0:(t.append(b_(E,S,i),m(C)),!1)}const g=[],y=Object.assign(xW,{defaultVisitor:x,convertValue:m,isVisitable:D1});function v(C,S){if(!xe.isUndefined(C)){if(g.indexOf(C)!==-1)throw Error("Circular reference detected in "+S.join("."));g.push(C),xe.forEach(C,function(j,R){(!(xe.isUndefined(j)||j===null)&&s.call(t,j,xe.isString(R)?R.trim():R,S,y))===!0&&v(j,S?S.concat(R):[R])}),g.pop()}}if(!xe.isObject(e))throw new TypeError("data must be an object");return v(e),t}function S_(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function jC(e,t){this._pairs=[],e&&Zx(e,this,t)}const QD=jC.prototype;QD.append=function(t,n){this._pairs.push([t,n])};QD.toString=function(t){const n=t?function(r){return t.call(this,r,S_)}:S_;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function yW(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function JD(e,t,n){if(!t)return e;const r=n&&n.encode||yW;xe.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let i;if(s?i=s(t,n):i=xe.isURLSearchParams(t)?t.toString():new jC(t,n).toString(r),i){const c=e.indexOf("#");c!==-1&&(e=e.slice(0,c)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class C_{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){xe.forEach(this.handlers,function(r){r!==null&&t(r)})}}const eO={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},vW=typeof URLSearchParams<"u"?URLSearchParams:jC,bW=typeof FormData<"u"?FormData:null,SW=typeof Blob<"u"?Blob:null,CW={isBrowser:!0,classes:{URLSearchParams:vW,FormData:bW,Blob:SW},protocols:["http","https","file","blob","url","data"]},TC=typeof window<"u"&&typeof document<"u",O1=typeof navigator=="object"&&navigator||void 0,EW=TC&&(!O1||["ReactNative","NativeScript","NS"].indexOf(O1.product)<0),wW=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",RW=TC&&window.location.href||"http://localhost",jW=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:TC,hasStandardBrowserEnv:EW,hasStandardBrowserWebWorkerEnv:wW,navigator:O1,origin:RW},Symbol.toStringTag,{value:"Module"})),na={...jW,...CW};function TW(e,t){return Zx(e,new na.classes.URLSearchParams,{visitor:function(n,r,s,i){return na.isNode&&xe.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function _W(e){return xe.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function NW(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 tO(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&&xe.isArray(s)?s.length:c,f?(xe.hasOwnProp(s,c)?s[c]=[s[c],r]:s[c]=r,!u):((!s[c]||!xe.isObject(s[c]))&&(s[c]=[]),t(n,r,s[c],i)&&xe.isArray(s[c])&&(s[c]=NW(s[c])),!u)}if(xe.isFormData(e)&&xe.isFunction(e.entries)){const n={};return xe.forEachEntry(e,(r,s)=>{t(_W(r),s,n,0)}),n}return null}function AW(e,t,n){if(xe.isString(e))try{return(t||JSON.parse)(e),xe.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const Wh={transitional:eO,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,i=xe.isObject(t);if(i&&xe.isHTMLForm(t)&&(t=new FormData(t)),xe.isFormData(t))return s?JSON.stringify(tO(t)):t;if(xe.isArrayBuffer(t)||xe.isBuffer(t)||xe.isStream(t)||xe.isFile(t)||xe.isBlob(t)||xe.isReadableStream(t))return t;if(xe.isArrayBufferView(t))return t.buffer;if(xe.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 TW(t,this.formSerializer).toString();if((u=xe.isFileList(t))||r.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return Zx(u?{"files[]":t}:t,f&&new f,this.formSerializer)}}return i||s?(n.setContentType("application/json",!1),AW(t)):t}],transformResponse:[function(t){const n=this.transitional||Wh.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(xe.isResponse(t)||xe.isReadableStream(t))return t;if(t&&xe.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"?Lt.from(u,Lt.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:na.classes.FormData,Blob:na.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};xe.forEach(["delete","get","head","post","put","patch"],e=>{Wh.headers[e]={}});const DW=xe.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"]),OW=e=>{const t={};let n,r,s;return e&&e.split(`
|
|
611
|
+
`).forEach(function(c){s=c.indexOf(":"),n=c.substring(0,s).trim().toLowerCase(),r=c.substring(s+1).trim(),!(!n||t[n]&&DW[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},E_=Symbol("internals");function Nf(e){return e&&String(e).trim().toLowerCase()}function xg(e){return e===!1||e==null?e:xe.isArray(e)?e.map(xg):String(e)}function IW(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 MW=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function vb(e,t,n,r,s){if(xe.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!xe.isString(t)){if(xe.isString(r))return t.indexOf(r)!==-1;if(xe.isRegExp(r))return r.test(t)}}function kW(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function LW(e,t){const n=xe.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 Oa=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function i(u,f,m){const x=Nf(f);if(!x)throw new Error("header name must be a non-empty string");const g=xe.findKey(s,x);(!g||s[g]===void 0||m===!0||m===void 0&&s[g]!==!1)&&(s[g||f]=xg(u))}const c=(u,f)=>xe.forEach(u,(m,x)=>i(m,x,f));if(xe.isPlainObject(t)||t instanceof this.constructor)c(t,n);else if(xe.isString(t)&&(t=t.trim())&&!MW(t))c(OW(t),n);else if(xe.isObject(t)&&xe.isIterable(t)){let u={},f,m;for(const x of t){if(!xe.isArray(x))throw TypeError("Object iterator must return a key-value pair");u[m=x[0]]=(f=u[m])?xe.isArray(f)?[...f,x[1]]:[f,x[1]]:x[1]}c(u,n)}else t!=null&&i(n,t,r);return this}get(t,n){if(t=Nf(t),t){const r=xe.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return IW(s);if(xe.isFunction(n))return n.call(this,s,r);if(xe.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Nf(t),t){const r=xe.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||vb(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function i(c){if(c=Nf(c),c){const u=xe.findKey(r,c);u&&(!n||vb(r,r[u],u,n))&&(delete r[u],s=!0)}}return xe.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||vb(this,this[i],i,t,!0))&&(delete this[i],s=!0)}return s}normalize(t){const n=this,r={};return xe.forEach(this,(s,i)=>{const c=xe.findKey(r,i);if(c){n[c]=xg(s),delete n[i];return}const u=t?kW(i):String(i).trim();u!==i&&delete n[i],n[u]=xg(s),r[u]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return xe.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&xe.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(`
|
|
612
|
+
`)}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[E_]=this[E_]={accessors:{}}).accessors,s=this.prototype;function i(c){const u=Nf(c);r[u]||(LW(s,c),r[u]=!0)}return xe.isArray(t)?t.forEach(i):i(t),this}};Oa.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);xe.reduceDescriptors(Oa.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});xe.freezeMethods(Oa);function bb(e,t){const n=this||Wh,r=t||n,s=Oa.from(r.headers);let i=r.data;return xe.forEach(e,function(u){i=u.call(n,i,s.normalize(),t?t.status:void 0)}),s.normalize(),i}function nO(e){return!!(e&&e.__CANCEL__)}function jd(e,t,n){Lt.call(this,e??"canceled",Lt.ERR_CANCELED,t,n),this.name="CanceledError"}xe.inherits(jd,Lt,{__CANCEL__:!0});function rO(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new Lt("Request failed with status code "+n.status,[Lt.ERR_BAD_REQUEST,Lt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function PW(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function UW(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(),x=r[i];c||(c=m),n[s]=f,r[s]=m;let g=i,y=0;for(;g!==s;)y+=n[g++],g=g%e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),m-c<t)return;const v=x&&m-x;return v?Math.round(y*1e3/v):void 0}}function zW(e,t){let n=0,r=1e3/t,s,i;const c=(m,x=Date.now())=>{n=x,s=null,i&&(clearTimeout(i),i=null),e(...m)};return[(...m)=>{const x=Date.now(),g=x-n;g>=r?c(m,x):(s=m,i||(i=setTimeout(()=>{i=null,c(s)},r-g)))},()=>s&&c(s)]}const Ug=(e,t,n=3)=>{let r=0;const s=UW(50,250);return zW(i=>{const c=i.loaded,u=i.lengthComputable?i.total:void 0,f=c-r,m=s(f),x=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&&x?(u-c)/m:void 0,event:i,lengthComputable:u!=null,[t?"download":"upload"]:!0};e(g)},n)},w_=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},R_=e=>(...t)=>xe.asap(()=>e(...t)),FW=na.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,na.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(na.origin),na.navigator&&/(msie|trident)/i.test(na.navigator.userAgent)):()=>!0,HW=na.hasStandardBrowserEnv?{write(e,t,n,r,s,i,c){if(typeof document>"u")return;const u=[`${e}=${encodeURIComponent(t)}`];xe.isNumber(n)&&u.push(`expires=${new Date(n).toUTCString()}`),xe.isString(r)&&u.push(`path=${r}`),xe.isString(s)&&u.push(`domain=${s}`),i===!0&&u.push("secure"),xe.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 $W(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function VW(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function aO(e,t,n){let r=!$W(t);return e&&(r||n==!1)?VW(e,t):t}const j_=e=>e instanceof Oa?{...e}:e;function Rc(e,t){t=t||{};const n={};function r(m,x,g,y){return xe.isPlainObject(m)&&xe.isPlainObject(x)?xe.merge.call({caseless:y},m,x):xe.isPlainObject(x)?xe.merge({},x):xe.isArray(x)?x.slice():x}function s(m,x,g,y){if(xe.isUndefined(x)){if(!xe.isUndefined(m))return r(void 0,m,g,y)}else return r(m,x,g,y)}function i(m,x){if(!xe.isUndefined(x))return r(void 0,x)}function c(m,x){if(xe.isUndefined(x)){if(!xe.isUndefined(m))return r(void 0,m)}else return r(void 0,x)}function u(m,x,g){if(g in t)return r(m,x);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,x,g)=>s(j_(m),j_(x),g,!0)};return xe.forEach(Object.keys({...e,...t}),function(x){const g=f[x]||s,y=g(e[x],t[x],x);xe.isUndefined(y)&&g!==u||(n[x]=y)}),n}const sO=e=>{const t=Rc({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:i,headers:c,auth:u}=t;if(t.headers=c=Oa.from(c),t.url=JD(aO(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),u&&c.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):""))),xe.isFormData(n)){if(na.hasStandardBrowserEnv||na.hasStandardBrowserWebWorkerEnv)c.setContentType(void 0);else if(xe.isFunction(n.getHeaders)){const f=n.getHeaders(),m=["content-type","content-length"];Object.entries(f).forEach(([x,g])=>{m.includes(x.toLowerCase())&&c.set(x,g)})}}if(na.hasStandardBrowserEnv&&(r&&xe.isFunction(r)&&(r=r(t)),r||r!==!1&&FW(t.url))){const f=s&&i&&HW.read(i);f&&c.set(s,f)}return t},GW=typeof XMLHttpRequest<"u",BW=GW&&function(e){return new Promise(function(n,r){const s=sO(e);let i=s.data;const c=Oa.from(s.headers).normalize();let{responseType:u,onUploadProgress:f,onDownloadProgress:m}=s,x,g,y,v,C;function S(){v&&v(),C&&C(),s.cancelToken&&s.cancelToken.unsubscribe(x),s.signal&&s.signal.removeEventListener("abort",x)}let E=new XMLHttpRequest;E.open(s.method.toUpperCase(),s.url,!0),E.timeout=s.timeout;function j(){if(!E)return;const T=Oa.from("getAllResponseHeaders"in E&&E.getAllResponseHeaders()),A={data:!u||u==="text"||u==="json"?E.responseText:E.response,status:E.status,statusText:E.statusText,headers:T,config:e,request:E};rO(function(_){n(_),S()},function(_){r(_),S()},A),E=null}"onloadend"in E?E.onloadend=j:E.onreadystatechange=function(){!E||E.readyState!==4||E.status===0&&!(E.responseURL&&E.responseURL.indexOf("file:")===0)||setTimeout(j)},E.onabort=function(){E&&(r(new Lt("Request aborted",Lt.ECONNABORTED,e,E)),E=null)},E.onerror=function(N){const A=N&&N.message?N.message:"Network Error",I=new Lt(A,Lt.ERR_NETWORK,e,E);I.event=N||null,r(I),E=null},E.ontimeout=function(){let N=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const A=s.transitional||eO;s.timeoutErrorMessage&&(N=s.timeoutErrorMessage),r(new Lt(N,A.clarifyTimeoutError?Lt.ETIMEDOUT:Lt.ECONNABORTED,e,E)),E=null},i===void 0&&c.setContentType(null),"setRequestHeader"in E&&xe.forEach(c.toJSON(),function(N,A){E.setRequestHeader(A,N)}),xe.isUndefined(s.withCredentials)||(E.withCredentials=!!s.withCredentials),u&&u!=="json"&&(E.responseType=s.responseType),m&&([y,C]=Ug(m,!0),E.addEventListener("progress",y)),f&&E.upload&&([g,v]=Ug(f),E.upload.addEventListener("progress",g),E.upload.addEventListener("loadend",v)),(s.cancelToken||s.signal)&&(x=T=>{E&&(r(!T||T.type?new jd(null,e,E):T),E.abort(),E=null)},s.cancelToken&&s.cancelToken.subscribe(x),s.signal&&(s.signal.aborted?x():s.signal.addEventListener("abort",x)));const R=PW(s.url);if(R&&na.protocols.indexOf(R)===-1){r(new Lt("Unsupported protocol "+R+":",Lt.ERR_BAD_REQUEST,e));return}E.send(i||null)})},qW=(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 x=m instanceof Error?m:this.reason;r.abort(x instanceof Lt?x:new jd(x instanceof Error?x.message:x))}};let c=t&&setTimeout(()=>{c=null,i(new Lt(`timeout ${t} of ms exceeded`,Lt.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=()=>xe.asap(u),f}},KW=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},WW=async function*(e,t){for await(const n of ZW(e))yield*KW(n,t)},ZW=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()}},T_=(e,t,n,r)=>{const s=WW(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:x}=await s.next();if(m){u(),f.close();return}let g=x.byteLength;if(n){let y=i+=g;n(y)}f.enqueue(new Uint8Array(x))}catch(m){throw u(m),m}},cancel(f){return u(f),s.return()}},{highWaterMark:2})},__=64*1024,{isFunction:Bp}=xe,YW=(({Request:e,Response:t})=>({Request:e,Response:t}))(xe.global),{ReadableStream:N_,TextEncoder:A_}=xe.global,D_=(e,...t)=>{try{return!!e(...t)}catch{return!1}},XW=e=>{e=xe.merge.call({skipUndefined:!0},YW,e);const{fetch:t,Request:n,Response:r}=e,s=t?Bp(t):typeof fetch=="function",i=Bp(n),c=Bp(r);if(!s)return!1;const u=s&&Bp(N_),f=s&&(typeof A_=="function"?(C=>S=>C.encode(S))(new A_):async C=>new Uint8Array(await new n(C).arrayBuffer())),m=i&&u&&D_(()=>{let C=!1;const S=new n(na.origin,{body:new N_,method:"POST",get duplex(){return C=!0,"half"}}).headers.has("Content-Type");return C&&!S}),x=c&&u&&D_(()=>xe.isReadableStream(new r("").body)),g={stream:x&&(C=>C.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(C=>{!g[C]&&(g[C]=(S,E)=>{let j=S&&S[C];if(j)return j.call(S);throw new Lt(`Response type '${C}' is not supported`,Lt.ERR_NOT_SUPPORT,E)})});const y=async C=>{if(C==null)return 0;if(xe.isBlob(C))return C.size;if(xe.isSpecCompliantForm(C))return(await new n(na.origin,{method:"POST",body:C}).arrayBuffer()).byteLength;if(xe.isArrayBufferView(C)||xe.isArrayBuffer(C))return C.byteLength;if(xe.isURLSearchParams(C)&&(C=C+""),xe.isString(C))return(await f(C)).byteLength},v=async(C,S)=>{const E=xe.toFiniteNumber(C.getContentLength());return E??y(S)};return async C=>{let{url:S,method:E,data:j,signal:R,cancelToken:T,timeout:N,onDownloadProgress:A,onUploadProgress:I,responseType:_,headers:M,withCredentials:G="same-origin",fetchOptions:H}=sO(C),L=t||fetch;_=_?(_+"").toLowerCase():"text";let q=qW([R,T&&T.toAbortSignal()],N),W=null;const B=q&&q.unsubscribe&&(()=>{q.unsubscribe()});let V;try{if(I&&m&&E!=="get"&&E!=="head"&&(V=await v(M,j))!==0){let z=new n(S,{method:"POST",body:j,duplex:"half"}),$;if(xe.isFormData(j)&&($=z.headers.get("content-type"))&&M.setContentType($),z.body){const[P,K]=w_(V,Ug(R_(I)));j=T_(z.body,__,P,K)}}xe.isString(G)||(G=G?"include":"omit");const D=i&&"credentials"in n.prototype,F={...H,signal:q,method:E.toUpperCase(),headers:M.normalize().toJSON(),body:j,duplex:"half",credentials:D?G:void 0};W=i&&new n(S,F);let U=await(i?L(W,H):L(S,F));const ee=x&&(_==="stream"||_==="response");if(x&&(A||ee&&B)){const z={};["status","statusText","headers"].forEach(Y=>{z[Y]=U[Y]});const $=xe.toFiniteNumber(U.headers.get("content-length")),[P,K]=A&&w_($,Ug(R_(A),!0))||[];U=new r(T_(U.body,__,P,()=>{K&&K(),B&&B()}),z)}_=_||"text";let he=await g[xe.findKey(g,_)||"text"](U,C);return!ee&&B&&B(),await new Promise((z,$)=>{rO(z,$,{data:he,headers:Oa.from(U.headers),status:U.status,statusText:U.statusText,config:C,request:W})})}catch(D){throw B&&B(),D&&D.name==="TypeError"&&/Load failed|fetch/i.test(D.message)?Object.assign(new Lt("Network Error",Lt.ERR_NETWORK,C,W),{cause:D.cause||D}):Lt.from(D,D&&D.code,C,W)}}},QW=new Map,oO=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,x=QW;for(;u--;)f=i[u],m=x.get(f),m===void 0&&x.set(f,m=u?new Map:XW(t)),x=m;return m};oO();const _C={http:pW,xhr:BW,fetch:{get:oO}};xe.forEach(_C,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const O_=e=>`- ${e}`,JW=e=>xe.isFunction(e)||e===null||e===!1;function eZ(e,t){e=xe.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,!JW(r)&&(s=_C[(u=String(r)).toLowerCase()],s===void 0))throw new Lt(`Unknown adapter '${u}'`);if(s&&(xe.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 :
|
|
613
|
+
`+c.map(O_).join(`
|
|
614
|
+
`):" "+O_(c[0]):"as no adapter specified";throw new Lt("There is no suitable adapter to dispatch the request "+u,"ERR_NOT_SUPPORT")}return s}const iO={getAdapter:eZ,adapters:_C};function Sb(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new jd(null,e)}function I_(e){return Sb(e),e.headers=Oa.from(e.headers),e.data=bb.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),iO.getAdapter(e.adapter||Wh.adapter,e)(e).then(function(r){return Sb(e),r.data=bb.call(e,e.transformResponse,r),r.headers=Oa.from(r.headers),r},function(r){return nO(r)||(Sb(e),r&&r.response&&(r.response.data=bb.call(e,e.transformResponse,r.response),r.response.headers=Oa.from(r.response.headers))),Promise.reject(r)})}const lO="1.13.2",Yx={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Yx[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const M_={};Yx.transitional=function(t,n,r){function s(i,c){return"[Axios v"+lO+"] Transitional option '"+i+"'"+c+(r?". "+r:"")}return(i,c,u)=>{if(t===!1)throw new Lt(s(c," has been removed"+(n?" in "+n:"")),Lt.ERR_DEPRECATED);return n&&!M_[c]&&(M_[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}};Yx.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function tZ(e,t,n){if(typeof e!="object")throw new Lt("options must be an object",Lt.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 Lt("option "+i+" must be "+f,Lt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Lt("Unknown option "+i,Lt.ERR_BAD_OPTION)}}const yg={assertOptions:tZ,validators:Yx},lo=yg.validators;let yc=class{constructor(t){this.defaults=t||{},this.interceptors={request:new C_,response:new C_}}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+=`
|
|
615
|
+
`+i):r.stack=i}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Rc(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:i}=n;r!==void 0&&yg.assertOptions(r,{silentJSONParsing:lo.transitional(lo.boolean),forcedJSONParsing:lo.transitional(lo.boolean),clarifyTimeoutError:lo.transitional(lo.boolean)},!1),s!=null&&(xe.isFunction(s)?n.paramsSerializer={serialize:s}:yg.assertOptions(s,{encode:lo.function,serialize:lo.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),yg.assertOptions(n,{baseUrl:lo.spelling("baseURL"),withXsrfToken:lo.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let c=i&&xe.merge(i.common,i[n.method]);i&&xe.forEach(["delete","get","head","post","put","patch","common"],C=>{delete i[C]}),n.headers=Oa.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 x,g=0,y;if(!f){const C=[I_.bind(this),void 0];for(C.unshift(...u),C.push(...m),y=C.length,x=Promise.resolve(n);g<y;)x=x.then(C[g++],C[g++]);return x}y=u.length;let v=n;for(;g<y;){const C=u[g++],S=u[g++];try{v=C(v)}catch(E){S.call(this,E);break}}try{x=I_.call(this,v)}catch(C){return Promise.reject(C)}for(g=0,y=m.length;g<y;)x=x.then(m[g++],m[g++]);return x}getUri(t){t=Rc(this.defaults,t);const n=aO(t.baseURL,t.url,t.allowAbsoluteUrls);return JD(n,t.params,t.paramsSerializer)}};xe.forEach(["delete","get","head","options"],function(t){yc.prototype[t]=function(n,r){return this.request(Rc(r||{},{method:t,url:n,data:(r||{}).data}))}});xe.forEach(["post","put","patch"],function(t){function n(r){return function(i,c,u){return this.request(Rc(u||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:c}))}}yc.prototype[t]=n(),yc.prototype[t+"Form"]=n(!0)});let nZ=class cO{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 jd(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 cO(function(s){t=s}),cancel:t}}};function rZ(e){return function(n){return e.apply(null,n)}}function aZ(e){return xe.isObject(e)&&e.isAxiosError===!0}const I1={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(I1).forEach(([e,t])=>{I1[t]=e});function uO(e){const t=new yc(e),n=HD(yc.prototype.request,t);return xe.extend(n,yc.prototype,t,{allOwnKeys:!0}),xe.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return uO(Rc(e,s))},n}const sr=uO(Wh);sr.Axios=yc;sr.CanceledError=jd;sr.CancelToken=nZ;sr.isCancel=nO;sr.VERSION=lO;sr.toFormData=Zx;sr.AxiosError=Lt;sr.Cancel=sr.CanceledError;sr.all=function(t){return Promise.all(t)};sr.spread=rZ;sr.isAxiosError=aZ;sr.mergeConfig=Rc;sr.AxiosHeaders=Oa;sr.formToJSON=e=>tO(xe.isHTMLForm(e)?new FormData(e):e);sr.getAdapter=iO.getAdapter;sr.HttpStatusCode=I1;sr.default=sr;const{Axios:Cge,AxiosError:k_,CanceledError:Ege,isCancel:wge,CancelToken:Rge,VERSION:jge,all:Tge,Cancel:_ge,isAxiosError:Nge,spread:Age,toFormData:Dge,AxiosHeaders:sZ,HttpStatusCode:Oge,formToJSON:Ige,getAdapter:Mge,mergeConfig:kge}=sr;function oZ(e){return{id:e.userId,email:e.email,fullName:e.fullName,roles:e.roles,projectId:e.projectId,projectTitle:e.projectTitle,avatar:e.avatar}}function hc(e,t){return e!=null&&e.roles?e.roles.includes(t):!1}function Cb(e,t){return t.some(n=>hc(e,n))}function iZ(e,t){return t.every(n=>hc(e,n))}const ud={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 lZ(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 NC=sr.create({baseURL:"/",timeout:3e4,headers:{"Content-Type":"application/json",Accept:"application/json"},withCredentials:!0});function cZ(){const e=window.location.pathname+window.location.search,t=new URL(ud.SIGN_IN,window.location.origin);e.startsWith("/auth/")||t.searchParams.set("redirect",e),window.location.href=t.toString()}function uZ(){const e=new URL(ud.SIGN_OUT,window.location.origin);e.searchParams.set("redirect",ud.SIGN_IN),window.location.href=e.toString()}async function dZ(){try{return(await NC.post(ud.ACCESS_TOKEN,{})).data}catch(e){const t=lZ(e);throw new Error(t.message)}}async function fZ(e){const t=await NC.get(ud.API_USER,{headers:{"X-OWOX-Authorization":`Bearer ${e}`}});return oZ(t.data)}async function hZ(e){return(await NC.get(ud.API_PROJECTS,{headers:{"X-OWOX-Authorization":`Bearer ${e}`}})).data}const dO=h.createContext(null);class mZ{constructor(t,n){io(this,"getToken");io(this,"refreshFn");this.getToken=t,this.refreshFn=n}getAccessToken(){return this.getToken()}async refreshToken(){return await this.refreshFn()}}let AC=null;function pZ(e){AC=e}function DC(){return AC}function qp(){AC=null}const gZ=()=>{typeof window<"u"&&!window.dataLayer&&(window.dataLayer=[])},De=e=>{e.timestamp=e.timestamp??Date.now(),e.eventType=e.eventType??"app",OC(e)},xZ=e=>{De({event:"system_user_identified",eventType:"system",category:"UserSession",action:"Identified",...e})},yZ=()=>{De({event:"system_user_logged_out",eventType:"system",category:"UserSession",action:"Logout"})},OC=e=>{var t;if(typeof window<"u"){gZ();try{(t=window.dataLayer)==null||t.push(e)}catch(n){console.error("Failed to push data to dataLayer",n)}}};function vZ(e,t){switch(t.type){case"SET_LOADING":return{...e,status:ra.LOADING,error:void 0};case"SET_AUTHENTICATED":return{...e,status:ra.AUTHENTICATED,session:t.payload.session,error:void 0};case"SET_UNAUTHENTICATED":return{...e,status:ra.UNAUTHENTICATED,session:null,error:void 0};case"SET_USER":return{...e,user:t.payload.user};case"SET_ERROR":return{...e,status:ra.ERROR,error:t.payload};case"CLEAR_ERROR":return{...e,error:void 0};default:return e}}const bZ={status:ra.LOADING,session:null,user:null};function SZ({children:e}){var x;const[t,n]=h.useReducer(vZ,bZ);h.useEffect(()=>{var g;if((g=t.session)!=null&&g.accessToken){const y=new mZ(()=>{var v;return((v=t.session)==null?void 0:v.accessToken)??null},async()=>await s());pZ(y)}else qp()},[(x=t.session)==null?void 0:x.accessToken]);const r=h.useCallback(()=>{cZ()},[]);async function s(){try{const y=(await dZ()).accessToken;if(!y)throw new Error("Invalid token received");const v={accessToken:y},C=await fZ(y);return n({type:"SET_USER",payload:{user:C}}),n({type:"SET_AUTHENTICATED",payload:{session:v}}),y}catch(g){throw qp(),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),qp(),n({type:"SET_UNAUTHENTICATED"})}},[i,r]),u=h.useCallback(()=>{try{yZ()}finally{uZ()}},[]),f=h.useCallback(()=>{n({type:"CLEAR_ERROR"})},[]);h.useEffect(()=>{c()},[c]),h.useEffect(()=>{t.user&&(OC({projectId:t.user.projectId}),xZ({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),qp()}},[u]);const m={...t,signIn:r,signOut:u,refreshToken:i,clearError:f};return a.jsx(dO.Provider,{value:m,children:e})}function Ti(){const e=h.useContext(dO);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e}function fO(){const{status:e,session:t,user:n,error:r}=Ti();return{status:e,session:t,user:n,error:r,isLoading:e===ra.LOADING,isAuthenticated:e===ra.AUTHENTICATED,isUnauthenticated:e===ra.UNAUTHENTICATED,hasError:e===ra.ERROR}}function hO(){const{user:e}=Ti();return e}function CZ(){const e=hO();return h.useMemo(()=>({hasRole:n=>hc(e,n),hasAnyRole:n=>Cb(e,n),hasAllRoles:n=>iZ(e,n),isAdmin:hc(e,"admin"),canEdit:Cb(e,["admin","editor"]),canView:Cb(e,["admin","editor","viewer"]),roles:(e==null?void 0:e.roles)??[],highestRole:hc(e,"admin")?"admin":hc(e,"editor")?"editor":hc(e,"viewer")?"viewer":null}),[e])}function Qu({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 L_({message:e}){return a.jsx(Qu,{fullScreen:!0,message:e})}function P_(){return a.jsx("div",{className:"flex h-screen items-center justify-center",children:a.jsxs("div",{className:"text-center",children:[a.jsx("h2",{className:"mb-4 text-2xl font-bold text-gray-900",children:"Authentication Required"}),a.jsx("p",{className:"mb-6 text-gray-600",children:"You need to sign in to access this page."}),a.jsx(we,{onClick:()=>window.location.href="/api/auth/sign-in",children:"Sign In"})]})})}function EZ({children:e,fallback:t,redirectTo:n}){const{isLoading:r,isAuthenticated:s,isUnauthenticated:i}=fO();return r?a.jsx(L_,{}):s?a.jsx(a.Fragment,{children:e}):i?n?(window.location.href=n,a.jsx(L_,{})):t?a.jsx(a.Fragment,{children:t}):a.jsx(P_,{}):t?a.jsx(a.Fragment,{children:t}):a.jsx(P_,{})}const mO=h.createContext(null);function pO(){const e=h.useContext(mO);if(!e)throw new Error("useProjects must be used within a ProjectsProvider");return e}const wZ="/ui",RZ=()=>wZ,zg=(e,t)=>{const n=RZ(),r=t.startsWith("/")?t:`/${t}`;return`${n}/${e}${r}`};function jZ(){const{projects:e,loadProjects:t,error:n,isLoading:r}=pO(),{user:s}=Ti();return a.jsxs(Vx,{children:[a.jsx(ns,{}),a.jsxs(Gx,{className:"flex items-center gap-2",children:[a.jsx(CU,{className:"h-4 w-4"}),"Switch project"]}),a.jsx(jK,{children:a.jsxs(Bx,{children:[r&&a.jsx(Ut,{disabled:!0,children:a.jsxs("span",{className:"flex items-center gap-2",children:[a.jsx(Uc,{className:"h-4 w-4 animate-spin"})," Loading projects..."]})}),!r&&n&&a.jsxs(a.Fragment,{children:[a.jsx(Ut,{disabled:!0,children:"Unable to load projects. Please try again."}),a.jsx(Ut,{onClick:()=>void t(),children:"Retry"})]}),!r&&!n&&e.map(i=>{const c=i.id===(s==null?void 0:s.projectId);return a.jsx(Ut,{asChild:!0,children:a.jsxs(Th,{to:zg(encodeURIComponent(i.id),"/"),className:"flex items-center gap-2",children:[c?a.jsx(Ia,{className:"h-4 w-4"}):a.jsx("span",{className:"h-4 w-4"}),i.title]})},i.id)})]})})]})}function TZ(){return a.jsx(jZ,{})}const _Z=({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"})}),gO=({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"})]}),xO=({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"})]}),NZ=({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"})]}),AZ=({className:e,size:t=24})=>a.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,style:{minWidth:t,minHeight:t},children:[a.jsx("path",{d:"M23.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"})]}),DZ=({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"})]}),yO=({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"})]}),vO=({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"})}),bO=({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"})]}),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.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"})]})]})]}),Vc=({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}}),IZ=({className:e,size:t=24})=>a.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("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"})]}),MZ=({className:e,size:t=24})=>a.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("path",{d:"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"})]}),kZ=({className:e,size:t=24})=>a.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("rect",{fill:"currentColor",width:"3",height:"8",x:"13",y:"2",rx:"1.5"}),a.jsx("path",{fill:"currentColor",d:"M19 8.5V10h1.5A1.5 1.5 0 1 0 19 8.5"}),a.jsx("rect",{fill:"currentColor",width:"3",height:"8",x:"8",y:"14",rx:"1.5"}),a.jsx("path",{fill:"currentColor",d:"M5 15.5V14H3.5A1.5 1.5 0 1 0 5 15.5"}),a.jsx("rect",{fill:"currentColor",width:"8",height:"3",x:"14",y:"13",rx:"1.5"}),a.jsx("path",{fill:"currentColor",d:"M15.5 19H14v1.5a1.5 1.5 0 1 0 1.5-1.5"}),a.jsx("rect",{fill:"currentColor",width:"8",height:"3",x:"2",y:"8",rx:"1.5"}),a.jsx("path",{fill:"currentColor",d:"M8.5 5H10V3.5A1.5 1.5 0 1 0 8.5 5"})]}),LZ=({className:e,size:t=24})=>a.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",fill:"none",children:[a.jsx("path",{d:"M16 16H22",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"}),a.jsx("path",{d:"M19 13V19",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"}),a.jsx("path",{d:"M21 9.99795V7.99795C20.9996 7.64722 20.9071 7.30276 20.7315 6.99911C20.556 6.69546 20.3037 6.44331 20 6.26795L13 2.26795C12.696 2.09241 12.3511 2 12 2C11.6489 2 11.304 2.09241 11 2.26795L4 6.26795C3.69626 6.44331 3.44398 6.69546 3.26846 6.99911C3.09294 7.30276 3.00036 7.64722 3 7.99795V15.9979C3.00036 16.3487 3.09294 16.6931 3.26846 16.9968C3.44398 17.3004 3.69626 17.5526 4 17.7279L11 21.7279C11.304 21.9035 11.6489 21.9959 12 21.9959C12.3511 21.9959 12.696 21.9035 13 21.7279L15 20.5879",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"}),a.jsx("path",{d:"M3.28906 7L11.9991 12L20.7091 7",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"}),a.jsx("path",{d:"M12 22V12",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"})]}),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"})]}),UZ=({className:e,size:t=24})=>a.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",fill:"none",children:[a.jsx("rect",{x:"2",y:"2",width:"20",height:"20",fill:"white"}),a.jsx("path",{d:"M20.4491 20.4496H16.8931V14.8805C16.8931 13.5525 16.8694 11.8429 15.0436 11.8429C13.1915 11.8429 12.9081 13.2899 12.9081 14.7838V20.4492H9.35203V8.99689H12.7658V10.562H12.8136C13.1553 9.97782 13.649 9.49726 14.2421 9.17149C14.8352 8.84572 15.5056 8.68693 16.1819 8.71203C19.7861 8.71203 20.4506 11.0828 20.4506 14.167L20.4491 20.4496ZM5.33963 7.43144C4.93148 7.43151 4.53247 7.31055 4.19307 7.08385C3.85367 6.85715 3.58913 6.53489 3.43287 6.15783C3.27661 5.78077 3.23566 5.36584 3.31521 4.96551C3.39477 4.56517 3.59125 4.19743 3.8798 3.90876C4.16835 3.6201 4.53602 3.42348 4.93631 3.34378C5.3366 3.26408 5.75152 3.30488 6.12863 3.46101C6.50573 3.61713 6.82807 3.88158 7.05489 4.22091C7.2817 4.56025 7.40281 4.95922 7.40288 5.36738C7.40293 5.63839 7.34959 5.90675 7.24593 6.15715C7.14227 6.40754 6.99032 6.63507 6.79873 6.82674C6.60714 7.0184 6.37966 7.17045 6.1293 7.27421C5.87895 7.37796 5.61062 7.43139 5.33963 7.43144ZM7.11765 20.4496H3.5579V8.99689H7.11765V20.4496ZM22.222 0.00163516H1.77099C1.30681 -0.00360329 0.859518 0.175663 0.52744 0.500042C0.195362 0.824421 0.00566506 1.26737 0 1.73156V22.2681C0.00547117 22.7325 0.195057 23.1758 0.527123 23.5005C0.85919 23.8252 1.30658 24.0048 1.77099 23.9999H22.222C22.6873 24.0057 23.1359 23.8266 23.4693 23.5019C23.8027 23.1772 23.9936 22.7334 24 22.2681V1.73008C23.9934 1.26497 23.8024 0.821515 23.469 0.497144C23.1356 0.172773 22.6871 -0.00598143 22.222 0.000152822",fill:"#0A66C2"})]}),zZ=({className:e,size:t=24})=>a.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",fill:"none",children:[a.jsx("path",{d:"M2.4 0H21.6C22.9256 0 24 1.07443 24 2.4V21.6C24 22.9256 22.9256 24 21.6 24H2.4C1.07443 24 0 22.9256 0 21.6V2.4C0 1.07443 1.07443 0 2.4 0Z",fill:"#010101"}),a.jsx("path",{d:"M16.0971 9.46492C17.3375 10.3511 18.8571 10.8725 20.4981 10.8725V7.71605C20.1875 7.71617 19.8778 7.68377 19.5739 7.61937V10.104C17.9329 10.104 16.4136 9.58256 15.1729 8.69639V15.1378C15.1729 18.3601 12.5594 20.9721 9.33558 20.9721C8.13276 20.9721 7.01472 20.6087 6.08594 19.9853C7.14596 21.0686 8.62418 21.7407 10.2596 21.7407C13.4836 21.7407 16.0972 19.1286 16.0972 15.9062V9.46492H16.0971ZM17.2373 6.28044C16.6034 5.5883 16.1872 4.69375 16.0971 3.70479V3.29883H15.2213C15.4417 4.55571 16.1937 5.62956 17.2373 6.28044ZM8.12494 17.5127C7.77082 17.0486 7.5794 16.4808 7.58026 15.897C7.58026 14.4232 8.77571 13.2283 10.2505 13.2283C10.5254 13.2281 10.7986 13.2703 11.0605 13.3533V10.1263C10.7544 10.0844 10.4455 10.0666 10.1366 10.0732V12.5849C9.87454 12.5019 9.60122 12.4597 9.32629 12.4599C7.85147 12.4599 6.65612 13.6548 6.65612 15.1287C6.65612 16.1708 7.25362 17.0732 8.12494 17.5127Z",fill:"#EE1D52"}),a.jsx("path",{d:"M15.1726 8.69639C16.4133 9.58256 17.9326 10.104 19.5736 10.104V7.61937C18.6576 7.42444 17.8467 6.94594 17.237 6.28044C16.1934 5.62956 15.4414 4.55571 15.221 3.29883H12.9204V15.9061C12.9152 17.3758 11.7218 18.5658 10.2501 18.5658C9.38288 18.5658 8.61243 18.1527 8.12452 17.5127C7.2532 17.0732 6.6557 16.1708 6.6557 15.1287C6.6557 13.6548 7.85104 12.4599 9.32587 12.4599C9.60841 12.4599 9.88075 12.5039 10.1362 12.5849V10.0732C6.96907 10.1386 4.42188 12.7251 4.42188 15.9062C4.42188 17.4941 5.05621 18.9337 6.08563 19.9854C7.01441 20.6088 8.13245 20.9722 9.33528 20.9722C12.5591 20.9722 15.1726 18.3601 15.1726 15.1379V8.69639Z",fill:"white"}),a.jsx("path",{d:"M19.5758 7.6202V6.94836C18.7498 6.9496 17.9401 6.71839 17.2392 6.28116C17.8596 6.96001 18.6765 7.42815 19.5758 7.6202ZM15.2232 3.29966C15.2022 3.17955 15.186 3.05864 15.1748 2.93721V2.53125H11.9983V15.1386C11.9932 16.6082 10.7999 17.7982 9.32812 17.7982C8.89598 17.7982 8.48809 17.6958 8.12678 17.5135C8.61468 18.1535 9.38513 18.5666 10.2524 18.5666C11.7239 18.5666 12.9174 17.3766 12.9226 15.9069V3.29966H15.2232ZM10.1386 10.074V9.35876C9.87315 9.32247 9.60555 9.30433 9.33764 9.30447C6.1135 9.30447 3.5 11.9166 3.5 15.1386C3.5 17.1587 4.52715 18.9389 6.088 19.9862C5.05858 18.9344 4.42424 17.4948 4.42424 15.9069C4.42424 12.7259 6.97133 10.1394 10.1386 10.074Z",fill:"#69C9D0"})]}),FZ=({className:e,size:t=24})=>a.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",fill:"none",children:[a.jsx("path",{d:"M2 2H11.5V11.5H2V2Z",fill:"#F25022"}),a.jsx("path",{d:"M12.5 2H22V11.5H12.5V2Z",fill:"#7FBA00"}),a.jsx("path",{d:"M2 12.5H11.5V22H2V12.5Z",fill:"#00A4EF"}),a.jsx("path",{d:"M12.5 12.5H22V22H12.5V12.5Z",fill:"#FFB900"})]}),HZ=({className:e,size:t=24})=>a.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",children:[a.jsxs("g",{"clip-path":"url(#clip0_377_3451)",children:[a.jsx("path",{d:"M16.4954 9.25H22.6042C23.1814 9.25 23.6492 9.71786 23.6492 10.295V15.8593C23.6492 17.9805 21.9297 19.7 19.8086 19.7H19.7904C17.6693 19.7003 15.9495 17.981 15.9492 15.8599C15.9492 15.8597 15.9492 15.8595 15.9492 15.8593V9.79616C15.9492 9.49452 16.1937 9.25 16.4954 9.25Z",fill:"#5059C9"}),a.jsx("path",{d:"M20.6234 8.14922C21.9903 8.14922 23.0984 7.04112 23.0984 5.67422C23.0984 4.30731 21.9903 3.19922 20.6234 3.19922C19.2565 3.19922 18.1484 4.30731 18.1484 5.67422C18.1484 7.04112 19.2565 8.14922 20.6234 8.14922Z",fill:"#5059C9"}),a.jsx("path",{d:"M12.9266 8.15001C14.901 8.15001 16.5016 6.54942 16.5016 4.575C16.5016 2.60058 14.901 1 12.9266 1C10.9521 1 9.35156 2.60058 9.35156 4.575C9.35156 6.54942 10.9521 8.15001 12.9266 8.15001Z",fill:"#7B83EB"}),a.jsx("path",{d:"M17.6912 9.25H7.60751C7.03725 9.26411 6.58614 9.73737 6.59937 10.3077V16.6541C6.51973 20.0763 9.22724 22.9163 12.6494 23C16.0715 22.9163 18.779 20.0763 18.6994 16.6541V10.3077C18.7126 9.73737 18.2615 9.26411 17.6912 9.25Z",fill:"#7B83EB"}),a.jsx("path",{opacity:"0.1",d:"M13.2019 9.25V18.1435C13.1991 18.5513 12.952 18.9177 12.5749 19.073C12.4548 19.1238 12.3257 19.15 12.1954 19.15H7.08585C7.01436 18.9685 6.94836 18.787 6.89335 18.6C6.70082 17.9689 6.60259 17.3128 6.60185 16.653V10.306C6.58863 9.73663 7.039 9.26411 7.60835 9.25H13.2019Z",fill:"black"}),a.jsx("path",{opacity:"0.2",d:"M12.6519 9.25V18.6935C12.6518 18.8239 12.6257 18.9529 12.5749 19.073C12.4196 19.4501 12.0532 19.6973 11.6454 19.7H7.34436C7.25085 19.5185 7.16286 19.337 7.08585 19.15C7.00885 18.963 6.94836 18.787 6.89335 18.6C6.70082 17.9689 6.60259 17.3128 6.60185 16.653V10.306C6.58863 9.73663 7.039 9.26411 7.60835 9.25H12.6519Z",fill:"black"}),a.jsx("path",{opacity:"0.2",d:"M12.6519 9.25V17.5935C12.6477 18.1476 12.1995 18.5958 11.6454 18.6H6.89335C6.70082 17.9689 6.60259 17.3128 6.60185 16.653V10.306C6.58863 9.73663 7.039 9.26411 7.60835 9.25H12.6519Z",fill:"black"}),a.jsx("path",{opacity:"0.2",d:"M12.1018 9.25V17.5935C12.0977 18.1476 11.6495 18.5958 11.0953 18.6H6.89335C6.70082 17.9689 6.60259 17.3128 6.60185 16.653V10.306C6.58863 9.73663 7.039 9.26411 7.60835 9.25H12.1018Z",fill:"black"}),a.jsx("path",{opacity:"0.1",d:"M13.2002 6.40688V8.13938C13.1067 8.14488 13.0187 8.15038 12.9252 8.15038C12.8317 8.15038 12.7437 8.14489 12.6502 8.13938C12.4646 8.12706 12.2805 8.09761 12.1002 8.05138C10.9865 7.78763 10.0663 7.00654 9.62522 5.95039C9.54932 5.77303 9.4904 5.58886 9.44922 5.40039H12.1937C12.7487 5.40249 13.1981 5.85188 13.2002 6.40688Z",fill:"black"}),a.jsx("path",{opacity:"0.2",d:"M12.65 6.95571V8.13821C12.4643 8.12589 12.2802 8.09644 12.1 8.05022C10.9862 7.78646 10.0661 7.00537 9.625 5.94922H11.6435C12.1985 5.95132 12.6479 6.40071 12.65 6.95571Z",fill:"black"}),a.jsx("path",{opacity:"0.2",d:"M12.65 6.95571V8.13821C12.4643 8.12589 12.2802 8.09644 12.1 8.05022C10.9862 7.78646 10.0661 7.00537 9.625 5.94922H11.6435C12.1985 5.95132 12.6479 6.40071 12.65 6.95571Z",fill:"black"}),a.jsx("path",{opacity:"0.2",d:"M12.1 6.95572V8.05022C10.9862 7.78646 10.0661 7.00537 9.625 5.94922H11.0935C11.6485 5.95133 12.0979 6.40072 12.1 6.95572Z",fill:"black"}),a.jsx("path",{d:"M1.00814 5.94922H11.0918C11.6486 5.94922 12.1 6.40059 12.1 6.95736V17.0411C12.1 17.5978 11.6486 18.0492 11.0918 18.0492H1.00814C0.451357 18.0492 0 17.5978 0 17.0411V6.95736C0 6.40059 0.451368 5.94922 1.00814 5.94922Z",fill:"url(#paint0_linear_377_3451)"}),a.jsx("path",{d:"M8.70484 9.78745H6.68908V15.2765H5.40484V9.78745H3.39844V8.72266H8.70484V9.78745Z",fill:"white"})]}),a.jsxs("defs",{children:[a.jsxs("linearGradient",{id:"paint0_linear_377_3451",x1:"2.10202",y1:"5.16147",x2:"9.99799",y2:"18.837",gradientUnits:"userSpaceOnUse",children:[a.jsx("stop",{"stop-color":"#5A62C3"}),a.jsx("stop",{offset:"0.5","stop-color":"#4D55BD"}),a.jsx("stop",{offset:"1","stop-color":"#3940AB"})]}),a.jsx("clipPath",{id:"clip0_377_3451",children:a.jsx("rect",{width:"23.65",height:"22",fill:"white",transform:"translate(0 1)"})})]})]}),$Z=({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"})]}),VZ=({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 Mo({className:e,...t}){return a.jsx("textarea",{"data-slot":"textarea",className:oe("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...t})}function SO({value:e,onChange:t,keysToMask:n=[],className:r,minHeightClass:s="min-h-[150px]",displayOnly:i=!1,showCopyButton:c=!1}){const u=(E,j)=>{if(!E||j.length===0)return!1;try{const R=JSON.parse(E),T=N=>typeof N!="object"||N===null?!1:Array.isArray(N)?N.some(A=>typeof A=="object"&&A!==null&&T(A)):Object.keys(N).some(A=>j.includes(A)||typeof N[A]=="object"&&N[A]!==null&&T(N[A]));return T(R)}catch{return!1}},f=i?!1:!e||n.length===0||!u(e,n),[m,x]=h.useState(f),[g,y]=h.useState(!1);h.useEffect(()=>{i?x(!1):(!e||n.length===0||!u(e,n))&&x(!0)},[e,n,i]),h.useEffect(()=>{if(g){const E=setTimeout(()=>{y(!1)},2e3);return()=>{clearTimeout(E)}}},[g]);const v=()=>{navigator.clipboard.writeText(e),y(!0)},C=E=>{if(!E)return"";try{const j=JSON.parse(E),R=A=>{if(typeof A!="object"||A===null)return A;const I=Array.isArray(A)?[...A]:{...A};return Array.isArray(I)?I.forEach((_,M)=>{typeof _=="object"&&_!==null&&(I[M]=R(_))}):Object.entries(I).forEach(([_,M])=>{if(n.includes(_))if(typeof M=="string"){const G=M.length;G>30?I[_]="*".repeat(Math.min(20,Math.ceil(G/3))):G>10?I[_]="*".repeat(Math.min(10,Math.ceil(G/2))):I[_]="*".repeat(G)}else I[_]="***";else typeof M=="object"&&M!==null&&(I[_]=R(M))}),I},N=R(typeof j=="object"?j:{});return JSON.stringify(N,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(ga,{children:a.jsxs(rt,{children:[a.jsx(at,{asChild:!0,children:a.jsx("div",{className:"absolute top-2 left-2 z-10",children:a.jsx(Zz,{className:"h-4 w-4 text-gray-500"})})}),a.jsx(st,{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(Mo,{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(we,{type:"button",variant:"ghost",className:"absolute top-2 right-2",onClick:()=>{x(!m)},children:m?a.jsx(ga,{children:a.jsxs(rt,{children:[a.jsx(at,{asChild:!0,children:a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(mz,{className:"h-4 w-4"}),a.jsx("span",{className:"text-xs",children:"Mask & Lock"})]})}),a.jsx(st,{children:a.jsx("p",{children:"Mask sensitive data and lock editing"})})]})}):a.jsx(ga,{children:a.jsxs(rt,{children:[a.jsx(at,{asChild:!0,children:a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(p4,{className:"h-4 w-4"}),a.jsx("span",{className:"text-xs",children:"Show & Edit"})]})}),a.jsx(st,{children:a.jsx("p",{children:"Show sensitive data and enable editing"})})]})})}),c&&a.jsx(we,{type:"button",variant:"ghost",className:`absolute ${S&&!i?"top-2 right-24":"top-2 right-2"}`,onClick:v,children:a.jsx(ga,{children:a.jsxs(rt,{children:[a.jsx(at,{asChild:!0,children:a.jsx("div",{className:"flex items-center gap-1",children:g?a.jsxs(a.Fragment,{children:[a.jsx(Ia,{className:"h-4 w-4"}),a.jsx("span",{className:"text-xs",children:"Copied!"})]}):a.jsxs(a.Fragment,{children:[a.jsx(od,{className:"h-4 w-4"}),a.jsx("span",{className:"text-xs",children:"Copy"})]})})}),a.jsx(st,{children:a.jsx("p",{children:"Copy content to clipboard"})})]})})})]})}var pn;(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})(pn||(pn={}));var U_;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(U_||(U_={}));const qe=pn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),rl=e=>{switch(typeof e){case"undefined":return qe.undefined;case"string":return qe.string;case"number":return Number.isNaN(e)?qe.nan:qe.number;case"boolean":return qe.boolean;case"function":return qe.function;case"bigint":return qe.bigint;case"symbol":return qe.symbol;case"object":return Array.isArray(e)?qe.array:e===null?qe.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?qe.promise:typeof Map<"u"&&e instanceof Map?qe.map:typeof Set<"u"&&e instanceof Set?qe.set:typeof Date<"u"&&e instanceof Date?qe.date:qe.object;default:return qe.unknown}},Ae=pn.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 Si 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 Si))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,pn.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()}}Si.create=e=>new Si(e);const M1=(e,t)=>{let n;switch(e.code){case Ae.invalid_type:e.received===qe.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case Ae.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,pn.jsonStringifyReplacer)}`;break;case Ae.unrecognized_keys:n=`Unrecognized key(s) in object: ${pn.joinValues(e.keys,", ")}`;break;case Ae.invalid_union:n="Invalid input";break;case Ae.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${pn.joinValues(e.options)}`;break;case Ae.invalid_enum_value:n=`Invalid enum value. Expected ${pn.joinValues(e.options)}, received '${e.received}'`;break;case Ae.invalid_arguments:n="Invalid function arguments";break;case Ae.invalid_return_type:n="Invalid function return type";break;case Ae.invalid_date:n="Invalid date";break;case Ae.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}"`:pn.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case Ae.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 Ae.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 Ae.custom:n="Invalid input";break;case Ae.invalid_intersection_types:n="Intersection results could not be merged";break;case Ae.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Ae.not_finite:n="Number must be finite";break;default:n=t.defaultError,pn.assertNever(e)}return{message:n}};let GZ=M1;function BZ(){return GZ}const qZ=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 Fe(e,t){const n=BZ(),r=qZ({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===M1?void 0:M1].filter(s=>!!s)});e.common.issues.push(r)}class va{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 St;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 va.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 St;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 St=Object.freeze({status:"aborted"}),Hf=e=>({status:"dirty",value:e}),Ts=e=>({status:"valid",value:e}),z_=e=>e.status==="aborted",F_=e=>e.status==="dirty",dd=e=>e.status==="valid",Fg=e=>typeof Promise<"u"&&e instanceof Promise;var et;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(et||(et={}));class No{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 H_=(e,t)=>{if(dd(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 Si(e.common.issues);return this._error=n,this._error}}};function zt(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 tn{get description(){return this._def.description}_getType(t){return rl(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:rl(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new va,ctx:{common:t.parent.common,data:t.data,parsedType:rl(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(Fg(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:rl(t)},s=this._parseSync({data:t,path:r.path,parent:r});return H_(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:rl(t)};if(!this["~standard"].async)try{const i=this._parseSync({data:t,path:[],parent:n});return dd(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=>dd(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:rl(t)},s=this._parse({data:t,path:r.path,parent:r}),i=await(Fg(s)?s:Promise.resolve(s));return H_(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:Ae.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 _c({schema:this,typeName:Et.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 pi.create(this,this._def)}nullable(){return Nc.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Co.create(this)}promise(){return Wg.create(this,this._def)}or(t){return Vg.create([this,t],this._def)}and(t){return Gg.create(this,t,this._def)}transform(t){return new _c({...zt(this._def),schema:this,typeName:Et.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new Zg({...zt(this._def),innerType:this,defaultValue:n,typeName:Et.ZodDefault})}brand(){return new RO({typeName:Et.ZodBranded,type:this,...zt(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new Yg({...zt(this._def),innerType:this,catchValue:n,typeName:Et.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return MC.create(this,t)}readonly(){return Xg.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const KZ=/^c[^\s-]{8,}$/i,WZ=/^[0-9a-z]+$/,ZZ=/^[0-9A-HJKMNP-TV-Z]{26}$/i,YZ=/^[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,XZ=/^[a-z0-9_-]{21}$/i,QZ=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,JZ=/^[-+]?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)?)??$/,eY=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,tY="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Eb;const nY=/^(?:(?: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])$/,rY=/^(?:(?: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])$/,aY=/^(([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]))$/,sY=/^(([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])$/,oY=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,iY=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,CO="((\\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])))",lY=new RegExp(`^${CO}$`);function EO(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 cY(e){return new RegExp(`^${EO(e)}$`)}function uY(e){let t=`${CO}T${EO(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 dY(e,t){return!!((t==="v4"||!t)&&nY.test(e)||(t==="v6"||!t)&&aY.test(e))}function fY(e,t){if(!QZ.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 hY(e,t){return!!((t==="v4"||!t)&&rY.test(e)||(t==="v6"||!t)&&sY.test(e))}class di extends tn{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==qe.string){const i=this._getOrReturnCtx(t);return Fe(i,{code:Ae.invalid_type,expected:qe.string,received:i.parsedType}),St}const r=new va;let s;for(const i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(s=this._getOrReturnCtx(t,s),Fe(s,{code:Ae.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),Fe(s,{code:Ae.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?Fe(s,{code:Ae.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):u&&Fe(s,{code:Ae.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")eY.test(t.data)||(s=this._getOrReturnCtx(t,s),Fe(s,{validation:"email",code:Ae.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")Eb||(Eb=new RegExp(tY,"u")),Eb.test(t.data)||(s=this._getOrReturnCtx(t,s),Fe(s,{validation:"emoji",code:Ae.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")YZ.test(t.data)||(s=this._getOrReturnCtx(t,s),Fe(s,{validation:"uuid",code:Ae.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")XZ.test(t.data)||(s=this._getOrReturnCtx(t,s),Fe(s,{validation:"nanoid",code:Ae.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")KZ.test(t.data)||(s=this._getOrReturnCtx(t,s),Fe(s,{validation:"cuid",code:Ae.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")WZ.test(t.data)||(s=this._getOrReturnCtx(t,s),Fe(s,{validation:"cuid2",code:Ae.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")ZZ.test(t.data)||(s=this._getOrReturnCtx(t,s),Fe(s,{validation:"ulid",code:Ae.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{s=this._getOrReturnCtx(t,s),Fe(s,{validation:"url",code:Ae.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),Fe(s,{validation:"regex",code:Ae.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),Fe(s,{code:Ae.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),Fe(s,{code:Ae.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(s=this._getOrReturnCtx(t,s),Fe(s,{code:Ae.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?uY(i).test(t.data)||(s=this._getOrReturnCtx(t,s),Fe(s,{code:Ae.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?lY.test(t.data)||(s=this._getOrReturnCtx(t,s),Fe(s,{code:Ae.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?cY(i).test(t.data)||(s=this._getOrReturnCtx(t,s),Fe(s,{code:Ae.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?JZ.test(t.data)||(s=this._getOrReturnCtx(t,s),Fe(s,{validation:"duration",code:Ae.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?dY(t.data,i.version)||(s=this._getOrReturnCtx(t,s),Fe(s,{validation:"ip",code:Ae.invalid_string,message:i.message}),r.dirty()):i.kind==="jwt"?fY(t.data,i.alg)||(s=this._getOrReturnCtx(t,s),Fe(s,{validation:"jwt",code:Ae.invalid_string,message:i.message}),r.dirty()):i.kind==="cidr"?hY(t.data,i.version)||(s=this._getOrReturnCtx(t,s),Fe(s,{validation:"cidr",code:Ae.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?oY.test(t.data)||(s=this._getOrReturnCtx(t,s),Fe(s,{validation:"base64",code:Ae.invalid_string,message:i.message}),r.dirty()):i.kind==="base64url"?iY.test(t.data)||(s=this._getOrReturnCtx(t,s),Fe(s,{validation:"base64url",code:Ae.invalid_string,message:i.message}),r.dirty()):pn.assertNever(i);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(s=>t.test(s),{validation:n,code:Ae.invalid_string,...et.errToObj(r)})}_addCheck(t){return new di({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...et.errToObj(t)})}url(t){return this._addCheck({kind:"url",...et.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...et.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...et.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...et.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...et.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...et.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...et.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...et.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...et.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...et.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...et.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...et.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,...et.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,...et.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...et.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...et.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...et.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...et.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...et.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...et.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...et.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...et.errToObj(n)})}nonempty(t){return this.min(1,et.errToObj(t))}trim(){return new di({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new di({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new di({...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}}di.create=e=>new di({checks:[],typeName:Et.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...zt(e)});function mY(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 fd extends tn{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)!==qe.number){const i=this._getOrReturnCtx(t);return Fe(i,{code:Ae.invalid_type,expected:qe.number,received:i.parsedType}),St}let r;const s=new va;for(const i of this._def.checks)i.kind==="int"?pn.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),Fe(r,{code:Ae.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),Fe(r,{code:Ae.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),Fe(r,{code:Ae.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?mY(t.data,i.value)!==0&&(r=this._getOrReturnCtx(t,r),Fe(r,{code:Ae.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),Fe(r,{code:Ae.not_finite,message:i.message}),s.dirty()):pn.assertNever(i);return{status:s.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,et.toString(n))}gt(t,n){return this.setLimit("min",t,!1,et.toString(n))}lte(t,n){return this.setLimit("max",t,!0,et.toString(n))}lt(t,n){return this.setLimit("max",t,!1,et.toString(n))}setLimit(t,n,r,s){return new fd({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:et.toString(s)}]})}_addCheck(t){return new fd({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:et.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:et.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:et.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:et.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:et.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:et.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:et.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:et.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:et.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"&&pn.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)}}fd.create=e=>new fd({checks:[],typeName:Et.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...zt(e)});class fh extends tn{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)!==qe.bigint)return this._getInvalidInput(t);let r;const s=new va;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),Fe(r,{code:Ae.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),Fe(r,{code:Ae.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),Fe(r,{code:Ae.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):pn.assertNever(i);return{status:s.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return Fe(n,{code:Ae.invalid_type,expected:qe.bigint,received:n.parsedType}),St}gte(t,n){return this.setLimit("min",t,!0,et.toString(n))}gt(t,n){return this.setLimit("min",t,!1,et.toString(n))}lte(t,n){return this.setLimit("max",t,!0,et.toString(n))}lt(t,n){return this.setLimit("max",t,!1,et.toString(n))}setLimit(t,n,r,s){return new fh({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:et.toString(s)}]})}_addCheck(t){return new fh({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:et.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:et.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:et.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:et.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:et.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}}fh.create=e=>new fh({checks:[],typeName:Et.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...zt(e)});class k1 extends tn{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==qe.boolean){const r=this._getOrReturnCtx(t);return Fe(r,{code:Ae.invalid_type,expected:qe.boolean,received:r.parsedType}),St}return Ts(t.data)}}k1.create=e=>new k1({typeName:Et.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...zt(e)});class Hg extends tn{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==qe.date){const i=this._getOrReturnCtx(t);return Fe(i,{code:Ae.invalid_type,expected:qe.date,received:i.parsedType}),St}if(Number.isNaN(t.data.getTime())){const i=this._getOrReturnCtx(t);return Fe(i,{code:Ae.invalid_date}),St}const r=new va;let s;for(const i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(s=this._getOrReturnCtx(t,s),Fe(s,{code:Ae.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),Fe(s,{code:Ae.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):pn.assertNever(i);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Hg({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:et.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:et.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}}Hg.create=e=>new Hg({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Et.ZodDate,...zt(e)});class $_ extends tn{_parse(t){if(this._getType(t)!==qe.symbol){const r=this._getOrReturnCtx(t);return Fe(r,{code:Ae.invalid_type,expected:qe.symbol,received:r.parsedType}),St}return Ts(t.data)}}$_.create=e=>new $_({typeName:Et.ZodSymbol,...zt(e)});class L1 extends tn{_parse(t){if(this._getType(t)!==qe.undefined){const r=this._getOrReturnCtx(t);return Fe(r,{code:Ae.invalid_type,expected:qe.undefined,received:r.parsedType}),St}return Ts(t.data)}}L1.create=e=>new L1({typeName:Et.ZodUndefined,...zt(e)});class $g extends tn{_parse(t){if(this._getType(t)!==qe.null){const r=this._getOrReturnCtx(t);return Fe(r,{code:Ae.invalid_type,expected:qe.null,received:r.parsedType}),St}return Ts(t.data)}}$g.create=e=>new $g({typeName:Et.ZodNull,...zt(e)});class V_ extends tn{constructor(){super(...arguments),this._any=!0}_parse(t){return Ts(t.data)}}V_.create=e=>new V_({typeName:Et.ZodAny,...zt(e)});class P1 extends tn{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Ts(t.data)}}P1.create=e=>new P1({typeName:Et.ZodUnknown,...zt(e)});class Sl extends tn{_parse(t){const n=this._getOrReturnCtx(t);return Fe(n,{code:Ae.invalid_type,expected:qe.never,received:n.parsedType}),St}}Sl.create=e=>new Sl({typeName:Et.ZodNever,...zt(e)});class G_ extends tn{_parse(t){if(this._getType(t)!==qe.undefined){const r=this._getOrReturnCtx(t);return Fe(r,{code:Ae.invalid_type,expected:qe.void,received:r.parsedType}),St}return Ts(t.data)}}G_.create=e=>new G_({typeName:Et.ZodVoid,...zt(e)});class Co extends tn{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),s=this._def;if(n.parsedType!==qe.array)return Fe(n,{code:Ae.invalid_type,expected:qe.array,received:n.parsedType}),St;if(s.exactLength!==null){const c=n.data.length>s.exactLength.value,u=n.data.length<s.exactLength.value;(c||u)&&(Fe(n,{code:c?Ae.too_big:Ae.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&&(Fe(n,{code:Ae.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&&(Fe(n,{code:Ae.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 No(n,c,n.path,u)))).then(c=>va.mergeArray(r,c));const i=[...n.data].map((c,u)=>s.type._parseSync(new No(n,c,n.path,u)));return va.mergeArray(r,i)}get element(){return this._def.type}min(t,n){return new Co({...this._def,minLength:{value:t,message:et.toString(n)}})}max(t,n){return new Co({...this._def,maxLength:{value:t,message:et.toString(n)}})}length(t,n){return new Co({...this._def,exactLength:{value:t,message:et.toString(n)}})}nonempty(t){return this.min(1,t)}}Co.create=(e,t)=>new Co({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Et.ZodArray,...zt(t)});function zu(e){if(e instanceof vr){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=pi.create(zu(r))}return new vr({...e._def,shape:()=>t})}else return e instanceof Co?new Co({...e._def,type:zu(e.element)}):e instanceof pi?pi.create(zu(e.unwrap())):e instanceof Nc?Nc.create(zu(e.unwrap())):e instanceof jc?jc.create(e.items.map(t=>zu(t))):e}class vr extends tn{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=pn.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==qe.object){const m=this._getOrReturnCtx(t);return Fe(m,{code:Ae.invalid_type,expected:qe.object,received:m.parsedType}),St}const{status:r,ctx:s}=this._processInputParams(t),{shape:i,keys:c}=this._getCached(),u=[];if(!(this._def.catchall instanceof Sl&&this._def.unknownKeys==="strip"))for(const m in s.data)c.includes(m)||u.push(m);const f=[];for(const m of c){const x=i[m],g=s.data[m];f.push({key:{status:"valid",value:m},value:x._parse(new No(s,g,s.path,m)),alwaysSet:m in s.data})}if(this._def.catchall instanceof Sl){const m=this._def.unknownKeys;if(m==="passthrough")for(const x of u)f.push({key:{status:"valid",value:x},value:{status:"valid",value:s.data[x]}});else if(m==="strict")u.length>0&&(Fe(s,{code:Ae.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 x of u){const g=s.data[x];f.push({key:{status:"valid",value:x},value:m._parse(new No(s,g,s.path,x)),alwaysSet:x in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const m=[];for(const x of f){const g=await x.key,y=await x.value;m.push({key:g,value:y,alwaysSet:x.alwaysSet})}return m}).then(m=>va.mergeObjectSync(r,m)):va.mergeObjectSync(r,f)}get shape(){return this._def.shape()}strict(t){return et.errToObj,new vr({...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:et.errToObj(t).message??s}:{message:s}}}:{}})}strip(){return new vr({...this._def,unknownKeys:"strip"})}passthrough(){return new vr({...this._def,unknownKeys:"passthrough"})}extend(t){return new vr({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new vr({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Et.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new vr({...this._def,catchall:t})}pick(t){const n={};for(const r of pn.objectKeys(t))t[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new vr({...this._def,shape:()=>n})}omit(t){const n={};for(const r of pn.objectKeys(this.shape))t[r]||(n[r]=this.shape[r]);return new vr({...this._def,shape:()=>n})}deepPartial(){return zu(this)}partial(t){const n={};for(const r of pn.objectKeys(this.shape)){const s=this.shape[r];t&&!t[r]?n[r]=s:n[r]=s.optional()}return new vr({...this._def,shape:()=>n})}required(t){const n={};for(const r of pn.objectKeys(this.shape))if(t&&!t[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof pi;)i=i._def.innerType;n[r]=i}return new vr({...this._def,shape:()=>n})}keyof(){return wO(pn.objectKeys(this.shape))}}vr.create=(e,t)=>new vr({shape:()=>e,unknownKeys:"strip",catchall:Sl.create(),typeName:Et.ZodObject,...zt(t)});vr.strictCreate=(e,t)=>new vr({shape:()=>e,unknownKeys:"strict",catchall:Sl.create(),typeName:Et.ZodObject,...zt(t)});vr.lazycreate=(e,t)=>new vr({shape:e,unknownKeys:"strip",catchall:Sl.create(),typeName:Et.ZodObject,...zt(t)});class Vg extends tn{_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 Si(u.ctx.common.issues));return Fe(n,{code:Ae.invalid_union,unionErrors:c}),St}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},x=f._parseSync({data:n.data,path:n.path,parent:m});if(x.status==="valid")return x;x.status==="dirty"&&!i&&(i={result:x,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 Si(f));return Fe(n,{code:Ae.invalid_union,unionErrors:u}),St}}get options(){return this._def.options}}Vg.create=(e,t)=>new Vg({options:e,typeName:Et.ZodUnion,...zt(t)});const oi=e=>e instanceof z1?oi(e.schema):e instanceof _c?oi(e.innerType()):e instanceof qg?[e.value]:e instanceof Tc?e.options:e instanceof Kg?pn.objectValues(e.enum):e instanceof Zg?oi(e._def.innerType):e instanceof L1?[void 0]:e instanceof $g?[null]:e instanceof pi?[void 0,...oi(e.unwrap())]:e instanceof Nc?[null,...oi(e.unwrap())]:e instanceof RO||e instanceof Xg?oi(e.unwrap()):e instanceof Yg?oi(e._def.innerType):[];class IC extends tn{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==qe.object)return Fe(n,{code:Ae.invalid_type,expected:qe.object,received:n.parsedType}),St;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}):(Fe(n,{code:Ae.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),St)}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=oi(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 IC({typeName:Et.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:s,...zt(r)})}}function U1(e,t){const n=rl(e),r=rl(t);if(e===t)return{valid:!0,data:e};if(n===qe.object&&r===qe.object){const s=pn.objectKeys(t),i=pn.objectKeys(e).filter(u=>s.indexOf(u)!==-1),c={...e,...t};for(const u of i){const f=U1(e[u],t[u]);if(!f.valid)return{valid:!1};c[u]=f.data}return{valid:!0,data:c}}else if(n===qe.array&&r===qe.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=U1(c,u);if(!f.valid)return{valid:!1};s.push(f.data)}return{valid:!0,data:s}}else return n===qe.date&&r===qe.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Gg extends tn{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),s=(i,c)=>{if(z_(i)||z_(c))return St;const u=U1(i.value,c.value);return u.valid?((F_(i)||F_(c))&&n.dirty(),{status:n.value,value:u.data}):(Fe(r,{code:Ae.invalid_intersection_types}),St)};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}))}}Gg.create=(e,t,n)=>new Gg({left:e,right:t,typeName:Et.ZodIntersection,...zt(n)});class jc extends tn{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==qe.array)return Fe(r,{code:Ae.invalid_type,expected:qe.array,received:r.parsedType}),St;if(r.data.length<this._def.items.length)return Fe(r,{code:Ae.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),St;!this._def.rest&&r.data.length>this._def.items.length&&(Fe(r,{code:Ae.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 No(r,c,r.path,u)):null}).filter(c=>!!c);return r.common.async?Promise.all(i).then(c=>va.mergeArray(n,c)):va.mergeArray(n,i)}get items(){return this._def.items}rest(t){return new jc({...this._def,rest:t})}}jc.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new jc({items:e,typeName:Et.ZodTuple,rest:null,...zt(t)})};class Bg extends tn{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!==qe.object)return Fe(r,{code:Ae.invalid_type,expected:qe.object,received:r.parsedType}),St;const s=[],i=this._def.keyType,c=this._def.valueType;for(const u in r.data)s.push({key:i._parse(new No(r,u,r.path,u)),value:c._parse(new No(r,r.data[u],r.path,u)),alwaysSet:u in r.data});return r.common.async?va.mergeObjectAsync(n,s):va.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof tn?new Bg({keyType:t,valueType:n,typeName:Et.ZodRecord,...zt(r)}):new Bg({keyType:di.create(),valueType:t,typeName:Et.ZodRecord,...zt(n)})}}class B_ extends tn{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!==qe.map)return Fe(r,{code:Ae.invalid_type,expected:qe.map,received:r.parsedType}),St;const s=this._def.keyType,i=this._def.valueType,c=[...r.data.entries()].map(([u,f],m)=>({key:s._parse(new No(r,u,r.path,[m,"key"])),value:i._parse(new No(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,x=await f.value;if(m.status==="aborted"||x.status==="aborted")return St;(m.status==="dirty"||x.status==="dirty")&&n.dirty(),u.set(m.value,x.value)}return{status:n.value,value:u}})}else{const u=new Map;for(const f of c){const m=f.key,x=f.value;if(m.status==="aborted"||x.status==="aborted")return St;(m.status==="dirty"||x.status==="dirty")&&n.dirty(),u.set(m.value,x.value)}return{status:n.value,value:u}}}}B_.create=(e,t,n)=>new B_({valueType:t,keyType:e,typeName:Et.ZodMap,...zt(n)});class hh extends tn{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==qe.set)return Fe(r,{code:Ae.invalid_type,expected:qe.set,received:r.parsedType}),St;const s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(Fe(r,{code:Ae.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&&(Fe(r,{code:Ae.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 x of f){if(x.status==="aborted")return St;x.status==="dirty"&&n.dirty(),m.add(x.value)}return{status:n.value,value:m}}const u=[...r.data.values()].map((f,m)=>i._parse(new No(r,f,r.path,m)));return r.common.async?Promise.all(u).then(f=>c(f)):c(u)}min(t,n){return new hh({...this._def,minSize:{value:t,message:et.toString(n)}})}max(t,n){return new hh({...this._def,maxSize:{value:t,message:et.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}hh.create=(e,t)=>new hh({valueType:e,minSize:null,maxSize:null,typeName:Et.ZodSet,...zt(t)});class z1 extends tn{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}z1.create=(e,t)=>new z1({getter:e,typeName:Et.ZodLazy,...zt(t)});class qg extends tn{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return Fe(n,{received:n.data,code:Ae.invalid_literal,expected:this._def.value}),St}return{status:"valid",value:t.data}}get value(){return this._def.value}}qg.create=(e,t)=>new qg({value:e,typeName:Et.ZodLiteral,...zt(t)});function wO(e,t){return new Tc({values:e,typeName:Et.ZodEnum,...zt(t)})}class Tc extends tn{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return Fe(n,{expected:pn.joinValues(r),received:n.parsedType,code:Ae.invalid_type}),St}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 Fe(n,{received:n.data,code:Ae.invalid_enum_value,options:r}),St}return Ts(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 Tc.create(t,{...this._def,...n})}exclude(t,n=this._def){return Tc.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}Tc.create=wO;class Kg extends tn{_parse(t){const n=pn.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==qe.string&&r.parsedType!==qe.number){const s=pn.objectValues(n);return Fe(r,{expected:pn.joinValues(s),received:r.parsedType,code:Ae.invalid_type}),St}if(this._cache||(this._cache=new Set(pn.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const s=pn.objectValues(n);return Fe(r,{received:r.data,code:Ae.invalid_enum_value,options:s}),St}return Ts(t.data)}get enum(){return this._def.values}}Kg.create=(e,t)=>new Kg({values:e,typeName:Et.ZodNativeEnum,...zt(t)});class Wg extends tn{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==qe.promise&&n.common.async===!1)return Fe(n,{code:Ae.invalid_type,expected:qe.promise,received:n.parsedType}),St;const r=n.parsedType===qe.promise?n.data:Promise.resolve(n.data);return Ts(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Wg.create=(e,t)=>new Wg({type:e,typeName:Et.ZodPromise,...zt(t)});class _c extends tn{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Et.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=>{Fe(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 St;const f=await this._def.schema._parseAsync({data:u,path:r.path,parent:r});return f.status==="aborted"?St:f.status==="dirty"||n.value==="dirty"?Hf(f.value):f});{if(n.value==="aborted")return St;const u=this._def.schema._parseSync({data:c,path:r.path,parent:r});return u.status==="aborted"?St:u.status==="dirty"||n.value==="dirty"?Hf(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"?St:(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"?St:(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(!dd(c))return St;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=>dd(c)?Promise.resolve(s.transform(c.value,i)).then(u=>({status:n.value,value:u})):St);pn.assertNever(s)}}_c.create=(e,t,n)=>new _c({schema:e,typeName:Et.ZodEffects,effect:t,...zt(n)});_c.createWithPreprocess=(e,t,n)=>new _c({schema:t,effect:{type:"preprocess",transform:e},typeName:Et.ZodEffects,...zt(n)});class pi extends tn{_parse(t){return this._getType(t)===qe.undefined?Ts(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}pi.create=(e,t)=>new pi({innerType:e,typeName:Et.ZodOptional,...zt(t)});class Nc extends tn{_parse(t){return this._getType(t)===qe.null?Ts(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Nc.create=(e,t)=>new Nc({innerType:e,typeName:Et.ZodNullable,...zt(t)});class Zg extends tn{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===qe.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Zg.create=(e,t)=>new Zg({innerType:e,typeName:Et.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...zt(t)});class Yg extends tn{_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 Fg(s)?s.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Si(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Si(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Yg.create=(e,t)=>new Yg({innerType:e,typeName:Et.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...zt(t)});class q_ extends tn{_parse(t){if(this._getType(t)!==qe.nan){const r=this._getOrReturnCtx(t);return Fe(r,{code:Ae.invalid_type,expected:qe.nan,received:r.parsedType}),St}return{status:"valid",value:t.data}}}q_.create=e=>new q_({typeName:Et.ZodNaN,...zt(e)});class RO extends tn{_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 MC extends tn{_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"?St:i.status==="dirty"?(n.dirty(),Hf(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"?St: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 MC({in:t,out:n,typeName:Et.ZodPipeline})}}class Xg extends tn{_parse(t){const n=this._def.innerType._parse(t),r=s=>(dd(s)&&(s.value=Object.freeze(s.value)),s);return Fg(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}}Xg.create=(e,t)=>new Xg({innerType:e,typeName:Et.ZodReadonly,...zt(t)});var Et;(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"})(Et||(Et={}));const yt=di.create,pY=fd.create,gY=k1.create,xY=$g.create,yY=P1.create;Sl.create;const F1=Co.create,Yt=vr.create,vY=Vg.create,Xx=IC.create;Gg.create;jc.create;const bY=Bg.create,or=qg.create;Tc.create;const Qx=Kg.create;Wg.create;pi.create;const SY=Nc.create,wb=St,jO=Yt({serviceAccount:yt().min(1,"Service Account Key is required").transform((e,t)=>{try{const n=JSON.parse(e);return typeof n!="object"?(t.addIssue({code:Ae.custom,message:"Service Account must be a valid JSON object"}),wb):n.client_email?e:(t.addIssue({code:Ae.custom,message:"Service Account must contain a client_email field"}),wb)}catch(n){return console.error(n),t.addIssue({code:Ae.custom,message:"Service Account must be a valid JSON string"}),wb}})}),CY=[{type:"menu-item",title:"GitHub Community",href:"https://github.com/OWOX/owox-data-marts",icon:_Z,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:UT,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:C4,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:UT,visible:{flagKey:"IDP_PROVIDER",expectedValue:"owox"},group:"project"},{type:"menu-item",title:"Subscription",href:"https://platform.owox.com/ui/p/none/settings/subscription",icon:kU,visible:{flagKey:"IDP_PROVIDER",expectedValue:"owox"},group:"project"},{type:"menu-item",title:"Members",href:"https://platform.owox.com/ui/p/none/settings/members",icon:zT,visible:{flagKey:"IDP_PROVIDER",expectedValue:"owox"},group:"project"},{type:"menu-item",title:"Members",href:"/auth",icon:zT,visible:{flagKey:"IDP_PROVIDER",expectedValue:"better-auth"},group:"project"},{type:"menu-item",title:"Leave Feedback",href:"https://github.com/OWOX/owox-data-marts/discussions",icon:nF,visible:{flagKey:"MENU_FEEDBACK_VISIBLE",expectedValue:"true"},group:"feedback"},{type:"menu-item",title:"Issues",href:"https://github.com/OWOX/owox-data-marts/issues",icon:_U,visible:{flagKey:"MENU_ISSUES_VISIBLE",expectedValue:"true"},group:"feedback"},{type:"menu-item",title:"License",href:"https://github.com/OWOX/owox-data-marts#License-1-ov-file",icon:TF,visible:{flagKey:"MENU_LICENSE_VISIBLE",expectedValue:"true"},group:"legal"},{type:"menu-item",title:"OWOX BI",href:"https://bi.owox.com/",icon:IZ,visible:{flagKey:"MENU_OWOX_BI_VISIBLE",expectedValue:"true"},group:"external"}];function Qg(e,t,n){if(!n||typeof n!="object")return!1;const r=n[e];return t===void 0?!!r:r===t}function EY(){const{flags:e}=wd(),{loadProjects:t,projects:n}=pO(),{id:r}=FD(),s=Qg("IDP_PROVIDER","owox",e);h.useEffect(()=>{s&&t()},[t,s]);const i=n.length>1;return{visibleMenuItems:h.useMemo(()=>{const f=CY.filter(y=>typeof y.visible=="boolean"?y.visible:Qg(y.visible.flagKey,y.visible.expectedValue,e)).map(y=>{if(y.group==="project"&&y.href&&r)try{const v=y.href.replace("/p/none/",`/p/${r}/`);return{...y,href:v}}catch{return y}return y}),m=new Map;f.forEach(y=>{const v=y.group||"default";m.has(v)||m.set(v,[]);const C=m.get(v);C&&C.push(y)});const x=[],g=Array.from(m.entries()).filter(([,y])=>y.length>0);return g.forEach(([,y],v)=>{x.push(...y),v<g.length-1&&x.push({type:"separator",visible:!0})}),x},[e,r]),canSwitchProject:i}}function wY(){const{visibleMenuItems:e,canSwitchProject:t}=EY();return a.jsxs(Mr,{align:"start",side:"right",className:"w-56",children:[e.map((n,r)=>{if(n.type==="separator")return a.jsx(ns,{},`separator-${String(r)}`);const s=n.icon;return a.jsx(Ut,{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(TZ,{},"switch-project")]})}var kt=(e=>(e.IDLE="idle",e.LOADING="loading",e.LOADED="loaded",e.ERROR="error",e))(kt||{});let RY={data:""},jY=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},TY=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,_Y=/\/\*[^]*?\*\/| +/g,K_=/\n+/g,ll=(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"?ll(c,i):i+"{"+ll(c,i[1]=="k"?"":t)+"}":typeof c=="object"?r+=ll(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+=ll.p?ll.p(i,c):i+":"+c+";")}return n+(t&&s?t+"{"+s+"}":s)+r},ni={},TO=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+TO(e[n]);return t}return e},NY=(e,t,n,r,s)=>{let i=TO(e),c=ni[i]||(ni[i]=(f=>{let m=0,x=11;for(;m<f.length;)x=101*x+f.charCodeAt(m++)>>>0;return"go"+x})(i));if(!ni[c]){let f=i!==e?e:(m=>{let x,g,y=[{}];for(;x=TY.exec(m.replace(_Y,""));)x[4]?y.shift():x[3]?(g=x[3].replace(K_," ").trim(),y.unshift(y[0][g]=y[0][g]||{})):y[0][x[1]]=x[2].replace(K_," ").trim();return y[0]})(e);ni[c]=ll(s?{["@keyframes "+c]:f}:f,n?"":"."+c)}let u=n&&ni.g?ni.g:null;return n&&(ni.g=ni[c]),((f,m,x,g)=>{g?m.data=m.data.replace(g,f):m.data.indexOf(f)===-1&&(m.data=x?f+m.data:m.data+f)})(ni[c],t,r,u),c},AY=(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?"":ll(u,""):u===!1?"":u}return r+s+(c??"")},"");function Jx(e){let t=this||{},n=e.call?e(t.p):e;return NY(n.unshift?n.raw?AY(n,[].slice.call(arguments,1),t.p):n.reduce((r,s)=>Object.assign(r,s&&s.call?s(t.p):s),{}):n,jY(t.target),t.g,t.o,t.k)}let _O,H1,$1;Jx.bind({g:1});let Ci=Jx.bind({k:1});function DY(e,t,n,r){ll.p=t,_O=e,H1=n,$1=r}function Tl(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:H1&&H1()},u),n.o=/ *go\d+/.test(f),u.className=Jx.apply(n,r)+(f?" "+f:"");let m=e;return e[0]&&(m=u.as||e,delete u.as),$1&&m[0]&&$1(u),_O(m,u)}return s}}var OY=e=>typeof e=="function",Jg=(e,t)=>OY(e)?e(t):e,IY=(()=>{let e=0;return()=>(++e).toString()})(),NO=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),MY=20,kC="default",AO=(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 AO(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}))}}},vg=[],DO={toasts:[],pausedAt:void 0,settings:{toastLimit:MY}},yo={},OO=(e,t=kC)=>{yo[t]=AO(yo[t]||DO,e),vg.forEach(([n,r])=>{n===t&&r(yo[t])})},IO=e=>Object.keys(yo).forEach(t=>OO(e,t)),kY=e=>Object.keys(yo).find(t=>yo[t].toasts.some(n=>n.id===e)),ey=(e=kC)=>t=>{OO(t,e)},LY={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},PY=(e={},t=kC)=>{let[n,r]=h.useState(yo[t]||DO),s=h.useRef(yo[t]);h.useEffect(()=>(s.current!==yo[t]&&r(yo[t]),vg.push([t,r]),()=>{let c=vg.findIndex(([u])=>u===t);c>-1&&vg.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)||LY[c.type],style:{...e.style,...(m=e[c.type])==null?void 0:m.style,...c.style}}});return{...n,toasts:i}},UY=(e,t="blank",n)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...n,id:(n==null?void 0:n.id)||IY()}),Zh=e=>(t,n)=>{let r=UY(t,e,n);return ey(r.toasterId||kY(r.id))({type:2,toast:r}),r.id},In=(e,t)=>Zh("blank")(e,t);In.error=Zh("error");In.success=Zh("success");In.loading=Zh("loading");In.custom=Zh("custom");In.dismiss=(e,t)=>{let n={type:3,toastId:e};t?ey(t)(n):IO(n)};In.dismissAll=e=>In.dismiss(void 0,e);In.remove=(e,t)=>{let n={type:4,toastId:e};t?ey(t)(n):IO(n)};In.removeAll=e=>In.remove(void 0,e);In.promise=(e,t,n)=>{let r=In.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?In.success(i,{id:r,...n,...n==null?void 0:n.success}):In.dismiss(r),s}).catch(s=>{let i=t.error?Jg(t.error,s):void 0;i?In.error(i,{id:r,...n,...n==null?void 0:n.error}):In.dismiss(r)}),e};var zY=1e3,FY=(e,t="default")=>{let{toasts:n,pausedAt:r}=PY(e,t),s=h.useRef(new Map).current,i=h.useCallback((g,y=zY)=>{if(s.has(g))return;let v=setTimeout(()=>{s.delete(g),c({type:4,toastId:g})},y);s.set(g,v)},[]);h.useEffect(()=>{if(r)return;let g=Date.now(),y=n.map(v=>{if(v.duration===1/0)return;let C=(v.duration||0)+v.pauseDuration-(g-v.createdAt);if(C<0){v.visible&&In.dismiss(v.id);return}return setTimeout(()=>In.dismiss(v.id,t),C)});return()=>{y.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,y)=>{c({type:1,toast:{id:g,height:y}})},[c]),m=h.useCallback(()=>{r&&c({type:6,time:Date.now()})},[r,c]),x=h.useCallback((g,y)=>{let{reverseOrder:v=!1,gutter:C=8,defaultPosition:S}=y||{},E=n.filter(T=>(T.position||S)===(g.position||S)&&T.height),j=E.findIndex(T=>T.id===g.id),R=E.filter((T,N)=>N<j&&T.visible).length;return E.filter(T=>T.visible).slice(...v?[R+1]:[0,R]).reduce((T,N)=>T+(N.height||0)+C,0)},[n]);return h.useEffect(()=>{n.forEach(g=>{if(g.dismissed)i(g.id,g.removeDelay);else{let y=s.get(g.id);y&&(clearTimeout(y),s.delete(g.id))}})},[n,i]),{toasts:n,handlers:{updateHeight:f,startPause:u,endPause:m,calculateOffset:x}}},HY=Ci`
|
|
616
|
+
from {
|
|
617
|
+
transform: scale(0) rotate(45deg);
|
|
618
|
+
opacity: 0;
|
|
619
|
+
}
|
|
620
|
+
to {
|
|
621
|
+
transform: scale(1) rotate(45deg);
|
|
622
|
+
opacity: 1;
|
|
623
|
+
}`,$Y=Ci`
|
|
624
|
+
from {
|
|
625
|
+
transform: scale(0);
|
|
626
|
+
opacity: 0;
|
|
627
|
+
}
|
|
628
|
+
to {
|
|
629
|
+
transform: scale(1);
|
|
630
|
+
opacity: 1;
|
|
631
|
+
}`,VY=Ci`
|
|
632
|
+
from {
|
|
633
|
+
transform: scale(0) rotate(90deg);
|
|
634
|
+
opacity: 0;
|
|
635
|
+
}
|
|
636
|
+
to {
|
|
637
|
+
transform: scale(1) rotate(90deg);
|
|
638
|
+
opacity: 1;
|
|
639
|
+
}`,GY=Tl("div")`
|
|
640
|
+
width: 20px;
|
|
641
|
+
opacity: 0;
|
|
642
|
+
height: 20px;
|
|
643
|
+
border-radius: 10px;
|
|
644
|
+
background: ${e=>e.primary||"#ff4b4b"};
|
|
645
|
+
position: relative;
|
|
646
|
+
transform: rotate(45deg);
|
|
647
|
+
|
|
648
|
+
animation: ${HY} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
649
|
+
forwards;
|
|
650
|
+
animation-delay: 100ms;
|
|
651
|
+
|
|
652
|
+
&:after,
|
|
653
|
+
&:before {
|
|
654
|
+
content: '';
|
|
655
|
+
animation: ${$Y} 0.15s ease-out forwards;
|
|
656
|
+
animation-delay: 150ms;
|
|
657
|
+
position: absolute;
|
|
658
|
+
border-radius: 3px;
|
|
659
|
+
opacity: 0;
|
|
660
|
+
background: ${e=>e.secondary||"#fff"};
|
|
661
|
+
bottom: 9px;
|
|
662
|
+
left: 4px;
|
|
663
|
+
height: 2px;
|
|
664
|
+
width: 12px;
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
&:before {
|
|
668
|
+
animation: ${VY} 0.15s ease-out forwards;
|
|
669
|
+
animation-delay: 180ms;
|
|
670
|
+
transform: rotate(90deg);
|
|
671
|
+
}
|
|
672
|
+
`,BY=Ci`
|
|
673
|
+
from {
|
|
674
|
+
transform: rotate(0deg);
|
|
675
|
+
}
|
|
676
|
+
to {
|
|
677
|
+
transform: rotate(360deg);
|
|
678
|
+
}
|
|
679
|
+
`,qY=Tl("div")`
|
|
680
|
+
width: 12px;
|
|
681
|
+
height: 12px;
|
|
682
|
+
box-sizing: border-box;
|
|
683
|
+
border: 2px solid;
|
|
684
|
+
border-radius: 100%;
|
|
685
|
+
border-color: ${e=>e.secondary||"#e0e0e0"};
|
|
686
|
+
border-right-color: ${e=>e.primary||"#616161"};
|
|
687
|
+
animation: ${BY} 1s linear infinite;
|
|
688
|
+
`,KY=Ci`
|
|
689
|
+
from {
|
|
690
|
+
transform: scale(0) rotate(45deg);
|
|
691
|
+
opacity: 0;
|
|
692
|
+
}
|
|
693
|
+
to {
|
|
694
|
+
transform: scale(1) rotate(45deg);
|
|
695
|
+
opacity: 1;
|
|
696
|
+
}`,WY=Ci`
|
|
697
|
+
0% {
|
|
698
|
+
height: 0;
|
|
699
|
+
width: 0;
|
|
700
|
+
opacity: 0;
|
|
701
|
+
}
|
|
702
|
+
40% {
|
|
703
|
+
height: 0;
|
|
704
|
+
width: 6px;
|
|
705
|
+
opacity: 1;
|
|
706
|
+
}
|
|
707
|
+
100% {
|
|
708
|
+
opacity: 1;
|
|
709
|
+
height: 10px;
|
|
710
|
+
}`,ZY=Tl("div")`
|
|
711
|
+
width: 20px;
|
|
712
|
+
opacity: 0;
|
|
713
|
+
height: 20px;
|
|
714
|
+
border-radius: 10px;
|
|
715
|
+
background: ${e=>e.primary||"#61d345"};
|
|
716
|
+
position: relative;
|
|
717
|
+
transform: rotate(45deg);
|
|
718
|
+
|
|
719
|
+
animation: ${KY} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
720
|
+
forwards;
|
|
721
|
+
animation-delay: 100ms;
|
|
722
|
+
&:after {
|
|
723
|
+
content: '';
|
|
724
|
+
box-sizing: border-box;
|
|
725
|
+
animation: ${WY} 0.2s ease-out forwards;
|
|
726
|
+
opacity: 0;
|
|
727
|
+
animation-delay: 200ms;
|
|
728
|
+
position: absolute;
|
|
729
|
+
border-right: 2px solid;
|
|
730
|
+
border-bottom: 2px solid;
|
|
731
|
+
border-color: ${e=>e.secondary||"#fff"};
|
|
732
|
+
bottom: 6px;
|
|
733
|
+
left: 6px;
|
|
734
|
+
height: 10px;
|
|
735
|
+
width: 6px;
|
|
736
|
+
}
|
|
737
|
+
`,YY=Tl("div")`
|
|
738
|
+
position: absolute;
|
|
739
|
+
`,XY=Tl("div")`
|
|
740
|
+
position: relative;
|
|
741
|
+
display: flex;
|
|
742
|
+
justify-content: center;
|
|
743
|
+
align-items: center;
|
|
744
|
+
min-width: 20px;
|
|
745
|
+
min-height: 20px;
|
|
746
|
+
`,QY=Ci`
|
|
747
|
+
from {
|
|
748
|
+
transform: scale(0.6);
|
|
749
|
+
opacity: 0.4;
|
|
750
|
+
}
|
|
751
|
+
to {
|
|
752
|
+
transform: scale(1);
|
|
753
|
+
opacity: 1;
|
|
754
|
+
}`,JY=Tl("div")`
|
|
755
|
+
position: relative;
|
|
756
|
+
transform: scale(0.6);
|
|
757
|
+
opacity: 0.4;
|
|
758
|
+
min-width: 20px;
|
|
759
|
+
animation: ${QY} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
760
|
+
forwards;
|
|
761
|
+
`,eX=({toast:e})=>{let{icon:t,type:n,iconTheme:r}=e;return t!==void 0?typeof t=="string"?h.createElement(JY,null,t):t:n==="blank"?null:h.createElement(XY,null,h.createElement(qY,{...r}),n!=="loading"&&h.createElement(YY,null,n==="error"?h.createElement(GY,{...r}):h.createElement(ZY,{...r})))},tX=e=>`
|
|
762
|
+
0% {transform: translate3d(0,${e*-200}%,0) scale(.6); opacity:.5;}
|
|
763
|
+
100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
|
|
764
|
+
`,nX=e=>`
|
|
765
|
+
0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
|
|
766
|
+
100% {transform: translate3d(0,${e*-150}%,-1px) scale(.6); opacity:0;}
|
|
767
|
+
`,rX="0%{opacity:0;} 100%{opacity:1;}",aX="0%{opacity:1;} 100%{opacity:0;}",sX=Tl("div")`
|
|
768
|
+
display: flex;
|
|
769
|
+
align-items: center;
|
|
770
|
+
background: #fff;
|
|
771
|
+
color: #363636;
|
|
772
|
+
line-height: 1.3;
|
|
773
|
+
will-change: transform;
|
|
774
|
+
box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05);
|
|
775
|
+
max-width: 350px;
|
|
776
|
+
pointer-events: auto;
|
|
777
|
+
padding: 8px 10px;
|
|
778
|
+
border-radius: 8px;
|
|
779
|
+
`,oX=Tl("div")`
|
|
780
|
+
display: flex;
|
|
781
|
+
justify-content: center;
|
|
782
|
+
margin: 4px 10px;
|
|
783
|
+
color: inherit;
|
|
784
|
+
flex: 1 1 auto;
|
|
785
|
+
white-space: pre-line;
|
|
786
|
+
`,iX=(e,t)=>{let n=e.includes("top")?1:-1,[r,s]=NO()?[rX,aX]:[tX(n),nX(n)];return{animation:t?`${Ci(r)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${Ci(s)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},lX=h.memo(({toast:e,position:t,style:n,children:r})=>{let s=e.height?iX(e.position||t||"top-center",e.visible):{opacity:0},i=h.createElement(eX,{toast:e}),c=h.createElement(oX,{...e.ariaProps},Jg(e.message,e));return h.createElement(sX,{className:e.className,style:{...s,...n,...e.style}},typeof r=="function"?r({icon:i,message:c}):h.createElement(h.Fragment,null,i,c))});DY(h.createElement);var cX=({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)},uX=(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:NO()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...r,...s}},dX=Jx`
|
|
787
|
+
z-index: 9999;
|
|
788
|
+
> * {
|
|
789
|
+
pointer-events: auto;
|
|
790
|
+
}
|
|
791
|
+
`,Kp=16,fX=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:s,toasterId:i,containerStyle:c,containerClassName:u})=>{let{toasts:f,handlers:m}=FY(n,i);return h.createElement("div",{"data-rht-toaster":i||"",style:{position:"fixed",zIndex:9999,top:Kp,left:Kp,right:Kp,bottom:Kp,pointerEvents:"none",...c},className:u,onMouseEnter:m.startPause,onMouseLeave:m.endPause},f.map(x=>{let g=x.position||t,y=m.calculateOffset(x,{reverseOrder:e,gutter:r,defaultPosition:t}),v=uX(g,y);return h.createElement(cX,{id:x.id,key:x.id,onHeightUpdate:m.updateHeight,className:x.visible?dX:"",style:v},x.type==="custom"?Jg(x.message,x):s?s(x):h.createElement(lX,{toast:x,position:g}))}))},Dt=In;const mn=e=>{var n;return(n=e.response)==null?void 0:n.data};function Rb(e,t="Something went wrong"){var s,i,c;const n=mn(e);let r=((s=n.message)==null?void 0:s.trim())??t;(c=(i=n.errorDetails)==null?void 0:i.error)!=null&&c.trim()&&(r=`${r}. ${n.errorDetails.error}`),Dt.error(r)}function MO(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 hX{constructor(){io(this,"isRefreshingToken",!1);io(this,"refreshTokenPromise",null);io(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 mX={baseURL:"/api",timeout:3e4,headers:{"Content-Type":"application/json",Accept:"application/json"}},Aa=sr.create(mX),V1=new hX;Aa.interceptors.request.use(e=>{if(e.skipAuthHeader||new sZ(e.headers).has("X-OWOX-Authorization"))return e;const n=DC(),r=(n==null?void 0:n.getAccessToken())??V1.getAccessToken();return r&&(e.headers["X-OWOX-Authorization"]=`Bearer ${r}`),e},e=>Promise.reject(e instanceof Error?e:new Error("Unknown error")));Aa.interceptors.response.use(e=>e,async e=>{var n,r,s,i;const t=e.config;if(((n=e.response)==null?void 0:n.status)===401&&!t._retry){t._retry=!0;try{const c=DC();if(!c)throw new Error("No token provider available");const u=await V1.refreshToken(()=>c.refreshToken());return t.headers["X-OWOX-Authorization"]=`Bearer ${u}`,await Aa(t)}catch{return V1.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)===404&&Rb(e,"Resource not found"),((s=e.response)==null?void 0:s.status)===403&&Rb(e,"Access forbidden - insufficient permissions"),((i=e.response)==null?void 0:i.status)===400&&Rb(e,"Bad request"),Promise.reject(e)});const kO={projects:[],callState:kt.IDLE,error:null};function pX(e,t){switch(t.type){case"LOADING":return{...e,callState:kt.LOADING,error:null};case"SUCCESS":return{projects:t.payload,callState:kt.LOADED,error:null};case"ERROR":return{...e,callState:kt.ERROR,error:t.payload};case"RESET":return{...kO};default:return e}}function gX({children:e}){const[t,n]=h.useReducer(pX,kO),r=h.useCallback(async()=>{n({type:"LOADING"});try{const u=DC();if(!u){n({type:"ERROR",payload:mn(new k_("No token provider"))});return}const f=u.getAccessToken();if(!f){n({type:"ERROR",payload:mn(new k_("Unable to obtain access token"))});return}const m=await hZ(f);n({type:"SUCCESS",payload:m})}catch(u){n({type:"ERROR",payload:mn(u)})}},[]),s=h.useCallback(()=>{n({type:"RESET"})},[]),i=t.callState===kt.LOADING,c={...t,loadProjects:r,reset:s,isLoading:i};return a.jsx(mO.Provider,{value:c,children:e})}function xX(){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(Or,{open:e,onOpenChange:t,children:[a.jsx(NK,{isOpen:e}),a.jsx(gX,{children:a.jsx(wY,{})})]})})})})}var yX=(e,t,n,r,s,i,c,u)=>{let f=document.documentElement,m=["light","dark"];function x(v){(Array.isArray(e)?e:[e]).forEach(C=>{let S=C==="class",E=S&&i?s.map(j=>i[j]||j):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 y(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(r)x(r);else try{let v=localStorage.getItem(t)||n,C=c&&v==="system"?y():v;x(C)}catch{}},W_=["light","dark"],LO="(prefers-color-scheme: dark)",vX=typeof window>"u",LC=h.createContext(void 0),bX={setTheme:e=>{},themes:[]},Yh=()=>{var e;return(e=h.useContext(LC))!=null?e:bX},SX=e=>h.useContext(LC)?h.createElement(h.Fragment,null,e.children):h.createElement(EX,{...e}),CX=["light","dark"],EX=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:s="theme",themes:i=CX,defaultTheme:c=n?"system":"light",attribute:u="data-theme",value:f,children:m,nonce:x,scriptProps:g})=>{let[y,v]=h.useState(()=>RX(s,c)),[C,S]=h.useState(()=>y==="system"?jb():y),E=f?Object.values(f):i,j=h.useCallback(A=>{let I=A;if(!I)return;A==="system"&&n&&(I=jb());let _=f?f[I]:I,M=t?jX(x):null,G=document.documentElement,H=L=>{L==="class"?(G.classList.remove(...E),_&&G.classList.add(_)):L.startsWith("data-")&&(_?G.setAttribute(L,_):G.removeAttribute(L))};if(Array.isArray(u)?u.forEach(H):H(u),r){let L=W_.includes(c)?c:null,q=W_.includes(I)?I:L;G.style.colorScheme=q}M==null||M()},[x]),R=h.useCallback(A=>{let I=typeof A=="function"?A(y):A;v(I);try{localStorage.setItem(s,I)}catch{}},[y]),T=h.useCallback(A=>{let I=jb(A);S(I),y==="system"&&n&&!e&&j("system")},[y,e]);h.useEffect(()=>{let A=window.matchMedia(LO);return A.addListener(T),T(A),()=>A.removeListener(T)},[T]),h.useEffect(()=>{let A=I=>{I.key===s&&(I.newValue?v(I.newValue):R(c))};return window.addEventListener("storage",A),()=>window.removeEventListener("storage",A)},[R]),h.useEffect(()=>{j(e??y)},[e,y]);let N=h.useMemo(()=>({theme:y,setTheme:R,forcedTheme:e,resolvedTheme:y==="system"?C:y,themes:n?[...i,"system"]:i,systemTheme:n?C:void 0}),[y,R,e,C,n,i]);return h.createElement(LC.Provider,{value:N},h.createElement(wX,{forcedTheme:e,storageKey:s,attribute:u,enableSystem:n,enableColorScheme:r,defaultTheme:c,value:f,themes:i,nonce:x,scriptProps:g}),m)},wX=h.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:s,defaultTheme:i,value:c,themes:u,nonce:f,scriptProps:m})=>{let x=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:`(${yX.toString()})(${x})`}})}),RX=(e,t)=>{if(vX)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},jX=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)}},jb=e=>(e||(e=window.matchMedia(LO)),e.matches?"dark":"light");const TX=({theme:e,setTheme:t,signOut:n})=>[{type:"submenu",title:"Appearance",icon:_X(e),submenu:{value:e,onChange:r=>{t(r)},options:[{value:"system",label:"System",icon:v4},{value:"light",label:"Light",icon:w4},{value:"dark",label:"Dark",icon:b4}]}},{type:"separator"},{type:"item",title:"Sign out",icon:Xz,onClick:n,className:"text-red-600 focus:text-red-600"}];function _X(e){switch(e){case"light":return w4;case"dark":return b4;case"system":default:return v4}}var Ju=(e=>(e.LARGE="LARGE",e.NORMAL="NORMAL",e.SMALL="SMALL",e))(Ju||{});function G1({avatar:e,initials:t,displayName:n,size:r=Ju.NORMAL}){let s,i,c;switch(r){case Ju.SMALL:s="w-6 h-6",i="w-5 h-5",c="text-[10px]";break;case Ju.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 NX({isOpen:e,displayName:t,email:n,avatar:r,initials:s}){return a.jsx(Ir,{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(G1,{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(ss,{className:`ml-auto size-4 transition-transform duration-200 group-data-[collapsible=icon]:hidden ${e?"-rotate-90":""}`})]})})}function AX({items:e}){return a.jsx(Mr,{align:"end",side:"right",className:"w-56",children:e.map((t,n)=>{if(t.type==="separator")return a.jsx(ns,{},`sep-${String(n)}`);if(t.type==="submenu"){const{submenu:r}=t;return a.jsxs(Vx,{children:[a.jsxs(Gx,{className:"flex items-center gap-2 px-2 py-1.5",children:[a.jsx(t.icon,{className:"size-4"}),t.title]}),a.jsx(Bx,{children:r.options.map(s=>a.jsxs(Ut,{className:"flex items-center gap-2 px-2 py-1.5",onClick:()=>{r.onChange(s.value)},children:[s.icon&&a.jsx(s.icon,{className:"size-4"}),s.label,r.value===s.value&&a.jsx(Ia,{className:"ml-auto size-4"})]},s.value))})]},t.title)}return a.jsxs(Ut,{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 DX(){const{user:e,signOut:t}=Ti(),{setTheme:n,theme:r}=Yh(),[s,i]=h.useState(!1);if(!e)return null;const{fullName:c,email:u,avatar:f}=e,m=c??u??"Unknown User",x=MO(c,u);return a.jsx("div",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:"group/menu-item relative",children:a.jsxs(Or,{open:s,onOpenChange:i,children:[a.jsx(NX,{isOpen:s,displayName:m,email:u,avatar:f,initials:x}),a.jsx(AX,{items:TX({theme:r,setTheme:n,signOut:t})})]})})}function OX(){const{user:e,status:t}=Ti();return t===ra.LOADING||t===ra.UNAUTHENTICATED||!(e!=null&&e.projectId)?null:e.projectId}function ko(){const e=Lc(),t=OX(),n=h.useCallback((i,c)=>{if(!t){e("/",{replace:!0});return}const u=zg(t,i);e(u,c)},[e,t]),r=h.useCallback(i=>t?zg(t,i):i,[t]);return h.useMemo(()=>({navigate:n,scope:r,projectId:t}),[n,r,t])}function IX(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 PO(e){const[t,n]=o4(),r=t.get(e),s=h.useCallback(c=>{n(u=>{const f=new URLSearchParams(u);return f.set(e,c),f},{replace:!0})},[e,n]),i=h.useCallback(()=>{n(c=>{const u=new URLSearchParams(c);return u.delete(e),u},{replace:!0})},[e,n]);return{value:r,setParam:s,removeParam:i}}function MX(){const{scope:e}=ko();return a.jsxs(Th,{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(sa,{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 kX=[{title:"Data Marts",url:"/data-marts",icon:_g},{title:"Storages",url:"/data-storages",icon:Sc},{title:"Destinations",url:"/data-destinations",icon:WS}];function LX(){const{scope:e}=ko();return a.jsx(MB,{children:kX.map(t=>{const n=t.icon;return a.jsx(kB,{children:a.jsx(Th,{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(rt,{delayDuration:500,children:[a.jsx(at,{asChild:!0,children:a.jsxs(PB,{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(st,{side:"right",children:t.title})]})})},t.title)})})}const UO=20,zO=20;function FO({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 PX(e){try{if(!window.Intercom)return;window.Intercom("update",{hide_default_launcher:!e})}catch(t){console.warn("Failed to toggle Intercom launcher visibility",t)}}function UX(e=30,t=0){FO({vertical:zO+e,horizontal:UO+t})}function B1(){if(FO({vertical:zO,horizontal:UO}),PX(!1),window.__intercom_open_on_ready&&window.Intercom){try{window.Intercom("show")}catch(e){console.warn("Failed to show Intercom after boot",e)}window.__intercom_open_on_ready=!1}}function zX(){if(window.Intercom)try{window.Intercom("show")}catch(e){console.warn("Intercom show failed",e)}else window.__intercom_open_on_ready=!0}function FX(e){return[{type:"menu-item",title:"What´s new",icon:EF,href:"https://docs.owox.com/docs/changelog/?utm_source=community_edition&utm_medium=organic&utm_campaign=support_menu_dropdown&utm_content=whats_new",visible:!0},{type:"separator"},{type:"menu-item",title:"Documentation",href:"https://docs.owox.com/?utm_source=community_edition&utm_medium=organic&utm_campaign=support_menu_dropdown&utm_content=documentation",icon:_r,visible:{flagKey:"MENU_DOCUMENTATION_COMMUNITY_EDITION_VISIBLE",expectedValue:"true"}},{type:"menu-item",title:"Documentation",href:"https://docs.owox.com/?utm_source=app_owox_com&utm_medium=organic&utm_campaign=support_menu_dropdown&utm_content=documentation",icon:_r,visible:{flagKey:"MENU_DOCUMENTATION_OWOX_CLOUD_VISIBLE",expectedValue:"true"}},{type:"submenu",title:"Video tutorials",icon:tz,visible:!0,submenu:{options:[{label:"Getting Started with Data Marts",icon:sb,onClick:()=>{e("video-3-getting-started-with-data-marts")}},{label:"SQL to Google Sheets in Minutes",icon:sb,onClick:()=>{e("video-1-google-sheets")}},{label:"Looker Studio Setup",icon:sb,onClick:()=>{e("video-2-looker")}}]}},{type:"separator"},{type:"menu-item",title:"Slack Community",href:"https://join.slack.com/t/owox-data-marts/shared_invite/zt-3fffrsau9-UlobJVlXzRLpXmvs0ffvoQ",icon:kZ,visible:!0},{type:"menu-item",title:"Online Chat",icon:aF,onClick:()=>{zX()},visible:!0}]}function HX({isOpen:e}){return a.jsx(Ir,{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-foreground flex aspect-square size-8 items-center justify-center rounded-md border bg-white dark:bg-white/10",children:a.jsx(y4,{className:"text-muted-foreground",size:18,strokeWidth:1.5})}),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:"Help"}),a.jsx("span",{className:"text-muted-foreground hidden truncate text-xs",children:"Chat, Docs, Videos"})]}),a.jsx(ss,{className:`ml-auto size-4 transition-transform duration-200 group-data-[collapsible=icon]:hidden ${e?"-rotate-90":""}`})]})})}function $X({items:e,onClose:t}){return a.jsx(Mr,{align:"end",side:"right",className:"w-56",children:e.map((n,r)=>{if(n.type==="separator")return a.jsx(ns,{},`sep-${String(r)}`);const s=n.icon;if(n.type==="submenu"){const{submenu:i}=n;return a.jsxs(Vx,{children:[a.jsxs(Gx,{className:"flex items-center gap-2",children:[a.jsx(s,{className:"text-muted-foreground size-4"}),n.title]}),a.jsx(Bx,{children:i.options.map((c,u)=>a.jsxs(Ut,{onClick:()=>{var f;(f=c.onClick)==null||f.call(c),t==null||t()},children:[c.icon&&a.jsx(c.icon,{className:"size-4"}),c.label]},`submenu-${n.title}-opt-${String(u)}`))})]},`submenu-${n.title}-${String(r)}`)}return a.jsx(Ut,{onClick:()=>{var i;(i=n.onClick)==null||i.call(n),t==null||t()},asChild:!!n.href,children:n.href?a.jsxs("a",{href:n.href,target:"_blank",rel:"noopener noreferrer",children:[a.jsx(s,{className:"size-4"}),n.title]}):a.jsxs(a.Fragment,{children:[a.jsx(s,{className:"size-4"}),n.title]})},`item-${n.title}-${String(r)}`)})})}function VX(e){const{flags:t}=wd();return{visibleItems:h.useMemo(()=>e.filter(r=>r.type==="separator"||r.type==="submenu"?!0:typeof r.visible=="boolean"?r.visible:Qg(r.visible.flagKey,r.visible.expectedValue,t)),[e,t])}}const HO={activePopoverId:null,isOpen:!1},$O="contentPopovers/OPEN_POPOVER",VO="contentPopovers/CLOSE_POPOVER",GO="contentPopovers/TOGGLE_POPOVER";function GX(e){return{type:$O,payload:e}}function BX(e){return{type:VO,payload:e}}function qX(e){return{type:GO,payload:e}}function KX(e=HO,t){switch(t.type){case $O:return{activePopoverId:t.payload,isOpen:!0};case VO:{const n=t.payload;return e.activePopoverId!==n?e:{activePopoverId:null,isOpen:!1}}case GO:{const n=t.payload;return e.activePopoverId!==n?{activePopoverId:n,isOpen:!0}:{activePopoverId:n,isOpen:!e.isOpen}}default:return e}}function PC(){const e=zD(),t=dh(n=>n.contentPopovers);return{activePopoverId:t.activePopoverId,isOpen:t.isOpen,open:n=>{e(GX(n))},close:()=>{t.activePopoverId&&e(BX(t.activePopoverId))},toggle:n=>{e(qX(n))}}}function WX(){const[e,t]=h.useState(!1),{open:n}=PC(),r=FX(n),{visibleItems:s}=VX(r);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(Or,{open:e,onOpenChange:t,children:[a.jsx(HX,{isOpen:e}),a.jsx($X,{items:s,onClose:()=>{t(!1)}})]})})})})}function ZX({variant:e="inset",collapsible:t="icon"}){return a.jsxs(TB,{variant:e,collapsible:t,children:[a.jsx(DB,{children:a.jsx(xX,{})}),a.jsxs(IB,{children:[a.jsx(p_,{children:a.jsx(g_,{children:a.jsx(MX,{})})}),a.jsx(p_,{children:a.jsx(g_,{children:a.jsx(LX,{})})})]}),a.jsxs(OB,{children:[a.jsx(WX,{}),a.jsx(eC,{}),a.jsx(DX,{})]}),a.jsx(NB,{})]})}function YX({children:e,...t}){return a.jsx(SX,{attribute:"class",defaultTheme:"system",enableSystem:!0,...t,children:e})}class _l{constructor(t){io(this,"baseUrl");this.baseUrl=t}async get(t,n,r){const s=this.createUrl(t);return(await Aa.get(s,{...r,params:n})).data}async post(t,n,r){const s=this.createUrl(t);return(await Aa.post(s,n,r)).data}async put(t,n,r){const s=this.createUrl(t);return(await Aa.put(s,n,r)).data}async patch(t,n,r){const s=this.createUrl(t);return(await Aa.patch(s,n,r)).data}async delete(t,n){const r=this.createUrl(t);return(await Aa.delete(r,n)).data}createUrl(t){return this.baseUrl?`${this.baseUrl}${t}`:t}}class XX{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 ta=new XX;class QX{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 JX=new QX;function eQ({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:oe("fixed top-0 right-0 left-0 z-50 h-1 transition-opacity duration-300",!s&&"opacity-0",t),children:a.jsx("div",{className:"bg-primary h-full transition-all duration-300 ease-out",style:{width:`${n.toString()}%`}})})}const BO=h.createContext({isLoading:!1});function tQ({children:e}){const[t,n]=h.useState(0),r=t>0;return h.useEffect(()=>{const s=Aa.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=Aa.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()=>{Aa.interceptors.request.eject(s),Aa.interceptors.response.eject(i)}},[]),a.jsx(BO.Provider,{value:{isLoading:r},children:e})}function nQ(){return h.useContext(BO)}function rQ(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 aQ=e=>{switch(e){case"success":return iQ;case"info":return cQ;case"warning":return lQ;case"error":return uQ;default:return null}},sQ=Array(12).fill(0),oQ=({visible:e,className:t})=>re.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},re.createElement("div",{className:"sonner-spinner"},sQ.map((n,r)=>re.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),iQ=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"})),lQ=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"})),cQ=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"})),uQ=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"})),dQ=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"})),fQ=()=>{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 q1=1;class hQ{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:q1++,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(pQ(m)&&!m.ok){i=!1;const g=typeof n.error=="function"?await n.error(`HTTP error! status: ${m.status}`):n.error,y=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:y,...C})}else if(m instanceof Error){i=!1;const g=typeof n.error=="function"?await n.error(m):n.error,y=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:y,...C})}else if(n.success!==void 0){i=!1;const g=typeof n.success=="function"?await n.success(m):n.success,y=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:y,...C})}}).catch(async m=>{if(c=["reject",m],n.error!==void 0){i=!1;const x=typeof n.error=="function"?await n.error(m):n.error,g=typeof n.description=="function"?await n.description(m):n.description,v=typeof x=="object"&&!re.isValidElement(x)?x:{message:x};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,x)=>u.then(()=>c[0]==="reject"?x(c[1]):m(c[1])).catch(x));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)||q1++;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 _a=new hQ,mQ=(e,t)=>{const n=(t==null?void 0:t.id)||q1++;return _a.addToast({title:e,...t,id:n}),n},pQ=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",gQ=mQ,xQ=()=>_a.toasts,yQ=()=>_a.getActiveToasts(),al=Object.assign(gQ,{success:_a.success,info:_a.info,warning:_a.warning,error:_a.error,custom:_a.custom,message:_a.message,promise:_a.promise,dismiss:_a.dismiss,loading:_a.loading},{getHistory:xQ,getToasts:yQ});rQ("[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 Wp(e){return e.label!==void 0}const vQ=3,bQ="24px",SQ="16px",Z_=4e3,CQ=356,EQ=14,wQ=45,RQ=200;function co(...e){return e.filter(Boolean).join(" ")}function jQ(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const TQ=e=>{var t,n,r,s,i,c,u,f,m;const{invert:x,toast:g,unstyled:y,interacting:v,setHeights:C,visibleToasts:S,heights:E,index:j,toasts:R,expanded:T,removeToast:N,defaultRichColors:A,closeButton:I,style:_,cancelButtonStyle:M,actionButtonStyle:G,className:H="",descriptionClassName:L="",duration:q,position:W,gap:B,expandByDefault:V,classNames:D,icons:F,closeButtonAriaLabel:U="Close toast"}=e,[ee,he]=re.useState(null),[z,$]=re.useState(null),[P,K]=re.useState(!1),[Y,se]=re.useState(!1),[Q,le]=re.useState(!1),[pe,be]=re.useState(!1),[ze,Re]=re.useState(!1),[Ge,ot]=re.useState(0),[Vt,He]=re.useState(0),Xt=re.useRef(g.duration||q||Z_),gn=re.useRef(null),ke=re.useRef(null),It=j===0,Z=j+1<=S,ae=g.type,ge=g.dismissible!==!1,Te=g.className||"",Oe=g.descriptionClassName||"",je=re.useMemo(()=>E.findIndex(Xe=>Xe.toastId===g.id)||0,[E,g.id]),Ve=re.useMemo(()=>{var Xe;return(Xe=g.closeButton)!=null?Xe:I},[g.closeButton,I]),lt=re.useMemo(()=>g.duration||q||Z_,[g.duration,q]),dt=re.useRef(0),vn=re.useRef(0),Wn=re.useRef(0),$n=re.useRef(null),[La,bn]=W.split("-"),Qn=re.useMemo(()=>E.reduce((Xe,nn,cn)=>cn>=je?Xe:Xe+nn.height,0),[E,je]),Vn=fQ(),_s=g.invert||x,ls=ae==="loading";vn.current=re.useMemo(()=>je*B+Qn,[je,Qn]),re.useEffect(()=>{Xt.current=lt},[lt]),re.useEffect(()=>{K(!0)},[]),re.useEffect(()=>{const Xe=ke.current;if(Xe){const nn=Xe.getBoundingClientRect().height;return He(nn),C(cn=>[{toastId:g.id,height:nn,position:g.position},...cn]),()=>C(cn=>cn.filter(rn=>rn.toastId!==g.id))}},[C,g.id]),re.useLayoutEffect(()=>{if(!P)return;const Xe=ke.current,nn=Xe.style.height;Xe.style.height="auto";const cn=Xe.getBoundingClientRect().height;Xe.style.height=nn,He(cn),C(rn=>rn.find(dn=>dn.toastId===g.id)?rn.map(dn=>dn.toastId===g.id?{...dn,height:cn}:dn):[{toastId:g.id,height:cn,position:g.position},...rn])},[P,g.title,g.description,C,g.id,g.jsx,g.action,g.cancel]);const kr=re.useCallback(()=>{se(!0),ot(vn.current),C(Xe=>Xe.filter(nn=>nn.toastId!==g.id)),setTimeout(()=>{N(g)},RQ)},[g,N,C,vn]);re.useEffect(()=>{if(g.promise&&ae==="loading"||g.duration===1/0||g.type==="loading")return;let Xe;return T||v||Vn?(()=>{if(Wn.current<dt.current){const rn=new Date().getTime()-dt.current;Xt.current=Xt.current-rn}Wn.current=new Date().getTime()})():(()=>{Xt.current!==1/0&&(dt.current=new Date().getTime(),Xe=setTimeout(()=>{g.onAutoClose==null||g.onAutoClose.call(g,g),kr()},Xt.current))})(),()=>clearTimeout(Xe)},[T,v,g,ae,Vn,kr]),re.useEffect(()=>{g.delete&&(kr(),g.onDismiss==null||g.onDismiss.call(g,g))},[kr,g.delete]);function Pa(){var Xe;if(F!=null&&F.loading){var nn;return re.createElement("div",{className:co(D==null?void 0:D.loader,g==null||(nn=g.classNames)==null?void 0:nn.loader,"sonner-loader"),"data-visible":ae==="loading"},F.loading)}return re.createElement(oQ,{className:co(D==null?void 0:D.loader,g==null||(Xe=g.classNames)==null?void 0:Xe.loader),visible:ae==="loading"})}const Ns=g.icon||(F==null?void 0:F[ae])||aQ(ae);var _n,Ln;return re.createElement("li",{tabIndex:0,ref:ke,className:co(H,Te,D==null?void 0:D.toast,g==null||(t=g.classNames)==null?void 0:t.toast,D==null?void 0:D.default,D==null?void 0:D[ae],g==null||(n=g.classNames)==null?void 0:n[ae]),"data-sonner-toast":"","data-rich-colors":(_n=g.richColors)!=null?_n:A,"data-styled":!(g.jsx||g.unstyled||y),"data-mounted":P,"data-promise":!!g.promise,"data-swiped":ze,"data-removed":Y,"data-visible":Z,"data-y-position":La,"data-x-position":bn,"data-index":j,"data-front":It,"data-swiping":Q,"data-dismissible":ge,"data-type":ae,"data-invert":_s,"data-swipe-out":pe,"data-swipe-direction":z,"data-expanded":!!(T||V&&P),"data-testid":g.testId,style:{"--index":j,"--toasts-before":j,"--z-index":R.length-j,"--offset":`${Y?Ge:vn.current}px`,"--initial-height":V?"auto":`${Vt}px`,..._,...g.style},onDragEnd:()=>{le(!1),he(null),$n.current=null},onPointerDown:Xe=>{Xe.button!==2&&(ls||!ge||(gn.current=new Date,ot(vn.current),Xe.target.setPointerCapture(Xe.pointerId),Xe.target.tagName!=="BUTTON"&&(le(!0),$n.current={x:Xe.clientX,y:Xe.clientY})))},onPointerUp:()=>{var Xe,nn,cn;if(pe||!ge)return;$n.current=null;const rn=Number(((Xe=ke.current)==null?void 0:Xe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Gn=Number(((nn=ke.current)==null?void 0:nn.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),dn=new Date().getTime()-((cn=gn.current)==null?void 0:cn.getTime()),un=ee==="x"?rn:Gn,Lr=Math.abs(un)/dn;if(Math.abs(un)>=wQ||Lr>.11){ot(vn.current),g.onDismiss==null||g.onDismiss.call(g,g),$(ee==="x"?rn>0?"right":"left":Gn>0?"down":"up"),kr(),be(!0);return}else{var X,te;(X=ke.current)==null||X.style.setProperty("--swipe-amount-x","0px"),(te=ke.current)==null||te.style.setProperty("--swipe-amount-y","0px")}Re(!1),le(!1),he(null)},onPointerMove:Xe=>{var nn,cn,rn;if(!$n.current||!ge||((nn=window.getSelection())==null?void 0:nn.toString().length)>0)return;const dn=Xe.clientY-$n.current.y,un=Xe.clientX-$n.current.x;var Lr;const X=(Lr=e.swipeDirections)!=null?Lr:jQ(W);!ee&&(Math.abs(un)>1||Math.abs(dn)>1)&&he(Math.abs(un)>Math.abs(dn)?"x":"y");let te={x:0,y:0};const ue=Ce=>1/(1.5+Math.abs(Ce)/20);if(ee==="y"){if(X.includes("top")||X.includes("bottom"))if(X.includes("top")&&dn<0||X.includes("bottom")&&dn>0)te.y=dn;else{const Ce=dn*ue(dn);te.y=Math.abs(Ce)<Math.abs(dn)?Ce:dn}}else if(ee==="x"&&(X.includes("left")||X.includes("right")))if(X.includes("left")&&un<0||X.includes("right")&&un>0)te.x=un;else{const Ce=un*ue(un);te.x=Math.abs(Ce)<Math.abs(un)?Ce:un}(Math.abs(te.x)>0||Math.abs(te.y)>0)&&Re(!0),(cn=ke.current)==null||cn.style.setProperty("--swipe-amount-x",`${te.x}px`),(rn=ke.current)==null||rn.style.setProperty("--swipe-amount-y",`${te.y}px`)}},Ve&&!g.jsx&&ae!=="loading"?re.createElement("button",{"aria-label":U,"data-disabled":ls,"data-close-button":!0,onClick:ls||!ge?()=>{}:()=>{kr(),g.onDismiss==null||g.onDismiss.call(g,g)},className:co(D==null?void 0:D.closeButton,g==null||(r=g.classNames)==null?void 0:r.closeButton)},(Ln=F==null?void 0:F.close)!=null?Ln:dQ):null,(ae||g.icon||g.promise)&&g.icon!==null&&((F==null?void 0:F[ae])!==null||g.icon)?re.createElement("div",{"data-icon":"",className:co(D==null?void 0:D.icon,g==null||(s=g.classNames)==null?void 0:s.icon)},g.promise||g.type==="loading"&&!g.icon?g.icon||Pa():null,g.type!=="loading"?Ns:null):null,re.createElement("div",{"data-content":"",className:co(D==null?void 0:D.content,g==null||(i=g.classNames)==null?void 0:i.content)},re.createElement("div",{"data-title":"",className:co(D==null?void 0:D.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:co(L,Oe,D==null?void 0:D.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&&Wp(g.cancel)?re.createElement("button",{"data-button":!0,"data-cancel":!0,style:g.cancelButtonStyle||M,onClick:Xe=>{Wp(g.cancel)&&ge&&(g.cancel.onClick==null||g.cancel.onClick.call(g.cancel,Xe),kr())},className:co(D==null?void 0:D.cancelButton,g==null||(f=g.classNames)==null?void 0:f.cancelButton)},g.cancel.label):null,re.isValidElement(g.action)?g.action:g.action&&Wp(g.action)?re.createElement("button",{"data-button":!0,"data-action":!0,style:g.actionButtonStyle||G,onClick:Xe=>{Wp(g.action)&&(g.action.onClick==null||g.action.onClick.call(g.action,Xe),!Xe.defaultPrevented&&kr())},className:co(D==null?void 0:D.actionButton,g==null||(m=g.classNames)==null?void 0:m.actionButton)},g.action.label):null)};function Y_(){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 _Q(e,t){const n={};return[e,t].forEach((r,s)=>{const i=s===1,c=i?"--mobile-offset":"--offset",u=i?SQ:bQ;function f(m){["top","right","bottom","left"].forEach(x=>{n[`${c}-${x}`]=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 NQ=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:x,mobileOffset:g,theme:y="light",richColors:v,duration:C,style:S,visibleToasts:E=vQ,toastOptions:j,dir:R=Y_(),gap:T=EQ,icons:N,containerAriaLabel:A="Notifications"}=t,[I,_]=re.useState([]),M=re.useMemo(()=>r?I.filter(P=>P.toasterId===r):I.filter(P=>!P.toasterId),[I,r]),G=re.useMemo(()=>Array.from(new Set([i].concat(M.filter(P=>P.position).map(P=>P.position)))),[M,i]),[H,L]=re.useState([]),[q,W]=re.useState(!1),[B,V]=re.useState(!1),[D,F]=re.useState(y!=="system"?y:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),U=re.useRef(null),ee=c.join("+").replace(/Key/g,"").replace(/Digit/g,""),he=re.useRef(null),z=re.useRef(!1),$=re.useCallback(P=>{_(K=>{var Y;return(Y=K.find(se=>se.id===P.id))!=null&&Y.delete||_a.dismiss(P.id),K.filter(({id:se})=>se!==P.id)})},[]);return re.useEffect(()=>_a.subscribe(P=>{if(P.dismiss){requestAnimationFrame(()=>{_(K=>K.map(Y=>Y.id===P.id?{...Y,delete:!0}:Y))});return}setTimeout(()=>{i4.flushSync(()=>{_(K=>{const Y=K.findIndex(se=>se.id===P.id);return Y!==-1?[...K.slice(0,Y),{...K[Y],...P},...K.slice(Y+1)]:[P,...K]})})})}),[I]),re.useEffect(()=>{if(y!=="system"){F(y);return}if(y==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?F("dark"):F("light")),typeof window>"u")return;const P=window.matchMedia("(prefers-color-scheme: dark)");try{P.addEventListener("change",({matches:K})=>{F(K?"dark":"light")})}catch{P.addListener(({matches:Y})=>{try{F(Y?"dark":"light")}catch(se){console.error(se)}})}},[y]),re.useEffect(()=>{I.length<=1&&W(!1)},[I]),re.useEffect(()=>{const P=K=>{var Y;if(c.every(le=>K[le]||K.code===le)){var Q;W(!0),(Q=U.current)==null||Q.focus()}K.code==="Escape"&&(document.activeElement===U.current||(Y=U.current)!=null&&Y.contains(document.activeElement))&&W(!1)};return document.addEventListener("keydown",P),()=>document.removeEventListener("keydown",P)},[c]),re.useEffect(()=>{if(U.current)return()=>{he.current&&(he.current.focus({preventScroll:!0}),he.current=null,z.current=!1)}},[U.current]),re.createElement("section",{ref:n,"aria-label":`${A} ${ee}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},G.map((P,K)=>{var Y;const[se,Q]=P.split("-");return M.length?re.createElement("ol",{key:P,dir:R==="auto"?Y_():R,tabIndex:-1,ref:U,className:m,"data-sonner-toaster":!0,"data-sonner-theme":D,"data-y-position":se,"data-x-position":Q,style:{"--front-toast-height":`${((Y=H[0])==null?void 0:Y.height)||0}px`,"--width":`${CQ}px`,"--gap":`${T}px`,...S,..._Q(x,g)},onBlur:le=>{z.current&&!le.currentTarget.contains(le.relatedTarget)&&(z.current=!1,he.current&&(he.current.focus({preventScroll:!0}),he.current=null))},onFocus:le=>{le.target instanceof HTMLElement&&le.target.dataset.dismissible==="false"||z.current||(z.current=!0,he.current=le.relatedTarget)},onMouseEnter:()=>W(!0),onMouseMove:()=>W(!0),onMouseLeave:()=>{B||W(!1)},onDragEnd:()=>W(!1),onPointerDown:le=>{le.target instanceof HTMLElement&&le.target.dataset.dismissible==="false"||V(!0)},onPointerUp:()=>V(!1)},M.filter(le=>!le.position&&K===0||le.position===P).map((le,pe)=>{var be,ze;return re.createElement(TQ,{key:le.id,icons:N,index:pe,toast:le,defaultRichColors:v,duration:(be=j==null?void 0:j.duration)!=null?be:C,className:j==null?void 0:j.className,descriptionClassName:j==null?void 0:j.descriptionClassName,invert:s,visibleToasts:E,closeButton:(ze=j==null?void 0:j.closeButton)!=null?ze:f,interacting:B,position:P,style:j==null?void 0:j.style,unstyled:j==null?void 0:j.unstyled,classNames:j==null?void 0:j.classNames,cancelButtonStyle:j==null?void 0:j.cancelButtonStyle,actionButtonStyle:j==null?void 0:j.actionButtonStyle,closeButtonAriaLabel:j==null?void 0:j.closeButtonAriaLabel,removeToast:$,toasts:M.filter(Re=>Re.position==le.position),heights:H.filter(Re=>Re.position==le.position),setHeights:L,expandByDefault:u,gap:T,expanded:q,swipeDirections:t.swipeDirections})})):null}))}),AQ=({...e})=>{const{theme:t="system"}=Yh();return a.jsx(NQ,{theme:t,className:"toaster group",icons:{success:a.jsx(Ah,{className:"size-4"}),info:a.jsx(_r,{className:"size-4"}),warning:a.jsx(Oh,{className:"size-4"}),error:a.jsx(S4,{className:"size-4"}),loading:a.jsx(Uc,{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 DQ(){return a.jsx(fX,{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 OQ({children:e}){const{isLoading:t}=fO(),n=hO(),r=Cx(),s=Qs();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 X_="sidebar_state";function IQ(){const{state:e,isMobile:t}=zh(),r=t||e==="collapsed",{isLoading:s}=nQ();return a.jsxs(a.Fragment,{children:[a.jsx(AQ,{position:"bottom-right",closeButton:!0}),a.jsx(DQ,{}),a.jsx(eQ,{isLoading:s}),a.jsxs(EZ,{redirectTo:"/auth/sign-in",children:[a.jsx(ZX,{variant:"inset",collapsible:"icon"}),a.jsxs(AB,{className:"min-w-0",children:[r&&a.jsx(_B,{}),a.jsx(OQ,{children:a.jsx(GS,{})})]})]})]})}function MQ(){const[e,t]=h.useState(()=>ta.get(X_,"boolean")??!0),n=r=>{t(r),ta.set(X_,r)};return a.jsx(YX,{children:a.jsx(tQ,{children:a.jsx(jB,{open:e,onOpenChange:n,children:a.jsx(IQ,{})})})})}function kQ(){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 K1(){return a.jsxs("div",{className:"dm-empty-state-404page",children:[a.jsxs("div",{className:"dm-empty-state-404page-foreground",children:[a.jsx(KF,{className:"dm-empty-state-ico",strokeWidth:1}),a.jsx("h1",{className:"dm-empty-state-title",children:"Lost in the 404th Data Realm"}),a.jsxs("p",{className:"dm-empty-state-subtitle",children:["In this dimension, ",a.jsx("code",{children:"1+1=3"}),", percentages exceed 100%, and dashboards predict"," ",a.jsx("i",{children:"yesterday"}),".",a.jsx("br",{}),"Escape while you can!"]}),a.jsx(we,{variant:"default",asChild:!0,children:a.jsxs(Nr,{to:"/",className:"flex items-center gap-1","aria-label":"Guide Me Home",children:["Guide Me Home",a.jsx(ba,{className:"h-4 w-4"})]})})]}),a.jsx("div",{className:"dm-empty-state-404page-background"})]})}const LQ={items:[],loading:!1,error:null};function PQ(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 qO=h.createContext(void 0);function UQ({children:e}){const[t,n]=h.useReducer(PQ,LQ);return a.jsx(qO.Provider,{value:{state:t,dispatch:n},children:e})}function zQ(){const e=h.useContext(qO);if(e===void 0)throw new Error("useDataMartListContext must be used within a DataMartListProvider");return e}class FQ extends _l{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 FQ;var br=(e=>(e.DRAFT="DRAFT",e.PUBLISHED="PUBLISHED",e))(br||{}),$e=(e=>(e.SQL="SQL",e.TABLE="TABLE",e.VIEW="VIEW",e.TABLE_PATTERN="TABLE_PATTERN",e.CONNECTOR="CONNECTOR",e))($e||{}),bg=(e=>(e.ALREADY_PUBLISHED="ALREADY_PUBLISHED",e.INVALID_STORAGE="INVALID_STORAGE",e.MISSING_DEFINITION="MISSING_DEFINITION",e))(bg||{});const HQ={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 ex=(e=>(e.SCHEDULED="scheduled",e.MANUAL="manual",e))(ex||{}),dr=(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))(dr||{}),Nt=(e=>(e.PENDING="PENDING",e.RUNNING="RUNNING",e.SUCCESS="SUCCESS",e.FAILED="FAILED",e.CANCELLED="CANCELLED",e.INTERRUPTED="INTERRUPTED",e.RESTRICTED="RESTRICTED",e))(Nt||{});const KO={statuses:{[br.DRAFT]:{code:br.DRAFT,displayName:"Draft",description:"Data mart is in draft mode and not yet published"},[br.PUBLISHED]:{code:br.PUBLISHED,displayName:"Published",description:"Data mart is published and available for use"}},getInfo(e){return this.statuses[e]},getAllStatuses(){return Object.values(this.statuses)}};var Wr=(e=>(e.NO_RUNS="no_runs",e.ALL_RUNS_SUCCESS="all_success",e.MIXED_RUNS="mixed",e.ALL_RUNS_FAILED="all_failed",e.RUNS_IN_PROGRESS="in_progress",e))(Wr||{});const WO=e=>e?/^[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+$/.test(e):!1,ZO=e=>e?/^[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+\.[a-zA-Z0-9_\-*]+$/.test(e):!1,$Q=e=>e?WO(e)?"":"Invalid format. Expected: project.dataset.object":"Fully qualified name is required",VQ=e=>e?ZO(e)?"":"Invalid format. Expected: project.dataset.table_* (with wildcards)":"Table pattern is required",YO=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)},XO=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)},GQ=e=>e?YO(e)?"":"Invalid format. Expected: database.object or catalog.database.object":"Fully qualified name is required",BQ=e=>e?XO(e)?"":"Invalid format. Expected: database.table_* or catalog.database.table_* (with wildcards)":"Table pattern is required";var Bs=(e=>(e.PASSWORD="PASSWORD",e.KEY_PAIR="KEY_PAIR",e))(Bs||{}),fr=(e=>(e.SERVERLESS="SERVERLESS",e.PROVISIONED="PROVISIONED",e))(fr||{}),tx=(e=>(e.PERSONAL_ACCESS_TOKEN="PERSONAL_ACCESS_TOKEN",e))(tx||{});const qQ=[{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 KQ(e){return"projectId"in e}function WQ(e){return"outputBucket"in e}var ce=(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))(ce||{}),ci=(e=>(e.ACTIVE="active",e.COMING_SOON="coming_soon",e))(ci||{});const ZQ=({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})]})},YQ=({type:e,config:t})=>{const n={[ce.GOOGLE_BIGQUERY]:[{label:"Project ID",key:"projectId"},{label:"Location",key:"location"}],[ce.AWS_ATHENA]:[{label:"Region",key:"region"},{label:"Output Bucket",key:"outputBucket"}],[ce.SNOWFLAKE]:[],[ce.DATABRICKS]:[],[ce.AWS_REDSHIFT]:[],[ce.AZURE_SYNAPSE]:[]},r=t&&(e===ce.GOOGLE_BIGQUERY&&KQ(t)||e===ce.AWS_ATHENA&&WQ(t));return a.jsx("div",{className:"grid gap-2",children:n[e].map(({label:s,key:i})=>{let c;return r&&(c=(e===ce.GOOGLE_BIGQUERY,t[i])),a.jsx(ZQ,{label:s,value:c},i)})})},XQ=({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(YQ,{type:e,config:t})]})}),QQ=Pc("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?_h:"span";return a.jsx(s,{"data-slot":"badge",className:oe(QQ({variant:t}),e),...r})}function QO(e){return e.type===ce.GOOGLE_BIGQUERY}function JO(e){return e.type===ce.AWS_ATHENA}function e5(e){return e.type===ce.SNOWFLAKE}const Nl={types:{[ce.GOOGLE_BIGQUERY]:{type:ce.GOOGLE_BIGQUERY,displayName:"Google BigQuery",icon:gO,status:ci.ACTIVE},[ce.AWS_ATHENA]:{type:ce.AWS_ATHENA,displayName:"AWS Athena",icon:xO,status:ci.ACTIVE},[ce.SNOWFLAKE]:{type:ce.SNOWFLAKE,displayName:"Snowflake",icon:yO,status:ci.ACTIVE},[ce.AWS_REDSHIFT]:{type:ce.AWS_REDSHIFT,displayName:"AWS Redshift",icon:bO,status:ci.ACTIVE},[ce.DATABRICKS]:{type:ce.DATABRICKS,displayName:"Databricks",icon:vO,status:ci.ACTIVE},[ce.AZURE_SYNAPSE]:{type:ce.AZURE_SYNAPSE,displayName:"Azure Synapse",icon:OZ,status:ci.COMING_SOON}},getInfo(e){return this.types[e]},getAllTypes(){return Object.values(this.types)}};function JQ({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(Kr,{className:"h-5 w-24"}),a.jsx(Kr,{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}=Nl.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(XQ,{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 eJ(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 t5(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 tJ(e,t){const n=encodeURIComponent(e),r=encodeURIComponent(t);return`https://console.cloud.google.com/bigquery?project=${n}&ws=!1m4!1m3!3m2!1s${n}!2s${r}`}function nJ(e){return`https://console.aws.amazon.com/athena/home?region=${encodeURIComponent(e)}#/query-editor`}function rJ(e){return`https://${e}.snowflakecomputing.com/`}function aJ(e,t){const n=eJ(t);if(!n)return null;const{dataset:r,table:s}=n;return QO(e)?t5(e.config.projectId,r,s):JO(e)?nJ(e.config.region):e5(e)?rJ(e.config.account):null}function sJ(e,t){const n=aJ(e,t);return n?(window.open(n,"_blank","noopener,noreferrer"),!0):!1}function oJ(e){return QO(e)?"Open table in Google BigQuery":JO(e)?"Open region in AWS Athena":e5(e)?"Open console in Snowflake":"Open data in storage"}function n5(e){switch(e.type){case ce.GOOGLE_BIGQUERY:return!!(e.config.projectId&&e.config.location);case ce.AWS_ATHENA:return!!(e.config.region&&e.config.outputBucket);case ce.SNOWFLAKE:return!!(e.config.account&&e.config.warehouse);case ce.AWS_REDSHIFT:{const t=e.config;return t.connectionType===fr.SERVERLESS?!!(t.region&&t.database&&t.workgroupName):!!(t.region&&t.database&&t.clusterIdentifier)}case ce.DATABRICKS:return!!(e.config.host&&e.config.httpPath);default:return!1}}const r5=Yt({accessKeyId:yt().min(1,"Access Key ID is required"),secretAccessKey:yt().min(1,"Secret Access Key is required")}),iJ=Yt({authMethod:or(Bs.PASSWORD),username:yt().min(1,"Username is required"),password:yt().min(1,"Password is required")}),lJ=Yt({authMethod:or(Bs.KEY_PAIR),username:yt().min(1,"Username is required"),privateKey:yt().min(1,"Private Key is required"),privateKeyPassphrase:yt().optional()}),cJ=Xx("authMethod",[iJ,lJ]),uJ=Yt({projectId:yt().min(1,"Project ID is required"),location:yt().min(1,"Location is required")}),dJ=Yt({region:yt().min(1,"Region is required"),outputBucket:yt().min(1,"Output Bucket is required")}),fJ=Yt({account:yt().min(1,"Account is required"),warehouse:yt().min(1,"Warehouse is required")}),hJ=Yt({connectionType:or(fr.SERVERLESS),region:yt().min(1,"Region is required"),database:yt().min(1,"Database is required"),workgroupName:yt().min(1,"Workgroup Name is required")}),mJ=Yt({connectionType:or(fr.PROVISIONED),region:yt().min(1,"Region is required"),database:yt().min(1,"Database is required"),clusterIdentifier:yt().min(1,"Cluster Identifier is required")}),pJ=Xx("connectionType",[hJ,mJ]),gJ=Yt({authMethod:or(tx.PERSONAL_ACCESS_TOKEN),token:yt().min(1,"Token is required")}),xJ=Yt({host:yt().min(1,"Host is required"),httpPath:yt().min(1,"HTTP Path is required")}),Xh=Yt({title:yt().min(1,"Title is required").max(255,"Title must be 255 characters or less")}),yJ=Xh.extend({type:or(ce.GOOGLE_BIGQUERY),credentials:jO,config:uJ}),vJ=Xh.extend({type:or(ce.AWS_ATHENA),credentials:r5,config:dJ}),bJ=Xh.extend({type:or(ce.SNOWFLAKE),credentials:cJ,config:fJ}),SJ=Xh.extend({type:or(ce.AWS_REDSHIFT),credentials:r5,config:pJ}),CJ=Xh.extend({type:or(ce.DATABRICKS),credentials:gJ,config:xJ}),EJ=Xx("type",[yJ,vJ,bJ,SJ,CJ]),a5=e=>{if(!e)return!1;const t='(?:[a-zA-Z0-9_$]+|"[^"]+")';return new RegExp(`^[a-zA-Z0-9_$]+\\.${t}\\.${t}$`).test(e)},s5=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)},wJ=e=>e?a5(e)?"":"Invalid format. Expected: database.schema.object":"Fully qualified name is required",RJ=e=>e?s5(e)?"":"Invalid format. Expected: database.schema.table_* (with wildcards)":"Table pattern is required",o5=e=>{if(!e)return!1;const t='(?:[a-zA-Z0-9_-]+|"[^"]+")',n=new RegExp(`^${t}\\.${t}$`),r=new RegExp(`^${t}\\.${t}\\.${t}$`);return n.test(e)||r.test(e)},i5=e=>{if(!e)return!1;const t='(?:[a-zA-Z0-9_-]+|"[^"]+")',n='(?:[a-zA-Z0-9_\\-*]+|"[^"]+")',r=new RegExp(`^${t}\\.${n}$`),s=new RegExp(`^${t}\\.${t}\\.${n}$`);return r.test(e)||s.test(e)},jJ=e=>e?o5(e)?"":"Invalid format. Expected: schema.object or database.schema.object":"Fully qualified name is required",TJ=e=>e?i5(e)?"":"Invalid format. Expected: schema.table_* or database.schema.table_* (with wildcards)":"Table pattern is required",l5=e=>e?/^[a-zA-Z0-9_`]+\.[a-zA-Z0-9_`]+\.[a-zA-Z0-9_`]+$/.test(e):!1,c5=e=>e?/^[a-zA-Z0-9_`]+\.[a-zA-Z0-9_`]+\.[a-zA-Z0-9_*`]+$/.test(e):!1,_J=e=>e?l5(e)?"":"Invalid format. Expected: catalog.schema.table (e.g., main.my_schema.my_table)":"Fully qualified name is required",NJ=e=>e?c5(e)?"":"Invalid format. Expected: catalog.schema.table_pattern (e.g., main.my_schema.table_*)":"Table pattern is required",AJ=(e,t)=>{if(!e)return!1;switch(t){case ce.GOOGLE_BIGQUERY:return WO(e);case ce.AWS_ATHENA:return YO(e);case ce.SNOWFLAKE:return a5(e);case ce.AWS_REDSHIFT:return o5(e);case ce.DATABRICKS:return l5(e);default:return!1}},DJ=(e,t)=>{if(!e)return!1;switch(t){case ce.GOOGLE_BIGQUERY:return ZO(e);case ce.AWS_ATHENA:return XO(e);case ce.SNOWFLAKE:return s5(e);case ce.AWS_REDSHIFT:return i5(e);case ce.DATABRICKS:return c5(e);default:return!1}},OJ=(e,t)=>{if(!e)return"Fully qualified name is required";switch(t){case ce.GOOGLE_BIGQUERY:return $Q(e);case ce.AWS_ATHENA:return GQ(e);case ce.SNOWFLAKE:return wJ(e);case ce.AWS_REDSHIFT:return jJ(e);case ce.DATABRICKS:return _J(e);default:return"Unsupported storage type"}},IJ=(e,t)=>{if(!e)return"Table pattern is required";switch(t){case ce.GOOGLE_BIGQUERY:return VQ(e);case ce.AWS_ATHENA:return BQ(e);case ce.SNOWFLAKE:return RJ(e);case ce.AWS_REDSHIFT:return TJ(e);case ce.DATABRICKS:return NJ(e);default:return"Unsupported storage type"}},u5=e=>{switch(e){case ce.GOOGLE_BIGQUERY:return"project.dataset.table";case ce.AWS_ATHENA:return"database.table or catalog.database.table";case ce.SNOWFLAKE:return"database.schema.table";case ce.AWS_REDSHIFT:return"schema.table or database.schema.table";case ce.DATABRICKS:return"catalog.schema.table";default:return""}},MJ=e=>{switch(e){case ce.GOOGLE_BIGQUERY:return"project.dataset.table_*";case ce.AWS_ATHENA:return"database.table_* or catalog.database.table_*";case ce.SNOWFLAKE:return"database.schema.table_*";case ce.AWS_REDSHIFT:return"schema.table_* or database.schema.table_*";case ce.DATABRICKS:return"catalog.schema.table_*";default:return""}},d5=e=>{switch(e){case ce.GOOGLE_BIGQUERY:return"Enter the fully qualified name of the table (e.g., project.dataset.table)";case ce.AWS_ATHENA:return"Enter the fully qualified name of the table (e.g., database.table or catalog.database.table)";case ce.SNOWFLAKE:return"Enter the fully qualified name of the table (e.g., database.schema.table)";case ce.AWS_REDSHIFT:return"Enter the fully qualified name of the table (e.g., schema.table or database.schema.table)";case ce.DATABRICKS:return"Enter the fully qualified name of the table (e.g., catalog.schema.table)";default:return""}},kJ=e=>{switch(e){case ce.GOOGLE_BIGQUERY:return'Enter a pattern to match multiple tables (e.g., project.dataset.table_* will match all tables starting with "table_")';case ce.AWS_ATHENA:return'Enter a pattern to match multiple tables (e.g., database.table_* will match all tables starting with "table_")';case ce.SNOWFLAKE:return'Enter a pattern to match multiple tables (e.g., database.schema.table_* will match all tables starting with "table_")';case ce.AWS_REDSHIFT:return'Enter a pattern to match multiple tables (e.g., schema.table_* will match all tables starting with "table_")';case ce.DATABRICKS:return'Enter a pattern to match multiple tables (e.g., catalog.schema.table_* will match all tables starting with "table_")';default:return""}};var En=(e=>(e.SUCCESS="success",e.ERROR="error",e.WARNING="warning",e.INFO="info",e.NEUTRAL="neutral",e))(En||{});const LJ={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:""},PJ=e=>LJ[e],UJ={[En.SUCCESS]:{icon:Ah,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"}},[En.ERROR]:{icon:S4,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"}},[En.WARNING]:{icon:Oh,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"}},[En.INFO]:{icon:_r,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"}},[En.NEUTRAL]:{icon:_r,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 Td({type:e=En.NEUTRAL,variant:t="ghost",showIcon:n=!0,children:r,className:s}){const{icon:i,colors:c}=UJ[e],u=f=>{const m="inline-flex items-center gap-1 text-sm",x=PJ(f),g=c[f];return oe(m,x,g,s)};return a.jsxs("span",{className:u(t),children:[n&&a.jsx(i,{className:"h-4 w-4","data-testid":"icon"}),r]})}const f5=/^https:\/\/(docs|spreadsheets)\.google\.com\/spreadsheets\/d\/([a-zA-Z0-9-_]+)/,zJ=/[#&]gid=([0-9]+)/;function h5(e){return f5.test(e)}function FJ(e){const t=f5.exec(e);return t?t[2]:""}function HJ(e){const t=zJ.exec(e);return t?t[1]:"0"}function $J(e){return{spreadsheetId:FJ(e),sheetId:parseInt(HJ(e),10)}}function UC(e,t){return`https://docs.google.com/spreadsheets/d/${e}/edit#gid=${String(t)}`}function VJ(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 Tb(e){return VJ(e,"client_email")}const m5=h.createContext(void 0);var ht=(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))(ht||{}),Hr=(e=>(e.GOOGLE_SHEETS_CONFIG="google-sheets-config",e.LOOKER_STUDIO_CONFIG="looker-studio-config",e.EMAIL_CONFIG="email-config",e))(Hr||{}),en=(e=>(e.SUCCESS="SUCCESS",e.ERROR="ERROR",e.RUNNING="RUNNING",e.CANCELLED="CANCELLED",e.RESTRICTED="RESTRICTED",e))(en||{}),kn=(e=>(e.EDIT="edit",e.CREATE="create",e))(kn||{});const GJ={reports:[],destinations:[],currentReport:null,loading:!1,error:null,polledReportIds:[]};function BJ(e,t){switch(t.type){case ht.FETCH_REPORTS_START:case ht.FETCH_REPORT_START:case ht.CREATE_REPORT_START:case ht.UPDATE_REPORT_START:case ht.DELETE_REPORT_START:return{...e,loading:!0,error:null};case ht.FETCH_REPORTS_SUCCESS:return{...e,reports:t.payload,loading:!1,error:null};case ht.FETCH_DESTINATIONS_SUCCESS:return{...e,destinations:t.payload,loading:!1,error:null};case ht.FETCH_REPORT_SUCCESS:return{...e,currentReport:t.payload,loading:!1,error:null};case ht.CREATE_REPORT_SUCCESS:return{...e,reports:[...e.reports,t.payload],loading:!1,error:null};case ht.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 ht.DELETE_REPORT_SUCCESS:return{...e,reports:e.reports.filter(n=>n.id!==t.payload),loading:!1,error:null};case ht.FETCH_REPORTS_ERROR:case ht.FETCH_REPORT_ERROR:case ht.FETCH_DESTINATIONS_ERROR:case ht.CREATE_REPORT_ERROR:case ht.UPDATE_REPORT_ERROR:case ht.DELETE_REPORT_ERROR:return{...e,loading:!1,error:t.payload};case ht.CLEAR_CURRENT_REPORT:return{...e,currentReport:null};case ht.CLEAR_ERROR:return{...e,error:null};case ht.START_POLLING_REPORT:return{...e,polledReportIds:[...e.polledReportIds,t.payload]};case ht.STOP_POLLING_REPORT:return{...e,polledReportIds:e.polledReportIds.filter(n=>n!==t.payload)};case ht.STOP_ALL_POLLING:return{...e,polledReportIds:[]};case ht.UPDATE_POLLED_REPORT:{const n=e.reports.find(r=>r.id===t.payload.id);return n&&t.payload.lastRunStatus!==en.RUNNING||(n==null?void 0:n.lastRunStatus)!==en.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 zC({children:e}){const[t,n]=h.useReducer(BJ,GJ);return a.jsx(m5.Provider,{value:{state:t,dispatch:n},children:e})}function qJ(){const e=h.useContext(m5);if(e===void 0)throw new Error("useReportContext must be used within a ReportProvider");return e}class KJ extends _l{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 ii=new KJ,WJ={initialPollingIntervalMs:2e3,initialPollCount:3,regularPollingIntervalMs:5e3};class ZJ{constructor(){io(this,"pollingTimers",new Map);io(this,"pollCounters",new Map);io(this,"config",WJ)}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 ii.getReportById(t);if(n(i),i.lastRunStatus!==en.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 Zp=new ZJ;var Ie=(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))(Ie||{}),Us=(e=>(e.ACTIVE="Active",e.COMING_SOON="Coming soon",e.CLOUD_ONLY="Cloud only",e))(Us||{}),Eo=(e=>(e.GOOGLE_SHEETS_CREDENTIALS="google-sheets-credentials",e.LOOKER_STUDIO_CREDENTIALS="looker-studio-credentials",e.EMAIL_CREDENTIALS="email-credentials",e))(Eo||{});class YJ extends _l{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 cc=new YJ,ha={types:{[Ie.GOOGLE_SHEETS]:{type:Ie.GOOGLE_SHEETS,displayName:"Google Sheets",icon:NZ,status:Us.ACTIVE},[Ie.LOOKER_STUDIO]:{type:Ie.LOOKER_STUDIO,displayName:"Looker Studio",icon:AZ,status:Us.ACTIVE},[Ie.EMAIL]:{type:Ie.EMAIL,displayName:"Email",icon:VZ,status:Us.CLOUD_ONLY},[Ie.SLACK]:{type:Ie.SLACK,displayName:"Slack",icon:MZ,status:Us.CLOUD_ONLY},[Ie.MS_TEAMS]:{type:Ie.MS_TEAMS,displayName:"Microsoft Teams",icon:HZ,status:Us.CLOUD_ONLY},[Ie.GOOGLE_CHAT]:{type:Ie.GOOGLE_CHAT,displayName:"Google Chat",icon:$Z,status:Us.CLOUD_ONLY},[Ie.ODATA]:{type:Ie.ODATA,displayName:"OData",icon:DZ,status:Us.COMING_SOON}},getInfo(e){return this.types[e]},getAllTypes(){return Object.values(this.types)}},XJ=Yt({deploymentUrl:yt().optional(),destinationId:yt().optional(),destinationSecretKey:yt().optional()}),QJ=Yt({to:F1(yt().email()).min(1)}),FC=Yt({title:yt().min(1,"Title is required"),type:Qx(Ie)}),JJ=FC.extend({type:or(Ie.GOOGLE_SHEETS),credentials:jO}),eee=FC.extend({type:or(Ie.LOOKER_STUDIO),credentials:XJ.optional()}),ty=FC.extend({credentials:QJ.optional()}),tee=ty.extend({type:or(Ie.EMAIL)}),nee=ty.extend({type:or(Ie.SLACK)}),ree=ty.extend({type:or(Ie.MS_TEAMS)}),aee=ty.extend({type:or(Ie.GOOGLE_CHAT)}),see=Xx("type",[JJ,eee,tee,nee,ree,aee]),p5=h.createContext(void 0);var fn=(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))(fn||{});const oee={dataDestinations:[],currentDataDestination:null,loading:!1,error:null};function iee(e,t){switch(t.type){case fn.FETCH_DESTINATIONS_START:case fn.FETCH_DESTINATION_START:case fn.CREATE_DESTINATION_START:case fn.UPDATE_DESTINATION_START:case fn.DELETE_DESTINATION_START:return{...e,loading:!0,error:null};case fn.FETCH_DESTINATIONS_SUCCESS:return{...e,dataDestinations:t.payload,loading:!1,error:null};case fn.FETCH_DESTINATION_SUCCESS:return{...e,currentDataDestination:t.payload,loading:!1,error:null};case fn.CREATE_DESTINATION_SUCCESS:return{...e,dataDestinations:[...e.dataDestinations,t.payload],loading:!1,error:null};case fn.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 fn.DELETE_DESTINATION_SUCCESS:return{...e,dataDestinations:e.dataDestinations.filter(n=>n.id!==t.payload),loading:!1,error:null};case fn.FETCH_DESTINATIONS_ERROR:case fn.FETCH_DESTINATION_ERROR:case fn.CREATE_DESTINATION_ERROR:case fn.UPDATE_DESTINATION_ERROR:case fn.DELETE_DESTINATION_ERROR:return{...e,loading:!1,error:t.payload};case fn.CLEAR_CURRENT_DESTINATION:return{...e,currentDataDestination:null};case fn.CLEAR_ERROR:return{...e,error:null};default:return e}}function Qh({children:e}){const[t,n]=h.useReducer(iee,oee);return a.jsx(p5.Provider,{value:{state:t,dispatch:n},children:e})}function lee(){const e=h.useContext(p5);if(e===void 0)throw new Error("useDataDestinationContext must be used within a DataDestinationProvider");return e}class Yp{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:Eo.EMAIL_CREDENTIALS,to:s}}return r}mapToCreateRequest(t){const n=t,r=n.credentials.to;return{title:n.title,type:this.type,credentials:{type:Eo.EMAIL_CREDENTIALS,to:r}}}extractCredentials(t){return t.type===Eo.EMAIL_CREDENTIALS?{to:t.to}:{to:[]}}}class cee{mapFromDto(t){let n="";try{t.credentials.type===Eo.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:Ie.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:Eo.GOOGLE_SHEETS_CREDENTIALS}),r}mapToCreateRequest(t){const n=t;return{title:n.title,type:Ie.GOOGLE_SHEETS,credentials:{serviceAccountKey:JSON.parse(n.credentials.serviceAccount),type:Eo.GOOGLE_SHEETS_CREDENTIALS}}}}class uee{mapFromDto(t){const n=this.extractLookerStudioCredentials(t.credentials);return{id:t.id,title:t.title,type:Ie.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:Eo.LOOKER_STUDIO_CREDENTIALS}}}mapToCreateRequest(t){return{title:t.title,type:Ie.LOOKER_STUDIO,credentials:{type:Eo.LOOKER_STUDIO_CREDENTIALS}}}extractLookerStudioCredentials(t){return t.type===Eo.LOOKER_STUDIO_CREDENTIALS?{deploymentUrl:t.deploymentUrl,destinationId:t.destinationId,destinationSecretKey:t.destinationSecretKey}:{deploymentUrl:"",destinationId:"",destinationSecretKey:""}}}const g5={getMapper(e){switch(e){case Ie.GOOGLE_SHEETS:return new cee;case Ie.LOOKER_STUDIO:return new uee;case Ie.EMAIL:return new Yp(Ie.EMAIL);case Ie.SLACK:return new Yp(Ie.SLACK);case Ie.MS_TEAMS:return new Yp(Ie.MS_TEAMS);case Ie.GOOGLE_CHAT:return new Yp(Ie.GOOGLE_CHAT);default:throw new Error(`Unknown destination type: ${e}`)}}};function Fu(e){return g5.getMapper(e.type).mapFromDto(e)}function Jh(){const{state:e,dispatch:t}=lee(),n=h.useCallback(async()=>{t({type:fn.FETCH_DESTINATIONS_START});try{const x=(await cc.getDataDestinations()).map(Fu);t({type:fn.FETCH_DESTINATIONS_SUCCESS,payload:x})}catch(m){const x=m instanceof Error?m.message:"Failed to load destinations";t({type:fn.FETCH_DESTINATIONS_ERROR,payload:x}),De({event:"data_destination_error",category:"DataDestination",action:"ListError",error:x})}},[t]),r=h.useCallback(async m=>{try{const x=await cc.getDataDestinationById(m),g=Fu(x);t({type:fn.FETCH_DESTINATION_SUCCESS,payload:g})}catch(x){const g=x instanceof Error?x.message:"Failed to load destination";t({type:fn.FETCH_DESTINATION_ERROR,payload:g}),De({event:"data_destination_error",category:"DataDestination",action:"GetError",error:g})}},[t]),s=h.useCallback(async m=>{t({type:fn.CREATE_DESTINATION_START});try{const x=await cc.createDataDestination(m),g=Fu(x);return t({type:fn.CREATE_DESTINATION_SUCCESS,payload:g}),De({event:"data_destination_created",category:"DataDestination",action:"Create",label:g.type}),Dt.success("Destination created"),g}catch(x){const g=x instanceof Error?x.message:"Failed to create destination";return t({type:fn.CREATE_DESTINATION_ERROR,payload:g}),De({event:"data_destination_error",category:"DataDestination",action:"CreateError",label:m.type,error:g}),null}},[t]),i=h.useCallback(async(m,x)=>{t({type:fn.UPDATE_DESTINATION_START});try{const g=await cc.updateDataDestination(m,x),y=Fu(g);return t({type:fn.UPDATE_DESTINATION_SUCCESS,payload:y}),De({event:"data_destination_updated",category:"DataDestination",action:"Update",label:y.type}),Dt.success("Destination updated"),y}catch(g){const y=g instanceof Error?g.message:"Failed to update destination";return t({type:fn.UPDATE_DESTINATION_ERROR,payload:y}),De({event:"data_destination_error",category:"DataDestination",action:"UpdateError",error:y}),null}},[t]),c=h.useCallback(async m=>{t({type:fn.DELETE_DESTINATION_START});try{await cc.deleteDataDestination(m),t({type:fn.DELETE_DESTINATION_SUCCESS,payload:m}),De({event:"data_destination_deleted",category:"DataDestination",action:"Delete"}),Dt.success("Destination deleted")}catch(x){const g=x instanceof Error?x.message:"Failed to delete destination";throw t({type:fn.DELETE_DESTINATION_ERROR,payload:g}),De({event:"data_destination_error",category:"DataDestination",action:"DeleteError",error:g}),x}},[t]),u=h.useCallback(()=>{t({type:fn.CLEAR_CURRENT_DESTINATION})},[t]),f=h.useCallback(async m=>{try{const x=await cc.rotateSecretKey(m),g=Fu(x);return De({event:"data_destination_updated",category:"DataDestination",action:"RotateSecretKey",label:g.type}),g}catch(x){const g=x instanceof Error?x.message:"Failed to rotate secret key";throw De({event:"data_destination_error",category:"DataDestination",action:"RotateSecretKeyError",error:g}),console.error("Failed to rotate secret key:",x),x}},[]);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 dee(e){const t=ha.getInfo(e.type),n=t.status!==Us.COMING_SOON;return{destinationInfo:t,isVisible:n}}function fee(){const{dataMart:e}=js(),{fetchReportsByDataMartId:t}=is(),{dataDestinations:n,fetchDataDestinations:r,loading:s}=Jh(),[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 HC(e){return JSON.stringify(e,null,2)}class hee{mapFromDto(t){if(t.type!==Hr.EMAIL_CONFIG)throw new Error("Invalid destination config type");return{type:Hr.EMAIL_CONFIG,reportCondition:t.reportCondition,subject:t.subject,messageTemplate:t.messageTemplate}}}class mee{mapFromDto(t){if(t.type!==Hr.GOOGLE_SHEETS_CONFIG)throw new Error("Invalid destination config type");return{type:Hr.GOOGLE_SHEETS_CONFIG,spreadsheetId:t.spreadsheetId,sheetId:t.sheetId.toString()}}}class pee{mapFromDto(t){if(t.type!==Hr.LOOKER_STUDIO_CONFIG)throw new Error("Invalid destination config type");return{type:Hr.LOOKER_STUDIO_CONFIG,cacheLifetime:t.cacheLifetime}}}const gee={getMapper(e){switch(e){case Hr.GOOGLE_SHEETS_CONFIG:return new mee;case Hr.LOOKER_STUDIO_CONFIG:return new pee;case Hr.EMAIL_CONFIG:return new hee;default:throw new Error(`Unknown destination config type: ${String(e)}`)}}};function xee(e){return gee.getMapper(e.type).mapFromDto(e)}function uc(e){const t=xee(e.destinationConfig);return{id:e.id,title:e.title,dataMart:{id:e.dataMart.id},dataDestination:Fu(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 x5=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)},ny=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")??"",x=s.get("second")??"";return`${i}-${c}-${u} ${f}:${m}:${x}`},Mu=e=>ny(y5(e).toISOString()),y5=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},yee=(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 v5(e){return JSON.parse(JSON.stringify(e))}function vee(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 b5=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 bee(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}function See(e){return!e||typeof e!="object"?!0:e.LICENSED_APP_EDITION==="COMMUNITY"}function is(){const{state:e,dispatch:t}=qJ(),n=h.useCallback(async()=>{t({type:ht.FETCH_DESTINATIONS_START});try{const E=await cc.getDataDestinations();t({type:ht.FETCH_DESTINATIONS_SUCCESS,payload:E})}catch(E){const j=E instanceof Error?E.message:"Failed to fetch destinations";t({type:ht.FETCH_DESTINATIONS_ERROR,payload:j}),De({event:"report_error",category:"Report",action:"DestinationsListError",label:j})}},[t]),r=h.useCallback(async()=>{t({type:ht.FETCH_REPORTS_START});try{const j=(await ii.getReportsByProject()).map(uc);t({type:ht.FETCH_REPORTS_SUCCESS,payload:j})}catch(E){const j=E instanceof Error?E.message:"Failed to fetch reports";t({type:ht.FETCH_REPORTS_ERROR,payload:j}),De({event:"report_error",category:"Report",action:"ListError",error:j})}},[t]),s=h.useCallback(async(E,j)=>{j!=null&&j.silent||t({type:ht.FETCH_REPORTS_START});try{const T=(await ii.getReportsByDataMartId(E,j!=null&&j.silent?{skipLoadingIndicator:!0}:void 0)).map(uc);t({type:ht.FETCH_REPORTS_SUCCESS,payload:T})}catch(R){const T=R instanceof Error?R.message:"Failed to fetch reports";t({type:ht.FETCH_REPORTS_ERROR,payload:T}),De({event:"report_error",category:"Report",action:"ListError",error:T})}},[t]),i=h.useCallback(async E=>{t({type:ht.FETCH_REPORT_START});try{const j=await ii.getReportById(E),R=uc(j);t({type:ht.FETCH_REPORT_SUCCESS,payload:R})}catch(j){const R=j instanceof Error?j.message:"Failed to fetch report";t({type:ht.FETCH_REPORT_ERROR,payload:R}),De({event:"report_error",category:"Report",action:"GetError",error:R})}},[t]),c=h.useCallback(async E=>{t({type:ht.CREATE_REPORT_START});try{const j=await ii.createReport(E),R=uc(j);return t({type:ht.CREATE_REPORT_SUCCESS,payload:R}),De({event:"report_created",category:"Report",action:"Create",label:R.dataDestination.type,details:R.title,context:R.dataMart.id}),Dt.success("Report created"),R}catch(j){const R=j instanceof Error?j.message:"Failed to create report";return t({type:ht.CREATE_REPORT_ERROR,payload:R}),De({event:"report_error",category:"Report",action:"CreateError",label:E.destinationConfig.type,error:R}),null}},[t]),u=h.useCallback(async(E,j)=>{t({type:ht.UPDATE_REPORT_START});try{const R=await ii.updateReport(E,j),T=uc(R);return t({type:ht.UPDATE_REPORT_SUCCESS,payload:T}),De({event:"report_updated",category:"Report",action:"Update",label:T.dataDestination.type,value:T.title,context:T.dataMart.id,details:T.id}),Dt.success("Report updated"),T}catch(R){const T=R instanceof Error?R.message:"Failed to update report";return t({type:ht.UPDATE_REPORT_ERROR,payload:T}),De({event:"report_error",category:"Report",action:"UpdateError",error:T}),null}},[t]),f=h.useCallback(async E=>{t({type:ht.DELETE_REPORT_START});try{await ii.deleteReport(E),t({type:ht.DELETE_REPORT_SUCCESS,payload:E}),De({event:"report_deleted",category:"Report",action:"Delete",label:E}),Dt.success("Report deleted")}catch(j){const R=j instanceof Error?j.message:"Failed to delete report";t({type:ht.DELETE_REPORT_ERROR,payload:R}),De({event:"report_error",category:"Report",action:"DeleteError",label:E,error:R})}},[t]),m=h.useCallback(()=>{t({type:ht.CLEAR_CURRENT_REPORT})},[t]),x=h.useCallback(()=>{t({type:ht.CLEAR_ERROR})},[t]),g=h.useCallback(E=>{Zp.stopPolling(E),t({type:ht.STOP_POLLING_REPORT,payload:E})},[t]),y=h.useCallback(E=>{e.polledReportIds.includes(E)&&g(E),t({type:ht.START_POLLING_REPORT,payload:E}),Zp.startPolling(E,j=>{const R=uc(j);t({type:ht.UPDATE_POLLED_REPORT,payload:R})})},[t,e.polledReportIds,g]),v=h.useCallback(()=>{Zp.stopAllPolling(),t({type:ht.STOP_ALL_POLLING})},[t]),C=h.useCallback(E=>{Zp.setConfig(E)},[]),S=h.useCallback(async E=>{try{g(E),await ii.runReport(E),await i(E),y(E),De({event:"report_run_started",category:"Report",action:"Run",label:E}),Dt.success("Report run started")}catch(j){const R=j instanceof Error?j.message:"Failed to run report";De({event:"report_error",category:"Report",action:"RunError",error:R}),console.error("Failed to run report:",j)}},[i,y,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:y,stopPollingReport:g,stopAllPolling:v,setPollingConfig:C,clearCurrentReport:m,clearError:x}}en.SUCCESS+"",en.SUCCESS,en.RUNNING+"",en.RUNNING,en.ERROR+"",en.ERROR,en.CANCELLED+"",en.CANCELLED,en.RESTRICTED+"",en.RESTRICTED;var _b,ry="HoverCard",[S5]=Dr(ry,[Io]),ay=Io(),[Cee,sy]=S5(ry),C5=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:s,onOpenChange:i,openDelay:c=700,closeDelay:u=300}=e,f=ay(t),m=h.useRef(0),x=h.useRef(0),g=h.useRef(!1),y=h.useRef(!1),[v,C]=ya({prop:r,defaultProp:s??!1,onChange:i,caller:ry}),S=h.useCallback(()=>{clearTimeout(x.current),m.current=window.setTimeout(()=>C(!0),c)},[c,C]),E=h.useCallback(()=>{clearTimeout(m.current),!g.current&&!y.current&&(x.current=window.setTimeout(()=>C(!1),u))},[u,C]),j=h.useCallback(()=>C(!1),[C]);return h.useEffect(()=>()=>{clearTimeout(m.current),clearTimeout(x.current)},[]),a.jsx(Cee,{scope:t,open:v,onOpenChange:C,onOpen:S,onClose:E,onDismiss:j,hasSelectionRef:g,isPointerDownOnContentRef:y,children:a.jsx(Cd,{...f,children:n})})};C5.displayName=ry;var E5="HoverCardTrigger",w5=h.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,s=sy(E5,n),i=ay(n);return a.jsx(Ed,{asChild:!0,...i,children:a.jsx(tt.a,{"data-state":s.open?"open":"closed",...r,ref:t,onPointerEnter:Me(e.onPointerEnter,rx(s.onOpen)),onPointerLeave:Me(e.onPointerLeave,rx(s.onClose)),onFocus:Me(e.onFocus,s.onOpen),onBlur:Me(e.onBlur,s.onClose),onTouchStart:Me(e.onTouchStart,c=>c.preventDefault())})})});w5.displayName=E5;var $C="HoverCardPortal",[Eee,wee]=S5($C,{forceMount:void 0}),R5=e=>{const{__scopeHoverCard:t,forceMount:n,children:r,container:s}=e,i=sy($C,t);return a.jsx(Eee,{scope:t,forceMount:n,children:a.jsx(Xr,{present:n||i.open,children:a.jsx(Hc,{asChild:!0,container:s,children:r})})})};R5.displayName=$C;var nx="HoverCardContent",j5=h.forwardRef((e,t)=>{const n=wee(nx,e.__scopeHoverCard),{forceMount:r=n.forceMount,...s}=e,i=sy(nx,e.__scopeHoverCard);return a.jsx(Xr,{present:r||i.open,children:a.jsx(Ree,{"data-state":i.open?"open":"closed",...s,onPointerEnter:Me(e.onPointerEnter,rx(i.onOpen)),onPointerLeave:Me(e.onPointerLeave,rx(i.onClose)),ref:t})})});j5.displayName=nx;var Ree=h.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:c,...u}=e,f=sy(nx,n),m=ay(n),x=h.useRef(null),g=Rt(t,x),[y,v]=h.useState(!1);return h.useEffect(()=>{if(y){const C=document.body;return _b=C.style.userSelect||C.style.webkitUserSelect,C.style.userSelect="none",C.style.webkitUserSelect="none",()=>{C.style.userSelect=_b,C.style.webkitUserSelect=_b}}},[y]),h.useEffect(()=>{if(x.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(()=>{x.current&&_ee(x.current).forEach(S=>S.setAttribute("tabindex","-1"))}),a.jsx(Fc,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:c,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:Me(i,C=>{C.preventDefault()}),onDismiss:f.onDismiss,children:a.jsx(Lh,{...m,...u,onPointerDown:Me(u.onPointerDown,C=>{C.currentTarget.contains(C.target)&&v(!0),f.hasSelectionRef.current=!1,f.isPointerDownOnContentRef.current=!0}),ref:g,style:{...u.style,userSelect:y?"text":void 0,WebkitUserSelect:y?"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)"}})})}),jee="HoverCardArrow",Tee=h.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,s=ay(n);return a.jsx(Ph,{...s,...r,ref:t})});Tee.displayName=jee;function rx(e){return t=>t.pointerType==="touch"?void 0:e()}function _ee(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 Nee=C5,Aee=w5,Dee=R5,Oee=j5;const em=({...e})=>a.jsx(Nee,{"data-slot":"hover-card",...e});em.displayName="HoverCard";const tm=h.forwardRef(({...e},t)=>a.jsx(Aee,{"data-slot":"hover-card-trigger",ref:t,...e}));tm.displayName="HoverCardTrigger";const nm=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(Dee,{children:a.jsx(Oee,{ref:i,align:t,sideOffset:n,className:oe("bg-popover text-popover-foreground z-50 rounded-lg border px-6 py-4 shadow-md outline-none","w-[calc(100vw-1rem)] sm:w-110 sm:max-w-110","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})})});nm.displayName="HoverCardContent";const oy=h.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:oe("border-border flex gap-4 border-b pb-4",e),...t}));oy.displayName="HoverCardHeader";const VC=h.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:oe("bg-muted flex h-14 min-h-[56px] w-14 min-w-[56px] shrink-0 items-center justify-center rounded-full",e),...t}));VC.displayName="HoverCardHeaderIcon";const iy=h.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:oe("flex flex-col space-y-1",e),...t}));iy.displayName="HoverCardHeaderText";const ly=h.forwardRef(({className:e,...t},n)=>a.jsx("h2",{ref:n,className:oe("text-md pt-1 leading-snug font-semibold",e),...t}));ly.displayName="HoverCardHeaderTitle";const cy=h.forwardRef(({className:e,...t},n)=>a.jsx("p",{ref:n,className:oe("text-muted-foreground text-sm",e),...t}));cy.displayName="HoverCardHeaderDescription";const uy=h.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:oe("flex flex-col",e),...t}));uy.displayName="HoverCardBody";const fi=h.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:oe("flex flex-col gap-1 sm:flex-row sm:items-center sm:justify-between","border-border border-b py-3 sm:py-4",e),...t}));fi.displayName="HoverCardItem";const hi=h.forwardRef(({className:e,...t},n)=>a.jsx("span",{ref:n,className:oe("text-muted-foreground text-sm",e),...t}));hi.displayName="HoverCardItemLabel";const mi=h.forwardRef(({className:e,...t},n)=>a.jsx("span",{ref:n,className:oe("text-sm break-words sm:text-right sm:font-normal",e),...t}));mi.displayName="HoverCardItemValue";const dy=h.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:oe("pt-4 pb-2",e),...t}));dy.displayName="HoverCardFooter";function GC(e){return e.type===Hr.GOOGLE_SHEETS_CONFIG}function T5(e){return e.type===Hr.LOOKER_STUDIO_CONFIG}function Nb(e){return e.type===Hr.EMAIL_CONFIG}function ws({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)),x=Math.floor(m/7),g=Math.floor(m/30),y=Math.floor(m/365),v=(E,j)=>{const R=E===1?j:`${j}s`;return c?`${E} ${R} ago`:`In ${E} ${R}`},C=E=>E.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0}),S=E=>E.toLocaleDateString("en-US",{weekday:"long"});return u<1?c?"Just now":"In a moment":u<60?v(u,"minute"):f<24?v(f,"hour"):m===1?c?`Yesterday at ${C(e)}`:`Tomorrow at ${C(e)}`:m<7?`${c?"Last":"This"} ${S(e)} at ${C(e)}`:m<14?`${c?"Last":"Next"} ${S(e)} at ${C(e)}`:x<4?v(x,"week"):m>=28&&m<=31?v(4,"week"):g>=1&&g<12?v(g,"month"):y>=1?v(y,"year"):e.toLocaleString()},[e]);return a.jsx("span",{className:`${t}`,title:e.toLocaleString(),children:n})}const Iee=()=>{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}},Mee=re.memo(function({report:t,children:n}){const{detailedDateFormatter:r,shortDateFormatter:s}=Iee(),i=h.useMemo(()=>t.lastRunStatus?{statusType:Pee(t.lastRunStatus),statusText:zee(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(()=>ha.getInfo(t.dataDestination.type).icon,[t.dataDestination.type]),f=h.useMemo(()=>GC(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 x=UC(f.spreadsheetId,f.sheetId);window.open(x,"_blank","noopener,noreferrer")},[f]);return a.jsxs(em,{children:[a.jsx(tm,{asChild:!0,children:a.jsx("span",{children:n})}),a.jsxs(nm,{children:[a.jsxs(oy,{children:[a.jsx(VC,{children:a.jsx(u,{size:20})}),a.jsxs(iy,{children:[a.jsx(ly,{children:t.title||"Unnamed Report"}),a.jsxs(cy,{children:["Last modified ",a.jsx(ws,{date:new Date(t.modifiedAt)})]})]})]}),a.jsxs(uy,{children:[a.jsxs(fi,{children:[a.jsx(hi,{children:"Last run status:"}),a.jsx(mi,{children:i?a.jsx(Td,{type:i.statusType,variant:"ghost",children:i.statusText}):"Not run yet"})]}),a.jsxs(fi,{children:[a.jsx(hi,{children:"Last run date:"}),a.jsx(mi,{children:t.lastRunDate?a.jsx(ws,{date:t.lastRunDate}):"Never run"})]}),t.lastRunError&&a.jsxs(fi,{children:[a.jsx(hi,{children:"Error message:"}),a.jsx(mi,{children:t.lastRunError})]}),a.jsxs(fi,{children:[a.jsx(hi,{children:"Total runs:"}),a.jsxs(mi,{children:[t.runsCount||0," runs",c.createdAt&&a.jsxs(a.Fragment,{children:[", since ",c.createdAt]})]})]})]}),f.isGoogleSheets&&a.jsx(dy,{children:a.jsxs(we,{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(yi,{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 ts=(e=>(e.IDLE="IDLE",e.READY="READY",e.PROCESSING="PROCESSING",e.SUCCESS="SUCCESS",e.ERROR="ERROR",e.CANCELLING="CANCELLING",e.CANCELLED="CANCELLED",e))(ts||{});const kee=e=>{switch(e){case br.DRAFT:return En.NEUTRAL;case br.PUBLISHED:return En.SUCCESS;default:return En.NEUTRAL}},Lee=e=>{switch(e){case Nt.SUCCESS:return En.SUCCESS;case Nt.RUNNING:return En.INFO;case Nt.FAILED:case Nt.CANCELLED:case Nt.INTERRUPTED:return En.ERROR;case Nt.RESTRICTED:return En.WARNING;default:return En.NEUTRAL}},Pee=e=>{switch(e){case en.SUCCESS:return En.SUCCESS;case en.RUNNING:return En.INFO;case en.ERROR:return En.ERROR;case en.RESTRICTED:return En.WARNING;default:return En.NEUTRAL}},Uee=e=>{switch(e){case Nt.SUCCESS:return"Success";case Nt.RUNNING:return"Running";case Nt.FAILED:return"Failed";case Nt.CANCELLED:return"Cancelled";case Nt.INTERRUPTED:return"Interrupted";case Nt.PENDING:return"Pending";case Nt.RESTRICTED:return"Restricted";default:return"Unknown"}},zee=e=>{switch(e){case en.SUCCESS:return"Success";case en.RUNNING:return"Running";case en.ERROR:return"Failed";case en.RESTRICTED:return"Restricted";default:return"Unknown"}},_5=e=>e?[Nt.SUCCESS,Nt.FAILED,Nt.CANCELLED,Nt.INTERRUPTED,Nt.RESTRICTED].includes(e):!0,Fee=e=>e?[ts.SUCCESS,ts.ERROR,ts.CANCELLED].includes(e):!0,N5=e=>Yt({fullyQualifiedName:yt().min(1,"Fully qualified name is required").refine(t=>AJ(t,e),t=>({message:OJ(t,e)}))}),Hee=e=>Yt({pattern:yt().min(1,"Table pattern is required").refine(t=>DJ(t,e),t=>({message:IJ(t,e)}))}),$ee=e=>{const t=[];return e.status.code===br.PUBLISHED&&t.push(bg.ALREADY_PUBLISHED),n5(e.storage)||t.push(bg.INVALID_STORAGE),e.definition||t.push(bg.MISSING_DEFINITION),t},Vee=e=>e.map(t=>HQ[t]);function Gee(e){return e.map(t=>({id:t.id,title:t.title,status:KO.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 A5(){const{state:e,dispatch:t}=zQ(),n=h.useCallback(async()=>{t({type:"SET_LOADING"});try{const i=await Tn.getDataMarts(),c=Gee(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),De({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}),De({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}}const Bee=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}),W1=e=>e.runs.map(Bee),qee=1440*60*1e3,Kee={[Wr.NO_RUNS]:2,[Wr.RUNS_IN_PROGRESS]:3,[Wr.ALL_RUNS_FAILED]:4,[Wr.MIXED_RUNS]:5,[Wr.ALL_RUNS_SUCCESS]:6};function Wee(e){const{dataMartStatus:t,healthStatus:n}=e;return t===br.DRAFT?0:n?Kee[n]:1}function Zee(e,t){const n=new Date(Date.now()-t*qee);return e.filter(r=>r.createdAt>=n)}function Yee(e){const t=Object.values(e).filter(c=>!!c);if(t.length===0)return Wr.NO_RUNS;const n=new Set(t.map(c=>c.status)),r=n.has(Nt.SUCCESS),s=n.has(Nt.FAILED),i=n.has(Nt.PENDING)||n.has(Nt.RUNNING);return i&&!r&&!s?Wr.RUNS_IN_PROGRESS:s&&!r&&!i?Wr.ALL_RUNS_FAILED:r&&!s&&!i?Wr.ALL_RUNS_SUCCESS:Wr.MIXED_RUNS}const Xee=30,Qee=100,Z1=new Map,Ab=new Set,Y1=new Set;function Jee(e){return Y1.add(e),()=>{Y1.delete(e)}}function ete(){Y1.forEach(e=>{e()})}function X1(e){return Z1.get(e)}function tte(e){const t=Zee(e,Xee),n={connector:null,report:null,insight:null};for(const s of t)switch(s.type){case dr.CONNECTOR:{(!n.connector||s.createdAt>n.connector.createdAt)&&(n.connector=s);break}case dr.INSIGHT:{(!n.insight||s.createdAt>n.insight.createdAt)&&(n.insight=s);break}default:(!n.report||s.createdAt>n.report.createdAt)&&(n.report=s)}const r=Yee(n);return{recentRuns:t,latestRunsByType:n,healthStatus:r}}async function D5(e,t){if(Z1.has(e)||Ab.has(e))return;Ab.add(e);const n={skipLoadingIndicator:!0,...t};try{const r=await Tn.getDataMartRuns(e,Qee,0,n),s=W1(r),i=tte(s);Z1.set(e,i),ete()}finally{Ab.delete(e)}}function Q_(e){const[t,n]=h.useState(()=>X1(e)??null),[r,s]=h.useState(!1),[i,c]=h.useState(null),u=h.useCallback(()=>X1(e)??null,[e]);h.useEffect(()=>Jee(()=>{const x=u();n(g=>g===x?g:x)}),[u]),h.useEffect(()=>{const x=u();n(g=>g===x?g:x),s(!1),c(null)},[u]);const f=h.useCallback(async()=>{if(!u()){s(!0),c(null);try{await D5(e)}catch(x){c(x instanceof Error?x:new Error("Failed to load health status"))}finally{s(!1)}}},[e,u]),m=h.useCallback(async()=>{u()||await f()},[f,u]);return{healthStatus:(t==null?void 0:t.healthStatus)??Wr.NO_RUNS,latestRunsByType:(t==null?void 0:t.latestRunsByType)??{connector:null,report:null,insight:null},isLoading:r,isFetched:!!t,error:i,prefetch:m}}/**
|
|
792
|
+
* table-core
|
|
793
|
+
*
|
|
794
|
+
* Copyright (c) TanStack
|
|
795
|
+
*
|
|
796
|
+
* This source code is licensed under the MIT license found in the
|
|
797
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
798
|
+
*
|
|
799
|
+
* @license MIT
|
|
800
|
+
*/function fl(e,t){return typeof e=="function"?e(t):e}function rs(e,t){return n=>{t.setState(r=>({...r,[e]:fl(n,r[e])}))}}function fy(e){return e instanceof Function}function nte(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function rte(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 pt(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((x,g)=>r[g]!==x)))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 x=Math.round((Date.now()-c)*100)/100,g=Math.round((Date.now()-m)*100)/100,y=g/16,v=(C,S)=>{for(C=String(C);C.length<S;)C=" "+C;return C};console.info(`%c⏱ ${v(g,5)} /${v(x,5)} ms`,`
|
|
801
|
+
font-size: .6rem;
|
|
802
|
+
font-weight: bold;
|
|
803
|
+
color: hsl(${Math.max(0,Math.min(120-120*y,120))}deg 100% 31%);`,n==null?void 0:n.key)}return s}}function gt(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 ate(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:pt(()=>[e,n,t,i],(c,u,f,m)=>({table:c,column:u,row:f,cell:m,getValue:m.getValue,renderValue:m.renderValue}),gt(e.options,"debugCells"))};return e._features.forEach(c=>{c.createCell==null||c.createCell(i,n,t,e)},{}),i}function ste(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,x;if(u.accessorFn?x=u.accessorFn:f&&(f.includes(".")?x=y=>{let v=y;for(const S of f.split(".")){var C;v=(C=v)==null?void 0:C[S]}return v}:x=y=>y[u.accessorKey]),!m)throw new Error;let g={id:`${String(m)}`,accessorFn:x,parent:r,depth:n,columnDef:u,columns:[],getFlatColumns:pt(()=>[!0],()=>{var y;return[g,...(y=g.columns)==null?void 0:y.flatMap(v=>v.getFlatColumns())]},gt(e.options,"debugColumns")),getLeafColumns:pt(()=>[e._getOrderColumnsFn()],y=>{var v;if((v=g.columns)!=null&&v.length){let C=g.columns.flatMap(S=>S.getLeafColumns());return y(C)}return[g]},gt(e.options,"debugColumns"))};for(const y of e._features)y.createColumn==null||y.createColumn(g,e);return g}const Jr="debugHeaders";function J_(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 ote={createTable:e=>{e.getHeaderGroups=pt(()=>[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(y=>y.id===g)).filter(Boolean))!=null?i:[],f=(c=s==null?void 0:s.map(g=>n.find(y=>y.id===g)).filter(Boolean))!=null?c:[],m=n.filter(g=>!(r!=null&&r.includes(g.id))&&!(s!=null&&s.includes(g.id)));return Xp(t,[...u,...m,...f],e)},gt(e.options,Jr)),e.getCenterHeaderGroups=pt(()=>[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))),Xp(t,n,e,"center")),gt(e.options,Jr)),e.getLeftHeaderGroups=pt(()=>[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 Xp(t,i,e,"left")},gt(e.options,Jr)),e.getRightHeaderGroups=pt(()=>[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 Xp(t,i,e,"right")},gt(e.options,Jr)),e.getFooterGroups=pt(()=>[e.getHeaderGroups()],t=>[...t].reverse(),gt(e.options,Jr)),e.getLeftFooterGroups=pt(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),gt(e.options,Jr)),e.getCenterFooterGroups=pt(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),gt(e.options,Jr)),e.getRightFooterGroups=pt(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),gt(e.options,Jr)),e.getFlatHeaders=pt(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),gt(e.options,Jr)),e.getLeftFlatHeaders=pt(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),gt(e.options,Jr)),e.getCenterFlatHeaders=pt(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),gt(e.options,Jr)),e.getRightFlatHeaders=pt(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),gt(e.options,Jr)),e.getCenterLeafHeaders=pt(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),gt(e.options,Jr)),e.getLeftLeafHeaders=pt(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),gt(e.options,Jr)),e.getRightLeafHeaders=pt(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),gt(e.options,Jr)),e.getLeafHeaders=pt(()=>[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(x=>x.getLeafHeaders()).flat()},gt(e.options,Jr))}};function Xp(e,t,n,r){var s,i;let c=0;const u=function(y,v){v===void 0&&(v=1),c=Math.max(c,v),y.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=(y,v)=>{const C={depth:v,id:[r,`${v}`].filter(Boolean).join("_"),headers:[]},S=[];y.forEach(E=>{const j=[...S].reverse()[0],R=E.column.depth===C.depth;let T,N=!1;if(R&&E.column.parent?T=E.column.parent:(T=E.column,N=!0),j&&(j==null?void 0:j.column)===T)j.subHeaders.push(E);else{const A=J_(n,T,{id:[r,v,T.id,E==null?void 0:E.id].filter(Boolean).join("_"),isPlaceholder:N,placeholderId:N?`${S.filter(I=>I.column===T).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)},x=t.map((y,v)=>J_(n,y,{depth:c,index:v}));m(x,c-1),f.reverse();const g=y=>y.filter(C=>C.column.getIsVisible()).map(C=>{let S=0,E=0,j=[0];C.subHeaders&&C.subHeaders.length?(j=[],g(C.subHeaders).forEach(T=>{let{colSpan:N,rowSpan:A}=T;S+=N,j.push(A)})):S=1;const R=Math.min(...j);return E=E+R,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 BC=(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:()=>rte(u.subRows,f=>f.subRows),getParentRow:()=>u.parentId?e.getRow(u.parentId,!0):void 0,getParentRows:()=>{let f=[],m=u;for(;;){const x=m.getParentRow();if(!x)break;f.push(x),m=x}return f.reverse()},getAllCells:pt(()=>[e.getAllLeafColumns()],f=>f.map(m=>ate(e,u,m,m.id)),gt(e.options,"debugRows")),_getAllCellsByColumnId:pt(()=>[u.getAllCells()],f=>f.reduce((m,x)=>(m[x.column.id]=x,m),{}),gt(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},ite={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()}}},O5=(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))};O5.autoRemove=e=>qs(e);const I5=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};I5.autoRemove=e=>qs(e);const M5=(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())};M5.autoRemove=e=>qs(e);const k5=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};k5.autoRemove=e=>qs(e);const L5=(e,t,n)=>!n.some(r=>{var s;return!((s=e.getValue(t))!=null&&s.includes(r))});L5.autoRemove=e=>qs(e)||!(e!=null&&e.length);const P5=(e,t,n)=>n.some(r=>{var s;return(s=e.getValue(t))==null?void 0:s.includes(r)});P5.autoRemove=e=>qs(e)||!(e!=null&&e.length);const U5=(e,t,n)=>e.getValue(t)===n;U5.autoRemove=e=>qs(e);const z5=(e,t,n)=>e.getValue(t)==n;z5.autoRemove=e=>qs(e);const qC=(e,t,n)=>{let[r,s]=n;const i=e.getValue(t);return i>=r&&i<=s};qC.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]};qC.autoRemove=e=>qs(e)||qs(e[0])&&qs(e[1]);const li={includesString:O5,includesStringSensitive:I5,equalsString:M5,arrIncludes:k5,arrIncludesAll:L5,arrIncludesSome:P5,equals:U5,weakEquals:z5,inNumberRange:qC};function qs(e){return e==null||e===""}const lte={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:rs("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"?li.includesString:typeof r=="number"?li.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?li.equals:Array.isArray(r)?li.arrIncludes:li.weakEquals},e.getFilterFn=()=>{var n,r;return fy(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:li[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(x=>x.id===e.id),c=fl(n,i?i.value:void 0);if(eN(s,c,e)){var u;return(u=r==null?void 0:r.filter(x=>x.id!==e.id))!=null?u:[]}const f={id:e.id,value:c};if(i){var m;return(m=r==null?void 0:r.map(x=>x.id===e.id?f:x))!=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=fl(t,s))==null?void 0:i.filter(c=>{const u=n.find(f=>f.id===c.id);if(u){const f=u.getFilterFn();if(eN(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 eN(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const cte=(e,t,n)=>n.reduce((r,s)=>{const i=s.getValue(e);return r+(typeof i=="number"?i:0)},0),ute=(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},dte=(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},fte=(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]},hte=(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},mte=(e,t)=>{if(!t.length)return;const n=t.map(i=>i.getValue(e));if(!nte(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},pte=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),gte=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,xte=(e,t)=>t.length,Db={sum:cte,min:ute,max:dte,extent:fte,mean:hte,median:mte,unique:pte,uniqueCount:gte,count:xte},yte={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:rs("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 Db.sum;if(Object.prototype.toString.call(r)==="[object Date]")return Db.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return fy(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:Db[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 vte(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 bte={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:rs("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=pt(n=>[Wf(t,n)],n=>n.findIndex(r=>r.id===e.id),gt(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var r;return((r=Wf(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const s=Wf(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=pt(()=>[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(x=>x.id===f);m>-1&&i.push(u.splice(m,1)[0])}i=[...i,...u]}return vte(i,n,r)},gt(e.options,"debugTable"))}},Ob=()=>({left:[],right:[]}),Ste={getInitialState:e=>({columnPinning:Ob(),...e}),getDefaultOptions:e=>({onColumnPinningChange:rs("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,x;return{left:[...((m=s==null?void 0:s.left)!=null?m:[]).filter(g=>!(r!=null&&r.includes(g))),...r],right:((x=s==null?void 0:s.right)!=null?x:[]).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=pt(()=>[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))},gt(t.options,"debugRows")),e.getLeftVisibleCells=pt(()=>[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"})),gt(t.options,"debugRows")),e.getRightVisibleCells=pt(()=>[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"})),gt(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?Ob():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:Ob())},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=pt(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(s=>s.id===r)).filter(Boolean),gt(e.options,"debugColumns")),e.getRightLeafColumns=pt(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(s=>s.id===r)).filter(Boolean),gt(e.options,"debugColumns")),e.getCenterLeafColumns=pt(()=>[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))},gt(e.options,"debugColumns"))}};function Cte(e){return e||(typeof document<"u"?document:null)}const Qp={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Ib=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),Ete={getDefaultColumnDef:()=>Qp,getInitialState:e=>({columnSizing:{},columnSizingInfo:Ib(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:rs("columnSizing",e),onColumnSizingInfoChange:rs("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:Qp.minSize,(r=i??e.columnDef.size)!=null?r:Qp.size),(s=e.columnDef.maxSize)!=null?s:Qp.maxSize)},e.getStart=pt(n=>[n,Wf(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((s,i)=>s+i.getSize(),0),gt(t.options,"debugColumns")),e.getAfter=pt(n=>[n,Wf(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((s,i)=>s+i.getSize(),0),gt(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(),Mb(i)&&i.touches&&i.touches.length>1))return;const c=e.getSize(),u=e?e.getLeafHeaders().map(j=>[j.column.id,j.column.getSize()]):[[r.id,r.getSize()]],f=Mb(i)?Math.round(i.touches[0].clientX):i.clientX,m={},x=(j,R)=>{typeof R=="number"&&(t.setColumnSizingInfo(T=>{var N,A;const I=t.options.columnResizeDirection==="rtl"?-1:1,_=(R-((N=T==null?void 0:T.startOffset)!=null?N:0))*I,M=Math.max(_/((A=T==null?void 0:T.startSize)!=null?A:0),-.999999);return T.columnSizingStart.forEach(G=>{let[H,L]=G;m[H]=Math.round(Math.max(L+L*M,0)*100)/100}),{...T,deltaOffset:_,deltaPercentage:M}}),(t.options.columnResizeMode==="onChange"||j==="end")&&t.setColumnSizing(T=>({...T,...m})))},g=j=>x("move",j),y=j=>{x("end",j),t.setColumnSizingInfo(R=>({...R,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},v=Cte(n),C={moveHandler:j=>g(j.clientX),upHandler:j=>{v==null||v.removeEventListener("mousemove",C.moveHandler),v==null||v.removeEventListener("mouseup",C.upHandler),y(j.clientX)}},S={moveHandler:j=>(j.cancelable&&(j.preventDefault(),j.stopPropagation()),g(j.touches[0].clientX),!1),upHandler:j=>{var R;v==null||v.removeEventListener("touchmove",S.moveHandler),v==null||v.removeEventListener("touchend",S.upHandler),j.cancelable&&(j.preventDefault(),j.stopPropagation()),y((R=j.touches[0])==null?void 0:R.clientX)}},E=wte()?{passive:!1}:!1;Mb(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(j=>({...j,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?Ib():(n=e.initialState.columnSizingInfo)!=null?n:Ib())},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 wte(){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 Mb(e){return e.type==="touchstart"}const Rte={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:rs("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=pt(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),gt(t.options,"debugRows")),e.getVisibleCells=pt(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,s)=>[...n,...r,...s],gt(t.options,"debugRows"))},createTable:e=>{const t=(n,r)=>pt(()=>[r(),r().filter(s=>s.getIsVisible()).map(s=>s.id).join("_")],s=>s.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),gt(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 Wf(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const jte={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()}}},Tte={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:rs("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=()=>li.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return fy(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:li[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},_te={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:rs("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()}}}},Q1=0,J1=10,kb=()=>({pageIndex:Q1,pageSize:J1}),Nte={getInitialState:e=>({...e,pagination:{...kb(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:rs("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=>fl(r,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(s)},e.resetPagination=r=>{var s;e.setPagination(r?kb():(s=e.initialState.pagination)!=null?s:kb())},e.setPageIndex=r=>{e.setPagination(s=>{let i=fl(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?Q1:(s=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?s:Q1)},e.resetPageSize=r=>{var s,i;e.setPageSize(r?J1:(s=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?s:J1)},e.setPageSize=r=>{e.setPagination(s=>{const i=Math.max(1,fl(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=fl(r,(i=e.options.pageCount)!=null?i:-1);return typeof c=="number"&&(c=Math.max(-1,c)),{...s,pageCount:c}}),e.getPageOptions=pt(()=>[e.getPageCount()],r=>{let s=[];return r&&r>0&&(s=[...new Array(r)].fill(null).map((i,c)=>c)),s},gt(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}}},Lb=()=>({top:[],bottom:[]}),Ate={getInitialState:e=>({rowPinning:Lb(),...e}),getDefaultOptions:e=>({onRowPinningChange:rs("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,x;if(n==="bottom"){var g,y;return{top:((g=f==null?void 0:f.top)!=null?g:[]).filter(S=>!(u!=null&&u.has(S))),bottom:[...((y=f==null?void 0:f.bottom)!=null?y:[]).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:((x=f==null?void 0:f.bottom)!=null?x:[]).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?Lb():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:Lb())},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=pt(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),gt(e.options,"debugRows")),e.getBottomRows=pt(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),gt(e.options,"debugRows")),e.getCenterRows=pt(()=>[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))},gt(e.options,"debugRows"))}},Dte={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:rs("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=>{eS(s,i.id,r,!0,e)}),s}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=pt(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?Pb(e,n):{rows:[],flatRows:[],rowsById:{}},gt(e.options,"debugTable")),e.getFilteredSelectedRowModel=pt(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?Pb(e,n):{rows:[],flatRows:[],rowsById:{}},gt(e.options,"debugTable")),e.getGroupedSelectedRowModel=pt(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?Pb(e,n):{rows:[],flatRows:[],rowsById:{}},gt(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 eS(u,e.id,n,(c=r==null?void 0:r.selectChildren)!=null?c:!0,t),u})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return KC(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return tS(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return tS(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)}}}},eS=(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=>eS(e,u.id,n,r,s))};function Pb(e,t){const n=e.getState().rowSelection,r=[],s={},i=function(c,u){return c.map(f=>{var m;const x=KC(f,n);if(x&&(r.push(f),s[f.id]=f),(m=f.subRows)!=null&&m.length&&(f={...f,subRows:i(f.subRows)}),x)return f}).filter(Boolean)};return{rows:i(t.rows),flatRows:r,rowsById:s}}function KC(e,t){var n;return(n=t[e.id])!=null?n:!1}function tS(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()&&(KC(c,t)?i=!0:s=!1),c.subRows&&c.subRows.length)){const u=tS(c,t);u==="all"?i=!0:(u==="some"&&(i=!0),s=!1)}}),s?"all":i?"some":!1}const nS=/([0-9]+)/gm,Ote=(e,t,n)=>F5(Cl(e.getValue(n)).toLowerCase(),Cl(t.getValue(n)).toLowerCase()),Ite=(e,t,n)=>F5(Cl(e.getValue(n)),Cl(t.getValue(n))),Mte=(e,t,n)=>WC(Cl(e.getValue(n)).toLowerCase(),Cl(t.getValue(n)).toLowerCase()),kte=(e,t,n)=>WC(Cl(e.getValue(n)),Cl(t.getValue(n))),Lte=(e,t,n)=>{const r=e.getValue(n),s=t.getValue(n);return r>s?1:r<s?-1:0},Pte=(e,t,n)=>WC(e.getValue(n),t.getValue(n));function WC(e,t){return e===t?0:e>t?1:-1}function Cl(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function F5(e,t){const n=e.split(nS).filter(Boolean),r=t.split(nS).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 Af={alphanumeric:Ote,alphanumericCaseSensitive:Ite,text:Mte,textCaseSensitive:kte,datetime:Lte,basic:Pte},Ute={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:rs("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 Af.datetime;if(typeof i=="string"&&(r=!0,i.split(nS).length>1))return Af.alphanumeric}return r?Af.text:Af.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 fy(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:Af[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=[],x,g=i?n:s==="desc";if(c!=null&&c.length&&e.getCanMultiSort()&&r?u?x="toggle":x="add":c!=null&&c.length&&f!==c.length-1?x="replace":u?x="toggle":x="replace",x==="toggle"&&(i||s||(x="remove")),x==="add"){var y;m=[...c,{id:e.id,desc:g}],m.splice(0,m.length-((y=t.options.maxMultiSortColCount)!=null?y:Number.MAX_SAFE_INTEGER))}else x==="toggle"?m=c.map(v=>v.id===e.id?{...v,desc:g}:v):x==="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())}},zte=[ote,Rte,bte,Ste,ite,lte,jte,Tte,Ute,yte,_te,Nte,Ate,Dte,Ete];function Fte(e){var t,n;const r=[...zte,...(t=e._features)!=null?t:[]];let s={_features:r};const i=s._features.reduce((y,v)=>Object.assign(y,v.getDefaultOptions==null?void 0:v.getDefaultOptions(s)),{}),c=y=>s.options.mergeOptions?s.options.mergeOptions(i,y):{...i,...y};let f={...{},...(n=e.initialState)!=null?n:{}};s._features.forEach(y=>{var v;f=(v=y.getInitialState==null?void 0:y.getInitialState(f))!=null?v:f});const m=[];let x=!1;const g={_features:r,options:{...i,...e},initialState:f,_queue:y=>{m.push(y),x||(x=!0,Promise.resolve().then(()=>{for(;m.length;)m.shift()();x=!1}).catch(v=>setTimeout(()=>{throw v})))},reset:()=>{s.setState(s.initialState)},setOptions:y=>{const v=fl(y,s.options);s.options=c(v)},getState:()=>s.options.state,setState:y=>{s.options.onStateChange==null||s.options.onStateChange(y)},_getRowId:(y,v,C)=>{var S;return(S=s.options.getRowId==null?void 0:s.options.getRowId(y,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:(y,v)=>{let C=(v?s.getPrePaginationRowModel():s.getRowModel()).rowsById[y];if(!C&&(C=s.getCoreRowModel().rowsById[y],!C))throw new Error;return C},_getDefaultColumnDef:pt(()=>[s.options.defaultColumn],y=>{var v;return y=(v=y)!=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()),{}),...y}},gt(e,"debugColumns")),_getColumnDefs:()=>s.options.columns,getAllColumns:pt(()=>[s._getColumnDefs()],y=>{const v=function(C,S,E){return E===void 0&&(E=0),C.map(j=>{const R=ste(s,j,E,S),T=j;return R.columns=T.columns?v(T.columns,R,E+1):[],R})};return v(y)},gt(e,"debugColumns")),getAllFlatColumns:pt(()=>[s.getAllColumns()],y=>y.flatMap(v=>v.getFlatColumns()),gt(e,"debugColumns")),_getAllFlatColumnsById:pt(()=>[s.getAllFlatColumns()],y=>y.reduce((v,C)=>(v[C.id]=C,v),{}),gt(e,"debugColumns")),getAllLeafColumns:pt(()=>[s.getAllColumns(),s._getOrderColumnsFn()],(y,v)=>{let C=y.flatMap(S=>S.getLeafColumns());return v(C)},gt(e,"debugColumns")),getColumn:y=>s._getAllFlatColumnsById()[y]};Object.assign(s,g);for(let y=0;y<s._features.length;y++){const v=s._features[y];v==null||v.createTable==null||v.createTable(s)}return s}function Al(){return e=>pt(()=>[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 x=BC(e,e._getRowId(s[m],m,c),s[m],m,i,void 0,c==null?void 0:c.id);if(n.flatRows.push(x),n.rowsById[x.id]=x,u.push(x),e.options.getSubRows){var f;x.originalSubRows=e.options.getSubRows(s[m],m),(f=x.originalSubRows)!=null&&f.length&&(x.subRows=r(x.originalSubRows,i+1,x))}}return u};return n.rows=r(t),n},gt(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function Hte(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 $te(e,t,n){return n.options.filterFromLeafRows?Vte(e,t,n):Gte(e,t,n)}function Vte(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 x=[];for(let y=0;y<f.length;y++){var g;let v=f[y];const C=BC(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){x.push(v),i[v.id]=v,s.push(v);continue}if(t(v)||C.subRows.length){x.push(v),i[v.id]=v,s.push(v);continue}}else v=C,t(v)&&(x.push(v),i[v.id]=v,s.push(v))}return x};return{rows:u(e),flatRows:s,rowsById:i}}function Gte(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 x=[];for(let y=0;y<f.length;y++){let v=f[y];if(t(v)){var g;if((g=v.subRows)!=null&&g.length&&m<c){const S=BC(n,v.id,v.original,v.index,v.depth,void 0,v.parentId);S.subRows=u(v.subRows,m+1),v=S}x.push(v),s.push(v),i[v.id]=v}}return x};return{rows:u(e),flatRows:s,rowsById:i}}function _d(){return e=>pt(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,r)=>{if(!t.rows.length||!(n!=null&&n.length)&&!r){for(let y=0;y<t.flatRows.length;y++)t.flatRows[y].columnFilters={},t.flatRows[y].columnFiltersMeta={};return t}const s=[],i=[];(n??[]).forEach(y=>{var v;const C=e.getColumn(y.id);if(!C)return;const S=C.getFilterFn();S&&s.push({id:y.id,filterFn:S,resolvedValue:(v=S.resolveFilterValue==null?void 0:S.resolveFilterValue(y.value))!=null?v:y.value})});const c=(n??[]).map(y=>y.id),u=e.getGlobalFilterFn(),f=e.getAllLeafColumns().filter(y=>y.getCanGlobalFilter());r&&u&&f.length&&(c.push("__global__"),f.forEach(y=>{var v;i.push({id:y.id,filterFn:u,resolvedValue:(v=u.resolveFilterValue==null?void 0:u.resolveFilterValue(r))!=null?v:r})}));let m,x;for(let y=0;y<t.flatRows.length;y++){const v=t.flatRows[y];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++){x=i[C];const S=x.id;if(x.filterFn(v,S,x.resolvedValue,E=>{v.columnFiltersMeta[S]=E})){v.columnFilters.__global__=!0;break}}v.columnFilters.__global__!==!0&&(v.columnFilters.__global__=!1)}}const g=y=>{for(let v=0;v<c.length;v++)if(y.columnFilters[c[v]]===!1)return!1;return!0};return $te(t.rows,g,e)},gt(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function rm(e){return t=>pt(()=>[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,x=m+s;c=c.slice(m,x);let g;t.options.paginateExpandedRows?g={rows:c,flatRows:u,rowsById:f}:g=Hte({rows:c,flatRows:u,rowsById:f}),g.flatRows=[];const y=v=>{g.flatRows.push(v),v.subRows.length&&v.subRows.forEach(y)};return g.rows.forEach(y),g},gt(t.options,"debugTable"))}function Gc(){return e=>pt(()=>[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(x=>({...x}));return m.sort((x,g)=>{for(let v=0;v<i.length;v+=1){var y;const C=i[v],S=c[C.id],E=S.sortUndefined,j=(y=C==null?void 0:C.desc)!=null?y:!1;let R=0;if(E){const T=x.getValue(C.id),N=g.getValue(C.id),A=T===void 0,I=N===void 0;if(A||I){if(E==="first")return A?-1:1;if(E==="last")return A?1:-1;R=A&&I?0:A?E:-E}}if(R===0&&(R=S.sortingFn(x,g,C.id)),R!==0)return j&&(R*=-1),S.invertSorting&&(R*=-1),R}return x.index-g.index}),m.forEach(x=>{var g;s.push(x),(g=x.subRows)!=null&&g.length&&(x.subRows=u(x.subRows))}),m};return{rows:u(n.rows),flatRows:s,rowsById:n.rowsById}},gt(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/**
|
|
804
|
+
* react-table
|
|
805
|
+
*
|
|
806
|
+
* Copyright (c) TanStack
|
|
807
|
+
*
|
|
808
|
+
* This source code is licensed under the MIT license found in the
|
|
809
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
810
|
+
*
|
|
811
|
+
* @license MIT
|
|
812
|
+
*/function hd(e,t){return e?Bte(e)?h.createElement(e,t):e:null}function Bte(e){return qte(e)||typeof e=="function"||Kte(e)}function qte(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function Kte(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function Dl(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=h.useState(()=>({current:Fte(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 tN(e){return{width:e.getSize()}}function Ol({className:e,...t}){return a.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:a.jsx("table",{"data-slot":"table",className:oe("w-full caption-bottom text-sm",e),...t})})}function Il({className:e,...t}){return a.jsx("thead",{"data-slot":"table-header",className:oe("[&_tr]:border-b",e),...t})}function Ml({className:e,...t}){return a.jsx("tbody",{"data-slot":"table-body",className:oe("[&_tr:last-child]:border-0",e),...t})}function Hn({className:e,...t}){return a.jsx("tr",{"data-slot":"table-row",className:oe("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function kl({className:e,...t}){return a.jsx("th",{"data-slot":"table-head",className:oe("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function Yr({className:e,...t}){return a.jsx("td",{"data-slot":"table-cell",className:oe("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}var Wte=Symbol("radix.slottable");function Zte(e){const t=({children:n})=>a.jsx(a.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Wte,t}var H5="AlertDialog",[Yte]=Dr(H5,[Q4]),_i=Q4(),$5=e=>{const{__scopeAlertDialog:t,...n}=e,r=_i(t);return a.jsx(Nx,{...r,...n,modal:!0})};$5.displayName=H5;var Xte="AlertDialogTrigger",Qte=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=_i(n);return a.jsx(_V,{...s,...r,ref:t})});Qte.displayName=Xte;var Jte="AlertDialogPortal",V5=e=>{const{__scopeAlertDialog:t,...n}=e,r=_i(t);return a.jsx(Ax,{...r,...n})};V5.displayName=Jte;var ene="AlertDialogOverlay",G5=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=_i(n);return a.jsx(Dx,{...s,...r,ref:t})});G5.displayName=ene;var ed="AlertDialogContent",[tne,nne]=Yte(ed),rne=Zte("AlertDialogContent"),B5=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...s}=e,i=_i(n),c=h.useRef(null),u=Rt(t,c),f=h.useRef(null);return a.jsx(wV,{contentName:ed,titleName:q5,docsSlug:"alert-dialog",children:a.jsx(tne,{scope:n,cancelRef:f,children:a.jsxs(Ox,{role:"alertdialog",...i,...s,ref:u,onOpenAutoFocus:Me(s.onOpenAutoFocus,m=>{var x;m.preventDefault(),(x=f.current)==null||x.focus({preventScroll:!0})}),onPointerDownOutside:m=>m.preventDefault(),onInteractOutside:m=>m.preventDefault(),children:[a.jsx(rne,{children:r}),a.jsx(sne,{contentRef:c})]})})})});B5.displayName=ed;var q5="AlertDialogTitle",K5=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=_i(n);return a.jsx(aC,{...s,...r,ref:t})});K5.displayName=q5;var W5="AlertDialogDescription",Z5=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=_i(n);return a.jsx(sC,{...s,...r,ref:t})});Z5.displayName=W5;var ane="AlertDialogAction",Y5=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=_i(n);return a.jsx(Ix,{...s,...r,ref:t})});Y5.displayName=ane;var X5="AlertDialogCancel",Q5=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:s}=nne(X5,n),i=_i(n),c=Rt(t,s);return a.jsx(Ix,{...i,...r,ref:c})});Q5.displayName=X5;var sne=({contentRef:e})=>{const t=`\`${ed}\` requires a description for the component to be accessible for screen reader users.
|
|
813
|
+
|
|
814
|
+
You can add a description to the \`${ed}\` by passing a \`${W5}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
815
|
+
|
|
816
|
+
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 \`${ed}\`. 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.
|
|
817
|
+
|
|
818
|
+
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},one=$5,ine=V5,lne=G5,cne=B5,une=Y5,dne=Q5,fne=K5,hne=Z5;function J5({...e}){return a.jsx(one,{"data-slot":"alert-dialog",...e})}function mne({...e}){return a.jsx(ine,{"data-slot":"alert-dialog-portal",...e})}function pne({className:e,...t}){return a.jsx(lne,{"data-slot":"alert-dialog-overlay",className:oe("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function eI({className:e,...t}){return a.jsxs(mne,{children:[a.jsx(pne,{}),a.jsx(cne,{"data-slot":"alert-dialog-content",className:oe("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...t})]})}function tI({className:e,...t}){return a.jsx("div",{"data-slot":"alert-dialog-header",className:oe("flex flex-col gap-2 text-center sm:text-left",e),...t})}function nI({className:e,...t}){return a.jsx("div",{"data-slot":"alert-dialog-footer",className:oe("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function rI({className:e,...t}){return a.jsx(fne,{"data-slot":"alert-dialog-title",className:oe("text-lg font-semibold",e),...t})}function aI({className:e,...t}){return a.jsx(hne,{"data-slot":"alert-dialog-description",className:oe("text-muted-foreground text-sm",e),...t})}function sI({className:e,...t}){return a.jsx(une,{className:oe(JS(),e),...t})}function oI({className:e,...t}){return a.jsx(dne,{className:oe(JS({variant:"outline"}),e),...t})}const iI=["facebook","linkedin","tiktok","microsoft","connector","sql","blank"],lI={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:UZ},tiktok:{title:"TikTok Ads",datamartTitle:"TikTok Ads Data Mart",connectorSourceTitle:"TikTokAds",definitionType:$e.CONNECTOR,icon:zZ},microsoft:{title:"Microsoft Ads",datamartTitle:"Microsoft Ads Data Mart",connectorSourceTitle:"MicrosoftAds",definitionType:$e.CONNECTOR,icon:FZ},connector:{title:"Other connector",datamartTitle:"Connector-based Data Mart",definitionType:$e.CONNECTOR,icon:XS},sql:{title:"SQL query",datamartTitle:"SQL-based Data Mart",definitionType:$e.SQL,icon:YS},blank:{title:"Blank Data Mart",datamartTitle:"New Data Mart",icon:_g}},nN=iI.map(e=>({key:e,...lI[e]}));function gne(e){if(!e||!iI.includes(e))return;const t=e;return{key:t,...lI[t]}}function xne({children:e,className:t="",...n}){return a.jsx("div",{className:"dm-card",children:a.jsx("div",{className:oe("-m-4 flex flex-col items-start justify-between gap-12 overflow-hidden px-8 py-16 lg:flex-row-reverse lg:px-16 lg:py-24 2xl:items-center",t),...n,children:e})})}function yne({children:e,className:t="",...n}){return a.jsx("div",{className:oe("pb-2",t),...n,children:e})}function vne({children:e,className:t="",...n}){return a.jsx("h2",{className:oe("mb-6 text-4xl font-semibold xl:text-5xl",t),...n,children:e})}function bne({children:e,className:t="",...n}){return a.jsx("p",{className:oe("text-muted-foreground text-lg",t),...n,children:e})}function Sne({children:e,rings:t=7,className:n="",...r}){return a.jsxs("div",{className:oe("relative flex w-full justify-center lg:w-[30%] 2xl:w-[35%]",n),...r,children:[a.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:Array.from({length:t},(s,i)=>{const c=`${(16*(i+1)+24).toString()}vmin`;return a.jsx("div",{className:"animate-ring-pulse",style:{height:c,width:c,animationDelay:`${(i*.3).toString()}s`,animationDuration:"4s",opacity:.2+i*.1,filter:i===0?"blur(1px)":"none"}},i)})}),a.jsx("div",{className:"animate-glow-burst"}),a.jsx("div",{className:"animate-icon-entrance","aria-label":"Illustration",children:e})]})}function Cne({children:e,className:t="",...n}){return a.jsx("div",{className:oe("w-full space-y-8 lg:w-[70%] 2xl:w-[65%]",t),...n,children:e})}function Ub({separator:e=!0,children:t,className:n="",...r}){return a.jsx("section",{className:oe("relative pb-10",e&&"after:from-border after:absolute after:bottom-0 after:left-0 after:h-px after:w-full after:bg-gradient-to-r after:to-transparent",n),...r,children:t})}function rN({children:e,className:t="",...n}){return a.jsx("h3",{className:oe("mb-4 text-xl font-medium",t),...n,children:e})}function zb({children:e,className:t="",...n}){return a.jsx("div",{className:oe("flex flex-wrap items-center gap-4",t),...n,children:e})}function eg({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:oe("flex items-center gap-2"),children:[t,n]});return e?a.jsx(we,{asChild:!0,variant:r,size:s??f,className:oe(r==="ghost"?"text-muted-foreground":"",i),...u,children:a.jsx(Nr,{to:e,target:c,children:m})}):a.jsx(we,{variant:r,size:s??f,className:i,...u,children:m})}function Ene(){const{scope:e}=ko(),t=nN.filter(r=>r.definitionType===$e.CONNECTOR),n=nN.filter(r=>r.definitionType!==$e.CONNECTOR);return a.jsxs(xne,{children:[a.jsx(Sne,{children:a.jsx(LZ,{className:"animate-icon-entrance","aria-label":"Data Mart creation illustration"})}),a.jsxs(Cne,{children:[a.jsxs(yne,{children:[a.jsx(vne,{children:"Let’s Build Your First Data Mart"}),a.jsx(bne,{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(Ub,{children:[a.jsx(rN,{children:"Connect a data source"}),a.jsx(zb,{children:t.map(r=>a.jsx(eg,{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(Ub,{children:[a.jsx(rN,{children:"Use existing SQL or start from scratch"}),a.jsx(zb,{children:n.map((r,s)=>a.jsxs(a.Fragment,{children:[a.jsx(eg,{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(Ub,{separator:!1,children:a.jsxs(zb,{children:[a.jsx(eg,{href:"https://www.youtube.com/playlist?list=PLvcNVLV5BVbHHCekyAZBEIVnlC4i1qcHx",icon:a.jsx(E4,{className:"h-4 w-4"}),title:"Watch a 2-minute demo",variant:"ghost",target:"_blank"}),a.jsx(eg,{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(Nz,{className:"h-4 w-4"}),title:"Core concepts",variant:"ghost",target:"_blank"})]})})]})]})}function wne(){return a.jsx(Kr,{className:"bg-muted/50 h-72 w-full rounded-md border-b border-gray-200 dark:border-white/10 dark:bg-white/4"})}const uo={DEFAULT_SORTING_COLUMN:"createdAt",DEFAULT_EXCLUDED_COLUMNS:["actions"],DEFAULT_PAGE_SIZE:15,STORAGE_KEYS:{SORTING_SUFFIX:"-sorting",COLUMN_VISIBILITY_SUFFIX:"-column-visibility",PAGE_SIZE_SUFFIX:"-page-size",COLUMN_SIZING_SUFFIX:"-column-sizing"}},Rne={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 Bc({columns:e,storageKeyPrefix:t,defaultSortingColumn:n=uo.DEFAULT_SORTING_COLUMN,defaultColumnVisibility:r={},defaultPageSize:s=uo.DEFAULT_PAGE_SIZE,excludedColumnsFromSorting:i=uo.DEFAULT_EXCLUDED_COLUMNS,excludedColumnsFromVisibility:c=uo.DEFAULT_EXCLUDED_COLUMNS}){const u=h.useMemo(()=>({SORTING:`${t}${uo.STORAGE_KEYS.SORTING_SUFFIX}`,COLUMN_VISIBILITY:`${t}${uo.STORAGE_KEYS.COLUMN_VISIBILITY_SUFFIX}`,PAGE_SIZE:`${t}${uo.STORAGE_KEYS.PAGE_SIZE_SUFFIX}`}),[t]),f=h.useMemo(()=>Rne.extractColumnIds(e),[e]),m=h.useMemo(()=>f.filter(I=>!i.includes(I)),[f,i]),x=h.useCallback(()=>{const I=ta.get(u.SORTING,"json");return I&&Array.isArray(I)&&I.length>0?I:[{id:m.includes(n)?n:m[0]??uo.DEFAULT_SORTING_COLUMN,desc:!0}]},[u.SORTING,m,n]),g=h.useCallback(()=>{const I=ta.get(u.COLUMN_VISIBILITY,"json");if(I&&typeof I=="object"&&!Array.isArray(I)){const _={};for(const M of f)c.includes(M)||(_[M]=I[M]);return _}return r},[u.COLUMN_VISIBILITY,f,c,r]),y=h.useCallback(()=>{const I=ta.get(u.PAGE_SIZE),_=I?Number(I):null;return typeof _=="number"&&!isNaN(_)&&_>0?_:s},[u.PAGE_SIZE,s]),v=h.useCallback(()=>{const I=ta.get(`${t}${uo.STORAGE_KEYS.COLUMN_SIZING_SUFFIX}`,"json");return I&&typeof I=="object"&&!Array.isArray(I)?I:{}},[t]),[C,S]=h.useState(x),[E,j]=h.useState(g),[R,T]=h.useState(y),[N,A]=h.useState(v);return h.useEffect(()=>{C.length>0&&m.includes(C[0].id)&&ta.set(u.SORTING,C)},[C,m,u.SORTING]),h.useEffect(()=>{ta.set(`${t}${uo.STORAGE_KEYS.COLUMN_SIZING_SUFFIX}`,N)},[N,t]),h.useEffect(()=>{const I={};for(const _ of f){if(c.includes(_))continue;const M=E[_];typeof M=="boolean"&&(I[_]=M)}ta.set(u.COLUMN_VISIBILITY,I)},[E,f,c,u.COLUMN_VISIBILITY]),h.useEffect(()=>{ta.set(u.PAGE_SIZE,R)},[R,u.PAGE_SIZE]),{sorting:C,setSorting:S,columnVisibility:E,setColumnVisibility:j,pageSize:R,setPageSize:T,columnSizing:N,setColumnSizing:A}}function aN(e,[t,n]){return Math.min(n,Math.max(t,e))}function rS(e){const t=jne(e),n=h.forwardRef((r,s)=>{const{children:i,...c}=r,u=h.Children.toArray(i),f=u.find(_ne);if(f){const m=f.props.children,x=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,x):null})}return a.jsx(t,{...c,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function jne(e){const t=h.forwardRef((n,r)=>{const{children:s,...i}=n;if(h.isValidElement(s)){const c=Ane(s),u=Nne(i,s.props);return s.type!==h.Fragment&&(u.ref=r?aa(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 Tne=Symbol("radix.slottable");function _ne(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Tne}function Nne(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 Ane(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 Dne(e){const t=e+"CollectionProvider",[n,r]=Dr(t),[s,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=S=>{const{scope:E,children:j}=S,R=re.useRef(null),T=re.useRef(new Map).current;return a.jsx(s,{scope:E,itemMap:T,collectionRef:R,children:j})};c.displayName=t;const u=e+"CollectionSlot",f=rS(u),m=re.forwardRef((S,E)=>{const{scope:j,children:R}=S,T=i(u,j),N=Rt(E,T.collectionRef);return a.jsx(f,{ref:N,children:R})});m.displayName=u;const x=e+"CollectionItemSlot",g="data-radix-collection-item",y=rS(x),v=re.forwardRef((S,E)=>{const{scope:j,children:R,...T}=S,N=re.useRef(null),A=Rt(E,N),I=i(x,j);return re.useEffect(()=>(I.itemMap.set(N,{ref:N,...T}),()=>void I.itemMap.delete(N))),a.jsx(y,{[g]:"",ref:A,children:R})});v.displayName=x;function C(S){const E=i(e+"CollectionConsumer",S);return re.useCallback(()=>{const R=E.collectionRef.current;if(!R)return[];const T=Array.from(R.querySelectorAll(`[${g}]`));return Array.from(E.itemMap.values()).sort((I,_)=>T.indexOf(I.ref.current)-T.indexOf(_.ref.current))},[E.collectionRef,E.itemMap])}return[{Provider:c,Slot:m,ItemSlot:v},C,r]}function ZC(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 One=[" ","Enter","ArrowUp","ArrowDown"],Ine=[" ","Enter"],Ac="Select",[hy,my,Mne]=Dne(Ac),[Nd]=Dr(Ac,[Mne,Io]),py=Io(),[kne,Ll]=Nd(Ac),[Lne,Pne]=Nd(Ac),cI=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:s,onOpenChange:i,value:c,defaultValue:u,onValueChange:f,dir:m,name:x,autoComplete:g,disabled:y,required:v,form:C}=e,S=py(t),[E,j]=h.useState(null),[R,T]=h.useState(null),[N,A]=h.useState(!1),I=Fh(m),[_,M]=ya({prop:r,defaultProp:s??!1,onChange:i,caller:Ac}),[G,H]=ya({prop:c,defaultProp:u,onChange:f,caller:Ac}),L=h.useRef(null),q=E?C||!!E.closest("form"):!0,[W,B]=h.useState(new Set),V=Array.from(W).map(D=>D.props.value).join(";");return a.jsx(Cd,{...S,children:a.jsxs(kne,{required:v,scope:t,trigger:E,onTriggerChange:j,valueNode:R,onValueNodeChange:T,valueNodeHasChildren:N,onValueNodeHasChildrenChange:A,contentId:ar(),value:G,onValueChange:H,open:_,onOpenChange:M,dir:I,triggerPointerDownPosRef:L,disabled:y,children:[a.jsx(hy.Provider,{scope:t,children:a.jsx(Lne,{scope:e.__scopeSelect,onNativeOptionAdd:h.useCallback(D=>{B(F=>new Set(F).add(D))},[]),onNativeOptionRemove:h.useCallback(D=>{B(F=>{const U=new Set(F);return U.delete(D),U})},[]),children:n})}),q?a.jsxs(II,{"aria-hidden":!0,required:v,tabIndex:-1,name:x,autoComplete:g,value:G,onChange:D=>H(D.target.value),disabled:y,form:C,children:[G===void 0?a.jsx("option",{value:""}):null,Array.from(W)]},V):null]})})};cI.displayName=Ac;var uI="SelectTrigger",dI=h.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,i=py(n),c=Ll(uI,n),u=c.disabled||r,f=Rt(t,c.onTriggerChange),m=my(n),x=h.useRef("touch"),[g,y,v]=kI(S=>{const E=m().filter(T=>!T.disabled),j=E.find(T=>T.value===c.value),R=LI(E,S,j);R!==void 0&&c.onValueChange(R.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(Ed,{asChild:!0,...i,children:a.jsx(tt.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":MI(c.value)?"":void 0,...s,ref:f,onClick:Me(s.onClick,S=>{S.currentTarget.focus(),x.current!=="mouse"&&C(S)}),onPointerDown:Me(s.onPointerDown,S=>{x.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:Me(s.onKeyDown,S=>{const E=g.current!=="";!(S.ctrlKey||S.altKey||S.metaKey)&&S.key.length===1&&y(S.key),!(E&&S.key===" ")&&One.includes(S.key)&&(C(),S.preventDefault())})})})});dI.displayName=uI;var fI="SelectValue",hI=h.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:i,placeholder:c="",...u}=e,f=Ll(fI,n),{onValueNodeHasChildrenChange:m}=f,x=i!==void 0,g=Rt(t,f.onValueNodeChange);return Zr(()=>{m(x)},[m,x]),a.jsx(tt.span,{...u,ref:g,style:{pointerEvents:"none"},children:MI(f.value)?a.jsx(a.Fragment,{children:c}):i})});hI.displayName=fI;var Une="SelectIcon",mI=h.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return a.jsx(tt.span,{"aria-hidden":!0,...s,ref:t,children:r||"▼"})});mI.displayName=Une;var zne="SelectPortal",pI=e=>a.jsx(Hc,{asChild:!0,...e});pI.displayName=zne;var Dc="SelectContent",gI=h.forwardRef((e,t)=>{const n=Ll(Dc,e.__scopeSelect),[r,s]=h.useState();if(Zr(()=>{s(new DocumentFragment)},[]),!n.open){const i=r;return i?Gs.createPortal(a.jsx(xI,{scope:e.__scopeSelect,children:a.jsx(hy.Slot,{scope:e.__scopeSelect,children:a.jsx("div",{children:e.children})})}),i):null}return a.jsx(yI,{...e,ref:t})});gI.displayName=Dc;var Ps=10,[xI,Pl]=Nd(Dc),Fne="SelectContentImpl",Hne=rS("SelectContent.RemoveScroll"),yI=h.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:i,onPointerDownOutside:c,side:u,sideOffset:f,align:m,alignOffset:x,arrowPadding:g,collisionBoundary:y,collisionPadding:v,sticky:C,hideWhenDetached:S,avoidCollisions:E,...j}=e,R=Ll(Dc,n),[T,N]=h.useState(null),[A,I]=h.useState(null),_=Rt(t,Q=>N(Q)),[M,G]=h.useState(null),[H,L]=h.useState(null),q=my(n),[W,B]=h.useState(!1),V=h.useRef(!1);h.useEffect(()=>{if(T)return Tx(T)},[T]),Rx();const D=h.useCallback(Q=>{const[le,...pe]=q().map(Re=>Re.ref.current),[be]=pe.slice(-1),ze=document.activeElement;for(const Re of Q)if(Re===ze||(Re==null||Re.scrollIntoView({block:"nearest"}),Re===le&&A&&(A.scrollTop=0),Re===be&&A&&(A.scrollTop=A.scrollHeight),Re==null||Re.focus(),document.activeElement!==ze))return},[q,A]),F=h.useCallback(()=>D([M,T]),[D,M,T]);h.useEffect(()=>{W&&F()},[W,F]);const{onOpenChange:U,triggerPointerDownPosRef:ee}=R;h.useEffect(()=>{if(T){let Q={x:0,y:0};const le=be=>{var ze,Re;Q={x:Math.abs(Math.round(be.pageX)-(((ze=ee.current)==null?void 0:ze.x)??0)),y:Math.abs(Math.round(be.pageY)-(((Re=ee.current)==null?void 0:Re.y)??0))}},pe=be=>{Q.x<=10&&Q.y<=10?be.preventDefault():T.contains(be.target)||U(!1),document.removeEventListener("pointermove",le),ee.current=null};return ee.current!==null&&(document.addEventListener("pointermove",le),document.addEventListener("pointerup",pe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",le),document.removeEventListener("pointerup",pe,{capture:!0})}}},[T,U,ee]),h.useEffect(()=>{const Q=()=>U(!1);return window.addEventListener("blur",Q),window.addEventListener("resize",Q),()=>{window.removeEventListener("blur",Q),window.removeEventListener("resize",Q)}},[U]);const[he,z]=kI(Q=>{const le=q().filter(ze=>!ze.disabled),pe=le.find(ze=>ze.ref.current===document.activeElement),be=LI(le,Q,pe);be&&setTimeout(()=>be.ref.current.focus())}),$=h.useCallback((Q,le,pe)=>{const be=!V.current&&!pe;(R.value!==void 0&&R.value===le||be)&&(G(Q),be&&(V.current=!0))},[R.value]),P=h.useCallback(()=>T==null?void 0:T.focus(),[T]),K=h.useCallback((Q,le,pe)=>{const be=!V.current&&!pe;(R.value!==void 0&&R.value===le||be)&&L(Q)},[R.value]),Y=r==="popper"?aS:vI,se=Y===aS?{side:u,sideOffset:f,align:m,alignOffset:x,arrowPadding:g,collisionBoundary:y,collisionPadding:v,sticky:C,hideWhenDetached:S,avoidCollisions:E}:{};return a.jsx(xI,{scope:n,content:T,viewport:A,onViewportChange:I,itemRefCallback:$,selectedItem:M,onItemLeave:P,itemTextRefCallback:K,focusSelectedItem:F,selectedItemText:H,position:r,isPositioned:W,searchRef:he,children:a.jsx(Mh,{as:Hne,allowPinchZoom:!0,children:a.jsx(Ih,{asChild:!0,trapped:R.open,onMountAutoFocus:Q=>{Q.preventDefault()},onUnmountAutoFocus:Me(s,Q=>{var le;(le=R.trigger)==null||le.focus({preventScroll:!0}),Q.preventDefault()}),children:a.jsx(Fc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:c,onFocusOutside:Q=>Q.preventDefault(),onDismiss:()=>R.onOpenChange(!1),children:a.jsx(Y,{role:"listbox",id:R.contentId,"data-state":R.open?"open":"closed",dir:R.dir,onContextMenu:Q=>Q.preventDefault(),...j,...se,onPlaced:()=>B(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...j.style},onKeyDown:Me(j.onKeyDown,Q=>{const le=Q.ctrlKey||Q.altKey||Q.metaKey;if(Q.key==="Tab"&&Q.preventDefault(),!le&&Q.key.length===1&&z(Q.key),["ArrowUp","ArrowDown","Home","End"].includes(Q.key)){let be=q().filter(ze=>!ze.disabled).map(ze=>ze.ref.current);if(["ArrowUp","End"].includes(Q.key)&&(be=be.slice().reverse()),["ArrowUp","ArrowDown"].includes(Q.key)){const ze=Q.target,Re=be.indexOf(ze);be=be.slice(Re+1)}setTimeout(()=>D(be)),Q.preventDefault()}})})})})})})});yI.displayName=Fne;var $ne="SelectItemAlignedPosition",vI=h.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,i=Ll(Dc,n),c=Pl(Dc,n),[u,f]=h.useState(null),[m,x]=h.useState(null),g=Rt(t,_=>x(_)),y=my(n),v=h.useRef(!1),C=h.useRef(!0),{viewport:S,selectedItem:E,selectedItemText:j,focusSelectedItem:R}=c,T=h.useCallback(()=>{if(i.trigger&&i.valueNode&&u&&m&&S&&E&&j){const _=i.trigger.getBoundingClientRect(),M=m.getBoundingClientRect(),G=i.valueNode.getBoundingClientRect(),H=j.getBoundingClientRect();if(i.dir!=="rtl"){const ze=H.left-M.left,Re=G.left-ze,Ge=_.left-Re,ot=_.width+Ge,Vt=Math.max(ot,M.width),He=window.innerWidth-Ps,Xt=aN(Re,[Ps,Math.max(Ps,He-Vt)]);u.style.minWidth=ot+"px",u.style.left=Xt+"px"}else{const ze=M.right-H.right,Re=window.innerWidth-G.right-ze,Ge=window.innerWidth-_.right-Re,ot=_.width+Ge,Vt=Math.max(ot,M.width),He=window.innerWidth-Ps,Xt=aN(Re,[Ps,Math.max(Ps,He-Vt)]);u.style.minWidth=ot+"px",u.style.right=Xt+"px"}const L=y(),q=window.innerHeight-Ps*2,W=S.scrollHeight,B=window.getComputedStyle(m),V=parseInt(B.borderTopWidth,10),D=parseInt(B.paddingTop,10),F=parseInt(B.borderBottomWidth,10),U=parseInt(B.paddingBottom,10),ee=V+D+W+U+F,he=Math.min(E.offsetHeight*5,ee),z=window.getComputedStyle(S),$=parseInt(z.paddingTop,10),P=parseInt(z.paddingBottom,10),K=_.top+_.height/2-Ps,Y=q-K,se=E.offsetHeight/2,Q=E.offsetTop+se,le=V+D+Q,pe=ee-le;if(le<=K){const ze=L.length>0&&E===L[L.length-1].ref.current;u.style.bottom="0px";const Re=m.clientHeight-S.offsetTop-S.offsetHeight,Ge=Math.max(Y,se+(ze?P:0)+Re+F),ot=le+Ge;u.style.height=ot+"px"}else{const ze=L.length>0&&E===L[0].ref.current;u.style.top="0px";const Ge=Math.max(K,V+S.offsetTop+(ze?$:0)+se)+pe;u.style.height=Ge+"px",S.scrollTop=le-K+S.offsetTop}u.style.margin=`${Ps}px 0`,u.style.minHeight=he+"px",u.style.maxHeight=q+"px",r==null||r(),requestAnimationFrame(()=>v.current=!0)}},[y,i.trigger,i.valueNode,u,m,S,E,j,i.dir,r]);Zr(()=>T(),[T]);const[N,A]=h.useState();Zr(()=>{m&&A(window.getComputedStyle(m).zIndex)},[m]);const I=h.useCallback(_=>{_&&C.current===!0&&(T(),R==null||R(),C.current=!1)},[T,R]);return a.jsx(Gne,{scope:n,contentWrapper:u,shouldExpandOnScrollRef:v,onScrollButtonChange:I,children:a.jsx("div",{ref:f,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:N},children:a.jsx(tt.div,{...s,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});vI.displayName=$ne;var Vne="SelectPopperPosition",aS=h.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=Ps,...i}=e,c=py(n);return a.jsx(Lh,{...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)"}})});aS.displayName=Vne;var[Gne,YC]=Nd(Dc,{}),sS="SelectViewport",bI=h.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,i=Pl(sS,n),c=YC(sS,n),u=Rt(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(hy.Slot,{scope:n,children:a.jsx(tt.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:Me(s.onScroll,m=>{const x=m.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:y}=c;if(y!=null&&y.current&&g){const v=Math.abs(f.current-x.scrollTop);if(v>0){const C=window.innerHeight-Ps*2,S=parseFloat(g.style.minHeight),E=parseFloat(g.style.height),j=Math.max(S,E);if(j<C){const R=j+v,T=Math.min(C,R),N=R-T;g.style.height=T+"px",g.style.bottom==="0px"&&(x.scrollTop=N>0?N:0,g.style.justifyContent="flex-end")}}}f.current=x.scrollTop})})})]})});bI.displayName=sS;var SI="SelectGroup",[Bne,qne]=Nd(SI),CI=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=ar();return a.jsx(Bne,{scope:n,id:s,children:a.jsx(tt.div,{role:"group","aria-labelledby":s,...r,ref:t})})});CI.displayName=SI;var EI="SelectLabel",Kne=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=qne(EI,n);return a.jsx(tt.div,{id:s.id,...r,ref:t})});Kne.displayName=EI;var ax="SelectItem",[Wne,wI]=Nd(ax),RI=h.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:i,...c}=e,u=Ll(ax,n),f=Pl(ax,n),m=u.value===r,[x,g]=h.useState(i??""),[y,v]=h.useState(!1),C=Rt(t,R=>{var T;return(T=f.itemRefCallback)==null?void 0:T.call(f,R,r,s)}),S=ar(),E=h.useRef("touch"),j=()=>{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(Wne,{scope:n,value:r,disabled:s,textId:S,isSelected:m,onItemTextChange:h.useCallback(R=>{g(T=>T||((R==null?void 0:R.textContent)??"").trim())},[]),children:a.jsx(hy.ItemSlot,{scope:n,value:r,disabled:s,textValue:x,children:a.jsx(tt.div,{role:"option","aria-labelledby":S,"data-highlighted":y?"":void 0,"aria-selected":m&&y,"data-state":m?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...c,ref:C,onFocus:Me(c.onFocus,()=>v(!0)),onBlur:Me(c.onBlur,()=>v(!1)),onClick:Me(c.onClick,()=>{E.current!=="mouse"&&j()}),onPointerUp:Me(c.onPointerUp,()=>{E.current==="mouse"&&j()}),onPointerDown:Me(c.onPointerDown,R=>{E.current=R.pointerType}),onPointerMove:Me(c.onPointerMove,R=>{var T;E.current=R.pointerType,s?(T=f.onItemLeave)==null||T.call(f):E.current==="mouse"&&R.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Me(c.onPointerLeave,R=>{var T;R.currentTarget===document.activeElement&&((T=f.onItemLeave)==null||T.call(f))}),onKeyDown:Me(c.onKeyDown,R=>{var N;((N=f.searchRef)==null?void 0:N.current)!==""&&R.key===" "||(Ine.includes(R.key)&&j(),R.key===" "&&R.preventDefault())})})})})});RI.displayName=ax;var $f="SelectItemText",jI=h.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...i}=e,c=Ll($f,n),u=Pl($f,n),f=wI($f,n),m=Pne($f,n),[x,g]=h.useState(null),y=Rt(t,j=>g(j),f.onItemTextChange,j=>{var R;return(R=u.itemTextRefCallback)==null?void 0:R.call(u,j,f.value,f.disabled)}),v=x==null?void 0:x.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 Zr(()=>(S(C),()=>E(C)),[S,E,C]),a.jsxs(a.Fragment,{children:[a.jsx(tt.span,{id:f.textId,...i,ref:y}),f.isSelected&&c.valueNode&&!c.valueNodeHasChildren?Gs.createPortal(i.children,c.valueNode):null]})});jI.displayName=$f;var TI="SelectItemIndicator",_I=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return wI(TI,n).isSelected?a.jsx(tt.span,{"aria-hidden":!0,...r,ref:t}):null});_I.displayName=TI;var oS="SelectScrollUpButton",NI=h.forwardRef((e,t)=>{const n=Pl(oS,e.__scopeSelect),r=YC(oS,e.__scopeSelect),[s,i]=h.useState(!1),c=Rt(t,r.onScrollButtonChange);return Zr(()=>{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(DI,{...e,ref:c,onAutoScroll:()=>{const{viewport:u,selectedItem:f}=n;u&&f&&(u.scrollTop=u.scrollTop-f.offsetHeight)}}):null});NI.displayName=oS;var iS="SelectScrollDownButton",AI=h.forwardRef((e,t)=>{const n=Pl(iS,e.__scopeSelect),r=YC(iS,e.__scopeSelect),[s,i]=h.useState(!1),c=Rt(t,r.onScrollButtonChange);return Zr(()=>{if(n.viewport&&n.isPositioned){let u=function(){const m=f.scrollHeight-f.clientHeight,x=Math.ceil(f.scrollTop)<m;i(x)};const f=n.viewport;return u(),f.addEventListener("scroll",u),()=>f.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),s?a.jsx(DI,{...e,ref:c,onAutoScroll:()=>{const{viewport:u,selectedItem:f}=n;u&&f&&(u.scrollTop=u.scrollTop+f.offsetHeight)}}):null});AI.displayName=iS;var DI=h.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,i=Pl("SelectScrollButton",n),c=h.useRef(null),u=my(n),f=h.useCallback(()=>{c.current!==null&&(window.clearInterval(c.current),c.current=null)},[]);return h.useEffect(()=>()=>f(),[f]),Zr(()=>{var x;const m=u().find(g=>g.ref.current===document.activeElement);(x=m==null?void 0:m.ref.current)==null||x.scrollIntoView({block:"nearest"})},[u]),a.jsx(tt.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:Me(s.onPointerDown,()=>{c.current===null&&(c.current=window.setInterval(r,50))}),onPointerMove:Me(s.onPointerMove,()=>{var m;(m=i.onItemLeave)==null||m.call(i),c.current===null&&(c.current=window.setInterval(r,50))}),onPointerLeave:Me(s.onPointerLeave,()=>{f()})})}),Zne="SelectSeparator",OI=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return a.jsx(tt.div,{"aria-hidden":!0,...r,ref:t})});OI.displayName=Zne;var lS="SelectArrow",Yne=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=py(n),i=Ll(lS,n),c=Pl(lS,n);return i.open&&c.position==="popper"?a.jsx(Ph,{...s,...r,ref:t}):null});Yne.displayName=lS;var Xne="SelectBubbleInput",II=h.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const s=h.useRef(null),i=Rt(r,s),c=ZC(t);return h.useEffect(()=>{const u=s.current;if(!u)return;const f=window.HTMLSelectElement.prototype,x=Object.getOwnPropertyDescriptor(f,"value").set;if(c!==t&&x){const g=new Event("change",{bubbles:!0});x.call(u,t),u.dispatchEvent(g)}},[c,t]),a.jsx(tt.select,{...n,style:{...k3,...n.style},ref:i,defaultValue:t})});II.displayName=Xne;function MI(e){return e===""||e===void 0}function kI(e){const t=Ws(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 LI(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=Qne(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 Qne(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Jne=cI,ere=dI,tre=hI,nre=mI,rre=pI,are=gI,sre=bI,ore=CI,ire=RI,lre=jI,cre=_I,ure=NI,dre=AI,fre=OI;function oa({...e}){return a.jsx(Jne,{"data-slot":"select",...e})}function gy({...e}){return a.jsx(ore,{"data-slot":"select-group",...e})}function ia({...e}){return a.jsx(tre,{"data-slot":"select-value",...e})}function la({className:e,size:t="default",children:n,...r}){return a.jsxs(ere,{"data-slot":"select-trigger","data-size":t,className:oe("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[n,a.jsx(nre,{asChild:!0,children:a.jsx(ss,{className:"size-4 opacity-50"})})]})}function ca({className:e,children:t,position:n="popper",...r}){return a.jsx(rre,{children:a.jsxs(are,{"data-slot":"select-content",className:oe("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[a.jsx(hre,{}),a.jsx(sre,{className:oe("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),a.jsx(mre,{})]})})}function Fn({className:e,children:t,...n}){return a.jsxs(ire,{"data-slot":"select-item",className:oe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[a.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:a.jsx(cre,{children:a.jsx(Ia,{className:"size-4"})})}),a.jsx(lre,{children:t})]})}function PI({className:e,...t}){return a.jsx(fre,{"data-slot":"select-separator",className:oe("bg-border pointer-events-none -mx-1 my-1 h-px",e),...t})}function hre({className:e,...t}){return a.jsx(ure,{"data-slot":"select-scroll-up-button",className:oe("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(Ng,{className:"size-4"})})}function mre({className:e,...t}){return a.jsx(dre,{"data-slot":"select-scroll-down-button",className:oe("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(ss,{className:"size-4"})})}const sN=[15,30,50,100,200];function XC({table:e,pageSizeOptions:t=sN,displaySelected:n=!0}){const r=h.useMemo(()=>{const x=t.map(g=>Math.round(g)).filter(g=>g>0);return x.length>0?x:sN},[t]);h.useEffect(()=>{const x=e.getState().pagination.pageSize,g=r[0];g&&!r.includes(x)&&e.setPageSize(g)},[r,e]);const s=e.getSelectedRowModel().rows.length,i=e.getState().pagination.pageIndex,c=e.getState().pagination.pageSize,u=e.getFilteredRowModel().rows.length,f=i*c+1,m=Math.min(f+c-1,u);return a.jsxs("div",{className:"text-muted-foreground/75 flex items-center text-sm",children:[a.jsx("div",{className:"flex-1",children:n&&s>0&&a.jsxs("span",{children:[s," ",s===1?"row":"rows"," selected"]})}),a.jsxs("div",{className:"flex items-center space-x-6 lg:space-x-8",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("span",{children:"Rows per page"}),a.jsxs(oa,{value:`${e.getState().pagination.pageSize}`,onValueChange:x=>{e.setPageSize(Number(x))},children:[a.jsx(la,{className:"bg-background h-8 w-[74px]",children:a.jsx(ia,{placeholder:e.getState().pagination.pageSize})}),a.jsx(ca,{children:r.map(x=>a.jsx(Fn,{value:`${x}`,children:x},x))})]})]}),a.jsxs("div",{className:"flex items-center justify-center",children:[f,"–",m," of ",u," ",u===1?"row":"rows"]}),a.jsxs("div",{className:"flex items-center space-x-1",children:[a.jsxs(we,{variant:"outline",size:"icon",className:"hidden size-8 lg:flex",onClick:()=>e.setPageIndex(0),disabled:!e.getCanPreviousPage(),children:[a.jsx("span",{className:"sr-only",children:"Go to first page"}),a.jsx(BU,{})]}),a.jsxs(we,{variant:"outline",size:"icon",className:"size-8",onClick:()=>e.previousPage(),disabled:!e.getCanPreviousPage(),children:[a.jsx("span",{className:"sr-only",children:"Go to previous page"}),a.jsx(f4,{})]}),a.jsxs(we,{variant:"outline",size:"icon",className:"size-8",onClick:()=>e.nextPage(),disabled:!e.getCanNextPage(),children:[a.jsx("span",{className:"sr-only",children:"Go to next page"}),a.jsx(ba,{})]}),a.jsxs(we,{variant:"outline",size:"icon",className:"hidden size-8 lg:flex",onClick:()=>e.setPageIndex(e.getPageCount()-1),disabled:!e.getCanNextPage(),children:[a.jsx("span",{className:"sr-only",children:"Go to last page"}),a.jsx(KU,{})]})]})]})]})}function pre({table:e,isLoading:t=!1,concurrency:n=5,maxPrefetch:r}){const s=h.useRef(new Set),{pagination:{pageIndex:i,pageSize:c},sorting:u}=e.getState();h.useEffect(()=>{if(t)return;const f=e.getPaginationRowModel().rows;if(!f.length)return;let m=f.map(g=>g.original.id).filter(g=>!s.current.has(g));if(!m.length)return;typeof r=="number"&&(m=m.slice(0,r)),(async()=>{for(let g=0;g<m.length;g+=n){const y=m.slice(g,g+n);await Promise.allSettled(y.map(async v=>{await D5(v),s.current.add(v)}))}})()},[e,t,n,r,i,c,u])}function gre({columns:e,data:t,deleteDataMart:n,refetchDataMarts:r,isLoading:s}){var B;const{navigate:i,scope:c}=ko(),{sorting:u,setSorting:f,columnVisibility:m,setColumnVisibility:x,pageSize:g,setPageSize:y,columnSizing:v,setColumnSizing:C}=Bc({columns:e,storageKeyPrefix:"data-mart-list",defaultColumnVisibility:{triggersCount:!1,reportsCount:!1,createdByUser:!1}}),[S,E]=h.useState([]),[j,R]=h.useState({}),[T,N]=h.useState(0),[A,I]=h.useState(!1),[_,M]=h.useState(!1),G="data-mart-empty-state-onboarding-video-shown",{open:H}=PC();h.useEffect(()=>{!s&&t.length===0&&(ta.get(G,"boolean")||(H("video-3-getting-started-with-data-marts"),ta.set(G,!0)))},[s,t.length,H]);const L=async()=>{try{M(!0);const D=W.getSelectedRowModel().rows.map(F=>F.original.id);for(const F of D)await n(F);In.success(`Successfully deleted ${String(D.length)} data mart${D.length!==1?"s":""}`),R({}),await r()}catch(V){console.error("Error deleting data marts:",V),In.error("Failed to delete some data marts. Please try again.")}finally{M(!1),I(!1)}},q=Object.keys(j).length>0,W=Dl({data:t,columns:[{id:"select",size:40,enableResizing:!1,header:({table:V})=>a.jsx("button",{type:"button",role:"checkbox","aria-checked":V.getIsAllPageRowsSelected(),"data-state":V.getIsAllPageRowsSelected()?"checked":"unchecked","aria-label":"Select all rows on this page",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:V.getToggleAllPageRowsSelectedHandler(),children:V.getIsAllPageRowsSelected()&&a.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:a.jsx(Ia,{className:"size-3.5 text-white"})})}),cell:({row:V})=>a.jsx("button",{type:"button",role:"checkbox","aria-checked":V.getIsSelected(),"data-state":V.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:V.getToggleSelectedHandler(),children:V.getIsSelected()&&a.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:a.jsx(Ia,{className:"size-3.5 text-white"})})}),enableSorting:!1,enableHiding:!1},...e],getCoreRowModel:Al(),getPaginationRowModel:rm(),onSortingChange:f,getSortedRowModel:Gc(),onColumnFiltersChange:E,getFilteredRowModel:_d(),onColumnVisibilityChange:x,onRowSelectionChange:R,initialState:{pagination:{pageSize:g}},state:{sorting:u,columnFilters:S,columnVisibility:m,rowSelection:j,pagination:{pageIndex:T,pageSize:g},columnSizing:v},defaultColumn:{size:void 0},onColumnSizingChange:C,onPaginationChange:V=>{if(typeof V=="function"){const F=V({pageIndex:T,pageSize:g});F.pageSize!==g&&y(F.pageSize),F.pageIndex!==T&&N(F.pageIndex)}},enableRowSelection:!0,enableColumnResizing:!0,columnResizeMode:"onChange"});return pre({table:W,isLoading:s,concurrency:5}),s?a.jsx("div",{children:a.jsx(wne,{})}):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:[q&&a.jsx(we,{variant:"destructive",size:"sm",className:"dm-card-toolbar-btn-delete",onClick:()=>{I(!0)},disabled:_,children:a.jsx(os,{className:"h-4 w-4"})}),a.jsxs("div",{className:"dm-card-toolbar-search",children:[a.jsx(zc,{className:"dm-card-toolbar-search-icon"}),a.jsx(ct,{placeholder:"Search by title",value:(B=W.getColumn("title"))==null?void 0:B.getFilterValue(),onChange:V=>{var D;return(D=W.getColumn("title"))==null?void 0:D.setFilterValue(V.target.value)},className:"dm-card-toolbar-search-input"})]})]}),a.jsx("div",{className:"dm-card-toolbar-right",children:a.jsx(Nr,{to:c("/data-marts/create"),children:a.jsxs(we,{variant:"outline",className:"dm-card-toolbar-btn-primary",children:[a.jsx(sa,{className:"h-4 w-4"}),"New Data Mart"]})})})]}),a.jsx("div",{className:"dm-card-table-wrap",children:a.jsxs(Ol,{className:"dm-card-table",role:"table","aria-label":"Data Marts table",children:[a.jsx(Il,{className:"dm-card-table-header",children:W.getHeaderGroups().map(V=>a.jsx(Hn,{className:"dm-card-table-header-row",children:V.headers.map(D=>a.jsxs(kl,{className:"group relative [&:has([role=checkbox])]:pl-6 [&>[role=checkbox]]:translate-y-[2px]",style:tN(D.column),children:[D.isPlaceholder?null:hd(D.column.columnDef.header,D.getContext()),D.column.getCanResize()&&a.jsx("div",{onMouseDown:D.getResizeHandler(),onTouchStart:D.getResizeHandler(),onDoubleClick:()=>{D.column.resetSize()},className:"absolute top-0 right-[2px] flex h-full w-1 cursor-col-resize items-center justify-center bg-transparent select-none group-hover:bg-neutral-200/50 hover:bg-neutral-200",title:"Drag to resize. Double-click to reset width"})]},D.id))},V.id))}),a.jsx(Ml,{className:"dm-card-table-body",children:W.getRowModel().rows.length?W.getRowModel().rows.map(V=>a.jsx(Hn,{"data-state":V.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 F=V.original.id;i(`/data-marts/${F}/data-setup`)},children:V.getVisibleCells().map(D=>a.jsx(Yr,{className:`px-6 pr-0 whitespace-normal [&>[role=checkbox]]:translate-y-[2px] ${D.column.id==="actions"?"actions-cell":""} ${D.column.id==="createdAt"?"whitespace-nowrap":""} ${D.column.id==="runHistory"?"pl-5":""}`,style:tN(D.column),children:hd(D.column.columnDef.cell,D.getContext())},D.id))},V.id)):a.jsx(Hn,{children:a.jsx(Yr,{colSpan:e.length+1,className:"dm-card-table-body-row-empty",children:"Oops! Nothing matched your search"})})})]})}),a.jsx(XC,{table:W}),a.jsx(J5,{open:A,onOpenChange:I,children:a.jsxs(eI,{children:[a.jsxs(tI,{children:[a.jsx(rI,{children:"Are you sure?"}),a.jsxs(aI,{children:["You're about to delete ",Object.keys(j).length," selected data mart",Object.keys(j).length!==1?"s":"",". This action cannot be undone."]})]}),a.jsxs(nI,{children:[a.jsx(oI,{disabled:_,children:"Cancel"}),a.jsx(sI,{onClick:()=>{L()},disabled:_,className:"bg-destructive hover:bg-destructive/90",children:_?"Deleting...":"Delete"})]})]})})]}):a.jsx(Ene,{})}function UI({userProjection:e}){const{fullName:t,email:n,avatar:r}=e,s=t??n??"Unknown User",i=MO(t,n);return a.jsxs(em,{children:[a.jsx(tm,{asChild:!0,children:a.jsxs("div",{className:"inline-flex max-w-full items-center gap-1 rounded-full bg-neutral-100 py-1 pr-3 pl-1 dark:bg-neutral-900",children:[a.jsx(G1,{avatar:r,initials:i,displayName:s,size:Ju.SMALL}),a.jsx("span",{className:"text-muted-foreground min-w-0 truncate text-sm leading-tight","aria-label":s,title:s,children:s})]})}),a.jsx(nm,{side:"top",align:"start",className:"max-w-auto sm:max-w-auto w-auto p-2 sm:w-auto",children:a.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[a.jsx(G1,{avatar:r,initials:i,displayName:s,size:Ju.LARGE}),a.jsxs("div",{className:"grid space-y-1 pr-4 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 QC({...e}){return a.jsx(Nx,{"data-slot":"dialog",...e})}function xre({...e}){return a.jsx(Ax,{"data-slot":"dialog-portal",...e})}function yre({className:e,...t}){return a.jsx(Dx,{"data-slot":"dialog-overlay",className:oe("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function JC({className:e,children:t,showCloseButton:n=!0,...r}){return a.jsxs(xre,{"data-slot":"dialog-portal",children:[a.jsx(yre,{}),a.jsxs(Ox,{"data-slot":"dialog-content",className:oe("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...r,children:[t,n&&a.jsxs(Ix,{"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(Cc,{}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function eE({className:e,...t}){return a.jsx("div",{"data-slot":"dialog-header",className:oe("flex flex-col gap-2 text-center sm:text-left",e),...t})}function vre({className:e,...t}){return a.jsx("div",{"data-slot":"dialog-footer",className:oe("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function tE({className:e,...t}){return a.jsx(aC,{"data-slot":"dialog-title",className:oe("text-lg leading-none font-semibold",e),...t})}function nE({className:e,...t}){return a.jsx(sC,{"data-slot":"dialog-description",className:oe("text-muted-foreground text-sm",e),...t})}const bre=Pc("",{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 td({className:e,variant:t,...n}){return t==="brand"?a.jsx(we,{variant:"default",className:oe(bre({variant:t}),e),...n}):a.jsx(we,{variant:t,className:e,...n})}const Ar=({open:e,onOpenChange:t,title:n,description:r,confirmLabel:s="Confirm",cancelLabel:i,onConfirm:c,onCancel:u,variant:f="destructive",children:m})=>{const x=()=>{t(!1),u==null||u()};return a.jsx(QC,{open:e,onOpenChange:t,children:a.jsxs(JC,{children:[a.jsxs(eE,{children:[a.jsx(tE,{children:n}),a.jsx(nE,{children:r})]}),m,a.jsxs(vre,{children:[i&&a.jsx(td,{variant:"secondary",onClick:x,children:i}),a.jsx(td,{variant:f,onClick:c,children:s})]})]})})},Sre=({row:e,onDeleteSuccess:t})=>{const{scope:n}=ko(),[r,s]=h.useState(!1),[i,c]=h.useState(!1),{deleteDataMart:u,refreshList:f}=A5(),m=async()=>{try{await u(e.original.id),s(!1),await f(),t==null||t()}catch(x){console.error("Failed to delete data mart:",x)}};return a.jsxs("div",{className:"text-right",children:[a.jsxs(Or,{open:i,onOpenChange:c,children:[a.jsx(Ir,{asChild:!0,children:a.jsx(we,{variant:"ghost",className:`dm-card-table-body-row-actionbtn opacity-0 transition-opacity ${i?"opacity-100":"group-hover:opacity-100"}`,"aria-label":"Open menu",children:a.jsx(Do,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsxs(Mr,{align:"end",children:[a.jsx(Ut,{children:a.jsxs(Nr,{to:n(`/data-marts/${e.original.id}/data-setup`),className:"flex gap-2 text-left",children:[a.jsx(xd,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),a.jsx("span",{children:"Edit"})]})}),a.jsx(ns,{}),a.jsxs(Ut,{onClick:()=>{s(!0)},children:[a.jsx(os,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),a.jsx("span",{className:"text-red-600",children:"Delete"})]})]})]}),a.jsx(Ar,{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"})]})};function Cre({prefetch:e,delay:t=100,enabled:n=!0}){const r=h.useRef(null),s=h.useCallback(()=>{n&&(r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{e()},t))},[e,t,n]),i=h.useCallback(()=>{r.current&&(clearTimeout(r.current),r.current=null)},[]);return h.useEffect(()=>()=>{r.current&&clearTimeout(r.current)},[]),{onMouseEnter:s,onMouseLeave:i}}const Ere={[Nt.SUCCESS]:En.SUCCESS,[Nt.RUNNING]:En.INFO,[Nt.FAILED]:En.ERROR,[Nt.CANCELLED]:En.WARNING,[Nt.INTERRUPTED]:En.WARNING,[Nt.PENDING]:En.INFO,[Nt.RESTRICTED]:En.WARNING},zI={[Wr.NO_RUNS]:{text:"No runs in the last 30 days",dotClass:"bg-neutral-400 dark:bg-neutral-600",ringClass:"ring-neutral-400/50"},[Wr.ALL_RUNS_SUCCESS]:{text:"All recent runs succeeded",dotClass:"bg-green-500",ringClass:"ring-green-500/50"},[Wr.MIXED_RUNS]:{text:"Mixed results in the last 30 days",dotClass:"bg-yellow-500",ringClass:"ring-yellow-500/50"},[Wr.ALL_RUNS_FAILED]:{text:"All recent runs failed",dotClass:"bg-red-500",ringClass:"ring-red-500/50"},[Wr.RUNS_IN_PROGRESS]:{text:"Some runs are in progress",dotClass:"bg-blue-500",ringClass:"ring-blue-500/50"}},wre={dotClass:"border border-neutral-400 bg-transparent",ringClass:"ring-neutral-400/50"};function Rre(e){const{healthStatus:t,isLoading:n,isNotFetched:r}=e;return n?"Loading run status...":r?"Hover to load run status":zI[t].text}function Fb({label:e,run:t}){return a.jsxs(fi,{children:[a.jsx(hi,{children:e}),a.jsx(mi,{children:t?a.jsxs(Td,{type:Ere[t.status],variant:"ghost",children:[a.jsx(ws,{date:t.createdAt})," (",t.triggerType,")"]}):a.jsx("span",{className:"text-muted-foreground text-sm",children:"No runs"})})]})}const jre=({row:e})=>{const{navigate:t}=ko(),n=e.original,r=n.status.code===br.DRAFT,{healthStatus:s,isLoading:i,isFetched:c,latestRunsByType:u}=Q_(n.id),{prefetch:f}=Q_(n.id),m=Cre({prefetch:f});if(r)return a.jsxs(rt,{children:[a.jsx(at,{asChild:!0,children:a.jsx("div",{className:"group inline-flex h-6 w-6 items-center justify-center",children:a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"h-2 w-2 rounded-full bg-neutral-300 dark:bg-neutral-700"}),a.jsx("div",{className:"pointer-events-none absolute -inset-[3px] rounded-full opacity-0 ring-1 ring-neutral-300/50 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100"})]})})}),a.jsx(st,{side:"top",align:"center",children:"Draft Data Mart is not available to run. Publish it to activate runs."})]});const x=n.definitionType===$e.CONNECTOR,g=!c,{dotClass:y,ringClass:v}=c?zI[s]:wre;return a.jsxs(em,{children:[a.jsx(tm,{asChild:!0,children:a.jsx("div",{className:"group inline-flex h-6 w-6 cursor-pointer items-center justify-center",...m,children:a.jsxs(rt,{children:[a.jsx(at,{asChild:!0,children:a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:oe("h-2 w-2 rounded-full transition-colors",y,i&&"animate-pulse")}),a.jsx("div",{className:oe("pointer-events-none absolute -inset-[3px] rounded-full opacity-0 ring-1 transition-opacity","group-hover:opacity-100 group-focus-visible:opacity-100",v)})]})}),a.jsx(st,{side:"top",align:"center",children:Rre({healthStatus:s,isLoading:i,isNotFetched:g})})]})})}),c&&!i&&a.jsxs(nm,{side:"right",align:"start",children:[a.jsx(oy,{children:a.jsxs(iy,{children:[a.jsx(ly,{children:n.title}),a.jsx(cy,{children:"Recent run history for last 30 days"})]})}),a.jsxs(uy,{children:[x&&a.jsx(Fb,{label:"Connector run",run:u.connector}),a.jsx(Fb,{label:"Report run",run:u.report}),a.jsx(Fb,{label:"Insight run",run:u.insight})]}),a.jsx(dy,{children:a.jsxs(we,{className:"w-full",onClick:()=>{t(`/data-marts/${n.id}/run-history`)},children:["View Full Run History",a.jsx(ba,{className:"h-4 w-4"})]})})]})]})},oN={types:{[$e.SQL]:{type:$e.SQL,displayName:"SQL",icon:YS},[$e.TABLE]:{type:$e.TABLE,displayName:"Table",icon:R4},[$e.VIEW]:{type:$e.VIEW,displayName:"View",icon:Mz},[$e.TABLE_PATTERN]:{type:$e.TABLE_PATTERN,displayName:"Pattern",icon:jU},[$e.CONNECTOR]:{type:$e.CONNECTOR,displayName:"Connector",icon:XS}},getInfo(e){return e?this.types[e]:{type:null,displayName:"—",icon:()=>null}}};var On=(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.HEALTH_STATUS="healthStatus",e))(On||{});const ri={[On.TITLE]:"Title",[On.DEFINITION_TYPE]:"Input Source",[On.STORAGE_TYPE]:"Storage",[On.STATUS]:"Status",[On.TRIGGERS_COUNT]:"Triggers",[On.REPORTS_COUNT]:"Reports",[On.CREATED_AT]:"Created at",[On.CREATED_BY_USER]:"Created by",[On.HEALTH_STATUS]:""};function Yn({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(we,{variant:"ghost",onClick:s,className:"group dm-card-table-header-row-btn","aria-label":`${u} - ${i()}. Click to sort.`,"aria-sort":c(),children:[t,a.jsxs("span",{className:"flex h-4 w-4 items-center justify-center","aria-hidden":"true",children:[r==="asc"&&a.jsx(Ng,{className:"text-foreground h-4 w-4"}),r==="desc"&&a.jsx(ss,{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(Ng,{className:"text-muted-foreground h-4 w-4"})})]})]})}function qc({table:e,getColumnLabel:t}){return a.jsx("div",{className:"text-right",children:a.jsxs(Or,{children:[a.jsx(Ir,{asChild:!0,children:a.jsx(we,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:a.jsx(Do,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsx(Mr,{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(Ut,{className:"capitalize",children:a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("button",{type:"button",role:"checkbox","aria-checked":n.getIsVisible(),"data-state":n.getIsVisible()?"checked":"unchecked","aria-label":`Toggle column ${r}`,className:"peer border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border bg-white shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-white/8",onClick:()=>{n.toggleVisibility(!n.getIsVisible())},children:n.getIsVisible()&&a.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:a.jsx(Ia,{className:"size-3.5 text-white"})})}),a.jsx("span",{children:r})]})},n.id)})})]})})}const Tre=({onDeleteSuccess:e,connectors:t=[]}={})=>[{id:On.HEALTH_STATUS,size:40,enableResizing:!1,accessorFn:n=>{const r=X1(n.id);return Wee({dataMartStatus:n.status.code,healthStatus:r==null?void 0:r.healthStatus})},sortingFn:"basic",header:({column:n})=>a.jsx(Yn,{column:n,children:ri[On.HEALTH_STATUS]}),cell:({row:n})=>a.jsx(jre,{row:n})},{accessorKey:On.TITLE,size:320,minSize:200,header:({column:n})=>a.jsx(Yn,{column:n,children:ri[On.TITLE]}),cell:({row:n})=>a.jsx("div",{className:"w-full",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}=oN.getInfo(r);return s}},id:On.DEFINITION_TYPE,size:220,header:({column:n})=>a.jsx(Yn,{column:n,children:ri[On.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(Vc,{base64:i.logoBase64,size:18}),(i==null?void 0:i.displayName)??"Unknown"]})}default:{const{displayName:s,icon:i}=oN.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:On.STORAGE_TYPE,size:220,header:({column:n})=>a.jsx(Yn,{column:n,children:ri[On.STORAGE_TYPE]}),cell:({row:n})=>{const r=n.getValue("storageType"),s=n.original.storageTitle,{displayName:i,icon:c}=Nl.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:On.CREATED_AT,size:140,header:({column:n})=>a.jsx(Yn,{column:n,children:ri[On.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:On.CREATED_BY_USER,size:220,accessorFn:n=>{const r=n.createdByUser;return(r==null?void 0:r.fullName)??(r==null?void 0:r.email)},header:({column:n})=>a.jsx(Yn,{column:n,children:ri[On.CREATED_BY_USER]}),cell:({row:n})=>{const r=n.original.createdByUser;return r?a.jsx(UI,{userProjection:r}):a.jsx("div",{className:"text-muted-foreground",children:"—"})}},{accessorKey:On.STATUS,size:120,header:({column:n})=>a.jsx(Yn,{column:n,children:ri[On.STATUS]}),cell:({row:n})=>{const r=n.getValue("status");return a.jsx(Td,{type:kee(r.code),variant:"ghost",showIcon:!1,children:r.displayName})}},{accessorKey:On.TRIGGERS_COUNT,size:100,header:({column:n})=>a.jsx(Yn,{column:n,children:ri[On.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:On.REPORTS_COUNT,size:100,header:({column:n})=>a.jsx(Yn,{column:n,children:ri[On.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:50,enableResizing:!1,header:({table:n})=>a.jsx(qc,{table:n}),cell:({row:n})=>a.jsx(Sre,{row:n,onDeleteSuccess:e})}];var Rr=(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))(Rr||{});const _re={connectors:[],connectorSpecification:null,connectorFields:null,loading:!1,loadingSpecification:!1,loadingFields:!1,error:null};function Nre(e,t){switch(t.type){case Rr.FETCH_CONNECTORS_START:return{...e,loading:!0,error:null};case Rr.FETCH_CONNECTORS_SUCCESS:return{...e,connectors:t.payload,loading:!1,error:null};case Rr.FETCH_CONNECTORS_ERROR:return{...e,loading:!1,error:t.payload};case Rr.FETCH_CONNECTOR_SPECIFICATION_START:return{...e,loadingSpecification:!0,error:null};case Rr.FETCH_CONNECTOR_SPECIFICATION_SUCCESS:return{...e,connectorSpecification:t.payload,loadingSpecification:!1,error:null};case Rr.FETCH_CONNECTOR_SPECIFICATION_ERROR:return{...e,loadingSpecification:!1,error:t.payload};case Rr.FETCH_CONNECTOR_FIELDS_START:return{...e,loadingFields:!0,error:null};case Rr.FETCH_CONNECTOR_FIELDS_SUCCESS:return{...e,connectorFields:t.payload,loadingFields:!1,error:null};case Rr.FETCH_CONNECTOR_FIELDS_ERROR:return{...e,loadingFields:!1,error:t.payload};default:return e}}const FI=h.createContext(void 0);function md({children:e}){const[t,n]=h.useReducer(Nre,_re);return a.jsx(FI.Provider,{value:{state:t,dispatch:n},children:e})}function Are(){const e=h.useContext(FI);if(!e)throw new Error("useConnectorContext must be used within a ConnectorContextProvider");return e}var Fs=(e=>(e.STRING="string",e.NUMBER="number",e.BOOLEAN="boolean",e.OBJECT="object",e.ARRAY="array",e.DATE="date",e))(Fs||{});class Zf extends _l{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 HI(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 Kc(){const{state:e,dispatch:t}=Are(),n=h.useMemo(()=>HI(e.connectors),[e.connectors]),r=h.useCallback(async()=>{t({type:Rr.FETCH_CONNECTORS_START});try{const u=await new Zf().getAvailableConnectors();t({type:Rr.FETCH_CONNECTORS_SUCCESS,payload:u})}catch(c){const u=c instanceof Error?c.message:"Unknown error";t({type:Rr.FETCH_CONNECTORS_ERROR,payload:u}),De({event:"connector_error",category:"Connector",action:"ListError",label:u})}},[t]),s=h.useCallback(async c=>{t({type:Rr.FETCH_CONNECTOR_SPECIFICATION_START});try{const f=await new Zf().getConnectorSpecification(c);t({type:Rr.FETCH_CONNECTOR_SPECIFICATION_SUCCESS,payload:f})}catch(u){const f=u instanceof Error?u.message:"Unknown error";t({type:Rr.FETCH_CONNECTOR_SPECIFICATION_ERROR,payload:f}),De({event:"connector_error",category:"Connector",action:"SpecificationError",label:c})}},[t]),i=h.useCallback(async c=>{t({type:Rr.FETCH_CONNECTOR_FIELDS_START});try{const f=await new Zf().getConnectorFields(c);t({type:Rr.FETCH_CONNECTOR_FIELDS_SUCCESS,payload:f})}catch(u){const f=u instanceof Error?u.message:"Unknown error";t({type:Rr.FETCH_CONNECTOR_FIELDS_ERROR,payload:f}),De({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 Dre=()=>{const{items:e,loadDataMarts:t,deleteDataMart:n,refreshList:r,loading:s}=A5(),{connectors:i,fetchAvailableConnectors:c}=Kc();return h.useEffect(()=>{c()},[c]),h.useEffect(()=>{t()},[t]),a.jsx(gre,{columns:Tre({connectors:i}),data:e,deleteDataMart:n,refetchDataMarts:r,isLoading:s})};function iN(){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(UQ,{children:a.jsx(md,{children:a.jsx(Dre,{})})})})]})}const $I=h.createContext(void 0),mh=20,Df=e=>{const t=$ee(e);return{...e,canPublish:t.length===0,validationErrors:t}};var xa=(e=>(e.CONNECTED="CONNECTED",e.CONNECTED_WITH_DEFINITION_MISMATCH="CONNECTED_WITH_DEFINITION_MISMATCH",e.DISCONNECTED="DISCONNECTED",e))(xa||{}),ph=(e=>(e.NULLABLE="NULLABLE",e.REQUIRED="REQUIRED",e.REPEATED="REPEATED",e))(ph||{}),ur=(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))(ur||{}),rE=(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))(rE||{}),aE=(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))(aE||{}),sE=(e=>(e.SMALLINT="SMALLINT",e.INTEGER="INTEGER",e.BIGINT="BIGINT",e.DECIMAL="DECIMAL",e.NUMERIC="NUMERIC",e.REAL="REAL",e.DOUBLE_PRECISION="DOUBLE PRECISION",e.VARCHAR="VARCHAR",e.CHAR="CHAR",e.TEXT="TEXT",e.BPCHAR="BPCHAR",e.BOOLEAN="BOOLEAN",e.BOOL="BOOL",e.DATE="DATE",e.TIMESTAMP="TIMESTAMP",e.TIMESTAMPTZ="TIMESTAMPTZ",e.TIME="TIME",e.TIMETZ="TIMETZ",e.BYTEA="BYTEA",e.SUPER="SUPER",e.GEOMETRY="GEOMETRY",e.GEOGRAPHY="GEOGRAPHY",e))(sE||{}),oE=(e=>(e.STRING="STRING",e.INT="INT",e.BIGINT="BIGINT",e.SMALLINT="SMALLINT",e.TINYINT="TINYINT",e.DOUBLE="DOUBLE",e.FLOAT="FLOAT",e.DECIMAL="DECIMAL",e.BOOLEAN="BOOLEAN",e.DATE="DATE",e.TIMESTAMP="TIMESTAMP",e.TIMESTAMP_NTZ="TIMESTAMP_NTZ",e.BINARY="BINARY",e.ARRAY="ARRAY",e.STRUCT="STRUCT",e.MAP="MAP",e))(oE||{});const Ore=(e,t)=>!!(e!==$e.CONNECTOR||t!==null&&t.fields.some(r=>r.status===xa.CONNECTED)),VI={dataMart:null,isLoading:!1,isLoadingMoreRuns:!1,error:null,runs:[],isManualRunTriggered:!1,hasMoreRunsToLoad:!0,hasActiveRuns:!1};function Ire(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":{const n=t.type==="RUN_DATA_MART_START";return{...e,isLoading:!0,error:null,isManualRunTriggered:n?!0:e.isManualRunTriggered,hasActiveRuns:n?!0:e.hasActiveRuns}}case"LOAD_MORE_DATA_MART_RUNS_START":return{...e,isLoadingMoreRuns:!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:Df(t.payload)};case"UPDATE_DATA_MART_TITLE_SUCCESS":return e.dataMart?{...e,isLoading:!1,error:null,dataMart:Df({...e.dataMart,title:t.payload,modifiedAt:new Date})}:e;case"UPDATE_DATA_MART_DESCRIPTION_SUCCESS":return e.dataMart?{...e,isLoading:!1,error:null,dataMart:Df({...e.dataMart,description:t.payload,modifiedAt:new Date})}:e;case"UPDATE_DATA_MART_STORAGE":return e.dataMart?{...e,dataMart:Df({...e.dataMart,storage:t.payload,modifiedAt:new Date})}:e;case"UPDATE_DATA_MART_DEFINITION_SUCCESS":return e.dataMart?{...e,isLoading:!1,error:null,dataMart:Df({...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":{const n=new Set(t.payload.map(f=>f.id)),r=e.runs.filter(f=>!n.has(f.id)),s=[...t.payload,...r],c=e.runs.length===0?t.payload.length>=mh:e.hasMoreRunsToLoad,u=Hb(e.isManualRunTriggered,s);return{...e,isLoading:!1,error:null,runs:s,hasMoreRunsToLoad:c,hasActiveRuns:u}}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":return{...e,isLoading:!1,error:t.payload};case"LOAD_MORE_DATA_MART_RUNS_SUCCESS":{const n=new Set(e.runs.map(u=>u.id)),r=t.payload.filter(u=>!n.has(u.id)),s=[...e.runs,...r],i=t.payload.length>=mh,c=Hb(e.isManualRunTriggered,s);return{...e,isLoading:!1,isLoadingMoreRuns:!1,error:null,runs:s,hasMoreRunsToLoad:i,hasActiveRuns:c}}case"LOAD_MORE_DATA_MART_RUNS_ERROR":return{...e,isLoadingMoreRuns:!1,error:t.payload};case"RESET_MANUAL_RUN_TRIGGERED":{const n=Hb(!1,e.runs);return{...e,isManualRunTriggered:!1,hasActiveRuns:n}}case"RESET":return VI;default:return e}}function Hb(e,t){return e||t.some(n=>!_5(n.status))}function to(){const e=h.useContext($I);if(e===void 0)throw new Error("useDataMartContext must be used within a DataMartProvider");return e}class Mre{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:ce.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 kre{mapFromDto(t){const n=t.config,r=t.credentials;return{id:t.id,title:t.title,type:ce.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 Lre{mapFromDto(t){const n=t.config,r=t.credentials,s=r?r.authMethod==="KEY_PAIR"?{authMethod:Bs.KEY_PAIR,username:r.username??"",privateKey:r.privateKey??"",privateKeyPassphrase:r.privateKeyPassphrase}:{authMethod:Bs.PASSWORD,username:r.username??"",password:r.password??""}:void 0;return{id:t.id,title:t.title,type:ce.SNOWFLAKE,createdAt:new Date(t.createdAt),modifiedAt:new Date(t.modifiedAt),credentials:s??{authMethod:Bs.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===Bs.PASSWORD?{password:r.password}:{privateKey:r.privateKey,privateKeyPassphrase:r.privateKeyPassphrase}}}return n}}class Pre{mapFromDto(t){const n=t.config,r=t.credentials;let s=fr.SERVERLESS;n!=null&&n.clusterIdentifier&&(s=fr.PROVISIONED);const i=(n==null?void 0:n.connectionType)??s;return{id:t.id,title:t.title,type:ce.AWS_REDSHIFT,createdAt:new Date(t.createdAt),modifiedAt:new Date(t.modifiedAt),credentials:r?{accessKeyId:r.accessKeyId??"",secretAccessKey:r.secretAccessKey??""}:{accessKeyId:"",secretAccessKey:""},config:n?i===fr.SERVERLESS?{connectionType:fr.SERVERLESS,region:n.region,database:n.database,workgroupName:n.workgroupName??""}:{connectionType:fr.PROVISIONED,region:n.region,database:n.database,clusterIdentifier:n.clusterIdentifier??""}:{connectionType:fr.SERVERLESS,region:"",database:"",workgroupName:""}}}mapToUpdateRequest(t){const n=t.config,r={config:{connectionType:n.connectionType,region:n.region,database:n.database,...n.connectionType===fr.SERVERLESS?{workgroupName:n.workgroupName}:{clusterIdentifier:n.clusterIdentifier}}};return t.credentials&&(r.credentials={accessKeyId:t.credentials.accessKeyId,secretAccessKey:t.credentials.secretAccessKey}),r}}class Ure{mapFromDto(t){const n=t.config,r=t.credentials,s=r?{authMethod:tx.PERSONAL_ACCESS_TOKEN,token:r.token??""}:void 0;return{id:t.id,title:t.title,type:ce.DATABRICKS,createdAt:new Date(t.createdAt),modifiedAt:new Date(t.modifiedAt),credentials:s??{authMethod:tx.PERSONAL_ACCESS_TOKEN,token:""},config:n?{host:n.host,httpPath:n.httpPath}:{host:"",httpPath:""}}}mapToUpdateRequest(t){const n={config:{host:t.config.host,httpPath:t.config.httpPath}};if(t.credentials){const r=t.credentials;n.credentials={authMethod:r.authMethod,token:r.token}}return n}}const GI={getMapper(e){switch(e){case ce.GOOGLE_BIGQUERY:return new Mre;case ce.AWS_ATHENA:return new kre;case ce.SNOWFLAKE:return new Lre;case ce.AWS_REDSHIFT:return new Pre;case ce.DATABRICKS:return new Ure;default:throw new Error(`Unknown storage type: ${e}`)}}};function Sg(e){return GI.getMapper(e.type).mapFromDto(e)}function zre(e){const t=GI.getMapper(e.type);return{title:e.title,...t.mapToUpdateRequest(e)}}function Fre(e){return{id:e.id,type:e.type,title:e.title,createdAt:new Date(e.createdAt),modifiedAt:new Date(e.modifiedAt)}}function Hre(e){return{type:e}}let tg=null;async function $re(){if(tg)return tg;const e=await Vre();return tg=HI(e),tg}async function Vre(){return await new Zf().getAvailableConnectors()}async function Gre(e){const t=await $re();return t.length===0?null:t.find(r=>r.name===e)??null}function Bre(e,t){const n=t.find(r=>r.name===e.source.name);return(n==null?void 0:n.displayName)??e.source.name}function qre(e){return{sqlQuery:e.sqlQuery}}function Kre(e){return{sqlQuery:e.sqlQuery}}function Wre(e){return{fullyQualifiedName:e.fullyQualifiedName}}function Zre(e){return{fullyQualifiedName:e.fullyQualifiedName}}function Yre(e){return{fullyQualifiedName:e.fullyQualifiedName}}function Xre(e){return{fullyQualifiedName:e.fullyQualifiedName}}function Qre(e){return{pattern:e.pattern}}function Jre(e){return{pattern:e.pattern}}function eae(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 tae(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 nae(e,t){if(!e||!t)return null;switch(e){case $e.SQL:return Kre(t);case $e.TABLE:return Zre(t);case $e.VIEW:return Xre(t);case $e.TABLE_PATTERN:return Jre(t);case $e.CONNECTOR:{const n=tae(t);return n.connector.info=await Gre(n.connector.source.name),n}default:return console.warn(`Unknown definition type: ${String(e)}`),null}}async function ku(e){const t={id:e.id,title:e.title,description:e.description,status:KO.getInfo(e.status),storage:Sg(e.storage),definitionType:e.definitionType,definition:await nae(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=Ore(t.definitionType,t.schema),t}function rae(e){return{id:e.id,title:e.title}}function iE({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 BI({children:e}){var _;const[t,n]=h.useReducer(Ire,VI),r=h.useCallback(async M=>{try{n({type:"FETCH_DATA_MART_START"});const G=await Tn.getDataMartById(M),H=await ku(G);n({type:"FETCH_DATA_MART_SUCCESS",payload:H}),OC({context:H.id,value:H.title})}catch(G){n({type:"FETCH_DATA_MART_ERROR",payload:mn(G)})}},[]),s=h.useCallback(async M=>{try{n({type:"CREATE_DATA_MART_START"});const G=await Tn.createDataMart(M),H=rae(G);return n({type:"CREATE_DATA_MART_SUCCESS",payload:H}),De({event:"data_mart_created",category:"DataMart",action:"Create",label:H.id,value:H.title}),Dt.success("Data Mart created"),H}catch(G){const H=mn(G);throw n({type:"CREATE_DATA_MART_ERROR",payload:H}),De({event:"data_mart_error",category:"DataMart",action:"CreateError",value:M.title,error:H.message}),G}},[]),i=h.useCallback(async(M,G)=>{try{n({type:"UPDATE_DATA_MART_START"});const H=await Tn.updateDataMart(M,G),L=await ku(H);n({type:"UPDATE_DATA_MART_SUCCESS",payload:L}),De({event:"data_mart_updated",category:"DataMart",action:"Update",label:L.id,value:L.title})}catch(H){const L=mn(H);n({type:"UPDATE_DATA_MART_ERROR",payload:L}),De({event:"data_mart_error",category:"DataMart",action:"UpdateError",label:M,value:G.title})}},[]),c=h.useCallback(async M=>{try{n({type:"DELETE_DATA_MART_START"}),await Tn.deleteDataMart(M),n({type:"DELETE_DATA_MART_SUCCESS"}),De({event:"data_mart_deleted",category:"DataMart",action:"Delete",label:M}),Dt.success("Data Mart deleted")}catch(G){const H=mn(G);n({type:"DELETE_DATA_MART_ERROR",payload:H}),De({event:"data_mart_error",category:"DataMart",action:"DeleteError",label:M,error:H.message})}},[]),u=h.useCallback(async(M,G)=>{try{n({type:"UPDATE_DATA_MART_TITLE_START"}),await Tn.updateDataMartTitle(M,G),n({type:"UPDATE_DATA_MART_TITLE_SUCCESS",payload:G}),De({event:"data_mart_updated",category:"DataMart",action:"UpdateTitle",label:M,value:G}),Dt.success("Title updated")}catch(H){const L=mn(H);n({type:"UPDATE_DATA_MART_TITLE_ERROR",payload:L}),De({event:"data_mart_error",category:"DataMart",action:"UpdateTitleError",label:M,error:L.message})}},[]),f=h.useCallback(async(M,G)=>{try{n({type:"UPDATE_DATA_MART_DESCRIPTION_START"}),await Tn.updateDataMartDescription(M,G),n({type:"UPDATE_DATA_MART_DESCRIPTION_SUCCESS",payload:G??""}),De({event:"data_mart_updated",category:"DataMart",action:"UpdateDescription",label:M}),Dt.success("Description updated")}catch(H){const L=mn(H);n({type:"UPDATE_DATA_MART_DESCRIPTION_ERROR",payload:L}),De({event:"data_mart_error",category:"DataMart",action:"UpdateDescriptionError",label:M,error:L.message})}},[]),m=h.useCallback(M=>{n({type:"UPDATE_DATA_MART_STORAGE",payload:M})},[]),x=h.useCallback(async(M,G,H)=>{try{n({type:"UPDATE_DATA_MART_DEFINITION_START"});let L;switch(G){case $e.SQL:L={definitionType:G,definition:qre(H)};break;case $e.TABLE:L={definitionType:G,definition:Wre(H)};break;case $e.VIEW:L={definitionType:G,definition:Yre(H)};break;case $e.TABLE_PATTERN:L={definitionType:G,definition:Qre(H)};break;case $e.CONNECTOR:{const B=H;let V;for(const D of B.connector.source.configuration){const F=D;if(F._copiedFrom){V=F._copiedFrom.dataMartId;break}}L={definitionType:$e.CONNECTOR,definition:eae(B),sourceDataMartId:V};break}default:throw new Error(`Unsupported definition type: ${String(G)}`)}const q=await Tn.updateDataMartDefinition(M,L),W=await ku(q);n({type:"UPDATE_DATA_MART_DEFINITION_SUCCESS",payload:{definitionType:G,definition:H}}),n({type:"UPDATE_DATA_MART_SUCCESS",payload:W}),De({event:"data_mart_updated",category:"DataMart",action:"UpdateDefinition",label:G,context:W.id,value:W.title})}catch(L){const q=mn(L);n({type:"UPDATE_DATA_MART_DEFINITION_ERROR",payload:q}),De({event:"data_mart_error",category:"DataMart",action:"UpdateDefinitionError",label:G,context:M,error:q.message})}},[]),g=h.useCallback(async M=>{try{n({type:"PUBLISH_DATA_MART_START"});const G=await Tn.publishDataMart(M),H=await ku(G);n({type:"PUBLISH_DATA_MART_SUCCESS",payload:H}),Dt.success("Data Mart published"),De({event:"data_mart_published",category:"DataMart",action:"Publish",label:H.storage.type,context:H.id,value:H.title,details:H.definitionType??"No definition"})}catch(G){const H=mn(G);throw n({type:"PUBLISH_DATA_MART_ERROR",payload:H}),De({event:"data_mart_error",category:"DataMart",action:"PublishError",label:M,error:H.message}),G}},[]),y=h.useCallback(async(M,G=5,H=0,L)=>{try{L!=null&&L.silent||n({type:"FETCH_DATA_MART_RUNS_START"});const q=await Tn.getDataMartRuns(M,G,H,L!=null&&L.silent?{skipLoadingIndicator:!0}:void 0),W=W1(q);return n({type:"FETCH_DATA_MART_RUNS_SUCCESS",payload:W}),W}catch(q){throw n({type:"FETCH_DATA_MART_RUNS_ERROR",payload:mn(q)}),q}},[]),v=h.useCallback(async(M,G,H=5)=>{try{n({type:"LOAD_MORE_DATA_MART_RUNS_START"});const L=await Tn.getDataMartRuns(M,H,G),q=W1(L);return n({type:"LOAD_MORE_DATA_MART_RUNS_SUCCESS",payload:q}),De({event:"data_mart_runs_loaded",category:"DataMart",action:"LoadMore",context:M}),q}catch(L){throw n({type:"LOAD_MORE_DATA_MART_RUNS_ERROR",payload:mn(L)}),L}},[]),C=h.useCallback(async M=>{const G=Dt.loading("Manual run started");try{n({type:"RUN_DATA_MART_START"}),De({event:"data_mart_run_started",category:"DataMart",action:"Run",label:"Manual",context:M.id}),await Tn.runDataMart(M.id,M.payload),n({type:"RUN_DATA_MART_SUCCESS"})}catch(H){Dt.dismiss(G);const L=mn(H);n({type:"RUN_DATA_MART_ERROR",payload:L}),De({event:"data_mart_error",category:"DataMart",action:"RunError",label:"Manual",context:M.id,error:L.message})}},[]),S=h.useCallback(async(M,G)=>{try{await Tn.cancelDataMartRun(M,G),await y(M),Dt.success("Data Mart run canceled"),De({event:"data_mart_run_canceled",category:"DataMart",action:"CancelRun",label:"Manual"})}catch(H){const L=mn(H);n({type:"RUN_DATA_MART_ERROR",payload:L}),De({event:"data_mart_error",category:"DataMart",action:"CancelRunError",error:L.message})}},[y]),E=h.useCallback(async(M,G)=>{try{return await Tn.getDataMartRunById(M,G)}catch(H){const L=mn(H);throw De({event:"data_mart_error",category:"DataMart",action:"FetchRunDetailsError",error:L.message}),H}},[]),j=h.useCallback(async M=>{try{n({type:"ACTUALIZE_DATA_MART_SCHEMA_START"});const G=await Tn.actualizeDataMartSchema(M),H=await ku(G);n({type:"ACTUALIZE_DATA_MART_SCHEMA_SUCCESS",payload:H}),Dt.success("Output schema actualized"),De({event:"data_mart_schema_actualized",category:"DataMart",action:"ActualizeSchema",label:"Automatic"})}catch(G){const H=mn(G);n({type:"ACTUALIZE_DATA_MART_SCHEMA_ERROR",payload:H}),De({event:"data_mart_error",category:"DataMart",action:"ActualizeSchemaError",error:H.message})}},[]),R=h.useCallback(async(M,G)=>{try{n({type:"UPDATE_DATA_MART_SCHEMA_START"});const H=await Tn.updateDataMartSchema(M,{schema:G}),L=await ku(H);n({type:"UPDATE_DATA_MART_SCHEMA_SUCCESS",payload:L}),Dt.success("Output schema updated"),De({event:"data_mart_schema_updated",category:"DataMart",action:"UpdateSchema",label:"Manual"})}catch(H){const L=mn(H);n({type:"UPDATE_DATA_MART_SCHEMA_ERROR",payload:L}),De({event:"data_mart_error",category:"DataMart",action:"UpdateSchemaError",error:L.message})}},[]),T=h.useCallback(()=>{n({type:"RESET_MANUAL_RUN_TRIGGERED"})},[]),N=h.useCallback(()=>{n({type:"RESET"})},[]);iE({enabled:!!((_=t.dataMart)!=null&&_.id),intervalMs:t.hasActiveRuns?5e3:3e4,onTick:()=>{var M;!((M=t.dataMart)!=null&&M.id)||t.isLoadingMoreRuns||y(t.dataMart.id,mh,0,{silent:!0})}});const A=h.useCallback(()=>t.error?t.error.message??null:null,[t.error]),I={...t,getDataMart:r,createDataMart:s,updateDataMart:i,deleteDataMart:c,updateDataMartTitle:u,updateDataMartDescription:f,updateDataMartStorage:m,updateDataMartDefinition:x,publishDataMart:g,runDataMart:C,cancelDataMartRun:S,actualizeDataMartSchema:j,updateDataMartSchema:R,getDataMartRuns:y,getDataMartRunById:E,loadMoreDataMartRuns:v,getErrorMessage:A,resetManualRunTriggered:T,reset:N};return a.jsx($I.Provider,{value:I,children:e})}var am=e=>e.type==="checkbox",gc=e=>e instanceof Date,Na=e=>e==null;const qI=e=>typeof e=="object";var Cr=e=>!Na(e)&&!Array.isArray(e)&&qI(e)&&!gc(e),KI=e=>Cr(e)&&e.target?am(e.target)?e.target.checked:e.target.value:e,aae=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,WI=(e,t)=>e.has(aae(t)),sae=e=>{const t=e.constructor&&e.constructor.prototype;return Cr(t)&&t.hasOwnProperty("isPrototypeOf")},lE=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function xr(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(lE&&(e instanceof Blob||t))return e;const n=Array.isArray(e);if(!n&&!(Cr(e)&&sae(e)))return e;const r=n?[]:Object.create(Object.getPrototypeOf(e));for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(r[s]=xr(e[s]));return r}var xy=e=>/^\w*$/.test(e),Kn=e=>e===void 0,cE=e=>Array.isArray(e)?e.filter(Boolean):[],uE=e=>cE(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Ue=(e,t,n)=>{if(!t||!Cr(e))return n;const r=(xy(t)?[t]:uE(t)).reduce((s,i)=>Na(s)?s:s[i],e);return Kn(r)||r===e?Kn(e[t])?n:e[t]:r},Za=e=>typeof e=="boolean",ma=e=>typeof e=="function",jn=(e,t,n)=>{let r=-1;const s=xy(t)?[t]:uE(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=Cr(m)||Array.isArray(m)?m:isNaN(+s[r+1])?{}:[]}if(u==="__proto__"||u==="constructor"||u==="prototype")return;e[u]=f,e=e[u]}};const sx={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Hs={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},ai={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},dE=re.createContext(null);dE.displayName="HookFormControlContext";const fE=()=>re.useContext(dE);var ZI=(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]!==Hs.all&&(t._proxyFormState[c]=!r||Hs.all),n&&(n[c]=!0),e[c]}});return s};const hE=typeof window<"u"?re.useLayoutEffect:re.useEffect;function YI(e){const t=fE(),{control:n=t,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 hE(()=>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(()=>ZI(c,n,f.current,!1),[c,n])}var Ja=e=>typeof e=="string",cS=(e,t,n,r,s)=>Ja(e)?(r&&t.watch.add(e),Ue(n,e,s)):Array.isArray(e)?e.map(i=>(r&&t.watch.add(i),Ue(n,i))):(r&&(t.watchAll=!0),n),uS=e=>Na(e)||!qI(e);function $s(e,t,n=new WeakSet){if(uS(e)||uS(t))return Object.is(e,t);if(gc(e)&&gc(t))return Object.is(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(gc(c)&&gc(u)||Cr(c)&&Cr(u)||Array.isArray(c)&&Array.isArray(u)?!$s(c,u,n):!Object.is(c,u))return!1}}return!0}function oae(e){const t=fE(),{control:n=t,name:r,defaultValue:s,disabled:i,exact:c,compute:u}=e||{},f=re.useRef(s),m=re.useRef(u),x=re.useRef(void 0),g=re.useRef(n),y=re.useRef(r);m.current=u;const[v,C]=re.useState(()=>{const N=n._getWatch(r,f.current);return m.current?m.current(N):N}),S=re.useCallback(N=>{const A=cS(r,n._names,N||n._formValues,!1,f.current);return m.current?m.current(A):A},[n._formValues,n._names,r]),E=re.useCallback(N=>{if(!i){const A=cS(r,n._names,N||n._formValues,!1,f.current);if(m.current){const I=m.current(A);$s(I,x.current)||(C(I),x.current=I)}else C(A)}},[n._formValues,n._names,i,r]);hE(()=>((g.current!==n||!$s(y.current,r))&&(g.current=n,y.current=r,E()),n._subscribe({name:r,formState:{values:!0},exact:c,callback:N=>{E(N.values)}})),[n,c,r,E]),re.useEffect(()=>n._removeUnmounted());const j=g.current!==n,R=y.current,T=re.useMemo(()=>{if(i)return null;const N=!j&&!$s(R,r);return j||N?S():null},[i,j,r,R,S]);return T!==null?T:v}function iae(e){const t=fE(),{name:n,disabled:r,control:s=t,shouldUnregister:i,defaultValue:c,exact:u=!0}=e,f=WI(s._names.array,n),m=re.useMemo(()=>Ue(s._formValues,n,Ue(s._defaultValues,n,c)),[s,n,c]),x=oae({control:s,name:n,defaultValue:m,exact:u}),g=YI({control:s,name:n,exact:u}),y=re.useRef(e),v=re.useRef(void 0),C=re.useRef(s.register(n,{...e.rules,value:x,...Za(e.disabled)?{disabled:e.disabled}:{}}));y.current=e;const S=re.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Ue(g.errors,n)},isDirty:{enumerable:!0,get:()=>!!Ue(g.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Ue(g.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Ue(g.validatingFields,n)},error:{enumerable:!0,get:()=>Ue(g.errors,n)}}),[g,n]),E=re.useCallback(N=>C.current.onChange({target:{value:KI(N),name:n},type:sx.CHANGE}),[n]),j=re.useCallback(()=>C.current.onBlur({target:{value:Ue(s._formValues,n),name:n},type:sx.BLUR}),[n,s._formValues]),R=re.useCallback(N=>{const A=Ue(s._fields,n);A&&A._f&&N&&(A._f.ref={focus:()=>ma(N.focus)&&N.focus(),select:()=>ma(N.select)&&N.select(),setCustomValidity:I=>ma(N.setCustomValidity)&&N.setCustomValidity(I),reportValidity:()=>ma(N.reportValidity)&&N.reportValidity()})},[s._fields,n]),T=re.useMemo(()=>({name:n,value:x,...Za(r)||g.disabled?{disabled:g.disabled||r}:{},onChange:E,onBlur:j,ref:R}),[n,r,g.disabled,E,j,R,x]);return re.useEffect(()=>{const N=s._options.shouldUnregister||i,A=v.current;A&&A!==n&&!f&&s.unregister(A),s.register(n,{...y.current.rules,...Za(y.current.disabled)?{disabled:y.current.disabled}:{}});const I=(_,M)=>{const G=Ue(s._fields,_);G&&G._f&&(G._f.mount=M)};if(I(n,!0),N){const _=xr(Ue(s._options.defaultValues,n,y.current.defaultValue));jn(s._defaultValues,n,_),Kn(Ue(s._formValues,n))&&jn(s._formValues,n,_)}return!f&&s.register(n),v.current=n,()=>{(f?N&&!s._state.action:N)?s.unregister(n):I(n,!1)}},[n,s,f,i]),re.useEffect(()=>{s._setDisabledField({disabled:r,name:n})},[r,n,s]),re.useMemo(()=>({field:T,formState:g,fieldState:S}),[T,g,S])}const lae=e=>e.render(iae(e)),mE=re.createContext(null);mE.displayName="HookFormContext";const pE=()=>re.useContext(mE),XI=e=>{const{children:t,watch:n,getValues:r,getFieldState:s,setError:i,clearErrors:c,setValue:u,trigger:f,formState:m,resetField:x,reset:g,handleSubmit:y,unregister:v,control:C,register:S,setFocus:E,subscribe:j}=e;return re.createElement(mE.Provider,{value:re.useMemo(()=>({watch:n,getValues:r,getFieldState:s,setError:i,clearErrors:c,setValue:u,trigger:f,formState:m,resetField:x,reset:g,handleSubmit:y,unregister:v,control:C,register:S,setFocus:E,subscribe:j}),[c,C,m,s,r,y,S,g,x,i,E,u,j,f,v,n])},re.createElement(dE.Provider,{value:C},t))};var gE=(e,t,n,r,s)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:s||!0}}:{},Yf=e=>Array.isArray(e)?e:[e],lN=()=>{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 QI(e,t){const n={};for(const r in e)if(e.hasOwnProperty(r)){const s=e[r],i=t[r];if(s&&Cr(s)&&i){const c=QI(s,i);Cr(c)&&(n[r]=c)}else e[r]&&(n[r]=i)}return n}var fa=e=>Cr(e)&&!Object.keys(e).length,xE=e=>e.type==="file",ox=e=>{if(!lE)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},JI=e=>e.type==="select-multiple",yE=e=>e.type==="radio",cae=e=>yE(e)||am(e),$b=e=>ox(e)&&e.isConnected;function uae(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=Kn(e)?r++:e[t[r++]];return e}function dae(e){for(const t in e)if(e.hasOwnProperty(t)&&!Kn(e[t]))return!1;return!0}function yr(e,t){const n=Array.isArray(t)?t:xy(t)?[t]:uE(t),r=n.length===1?e:uae(e,n),s=n.length-1,i=n[s];return r&&delete r[i],s!==0&&(Cr(r)&&fa(r)||Array.isArray(r)&&dae(r))&&yr(e,n.slice(0,-1)),e}var fae=e=>{for(const t in e)if(ma(e[t]))return!0;return!1};function e6(e){return Array.isArray(e)||Cr(e)&&!fae(e)}function dS(e,t={}){for(const n in e){const r=e[n];e6(r)?(t[n]=Array.isArray(r)?[]:{},dS(r,t[n])):Kn(r)||(t[n]=!0)}return t}function Hu(e,t,n){n||(n=dS(t));for(const r in e){const s=e[r];if(e6(s))Kn(t)||uS(n[r])?n[r]=dS(s,Array.isArray(s)?[]:{}):Hu(s,Na(t)?{}:t[r],n[r]);else{const i=t[r];n[r]=!$s(s,i)}}return n}const cN={value:!1,isValid:!1},uN={value:!0,isValid:!0};var t6=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&&!Kn(e[0].attributes.value)?Kn(e[0].value)||e[0].value===""?uN:{value:e[0].value,isValid:!0}:uN:cN}return cN},n6=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>Kn(e)?e:t?e===""?NaN:e&&+e:n&&Ja(e)?new Date(e):r?r(e):e;const dN={isValid:!1,value:null};var r6=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,dN):dN;function fN(e){const t=e.ref;return xE(t)?t.files:yE(t)?r6(e.refs).value:JI(t)?[...t.selectedOptions].map(({value:n})=>n):am(t)?t6(e.refs).value:n6(Kn(t.value)?e.ref.value:t.value,e)}var hae=(e,t,n,r)=>{const s={};for(const i of e){const c=Ue(t,i);c&&jn(s,i,c._f)}return{criteriaMode:n,names:[...e],fields:s,shouldUseNativeValidation:r}},ix=e=>e instanceof RegExp,Of=e=>Kn(e)?e:ix(e)?e.source:Cr(e)?ix(e.value)?e.value.source:e.value:e,hN=e=>({isOnSubmit:!e||e===Hs.onSubmit,isOnBlur:e===Hs.onBlur,isOnChange:e===Hs.onChange,isOnAll:e===Hs.all,isOnTouch:e===Hs.onTouched});const mN="AsyncFunction";var mae=e=>!!e&&!!e.validate&&!!(ma(e.validate)&&e.validate.constructor.name===mN||Cr(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===mN)),pae=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),pN=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const Xf=(e,t,n,r)=>{for(const s of n||Object.keys(e)){const i=Ue(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(Xf(u,t))break}else if(Cr(u)&&Xf(u,t))break}}};function gN(e,t,n){const r=Ue(e,n);if(r||xy(n))return{error:r,name:n};const s=n.split(".");for(;s.length;){const i=s.join("."),c=Ue(t,i),u=Ue(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 gae=(e,t,n,r)=>{n(e);const{name:s,...i}=e;return fa(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(c=>t[c]===(!r||Hs.all))},xae=(e,t,n)=>!e||!t||e===t||Yf(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r))),yae=(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,vae=(e,t)=>!cE(Ue(e,t)).length&&yr(e,t),bae=(e,t,n)=>{const r=Yf(Ue(e,n));return jn(r,"root",t[n]),jn(e,n,r),e};function xN(e,t,n="validate"){if(Ja(e)||Array.isArray(e)&&e.every(Ja)||Za(e)&&!e)return{type:n,message:Ja(e)?e:"",ref:t}}var Lu=e=>Cr(e)&&!ix(e)?e:{value:e,message:""},yN=async(e,t,n,r,s,i)=>{const{ref:c,refs:u,required:f,maxLength:m,minLength:x,min:g,max:y,pattern:v,validate:C,name:S,valueAsNumber:E,mount:j}=e._f,R=Ue(n,S);if(!j||t.has(S))return{};const T=u?u[0]:c,N=q=>{s&&T.reportValidity&&(T.setCustomValidity(Za(q)?"":q||""),T.reportValidity())},A={},I=yE(c),_=am(c),M=I||_,G=(E||xE(c))&&Kn(c.value)&&Kn(R)||ox(c)&&c.value===""||R===""||Array.isArray(R)&&!R.length,H=gE.bind(null,S,r,A),L=(q,W,B,V=ai.maxLength,D=ai.minLength)=>{const F=q?W:B;A[S]={type:q?V:D,message:F,ref:c,...H(q?V:D,F)}};if(i?!Array.isArray(R)||!R.length:f&&(!M&&(G||Na(R))||Za(R)&&!R||_&&!t6(u).isValid||I&&!r6(u).isValid)){const{value:q,message:W}=Ja(f)?{value:!!f,message:f}:Lu(f);if(q&&(A[S]={type:ai.required,message:W,ref:T,...H(ai.required,W)},!r))return N(W),A}if(!G&&(!Na(g)||!Na(y))){let q,W;const B=Lu(y),V=Lu(g);if(!Na(R)&&!isNaN(R)){const D=c.valueAsNumber||R&&+R;Na(B.value)||(q=D>B.value),Na(V.value)||(W=D<V.value)}else{const D=c.valueAsDate||new Date(R),F=he=>new Date(new Date().toDateString()+" "+he),U=c.type=="time",ee=c.type=="week";Ja(B.value)&&R&&(q=U?F(R)>F(B.value):ee?R>B.value:D>new Date(B.value)),Ja(V.value)&&R&&(W=U?F(R)<F(V.value):ee?R<V.value:D<new Date(V.value))}if((q||W)&&(L(!!q,B.message,V.message,ai.max,ai.min),!r))return N(A[S].message),A}if((m||x)&&!G&&(Ja(R)||i&&Array.isArray(R))){const q=Lu(m),W=Lu(x),B=!Na(q.value)&&R.length>+q.value,V=!Na(W.value)&&R.length<+W.value;if((B||V)&&(L(B,q.message,W.message),!r))return N(A[S].message),A}if(v&&!G&&Ja(R)){const{value:q,message:W}=Lu(v);if(ix(q)&&!R.match(q)&&(A[S]={type:ai.pattern,message:W,ref:c,...H(ai.pattern,W)},!r))return N(W),A}if(C){if(ma(C)){const q=await C(R,n),W=xN(q,T);if(W&&(A[S]={...W,...H(ai.validate,W.message)},!r))return N(W.message),A}else if(Cr(C)){let q={};for(const W in C){if(!fa(q)&&!r)break;const B=xN(await C[W](R,n),T,W);B&&(q={...B,...H(W,B.message)},N(B.message),r&&(A[S]=q))}if(!fa(q)&&(A[S]={ref:T,...q},!r))return A}}return N(!0),A};const Sae={mode:Hs.onSubmit,reValidateMode:Hs.onChange,shouldFocusError:!0};function Cae(e={}){let t={...Sae,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:ma(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},s=Cr(t.defaultValues)||Cr(t.values)?xr(t.defaultValues||t.values)||{}:{},i=t.shouldUnregister?{}:xr(s),c={action:!1,mount:!1,watch:!1,keepIsValid:!1},u={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},f,m=0;const x={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},g={...x};let y={...g};const v={array:lN(),state:lN()},C=t.criteriaMode===Hs.all,S=Z=>ae=>{clearTimeout(m),m=setTimeout(Z,ae)},E=async Z=>{if(!c.keepIsValid&&!t.disabled&&(g.isValid||y.isValid||Z)){let ae;t.resolver?(ae=fa((await M()).errors),j()):ae=await H(r,!0),ae!==n.isValid&&v.state.next({isValid:ae})}},j=(Z,ae)=>{!t.disabled&&(g.isValidating||g.validatingFields||y.isValidating||y.validatingFields)&&((Z||Array.from(u.mount)).forEach(ge=>{ge&&(ae?jn(n.validatingFields,ge,ae):yr(n.validatingFields,ge))}),v.state.next({validatingFields:n.validatingFields,isValidating:!fa(n.validatingFields)}))},R=(Z,ae=[],ge,Te,Oe=!0,je=!0)=>{if(Te&&ge&&!t.disabled){if(c.action=!0,je&&Array.isArray(Ue(r,Z))){const Ve=ge(Ue(r,Z),Te.argA,Te.argB);Oe&&jn(r,Z,Ve)}if(je&&Array.isArray(Ue(n.errors,Z))){const Ve=ge(Ue(n.errors,Z),Te.argA,Te.argB);Oe&&jn(n.errors,Z,Ve),vae(n.errors,Z)}if((g.touchedFields||y.touchedFields)&&je&&Array.isArray(Ue(n.touchedFields,Z))){const Ve=ge(Ue(n.touchedFields,Z),Te.argA,Te.argB);Oe&&jn(n.touchedFields,Z,Ve)}(g.dirtyFields||y.dirtyFields)&&(n.dirtyFields=Hu(s,i)),v.state.next({name:Z,isDirty:q(Z,ae),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else jn(i,Z,ae)},T=(Z,ae)=>{jn(n.errors,Z,ae),v.state.next({errors:n.errors})},N=Z=>{n.errors=Z,v.state.next({errors:n.errors,isValid:!1})},A=(Z,ae,ge,Te)=>{const Oe=Ue(r,Z);if(Oe){const je=Ue(i,Z,Kn(ge)?Ue(s,Z):ge);Kn(je)||Te&&Te.defaultChecked||ae?jn(i,Z,ae?je:fN(Oe._f)):V(Z,je),c.mount&&!c.action&&E()}},I=(Z,ae,ge,Te,Oe)=>{let je=!1,Ve=!1;const lt={name:Z};if(!t.disabled){if(!ge||Te){(g.isDirty||y.isDirty)&&(Ve=n.isDirty,n.isDirty=lt.isDirty=q(),je=Ve!==lt.isDirty);const dt=$s(Ue(s,Z),ae);Ve=!!Ue(n.dirtyFields,Z),dt?yr(n.dirtyFields,Z):jn(n.dirtyFields,Z,!0),lt.dirtyFields=n.dirtyFields,je=je||(g.dirtyFields||y.dirtyFields)&&Ve!==!dt}if(ge){const dt=Ue(n.touchedFields,Z);dt||(jn(n.touchedFields,Z,ge),lt.touchedFields=n.touchedFields,je=je||(g.touchedFields||y.touchedFields)&&dt!==ge)}je&&Oe&&v.state.next(lt)}return je?lt:{}},_=(Z,ae,ge,Te)=>{const Oe=Ue(n.errors,Z),je=(g.isValid||y.isValid)&&Za(ae)&&n.isValid!==ae;if(t.delayError&&ge?(f=S(()=>T(Z,ge)),f(t.delayError)):(clearTimeout(m),f=null,ge?jn(n.errors,Z,ge):yr(n.errors,Z)),(ge?!$s(Oe,ge):Oe)||!fa(Te)||je){const Ve={...Te,...je&&Za(ae)?{isValid:ae}:{},errors:n.errors,name:Z};n={...n,...Ve},v.state.next(Ve)}},M=async Z=>(j(Z,!0),await t.resolver(i,t.context,hae(Z||u.mount,r,t.criteriaMode,t.shouldUseNativeValidation))),G=async Z=>{const{errors:ae}=await M(Z);if(j(Z),Z)for(const ge of Z){const Te=Ue(ae,ge);Te?jn(n.errors,ge,Te):yr(n.errors,ge)}else n.errors=ae;return ae},H=async(Z,ae,ge={valid:!0})=>{for(const Te in Z){const Oe=Z[Te];if(Oe){const{_f:je,...Ve}=Oe;if(je){const lt=u.array.has(je.name),dt=Oe._f&&mae(Oe._f);dt&&g.validatingFields&&j([je.name],!0);const vn=await yN(Oe,u.disabled,i,C,t.shouldUseNativeValidation&&!ae,lt);if(dt&&g.validatingFields&&j([je.name]),vn[je.name]&&(ge.valid=!1,ae||e.shouldUseNativeValidation))break;!ae&&(Ue(vn,je.name)?lt?bae(n.errors,vn,je.name):jn(n.errors,je.name,vn[je.name]):yr(n.errors,je.name))}!fa(Ve)&&await H(Ve,ae,ge)}}return ge.valid},L=()=>{for(const Z of u.unMount){const ae=Ue(r,Z);ae&&(ae._f.refs?ae._f.refs.every(ge=>!$b(ge)):!$b(ae._f.ref))&&le(Z)}u.unMount=new Set},q=(Z,ae)=>!t.disabled&&(Z&&ae&&jn(i,Z,ae),!$s(z(),s)),W=(Z,ae,ge)=>cS(Z,u,{...c.mount?i:Kn(ae)?s:Ja(Z)?{[Z]:ae}:ae},ge,ae),B=Z=>cE(Ue(c.mount?i:s,Z,t.shouldUnregister?Ue(s,Z,[]):[])),V=(Z,ae,ge={})=>{const Te=Ue(r,Z);let Oe=ae;if(Te){const je=Te._f;je&&(!je.disabled&&jn(i,Z,n6(ae,je)),Oe=ox(je.ref)&&Na(ae)?"":ae,JI(je.ref)?[...je.ref.options].forEach(Ve=>Ve.selected=Oe.includes(Ve.value)):je.refs?am(je.ref)?je.refs.forEach(Ve=>{(!Ve.defaultChecked||!Ve.disabled)&&(Array.isArray(Oe)?Ve.checked=!!Oe.find(lt=>lt===Ve.value):Ve.checked=Oe===Ve.value||!!Oe)}):je.refs.forEach(Ve=>Ve.checked=Ve.value===Oe):xE(je.ref)?je.ref.value="":(je.ref.value=Oe,je.ref.type||v.state.next({name:Z,values:xr(i)})))}(ge.shouldDirty||ge.shouldTouch)&&I(Z,Oe,ge.shouldTouch,ge.shouldDirty,!0),ge.shouldValidate&&he(Z)},D=(Z,ae,ge)=>{for(const Te in ae){if(!ae.hasOwnProperty(Te))return;const Oe=ae[Te],je=Z+"."+Te,Ve=Ue(r,je);(u.array.has(Z)||Cr(Oe)||Ve&&!Ve._f)&&!gc(Oe)?D(je,Oe,ge):V(je,Oe,ge)}},F=(Z,ae,ge={})=>{const Te=Ue(r,Z),Oe=u.array.has(Z),je=xr(ae);jn(i,Z,je),Oe?(v.array.next({name:Z,values:xr(i)}),(g.isDirty||g.dirtyFields||y.isDirty||y.dirtyFields)&&ge.shouldDirty&&v.state.next({name:Z,dirtyFields:Hu(s,i),isDirty:q(Z,je)})):Te&&!Te._f&&!Na(je)?D(Z,je,ge):V(Z,je,ge),pN(Z,u)?v.state.next({...n,name:Z,values:xr(i)}):v.state.next({name:c.mount?Z:void 0,values:xr(i)})},U=async Z=>{c.mount=!0;const ae=Z.target;let ge=ae.name,Te=!0;const Oe=Ue(r,ge),je=dt=>{Te=Number.isNaN(dt)||gc(dt)&&isNaN(dt.getTime())||$s(dt,Ue(i,ge,dt))},Ve=hN(t.mode),lt=hN(t.reValidateMode);if(Oe){let dt,vn;const Wn=ae.type?fN(Oe._f):KI(Z),$n=Z.type===sx.BLUR||Z.type===sx.FOCUS_OUT,La=!pae(Oe._f)&&!t.resolver&&!Ue(n.errors,ge)&&!Oe._f.deps||yae($n,Ue(n.touchedFields,ge),n.isSubmitted,lt,Ve),bn=pN(ge,u,$n);jn(i,ge,Wn),$n?(!ae||!ae.readOnly)&&(Oe._f.onBlur&&Oe._f.onBlur(Z),f&&f(0)):Oe._f.onChange&&Oe._f.onChange(Z);const Qn=I(ge,Wn,$n),Vn=!fa(Qn)||bn;if(!$n&&v.state.next({name:ge,type:Z.type,values:xr(i)}),La)return(g.isValid||y.isValid)&&(t.mode==="onBlur"?$n&&E():$n||E()),Vn&&v.state.next({name:ge,...bn?{}:Qn});if(!$n&&bn&&v.state.next({...n}),t.resolver){const{errors:_s}=await M([ge]);if(j([ge]),je(Wn),Te){const ls=gN(n.errors,r,ge),kr=gN(_s,r,ls.name||ge);dt=kr.error,ge=kr.name,vn=fa(_s)}}else j([ge],!0),dt=(await yN(Oe,u.disabled,i,C,t.shouldUseNativeValidation))[ge],j([ge]),je(Wn),Te&&(dt?vn=!1:(g.isValid||y.isValid)&&(vn=await H(r,!0)));Te&&(Oe._f.deps&&(!Array.isArray(Oe._f.deps)||Oe._f.deps.length>0)&&he(Oe._f.deps),_(ge,vn,dt,Qn))}},ee=(Z,ae)=>{if(Ue(n.errors,ae)&&Z.focus)return Z.focus(),1},he=async(Z,ae={})=>{let ge,Te;const Oe=Yf(Z);if(t.resolver){const je=await G(Kn(Z)?Z:Oe);ge=fa(je),Te=Z?!Oe.some(Ve=>Ue(je,Ve)):ge}else Z?(Te=(await Promise.all(Oe.map(async je=>{const Ve=Ue(r,je);return await H(Ve&&Ve._f?{[je]:Ve}:Ve)}))).every(Boolean),!(!Te&&!n.isValid)&&E()):Te=ge=await H(r);return v.state.next({...!Ja(Z)||(g.isValid||y.isValid)&&ge!==n.isValid?{}:{name:Z},...t.resolver||!Z?{isValid:ge}:{},errors:n.errors}),ae.shouldFocus&&!Te&&Xf(r,ee,Z?Oe:u.mount),Te},z=(Z,ae)=>{let ge={...c.mount?i:s};return ae&&(ge=QI(ae.dirtyFields?n.dirtyFields:n.touchedFields,ge)),Kn(Z)?ge:Ja(Z)?Ue(ge,Z):Z.map(Te=>Ue(ge,Te))},$=(Z,ae)=>({invalid:!!Ue((ae||n).errors,Z),isDirty:!!Ue((ae||n).dirtyFields,Z),error:Ue((ae||n).errors,Z),isValidating:!!Ue(n.validatingFields,Z),isTouched:!!Ue((ae||n).touchedFields,Z)}),P=Z=>{Z&&Yf(Z).forEach(ae=>yr(n.errors,ae)),v.state.next({errors:Z?n.errors:{}})},K=(Z,ae,ge)=>{const Te=(Ue(r,Z,{_f:{}})._f||{}).ref,Oe=Ue(n.errors,Z)||{},{ref:je,message:Ve,type:lt,...dt}=Oe;jn(n.errors,Z,{...dt,...ae,ref:Te}),v.state.next({name:Z,errors:n.errors,isValid:!1}),ge&&ge.shouldFocus&&Te&&Te.focus&&Te.focus()},Y=(Z,ae)=>ma(Z)?v.state.subscribe({next:ge=>"values"in ge&&Z(W(void 0,ae),ge)}):W(Z,ae,!0),se=Z=>v.state.subscribe({next:ae=>{xae(Z.name,ae.name,Z.exact)&&gae(ae,Z.formState||g,gn,Z.reRenderRoot)&&Z.callback({values:{...i},...n,...ae,defaultValues:s})}}).unsubscribe,Q=Z=>(c.mount=!0,y={...y,...Z.formState},se({...Z,formState:{...x,...Z.formState}})),le=(Z,ae={})=>{for(const ge of Z?Yf(Z):u.mount)u.mount.delete(ge),u.array.delete(ge),ae.keepValue||(yr(r,ge),yr(i,ge)),!ae.keepError&&yr(n.errors,ge),!ae.keepDirty&&yr(n.dirtyFields,ge),!ae.keepTouched&&yr(n.touchedFields,ge),!ae.keepIsValidating&&yr(n.validatingFields,ge),!t.shouldUnregister&&!ae.keepDefaultValue&&yr(s,ge);v.state.next({values:xr(i)}),v.state.next({...n,...ae.keepDirty?{isDirty:q()}:{}}),!ae.keepIsValid&&E()},pe=({disabled:Z,name:ae})=>{if(Za(Z)&&c.mount||Z||u.disabled.has(ae)){const Oe=u.disabled.has(ae)!==!!Z;Z?u.disabled.add(ae):u.disabled.delete(ae),Oe&&c.mount&&!c.action&&E()}},be=(Z,ae={})=>{let ge=Ue(r,Z);const Te=Za(ae.disabled)||Za(t.disabled);return jn(r,Z,{...ge||{},_f:{...ge&&ge._f?ge._f:{ref:{name:Z}},name:Z,mount:!0,...ae}}),u.mount.add(Z),ge?pe({disabled:Za(ae.disabled)?ae.disabled:t.disabled,name:Z}):A(Z,!0,ae.value),{...Te?{disabled:ae.disabled||t.disabled}:{},...t.progressive?{required:!!ae.required,min:Of(ae.min),max:Of(ae.max),minLength:Of(ae.minLength),maxLength:Of(ae.maxLength),pattern:Of(ae.pattern)}:{},name:Z,onChange:U,onBlur:U,ref:Oe=>{if(Oe){be(Z,ae),ge=Ue(r,Z);const je=Kn(Oe.value)&&Oe.querySelectorAll&&Oe.querySelectorAll("input,select,textarea")[0]||Oe,Ve=cae(je),lt=ge._f.refs||[];if(Ve?lt.find(dt=>dt===je):je===ge._f.ref)return;jn(r,Z,{_f:{...ge._f,...Ve?{refs:[...lt.filter($b),je,...Array.isArray(Ue(s,Z))?[{}]:[]],ref:{type:je.type,name:Z}}:{ref:je}}}),A(Z,!1,void 0,je)}else ge=Ue(r,Z,{}),ge._f&&(ge._f.mount=!1),(t.shouldUnregister||ae.shouldUnregister)&&!(WI(u.array,Z)&&c.action)&&u.unMount.add(Z)}}},ze=()=>t.shouldFocusError&&Xf(r,ee,u.mount),Re=Z=>{Za(Z)&&(v.state.next({disabled:Z}),Xf(r,(ae,ge)=>{const Te=Ue(r,ge);Te&&(ae.disabled=Te._f.disabled||Z,Array.isArray(Te._f.refs)&&Te._f.refs.forEach(Oe=>{Oe.disabled=Te._f.disabled||Z}))},0,!1))},Ge=(Z,ae)=>async ge=>{let Te;ge&&(ge.preventDefault&&ge.preventDefault(),ge.persist&&ge.persist());let Oe=xr(i);if(v.state.next({isSubmitting:!0}),t.resolver){const{errors:je,values:Ve}=await M();j(),n.errors=je,Oe=xr(Ve)}else await H(r);if(u.disabled.size)for(const je of u.disabled)yr(Oe,je);if(yr(n.errors,"root"),fa(n.errors)){v.state.next({errors:{}});try{await Z(Oe,ge)}catch(je){Te=je}}else ae&&await ae({...n.errors},ge),ze(),setTimeout(ze);if(v.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:fa(n.errors)&&!Te,submitCount:n.submitCount+1,errors:n.errors}),Te)throw Te},ot=(Z,ae={})=>{Ue(r,Z)&&(Kn(ae.defaultValue)?F(Z,xr(Ue(s,Z))):(F(Z,ae.defaultValue),jn(s,Z,xr(ae.defaultValue))),ae.keepTouched||yr(n.touchedFields,Z),ae.keepDirty||(yr(n.dirtyFields,Z),n.isDirty=ae.defaultValue?q(Z,xr(Ue(s,Z))):q()),ae.keepError||(yr(n.errors,Z),g.isValid&&E()),v.state.next({...n}))},Vt=(Z,ae={})=>{const ge=Z?xr(Z):s,Te=xr(ge),Oe=fa(Z),je=Oe?s:Te;if(ae.keepDefaultValues||(s=ge),!ae.keepValues){if(ae.keepDirtyValues){const Ve=new Set([...u.mount,...Object.keys(Hu(s,i))]);for(const lt of Array.from(Ve)){const dt=Ue(n.dirtyFields,lt),vn=Ue(i,lt),Wn=Ue(je,lt);dt&&!Kn(vn)?jn(je,lt,vn):!dt&&!Kn(Wn)&&F(lt,Wn)}}else{if(lE&&Kn(Z))for(const Ve of u.mount){const lt=Ue(r,Ve);if(lt&<._f){const dt=Array.isArray(lt._f.refs)?lt._f.refs[0]:lt._f.ref;if(ox(dt)){const vn=dt.closest("form");if(vn){vn.reset();break}}}}if(ae.keepFieldsRef)for(const Ve of u.mount)F(Ve,Ue(je,Ve));else r={}}i=t.shouldUnregister?ae.keepDefaultValues?xr(s):{}:xr(je),v.array.next({values:{...je}}),v.state.next({values:{...je}})}u={mount:ae.keepDirtyValues?u.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},c.mount=!g.isValid||!!ae.keepIsValid||!!ae.keepDirtyValues||!t.shouldUnregister&&!fa(je),c.watch=!!t.shouldUnregister,c.keepIsValid=!!ae.keepIsValid,c.action=!1,ae.keepErrors||(n.errors={}),v.state.next({submitCount:ae.keepSubmitCount?n.submitCount:0,isDirty:Oe?!1:ae.keepDirty?n.isDirty:!!(ae.keepDefaultValues&&!$s(Z,s)),isSubmitted:ae.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:Oe?{}:ae.keepDirtyValues?ae.keepDefaultValues&&i?Hu(s,i):n.dirtyFields:ae.keepDefaultValues&&Z?Hu(s,Z):ae.keepDirty?n.dirtyFields:{},touchedFields:ae.keepTouched?n.touchedFields:{},errors:ae.keepErrors?n.errors:{},isSubmitSuccessful:ae.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:s})},He=(Z,ae)=>Vt(ma(Z)?Z(i):Z,{...t.resetOptions,...ae}),Xt=(Z,ae={})=>{const ge=Ue(r,Z),Te=ge&&ge._f;if(Te){const Oe=Te.refs?Te.refs[0]:Te.ref;Oe.focus&&setTimeout(()=>{Oe.focus(),ae.shouldSelect&&ma(Oe.select)&&Oe.select()})}},gn=Z=>{n={...n,...Z}},It={control:{register:be,unregister:le,getFieldState:$,handleSubmit:Ge,setError:K,_subscribe:se,_runSchema:M,_updateIsValidating:j,_focusError:ze,_getWatch:W,_getDirty:q,_setValid:E,_setFieldArray:R,_setDisabledField:pe,_setErrors:N,_getFieldArray:B,_reset:Vt,_resetDefaultValues:()=>ma(t.defaultValues)&&t.defaultValues().then(Z=>{He(Z,t.resetOptions),v.state.next({isLoading:!1})}),_removeUnmounted:L,_disableForm:Re,_subjects:v,_proxyFormState:g,get _fields(){return r},get _formValues(){return i},get _state(){return c},set _state(Z){c=Z},get _defaultValues(){return s},get _names(){return u},set _names(Z){u=Z},get _formState(){return n},get _options(){return t},set _options(Z){t={...t,...Z}}},subscribe:Q,trigger:he,register:be,handleSubmit:Ge,watch:Y,setValue:F,getValues:z,reset:He,resetField:ot,clearErrors:P,unregister:le,setError:K,setFocus:Xt,getFieldState:$};return{...It,formControl:It}}function Lo(e={}){const t=re.useRef(void 0),n=re.useRef(void 0),[r,s]=re.useState({isDirty:!1,isValidating:!1,isLoading:ma(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:ma(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:r},e.defaultValues&&!ma(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:c,...u}=Cae(e);t.current={...u,formState:r}}const i=t.current.control;return i._options=e,hE(()=>{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&&!$s(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=re.useMemo(()=>ZI(r,i),[i,r]),t.current}var Eae=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],wae=Eae.reduce((e,t)=>{const n=KS(`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}},{}),Rae="Label",a6=h.forwardRef((e,t)=>a.jsx(wae.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())}}));a6.displayName=Rae;var jae=a6;function Ma({className:e,...t}){return a.jsx(jae,{"data-slot":"label",className:oe("flex items-center gap-2 text-sm leading-none font-medium group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}const Ul=XI,s6=h.createContext({}),bt=({...e})=>a.jsx(s6.Provider,{value:{name:e.name},children:a.jsx(lae,{...e})}),sm=()=>{const e=h.useContext(s6),t=h.useContext(o6),{getFieldState:n}=pE(),r=YI({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}},o6=h.createContext({});function mt({className:e="",...t}){const n=h.useId();return a.jsx(o6.Provider,{value:{id:n},children:a.jsx("div",{"data-slot":"form-item",className:oe("group border-border flex flex-col gap-2 rounded-md border-b bg-white px-4 py-3 transition-shadow duration-200 hover:shadow-sm dark:border-transparent dark:bg-white/4",e),...t})})}function ut({className:e="",tooltip:t,tooltipProps:n,children:r,...s}){const{error:i,formItemId:c}=sm();return a.jsxs(Ma,{"data-slot":"form-label","data-error":!!i,className:oe("text-foreground flex items-center justify-between gap-2 text-sm font-medium","data-[error=true]:text-destructive",e),htmlFor:c,...s,children:[a.jsx("span",{children:r}),t&&a.jsxs(rt,{...n,children:[a.jsx(at,{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(_r,{className:"text-muted-foreground/50 hover:text-muted-foreground size-4 shrink-0 transition-colors","aria-hidden":"true"})})}),a.jsx(st,{side:"top",align:"center",role:"tooltip",children:t})]})]})}function xt({...e}){const{error:t,formItemId:n,formDescriptionId:r,formMessageId:s}=sm();return a.jsx(_h,{"data-slot":"form-control",id:n,"aria-describedby":t?`${r} ${s}`:`${r}`,"aria-invalid":!!t,...e})}function qt({className:e,...t}){const{formDescriptionId:n}=sm();return a.jsx("div",{"data-slot":"form-description",id:n,className:oe("text-muted-foreground text-sm",e),...t})}function Ct({className:e,...t}){const{error:n,formMessageId:r}=sm(),s=n?String((n==null?void 0:n.message)??""):t.children;return s?a.jsx("p",{"data-slot":"form-message",id:r,className:oe("text-destructive text-sm",e),...t,children:s}):null}function zl({children:e,className:t="",variant:n="default"}){const r=n==="light"?"flex-1 overflow-y-auto":"bg-muted dark:bg-sidebar flex-1 overflow-y-auto p-4";return a.jsx("div",{className:r,children:a.jsx("div",{className:oe("flex min-h-full flex-col gap-4",t),children:e})})}function Wc({className:e="",children:t,variant:n="default"}){const r=n==="light"?"flex flex-col gap-1.5 pt-4":"flex flex-col gap-1.5 border-t px-4 py-3";return a.jsx("div",{className:oe(r,e),children:t})}function Sr({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 Tae({value:e,label:t,checked:n,onChange:r,disabled:s=!1,orientation:i="vertical",className:c=""}){const{formItemId:u}=sm();return a.jsxs("label",{htmlFor:`${u}-${e}`,className:oe("flex cursor-pointer items-center gap-2 rounded-md py-1 pr-4 pl-2 text-sm",s&&"cursor-not-allowed opacity-50",i==="horizontal"?"flex-row":"flex-col",n?"bg-muted border-input border-b":"hover:bg-muted border-border bg-transparent",c),children:[a.jsx("input",{type:"radio",id:`${u}-${e}`,value:e,checked:n,onChange:r,disabled:s,className:oe("peer border-input ring-offset-background h-4 w-4 rounded-full border","checked:bg-primary checked:border-primary","focus-visible:ring-ring focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50")}),a.jsx("span",{className:oe("peer-disabled:cursor-not-allowed peer-disabled:opacity-50"),children:t})]})}function _ae({options:e,value:t,onChange:n,orientation:r="vertical",className:s=""}){return a.jsx("div",{tabIndex:-1,className:oe(r==="horizontal"?"flex gap-6":"flex flex-col gap-2","border-input rounded-md border bg-transparent px-1 py-1 transition-colors","focus-within:border-ring focus-within:ring-ring/50 focus-within:ring-[3px]","text-foreground selection:bg-primary selection:text-primary-foreground","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40","disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",s),children:e.map(i=>a.jsx(Tae,{value:i.value,label:i.label,checked:t===i.value,onChange:c=>n(c.target.value),disabled:i.disabled,orientation:r},i.value))})}const Ni=h.forwardRef(({children:e,className:t="",...n},r)=>a.jsx("form",{ref:r,className:oe("flex flex-1 flex-col overflow-hidden",t),...n,children:e}));Ni.displayName="AppForm";const Nae=Yt({title:yt().min(1,"Title is required").max(100,"Title must be less than 100 characters"),storageId:yt().min(1,"Storage is required")});function Aae(){const{createDataMart:e,isLoading:t,error:n}=to();return{handleCreate:h.useCallback(async s=>{try{return await e(s)}catch(i){return console.error(i),null}},[e]),isSubmitting:t,serverError:n}}function Dae(e){const{getDataMart:t,deleteDataMart:n,updateDataMartTitle:r,updateDataMartDescription:s,updateDataMartDefinition:i,updateDataMartSchema:c,actualizeDataMartSchema:u,publishDataMart:f,runDataMart:m,cancelDataMartRun:x,getDataMartRuns:g,loadMoreDataMartRuns:y,reset:v,dataMart:C,isLoading:S,isLoadingMoreRuns:E,hasMoreRunsToLoad:j,hasActiveRuns:R,error:T,getErrorMessage:N,runs:A,isManualRunTriggered:I,resetManualRunTriggered:_}=to();return h.useEffect(()=>(e?t(e):v(),()=>{v()}),[e,t,v]),{dataMart:C,isLoading:S,isLoadingMoreRuns:E,hasMoreRunsToLoad:j,hasActiveRuns:R,error:T,getErrorMessage:N,deleteDataMart:n,updateDataMartTitle:r,updateDataMartDescription:s,updateDataMartDefinition:i,updateDataMartSchema:c,actualizeDataMartSchema:u,publishDataMart:f,runDataMart:m,cancelDataMartRun:x,getDataMartRuns:g,loadMoreDataMartRuns:y,runs:A,getDataMart:t,isManualRunTriggered:I,resetManualRunTriggered:_}}const vN=(e,t,n)=>{if(e&&"reportValidity"in e){const r=Ue(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},fS=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?vN(r.ref,n,e):r&&r.refs&&r.refs.forEach(s=>vN(s,n,e))}},bN=(e,t)=>{t.shouldUseNativeValidation&&fS(e,t);const n={};for(const r in e){const s=Ue(t.fields,r),i=Object.assign(e[r]||{},{ref:s&&s.ref});if(Oae(t.names||Object.keys(e),r)){const c=Object.assign({},Ue(n,r));jn(c,"root",i),jn(n,r,c)}else jn(n,r,i)}return n},Oae=(e,t)=>{const n=SN(t);return e.some(r=>SN(r).match(`^${n}\\.\\d+`))};function SN(e){return e.replace(/\]|\[/g,"")}function i6(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 x in c.prototype)x in u||Object.defineProperty(u,x,{value:c.prototype[x].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 x of m._zod.deferred)x();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 Iae extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const Mae={};function l6(e){return Mae}function kae(e,t){return typeof t=="bigint"?t.toString():t}const c6=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function ng(e){return typeof e=="string"?e:e==null?void 0:e.message}function u6(e,t,n){var s,i,c,u,f,m;const r={...e,path:e.path??[]};if(!e.message){const x=ng((c=(i=(s=e.inst)==null?void 0:s._zod.def)==null?void 0:i.error)==null?void 0:c.call(i,e))??ng((u=t==null?void 0:t.error)==null?void 0:u.call(t,e))??ng((f=n.customError)==null?void 0:f.call(n,e))??ng((m=n.localeError)==null?void 0:m.call(n,e))??"Invalid input";r.message=x}return delete r.inst,delete r.continue,t!=null&&t.reportInput||delete r.input,r}const d6=(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,kae,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Lae=i6("$ZodError",d6),f6=i6("$ZodError",d6,{Parent:Error}),Pae=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 Iae;if(c.issues.length){const u=new((s==null?void 0:s.Err)??e)(c.issues.map(f=>u6(f,i,l6())));throw c6(u,s==null?void 0:s.callee),u}return c.value},Uae=Pae(f6),zae=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=>u6(f,i,l6())));throw c6(u,s==null?void 0:s.callee),u}return c.value},Fae=zae(f6);function CN(e,t){try{var n=e()}catch(r){return t(r)}return n&&n.then?n.then(void 0,t):n}function Hae(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(x){return x.errors.forEach(function(g){return e.push(g)})}),t){var f=n[c].types,m=f&&f[r.code];n[c]=gE(c,t,n,s,m?[].concat(m,r.message):r.message)}e.shift()}return n}function $ae(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(x){return x.forEach(function(g){return e.push(g)})}),t){var f=n[c].types,m=f&&f[r.code];n[c]=gE(c,t,n,s,m?[].concat(m,r.message):r.message)}e.shift()}return n}function Ai(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(CN(function(){return Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(c){return i.shouldUseNativeValidation&&fS({},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:bN(Hae(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(CN(function(){return Promise.resolve((n.mode==="sync"?Uae:Fae)(e,r,t)).then(function(c){return i.shouldUseNativeValidation&&fS({},i),{errors:{},values:n.raw?Object.assign({},r):c}})},function(c){if((function(u){return u instanceof Lae})(c))return{values:{},errors:bN($ae(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 h6=h.createContext(void 0);function Vae(){const e=h.useContext(h6);if(e===void 0)throw new Error("useDataStorageContext must be used within a DataStorageProvider");return e}var hn=(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))(hn||{});const Gae={dataStorages:[],currentDataStorage:null,loading:!1,error:null};function Bae(e,t){switch(t.type){case hn.FETCH_STORAGES_START:case hn.FETCH_STORAGE_START:case hn.CREATE_STORAGE_START:case hn.UPDATE_STORAGE_START:return{...e,error:null};case hn.DELETE_STORAGE_START:return{...e,loading:!0,error:null};case hn.FETCH_STORAGES_SUCCESS:return{...e,dataStorages:t.payload,loading:!1,error:null};case hn.FETCH_STORAGE_SUCCESS:return{...e,currentDataStorage:t.payload,loading:!1,error:null};case hn.CREATE_STORAGE_SUCCESS:return{...e,dataStorages:[...e.dataStorages,t.payload],loading:!1,error:null};case hn.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 hn.DELETE_STORAGE_SUCCESS:return{...e,dataStorages:e.dataStorages.filter(n=>n.id!==t.payload),loading:!1,error:null};case hn.FETCH_STORAGES_ERROR:case hn.FETCH_STORAGE_ERROR:case hn.CREATE_STORAGE_ERROR:case hn.UPDATE_STORAGE_ERROR:case hn.DELETE_STORAGE_ERROR:return{...e,loading:!1,error:t.payload};case hn.CLEAR_CURRENT_STORAGE:return{...e,currentDataStorage:null};case hn.CLEAR_ERROR:return{...e,error:null};default:return e}}function vE({children:e}){const[t,n]=h.useReducer(Bae,Gae);return a.jsx(h6.Provider,{value:{state:t,dispatch:n},children:e})}class qae extends _l{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 If=new qae;function yy(){const{state:e,dispatch:t}=Vae(),n=h.useCallback(async()=>{t({type:hn.FETCH_STORAGES_START});try{const f=await If.getDataStorages();t({type:hn.FETCH_STORAGES_SUCCESS,payload:f.map(Fre)})}catch(f){throw t({type:hn.FETCH_STORAGES_ERROR,payload:mn(f)}),f}},[t]),r=h.useCallback(async f=>{try{const m=await If.getDataStorageById(f),x=Sg(m);t({type:hn.FETCH_STORAGE_SUCCESS,payload:x})}catch(m){throw t({type:hn.FETCH_STORAGE_ERROR,payload:mn(m)}),m}},[t]),s=h.useCallback(async f=>{t({type:hn.CREATE_STORAGE_START});try{const m=Hre(f),x=await If.createDataStorage(m),g=Sg(x);return t({type:hn.CREATE_STORAGE_SUCCESS,payload:g}),De({event:"data_storage_created",category:"DataStorage",action:"Create",label:g.type,details:g.title}),Dt.success("Storage created"),g}catch(m){return t({type:hn.CREATE_STORAGE_ERROR,payload:mn(m)}),null}},[t]),i=h.useCallback(async(f,m)=>{t({type:hn.UPDATE_STORAGE_START});try{const x=zre(m),g=await If.updateDataStorage(f,x),y=Sg(g);return t({type:hn.UPDATE_STORAGE_SUCCESS,payload:y}),De({event:"data_storage_updated",category:"DataStorage",action:"Update",label:y.type,context:y.id}),Dt.success("Storage updated"),y}catch(x){return t({type:hn.UPDATE_STORAGE_ERROR,payload:mn(x)}),null}},[t]),c=h.useCallback(async f=>{t({type:hn.DELETE_STORAGE_START});try{await If.deleteDataStorage(f),t({type:hn.DELETE_STORAGE_SUCCESS,payload:f}),De({event:"data_storage_deleted",category:"DataStorage",action:"Delete",label:f}),Dt.success("Storage deleted")}catch(m){throw t({type:hn.DELETE_STORAGE_ERROR,payload:mn(m)}),m}},[t]),u=h.useCallback(()=>{t({type:hn.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 m6=({isOpen:e,onClose:t,onSelect:n,isCreatingDataStorage:r})=>{const{trigger:s,isLocked:i}=IX(n,1e3);return a.jsx(QC,{open:e,onOpenChange:t,children:a.jsxs(JC,{className:"sm:max-w-sm",children:[a.jsxs(eE,{children:[a.jsx(tE,{children:"New Storage"}),a.jsx(nE,{children:"Choose the type of storage you want to create"})]}),a.jsx("div",{className:"flex flex-col gap-4 py-4",children:Nl.getAllTypes().map(c=>{const u=c.icon,f=c.status===ci.ACTIVE;return a.jsxs(we,{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 Kae({initialData:e,onSuccess:t}){const{handleCreate:n,isSubmitting:r,serverError:s}=Aae(),{dataStorages:i,loading:c,fetchDataStorages:u,createDataStorage:f,getDataStorageById:m}=yy(),[x,g]=h.useState(!1),[y,v]=h.useState(!1);h.useEffect(()=>{u()},[u]);const C=Lo({resolver:Ai(Nae),defaultValues:{title:(e==null?void 0:e.title)??"",storageId:""},mode:"onTouched"}),S=async R=>{const T=await n(R);T&&t&&t(T)},E=()=>{g(!0)},j=async R=>{v(!0);try{const T=await f(R);T!=null&&T.id&&(await m(T.id),C.setValue("storageId",T.id))}catch(T){console.error("Failed to create storage:",T)}g(!1),v(!1)};return a.jsxs(a.Fragment,{children:[a.jsx(Ul,{...C,children:a.jsxs(Ni,{onSubmit:R=>{C.handleSubmit(S)(R)},children:[a.jsxs(zl,{variant:"light",children:[s&&a.jsx("div",{className:"rounded bg-red-100 p-3 text-red-700",children:s.message}),a.jsx(bt,{control:C.control,name:"title",render:({field:R})=>a.jsxs(mt,{children:[a.jsx(ut,{children:"Title"}),a.jsx(xt,{children:a.jsx(ct,{id:"title",placeholder:"Enter title",...R,disabled:r})}),a.jsx(Ct,{})]})}),a.jsx(bt,{control:C.control,name:"storageId",render:({field:R})=>a.jsxs(mt,{children:[a.jsx(ut,{children:"Storage"}),a.jsx(xt,{children:a.jsxs(oa,{onValueChange:T=>{T==="create_new"?E():R.onChange(T)},value:R.value,disabled:r||c,children:[a.jsx(la,{className:"w-full",children:a.jsx(ia,{placeholder:"Select a storage"})}),a.jsx(ca,{children:a.jsxs(gy,{children:[c&&a.jsx(Fn,{value:"loading",disabled:!0,children:"Loading..."}),!c&&i.map(T=>{const N=Nl.getInfo(T.type).icon;return a.jsx(Fn,{value:T.id,children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(N,{size:20}),a.jsx("span",{children:T.title})]})},T.id)}),!c&&i.length>0&&a.jsx(PI,{}),a.jsx(Fn,{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(sa,{size:20})}),a.jsx("span",{children:"Create new storage"})]})})]})})]})}),a.jsx(Ct,{})]})})]}),a.jsxs(Wc,{variant:"light",children:[a.jsx(we,{type:"submit",children:"Create Data Mart"}),a.jsx(we,{variant:"outline",type:"button",onClick:()=>{window.history.back()},children:"Go back"})]})]})}),a.jsx(m6,{isOpen:x,onClose:()=>{g(!1)},onSelect:R=>j(R),isCreatingDataStorage:y})]})}function p6({title:e,onUpdate:t,className:n,errorMessage:r="Title cannot be empty",minWidth:s="200px",readOnly:i=!1}){const[c,u]=h.useState(e),[f,m]=h.useState(!1),x=h.useRef(null);h.useEffect(()=>{u(e)},[e]),h.useEffect(()=>{x.current&&(x.current.style.height="auto",x.current.style.height=`${String(x.current.scrollHeight)}px`)},[c]);const g=async()=>{if(i||c.trim()===""){u(e);return}if(c.trim()!==e)try{m(!0),await t(c.trim())}catch(v){u(e),console.error(v)}finally{m(!1)}},y=v=>{if(!i)if(v.key==="Enter"&&!v.shiftKey){if(v.preventDefault(),c.trim()===""){Dt.error(r),u(e);return}g()}else v.key==="Escape"&&u(e)};return a.jsx("h2",{className:oe("m-0 p-0",n,{"cursor-pointer hover:opacity-80":!i}),children:a.jsx(Mo,{ref:x,value:c,readOnly:i,onChange:v=>{if(i)return;u(v.target.value);const C=v.target;C.style.height="auto",C.style.height=`${String(C.scrollHeight)}px`},onBlur:()=>!i&&void g(),onKeyDown:y,className:oe("m-0 w-full border-0 p-0 shadow-none","bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0",{"opacity-50":f,"cursor-default":i}),style:{fontSize:"inherit",fontWeight:"inherit",lineHeight:"inherit",fontFamily:"inherit",color:"inherit",resize:"none",overflow:"hidden",minHeight:"inherit",height:"auto",minWidth:s},disabled:f})})}var dc=(e=>(e.MANUAL_BACKFILL="MANUAL_BACKFILL",e.INCREMENTAL="INCREMENTAL",e))(dc||{}),g6=(e=>(e.MANUAL_BACKFILL="MANUAL_BACKFILL",e.HIDE_IN_CONFIG_FORM="HIDE_IN_CONFIG_FORM",e))(g6||{}),vy="Tabs",[Wae]=Dr(vy,[Fx]),x6=Fx(),[Zae,bE]=Wae(vy),y6=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:i,orientation:c="horizontal",dir:u,activationMode:f="automatic",...m}=e,x=Fh(u),[g,y]=ya({prop:r,onChange:s,defaultProp:i??"",caller:vy});return a.jsx(Zae,{scope:n,baseId:ar(),value:g,onValueChange:y,orientation:c,dir:x,activationMode:f,children:a.jsx(tt.div,{dir:x,"data-orientation":c,...m,ref:t})})});y6.displayName=vy;var v6="TabsList",b6=h.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...s}=e,i=bE(v6,n),c=x6(n);return a.jsx(Q3,{asChild:!0,...c,orientation:i.orientation,dir:i.dir,loop:r,children:a.jsx(tt.div,{role:"tablist","aria-orientation":i.orientation,...s,ref:t})})});b6.displayName=v6;var S6="TabsTrigger",C6=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...i}=e,c=bE(S6,n),u=x6(n),f=R6(c.baseId,r),m=j6(c.baseId,r),x=r===c.value;return a.jsx(J3,{asChild:!0,...u,focusable:!s,active:x,children:a.jsx(tt.button,{type:"button",role:"tab","aria-selected":x,"aria-controls":m,"data-state":x?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:f,...i,ref:t,onMouseDown:Me(e.onMouseDown,g=>{!s&&g.button===0&&g.ctrlKey===!1?c.onValueChange(r):g.preventDefault()}),onKeyDown:Me(e.onKeyDown,g=>{[" ","Enter"].includes(g.key)&&c.onValueChange(r)}),onFocus:Me(e.onFocus,()=>{const g=c.activationMode!=="manual";!x&&!s&&g&&c.onValueChange(r)})})})});C6.displayName=S6;var E6="TabsContent",w6=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:s,children:i,...c}=e,u=bE(E6,n),f=R6(u.baseId,r),m=j6(u.baseId,r),x=r===u.value,g=h.useRef(x);return h.useEffect(()=>{const y=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(y)},[]),a.jsx(Xr,{present:s||x,children:({present:y})=>a.jsx(tt.div,{"data-state":x?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":f,hidden:!y,id:m,tabIndex:0,...c,ref:t,style:{...e.style,animationDuration:g.current?"0s":void 0},children:y&&i})})});w6.displayName=E6;function R6(e,t){return`${e}-trigger-${t}`}function j6(e,t){return`${e}-content-${t}`}var Yae=y6,Xae=b6,Qae=C6,Jae=w6;function by({className:e,...t}){return a.jsx(Yae,{"data-slot":"tabs",className:oe("flex flex-col gap-2",e),...t})}function Sy({className:e,...t}){return a.jsx(Xae,{"data-slot":"tabs-list",className:oe("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function Oc({className:e,...t}){return a.jsx(Qae,{"data-slot":"tabs-trigger",className:oe("data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}function ese({className:e,...t}){return a.jsx(Jae,{"data-slot":"tabs-content",className:oe("flex-1 outline-none",e),...t})}var Cy="Collapsible",[tse,T6]=Dr(Cy),[nse,SE]=tse(Cy),_6=h.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:i,onOpenChange:c,...u}=e,[f,m]=ya({prop:r,defaultProp:s??!1,onChange:c,caller:Cy});return a.jsx(nse,{scope:n,disabled:i,contentId:ar(),open:f,onOpenToggle:h.useCallback(()=>m(x=>!x),[m]),children:a.jsx(tt.div,{"data-state":RE(f),"data-disabled":i?"":void 0,...u,ref:t})})});_6.displayName=Cy;var N6="CollapsibleTrigger",CE=h.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,s=SE(N6,n);return a.jsx(tt.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":RE(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:t,onClick:Me(e.onClick,s.onOpenToggle)})});CE.displayName=N6;var EE="CollapsibleContent",wE=h.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=SE(EE,e.__scopeCollapsible);return a.jsx(Xr,{present:n||s.open,children:({present:i})=>a.jsx(rse,{...r,ref:t,present:i})})});wE.displayName=EE;var rse=h.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:s,...i}=e,c=SE(EE,n),[u,f]=h.useState(r),m=h.useRef(null),x=Rt(t,m),g=h.useRef(0),y=g.current,v=h.useRef(0),C=v.current,S=c.open||u,E=h.useRef(S),j=h.useRef(void 0);return h.useEffect(()=>{const R=requestAnimationFrame(()=>E.current=!1);return()=>cancelAnimationFrame(R)},[]),Zr(()=>{const R=m.current;if(R){j.current=j.current||{transitionDuration:R.style.transitionDuration,animationName:R.style.animationName},R.style.transitionDuration="0s",R.style.animationName="none";const T=R.getBoundingClientRect();g.current=T.height,v.current=T.width,E.current||(R.style.transitionDuration=j.current.transitionDuration,R.style.animationName=j.current.animationName),f(r)}},[c.open,r]),a.jsx(tt.div,{"data-state":RE(c.open),"data-disabled":c.disabled?"":void 0,id:c.contentId,hidden:!S,...i,ref:x,style:{"--radix-collapsible-content-height":y?`${y}px`:void 0,"--radix-collapsible-content-width":C?`${C}px`:void 0,...e.style},children:S&&s})});function RE(e){return e?"open":"closed"}var A6=_6,ase=CE,sse=wE;const ose=A6,ise=CE,lse=wE;function cse({children:e,className:t="",...n}){return a.jsx("div",{className:oe("flex flex-1 flex-col overflow-hidden",t),...n,children:e})}function use({children:e,className:t="",...n}){return a.jsx("div",{className:oe("bg-muted dark:bg-sidebar flex-1 overflow-y-auto p-4",t),...n,children:a.jsx("div",{className:"flex min-h-full flex-col gap-4",children:e})})}function dse({children:e,className:t="",variant:n="horizontal",...r}){const s=n==="vertical"?"flex flex-col gap-1.5 pt-4":"flex items-center justify-between border-t px-4 py-3";return a.jsx("div",{className:oe(s,t),...r,children:e})}function qa({children:e,className:t="",...n}){return a.jsx("div",{"data-slot":"wizard-step-item",className:oe("group border-border flex flex-col gap-2 rounded-md border-b bg-white px-4 py-3 transition-shadow duration-200 hover:shadow-sm dark:border-transparent dark:bg-white/4",t),...n,children:e})}function fse({label:e,children:t,className:n="",options:r,value:s,onValueChange:i,required:c=!1,tooltip:u,...f}){return a.jsx("div",{"data-slot":"wizard-step-item-one-of",className:oe("group border-border flex flex-col gap-2 rounded-md border-b bg-white px-4 py-3 transition-shadow duration-200 hover:shadow-sm dark:border-transparent dark:bg-white/4",n),...f,children:a.jsxs(by,{value:s,onValueChange:i,children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx(zr,{required:c,tooltip:u,className:"w-full",children:e}),r.length>1&&a.jsx(Sy,{children:r.map(m=>a.jsx(Oc,{value:m.value,children:m.label},m.value))})]}),t]})})}function D6({title:e,children:t,defaultOpen:n=!1,className:r=""}){const[s,i]=h.useState(n);return a.jsxs(ose,{open:s,onOpenChange:i,"data-slot":"wizard-collapsible",className:oe("group/collapsible flex flex-col gap-2 py-3",r),children:[a.jsx(ise,{asChild:!0,children:a.jsxs("button",{type:"button",className:oe("flex cursor-pointer items-center gap-1"),children:[a.jsx("span",{className:"text-muted-foreground/75 text-xs font-semibold tracking-wide uppercase",children:e}),a.jsx(ba,{className:oe("text-foreground/75 h-3.5 w-3.5 transition-transform duration-200",s&&"rotate-90")})]})}),a.jsx(lse,{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 zr({children:e,required:t=!1,tooltip:n,tooltipProps:r,className:s="",...i}){return a.jsxs(Ma,{"data-slot":"wizard-step-label",className:oe("text-foreground flex items-center justify-between gap-2 text-sm font-medium",s),...i,children:[t?a.jsxs(rt,{...r,children:[a.jsx(at,{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(st,{side:"top",align:"center",role:"tooltip",children:"Required"})]}):a.jsx("span",{children:e}),n&&a.jsxs(rt,{...r,children:[a.jsx(at,{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(_r,{className:"text-muted-foreground/50 hover:text-muted-foreground size-4 shrink-0 transition-colors","aria-hidden":"true"})})}),a.jsx(st,{side:"top",align:"center",role:"tooltip",children:n})]})]})}function mo({title:e,children:t,className:n="",...r}){return a.jsxs("section",{"data-slot":"wizard-step-section",className:oe("mb-8",n),...r,children:[e&&a.jsx("h3",{className:"text-muted-foreground/75 mb-2 text-xs font-semibold tracking-wide uppercase",children:e}),a.jsx("div",{className:"flex flex-col gap-2",children:t})]})}function Vs({icon:e,title:t,subtitle:n,docUrl:r,variant:s="default",className:i,...c}){return s==="compact"?a.jsxs("div",{"data-slot":"wizard-step-hero",className:oe("border-border mb-6 flex items-center justify-between gap-4 border-b pb-4",i),...c,children:[a.jsxs("div",{className:"flex items-center gap-2",children:[e&&a.jsx("div",{children:e}),a.jsx("h2",{className:"text-md font-medium",children:t})]}),r!=null&&a.jsx(we,{variant:"outline",asChild:!0,children:a.jsxs(Nr,{to:r,target:"_blank",rel:"noopener noreferrer",children:["Documentation",a.jsx(yi,{className:"h-4 w-4"})]})})]}):a.jsxs("div",{"data-slot":"wizard-step-hero",className:oe("mb-6 flex flex-col items-center justify-center text-center",i),...c,children:[e&&a.jsx("div",{className:"mt-6 mb-3",children:e}),a.jsx("h2",{className:"text-xl font-medium",children:t}),n&&a.jsx("p",{className:"text-muted-foreground mt-2 text-sm",children:n}),r!=null&&a.jsx(we,{variant:"outline",className:"mt-3 mb-6",asChild:!0,children:a.jsxs(Nr,{to:r,target:"_blank",rel:"noopener noreferrer",children:["Documentation",a.jsx(yi,{className:"h-4 w-4"})]})})]})}function gi({children:e,className:t="",...n}){return a.jsx("div",{"data-slot":"wizard-step",className:oe("space-y-4",t),...n,children:e})}function hse({children:e,className:t="",...n}){return a.jsx("div",{className:oe("grid grid-cols-1 gap-4 md:grid-cols-2",t),...n,children:e})}function mse({icon:e,title:t,selected:n=!1,disabled:r=!1,onClick:s,onDoubleClick:i,className:c="",...u}){return a.jsxs("div",{className:oe("border-border flex items-center gap-4 rounded-md border-b bg-white px-4 py-3 transition-shadow duration-200 select-none hover:shadow-sm dark:border-transparent dark:bg-white/4",r?"cursor-not-allowed opacity-50 hover:shadow-none":"cursor-pointer hover:shadow-sm dark:hover:bg-white/8",n&&!r?"ring-primary border-transparent ring-2 dark:bg-white/8":"",c),onClick:s,onDoubleClick:i,...u,children:[e&&a.jsx("span",{className:"shrink-0",children:e}),r?a.jsxs(rt,{children:[a.jsx(at,{asChild:!0,children:a.jsx("span",{className:"cursor-not-allowed text-sm font-medium opacity-70",children:t})}),a.jsx(st,{side:"top",align:"center",children:"Coming soon"})]}):a.jsx("span",{className:"text-sm font-medium",children:t})]})}function O6({children:e,className:t="",...n}){return a.jsx("div",{className:oe("flex flex-col gap-0.5 rounded-md border-b bg-white p-2 transition-shadow duration-200 select-none hover:shadow-sm dark:bg-white/4",t),...n,children:e})}function I6({type:e,id:t,name:n,value:r,label:s,checked:i,selected:c=!1,disabled:u=!1,tooltip:f,rightIcon:m,onChange:x,className:g="",...y}){const v=S=>{x&&x(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:oe("group flex items-center gap-2 rounded-sm px-4 py-3 transition-shadow duration-200 select-none",u?"cursor-not-allowed":"hover:bg-accent cursor-pointer dark:hover:bg-white/4",c?"bg-primary/8 hover:bg-primary/8 dark:bg-white/8 dark:hover:bg-white/8":"",g),children:[a.jsx("input",{ref:C,id:t,type:e,name:n,value:r,checked:i,disabled:u,onChange:v,className:oe("text-primary focus:ring-primary border-border cursor-pointer",e==="radio"||e==="checkbox"?"accent-primary dark:accent-primary h-4 w-4":"h-8 w-full rounded-md border px-2"),...y}),s&&a.jsx(zr,{htmlFor:t,className:oe("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(rt,{children:[a.jsx(at,{asChild:!0,children:a.jsx(_r,{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(st,{side:"top",align:"center",children:f})]}),m&&a.jsx("div",{className:"flex items-center",children:m})]})]})}function jE({variant:e="grid",items:t,className:n=""}){const r=t??(e==="grid"?12:6),s=e==="grid"?"grid grid-cols-1 gap-4 md:grid-cols-2":"flex flex-col gap-4";return a.jsx("div",{"data-slot":"wizard-step-loading",className:oe(s,n),children:Array.from({length:r}).map((i,c)=>a.jsx(Kr,{className:"border-border h-12 rounded-md border-b bg-white dark:bg-white/4"},c))})}function EN(e){const t=pse(e),n=h.forwardRef((r,s)=>{const{children:i,...c}=r,u=h.Children.toArray(i),f=u.find(xse);if(f){const m=f.props.children,x=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,x):null})}return a.jsx(t,{...c,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function pse(e){const t=h.forwardRef((n,r)=>{const{children:s,...i}=n;if(h.isValidElement(s)){const c=vse(s),u=yse(i,s.props);return s.type!==h.Fragment&&(u.ref=r?aa(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 gse=Symbol("radix.slottable");function xse(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===gse}function yse(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 vse(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 bse(e){const t=e+"CollectionProvider",[n,r]=Dr(t),[s,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=S=>{const{scope:E,children:j}=S,R=re.useRef(null),T=re.useRef(new Map).current;return a.jsx(s,{scope:E,itemMap:T,collectionRef:R,children:j})};c.displayName=t;const u=e+"CollectionSlot",f=EN(u),m=re.forwardRef((S,E)=>{const{scope:j,children:R}=S,T=i(u,j),N=Rt(E,T.collectionRef);return a.jsx(f,{ref:N,children:R})});m.displayName=u;const x=e+"CollectionItemSlot",g="data-radix-collection-item",y=EN(x),v=re.forwardRef((S,E)=>{const{scope:j,children:R,...T}=S,N=re.useRef(null),A=Rt(E,N),I=i(x,j);return re.useEffect(()=>(I.itemMap.set(N,{ref:N,...T}),()=>void I.itemMap.delete(N))),a.jsx(y,{[g]:"",ref:A,children:R})});v.displayName=x;function C(S){const E=i(e+"CollectionConsumer",S);return re.useCallback(()=>{const R=E.collectionRef.current;if(!R)return[];const T=Array.from(R.querySelectorAll(`[${g}]`));return Array.from(E.itemMap.values()).sort((I,_)=>T.indexOf(I.ref.current)-T.indexOf(_.ref.current))},[E.collectionRef,E.itemMap])}return[{Provider:c,Slot:m,ItemSlot:v},C,r]}var no="Accordion",Sse=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[TE,Cse,Ese]=bse(no),[Ey]=Dr(no,[Ese,T6]),_E=T6(),M6=re.forwardRef((e,t)=>{const{type:n,...r}=e,s=r,i=r;return a.jsx(TE.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?a.jsx(Tse,{...i,ref:t}):a.jsx(jse,{...s,ref:t})})});M6.displayName=no;var[k6,wse]=Ey(no),[L6,Rse]=Ey(no,{collapsible:!1}),jse=re.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},collapsible:i=!1,...c}=e,[u,f]=ya({prop:n,defaultProp:r??"",onChange:s,caller:no});return a.jsx(k6,{scope:e.__scopeAccordion,value:re.useMemo(()=>u?[u]:[],[u]),onItemOpen:f,onItemClose:re.useCallback(()=>i&&f(""),[i,f]),children:a.jsx(L6,{scope:e.__scopeAccordion,collapsible:i,children:a.jsx(P6,{...c,ref:t})})})}),Tse=re.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},...i}=e,[c,u]=ya({prop:n,defaultProp:r??[],onChange:s,caller:no}),f=re.useCallback(x=>u((g=[])=>[...g,x]),[u]),m=re.useCallback(x=>u((g=[])=>g.filter(y=>y!==x)),[u]);return a.jsx(k6,{scope:e.__scopeAccordion,value:c,onItemOpen:f,onItemClose:m,children:a.jsx(L6,{scope:e.__scopeAccordion,collapsible:!0,children:a.jsx(P6,{...i,ref:t})})})}),[_se,wy]=Ey(no),P6=re.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:s,orientation:i="vertical",...c}=e,u=re.useRef(null),f=Rt(u,t),m=Cse(n),g=Fh(s)==="ltr",y=Me(e.onKeyDown,v=>{var M;if(!Sse.includes(v.key))return;const C=v.target,S=m().filter(G=>{var H;return!((H=G.ref.current)!=null&&H.disabled)}),E=S.findIndex(G=>G.ref.current===C),j=S.length;if(E===-1)return;v.preventDefault();let R=E;const T=0,N=j-1,A=()=>{R=E+1,R>N&&(R=T)},I=()=>{R=E-1,R<T&&(R=N)};switch(v.key){case"Home":R=T;break;case"End":R=N;break;case"ArrowRight":i==="horizontal"&&(g?A():I());break;case"ArrowDown":i==="vertical"&&A();break;case"ArrowLeft":i==="horizontal"&&(g?I():A());break;case"ArrowUp":i==="vertical"&&I();break}const _=R%j;(M=S[_].ref.current)==null||M.focus()});return a.jsx(_se,{scope:n,disabled:r,direction:s,orientation:i,children:a.jsx(TE.Slot,{scope:n,children:a.jsx(tt.div,{...c,"data-orientation":i,ref:f,onKeyDown:r?void 0:y})})})}),lx="AccordionItem",[Nse,NE]=Ey(lx),U6=re.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...s}=e,i=wy(lx,n),c=wse(lx,n),u=_E(n),f=ar(),m=r&&c.value.includes(r)||!1,x=i.disabled||e.disabled;return a.jsx(Nse,{scope:n,open:m,disabled:x,triggerId:f,children:a.jsx(A6,{"data-orientation":i.orientation,"data-state":G6(m),...u,...s,ref:t,disabled:x,open:m,onOpenChange:g=>{g?c.onItemOpen(r):c.onItemClose(r)}})})});U6.displayName=lx;var z6="AccordionHeader",F6=re.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=wy(no,n),i=NE(z6,n);return a.jsx(tt.h3,{"data-orientation":s.orientation,"data-state":G6(i.open),"data-disabled":i.disabled?"":void 0,...r,ref:t})});F6.displayName=z6;var hS="AccordionTrigger",H6=re.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=wy(no,n),i=NE(hS,n),c=Rse(hS,n),u=_E(n);return a.jsx(TE.ItemSlot,{scope:n,children:a.jsx(ase,{"aria-disabled":i.open&&!c.collapsible||void 0,"data-orientation":s.orientation,id:i.triggerId,...u,...r,ref:t})})});H6.displayName=hS;var $6="AccordionContent",V6=re.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=wy(no,n),i=NE($6,n),c=_E(n);return a.jsx(sse,{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}})});V6.displayName=$6;function G6(e){return e?"open":"closed"}var Ase=M6,Dse=U6,Ose=F6,Ise=H6,Mse=V6;const AE={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(y4,{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}},B6=h.createContext("default");function $t({variant:e="default",...t}){return a.jsx(B6.Provider,{value:e,children:a.jsx(Ase,{"data-slot":"accordion",...t})})}function DE(e){const t=h.useContext(B6);return e??t??"default"}function jt({className:e,variant:t,...n}){const r=DE(t),{itemClass:s}=AE[r];return a.jsx(Dse,{"data-slot":"accordion-item",className:oe(s,e),...n})}function Tt({className:e,children:t,variant:n,...r}){const s=DE(n),{triggerClass:i,icon:c,chevronClass:u,headerClass:f}=AE[s];return a.jsx(Ose,{className:f,children:a.jsxs(Ise,{"data-slot":"accordion-trigger",className:oe(i,e),...r,children:[c,t,a.jsx(ss,{className:u,"aria-hidden":"true"})]})})}function _t({className:e,children:t,variant:n,...r}){const s=DE(n),{contentClass:i,contentInnerClass:c}=AE[s];return a.jsx(Mse,{"data-slot":"accordion-content",className:oe(i,e),...r,children:a.jsx("div",{className:c,children:t})})}function Ft({href:e,children:t,className:n,...r}){return a.jsxs("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:oe("text-muted-foreground hover:bg-muted inline-flex items-center px-1 font-medium hover:rounded-md",n),...r,children:[t,a.jsx(yi,{className:"ml-1 inline h-3 w-3","aria-hidden":"true"})]})}function wN(){return a.jsx($t,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(jt,{value:"connector-state-details",children:[a.jsx(Tt,{children:"What’s connector state?"}),a.jsxs(_t,{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(Ft,{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 kse({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(D6,{title:"State Info",children:c.length===0?a.jsxs(mt,{children:[a.jsx(ut,{children:"Connector state"}),a.jsx(xt,{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(qt,{children:a.jsx(wN,{})})]}):a.jsx(a.Fragment,{children:c.map(({state:u,index:f})=>{const m=u.at||"",x=m?ny(y5(m).toISOString()):"—",g=u.state,y=(()=>{try{return JSON.stringify(g,null,2)}catch{return typeof g=="string"?g:'"—"'}})();return a.jsxs(mt,{children:[a.jsx(ut,{tooltip:`Created at ${x}`,children:`Connector state of configuration #${String(f+1)}`}),a.jsx(xt,{children:a.jsx(SO,{value:y,displayOnly:!0,className:"bg-muted overflow-auto rounded-md text-sm",minHeightClass:"min-h-0",showCopyButton:!0})}),a.jsx(qt,{children:a.jsx(wN,{})})]},u._id)})})})}function Lse({configuration:e,onClose:t,onSubmit:n}){const[r,s]=h.useState(new Set),i=h.useId(),c=Lo({defaultValues:{runType:dc.INCREMENTAL}}),{loading:u,loadingSpecification:f,connectorSpecification:m,fetchConnectorSpecification:x}=Kc(),{dataMart:g}=to(),y=h.useCallback(async E=>{!r.has(E)&&!f&&(s(j=>new Set(j).add(E)),await x(E))},[r,f,x]);h.useEffect(()=>{e!=null&&e.connector.source.name&&y(e.connector.source.name)},[e,u,y]);const v=E=>{n&&n(E)},C=()=>{t&&t()},S=E=>{if(!E)return"text";switch(E){case Fs.DATE:return"date";case Fs.NUMBER:return"number";default:return"text"}};return f?a.jsx("div",{children:"Loading..."}):m?a.jsx(Ul,{...c,children:a.jsxs(Ni,{id:i,noValidate:!0,onSubmit:E=>void c.handleSubmit(v)(E),children:[a.jsxs(zl,{children:[a.jsxs(Sr,{title:"General",children:[a.jsx(bt,{control:c.control,name:"runType",render:({field:E})=>a.jsxs(mt,{children:[a.jsx(ut,{tooltip:"Select how you want to load data: incremental updates or full backfill for a period",children:"Run type"}),a.jsx(xt,{children:a.jsxs(a.Fragment,{children:[a.jsx(_ae,{options:[{value:dc.INCREMENTAL,label:"Incremental load"},{value:dc.MANUAL_BACKFILL,label:"Backfill (custom period)"}],value:E.value,onChange:E.onChange,orientation:"horizontal"}),a.jsx(qt,{children:c.watch("runType")===dc.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")===dc.INCREMENTAL&&a.jsx(kse,{configuration:e,connectorState:(g==null?void 0:g.connectorState)??null})]}),c.watch("runType")===dc.MANUAL_BACKFILL&&a.jsx(Sr,{title:"Run configuration",children:m.filter(E=>{var j;return(j=E.attributes)==null?void 0:j.includes(g6.MANUAL_BACKFILL)}).map(E=>a.jsx(bt,{control:c.control,name:`data.${E.name}`,render:()=>a.jsxs(mt,{children:[a.jsx(ut,{tooltip:E.description,children:E.title??E.name}),a.jsx(xt,{children:a.jsx(ct,{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(Ct,{})]})},E.name))})]}),a.jsxs(Wc,{children:[a.jsx(we,{type:"submit",disabled:!c.formState.isValid||f,children:"Run"}),a.jsx(we,{type:"button",variant:"outline",onClick:C,children:"Cancel"})]})]})}):a.jsx("div",{children:"No connector specification found"})}function Fl(e,t){h.useEffect(()=>(e?UX(0,600):B1(),()=>{B1()}),[e,0,600])}function Pse({isOpen:e,onClose:t,configuration:n,onSubmit:r}){return Fl(e),a.jsx(Ei,{open:e,onOpenChange:t,children:a.jsxs(wi,{children:[a.jsx(Ri,{children:a.jsx(ji,{children:"Manual Run"})}),a.jsx(Lse,{configuration:n,onClose:t,onSubmit:r})]})})}function mS({children:e,configuration:t,onManualRun:n,open:r,onOpenChange:s}){const[i,c]=h.useState(r??!1);h.useEffect(()=>{r!==void 0&&c(r)},[r]);const u=g=>{c(g),s==null||s(g)},f=()=>{u(!0)},m=g=>{n(g),u(!1)},x=()=>e?a.jsx("div",{onClick:f,style:{cursor:"pointer"},children:e}):null;return a.jsxs(a.Fragment,{children:[x(),i&&a.jsx(md,{children:a.jsx(Pse,{isOpen:i,onClose:()=>{u(!1)},configuration:t,onSubmit:m})})]})}const Use=1e3;function zse(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 x=h.useCallback(E=>{f.current&&r(E)},[]),g=h.useCallback(E=>{f.current&&i(E)},[]),y=h.useCallback((E,j)=>{const R=E instanceof Error?E.message:"Schema actualization failed";Dt.dismiss(j),g(R),x(!1),c.current=null,u.current=null,Dt.error(R,{duration:void 0,id:j})},[g,x]),v=h.useCallback(async()=>{var j;const E=c.current;if((j=u.current)==null||j.abort(),E){Dt.dismiss(E);try{await Tn.abortSchemaActualizeTrigger(e,E)}catch{}}c.current=null,u.current=null,x(!1)},[e,x]),C=h.useCallback(async(E,j)=>{var T;const R=N=>N===ts.SUCCESS||N===ts.ERROR||N===ts.CANCELLED;for(;!j.aborted&&c.current===E;)try{const N=await Tn.getSchemaActualizeTriggerStatus(e,E);if(R(N)){try{const A=await Tn.getSchemaActualizeTriggerResponse(e,E);if(Dt.dismiss(E),A.success)(T=m.current)==null||T.call(m),Dt.success("Output schema actualized",{duration:void 0,id:E});else{const I=A.error??"Schema actualization failed";g(I),Dt.error(I,{duration:void 0,id:E})}}catch(A){const I=A instanceof Error?A.message:"Schema actualization failed";Dt.dismiss(E),g(I),Dt.error(I,{duration:void 0,id:E})}x(!1),c.current=null,u.current=null;return}await new Promise(A=>setTimeout(A,Use))}catch(N){y(N,E)}},[e,g,x,y]),S=h.useCallback(async()=>{c.current&&await v(),g(null),x(!0);try{const{triggerId:E}=await Tn.createSchemaActualizeTrigger(e);Dt.loading("Synchronizing schema with the data storage state. This may take a while.",{duration:1/0,id:E}),c.current=E;const j=new AbortController;u.current=j;try{await C(E,j.signal)}catch(R){y(R,E)}}catch(E){x(!1),g(E instanceof Error?E.message:"Failed to start schema actualization")}},[e,v,C,g,x,y]);return h.useEffect(()=>(f.current=!0,()=>{var j;f.current=!1;const E=c.current;(j=u.current)==null||j.abort(),E&&(Dt.dismiss(E),Tn.abortSchemaActualizeTrigger(e,E).catch(()=>{})),c.current=null,u.current=null}),[e]),{run:S,isLoading:n,cancel:v,error:s}}var Cg=(e=>(e.LOAD_DATA="load_data",e.USE_DATA="use_data",e))(Cg||{});function Fse(){return{showPromo:h.useCallback(({step:t,projectId:n,dataMartId:r,isInsightsEnabled:s,onManualRunClick:i})=>{switch(t){case"load_data":al(a.jsx("div",{className:"text-foreground text-sm",children:"Data Mart is ready to load your data"}),{closeButton:!0,description:a.jsxs("div",{className:"mt-2 flex gap-2",children:[a.jsxs(we,{size:"sm",variant:"outline",onClick:()=>{al.dismiss(),i==null||i()},children:[a.jsx(Dh,{className:"h-4 w-4"}),"Manual Run…"]}),a.jsx(we,{size:"sm",variant:"ghost",asChild:!0,onClick:()=>al.dismiss(),children:a.jsxs(Nr,{to:`/ui/${n}/data-marts/${r}/triggers`,children:[a.jsx(wx,{className:"h-4 w-4"}),"Schedule Trigger…"]})})]}),duration:1/0});break;case"use_data":al(a.jsx("div",{className:"text-foreground text-sm",children:"Enable your data"}),{closeButton:!0,description:a.jsxs("div",{className:"mt-2 flex gap-2",children:[s&&a.jsx(we,{size:"sm",variant:"outline",asChild:!0,onClick:()=>al.dismiss(),children:a.jsxs(Nr,{to:`/ui/${n}/data-marts/${r}/insights`,children:[a.jsx(Xa,{className:"h-4 w-4"}),"Generate Insights…"]})}),a.jsx(we,{size:"sm",variant:s?"ghost":"outline",asChild:!0,onClick:()=>al.dismiss(),children:a.jsxs(Nr,{to:`/ui/${n}/data-marts/${r}/reports`,children:[a.jsx(g4,{className:"h-4 w-4"}),"Create Report…"]})})]}),duration:1/0});break}},[])}}function Hse({id:e}){const{navigate:t}=ko(),{user:n}=Ti(),{flags:r}=wd(),s=(n==null?void 0:n.projectId)??"",{dataMart:i,deleteDataMart:c,updateDataMartTitle:u,updateDataMartDescription:f,updateDataMartDefinition:m,actualizeDataMartSchema:x,updateDataMartSchema:g,publishDataMart:y,runDataMart:v,cancelDataMartRun:C,getDataMartRuns:S,loadMoreDataMartRuns:E,isLoading:j,isLoadingMoreRuns:R,hasMoreRunsToLoad:T,hasActiveRuns:N,error:A,getErrorMessage:I,runs:_,getDataMart:M,isManualRunTriggered:G,resetManualRunTriggered:H}=Dae(e),[L,q]=h.useState(!1),[W,B]=h.useState(!1),[V,D]=h.useState(!1),F=h.useRef(null),{id:U="",canPublish:ee=!1,canActualizeSchema:he=!1,status:z={code:null,displayName:"",description:""},title:$="",definition:P=null,definitionType:K=null,validationErrors:Y=[]}=i??{},se=h.useCallback(()=>{U&&M(U)},[U,M]),{run:Q,isLoading:le}=zse(U,se),pe=h.useCallback(async()=>{he&&await Q()},[he,Q]),be=Qg("INSIGHTS_ENABLED","true",r),{showPromo:ze}=Fse(),Re=[{name:"Overview",path:"overview"},{name:"Data Setup",path:"data-setup"},...be?[{name:"Insights",path:"insights"}]:[],{name:"Destinations",path:"reports"},{name:"Triggers",path:"triggers"},{name:"Run History",path:"run-history"}],Ge=h.useCallback(async He=>{U&&await u(U,He)},[U,u]),ot=h.useCallback(async()=>{if(U){B(!0);try{await y(U),pe();const He=K===$e.CONNECTOR;ze({step:He?Cg.LOAD_DATA:Cg.USE_DATA,projectId:s,dataMartId:U,isInsightsEnabled:be,onManualRunClick:()=>{D(!0)}})}catch(He){console.log(He instanceof Error?He.message:"Failed to publish Data Mart")}finally{B(!1)}}},[U,K,y,pe,ze,s,be]),Vt=h.useCallback(async He=>{var Xt;if(U){if(z.code!==br.PUBLISHED){In.error("Manual run is only available for published Data Marts");return}F.current=((Xt=_[0])==null?void 0:Xt.id)||null,await v({id:U,payload:He})}},[U,z,v,_]);return h.useEffect(()=>{if(!G||!_.length||K!==$e.CONNECTOR)return;const He=_[0];if(He.id===F.current)return;[Nt.SUCCESS,Nt.FAILED,Nt.CANCELLED,Nt.INTERRUPTED,Nt.RESTRICTED].includes(He.status)&&(F.current=He.id,H(),He.status===Nt.SUCCESS&&He.triggerType===ex.MANUAL&&He.type===dr.CONNECTOR&&_.filter(ke=>ke.status===Nt.SUCCESS&&ke.triggerType===ex.MANUAL&&ke.type===dr.CONNECTOR).length===1&&ze({step:Cg.USE_DATA,projectId:s,dataMartId:U,isInsightsEnabled:be}))},[_,G,K,H,ze,s,U,be]),(A==null?void 0:A.statusCode)===404?a.jsx(K1,{}):i?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(td,{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(bU,{className:"h-5 w-5"})}),a.jsx(p6,{title:$,onUpdate:Ge,className:"text-2xl font-medium"})]}),a.jsxs("div",{className:"flex items-center gap-2"+(W?" opacity-50":""),style:{minWidth:"120px"},children:[a.jsxs("div",{className:"ml-4 flex items-center gap-2",children:[a.jsxs(rt,{children:[a.jsx(at,{asChild:!0,children:a.jsx("div",{children:a.jsx(Td,{type:z.code===br.PUBLISHED?En.SUCCESS:En.NEUTRAL,variant:"subtle",children:z.displayName})})}),a.jsx(st,{children:z.code===br.PUBLISHED?"Your published Data Mart is ready for scheduled runs":"Draft Data Mart is not available for scheduled runs. Publish it to activate scheduling."})]}),z.code===br.DRAFT&&a.jsxs(rt,{children:[a.jsx(at,{asChild:!0,children:a.jsx("div",{children:a.jsxs(td,{variant:"default",onClick:()=>{ot()},disabled:W||!ee,className:"ml-2 flex items-center gap-1",children:[a.jsx(Ah,{className:"h-4 w-4"}),"Publish Data Mart"]})})}),!ee&&a.jsxs(st,{children:[a.jsx("div",{children:"Cannot publish Data Mart. Fix the issues below."}),Y.length>0&&a.jsx("ul",{className:"mt-1 list-disc space-y-1 pl-4",children:Vee(Y).map((He,Xt)=>a.jsx("li",{children:He},Xt))})]})]})]}),a.jsxs(Or,{children:[a.jsx(Ir,{asChild:!0,children:a.jsx(td,{variant:"ghost",children:a.jsx(m4,{className:"h-5 w-5"})})}),a.jsxs(Mr,{align:"end",children:[K===$e.CONNECTOR&&a.jsxs(a.Fragment,{children:[a.jsx(mS,{configuration:P??null,onManualRun:He=>{Vt({runType:He.runType,data:He.data})},children:a.jsxs(Ut,{onClick:He=>{He.preventDefault()},children:[a.jsx(Dh,{className:"text-foreground h-4 w-4"}),a.jsx("span",{children:"Manual Run..."})]})}),a.jsx(ns,{})]}),a.jsxs(Ut,{onClick:()=>{q(!0)},children:[a.jsx(os,{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:"no-scrollbar -mb-px flex gap-2 overflow-x-auto border-b whitespace-nowrap","aria-label":"Tabs",role:"tablist",children:Re.map(He=>a.jsx(Th,{to:He.path,className:({isActive:Xt})=>oe("border-b-2 px-4 py-3 text-sm font-medium whitespace-nowrap sm:py-2",Xt?"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:He.name},He.name))})}),a.jsx("div",{className:"pt-4",children:a.jsx(GS,{context:{dataMart:i,isLoading:j,isLoadingMoreRuns:R,hasMoreRunsToLoad:T,hasActiveRuns:N,error:A,getErrorMessage:I,updateDataMartDescription:f,updateDataMartDefinition:m,actualizeDataMartSchema:x,updateDataMartSchema:g,runDataMart:v,cancelDataMartRun:C,getDataMartRuns:S,loadMoreDataMartRuns:E,runs:_,getDataMart:M,runSchemaActualization:pe,isSchemaActualizationLoading:le}})}),a.jsx(Ar,{open:L,onOpenChange:q,title:"Delete Data Mart",description:a.jsxs(a.Fragment,{children:["Are you sure you want to delete ",a.jsxs("strong",{children:['"',$,'"']}),"? This action cannot be undone."]}),confirmLabel:"Delete",cancelLabel:"Cancel",variant:"destructive",onConfirm:()=>{(async()=>{try{await c(U),q(!1),t("/data-marts")}catch(He){console.error("Failed to delete Data Mart:",He)}})()}}),K===$e.CONNECTOR&&a.jsx(mS,{configuration:P??null,onManualRun:He=>{Vt({runType:He.runType,data:He.data})},open:V,onOpenChange:D})]}):a.jsxs("div",{className:"dm-page-content flex flex-col gap-4 py-4 md:py-8",children:[a.jsx(Kr,{className:"h-16 w-full"},0),Array.from({length:3}).map((He,Xt)=>a.jsx(Kr,{className:"h-48 w-full"},Xt+1))]})}function $se({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),[x,g]=h.useState(!1),y=h.useRef(null);h.useEffect(()=>{u(e??"")},[e]),h.useEffect(()=>{if(y.current&&f){y.current.focus();const j=y.current.value.length;y.current.setSelectionRange(j,j),v(y.current)}},[f]);const v=j=>{j.style.height="auto",j.style.height=`${String(j.scrollHeight)}px`},C=j=>{u(j.target.value),v(j.target)},S=async()=>{const j=c.trim();if(j===(e??"")){m(!1);return}try{g(!0),await t(j===""?null:j),m(!1)}catch(T){console.error("Failed to update description:",T),u(e??"")}finally{g(!1)}},E=j=>{j.key==="Enter"&&j.ctrlKey?(j.preventDefault(),S()):j.key==="Escape"&&(j.preventDefault(),u(e??""),m(!1))};return f?a.jsxs("div",{className:"w-full",children:[a.jsx(Mo,{ref:y,value:c,onChange:C,onBlur:()=>void S(),onKeyDown:E,placeholder:r,className:oe("m-0 w-full border-0 bg-white p-2 shadow-none dark:bg-white/4","focus-visible:ring-primary focus-visible:ring-0",{"opacity-50":x}),style:{fontSize:"inherit",lineHeight:"inherit",fontFamily:"inherit",resize:"vertical",minHeight:i,minWidth:s},disabled:x}),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:oe("min-h-24 cursor-pointer rounded p-2 whitespace-pre-wrap","transition-colors duration-150",!e&&"text-gray-400 italic",n),style:{minWidth:s},children:e??r})})}function Vse(){const{dataMart:e,updateDataMartDescription:t}=js(),n=async r=>{await t(e.id,r)};return a.jsx("div",{children:a.jsx($se,{description:e.description,onUpdate:n,placeholder:"Add a description for this Data Mart..."})})}function RN(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 Gse(e){if(Array.isArray(e))return e}function Bse(e,t,n){return(t=Qse(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qse(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(x){m=!0,s=x}finally{try{if(!f&&n.return!=null&&(c=n.return(),Object(c)!==c))return}finally{if(m)throw s}}return u}}function Kse(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
819
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jN(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 TN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jN(Object(n),!0).forEach(function(r){Bse(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Wse(e,t){if(e==null)return{};var n,r,s=Zse(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 Zse(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 Yse(e,t){return Gse(e)||qse(e,t)||Jse(e,t)||Kse()}function Xse(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 Qse(e){var t=Xse(e,"string");return typeof t=="symbol"?t:t+""}function Jse(e,t){if(e){if(typeof e=="string")return RN(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)?RN(e,t):void 0}}function eoe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _N(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 NN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_N(Object(n),!0).forEach(function(r){eoe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_N(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function toe(){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 Vf(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 cx(e){return{}.toString.call(e).includes("Object")}function noe(e){return!Object.keys(e).length}function gh(e){return typeof e=="function"}function roe(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function aoe(e,t){return cx(t)||gl("changeType"),Object.keys(t).some(function(n){return!roe(e,n)})&&gl("changeField"),t}function soe(e){gh(e)||gl("selectorType")}function ooe(e){gh(e)||cx(e)||gl("handlerType"),cx(e)&&Object.values(e).some(function(t){return!gh(t)})&&gl("handlersType")}function ioe(e){e||gl("initialIsRequired"),cx(e)||gl("initialType"),noe(e)&&gl("initialContent")}function loe(e,t){throw new Error(e[t]||e.default)}var coe={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"},gl=Vf(loe)(coe),rg={changes:aoe,selector:soe,handler:ooe,initial:ioe};function uoe(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};rg.initial(e),rg.handler(t);var n={current:e},r=Vf(hoe)(n,t),s=Vf(foe)(n),i=Vf(rg.changes)(e),c=Vf(doe)(n);function u(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(x){return x};return rg.selector(m),m(n.current)}function f(m){toe(r,s,i,c)(m)}return[u,f]}function doe(e,t){return gh(t)?t(e.current):t}function foe(e,t){return e.current=NN(NN({},e.current),t),t}function hoe(e,t,n){return gh(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 moe={create:uoe},poe={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function goe(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 xoe(e){return{}.toString.call(e).includes("Object")}function yoe(e){return e||AN("configIsRequired"),xoe(e)||AN("configType"),e.urls?(voe(),{paths:{vs:e.urls.monacoBase}}):e}function voe(){console.warn(q6.deprecation)}function boe(e,t){throw new Error(e[t]||e.default)}var q6={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!
|
|
820
|
+
You are using deprecated way of configuration.
|
|
821
|
+
|
|
822
|
+
Instead of using
|
|
823
|
+
monaco.config({ urls: { monacoBase: '...' } })
|
|
824
|
+
use
|
|
825
|
+
monaco.config({ paths: { vs: '...' } })
|
|
826
|
+
|
|
827
|
+
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
828
|
+
`},AN=goe(boe)(q6),Soe={config:yoe},Coe=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 K6(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],K6(e[n],t[n]))}),TN(TN({},e),t)}var Eoe={type:"cancelation",msg:"operation is manually canceled"};function Vb(e){var t=!1,n=new Promise(function(r,s){e.then(function(i){return t?s(Eoe):r(i)}),e.catch(s)});return n.cancel=function(){return t=!0},n}var woe=["monaco"],Roe=moe.create({config:poe,isInitialized:!1,resolve:null,reject:null,monaco:null}),W6=Yse(Roe,2),om=W6[0],Ry=W6[1];function joe(e){var t=Soe.config(e),n=t.monaco,r=Wse(t,woe);Ry(function(s){return{config:K6(s.config,r),monaco:n}})}function Toe(){var e=om(function(t){var n=t.monaco,r=t.isInitialized,s=t.resolve;return{monaco:n,isInitialized:r,resolve:s}});if(!e.isInitialized){if(Ry({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),Vb(Gb);if(window.monaco&&window.monaco.editor)return Z6(window.monaco),e.resolve(window.monaco),Vb(Gb);Coe(_oe,Aoe)(Doe)}return Vb(Gb)}function _oe(e){return document.body.appendChild(e)}function Noe(e){var t=document.createElement("script");return e&&(t.src=e),t}function Aoe(e){var t=om(function(r){var s=r.config,i=r.reject;return{config:s,reject:i}}),n=Noe("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function Doe(){var e=om(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;Z6(r),e.resolve(r)},function(n){e.reject(n)})}function Z6(e){om().monaco||Ry({monaco:e})}function Ooe(){return om(function(e){var t=e.monaco;return t})}var Gb=new Promise(function(e,t){return Ry({resolve:e,reject:t})}),Y6={config:joe,init:Toe,__getMonacoInstance:Ooe},Ioe={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},Bb=Ioe,Moe={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},koe=Moe;function Loe({children:e}){return re.createElement("div",{style:koe.container},e)}var Poe=Loe,Uoe=Poe;function zoe({width:e,height:t,isEditorReady:n,loading:r,_ref:s,className:i,wrapperProps:c}){return re.createElement("section",{style:{...Bb.wrapper,width:e,height:t},...c},!n&&re.createElement(Uoe,null,r),re.createElement("div",{ref:s,style:{...Bb.fullWidth,...!n&&Bb.hide},className:i}))}var Foe=zoe,X6=h.memo(Foe);function Hoe(e){h.useEffect(e,[])}var Q6=Hoe;function $oe(e,t,n=!0){let r=h.useRef(!0);h.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var Ya=$oe;function Qf(){}function Ku(e,t,n,r){return Voe(e,r)||Goe(e,t,n,r)}function Voe(e,t){return e.editor.getModel(J6(e,t))}function Goe(e,t,n,r){return e.editor.createModel(t,n,r?J6(e,r):void 0)}function J6(e,t){return e.Uri.parse(t)}function Boe({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:s,originalModelPath:i,modifiedModelPath:c,keepCurrentOriginalModel:u=!1,keepCurrentModifiedModel:f=!1,theme:m="light",loading:x="Loading...",options:g={},height:y="100%",width:v="100%",className:C,wrapperProps:S={},beforeMount:E=Qf,onMount:j=Qf}){let[R,T]=h.useState(!1),[N,A]=h.useState(!0),I=h.useRef(null),_=h.useRef(null),M=h.useRef(null),G=h.useRef(j),H=h.useRef(E),L=h.useRef(!1);Q6(()=>{let V=Y6.init();return V.then(D=>(_.current=D)&&A(!1)).catch(D=>(D==null?void 0:D.type)!=="cancelation"&&console.error("Monaco initialization: error:",D)),()=>I.current?B():V.cancel()}),Ya(()=>{if(I.current&&_.current){let V=I.current.getOriginalEditor(),D=Ku(_.current,e||"",r||n||"text",i||"");D!==V.getModel()&&V.setModel(D)}},[i],R),Ya(()=>{if(I.current&&_.current){let V=I.current.getModifiedEditor(),D=Ku(_.current,t||"",s||n||"text",c||"");D!==V.getModel()&&V.setModel(D)}},[c],R),Ya(()=>{let V=I.current.getModifiedEditor();V.getOption(_.current.editor.EditorOption.readOnly)?V.setValue(t||""):t!==V.getValue()&&(V.executeEdits("",[{range:V.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),V.pushUndoStop())},[t],R),Ya(()=>{var V,D;(D=(V=I.current)==null?void 0:V.getModel())==null||D.original.setValue(e||"")},[e],R),Ya(()=>{let{original:V,modified:D}=I.current.getModel();_.current.editor.setModelLanguage(V,r||n||"text"),_.current.editor.setModelLanguage(D,s||n||"text")},[n,r,s],R),Ya(()=>{var V;(V=_.current)==null||V.editor.setTheme(m)},[m],R),Ya(()=>{var V;(V=I.current)==null||V.updateOptions(g)},[g],R);let q=h.useCallback(()=>{var F;if(!_.current)return;H.current(_.current);let V=Ku(_.current,e||"",r||n||"text",i||""),D=Ku(_.current,t||"",s||n||"text",c||"");(F=I.current)==null||F.setModel({original:V,modified:D})},[n,t,s,e,r,i,c]),W=h.useCallback(()=>{var V;!L.current&&M.current&&(I.current=_.current.editor.createDiffEditor(M.current,{automaticLayout:!0,...g}),q(),(V=_.current)==null||V.editor.setTheme(m),T(!0),L.current=!0)},[g,m,q]);h.useEffect(()=>{R&&G.current(I.current,_.current)},[R]),h.useEffect(()=>{!N&&!R&&W()},[N,R,W]);function B(){var D,F,U,ee;let V=(D=I.current)==null?void 0:D.getModel();u||((F=V==null?void 0:V.original)==null||F.dispose()),f||((U=V==null?void 0:V.modified)==null||U.dispose()),(ee=I.current)==null||ee.dispose()}return re.createElement(X6,{width:v,height:y,isEditorReady:R,loading:x,_ref:M,className:C,wrapperProps:S})}var qoe=Boe;h.memo(qoe);function Koe(e){let t=h.useRef();return h.useEffect(()=>{t.current=e},[e]),t.current}var Woe=Koe,ag=new Map;function Zoe({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:s,path:i,theme:c="light",line:u,loading:f="Loading...",options:m={},overrideServices:x={},saveViewState:g=!0,keepCurrentModel:y=!1,width:v="100%",height:C="100%",className:S,wrapperProps:E={},beforeMount:j=Qf,onMount:R=Qf,onChange:T,onValidate:N=Qf}){let[A,I]=h.useState(!1),[_,M]=h.useState(!0),G=h.useRef(null),H=h.useRef(null),L=h.useRef(null),q=h.useRef(R),W=h.useRef(j),B=h.useRef(),V=h.useRef(r),D=Woe(i),F=h.useRef(!1),U=h.useRef(!1);Q6(()=>{let z=Y6.init();return z.then($=>(G.current=$)&&M(!1)).catch($=>($==null?void 0:$.type)!=="cancelation"&&console.error("Monaco initialization: error:",$)),()=>H.current?he():z.cancel()}),Ya(()=>{var $,P,K,Y;let z=Ku(G.current,e||r||"",t||s||"",i||n||"");z!==(($=H.current)==null?void 0:$.getModel())&&(g&&ag.set(D,(P=H.current)==null?void 0:P.saveViewState()),(K=H.current)==null||K.setModel(z),g&&((Y=H.current)==null||Y.restoreViewState(ag.get(i))))},[i],A),Ya(()=>{var z;(z=H.current)==null||z.updateOptions(m)},[m],A),Ya(()=>{!H.current||r===void 0||(H.current.getOption(G.current.editor.EditorOption.readOnly)?H.current.setValue(r):r!==H.current.getValue()&&(U.current=!0,H.current.executeEdits("",[{range:H.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),H.current.pushUndoStop(),U.current=!1))},[r],A),Ya(()=>{var $,P;let z=($=H.current)==null?void 0:$.getModel();z&&s&&((P=G.current)==null||P.editor.setModelLanguage(z,s))},[s],A),Ya(()=>{var z;u!==void 0&&((z=H.current)==null||z.revealLine(u))},[u],A),Ya(()=>{var z;(z=G.current)==null||z.editor.setTheme(c)},[c],A);let ee=h.useCallback(()=>{var z;if(!(!L.current||!G.current)&&!F.current){W.current(G.current);let $=i||n,P=Ku(G.current,r||e||"",t||s||"",$||"");H.current=(z=G.current)==null?void 0:z.editor.create(L.current,{model:P,automaticLayout:!0,...m},x),g&&H.current.restoreViewState(ag.get($)),G.current.editor.setTheme(c),u!==void 0&&H.current.revealLine(u),I(!0),F.current=!0}},[e,t,n,r,s,i,m,x,g,c,u]);h.useEffect(()=>{A&&q.current(H.current,G.current)},[A]),h.useEffect(()=>{!_&&!A&&ee()},[_,A,ee]),V.current=r,h.useEffect(()=>{var z,$;A&&T&&((z=B.current)==null||z.dispose(),B.current=($=H.current)==null?void 0:$.onDidChangeModelContent(P=>{U.current||T(H.current.getValue(),P)}))},[A,T]),h.useEffect(()=>{if(A){let z=G.current.editor.onDidChangeMarkers($=>{var K;let P=(K=H.current.getModel())==null?void 0:K.uri;if(P&&$.find(Y=>Y.path===P.path)){let Y=G.current.editor.getModelMarkers({resource:P});N==null||N(Y)}});return()=>{z==null||z.dispose()}}return()=>{}},[A,N]);function he(){var z,$;(z=B.current)==null||z.dispose(),y?g&&ag.set(i,H.current.saveViewState()):($=H.current.getModel())==null||$.dispose(),H.current.dispose()}return re.createElement(X6,{width:v,height:C,isEditorReady:A,loading:f,_ref:L,className:S,wrapperProps:E})}var Yoe=Zoe,eM=h.memo(Yoe);function Xoe({initialValue:e,onChange:t}){const[n,r]=h.useState((e==null?void 0:e.sqlQuery)??""),{resolvedTheme:s}=Yh();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(eM,{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 pS({icon:e,title:t,subtitle:n,rightContent:r,onClick:s,className:i}){const c=e;return a.jsxs("div",{className:oe("group flex items-center gap-4 rounded-md border-b border-gray-200 bg-white transition-shadow duration-200 hover:shadow-xs dark:border-0 dark:bg-white/2",s&&"cursor-pointer dark:hover:bg-white/5",i),onClick:s,children:[a.jsxs("div",{className:"flex flex-grow items-start justify-center gap-3 px-6 py-5",children:[e&&a.jsx("div",{className:"flex items-center justify-center",children:a.jsx(c,{className:"h-6 w-6"})}),a.jsxs("div",{className:"flex flex-grow flex-col gap-1",children:[a.jsx("div",{className:"text-md font-medium",children:t}),n&&a.jsx("div",{className:"text-muted-foreground/60 text-sm",children:n})]})]}),a.jsxs("div",{className:"flex items-center justify-center gap-2 p-4",children:[r,s&&a.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-full transition-colors duration-200 group-hover:bg-gray-200/50 dark:group-hover:bg-white/4",children:a.jsx(ba,{className:"text-muted-foreground/75 dark:text-muted-foreground/50 h-4 w-4"})})]})]})}var DN=1,Qoe=.9,Joe=.8,eie=.17,qb=.1,Kb=.999,tie=.9999,nie=.99,rie=/[\\\/_+.#"@\[\(\{&]/,aie=/[\\\/_+.#"@\[\(\{&]/g,sie=/[\s-]/,tM=/[\s-]/g;function gS(e,t,n,r,s,i,c){if(i===t.length)return s===e.length?DN:nie;var u=`${s},${i}`;if(c[u]!==void 0)return c[u];for(var f=r.charAt(i),m=n.indexOf(f,s),x=0,g,y,v,C;m>=0;)g=gS(e,t,n,r,m+1,i+1,c),g>x&&(m===s?g*=DN:rie.test(e.charAt(m-1))?(g*=Joe,v=e.slice(s,m-1).match(aie),v&&s>0&&(g*=Math.pow(Kb,v.length))):sie.test(e.charAt(m-1))?(g*=Qoe,C=e.slice(s,m-1).match(tM),C&&s>0&&(g*=Math.pow(Kb,C.length))):(g*=eie,s>0&&(g*=Math.pow(Kb,m-s))),e.charAt(m)!==t.charAt(i)&&(g*=tie)),(g<qb&&n.charAt(m-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(m-1)!==r.charAt(i))&&(y=gS(e,t,n,r,m+1,i+2,c),y*qb>g&&(g=y*qb)),g>x&&(x=g),m=n.indexOf(f,m+1);return c[u]=x,x}function ON(e){return e.toLowerCase().replace(tM," ")}function oie(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,gS(e,t,ON(e),ON(t),0,0,{})}var Mf='[cmdk-group=""]',Wb='[cmdk-group-items=""]',iie='[cmdk-group-heading=""]',nM='[cmdk-item=""]',IN=`${nM}:not([aria-disabled="true"])`,xS="cmdk-item-select",$u="data-value",lie=(e,t,n)=>oie(e,t,n),rM=h.createContext(void 0),im=()=>h.useContext(rM),aM=h.createContext(void 0),OE=()=>h.useContext(aM),sM=h.createContext(void 0),oM=h.forwardRef((e,t)=>{let n=Vu(()=>{var $,P;return{search:"",value:(P=($=e.value)!=null?$:e.defaultValue)!=null?P:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Vu(()=>new Set),s=Vu(()=>new Map),i=Vu(()=>new Map),c=Vu(()=>new Set),u=iM(e),{label:f,children:m,value:x,onValueChange:g,filter:y,shouldFilter:v,loop:C,disablePointerSelection:S=!1,vimBindings:E=!0,...j}=e,R=ar(),T=ar(),N=ar(),A=h.useRef(null),I=vie();Ic(()=>{if(x!==void 0){let $=x.trim();n.current.value=$,_.emit()}},[x]),Ic(()=>{I(6,W)},[]);let _=h.useMemo(()=>({subscribe:$=>(c.current.add($),()=>c.current.delete($)),snapshot:()=>n.current,setState:($,P,K)=>{var Y,se,Q,le;if(!Object.is(n.current[$],P)){if(n.current[$]=P,$==="search")q(),H(),I(1,L);else if($==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let pe=document.getElementById(N);pe?pe.focus():(Y=document.getElementById(R))==null||Y.focus()}if(I(7,()=>{var pe;n.current.selectedItemId=(pe=B())==null?void 0:pe.id,_.emit()}),K||I(5,W),((se=u.current)==null?void 0:se.value)!==void 0){let pe=P??"";(le=(Q=u.current).onValueChange)==null||le.call(Q,pe);return}}_.emit()}},emit:()=>{c.current.forEach($=>$())}}),[]),M=h.useMemo(()=>({value:($,P,K)=>{var Y;P!==((Y=i.current.get($))==null?void 0:Y.value)&&(i.current.set($,{value:P,keywords:K}),n.current.filtered.items.set($,G(P,K)),I(2,()=>{H(),_.emit()}))},item:($,P)=>(r.current.add($),P&&(s.current.has(P)?s.current.get(P).add($):s.current.set(P,new Set([$]))),I(3,()=>{q(),H(),n.current.value||L(),_.emit()}),()=>{i.current.delete($),r.current.delete($),n.current.filtered.items.delete($);let K=B();I(4,()=>{q(),(K==null?void 0:K.getAttribute("id"))===$&&L(),_.emit()})}),group:$=>(s.current.has($)||s.current.set($,new Set),()=>{i.current.delete($),s.current.delete($)}),filter:()=>u.current.shouldFilter,label:f||e["aria-label"],getDisablePointerSelection:()=>u.current.disablePointerSelection,listId:R,inputId:N,labelId:T,listInnerRef:A}),[]);function G($,P){var K,Y;let se=(Y=(K=u.current)==null?void 0:K.filter)!=null?Y:lie;return $?se($,n.current.search,P):0}function H(){if(!n.current.search||u.current.shouldFilter===!1)return;let $=n.current.filtered.items,P=[];n.current.filtered.groups.forEach(Y=>{let se=s.current.get(Y),Q=0;se.forEach(le=>{let pe=$.get(le);Q=Math.max(pe,Q)}),P.push([Y,Q])});let K=A.current;V().sort((Y,se)=>{var Q,le;let pe=Y.getAttribute("id"),be=se.getAttribute("id");return((Q=$.get(be))!=null?Q:0)-((le=$.get(pe))!=null?le:0)}).forEach(Y=>{let se=Y.closest(Wb);se?se.appendChild(Y.parentElement===se?Y:Y.closest(`${Wb} > *`)):K.appendChild(Y.parentElement===K?Y:Y.closest(`${Wb} > *`))}),P.sort((Y,se)=>se[1]-Y[1]).forEach(Y=>{var se;let Q=(se=A.current)==null?void 0:se.querySelector(`${Mf}[${$u}="${encodeURIComponent(Y[0])}"]`);Q==null||Q.parentElement.appendChild(Q)})}function L(){let $=V().find(K=>K.getAttribute("aria-disabled")!=="true"),P=$==null?void 0:$.getAttribute($u);_.setState("value",P||void 0)}function q(){var $,P,K,Y;if(!n.current.search||u.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let se=0;for(let Q of r.current){let le=(P=($=i.current.get(Q))==null?void 0:$.value)!=null?P:"",pe=(Y=(K=i.current.get(Q))==null?void 0:K.keywords)!=null?Y:[],be=G(le,pe);n.current.filtered.items.set(Q,be),be>0&&se++}for(let[Q,le]of s.current)for(let pe of le)if(n.current.filtered.items.get(pe)>0){n.current.filtered.groups.add(Q);break}n.current.filtered.count=se}function W(){var $,P,K;let Y=B();Y&&((($=Y.parentElement)==null?void 0:$.firstChild)===Y&&((K=(P=Y.closest(Mf))==null?void 0:P.querySelector(iie))==null||K.scrollIntoView({block:"nearest"})),Y.scrollIntoView({block:"nearest"}))}function B(){var $;return($=A.current)==null?void 0:$.querySelector(`${nM}[aria-selected="true"]`)}function V(){var $;return Array.from((($=A.current)==null?void 0:$.querySelectorAll(IN))||[])}function D($){let P=V()[$];P&&_.setState("value",P.getAttribute($u))}function F($){var P;let K=B(),Y=V(),se=Y.findIndex(le=>le===K),Q=Y[se+$];(P=u.current)!=null&&P.loop&&(Q=se+$<0?Y[Y.length-1]:se+$===Y.length?Y[0]:Y[se+$]),Q&&_.setState("value",Q.getAttribute($u))}function U($){let P=B(),K=P==null?void 0:P.closest(Mf),Y;for(;K&&!Y;)K=$>0?xie(K,Mf):yie(K,Mf),Y=K==null?void 0:K.querySelector(IN);Y?_.setState("value",Y.getAttribute($u)):F($)}let ee=()=>D(V().length-1),he=$=>{$.preventDefault(),$.metaKey?ee():$.altKey?U(1):F(1)},z=$=>{$.preventDefault(),$.metaKey?D(0):$.altKey?U(-1):F(-1)};return h.createElement(tt.div,{ref:t,tabIndex:-1,...j,"cmdk-root":"",onKeyDown:$=>{var P;(P=j.onKeyDown)==null||P.call(j,$);let K=$.nativeEvent.isComposing||$.keyCode===229;if(!($.defaultPrevented||K))switch($.key){case"n":case"j":{E&&$.ctrlKey&&he($);break}case"ArrowDown":{he($);break}case"p":case"k":{E&&$.ctrlKey&&z($);break}case"ArrowUp":{z($);break}case"Home":{$.preventDefault(),D(0);break}case"End":{$.preventDefault(),ee();break}case"Enter":{$.preventDefault();let Y=B();if(Y){let se=new Event(xS);Y.dispatchEvent(se)}}}}},h.createElement("label",{"cmdk-label":"",htmlFor:M.inputId,id:M.labelId,style:Sie},f),jy(e,$=>h.createElement(aM.Provider,{value:_},h.createElement(rM.Provider,{value:M},$))))}),cie=h.forwardRef((e,t)=>{var n,r;let s=ar(),i=h.useRef(null),c=h.useContext(sM),u=im(),f=iM(e),m=(r=(n=f.current)==null?void 0:n.forceMount)!=null?r:c==null?void 0:c.forceMount;Ic(()=>{if(!m)return u.item(s,c==null?void 0:c.id)},[m]);let x=lM(s,i,[e.value,e.children,i],e.keywords),g=OE(),y=El(I=>I.value&&I.value===x.current),v=El(I=>m||u.filter()===!1?!0:I.search?I.filtered.items.get(s)>0:!0);h.useEffect(()=>{let I=i.current;if(!(!I||e.disabled))return I.addEventListener(xS,C),()=>I.removeEventListener(xS,C)},[v,e.onSelect,e.disabled]);function C(){var I,_;S(),(_=(I=f.current).onSelect)==null||_.call(I,x.current)}function S(){g.setState("value",x.current,!0)}if(!v)return null;let{disabled:E,value:j,onSelect:R,forceMount:T,keywords:N,...A}=e;return h.createElement(tt.div,{ref:aa(i,t),...A,id:s,"cmdk-item":"",role:"option","aria-disabled":!!E,"aria-selected":!!y,"data-disabled":!!E,"data-selected":!!y,onPointerMove:E||u.getDisablePointerSelection()?void 0:S,onClick:E?void 0:C},e.children)}),uie=h.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:s,...i}=e,c=ar(),u=h.useRef(null),f=h.useRef(null),m=ar(),x=im(),g=El(v=>s||x.filter()===!1?!0:v.search?v.filtered.groups.has(c):!0);Ic(()=>x.group(c),[]),lM(c,u,[e.value,e.heading,f]);let y=h.useMemo(()=>({id:c,forceMount:s}),[s]);return h.createElement(tt.div,{ref:aa(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),jy(e,v=>h.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?m:void 0},h.createElement(sM.Provider,{value:y},v))))}),die=h.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,s=h.useRef(null),i=El(c=>!c.search);return!n&&!i?null:h.createElement(tt.div,{ref:aa(s,t),...r,"cmdk-separator":"",role:"separator"})}),fie=h.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,s=e.value!=null,i=OE(),c=El(m=>m.search),u=El(m=>m.selectedItemId),f=im();return h.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),h.createElement(tt.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)}})}),hie=h.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...s}=e,i=h.useRef(null),c=h.useRef(null),u=El(m=>m.selectedItemId),f=im();return h.useEffect(()=>{if(c.current&&i.current){let m=c.current,x=i.current,g,y=new ResizeObserver(()=>{g=requestAnimationFrame(()=>{let v=m.offsetHeight;x.style.setProperty("--cmdk-list-height",v.toFixed(1)+"px")})});return y.observe(m),()=>{cancelAnimationFrame(g),y.unobserve(m)}}},[]),h.createElement(tt.div,{ref:aa(i,t),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":u,"aria-label":r,id:f.listId},jy(e,m=>h.createElement("div",{ref:aa(c,f.listInnerRef),"cmdk-list-sizer":""},m)))}),mie=h.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:s,contentClassName:i,container:c,...u}=e;return h.createElement(Nx,{open:n,onOpenChange:r},h.createElement(Ax,{container:c},h.createElement(Dx,{"cmdk-overlay":"",className:s}),h.createElement(Ox,{"aria-label":e.label,"cmdk-dialog":"",className:i},h.createElement(oM,{ref:t,...u}))))}),pie=h.forwardRef((e,t)=>El(n=>n.filtered.count===0)?h.createElement(tt.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),gie=h.forwardRef((e,t)=>{let{progress:n,children:r,label:s="Loading...",...i}=e;return h.createElement(tt.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},jy(e,c=>h.createElement("div",{"aria-hidden":!0},c)))}),Ad=Object.assign(oM,{List:hie,Item:cie,Input:fie,Group:uie,Separator:die,Dialog:mie,Empty:pie,Loading:gie});function xie(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function yie(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function iM(e){let t=h.useRef(e);return Ic(()=>{t.current=e}),t}var Ic=typeof window>"u"?h.useEffect:h.useLayoutEffect;function Vu(e){let t=h.useRef();return t.current===void 0&&(t.current=e()),t}function El(e){let t=OE(),n=()=>e(t.snapshot());return h.useSyncExternalStore(t.subscribe,n,n)}function lM(e,t,n,r=[]){let s=h.useRef(),i=im();return Ic(()=>{var c;let u=(()=>{var m;for(let x of n){if(typeof x=="string")return x.trim();if(typeof x=="object"&&"current"in x)return x.current?(m=x.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 vie=()=>{let[e,t]=h.useState(),n=Vu(()=>new Map);return Ic(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,s)=>{n.current.set(r,s),t({})}};function bie(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function jy({asChild:e,children:t},n){return e&&h.isValidElement(t)?h.cloneElement(bie(t),{ref:t.ref},n(t.props.children)):n(t)}var Sie={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function IE({className:e,...t}){return a.jsx(Ad,{"data-slot":"command",className:oe("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}function ME({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(zc,{className:"size-4 shrink-0 opacity-50"}),a.jsx(Ad.Input,{"data-slot":"command-input",className:oe("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...t})]})}function cM({className:e,...t}){return a.jsx(Ad.List,{"data-slot":"command-list",className:oe("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function uM({...e}){return a.jsx(Ad.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function dM({className:e,...t}){return a.jsx(Ad.Group,{"data-slot":"command-group",className:oe("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...t})}function kE({className:e,...t}){return a.jsx(Ad.Item,{"data-slot":"command-item",className:oe("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}function Cie(e){const t=Eie(e),n=h.forwardRef((r,s)=>{const{children:i,...c}=r,u=h.Children.toArray(i),f=u.find(Rie);if(f){const m=f.props.children,x=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,x):null})}return a.jsx(t,{...c,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function Eie(e){const t=h.forwardRef((n,r)=>{const{children:s,...i}=n;if(h.isValidElement(s)){const c=Tie(s),u=jie(i,s.props);return s.type!==h.Fragment&&(u.ref=r?aa(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 wie=Symbol("radix.slottable");function Rie(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===wie}function jie(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 Tie(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="Popover",[fM]=Dr(Ty,[Io]),lm=Io(),[_ie,Hl]=fM(Ty),hM=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:c=!1}=e,u=lm(t),f=h.useRef(null),[m,x]=h.useState(!1),[g,y]=ya({prop:r,defaultProp:s??!1,onChange:i,caller:Ty});return a.jsx(Cd,{...u,children:a.jsx(_ie,{scope:t,contentId:ar(),triggerRef:f,open:g,onOpenChange:y,onOpenToggle:h.useCallback(()=>y(v=>!v),[y]),hasCustomAnchor:m,onCustomAnchorAdd:h.useCallback(()=>x(!0),[]),onCustomAnchorRemove:h.useCallback(()=>x(!1),[]),modal:c,children:n})})};hM.displayName=Ty;var mM="PopoverAnchor",Nie=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Hl(mM,n),i=lm(n),{onCustomAnchorAdd:c,onCustomAnchorRemove:u}=s;return h.useEffect(()=>(c(),()=>u()),[c,u]),a.jsx(Ed,{...i,...r,ref:t})});Nie.displayName=mM;var pM="PopoverTrigger",gM=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Hl(pM,n),i=lm(n),c=Rt(t,s.triggerRef),u=a.jsx(tt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":SM(s.open),...r,ref:c,onClick:Me(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?u:a.jsx(Ed,{asChild:!0,...i,children:u})});gM.displayName=pM;var LE="PopoverPortal",[Aie,Die]=fM(LE,{forceMount:void 0}),xM=e=>{const{__scopePopover:t,forceMount:n,children:r,container:s}=e,i=Hl(LE,t);return a.jsx(Aie,{scope:t,forceMount:n,children:a.jsx(Xr,{present:n||i.open,children:a.jsx(Hc,{asChild:!0,container:s,children:r})})})};xM.displayName=LE;var pd="PopoverContent",yM=h.forwardRef((e,t)=>{const n=Die(pd,e.__scopePopover),{forceMount:r=n.forceMount,...s}=e,i=Hl(pd,e.__scopePopover);return a.jsx(Xr,{present:r||i.open,children:i.modal?a.jsx(Iie,{...s,ref:t}):a.jsx(Mie,{...s,ref:t})})});yM.displayName=pd;var Oie=Cie("PopoverContent.RemoveScroll"),Iie=h.forwardRef((e,t)=>{const n=Hl(pd,e.__scopePopover),r=h.useRef(null),s=Rt(t,r),i=h.useRef(!1);return h.useEffect(()=>{const c=r.current;if(c)return Tx(c)},[]),a.jsx(Mh,{as:Oie,allowPinchZoom:!0,children:a.jsx(vM,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Me(e.onCloseAutoFocus,c=>{var u;c.preventDefault(),i.current||(u=n.triggerRef.current)==null||u.focus()}),onPointerDownOutside:Me(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:Me(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1})})})}),Mie=h.forwardRef((e,t)=>{const n=Hl(pd,e.__scopePopover),r=h.useRef(!1),s=h.useRef(!1);return a.jsx(vM,{...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()}})}),vM=h.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:c,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:m,onInteractOutside:x,...g}=e,y=Hl(pd,n),v=lm(n);return Rx(),a.jsx(Ih,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:a.jsx(Fc,{asChild:!0,disableOutsidePointerEvents:c,onInteractOutside:x,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:m,onDismiss:()=>y.onOpenChange(!1),children:a.jsx(Lh,{"data-state":SM(y.open),role:"dialog",id:y.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)"}})})})}),bM="PopoverClose",kie=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Hl(bM,n);return a.jsx(tt.button,{type:"button",...r,ref:t,onClick:Me(e.onClick,()=>s.onOpenChange(!1))})});kie.displayName=bM;var Lie="PopoverArrow",Pie=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=lm(n);return a.jsx(Ph,{...s,...r,ref:t})});Pie.displayName=Lie;function SM(e){return e?"open":"closed"}var Uie=hM,zie=gM,Fie=xM,Hie=yM;function PE({...e}){return a.jsx(Uie,{"data-slot":"popover",...e})}function UE({...e}){return a.jsx(zie,{"data-slot":"popover-trigger",...e})}function zE({className:e,align:t="center",sideOffset:n=4,...r}){return a.jsx(Fie,{children:a.jsx(Hie,{"data-slot":"popover-content",align:t,sideOffset:n,className:oe("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...r})})}function FE({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,x]=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]),y=e.find(C=>C.value===t),v=h.useCallback(C=>{n(C),requestAnimationFrame(()=>{x(""),f(!1)})},[n]);return a.jsxs(PE,{open:u,onOpenChange:f,modal:!0,children:[a.jsx(UE,{asChild:!0,children:a.jsxs(we,{variant:"outline",role:"combobox","aria-expanded":u,className:oe("w-full justify-between",!t&&"text-muted-foreground",i),disabled:c,children:[y?y.label:r,a.jsx(ZS,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),a.jsx(zE,{className:"max-h-[300px] min-w-[300px] overflow-auto p-0",align:"start",sideOffset:5,children:a.jsxs(IE,{children:[a.jsx(ME,{placeholder:`Search ${r.toLowerCase()}...`,value:m,onValueChange:x}),a.jsx(uM,{children:s}),Object.entries(g).map(([C,S])=>a.jsx(dM,{heading:C,children:S.map(E=>a.jsxs(kE,{value:E.value,onSelect:()=>{v(E.value)},keywords:[E.label],children:[a.jsx(Ia,{className:oe("mr-2 h-4 w-4",t===E.value?"opacity-100":"opacity-0")}),E.label]},E.value))},C||"default"))]})})]})}function $ie(){return a.jsx($t,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(jt,{value:"service-account-details",children:[a.jsx(Tt,{children:"How do I get a Service Account JSON key?"}),a.jsxs(_t,{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(Ft,{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 Vie(){return a.jsx($t,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(jt,{value:"project-id-details",children:[a.jsx(Tt,{children:"How do I find my Project ID?"}),a.jsxs(_t,{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(Ft,{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 Gie(){return a.jsx($t,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(jt,{value:"gbq-location-details",children:[a.jsx(Tt,{children:"How do I find my dataset location?"}),a.jsxs(_t,{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(Ft,{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 Bie=({form:e})=>{const[t,n]=h.useState(!1);if(e.watch("type")!==ce.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?b5(i):null;return a.jsxs(a.Fragment,{children:[a.jsxs(Sr,{title:"Connection Settings",children:[a.jsx(bt,{control:e.control,name:"config.projectId",render:({field:u})=>a.jsxs(mt,{children:[a.jsx(ut,{tooltip:"Enter the ID of your Google Cloud project where BigQuery usage will be billed",children:"Project ID"}),a.jsx(xt,{children:a.jsx(ct,{...u,placeholder:"Enter a Project Id"})}),a.jsx(qt,{children:a.jsx(Vie,{})}),a.jsx(Ct,{})]})}),a.jsx(bt,{control:e.control,name:"config.location",render:({field:u})=>a.jsxs(mt,{children:[a.jsx(ut,{tooltip:"Choose the same region where your BigQuery data is stored to ensure queries work correctly",children:"Location"}),a.jsx(xt,{children:a.jsx(FE,{options:qQ,value:u.value,onValueChange:u.onChange,placeholder:"Select a location",emptyMessage:"No locations found",className:"w-full"})}),a.jsx(qt,{children:a.jsx(Gie,{})}),a.jsx(Ct,{})]})})]}),a.jsx(Sr,{title:"Authentication",children:a.jsx(bt,{control:e.control,name:"credentials.serviceAccount",render:({field:u})=>a.jsxs(mt,{children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(ut,{tooltip:"Paste a JSON key from a service account that has access to the selected storage provider",children:"Service Account"}),!t&&i&&a.jsx(we,{variant:"ghost",size:"sm",onClick:r,type:"button",children:"Edit"}),t&&a.jsx(we,{variant:"ghost",size:"sm",onClick:s,type:"button",children:"Cancel"})]}),a.jsx(xt,{children:!t&&c?a.jsxs(rt,{children:[a.jsx(at,{asChild:!0,children:a.jsx(Ft,{href:c.url,children:c.email})}),a.jsx(st,{children:a.jsx("p",{children:"View in Google Cloud Console"})})]}):a.jsx(Mo,{...u,className:"min-h-[150px] font-mono",rows:8,placeholder:"Paste your service account JSON here"})}),a.jsx(qt,{children:a.jsx($ie,{})}),a.jsx(Ct,{})]})})})]})};function qie(){return a.jsx($t,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(jt,{value:"athena-region-details",children:[a.jsx(Tt,{children:"How do I find my Athena region?"}),a.jsxs(_t,{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(Ft,{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 Kie(){return a.jsx($t,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(jt,{value:"athena-output-bucket-details",children:[a.jsx(Tt,{children:"How do I find a bucket?"}),a.jsxs(_t,{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(Ft,{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 Wie(){return a.jsx($t,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(jt,{value:"athena-access-key-id-details",children:[a.jsx(Tt,{children:"How do I get my AWS Access Key ID?"}),a.jsxs(_t,{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(Ft,{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(eC,{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(Ft,{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 Zie(){return a.jsx($t,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(jt,{value:"athena-secret-access-key-details",children:[a.jsx(Tt,{children:"How do I get my AWS Secret Access Key?"}),a.jsxs(_t,{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(Ft,{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 Yie=({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")!==ce.AWS_ATHENA?null:a.jsxs(a.Fragment,{children:[a.jsxs(Sr,{title:"Connection Settings",children:[a.jsx(bt,{control:e.control,name:"config.region",render:({field:r})=>a.jsxs(mt,{children:[a.jsx(ut,{tooltip:"Enter the AWS region where your Athena service is active",children:"Region"}),a.jsx(xt,{children:a.jsx(ct,{...r,placeholder:"Enter a region"})}),a.jsx(qt,{children:a.jsx(qie,{})}),a.jsx(Ct,{})]})}),a.jsx(bt,{control:e.control,name:"config.outputBucket",render:({field:r})=>a.jsxs(mt,{children:[a.jsx(ut,{tooltip:"Specify the S3 bucket where Athena query results will be stored",children:"Output Bucket"}),a.jsx(xt,{children:a.jsx(ct,{...r,placeholder:"Enter an output bucket"})}),a.jsx(qt,{children:a.jsx(Kie,{})}),a.jsx(Ct,{})]})})]}),a.jsxs(Sr,{title:"Authentication",children:[a.jsx(bt,{control:e.control,name:"credentials.accessKeyId",render:({field:r})=>a.jsxs(mt,{children:[a.jsx(ut,{tooltip:"Your AWS Access Key ID used for authentication",children:"Access Key ID"}),a.jsx(xt,{children:a.jsx(ct,{...r,placeholder:"Enter an access key id"})}),a.jsx(qt,{children:a.jsx(Wie,{})}),a.jsx(Ct,{})]})}),a.jsx(bt,{control:e.control,name:"credentials.secretAccessKey",render:({field:r})=>a.jsxs(mt,{children:[a.jsx(ut,{tooltip:"Your AWS Secret Access Key used for authentication",children:"Secret Access Key"}),a.jsx(xt,{children:a.jsx(ct,{...r,type:"password",placeholder:t||"Enter a secret access key"})}),a.jsx(qt,{children:a.jsx(Zie,{})}),a.jsx(Ct,{})]})})]})]})};function Xie(){return a.jsx($t,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(jt,{value:"snowflake-account-details",children:[a.jsx(Tt,{children:"How do I find my Snowflake account identifier?"}),a.jsxs(_t,{children:[a.jsxs("p",{className:"mb-2",children:["To find the region and locator for your account, see"," ",a.jsx(Ft,{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(Ft,{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(Ft,{className:"underline",href:"https://docs.owox.com/docs/storages/supported-storages/snowflake/",children:"OWOX Snowflake documentation"}),"."]})]})]})})}function Qie(){return a.jsx($t,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(jt,{value:"snowflake-warehouse-details",children:[a.jsx(Tt,{children:"How do I find my Snowflake warehouse?"}),a.jsxs(_t,{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 Jie(){return a.jsx($t,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(jt,{value:"snowflake-auth-method-details",children:[a.jsx(Tt,{children:"Which authentication method should I choose?"}),a.jsxs(_t,{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(Ft,{className:"underline",href:"https://docs.snowflake.com/en/user-guide/key-pair-auth.html",children:"key pair authentication"}),"."]})]})]})]})]})})}function ele(){return a.jsx($t,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(jt,{value:"snowflake-username-details",children:[a.jsx(Tt,{children:"How do I find my Snowflake username?"}),a.jsxs(_t,{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 tle(){return a.jsx($t,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(jt,{value:"snowflake-password-details",children:[a.jsx(Tt,{children:"How do I manage my Snowflake password?"}),a.jsxs(_t,{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(Ft,{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 nle(){return a.jsx($t,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(jt,{value:"snowflake-keypair-details",children:[a.jsx(Tt,{children:"How do I set up key pair authentication?"}),a.jsxs(_t,{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(Ft,{className:"underline",href:"https://docs.snowflake.com/en/user-guide/key-pair-auth.html",children:"Snowflake's key pair authentication documentation"}),"."]})]})]})})}function rle(){return a.jsx($t,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(jt,{value:"snowflake-passphrase-details",children:[a.jsx(Tt,{children:"What is a passphrase and when do I need it?"}),a.jsxs(_t,{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 ale=({form:e})=>{const t=e.watch("credentials.authMethod"),[n,r]=h.useState(""),[s,i]=h.useState("");return h.useEffect(()=>{if(e.getValues("credentials.username")){const u="_".repeat(12);r(u),e.setValue("credentials.password",u,{shouldDirty:!1});const f="_".repeat(20);i(f),e.setValue("credentials.privateKey",f,{shouldDirty:!1})}},[e]),e.watch("type")!==ce.SNOWFLAKE?null:a.jsxs(a.Fragment,{children:[a.jsxs(Sr,{title:"Connection Settings",children:[a.jsx(bt,{control:e.control,name:"config.account",render:({field:c})=>a.jsxs(mt,{children:[a.jsx(ut,{tooltip:"Enter your Snowflake account identifier",children:"Account"}),a.jsx(xt,{children:a.jsx(ct,{...c,placeholder:"e.g., xy12345.us-east-1"})}),a.jsx(qt,{children:a.jsx(Xie,{})}),a.jsx(Ct,{})]})}),a.jsx(bt,{control:e.control,name:"config.warehouse",render:({field:c})=>a.jsxs(mt,{children:[a.jsx(ut,{tooltip:"Specify the Snowflake warehouse to use for query execution",children:"Warehouse"}),a.jsx(xt,{children:a.jsx(ct,{...c,placeholder:"Enter warehouse name"})}),a.jsx(qt,{children:a.jsx(Qie,{})}),a.jsx(Ct,{})]})})]}),a.jsxs(Sr,{title:"Authentication",children:[a.jsx(bt,{control:e.control,name:"credentials.authMethod",render:({field:c})=>a.jsxs(mt,{children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(ut,{children:"Authentication Method"}),a.jsx(by,{value:c.value,onValueChange:c.onChange,children:a.jsxs(Sy,{children:[a.jsx(Oc,{value:Bs.PASSWORD,children:"Username & Password"}),a.jsx(Oc,{value:Bs.KEY_PAIR,children:"Key Pair"})]})})]}),a.jsx(qt,{children:a.jsx(Jie,{})}),a.jsx(Ct,{})]})}),a.jsx(bt,{control:e.control,name:"credentials.username",render:({field:c})=>a.jsxs(mt,{children:[a.jsx(ut,{tooltip:"Your Snowflake username",children:"Username"}),a.jsx(xt,{children:a.jsx(ct,{...c,placeholder:"Enter username"})}),a.jsx(qt,{children:a.jsx(ele,{})}),a.jsx(Ct,{})]})}),t===Bs.PASSWORD&&a.jsx(bt,{control:e.control,name:"credentials.password",render:({field:c})=>a.jsxs(mt,{children:[a.jsx(ut,{tooltip:"Your Snowflake password",children:"Password"}),a.jsx(xt,{children:a.jsx(ct,{...c,type:"password",placeholder:n||"Enter password"})}),a.jsx(qt,{children:a.jsx(tle,{})}),a.jsx(Ct,{})]})}),t===Bs.KEY_PAIR&&a.jsxs(a.Fragment,{children:[a.jsx(bt,{control:e.control,name:"credentials.privateKey",render:({field:c})=>a.jsxs(mt,{children:[a.jsx(ut,{tooltip:"Paste your private key in PEM format",children:"Private Key"}),a.jsx(xt,{children:a.jsx(Mo,{...c,placeholder:s||`-----BEGIN PRIVATE KEY-----
|
|
829
|
+
...
|
|
830
|
+
-----END PRIVATE KEY-----`,rows:6})}),a.jsx(qt,{children:a.jsx(nle,{})}),a.jsx(Ct,{})]})}),a.jsx(bt,{control:e.control,name:"credentials.privateKeyPassphrase",render:({field:c})=>a.jsxs(mt,{children:[a.jsx(ut,{tooltip:"Enter the passphrase if your private key is encrypted",children:"Passphrase (Optional)"}),a.jsx(xt,{children:a.jsx(ct,{...c,type:"password",value:c.value??"",placeholder:"Enter passphrase if key is encrypted"})}),a.jsx(qt,{children:a.jsx(rle,{})}),a.jsx(Ct,{})]})})]})]})]})};function sle(){return a.jsx($t,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(jt,{value:"redshift-region-details",children:[a.jsx(Tt,{children:"What is the AWS region?"}),a.jsxs(_t,{children:[a.jsx("p",{className:"mb-2",children:"The AWS region is the geographic location where your Redshift cluster or Serverless workgroup is hosted."}),a.jsx("p",{className:"mb-2",children:"Common examples:"}),a.jsxs("ul",{className:"list-inside list-disc space-y-1 text-sm",children:[a.jsxs("li",{children:[a.jsx("code",{className:"bg-muted rounded px-1 py-0.5",children:"us-east-1"})," - US East (N. Virginia)"]}),a.jsxs("li",{children:[a.jsx("code",{className:"bg-muted rounded px-1 py-0.5",children:"us-west-2"})," - US West (Oregon)"]}),a.jsxs("li",{children:[a.jsx("code",{className:"bg-muted rounded px-1 py-0.5",children:"eu-west-1"})," - Europe (Ireland)"]}),a.jsxs("li",{children:[a.jsx("code",{className:"bg-muted rounded px-1 py-0.5",children:"ap-southeast-1"})," - Asia Pacific (Singapore)"]})]}),a.jsxs("p",{className:"mt-2 text-sm",children:["You can find your region in the"," ",a.jsx(Ft,{className:"underline",href:"https://console.aws.amazon.com/redshift/",children:"AWS Redshift Console"}),"."]})]})]})})}function ole(){return a.jsx($t,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(jt,{value:"redshift-workgroup-details",children:[a.jsx(Tt,{children:"What is a Redshift Serverless workgroup?"}),a.jsxs(_t,{children:[a.jsxs("p",{className:"mb-2",children:["A workgroup is a collection of compute resources in Redshift Serverless. Use this field if you're using ",a.jsx("strong",{children:"Redshift Serverless"}),"."]}),a.jsxs("p",{className:"mb-2",children:["You can find your workgroup name in the"," ",a.jsx(Ft,{className:"underline",href:"https://console.aws.amazon.com/redshiftv2/home#serverless-dashboard",children:"Redshift Serverless Console"}),"."]}),a.jsxs("p",{className:"text-muted-foreground text-sm",children:[a.jsx("strong",{children:"Note:"})," You must provide either a workgroup name (for Serverless) OR a cluster identifier (for provisioned clusters), but not both."]})]})]})})}function ile(){return a.jsx($t,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(jt,{value:"redshift-cluster-details",children:[a.jsx(Tt,{children:"What is a cluster identifier?"}),a.jsxs(_t,{children:[a.jsxs("p",{className:"mb-2",children:["A cluster identifier is the unique name of your"," ",a.jsx("strong",{children:"provisioned Redshift cluster"}),". Use this field if you're using a traditional Redshift cluster (not Serverless)."]}),a.jsxs("p",{className:"mb-2",children:["You can find your cluster identifier in the"," ",a.jsx(Ft,{className:"underline",href:"https://console.aws.amazon.com/redshiftv2/home#clusters",children:"Redshift Clusters Console"}),"."]}),a.jsxs("p",{className:"text-muted-foreground text-sm",children:[a.jsx("strong",{children:"Note:"})," You must provide either a cluster identifier (for provisioned clusters) OR a workgroup name (for Serverless), but not both."]})]})]})})}function lle(){return a.jsx($t,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(jt,{value:"redshift-database-details",children:[a.jsx(Tt,{children:"What is the database name?"}),a.jsxs(_t,{children:[a.jsx("p",{className:"mb-2",children:"The database name is the name of the database you want to connect to within your Redshift cluster or workgroup."}),a.jsxs("p",{className:"mb-2",children:["Every Redshift cluster/workgroup has at least one database. The default database is often named ",a.jsx("code",{className:"bg-muted rounded px-1 py-0.5",children:"dev"}),", but you may have created custom databases."]}),a.jsx("p",{className:"text-muted-foreground text-sm",children:"This field is required for all authentication methods."})]})]})})}function cle(){return a.jsx($t,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(jt,{value:"redshift-access-key-details",children:[a.jsx(Tt,{children:"What is an AWS Access Key ID?"}),a.jsxs(_t,{children:[a.jsx("p",{className:"mb-2",children:"The Access Key ID is part of your AWS security credentials. It's used together with the Secret Access Key to authenticate AWS API requests."}),a.jsxs("p",{className:"mb-2",children:["Access keys are typically 20 characters long and start with"," ",a.jsx("code",{className:"bg-muted rounded px-1 py-0.5",children:"AKIA"})," or"," ",a.jsx("code",{className:"bg-muted rounded px-1 py-0.5",children:"ASIA"})," (for temporary credentials)."]}),a.jsxs("p",{className:"text-sm",children:["You can create access keys in the"," ",a.jsx(Ft,{className:"underline",href:"https://console.aws.amazon.com/iam/home#/security_credentials",children:"AWS IAM Console"}),"."]})]})]})})}function ule(){return a.jsx($t,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(jt,{value:"redshift-secret-key-details",children:[a.jsx(Tt,{children:"What is an AWS Secret Access Key?"}),a.jsxs(_t,{children:[a.jsx("p",{className:"mb-2",children:"The Secret Access Key is the private part of your AWS security credentials. It's used together with the Access Key ID to sign and authenticate AWS API requests."}),a.jsx("p",{className:"mb-2",children:"Secret Access Keys are typically 40 characters long and are only shown once when created. If you lose it, you'll need to create a new access key pair."}),a.jsxs("p",{className:"text-muted-foreground text-sm",children:[a.jsx("strong",{children:"Security warning:"})," Keep your secret access key secure and never share it publicly. It will be stored encrypted."]})]})]})})}const dle=({form:e})=>{const[t,n]=h.useState("");return h.useEffect(()=>{const r=e.getValues("config.connectionType"),s=e.watch("type");r===void 0&&s===ce.AWS_REDSHIFT&&e.setValue("config.connectionType",fr.SERVERLESS,{shouldDirty:!1})},[e]),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")!==ce.AWS_REDSHIFT?null:a.jsxs(a.Fragment,{children:[a.jsxs(Sr,{title:"Connection Settings",children:[a.jsx(bt,{control:e.control,name:"config.region",render:({field:r})=>a.jsxs(mt,{children:[a.jsx(ut,{tooltip:"Enter the AWS region where your Redshift service is active",children:"Region"}),a.jsx(xt,{children:a.jsx(ct,{...r,placeholder:"Enter a region"})}),a.jsx(qt,{children:a.jsx(sle,{})}),a.jsx(Ct,{})]})}),a.jsx(bt,{control:e.control,name:"config.database",render:({field:r})=>a.jsxs(mt,{children:[a.jsx(ut,{tooltip:"The database name to connect to",children:"Database"}),a.jsx(xt,{children:a.jsx(ct,{...r,placeholder:"Enter database name"})}),a.jsx(qt,{children:a.jsx(lle,{})}),a.jsx(Ct,{})]})}),a.jsx(bt,{control:e.control,name:"config.connectionType",render:({field:r})=>{const s=r.value??fr.SERVERLESS;return a.jsxs(mt,{children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(ut,{tooltip:s===fr.SERVERLESS?"Workgroup name for Redshift Serverless":"Cluster identifier for provisioned Redshift cluster",children:s===fr.SERVERLESS?"Workgroup Name":"Cluster Identifier"}),a.jsx(by,{value:s,onValueChange:r.onChange,children:a.jsxs(Sy,{children:[a.jsx(Oc,{value:fr.SERVERLESS,children:"Serverless"}),a.jsx(Oc,{value:fr.PROVISIONED,children:"Provisioned"})]})})]}),a.jsx(xt,{children:s===fr.SERVERLESS?a.jsx(ct,{...e.register("config.workgroupName"),placeholder:"Enter workgroup name"}):a.jsx(ct,{...e.register("config.clusterIdentifier"),placeholder:"Enter cluster identifier"})}),a.jsx(qt,{children:s===fr.SERVERLESS?a.jsx(ole,{}):a.jsx(ile,{})}),a.jsx(Ct,{})]})}})]}),a.jsxs(Sr,{title:"Authentication",children:[a.jsx(bt,{control:e.control,name:"credentials.accessKeyId",render:({field:r})=>a.jsxs(mt,{children:[a.jsx(ut,{tooltip:"Your AWS Access Key ID used for authentication",children:"Access Key ID"}),a.jsx(xt,{children:a.jsx(ct,{...r,placeholder:"Enter an access key id"})}),a.jsx(qt,{children:a.jsx(cle,{})}),a.jsx(Ct,{})]})}),a.jsx(bt,{control:e.control,name:"credentials.secretAccessKey",render:({field:r})=>a.jsxs(mt,{children:[a.jsx(ut,{tooltip:"Your AWS Secret Access Key used for authentication",children:"Secret Access Key"}),a.jsx(xt,{children:a.jsx(ct,{...r,type:"password",placeholder:t||"Enter a secret access key"})}),a.jsx(qt,{children:a.jsx(ule,{})}),a.jsx(Ct,{})]})})]})]})};function fle(){return a.jsx($t,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(jt,{value:"databricks-host-details",children:[a.jsx(Tt,{children:"How do I find my Databricks workspace URL?"}),a.jsxs(_t,{children:[a.jsx("p",{className:"mb-2",children:"Your Databricks workspace URL is the hostname of your workspace."}),a.jsxs("ol",{className:"list-inside list-decimal space-y-3 text-sm",children:[a.jsx("li",{children:"Sign in to your Databricks workspace."}),a.jsx("li",{children:"Look at the URL in your browser's address bar. The hostname is everything before the first slash."}),a.jsxs("li",{children:["For example, if your workspace URL is"," ",a.jsx("code",{className:"bg-muted rounded px-1 py-0.5",children:"https://adb-123456789.7.azuredatabricks.net/?o=123456789"}),", then your host is"," ",a.jsx("code",{className:"bg-muted rounded px-1 py-0.5",children:"adb-123456789.7.azuredatabricks.net"})]})]}),a.jsxs("div",{className:"mt-4",children:[a.jsx("p",{className:"mb-2 font-medium",children:"Examples by cloud provider:"}),a.jsxs("ul",{className:"ml-4 space-y-1",children:[a.jsxs("li",{children:["AWS:"," ",a.jsx("code",{className:"bg-muted rounded px-1 py-0.5",children:"dbc-12345678-90ab.cloud.databricks.com"})]}),a.jsxs("li",{children:["Azure:"," ",a.jsx("code",{className:"bg-muted rounded px-1 py-0.5",children:"adb-123456789.7.azuredatabricks.net"})]}),a.jsxs("li",{children:["GCP:"," ",a.jsx("code",{className:"bg-muted rounded px-1 py-0.5",children:"12345678901234.5.gcp.databricks.com"})]})]})]}),a.jsxs("div",{className:"mt-4 text-sm",children:["More details in"," ",a.jsx(Ft,{className:"underline",href:"https://docs.databricks.com/workspace/workspace-details.html",children:"Databricks documentation"}),"."]})]})]})})}function hle(){return a.jsx($t,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(jt,{value:"databricks-httppath-details",children:[a.jsx(Tt,{children:"How do I find the SQL warehouse HTTP path?"}),a.jsxs(_t,{children:[a.jsx("p",{className:"mb-2",children:"The HTTP path identifies which SQL warehouse to use for query execution."}),a.jsxs("ol",{className:"list-inside list-decimal space-y-3 text-sm",children:[a.jsx("li",{children:"Sign in to your Databricks workspace."}),a.jsxs("li",{children:["In the sidebar, click ",a.jsx("strong",{children:"SQL Warehouses"}),"."]}),a.jsx("li",{children:"Select the SQL warehouse you want to connect to."}),a.jsxs("li",{children:["Go to the ",a.jsx("strong",{children:"Connection Details"})," tab."]}),a.jsxs("li",{children:["Copy the ",a.jsx("strong",{children:"HTTP Path"})," value."]})]}),a.jsxs("div",{className:"mt-4",children:[a.jsx("p",{className:"mb-2 font-medium",children:"Example HTTP path:"}),a.jsx("code",{className:"bg-muted rounded px-1 py-0.5",children:"/sql/1.0/warehouses/abc123def456789"})]}),a.jsxs("div",{className:"mt-4 text-sm",children:["More details in"," ",a.jsx(Ft,{className:"underline",href:"https://docs.databricks.com/sql/admin/sql-endpoints.html",children:"Databricks SQL Warehouses documentation"}),"."]})]})]})})}function mle(){return a.jsx($t,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(jt,{value:"databricks-token-details",children:[a.jsx(Tt,{children:"How do I generate a Personal Access Token?"}),a.jsxs(_t,{children:[a.jsx("p",{className:"mb-2",children:"Personal Access Tokens (PAT) provide secure authentication to Databricks."}),a.jsxs("ol",{className:"list-inside list-decimal space-y-3 text-sm",children:[a.jsx("li",{children:"Sign in to your Databricks workspace."}),a.jsxs("li",{children:["Click your username in the top right corner and select ",a.jsx("strong",{children:"User Settings"}),"."]}),a.jsxs("li",{children:["Go to the ",a.jsx("strong",{children:"Developer"})," tab."]}),a.jsxs("li",{children:["Next to ",a.jsx("strong",{children:"Access tokens"}),", click ",a.jsx("strong",{children:"Manage"}),"."]}),a.jsxs("li",{children:["Click ",a.jsx("strong",{children:"Generate new token"}),"."]}),a.jsx("li",{children:'(Optional) Enter a comment to describe the purpose of the token (e.g., "OWOX Data Marts").'}),a.jsx("li",{children:"(Optional) Set a lifetime for the token. If you don't specify a lifetime, the token will never expire."}),a.jsxs("li",{children:["Click ",a.jsx("strong",{children:"Generate"}),"."]}),a.jsxs("li",{children:[a.jsx("strong",{className:"text-destructive",children:"Copy the displayed token and save it in a secure location"}),". You won't be able to see it again."]})]}),a.jsxs("div",{className:"bg-muted mt-4 rounded-md p-3",children:[a.jsx("p",{className:"mb-1 font-medium",children:"Security recommendations:"}),a.jsxs("ul",{className:"list-inside list-disc space-y-1 text-sm",children:[a.jsx("li",{children:"Never share your Personal Access Token with anyone"}),a.jsx("li",{children:"Set an expiration date for tokens when possible"}),a.jsx("li",{children:"Revoke tokens that are no longer needed"}),a.jsx("li",{children:"Use separate tokens for different applications"})]})]}),a.jsxs("div",{className:"mt-4 text-sm",children:["More details in"," ",a.jsx(Ft,{className:"underline",href:"https://docs.databricks.com/dev-tools/auth/pat.html",children:"Databricks Personal Access Tokens documentation"}),"."]})]})]})})}const ple=({form:e})=>{const[t,n]=h.useState("");return h.useEffect(()=>{if(e.getValues("config.host").length>0){const s="_".repeat(12);n(s),e.setValue("credentials.token",s,{shouldDirty:!1})}},[e]),e.watch("type")!==ce.DATABRICKS?null:a.jsxs(a.Fragment,{children:[a.jsxs(Sr,{title:"Connection Settings",children:[a.jsx(bt,{control:e.control,name:"config.host",render:({field:r})=>a.jsxs(mt,{children:[a.jsx(ut,{tooltip:"Enter your Databricks workspace URL",children:"Host"}),a.jsx(xt,{children:a.jsx(ct,{...r,placeholder:"e.g., adb-123456.7.azuredatabricks.net"})}),a.jsx(qt,{children:a.jsx(fle,{})}),a.jsx(Ct,{})]})}),a.jsx(bt,{control:e.control,name:"config.httpPath",render:({field:r})=>a.jsxs(mt,{children:[a.jsx(ut,{tooltip:"Specify the SQL warehouse HTTP path",children:"HTTP Path"}),a.jsx(xt,{children:a.jsx(ct,{...r,placeholder:"e.g., /sql/1.0/warehouses/abc123def456"})}),a.jsx(qt,{children:a.jsx(hle,{})}),a.jsx(Ct,{})]})})]}),a.jsx(Sr,{title:"Authentication",children:a.jsx(bt,{control:e.control,name:"credentials.token",render:({field:r})=>a.jsxs(mt,{children:[a.jsx(ut,{tooltip:"Your Databricks Personal Access Token",children:"Personal Access Token"}),a.jsx(xt,{children:a.jsx(ct,{...r,type:"password",placeholder:t||"Enter your token"})}),a.jsx(qt,{children:a.jsx(mle,{})}),a.jsx(Ct,{})]})})})]})},gle=()=>a.jsx(a.Fragment,{children:a.jsx($t,{variant:"common",type:"single",collapsible:!0,className:"mt-2",children:a.jsxs(jt,{value:"snowflake-setup",children:[a.jsx(Tt,{children:"How do I get started with Snowflake?"}),a.jsxs(_t,{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(Ft,{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 xle(){return a.jsx($t,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(jt,{value:"bigquery-api-details",children:[a.jsx(Tt,{children:"How do I enable the BigQuery API?"}),a.jsxs(_t,{children:[a.jsxs("p",{className:"mb-2",children:["To run queries and process data in Google BigQuery, you need to enable the"," ",a.jsx(Ft,{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 yle(){return a.jsx($t,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(jt,{value:"athena-api-details",children:[a.jsx(Tt,{children:"How do I activate Athena API?"}),a.jsxs(_t,{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(Ft,{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 vle(){return a.jsx($t,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(jt,{value:"redshift-storage-details",children:[a.jsx(Tt,{children:"What is AWS Redshift?"}),a.jsxs(_t,{children:[a.jsx("p",{className:"mb-2",children:"Amazon Redshift is a fast, fully managed cloud data warehouse that makes it simple and cost-effective to analyze data using standard SQL and existing business intelligence tools."}),a.jsx("p",{className:"mb-2",children:"Redshift supports two deployment options:"}),a.jsxs("ul",{className:"mb-2 list-inside list-disc space-y-1 text-sm",children:[a.jsxs("li",{children:[a.jsx("strong",{children:"Redshift Serverless:"})," Automatically scales compute capacity and you only pay for what you use"]}),a.jsxs("li",{children:[a.jsx("strong",{children:"Provisioned Clusters:"})," Traditional clusters where you provision and manage compute nodes"]})]}),a.jsxs("p",{className:"text-sm",children:["Learn more in the"," ",a.jsx(Ft,{className:"underline",href:"https://docs.aws.amazon.com/redshift/latest/mgmt/welcome.html",children:"AWS Redshift Documentation"}),"."]})]})]})})}function ble(){return a.jsxs("div",{className:"text-muted-foreground space-y-2 text-sm",children:[a.jsx("p",{children:"Databricks is a unified data analytics platform built on Apache Spark. It provides a lakehouse architecture that combines the best of data lakes and data warehouses."}),a.jsx("p",{children:"To connect OWOX to Databricks, you'll need your workspace URL, SQL warehouse HTTP path, and a Personal Access Token for authentication."}),a.jsxs("p",{children:["Learn more in"," ",a.jsx(Ft,{className:"underline",href:"https://docs.owox.com/docs/storages/supported-storages/databricks/",children:"OWOX Databricks documentation"}),"."]})]})}function Sle({initialData:e,onSubmit:t,onCancel:n,onDirtyChange:r}){const s=Lo({resolver:Ai(EJ),defaultValues:e}),{watch:i,control:c,formState:{isDirty:u,isSubmitting:f}}=s,m=i("type");re.useEffect(()=>{r==null||r(u)},[u,r]);const x=async g=>{const{dirtyFields:y}=s.formState,v=v5(g);return y.credentials||delete v.credentials,t(v)};return a.jsx(Ul,{...s,children:a.jsxs(Ni,{onSubmit:g=>{s.handleSubmit(x)(g)},noValidate:!0,children:[a.jsxs(zl,{children:[a.jsxs(Sr,{title:"General",children:[a.jsx(bt,{control:c,name:"title",render:({field:g})=>a.jsxs(mt,{children:[a.jsx(ut,{tooltip:"Name the storage to clarify its purpose",children:"Title"}),a.jsx(xt,{children:a.jsx(ct,{...g,placeholder:"Storage title"})}),a.jsx(Ct,{})]})}),a.jsx(bt,{control:c,name:"type",render:({field:g})=>a.jsxs(mt,{children:[a.jsx(ut,{tooltip:"The selected source will be used to process data in your Data Marts",children:"Storage Type"}),a.jsx(xt,{children:a.jsxs(oa,{value:g.value,onValueChange:g.onChange,disabled:!!e,children:[a.jsx(la,{className:"w-full",children:a.jsx(ia,{placeholder:"Select a storage type"})}),a.jsx(ca,{children:a.jsx(gy,{children:Nl.getAllTypes().map(({type:y,displayName:v,icon:C,status:S})=>a.jsx(Fn,{value:y,disabled:S===ci.COMING_SOON,children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(C,{size:20}),v]})},y))})})]})}),a.jsxs(qt,{children:[m===ce.GOOGLE_BIGQUERY&&a.jsx(xle,{}),m===ce.AWS_ATHENA&&a.jsx(yle,{}),m===ce.SNOWFLAKE&&a.jsx(gle,{}),m===ce.AWS_REDSHIFT&&a.jsx(vle,{}),m===ce.DATABRICKS&&a.jsx(ble,{})]}),a.jsx(Ct,{})]})})]}),m===ce.GOOGLE_BIGQUERY&&a.jsx(Bie,{form:s}),m===ce.AWS_ATHENA&&a.jsx(Yie,{form:s}),m===ce.SNOWFLAKE&&a.jsx(ale,{form:s}),m===ce.AWS_REDSHIFT&&a.jsx(dle,{form:s}),m===ce.DATABRICKS&&a.jsx(ple,{form:s})]}),a.jsxs(Wc,{children:[a.jsx(we,{variant:"default",type:"submit",className:"w-full","aria-label":"Save",disabled:!u||f,children:"Save"}),a.jsx(we,{variant:"outline",type:"button",onClick:n,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})}function Zc(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 CM({isOpen:e,onClose:t,dataStorage:n,onSaveSuccess:r}){const{updateDataStorage:s}=yy();Fl(e);const{showUnsavedDialog:i,setShowUnsavedDialog:c,handleClose:u,confirmClose:f,handleFormDirtyChange:m,handleFormSubmitSuccess:x}=Zc(t),g=async v=>{if(n){const C=await s(n.id,v);C&&(r(C),x())}},y=h.useRef(!1);return h.useEffect(()=>{const v=n?"Edit":"Create";e&&!y.current?(De({event:"data_storage_config_open",category:"DataStorage",action:v,label:n==null?void 0:n.type}),y.current=!0):!e&&y.current&&(De({event:"data_storage_config_close",category:"DataStorage",action:v,label:n==null?void 0:n.type}),y.current=!1)},[e,n]),a.jsxs(a.Fragment,{children:[a.jsx(Ei,{open:e,onOpenChange:v=>{v||u()},children:a.jsxs(wi,{children:[a.jsxs(Ri,{children:[a.jsx(ji,{children:"Configure Storage Provider"}),a.jsx(Rl,{children:"Customize settings for your storage provider"})]}),a.jsx(Sle,{initialData:n??void 0,onSubmit:g,onCancel:u,onDirtyChange:m})]})}),a.jsx(Ar,{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 Cle=({dataStorage:e,onDataStorageChange:t})=>{const[n,r]=h.useState(!1),s=Nl.getInfo(e.type),i=()=>{r(!0)},c=()=>{r(!1)},u=()=>{const f=n5(e);if(De({event:"data_storage_configuration_loaded",category:"DataMart",action:f?"ValidStorage":"InvalidStorage",label:e.type}),!f)return a.jsxs("div",{className:"flex items-center space-x-2 text-sm",children:[a.jsx(Oh,{className:"h-4 w-4 text-red-500"}),a.jsx("span",{className:"text-red-500",children:"Storage configuration is incomplete"})]});const m=(g,y)=>a.jsxs("span",{children:[a.jsxs("span",{className:"text-muted-foreground/75",children:[g,":"]})," ",a.jsx("span",{className:"text-muted-foreground font-medium",children:y})]}),x=(g,y,v)=>a.jsxs("span",{children:[a.jsxs("span",{className:"text-muted-foreground/75",children:[g,":"]})," ",a.jsx(Ft,{href:v,onClick:C=>{C.stopPropagation()},children:y})]});switch(e.type){case ce.GOOGLE_BIGQUERY:{const g=e.config.projectId,y=e.config.location,v=`https://console.cloud.google.com/bigquery?project=${g}`;return a.jsxs("div",{className:"flex flex-wrap gap-2",children:[x("Project ID",g,v),a.jsx("span",{className:"text-muted-foreground",children:"•"}),m("Location",y)]})}case ce.AWS_ATHENA:{const g=e.config.region,y=e.config.outputBucket,v=`https://s3.console.aws.amazon.com/s3/buckets/${y}?region=${g}`;return a.jsxs("div",{className:"flex flex-wrap gap-2",children:[m("Region",g),a.jsx("span",{className:"text-muted-foreground",children:"•"}),x("Bucket",y,v)]})}case ce.SNOWFLAKE:{const g=e.config.account,y=e.config.warehouse;return a.jsxs("div",{className:"flex flex-wrap gap-2",children:[x("Account",g,"https://app.snowflake.com/"),a.jsx("span",{className:"text-muted-foreground",children:"•"}),m("Warehouse",y)]})}case ce.AWS_REDSHIFT:{const g=e.config,y=g.region,v=g.database;let C,S;g.connectionType===fr.SERVERLESS?(C=g.workgroupName,S="Workgroup"):(C=g.clusterIdentifier,S="Cluster");const E=`https://${y}.console.aws.amazon.com/redshiftv2/home?region=${y}`;return a.jsxs("div",{className:"flex flex-wrap gap-2",children:[m("Region",y),a.jsx("span",{className:"text-muted-foreground",children:"•"}),m("Database",v),a.jsx("span",{className:"text-muted-foreground",children:"•"}),x(S,C,E)]})}case ce.DATABRICKS:{const g=e.config.host,y=e.config.httpPath,v=`https://${g}`;return a.jsxs("div",{className:"flex flex-wrap gap-2",children:[x("Host",g,v),a.jsx("span",{className:"text-muted-foreground",children:"•"}),m("HTTP Path",y)]})}default:return"Unknown storage type configuration"}};return a.jsxs(a.Fragment,{children:[a.jsx(pS,{title:e.title,icon:s.icon,subtitle:u(),onClick:i}),a.jsx(vE,{children:a.jsx(CM,{isOpen:n,onClose:c,dataStorage:e,onSaveSuccess:f=>{t&&t(f)}})})]})};function Ele({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(Ma,{className:"text-foreground",children:"Definition Type"}),a.jsxs(oa,{value:n??"",onValueChange:u=>{s(u)},children:[a.jsx(la,{className:"dm-card-formcontrol w-full","aria-label":"Definition Type",children:a.jsx(ia,{placeholder:"Select definition type",children:n&&((c=i.find(u=>u.type===n))==null?void 0:c.label)})}),a.jsx(ca,{children:a.jsx(gy,{children:i.map(u=>a.jsxs(Fn,{value:u.type,children:[u.label,a.jsx("span",{className:"text-muted-foreground/80 ml-2",children:u.description})]},u.type))})})]})]})}const wle=Yt({definitionType:or($e.SQL),definition:Yt({sqlQuery:yt().min(1,"SQL query is required")})}),Rle=e=>{const t=N5(e);return Yt({definitionType:or($e.TABLE),definition:t})},jle=e=>{const t=N5(e);return Yt({definitionType:or($e.VIEW),definition:t})},Tle=e=>{const t=Hee(e);return Yt({definitionType:or($e.TABLE_PATTERN),definition:t})},_le=Yt({definitionType:or($e.CONNECTOR),definition:Yt({connector:Yt({source:Yt({name:yt().min(1,"Connector name is required"),configuration:F1(bY(yY())).min(1,"At least one configuration is required"),node:yt().min(1,"Node is required"),fields:F1(yt()).min(1,"At least one field is required")}),storage:Yt({fullyQualifiedName:yt().min(1,"fully qualified name is required")})})})}),Nle=(e,t)=>{if(!e)return Yt({definitionType:SY(Qx($e)),definition:Yt({}).optional()});switch(e){case $e.SQL:return wle;case $e.TABLE:return Rle(t);case $e.VIEW:return jle(t);case $e.TABLE_PATTERN:return Tle(t);case $e.CONNECTOR:return _le;default:return Yt({})}};function Ale({control:e}){return a.jsx(bt,{control:e,name:"definition.sqlQuery",render:({field:t})=>a.jsxs(mt,{className:"dm-card-block",children:[a.jsx(ut,{className:"text-foreground",children:"SQL Query"}),a.jsx(xt,{children:a.jsx(Xoe,{initialValue:t.value?{sqlQuery:t.value}:void 0,onChange:n=>{t.onChange(n.sqlQuery)}})}),a.jsx(Ct,{})]})})}function Dle({control:e,storageType:t}){const n=u5(t),r=d5(t);return a.jsx(bt,{control:e,name:"definition.fullyQualifiedName",render:({field:s})=>a.jsxs(mt,{className:"dm-card-block",children:[a.jsx(ut,{children:"Fully Qualified Table Name"}),a.jsx(xt,{children:a.jsx(ct,{placeholder:n,value:s.value,onChange:s.onChange,className:"dm-card-formcontrol"})}),a.jsx(qt,{className:"text-muted-foreground/75",children:r}),a.jsx(Ct,{})]})})}function Ole({control:e,storageType:t}){const n=u5(t),r=d5(t);return a.jsx(bt,{control:e,name:"definition.fullyQualifiedName",render:({field:s})=>a.jsxs(mt,{className:"dm-card-block",children:[a.jsx(ut,{children:"Fully Qualified View Name"}),a.jsx(xt,{children:a.jsx(ct,{placeholder:n,value:s.value,onChange:s.onChange,className:"dm-card-formcontrol"})}),a.jsx(qt,{className:"text-muted-foreground/75",children:r}),a.jsx(Ct,{})]})})}function Ile({control:e,storageType:t}){const n=MJ(t),r=kJ(t);return a.jsx(bt,{control:e,name:"definition.pattern",render:({field:s})=>a.jsxs(mt,{className:"dm-card-block",children:[a.jsx(ut,{children:"Table Pattern"}),a.jsx(xt,{children:a.jsx(ct,{placeholder:n,value:s.value,onChange:s.onChange,className:"dm-card-formcontrol"})}),a.jsx(qt,{className:"text-muted-foreground/75",children:r}),a.jsx(Ct,{})]})})}const HE=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{}}},Mle=Pc("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 $E({className:e,variant:t,...n}){return a.jsx("div",{"data-slot":"alert",role:"alert",className:oe(Mle({variant:t}),e),...n})}function EM({className:e,...t}){return a.jsx("div",{"data-slot":"alert-title",className:oe("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),...t})}function VE({className:e,...t}){return a.jsx("div",{"data-slot":"alert-description",className:oe("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",e),...t})}function kle({connectors:e,selectedConnector:t,loading:n,error:r,onConnectorSelect:s,onConnectorDoubleClick:i}){return h.useEffect(()=>{De({event:"connector_setup",category:"connector_selection",action:"step",label:"Choose Connector"})},[]),n?a.jsx(jE,{variant:"grid"}):r?a.jsxs($E,{variant:"destructive",children:[a.jsx(Nh,{className:"h-4 w-4"}),a.jsx(VE,{children:"Failed to load available connectors. Please try again."})]}):a.jsxs(gi,{children:[a.jsx(mo,{title:"Choose Connector",children:a.jsx(hse,{children:e.map(c=>a.jsx(mse,{icon:c.logoBase64?a.jsx(Vc,{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(Vs,{icon:a.jsx(sh,{size:56,strokeWidth:1}),title:"No connectors available",subtitle:"Ask your administrator to configure connectors."})]})}function Lle({currentStep:e,totalSteps:t,canGoNext:n,canGoBack:r,isLoading:s=!1,onNext:i,onBack:c,onFinish:u,nextLabel:f="Next",backLabel:m="Back",finishLabel:x="Save"}){const g=e===t;return t===1?a.jsx("div",{className:"w-full",children:a.jsx(we,{className:"w-full",variant:"default",onClick:u,disabled:!n||s,children:x})}):a.jsxs("div",{className:"flex w-full items-center justify-between gap-4",children:[a.jsx("div",{className:"flex-1",children:r&&a.jsxs(we,{variant:"outline",onClick:c,disabled:s,children:[a.jsx(f4,{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(we,{variant:"default",onClick:u,disabled:!n||s,children:x}):a.jsxs(we,{variant:"default",onClick:i,disabled:!n||s,children:[f,a.jsx(ba,{className:"h-4 w-4"})]})})]})}function vc({connector:e,size:t=24,variant:n="compact"}){return a.jsx(Vs,{icon:a.jsx(Vc,{base64:e.logoBase64,size:t}),title:e.displayName,docUrl:e.docUrl,variant:n})}function nd({label:e}){return a.jsx("div",{className:"border-border text-muted-foreground mt-3 flex items-center justify-center gap-2 border-t pt-3 text-sm",children:a.jsx(we,{variant:"outline",asChild:!0,children:a.jsxs(Nr,{to:"https://github.com/OWOX/owox-data-marts/issues",target:"_blank",rel:"noopener noreferrer",children:[e," Open issue here",a.jsx(yi,{className:"h-4 w-4"})]})})})}const yS="**********";function Ple({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(ct,{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(Ma,{htmlFor:c,className:"cursor-pointer text-sm",children:a.jsx(zr,{htmlFor:c,required:e.required,tooltip:e.description,children:i})})]})}function Ule({specification:e,configuration:t,onValueChange:n}){const{name:r,placeholder:s}=e,i=e.title??e.name;return a.jsx(ct,{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 zle({specification:e,configuration:t,onValueChange:n}){const{name:r,placeholder:s,default:i}=e,c=e.title??e.name;return a.jsx(Mo,{id:r,name:r,value:Array.isArray(t[r])?t[r].join(`
|
|
831
|
+
`):Array.isArray(i)?i.join(`
|
|
832
|
+
`):"",placeholder:s??`Enter ${c.toLowerCase()} (one per line)`,rows:4,onChange:u=>{const f=u.target.value.split(`
|
|
833
|
+
`).filter(m=>m.trim());n(r,f)}})}function Fle({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 x=new Date(m);return isNaN(x.getTime())?"":x.toISOString().split("T")[0]}catch{return""}};return a.jsx(ct,{id:r,name:r,type:"date",value:t[r]||u(i)||"",placeholder:s??`Enter ${c.toLowerCase()}`,onChange:f=>{n(r,f.target.value)}})}function Hle({specification:e,configuration:t,onValueChange:n}){const{name:r,placeholder:s}=e,i=e.title??e.name;return a.jsx(ct,{id:r,name:r,type:"text",value:t[r]||"",placeholder:s??`Enter ${i.toLowerCase()}`,onChange:c=>{n(r,c.target.value)}})}function $le({specification:e,configuration:t,onValueChange:n}){const r=e.title??e.name,{name:s,placeholder:i,default:c}=e;return a.jsx(Mo,{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 Vle({specification:e,configuration:t,onValueChange:n,isEditingExisting:r,isSecretEditing:s}){const i=e.title??e.name,c=r&&!s;return a.jsx(ct,{id:e.name,...c?{}:{name:e.name},type:c?"password":"text",autoComplete:c?"new-password":"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,value:c?yS: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 Gle({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(FE,{options:f,value:t[s]||c||"",onValueChange:m=>{n(s,m)},placeholder:i??`Select ${u.toLowerCase()}`,emptyMessage:"No options available",className:"w-full"})}function Ble(){const e=h.useRef(new Zf),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 kf=null;function qle({appId:e,scope:t,onSuccess:n,onError:r,disabled:s=!1,children:i}){const[c,u]=h.useState(!1),[f,m]=h.useState(!1),[x,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(kf&&kf!==e){console.warn("Facebook SDK already initialized with different appId");return}kf??(kf=e),window.fbAsyncInit=function(){window.FB&&kf&&(window.FB.init({appId:kf,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 y=()=>{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:j,expiresIn:R,userID:T}=S.authResponse;(E=window.FB)==null||E.api("/me?fields=name,email",N=>{const A={accessToken:j,expiresIn:R,userID:T,userName:N.name,userEmail:N.email};n(A),u(!1)})}else{const j=new Error("User cancelled login or did not fully authorize");g(j.message),r==null||r(j),u(!1)}},{scope:t})},v=s||c||!f,C=()=>c?"Connecting...":i||(f?"Continue with Facebook":"Loading...");return a.jsxs("div",{className:"flex flex-col gap-2",children:[a.jsxs(we,{type:"button",onClick:y,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()]}),x&&a.jsx("div",{className:"mt-1 text-xs text-red-600",children:x})]})}function Kle({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(qle,{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 wM({specification:e,option:t,configuration:n,onValueChange:r,connectorName:s,onSecretEditToggle:i,secretEditing:c={},isEditingExisting:u=!1}){const[f,m]=h.useState(!1),[x,g]=h.useState(null),[y,v]=h.useState(null),[C,S]=h.useState(null),E=h.useMemo(()=>{const W=n[e.name],B=t!=null&&t.value&&W?W[t.value]:W;return B==null?void 0:B._source_credential_id},[n,e.name,t==null?void 0:t.value]),j=h.useMemo(()=>t?`${e.name}.${t.value}`:e.name,[e.name,t]),R=h.useMemo(()=>{const W=n[e.name];if(t!=null&&t.value&&W){const B=W[t.value];return B&&typeof B=="object"&&!Array.isArray(B)?B:{}}return W&&typeof W=="object"&&!Array.isArray(W)?W:{}},[n,e.name,t==null?void 0:t.value]),T=h.useMemo(()=>{const W=R;return"_source_credential_id"in W?!1:!!(t!=null&&t.items&&Object.keys(t.items).some(V=>V in W&&W[V]!==void 0&&W[V]!==""))},[R,t]),[N,A]=h.useState(T);h.useEffect(()=>{const W="_source_credential_id"in R,B=(t==null?void 0:t.items)&&Object.keys(t.items).some(V=>V in R&&R[V]!==void 0&&R[V]!=="");W&&N?A(!1):B&&!N&&A(!0)},[R,t,N]);const I=(W,B)=>{if(!(t!=null&&t.value))return;const V=n[e.name]&&typeof n[e.name]=="object"?n[e.name]:{};r(e.name,{...V,[t.value]:{...typeof V[t.value]=="object"&&V[t.value]!==null?V[t.value]:{},[W]:B}})},{checkStatus:_,getSettings:M,exchangeCredentials:G}=Ble(),H=async W=>{try{m(!0),S(null);const B=await G(s,W,j),V=n[e.name];t?r(e.name,{...V,[t.value]:{_source_credential_id:B.credentialId}}):r(e.name,{_source_credential_id:B.credentialId})}catch(B){const V=B instanceof Error?B.message:"Failed to exchange OAuth credentials";console.error("Failed to exchange OAuth credentials:",B),S(V)}finally{m(!1)}};h.useEffect(()=>{if(!E){g(null),m(!1);return}let W=!1;return(async()=>{try{m(!0);const V=await _(s,E);W||g(V)}catch(V){W||(console.error("Failed to validate credentials:",V),g({valid:!1}))}finally{W||m(!1)}})(),()=>{W=!0}},[E,s,_]),h.useEffect(()=>{(async()=>{try{const B=await M(s,j);v(B)}catch(B){console.error("Failed to fetch settings:",B),v(null)}})()},[s,j,M]);const L=!!(y!=null&&y.isEnabled);if((N||!L)&&(t!=null&&t.items))return a.jsxs("div",{className:"space-y-4",children:[Object.entries(t.items).map(([W,B])=>{const V=Array.isArray(B.attributes)?B.attributes.includes("SECRET")&&R[W]!==void 0:!1,D=c[e.name]??!1;return a.jsxs("div",{className:"mb-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(zr,{htmlFor:W,required:B.required,tooltip:B.description,className:"mb-2 justify-start",children:B.title??W}),V&&u&&i&&a.jsx(we,{variant:"ghost",size:"sm",type:"button",onClick:()=>{i(e.name,!D)},children:D?"Cancel":"Edit"})]}),GE({specification:{...B,name:W},configuration:R,onValueChange:(F,U)=>{I(F,U)},flags:{isEditingExisting:u,isSecret:V,isSecretEditing:D},connectorName:s})]},W)}),L&&a.jsx(we,{variant:"link",size:"sm",type:"button",onClick:()=>{r(e.name,{[t.value]:{}}),A(!1),m(!1)},className:"px-0",children:"Back to OAuth"})]});const q=(()=>{switch(s){case"FacebookMarketing":return a.jsx(Kle,{isLoading:f,status:x,settings:y,onOAuthSuccess:H});default:return null}})();return a.jsxs("div",{className:"space-y-3",children:[q,C&&a.jsx("div",{className:"text-destructive text-sm",children:C}),(t==null?void 0:t.items)&&Object.keys(t.items).length>0&&a.jsx(we,{variant:"link",size:"sm",type:"button",onClick:()=>{r(e.name,{[t.value]:{}}),A(!0)},className:"px-0",children:"Manually"})]})}function GE({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(wM,{specification:e,configuration:t,onValueChange:n,connectorName:s});if(u)return a.jsx(Vle,{specification:e,configuration:t,onValueChange:n,isEditingExisting:f,isSecretEditing:m});if(c&&c.length>0)return a.jsx(Gle,{specification:e,configuration:t,onValueChange:n,specOptions:c});switch(i){case Fs.BOOLEAN:return a.jsx(Ple,{specification:e,configuration:t,onValueChange:n});case Fs.NUMBER:return a.jsx(Ule,{specification:e,configuration:t,onValueChange:n});case Fs.ARRAY:return a.jsx(zle,{specification:e,configuration:t,onValueChange:n});case Fs.OBJECT:return a.jsx($le,{specification:e,configuration:t,onValueChange:n});case Fs.DATE:return a.jsx(Fle,{specification:e,configuration:t,onValueChange:n});case Fs.STRING:default:return a.jsx(Hle,{specification:e,configuration:t,onValueChange:n})}}function Wle({specification:e,configuration:t,isEditingExisting:n,isSecretEditing:r,isSecret:s,onValueChange:i,onSecretEditToggle:c,connectorName:u}){return a.jsxs(qa,{children:[e.requiredType!==Fs.BOOLEAN&&a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(zr,{htmlFor:e.name,required:e.required,tooltip:e.description,children:e.title??e.name}),s&&n&&a.jsx(we,{variant:"ghost",size:"sm",type:"button",onClick:()=>{c(e.name,!r)},children:r?"Cancel":"Edit"})]}),GE({specification:e,configuration:t,onValueChange:i,flags:{isSecret:s,isEditingExisting:n,isSecretEditing:r},connectorName:u})]},e.name)}function Zle({specification:e,configuration:t,onValueChange:n,isEditingExisting:r,isSecretEditing:s,onSecretEditToggle:i,connectorName:c}){const u=h.useMemo(()=>{var v,C;const y=t[e.name];if(y&&typeof y=="object"){const S=Object.keys(y);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 y=t[e.name];y&&typeof y=="object"&&f in y||n(e.name,{[f]:{}})}},[f,e.name]),!e.oneOf)return null;const x=y=>{m(y)},g=(y,v,C)=>{const S=t[e.name]&&typeof t[e.name]=="object"?t[e.name]:{};n(e.name,{[y]:{...typeof S[y]=="object"&&S[y]!==null?S[y]:{},[v]:C}})};return a.jsx(fse,{label:e.title??e.name,options:e.oneOf.map(y=>({value:y.value,label:y.label})),value:f,onValueChange:x,children:e.oneOf.map(y=>{const v=y.attributes&&Array.isArray(y.attributes)&&y.attributes.includes("OAUTH_FLOW");return a.jsx(ese,{value:y.value,children:v?a.jsx(wM,{specification:e,option:y,configuration:t,onValueChange:n,connectorName:c,onSecretEditToggle:i,secretEditing:{[e.name]:s},isEditingExisting:r}):Object.entries(y.items).map(([C,S])=>{const E=t[e.name]&&typeof t[e.name]=="object"?t[e.name]:{},j=Array.isArray(S.attributes)&&Object.keys(E)[0]===y.value?S.attributes.includes("SECRET"):!1,R=typeof t[e.name]=="object"&&t[e.name]!==null?t[e.name]:{},T=typeof R[y.value]=="object"&&R[y.value]!==null?R[y.value]:{};return a.jsxs("div",{className:"mb-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(zr,{htmlFor:C,required:S.required,tooltip:S.description,className:"mb-2 justify-start",children:C}),j&&r&&a.jsx(we,{variant:"ghost",size:"sm",type:"button",onClick:()=>{i(e.name,!s)},children:s?"Cancel":"Edit"})]}),GE({specification:{...S,name:C},configuration:T,onValueChange:(N,A)=>{g(y.value,N,A)},flags:{isEditingExisting:r,isSecret:j,isSecretEditing:s},connectorName:c})]},C)})},y.value)})},e.name)}function MN(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===Fs.OBJECT?a.jsx(Zle,{specification:u,configuration:t,onValueChange:n,isEditingExisting:i,isSecretEditing:m,onSecretEditToggle:r,connectorName:c},u.name):a.jsx(Wle,{specification:u,configuration:t,isEditingExisting:i,isSecret:f,isSecretEditing:m,onValueChange:n,onSecretEditToggle:r,connectorName:c},u.name)})}function kN({collapsibleTitle:e,items:t,configuration:n,onValueChange:r,onSecretEditToggle:s,secretEditing:i,isEditingExisting:c,connectorName:u}){return e?a.jsx(D6,{title:e,children:MN(t,n,r,s,i,c,u)}):MN(t,n,r,s,i,c,u)}function Yle({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 y=await Tn.getDataMartsByConnectorName(e);s(y)}catch{s([])}finally{c(!1)}},[e]);h.useEffect(()=>{u&&m()},[u,m]);const x=(y,v)=>{const C=v._id;if(!C){console.error("Configuration does not have _id field");return}t({dataMartId:y.id,dataMartTitle:y.title,configId:C,configuration:v}),f(!1)},g=y=>{const C=[],S=j=>{if(!n)return!0;const R=n.find(T=>T.name===j);return(R==null?void 0:R.required)??!1},E=(j,R,T=0,N=!0)=>{if(j.startsWith("_")||N&&T===0&&!S(j))return;let A=null;if(R==null)A="N/A";else if(typeof R=="string")A=R;else if(typeof R=="number"||typeof R=="boolean")A=String(R);else if(Array.isArray(R))A=JSON.stringify(R);else if(typeof R=="object"){C.push({key:j,value:"{",indent:T}),Object.entries(R).forEach(([I,_])=>{E(I,_,T+1,!1)}),C.push({key:"",value:"}",indent:T});return}else A=JSON.stringify(R);C.push({key:j,value:A,indent:T})};for(const[j,R]of Object.entries(y))E(j,R);return a.jsx("div",{className:"space-y-1 font-mono text-xs",children:C.map(({key:j,value:R,indent:T},N)=>a.jsxs("div",{className:"flex gap-2",style:{paddingLeft:`${String(T*12)}px`},children:[j&&a.jsxs("span",{className:"font-medium",children:[j,":"]}),a.jsx("span",{className:"text-muted-foreground truncate",title:R,children:R})]},N))})};return a.jsx(ga,{children:a.jsxs(Or,{open:u,onOpenChange:f,children:[a.jsx(Ir,{asChild:!0,children:a.jsxs(we,{type:"button",variant:"ghost",size:"sm",className:"cursor-pointer",children:[a.jsx("span",{className:"text-muted-foreground/75 text-xs font-semibold tracking-wide uppercase",children:"Copy from…"}),a.jsx(ba,{className:oe("text-foreground/75 h-3.5 w-3.5 transition-transform duration-200",u&&"rotate-90")})]})}),a.jsx(Mr,{side:"bottom",align:"end",className:"w-72",children:i?a.jsx(Ut,{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(hF,{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(y=>{const C=y.definition.connector.source.configuration;return C.length===0?null:C.length===1?a.jsxs(rt,{delayDuration:300,children:[a.jsx(at,{asChild:!0,children:a.jsxs(Ut,{onSelect:()=>{x(y,C[0])},children:[a.jsx(_g,{className:"text-foreground h-4 w-4"}),y.title]})}),a.jsx(st,{side:"right",className:"max-w-sm",children:g(C[0])})]},y.id):a.jsxs(Vx,{children:[a.jsxs(Gx,{className:"flex items-center gap-2",children:[a.jsx(_g,{className:"text-foreground h-4 w-4"}),a.jsx("span",{children:y.title})]}),a.jsx(Bx,{children:C.map((S,E)=>a.jsxs(rt,{delayDuration:300,children:[a.jsx(at,{asChild:!0,children:a.jsxs(Ut,{onSelect:()=>{x(y,S)},children:["Configuration ",E+1]})}),a.jsx(st,{side:"right",className:"max-w-sm",children:g(S)})]},E))})]},y.id)})})]})})]})})}function LN({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),x=h.useRef(!1),[g,y]=h.useState({});h.useEffect(()=>{De({event:"connector_setup",category:e.name,action:"connector_selected",label:e.displayName})},[e]),h.useEffect(()=>{if(t){x.current=!0;const I={...s??{}};t.forEach(_=>{const M=Array.isArray(_.attributes)?_.attributes.includes("SECRET"):!1;I[_.name]===void 0&&_.default!==void 0&&(I[_.name]=_.default),c&&M&&(I[_.name]=yS)}),f(I),m.current=!0,setTimeout(()=>{x.current=!1},0)}},[t,s,c]),h.useEffect(()=>{m.current&&s&&Object.keys(s).length>0&&(x.current=!0,f({...s}),setTimeout(()=>{x.current=!1},0))},[s]),h.useEffect(()=>{m.current&&!x.current&&Object.keys(u).length>0&&(n==null||n(u))},[u,n]);const v=(I,_)=>{f(M=>({...M,[I]:_}))},C=h.useCallback(I=>!(I==null||typeof I=="string"&&I.trim()===""||typeof I=="number"&&isNaN(I)||Array.isArray(I)&&I.length===0),[]),S=h.useCallback((I,_)=>{var G,H;if(typeof I!="object"||I===null)return C(I);if((G=_.attributes)!=null&&G.includes("OAUTH_FLOW")&&"_source_credential_id"in I)return!0;const M=(H=_.oneOf)==null?void 0:H.filter(L=>L.value===Object.keys(I)[0]);return M?M.every(L=>{var q;if((q=L.attributes)!=null&&q.includes("OAUTH_FLOW")){const W=I[L.value];if(typeof W=="object"&&W!==null){if("_source_credential_id"in W)return!0;const B=Object.entries(L.items).filter(([,V])=>V.required);if(B.length>0)return B.every(([V])=>{const D=W[V];return C(D)})}return!1}return Object.entries(L.items).every(([,W])=>L.value in I?S(I[L.value],W):!1)}):C(I[_.name])},[C]),E=h.useCallback((I,_)=>{const M=_.filter(q=>q.required&&q.oneOf),G=M.length===0?!0:M.some(q=>S(I[q.name],q)),L=_.filter(q=>q.required&&q.name!=="Fields").every(q=>C(I[q.name]));return G&&L},[C,S]),j=(I,_)=>{y(M=>({...M,[I]:_})),f(_?M=>({...M,[I]:""}):M=>({...M,[I]:yS}))},R=I=>{const _={...u};Object.entries(I.configuration).forEach(([M,G])=>{["_id","_copiedFrom"].includes(M)||(_[M]=G)}),_._copiedFrom={dataMartId:I.dataMartId,dataMartTitle:I.dataMartTitle,configId:I.configId},f(_)};if(h.useEffect(()=>{if(t&&r){const I=E(u,t);r(I)}},[u,t,r,E]),i)return a.jsx(jE,{variant:"list"});if(!t||t.length===0)return a.jsxs(gi,{children:[a.jsx(vc,{connector:e}),a.jsx(Vs,{icon:a.jsx(sh,{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(nd,{label:"Need configuration?"})]});const T=[...t].filter(I=>{var _;return I.name!=="Fields"&&!((_=I.attributes)!=null&&_.includes("HIDE_IN_CONFIG_FORM"))}).sort((I,_)=>{const M=G=>{const H=G.default!=null&&G.default!=="";return G.required&&!H?1:G.required&&H?2:!G.required&&!H?3:4};return M(I)-M(_)}),N=T.filter(I=>{var _;return!((_=I.attributes)!=null&&_.includes("ADVANCED"))}),A=T.filter(I=>{var _;return(_=I.attributes)==null?void 0:_.includes("ADVANCED")});return a.jsx(a.Fragment,{children:a.jsxs(gi,{children:[a.jsx(vc,{connector:e}),a.jsxs(mo,{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(Yle,{currentConnectorName:e.name,onCopyConfiguration:R,connectorSpecification:t})]}),N.length>0&&a.jsx(kN,{items:N,configuration:u,onValueChange:v,onSecretEditToggle:j,secretEditing:g,isEditingExisting:c,connectorName:e.name}),A.length>0&&a.jsx(kN,{collapsibleTitle:"Advanced Settings",items:A,configuration:u,onValueChange:v,onSecretEditToggle:j,secretEditing:g,isEditingExisting:c,connectorName:e.name})]})]})})}function Xle({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(jE,{variant:"list"}):!t||t.length===0?a.jsxs(gi,{children:[a.jsx(vc,{connector:e}),a.jsx(Vs,{icon:a.jsx(sh,{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(nd,{label:"Missing some data?"})]}):a.jsxs(gi,{children:[a.jsx(vc,{connector:e}),a.jsxs(mo,{title:c,children:[a.jsx(O6,{children:t.map(u=>a.jsx(I6,{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(Nr,{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(ba,{className:"h-3 w-3"})]})]}),selected:n===u.name},u.name))}),a.jsx(nd,{label:"Missing some data?"})]})]})}var ho=(e=>(e.ASC="asc",e.DESC="desc",e.ORIGINAL="original",e))(ho||{});function PN({connector:e,connectorFields:t,selectedField:n,selectedFields:r,onFieldToggle:s,onSelectAllFields:i}){const c=h.useRef(null),[u,f]=h.useState(""),[m,x]=h.useState(ho.ORIGINAL),g=t==null?void 0:t.find(R=>R.name===n),y=h.useMemo(()=>(g==null?void 0:g.fields)??[],[g==null?void 0:g.fields]),v=h.useMemo(()=>(g==null?void 0:g.uniqueKeys)??[],[g==null?void 0:g.uniqueKeys]),C=h.useMemo(()=>{const R=new Map;return y.forEach((T,N)=>R.set(T.name,N)),R},[y]),S=h.useMemo(()=>{const R=y.filter(N=>N.name.toLowerCase().includes(u.toLowerCase().trim())),T=(N,A)=>{const I=v.includes(N.name),_=v.includes(A.name);if(I&&!_)return-1;if(!I&&_)return 1;if(m===ho.ASC)return N.name.localeCompare(A.name);if(m===ho.DESC)return A.name.localeCompare(N.name);const M=C.get(N.name)??0,G=C.get(A.name)??0;return M-G};return[...R].sort(T)},[y,u,v,m,C]),E=y.map(R=>R.name),j=r.filter(R=>E.includes(R)).length;return h.useEffect(()=>{const R=new Set(y.map(_=>_.name)),T=new Set(r),N=new Set(v),A=new Set;if(v.forEach(_=>{R.has(_)&&!T.has(_)&&A.add(_)}),r.some(_=>!N.has(_))||((g==null?void 0:g.defaultFields)??[]).forEach(M=>{R.has(M)&&!T.has(M)&&A.add(M)}),A.size>0){const _=Array.from(A);i(_,!0)}},[y,v,r,g,i]),h.useEffect(()=>{const R=T=>{const A=(T.ctrlKey||T.metaKey)&&T.shiftKey&&T.key.toLowerCase()==="a",I=document.activeElement.tagName;if(!(I==="INPUT"||I==="TEXTAREA")&&A){T.preventDefault();const _=y.map(H=>H.name),G=_.filter(H=>!r.includes(H)).length>0;i(_,G)}};return window.addEventListener("keydown",R),()=>{window.removeEventListener("keydown",R)}},[y,r,s,i]),!n||!t?a.jsxs(gi,{children:[a.jsx(vc,{connector:e}),a.jsx(Vs,{icon:a.jsx(sh,{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(nd,{label:"Need fields?"})]}):y.length?a.jsx(gi,{children:a.jsxs(a.Fragment,{children:[a.jsx(vc,{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(zc,{className:"text-muted-foreground absolute top-1/2 left-3 h-4 w-4 -translate-y-1/2 cursor-text",onClick:()=>{var R;(R=c.current)==null||R.focus()}}),a.jsx("input",{ref:c,type:"text",placeholder:"Search field",value:u,onChange:R=>{f(R.target.value)},className:"h-12 w-full rounded-none border-0 pl-9 text-sm outline-none"}),u&&a.jsx("button",{type:"button",onClick:()=>{f("")},className:"text-muted-foreground hover:text-foreground absolute top-1/2 right-0 -translate-y-1/2",children:a.jsx(Cc,{className:"h-4 w-4"})})]}),a.jsxs(Or,{children:[a.jsx(Ir,{asChild:!0,children:a.jsxs(we,{variant:"ghost",size:"icon","aria-label":"Sort fields",children:[m===ho.ASC&&a.jsx(LT,{className:"text-muted-foreground h-4 w-4"}),m===ho.DESC&&a.jsx(kT,{className:"text-muted-foreground h-4 w-4"}),m===ho.ORIGINAL&&a.jsx(PT,{className:"text-muted-foreground h-4 w-4"})]})}),a.jsxs(Mr,{align:"end",children:[a.jsxs(Ut,{onSelect:()=>{x(ho.ASC)},children:[a.jsx(LT,{className:"text-muted-foreground mr-2 h-4 w-4"}),"A–Z"]}),a.jsxs(Ut,{onSelect:()=>{x(ho.DESC)},children:[a.jsx(kT,{className:"text-muted-foreground mr-2 h-4 w-4"}),"Z–A"]}),a.jsxs(Ut,{onSelect:()=>{x(ho.ORIGINAL)},children:[a.jsx(PT,{className:"text-muted-foreground mr-2 h-4 w-4"}),"Original"]})]})]})]}),a.jsxs(mo,{title:`Selected ${String(j)} of ${String(E.length)} fields for "${n}" data`,children:[a.jsxs(O6,{children:[S.map(R=>{const T=v.includes(R.name);return a.jsx(I6,{type:"checkbox",id:`field-${R.name}`,name:"selectedFields",value:R.name,checked:r.includes(R.name),selected:r.includes(R.name)||T,disabled:T,onChange:N=>{s(R.name,N)},label:R.name,tooltip:a.jsxs("div",{className:"flex flex-col gap-2 py-1",children:[T&&a.jsxs("p",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"font-semibold",children:"Unique key"})," ",a.jsx(y1,{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:T?a.jsx(y1,{className:"text-muted-foreground/75 h-4 w-4"}):void 0},R.name)}),S.length===0&&u&&a.jsxs("div",{className:"text-muted-foreground p-8 text-center text-sm",children:['No fields match "',u,'"']})]}),a.jsx(nd,{label:"Need another field?"})]})]})}):a.jsxs(gi,{children:[a.jsx(vc,{connector:e}),a.jsx(Vs,{icon:a.jsx(sh,{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(nd,{label:"Need fields?"})]})}const RM=h.createContext(void 0),jM={triggers:[],selectedTrigger:null,isLoading:!1,error:null};function Qle(e,t){var n,r;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(s=>s.id===t.payload.id?t.payload:s),selectedTrigger:((n=e.selectedTrigger)==null?void 0:n.id)===t.payload.id?t.payload:e.selectedTrigger,isLoading:!1};case"DELETE_TRIGGER_SUCCESS":return{...e,triggers:e.triggers.filter(s=>s.id!==t.payload),selectedTrigger:((r=e.selectedTrigger)==null?void 0:r.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 jM;default:return e}}class Jle extends _l{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 po=new Jle;var zn=(e=>(e.REPORT_RUN="REPORT_RUN",e.CONNECTOR_RUN="CONNECTOR_RUN",e))(zn||{});const hl={SCHEDULED_REPORT_RUN:"scheduled-report-run-config"};class vS{mapFromDto(t){return{id:t.id,type:t.type,cronExpression:t.cronExpression,timeZone:t.timeZone,isActive:t.isActive,nextRun:t.nextRunTimestamp?new Date(t.nextRunTimestamp):null,lastRun:t.lastRunTimestamp?new Date(t.lastRunTimestamp):null,triggerConfig:t.triggerConfig,createdById:t.createdById,createdAt:new Date(t.createdAt),modifiedAt:new Date(t.modifiedAt)}}async enhanceWithReportData(t){if(t.type!==zn.REPORT_RUN)return t;const n=t.triggerConfig;if(!n.reportId)return t;try{const r=await ii.getReportById(n.reportId),s=uc(r);return{...t,triggerConfig:{...n,report:s}}}catch(r){return console.error(`Failed to fetch report data for trigger ${t.id}:`,r),t}}async enhanceTriggersWithReportData(t){return Promise.all(t.map(n=>this.enhanceWithReportData(n)))}mapToCreateRequest(t){return{type:zn.REPORT_RUN,cronExpression:t.cronExpression,timeZone:t.timeZone,isActive:t.isActive,triggerConfig:t.triggerConfig}}mapToUpdateRequest(t){return{cronExpression:t.cronExpression,timeZone:t.timeZone,isActive:t.isActive}}}class ece{mapFromDto(t){return{id:t.id,type:t.type,cronExpression:t.cronExpression,timeZone:t.timeZone,isActive:t.isActive,nextRun:t.nextRunTimestamp?new Date(t.nextRunTimestamp):null,lastRun:t.lastRunTimestamp?new Date(t.lastRunTimestamp):null,triggerConfig:t.triggerConfig,createdById:t.createdById,createdAt:new Date(t.createdAt),modifiedAt:new Date(t.modifiedAt)}}mapToCreateRequest(t){return{type:zn.CONNECTOR_RUN,cronExpression:t.cronExpression,timeZone:t.timeZone,isActive:t.isActive,triggerConfig:t.triggerConfig}}mapToUpdateRequest(t){return{cronExpression:t.cronExpression,timeZone:t.timeZone,isActive:t.isActive}}}const Zb={getMapper(e){switch(e){case zn.REPORT_RUN:return new vS;case zn.CONNECTOR_RUN:return new ece;default:throw new Error(`Unknown scheduled trigger type: ${String(e)}`)}}},Lf={mapFromDto(e){return Zb.getMapper(e.type).mapFromDto(e)},mapFromDtoList(e){return e.map(t=>this.mapFromDto(t))},async mapFromDtoWithReportData(e,t){const n=this.mapFromDto(e);switch(n.type){case zn.REPORT_RUN:return new vS().enhanceWithReportData(n);case zn.CONNECTOR_RUN:{const r=t.definition;return{...n,triggerConfig:{...n.triggerConfig,connector:r}}}default:return n}},async mapFromDtoListWithReportData(e,t){const n=new vS,r=this.mapFromDtoList(e),s=r.filter(c=>c.type===zn.REPORT_RUN),i=await n.enhanceTriggersWithReportData(s);return r.map(c=>{switch(c.type){case zn.REPORT_RUN:return i.find(u=>u.id===c.id)??c;case zn.CONNECTOR_RUN:{const u=t.definition;return{...c,triggerConfig:{...c.triggerConfig,connector:u}}}default:return c}})},mapToCreateRequest(e){return Zb.getMapper(e.type).mapToCreateRequest(e)},mapToUpdateRequest(e){return Zb.getMapper(e.type).mapToUpdateRequest(e)}};function tce({children:e}){const[t,n]=h.useReducer(Qle,jM),{dataMart:r}=to(),{fetchAvailableConnectors:s}=Kc();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 po.getScheduledTriggers(v),S=await Lf.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}),De({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 po.getScheduledTriggers(v)).filter(R=>R.type===C),j=await Lf.mapFromDtoListWithReportData(E,r);n({type:"FETCH_TRIGGERS_SUCCESS",payload:j})}catch(S){const E=S instanceof Error?S.message:"Failed to fetch scheduled triggers";n({type:"FETCH_TRIGGERS_ERROR",payload:E}),De({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 po.getScheduledTrigger(v,C),E=await Lf.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}),De({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"GetError",label:E})}},[r]),f=h.useCallback(async(v,C,S,E,j,R)=>{n({type:"CREATE_TRIGGER_START"});try{const T={type:C,cronExpression:S,timeZone:E,isActive:j,triggerConfig:R},N=await po.createScheduledTrigger(v,T),A=await Lf.mapFromDtoWithReportData(N,r);return n({type:"CREATE_TRIGGER_SUCCESS",payload:A}),De({event:"scheduled_trigger_created",category:"ScheduledTrigger",action:"Create",label:C}),In.success("Trigger created"),A}catch(T){const N=T instanceof Error?T.message:"Failed to create scheduled trigger";throw n({type:"CREATE_TRIGGER_ERROR",payload:N}),De({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"CreateError",label:N}),T}},[r]),m=h.useCallback(async(v,C,S,E,j)=>{n({type:"UPDATE_TRIGGER_START"});try{const R={cronExpression:S,timeZone:E,isActive:j},T=await po.updateScheduledTrigger(v,C,R),N=await Lf.mapFromDtoWithReportData(T,r);n({type:"UPDATE_TRIGGER_SUCCESS",payload:N}),De({event:"scheduled_trigger_updated",category:"ScheduledTrigger",action:"Update",label:N.type}),In.success("Trigger updated")}catch(R){const T=R instanceof Error?R.message:"Failed to update scheduled trigger";throw n({type:"UPDATE_TRIGGER_ERROR",payload:T}),De({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"UpdateError",label:T}),R}},[r]),x=h.useCallback(async(v,C)=>{n({type:"DELETE_TRIGGER_START"});try{await po.deleteScheduledTrigger(v,C),n({type:"DELETE_TRIGGER_SUCCESS",payload:C}),De({event:"scheduled_trigger_deleted",category:"ScheduledTrigger",action:"Delete",label:C}),In.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}),De({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"DeleteError",label:E}),S}},[]),g=h.useCallback(v=>{n({type:"SELECT_TRIGGER",payload:v})},[]),y=h.useCallback(()=>{n({type:"RESET"})},[]);return a.jsx(RM.Provider,{value:{...t,getScheduledTriggers:i,getScheduledTriggersByType:c,getScheduledTrigger:u,createScheduledTrigger:f,updateScheduledTrigger:m,deleteScheduledTrigger:x,selectScheduledTrigger:g,reset:y},children:e})}function TM(){const e=h.useContext(RM);if(e===void 0)throw new Error("useScheduledTriggerContext must be used within a ScheduledTriggerProvider");return e}function nce(e){const{getScheduledTriggers:t,getScheduledTriggersByType:n,getScheduledTrigger:r,createScheduledTrigger:s,updateScheduledTrigger:i,deleteScheduledTrigger:c,selectScheduledTrigger:u,reset:f,triggers:m,selectedTrigger:x,isLoading:g,error:y}=TM();return h.useEffect(()=>(e?t(e):f(),()=>{f()}),[e,t,f]),{triggers:m,selectedTrigger:x,isLoading:g,error:y,getScheduledTriggers:v=>t(v),getScheduledTriggersByType:(v,C)=>n(v,C),getScheduledTrigger:(v,C)=>r(v,C),createScheduledTrigger:(v,C,S,E,j,R)=>s(v,C,S,E,j,R),updateScheduledTrigger:(v,C,S,E,j)=>i(v,C,S,E,j),deleteScheduledTrigger:(v,C)=>c(v,C),selectScheduledTrigger:u}}const rce=Yt({type:or(hl.SCHEDULED_REPORT_RUN),reportId:yt().min(1,"Report ID is required")}),ace=xY(),sce=Yt({type:Qx(zn),cronExpression:yt().min(1,"Cron expression is required"),timeZone:yt().min(1,"Time zone is required"),isActive:gY(),triggerConfig:vY([rce,ace])});function oce({initialData:e,preSelectedReportId:t,preSelectedType:n,onSubmit:r}){const s=Lo({resolver:Ai(sce),defaultValues:{type:e?e.type:n??zn.REPORT_RUN,cronExpression:(e==null?void 0:e.cronExpression)??"",timeZone:(e==null?void 0:e.timeZone)??Intl.DateTimeFormat().resolvedOptions().timeZone,isActive:(e==null?void 0:e.isActive)??!0,triggerConfig:e?e.triggerConfig:{type:hl.SCHEDULED_REPORT_RUN,reportId:t??""}}});h.useEffect(()=>{t&&s.getValues("type")===zn.REPORT_RUN&&s.setValue("triggerConfig",{type:hl.SCHEDULED_REPORT_RUN,reportId:t})},[t,s]),h.useEffect(()=>{n&&(s.setValue("type",n),n===zn.REPORT_RUN?s.setValue("triggerConfig",{type:hl.SCHEDULED_REPORT_RUN,reportId:t??""}):s.setValue("triggerConfig",null))},[n,t,s]);const i=u=>{s.setValue("type",u),u===zn.REPORT_RUN?s.setValue("triggerConfig",{type:hl.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 ice=[Ie.GOOGLE_SHEETS,Ie.EMAIL,Ie.SLACK,Ie.MS_TEAMS,Ie.GOOGLE_CHAT];function lce({value:e,onChange:t,disabled:n}){const{reports:r,fetchReportsByDataMartId:s}=is(),{dataMart:i}=to();h.useEffect(()=>{i&&s(i.id)},[s,i]);const c=r.filter(u=>ice.includes(u.dataDestination.type));return a.jsxs(oa,{value:e,onValueChange:t,disabled:n,children:[a.jsx(la,{className:"w-full",children:a.jsx(ia,{placeholder:"Select a report"})}),a.jsx(ca,{children:c.map(u=>{const f=ha.getInfo(u.dataDestination.type).icon;return a.jsx(Fn,{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 _y="Switch",[cce]=Dr(_y),[uce,dce]=cce(_y),_M=h.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:i,required:c,disabled:u,value:f="on",onCheckedChange:m,form:x,...g}=e,[y,v]=h.useState(null),C=Rt(t,T=>v(T)),S=h.useRef(!1),E=y?x||!!y.closest("form"):!0,[j,R]=ya({prop:s,defaultProp:i??!1,onChange:m,caller:_y});return a.jsxs(uce,{scope:n,checked:j,disabled:u,children:[a.jsx(tt.button,{type:"button",role:"switch","aria-checked":j,"aria-required":c,"data-state":OM(j),"data-disabled":u?"":void 0,disabled:u,value:f,...g,ref:C,onClick:Me(e.onClick,T=>{R(N=>!N),E&&(S.current=T.isPropagationStopped(),S.current||T.stopPropagation())})}),E&&a.jsx(DM,{control:y,bubbles:!S.current,name:r,value:f,checked:j,required:c,disabled:u,form:x,style:{transform:"translateX(-100%)"}})]})});_M.displayName=_y;var NM="SwitchThumb",AM=h.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,s=dce(NM,n);return a.jsx(tt.span,{"data-state":OM(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t})});AM.displayName=NM;var fce="SwitchBubbleInput",DM=h.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...s},i)=>{const c=h.useRef(null),u=Rt(c,i),f=ZC(n),m=fC(t);return h.useEffect(()=>{const x=c.current;if(!x)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(x,n),x.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}})});DM.displayName=fce;function OM(e){return e?"checked":"unchecked"}var hce=_M,mce=AM;function BE({className:e,...t}){return a.jsx(hce,{"data-slot":"switch",className:oe("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 dark:data-[state=unchecked]:bg-white/16",e),...t,children:a.jsx(mce,{"data-slot":"switch-thumb",className:oe("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}function pce(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 bS(e,t="UTC"){const n=pce(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),x=!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:x,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(y=>Number.parseInt(y.trim())).filter(y=>!isNaN(y)&&y>=0&&y<=6);if(g.length>0)return{type:"weekly",time:x,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(y=>Number.parseInt(y.trim())).filter(y=>!isNaN(y)&&y>=1&&y<=31);if(g.length>0)return{type:"monthly",time:x,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 IM({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 y=t.includes(g)?t.filter(v=>v!==g):[...t,g].sort((v,C)=>v-C);n(y)},m=(g,y)=>{y.preventDefault(),y.stopPropagation(),n(t.filter(v=>v!==g))},x=()=>{if(t.length===0)return a.jsx("span",{className:"text-muted-foreground text-sm",children:r});const g=t.map(y=>e.find(v=>v.value===y)).filter(Boolean);return g.length<=i?a.jsx("div",{className:"flex flex-wrap gap-1",children:g.map(y=>a.jsxs(jr,{variant:"secondary",className:"h-5 text-xs",children:[y.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(y.value,v),children:a.jsx(Cc,{className:"h-2 w-2"})})]},y.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:y=>m(g[0].value,y),children:a.jsx(Cc,{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(PE,{open:c,onOpenChange:u,modal:!0,children:[a.jsx(UE,{asChild:!0,children:a.jsxs(we,{variant:"outline",role:"combobox","aria-expanded":c,className:"h-9 min-h-9 w-full justify-between bg-transparent py-1",children:[a.jsx("div",{className:"flex-1 text-left",children:x()}),a.jsx(ZS,{className:"ml-2 h-3 w-3 shrink-0 opacity-50"})]})}),a.jsx(zE,{className:"max-h-[400px] w-full overflow-y-auto p-0",style:{padding:0},children:a.jsxs(IE,{className:"h-full overflow-visible",children:[a.jsx(ME,{placeholder:s,className:"h-8"}),a.jsxs(cM,{className:"h-full max-h-[350px] overflow-y-auto",children:[a.jsx(uM,{children:"No items found."}),a.jsx(dM,{className:"h-full overflow-visible",children:e.map(g=>a.jsxs(kE,{value:g.value.toString(),onSelect:()=>f(g.value),className:"text-sm",children:[a.jsx(Ia,{className:oe("mr-2 h-3 w-3",t.includes(g.value)?"opacity-100":"opacity-0")}),g.label]},g.value))})]})]})})]})}const MM=[{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"}],sg=()=>{try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return"UTC"}};function kM(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=MM.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 gce(e,t,n=!0){const r=bS(e,t);return kM(r,n)}const xce=Array.from({length:31},(e,t)=>({value:t+1,label:`${String(t+1)}${t===0?"st":t===1?"nd":t===2?"rd":"th"}`})),SS=[5,10,15,30],CS=[1,2,3,4,6,8,12],yce=({value:e,onChange:t,disabled:n})=>a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ma,{children:"Type"}),a.jsxs(oa,{value:e,onValueChange:r=>{t(r)},disabled:n,children:[a.jsx(la,{className:"w-full",children:a.jsx(ia,{})}),a.jsxs(ca,{children:[a.jsx(Fn,{value:"daily",children:"Daily"}),a.jsx(Fn,{value:"weekly",children:"Weekly"}),a.jsx(Fn,{value:"monthly",children:"Monthly"}),a.jsx(Fn,{value:"interval",children:"Interval"})]})]})]}),vce=({value:e,onChange:t,disabled:n})=>a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ma,{children:"Time"}),a.jsx("div",{className:"flex items-center gap-2",children:a.jsx(ct,{className:"w-24",type:"time",value:e,onChange:r=>{t(r.target.value)},disabled:n})})]}),UN=({value:e,onChange:t,disabled:n,timezones:r})=>a.jsxs("div",{className:"w-full space-y-2",children:[a.jsx(Ma,{children:"Timezone"}),a.jsx("div",{className:"flex items-center gap-2",children:a.jsx(FE,{options:r,value:e,onValueChange:t,placeholder:"Select timezone",emptyMessage:"No timezones found",disabled:n,className:"w-full"})})]}),bce=({value:e,onChange:t,disabled:n})=>a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ma,{children:"Days of Week"}),a.jsx("div",{className:n?"pointer-events-none":"",children:a.jsx(IM,{options:MM,selected:e,onSelectionChange:t,placeholder:"Select days...",maxDisplayItems:3})})]}),Sce=({value:e,onChange:t,disabled:n})=>a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ma,{children:"Days of Month"}),a.jsx("div",{className:n?"pointer-events-none":"",children:a.jsx(IM,{options:xce,selected:e,onSelectionChange:t,placeholder:"Select days...",maxDisplayItems:4})})]}),Cce=({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(Ma,{children:"Type"}),a.jsxs(oa,{value:e,onValueChange:i=>{n(i)},disabled:s,children:[a.jsx(la,{className:"w-full",children:a.jsx(ia,{})}),a.jsxs(ca,{children:[a.jsx(Fn,{value:"minutes",children:"Minutes"}),a.jsx(Fn,{value:"hours",children:"Hours"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ma,{children:"Every"}),a.jsxs(oa,{value:t.toString(),onValueChange:i=>{r(Number.parseInt(i)||1)},disabled:s,children:[a.jsx(la,{className:"w-full",children:a.jsx(ia,{})}),a.jsx(ca,{children:(e==="minutes"?SS:CS).map(i=>a.jsxs(Fn,{value:i.toString(),children:[i," ",e==="minutes"?"min":"hr"]},i))})]})]})]}),Ece=({value:e,onChange:t,disabled:n})=>a.jsxs("div",{className:"space-y-1",children:[a.jsx(Ma,{className:"text-sm",children:"Cron Expression"}),a.jsx(ct,{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 ES({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),[x,g]=h.useState(t??sg()),[y,v]=h.useState(!1),C=h.useMemo(()=>JX.getTimezonesWithOffset().map(V=>({value:V.identifier,label:V.displayName,offset:V.offsetString,isDST:V.isDST})),[]),[S,E]=h.useState(()=>bS(e,x)),[j,R]=h.useState(""),[T,N]=h.useState("");h.useEffect(()=>{m(n)},[n]),h.useEffect(()=>{const V=t??sg();g(V)},[t]),h.useEffect(()=>{if(e){const V=bS(e,x);E(V)}},[e,x]);const A=V=>{const[D,F]=V.time.split(":").map(Number);switch(V.type){case"daily":return`${String(F)} ${String(D)} * * *`;case"weekly":return`${String(F)} ${String(D)} * * ${V.weekdays.join(",")}`;case"monthly":return`${String(F)} ${String(D)} ${V.monthDays.join(",")} * *`;case"interval":return V.intervalType==="minutes"?`*/${String(V.intervalValue)} * * * *`:`0 */${String(V.intervalValue)} * * *`;case"custom":return V.customCron;default:return`${String(F)} ${String(D)} * * *`}},I=h.useCallback(V=>{E(D=>{if(D.intervalType===V)return console.log("Type unchanged, skipping update"),D;const U=(V==="minutes"?SS:CS)[0];return{...D,intervalType:V,intervalValue:U}})},[]),_=h.useCallback(V=>{E(D=>(D.intervalType==="minutes"?SS:CS).includes(V)?{...D,intervalValue:V}:D)},[]),M=h.useMemo(()=>V=>kM(V,f),[f]);h.useEffect(()=>{const V=A(S);R(V),N(M(S))},[S,f,x,M]);const G=h.useRef(""),H=h.useRef(""),L=h.useRef(!1);h.useEffect(()=>{const V=A(S);r&&(G.current!==V||H.current!==x||L.current!==f)&&(r({cron:V,timezone:x,enabled:f}),G.current=V,H.current=x,L.current=f)},[S,x,f,r]);const q=V=>{m(V)},W=V=>{g(V),E(D=>({...D,timezone:V}))},B=["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(Ma,{htmlFor:"schedule-enabled",className:"text-sm font-normal",children:f?"Enabled":"Disabled"}),a.jsx(BE,{id:"schedule-enabled",checked:f,onCheckedChange:q})]})})}),a.jsxs("div",{className:"space-y-4 pt-0",children:[a.jsxs("div",{className:`space-y-4 ${f?"":"opacity-50"}`,children:[a.jsx(yce,{value:S.type,onChange:V=>{E(D=>({...D,type:V}))},disabled:!f}),S.type!=="custom"&&S.type!=="interval"&&a.jsxs("div",{className:"flex gap-3",children:[a.jsx(vce,{value:S.time,onChange:V=>{E(D=>({...D,time:V}))},disabled:!f}),B&&a.jsx(UN,{value:x,onChange:W,disabled:!f,timezones:C})]}),(S.type==="interval"||S.type==="custom")&&a.jsx(UN,{value:x,onChange:W,disabled:!f,timezones:C}),S.type==="weekly"&&a.jsx(bce,{value:S.weekdays,onChange:V=>{E(D=>({...D,weekdays:V}))},disabled:!f}),S.type==="monthly"&&a.jsx(Sce,{value:S.monthDays,onChange:V=>{E(D=>({...D,monthDays:V}))},disabled:!f}),S.type==="interval"&&a.jsx(Cce,{intervalType:S.intervalType,intervalValue:S.intervalValue,onTypeChange:I,onValueChange:_,disabled:!f}),S.type==="custom"&&a.jsx(Ece,{value:S.customCron,onChange:V=>{E(D=>({...D,customCron:V}))},disabled:!f})]}),i&&a.jsxs(a.Fragment,{children:[a.jsx(eC,{className:"my-3"}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex cursor-pointer items-center justify-between",onClick:()=>{v(!y)},children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(C4,{className:"h-4 w-4"}),a.jsx("span",{className:"text-sm font-medium",children:"Preview"})]}),y?a.jsx(Ng,{className:"text-muted-foreground h-4 w-4"}):a.jsx(ss,{className:"text-muted-foreground h-4 w-4"})]}),y&&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:j})]}),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:x})]}),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:T})]})]}),f&&B&&x!==sg()&&a.jsxs($E,{className:"border-amber-200 bg-amber-50",children:[a.jsx(Nh,{className:"h-4 w-4"}),a.jsx(EM,{children:"Time Zone"}),a.jsxs(VE,{children:["Schedule runs in ",x," (not your local ",sg()," ","time). Execution time may differ from expected."]})]})]})]})]}),c&&a.jsx(we,{className:"w-full",disabled:!f,children:"Save Schedule"})]})]})}function wce(){return a.jsx($t,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(jt,{value:"trigger-type-options-description-details",children:[a.jsx(Tt,{children:"How do I choose a type?"}),a.jsxs(_t,{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 Rce(){return a.jsx($t,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(jt,{value:"trigger-type-change-description-details",children:[a.jsx(Tt,{children:"How do I change the trigger type?"}),a.jsx(_t,{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 jce(){return a.jsx($t,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(jt,{value:"report-change-description-details",children:[a.jsx(Tt,{children:"How do I change a report?"}),a.jsx(_t,{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 Tce(){return a.jsx($t,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(jt,{value:"report-select-description-details",children:[a.jsx(Tt,{children:"How do I choose the report?"}),a.jsxs(_t,{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 _ce({initialData:e,preSelectedReportId:t,preSelectedType:n,onSubmit:r,onCancel:s,onDirtyChange:i}){const[c,u]=h.useState(!1),{form:f,handleTypeChange:m,handleSubmit:x,isDirty:g}=oce({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:y,watch:v}=f,S=v("type")===zn.REPORT_RUN;return a.jsx(Ul,{...f,children:a.jsxs(Ni,{onSubmit:E=>void x(E),noValidate:!1,children:[a.jsxs(zl,{children:[a.jsx(bt,{control:y,name:"type",render:({field:E})=>a.jsxs(mt,{children:[a.jsx(ut,{tooltip:"Choose what you want this trigger to run - a report or a connector",children:"Trigger Type"}),a.jsxs(oa,{onValueChange:j=>{E.onChange(j),m(j)},defaultValue:E.value,disabled:!!n||!!e||!!v("triggerConfig.reportId"),children:[a.jsx(xt,{children:a.jsx(la,{className:"w-full",children:a.jsx(ia,{placeholder:"Select trigger type"})})}),a.jsxs(ca,{children:[a.jsx(Fn,{value:zn.REPORT_RUN,children:"Report Run"}),a.jsx(Fn,{value:zn.CONNECTOR_RUN,children:"Connector Run"})]})]}),a.jsx(qt,{children:e?a.jsx(Rce,{}):a.jsx(wce,{})}),a.jsx(Ct,{})]})}),S&&a.jsx(bt,{control:y,name:"triggerConfig.reportId",render:({field:E})=>a.jsxs(mt,{children:[a.jsx(ut,{tooltip:"Select the report that will be run by this trigger",children:"Report"}),a.jsx(xt,{children:a.jsx(zC,{children:a.jsx(lce,{value:E.value,onChange:E.onChange,disabled:!!t||!!e})})}),a.jsx(qt,{children:e!=null&&e.triggerConfig?a.jsx(jce,{}):a.jsx(Tce,{})}),a.jsx(Ct,{})]})}),a.jsx(ES,{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(Wc,{children:[a.jsx(we,{variant:"default",type:"submit",className:"w-full","aria-label":e?"Save changes":"Create trigger",disabled:!g||c,children:c?e?"Saving...":"Creating...":e?"Save changes":"Create trigger"}),s&&a.jsx(we,{variant:"outline",type:"button",onClick:s,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})}function Nce({cronExpression:e,timeZone:t,isEnabled:n=!0}){const r=h.useMemo(()=>gce(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 Ace({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(Or,{open:r,onOpenChange:s,children:[a.jsx(Ir,{asChild:!0,children:a.jsx(we,{variant:"ghost",className:`dm-card-table-body-row-actionbtn opacity-0 transition-opacity ${r?"opacity-100":"group-hover:opacity-100"}`,"aria-label":"Open menu",children:a.jsx(Do,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsxs(Mr,{align:"end",children:[a.jsxs(Ut,{onClick:()=>{t(e.id)},children:[a.jsx(xd,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),"Edit trigger"]}),a.jsx(ns,{}),a.jsxs(Ut,{onClick:()=>{c(!0)},children:[a.jsx(os,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),a.jsx("span",{className:"text-red-600",children:"Delete trigger"})]})]})]}),a.jsx(Ar,{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 Dce({connector:e}){const{connectors:t}=Kc(),n=Bre(e,t);return a.jsx(a.Fragment,{children:n})}function LM({connector:e}){return a.jsx(Dce,{connector:e})}function Oce(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 Ice=e=>{const{connectors:t}=Kc();return h.useMemo(()=>t.find(n=>n.name===e),[t,e])},Mce=re.memo(function({connector:t,children:n}){const r=Ice(t.source.name),{dataMart:s,runs:i,getDataMartRuns:c}=to();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(Vc,{base64:r.logoBase64,size:20}):null,[r==null?void 0:r.logoBase64]),f=h.useCallback(()=>{s!=null&&s.storage&&sJ(s.storage,t.storage.fullyQualifiedName)},[s==null?void 0:s.storage,t.storage.fullyQualifiedName]),m=h.useMemo(()=>Oce(i),[i]),x=h.useMemo(()=>!m.lastRunDate||!m.lastRunStatus?null:{statusType:Lee(m.lastRunStatus),statusText:Uee(m.lastRunStatus),date:m.lastRunDate},[m]),g=h.useMemo(()=>(s==null?void 0:s.storage)&&oJ(s.storage),[s]),y=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(em,{children:[a.jsx(tm,{asChild:!0,children:a.jsx("span",{children:n})}),a.jsxs(nm,{children:[a.jsxs(oy,{children:[a.jsx(VC,{children:u}),a.jsxs(iy,{children:[a.jsx(ly,{children:a.jsx(LM,{connector:t})}),a.jsx(cy,{children:y})]})]}),a.jsxs(uy,{children:[a.jsxs(fi,{children:[a.jsx(hi,{children:"Last run status:"}),a.jsx(mi,{children:x?a.jsx(Td,{type:x.statusType,variant:"ghost",children:x.statusText}):"Not run yet"})]}),a.jsxs(fi,{children:[a.jsx(hi,{children:"Last run date:"}),a.jsx(mi,{children:x?a.jsx(ws,{date:x.date}):"Never run"})]}),a.jsxs(fi,{children:[a.jsx(hi,{children:"Total runs:"}),a.jsxs(mi,{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(dy,{children:a.jsxs(we,{className:"w-full",variant:"default",onClick:f,title:"Open Storage","aria-label":"Open Storage",children:[g,a.jsx(yi,{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 kce(e){const t=e.triggerConfig,n=ha.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(Mee,{report:t.report,children:a.jsx(_r,{className:"inline-block h-4 w-4 align-text-bottom opacity-0 transition-opacity duration-200 group-hover:opacity-100"})})]})}function Lce(e){var s;const t=e.triggerConfig,{connector:n}=t.connector,r=(s=n.info)!=null&&s.logoBase64?a.jsx(Vc,{base64:n.info.logoBase64,className:"h-4 w-4",size:16}):a.jsx(Sc,{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(LM,{connector:n}),a.jsx(Mce,{connector:n,children:a.jsx(_r,{className:"inline-block h-4 w-4 align-text-bottom opacity-0 transition-opacity duration-200 group-hover:opacity-100"})})]})}function Pce({trigger:e}){switch(e.type){case zn.REPORT_RUN:return kce(e);case zn.CONNECTOR_RUN:return Lce(e);default:return a.jsx("div",{className:"text-muted-foreground text-sm",children:"—"})}}function Uce({onEditTrigger:e,onDeleteTrigger:t}){return[{accessorKey:"type",size:150,header:"Trigger Type",cell:({row:n})=>{const s=n.getValue("type")===zn.REPORT_RUN?"Report Run":"Connector Run";return a.jsx(jr,{variant:"outline",children:s})},meta:{title:"Trigger Type"}},{accessorKey:"triggerConfig",size:35,header:"Run Target",cell:({row:n})=>a.jsx(Pce,{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(Nce,{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(ws,{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(ws,{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(Td,{type:r?En.SUCCESS:En.NEUTRAL,variant:"ghost",showIcon:!1,children:r?"Enabled":"Disabled"})},meta:{title:"Trigger Status"}},{id:"actions",size:80,header:({table:n})=>a.jsx(qc,{table:n}),cell:({row:n})=>a.jsx(Ace,{trigger:n.original,onEditTrigger:e,onDeleteTrigger:t}),meta:{title:"Actions"}}]}function zce({table:e,onPreviousClick:t,onNextClick:n}){return a.jsxs("div",{className:"dm-card-pagination",role:"navigation","aria-label":"Table pagination",children:[a.jsx(we,{variant:"outline",size:"sm",onClick:t,disabled:!e.getCanPreviousPage(),"aria-label":"Go to previous page",children:"Previous"}),a.jsx(we,{variant:"outline",size:"sm",onClick:n,disabled:!e.getCanNextPage(),"aria-label":"Go to next page",children:"Next"})]})}function qE({isOpen:e,onClose:t,dataMartId:n,preSelectedReportId:r,preSelectedType:s}){Fl(e);const{createScheduledTrigger:i,updateScheduledTrigger:c,selectedTrigger:u}=TM(),{showUnsavedDialog:f,setShowUnsavedDialog:m,handleClose:x,confirmClose:g,handleFormDirtyChange:y,handleFormSubmitSuccess:v}=Zc(t),C=!!u,S=h.useMemo(()=>u?{type:u.type,cronExpression:u.cronExpression,timeZone:u.timeZone,isActive:u.isActive,triggerConfig:u.type===zn.REPORT_RUN?{type:hl.SCHEDULED_REPORT_RUN,reportId:u.triggerConfig.reportId}:null}:void 0,[u]),E=async R=>{C?await c(n,u.id,R.cronExpression,R.timeZone,R.isActive):await i(n,R.type,R.cronExpression,R.timeZone,R.isActive,R.triggerConfig),v()},j=h.useRef(!1);return h.useEffect(()=>{const R=C?"Edit":"Create",T=(u==null?void 0:u.type)??s;e&&!j.current?(De({event:"scheduled_trigger_config_open",category:"ScheduledTrigger",action:R,label:T}),j.current=!0):!e&&j.current&&(De({event:"scheduled_trigger_config_close",category:"ScheduledTrigger",action:R,label:T}),j.current=!1)},[e,C,u,s]),a.jsxs(a.Fragment,{children:[a.jsx(Ei,{open:e,onOpenChange:R=>{R||x()},children:a.jsxs(wi,{children:[a.jsxs(Ri,{children:[a.jsxs(ji,{children:[C?"Edit":"Create"," Scheduled Trigger"]}),a.jsx(Rl,{children:"Configure automatic runs for your reports or connectors."})]}),a.jsx(_ce,{preSelectedReportId:r,preSelectedType:s,initialData:S,onSubmit:E,onCancel:x,onDirtyChange:y})]})}),a.jsx(Ar,{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 Fce({triggers:e,dataMartId:t,onEditTrigger:n,onDeleteTrigger:r}){const[s,i]=h.useState(!1),c=h.useCallback(()=>{i(!1)},[]),u=h.useCallback(j=>{r(j)},[r]),f=h.useMemo(()=>Uce({onEditTrigger:n,onDeleteTrigger:u}),[n,u]),{sorting:m,setSorting:x,columnVisibility:g,setColumnVisibility:y}=Bc({columns:f,storageKeyPrefix:"data-mart-scheduled-triggers",defaultSortingColumn:"type"}),v=Dl({data:e,columns:f,getCoreRowModel:Al(),getPaginationRowModel:rm(),onSortingChange:x,getSortedRowModel:Gc(),getFilteredRowModel:_d(),state:{sorting:m,columnVisibility:g},onColumnVisibilityChange:y,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(Ol,{id:"scheduled-triggers-table",className:"dm-card-table",role:"table","aria-label":"Scheduled Triggers",children:[a.jsx(Il,{className:"dm-card-table-header",children:v.getHeaderGroups().map(j=>a.jsx(Hn,{className:"dm-card-table-header-row",children:j.headers.map(R=>a.jsx(kl,{className:"[&:has([role=checkbox])]:pl-6 [&>[role=checkbox]]:translate-y-[2px]",scope:"col",style:R.column.id==="type"?{width:150,minWidth:150,maxWidth:150}:R.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(R.getSize())}%`},children:R.isPlaceholder?null:typeof R.column.columnDef.header=="function"?R.column.columnDef.header(R.getContext()):R.column.columnDef.header},R.id))},j.id))}),a.jsx(Ml,{className:"dm-card-table-body",children:v.getRowModel().rows.length?v.getRowModel().rows.map((j,R)=>a.jsx(Hn,{onClick:()=>{n(j.original.id)},className:"dm-card-table-body-row group",role:"row","aria-rowindex":R+1,children:j.getVisibleCells().map((T,N)=>a.jsx(Yr,{className:`whitespace-normal ${T.column.id==="actions"?"actions-cell":""}`,role:"cell","aria-colindex":N+1,style:T.column.id==="type"?{width:150,minWidth:150,maxWidth:150}:T.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(T.column.getSize())}%`},children:typeof T.column.columnDef.cell=="function"?T.column.columnDef.cell(T.getContext()):T.column.columnDef.cell},T.id))},j.id)):a.jsx(Hn,{children:a.jsx(Yr,{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 yet. Create a trigger to automate data updates"})})})})]})}),a.jsx(zce,{table:v,onPreviousClick:C,onNextClick:S}),a.jsx(qE,{isOpen:s,onClose:c,dataMartId:t})]})}function Hce({dataMartId:e}){const{triggers:t,deleteScheduledTrigger:n,selectScheduledTrigger:r,selectedTrigger:s}=nce(e),[i,c]=h.useState(!1);h.useEffect(()=>{s&&c(!0)},[s]);const u=x=>{const g=t.find(y=>y.id===x);g&&r(g)},f=()=>{c(!1),r(null)},m=async x=>{try{await n(e,x)}catch(g){console.error("Error deleting trigger:",g)}};return a.jsxs(a.Fragment,{children:[a.jsx(Fce,{triggers:t,dataMartId:e,onEditTrigger:u,onDeleteTrigger:x=>void m(x)}),a.jsx(qE,{isOpen:i,onClose:f,dataMartId:e})]})}function KE(){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(wx,{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 tl(e){return e.startsWith('"')&&e.endsWith('"')?e:`"${e}"`}function Ss(e){return e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}function $ce(){return a.jsx($t,{variant:"common",type:"single",collapsible:!0,className:"text-sm",children:a.jsxs(jt,{value:"redshift-schema-permissions",children:[a.jsx(Tt,{className:"text-sm",children:"How to grant permissions for schema creation?"}),a.jsxs(_t,{children:[a.jsx("p",{className:"mb-2",children:"You need to grant permissions to the IAM user who will be used to upload data."}),a.jsx("p",{className:"mb-2 text-sm font-medium",children:"Grant permissions:"}),a.jsx("pre",{className:"bg-muted overflow-x-auto rounded p-2 text-xs",children:a.jsx("code",{children:'GRANT CREATE ON DATABASE <DATABASE_NAME> TO "IAM:<USERNAME_IN_IAM>";'})}),a.jsxs("p",{className:"text-muted-foreground mt-2 text-sm",children:["Replace ",a.jsx("code",{className:"bg-muted rounded px-1 py-0.5",children:"<DATABASE_NAME>"})," with your database name and"," ",a.jsx("code",{className:"bg-muted rounded px-1 py-0.5",children:"<USERNAME_IN_IAM>"})," with your IAM username."]}),a.jsxs("p",{className:"mt-2 text-sm",children:["You can find your IAM username in the"," ",a.jsx(Ft,{className:"underline",href:"https://console.aws.amazon.com/iam/",children:"AWS IAM Console"})," ","under the ",a.jsx("strong",{children:"Users"})," tab."]})]})]})})}function Vce({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,x]=h.useState(""),[g,y]=h.useState(""),[v,C]=h.useState(""),[S,E]=h.useState(null),[j,R]=h.useState(null),[T,N]=h.useState(null),[A,I]=h.useState(null),_=h.useRef(!1),M=h.useRef(!1),G=h.useRef(!1),H=(D,F=!1)=>D.trim()?F&&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",L=h.useCallback((D,F,U,ee,he,z,$,P)=>{let K;if(e===ce.SNOWFLAKE&&he){const se=tl(he),Q=tl(F);K=`${D}.${se}.${Q}`}else if(e===ce.AWS_REDSHIFT)if(!he||!F)K="";else{const se=tl(he),Q=tl(F);K=`${se}.${Q}`}else e===ce.DATABRICKS?!$||!he||!F?K="":K=`${$}.${he}.${F}`:K=`${D}.${F}`;const Y=e===ce.SNOWFLAKE?!!(D&&he&&F&&U===null&&z===null&&ee===null):e===ce.AWS_REDSHIFT?!!(he&&F&&z===null&&ee===null):e===ce.DATABRICKS?!!($&&he&&F&&P===null&&z===null&&ee===null):!!(D&&F&&U===null&&ee===null);s({fullyQualifiedName:K,isValid:Y})},[s,e]);h.useEffect(()=>{let D="",F="",U="",ee="";if(t!=null&&t.fullyQualifiedName){const Q=t.fullyQualifiedName.match(/(?:[^."]+|"[^"]*")+/g)??[];if(e===ce.SNOWFLAKE&&Q.length===3){const le=Q[0],pe=Q[1],be=Q[2];le&&pe&&be&&(D=le,U=Ss(pe),ee=Ss(be))}else if(e===ce.DATABRICKS&&Q.length===3){const le=Q[0],pe=Q[1],be=Q[2];le&&pe&&be&&(F=le,U=pe,ee=be)}else if(e===ce.AWS_REDSHIFT){if(Q.length===2){const le=Q[0],pe=Q[1];le&&pe&&(U=Ss(le),ee=Ss(pe))}else if(Q.length===3){const le=Q[1],pe=Q[2];le&&pe&&(U=Ss(le),ee=Ss(pe))}}else if(Q.length>=2){const le=Q[0],pe=Q[1];le&&pe&&(D=le,ee=pe)}}else D=`${c}_owox`,e===ce.SNOWFLAKE?U="PUBLIC":e===ce.DATABRICKS?(F="main",U=`${c}_owox`):e===ce.AWS_REDSHIFT&&(U=`${c}_owox`),ee=i;const he=e===ce.AWS_REDSHIFT||e===ce.DATABRICKS?null:H(D),z=e===ce.DATABRICKS?H(F):null,$=e===ce.SNOWFLAKE?H(U,!0):e===ce.AWS_REDSHIFT?U?H(U,!0):null:e===ce.DATABRICKS?H(U):null,P=H(ee,e===ce.SNOWFLAKE||e===ce.AWS_REDSHIFT);f(D),_.current||(x(F),R(z)),M.current||(y(U),N($)),G.current||(C(ee),I(P)),E(he);const K=e===ce.SNOWFLAKE&&U?`${D}.${tl(U)}.${tl(ee)}`:e===ce.AWS_REDSHIFT?U&&ee?`${tl(U)}.${tl(ee)}`:"":e===ce.DATABRICKS?F&&U&&ee?`${F}.${U}.${ee}`:"":`${D}.${ee}`,Y=e===ce.SNOWFLAKE?!!(D&&U&&ee&&he===null&&$===null&&P===null):e===ce.AWS_REDSHIFT?!!(U&&ee&&$===null&&P===null):e===ce.DATABRICKS?!!(F&&U&&ee&&z===null&&$===null&&P===null):!!(D&&ee&&he===null&&P===null);!_.current&&!M.current&&!G.current&&((t==null?void 0:t.fullyQualifiedName)!==K||t.isValid!==Y)&&L(D,ee,he,P,U,$,F,z)},[t,i,c,e,L]);const q=D=>{f(D);const F=H(D);E(F),L(D,v,F,A,g,T,m,j)},W=D=>{_.current=!0,x(D);const F=H(D);R(F),L(u,v,S,A,g,T,D,F)},B=D=>{M.current=!0,y(D);const F=e===ce.DATABRICKS?H(D):H(D,!0);N(F),L(u,v,S,A,D,F,m,j)},V=D=>{G.current=!0,C(D);const F=H(D,e===ce.SNOWFLAKE||e===ce.AWS_REDSHIFT);I(F),L(u,D,S,F,g,T,m,j)};return a.jsxs(gi,{children:[e===ce.GOOGLE_BIGQUERY&&a.jsxs(a.Fragment,{children:[a.jsx(Vs,{icon:a.jsx(gO,{}),title:"Google BigQuery",docUrl:"https://docs.owox.com/docs/storages/supported-storages/google-bigquery/",variant:"compact"}),a.jsxs(mo,{title:"Choose where to store your data",children:[a.jsxs(qa,{children:[a.jsx(zr,{required:!0,htmlFor:"dataset-name",tooltip:"Enter dataset name for Google BigQuery where the connector data will be stored.",children:"Dataset name"}),a.jsx(ct,{type:"text",id:"dataset-name",placeholder:"Enter dataset name",autoComplete:"off",className:"box-border w-full",value:u,"aria-invalid":!!S,"aria-describedby":S?"dataset-name-error":void 0,onChange:D=>{q(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"}),S&&a.jsx("p",{id:"dataset-name-error",className:"text-destructive text-sm",children:S})]}),a.jsxs(qa,{children:[a.jsx(zr,{required:!0,htmlFor:"table-name",tooltip:"Enter table name where the connector data will be stored.",children:"Table name"}),a.jsx(ct,{type:"text",id:"table-name",placeholder:"Enter table name",autoComplete:"off",className:"box-border w-full",value:v,"aria-invalid":!!A,"aria-describedby":A?"table-name-error":void 0,onChange:D=>{V(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"}),A&&a.jsx("p",{id:"table-name-error",className:"text-destructive text-sm",children:A})]})]})]}),e===ce.AWS_ATHENA&&a.jsxs(a.Fragment,{children:[a.jsx(Vs,{icon:a.jsx(xO,{}),title:"AWS Athena",docUrl:"https://docs.owox.com/docs/storages/supported-storages/aws-athena/",variant:"compact"}),a.jsxs(mo,{title:"Choose where to store your data",children:[a.jsxs(qa,{children:[a.jsx(zr,{required:!0,htmlFor:"database-name",tooltip:"Enter database name for Amazon Athena where the connector data will be stored.",children:"Database name"}),a.jsx(ct,{type:"text",id:"database-name",placeholder:"Enter database name",autoComplete:"off",className:"box-border w-full",value:u,"aria-invalid":!!S,"aria-describedby":S?"database-name-error":void 0,onChange:D=>{q(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"}),S&&a.jsx("p",{id:"database-name-error",className:"text-destructive text-sm",children:S})]}),a.jsxs(qa,{children:[a.jsx(zr,{required:!0,htmlFor:"athena-table-name",tooltip:"Enter table name where the connector data will be stored.",children:"Table name"}),a.jsx(ct,{type:"text",id:"athena-table-name",placeholder:"Enter table name",autoComplete:"off",className:"box-border w-full",value:v,"aria-invalid":!!A,"aria-describedby":A?"athena-table-name-error":void 0,onChange:D=>{V(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"}),A&&a.jsx("p",{id:"athena-table-name-error",className:"text-destructive text-sm",children:A})]})]})]}),e===ce.SNOWFLAKE&&a.jsxs(a.Fragment,{children:[a.jsx(Vs,{icon:a.jsx(yO,{}),title:"Snowflake",docUrl:"https://docs.owox.com/docs/storages/supported-storages/snowflake/",variant:"compact"}),a.jsxs(mo,{title:"Choose where to store your data",children:[a.jsxs(qa,{children:[a.jsx(zr,{required:!0,htmlFor:"snowflake-database-name",tooltip:"Enter database name for Snowflake where the connector data will be stored.",children:"Database name"}),a.jsx(ct,{type:"text",id:"snowflake-database-name",placeholder:"Enter database name",autoComplete:"off",className:"box-border w-full",value:u,"aria-invalid":!!S,"aria-describedby":S?"snowflake-database-name-error":void 0,onChange:D=>{q(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"}),S&&a.jsx("p",{id:"snowflake-database-name-error",className:"text-destructive text-sm",children:S})]}),a.jsxs(qa,{children:[a.jsx(zr,{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(ct,{type:"text",id:"snowflake-schema-name",placeholder:"PUBLIC",autoComplete:"off",className:"box-border w-full",value:g,"aria-invalid":!!T,"aria-describedby":T?"snowflake-schema-name-error":void 0,onChange:D=>{B(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"}),T&&a.jsx("p",{id:"snowflake-schema-name-error",className:"text-destructive text-sm",children:T})]}),a.jsxs(qa,{children:[a.jsx(zr,{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(ct,{type:"text",id:"snowflake-table-name",placeholder:"my_table",autoComplete:"off",className:"box-border w-full",value:v,"aria-invalid":!!A,"aria-describedby":A?"snowflake-table-name-error":void 0,onChange:D=>{V(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"}),A&&a.jsx("p",{id:"snowflake-table-name-error",className:"text-destructive text-sm",children:A})]})]})]}),e===ce.AWS_REDSHIFT&&a.jsxs(a.Fragment,{children:[a.jsx(Vs,{icon:a.jsx(bO,{}),title:"AWS Redshift",docUrl:"https://docs.owox.com/docs/storages/supported-storages/aws-redshift/",variant:"compact"}),a.jsxs(mo,{title:"Choose where to store your data",children:[a.jsxs(qa,{children:[a.jsx(zr,{required:!0,htmlFor:"redshift-schema-name",tooltip:"Enter schema name for Redshift where the connector data will be stored. Identifiers will be quoted automatically to preserve case sensitivity.",children:"Schema name"}),a.jsx(ct,{type:"text",id:"redshift-schema-name",placeholder:"public",autoComplete:"off",className:"box-border w-full",value:g,"aria-invalid":!!T,"aria-describedby":T?"redshift-schema-name-error":void 0,onChange:D=>{B(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."}),a.jsx($ce,{}),T&&a.jsx("p",{id:"redshift-schema-name-error",className:"text-destructive text-sm",children:T})]}),a.jsxs(qa,{children:[a.jsx(zr,{required:!0,htmlFor:"redshift-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(ct,{type:"text",id:"redshift-table-name",placeholder:"my_table",autoComplete:"off",className:"box-border w-full",value:v,"aria-invalid":!!A,"aria-describedby":A?"redshift-table-name-error":void 0,onChange:D=>{V(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. Identifiers will be quoted automatically to preserve case sensitivity."}),A&&a.jsx("p",{id:"redshift-table-name-error",className:"text-destructive text-sm",children:A})]})]})]}),e===ce.DATABRICKS&&a.jsxs(a.Fragment,{children:[a.jsx(Vs,{icon:a.jsx(vO,{}),title:"Databricks",docUrl:"https://docs.owox.com/docs/storages/supported-storages/databricks/",variant:"compact"}),a.jsxs(mo,{title:"Choose where to store your data",children:[a.jsxs(qa,{children:[a.jsx(zr,{required:!0,htmlFor:"databricks-catalog-name",tooltip:'Enter catalog name for Databricks where the connector data will be stored. Use "main" for the default catalog or your Unity Catalog name.',children:"Catalog name"}),a.jsx(ct,{type:"text",id:"databricks-catalog-name",placeholder:"main",autoComplete:"off",className:"box-border w-full",value:m,"aria-invalid":!!j,"aria-describedby":j?"databricks-catalog-name-error":void 0,onChange:D=>{W(D.target.value)},required:!0}),a.jsx("p",{className:"text-muted-foreground text-sm",children:"Catalog is auto-created on first run if it doesn't exist"}),j&&a.jsx("p",{id:"databricks-catalog-name-error",className:"text-destructive text-sm",children:j})]}),a.jsxs(qa,{children:[a.jsx(zr,{required:!0,htmlFor:"databricks-schema-name",tooltip:"Enter schema name for Databricks where the connector data will be stored.",children:"Schema name"}),a.jsx(ct,{type:"text",id:"databricks-schema-name",placeholder:"Enter schema name",autoComplete:"off",className:"box-border w-full",value:g,"aria-invalid":!!T,"aria-describedby":T?"databricks-schema-name-error":void 0,onChange:D=>{B(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"}),T&&a.jsx("p",{id:"databricks-schema-name-error",className:"text-destructive text-sm",children:T})]}),a.jsxs(qa,{children:[a.jsx(zr,{required:!0,htmlFor:"databricks-table-name",tooltip:"Enter table name where the connector data will be stored.",children:"Table name"}),a.jsx(ct,{type:"text",id:"databricks-table-name",placeholder:"my_table",autoComplete:"off",className:"box-border w-full",value:v,"aria-invalid":!!A,"aria-describedby":A?"databricks-table-name-error":void 0,onChange:D=>{V(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"}),A&&a.jsx("p",{id:"databricks-table-name-error",className:"text-destructive text-sm",children:A})]})]})]}),a.jsx(mo,{title:"Schedule updates",children:a.jsx(KE,{})})]})}function Gce({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),[x,g]=h.useState(null),[y,v]=h.useState(""),[C,S]=h.useState([]),[E,j]=h.useState(1),[R,T]=h.useState({}),[N,A]=h.useState(!1),[I,_]=h.useState(new Set),[M,G]=h.useState(new Set),{connectors:H,connectorSpecification:L,connectorFields:q,loading:W,loadingSpecification:B,loadingFields:V,error:D,fetchAvailableConnectors:F,fetchConnectorSpecification:U,fetchConnectorFields:ee}=Kc();h.useEffect(()=>{u==null||u(f)},[f,u]);const[he,z]=h.useState(null),$=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]),P=$.length,K=h.useCallback(async ke=>{!I.has(ke)&&!B&&(_(It=>new Set(It).add(ke)),await U(ke))},[I,B,U]),Y=h.useCallback(async ke=>{M.has(ke)||(G(It=>new Set(It).add(ke)),await ee(ke))},[M,ee]);h.useEffect(()=>{if(!c||x||H.length===0)return;const ke=H.find(It=>It.name===c);ke&&(g(ke),j(i??2),K(ke.name),!n&&s!=="fields-only"&&Y(ke.name))},[c,H,x,i,n,s,K,Y]),h.useEffect(()=>{if(H.length===0&&!W&&F(),r&&H.length>0&&!x){const{source:ke,storage:It}=r;v(ke.node),S(ke.fields),T(ke.configuration[0]||{}),z({fullyQualifiedName:It.fullyQualifiedName,isValid:!0});const Z=H.find(ae=>ae.name===ke.name);Z&&(g(Z),K(Z.name),!n&&s!=="fields-only"&&Y(Z.name),s==="fields-only"&&Y(Z.name))}if(n&&H.length>0&&!x&&!r){const ke=H[0];g(ke),K(ke.name)}},[s,r,H,n,W,F,K,Y,x]);const se=ke=>{g(ke),T({}),A(!1),m(!0),_(It=>{const Z=new Set(It);return Z.delete(ke.name),Z}),K(ke.name),Y(ke.name)},Q=ke=>{v(ke),S([]),m(!0)},le=(ke,It)=>{S(It?Z=>Z.includes(ke)?Z:[...Z,ke]:Z=>Z.filter(ae=>ae!==ke)),m(!0)},pe=(ke,It)=>{S(It?Z=>{const ae=ke.filter(ge=>!Z.includes(ge));return[...Z,...ae]}:Z=>Z.filter(ae=>!ke.includes(ae))),m(!0)},be=ke=>{z(ke),m(!0)},ze=h.useCallback(ke=>{T(ke),m(!0)},[]),Re=h.useCallback(ke=>{A(ke)},[]);h.useEffect(()=>{L&&(L.some(It=>It.required&&It.name!=="Fields")||A(!0))},[L]),h.useEffect(()=>{const ke=$[E-1];x&&De({event:"connector_setup",category:x.name,action:"step",label:ke.title})},[E]);const Ge=()=>{E<P&&j(E+1)},ot=()=>{E>1&&j(E-1)},Vt=()=>{if(n)return x!==null&&N;if(s==="fields-only")switch(E){case 1:return C.length>0;default:return!1}switch(E){case 1:return x!==null;case 2:return N;case 3:return y!=="";case 4:return C.length>0;case 5:return he!==null&&he.fullyQualifiedName!==""&&he.isValid;default:return!1}},He=()=>E>1,Xt=(ke,It)=>{if(!ke)return It;const Z=ke.find(ae=>ae.name===It);return(Z==null?void 0:Z.destinationName)??It},gn=()=>{if(n&&E===1)return L&&x?a.jsx(LN,{connector:x,connectorSpecification:L,onConfigurationChange:ze,onValidationChange:Re,initialConfiguration:R,loading:B,isEditingExisting:!!(r!=null&&r.source.configuration.length)}):null;if(s==="fields-only")switch(E){case 1:return x&&y&&q?a.jsx(PN,{connector:x,connectorFields:q,selectedField:y,selectedFields:C,onFieldToggle:le,onSelectAllFields:pe}):null;default:return null}switch(E){case 1:return a.jsx(kle,{connectors:H,selectedConnector:x,loading:W,error:D,onConnectorSelect:se,onConnectorDoubleClick:()=>{j(ke=>ke<P?ke+1:ke)}});case 2:return x&&L?a.jsx(LN,{connector:x,connectorSpecification:L,onConfigurationChange:ze,onValidationChange:Re,initialConfiguration:R,loading:B,isEditingExisting:!1}):null;case 3:return x&&q?a.jsx(Xle,{connectorFields:q,connector:x,selectedField:y,connectorName:x.displayName,loading:V,onFieldSelect:Q}):null;case 4:return x&&y&&q?a.jsx(PN,{connector:x,connectorFields:q,selectedField:y,selectedFields:C,onFieldToggle:le,onSelectAllFields:pe}):null;case 5:return y&&q?a.jsx(Vce,{dataStorageType:t,destinationName:Xt(q,y),connectorName:(x==null?void 0:x.displayName)??"",target:he,onTargetChange:be}):null;default:return null}};return a.jsxs(cse,{children:[a.jsx(use,{children:gn()}),a.jsx(dse,{variant:"horizontal",children:a.jsx(Lle,{currentStep:E,totalSteps:P,canGoNext:Vt(),canGoBack:He(),isLoading:B||V,onNext:Ge,onBack:ot,onFinish:()=>{n&&x?(e({source:{name:x.name,configuration:[R],node:(r==null?void 0:r.source.node)??y,fields:(r==null?void 0:r.source.fields)??C},storage:(r==null?void 0:r.storage)??{fullyQualifiedName:(r==null?void 0:r.storage.fullyQualifiedName)??""}}),De({event:"connector_setup",category:x.name,action:"created",label:"configuration-only"})):s==="fields-only"&&r?(e({source:{...r.source,fields:C},storage:r.storage}),De({event:"connector_setup",category:r.source.name,action:"created",label:"fields-only"})):x&&he&&(e({source:{name:x.name,configuration:[R],node:y,fields:C},storage:{fullyQualifiedName:he.fullyQualifiedName}}),De({event:"connector_setup",category:x.name,action:"created",label:"full"})),m(!1)}})})]})}function PM({isOpen:e,onClose:t,dataStorageType:n,onSubmit:r,configurationOnly:s=!1,existingConnector:i=null,mode:c="full",initialStep:u,preselectedConnector:f}){const{showUnsavedDialog:m,setShowUnsavedDialog:x,handleClose:g,confirmClose:y,handleFormDirtyChange:v,handleFormSubmitSuccess:C}=Zc(t);return Fl(e),a.jsxs(a.Fragment,{children:[a.jsx(Ei,{open:e,onOpenChange:S=>{S||g()},children:a.jsxs(wi,{children:[a.jsxs(Ri,{children:[a.jsx(ji,{children:c==="fields-only"?"Connector Fields":i!=null&&i.source.name?"Edit Connector":"Set Up Connector"}),a.jsx(Rl,{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(Gce,{onSubmit:S=>{r(S),C()},dataStorageType:n,configurationOnly:s||c==="configuration-only",existingConnector:i,mode:c,initialStep:u,preselectedConnector:f,onDirtyChange:v})]})}),a.jsx(Ar,{open:m,onOpenChange:x,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:y,variant:"destructive"})]})}const WE=({dataStorageType:e,onSubmit:t,children:n,configurationOnly:r=!1,existingConnector:s=null,preset:i,isOpen:c,onClose:u})=>{const[f,m]=h.useState(!1),[x,g]=h.useState(1),[y,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(md,{children:a.jsx(PM,{isOpen:f,onClose:S,dataStorageType:e,onSubmit:t,configurationOnly:r,existingConnector:s,initialStep:x,preselectedConnector:y})})]})};function Bce({storageType:e,onSetupConnector:t,preset:n,isOpen:r,onClose:s}){return a.jsx(WE,{dataStorageType:e,onSubmit:t,configurationOnly:!1,preset:n,isOpen:r,onClose:s,children:a.jsxs(we,{type:"button",variant:"outline",className:"flex h-24 w-full cursor-pointer items-center justify-center gap-2 border-0 shadow-none dark:border-transparent dark:bg-transparent dark:hover:bg-white/4",children:[a.jsx("div",{className:"text-foreground flex h-7 w-7 items-center justify-center rounded-sm bg-gray-200/50 transition-colors duration-200 group-hover:bg-gray-200/75 dark:bg-white/8 dark:group-hover:bg-white/10",children:a.jsx(XS,{className:"h-4 w-4",strokeWidth:2.25})}),a.jsx("span",{children:"Setup Connector"}),a.jsx(ba,{className:"h-6 w-6"})]})})}const qce=e=>{switch(e){case ce.GOOGLE_BIGQUERY:return"Google BigQuery";case ce.AWS_ATHENA:return"AWS Athena";case ce.SNOWFLAKE:return"Snowflake";case ce.AWS_REDSHIFT:return"AWS Redshift";case ce.DATABRICKS:return"Databricks";default:return e}},Gu=e=>typeof e=="object"&&"connector"in e,Pf=e=>{if(!Gu(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 Kce({configIndex:e,connectorDef:t,onRemoveConfiguration:n,onUpdateConfiguration:r,totalConfigurations:s,dataStorage:i}){const c=Nl.getInfo(i.type),{connectors:u,fetchAvailableConnectors:f}=Kc();h.useEffect(()=>{f()},[f]);const m=C=>{const S=u.find(E=>E.name===C);if(S!=null&&S.logoBase64)return()=>a.jsx(Vc,{base64:S.logoBase64,size:24})},x=()=>{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(rt,{children:[a.jsx(at,{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(ba,{className:"h-3 w-3"})]})}),a.jsx(st,{children:"Edit connector configuration"})]})]})},g=(C,S,E)=>a.jsxs("span",{children:[a.jsxs("span",{className:"text-muted-foreground/75",children:[C,":"]})," ",a.jsx(Ft,{href:E,onClick:j=>{j.stopPropagation()},children:S})]}),y=()=>{switch(i.type){case ce.GOOGLE_BIGQUERY:{const C=i.config.projectId,S=t.connector.storage.fullyQualifiedName,E=S.split(".")[0],j=S.split(".")[1],R=tJ(C,E);return a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[g("Dataset",E,R),a.jsx("span",{className:"text-muted-foreground",children:"•"}),g("Table",j,t5(C,E,j)),a.jsxs(rt,{children:[a.jsx(at,{asChild:!0,children:a.jsx(_r,{className:"h-4 w-4"})}),a.jsx(st,{children:"The dataset and table are automatically created during the first run of the data mart, if they don't already exist"})]})]})}case ce.AWS_ATHENA:{const C=i.config.region,S=t.connector.storage.fullyQualifiedName,[E,j]=S.split("."),R=`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,R),a.jsx("span",{className:"text-muted-foreground",children:"•"}),g("Table",j,R),a.jsxs(rt,{children:[a.jsx(at,{asChild:!0,children:a.jsx(_r,{className:"h-4 w-4"})}),a.jsx(st,{children:"The database and table are automatically created during the first run of the data mart, if they don't already exist"})]})]})}case ce.SNOWFLAKE:{const C=i.config.account,E=t.connector.storage.fullyQualifiedName.split("."),j=E[0],R=E[1],T=E[2],N=`https://${C}.snowflakecomputing.com`,A=`${N}/#/data/databases/${j}`,I=`${N}/#/data/databases/${j}/schemas/${R}`,_=`${N}/#/data/databases/${j}/schemas/${R}/table/${T}`;return a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[g("Database",j,A),a.jsx("span",{className:"text-muted-foreground",children:"•"}),g("Schema",Ss(R),I),a.jsx("span",{className:"text-muted-foreground",children:"•"}),g("Table",Ss(T),_),a.jsxs(rt,{children:[a.jsx(at,{asChild:!0,children:a.jsx(_r,{className:"h-4 w-4"})}),a.jsx(st,{children:"The database, schema and table are automatically created during the first run of the data mart, if they don't already exist"})]})]})}case ce.AWS_REDSHIFT:{const C=i.config,E=t.connector.storage.fullyQualifiedName.split(".");let j,R;E.length===3?(j=Ss(E[1]),R=Ss(E[2])):(j=Ss(E[0]),R=Ss(E[1]));const T=C.connectionType===fr.SERVERLESS?`Workgroup: ${C.workgroupName}`:`Cluster: ${C.clusterIdentifier}`,N=`https://console.aws.amazon.com/redshiftv2/home?region=${C.region}#query-editor`;return a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsxs("span",{children:[a.jsx("span",{className:"text-muted-foreground/75",children:"Region:"})," ",a.jsx("span",{className:"text-muted-foreground font-medium",children:C.region})]}),a.jsx("span",{className:"text-muted-foreground",children:"•"}),a.jsxs("span",{children:[a.jsx("span",{className:"text-muted-foreground/75",children:"Database:"})," ",a.jsx("span",{className:"text-muted-foreground font-medium",children:C.database})]}),a.jsx("span",{className:"text-muted-foreground",children:"•"}),a.jsxs("span",{children:[a.jsxs("span",{className:"text-muted-foreground/75",children:[T.split(":")[0],":"]})," ",a.jsx("span",{className:"text-muted-foreground font-medium",children:T.split(":")[1].trim()})]}),a.jsx("span",{className:"text-muted-foreground",children:"•"}),g("Schema",j,N),a.jsx("span",{className:"text-muted-foreground",children:"•"}),g("Table",R,N),a.jsxs(rt,{children:[a.jsx(at,{asChild:!0,children:a.jsx(_r,{className:"h-4 w-4"})}),a.jsx(st,{children:"The schema and table are automatically created during the first run of the data mart, if they don't already exist"})]})]})}case ce.DATABRICKS:{const S=t.connector.storage.fullyQualifiedName.split(".");let E,j,R;S.length===3?(E=S[0],j=S[1],R=S[2]):(E="hive_metastore",j=S[0],R=S[1]);const N=`https://${i.config.host}`;return a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[g("Catalog",E,N),a.jsx("span",{className:"text-muted-foreground",children:"•"}),g("Schema",j,N),a.jsx("span",{className:"text-muted-foreground",children:"•"}),g("Table",R,N),a.jsxs(rt,{children:[a.jsx(at,{asChild:!0,children:a.jsx(_r,{className:"h-4 w-4"})}),a.jsx(st,{children:"The catalog, 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(WE,{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(pS,{icon:m(t.connector.source.name),title:t.connector.source.name||"Connector",subtitle:x(),className:"bg-background hover:bg-muted min-h-[80px] cursor-pointer border-0 transition-colors hover:shadow-none"})}),a.jsx(pS,{title:qce(i.type),icon:c.icon,subtitle:y(),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(rt,{children:[a.jsx(at,{asChild:!0,children:a.jsx("span",{children:a.jsx(we,{type:"button",variant:"ghost",onClick:()=>{v()&&n(e)},disabled:!v(),children:a.jsx(os,{className:"h-4 w-4"})})})}),!v()&&a.jsx(st,{children:"Remove last configuration only after adding a new one."})]})})]})}function Wce({storageType:e,onAddConfiguration:t,existingConnector:n}){return a.jsx("div",{children:a.jsx(WE,{dataStorageType:e,onSubmit:r=>{const s=r.source.configuration[0]||{};t(s)},configurationOnly:!0,existingConnector:n?{source:{...n.source,configuration:[]},storage:n.storage}:void 0,children:a.jsxs(we,{type:"button",variant:"outline",className:"dm-card-table-add-field-btn cursor-pointer",children:[a.jsx(sa,{className:"h-4 w-4"}),a.jsx("span",{children:"Configuration"})]})})})}function Zce({control:e,storageType:t,preset:n,autoOpen:r=!1,saveDataMartDefinition:s}){const{dataMart:i,runDataMart:c}=js(),{setValue:u,getValues:f,trigger:m}=pE(),[x,g]=h.useState(!1),[y,v]=h.useState(!1);h.useEffect(()=>{r&&v(!0)},[r]);const C=(i==null?void 0:i.status)??br.DRAFT,S=async B=>{u("definition",B,{shouldDirty:!0,shouldTouch:!0}),await m("definition")&&s&&s()},E=async B=>{const V=B.source,D=B.storage;await S({connector:{source:V,storage:D}})},j=async B=>{if(i){if(i.status.code!==br.PUBLISHED){Dt.error("Manual run is only available for published data marts");return}await c({id:i.id,payload:B})}},R=B=>async V=>{const F=f().definition;if(typeof F=="object"&&Gu(F)){const U=[...F.connector.source.configuration];U[B]=V.source.configuration[0]||{};const ee={connector:{...F.connector,source:{...F.connector.source,configuration:U}}};await S(ee)}},T=async B=>{const D=f().definition;if(typeof D=="object"&&Gu(D)){const F={connector:{...D.connector,source:{...D.connector.source,fields:B.source.fields}}};await S(F)}g(!1)},N=B=>{j({runType:B.runType,data:B.data})},A=B=>{const V=B.connector.source.fields.length;return a.jsxs(we,{type:"button",variant:"outline",onClick:()=>{g(!0)},className:"dm-card-table-add-field-btn cursor-pointer",children:[a.jsx(pF,{className:"h-4 w-4"}),a.jsxs("span",{children:["Edit Fields (",String(V),")"]})]})},[I,_]=h.useState(null),[M,G]=h.useState(!1),H=B=>{_(B),G(!0)},L=async()=>{I!==null&&(await q(I),_(null),G(!1))},q=async B=>{const D=f().definition;if(Gu(D)&&D.connector.source.configuration.length<=1){const F=HE($e.CONNECTOR);await S(F)}if(typeof D=="object"&&Gu(D)&&D.connector.source.configuration.length>1){const F={...D.connector.source,configuration:D.connector.source.configuration.filter((ee,he)=>he!==B)},U={connector:{...D.connector,source:F}};await S(U)}},W=async B=>{const D=f().definition;if(Gu(D)){const F={...D.connector.source,configuration:[...D.connector.source.configuration,B]},U={connector:{...D.connector,source:F}};await S(U)}};return a.jsxs(a.Fragment,{children:[a.jsx(bt,{control:e,name:"definition",render:({field:B})=>a.jsxs(mt,{className:"dark:bg-white/2",children:[a.jsx(xt,{children:a.jsx("div",{className:"space-y-3",children:!Pf(B.value)||C===br.DRAFT?a.jsx(Bce,{storageType:t,onSetupConnector:V=>{E(V),v(!1)},preset:n,isOpen:y,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(Wce,{storageType:t,onAddConfiguration:V=>void W(V),existingConnector:Pf(B.value)?{source:B.value.connector.source,storage:B.value.connector.storage}:void 0}),Pf(B.value)&&A(B.value)]}),a.jsx("div",{className:"flex items-center gap-2",children:(i==null?void 0:i.definitionType)===$e.CONNECTOR&&a.jsx(mS,{configuration:i.definition,onManualRun:N,children:a.jsxs(we,{variant:"outline",children:[a.jsx(Dh,{className:"h-4 w-4"}),a.jsx("span",{children:"Manual Run..."})]})})})]}),a.jsx("div",{className:"space-y-3",children:Pf(B.value)&&(i!=null&&i.storage)?B.value.connector.source.configuration.map((V,D)=>{const F=B.value;return a.jsx(md,{children:a.jsx(Kce,{configIndex:D,connectorDef:F,dataStorage:i.storage,onRemoveConfiguration:U=>{H(U)},onUpdateConfiguration:U=>R(U),dataMartStatus:typeof C=="object"?C.code:C,totalConfigurations:F.connector.source.configuration.length},D)},D)}):null})]})})}),a.jsx(Ct,{})]})}),a.jsx(md,{children:a.jsx(PM,{isOpen:x,onClose:()=>{g(!1)},onSubmit:B=>void T(B),dataStorageType:t,existingConnector:Pf(f().definition)?{source:f().definition.connector.source,storage:f().definition.connector.storage}:void 0,mode:"fields-only"})}),a.jsx(Ar,{open:M,onOpenChange:G,title:"Delete Configuration",description:"Are you sure you want to delete this configuration? This action cannot be undone.",confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:()=>{L()},onCancel:()=>{_(null)},variant:"destructive"})]})}function Yce({definitionType:e,storageType:t,preset:n,saveDataMartDefinition:r}){const{control:s}=pE(),[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(Ale,{control:s}),e===$e.TABLE&&a.jsx(Dle,{control:s,storageType:t}),e===$e.VIEW&&a.jsx(Ole,{control:s,storageType:t}),e===$e.TABLE_PATTERN&&a.jsx(Ile,{control:s,storageType:t}),e===$e.CONNECTOR&&a.jsx(Zce,{control:s,storageType:t,preset:n,autoOpen:i,saveDataMartDefinition:r})]})}function UM(){const[e]=o4(),t=e.get("preset");return h.useMemo(()=>{if(!t)return;const n=t.toLowerCase();return gne(n)},[t])}function Xce(e,t){const[n,r]=h.useState(e);return h.useEffect(()=>{const s=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(s)}},[e,t]),n}const Qce=1e3,Jce=[ts.SUCCESS,ts.ERROR,ts.CANCELLED];function eue(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:y}=i.current;if(g){y==null||y.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,y)=>{for(;!y.aborted&&c(g);)try{const v=await Tn.getSqlDryRunTriggerStatus(e,g);if(Jce.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,Qce))}catch(v){u(v),i.current={triggerId:null,abortController:null};return}},[e,c,u]),x=h.useCallback(async g=>{await f(),n(!0),s(null);try{const{triggerId:y}=await Tn.createSqlDryRunTrigger(e,g),v=new AbortController;i.current={triggerId:y,abortController:v},await m(y,v.signal)}catch(y){u(y)}},[e,f,m,u]);return h.useEffect(()=>()=>{const{triggerId:g,abortController:y}=i.current;y==null||y.abort(),g&&Tn.abortSqlDryRunTrigger(e,g).catch(()=>{})},[e]),{validateSql:x,isLoading:t,result:r,cancel:f}}const tue=300;function nue({sql:e,dataMartId:t,debounceDelay:n=tue,className:r="",onValidationStateChange:s}){const i=Xce(e.trim(),n),{validateSql:c,isLoading:u,result:f,cancel:m}=eue(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 x=()=>u?a.jsxs("div",{className:"flex h-5 items-center gap-2",children:[a.jsx(Uc,{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(XU,{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(rt,{children:[a.jsx(at,{asChild:!0,children:a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(Sc,{className:"h-3 w-3 text-gray-600"}),a.jsx("span",{className:"text-xs text-gray-600",children:vee(f.bytes)})]})}),a.jsx(st,{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(Kf,{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(Sc,{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:x()})}const rue={isValid:null,isLoading:!1,error:null},aue=(e,t)=>{if(e!==$e.SQL)return"";const n=t;return(n==null?void 0:n.sqlQuery)??""},sue=e=>HE(e);function oue({definitionType:e,initialDefinitionType:t,setDefinitionType:n}){const{dataMart:r,updateDataMartDefinition:s,runSchemaActualization:i}=js(),c=UM();if(!r)throw new Error("Data mart not found");const{definition:u,id:f,storage:{type:m}}=r,[,x]=h.useState(rue),[g,y]=h.useState(!1),v=h.useCallback(()=>{if(!e)return;const W={definitionType:e,definition:HE(e)};return u?{definitionType:e,definition:u}:W},[e,u]),C=h.useCallback(()=>{if(!e)return;const W=Nle(e,m);return Ai(W)},[e,m]),S=Lo({resolver:C(),defaultValues:v(),mode:"onChange"}),{handleSubmit:E,reset:j,watch:R,formState:{isDirty:T,isValid:N}}=S,A=R("definition"),I=aue(e,A);h.useEffect(()=>{e&&j(v())},[e,j,v]),h.useEffect(()=>{if(!e&&!t&&(c!=null&&c.definitionType)){n(c.definitionType);const W={definitionType:c.definitionType,definition:sue(c.definitionType)};j(W)}},[c,e,t,j,n]);const _=h.useCallback(W=>{x({isLoading:W.isLoading,isValid:W.isValid,error:W.error})},[]),M=h.useCallback(W=>{n(W)},[n]),G=h.useCallback(async W=>{if(e&&f)try{await s(f,W.definitionType,W.definition),y(!0),j(W)}catch(B){console.error("Failed to update data mart definition:",B)}},[f,e,s,j]);h.useEffect(()=>{g&&(y(!1),i==null||i())},[g,i]);const H=h.useCallback(W=>{W==null||W.preventDefault(),E(G)(W)},[E,G]),L=h.useCallback(()=>{j(v())},[j,v]),q=()=>e?a.jsxs("form",{onSubmit:H,className:"space-y-4",children:[a.jsx(Yce,{definitionType:e,storageType:m,preset:c==null?void 0:c.connectorSourceTitle,saveDataMartDefinition:H}),e!==$e.CONNECTOR&&a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx(we,{variant:"default",type:"submit",disabled:!N||!T,children:"Save"}),a.jsx(we,{type:"button",variant:"ghost",onClick:L,disabled:!T,children:"Discard"}),e===$e.SQL&&I&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"h-6 w-px bg-gray-300"}),a.jsx(nue,{sql:I,dataMartId:f,onValidationStateChange:_})]})]})]}):null;return a.jsx(XI,{...S,children:a.jsxs("div",{className:"space-y-4",children:[!t&&a.jsx(Ele,{initialType:e,onTypeSelect:M}),q()]})})}function iue(e){switch(e){case ce.GOOGLE_BIGQUERY:return{type:"bigquery-data-mart-schema",fields:[]};case ce.AWS_ATHENA:return{type:"athena-data-mart-schema",fields:[]};case ce.SNOWFLAKE:return{type:"snowflake-data-mart-schema",fields:[]};case ce.AWS_REDSHIFT:return{type:"redshift-data-mart-schema",fields:[]};case ce.DATABRICKS:return{type:"databricks-data-mart-schema",fields:[]};default:throw new Error(`Unsupported storage type: ${e}`)}}function zM(e){return e.type==="bigquery-data-mart-schema"}function FM(e){return e.type==="athena-data-mart-schema"}function HM(e){return e.type==="snowflake-data-mart-schema"}function zN(e){return e!==null&&typeof e=="object"&&"mode"in e}function FN(e){return e!==null&&typeof e=="object"&&"isPrimaryKey"in e}function HN(e){return e!==null&&typeof e=="object"&&"isPrimaryKey"in e&&!("mode"in e)}function $M(e){return e.type==="redshift-data-mart-schema"}function $N(e){return e!==null&&typeof e=="object"&&"isPrimaryKey"in e&&!("mode"in e)}function VM(e){return e.type==="databricks-data-mart-schema"}function VN(e){return e!==null&&typeof e=="object"&&"isPrimaryKey"in e&&!("mode"in e)}function lue(e){return e==null?"":typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):""}function Yb(e){return e==null?e:JSON.parse(JSON.stringify(e))}function cue(e){const t=Yb(e),[n,r]=h.useState(t),[s,i]=h.useState(!1);h.useEffect(()=>{const f=Yb(e);r(f),i(!1)},[e]);const c=h.useCallback(f=>{n?zM(n)&&f.every(zN)?(r({...n,fields:f}),i(!0)):FM(n)&&f.every(FN)?(r({...n,fields:f}),i(!0)):HM(n)&&f.every(HN)?(r({...n,fields:f}),i(!0)):$M(n)&&f.every($N)?(r({...n,fields:f}),i(!0)):VM(n)&&f.every(VN)&&(r({...n,fields:f}),i(!0)):f.length>0&&(zN(f[0])?(r({type:"bigquery-data-mart-schema",fields:f}),i(!0)):FN(f[0])?(r({type:"athena-data-mart-schema",fields:f}),i(!0)):HN(f[0])?(r({type:"snowflake-data-mart-schema",fields:f}),i(!0)):$N(f[0])?(r({type:"redshift-data-mart-schema",fields:f}),i(!0)):VN(f[0])&&(r({type:"databricks-data-mart-schema",fields:f}),i(!0)))},[n]),u=h.useCallback(()=>{const f=Yb(e);r(f),i(!1)},[e]);return{schema:n,isDirty:s,updateSchema:c,resetSchema:u,setIsDirty:i}}function uue(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 due(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 GM(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=>GM(c,t)):!1}function BM(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 x=BM(s.fields,t,c);x.length>0&&(r.includes(c)||r.push(c),r.push(...x))}}),r}function fue(e,t,n){const r=e.original;if(!n)return!0;const s=n.toLowerCase();return GM(r,s)}function hue(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 mue(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===ur.RECORD||E.type===ur.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,j="")=>{E.forEach((R,T)=>{const N=j?`${j}.${String(T)}`:String(T);(R.type===ur.RECORD||R.type===ur.STRUCT)&&R.fields&&R.fields.length>0&&(C.push(N),S(R.fields,N))})};S(e),n(E=>C.every(R=>E.has(R))?new Set:new Set(C))},[e]),m=h.useMemo(()=>{const C=[],S=(E,j="",R=0)=>{E.forEach((T,N)=>{const A=j?`${j}.${String(N)}`:String(N),I=T.type===ur.RECORD||T.type===ur.STRUCT;C.push({...T,path:A,level:R}),I&&T.fields&&t.has(A)&&S(T.fields,A,R+1)})};return S(e),C},[e,t]),x=h.useCallback(C=>{if(C!==i.current)if(i.current=C,C){r===null&&s(new Set(t));const E=BM(e,C).filter(j=>{const R=j.split(".").map(Number);let T=e,N;for(let A=0;A<R.length;A++){if(N=T[R[A]],!N)return!1;if((N.type===ur.RECORD||N.type===ur.STRUCT)&&N.fields&&N.fields.length>0)return!0;A<R.length-1&&(T=N.fields??[])}return!1});n(j=>{const R=new Set(j);return E.forEach(T=>{R.add(T)}),R})}else r!==null&&(n(r),s(null))},[e,t,r]),g=h.useCallback(C=>{const S=m[C];return S.type===ur.RECORD||S.type===ur.STRUCT},[m]),y=h.useMemo(()=>e.map(C=>({...C,fields:void 0})),[e]),v=h.useMemo(()=>{const C=[],S=(E,j="")=>{E.forEach((R,T)=>{const N=j?`${j}.${String(T)}`:String(T);(R.type===ur.RECORD||R.type===ur.STRUCT)&&R.fields&&R.fields.length>0&&(C.push(N),S(R.fields,N))})};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:x,isRecordType:g,topLevelFields:y,allExpanded:v}}function pue(e,t,n,r){const s=h.useCallback((f,m)=>{if(n){const x=[...e],g=t[f].path;if(!g)x[f]={...x[f],...m};else{const y=g.split(".").map(Number);let v=x,C;for(let E=0;E<y.length-1;E++)C=v[y[E]],v=C.fields??[];const S=y[y.length-1];v[S]&&(v[S]={...v[S],...m})}n(x)}},[e,t,n]),i=h.useCallback(()=>{if(n){const f={name:"",type:ur.STRING,mode:ph.NULLABLE,isPrimaryKey:!1,status:xa.DISCONNECTED};n([...e,f])}},[e,n]),c=h.useCallback(f=>{if(n){const m=[...e],x=t[f].path;if(!x)m.splice(f,1);else{const g=x.split(".").map(Number);let y=m,v;for(let S=0;S<g.length-1;S++)v=y[g[S]],y=v.fields??[];const C=g[g.length-1];y.splice(C,1)}n(m)}},[e,t,n]),u=h.useCallback(f=>{var m,x;if(n&&r){const g=[...e],y=t[f].path,v={name:"",type:ur.STRING,mode:ph.NULLABLE,isPrimaryKey:!1,status:xa.DISCONNECTED};if(!y)(m=g[f]).fields??(m.fields=[]),g[f].fields.push(v);else{const C=y.split(".").map(Number);let S=g;for(let E=0;E<C.length;E++){const j=C[E];E===C.length-1?((x=S[j]).fields??(x.fields=[]),S[j].fields.push(v)):S=S[j].fields??[]}}n(g)}},[e,t,n,r]);return{updateField:s,handleAddRow:i,handleDeleteRow:c,handleAddNestedField:u}}function cm(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 y=Number(i.id),v=Number(c.id),C=[...e],[S]=C.splice(y,1);C.splice(v,0,S),t(C);return}const u=n.findIndex((y,v)=>(y.path??String(v))===i.id),f=n.findIndex((y,v)=>(y.path??String(v))===c.id);if(u===-1||f===-1)return;const m=n[u].path,x=n[f].path,g=[...e];if(!m&&!x){const[y]=g.splice(u,1);g.splice(f,0,y),t(g);return}if(m&&x){const y=m.split(".").map(Number),v=x.split(".").map(Number);if(y.length===v.length&&y.slice(0,-1).join(".")===v.slice(0,-1).join(".")){let C=g;for(let R=0;R<y.length-1;R++)C=C[y[R]].fields??[];const S=y[y.length-1],E=v[v.length-1],[j]=C.splice(S,1);C.splice(E,0,j),t(g)}}},[e,n,t])}}function gue(){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 Ny=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Dd(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function ZE(e){return"nodeType"in e}function ka(e){var t,n;return e?Dd(e)?e:ZE(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function YE(e){const{Document:t}=ka(e);return e instanceof t}function um(e){return Dd(e)?!1:e instanceof ka(e).HTMLElement}function qM(e){return e instanceof ka(e).SVGElement}function Od(e){return e?Dd(e)?e.document:ZE(e)?YE(e)?e:um(e)||qM(e)?e.ownerDocument:document:document:document}const Ao=Ny?h.useLayoutEffect:h.useEffect;function XE(e){const t=h.useRef(e);return Ao(()=>{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 xue(){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 xh(e,t){t===void 0&&(t=[e]);const n=h.useRef(e);return Ao(()=>{n.current!==e&&(n.current=e)},t),n}function dm(e,t){const n=h.useRef();return h.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function ux(e){const t=XE(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 wS(e){const t=h.useRef();return h.useEffect(()=>{t.current=e},[e]),t.current}let Xb={};function fm(e,t){return h.useMemo(()=>{if(t)return t;const n=Xb[e]==null?0:Xb[e]+1;return Xb[e]=n,e+"-"+n},[e,t])}function KM(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 x=i[f];x!=null&&(i[f]=x+e*m)}return i},{...t})}}const rd=KM(1),dx=KM(-1);function yue(e){return"clientX"in e&&"clientY"in e}function QE(e){if(!e)return!1;const{KeyboardEvent:t}=ka(e.target);return t&&e instanceof t}function vue(e){if(!e)return!1;const{TouchEvent:t}=ka(e.target);return t&&e instanceof t}function RS(e){if(vue(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 yue(e)?{x:e.clientX,y:e.clientY}:null}const yh=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[yh.Translate.toString(e),yh.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),GN="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function bue(e){return e.matches(GN)?e:e.querySelector(GN)}const Sue={display:"none"};function Cue(e){let{id:t,value:n}=e;return re.createElement("div",{id:t,style:Sue},n)}function Eue(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 wue(){const[e,t]=h.useState("");return{announce:h.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const WM=h.createContext(null);function Rue(e){const t=h.useContext(WM);h.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function jue(){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 Tue={draggable:`
|
|
834
|
+
To pick up a draggable item, press the space bar.
|
|
835
|
+
While dragging, use the arrow keys to move the item.
|
|
836
|
+
Press space again to drop the item in its new position, or press escape to cancel.
|
|
837
|
+
`},_ue={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 Nue(e){let{announcements:t=_ue,container:n,hiddenTextDescribedById:r,screenReaderInstructions:s=Tue}=e;const{announce:i,announcement:c}=wue(),u=fm("DndLiveRegion"),[f,m]=h.useState(!1);if(h.useEffect(()=>{m(!0)},[]),Rue(h.useMemo(()=>({onDragStart(g){let{active:y}=g;i(t.onDragStart({active:y}))},onDragMove(g){let{active:y,over:v}=g;t.onDragMove&&i(t.onDragMove({active:y,over:v}))},onDragOver(g){let{active:y,over:v}=g;i(t.onDragOver({active:y,over:v}))},onDragEnd(g){let{active:y,over:v}=g;i(t.onDragEnd({active:y,over:v}))},onDragCancel(g){let{active:y,over:v}=g;i(t.onDragCancel({active:y,over:v}))}}),[i,t])),!f)return null;const x=re.createElement(re.Fragment,null,re.createElement(Cue,{id:r,value:s.draggable}),re.createElement(Eue,{id:u,announcement:c}));return n?Gs.createPortal(x,n):x}var Tr;(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"})(Tr||(Tr={}));function fx(){}function hm(e,t){return h.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function mm(){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 Xs=Object.freeze({x:0,y:0});function Aue(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Due(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Oue(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Iue(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function BN(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 pm=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const s=BN(t,t.left,t.top),i=[];for(const c of r){const{id:u}=c,f=n.get(u);if(f){const m=Aue(BN(f),s);i.push({id:u,data:{droppableContainer:c,value:m}})}}return i.sort(Due)};function Mue(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,x=c*u,g=x/(f+m-x);return Number(g.toFixed(4))}return 0}const kue=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=Mue(u,t);f>0&&s.push({id:c,data:{droppableContainer:i,value:f}})}}return s.sort(Oue)};function Lue(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function ZM(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Xs}function Pue(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 Uue=Pue(1);function zue(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 Fue(e,t,n){const r=zue(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)),x=s?e.width/s:e.width,g=i?e.height/i:e.height;return{width:x,height:g,top:m,right:f+x,bottom:m+g,left:f}}const Hue={ignoreTransform:!1};function Id(e,t){t===void 0&&(t=Hue);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:m,transformOrigin:x}=ka(e).getComputedStyle(e);m&&(n=Fue(n,m,x))}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 qN(e){return Id(e,{ignoreTransform:!0})}function $ue(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function Vue(e,t){return t===void 0&&(t=ka(e).getComputedStyle(e)),t.position==="fixed"}function Gue(e,t){t===void 0&&(t=ka(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 JE(e,t){const n=[];function r(s){if(t!=null&&n.length>=t||!s)return n;if(YE(s)&&s.scrollingElement!=null&&!n.includes(s.scrollingElement))return n.push(s.scrollingElement),n;if(!um(s)||qM(s)||n.includes(s))return n;const i=ka(e).getComputedStyle(s);return s!==e&&Gue(s,i)&&n.push(s),Vue(s,i)?n:r(s.parentNode)}return e?r(e):n}function YM(e){const[t]=JE(e,1);return t??null}function Qb(e){return!Ny||!e?null:Dd(e)?e:ZE(e)?YE(e)||e===Od(e).scrollingElement?window:um(e)?e:null:null}function XM(e){return Dd(e)?e.scrollX:e.scrollLeft}function QM(e){return Dd(e)?e.scrollY:e.scrollTop}function jS(e){return{x:XM(e),y:QM(e)}}var Fr;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Fr||(Fr={}));function JM(e){return!Ny||!e?!1:e===document.scrollingElement}function ek(e){const t={x:0,y:0},n=JM(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 Bue={x:.2,y:.2};function que(e,t,n,r,s){let{top:i,left:c,right:u,bottom:f}=n;r===void 0&&(r=10),s===void 0&&(s=Bue);const{isTop:m,isBottom:x,isLeft:g,isRight:y}=ek(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=Fr.Backward,C.y=r*Math.abs((t.top+S.height-i)/S.height)):!x&&f>=t.bottom-S.height&&(v.y=Fr.Forward,C.y=r*Math.abs((t.bottom-S.height-f)/S.height)),!y&&u>=t.right-S.width?(v.x=Fr.Forward,C.x=r*Math.abs((t.right-S.width-u)/S.width)):!g&&c<=t.left+S.width&&(v.x=Fr.Backward,C.x=r*Math.abs((t.left+S.width-c)/S.width)),{direction:v,speed:C}}function Kue(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 tk(e){return e.reduce((t,n)=>rd(t,jS(n)),Xs)}function Wue(e){return e.reduce((t,n)=>t+XM(n),0)}function Zue(e){return e.reduce((t,n)=>t+QM(n),0)}function Yue(e,t){if(t===void 0&&(t=Id),!e)return;const{top:n,left:r,bottom:s,right:i}=t(e);YM(e)&&(s<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Xue=[["x",["left","right"],Wue],["y",["top","bottom"],Zue]];class e2{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=JE(n),s=tk(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,c,u]of Xue)for(const f of c)Object.defineProperty(this,f,{get:()=>{const m=u(r),x=s[i]-m;return this.rect[f]+x},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Jf{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 Que(e){const{EventTarget:t}=ka(e);return e instanceof t?e:Od(e)}function Jb(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 bs;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(bs||(bs={}));function KN(e){e.preventDefault()}function Jue(e){e.stopPropagation()}var Cn;(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"})(Cn||(Cn={}));const nk={start:[Cn.Space,Cn.Enter],cancel:[Cn.Esc],end:[Cn.Space,Cn.Enter,Cn.Tab]},ede=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Cn.Right:return{...n,x:n.x+25};case Cn.Left:return{...n,x:n.x-25};case Cn.Down:return{...n,y:n.y+25};case Cn.Up:return{...n,y:n.y-25}}};class rk{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 Jf(Od(n)),this.windowListeners=new Jf(ka(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(bs.Resize,this.handleCancel),this.windowListeners.add(bs.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(bs.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&Yue(r),n(Xs)}handleKeyDown(t){if(QE(t)){const{active:n,context:r,options:s}=this.props,{keyboardCodes:i=nk,coordinateGetter:c=ede,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,x=m?{x:m.left,y:m.top}:Xs;this.referenceCoordinates||(this.referenceCoordinates=x);const g=c(t,{active:n,context:r.current,currentCoordinates:x});if(g){const y=dx(g,x),v={x:0,y:0},{scrollableAncestors:C}=r.current;for(const S of C){const E=t.code,{isTop:j,isRight:R,isLeft:T,isBottom:N,maxScroll:A,minScroll:I}=ek(S),_=Kue(S),M={x:Math.min(E===Cn.Right?_.right-_.width/2:_.right,Math.max(E===Cn.Right?_.left:_.left+_.width/2,g.x)),y:Math.min(E===Cn.Down?_.bottom-_.height/2:_.bottom,Math.max(E===Cn.Down?_.top:_.top+_.height/2,g.y))},G=E===Cn.Right&&!R||E===Cn.Left&&!T,H=E===Cn.Down&&!N||E===Cn.Up&&!j;if(G&&M.x!==g.x){const L=S.scrollLeft+y.x,q=E===Cn.Right&&L<=A.x||E===Cn.Left&&L>=I.x;if(q&&!y.y){S.scrollTo({left:L,behavior:u});return}q?v.x=S.scrollLeft-L:v.x=E===Cn.Right?S.scrollLeft-A.x:S.scrollLeft-I.x,v.x&&S.scrollBy({left:-v.x,behavior:u});break}else if(H&&M.y!==g.y){const L=S.scrollTop+y.y,q=E===Cn.Down&&L<=A.y||E===Cn.Up&&L>=I.y;if(q&&!y.x){S.scrollTo({top:L,behavior:u});return}q?v.y=S.scrollTop-L:v.y=E===Cn.Down?S.scrollTop-A.y:S.scrollTop-I.y,v.y&&S.scrollBy({top:-v.y,behavior:u});break}}this.handleMove(t,rd(dx(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()}}rk.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=nk,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 WN(e){return!!(e&&"distance"in e)}function ZN(e){return!!(e&&"delay"in e)}class t2{constructor(t,n,r){var s;r===void 0&&(r=Que(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=Od(c),this.documentListeners=new Jf(this.document),this.listeners=new Jf(r),this.windowListeners=new Jf(ka(c)),this.initialCoordinates=(s=RS(i))!=null?s:Xs,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(bs.Resize,this.handleCancel),this.windowListeners.add(bs.DragStart,KN),this.windowListeners.add(bs.VisibilityChange,this.handleCancel),this.windowListeners.add(bs.ContextMenu,KN),this.documentListeners.add(bs.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(ZN(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(WN(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(bs.Click,Jue,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(bs.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=RS(t))!=null?n:Xs,m=dx(s,f);if(!r&&u){if(WN(u)){if(u.tolerance!=null&&Jb(m,u.tolerance))return this.handleCancel();if(Jb(m,u.distance))return this.handleStart()}if(ZN(u)&&Jb(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===Cn.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const tde={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Yc extends t2{constructor(t){const{event:n}=t,r=Od(n.target);super(t,tde,r)}}Yc.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 nde={move:{name:"mousemove"},end:{name:"mouseup"}};var TS;(function(e){e[e.RightClick=2]="RightClick"})(TS||(TS={}));class rde extends t2{constructor(t){super(t,nde,Od(t.event.target))}}rde.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===TS.RightClick?!1:(r==null||r({event:n}),!0)}}];const e1={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class ade extends t2{constructor(t){super(t,e1)}static setup(){return window.addEventListener(e1.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(e1.move.name,t)};function t(){}}}ade.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 eh;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(eh||(eh={}));var hx;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(hx||(hx={}));function sde(e){let{acceleration:t,activator:n=eh.Pointer,canScroll:r,draggingRect:s,enabled:i,interval:c=5,order:u=hx.TreeOrder,pointerCoordinates:f,scrollableAncestors:m,scrollableAncestorRects:x,delta:g,threshold:y}=e;const v=ide({delta:g,disabled:!i}),[C,S]=xue(),E=h.useRef({x:0,y:0}),j=h.useRef({x:0,y:0}),R=h.useMemo(()=>{switch(n){case eh.Pointer:return f?{top:f.y,bottom:f.y,left:f.x,right:f.x}:null;case eh.DraggableRect:return s}},[n,s,f]),T=h.useRef(null),N=h.useCallback(()=>{const I=T.current;if(!I)return;const _=E.current.x*j.current.x,M=E.current.y*j.current.y;I.scrollBy(_,M)},[]),A=h.useMemo(()=>u===hx.TreeOrder?[...m].reverse():m,[u,m]);h.useEffect(()=>{if(!i||!m.length||!R){S();return}for(const I of A){if((r==null?void 0:r(I))===!1)continue;const _=m.indexOf(I),M=x[_];if(!M)continue;const{direction:G,speed:H}=que(I,M,R,t,y);for(const L of["x","y"])v[L][G[L]]||(H[L]=0,G[L]=0);if(H.x>0||H.y>0){S(),T.current=I,C(N,c),E.current=H,j.current=G;return}}E.current={x:0,y:0},j.current={x:0,y:0},S()},[t,N,r,S,i,c,JSON.stringify(R),JSON.stringify(v),C,m,A,x,JSON.stringify(y)])}const ode={x:{[Fr.Backward]:!1,[Fr.Forward]:!1},y:{[Fr.Backward]:!1,[Fr.Forward]:!1}};function ide(e){let{delta:t,disabled:n}=e;const r=wS(t);return dm(s=>{if(n||!r||!s)return ode;const i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[Fr.Backward]:s.x[Fr.Backward]||i.x===-1,[Fr.Forward]:s.x[Fr.Forward]||i.x===1},y:{[Fr.Backward]:s.y[Fr.Backward]||i.y===-1,[Fr.Forward]:s.y[Fr.Forward]||i.y===1}}},[n,t,r])}function lde(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return dm(s=>{var i;return t==null?null:(i=r??s)!=null?i:null},[r,t])}function cde(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 vh;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(vh||(vh={}));var _S;(function(e){e.Optimized="optimized"})(_S||(_S={}));const YN=new Map;function ude(e,t){let{dragging:n,dependencies:r,config:s}=t;const[i,c]=h.useState(null),{frequency:u,measure:f,strategy:m}=s,x=h.useRef(e),g=E(),y=xh(g),v=h.useCallback(function(j){j===void 0&&(j=[]),!y.current&&c(R=>R===null?j:R.concat(j.filter(T=>!R.includes(T))))},[y]),C=h.useRef(null),S=dm(j=>{if(g&&!n)return YN;if(!j||j===YN||x.current!==e||i!=null){const R=new Map;for(let T of e){if(!T)continue;if(i&&i.length>0&&!i.includes(T.id)&&T.rect.current){R.set(T.id,T.rect.current);continue}const N=T.node.current,A=N?new e2(f(N),N):null;T.rect.current=A,A&&R.set(T.id,A)}return R}return j},[e,i,n,g,f]);return h.useEffect(()=>{x.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 vh.Always:return!1;case vh.BeforeDragging:return n;default:return!n}}}function ak(e,t){return dm(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function dde(e,t){return ak(e,t)}function fde(e){let{callback:t,disabled:n}=e;const r=XE(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 Ay(e){let{callback:t,disabled:n}=e;const r=XE(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 hde(e){return new e2(Id(e),e)}function XN(e,t,n){t===void 0&&(t=hde);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 x=t(e);return JSON.stringify(f)===JSON.stringify(x)?f:x})}const c=fde({callback(f){if(e)for(const m of f){const{type:x,target:g}=m;if(x==="childList"&&g instanceof HTMLElement&&g.contains(e)){i();break}}}}),u=Ay({callback:i});return Ao(()=>{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 mde(e){const t=ak(e);return ZM(e,t)}const QN=[];function pde(e){const t=h.useRef(e),n=dm(r=>e?r&&r!==QN&&e&&t.current&&e.parentNode===t.current.parentNode?r:JE(e):QN,[e]);return h.useEffect(()=>{t.current=e},[e]),n}function gde(e){const[t,n]=h.useState(null),r=h.useRef(e),s=h.useCallback(i=>{const c=Qb(i.target);c&&n(u=>u?(u.set(c,jS(c)),new Map(u)):null)},[]);return h.useEffect(()=>{const i=r.current;if(e!==i){c(i);const u=e.map(f=>{const m=Qb(f);return m?(m.addEventListener("scroll",s,{passive:!0}),[m,jS(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=Qb(f);m==null||m.removeEventListener("scroll",s)})}},[s,e]),h.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,c)=>rd(i,c),Xs):tk(e):Xs,[e,t])}function JN(e,t){t===void 0&&(t=[]);const n=h.useRef(null);return h.useEffect(()=>{n.current=null},t),h.useEffect(()=>{const r=e!==Xs;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?dx(e,n.current):Xs}function xde(e){h.useEffect(()=>{if(!Ny)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 yde(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 sk(e){return h.useMemo(()=>e?$ue(e):null,[e])}const eA=[];function vde(e,t){t===void 0&&(t=Id);const[n]=e,r=sk(n?ka(n):null),[s,i]=h.useState(eA);function c(){i(()=>e.length?e.map(f=>JM(f)?r:new e2(t(f),f)):eA)}const u=Ay({callback:c});return Ao(()=>{u==null||u.disconnect(),c(),e.forEach(f=>u==null?void 0:u.observe(f))},[e]),s}function bde(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return um(t)?t:e}function Sde(e){let{measure:t}=e;const[n,r]=h.useState(null),s=h.useCallback(m=>{for(const{target:x}of m)if(um(x)){r(g=>{const y=t(x);return g?{...g,width:y.width,height:y.height}:y});break}},[t]),i=Ay({callback:s}),c=h.useCallback(m=>{const x=bde(m);i==null||i.disconnect(),x&&(i==null||i.observe(x)),r(x?t(x):null)},[t,i]),[u,f]=ux(c);return h.useMemo(()=>({nodeRef:u,rect:n,setRef:f}),[n,u,f])}const Cde=[{sensor:Yc,options:{}},{sensor:rk,options:{}}],Ede={current:{}},Eg={draggable:{measure:qN},droppable:{measure:qN,strategy:vh.WhileDragging,frequency:_S.Optimized},dragOverlay:{measure:Id}};class th 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 wde={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new th,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:fx},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Eg,measureDroppableContainers:fx,windowRect:null,measuringScheduled:!1},Rde={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:fx,draggableNodes:new Map,over:null,measureDroppableContainers:fx},Dy=h.createContext(Rde),ok=h.createContext(wde);function jde(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new th}}}function Tde(e,t){switch(t.type){case Tr.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Tr.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 Tr.DragEnd:case Tr.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Tr.RegisterDroppable:{const{element:n}=t,{id:r}=n,s=new th(e.droppable.containers);return s.set(r,n),{...e,droppable:{...e.droppable,containers:s}}}case Tr.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 th(e.droppable.containers);return c.set(n,{...i,disabled:s}),{...e,droppable:{...e.droppable,containers:c}}}case Tr.UnregisterDroppable:{const{id:n,key:r}=t,s=e.droppable.containers.get(n);if(!s||r!==s.key)return e;const i=new th(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function _de(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:s}=h.useContext(Dy),i=wS(r),c=wS(n==null?void 0:n.id);return h.useEffect(()=>{if(!t&&!r&&i&&c!=null){if(!QE(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 x of[f.current,m.current]){if(!x)continue;const g=bue(x);if(g){g.focus();break}}})}},[r,t,s,c,i]),null}function Nde(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((s,i)=>i({transform:s,...r}),n):n}function Ade(e){return h.useMemo(()=>({draggable:{...Eg.draggable,...e==null?void 0:e.draggable},droppable:{...Eg.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Eg.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 Dde(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;Ao(()=>{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 x=n(m),g=ZM(x,r);if(c||(g.x=0),u||(g.y=0),i.current=!0,Math.abs(g.x)>0||Math.abs(g.y)>0){const y=YM(m);y&&y.scrollBy({top:g.y,left:g.x})}},[t,c,u,r,n])}const ik=h.createContext({...Xs,scaleX:1,scaleY:1});var sl;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(sl||(sl={}));const gm=h.memo(function(t){var n,r,s,i;let{id:c,accessibility:u,autoScroll:f=!0,children:m,sensors:x=Cde,collisionDetection:g=kue,measuring:y,modifiers:v,...C}=t;const S=h.useReducer(Tde,void 0,jde),[E,j]=S,[R,T]=jue(),[N,A]=h.useState(sl.Uninitialized),I=N===sl.Initialized,{draggable:{active:_,nodes:M,translate:G},droppable:{containers:H}}=E,L=_!=null?M.get(_):null,q=h.useRef({initial:null,translated:null}),W=h.useMemo(()=>{var _n;return _!=null?{id:_,data:(_n=L==null?void 0:L.data)!=null?_n:Ede,rect:q}:null},[_,L]),B=h.useRef(null),[V,D]=h.useState(null),[F,U]=h.useState(null),ee=xh(C,Object.values(C)),he=fm("DndDescribedBy",c),z=h.useMemo(()=>H.getEnabled(),[H]),$=Ade(y),{droppableRects:P,measureDroppableContainers:K,measuringScheduled:Y}=ude(z,{dragging:I,dependencies:[G.x,G.y],config:$.droppable}),se=lde(M,_),Q=h.useMemo(()=>F?RS(F):null,[F]),le=Ns(),pe=dde(se,$.draggable.measure);Dde({activeNode:_!=null?M.get(_):null,config:le.layoutShiftCompensation,initialRect:pe,measure:$.draggable.measure});const be=XN(se,$.draggable.measure,pe),ze=XN(se?se.parentElement:null),Re=h.useRef({activatorEvent:null,active:null,activeNode:se,collisionRect:null,collisions:null,droppableRects:P,draggableNodes:M,draggingNode:null,draggingNodeRect:null,droppableContainers:H,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Ge=H.getNodeFor((n=Re.current.over)==null?void 0:n.id),ot=Sde({measure:$.dragOverlay.measure}),Vt=(r=ot.nodeRef.current)!=null?r:se,He=I?(s=ot.rect)!=null?s:be:null,Xt=!!(ot.nodeRef.current&&ot.rect),gn=mde(Xt?null:be),ke=sk(Vt?ka(Vt):null),It=pde(I?Ge??se:null),Z=vde(It),ae=Nde(v,{transform:{x:G.x-gn.x,y:G.y-gn.y,scaleX:1,scaleY:1},activatorEvent:F,active:W,activeNodeRect:be,containerNodeRect:ze,draggingNodeRect:He,over:Re.current.over,overlayNodeRect:ot.rect,scrollableAncestors:It,scrollableAncestorRects:Z,windowRect:ke}),ge=Q?rd(Q,G):null,Te=gde(It),Oe=JN(Te),je=JN(Te,[be]),Ve=rd(ae,Oe),lt=He?Uue(He,ae):null,dt=W&<?g({active:W,collisionRect:lt,droppableRects:P,droppableContainers:z,pointerCoordinates:ge}):null,vn=Iue(dt,"id"),[Wn,$n]=h.useState(null),La=Xt?ae:rd(ae,je),bn=Lue(La,(i=Wn==null?void 0:Wn.rect)!=null?i:null,be),Qn=h.useRef(null),Vn=h.useCallback((_n,Ln)=>{let{sensor:Xe,options:nn}=Ln;if(B.current==null)return;const cn=M.get(B.current);if(!cn)return;const rn=_n.nativeEvent,Gn=new Xe({active:B.current,activeNode:cn,event:rn,options:nn,context:Re,onAbort(un){if(!M.get(un))return;const{onDragAbort:X}=ee.current,te={id:un};X==null||X(te),R({type:"onDragAbort",event:te})},onPending(un,Lr,X,te){if(!M.get(un))return;const{onDragPending:Ce}=ee.current,Ne={id:un,constraint:Lr,initialCoordinates:X,offset:te};Ce==null||Ce(Ne),R({type:"onDragPending",event:Ne})},onStart(un){const Lr=B.current;if(Lr==null)return;const X=M.get(Lr);if(!X)return;const{onDragStart:te}=ee.current,ue={activatorEvent:rn,active:{id:Lr,data:X.data,rect:q}};Gs.unstable_batchedUpdates(()=>{te==null||te(ue),A(sl.Initializing),j({type:Tr.DragStart,initialCoordinates:un,active:Lr}),R({type:"onDragStart",event:ue}),D(Qn.current),U(rn)})},onMove(un){j({type:Tr.DragMove,coordinates:un})},onEnd:dn(Tr.DragEnd),onCancel:dn(Tr.DragCancel)});Qn.current=Gn;function dn(un){return async function(){const{active:X,collisions:te,over:ue,scrollAdjustedTranslate:Ce}=Re.current;let Ne=null;if(X&&Ce){const{cancelDrop:Ke}=ee.current;Ne={activatorEvent:rn,active:X,collisions:te,delta:Ce,over:ue},un===Tr.DragEnd&&typeof Ke=="function"&&await Promise.resolve(Ke(Ne))&&(un=Tr.DragCancel)}B.current=null,Gs.unstable_batchedUpdates(()=>{j({type:un}),A(sl.Uninitialized),$n(null),D(null),U(null),Qn.current=null;const Ke=un===Tr.DragEnd?"onDragEnd":"onDragCancel";if(Ne){const Be=ee.current[Ke];Be==null||Be(Ne),R({type:Ke,event:Ne})}})}}},[M]),_s=h.useCallback((_n,Ln)=>(Xe,nn)=>{const cn=Xe.nativeEvent,rn=M.get(nn);if(B.current!==null||!rn||cn.dndKit||cn.defaultPrevented)return;const Gn={active:rn};_n(Xe,Ln.options,Gn)===!0&&(cn.dndKit={capturedBy:Ln.sensor},B.current=nn,Vn(Xe,Ln))},[M,Vn]),ls=cde(x,_s);xde(x),Ao(()=>{be&&N===sl.Initializing&&A(sl.Initialized)},[be,N]),h.useEffect(()=>{const{onDragMove:_n}=ee.current,{active:Ln,activatorEvent:Xe,collisions:nn,over:cn}=Re.current;if(!Ln||!Xe)return;const rn={active:Ln,activatorEvent:Xe,collisions:nn,delta:{x:Ve.x,y:Ve.y},over:cn};Gs.unstable_batchedUpdates(()=>{_n==null||_n(rn),R({type:"onDragMove",event:rn})})},[Ve.x,Ve.y]),h.useEffect(()=>{const{active:_n,activatorEvent:Ln,collisions:Xe,droppableContainers:nn,scrollAdjustedTranslate:cn}=Re.current;if(!_n||B.current==null||!Ln||!cn)return;const{onDragOver:rn}=ee.current,Gn=nn.get(vn),dn=Gn&&Gn.rect.current?{id:Gn.id,rect:Gn.rect.current,data:Gn.data,disabled:Gn.disabled}:null,un={active:_n,activatorEvent:Ln,collisions:Xe,delta:{x:cn.x,y:cn.y},over:dn};Gs.unstable_batchedUpdates(()=>{$n(dn),rn==null||rn(un),R({type:"onDragOver",event:un})})},[vn]),Ao(()=>{Re.current={activatorEvent:F,active:W,activeNode:se,collisionRect:lt,collisions:dt,droppableRects:P,draggableNodes:M,draggingNode:Vt,draggingNodeRect:He,droppableContainers:H,over:Wn,scrollableAncestors:It,scrollAdjustedTranslate:Ve},q.current={initial:He,translated:lt}},[W,se,dt,lt,M,Vt,He,P,H,Wn,It,Ve]),sde({...le,delta:G,draggingRect:lt,pointerCoordinates:ge,scrollableAncestors:It,scrollableAncestorRects:Z});const kr=h.useMemo(()=>({active:W,activeNode:se,activeNodeRect:be,activatorEvent:F,collisions:dt,containerNodeRect:ze,dragOverlay:ot,draggableNodes:M,droppableContainers:H,droppableRects:P,over:Wn,measureDroppableContainers:K,scrollableAncestors:It,scrollableAncestorRects:Z,measuringConfiguration:$,measuringScheduled:Y,windowRect:ke}),[W,se,be,F,dt,ze,ot,M,H,P,Wn,K,It,Z,$,Y,ke]),Pa=h.useMemo(()=>({activatorEvent:F,activators:ls,active:W,activeNodeRect:be,ariaDescribedById:{draggable:he},dispatch:j,draggableNodes:M,over:Wn,measureDroppableContainers:K}),[F,ls,W,be,j,he,M,Wn,K]);return re.createElement(WM.Provider,{value:T},re.createElement(Dy.Provider,{value:Pa},re.createElement(ok.Provider,{value:kr},re.createElement(ik.Provider,{value:bn},m)),re.createElement(_de,{disabled:(u==null?void 0:u.restoreFocus)===!1})),re.createElement(Nue,{...u,hiddenTextDescribedById:he}));function Ns(){const _n=(V==null?void 0:V.autoScrollEnabled)===!1,Ln=typeof f=="object"?f.enabled===!1:f===!1,Xe=I&&!_n&&!Ln;return typeof f=="object"?{...f,enabled:Xe}:{enabled:Xe}}}),Ode=h.createContext(null),tA="button",Ide="Draggable";function Mde(e){let{id:t,data:n,disabled:r=!1,attributes:s}=e;const i=fm(Ide),{activators:c,activatorEvent:u,active:f,activeNodeRect:m,ariaDescribedById:x,draggableNodes:g,over:y}=h.useContext(Dy),{role:v=tA,roleDescription:C="draggable",tabIndex:S=0}=s??{},E=(f==null?void 0:f.id)===t,j=h.useContext(E?ik:Ode),[R,T]=ux(),[N,A]=ux(),I=yde(c,t),_=xh(n);Ao(()=>(g.set(t,{id:t,key:i,node:R,activatorNode:N,data:_}),()=>{const G=g.get(t);G&&G.key===i&&g.delete(t)}),[g,t]);const M=h.useMemo(()=>({role:v,tabIndex:S,"aria-disabled":r,"aria-pressed":E&&v===tA?!0:void 0,"aria-roledescription":C,"aria-describedby":x.draggable}),[r,v,S,E,C,x.draggable]);return{active:f,activatorEvent:u,activeNodeRect:m,attributes:M,isDragging:E,listeners:r?void 0:I,node:R,over:y,setNodeRef:T,setActivatorNodeRef:A,transform:j}}function kde(){return h.useContext(ok)}const Lde="Droppable",Pde={timeout:25};function Ude(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:s}=e;const i=fm(Lde),{active:c,dispatch:u,over:f,measureDroppableContainers:m}=h.useContext(Dy),x=h.useRef({disabled:n}),g=h.useRef(!1),y=h.useRef(null),v=h.useRef(null),{disabled:C,updateMeasurementsFor:S,timeout:E}={...Pde,...s},j=xh(S??r),R=h.useCallback(()=>{if(!g.current){g.current=!0;return}v.current!=null&&clearTimeout(v.current),v.current=setTimeout(()=>{m(Array.isArray(j.current)?j.current:[j.current]),v.current=null},E)},[E]),T=Ay({callback:R,disabled:C||!c}),N=h.useCallback((M,G)=>{T&&(G&&(T.unobserve(G),g.current=!1),M&&T.observe(M))},[T]),[A,I]=ux(N),_=xh(t);return h.useEffect(()=>{!T||!A.current||(T.disconnect(),g.current=!1,T.observe(A.current))},[A,T]),h.useEffect(()=>(u({type:Tr.RegisterDroppable,element:{id:r,key:i,disabled:n,node:A,rect:y,data:_}}),()=>u({type:Tr.UnregisterDroppable,key:i,id:r})),[r]),h.useEffect(()=>{n!==x.current.disabled&&(u({type:Tr.SetDroppableDisabled,id:r,key:i,disabled:n}),x.current.disabled=n)},[r,i,n,u]),{active:c,rect:y,isOver:(f==null?void 0:f.id)===r,node:A,over:f,setNodeRef:I}}function lk(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function zde(e,t){return e.reduce((n,r,s)=>{const i=t.get(r);return i&&(n[s]=i),n},Array(e.length))}function og(e){return e!==null&&e>=0}function Fde(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 Hde(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const ck=e=>{let{rects:t,activeIndex:n,overIndex:r,index:s}=e;const i=lk(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}},ig={scaleX:1,scaleY:1},xm=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,...ig}:null}const f=$de(i,s,n);return s>n&&s<=c?{x:0,y:-u.height-f,...ig}:s<n&&s>=c?{x:0,y:u.height+f,...ig}:{x:0,y:0,...ig}};function $de(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 uk="Sortable",dk=re.createContext({activeIndex:-1,containerId:uk,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:ck,disabled:{draggable:!1,droppable:!1}});function ym(e){let{children:t,id:n,items:r,strategy:s=ck,disabled:i=!1}=e;const{active:c,dragOverlay:u,droppableRects:f,over:m,measureDroppableContainers:x}=kde(),g=fm(uk,n),y=u.rect!==null,v=h.useMemo(()=>r.map(I=>typeof I=="object"&&"id"in I?I.id:I),[r]),C=c!=null,S=c?v.indexOf(c.id):-1,E=m?v.indexOf(m.id):-1,j=h.useRef(v),R=!Fde(v,j.current),T=E!==-1&&S===-1||R,N=Hde(i);Ao(()=>{R&&C&&x(v)},[R,v,C,x]),h.useEffect(()=>{j.current=v},[v]);const A=h.useMemo(()=>({activeIndex:S,containerId:g,disabled:N,disableTransforms:T,items:v,overIndex:E,useDragOverlay:y,sortedRects:zde(v,f),strategy:s}),[S,g,N.draggable,N.droppable,T,v,E,f,y,s]);return re.createElement(dk.Provider,{value:A},t)}const Vde=e=>{let{id:t,items:n,activeIndex:r,overIndex:s}=e;return lk(n,r,s).indexOf(t)},Gde=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},Bde={duration:200,easing:"ease"},fk="transform",qde=yh.Transition.toString({property:fk,duration:0,easing:"linear"}),Kde={roleDescription:"sortable"};function Wde(e){let{disabled:t,index:n,node:r,rect:s}=e;const[i,c]=h.useState(null),u=h.useRef(n);return Ao(()=>{if(!t&&n!==u.current&&r.current){const f=s.current;if(f){const m=Id(r.current,{ignoreTransform:!0}),x={x:f.left-m.left,y:f.top-m.top,scaleX:f.width/m.width,scaleY:f.height/m.height};(x.x||x.y)&&c(x)}}n!==u.current&&(u.current=n)},[t,n,r,s]),h.useEffect(()=>{i&&c(null)},[i]),i}function Zde(e){let{animateLayoutChanges:t=Gde,attributes:n,disabled:r,data:s,getNewIndex:i=Vde,id:c,strategy:u,resizeObserverConfig:f,transition:m=Bde}=e;const{items:x,containerId:g,activeIndex:y,disabled:v,disableTransforms:C,sortedRects:S,overIndex:E,useDragOverlay:j,strategy:R}=h.useContext(dk),T=Yde(r,v),N=x.indexOf(c),A=h.useMemo(()=>({sortable:{containerId:g,index:N,items:x},...s}),[g,s,N,x]),I=h.useMemo(()=>x.slice(x.indexOf(c)),[x,c]),{rect:_,node:M,isOver:G,setNodeRef:H}=Ude({id:c,data:A,disabled:T.droppable,resizeObserverConfig:{updateMeasurementsFor:I,...f}}),{active:L,activatorEvent:q,activeNodeRect:W,attributes:B,setNodeRef:V,listeners:D,isDragging:F,over:U,setActivatorNodeRef:ee,transform:he}=Mde({id:c,data:A,attributes:{...Kde,...n},disabled:T.draggable}),z=gue(H,V),$=!!L,P=$&&!C&&og(y)&&og(E),K=!j&&F,Y=K&&P?he:null,Q=P?Y??(u??R)({rects:S,activeNodeRect:W,activeIndex:y,overIndex:E,index:N}):null,le=og(y)&&og(E)?i({id:c,items:x,activeIndex:y,overIndex:E}):N,pe=L==null?void 0:L.id,be=h.useRef({activeId:pe,items:x,newIndex:le,containerId:g}),ze=x!==be.current.items,Re=t({active:L,containerId:g,isDragging:F,isSorting:$,id:c,index:N,items:x,newIndex:be.current.newIndex,previousItems:be.current.items,previousContainerId:be.current.containerId,transition:m,wasDragging:be.current.activeId!=null}),Ge=Wde({disabled:!Re,index:N,node:M,rect:_});return h.useEffect(()=>{$&&be.current.newIndex!==le&&(be.current.newIndex=le),g!==be.current.containerId&&(be.current.containerId=g),x!==be.current.items&&(be.current.items=x)},[$,le,g,x]),h.useEffect(()=>{if(pe===be.current.activeId)return;if(pe&&!be.current.activeId){be.current.activeId=pe;return}const Vt=setTimeout(()=>{be.current.activeId=pe},50);return()=>clearTimeout(Vt)},[pe]),{active:L,activeIndex:y,attributes:B,data:A,rect:_,index:N,newIndex:le,items:x,isOver:G,isSorting:$,isDragging:F,listeners:D,node:M,overIndex:E,over:U,setNodeRef:z,setActivatorNodeRef:ee,setDroppableNodeRef:H,setDraggableNodeRef:V,transform:Ge??Q,transition:ot()};function ot(){if(Ge||ze&&be.current.newIndex===N)return qde;if(!(K&&!QE(q)||!m)&&($||Re))return yh.Transition.toString({...m,property:fk})}}function Yde(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}}Cn.Down,Cn.Right,Cn.Up,Cn.Left;function ad({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),[x,g]=h.useState(e),y=h.useRef(null),v=R=>{g(R.target.value)},C=()=>{n&&x!==e&&n(x.trim()),m(!1)},S=()=>{g(e),m(!1)},E=R=>{R.key==="Enter"&&!R.shiftKey?(r===1||R.ctrlKey)&&(R.preventDefault(),C()):R.key==="Escape"&&(R.preventDefault(),S())},j=R=>{m(R),R?(g(e),setTimeout(()=>{y.current&&y.current.focus()},0)):S()};return a.jsxs(PE,{open:f,onOpenChange:j,children:[a.jsx(UE,{asChild:!0,children:a.jsx("div",{className:oe("cursor-edit w-full min-w-[100px]",!e&&"text-gray-400",s&&"font-medium",i),children:e||t})}),a.jsxs(zE,{className:"w-auto max-w-[600px] min-w-[300px] p-2",align:"start",children:[a.jsx(Mo,{ref:y,value:x,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(we,{variant:"outline",size:"sm",onClick:S,className:"h-7 cursor-pointer px-2 text-xs",children:u}),a.jsx(we,{size:"sm",onClick:C,className:"h-7 cursor-pointer px-2 text-xs",children:c})]})]})]})}function Xde({isAllExpanded:e,onToggle:t}){return a.jsx(we,{variant:"ghost",size:"icon",className:"h-5 w-5 cursor-pointer p-0",onClick:t,title:e?"Collapse all items":"Expand all items",children:e?a.jsx(VU,{className:"h-4 w-4"}):a.jsx(ZS,{className:"h-4 w-4"})})}function Qde({isExpanded:e,onToggle:t,ariaLabel:n}){return a.jsx(we,{variant:"ghost",size:"icon",className:"h-5 w-5 cursor-pointer p-0",onClick:t,"aria-label":n??(e?"Collapse":"Expand"),children:e?a.jsx(ss,{className:"h-4 w-4"}):a.jsx(ba,{className:"h-4 w-4"})})}function Jde({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(x4,{className:"h-4 w-4 text-gray-400"})})}function vm({id:e,children:t}){const{attributes:n,listeners:r,setNodeRef:s,transform:i,transition:c,isDragging:u}=Zde({id:e}),f={transform:yh.Transform.toString(i),transition:c,opacity:u?.75:1},m=h.Children.toArray(t),x=[a.jsx(Yr,{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(Jde,{...n,...r})},"drag-handle-cell"),...m.slice(1)];return a.jsx(Hn,{ref:s,style:f,className:"group",children:x})}function hk({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(Or,{children:[a.jsx(Ir,{asChild:!0,children:a.jsx(we,{variant:"ghost",className:"dm-card-table-body-row-actionbtn opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100","aria-label":"Row actions",children:a.jsx(Do,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsxs(Mr,{align:"end",children:[u&&a.jsxs(Ut,{className:"cursor-pointer",onClick:()=>{n(e.index)},children:[a.jsx(sa,{className:"mr-2 h-4 w-4"}),"Add nested field"]}),m&&a.jsx(ns,{}),f&&a.jsxs(Ut,{onClick:()=>{i(!0)},children:[a.jsx(os,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),a.jsx("span",{className:"text-red-600",children:"Delete field"})]})]})]}),a.jsx(Ar,{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 efe({mode:e,onModeChange:t}){const n=Object.values(ph),r=s=>{t&&t(s)};return a.jsxs(oa,{value:e,onValueChange:r,children:[a.jsx(la,{className:"h-90 cursor-pointer",size:"sm",children:a.jsx(ia,{placeholder:"Select field mode"})}),a.jsx(ca,{className:"max-h-[300px]",children:n.map(s=>a.jsx(Fn,{value:s,children:s},s))})]})}var Oy="Checkbox",[tfe]=Dr(Oy),[nfe,n2]=tfe(Oy);function rfe(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:s,disabled:i,form:c,name:u,onCheckedChange:f,required:m,value:x="on",internal_do_not_use_render:g}=e,[y,v]=ya({prop:n,defaultProp:s??!1,onChange:f,caller:Oy}),[C,S]=h.useState(null),[E,j]=h.useState(null),R=h.useRef(!1),T=C?!!c||!!C.closest("form"):!0,N={checked:y,disabled:i,setChecked:v,control:C,setControl:S,name:u,form:c,value:x,hasConsumerStoppedPropagationRef:R,required:m,defaultChecked:xl(s)?!1:s,isFormControl:T,bubbleInput:E,setBubbleInput:j};return a.jsx(nfe,{scope:t,...N,children:afe(g)?g(N):r})}var mk="CheckboxTrigger",pk=h.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},s)=>{const{control:i,value:c,disabled:u,checked:f,required:m,setControl:x,setChecked:g,hasConsumerStoppedPropagationRef:y,isFormControl:v,bubbleInput:C}=n2(mk,e),S=Rt(s,x),E=h.useRef(f);return h.useEffect(()=>{const j=i==null?void 0:i.form;if(j){const R=()=>g(E.current);return j.addEventListener("reset",R),()=>j.removeEventListener("reset",R)}},[i,g]),a.jsx(tt.button,{type:"button",role:"checkbox","aria-checked":xl(f)?"mixed":f,"aria-required":m,"data-state":Sk(f),"data-disabled":u?"":void 0,disabled:u,value:c,...r,ref:S,onKeyDown:Me(t,j=>{j.key==="Enter"&&j.preventDefault()}),onClick:Me(n,j=>{g(R=>xl(R)?!0:!R),C&&v&&(y.current=j.isPropagationStopped(),y.current||j.stopPropagation())})})});pk.displayName=mk;var gk=h.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:s,defaultChecked:i,required:c,disabled:u,value:f,onCheckedChange:m,form:x,...g}=e;return a.jsx(rfe,{__scopeCheckbox:n,checked:s,defaultChecked:i,disabled:u,required:c,onCheckedChange:m,name:r,form:x,value:f,internal_do_not_use_render:({isFormControl:y})=>a.jsxs(a.Fragment,{children:[a.jsx(pk,{...g,ref:t,__scopeCheckbox:n}),y&&a.jsx(bk,{__scopeCheckbox:n})]})})});gk.displayName=Oy;var xk="CheckboxIndicator",yk=h.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...s}=e,i=n2(xk,n);return a.jsx(Xr,{present:r||xl(i.checked)||i.checked===!0,children:a.jsx(tt.span,{"data-state":Sk(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:t,style:{pointerEvents:"none",...e.style}})})});yk.displayName=xk;var vk="CheckboxBubbleInput",bk=h.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:s,checked:i,defaultChecked:c,required:u,disabled:f,name:m,value:x,form:g,bubbleInput:y,setBubbleInput:v}=n2(vk,e),C=Rt(n,v),S=ZC(i),E=fC(r);h.useEffect(()=>{const R=y;if(!R)return;const T=window.HTMLInputElement.prototype,A=Object.getOwnPropertyDescriptor(T,"checked").set,I=!s.current;if(S!==i&&A){const _=new Event("click",{bubbles:I});R.indeterminate=xl(i),A.call(R,xl(i)?!1:i),R.dispatchEvent(_)}},[y,S,i,s]);const j=h.useRef(xl(i)?!1:i);return a.jsx(tt.input,{type:"checkbox","aria-hidden":!0,defaultChecked:c??j.current,required:u,disabled:f,name:m,value:x,form:g,...t,tabIndex:-1,ref:C,style:{...t.style,...E,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});bk.displayName=vk;function afe(e){return typeof e=="function"}function xl(e){return e==="indeterminate"}function Sk(e){return xl(e)?"indeterminate":e?"checked":"unchecked"}function sfe({className:e,...t}){return a.jsx(gk,{"data-slot":"checkbox",className:oe("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:a.jsx(yk,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:a.jsx(Ia,{className:"size-3.5"})})})}function Ck({isPrimaryKey:e,onPrimaryKeyChange:t}){const n=!!e,r=s=>{t&&t(s)};return a.jsx(sfe,{className:"cursor-pointer",checked:n,onCheckedChange:r,"aria-label":"Primary Key"})}const nA={[xa.CONNECTED]:{icon:Ah,color:"text-green-500",label:"Connected",description:"Field is connected to the data source"},[xa.CONNECTED_WITH_DEFINITION_MISMATCH]:{icon:Oh,color:"text-orange-500",label:"Connected with issues",description:"Field is connected but has definition mismatches"},[xa.DISCONNECTED]:{icon:uF,color:"text-red-500",label:"Disconnected",description:"Field is not connected to the data source"}};function Ek({status:e}){if(!(e in nA))return null;const t=nA[e],{icon:n,color:r,label:s,description:i}=t,c=`schema-field-status-tooltip-${e}`;return a.jsx(ga,{children:a.jsxs(rt,{children:[a.jsx(at,{asChild:!0,children:a.jsx(n,{className:oe("h-5 w-5",r),role:"img","aria-label":s,"aria-describedby":c,tabIndex:0})}),a.jsxs(st,{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 bm({type:e,storageType:t,onTypeChange:n}){const r=t===ce.GOOGLE_BIGQUERY?Object.values(ur):t===ce.AWS_ATHENA?Object.values(rE):t===ce.SNOWFLAKE?Object.values(aE):t===ce.AWS_REDSHIFT?Object.values(sE):Object.values(oE),s=i=>{n&&(t===ce.GOOGLE_BIGQUERY||t===ce.AWS_ATHENA||t===ce.SNOWFLAKE||ce.AWS_REDSHIFT,n(i))};return a.jsxs(oa,{value:e,onValueChange:s,children:[a.jsx(la,{className:"cursor-pointer",size:"sm",children:a.jsx(ia,{placeholder:"Select field type"})}),a.jsx(ca,{className:"max-h-[300px]",children:r.map(i=>a.jsx(Fn,{value:i,children:i},i))})]})}function ofe({table:e}){return a.jsx("div",{className:"px-3 text-right",children:a.jsxs(Or,{children:[a.jsx(Ir,{asChild:!0,children:a.jsx(we,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:a.jsx(Do,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsx(Mr,{align:"end",children:e.getAllColumns().filter(t=>t.getCanHide()&&t.id!=="actions").map(t=>a.jsx(Ut,{className:"capitalize",children:a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("button",{type:"button",role:"checkbox","aria-checked":t.getIsVisible(),"data-state":t.getIsVisible()?"checked":"unchecked","aria-label":`Toggle column ${t.columnDef.meta?t.columnDef.meta.title??t.id:t.id}`,className:"peer border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border bg-white shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-white/8",onClick:()=>{t.toggleVisibility(!t.getIsVisible())},children:t.getIsVisible()&&a.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:a.jsx(Ia,{className:"size-3.5 text-white"})})}),a.jsx("span",{children:t.columnDef.meta?t.columnDef.meta.title??t.id:t.id})]})},t.id))})]})})}function ife({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 x=h.useCallback(g=>{const y=g.target.value;f(y);const v=setTimeout(()=>{r(y)},s);return()=>{clearTimeout(v)}},[r,s]);return a.jsxs("div",{className:"dm-card-toolbar-search",children:[a.jsx(zc,{className:"dm-card-toolbar-search-icon","aria-hidden":"true"}),a.jsx(ct,{id:e,placeholder:t,value:u,onChange:x,className:i??"dm-card-toolbar-search-input","aria-label":c??t})]})}function lfe({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(ife,{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(Ek,{status:c}),a.jsx("span",{className:"text-sm font-medium text-gray-500",children:u})]},c))}),a.jsxs(we,{variant:"outline",className:"dm-card-table-add-field-btn cursor-pointer",onClick:t,disabled:i,"aria-label":"Add new field",children:[a.jsx(sa,{className:"h-4 w-4","aria-hidden":"true"}),"Add Field"]})]})]})}const cfe={dragHandle:{left:0,zIndex:1},status:{left:20,zIndex:1},name:{left:56,zIndex:1},actions:{right:0,zIndex:1}};function rA(e,t={}){const n=cfe[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 ufe({fields:e,columns:t,onAddRow:n,fieldsForStatusCount:r,onSearchChange:s,dragContext:i,dragContextProps:c,rowComponent:u=Hn,getRowId:f}){const{isSchemaActualizationLoading:m}=js(),x=t,g=i,y=u,{columnVisibility:v,setColumnVisibility:C}=due(x),S=Dl({data:e,columns:x,getCoreRowModel:Al(),getFilteredRowModel:_d(),columnResizeMode:"onChange",enableColumnResizing:!0,state:{columnVisibility:v},onColumnVisibilityChange:C,enableGlobalFilter:!0,globalFilterFn:fue,defaultColumn:{enableResizing:!0,size:0,minSize:0}}),{value:E,onChange:j,searchValue:R}=hue(S),T=h.useRef("");h.useEffect(()=>{s&&R!==T.current&&(T.current=R,s(R))},[R,s]);const N=h.useMemo(()=>{const _={[xa.CONNECTED]:0,[xa.CONNECTED_WITH_DEFINITION_MISMATCH]:0,[xa.DISCONNECTED]:0};return(r??e).forEach(G=>{G.status in _&&_[G.status]++}),_},[e,r]);return a.jsxs("div",{className:"space-y-4",children:[n&&a.jsx(lfe,{table:S,searchInputId:"schema-fields-search-input",onAddField:n,filterValue:E,onFilterChange:j,statusCounts:N,disabled:m}),a.jsx("div",{className:"dm-card-table-wrap mb-0",children:a.jsxs(Ol,{id:"schema-fields-table",className:"w-full table-auto",role:"table",children:[a.jsx(Il,{className:"dm-card-table-header",children:S.getHeaderGroups().map(_=>a.jsx(Hn,{className:"dm-card-table-header-row",children:_.headers.map(M=>a.jsx(kl,{className:"bg-secondary dark:bg-background",style:rA(M.column.id,{width:M.getSize()!==0?M.getSize():void 0,whiteSpace:"nowrap",cursor:"default"}),children:M.isPlaceholder?null:typeof M.column.columnDef.header=="function"?M.column.columnDef.header(M.getContext()):M.column.columnDef.header},M.id))},_.id))}),a.jsx(Ml,{className:"dm-card-table-body",children:S.getRowModel().rows.length?a.jsx(g,{...c,children:S.getRowModel().rows.map(_=>a.jsx(y,{id:f?f(_):_.index,row:_,children:_.getVisibleCells().map(M=>a.jsx(Yr,{className:"bg-background dark:bg-muted",style:rA(M.column.id,{width:M.column.getSize()!==0?M.column.getSize():void 0,whiteSpace:"pre",paddingTop:8,paddingBottom:8}),children:M.column.columnDef.cell&&typeof M.column.columnDef.cell=="function"?M.column.columnDef.cell(M.getContext()):null},M.id))},_.id))}):a.jsx(Hn,{children:a.jsx(Yr,{colSpan:x.length,className:"text-center text-gray-400",style:{whiteSpace:"nowrap"},children:"Output schema has no configured fields"})})})]})}),n&&a.jsxs(we,{variant:"outline",className:"dm-card-table-add-field-btn bg-background dark:bg-muted w-full cursor-pointer rounded-t-none border-0",onClick:n,disabled:m,"aria-label":"Add new field",children:[a.jsx(sa,{className:"h-4 w-4","aria-hidden":"true"}),"Add Field"]})]})}function Sm({fields:e,onFieldsChange:t,onAddRow:n,createNewField:r,renderTypeCell:s,additionalColumns:i=[],fieldsForStatusCount:c,onSearchChange:u,nameColumnHeader:f,nameColumnCell:m,primaryKeyColumnCell:x,aliasColumnCell:g,descriptionColumnCell:y,actionsColumnCell:v,dragContext:C,dragContextProps:S,rowComponent:E,getRowId:j}){const R=h.useCallback((_,M)=>{if(t){const G=[...e];G[_]={...G[_],...M},t(G)}},[e,t]),T=h.useCallback(()=>{if(t){const _=r();t([...e,_])}},[e,t,r]),N=h.useCallback(_=>{if(t){const M=[...e];M.splice(_,1),t(M)}},[e,t]),A=h.useMemo(()=>[{id:"dragHandle",header:"",size:24,enableHiding:!1},{accessorKey:"status",header:"",size:36,cell:({row:_})=>a.jsx(Ek,{status:_.getValue("status")}),enableHiding:!1},{accessorKey:"name",header:f??(()=>a.jsxs(rt,{children:[a.jsx(at,{className:"cursor-default",children:"Name"}),a.jsx(st,{children:"Field name in the output schema"})]})),size:80,cell:({row:_})=>m?m({row:_,updateField:R}):a.jsx(ad,{value:lue(_.getValue("name")),onValueChange:M=>{R(_.index,{name:M})},placeholder:"Field name is required",isBold:!0}),enableHiding:!1},{accessorKey:"isPrimaryKey",header:()=>a.jsxs(rt,{children:[a.jsx(at,{className:"cursor-default",children:"PK"}),a.jsx(st,{children:"Is field must be considered as a part of the output Primary Key"})]}),size:36,cell:({row:_})=>x?x({row:_,updateField:R}):a.jsx(Ck,{isPrimaryKey:_.getValue("isPrimaryKey"),onPrimaryKeyChange:M=>{R(_.index,{isPrimaryKey:M})}}),enableHiding:!1},{accessorKey:"alias",header:()=>a.jsxs(rt,{children:[a.jsx(at,{className:"cursor-default",children:"Alias"}),a.jsx(st,{children:"Alternative name for the field"})]}),size:80,cell:({row:_})=>g?g({row:_,updateField:R}):a.jsx(ad,{value:_.getValue("alias"),onValueChange:M=>{R(_.index,{alias:M})},placeholder:"-"})},{accessorKey:"description",header:()=>a.jsxs(rt,{children:[a.jsx(at,{className:"cursor-default",children:"Description"}),a.jsx(st,{children:"Detailed information about the field"})]}),cell:({row:_})=>y?y({row:_,updateField:R}):a.jsx(ad,{value:_.getValue("description"),onValueChange:M=>{R(_.index,{description:M})},minRows:5,placeholder:"-"})},{id:"actions",header:({table:_})=>a.jsx(ofe,{table:_}),cell:({row:_,table:M})=>v?v({row:_,table:M}):a.jsx(hk,{row:_,onDeleteRow:t?N:void 0}),size:40,enableResizing:!1,enableHiding:!1}],[R,N,t,f,m,x,g,y,v]),I=h.useMemo(()=>{const M={accessorKey:"type",header:()=>a.jsxs(rt,{children:[a.jsx(at,{className:"cursor-default pl-[12px]",children:"Type"}),a.jsx(st,{children:"Data type of the field"})]}),size:80,cell:H=>s({row:H.row,updateField:R}),enableHiding:!1},G=[...A];if(G.splice(3,0,M),i.length>0){const H=[...i];H.sort((L,q)=>{const W=L.columnIndex??1/0,B=q.columnIndex??1/0;return W-B}),H.forEach(L=>{if(L.columnIndex!==void 0){const q=Math.min(Math.max(0,L.columnIndex),G.length);G.splice(q,0,L)}else G.splice(G.length-1,0,L)})}return G},[A,s,R,i]);return a.jsx(ufe,{fields:e,columns:I,onFieldsChange:t,onAddRow:n??(t?T:void 0),fieldsForStatusCount:c,onSearchChange:u,dragContext:C,dragContextProps:S,rowComponent:E,getRowId:j})}function dfe({fields:e,onFieldsChange:t}){const{expandedRecords:n,hasRecordFields:r,toggleRecordExpansion:s,toggleAllRecords:i,flattenedFields:c,handleSearchChange:u,isRecordType:f,topLevelFields:m,allExpanded:x}=mue(e),{updateField:g,handleDeleteRow:y,handleAddNestedField:v,handleAddRow:C}=pue(e,c,t,L=>L),S=h.useCallback(()=>({name:"",type:ur.STRING,mode:ph.NULLABLE,isPrimaryKey:!1,status:xa.DISCONNECTED}),[]),E=h.useCallback(({row:L})=>a.jsx(bm,{type:L.getValue("type"),storageType:ce.GOOGLE_BIGQUERY,onTypeChange:q=>{g(L.index,{type:q})}}),[g]),j=h.useMemo(()=>[{accessorKey:"mode",header:()=>a.jsxs(rt,{children:[a.jsx(at,{className:"cursor-default pl-[12px]",children:"Mode"}),a.jsx(st,{style:{whiteSpace:"pre"},children:`BigQuery Field mode:
|
|
838
|
+
NULLABLE - field can be NULL
|
|
839
|
+
REQUIRED - field cant be NULL
|
|
840
|
+
REPEATED - field is an Array of Type`})]}),size:80,cell:({row:L})=>a.jsx(efe,{mode:L.getValue("mode"),onModeChange:q=>{g(L.index,{mode:q})}}),columnIndex:4}],[g]),R=h.useCallback(()=>a.jsxs("div",{className:"flex items-center",children:[r&&a.jsx(Xde,{isAllExpanded:x,onToggle:i}),a.jsxs(rt,{children:[a.jsx(at,{className:"cursor-default",children:"Name"}),a.jsx(st,{children:"Field name in the output schema"})]})]}),[r,x,i]),T=h.useCallback(({row:L})=>{const q=c[L.index],B=(q.type===ur.RECORD||q.type===ur.STRUCT)&&q.fields&&q.fields.length>0,V=q.path??"",D=q.level??0,F=n.has(V);return a.jsxs("div",{className:"flex items-center",children:[D>0&&a.jsx("div",{style:{width:`${String(D*16-(B?4:0))}px`},className:"flex-shrink-0"}),B?a.jsx(Qde,{isExpanded:F,onToggle:()=>{s(V)},ariaLabel:F?"Collapse nested fields":"Expand nested fields"}):r&&a.jsx("div",{className:"w-5"}),a.jsx(ad,{value:L.getValue("name"),onValueChange:U=>{g(L.index,{name:U})},placeholder:"Field name is required",isBold:!0})]})},[c,n,r,s,g]),N=h.useCallback(({row:L})=>{const q=c[L.index],W=q.type===ur.RECORD||q.type===ur.STRUCT;return(q.level??0)===0&&!W?a.jsx(Ck,{isPrimaryKey:L.getValue("isPrimaryKey"),onPrimaryKeyChange:V=>{g(L.index,{isPrimaryKey:V})}}):a.jsx("div",{})},[c,g]),A=h.useCallback(({row:L})=>a.jsx(ad,{value:L.getValue("description"),onValueChange:q=>{g(L.index,{description:q})},minRows:5,placeholder:"-"}),[g]),I=h.useCallback(({row:L})=>a.jsx(ad,{value:L.getValue("alias"),onValueChange:q=>{g(L.index,{alias:q})},placeholder:"-"}),[g]),_=h.useCallback(({row:L})=>a.jsx(hk,{row:L,onDeleteRow:t?y:void 0,onAddNestedField:t?v:void 0,isRecordType:f}),[t,y,v,f]),{handleDragEnd:M}=cm(e,t,c),G=h.useCallback(L=>{const q=c[L.index];return q.path??String(c.indexOf(q))},[c]),H=mm(hm(Yc,{activationConstraint:{distance:5}}));return a.jsx(gm,{sensors:H,collisionDetection:pm,onDragEnd:M,children:a.jsx(Sm,{fields:c,onFieldsChange:t,onAddRow:C,createNewField:S,renderTypeCell:E,additionalColumns:j,fieldsForStatusCount:m,onSearchChange:u,nameColumnHeader:R,nameColumnCell:T,primaryKeyColumnCell:N,aliasColumnCell:I,descriptionColumnCell:A,actionsColumnCell:_,dragContext:ym,dragContextProps:{items:c.map(L=>L.path??String(c.indexOf(L))),strategy:xm},rowComponent:vm,getRowId:G})})}function ffe({fields:e,onFieldsChange:t}){const n=h.useCallback(()=>({name:"",type:rE.STRING,isPrimaryKey:!1,status:xa.DISCONNECTED}),[]),r=h.useCallback(({row:c,updateField:u})=>a.jsx(bm,{type:c.getValue("type"),storageType:ce.AWS_ATHENA,onTypeChange:f=>{u(c.index,{type:f})}}),[]),{handleDragEnd:s}=cm(e,t),i=mm(hm(Yc,{activationConstraint:{distance:5}}));return a.jsx(gm,{sensors:i,collisionDetection:pm,onDragEnd:s,children:a.jsx(Sm,{fields:e,onFieldsChange:t,createNewField:n,renderTypeCell:r,dragContext:ym,dragContextProps:{items:e.map((c,u)=>u),strategy:xm},rowComponent:vm})})}function hfe({fields:e,onFieldsChange:t}){const n=h.useCallback(()=>({name:"",type:aE.VARCHAR,isPrimaryKey:!1,status:xa.DISCONNECTED}),[]),r=h.useCallback(({row:c,updateField:u})=>a.jsx(bm,{type:c.getValue("type"),storageType:ce.SNOWFLAKE,onTypeChange:f=>{u(c.index,{type:f})}}),[]),{handleDragEnd:s}=cm(e,t),i=mm(hm(Yc,{activationConstraint:{distance:5}}));return a.jsx(gm,{sensors:i,collisionDetection:pm,onDragEnd:s,children:a.jsx(Sm,{fields:e,onFieldsChange:t,createNewField:n,renderTypeCell:r,dragContext:ym,dragContextProps:{items:e.map((c,u)=>u),strategy:xm},rowComponent:vm})})}function mfe({fields:e,onFieldsChange:t}){const n=h.useCallback(()=>({name:"",type:sE.VARCHAR,isPrimaryKey:!1,status:xa.DISCONNECTED}),[]),r=h.useCallback(({row:c,updateField:u})=>a.jsx(bm,{type:c.getValue("type"),storageType:ce.AWS_REDSHIFT,onTypeChange:f=>{u(c.index,{type:f})}}),[]),{handleDragEnd:s}=cm(e,t),i=mm(hm(Yc,{activationConstraint:{distance:5}}));return a.jsx(gm,{sensors:i,collisionDetection:pm,onDragEnd:s,children:a.jsx(Sm,{fields:e,onFieldsChange:t,createNewField:n,renderTypeCell:r,dragContext:ym,dragContextProps:{items:e.map((c,u)=>u),strategy:xm},rowComponent:vm})})}function pfe({fields:e,onFieldsChange:t}){const n=h.useCallback(()=>({name:"",type:oE.STRING,isPrimaryKey:!1,status:xa.DISCONNECTED}),[]),r=h.useCallback(({row:c,updateField:u})=>a.jsx(bm,{type:c.getValue("type"),storageType:ce.DATABRICKS,onTypeChange:f=>{u(c.index,{type:f})}}),[]),{handleDragEnd:s}=cm(e,t),i=mm(hm(Yc,{activationConstraint:{distance:5}}));return a.jsx(gm,{sensors:i,collisionDetection:pm,onDragEnd:s,children:a.jsx(Sm,{fields:e,onFieldsChange:t,createNewField:n,renderTypeCell:r,dragContext:ym,dragContextProps:{items:e.map((c,u)=>u),strategy:xm},rowComponent:vm})})}function gfe({schema:e,storageType:t,onFieldsChange:n}){const r=h.useMemo(()=>{if(!e){const s=iue(t);return n(s.fields),s}return e},[e,t,n]);return zM(r)?a.jsx(dfe,{fields:r.fields,onFieldsChange:n}):FM(r)?a.jsx(ffe,{fields:r.fields,onFieldsChange:n}):HM(r)?a.jsx(hfe,{fields:r.fields,onFieldsChange:n}):$M(r)?a.jsx(mfe,{fields:r.fields,onFieldsChange:n}):VM(r)?a.jsx(pfe,{fields:r.fields,onFieldsChange:n}):a.jsx("div",{className:"p-4 text-center",children:a.jsx("p",{children:"Unsupported schema type"})})}function xfe({definitionType:e}){const{dataMart:t,updateDataMartSchema:n,isLoading:r,error:s,runSchemaActualization:i,isSchemaActualizationLoading:c}=js(),{id:u="",schema:f}=t??{},{schema:m,isDirty:x,updateSchema:g,resetSchema:y}=cue(f),{operationStatus:v,startSaveOperation:C}=uue(r,s);h.useEffect(()=>{v==="success"&&y()},[v,y]);const S=h.useCallback(N=>{g(N)},[g]),E=h.useCallback(()=>{u&&m&&(C(),n(u,m).then(()=>{i==null||i()}))},[u,m,C,n,i]),j=h.useCallback(()=>{i==null||i()},[i]),R=h.useCallback(()=>{y()},[y]),T=r||c;return t?a.jsxs("div",{className:"space-y-4",children:[a.jsx(gfe,{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(we,{variant:"default",onClick:E,disabled:!x||T,children:"Save"}),a.jsx(we,{type:"button",variant:"ghost",onClick:R,disabled:!x||T,children:"Discard"})]}),a.jsx(we,{type:"button",variant:"outline",onClick:j,disabled:!e||T,children:"Refresh schema"})]})]}):a.jsx("div",{children:"Error: Data mart not found"})}function yfe(){const e=Cx(),{id:t,projectId:n}=e;return t?n?a.jsx("div",{className:"dm-page",children:a.jsx(BI,{children:a.jsx(Hse,{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 vfe({className:e,...t}){return a.jsx("div",{"data-slot":"card",className:oe("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function bfe({className:e,...t}){return a.jsx("div",{"data-slot":"card-header",className:oe("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function Sfe({className:e,...t}){return a.jsx("div",{"data-slot":"card-title",className:oe("leading-none font-semibold",e),...t})}function Cfe({className:e,...t}){return a.jsx("div",{"data-slot":"card-description",className:oe("text-muted-foreground text-sm",e),...t})}function Efe({className:e,...t}){return a.jsx("div",{"data-slot":"card-content",className:oe("px-6",e),...t})}function wfe({className:e,...t}){return a.jsx("div",{"data-slot":"card-footer",className:oe("flex items-center px-6 [.border-t]:pt-6",e),...t})}const r2=h.createContext({isCollapsed:!1,collapsible:!1,handleCollapse:()=>{throw new Error("CollapsibleCardContext: handleCollapse not implemented")}});function wo({icon:e,tooltip:t,subtitle:n,children:r}){const{isCollapsed:s}=h.useContext(r2);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(Sfe,{className:"text-md text-foreground leading-none font-medium",children:r})]}),n&&a.jsx(Cfe,{className:oe("text-md text-muted-foreground/50",!s&&"hidden"),children:n}),t&&a.jsx(ga,{children:a.jsxs(rt,{children:[a.jsx(at,{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(_r,{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(st,{children:a.jsx("p",{children:t})})]})})]})}wo.displayName="CollapsibleCardHeaderTitle";function Cm({children:e,className:t}){const n=r=>{r.stopPropagation()};return a.jsx("div",{className:oe("flex items-center gap-2 self-center",t),onClick:n,children:e})}Cm.displayName="CollapsibleCardHeaderActions";function Ro({children:e}){const{collapsible:t,isCollapsed:n,handleCollapse:r}=h.useContext(r2);let s,i;return h.Children.forEach(e,c=>{if(h.isValidElement(c))switch(c.type){case wo:s=c;break;case Cm:i=c;break}}),a.jsxs(bfe,{className:oe("group flex items-start justify-between gap-4 px-4 py-4",t&&"cursor-pointer"),onClick:t?r:void 0,children:[s,a.jsxs("div",{className:"flex items-center gap-2",children:[i,t&&a.jsx("div",{className:oe("flex h-7 w-7 items-center justify-center rounded-full transition-colors duration-200 hover:bg-gray-200/50 dark:hover:bg-white/4"),children:a.jsx("div",{className:oe("transform transition-transform duration-200",n?"rotate-0":"rotate-180"),children:a.jsx(ss,{className:"text-muted-foreground/75 dark:text-muted-foreground/50 h-4 w-4"})})})]})]})}Ro.displayName="CollapsibleCardHeader";function jo({children:e}){return a.jsx(Efe,{className:"px-4 pt-1",children:e})}jo.displayName="CollapsibleCardContent";function xi({left:e,right:t}){return a.jsxs(wfe,{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})]})}xi.displayName="CollapsibleCardFooter";const aA="collapsed-card-";function yl({children:e,className:t,variant:n="default",collapsible:r=!1,defaultCollapsed:s=!1,onCollapsedChange:i,name:c}){const u=c?ta.get(`${aA}${c}`,"boolean")??s:s,[f,m]=h.useState(u);h.useEffect(()=>{c&&ta.set(`${aA}${c}`,f)},[f,c]);const x=()=>{const S=!f;m(S),i==null||i(S)};let g,y,v;h.Children.forEach(e,S=>{if(h.isValidElement(S))switch(S.type){case Ro:g=S;break;case jo:y=S;break;case xi: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(r2.Provider,{value:{isCollapsed:f,collapsible:r,handleCollapse:x},children:a.jsxs(vfe,{className:oe(C[n],t),children:[g,a.jsx("div",{className:oe("grid transition-all duration-200",f?"grid-rows-[0fr]":"grid-rows-[1fr]"),children:a.jsxs("div",{className:"overflow-hidden",children:[y,v]})})]})})}function Rfe(){const{dataMart:e,updateDataMartStorage:t}=to(),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(yl,{collapsible:!0,name:"data-storage",children:[a.jsx(Ro,{children:a.jsx(wo,{icon:Sc,tooltip:"Configure where your data will be stored",children:"Storage"})}),a.jsx(jo,{children:(e==null?void 0:e.storage)&&a.jsx(Cle,{dataStorage:e.storage,onDataStorageChange:t})}),a.jsx(xi,{})]}),a.jsxs(yl,{collapsible:!0,name:"input-source",children:[a.jsx(Ro,{children:a.jsx(wo,{icon:YS,tooltip:"Configure how to extract data from your data warehouse",children:"Input Source"})}),a.jsx(jo,{children:e&&a.jsx(oue,{definitionType:r,initialDefinitionType:n,setDefinitionType:s})}),a.jsx(xi,{})]}),a.jsxs(yl,{collapsible:!0,name:"output-schema",children:[a.jsx(Ro,{children:a.jsx(wo,{icon:az,tooltip:"Configure your data mart output schema",children:"Output Schema"})}),a.jsx(jo,{children:e&&a.jsx(xfe,{definitionType:r})}),a.jsx(xi,{})]})]})}function jfe({row:e,onDeleteSuccess:t,onEditReport:n}){const[r,s]=h.useState(e.original.lastRunStatus===en.RUNNING),[i,c]=h.useState(!1),[u,f]=h.useState(!1),{deleteReport:m,fetchReportsByDataMartId:x,runReport:g}=is(),y=`actions-menu-${e.original.id}`;h.useEffect(()=>{s(e.original.lastRunStatus===en.RUNNING)},[e.original.lastRunStatus]);const v=h.useCallback(async()=>{try{await m(e.original.id),await x(e.original.dataMart.id),t==null||t(),f(!1)}catch(j){console.error("Failed to delete Google Sheet:",j)}},[m,x,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(j){s(!1),console.error("Failed to run report:",j)}},[g,e.original.id]),E=h.useCallback(()=>{f(!0),c(!1)},[]);return a.jsx(ga,{children:a.jsxs("div",{className:"flex justify-end gap-1",onClick:j=>{j.stopPropagation()},children:[a.jsxs(rt,{children:[a.jsx(at,{asChild:!0,children:a.jsx(we,{onClick:j=>{j.stopPropagation(),S()},variant:"ghost",className:"dm-card-table-body-row-actionbtn opacity-0 transition-opacity group-hover:opacity-100 disabled:opacity-0 disabled:group-hover:opacity-50",disabled:r,"aria-label":r?"Running report...":`Run report: ${e.original.title}`,children:a.jsx(Dh,{className:"dm-card-table-body-row-actionbtn-icon","aria-hidden":"true"})})}),a.jsx(st,{id:`run-report-${e.original.id}`,side:"bottom",role:"tooltip",children:"Run report"})]}),a.jsxs(rt,{children:[a.jsx(at,{asChild:!0,children:a.jsx("a",{href:UC(e.original.destinationConfig.spreadsheetId,e.original.destinationConfig.sheetId),className:"dm-card-table-body-row-actionbtn inline-flex items-center justify-center rounded-md px-3 opacity-0 transition-opacity group-hover:opacity-100",target:"_blank",rel:"noopener noreferrer",onClick:j=>{j.stopPropagation()},children:a.jsx(g4,{className:"dm-card-table-body-row-actionbtn-icon","aria-hidden":"true"})})}),a.jsx(st,{id:`run-report-${e.original.id}`,side:"bottom",role:"tooltip",children:"Open document"})]}),a.jsxs(Or,{open:i,onOpenChange:c,children:[a.jsx(Ir,{asChild:!0,children:a.jsx(we,{variant:"ghost",className:`dm-card-table-body-row-actionbtn opacity-0 transition-opacity ${i?"opacity-100":"group-hover:opacity-100"}`,"aria-label":`Actions for report: ${e.original.title}`,"aria-haspopup":"true","aria-expanded":i,"aria-controls":y,children:a.jsx(Do,{className:"dm-card-table-body-row-actionbtn-icon","aria-hidden":"true"})})}),a.jsxs(Mr,{id:y,align:"end",role:"menu",children:[a.jsxs(Ut,{onClick:j=>{j.stopPropagation(),C()},role:"menuitem",children:[a.jsx(xd,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),"Edit report"]}),a.jsx(ns,{}),a.jsxs(Ut,{onClick:j=>{j.stopPropagation(),E()},role:"menuitem","aria-label":`Delete report: ${e.original.title}`,children:[a.jsx(os,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),a.jsx("span",{className:"text-red-600",children:"Delete report"})]})]})]}),a.jsx(Ar,{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 Tfe={[en.SUCCESS]:{icon:Ah,color:"text-green-500",label:"Success"},[en.ERROR]:{icon:Kf,color:"text-red-500",label:"Fail"},[en.RUNNING]:{icon:Uc,color:"text-primary animate-spin",label:"In progress"},[en.CANCELLED]:{icon:Kf,color:"text-gray-500",label:"Cancelled"},[en.RESTRICTED]:{icon:Kf,color:"text-yellow-500",label:"Restricted"}};function wk({status:e,error:t}){if(!e)return null;const n=Tfe[e],{icon:r,color:s,label:i}=n,c=`status-tooltip-${e}-${t?"error":"normal"}`,u=()=>e===en.ERROR&&t?`${i}: ${t}`:i;return a.jsx(ga,{children:a.jsxs(rt,{children:[a.jsx(at,{asChild:!0,children:a.jsx(r,{className:oe("h-5 w-5",s),role:"img","aria-label":u(),"aria-describedby":c,tabIndex:0})}),a.jsxs(st,{id:c,side:"bottom",role:"tooltip",children:[a.jsx("div",{className:"text-xs",children:i}),e===en.ERROR&&t&&a.jsx("div",{className:"mt-1 max-w-xs text-xs break-words whitespace-normal",children:t})]})]})})}var ml=(e=>(e.TITLE="title",e.LAST_RUN_DATE="lastRunDate",e.LAST_RUN_STATUS="lastRunStatus",e))(ml||{});const _fe={[ml.TITLE]:"Title",[ml.LAST_RUN_DATE]:"Last Run Date",[ml.LAST_RUN_STATUS]:"Last Run Status"},Nfe=({onDeleteSuccess:e,onEditReport:t}={})=>[{accessorKey:ml.TITLE,header:({column:n})=>a.jsx(Yn,{column:n,children:_fe[ml.TITLE]}),cell:({row:n})=>n.original.title,enableColumnFilter:!0,size:50},{accessorKey:ml.LAST_RUN_DATE,header:({column:n})=>a.jsx(Yn,{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(ws,{date:new Date(r)}):"Never run"})},size:25},{accessorKey:ml.LAST_RUN_STATUS,header:({column:n})=>a.jsx(Yn,{column:n,children:"Last Run Status"}),cell:({row:n})=>n.original.lastRunStatus?a.jsx(wk,{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(qc,{table:n}),cell:({row:n})=>a.jsx(jfe,{row:n,onDeleteSuccess:e,onEditReport:t}),size:140}];function Afe({destination:e,onEditReport:t}){const{reports:n,setPollingConfig:r}=is(),s=h.useMemo(()=>n.filter(y=>y.dataDestination.type===Ie.GOOGLE_SHEETS&&y.dataDestination.id===e.id),[n,e.id]);h.useEffect(()=>{r({initialPollingIntervalMs:2e3,initialPollCount:3,regularPollingIntervalMs:5e3})},[r]);const i=h.useMemo(()=>Nfe({onDeleteSuccess:()=>{},onEditReport:t}),[t]),{sorting:c,setSorting:u,columnVisibility:f,setColumnVisibility:m}=Bc({columns:i,storageKeyPrefix:`data-mart-google-sheets-reports-${e.id}`,defaultSortingColumn:"lastRunDate"}),x=Dl({data:s,columns:i,getCoreRowModel:Al(),onSortingChange:u,getSortedRowModel:Gc(),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(Ol,{id:g,className:"dm-card-table",role:"table","aria-label":`${e.title} reports`,children:[a.jsx(Il,{className:"dm-card-table-header",children:x.getHeaderGroups().map(y=>a.jsx(Hn,{className:"dm-card-table-header-row",children:y.headers.map(v=>a.jsx(kl,{style:v.column.id==="actions"?{width:`${String(v.column.getSize())}px`,minWidth:`${String(v.column.getSize())}px`,maxWidth:`${String(v.column.getSize())}px`}:{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))},y.id))}),a.jsx(Ml,{className:"dm-card-table-body",children:x.getRowModel().rows.length?x.getRowModel().rows.map((y,v)=>a.jsx(Hn,{onClick:()=>{const C=n.find(S=>S.id===y.original.id);C&&t(C)},className:"dm-card-table-body-row group",role:"row","aria-rowindex":v+1,children:y.getVisibleCells().map((C,S)=>a.jsx(Yr,{className:`px-6 whitespace-normal ${C.column.id==="actions"?"actions-cell":""}`,style:C.column.id==="actions"?{width:`${String(C.column.getSize())}px`,minWidth:`${String(C.column.getSize())}px`,maxWidth:`${String(C.column.getSize())}px`}:{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))},y.id)):a.jsx(Hn,{children:a.jsx(Yr,{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 Dfe({row:e,onDeleteSuccess:t,onEditReport:n}){const[r,s]=h.useState(e.original.lastRunStatus===en.RUNNING),[i,c]=h.useState(!1),[u,f]=h.useState(!1),{deleteReport:m,fetchReportsByDataMartId:x,runReport:g}=is(),y=`actions-menu-${e.original.id}`;h.useEffect(()=>{s(e.original.lastRunStatus===en.RUNNING)},[e.original.lastRunStatus]);const v=h.useCallback(async()=>{try{await m(e.original.id),await x(e.original.dataMart.id),t==null||t(),f(!1)}catch(j){console.error("Failed to delete report:",j)}},[m,x,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(j){s(!1),console.error("Failed to run report:",j)}},[g,e.original.id]),E=h.useCallback(()=>{f(!0),c(!1)},[]);return a.jsx(ga,{children:a.jsxs("div",{className:"flex justify-end gap-1",onClick:j=>{j.stopPropagation()},children:[a.jsxs(rt,{children:[a.jsx(at,{asChild:!0,children:a.jsx(we,{onClick:j=>{j.stopPropagation(),S()},variant:"ghost",className:"dm-card-table-body-row-actionbtn opacity-0 transition-opacity group-hover:opacity-100 disabled:opacity-0 disabled:group-hover:opacity-50",disabled:r,"aria-label":r?"Running report...":`Run report: ${e.original.title}`,children:a.jsx(Dh,{className:"dm-card-table-body-row-actionbtn-icon","aria-hidden":"true"})})}),a.jsx(st,{side:"bottom",role:"tooltip",children:"Run report"})]}),a.jsxs(Or,{open:i,onOpenChange:c,children:[a.jsx(Ir,{asChild:!0,children:a.jsx(we,{variant:"ghost",className:`dm-card-table-body-row-actionbtn opacity-0 transition-opacity ${i?"opacity-100":"group-hover:opacity-100"}`,"aria-label":`Actions for report: ${e.original.title}`,"aria-haspopup":"true","aria-expanded":i,"aria-controls":y,children:a.jsx(Do,{className:"dm-card-table-body-row-actionbtn-icon","aria-hidden":"true"})})}),a.jsxs(Mr,{id:y,align:"end",role:"menu",children:[a.jsxs(Ut,{onClick:j=>{j.stopPropagation(),C()},role:"menuitem",children:[a.jsx(xd,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),"Edit report"]}),a.jsx(ns,{}),a.jsxs(Ut,{onClick:j=>{j.stopPropagation(),E()},role:"menuitem","aria-label":`Delete report: ${e.original.title}`,children:[a.jsx(os,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),a.jsx("span",{className:"text-red-600",children:"Delete report"})]})]})]}),a.jsx(Ar,{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"})]})})}var pl=(e=>(e.TITLE="title",e.LAST_RUN_DATE="lastRunDate",e.LAST_RUN_STATUS="lastRunStatus",e))(pl||{});const Ofe={[pl.TITLE]:"Title",[pl.LAST_RUN_DATE]:"Last Run Date",[pl.LAST_RUN_STATUS]:"Last Run Status"},Ife=({onDeleteSuccess:e,onEditReport:t}={})=>[{accessorKey:pl.TITLE,header:({column:n})=>a.jsx(Yn,{column:n,children:Ofe[pl.TITLE]}),cell:({row:n})=>n.original.title,enableColumnFilter:!0,size:50},{accessorKey:pl.LAST_RUN_DATE,header:({column:n})=>a.jsx(Yn,{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(ws,{date:new Date(r)}):"Never run"})},size:25},{accessorKey:pl.LAST_RUN_STATUS,header:({column:n})=>a.jsx(Yn,{column:n,children:"Last Run Status"}),cell:({row:n})=>n.original.lastRunStatus?a.jsx(wk,{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(qc,{table:n}),cell:({row:n})=>a.jsx(Dfe,{row:n,onDeleteSuccess:e,onEditReport:t}),size:140}];function Mfe({destinationType:e,destination:t,onEditReport:n}){const{reports:r,setPollingConfig:s}=is(),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(()=>Ife({onDeleteSuccess:()=>{},onEditReport:n}),[n]),{sorting:u,setSorting:f,columnVisibility:m,setColumnVisibility:x}=Bc({columns:c,storageKeyPrefix:`data-mart-email-reports-${t.id}`,defaultSortingColumn:"lastRunDate"}),g=Dl({data:i,columns:c,getCoreRowModel:Al(),onSortingChange:f,getSortedRowModel:Gc(),state:{sorting:u,columnVisibility:m},onColumnVisibilityChange:x}),y=`email-reports-table-${t.id}`;return a.jsx("div",{className:"w-full",children:a.jsx("div",{className:"dm-card-table-wrap",children:a.jsxs(Ol,{id:y,className:"dm-card-table",role:"table","aria-label":`${t.title} reports`,children:[a.jsx(Il,{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(kl,{style:C.column.id==="actions"?{width:`${String(C.column.getSize())}px`,minWidth:`${String(C.column.getSize())}px`,maxWidth:`${String(C.column.getSize())}px`}:{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(Ml,{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(Yr,{className:`px-6 whitespace-normal ${S.column.id==="actions"?"actions-cell":""}`,style:S.column.id==="actions"?{width:`${String(S.column.getSize())}px`,minWidth:`${String(S.column.getSize())}px`,maxWidth:`${String(S.column.getSize())}px`}:{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(Yr,{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 kfe({children:e,className:t,...n}){return a.jsx("div",{className:oe("group flex items-start justify-center gap-3 rounded-md border-b border-gray-200 bg-white transition-shadow duration-200 hover:shadow-xs dark:border-0 dark:bg-white/2",t),...n,children:e})}function Lfe({children:e,className:t,...n}){return a.jsx("div",{className:oe("flex flex-grow flex-col gap-1 py-4",t),...n,children:e})}function Pfe({children:e,className:t,...n}){return a.jsx("div",{className:oe("text-md font-medium",t),...n,children:e})}function Ufe({children:e,className:t,...n}){return a.jsx("div",{className:oe("text-muted-foreground text-sm",t),...n,children:e})}function zfe({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(rt,{children:[a.jsx(at,{asChild:!0,children:a.jsx("div",{className:"flex items-center justify-center py-5 pl-6",onClick:f=>f.stopPropagation(),children:n?a.jsx(Uc,{className:"text-muted-foreground h-5 w-5 animate-spin"}):a.jsx(BE,{checked:e,disabled:t,onCheckedChange:r})})}),a.jsx(st,{children:u})]})}function Ffe({icon:e,className:t,...n}){return a.jsx("div",{className:oe("flex flex-shrink-0 items-center justify-center self-center p-4",t),...n,children:a.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-full transition-colors duration-200 group-hover:bg-gray-200/50 dark:group-hover:bg-white/4",children:e??a.jsx(ba,{className:"text-muted-foreground/75 dark:text-muted-foreground/50 h-4 w-4"})})})}function Hfe(e){const{dataMart:t}=js(),{reports:n,createReport:r,deleteReport:s,fetchReportsByDataMartId:i}=is(),[c,u]=h.useState(!1),f=h.useMemo(()=>n.find(v=>v.dataDestination.type===Ie.LOOKER_STUDIO&&v.dataDestination.id===e.id),[n,e.id]),m=h.useMemo(()=>(t==null?void 0:t.status.code)===br.PUBLISHED,[t==null?void 0:t.status.code]),x=h.useMemo(()=>!!f,[f]),g=h.useMemo(()=>x?"Available in Looker Studio":"Not available in Looker Studio",[x]),y=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:Hr.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:x,dynamicTitle:g,handleSwitchChange:y}}function $fe({destination:e,onEditReport:t,...n}){const{existingReport:r,isLoading:s,isEnabled:i,isChecked:c,dynamicTitle:u,handleSwitchChange:f}=Hfe(e),m=h.useCallback(()=>{r&&t(r)},[r,t]);return a.jsxs(kfe,{className:r?"cursor-pointer dark:hover:bg-white/5":"",onClick:r?m:void 0,...n,children:[a.jsx(zfe,{checked:c,disabled:!i,loading:s,onCheckedChange:x=>void f(x),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(Lfe,{children:[a.jsx(Pfe,{children:u}),a.jsx(Ufe,{children:c&&r?a.jsx(a.Fragment,{children:r.lastRunDate?a.jsxs(a.Fragment,{children:["Last fetched"," ",r.lastRunStatus===en.SUCCESS&&"successfully ",a.jsx(ws,{date:new Date(r.lastRunDate)}),(r.lastRunStatus===en.ERROR||r.lastRunStatus===en.RESTRICTED)&&" 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(Ffe,{})]})}function Vfe(){const{scope:e}=ko();return a.jsx("div",{className:"dm-card",children:a.jsxs("div",{className:"dm-empty-state",children:[a.jsx(WS,{className:"dm-empty-state-ico",strokeWidth:1}),a.jsx("h2",{className:"dm-empty-state-title",children:"Google Sheets, Looker Studio, Email… and friends!"}),a.jsx("p",{className:"dm-empty-state-subtitle",children:"To turn data into reports using your favorite tools, create a Destination first."}),a.jsx(we,{variant:"outline",asChild:!0,children:a.jsxs(Nr,{to:e("/data-destinations"),className:"flex items-center gap-1",children:["Go to Destinations",a.jsx(ba,{className:"h-4 w-4"})]})})]})})}function Gfe(){const[e,t]=h.useState(!1),[n,r]=h.useState(kn.CREATE),[s,i]=h.useState(null);return{isOpen:e,mode:n,editingReport:s,handleAddReport:()=>{r(kn.CREATE),i(null),t(!0),De({event:"report_open",category:"Report",action:"CreateReport",label:"ReportForm"})},handleEditReport:m=>{r(kn.EDIT),i(m),t(!0),De({event:"report_open",category:"Report",action:"EditReport",label:m.dataDestination.type})},handleCloseModal:()=>{t(!1),i(null),De({event:"report_close",category:"Report",action:n===kn.EDIT?"Edit":"Create",label:"ReportForm"})}}}const Bfe=[Ie.GOOGLE_SHEETS,Ie.EMAIL,Ie.SLACK,Ie.MS_TEAMS,Ie.GOOGLE_CHAT];function qfe({destination:e,dataMartStatus:t}){const{destinationInfo:n,isVisible:r}=dee(e),{isOpen:s,mode:i,editingReport:c,handleAddReport:u,handleEditReport:f,handleCloseModal:m}=Gfe();return r?a.jsxs(a.Fragment,{children:[a.jsxs(yl,{name:e.id,collapsible:!0,defaultCollapsed:!1,children:[a.jsxs(Ro,{children:[a.jsx(wo,{icon:n.icon,children:e.title}),a.jsx(Cm,{children:Bfe.includes(e.type)&&a.jsx(Kfe,{dataMartStatus:t,onAddReport:u})})]}),a.jsx(jo,{children:a.jsx(Yhe,{destination:e,onEditReport:f})}),a.jsx(xi,{})]}),a.jsx(Zhe,{destination:e,isOpen:s,onClose:m,mode:i,initialReport:c})]}):null}function Kfe({dataMartStatus:e,onAddReport:t}){const n=(e==null?void 0:e.code)===br.DRAFT;return a.jsxs(rt,{children:[a.jsx(at,{asChild:!0,children:a.jsx("span",{children:a.jsxs(we,{onClick:t,variant:"outline",size:"sm","aria-label":"Add new report",disabled:n,children:[a.jsx(sa,{className:"h-4 w-4"}),"Add Report"]})})}),n&&a.jsx(st,{children:a.jsx("p",{children:"To create a report, publish the Data Mart first"})})]})}function Wfe({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 Zfe=Yt({title:yt().min(1,"Title is required"),documentUrl:yt().refine(h5,"Enter a valid Google Sheets URL"),dataDestinationId:yt().min(1,"Destination is required")});function Yfe({initialReport:e,mode:t,dataMartId:n,onAfterSubmit:r,onSuccess:s,preSelectedDestination:i}){const[c,u]=h.useState(null),[f,m]=h.useState(!1),{updateReport:x,createReport:g,error:y,clearError:v}=is();h.useEffect(()=>{f&&y&&(u(y),m(!1))},[y,f]);const C=Lo({resolver:Ai(Zfe),defaultValues:{title:(e==null?void 0:e.title)??"",documentUrl:e!=null&&e.destinationConfig&&GC(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:j,reset:R}=C,{errors:T,isDirty:N}=j,A=h.useCallback(async I=>{try{u(null),v(),m(!0);const{spreadsheetId:_,sheetId:M}=$J(I.documentUrl);if(!_){u("Invalid Google Sheets URL");return}let G;if(t===kn.CREATE)G=await g({title:I.title,dataMartId:n,dataDestinationId:I.dataDestinationId,destinationConfig:{type:Hr.GOOGLE_SHEETS_CONFIG,spreadsheetId:_,sheetId:M}});else{if(!e){u("Initial report is required for edit mode");return}G=await x(e.id,{title:I.title,dataDestinationId:I.dataDestinationId,destinationConfig:{type:Hr.GOOGLE_SHEETS_CONFIG,spreadsheetId:_,sheetId:M}})}if(!G||y){u(y??"An error occurred while submitting the form");return}try{await(r==null?void 0:r(G))}catch(H){console.error("onAfterSubmit failed",H)}s==null||s()}catch(_){console.error("Error submitting form:",_),u("An error occurred while submitting the form")}},[t,e,n,g,x,r,s,v,y]);return{form:C,register:S,handleSubmit:E,errors:T,isDirty:N,reset:R,formError:c,isSubmitting:f,setFormError:u,getValues:C.getValues,onSubmit:A}}function Xfe(e){return e.type===hl.SCHEDULED_REPORT_RUN}function Qfe(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 sA=()=>Intl.DateTimeFormat().resolvedOptions().timeZone,oA="0 9 * * *";function Jfe(e){return{id:e.id,cron:e.cronExpression,timezone:e.timeZone,enabled:e.isActive,lastRun:e.lastRunTimestamp??null,nextRun:e.nextRunTimestamp??null}}async function iA(e,t){return(await po.getScheduledTriggers(e)).filter(s=>s.type===zn.REPORT_RUN&&Xfe(s.triggerConfig)&&s.triggerConfig.reportId===t).map(Jfe)}const a2=h.forwardRef(({dataMartId:e,reportId:t,onDirtyChange:n},r)=>{const[s,i]=h.useState([]),[c,u]=h.useState([]),f=h.useRef(!1),[m,x]=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 j=await iA(e,t);S||(u(j),i(j),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(!Qfe(s,c)))},[s,c,n]),h.useImperativeHandle(r,()=>({persist:async S=>{const E=c.filter(A=>A.id!==null),j=s.filter(A=>A.id!==null),R=new Map(E.map(A=>[A.id,A])),T=new Map(j.map(A=>[A.id,A]));for(const[A]of R.entries())T.get(A)||await po.deleteScheduledTrigger(e,A);for(const[A,I]of T.entries()){const _=R.get(A);_&&(_.cron!==I.cron||_.timezone!==I.timezone||_.enabled!==I.enabled)&&await po.updateScheduledTrigger(e,A,{cronExpression:I.cron,timeZone:I.timezone,isActive:I.enabled})}const N=s.filter(A=>!A.id);for(const A of N)await po.createScheduledTrigger(e,{type:zn.REPORT_RUN,cronExpression:A.cron,timeZone:A.timezone,isActive:A.enabled,triggerConfig:{type:hl.SCHEDULED_REPORT_RUN,reportId:S}});try{const A=await iA(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:oA,timezone:sA(),enabled:!0}])},y=S=>{i(E=>E.filter((j,R)=>R!==S))},v=(S,E)=>{i(j=>j.map((R,T)=>T===S?{...R,...E}:R))},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(Ma,{htmlFor:`trigger-enabled-${String(E)}`,className:"text-sm font-normal",children:S.enabled?"Enabled":"Disabled"}),a.jsx(BE,{id:`trigger-enabled-${String(E)}`,checked:S.enabled,onCheckedChange:j=>{v(E,{enabled:j})}})]}),a.jsx("div",{children:a.jsx(we,{variant:"ghost",size:"sm",type:"button","aria-label":"Delete trigger",onClick:()=>{x(E)},children:a.jsx(os,{className:"h-4 w-4","aria-hidden":"true"})})})]}),a.jsx(ES,{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(ws,{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(ws,{date:new Date(S.nextRun)})]})]}),m===E&&a.jsx(J5,{open:m===E,onOpenChange:j=>{j||x(null)},children:a.jsxs(eI,{children:[a.jsxs(tI,{children:[a.jsx(rI,{children:"Delete trigger?"}),a.jsx(aI,{children:"This action will remove this schedule from the report."})]}),a.jsxs(nI,{children:[a.jsx(oI,{onClick:()=>{x(null)},children:"Cancel"}),a.jsx(sI,{className:"bg-red-600 hover:bg-red-700",onClick:()=>{y(E),x(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(ES,{cron:oA,timezone:sA(),enabled:!1,showPreview:!1,showSaveButton:!1,hideEnableSwitch:!0}),a.jsx("div",{className:"gp-2 mt-3 flex items-center justify-between text-sm",children:a.jsx(we,{variant:"outline",type:"button",onClick:g,size:"sm",children:"+ Add trigger"})})]}),C&&a.jsx("div",{children:a.jsx(we,{variant:"outline",type:"button",onClick:g,children:"+ Add trigger"})})]})});a2.displayName="ReportSchedulesInlineList";function ehe(){return a.jsx($t,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(jt,{value:"service-account-details",children:[a.jsx(Tt,{children:"How do I get a correct document link?"}),a.jsxs(_t,{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 t1(e){return"serviceAccount"in e}function Rk({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(ga,{children:a.jsxs(rt,{children:[a.jsx(at,{asChild:!0,children:a.jsxs("div",{role:"button",tabIndex:0,onClick:i,onKeyDown:c=>c.key==="Enter"&&i(),className:oe("flex cursor-pointer items-center justify-between gap-2 select-none","text-muted-foreground border-input rounded-md border px-3 py-1.5 text-sm","hover:bg-accent hover:text-accent-foreground transition-colors"),children:[a.jsx("span",{className:n?"w-[95%]":"truncate",children:t||e||"No data"}),r?a.jsx(Ia,{className:"h-4 w-4 text-green-500"}):a.jsx(od,{className:"h-4 w-4"})]})}),a.jsx(st,{children:a.jsx("p",{children:r?"Copied!":"Click to copy"})})]})})}const the=Pc("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 [&>*:not(:first-child)]:border-white/24 [&>*: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 nhe({className:e,orientation:t,...n}){return a.jsx("div",{role:"group","data-slot":"button-group","data-orientation":t,className:oe(the({orientation:t}),e),...n})}const jk=({mode:e,isSubmitting:t,isDirty:n,triggersDirty:r,runAfterSaveRef:s,onSubmit:i,onCancel:c})=>{const u=t||!(n||r),f=e===kn.CREATE?"Create & Run report":"Save changes to report",m=e===kn.CREATE?"Create new report":n||r?"Save & Run report":"Run report";return a.jsxs(Wc,{children:[a.jsxs(nhe,{className:"w-full",children:[a.jsx(we,{variant:"default",type:"submit",disabled:u,className:"flex-1",onClick:()=>{s.current=e===kn.CREATE},children:f}),a.jsxs(Or,{children:[a.jsx(Ir,{asChild:!0,children:a.jsx(we,{variant:"default",type:"button",disabled:u,"aria-label":"More actions",className:"group",children:a.jsx(ss,{className:"size-4 transition-transform duration-200 group-data-[state=open]:rotate-180","aria-hidden":"true"})})}),a.jsx(Mr,{align:"end",side:"top",children:a.jsx(Ut,{onClick:()=>{s.current=e===kn.EDIT,i()},disabled:t,children:m})})]})]}),c&&a.jsx(we,{variant:"outline",type:"button",onClick:c,disabled:t,children:"Cancel"})]})},rhe=h.forwardRef(({initialReport:e,mode:t,onDirtyChange:n,onFormErrorChange:r,onSubmit:s,onCancel:i,preSelectedDestination:c},u)=>{const f="google-sheets-edit-form",m="google-sheets-title-input",x="google-sheets-document-url-input",g="google-sheets-data-destination-select",{dataMart:y}=js(),{scope:v}=ko(),{dataDestinations:C,fetchDataDestinations:S,loading:E}=Jh(),[j,R]=h.useState([]);h.useEffect(()=>{y&&S()},[y,S]),h.useEffect(()=>{if(C.length>0){const D=C.filter(F=>F.type===Ie.GOOGLE_SHEETS);R(D)}},[C]),Wfe({elementId:m,isOpen:!0,delay:150});const T=h.useRef(null),N=h.useRef(!1),[A,I]=h.useState(!1),{runReport:_}=is(),{isDirty:M,reset:G,form:H,isSubmitting:L,formError:q,onSubmit:W}=Yfe({initialReport:e,mode:t,dataMartId:(y==null?void 0:y.id)??"",onAfterSubmit:async D=>{var F;try{await((F=T.current)==null?void 0:F.persist(D.id))}catch(U){console.error("Failed to persist schedule for report",U)}if(N.current)try{await _(D.id)}catch(U){throw console.error("Failed to run report",U),U}finally{N.current=!1}},onSuccess:()=>{s==null||s()},preSelectedDestination:c});h.useEffect(()=>{r&&r(q)},[q,r]),h.useEffect(()=>{if(t===kn.EDIT&&e&&GC(e.destinationConfig))G({title:e.title,documentUrl:UC(e.destinationConfig.spreadsheetId,e.destinationConfig.sheetId),dataDestinationId:e.dataDestination.id});else if(t===kn.CREATE){const D=(c==null?void 0:c.id)??"";G({title:"",documentUrl:"",dataDestinationId:D})}},[e,t,G,c]),h.useEffect(()=>{n==null||n(M||A)},[M,A,n]);const B=H.watch("documentUrl"),V=B&&h5(B.trim());return a.jsx(Ul,{...H,children:a.jsxs(Ni,{id:f,ref:u,noValidate:!0,onSubmit:D=>void H.handleSubmit(W)(D),children:[a.jsxs(zl,{children:[a.jsxs(Sr,{title:"General",children:[a.jsx(bt,{control:H.control,name:"title",render:({field:D})=>a.jsxs(mt,{children:[a.jsx(ut,{tooltip:"Add a title that reflects the report`s purpose",children:"Title"}),a.jsx(xt,{children:a.jsx(ct,{id:m,placeholder:"Enter a report title",...D})}),a.jsx(Ct,{})]})}),a.jsx(bt,{control:H.control,name:"dataDestinationId",render:({field:D})=>a.jsxs(mt,{children:[a.jsx(ut,{tooltip:"Select one of your existing destinations",children:"Destination"}),a.jsxs(oa,{onValueChange:D.onChange,value:D.value,disabled:E||j.length===0,children:[a.jsx(xt,{children:a.jsx(la,{id:g,className:"w-full max-w-full overflow-hidden",children:a.jsx(ia,{className:"truncate",placeholder:"Select a destination",children:D.value&&j.length>0&&(()=>{const F=j.find(U=>U.id===D.value);if(F){const ee=ha.getInfo(F.type).icon;return a.jsxs("div",{className:"flex w-full min-w-0 items-center gap-2",children:[a.jsx(ee,{className:"flex-shrink-0",size:18}),a.jsx("div",{className:"flex min-w-0 flex-col",children:a.jsx("span",{className:"truncate",children:F.title})})]})}return null})()})})}),a.jsx(ca,{children:j.map(F=>{const ee=ha.getInfo(F.type).icon;return a.jsx(Fn,{value:F.id,children:a.jsxs("div",{className:"flex w-full min-w-0 items-center gap-2",children:[a.jsx(ee,{className:"flex-shrink-0",size:18}),a.jsxs("div",{className:"flex min-w-0 flex-col",children:[a.jsx("span",{className:"truncate",children:F.title}),a.jsx("span",{className:"text-muted-foreground truncate text-xs",children:(t1(F.credentials)&&Tb(F.credentials.serviceAccount))??"No email found"})]})]})},F.id)})})]}),j.length===0&&!E&&a.jsxs($E,{className:"mt-2",children:[a.jsx(Nh,{className:"h-4 w-4"}),a.jsx(EM,{children:"No destinations available"}),a.jsxs(VE,{children:["You need to create a Destination before you can create a report."," ",a.jsx(Nr,{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"})]})]}),D.value&&j.length>0&&(()=>{const F=j.find(U=>U.id===D.value);return F?a.jsxs("div",{className:"mt-2 flex flex-col gap-1",children:[a.jsx(ut,{children:"Service Account Email"}),a.jsx(Rk,{value:t1(F.credentials)?Tb(F.credentials.serviceAccount)??"No email found":"",children:t1(F.credentials)?Tb(F.credentials.serviceAccount):"No email found"})]}):null})(),a.jsx(Ct,{})]})}),a.jsx(bt,{control:H.control,name:"documentUrl",render:({field:D})=>a.jsxs(mt,{children:[a.jsx(ut,{tooltip:"The link must include the Sheet ID to insert data into the correct tab",children:"Document Link with Sheet ID (GID)"}),a.jsx(xt,{children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ct,{id:x,placeholder:"Document URL",className:"flex-1",...D}),a.jsxs(rt,{children:[a.jsx(at,{asChild:!0,children:a.jsx("button",{type:"button",className:`flex-shrink-0 rounded-md p-2 transition-all duration-200 ${V?"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:()=>{V&&window.open(B.trim(),"_blank","noopener,noreferrer")},disabled:!V,"aria-label":V?"Open document in new tab":"Document link is not valid",children:a.jsx(yi,{className:"h-4 w-4","aria-hidden":"true"})})}),a.jsx(st,{side:"top",align:"center",role:"tooltip",children:V?"Open document in new tab":"Enter a valid URL to enable link"})]})]})}),a.jsx(qt,{children:a.jsx(ehe,{})}),a.jsx(Ct,{})]})})]}),a.jsx(Sr,{title:"Automate Report Runs",children:y!=null&&y.id?a.jsx(a2,{ref:T,dataMartId:y.id,reportId:t===kn.EDIT?(e==null?void 0:e.id)??null:null,onDirtyChange:I}):a.jsx(KE,{})})]}),a.jsx(jk,{mode:t,isSubmitting:L,isDirty:M,triggersDirty:A,runAfterSaveRef:N,onSubmit:()=>void H.handleSubmit(W)(),onCancel:i})]})})});function ahe({isOpen:e,onClose:t,initialReport:n,mode:r,preSelectedDestination:s}){const{showUnsavedDialog:i,setShowUnsavedDialog:c,handleClose:u,confirmClose:f,handleFormDirtyChange:m,handleFormSubmitSuccess:x}=Zc(t);return Fl(e),a.jsxs(a.Fragment,{children:[a.jsx(Ei,{open:e,onOpenChange:g=>{g||u()},children:a.jsxs(wi,{children:[a.jsxs(Ri,{children:[a.jsx(ji,{children:r===kn.CREATE?"Create new report":"Edit report"}),a.jsx(Rl,{children:r===kn.CREATE?"Fill in the details to create a new Google Sheets report":"Update details of an existing Google Sheets report"})]}),a.jsx(Qh,{children:a.jsx(rhe,{initialReport:n,mode:r,onDirtyChange:m,onSubmit:x,onCancel:u,preSelectedDestination:s})})]})}),a.jsx(Ar,{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 she=Yt({cacheLifetime:pY().min(300,"Cache time must be at least 5 minutes (300 seconds)")});function ohe({initialReport:e,dataMartId:t,onSuccess:n,preSelectedDestination:r}){const[s,i]=h.useState(null),{createReport:c,updateReport:u}=is(),f=Lo({resolver:Ai(she),defaultValues:{cacheLifetime:e!=null&&e.destinationConfig&&T5(e.destinationConfig)?e.destinationConfig.cacheLifetime:300},mode:"onTouched"});return{form:f,onSubmit:async x=>{try{i(null);const{cacheLifetime:g}=x,y={type:Hr.LOOKER_STUDIO_CONFIG,cacheLifetime:g};e?await u(e.id,{title:"Looker Studio Report",dataDestinationId:e.dataDestination.id,destinationConfig:y}):await c({title:"Looker Studio Report",dataMartId:t,dataDestinationId:(r==null?void 0:r.id)??"",destinationConfig:y}),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 ihe(){return a.jsx($t,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(jt,{value:"cache-lifetime-details",children:[a.jsx(Tt,{children:"What is the Cache Lifetime for Looker Studio?"}),a.jsx(_t,{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 lhe=[{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"}],che=h.forwardRef(({initialReport:e,mode:t,onDirtyChange:n,onFormErrorChange:r,onSubmit:s,onCancel:i,preSelectedDestination:c},u)=>{const f="looker-studio-edit-form",{dataMart:m}=js(),{isDirty:x,reset:g,form:y,isSubmitting:v,formError:C,onSubmit:S}=ohe({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===kn.EDIT&&e&&T5(e.destinationConfig)?g({cacheLifetime:e.destinationConfig.cacheLifetime}):t===kn.CREATE&&g({cacheLifetime:300})},[e,t,g]),h.useEffect(()=>{n==null||n(x)},[x,n]),a.jsx(Ul,{...y,children:a.jsxs(Ni,{id:f,ref:u,noValidate:!0,onSubmit:E=>void y.handleSubmit(S)(E),children:[a.jsx(zl,{children:a.jsx(Sr,{title:"Cache Configuration",children:a.jsx(bt,{control:y.control,name:"cacheLifetime",render:({field:E})=>a.jsxs(mt,{children:[a.jsx(ut,{tooltip:"Period during which query results are served from storage-side cache, avoiding re-execution",children:"Cache Lifetime"}),a.jsxs(oa,{onValueChange:j=>{E.onChange(parseInt(j,10))},value:E.value.toString(),defaultValue:"300",children:[a.jsx(xt,{children:a.jsx(la,{className:"w-full",children:a.jsx(ia,{placeholder:"Select cache time"})})}),a.jsx(ca,{children:lhe.map(j=>a.jsx(Fn,{value:j.value.toString(),children:j.label},j.value))})]}),a.jsx(Ct,{}),a.jsx(qt,{children:a.jsx(ihe,{})})]})})})}),a.jsxs(Wc,{children:[a.jsx(we,{variant:"default",type:"submit",className:"w-full","aria-label":t===kn.CREATE?"Create":"Save changes",disabled:!x||v,children:v?t===kn.CREATE?"Creating...":"Saving...":t===kn.CREATE?"Create":"Save changes"}),i&&a.jsx(we,{variant:"outline",type:"button",onClick:i,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})});function uhe({isOpen:e,onClose:t,initialReport:n,mode:r,preSelectedDestination:s}){const{showUnsavedDialog:i,setShowUnsavedDialog:c,handleClose:u,confirmClose:f,handleFormDirtyChange:m,handleFormSubmitSuccess:x}=Zc(t);return Fl(e),a.jsxs(a.Fragment,{children:[a.jsx(Ei,{open:e,onOpenChange:g=>{g||u()},children:a.jsxs(wi,{children:[a.jsxs(Ri,{children:[a.jsx(ji,{children:(s==null?void 0:s.title)??"Looker Studio"}),a.jsx(Rl,{children:r===kn.CREATE?"Set up Data Mart as a data source":"Update connection details"})]}),a.jsx(Qh,{children:a.jsx(che,{initialReport:n,mode:r,onDirtyChange:m,onSubmit:x,onCancel:u,preSelectedDestination:s})})]})}),a.jsx(Ar,{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 lA=({destination:e})=>{const n=ha.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 dhe(e){return"to"in e}const fhe=({destination:e})=>{if(!e)return null;const t=e.credentials,n=dhe(t)&&t.to.length?t.to.join(", "):"";return a.jsxs("div",{className:"mt-2 flex flex-col gap-1",children:[a.jsx(ut,{children:"Recipients of this report"}),a.jsx(Rk,{doNotTruncateContent:!0,value:n,children:n||"No recipients found"})]})};var xc=(e=>(e.ALWAYS="ALWAYS",e.RESULT_IS_EMPTY="RESULT_IS_EMPTY",e.RESULT_IS_NOT_EMPTY="RESULT_IS_NOT_EMPTY",e))(xc||{});const hhe=Yt({title:yt().min(1,"Title is required"),dataDestinationId:yt().min(1,"Destination is required"),reportCondition:Qx(xc),subject:yt().min(1,"Subject is required"),messageTemplate:yt().min(1,"Message body is required")});function mhe({initialReport:e,mode:t,dataMartId:n,onAfterSubmit:r,onSuccess:s,preSelectedDestination:i}){const[c,u]=h.useState(null),[f,m]=h.useState(!1),{updateReport:x,createReport:g,error:y,clearError:v}=is();h.useEffect(()=>{f&&y&&(u(y),m(!1))},[y,f]);const C=Lo({resolver:Ai(hhe),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&&Nb(e.destinationConfig)?e.destinationConfig.reportCondition:xc.ALWAYS,subject:e!=null&&e.destinationConfig&&Nb(e.destinationConfig)?e.destinationConfig.subject:"",messageTemplate:e!=null&&e.destinationConfig&&Nb(e.destinationConfig)?e.destinationConfig.messageTemplate:""},mode:"onTouched"}),{handleSubmit:S,formState:E,reset:j}=C,{isDirty:R,errors:T}=E,N=h.useCallback(async A=>{try{u(null),v(),m(!0);let I;const _={type:Hr.EMAIL_CONFIG,reportCondition:A.reportCondition,subject:A.subject,messageTemplate:A.messageTemplate};if(t===kn.CREATE)I=await g({title:A.title,dataMartId:n,dataDestinationId:A.dataDestinationId,destinationConfig:_});else{if(!e){u("Initial report is required for edit mode");return}I=await x(e.id,{title:A.title,dataDestinationId:A.dataDestinationId,destinationConfig:_})}if(!I||y){u(y??"An error occurred while submitting the form");return}try{await(r==null?void 0:r(I))}catch(M){console.error("onAfterSubmit failed",M)}s==null||s()}catch(I){console.error("Error submitting form:",I),u("An error occurred while submitting the form")}},[t,e,n,g,x,r,s,v,y]);return{form:C,handleSubmit:S,errors:T,isDirty:R,reset:j,formError:c,isSubmitting:f,setFormError:u,onSubmit:N}}const phe=()=>a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Kr,{className:"h-6 w-3/4"}),a.jsx(Kr,{className:"h-4 w-1/2"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Kr,{className:"h-4 w-full"}),a.jsx(Kr,{className:"h-4 w-5/6"}),a.jsx(Kr,{className:"h-4 w-4/5"}),a.jsx(Kr,{className:"h-4 w-3/4"})]})]});function Tk({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}=Yh(),[u,f]=h.useState({bg:"#fff",fg:"#000"});return h.useEffect(()=>{if(typeof window>"u")return;let m;const x=requestAnimationFrame(()=>{m=requestAnimationFrame(()=>{const g=getComputedStyle(document.documentElement),y=g.getPropertyValue("--background").trim()||"#fff",v=g.getPropertyValue("--foreground").trim()||"#000";f({bg:y,fg:v})})});return()=>{cancelAnimationFrame(x),cancelAnimationFrame(m)}},[c]),a.jsxs("div",{className:`bg-background overflow-auto rounded-md pl-2 ${s??""}`,style:{height:r},children:[t&&a.jsx(phe,{}),!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>
|
|
841
|
+
<html lang='en' style="background:${u.bg};color:${u.fg}">
|
|
842
|
+
<head>
|
|
843
|
+
<meta charset='utf-8'/>
|
|
844
|
+
<base target='_blank'>
|
|
845
|
+
</head>
|
|
846
|
+
<body>${e}</body>
|
|
847
|
+
</html>`,className:"h-full w-full border-0"})]})}function ghe({value:e,onChange:t}){return a.jsx(by,{value:e,onValueChange:n=>{t(n)},children:a.jsxs(Sy,{children:[a.jsx(Oc,{value:"markdown",children:"Markdown"}),a.jsx(Oc,{value:"preview",children:"Preview"})]})})}function xhe({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),x=h.useRef(null);return h.useEffect(()=>{var C;if(!t)return;const g=e;if(!g.trim()){i(""),m(null),u(!1);return}const y=new AbortController;(C=x.current)==null||C.abort(),x.current=y,u(!0),m(null);const v=setTimeout(()=>{r(g,y.signal).then(S=>{i(S)}).catch(S=>{if(y.signal.aborted)return;const E=S instanceof Error?S.message:"Failed to load preview";m(E)}).finally(()=>{y.signal.aborted||u(!1)})},n);return()=>{clearTimeout(v),y.abort()}},[e,t,n,r]),{html:s,loading:c,error:f}}function yhe(e,t){return Aa.post("/markdown/parse-to-html",{markdown:e},{headers:{"Content-Type":"application/json"},responseType:"text",signal:t}).then(n=>n.data)}function _k(e){const t=h.useCallback(yhe,[]);return xhe({...e,toHtml:t})}const vhe={list:[],listLoadingStatus:kt.IDLE,activeInsight:null,activeInsightLoadingStatus:kt.IDLE,executionStatus:kt.IDLE,executionTriggerId:null,error:null};var vt=(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))(vt||{});class bhe extends _l{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 createInsightWithAi(t){return this.post(`/${t}/insights/ai-generate`,{})}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 Ls=new bhe,fc=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)}),She=e=>e.data.map(fc),Che=e=>({title:e.title,template:e.template??null}),Ehe=e=>({title:e.title,template:e.template??null}),Nk=h.createContext(void 0);function Ak(){const e=h.useContext(Nk);if(!e)throw new Error("useInsightsContext must be used within InsightsProvider");return e}function Iy(){const e=Lc(),{state:t,dispatch:n}=Ak(),{dataMart:r}=to();if(!r)throw new Error("useInsights must be used within a DataMart context");const s=h.useCallback(async()=>{n({type:vt.FETCH_INSIGHTS_START});try{const R=await Ls.getInsights(r.id),T=She(R);n({type:vt.FETCH_INSIGHTS_SUCCESS,payload:T})}catch(R){throw n({type:vt.FETCH_INSIGHTS_ERROR,payload:mn(R)}),R}},[r.id,n]),i=h.useCallback(async R=>{n({type:vt.GET_INSIGHT_START});try{const T=await Ls.getInsightById(r.id,R),N=fc(T);return n({type:vt.GET_INSIGHT_SUCCESS,payload:N}),N}catch(T){throw n({type:vt.GET_INSIGHT_ERROR,payload:mn(T)}),T}},[r.id,n]),c=h.useCallback(async R=>{const T=await Ls.getInsightById(r.id,R);return fc(T)},[r.id]),u=h.useCallback(async R=>{n({type:vt.CREATE_INSIGHT_START});try{const T=Che(R),N=await Ls.createInsight(r.id,T),A=fc(N);return n({type:vt.CREATE_INSIGHT_SUCCESS,payload:A}),De({event:"insight_created",category:"Insights",action:"Create",label:A.id,details:A.title,context:r.id,value:r.title}),Dt.success("Insight created"),A}catch(T){const N=mn(T);return n({type:vt.CREATE_INSIGHT_ERROR,payload:N}),De({event:"insight_error",category:"Insights",action:"CreateError",label:R.title,context:r.id,error:N.message}),null}},[r.id,r.title,n]),f=h.useCallback(async()=>{n({type:vt.CREATE_INSIGHT_START});try{const R=await Ls.createInsightWithAi(r.id),T=fc(R);return n({type:vt.CREATE_INSIGHT_SUCCESS,payload:T}),De({event:"insight_generated_with_ai",category:"Insights",action:"Generate with AI",label:T.id}),Dt.success("Insight generated with AI"),T}catch(R){return n({type:vt.CREATE_INSIGHT_ERROR,payload:mn(R)}),null}},[r.id,n]),m=h.useCallback(async(R,T)=>{n({type:vt.UPDATE_INSIGHT_START});try{const N=Ehe(T),A=await Ls.updateInsight(r.id,R,N),I=fc(A);return n({type:vt.UPDATE_INSIGHT_SUCCESS,payload:I}),De({event:"insight_updated",category:"Insights",action:"Update",label:I.id,context:r.id,details:I.title}),Dt.success("Insight updated"),I}catch(N){return n({type:vt.UPDATE_INSIGHT_ERROR,payload:mn(N)}),null}},[r.id,n]),x=h.useCallback(async R=>{n({type:vt.DELETE_INSIGHT_START});try{await Ls.deleteInsight(r.id,R),n({type:vt.DELETE_INSIGHT_SUCCESS,payload:R}),De({event:"insight_deleted",category:"Insights",action:"Delete",label:R}),Dt.success("Insight deleted")}catch(T){throw n({type:vt.DELETE_INSIGHT_ERROR,payload:mn(T)}),T}},[r.id,n]),g=h.useCallback(async(R,T)=>{n({type:vt.UPDATE_INSIGHT_START});try{const N=await Ls.updateInsightTitle(r.id,R,{title:T}),A=fc(N),I=t.list.find(M=>M.id===R)??t.activeInsight,_=I?{...A,template:I.template}:A;return n({type:vt.UPDATE_INSIGHT_SUCCESS,payload:_}),De({event:"insight_title_updated",category:"Insights",action:"Update title",label:_.id,context:r.id,details:_.title}),Dt.success("Title updated"),_}catch(N){return n({type:vt.UPDATE_INSIGHT_ERROR,payload:mn(N)}),null}},[r.id,n,t.activeInsight,t.list]),y=h.useCallback(async R=>{n({type:vt.RUN_INSIGHT_START});try{const T=await Ls.startInsightExecution(r.id,R);n({type:vt.RUN_INSIGHT_STARTED,payload:{triggerId:T.triggerId}}),De({event:"insight_run",category:"Insights",action:"Run",label:R})}catch(T){n({type:vt.RUN_INSIGHT_ERROR,payload:mn(T)})}},[n,r.id]),v=h.useCallback(()=>{n({type:vt.RUN_INSIGHT_SUCCESS,payload:{triggerId:""}})},[n]),C=h.useCallback(R=>{n({type:vt.RUN_INSIGHT_STARTED,payload:{triggerId:R}})},[n]),S=h.useCallback(async()=>{const R=t.activeInsight;if(!(!R||!r.id)&&!t.executionTriggerId&&!(!R.lastRun||_5(R.lastRun.status)))try{const N=(await Ls.getInsightRunTriggers(r.id,R.id,{skipLoadingIndicator:!0})).data.sort((A,I)=>new Date(I.modifiedAt).getTime()-new Date(A.modifiedAt).getTime()).find(A=>!Fee(A.status));N!=null&&N.id&&(n({type:vt.RUN_INSIGHT_START}),n({type:vt.RUN_INSIGHT_STARTED,payload:{triggerId:N.id}}))}catch(T){n({type:vt.RUN_INSIGHT_ERROR,payload:mn(T)})}},[t.activeInsight,t.executionTriggerId,r.id,n]),E=h.useCallback(async()=>{const R=await u({title:"Untitled insight"});R&&e(R.id)},[u,e]),j=h.useCallback(async()=>{const R=await f();R&&e(R.id)},[f,e]);return{insights:t.list,activeInsight:t.activeInsight,listLoading:t.listLoadingStatus===kt.LOADING,insightLoading:t.activeInsightLoadingStatus===kt.LOADING,isRunning:t.executionStatus===kt.LOADING,triggerId:t.executionTriggerId,error:t.error,fetchInsights:s,getInsight:i,getInsightSilently:c,createInsight:u,createInsightWithAi:f,handleCreateInsight:E,handleCreateInsightWithAi:j,updateInsight:m,updateInsightTitle:g,deleteInsight:x,runInsight:y,setTriggerId:C,resetTriggerId:v,ensureActiveRunPolling:S}}function Dk(){const{state:e}=Ak(),t=h.useMemo(()=>e.list,[e.list]),n=h.useMemo(()=>e.listLoadingStatus===kt.LOADING,[e.listLoadingStatus]),r=h.useMemo(()=>e.listLoadingStatus===kt.LOADED||e.listLoadingStatus===kt.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 whe(e,t){var n,r;switch(t.type){case vt.FETCH_INSIGHTS_START:return{...e,listLoadingStatus:kt.LOADING,error:null};case vt.GET_INSIGHT_START:return{...e,activeInsightLoadingStatus:kt.LOADING,error:null};case vt.CREATE_INSIGHT_START:return{...e,activeInsightLoadingStatus:kt.LOADING,error:null};case vt.UPDATE_INSIGHT_START:return{...e,error:null};case vt.DELETE_INSIGHT_START:return{...e,listLoadingStatus:kt.LOADING,error:null};case vt.FETCH_INSIGHTS_SUCCESS:return{...e,list:t.payload,listLoadingStatus:kt.LOADED,error:null};case vt.GET_INSIGHT_SUCCESS:return{...e,activeInsight:t.payload,activeInsightLoadingStatus:kt.LOADED,error:null};case vt.CREATE_INSIGHT_SUCCESS:return{...e,list:[...e.list,t.payload],listLoadingStatus:kt.LOADED,activeInsightLoadingStatus:kt.LOADED,error:null};case vt.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:kt.LOADED,error:null};case vt.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:kt.LOADED,error:null};case vt.FETCH_INSIGHTS_ERROR:return{...e,listLoadingStatus:kt.ERROR,error:t.payload};case vt.GET_INSIGHT_ERROR:return{...e,activeInsightLoadingStatus:kt.ERROR,error:t.payload};case vt.CREATE_INSIGHT_ERROR:return{...e,listLoadingStatus:kt.ERROR,activeInsightLoadingStatus:kt.ERROR,error:t.payload};case vt.UPDATE_INSIGHT_ERROR:case vt.DELETE_INSIGHT_ERROR:return{...e,listLoadingStatus:kt.ERROR,error:t.payload};case vt.RUN_INSIGHT_START:return{...e,executionStatus:kt.LOADING,error:null};case vt.RUN_INSIGHT_STARTED:return{...e,executionTriggerId:t.payload.triggerId,error:null};case vt.RUN_INSIGHT_SUCCESS:return{...e,executionStatus:kt.LOADED,executionTriggerId:null,error:null};case vt.CLEAR_ERROR:return{...e,error:null};default:return e}}function s2({children:e,initialState:t}){const[n,r]=h.useReducer(whe,t??vhe);return a.jsx(Nk.Provider,{value:{state:n,dispatch:r},children:e})}const Rhe=[{label:"New prompt",insertText:`{{#prompt}}
|
|
848
|
+
$0
|
|
849
|
+
{{/prompt}}`,documentation:"Insert a {{#prompt}} template for generative queries"}],n1=new WeakMap,r1=new WeakMap,cA="insight.copyTemplate";let wg=null;function uA(e){wg=e}function jhe(e,t){const n=n1.get(e)??new Set;if(n1.has(e)||n1.set(e,n),n.has(t))return;e.editor.registerCommand(cA,()=>{wg==null||wg()});const r=e.languages.registerCompletionItemProvider(t,{triggerCharacters:["/"],provideCompletionItems:(i,c)=>{const u=c.lineNumber,f=c.column,m=i.getValueInRange({startLineNumber:u,startColumn:1,endLineNumber:u,endColumn:f}),x=m.lastIndexOf("/");if(x!==-1){const g=m.substring(x+1),y={startLineNumber:u,endLineNumber:u,startColumn:x+2,endColumn:f},v={range:{startLineNumber:u,endLineNumber:u,startColumn:x+1,endColumn:x+2},text:""},C=[];return Rhe.forEach((S,E)=>{S.label.startsWith(g)&&C.push({label:S.label,insertText:S.insertText,documentation:{value:S.documentation,isTrusted:!0},detail:S.documentation,kind:e.languages.CompletionItemKind.Field,insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:y,additionalTextEdits:[v],sortText:`${String(E)}_${S.label}`})}),C.push({label:"Copy template…",kind:e.languages.CompletionItemKind.Reference,detail:"Copy template from an existing Insight",insertText:"",range:y,additionalTextEdits:[v],command:{id:cA,title:"Copy template…"},sortText:"999_copy_template"}),{suggestions:C}}return{suggestions:[]}}}),s=r1.get(e)??new Map;r1.has(e)||r1.set(e,s),s.set(t,r),n.add(t)}function NS({value:e,onChange:t,height:n="60vh",className:r,readOnly:s,showLineNumbers:i=!0,excludeInsightId:c}){const{resolvedTheme:u}=Yh(),f=h.useRef(null),m=h.useRef(null),x=h.useRef(null),[g,y]=h.useState(!1),[v,C]=h.useState({top:0,left:0}),[S,E]=h.useState(320),[j,R]=h.useState(""),T=h.useRef(null),{insights:N,isLoading:A}=Dk(),{fetchInsights:I,getInsightSilently:_}=Iy(),M=()=>{const L=m.current,q=x.current;if(!L||!q)return;const W=L.getLayoutInfo(),B=W.contentLeft,V=W.contentWidth,D=8,F=288,U=16,ee=B+(V-F)/2,he=B+D,z=B+Math.max(0,V-F-D),$=Math.min(Math.max(ee,he),z);C({top:D,left:$});const P=W.height,K=Math.max(120,P-U);E(K),y(!0),De({event:"insight_editor_open_copy_template_menu",category:"InsightEditor",action:"OpenMenu"})},G=async L=>{const q=m.current;if(!q||!q.getModel())return;const B=q.getPosition();if(!B)return;const V={startLineNumber:B.lineNumber,startColumn:B.column,endLineNumber:B.lineNumber,endColumn:B.column};let D=L.template??"";if(!D||D.length===0)try{const U=await _(L.id);if(D=(U==null?void 0:U.template)??"",D.length===0){In.error("Insight template is empty"),y(!1);return}}catch{console.error("[InsightEditor] Failed to fetch insight template - skipping")}const F=D.concat(`
|
|
850
|
+
|
|
851
|
+
<!-- Copied from Insight: ${L.title} (${L.id}) -->
|
|
852
|
+
`);q.executeEdits("insight-editor",[{range:V,text:F,forceMoveMarkers:!0}]),De({event:"insight_editor_copy_template",category:"InsightEditor",action:"CopyTemplate",label:L.title,details:L.id}),q.focus(),y(!1)},H=(L,q)=>{m.current=L,x.current=q,jhe(q,"markdown");const W=()=>{uA(()=>{A||I(),R(""),M()})};W();const B=L.onDidFocusEditorText(()=>{W()}),V=L.onDidScrollChange(()=>{y(!1)}),D=L.onMouseDown(()=>{y(!1)}),F="insight-editor-inline-placeholder",U=document.createElement("div");U.textContent="Press '/' for commands";const ee=()=>{try{const Re=L.getOption(q.editor.EditorOption.fontInfo),Ge=`${String(Re.fontSize)}px`,ot=`${String(Re.lineHeight)}px`,Vt=Re.fontFamily;Object.assign(U.style,{color:"inherit",opacity:"0.55",fontStyle:"italic",fontSize:Ge,lineHeight:ot,fontFamily:Vt,pointerEvents:"none",whiteSpace:"pre",userSelect:"none"})}catch{Object.assign(U.style,{color:"inherit",opacity:"0.55",fontStyle:"italic",pointerEvents:"none",whiteSpace:"pre",userSelect:"none"})}};ee();let he=null,z=null;const $={getId:()=>F,getDomNode:()=>U,getPosition:()=>he};L.addContentWidget($);const P=Re=>{he={position:{lineNumber:Re,column:1},preference:[q.editor.ContentWidgetPositionPreference.EXACT]},U.style.display="",L.layoutContentWidget($)},K=()=>{he=null,U.style.display="none",L.layoutContentWidget($)},Y=()=>{const Re=L.getModel(),Ge=L.getPosition()??z;if(!Re||!Ge){K();return}const ot=Re.getLineCount(),Vt=Math.min(Math.max(1,Ge.lineNumber),Math.max(1,ot));Re.getLineContent(Vt).trim().length===0?P(Vt):K()};Y();const se=L.onDidChangeCursorPosition(()=>{const Re=L.getPosition();Re&&(z=Re),Y()}),Q=L.onDidChangeModelContent(()=>{Y()}),le=L.onDidChangeModel(()=>{Y()}),pe=L.onDidBlurEditorText(()=>{Y()}),be=L.onDidFocusEditorText(()=>{const Re=L.getPosition();Re&&(z=Re),Y()}),ze=L.onDidChangeConfiguration(()=>{ee(),Y()});T.current={scroll:V,mouse:D,layout:B,cursor:se,content:Q,model:le,blur:pe,focusText:be,config:ze,placeholderWidget:{dispose:()=>{try{L.removeContentWidget($)}catch{}}}}};return h.useEffect(()=>()=>{var q,W,B,V,D,F,U,ee,he,z;uA(null);const L=T.current;if(L){try{(q=L.scroll)==null||q.dispose(),(W=L.mouse)==null||W.dispose(),(B=L.layout)==null||B.dispose(),(V=L.cursor)==null||V.dispose(),(D=L.content)==null||D.dispose(),(F=L.model)==null||F.dispose(),(U=L.blur)==null||U.dispose(),(ee=L.focusText)==null||ee.dispose(),(he=L.config)==null||he.dispose(),(z=L.placeholderWidget)==null||z.dispose()}catch{}T.current=null}},[]),h.useEffect(()=>{if(!g)return;const L=W=>{const B=W.target,V=f.current;V&&B&&!V.contains(B)&&y(!1)},q=W=>{var B;W.key==="Escape"&&(W.preventDefault(),W.stopPropagation(),y(!1),R(""),(B=m.current)==null||B.focus())};return document.addEventListener("mousedown",L),document.addEventListener("keydown",q,!0),()=>{document.removeEventListener("mousedown",L),document.removeEventListener("keydown",q,!0)}},[g]),a.jsxs("div",{ref:f,className:r,style:{position:"relative"},children:[a.jsx(eM,{height:n,language:"markdown",theme:u==="dark"?"vs-dark":"light",className:"overflow-hidden rounded-tl-md",value:e,onChange:L=>{t(L??"")},onMount:H,options:{minimap:{enabled:!1},scrollBeyondLastLine:!1,wordWrap:"on",overviewRulerBorder:!1,automaticLayout:!0,overviewRulerLanes:0,readOnly:!!s,lineNumbers:i?"on":"off"}}),g&&a.jsx("div",{style:{position:"absolute",top:v.top,left:v.left,zIndex:60},onMouseDown:L=>{L.stopPropagation()},children:a.jsx("div",{className:"bg-popover text-popover-foreground flex w-72 flex-col rounded-md border shadow-md outline-none",style:{maxHeight:S},children:a.jsxs(IE,{className:"flex min-h-0 flex-col",children:[a.jsx(ME,{autoFocus:!0,placeholder:"Search insights…",value:j,onValueChange:R}),a.jsxs(cM,{className:"flex-1 overflow-auto",children:[A&&a.jsx("div",{className:"p-2 text-sm opacity-60",children:"Loading…"}),!A&&N.filter(L=>c?L.id!==c:!0).filter(L=>(j||"").length?L.title.toLowerCase().includes(j.toLowerCase()):!0).map(L=>a.jsx(kE,{value:`${L.id}:${L.title}`,onSelect:()=>{G(L)},children:a.jsx("span",{className:"block w-full truncate whitespace-nowrap",children:L.title})},L.id)),!A&&N.filter(L=>c?L.id!==c:!0).length===0&&a.jsxs("div",{className:"flex items-start gap-2 p-2 text-sm opacity-60",children:[a.jsx(Gz,{className:"mt-0.5 h-4 w-4 shrink-0","aria-hidden":"true"}),a.jsx("span",{children:"No insights yet. Create them on the Insights tab, then you can copy their templates into the email report."})]})]})]})})})]})}function The(){return a.jsx($t,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(jt,{value:"message-details",children:[a.jsx(Tt,{children:"How can I format my message?"}),a.jsxs(_t,{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(Ft,{className:"underline",href:"https://www.markdownguide.org/basic-syntax/",children:"quick guide"})]})]})]})})}function _he(){return a.jsx($t,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(jt,{value:"sending-condition-details",children:[a.jsx(Tt,{children:"What are Data Mart Run results?"}),a.jsxs(_t,{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 Nhe(){return a.jsxs(jt,{value:"sheets-api-details",children:[a.jsx(Tt,{children:"How do I enable the Google Sheets API?"}),a.jsxs(_t,{children:[a.jsxs("p",{className:"mb-2",children:["To send data to Google Sheets, you need to enable the"," ",a.jsx(Ft,{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 Ahe(){return a.jsxs(jt,{value:"looker-studio-details",children:[a.jsx(Tt,{children:"How do I connect to Looker Studio?"}),a.jsxs(_t,{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(Ft,{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(Ft,{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 Dhe(){return a.jsxs(jt,{value:"odata-details",children:[a.jsx(Tt,{children:"How do I use OData?"}),a.jsxs(_t,{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 Ohe(){return a.jsxs(jt,{value:"email-details",children:[a.jsx(Tt,{children:"How do I start sending Email?"}),a.jsxs(_t,{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(Ft,{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 Ihe(){return a.jsxs(jt,{value:"slack-details",children:[a.jsx(Tt,{children:"How do I start sending to Slack?"}),a.jsxs(_t,{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(Ft,{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 Mhe(){return a.jsxs(jt,{value:"msteams-details",children:[a.jsx(Tt,{children:"How do I start sending to Microsoft Teams?"}),a.jsxs(_t,{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(Ft,{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 khe(){return a.jsxs(jt,{value:"googlechat-details",children:[a.jsx(Tt,{children:"How do I start sending to Google Chat?"}),a.jsxs(_t,{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(Ft,{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 Lhe={[Ie.GOOGLE_SHEETS]:Nhe,[Ie.LOOKER_STUDIO]:Ahe,[Ie.ODATA]:Dhe,[Ie.EMAIL]:Ohe,[Ie.SLACK]:Ihe,[Ie.MS_TEAMS]:Mhe,[Ie.GOOGLE_CHAT]:khe};function Phe({destinationType:e}){const t=Lhe[e];return a.jsx($t,{variant:"common",type:"single",collapsible:!0,children:a.jsx(t,{})})}function Uhe({form:e,isEditMode:t,allowedDestinationTypes:n}){const{flags:r}=wd();return a.jsx(bt,{control:e.control,name:"type",render:({field:s})=>a.jsxs(mt,{children:[a.jsx(ut,{tooltip:"Select the destination to send your data",children:"Destination Type"}),a.jsxs(oa,{onValueChange:s.onChange,defaultValue:s.value,disabled:!!t,children:[a.jsx(xt,{children:a.jsx(la,{className:"w-full",children:a.jsx(ia,{placeholder:"Select a destination type"})})}),a.jsx(ca,{children:a.jsx(gy,{children:ha.getAllTypes().filter(({type:i})=>n&&n.length>0?n.includes(i):!0).map(({type:i,displayName:c,icon:u,status:f})=>{const m=f===Us.COMING_SOON,x=f===Us.CLOUD_ONLY&&See(r);return a.jsx(a.Fragment,{children:x?a.jsxs(rt,{children:[a.jsx(at,{asChild:!0,children:a.jsx("div",{children:a.jsx(Fn,{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(st,{side:"left",align:"start",className:"w-[220px]",children:["Available only in"," ",a.jsxs(Nr,{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(yi,{className:"h-3 w-3"})]})," ","or with"," ",a.jsxs(Nr,{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(yi,{className:"h-3 w-3"})]}),"."]})]}):a.jsx(Fn,{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(qt,{children:a.jsx(Phe,{destinationType:s.value})}),a.jsx(Ct,{})]})})}const Ok="credentials.to",zhe=/[,;\n]/,Fhe=", ",Ik="Enter emails separated by comma, semicolon or newline",Hhe="Emails list";function dA(e){const t=new Set,n=[];for(const r of e.split(zhe)){const s=r.trim();if(!s)continue;const i=s.toLowerCase();t.has(i)||(t.add(i),n.push(s))}return n}function a1(e){return e.join(Fhe)}function fA(e,t){e.setValue(Ok,t,{shouldDirty:!0,shouldTouch:!0})}function $he({field:e,form:t}){const n=Array.isArray(e.value)?a1(e.value):"",[r,s]=h.useState(n),[i,c]=h.useState(!1),u=Array.isArray(e.value)?a1(e.value):"";h.useEffect(()=>{i||s(u)},[u,i]);const f=g=>{const y=g.target.value;s(y),fA(t,dA(y))},m=()=>{c(!0)},x=g=>{c(!1),e.onBlur();const y=dA(g.target.value);fA(t,y),s(a1(y))};return a.jsx(Mo,{name:e.name,ref:e.ref,onFocus:m,onBlur:x,value:r,onChange:f,className:"min-h-[150px] font-mono",rows:8,placeholder:Ik})}function lg({form:e,emailsFieldTitle:t=Hhe}){return a.jsx(bt,{control:e.control,name:Ok,render:({field:n})=>a.jsxs(mt,{children:[a.jsx("div",{className:"flex items-center justify-between",children:a.jsx(ut,{tooltip:Ik,children:t})}),a.jsx(xt,{children:a.jsx($he,{field:n,form:e})}),a.jsx(Ct,{})]})})}function Vhe(){return a.jsx($t,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(jt,{value:"service-account-details",children:[a.jsx(Tt,{children:"How do I get a Service Account JSON key?"}),a.jsxs(_t,{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(Ft,{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 Ghe({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?b5(i):null;return a.jsx(bt,{control:e.control,name:"credentials.serviceAccount",render:({field:u})=>a.jsxs(mt,{children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(ut,{tooltip:"Paste a JSON key from a service account that has access to the selected destination provider",children:"Service Account"}),!t&&i&&a.jsx(we,{variant:"ghost",size:"sm",onClick:r,type:"button",children:"Edit"}),t&&a.jsx(we,{variant:"ghost",size:"sm",onClick:s,type:"button",children:"Cancel"})]}),a.jsx(xt,{children:!t&&c?a.jsxs(rt,{children:[a.jsx(at,{asChild:!0,children:a.jsx(Ft,{href:c.url,children:c.email})}),a.jsx(st,{children:a.jsx("p",{children:"View in Google Cloud Console"})})]}):a.jsx(Mo,{...u,className:"min-h-[150px] font-mono",rows:8,placeholder:"Paste your service account JSON here"})}),a.jsx(qt,{children:a.jsx(Vhe,{})}),a.jsx(Ct,{})]})})}function o2(e){return"destinationSecretKey"in e}function Bhe(){return a.jsx($t,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(jt,{value:"json-config-details",children:[a.jsx(Tt,{children:"What is the JSON Config for Looker Studio?"}),a.jsxs(_t,{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 qhe({form:e}){const t=e.getValues("credentials"),n=h.useMemo(()=>t&&o2(t)?t:{deploymentUrl:"",destinationId:"",destinationSecretKey:""},[t]),r=h.useMemo(()=>HC(n),[n]);return a.jsx(a.Fragment,{children:n.destinationSecretKey&&a.jsx(bt,{control:e.control,name:"credentials.destinationSecretKey",render:()=>a.jsxs(mt,{children:[a.jsx(ut,{children:"JSON Config"}),a.jsx(xt,{children:a.jsx(SO,{value:r,displayOnly:!0,keysToMask:["destinationSecretKey"],className:"bg-muted overflow-auto rounded-md text-sm",showCopyButton:!0})}),a.jsx(Ct,{}),a.jsx(qt,{children:a.jsx(Bhe,{})})]})})})}function Khe({initialData:e,onSubmit:t,onCancel:n,onDirtyChange:r,isEditMode:s,allowedDestinationTypes:i}){const c=Lo({resolver:Ai(see),defaultValues:e??{title:"New Destination",type:Ie.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:x}=c.formState,g=v5(m);return x.credentials||delete g.credentials,t(g)};return a.jsx(Ul,{...c,children:a.jsxs(Ni,{onSubmit:m=>{c.handleSubmit(f)(m)},children:[a.jsxs(zl,{children:[a.jsx(bt,{control:c.control,name:"title",render:({field:m})=>a.jsxs(mt,{children:[a.jsx(ut,{tooltip:"Name the destination to clarify its purpose",children:"Title"}),a.jsx(xt,{children:a.jsx(ct,{placeholder:"Enter title",...m})}),a.jsx(Ct,{})]})}),a.jsx(Uhe,{form:c,isEditMode:s,allowedDestinationTypes:i}),u===Ie.GOOGLE_SHEETS&&a.jsx(Ghe,{form:c}),u===Ie.LOOKER_STUDIO&&a.jsx(qhe,{form:c}),u===Ie.EMAIL&&a.jsx(lg,{form:c,emailsFieldTitle:"Enter user emails list"}),u===Ie.SLACK&&a.jsx(lg,{form:c,emailsFieldTitle:"Enter Slack channel emails list"}),u===Ie.MS_TEAMS&&a.jsx(lg,{form:c,emailsFieldTitle:"Enter Microsoft Teams channel emails list"}),u===Ie.GOOGLE_CHAT&&a.jsx(lg,{form:c,emailsFieldTitle:"Enter Google Chat channel emails list"})]}),a.jsxs(Wc,{children:[a.jsxs(we,{variant:"default",type:"submit",className:"w-full","aria-label":"Save",disabled:!c.formState.isDirty||c.formState.isSubmitting,children:[c.formState.isSubmitting&&a.jsx(Uc,{className:"mr-2 h-4 w-4 animate-spin"}),"Save"]}),a.jsx(we,{variant:"outline",type:"button",onClick:n,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})}function Mk({isOpen:e,onClose:t,dataDestination:n,onSaveSuccess:r,initialFormData:s,allowedDestinationTypes:i}){const{updateDataDestination:c,createDataDestination:u}=Jh(),{showUnsavedDialog:f,setShowUnsavedDialog:m,handleClose:x,confirmClose:g,handleFormDirtyChange:y,handleFormSubmitSuccess:v}=Zc(t);Fl(e);const C=async E=>{const j=g5.getMapper(E.type);if(n){const R=j.mapToUpdateRequest(E),T=await c(n.id,R);T&&r(T)}else{const R=j.mapToCreateRequest(E),T=await u(R);T&&r(T)}v()},S=h.useRef(!1);return h.useEffect(()=>{const E=n?"Edit":"Create";e&&!S.current?(De({event:"data_destination_config_open",category:"DataDestination",action:E,label:n==null?void 0:n.type}),S.current=!0):!e&&S.current&&(De({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(Ei,{open:e,onOpenChange:E=>{E||x()},children:a.jsxs(wi,{children:[a.jsxs(Ri,{children:[a.jsx(ji,{children:"Configure destination"}),a.jsx(Rl,{children:"Customize settings for your destination"})]}),a.jsx(Khe,{initialData:n??s??null,onSubmit:C,onCancel:x,onDirtyChange:y,isEditMode:!!n,allowedDestinationTypes:i})]})}),a.jsx(Ar,{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 Whe=[Ie.EMAIL,Ie.SLACK,Ie.GOOGLE_CHAT,Ie.MS_TEAMS],kk=h.forwardRef(({initialReport:e,mode:t,onDirtyChange:n,onFormErrorChange:r,onSubmit:s,onCancel:i,preSelectedDestination:c,prefill:u,allowedDestinationTypes:f},m)=>{const x="email-report-edit-form",{dataMart:g}=to(),y=h.useRef(null),v=h.useRef(!1),[C,S]=h.useState(!1),{runReport:E}=is(),{dataDestinations:j,fetchDataDestinations:R,loading:T}=Jh(),[N,A]=h.useState([]),[I,_]=h.useState(!1);h.useEffect(()=>{g&&R()},[g,R]),h.useEffect(()=>{if(j.length>0){const P=f??(c!=null&&c.type?[c.type]:Whe),K=j.filter(Y=>P.includes(Y.type));A(K)}},[j,c==null?void 0:c.type,f]);const{isDirty:M,reset:G,form:H,isSubmitting:L,formError:q,onSubmit:W}=mhe({initialReport:e,mode:t,dataMartId:(g==null?void 0:g.id)??"",onAfterSubmit:async P=>{var K;try{await((K=y.current)==null?void 0:K.persist(P.id))}catch(Y){console.error("Failed to persist schedule for report",Y)}if(v.current)try{await E(P.id)}catch(Y){throw console.error("Failed to run report",Y),Y}finally{v.current=!1}},onSuccess:()=>{s==null||s()},preSelectedDestination:c});h.useEffect(()=>{r&&r(q)},[q,r]),h.useEffect(()=>{if(!(t===kn.EDIT&&e)){if(t===kn.CREATE){const P=(c==null?void 0:c.id)??"";G({title:(u==null?void 0:u.title)??"",dataDestinationId:P,reportCondition:xc.ALWAYS,subject:(u==null?void 0:u.subject)??"",messageTemplate:(u==null?void 0:u.messageTemplate)??""})}}},[e,t,G,c,u==null?void 0:u.title,u==null?void 0:u.subject,u==null?void 0:u.messageTemplate]),h.useEffect(()=>{n==null||n(M||C)},[M,C,n]);const B=h.useMemo(()=>[{value:xc.ALWAYS,label:"Send always"},{value:xc.RESULT_IS_EMPTY,label:"Send only when result is empty"},{value:xc.RESULT_IS_NOT_EMPTY,label:"Send only when result is not empty"}],[]),[V,D]=h.useState("markdown"),F=H.watch("messageTemplate"),{html:U,loading:ee,error:he}=_k({markdown:F,enabled:V==="preview"}),z=H.watch("dataDestinationId"),$=h.useMemo(()=>z&&N.length>0?N.find(P=>P.id===z)??null:null,[z,N]);return a.jsxs(a.Fragment,{children:[a.jsx(Ul,{...H,children:a.jsxs(Ni,{id:x,ref:m,noValidate:!0,onSubmit:P=>{H.handleSubmit(W)(P)},children:[a.jsxs(zl,{children:[a.jsxs(Sr,{title:"General",children:[a.jsx(bt,{control:H.control,name:"title",render:({field:P})=>a.jsxs(mt,{children:[a.jsx(ut,{tooltip:"Add a title that reflects the report`s purpose",children:"Title"}),a.jsx(xt,{children:a.jsx(ct,{placeholder:"Enter a report title",...P})}),a.jsx(Ct,{})]})}),a.jsx(bt,{control:H.control,name:"dataDestinationId",render:({field:P})=>a.jsxs(mt,{children:[a.jsx("div",{className:"flex items-center justify-between gap-2",children:a.jsx(ut,{tooltip:"Select one of your existing destinations",children:"Destination"})}),a.jsxs(oa,{onValueChange:K=>{if(K==="__create_new__"){_(!0);return}P.onChange(K)},value:P.value,disabled:T,children:[a.jsx(xt,{children:a.jsx(la,{className:"w-full max-w-full overflow-hidden",children:a.jsx(ia,{className:"truncate",placeholder:"Select a destination",children:$&&a.jsx(lA,{destination:$})})})}),a.jsxs(ca,{children:[N.map(K=>a.jsx(Fn,{value:K.id,children:a.jsx(lA,{destination:K})},K.id)),N.length>0&&a.jsx(PI,{}),!c&&a.jsx(Fn,{value:"__create_new__",children:"+ Create new"})]})]}),a.jsx(fhe,{destination:$}),a.jsx(Ct,{})]})})]}),a.jsxs(Sr,{title:"Template",children:[a.jsx(bt,{control:H.control,name:"subject",render:({field:P})=>a.jsxs(mt,{children:[a.jsx(ut,{tooltip:"Add a short, clear subject line for your report",children:"Subject"}),a.jsx(xt,{children:a.jsx(ct,{placeholder:"Enter a message title",...P})}),a.jsx(Ct,{})]})}),a.jsx(bt,{control:H.control,name:"messageTemplate",render:({field:P})=>a.jsxs(mt,{children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsx(ut,{tooltip:"Write your report message in Markdown and check the final format in Preview",children:"Message"}),a.jsx(ghe,{value:V,onChange:D})]}),a.jsx(xt,{children:a.jsx("div",{className:"overflow-hidden rounded-md border",children:V==="markdown"?a.jsx(s2,{children:a.jsx(NS,{value:P.value,onChange:K=>{P.onChange(K)},height:240,showLineNumbers:!1})}):a.jsx(Tk,{html:U,loading:ee,error:he,height:240})})}),a.jsx(qt,{children:a.jsx(The,{})}),a.jsx(Ct,{})]})})]}),a.jsx(Sr,{title:"Sending conditions",children:a.jsx(bt,{control:H.control,name:"reportCondition",render:({field:P})=>a.jsxs(mt,{children:[a.jsx(ut,{tooltip:"Define when the report should be sent based on your Data Mart’s execution result",children:"Data Mart Run results"}),a.jsxs(oa,{onValueChange:P.onChange,value:P.value,children:[a.jsx(xt,{children:a.jsx(la,{className:"w-full max-w-full overflow-hidden",children:a.jsx(ia,{})})}),a.jsx(ca,{children:B.map(K=>a.jsx(Fn,{value:K.value,children:K.label},K.value))})]}),a.jsx(qt,{children:a.jsx(_he,{})}),a.jsx(Ct,{})]})})}),a.jsx(Sr,{title:"Automate Report Runs",children:g!=null&&g.id?a.jsx(a2,{ref:y,dataMartId:g.id,reportId:t===kn.EDIT?(e==null?void 0:e.id)??null:null,onDirtyChange:S}):a.jsx(KE,{})})]}),a.jsx(jk,{mode:t,isSubmitting:L,isDirty:M,triggersDirty:C,runAfterSaveRef:v,onSubmit:()=>void H.handleSubmit(W)(),onCancel:i})]})}),a.jsx(Mk,{isOpen:I,onClose:()=>{_(!1)},dataDestination:null,initialFormData:{title:"New Destination",type:(f==null?void 0:f[0])??Ie.EMAIL},allowedDestinationTypes:f,onSaveSuccess:P=>{R().then(()=>{H.setValue("dataDestinationId",P.id,{shouldDirty:!0,shouldTouch:!0}),_(!1)})}})]})});kk.displayName="EmailReportEditForm";function Lk({isOpen:e,onClose:t,initialReport:n,mode:r,preSelectedDestination:s,prefill:i,allowedDestinationTypes:c}){const{projectId:u,id:f}=Cx(),{pathname:m}=Qs(),{showUnsavedDialog:x,setShowUnsavedDialog:g,handleClose:y,confirmClose:v,handleFormDirtyChange:C,handleFormSubmitSuccess:S}=Zc(t),E=h.useCallback(()=>{const j=u&&f?`/ui/${u}/data-marts/${f}/reports`:"/";m.includes("/reports")||al("Report has been created",{closeButton:!0,description:a.jsxs(a.Fragment,{children:["You can view it in"," ",a.jsx(Nr,{to:j,className:"underline underline-offset-4",onClick:()=>al.dismiss(),children:"Destinations"})," ","page"]}),duration:1/0}),S()},[S,u,f,m]);return Fl(e),a.jsxs(a.Fragment,{children:[a.jsx(Ei,{open:e,onOpenChange:j=>{j||y()},children:a.jsxs(wi,{children:[a.jsxs(Ri,{children:[a.jsx(ji,{children:(s==null?void 0:s.title)??"Report"}),a.jsx(Rl,{children:r===kn.CREATE?"Fill in the details to create a new report":"Update details of an existing report"})]}),a.jsx(Qh,{children:a.jsx(kk,{initialReport:n,mode:r,onDirtyChange:C,onSubmit:E,onCancel:y,preSelectedDestination:s,prefill:i,allowedDestinationTypes:c})})]})}),a.jsx(Ar,{open:x,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 Zhe({destination:e,isOpen:t,onClose:n,mode:r,initialReport:s}){switch(e.type){case Ie.GOOGLE_SHEETS:return a.jsx(ahe,{isOpen:t,onClose:n,mode:r,preSelectedDestination:e,initialReport:s??void 0});case Ie.LOOKER_STUDIO:return a.jsx(uhe,{isOpen:t,onClose:n,mode:r,preSelectedDestination:e,initialReport:s??void 0});case Ie.EMAIL:case Ie.SLACK:case Ie.GOOGLE_CHAT:case Ie.MS_TEAMS:return a.jsx(Lk,{isOpen:t,onClose:n,mode:r,preSelectedDestination:e,initialReport:s??void 0});default:return null}}function Yhe({destination:e,onEditReport:t}){switch(e.type){case Ie.GOOGLE_SHEETS:return a.jsx(Afe,{destination:e,onEditReport:t});case Ie.EMAIL:case Ie.SLACK:case Ie.GOOGLE_CHAT:case Ie.MS_TEAMS:return a.jsx(Mfe,{destinationType:e.type,destination:e,onEditReport:t});case Ie.LOOKER_STUDIO:return a.jsx($fe,{destination:e,onEditReport:t});default:return null}}function Pk(){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(Kr,{className:"h-4 w-4 rounded-full"}),a.jsx(Kr,{className:"h-4 w-40"}),a.jsx(Kr,{className:"h-3 w-32"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Kr,{className:"h-6 w-16 rounded-full"}),a.jsx(Kr,{className:"h-4 w-4"})]})]})},t))})})}function Xhe({enabled:e=!0,intervalMs:t=5e3}={}){const{dataMart:n}=js(),{fetchReportsByDataMartId:r}=is(),s=n==null?void 0:n.id;h.useEffect(()=>{s&&r(s)},[s,r]),iE({enabled:!!s&&e,intervalMs:t,onTick:()=>{s&&r(s,{silent:!0})}})}function Qhe(){const{dataMart:e}=js(),{dataDestinations:t,isLoading:n}=fee();return Xhe({enabled:!0,intervalMs:5e3}),e?a.jsx("div",{className:"flex flex-col gap-4",children:n?a.jsx(Pk,{}):t.length===0?a.jsx(Vfe,{}):t.map(r=>a.jsx(qfe,{destination:r,dataMartStatus:e.status},r.id))}):null}function Jhe(){return a.jsx(Qh,{children:a.jsx(zC,{children:a.jsx(Qhe,{})})})}function hA(){return a.jsxs(yl,{children:[a.jsx(Ro,{children:a.jsx(wo,{icon:OU,tooltip:"Description of the Data Mart",children:"Description"})}),a.jsx(jo,{children:a.jsx(Vse,{})}),a.jsx(xi,{})]})}function eme(){const{dataMart:e}=to(),[t,n]=h.useState(!1),r=h.useCallback(()=>{n(!0)},[]),s=h.useCallback(()=>{n(!1)},[]);return a.jsxs(yl,{children:[a.jsxs(Ro,{children:[a.jsx(wo,{icon:wx,tooltip:"Time triggers allow you to schedule Data Mart runs at specific times",children:"Time triggers"}),a.jsx(Cm,{children:a.jsxs(we,{variant:"outline",onClick:r,"aria-label":"Add new trigger",children:[a.jsx(sa,{className:"h-4 w-4","aria-hidden":"true"}),"Add Trigger"]})})]}),a.jsx(jo,{children:a.jsx(md,{children:a.jsx(tce,{children:e&&a.jsxs(a.Fragment,{children:[a.jsx(Hce,{dataMartId:e.id}),a.jsx(qE,{isOpen:t,onClose:s,dataMartId:e.id})]})})})}),a.jsx(xi,{})]})}function tme(){return a.jsx(s2,{children:a.jsx(GS,{})})}function nme({status:e}){switch(e){case Nt.RUNNING:return a.jsx(jr,{variant:"secondary",className:"text-primary bg-primary/10",children:"Running"});case Nt.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 Nt.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 Nt.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 Nt.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 Nt.PENDING:return a.jsx(jr,{variant:"secondary",className:"bg-gray-50 text-gray-500 dark:bg-gray-950 dark:text-gray-400",children:"Pending"});case Nt.RESTRICTED:return a.jsx(jr,{variant:"secondary",className:"bg-yellow-50 text-yellow-500 dark:bg-yellow-950 dark:text-yellow-400",children:"Restricted"});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 pa=(e=>(e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.SYSTEM="SYSTEM",e))(pa||{}),zs=(e=>(e.STRUCTURED="structured",e.RAW="raw",e.CONFIGURATION="configuration",e))(zs||{});const mA=(e,t,n=!1)=>{var c,u,f,m;const r=e.split(`
|
|
853
|
+
`).filter(x=>x.trim()!=="");if(r.length>=3){const x=r[0],g=r[1],y=r.slice(2).join(`
|
|
854
|
+
`);if(x.includes("T")&&x.includes("Z")){const v=s1(y);return{id:`log-${t.toString()}`,timestamp:Mu(x),level:n?pa.ERROR:pa.INFO,message:v.message,metadata:{at:(c=v.metadata)!=null&&c.at?Mu(v.metadata.at):Mu(x),type:((u=v.metadata)==null?void 0:u.type)??(g!=="unknown"?g:null)}}}}const s=/^\[(.*?)\]\s*\[(.*?)\]\s*(.*)$/.exec(e);if(s){const x=s1(s[3]);return{id:`log-${t.toString()}`,timestamp:Mu(s[1]),level:n?pa.ERROR:s[2],message:x.message,metadata:(f=x.metadata)!=null&&f.at?{...x.metadata,at:Mu(x.metadata.at)}:x.metadata}}const i=s1(e);return{id:`log-${t.toString()}`,timestamp:"N/A",level:n?pa.ERROR:pa.INFO,message:i.message,metadata:(m=i.metadata)!=null&&m.at?{...i.metadata,at:Mu(i.metadata.at)}:i.metadata}},s1=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}},Uk=e=>{var t;return(t=e.metadata)!=null&&t.type?e.metadata.type:e.level},rme=(e,t)=>{var i,c;let n="",r="";switch(e.type){case dr.CONNECTOR:n=t??"",r="connector";break;case dr.LOOKER_STUDIO:n="Looker Studio data fetching",r="report";break;case dr.GOOGLE_SHEETS_EXPORT:case dr.EMAIL:case dr.SLACK:case dr.MS_TEAMS:case dr.GOOGLE_CHAT:n=((i=e.reportDefinition)==null?void 0:i.title)??"",r="report";break;case dr.INSIGHT:n=((c=e.insightDefinition)==null?void 0:c.title)??"",r="insight";break}return[bee(`${e.triggerType} ${r} run`.trim()),n]},ame=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)},sme=e=>{const t=e.startedAt??e.createdAt;return ny(t.toISOString())},ome=e=>{const t=pA(e.startedAt),n=pA(e.finishedAt);let r="";return e.startedAt&&e.finishedAt&&(r=yee(e.startedAt,e.finishedAt)),{startedAt:t,finishedAt:n,duration:r}},pA=e=>e?ny(e.toISOString()):"N/A";function ime({logViewType:e,setLogViewType:t,searchTerm:n,setSearchTerm:r,run:s,cancelDataMartRun:i,dataMartId:c}){const u=x=>{x.stopPropagation()},f=async x=>{if(x.stopPropagation(),c)try{await i(c,s.id),In.success("Data mart run cancelled successfully")}catch(g){In.error(g instanceof Error?g.message:"Failed to cancel data mart run")}},m=x=>`px-3 py-2 text-sm font-medium transition-colors rounded-none ${x?"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:x=>{x.stopPropagation(),t(zs.STRUCTURED)},className:`${m(e===zs.STRUCTURED)} rounded-l-lg`,children:"Structured"}),a.jsx("button",{onClick:x=>{x.stopPropagation(),t(zs.RAW)},className:`${m(e===zs.RAW)} rounded-none`,children:"Raw"}),a.jsx("button",{onClick:x=>{x.stopPropagation(),t(zs.CONFIGURATION)},className:`${m(e===zs.CONFIGURATION)} rounded-r-lg`,children:"Configuration"})]}),e!==zs.CONFIGURATION&&a.jsxs("div",{className:"relative",children:[a.jsx(zc,{className:"text-muted-foreground absolute top-2.5 left-2 h-4 w-4"}),a.jsx(ct,{type:"text",placeholder:"Search logs...",value:n,onChange:x=>{r(x.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===Nt.RUNNING&&a.jsxs(we,{variant:"destructive",size:"sm",onClick:x=>void f(x),children:[a.jsx(Cc,{className:"h-4 w-4"}),"Cancel"]}),a.jsxs(we,{variant:"outline",size:"sm",onClick:x=>{x.stopPropagation(),ame(s)},className:"flex items-center gap-2",children:[a.jsx(cz,{className:"h-4 w-4"}),"JSON"]})]})]})}function lme(e){switch(e){case pa.INFO:return a.jsx(_r,{className:"h-3 w-3 text-blue-500"});case pa.WARNING:return a.jsx(Oh,{className:"h-3 w-3 text-yellow-500"});case pa.ERROR:return a.jsx(Kf,{className:"h-3 w-3 text-red-500"});case pa.SYSTEM:return a.jsx(Nh,{className:"text-muted-foreground h-3 w-3"});default:return a.jsx(_r,{className:"text-muted-foreground h-3 w-3"})}}function cme(e){switch(e){case pa.INFO:return"text-blue-600 dark:text-blue-400";case pa.WARNING:return"text-yellow-600 dark:text-yellow-400";case pa.ERROR:return"text-red-600 dark:text-red-400";case pa.SYSTEM:return"text-muted-foreground";default:return"text-muted-foreground"}}function ume(e){return e===ex.SCHEDULED?a.jsx(wx,{size:18}):a.jsx(E4,{size:18})}function dme({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:[lme(r.level),a.jsx("span",{className:`text-xs font-medium ${cme(r.level)}`,children:Uk(r)})]}),a.jsx("div",{className:`min-w-0 flex-1 text-xs break-words ${r.level===pa.ERROR?"text-red-700 dark:text-red-300":"text-foreground"}`,children:r.message.includes(`
|
|
855
|
+
`)?a.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap",children:r.message}):a.jsx("span",{children:r.message})})]},r.id))})})}var mx=(e=>(e.ERROR="error",e.DEFAULT="default",e))(mx||{});function px({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:x=>{s(e,t),x.stopPropagation()},className:`${f} ${m}`,title:`Copy ${t} to clipboard`,children:i?a.jsx(a.Fragment,{children:u?a.jsx(Ia,{className:"h-3 w-3"}):a.jsx(od,{className:"h-3 w-3"})}):u?a.jsxs(a.Fragment,{children:[a.jsx(Ia,{className:"h-3 w-3"}),"Copied"]}):a.jsxs(a.Fragment,{children:[a.jsx(od,{className:"h-3 w-3"}),"Copy"]})})}function My(){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 fme({logs:e,errors:t}){const{copiedSection:n,handleCopy:r}=My(),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(Nh,{className:"h-4 w-4 text-red-500"}),"Error Output:"]}),a.jsx(px,{text:t.join(`
|
|
856
|
+
`),section:"errors",variant:mx.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(_r,{className:"h-4 w-4 text-blue-500"}),"Standard Output:"]}),a.jsx(px,{text:e.join(`
|
|
857
|
+
`),section:"logs",variant:mx.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 hme({definitionRun:e,reportDefinition:t,insightDefinition:n}){const{copiedSection:r,handleCopy:s}=My(),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(px,{text:JSON.stringify(e,null,2),section:"configuration",variant:mx.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 fo=18;function mme({type:e,base64Icon:t}){switch(e){case dr.CONNECTOR:return t?a.jsx(Vc,{base64:t,size:fo}):a.jsx(Sc,{className:"text-muted-foreground",size:fo});case dr.GOOGLE_SHEETS_EXPORT:{const n=ha.getInfo(Ie.GOOGLE_SHEETS).icon;return a.jsx(n,{size:fo})}case dr.LOOKER_STUDIO:{const n=ha.getInfo(Ie.LOOKER_STUDIO).icon;return a.jsx(n,{size:fo})}case dr.EMAIL:{const n=ha.getInfo(Ie.EMAIL).icon;return a.jsx(n,{size:fo})}case dr.SLACK:{const n=ha.getInfo(Ie.SLACK).icon;return a.jsx(n,{size:fo})}case dr.MS_TEAMS:{const n=ha.getInfo(Ie.MS_TEAMS).icon;return a.jsx(n,{size:fo})}case dr.GOOGLE_CHAT:{const n=ha.getInfo(Ie.GOOGLE_CHAT).icon;return a.jsx(n,{size:fo})}case dr.INSIGHT:return a.jsx(Xa,{className:"text-brand-blue-500",size:fo});default:return a.jsx(Sc,{className:"text-muted-foreground",size:fo})}}function pme({run:e,isExpanded:t,onToggle:n,logViewType:r,setLogViewType:s,searchTerm:i,setSearchTerm:c,cancelDataMartRun:u,dataMartId:f,dataMartConnectorInfo:m}){const{copiedSection:x,handleCopy:g}=My(),y=h.useMemo(()=>{if(e.logs.length===0&&e.errors.length===0)return[];const R=e.logs.map((A,I)=>mA(A,I)),T=e.errors.map((A,I)=>mA(A,e.logs.length+I,!0));return[...R,...T].filter(A=>{const I=Uk(A);return i===""||A.message.toLowerCase().includes(i.toLowerCase())||I.toLowerCase().includes(i.toLowerCase())})},[e.logs,e.errors,i]),v=h.useCallback(()=>r===zs.STRUCTURED?a.jsx(dme,{logs:y}):r===zs.RAW?a.jsx(fme,{logs:e.logs,errors:e.errors}):a.jsx(hme,{definitionRun:e.definitionRun,reportDefinition:e.reportDefinition,insightDefinition:e.insightDefinition}),[r,y,e.logs,e.errors,e.definitionRun,e.reportDefinition,e.insightDefinition]),C=sme(e),S=ome(e),[E,j]=rme(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(mme,{type:e.type,base64Icon:m==null?void 0:m.logoBase64})}),a.jsxs(rt,{children:[a.jsx(at,{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(st,{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:[ume(e.triggerType),a.jsxs("div",{className:"inline-flex items-center gap-2",children:[E,e.createdByUser&&a.jsxs(a.Fragment,{children:[" by ",a.jsx(UI,{userProjection:e.createdByUser})]}),j&&a.jsxs(a.Fragment,{children:[" • ",j]})]})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(nme,{status:e.status}),a.jsx(ss,{className:`text-muted-foreground h-4 w-4 transition-transform ${t?"rotate-180":""}`})]})]}),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(px,{text:e.id,section:"run-id",onCopy:g,copiedSection:x,iconOnly:!0})]}),a.jsx(ime,{logViewType:r,setLogViewType:s,searchTerm:i,setSearchTerm:c,run:e,cancelDataMartRun:u,dataMartId:f}),v()]})]})}function gme(){const{dataMart:e,getDataMartRuns:t,loadMoreDataMartRuns:n,cancelDataMartRun:r,runs:s,isLoading:i,isLoadingMoreRuns:c,hasMoreRunsToLoad:u}=js(),[f,m]=h.useState(null),[x,g]=h.useState(zs.STRUCTURED),[y,v]=h.useState(""),C=h.useCallback(async()=>{if(!(e!=null&&e.id)||c||!u)return;const j=s.length;await n(e.id,j,mh)},[e==null?void 0:e.id,n,s.length,c,u]);h.useEffect(()=>{e!=null&&e.id&&t(e.id,mh,0)},[e==null?void 0:e.id,t]);const S=h.useMemo(()=>(e==null?void 0:e.definitionType)===$e.CONNECTOR&&e.definition&&"connector"in e.definition?e.definition.connector.info??null:null,[e]),E=j=>{m(f===j?null:j)};return i?a.jsx(Pk,{}):a.jsx("div",{className:"flex flex-col gap-4 pb-4",children:s.length===0?a.jsx("div",{className:"text-muted-foreground rounded-sm border-b border-gray-200 bg-white p-8 text-center text-sm dark:border-white/4 dark:bg-white/1",children:"No runs found for this Data Mart"}):a.jsxs("div",{className:"space-y-2",children:[s.map(j=>a.jsx(pme,{run:j,isExpanded:f===j.id,onToggle:E,logViewType:x,setLogViewType:g,searchTerm:y,setSearchTerm:v,cancelDataMartRun:r,dataMartId:e==null?void 0:e.id,dataMartConnectorInfo:S},j.id)),u&&a.jsx("div",{className:"flex justify-center pt-4",children:a.jsx(td,{variant:"outline",size:"sm",onClick:()=>void C(),disabled:c,className:"flex items-center gap-2",children:c?a.jsxs(a.Fragment,{children:[a.jsx(SF,{className:"h-4 w-4 animate-spin"}),"Loading..."]}):"Load More"})})]})})}function xme(){return a.jsx("div",{className:"flex flex-col gap-4",children:a.jsxs(yl,{collapsible:!1,name:"run-history",children:[a.jsx(Ro,{children:a.jsx(wo,{icon:Uz,tooltip:"View all Data Mart execution runs with detailed logs and errors",children:"Run History"})}),a.jsx(jo,{children:a.jsx(gme,{})})]})})}function yme(){const e=UM(),{navigate:t}=ko(),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(vE,{children:a.jsx(BI,{children:a.jsx(Kae,{initialData:{title:(e==null?void 0:e.datamartTitle)??"New Data Mart"},onSuccess:n})})})]})})})}function zk({isOpen:e,onClose:t,id:n}){const{getDataStorageById:r,currentDataStorage:s,loading:i,clearCurrentDataStorage:c}=yy();h.useEffect(()=>(e&&n&&r(n),()=>{e||c()}),[e,n,r,c]);const u=()=>{c(),t()};return a.jsx(QC,{open:e,onOpenChange:f=>{f||u()},children:a.jsxs(JC,{children:[a.jsxs(eE,{children:[a.jsx(tE,{children:"Storage Details"}),a.jsx(nE,{children:"View detailed information about this storage."})]}),a.jsx("div",{className:"py-4",children:a.jsx(JQ,{dataStorage:s,isLoading:i})})]})})}const vme=({id:e,onViewDetails:t,onEdit:n,onDelete:r})=>{const[s,i]=h.useState(!1);return a.jsx("div",{className:"text-right",children:a.jsxs(Or,{open:s,onOpenChange:i,children:[a.jsx(Ir,{asChild:!0,children:a.jsx(we,{variant:"ghost",className:`dm-card-table-body-row-actionbtn opacity-0 transition-opacity ${s?"opacity-100":"group-hover:opacity-100"}`,"aria-label":"Open menu",children:a.jsx(Do,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsxs(Mr,{align:"end",children:[a.jsxs(Ut,{onClick:()=>t==null?void 0:t(e),children:[a.jsx(p4,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),a.jsx("span",{children:"View details"})]}),a.jsxs(Ut,{onClick:()=>void(n==null?void 0:n(e)),children:[a.jsx(xd,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),a.jsx("span",{children:"Edit"})]}),a.jsx(ns,{}),a.jsxs(Ut,{onClick:()=>r==null?void 0:r(e),children:[a.jsx(os,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),a.jsx("span",{className:"text-red-600",children:"Delete"})]})]})]})})},bme=({onViewDetails:e,onEdit:t,onDelete:n}={})=>[{accessorKey:"title",size:50,header:({column:r})=>a.jsx(Yn,{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(Yn,{column:r,children:"Type"}),cell:({row:r})=>{const s=r.getValue("type"),{displayName:i,icon:c}=Nl.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(Yn,{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(qc,{table:r}),cell:({row:r})=>a.jsx(vme,{id:r.original.id,onViewDetails:e,onEdit:t,onDelete:n})}];function Sme({onOpenTypeDialog:e}){return a.jsxs("div",{className:"dm-empty-state",children:[a.jsx(h4,{className:"dm-empty-state-ico",strokeWidth:1}),a.jsx("h2",{className:"dm-empty-state-title",children:"Create your first Storage"}),a.jsx("p",{className:"dm-empty-state-subtitle",children:"A Storage combines your data warehouse and access credentials — both required to start building Data Marts."}),a.jsxs(we,{variant:"outline",onClick:e,children:[a.jsx(sa,{className:"h-4 w-4"}),"New Storage"]})]})}function Cme({columns:e,data:t,onEdit:n,onOpenTypeDialog:r}){var A;const{sorting:s,setSorting:i,columnVisibility:c,setColumnVisibility:u,pageSize:f,setPageSize:m}=Bc({columns:e,storageKeyPrefix:"data-storage-list"}),[x,g]=h.useState([]),[y,v]=h.useState({}),[C,S]=h.useState(!1),[E]=h.useState(null),[j,R]=h.useState(0),T=Dl({data:t,columns:[...e],getCoreRowModel:Al(),getPaginationRowModel:rm(),onSortingChange:i,getSortedRowModel:Gc(),onColumnFiltersChange:g,getFilteredRowModel:_d(),onColumnVisibilityChange:u,onRowSelectionChange:v,initialState:{pagination:{pageSize:f}},state:{sorting:s,columnFilters:x,columnVisibility:c,rowSelection:y,pagination:{pageIndex:j,pageSize:f}},onPaginationChange:I=>{if(typeof I=="function"){const M=I({pageIndex:j,pageSize:f});M.pageSize!==f&&m(M.pageSize),M.pageIndex!==j&&R(M.pageIndex)}},enableRowSelection:!0}),N=(I,_)=>{_.target instanceof HTMLElement&&(_.target.closest('[role="checkbox"]')||_.target.closest(".actions-cell")||_.target.closest('[role="menuitem"]'))||n==null||n(I)};return t.length?a.jsxs("div",{children:[E&&a.jsx(zk,{isOpen:C,onClose:()=>{S(!1)},id:E.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(zc,{className:"dm-card-toolbar-search-icon"}),a.jsx(ct,{placeholder:"Search by title",value:(A=T.getColumn("title"))==null?void 0:A.getFilterValue(),onChange:I=>{var _;return(_=T.getColumn("title"))==null?void 0:_.setFilterValue(I.target.value)},className:"dm-card-toolbar-search-input"})]})}),a.jsx("div",{className:"dm-card-toolbar-right",children:a.jsxs(we,{variant:"outline",className:"dm-card-toolbar-btn-primary",onClick:()=>{r==null||r()},children:[a.jsx(sa,{className:"h-4 w-4"}),"New Storage"]})})]}),a.jsx("div",{className:"dm-card-table-wrap",children:a.jsxs(Ol,{className:"dm-card-table",role:"table","aria-label":"Storages table",children:[a.jsx(Il,{className:"dm-card-table-header",children:T.getHeaderGroups().map(I=>a.jsx(Hn,{className:"dm-card-table-header-row",children:I.headers.map(_=>a.jsx(kl,{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:hd(_.column.columnDef.header,_.getContext())},_.id))},I.id))}),a.jsx(Ml,{className:"dm-card-table-body",children:T.getRowModel().rows.length?T.getRowModel().rows.map(I=>a.jsx(Hn,{"data-state":I.getIsSelected()&&"selected",className:"dm-card-table-body-row group",onClick:_=>{const M=I.original.id;N(M,_)},children:I.getVisibleCells().map(_=>a.jsx(Yr,{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:hd(_.column.columnDef.cell,_.getContext())},_.id))},I.id)):a.jsx(Hn,{children:a.jsx(Yr,{colSpan:e.length+1,className:"dm-card-table-body-row-empty",children:"Oops! Nothing matched your search"})})})]})}),a.jsx(XC,{table:T,displaySelected:!1})]})]}):a.jsx("div",{className:"dm-card",children:a.jsx(Sme,{onOpenTypeDialog:r})})}const Eme=({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:x,deleteDataStorage:g,createDataStorage:y,loading:v}=yy(),[C,S]=h.useState(!1),[E,j]=h.useState(!1),[R,T]=h.useState(null),[N,A]=h.useState(!1),[I,_]=h.useState(null),{value:M,setParam:G,removeParam:H}=PO("id"),L=h.useRef(!1);h.useEffect(()=>{m()},[m]);const q=h.useCallback(async P=>{await x(P),S(!0),G(P)},[x,G]);h.useEffect(()=>{!v&&c.length>0&&M&&!L.current&&(c.find(K=>K.id===M)?q(M):(Dt.error(`Storage not found by id ${M}`),H()),L.current=!0)},[v,c,M,H,q]),h.useEffect(()=>{r(e)},[e]);const W=()=>{r(!1),t==null||t()},B=async P=>{i(!0);try{const K=await y(P);W(),K!=null&&K.id&&(await q(K.id),i(!1))}catch(K){console.error("Failed to create storage:",K)}},V=P=>{_(P),A(!0),G(P)},D=()=>{A(!1),_(null),H()},F=P=>{T(P),j(!0)},U=async()=>{if(R)try{await g(R),await m()}catch(P){console.error("Failed to delete storage:",P)}finally{j(!1),T(null)}},ee=async()=>{try{S(!1),await m(),H()}catch(P){console.error("Failed to save storage:",P)}},he=()=>{S(!1),f(),H()},z=c.map(P=>({id:P.id,title:P.title,type:P.type,createdAt:P.createdAt,modifiedAt:P.modifiedAt})),$=bme({onViewDetails:V,onEdit:q,onDelete:F});return a.jsxs("div",{children:[a.jsx(Cme,{columns:$,data:z,onEdit:q,onOpenTypeDialog:()=>{r(!0)}}),a.jsx(zk,{isOpen:N,onClose:D,id:I??""}),a.jsx(m6,{isOpen:n,onClose:W,onSelect:B,isCreatingDataStorage:s}),a.jsx(CM,{isOpen:C,onClose:he,dataStorage:u,onSaveSuccess:()=>void ee()}),a.jsx(Ar,{open:E,onOpenChange:j,title:"Delete Storage",description:"Are you sure you want to delete this storage? This action cannot be undone.",confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:()=>{U()},onCancel:()=>{T(null)},variant:"destructive"})]})},wme=()=>{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(vE,{children:a.jsx(Eme,{initialTypeDialogOpen:e,onTypeDialogClose:()=>{t(!1)}})})})]})};function Rme({onOpenTypeDialog:e}){return a.jsxs("div",{className:"dm-empty-state",children:[a.jsx(WS,{className:"dm-empty-state-ico",strokeWidth:1}),a.jsx("h2",{className:"dm-empty-state-title",children:"Create your first Destination"}),a.jsx("p",{className:"dm-empty-state-subtitle",children:"A Destination combines your reporting tool and access credentials — both needed to deliver data from Data Marts to your reports and dashboards."}),a.jsxs(we,{variant:"outline",onClick:e,children:[a.jsx(sa,{className:"h-4 w-4"}),"New Destination"]})]})}function jme({columns:e,data:t,onEdit:n,onOpenTypeDialog:r}){var R;const{sorting:s,setSorting:i,columnVisibility:c,setColumnVisibility:u,pageSize:f,setPageSize:m}=Bc({columns:e,storageKeyPrefix:"data-destination-list"}),[x,g]=h.useState([]),[y,v]=h.useState({}),[C,S]=h.useState(0),E=Dl({data:t,columns:[...e],getCoreRowModel:Al(),getPaginationRowModel:rm(),onSortingChange:i,getSortedRowModel:Gc(),onColumnFiltersChange:g,getFilteredRowModel:_d(),onColumnVisibilityChange:u,onRowSelectionChange:v,initialState:{pagination:{pageSize:f}},state:{sorting:s,columnFilters:x,columnVisibility:c,rowSelection:y,pagination:{pageIndex:C,pageSize:f}},onPaginationChange:T=>{if(typeof T=="function"){const A=T({pageIndex:C,pageSize:f});A.pageSize!==f&&m(A.pageSize),A.pageIndex!==C&&S(A.pageIndex)}},enableRowSelection:!0}),j=(T,N)=>{N.target instanceof HTMLElement&&(N.target.closest('[role="checkbox"]')||N.target.closest(".actions-cell")||N.target.closest('[role="menuitem"]'))||n==null||n(T)};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(zc,{className:"dm-card-toolbar-search-icon"}),a.jsx(ct,{placeholder:"Search by title",value:(R=E.getColumn("title"))==null?void 0:R.getFilterValue(),onChange:T=>{var N;return(N=E.getColumn("title"))==null?void 0:N.setFilterValue(T.target.value)},className:"dm-card-toolbar-search-input"})]})}),a.jsx("div",{className:"dm-card-toolbar-right",children:a.jsxs(we,{variant:"outline",className:"dm-card-toolbar-btn-primary",onClick:()=>{r==null||r()},children:[a.jsx(sa,{className:"h-4 w-4"}),"New Destination"]})})]}),a.jsx("div",{className:"dm-card-table-wrap",children:a.jsxs(Ol,{className:"dm-card-table",role:"table","aria-label":"Destinations table",children:[a.jsx(Il,{className:"dm-card-table-header",children:E.getHeaderGroups().map(T=>a.jsx(Hn,{className:"dm-card-table-header-row",children:T.headers.map(N=>a.jsx(kl,{className:"[&:has([role=checkbox])]:pl-6 [&>[role=checkbox]]:translate-y-[2px]",style:N.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(N.getSize())}%`},children:N.isPlaceholder?null:hd(N.column.columnDef.header,N.getContext())},N.id))},T.id))}),a.jsx(Ml,{className:"dm-card-table-body",children:E.getRowModel().rows.length?E.getRowModel().rows.map(T=>a.jsx(Hn,{"data-state":T.getIsSelected()&&"selected",className:"dm-card-table-body-row group",onClick:N=>{const A=T.original.id;j(A,N)},children:T.getVisibleCells().map(N=>a.jsx(Yr,{className:`[&:has([role=checkbox])]pr-0 px-6 whitespace-normal [&>[role=checkbox]]:translate-y-[2px] ${N.column.id==="actions"?"actions-cell":""} ${N.column.id==="createdAt"?"whitespace-nowrap":""}`,style:N.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(N.column.getSize())}%`},children:hd(N.column.columnDef.cell,N.getContext())},N.id))},T.id)):a.jsx(Hn,{children:a.jsx(Yr,{colSpan:e.length+1,className:"dm-card-table-body-row-empty",children:"Oops! Nothing matched your search"})})})]})}),a.jsx(XC,{table:E,displaySelected:!1})]})}):a.jsx("div",{className:"dm-card",children:a.jsx(Rme,{onOpenTypeDialog:r})})}const Tme=({id:e,type:t,credentials:n,onEdit:r,onDelete:s,onRotateSecretKey:i})=>{const[c,u]=h.useState(!1),f=()=>{if(n&&o2(n)){const g=HC(n);navigator.clipboard.writeText(g),Dt.success("JSON Config copied to clipboard")}},m=t===Ie.LOOKER_STUDIO,x=n&&"destinationSecretKey"in n&&n.destinationSecretKey;return a.jsx(a.Fragment,{children:a.jsx("div",{className:"text-right",children:a.jsxs(Or,{open:c,onOpenChange:u,children:[a.jsx(Ir,{asChild:!0,children:a.jsx(we,{variant:"ghost",className:`dm-card-table-body-row-actionbtn opacity-0 transition-opacity ${c?"opacity-100":"group-hover:opacity-100"}`,"aria-label":"Open menu",children:a.jsx(Do,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsxs(Mr,{align:"end",children:[a.jsxs(Ut,{onClick:()=>void(r==null?void 0:r(e)),children:[a.jsx(xd,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),a.jsx("span",{children:"Edit"})]}),m&&x&&a.jsxs(a.Fragment,{children:[a.jsx(ns,{}),a.jsxs(Ut,{onClick:f,children:[a.jsx(od,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),a.jsx("span",{children:"Copy JSON Config"})]}),a.jsxs(Ut,{onClick:()=>{i==null||i(e)},children:[a.jsx(y1,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),a.jsx("span",{children:"Rotate Secret Key"})]})]}),a.jsx(ns,{}),a.jsxs(Ut,{onClick:()=>s==null?void 0:s(e),children:[a.jsx(os,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),a.jsx("span",{className:"text-red-600",children:"Delete"})]})]})]})})})},_me=({onEdit:e,onDelete:t,onRotateSecretKey:n}={})=>[{accessorKey:"title",size:50,header:({column:r})=>a.jsx(Yn,{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(Yn,{column:r,children:"Type"}),cell:({row:r})=>{const s=r.getValue("type"),{displayName:i,icon:c}=ha.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(Yn,{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(qc,{table:r}),cell:({row:r})=>a.jsx(Tme,{id:r.original.id,type:r.original.type,credentials:r.original.credentials,onEdit:e,onDelete:t,onRotateSecretKey:n})}],Nme=({isCreateSheetInitiallyOpen:e=!1,onCreateSheetClose:t})=>{const{dataDestinations:n,currentDataDestination:r,clearCurrentDataDestination:s,fetchDataDestinations:i,getDataDestinationById:c,deleteDataDestination:u,rotateSecretKey:f,loading:m}=Jh(),[x,g]=h.useState(!1),[y,v]=h.useState(!1),[C,S]=h.useState(!1),[E,j]=h.useState(null),[R,T]=h.useState(null),{value:N,setParam:A,removeParam:I}=PO("id"),_=h.useRef(!1),M=h.useCallback(async U=>{await c(U),g(!0),A(U)},[c,A]),G=h.useCallback(()=>{s(),g(!0),t==null||t(),I()},[s,t,I]);h.useEffect(()=>{!m&&n.length>0&&N&&!_.current&&(n.find(ee=>ee.id===N)?M(N):(Dt.error(`Destination not found by id ${N}`),I()),_.current=!0)},[m,n,N,I,M]),h.useEffect(()=>{i()},[i]),h.useEffect(()=>{e&&G()},[e,G]);const H=U=>{j(U),v(!0)},L=U=>{T(U),S(!0)},q=async()=>{if(R)try{const U=await f(R);if(o2(U.credentials)){Dt.success("New JSON Config copied to clipboard");const ee=HC(U.credentials);navigator.clipboard.writeText(ee)}await i()}catch(U){console.error("Failed to rotate secret key:",U)}finally{S(!1),T(null)}},W=async()=>{if(E)try{await u(E),await i()}catch(U){console.error("Failed to delete destination:",U)}finally{v(!1),j(null)}},B=async()=>{try{g(!1),await i(),I()}catch(U){console.error("Failed to save destination:",U)}},V=()=>{g(!1),s(),I()},D=n.map(U=>({id:U.id,title:U.title,type:U.type,createdAt:U.createdAt,modifiedAt:U.modifiedAt,credentials:U.credentials})),F=_me({onEdit:M,onDelete:H,onRotateSecretKey:L});return a.jsxs("div",{children:[a.jsx(jme,{columns:F,data:D,onEdit:M,onDelete:H,onRotateSecretKey:L,onOpenTypeDialog:G}),a.jsx(Mk,{isOpen:x,onClose:V,dataDestination:r,onSaveSuccess:()=>void B()}),a.jsx(Ar,{open:y,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:()=>{W()},onCancel:()=>{j(null)},variant:"destructive"}),a.jsx(Ar,{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 q(),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?"})]})})]})},Ame=()=>{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(Qh,{children:a.jsx(Nme,{isCreateSheetInitiallyOpen:e,onCreateSheetClose:()=>{t(!1)}})})})]})};function Dme(e){const{isAdmin:t,canEdit:n}=CZ();return h.useMemo(()=>{const r={canCreate:n,canEdit:n,canDelete:n};return e?{...r,...e({isAdmin:t,canEdit:n})}:r},[t,n,e])}const vo="You don’t have access to this action. Ask a project administrator for permission.";function ky(){return Dme(({canEdit:e})=>({canGenerateAI:e,canRun:e,canSendAndSchedule:e}))}function AS({className:e,...t}){return a.jsx("div",{"data-slot":"empty",className:oe("flex min-w-0 flex-1 flex-col items-center justify-center gap-6 rounded-lg border-dashed p-6 text-center text-balance md:p-12",e),...t})}function DS({className:e,...t}){return a.jsx("div",{"data-slot":"empty-header",className:oe("flex max-w-sm flex-col items-center gap-2 text-center",e),...t})}const Ome=Pc("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 OS({className:e,variant:t="default",...n}){return a.jsx("div",{"data-slot":"empty-icon","data-variant":t,className:oe(Ome({variant:t,className:e})),...n})}function IS({className:e,...t}){return a.jsx("div",{"data-slot":"empty-title",className:oe("text-muted-foreground text-lg font-medium tracking-tight",e),...t})}function MS({className:e,...t}){return a.jsx("div",{"data-slot":"empty-description",className:oe("text-muted-foreground [&>a:hover]:text-primary text-sm/relaxed [&>a]:underline [&>a]:underline-offset-4",e),...t})}function Ime({className:e,...t}){return a.jsx("div",{"data-slot":"empty-content",className:oe("flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance",e),...t})}const Mme=()=>{const{handleCreateInsight:e,handleCreateInsightWithAi:t,insightLoading:n}=Iy(),{canCreate:r,canGenerateAI:s}=ky();return a.jsxs(AS,{children:[a.jsxs(DS,{className:"max-w-xl",children:[a.jsx(OS,{variant:"icon",children:a.jsx(Xa,{})}),a.jsx(IS,{children:"Create your first Insight"}),a.jsx(MS,{children:"Create an Insight to prompt your Data Mart and discover the story behind your data."})]}),a.jsx(Ime,{className:"max-w-xl",children:a.jsxs("div",{className:"flex w-full items-center justify-center gap-4",children:[a.jsxs(rt,{children:[a.jsx(at,{asChild:!0,children:a.jsx("div",{className:"inline-flex",children:a.jsxs(we,{onClick:()=>void t(),disabled:n||!s,children:[a.jsx(Xa,{className:"h-4 w-4"}),"Generate Insight with AI"]})})}),!s&&a.jsx(st,{children:vo})]}),a.jsxs(rt,{children:[a.jsx(at,{asChild:!0,children:a.jsx("div",{className:"inline-flex",children:a.jsxs(we,{variant:"outline",onClick:()=>void e(),disabled:n||!r,children:[a.jsx(sa,{className:"h-4 w-4"}),"Blank Insight"]})})}),!r&&a.jsx(st,{children:vo})]})]})})]})};function kme({id:e,onDelete:t}){const[n,r]=h.useState(!1),{canDelete:s}=ky();return a.jsx("div",{className:"text-right",onClick:i=>{i.stopPropagation()},children:a.jsxs(Or,{open:n,onOpenChange:r,children:[a.jsx(Ir,{asChild:!0,children:a.jsx(we,{variant:"ghost",className:`dm-card-table-body-row-actionbtn opacity-0 transition-opacity ${n?"opacity-100":"group-hover:opacity-100"}`,"aria-label":"Open menu",children:a.jsx(Do,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsx(Mr,{align:"end",children:a.jsxs(rt,{children:[a.jsx(at,{asChild:!0,children:a.jsx("div",{className:"w-full",children:a.jsxs(Ut,{className:"text-destructive",onClick:()=>t==null?void 0:t(e),disabled:!s,children:[a.jsx(os,{className:"h-4 w-4 text-red-600"}),a.jsx("span",{className:"text-red-600",children:"Delete insight"})]})})}),!s&&a.jsx(st,{side:"left",children:vo})]})})]})})}const Lme=({onDelete:e}={})=>[{accessorKey:"title",size:50,header:({column:t})=>a.jsx(Yn,{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(Yn,{column:t,children:"Last run"}),cell:({row:t})=>{const n=t.getValue("lastRun");return a.jsx("div",{className:"text-muted-foreground",children:x5(n)})},meta:{title:"Last run"}},{id:"actions",size:80,header:({table:t})=>a.jsx(qc,{table:t}),cell:({row:t})=>a.jsx(kme,{id:t.original.id,onDelete:e}),meta:{title:"Actions"}}];function Pme({items:e,onRowClick:t,onDelete:n}){const r=h.useMemo(()=>Lme({onDelete:n}),[n]),{sorting:s,setSorting:i,columnVisibility:c,setColumnVisibility:u}=Bc({columns:r,storageKeyPrefix:"data-mart-insights",defaultSortingColumn:"lastRun"}),f=Dl({data:e,columns:r,getCoreRowModel:Al(),getPaginationRowModel:rm(),onSortingChange:i,getSortedRowModel:Gc(),getFilteredRowModel:_d(),state:{sorting:s,columnVisibility:c},onColumnVisibilityChange:u,enableGlobalFilter:!0,enableColumnResizing:!1}),m=h.useCallback(()=>{f.previousPage()},[f]),x=h.useCallback(()=>{f.nextPage()},[f]);return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"dm-card-table-wrap",children:a.jsxs(Ol,{id:"insights-table",className:"dm-card-table",role:"table","aria-label":"Insights",children:[a.jsx(Il,{className:"dm-card-table-header",children:f.getHeaderGroups().map(y=>a.jsx(Hn,{className:"dm-card-table-header-row",children:y.headers.map(v=>a.jsx(kl,{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))},y.id))}),a.jsx(Ml,{className:"dm-card-table-body",children:f.getRowModel().rows.length?f.getRowModel().rows.map((y,v)=>a.jsx(Hn,{onClick:()=>{t(y.original.id)},className:"dm-card-table-body-row group",role:"row","aria-rowindex":v+1,children:y.getVisibleCells().map((C,S)=>a.jsx(Yr,{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))},y.id)):a.jsx(Hn,{children:a.jsx(Yr,{colSpan:r.length,className:"dm-card-table-body-row-empty",role:"cell",children:a.jsx("span",{role:"status","aria-live":"polite",children:"No insights found."})})})})]})}),a.jsxs("div",{className:"dm-card-pagination",role:"navigation","aria-label":"Table pagination",children:[a.jsx(we,{variant:"outline",size:"sm",onClick:m,disabled:!f.getCanPreviousPage(),"aria-label":"Go to previous page",children:"Previous"}),a.jsx(we,{variant:"outline",size:"sm",onClick:x,disabled:!f.getCanNextPage(),"aria-label":"Go to next page",children:"Next"})]})]})}function Ume(){const e=Lc(),{fetchInsights:t,deleteInsight:n,insightLoading:r,handleCreateInsight:s,handleCreateInsightWithAi:i}=Iy(),{insights:c,isLoading:u,error:f,hasInsights:m}=Dk(),{canCreate:x,canGenerateAI:g}=ky(),[y,v]=h.useState(null);h.useEffect(()=>{t()},[t]);const C=E=>{e(E)},S=()=>{(async()=>{if(y)try{await n(y)}finally{v(null)}})()};return a.jsxs(yl,{children:[a.jsxs(Ro,{children:[a.jsx(wo,{tooltip:"Manage and review your insights",icon:Xa,children:"Insights"}),m&&a.jsx(Cm,{children:a.jsxs("div",{className:"inline-flex -space-x-px",children:[a.jsxs(rt,{children:[a.jsx(at,{asChild:!0,children:a.jsx("div",{className:"inline-flex",children:a.jsxs(we,{variant:"outline",className:"rounded-r-none",onClick:()=>void s(),disabled:r||!x,children:[a.jsx(sa,{className:"h-4 w-4","aria-hidden":"true"}),"New insight"]})})}),!x&&a.jsx(st,{children:vo})]}),a.jsxs(Or,{children:[a.jsx(Ir,{asChild:!0,children:a.jsx(we,{variant:"outline",className:"rounded-l-none px-2","aria-label":"More options",disabled:r,children:a.jsx(ss,{className:"h-4 w-4","aria-hidden":"true"})})}),a.jsxs(Mr,{align:"end",children:[a.jsxs(rt,{children:[a.jsx(at,{asChild:!0,children:a.jsx("div",{className:"w-full",children:a.jsxs(Ut,{onClick:()=>void i(),disabled:r||!g,children:[a.jsx(Xa,{className:"h-4 w-4","aria-hidden":"true"}),"Generate insight with AI"]})})}),!g&&a.jsx(st,{children:vo})]}),a.jsxs(rt,{children:[a.jsx(at,{asChild:!0,children:a.jsx("div",{className:"w-full",children:a.jsxs(Ut,{onClick:()=>void s(),disabled:r||!x,children:[a.jsx(sa,{className:"h-4 w-4","aria-hidden":"true"}),"Blank insight"]})})}),!x&&a.jsx(st,{children:vo})]})]})]})]})})]}),a.jsxs(jo,{children:[u&&!m?a.jsx("div",{className:"text-muted-foreground p-4 text-sm",children:"Loading insights…"}):f?a.jsx("div",{className:"text-destructive p-4 text-sm",children:"Failed to load insights"}):m?a.jsx(Pme,{items:c.map(E=>({id:E.id,title:E.title,lastRun:E.outputUpdatedAt})),onRowClick:C,onDelete:E=>{v(E)}}):a.jsx(Mme,{}),a.jsx(Ar,{open:!!y,onOpenChange:E=>{E||v(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:S})]}),a.jsx(xi,{})]})}function zme(){return a.jsx(s2,{children:a.jsx(Ume,{})})}const Ly=h.createContext(null);Ly.displayName="PanelGroupContext";const rr={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"},i2=10,bc=h.useLayoutEffect,gA=Ch.useId,Fme=typeof gA=="function"?gA:()=>null;let Hme=0;function l2(e=null){const t=Fme(),n=h.useRef(e||t||null);return n.current===null&&(n.current=""+Hme++),e??n.current}function Fk({children:e,className:t="",collapsedSize:n,collapsible:r,defaultSize:s,forwardedRef:i,id:c,maxSize:u,minSize:f,onCollapse:m,onExpand:x,onResize:g,order:y,style:v,tagName:C="div",...S}){const E=h.useContext(Ly);if(E===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:j,expandPanel:R,getPanelSize:T,getPanelStyle:N,groupId:A,isPanelCollapsed:I,reevaluatePanelConstraints:_,registerPanel:M,resizePanel:G,unregisterPanel:H}=E,L=l2(c),q=h.useRef({callbacks:{onCollapse:m,onExpand:x,onResize:g},constraints:{collapsedSize:n,collapsible:r,defaultSize:s,maxSize:u,minSize:f},id:L,idIsFromProps:c!==void 0,order:y});h.useRef({didLogMissingDefaultSizeWarning:!1}),bc(()=>{const{callbacks:B,constraints:V}=q.current,D={...V};q.current.id=L,q.current.idIsFromProps=c!==void 0,q.current.order=y,B.onCollapse=m,B.onExpand=x,B.onResize=g,V.collapsedSize=n,V.collapsible=r,V.defaultSize=s,V.maxSize=u,V.minSize=f,(D.collapsedSize!==V.collapsedSize||D.collapsible!==V.collapsible||D.maxSize!==V.maxSize||D.minSize!==V.minSize)&&_(q.current,D)}),bc(()=>{const B=q.current;return M(B),()=>{H(B)}},[y,L,M,H]),h.useImperativeHandle(i,()=>({collapse:()=>{j(q.current)},expand:B=>{R(q.current,B)},getId(){return L},getSize(){return T(q.current)},isCollapsed(){return I(q.current)},isExpanded(){return!I(q.current)},resize:B=>{G(q.current,B)}}),[j,R,T,I,L,G]);const W=N(q.current,s);return h.createElement(C,{...S,children:e,className:t,id:L,style:{...W,...v},[rr.groupId]:A,[rr.panel]:"",[rr.panelCollapsible]:r||void 0,[rr.panelId]:L,[rr.panelSize]:parseFloat(""+W.flexGrow).toFixed(1)})}const Hk=h.forwardRef((e,t)=>h.createElement(Fk,{...e,forwardedRef:t}));Fk.displayName="Panel";Hk.displayName="forwardRef(Panel)";let kS=null,Rg=-1,cl=null;function $me(e,t,n){const r=(t&qk)!==0,s=(t&Kk)!==0,i=(t&Wk)!==0,c=(t&Zk)!==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 Vme(){cl!==null&&(document.head.removeChild(cl),kS=null,cl=null,Rg=-1)}function o1(e,t,n){var r,s;const i=$me(e,t);if(kS!==i){if(kS=i,cl===null&&(cl=document.createElement("style"),document.head.appendChild(cl)),Rg>=0){var c;(c=cl.sheet)===null||c===void 0||c.removeRule(Rg)}Rg=(r=(s=cl.sheet)===null||s===void 0?void 0:s.insertRule(`*{cursor: ${i} !important;}`))!==null&&r!==void 0?r:-1}}function $k(e){return e.type==="keydown"}function Vk(e){return e.type.startsWith("pointer")}function Gk(e){return e.type.startsWith("mouse")}function Py(e){if(Vk(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(Gk(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}function Gme(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function Bme(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 qme(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:vA(e),b:vA(t)};let r;for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),r=e;Ht(r,"Stacking order can only be calculated for elements with a common ancestor");const s={a:yA(xA(n.a)),b:yA(xA(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 Kme=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Wme(e){var t;const n=getComputedStyle((t=Bk(e))!==null&&t!==void 0?t:e).display;return n==="flex"||n==="inline-flex"}function Zme(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||Wme(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"||Kme.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function xA(e){let t=e.length;for(;t--;){const n=e[t];if(Ht(n,"Missing node"),Zme(n))return n}return null}function yA(e){return e&&Number(getComputedStyle(e).zIndex)||0}function vA(e){const t=[];for(;e;)t.push(e),e=Bk(e);return t}function Bk(e){const{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}const qk=1,Kk=2,Wk=4,Zk=8,Yme=Gme()==="coarse";let Ks=[],sd=!1,ul=new Map,Uy=new Map;const bh=new Set;function Xme(e,t,n,r,s){var i;const{ownerDocument:c}=t,u={direction:n,element:t,hitAreaMargins:r,setResizeHandlerState:s},f=(i=ul.get(c))!==null&&i!==void 0?i:0;return ul.set(c,f+1),bh.add(u),gx(),function(){var x;Uy.delete(e),bh.delete(u);const g=(x=ul.get(c))!==null&&x!==void 0?x:1;if(ul.set(c,g-1),gx(),g===1&&ul.delete(c),Ks.includes(u)){const y=Ks.indexOf(u);y>=0&&Ks.splice(y,1),zy(),s("up",!0,null)}}}function Qme(e){const{target:t}=e,{x:n,y:r}=Py(e);sd=!0,c2({target:t,x:n,y:r}),gx(),Ks.length>0&&(xx("down",e),zy(),e.preventDefault(),Yk(t)||e.stopImmediatePropagation())}function i1(e){const{x:t,y:n}=Py(e);if(sd&&e.type!=="pointerleave"&&e.buttons===0&&(sd=!1,xx("up",e)),!sd){const{target:r}=e;c2({target:r,x:t,y:n})}xx("move",e),zy(),Ks.length>0&&e.preventDefault()}function l1(e){const{target:t}=e,{x:n,y:r}=Py(e);Uy.clear(),sd=!1,Ks.length>0&&(e.preventDefault(),Yk(t)||e.stopImmediatePropagation()),xx("up",e),c2({target:t,x:n,y:r}),zy(),gx()}function Yk(e){let t=e;for(;t;){if(t.hasAttribute(rr.resizeHandle))return!0;t=t.parentElement}return!1}function c2({target:e,x:t,y:n}){Ks.splice(0);let r=null;(e instanceof HTMLElement||e instanceof SVGElement)&&(r=e),bh.forEach(s=>{const{element:i,hitAreaMargins:c}=s,u=i.getBoundingClientRect(),{bottom:f,left:m,right:x,top:g}=u,y=Yme?c.coarse:c.fine;if(t>=m-y&&t<=x+y&&n>=g-y&&n<=f+y){if(r!==null&&document.contains(r)&&i!==r&&!i.contains(r)&&!r.contains(i)&&qme(r,i)>0){let C=r,S=!1;for(;C&&!C.contains(i);){if(Bme(C.getBoundingClientRect(),u)){S=!0;break}C=C.parentElement}if(S)return}Ks.push(s)}})}function c1(e,t){Uy.set(e,t)}function zy(){let e=!1,t=!1;Ks.forEach(r=>{const{direction:s}=r;s==="horizontal"?e=!0:t=!0});let n=0;Uy.forEach(r=>{n|=r}),e&&t?o1("intersection",n):e?o1("horizontal",n):t?o1("vertical",n):Vme()}let u1;function gx(){var e;(e=u1)===null||e===void 0||e.abort(),u1=new AbortController;const t={capture:!0,signal:u1.signal};bh.size&&(sd?(Ks.length>0&&ul.forEach((n,r)=>{const{body:s}=r;n>0&&(s.addEventListener("contextmenu",l1,t),s.addEventListener("pointerleave",i1,t),s.addEventListener("pointermove",i1,t))}),ul.forEach((n,r)=>{const{body:s}=r;s.addEventListener("pointerup",l1,t),s.addEventListener("pointercancel",l1,t)})):ul.forEach((n,r)=>{const{body:s}=r;n>0&&(s.addEventListener("pointerdown",Qme,t),s.addEventListener("pointermove",i1,t))}))}function xx(e,t){bh.forEach(n=>{const{setResizeHandlerState:r}=n,s=Ks.includes(n);r(e,s,t)})}function Jme(){const[e,t]=h.useState(0);return h.useCallback(()=>t(n=>n+1),[])}function Ht(e,t){if(!e)throw console.error(t),Error(t)}function Mc(e,t,n=i2){return e.toFixed(n)===t.toFixed(n)?0:e>t?1:-1}function ui(e,t,n=i2){return Mc(e,t,n)===0}function Ka(e,t,n){return Mc(e,t,n)===0}function epe(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(!Ka(s,i,n))return!1}return!0}function Wu({panelConstraints:e,panelIndex:t,size:n}){const r=e[t];Ht(r!=null,`Panel constraints not found for index ${t}`);let{collapsedSize:s=0,collapsible:i,maxSize:c=100,minSize:u=0}=r;if(Mc(n,u)<0)if(i){const f=(s+u)/2;Mc(n,f)<0?n=s:n=u}else n=u;return n=Math.min(c,n),n=parseFloat(n.toFixed(i2)),n}function Gf({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:s,trigger:i}){if(Ka(e,0))return t;const c=[...t],[u,f]=r;Ht(u!=null,"Invalid first pivot index"),Ht(f!=null,"Invalid second pivot index");let m=0;if(i==="keyboard"){{const g=e<0?f:u,y=n[g];Ht(y,`Panel constraints not found for index ${g}`);const{collapsedSize:v=0,collapsible:C,minSize:S=0}=y;if(C){const E=t[g];if(Ht(E!=null,`Previous layout not found for panel index ${g}`),Ka(E,v)){const j=S-E;Mc(j,Math.abs(e))>0&&(e=e<0?0-j:j)}}}{const g=e<0?u:f,y=n[g];Ht(y,`No panel constraints found for index ${g}`);const{collapsedSize:v=0,collapsible:C,minSize:S=0}=y;if(C){const E=t[g];if(Ht(E!=null,`Previous layout not found for panel index ${g}`),Ka(E,S)){const j=E-v;Mc(j,Math.abs(e))>0&&(e=e<0?0-j:j)}}}}{const g=e<0?1:-1;let y=e<0?f:u,v=0;for(;;){const S=t[y];Ht(S!=null,`Previous layout not found for panel index ${y}`);const j=Wu({panelConstraints:n,panelIndex:y,size:100})-S;if(v+=j,y+=g,y<0||y>=n.length)break}const C=Math.min(Math.abs(e),Math.abs(v));e=e<0?0-C:C}{let y=e<0?u:f;for(;y>=0&&y<n.length;){const v=Math.abs(e)-Math.abs(m),C=t[y];Ht(C!=null,`Previous layout not found for panel index ${y}`);const S=C-v,E=Wu({panelConstraints:n,panelIndex:y,size:S});if(!Ka(C,E)&&(m+=C-E,c[y]=E,m.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?y--:y++}}if(epe(s,c))return s;{const g=e<0?f:u,y=t[g];Ht(y!=null,`Previous layout not found for panel index ${g}`);const v=y+m,C=Wu({panelConstraints:n,panelIndex:g,size:v});if(c[g]=C,!Ka(C,v)){let S=v-C,j=e<0?f:u;for(;j>=0&&j<n.length;){const R=c[j];Ht(R!=null,`Previous layout not found for panel index ${j}`);const T=R+S,N=Wu({panelConstraints:n,panelIndex:j,size:T});if(Ka(R,N)||(S-=N-R,c[j]=N),Ka(S,0))break;e>0?j--:j++}}}const x=c.reduce((g,y)=>y+g,0);return Ka(x,100)?c:s}function tpe({layout:e,panelsArray:t,pivotIndices:n}){let r=0,s=100,i=0,c=0;const u=n[0];Ht(u!=null,"No pivot index found"),t.forEach((g,y)=>{const{constraints:v}=g,{maxSize:C=100,minSize:S=0}=v;y===u?(r=S,s=C):(i+=S,c+=C)});const f=Math.min(s,100-i),m=Math.max(r,100-c),x=e[u];return{valueMax:f,valueMin:m,valueNow:x}}function Sh(e,t=document){return Array.from(t.querySelectorAll(`[${rr.resizeHandleId}][data-panel-group-id="${e}"]`))}function Xk(e,t,n=document){const s=Sh(e,n).findIndex(i=>i.getAttribute(rr.resizeHandleId)===t);return s??null}function Qk(e,t,n){const r=Xk(e,t,n);return r!=null?[r,r+1]:[-1,-1]}function npe(e){return e instanceof HTMLElement?!0:typeof e=="object"&&e!==null&&"tagName"in e&&"getAttribute"in e}function Jk(e,t=document){if(npe(t)&&t.dataset.panelGroupId==e)return t;const n=t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return n||null}function Fy(e,t=document){const n=t.querySelector(`[${rr.resizeHandleId}="${e}"]`);return n||null}function rpe(e,t,n,r=document){var s,i,c,u;const f=Fy(t,r),m=Sh(e,r),x=f?m.indexOf(f):-1,g=(s=(i=n[x])===null||i===void 0?void 0:i.id)!==null&&s!==void 0?s:null,y=(c=(u=n[x+1])===null||u===void 0?void 0:u.id)!==null&&c!==void 0?c:null;return[g,y]}function ape({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:s,panelGroupElement:i,setLayout:c}){h.useRef({didWarnAboutMissingResizeHandle:!1}),bc(()=>{if(!i)return;const u=Sh(n,i);for(let f=0;f<s.length-1;f++){const{valueMax:m,valueMin:x,valueNow:g}=tpe({layout:r,panelsArray:s,pivotIndices:[f,f+1]}),y=u[f];if(y!=null){const v=s[f];Ht(v,`No panel data found for index "${f}"`),y.setAttribute("aria-controls",v.id),y.setAttribute("aria-valuemax",""+Math.round(m)),y.setAttribute("aria-valuemin",""+Math.round(x)),y.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;Ht(u,"Eager values not found");const{panelDataArray:f}=u,m=Jk(n,i);Ht(m!=null,`No group found for id "${n}"`);const x=Sh(n,i);Ht(x,`No resize handles found for group id "${n}"`);const g=x.map(y=>{const v=y.getAttribute(rr.resizeHandleId);Ht(v,"Resize handle element has no handle id attribute");const[C,S]=rpe(n,v,f,i);if(C==null||S==null)return()=>{};const E=j=>{if(!j.defaultPrevented)switch(j.key){case"Enter":{j.preventDefault();const R=f.findIndex(T=>T.id===C);if(R>=0){const T=f[R];Ht(T,`No panel data found for index ${R}`);const N=r[R],{collapsedSize:A=0,collapsible:I,minSize:_=0}=T.constraints;if(N!=null&&I){const M=Gf({delta:Ka(N,A)?_-A:A-N,initialLayout:r,panelConstraints:f.map(G=>G.constraints),pivotIndices:Qk(n,v,i),prevLayout:r,trigger:"keyboard"});r!==M&&c(M)}}break}}};return y.addEventListener("keydown",E),()=>{y.removeEventListener("keydown",E)}});return()=>{g.forEach(y=>y())}},[i,e,t,n,r,s,c])}function bA(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 e8(e,t){const n=e==="horizontal",{x:r,y:s}=Py(t);return n?r:s}function spe(e,t,n,r,s){const i=n==="horizontal",c=Fy(t,s);Ht(c,`No resize handle element found for id "${t}"`);const u=c.getAttribute(rr.groupId);Ht(u,"Resize handle element has no group id attribute");let{initialCursorPosition:f}=r;const m=e8(n,e),x=Jk(u,s);Ht(x,`No group element found for id "${u}"`);const g=x.getBoundingClientRect(),y=i?g.width:g.height;return(m-f)/y*100}function ope(e,t,n,r,s,i){if($k(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:spe(e,t,n,r,i)}function ipe({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];Ht(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];Ht(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 Pu(e,t,n){t.forEach((r,s)=>{const i=e[s];Ht(i,`Panel data not found for index ${s}`);const{callbacks:c,constraints:u,id:f}=i,{collapsedSize:m=0,collapsible:x}=u,g=n[f];if(g==null||r!==g){n[f]=r;const{onCollapse:y,onExpand:v,onResize:C}=c;C&&C(r,g),x&&(y||v)&&(v&&(g==null||ui(g,m))&&!ui(r,m)&&v(),y&&(g==null||!ui(g,m))&&ui(r,m)&&y())}})}function cg(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 lpe({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 cpe(e,t=10){let n=null;return(...s)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...s)},t)}}function SA(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 t8(e){return`react-resizable-panels:${e}`}function n8(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 r8(e,t){try{const n=t8(e),r=t.getItem(n);if(r){const s=JSON.parse(r);if(typeof s=="object"&&s!=null)return s}}catch{}return null}function upe(e,t,n){var r,s;const i=(r=r8(e,n))!==null&&r!==void 0?r:{},c=n8(t);return(s=i[c])!==null&&s!==void 0?s:null}function dpe(e,t,n,r,s){var i;const c=t8(e),u=n8(t),f=(i=r8(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 CA({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(!Ka(r,100)&&n.length>0)for(let i=0;i<t.length;i++){const c=n[i];Ht(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];Ht(c!=null,`No layout data found for index ${i}`);const u=Wu({panelConstraints:t,panelIndex:i,size:c});c!=u&&(s+=c-u,n[i]=u)}if(!Ka(s,0))for(let i=0;i<t.length;i++){const c=n[i];Ht(c!=null,`No layout data found for index ${i}`);const u=c+s,f=Wu({panelConstraints:t,panelIndex:i,size:u});if(c!==f&&(s-=f-c,n[i]=f,Ka(s,0)))break}return n}const fpe=100,Bf={getItem:e=>(SA(Bf),Bf.getItem(e)),setItem:(e,t)=>{SA(Bf),Bf.setItem(e,t)}},EA={};function a8({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:s,id:i=null,onLayout:c=null,keyboardResizeBy:u=null,storage:f=Bf,style:m,tagName:x="div",...g}){const y=l2(i),v=h.useRef(null),[C,S]=h.useState(null),[E,j]=h.useState([]),R=Jme(),T=h.useRef({}),N=h.useRef(new Map),A=h.useRef(0),I=h.useRef({autoSaveId:e,direction:r,dragState:C,id:y,keyboardResizeBy:u,onLayout:c,storage:f}),_=h.useRef({layout:E,panelDataArray:[],panelDataArrayChanged:!1});h.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),h.useImperativeHandle(s,()=>({getId:()=>I.current.id,getLayout:()=>{const{layout:P}=_.current;return P},setLayout:P=>{const{onLayout:K}=I.current,{layout:Y,panelDataArray:se}=_.current,Q=CA({layout:P,panelConstraints:se.map(le=>le.constraints)});bA(Y,Q)||(j(Q),_.current.layout=Q,K&&K(Q),Pu(se,Q,T.current))}}),[]),bc(()=>{I.current.autoSaveId=e,I.current.direction=r,I.current.dragState=C,I.current.id=y,I.current.onLayout=c,I.current.storage=f}),ape({committedValuesRef:I,eagerValuesRef:_,groupId:y,layout:E,panelDataArray:_.current.panelDataArray,setLayout:j,panelGroupElement:v.current}),h.useEffect(()=>{const{panelDataArray:P}=_.current;if(e){if(E.length===0||E.length!==P.length)return;let K=EA[e];K==null&&(K=cpe(dpe,fpe),EA[e]=K);const Y=[...P],se=new Map(N.current);K(e,Y,se,E,f)}},[e,E,f]),h.useEffect(()=>{});const M=h.useCallback(P=>{const{onLayout:K}=I.current,{layout:Y,panelDataArray:se}=_.current;if(P.constraints.collapsible){const Q=se.map(ze=>ze.constraints),{collapsedSize:le=0,panelSize:pe,pivotIndices:be}=lc(se,P,Y);if(Ht(pe!=null,`Panel size not found for panel "${P.id}"`),!ui(pe,le)){N.current.set(P.id,pe);const Re=Bu(se,P)===se.length-1?pe-le:le-pe,Ge=Gf({delta:Re,initialLayout:Y,panelConstraints:Q,pivotIndices:be,prevLayout:Y,trigger:"imperative-api"});cg(Y,Ge)||(j(Ge),_.current.layout=Ge,K&&K(Ge),Pu(se,Ge,T.current))}}},[]),G=h.useCallback((P,K)=>{const{onLayout:Y}=I.current,{layout:se,panelDataArray:Q}=_.current;if(P.constraints.collapsible){const le=Q.map(ot=>ot.constraints),{collapsedSize:pe=0,panelSize:be=0,minSize:ze=0,pivotIndices:Re}=lc(Q,P,se),Ge=K??ze;if(ui(be,pe)){const ot=N.current.get(P.id),Vt=ot!=null&&ot>=Ge?ot:Ge,Xt=Bu(Q,P)===Q.length-1?be-Vt:Vt-be,gn=Gf({delta:Xt,initialLayout:se,panelConstraints:le,pivotIndices:Re,prevLayout:se,trigger:"imperative-api"});cg(se,gn)||(j(gn),_.current.layout=gn,Y&&Y(gn),Pu(Q,gn,T.current))}}},[]),H=h.useCallback(P=>{const{layout:K,panelDataArray:Y}=_.current,{panelSize:se}=lc(Y,P,K);return Ht(se!=null,`Panel size not found for panel "${P.id}"`),se},[]),L=h.useCallback((P,K)=>{const{panelDataArray:Y}=_.current,se=Bu(Y,P);return lpe({defaultSize:K,dragState:C,layout:E,panelData:Y,panelIndex:se})},[C,E]),q=h.useCallback(P=>{const{layout:K,panelDataArray:Y}=_.current,{collapsedSize:se=0,collapsible:Q,panelSize:le}=lc(Y,P,K);return Ht(le!=null,`Panel size not found for panel "${P.id}"`),Q===!0&&ui(le,se)},[]),W=h.useCallback(P=>{const{layout:K,panelDataArray:Y}=_.current,{collapsedSize:se=0,collapsible:Q,panelSize:le}=lc(Y,P,K);return Ht(le!=null,`Panel size not found for panel "${P.id}"`),!Q||Mc(le,se)>0},[]),B=h.useCallback(P=>{const{panelDataArray:K}=_.current;K.push(P),K.sort((Y,se)=>{const Q=Y.order,le=se.order;return Q==null&&le==null?0:Q==null?-1:le==null?1:Q-le}),_.current.panelDataArrayChanged=!0,R()},[R]);bc(()=>{if(_.current.panelDataArrayChanged){_.current.panelDataArrayChanged=!1;const{autoSaveId:P,onLayout:K,storage:Y}=I.current,{layout:se,panelDataArray:Q}=_.current;let le=null;if(P){const be=upe(P,Q,Y);be&&(N.current=new Map(Object.entries(be.expandToSizes)),le=be.layout)}le==null&&(le=ipe({panelDataArray:Q}));const pe=CA({layout:le,panelConstraints:Q.map(be=>be.constraints)});bA(se,pe)||(j(pe),_.current.layout=pe,K&&K(pe),Pu(Q,pe,T.current))}}),bc(()=>{const P=_.current;return()=>{P.layout=[]}},[]);const V=h.useCallback(P=>{let K=!1;const Y=v.current;return Y&&window.getComputedStyle(Y,null).getPropertyValue("direction")==="rtl"&&(K=!0),function(Q){Q.preventDefault();const le=v.current;if(!le)return()=>null;const{direction:pe,dragState:be,id:ze,keyboardResizeBy:Re,onLayout:Ge}=I.current,{layout:ot,panelDataArray:Vt}=_.current,{initialLayout:He}=be??{},Xt=Qk(ze,P,le);let gn=ope(Q,P,pe,be,Re,le);const ke=pe==="horizontal";ke&&K&&(gn=-gn);const It=Vt.map(ge=>ge.constraints),Z=Gf({delta:gn,initialLayout:He??ot,panelConstraints:It,pivotIndices:Xt,prevLayout:ot,trigger:$k(Q)?"keyboard":"mouse-or-touch"}),ae=!cg(ot,Z);(Vk(Q)||Gk(Q))&&A.current!=gn&&(A.current=gn,!ae&&gn!==0?ke?c1(P,gn<0?qk:Kk):c1(P,gn<0?Wk:Zk):c1(P,0)),ae&&(j(Z),_.current.layout=Z,Ge&&Ge(Z),Pu(Vt,Z,T.current))}},[]),D=h.useCallback((P,K)=>{const{onLayout:Y}=I.current,{layout:se,panelDataArray:Q}=_.current,le=Q.map(ot=>ot.constraints),{panelSize:pe,pivotIndices:be}=lc(Q,P,se);Ht(pe!=null,`Panel size not found for panel "${P.id}"`);const Re=Bu(Q,P)===Q.length-1?pe-K:K-pe,Ge=Gf({delta:Re,initialLayout:se,panelConstraints:le,pivotIndices:be,prevLayout:se,trigger:"imperative-api"});cg(se,Ge)||(j(Ge),_.current.layout=Ge,Y&&Y(Ge),Pu(Q,Ge,T.current))},[]),F=h.useCallback((P,K)=>{const{layout:Y,panelDataArray:se}=_.current,{collapsedSize:Q=0,collapsible:le}=K,{collapsedSize:pe=0,collapsible:be,maxSize:ze=100,minSize:Re=0}=P.constraints,{panelSize:Ge}=lc(se,P,Y);Ge!=null&&(le&&be&&ui(Ge,Q)?ui(Q,pe)||D(P,pe):Ge<Re?D(P,Re):Ge>ze&&D(P,ze))},[D]),U=h.useCallback((P,K)=>{const{direction:Y}=I.current,{layout:se}=_.current;if(!v.current)return;const Q=Fy(P,v.current);Ht(Q,`Drag handle element not found for id "${P}"`);const le=e8(Y,K);S({dragHandleId:P,dragHandleRect:Q.getBoundingClientRect(),initialCursorPosition:le,initialLayout:se})},[]),ee=h.useCallback(()=>{S(null)},[]),he=h.useCallback(P=>{const{panelDataArray:K}=_.current,Y=Bu(K,P);Y>=0&&(K.splice(Y,1),delete T.current[P.id],_.current.panelDataArrayChanged=!0,R())},[R]),z=h.useMemo(()=>({collapsePanel:M,direction:r,dragState:C,expandPanel:G,getPanelSize:H,getPanelStyle:L,groupId:y,isPanelCollapsed:q,isPanelExpanded:W,reevaluatePanelConstraints:F,registerPanel:B,registerResizeHandle:V,resizePanel:D,startDragging:U,stopDragging:ee,unregisterPanel:he,panelGroupElement:v.current}),[M,C,r,G,H,L,y,q,W,F,B,V,D,U,ee,he]),$={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return h.createElement(Ly.Provider,{value:z},h.createElement(x,{...g,children:t,className:n,id:i,ref:v,style:{...$,...m},[rr.group]:"",[rr.groupDirection]:r,[rr.groupId]:y}))}const s8=h.forwardRef((e,t)=>h.createElement(a8,{...e,forwardedRef:t}));a8.displayName="PanelGroup";s8.displayName="forwardRef(PanelGroup)";function Bu(e,t){return e.findIndex(n=>n===t||n.id===t.id)}function lc(e,t,n){const r=Bu(e,t),i=r===e.length-1?[r-1,r]:[r,r+1],c=n[r];return{...t.constraints,panelSize:c,pivotIndices:i}}function hpe({disabled:e,handleId:t,resizeHandler:n,panelGroupElement:r}){h.useEffect(()=>{if(e||n==null||r==null)return;const s=Fy(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(rr.groupId);Ht(u,`No group element found for id "${u}"`);const f=Sh(u,r),m=Xk(u,t,r);Ht(m!==null,`No resize element found for id "${t}"`);const x=c.shiftKey?m>0?m-1:f.length-1:m+1<f.length?m+1:0;f[x].focus();break}}};return s.addEventListener("keydown",i),()=>{s.removeEventListener("keydown",i)}},[r,e,t,n])}function o8({children:e=null,className:t="",disabled:n=!1,hitAreaMargins:r,id:s,onBlur:i,onClick:c,onDragging:u,onFocus:f,onPointerDown:m,onPointerUp:x,style:g={},tabIndex:y=0,tagName:v="div",...C}){var S,E;const j=h.useRef(null),R=h.useRef({onClick:c,onDragging:u,onPointerDown:m,onPointerUp:x});h.useEffect(()=>{R.current.onClick=c,R.current.onDragging=u,R.current.onPointerDown=m,R.current.onPointerUp=x});const T=h.useContext(Ly);if(T===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:N,groupId:A,registerResizeHandle:I,startDragging:_,stopDragging:M,panelGroupElement:G}=T,H=l2(s),[L,q]=h.useState("inactive"),[W,B]=h.useState(!1),[V,D]=h.useState(null),F=h.useRef({state:L});bc(()=>{F.current.state=L}),h.useEffect(()=>{if(n)D(null);else{const z=I(H);D(()=>z)}},[n,H,I]);const U=(S=r==null?void 0:r.coarse)!==null&&S!==void 0?S:15,ee=(E=r==null?void 0:r.fine)!==null&&E!==void 0?E:5;h.useEffect(()=>{if(n||V==null)return;const z=j.current;Ht(z,"Element ref not attached");let $=!1;return Xme(H,z,N,{coarse:U,fine:ee},(K,Y,se)=>{if(!Y){q("inactive");return}switch(K){case"down":{q("drag"),$=!1,Ht(se,'Expected event to be defined for "down" action'),_(H,se);const{onDragging:Q,onPointerDown:le}=R.current;Q==null||Q(!0),le==null||le();break}case"move":{const{state:Q}=F.current;$=!0,Q!=="drag"&&q("hover"),Ht(se,'Expected event to be defined for "move" action'),V(se);break}case"up":{q("hover"),M();const{onClick:Q,onDragging:le,onPointerUp:pe}=R.current;le==null||le(!1),pe==null||pe(),$||Q==null||Q();break}}})},[U,N,n,ee,I,H,V,_,M]),hpe({disabled:n,handleId:H,resizeHandler:V,panelGroupElement:G});const he={touchAction:"none",userSelect:"none"};return h.createElement(v,{...C,children:e,className:t,id:s,onBlur:()=>{B(!1),i==null||i()},onFocus:()=>{B(!0),f==null||f()},ref:j,role:"separator",style:{...he,...g},tabIndex:y,[rr.groupDirection]:N,[rr.groupId]:A,[rr.resizeHandle]:"",[rr.resizeHandleActive]:L==="drag"?"pointer":W?"keyboard":void 0,[rr.resizeHandleEnabled]:!n,[rr.resizeHandleId]:H,[rr.resizeHandleState]:L})}o8.displayName="PanelResizeHandle";function mpe({className:e,...t}){return a.jsx(s8,{"data-slot":"resizable-panel-group",className:oe("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t})}function wA({...e}){return a.jsx(Hk,{"data-slot":"resizable-panel",...e})}function ppe({withHandle:e,className:t,...n}){return a.jsx(o8,{"data-slot":"resizable-handle",className:oe("bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:translate-x-0 data-[panel-group-direction=vertical]:after:-translate-y-1/2 [&[data-panel-group-direction=vertical]>div]:rotate-90",t),...n,children:e&&a.jsx("div",{className:"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border",children:a.jsx(x4,{className:"size-2.5"})})})}function gpe({storageKey:e,left:t,right:n,initialRatio:r=.5,minWidth:s=240,className:i}){const c=h.useMemo(()=>{const y=ta.get(e);if(y!==null){const v=Number(y);if(!Number.isNaN(v))return d1(v,.1,.9)}return d1(r,.1,.9)},[e,r]),u=Math.round(c*100),f=100-u,x=Math.min(45,Math.max(5,Math.round(s/1200*100)));function g(y){const v=y[0],C=d1(v/100,.1,.9);ta.set(e,C)}return a.jsxs(mpe,{direction:"horizontal",onLayout:g,className:oe("relative flex h-full w-full items-stretch overflow-hidden",i),children:[a.jsx(wA,{defaultSize:u,minSize:x,className:"overflow-auto",children:t}),a.jsx(ppe,{withHandle:!0}),a.jsx(wA,{defaultSize:f,minSize:x,className:"overflow-auto",children:n})]})}function d1(e,t,n){return Math.max(t,Math.min(n,e))}function xpe({...e}){return a.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...e})}function ype({className:e,...t}){return a.jsx("ol",{"data-slot":"breadcrumb-list",className:oe("text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",e),...t})}function RA({className:e,...t}){return a.jsx("li",{"data-slot":"breadcrumb-item",className:oe("inline-flex items-center gap-1.5",e),...t})}function vpe({asChild:e,className:t,...n}){const r=e?_h:"a";return a.jsx(r,{"data-slot":"breadcrumb-link",className:oe("hover:text-foreground transition-colors",t),...n})}function bpe({children:e,className:t,...n}){return a.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:oe("[&>svg]:size-3.5",t),...n,children:e??a.jsx(ba,{})})}function Spe({dataMartId:e,triggerId:t,insightId:n,onRunFinished:r,onError:s}){const i=h.useCallback(async c=>{if(!(!e||!t))try{const u=await Ls.checkInsightExecutionStatus(e,t,n,{skipLoadingIndicator:!0,signal:c});[ts.SUCCESS,ts.ERROR,ts.CANCELLED].includes(u.status)&&r()}catch(u){s(u)}},[e,t,n,r,s]);iE({enabled:!!(e&&t),intervalMs:2500,onlyWhenVisible:!0,onTick:i})}const Cpe=Yt({title:yt().min(1,"Title cannot be empty"),template:yt().optional()}),Epe=(e,t,n)=>{const{register:r,watch:s,handleSubmit:i,reset:c,resetField:u,setValue:f,formState:{isSubmitting:m,dirtyFields:x}}=Lo({resolver:Ai(Cpe),defaultValues:{title:(e==null?void 0:e.title)??"",template:(e==null?void 0:e.template)??""}}),g=s("title"),y=s("template"),v=!!x.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 j=E.trim();f("title",j,{shouldDirty:!0,shouldValidate:!0}),await n(e.id,j),u("title",{defaultValue:j})},[e,u,f,n]),S=h.useCallback(async E=>{if(!e)return;const j={title:E.title.trim(),template:E.template&&E.template.trim().length>0?E.template:null},R=await t(e.id,j);R&&c({title:R.title,template:R.template??""})},[e,c,t]);return{register:r,handleSubmit:i,setValue:f,isTemplateDirty:v,isSubmitting:m,titleValue:g,templateValue:y,handleTitleUpdate:C,onSubmit:S}},f1=[{icon:Xa,text:"Initializing intelligence..."},{icon:h4,text:"Connecting to data sources..."},{icon:lF,text:"Mapping data relationships..."},{icon:wz,text:"Exploring dataset structure..."},{icon:DF,text:"Scanning available fields..."},{icon:UF,text:"Analyzing data patterns..."},{icon:RF,text:"Selecting optimal insight path..."},{icon:R4,text:"Preparing aggregated tables..."},{icon:$z,text:"Building visual model..."},{icon:xz,text:"Finalizing insight output..."},{icon:GF,text:"Validating field consistency..."},{icon:NF,text:"Checking for missing values..."},{icon:Cz,text:"Detecting anomalies in data..."},{icon:qz,text:"Cross-referencing data sources..."},{icon:FF,text:"Verifying aggregation results..."},{icon:Lz,text:"Ensuring data relationships are correct..."},{icon:AU,text:"Refining visual model parameters..."},{icon:Dz,text:"Confirming data integrity..."},{icon:vz,text:"Preparing final output for insights..."},{icon:Tz,text:"Performing final quality checks..."}],wpe=()=>{const[e,t]=h.useState(0);h.useEffect(()=>{const r=setInterval(()=>{t(s=>(s+1)%f1.length)},5e3);return()=>{clearInterval(r)}},[]);const n=f1[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:f1[e].text},`${String(e)}-text`)]})})};function Rpe(){const e=Lc(),{insightId:t}=Cx(),n=h.useMemo(()=>"insight_details_split",[]),[r,s]=h.useState(!1),{dataMart:i}=to(),c=(i==null?void 0:i.status.code)===br.DRAFT,{activeInsight:u,insightLoading:f,isRunning:m,triggerId:x,updateInsight:g,updateInsightTitle:y,getInsight:v,runInsight:C,deleteInsight:S,resetTriggerId:E,ensureActiveRunPolling:j}=Iy(),{canEdit:R,canDelete:T,canRun:N,canSendAndSchedule:A}=ky(),{handleSubmit:I,setValue:_,isTemplateDirty:M,isSubmitting:G,titleValue:H,templateValue:L,handleTitleUpdate:q,onSubmit:W}=Epe(u,g,y),B=_k({markdown:(u==null?void 0:u.output)??"",enabled:!!(u!=null&&u.output),debounceMs:0}),[V,D]=h.useState(!1),[F,U]=h.useState(!1),{copyToClipboard:ee}=My(),he=h.useCallback(async()=>{const Y=(u==null?void 0:u.output)??"";if(!Y)return;await ee(Y,"insight-output")?Dt.success("Markdown copied to clipboard"):Dt.error("Failed to copy to clipboard"),De({event:"insight_output_copied",category:"Insights",action:"Copy"})},[u==null?void 0:u.output,ee]);h.useEffect(()=>{const Y=se=>{(se.metaKey||se.ctrlKey)&&se.shiftKey&&(se.key==="M"||se.key==="m")&&(se.preventDefault(),D(le=>!le),De({event:"insight_raw_output_toggle",category:"Insights",action:"ToggleRawOutput"}))};return window.addEventListener("keydown",Y),()=>{window.removeEventListener("keydown",Y)}},[]);const z=h.useCallback(async()=>{u&&(await S(u.id),e(".."))},[u,S,e]),$=!f&&!(u!=null&&u.output);h.useEffect(()=>{t&&v(t)},[t,v]),h.useEffect(()=>{u!=null&&u.id&&j()},[u==null?void 0:u.id,j]),Spe({triggerId:x,dataMartId:(i==null?void 0:i.id)??"",insightId:(u==null?void 0:u.id)??"",onRunFinished:h.useCallback(()=>{E(),u!=null&&u.id&&v(u.id)},[u==null?void 0:u.id,v,E]),onError:h.useCallback(()=>{E()},[E])});const P=h.useCallback(async()=>{if(!(u!=null&&u.id)){console.error("Insight ID is not available");return}try{await C(u.id)}catch(Y){throw console.error("Failed to run insight"),Y}},[u==null?void 0:u.id,C]),K=h.useCallback(()=>I(async Y=>{if(await W(Y),!(u!=null&&u.id)){console.error("Insight ID is not available");return}try{await C(u.id)}catch(se){throw console.error("Failed to run insight"),se}})(),[I,u==null?void 0:u.id,W,C]);return f?a.jsx("div",{className:"text-muted-foreground flex flex-col gap-2 text-sm",children:"Loading..."}):!u||!i?a.jsxs(AS,{children:[a.jsx(DS,{children:a.jsx(OS,{variant:"icon",children:a.jsx(Xa,{})})}),a.jsx(IS,{children:"Insight not found"}),a.jsx(MS,{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(xpe,{children:a.jsxs(ype,{children:[a.jsx(RA,{children:a.jsx(vpe,{asChild:!0,children:a.jsx(Nr,{to:"..",children:"Insights"})})}),a.jsx(bpe,{}),a.jsx(RA,{children:a.jsx("span",{"aria-current":"page",className:"block max-w-[480px] truncate",children:a.jsx(p6,{title:H||"Untitled insight",onUpdate:q,className:"font-medium",errorMessage:"Title cannot be empty",minWidth:"200px",readOnly:!R})})})]})}),a.jsx("div",{className:"flex items-center gap-2",children:a.jsxs(Or,{children:[a.jsx(Ir,{asChild:!0,children:a.jsx(we,{variant:"ghost",size:"icon","aria-label":"Insight actions",children:a.jsx(m4,{className:"h-4 w-4"})})}),a.jsx(Mr,{align:"end",children:a.jsxs(rt,{children:[a.jsx(at,{asChild:!0,children:a.jsx("div",{className:"w-full",children:a.jsxs(Ut,{onClick:()=>{s(!0)},className:"text-destructive",disabled:!T,children:[a.jsx(os,{className:"h-4 w-4 text-red-600"})," ",a.jsx("span",{className:"text-red-600",children:"Delete insight"})]})})}),!T&&a.jsx(st,{side:"left",children:vo})]})})]})})]}),a.jsx("div",{className:"bg-background flex-1 rounded-md border",children:a.jsx(gpe,{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(NS,{value:L??"",onChange:Y=>{_("template",Y,{shouldDirty:!0})},height:"calc(100vh - 275px)",placeholder:"Type / to view available commands...",readOnly:m||!R,excludeInsightId:t})}),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:[c?a.jsxs(rt,{delayDuration:150,children:[a.jsx(at,{asChild:!0,children:a.jsx("span",{className:"inline-flex",tabIndex:0,children:a.jsx(we,{variant:"default",size:"default",disabled:G||m||!N,onClick:()=>{M&&I(async Y=>{await W(Y)})()},children:M?a.jsxs("span",{className:"inline-flex items-center gap-2",children:[a.jsx(Xa,{})," Save Insight"]}):a.jsxs("span",{className:"inline-flex items-center gap-2",children:[a.jsx(Xa,{})," Run Insight"]})})})}),a.jsx(st,{side:"top",children:N?a.jsx("p",{children:"To run an insight, publish the Data Mart first"}):a.jsx("p",{children:vo})})]}):a.jsxs(rt,{delayDuration:150,children:[a.jsx(at,{asChild:!0,children:a.jsx("div",{className:"inline-flex",children:a.jsx(we,{variant:"default",size:"default",disabled:G||m||!N,onClick:()=>void(M?K():P()),children:m?a.jsxs("span",{className:"inline-flex items-center gap-2",children:[a.jsx(Uc,{className:"h-3 w-3 animate-spin"})," Running…"]}):M?a.jsxs("span",{className:"inline-flex items-center gap-2",children:[a.jsx(Xa,{})," Save & Run Insight"]}):a.jsxs("span",{className:"inline-flex items-center gap-2",children:[a.jsx(Xa,{})," Run Insight"]})})})}),!N&&a.jsx(st,{side:"top",children:vo})]}),a.jsxs(rt,{delayDuration:1500,children:[a.jsx(at,{asChild:!0,children:a.jsx("span",{className:"inline-flex",tabIndex:0,children:a.jsxs(we,{variant:"outline",size:"default",onClick:()=>{De({event:"insight_send_schedule",category:"Insights",action:"SendSchedule",label:t}),!c&&A&&U(!0)},disabled:c||!A,className:"gap-2",children:[a.jsx(MF,{className:"text-muted-foreground h-4 w-4"}),"Send & Schedule ..."]})})}),a.jsx(st,{side:"top",children:c?a.jsx("p",{children:"You can schedule and send reports only after publishing the Data Mart"}):A?a.jsx("p",{children:"You can schedule this insight to run at a specific time or send it to a recipient"}):a.jsx("p",{children:vo})})]})]}),u.outputUpdatedAt&&a.jsx(ga,{children:a.jsxs(rt,{children:[a.jsx(at,{asChild:!0,children:a.jsx("div",{className:"text-muted-foreground/75 text-sm",children:a.jsx(ws,{date:u.outputUpdatedAt})})}),a.jsx(st,{side:"top",children:a.jsxs("p",{children:["Last run: ",x5(u.outputUpdatedAt)]})})]})})]})]}),right:a.jsx("div",{className:"h-full",children:m?a.jsx(wpe,{}):$?a.jsx(AS,{className:"h-full",children:a.jsxs(DS,{children:[a.jsx(OS,{variant:"icon",children:a.jsx(Xa,{})}),a.jsx(IS,{children:"Even data needs a little spark"}),a.jsx(MS,{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:V?a.jsx(NS,{value:u.output??"",onChange:()=>{},height:"100%",className:"h-full",readOnly:!0,excludeInsightId:t}):B.error?a.jsx("div",{className:"text-destructive",children:B.error}):a.jsxs(a.Fragment,{children:[a.jsx(Tk,{html:B.html,loading:B.loading,error:B.error,height:"100%"}),!!u.output&&!B.loading&&!B.error&&a.jsx("div",{className:"absolute top-2 right-2 z-10",children:a.jsx(ga,{children:a.jsxs(rt,{children:[a.jsx(at,{asChild:!0,children:a.jsx(we,{variant:"outline",size:"icon",className:"h-8 w-8","aria-label":"Copy markdown to clipboard",onClick:()=>void he(),children:a.jsx(od,{className:"h-4 w-4"})})}),a.jsx(st,{side:"left",children:a.jsx("p",{children:"Copy markdown to clipboard"})})]})})})]})})})})})}),a.jsx(Ar,{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:()=>{z()}}),a.jsx(zC,{children:a.jsx(Lk,{isOpen:F,onClose:()=>{U(!1)},mode:kn.CREATE,preSelectedDestination:null,prefill:{title:u.title||H||"New report",subject:`Insight: ${u.title||H||""}`.trim(),messageTemplate:L??""},allowedDestinationTypes:[Ie.EMAIL,Ie.SLACK,Ie.MS_TEAMS,Ie.GOOGLE_CHAT]})})]})}const jpe=[{path:"overview",element:a.jsx(hA,{})},{path:"data-setup",element:a.jsx(Rfe,{})},{path:"insights",element:a.jsx(tme,{}),children:[{index:!0,element:a.jsx(zme,{})},{path:":insightId",element:a.jsx(Rpe,{})}]},{path:"reports",element:a.jsx(Jhe,{})},{path:"triggers",element:a.jsx(eme,{})},{path:"run-history",element:a.jsx(xme,{})},{index:!0,element:a.jsx(hA,{})}];function Tpe({to:e="/data-marts"}){const{user:t,status:n}=Ti();if(n===ra.LOADING)return a.jsx(Qu,{fullScreen:!0,message:"Loading..."});if(n===ra.UNAUTHENTICATED||!t)return a.jsx(Qu,{fullScreen:!0,message:"Authentication..."});if(t.projectId){const r=zg(t.projectId,e);return a.jsx(CP,{to:r,replace:!0})}return a.jsx(Qu,{fullScreen:!0,message:"Project not found"})}const _pe=[{index:!0,path:"/",element:a.jsx(Tpe,{})},{path:"/ui/:projectId",element:a.jsx(MQ,{}),children:[{path:"about",element:a.jsx(kQ,{})},{index:!0,element:a.jsx(iN,{})},{path:"data-marts",element:a.jsx(iN,{})},{path:"data-marts/create",element:a.jsx(yme,{})},{path:"data-marts/:id",element:a.jsx(yfe,{}),children:jpe},{path:"data-storages",element:a.jsx(wme,{})},{path:"data-destinations",element:a.jsx(Ame,{})},{path:"*",element:a.jsx(K1,{})}]},{path:"*",element:a.jsx(K1,{})}],i8="gtm-script",l8="gtm-noscript",Npe="GOOGLE_TAG_MANAGER_CONTAINER_ID";function Ape(){return!!document.getElementById(i8)}function Dpe(e){const t=document.createElement("script");return t.id=i8,t.innerHTML=`
|
|
858
|
+
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
|
|
859
|
+
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
|
|
860
|
+
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
|
|
861
|
+
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
|
|
862
|
+
})(window,document,'script','dataLayer','${e}');
|
|
863
|
+
`,t}function Ope(e){const t=document.createElement("noscript");return t.id=l8,t.innerHTML=`
|
|
864
|
+
<iframe src="https://www.googletagmanager.com/ns.html?id=${e}"
|
|
865
|
+
height="0"
|
|
866
|
+
width="0"
|
|
867
|
+
style="display:none;visibility:hidden">
|
|
868
|
+
</iframe>
|
|
869
|
+
`,t}function Ipe(e){if(Ape())return;const t=Dpe(e);document.head.prepend(t)}function Mpe(e){if(document.getElementById(l8))return;const t=Ope(e);document.body.firstChild?document.body.insertBefore(t,document.body.firstChild):document.body.appendChild(t)}function kpe(e){try{Ipe(e),Mpe(e)}catch(t){console.warn("Failed to initialize Google Tag Manager:",t)}}function Lpe(e){return(e[Npe]??"").trim()}function Ppe(){const{flags:e,callState:t}=wd();return h.useEffect(()=>{if(t!==kt.LOADED||!e)return;const n=Lpe(e);n&&kpe(n)},[e,t]),null}const Upe="INTERCOM_APP_ID",c8="intercom-widget-script";function zpe(){return!!document.getElementById(c8)}function Fpe(e,t){if(zpe()){t();return}const n=document.createElement("script");n.id=c8,n.src=`https://widget.intercom.io/widget/${e}`,n.async=!0,n.onload=()=>{t()},document.head.appendChild(n)}async function Hpe(){try{return(await Aa.post("/intercom/jwt")).data.token}catch(e){return console.warn("Failed to fetch Intercom JWT",e),null}}function $pe(e,t){const n={app_id:e,user_id:t.id,hide_default_launcher:!0};return t.email&&(n.email=t.email),t.fullName&&(n.name=t.fullName),t.projectTitle&&(n.Name_project=t.projectTitle),n}async function Vpe(e,t){if(!t)return;const n=$pe(e,t),r=await Hpe();if(r){n.intercom_user_jwt=r;try{window.Intercom&&window.Intercom("boot",n)}catch(s){console.warn("Failed to boot Intercom",s)}}}function Gpe(){const{flags:e,callState:t}=wd(),{user:n}=Ti(),r=h.useRef(!1);return h.useEffect(()=>{if(r.current||t!==kt.LOADED||!e)return;const s=e[Upe],i=(typeof s=="string"?s:"").trim();i&&Fpe(i,()=>{Vpe(i,n).then(()=>{r.current=!0,B1()})})},[e,t,n]),null}function Bpe({initialState:e,reducer:t,children:n}){const[r,s]=h.useReducer(t,e),i=h.useMemo(()=>s,[s]);return a.jsx(PD.Provider,{value:r,children:a.jsx(UD.Provider,{value:i,children:n})})}function qpe(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 jA={id:null,title:null},u8="project/SET_PROJECT",Kpe="project/CLEAR_PROJECT";function Wpe(e){return{type:u8,payload:e}}function Zpe(e=jA,t){switch(t.type){case u8:{const{id:n,title:r}=t.payload;return{id:n,title:r??null}}case Kpe:return{...jA};default:return e}}class Ype extends _l{getFlags(){return this.get("/flags")}}const Xpe=new Ype(""),d8={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"},Qpe={data:{...d8},callState:kt.IDLE},f8="settings/LOAD_FLAGS",h8="settings/LOAD_FLAGS_SUCCESS",m8="settings/LOAD_FLAGS_ERROR";function Jpe(){return{type:f8}}function ege(e){return{type:h8,payload:e}}function tge(e){return{type:m8,payload:e}}function nge(e=Qpe,t){switch(t.type){case f8:return{...e,callState:kt.LOADING,error:void 0};case h8:return{...e,callState:kt.LOADED,data:{...d8,...t.payload}};case m8:return{...e,callState:kt.ERROR,error:t.payload};default:return e}}async function rge(e){try{e(Jpe());const t=await Xpe.getFlags();e(ege(t))}catch(t){const n=t instanceof Error?t.message:"Failed to load settings";e(tge(n))}}const p8="app/SET_READY";function age(e={ready:!1},t){switch(t.type){case p8:return{...e,ready:!!t.payload};default:return e}}const sge=qpe({project:Zpe,flags:nge,contentPopovers:KX,app:age});function oge({children:e}){return a.jsx(Bpe,{reducer:sge,initialState:{project:{id:null,title:null},flags:{data:null,callState:kt.IDLE},contentPopovers:HO,app:{ready:!1}},children:e})}function ige({children:e}){const t=zD(),{user:n,status:r}=Ti(),s=dh(f=>f.flags),i=s.callState,c=dh(f=>f.app.ready);h.useEffect(()=>{r===ra.AUTHENTICATED&&(n!=null&&n.projectId)&&(t(Wpe({id:n.projectId,title:n.projectTitle??null})),i===kt.IDLE&&rge(t))},[r,n==null?void 0:n.projectId,n==null?void 0:n.projectTitle,i,t]),h.useEffect(()=>{const f=r===ra.AUTHENTICATED&&!!(n!=null&&n.projectId)&&i===kt.LOADED;t({type:p8,payload:f})},[r,n==null?void 0:n.projectId,i,t]);const u=h.useMemo(()=>a.jsx(Qu,{fullScreen:!0,message:"Loading application..."}),[]);return c?a.jsx(a.Fragment,{children:e}):i===kt.ERROR?a.jsx(Qu,{fullScreen:!0,message:`Failed to load app flags: ${s.error??""}`}):u}const lge={center:"top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2","bottom-left":"bottom-4 left-4","bottom-right":"bottom-4 right-4","top-left":"top-4 left-4","top-right":"top-4 right-4"};function cge({width:e=500,height:t=500,position:n="center",children:r}){return a.jsx("div",{className:oe("fixed z-[999] rounded-2xl border bg-white dark:bg-neutral-900","border-neutral-200 dark:border-neutral-800","hover:shadow-3xl transform shadow-2xl transition-all duration-200 ease-out","max-w-[calc(100vw-2rem)]",lge[n]),style:{width:e,height:t},"data-slot":"floating-popover",children:a.jsx("div",{className:"flex h-full flex-col",children:r})})}function uge({children:e,onClose:t,...n}){return a.jsxs("div",{className:"relative flex items-center justify-between rounded-tl-2xl rounded-tr-2xl border-b bg-neutral-50 px-4 py-3 dark:bg-neutral-800/40","data-slot":"floating-popover-header",...n,children:[e,t&&a.jsx("button",{onClick:t,className:oe("ml-2 rounded-sm p-1.5 transition-all","text-muted-foreground hover:text-foreground hover:bg-neutral-100 dark:hover:bg-neutral-800","focus:ring-brand-blue-500 focus:ring-2 focus:outline-none active:scale-95"),"aria-label":"Close popover",children:a.jsx(Cc,{className:"size-4"})})]})}function dge({children:e}){return a.jsx("h2",{className:"text-md font-semibold","data-slot":"floating-popover-title",children:e})}function fge({children:e}){return a.jsx("div",{className:"flex-1 space-y-4 overflow-auto px-4 py-3","data-slot":"floating-popover-content",children:e})}function hge(){return a.jsx(a.Fragment,{children:a.jsx("video",{src:"https://github.com/user-attachments/assets/d2d9d913-a6fc-4949-a8e8-d697abd1631a",controls:!0,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,className:"w-full rounded-md",children:"Your browser does not support the video tag."})})}function mge(){return a.jsx(a.Fragment,{children:a.jsx("video",{src:"https://github.com/user-attachments/assets/95e499eb-0a36-4180-846b-a829294e1afe",controls:!0,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,className:"w-full rounded-md",children:"Your browser does not support the video tag."})})}function pge(){return a.jsx(a.Fragment,{children:a.jsx("video",{src:"https://github.com/user-attachments/assets/dcb60ce1-dd7b-4783-b19c-f2fd85079e1f",controls:!0,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,className:"w-full rounded-md",children:"Your browser does not support the video tag."})})}const gge={"video-1-google-sheets":{width:500,height:410,position:"bottom-left",title:"SQL to Google Sheets in Minutes",content:hge},"video-2-looker":{width:500,height:410,position:"bottom-left",title:"Looker Studio Setup",content:mge},"video-3-getting-started-with-data-marts":{width:500,height:355,position:"bottom-left",title:"Getting Started with Data Marts",content:pge}};function xge(){const{activePopoverId:e,isOpen:t,close:n}=PC();if(!t||!e)return null;const r=gge[e],{width:s=500,height:i=400,position:c="center",title:u,content:f}=r;return a.jsxs(cge,{width:s,height:i,position:c,onClose:n,children:[a.jsx(uge,{onClose:n,children:u&&a.jsx(dge,{children:u})}),a.jsx(fge,{children:a.jsx(f,{onClose:n})})]})}function yge(){const e=WP(_pe);return a.jsx(SZ,{children:a.jsx(oge,{children:a.jsxs(ige,{children:[a.jsx(Ppe,{}),a.jsx(Gpe,{}),a.jsx(xge,{}),a.jsx(sU,{router:e})]})})})}const g8=document.getElementById("root");if(!g8)throw new Error("Root element not found");ML.createRoot(g8).render(a.jsx(h.StrictMode,{children:a.jsx(yge,{})}));
|