@owox/web 0.15.0-next-20251211083849 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,826 +0,0 @@
|
|
|
1
|
-
var Pk=Object.defineProperty;var Uk=(e,t,n)=>t in e?Pk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Bs=(e,t,n)=>Uk(e,typeof t!="symbol"?t+"":t,n);function Fk(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 CN(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var r0={exports:{}},sf={};/**
|
|
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 XR;function zk(){if(XR)return sf;XR=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 sf.Fragment=t,sf.jsx=n,sf.jsxs=n,sf}var JR;function Hk(){return JR||(JR=1,r0.exports=zk()),r0.exports}var a=Hk(),a0={exports:{}},pt={};/**
|
|
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 ej;function Vk(){if(ej)return pt;ej=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"),g=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),x=Symbol.iterator;function v(P){return P===null||typeof P!="object"?null:(P=x&&P[x]||P["@@iterator"],typeof P=="function"?P:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,E={};function R(P,U,$){this.props=P,this.context=U,this.refs=E,this.updater=$||S}R.prototype.isReactComponent={},R.prototype.setState=function(P,U){if(typeof P!="object"&&typeof P!="function"&&P!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,P,U,"setState")},R.prototype.forceUpdate=function(P){this.updater.enqueueForceUpdate(this,P,"forceUpdate")};function j(){}j.prototype=R.prototype;function _(P,U,$){this.props=P,this.context=U,this.refs=E,this.updater=$||S}var A=_.prototype=new j;A.constructor=_,C(A,R.prototype),A.isPureReactComponent=!0;var O=Array.isArray;function I(){}var T={H:null,A:null,T:null,S:null},D=Object.prototype.hasOwnProperty;function L(P,U,$){var Q=$.ref;return{$$typeof:e,type:P,key:U,ref:Q!==void 0?Q:null,props:$}}function H(P,U){return L(P.type,U,P.props)}function B(P){return typeof P=="object"&&P!==null&&P.$$typeof===e}function q(P){var U={"=":"=0",":":"=2"};return"$"+P.replace(/[=:]/g,function($){return U[$]})}var Z=/\/+/g;function F(P,U){return typeof P=="object"&&P!==null&&P.key!=null?q(""+P.key):U.toString(36)}function z(P){switch(P.status){case"fulfilled":return P.value;case"rejected":throw P.reason;default:switch(typeof P.status=="string"?P.then(I,I):(P.status="pending",P.then(function(U){P.status==="pending"&&(P.status="fulfilled",P.value=U)},function(U){P.status==="pending"&&(P.status="rejected",P.reason=U)})),P.status){case"fulfilled":return P.value;case"rejected":throw P.reason}}throw P}function M(P,U,$,Q,ne){var ue=typeof P;(ue==="undefined"||ue==="boolean")&&(P=null);var J=!1;if(P===null)J=!0;else switch(ue){case"bigint":case"string":case"number":J=!0;break;case"object":switch(P.$$typeof){case e:case t:J=!0;break;case g:return J=P._init,M(J(P._payload),U,$,Q,ne)}}if(J)return ne=ne(P),J=Q===""?"."+F(P,0):Q,O(ne)?($="",J!=null&&($=J.replace(Z,"$&/")+"/"),M(ne,U,$,"",function(Ee){return Ee})):ne!=null&&(B(ne)&&(ne=H(ne,$+(ne.key==null||P&&P.key===ne.key?"":(""+ne.key).replace(Z,"$&/")+"/")+J)),U.push(ne)),1;J=0;var he=Q===""?".":Q+":";if(O(P))for(var ge=0;ge<P.length;ge++)Q=P[ge],ue=he+F(Q,ge),J+=M(Q,U,$,ue,ne);else if(ge=v(P),typeof ge=="function")for(P=ge.call(P),ge=0;!(Q=P.next()).done;)Q=Q.value,ue=he+F(Q,ge++),J+=M(Q,U,$,ue,ne);else if(ue==="object"){if(typeof P.then=="function")return M(z(P),U,$,Q,ne);throw U=String(P),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(P).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.")}return J}function V(P,U,$){if(P==null)return P;var Q=[],ne=0;return M(P,Q,"","",function(ue){return U.call($,ue,ne++)}),Q}function K(P){if(P._status===-1){var U=P._result;U=U(),U.then(function($){(P._status===0||P._status===-1)&&(P._status=1,P._result=$)},function($){(P._status===0||P._status===-1)&&(P._status=2,P._result=$)}),P._status===-1&&(P._status=0,P._result=U)}if(P._status===1)return P._result.default;throw P._result}var se=typeof reportError=="function"?reportError:function(P){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var U=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof P=="object"&&P!==null&&typeof P.message=="string"?String(P.message):String(P),error:P});if(!window.dispatchEvent(U))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",P);return}console.error(P)},ve={map:V,forEach:function(P,U,$){V(P,function(){U.apply(this,arguments)},$)},count:function(P){var U=0;return V(P,function(){U++}),U},toArray:function(P){return V(P,function(U){return U})||[]},only:function(P){if(!B(P))throw Error("React.Children.only expected to receive a single React element child.");return P}};return pt.Activity=y,pt.Children=ve,pt.Component=R,pt.Fragment=n,pt.Profiler=s,pt.PureComponent=_,pt.StrictMode=r,pt.Suspense=f,pt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,pt.__COMPILER_RUNTIME={__proto__:null,c:function(P){return T.H.useMemoCache(P)}},pt.cache=function(P){return function(){return P.apply(null,arguments)}},pt.cacheSignal=function(){return null},pt.cloneElement=function(P,U,$){if(P==null)throw Error("The argument must be a React element, but you passed "+P+".");var Q=C({},P.props),ne=P.key;if(U!=null)for(ue in U.key!==void 0&&(ne=""+U.key),U)!D.call(U,ue)||ue==="key"||ue==="__self"||ue==="__source"||ue==="ref"&&U.ref===void 0||(Q[ue]=U[ue]);var ue=arguments.length-2;if(ue===1)Q.children=$;else if(1<ue){for(var J=Array(ue),he=0;he<ue;he++)J[he]=arguments[he+2];Q.children=J}return L(P.type,ne,Q)},pt.createContext=function(P){return P={$$typeof:c,_currentValue:P,_currentValue2:P,_threadCount:0,Provider:null,Consumer:null},P.Provider=P,P.Consumer={$$typeof:i,_context:P},P},pt.createElement=function(P,U,$){var Q,ne={},ue=null;if(U!=null)for(Q in U.key!==void 0&&(ue=""+U.key),U)D.call(U,Q)&&Q!=="key"&&Q!=="__self"&&Q!=="__source"&&(ne[Q]=U[Q]);var J=arguments.length-2;if(J===1)ne.children=$;else if(1<J){for(var he=Array(J),ge=0;ge<J;ge++)he[ge]=arguments[ge+2];ne.children=he}if(P&&P.defaultProps)for(Q in J=P.defaultProps,J)ne[Q]===void 0&&(ne[Q]=J[Q]);return L(P,ue,ne)},pt.createRef=function(){return{current:null}},pt.forwardRef=function(P){return{$$typeof:u,render:P}},pt.isValidElement=B,pt.lazy=function(P){return{$$typeof:g,_payload:{_status:-1,_result:P},_init:K}},pt.memo=function(P,U){return{$$typeof:m,type:P,compare:U===void 0?null:U}},pt.startTransition=function(P){var U=T.T,$={};T.T=$;try{var Q=P(),ne=T.S;ne!==null&&ne($,Q),typeof Q=="object"&&Q!==null&&typeof Q.then=="function"&&Q.then(I,se)}catch(ue){se(ue)}finally{U!==null&&$.types!==null&&(U.types=$.types),T.T=U}},pt.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},pt.use=function(P){return T.H.use(P)},pt.useActionState=function(P,U,$){return T.H.useActionState(P,U,$)},pt.useCallback=function(P,U){return T.H.useCallback(P,U)},pt.useContext=function(P){return T.H.useContext(P)},pt.useDebugValue=function(){},pt.useDeferredValue=function(P,U){return T.H.useDeferredValue(P,U)},pt.useEffect=function(P,U){return T.H.useEffect(P,U)},pt.useEffectEvent=function(P){return T.H.useEffectEvent(P)},pt.useId=function(){return T.H.useId()},pt.useImperativeHandle=function(P,U,$){return T.H.useImperativeHandle(P,U,$)},pt.useInsertionEffect=function(P,U){return T.H.useInsertionEffect(P,U)},pt.useLayoutEffect=function(P,U){return T.H.useLayoutEffect(P,U)},pt.useMemo=function(P,U){return T.H.useMemo(P,U)},pt.useOptimistic=function(P,U){return T.H.useOptimistic(P,U)},pt.useReducer=function(P,U,$){return T.H.useReducer(P,U,$)},pt.useRef=function(P){return T.H.useRef(P)},pt.useState=function(P){return T.H.useState(P)},pt.useSyncExternalStore=function(P,U,$){return T.H.useSyncExternalStore(P,U,$)},pt.useTransition=function(){return T.H.useTransition()},pt.version="19.2.0",pt}var tj;function Nb(){return tj||(tj=1,a0.exports=Vk()),a0.exports}var h=Nb();const be=CN(h),Lg=Fk({__proto__:null,default:be},[h]);var s0={exports:{}},of={},o0={exports:{}},i0={};/**
|
|
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 nj;function $k(){return nj||(nj=1,(function(e){function t(M,V){var K=M.length;M.push(V);e:for(;0<K;){var se=K-1>>>1,ve=M[se];if(0<s(ve,V))M[se]=V,M[K]=ve,K=se;else break e}}function n(M){return M.length===0?null:M[0]}function r(M){if(M.length===0)return null;var V=M[0],K=M.pop();if(K!==V){M[0]=K;e:for(var se=0,ve=M.length,P=ve>>>1;se<P;){var U=2*(se+1)-1,$=M[U],Q=U+1,ne=M[Q];if(0>s($,K))Q<ve&&0>s(ne,$)?(M[se]=ne,M[Q]=K,se=Q):(M[se]=$,M[U]=K,se=U);else if(Q<ve&&0>s(ne,K))M[se]=ne,M[Q]=K,se=Q;else break e}}return V}function s(M,V){var K=M.sortIndex-V.sortIndex;return K!==0?K:M.id-V.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=[],g=1,y=null,x=3,v=!1,S=!1,C=!1,E=!1,R=typeof setTimeout=="function"?setTimeout:null,j=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function A(M){for(var V=n(m);V!==null;){if(V.callback===null)r(m);else if(V.startTime<=M)r(m),V.sortIndex=V.expirationTime,t(f,V);else break;V=n(m)}}function O(M){if(C=!1,A(M),!S)if(n(f)!==null)S=!0,I||(I=!0,q());else{var V=n(m);V!==null&&z(O,V.startTime-M)}}var I=!1,T=-1,D=5,L=-1;function H(){return E?!0:!(e.unstable_now()-L<D)}function B(){if(E=!1,I){var M=e.unstable_now();L=M;var V=!0;try{e:{S=!1,C&&(C=!1,j(T),T=-1),v=!0;var K=x;try{t:{for(A(M),y=n(f);y!==null&&!(y.expirationTime>M&&H());){var se=y.callback;if(typeof se=="function"){y.callback=null,x=y.priorityLevel;var ve=se(y.expirationTime<=M);if(M=e.unstable_now(),typeof ve=="function"){y.callback=ve,A(M),V=!0;break t}y===n(f)&&r(f),A(M)}else r(f);y=n(f)}if(y!==null)V=!0;else{var P=n(m);P!==null&&z(O,P.startTime-M),V=!1}}break e}finally{y=null,x=K,v=!1}V=void 0}}finally{V?q():I=!1}}}var q;if(typeof _=="function")q=function(){_(B)};else if(typeof MessageChannel<"u"){var Z=new MessageChannel,F=Z.port2;Z.port1.onmessage=B,q=function(){F.postMessage(null)}}else q=function(){R(B,0)};function z(M,V){T=R(function(){M(e.unstable_now())},V)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(M){M.callback=null},e.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<M?Math.floor(1e3/M):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(M){switch(x){case 1:case 2:case 3:var V=3;break;default:V=x}var K=x;x=V;try{return M()}finally{x=K}},e.unstable_requestPaint=function(){E=!0},e.unstable_runWithPriority=function(M,V){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var K=x;x=M;try{return V()}finally{x=K}},e.unstable_scheduleCallback=function(M,V,K){var se=e.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0<K?se+K:se):K=se,M){case 1:var ve=-1;break;case 2:ve=250;break;case 5:ve=1073741823;break;case 4:ve=1e4;break;default:ve=5e3}return ve=K+ve,M={id:g++,callback:V,priorityLevel:M,startTime:K,expirationTime:ve,sortIndex:-1},K>se?(M.sortIndex=K,t(m,M),n(f)===null&&M===n(m)&&(C?(j(T),T=-1):C=!0,z(O,K-se))):(M.sortIndex=ve,t(f,M),S||v||(S=!0,I||(I=!0,q()))),M},e.unstable_shouldYield=H,e.unstable_wrapCallback=function(M){var V=x;return function(){var K=x;x=V;try{return M.apply(this,arguments)}finally{x=K}}}})(i0)),i0}var rj;function Gk(){return rj||(rj=1,o0.exports=$k()),o0.exports}var l0={exports:{}},zr={};/**
|
|
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 aj;function Bk(){if(aj)return zr;aj=1;var e=Nb();function t(f){var m="https://react.dev/errors/"+f;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)m+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+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,g){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:y==null?null:""+y,children:f,containerInfo:m,implementation:g}}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 zr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,zr.createPortal=function(f,m){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(t(299));return i(f,m,null,g)},zr.flushSync=function(f){var m=c.T,g=r.p;try{if(c.T=null,r.p=2,f)return f()}finally{c.T=m,r.p=g,r.d.f()}},zr.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))},zr.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},zr.preinit=function(f,m){if(typeof f=="string"&&m&&typeof m.as=="string"){var g=m.as,y=u(g,m.crossOrigin),x=typeof m.integrity=="string"?m.integrity:void 0,v=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;g==="style"?r.d.S(f,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:y,integrity:x,fetchPriority:v}):g==="script"&&r.d.X(f,{crossOrigin:y,integrity:x,fetchPriority:v,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},zr.preinitModule=function(f,m){if(typeof f=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var g=u(m.as,m.crossOrigin);r.d.M(f,{crossOrigin:g,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&r.d.M(f)},zr.preload=function(f,m){if(typeof f=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var g=m.as,y=u(g,m.crossOrigin);r.d.L(f,g,{crossOrigin:y,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})}},zr.preloadModule=function(f,m){if(typeof f=="string")if(m){var g=u(m.as,m.crossOrigin);r.d.m(f,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:g,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else r.d.m(f)},zr.requestFormReset=function(f){r.d.r(f)},zr.unstable_batchedUpdates=function(f,m){return f(m)},zr.useFormState=function(f,m,g){return c.H.useFormState(f,m,g)},zr.useFormStatus=function(){return c.H.useHostTransitionStatus()},zr.version="19.2.0",zr}var sj;function EN(){if(sj)return l0.exports;sj=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(),l0.exports=Bk(),l0.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 oj;function qk(){if(oj)return of;oj=1;var e=Gk(),t=Nb(),n=EN();function r(o){var l="https://react.dev/errors/"+o;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)l+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+o+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function i(o){var l=o,d=o;if(o.alternate)for(;l.return;)l=l.return;else{o=l;do l=o,(l.flags&4098)!==0&&(d=l.return),o=l.return;while(o)}return l.tag===3?d:null}function c(o){if(o.tag===13){var l=o.memoizedState;if(l===null&&(o=o.alternate,o!==null&&(l=o.memoizedState)),l!==null)return l.dehydrated}return null}function u(o){if(o.tag===31){var l=o.memoizedState;if(l===null&&(o=o.alternate,o!==null&&(l=o.memoizedState)),l!==null)return l.dehydrated}return null}function f(o){if(i(o)!==o)throw Error(r(188))}function m(o){var l=o.alternate;if(!l){if(l=i(o),l===null)throw Error(r(188));return l!==o?null:o}for(var d=o,p=l;;){var b=d.return;if(b===null)break;var w=b.alternate;if(w===null){if(p=b.return,p!==null){d=p;continue}break}if(b.child===w.child){for(w=b.child;w;){if(w===d)return f(b),o;if(w===p)return f(b),l;w=w.sibling}throw Error(r(188))}if(d.return!==p.return)d=b,p=w;else{for(var N=!1,k=b.child;k;){if(k===d){N=!0,d=b,p=w;break}if(k===p){N=!0,p=b,d=w;break}k=k.sibling}if(!N){for(k=w.child;k;){if(k===d){N=!0,d=w,p=b;break}if(k===p){N=!0,p=w,d=b;break}k=k.sibling}if(!N)throw Error(r(189))}}if(d.alternate!==p)throw Error(r(190))}if(d.tag!==3)throw Error(r(188));return d.stateNode.current===d?o:l}function g(o){var l=o.tag;if(l===5||l===26||l===27||l===6)return o;for(o=o.child;o!==null;){if(l=g(o),l!==null)return l;o=o.sibling}return null}var y=Object.assign,x=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),j=Symbol.for("react.consumer"),_=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),L=Symbol.for("react.activity"),H=Symbol.for("react.memo_cache_sentinel"),B=Symbol.iterator;function q(o){return o===null||typeof o!="object"?null:(o=B&&o[B]||o["@@iterator"],typeof o=="function"?o:null)}var Z=Symbol.for("react.client.reference");function F(o){if(o==null)return null;if(typeof o=="function")return o.$$typeof===Z?null:o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case C:return"Fragment";case R:return"Profiler";case E:return"StrictMode";case O:return"Suspense";case I:return"SuspenseList";case L:return"Activity"}if(typeof o=="object")switch(o.$$typeof){case S:return"Portal";case _:return o.displayName||"Context";case j:return(o._context.displayName||"Context")+".Consumer";case A:var l=o.render;return o=o.displayName,o||(o=l.displayName||l.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case T:return l=o.displayName||null,l!==null?l:F(o.type)||"Memo";case D:l=o._payload,o=o._init;try{return F(o(l))}catch{}}return null}var z=Array.isArray,M=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K={pending:!1,data:null,method:null,action:null},se=[],ve=-1;function P(o){return{current:o}}function U(o){0>ve||(o.current=se[ve],se[ve]=null,ve--)}function $(o,l){ve++,se[ve]=o.current,o.current=l}var Q=P(null),ne=P(null),ue=P(null),J=P(null);function he(o,l){switch($(ue,l),$(ne,o),$(Q,null),l.nodeType){case 9:case 11:o=(o=l.documentElement)&&(o=o.namespaceURI)?SR(o):0;break;default:if(o=l.tagName,l=l.namespaceURI)l=SR(l),o=CR(l,o);else switch(o){case"svg":o=1;break;case"math":o=2;break;default:o=0}}U(Q),$(Q,o)}function ge(){U(Q),U(ne),U(ue)}function Ee(o){o.memoizedState!==null&&$(J,o);var l=Q.current,d=CR(l,o.type);l!==d&&($(ne,o),$(Q,d))}function Me(o){ne.current===o&&(U(Q),U(ne)),J.current===o&&(U(J),tf._currentValue=K)}var Fe,nt;function ut(o){if(Fe===void 0)try{throw Error()}catch(d){var l=d.stack.trim().match(/\n( *(at )?)/);Fe=l&&l[1]||"",nt=-1<d.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<d.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+Fe+o+nt}var Vt=!1;function xn(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 xe=function(){throw Error()};if(Object.defineProperty(xe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(xe,[])}catch(me){var ce=me}Reflect.construct(o,[],xe)}else{try{xe.call()}catch(me){ce=me}o.call(xe.prototype)}}else{try{throw Error()}catch(me){ce=me}(xe=o())&&typeof xe.catch=="function"&&xe.catch(function(){})}}catch(me){if(me&&ce&&typeof me.stack=="string")return[me.stack,ce.stack]}return[null,null]}};p.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var b=Object.getOwnPropertyDescriptor(p.DetermineComponentFrameRoot,"name");b&&b.configurable&&Object.defineProperty(p.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var w=p.DetermineComponentFrameRoot(),N=w[0],k=w[1];if(N&&k){var W=N.split(`
|
|
44
|
-
`),ie=k.split(`
|
|
45
|
-
`);for(b=p=0;p<W.length&&!W[p].includes("DetermineComponentFrameRoot");)p++;for(;b<ie.length&&!ie[b].includes("DetermineComponentFrameRoot");)b++;if(p===W.length||b===ie.length)for(p=W.length-1,b=ie.length-1;1<=p&&0<=b&&W[p]!==ie[b];)b--;for(;1<=p&&0<=b;p--,b--)if(W[p]!==ie[b]){if(p!==1||b!==1)do if(p--,b--,0>b||W[p]!==ie[b]){var pe=`
|
|
46
|
-
`+W[p].replace(" at new "," at ");return o.displayName&&pe.includes("<anonymous>")&&(pe=pe.replace("<anonymous>",o.displayName)),pe}while(1<=p&&0<=b);break}}}finally{Vt=!1,Error.prepareStackTrace=d}return(d=o?o.displayName||o.name:"")?ut(d):""}function er(o,l){switch(o.tag){case 26:case 27:case 5:return ut(o.type);case 16:return ut("Lazy");case 13:return o.child!==l&&l!==null?ut("Suspense Fallback"):ut("Suspense");case 19:return ut("SuspenseList");case 0:case 15:return xn(o.type,!1);case 11:return xn(o.type.render,!1);case 1:return xn(o.type,!0);case 31:return ut("Activity");default:return""}}function fn(o){try{var l="",d=null;do l+=er(o,d),d=o,o=o.return;while(o);return l}catch(p){return`
|
|
47
|
-
Error generating stack: `+p.message+`
|
|
48
|
-
`+p.stack}}var Pe=Object.prototype.hasOwnProperty,G=e.unstable_scheduleCallback,ee=e.unstable_cancelCallback,de=e.unstable_shouldYield,Ae=e.unstable_requestPaint,we=e.unstable_now,Te=e.unstable_getCurrentPriorityLevel,Ye=e.unstable_ImmediatePriority,it=e.unstable_UserBlockingPriority,lt=e.unstable_NormalPriority,Dn=e.unstable_LowPriority,Ka=e.unstable_IdlePriority,On=e.log,di=e.unstable_setDisableYieldValue,Zn=null,Un=null;function Er(o){if(typeof On=="function"&&di(o),Un&&typeof Un.setStrictMode=="function")try{Un.setStrictMode(Zn,o)}catch{}}var Fn=Math.clz32?Math.clz32:fi,Al=Math.log,Fs=Math.LN2;function fi(o){return o>>>=0,o===0?32:31-(Al(o)/Fs|0)|0}var yo=256,zs=262144,In=4194304;function _n(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 tr(o,l,d){var p=o.pendingLanes;if(p===0)return 0;var b=0,w=o.suspendedLanes,N=o.pingedLanes;o=o.warmLanes;var k=p&134217727;return k!==0?(p=k&~w,p!==0?b=_n(p):(N&=k,N!==0?b=_n(N):d||(d=k&~o,d!==0&&(b=_n(d))))):(k=p&~w,k!==0?b=_n(k):N!==0?b=_n(N):d||(d=p&~o,d!==0&&(b=_n(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 wr(o,l){return(o.pendingLanes&~(o.suspendedLanes&~o.pingedLanes)&l)===0}function cr(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 Yn(){var o=In;return In<<=1,(In&62914560)===0&&(In=4194304),o}function Rr(o){for(var l=[],d=0;31>d;d++)l.push(o);return l}function da(o,l){o.pendingLanes|=l,l!==268435456&&(o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0)}function Wn(o,l,d,p,b,w){var N=o.pendingLanes;o.pendingLanes=d,o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0,o.expiredLanes&=d,o.entangledLanes&=d,o.errorRecoveryDisabledLanes&=d,o.shellSuspendCounter=0;var k=o.entanglements,W=o.expirationTimes,ie=o.hiddenUpdates;for(d=N&~d;0<d;){var pe=31-Fn(d),xe=1<<pe;k[pe]=0,W[pe]=-1;var ce=ie[pe];if(ce!==null)for(ie[pe]=null,pe=0;pe<ce.length;pe++){var me=ce[pe];me!==null&&(me.lane&=-536870913)}d&=~xe}p!==0&&Y(o,p,0),w!==0&&b===0&&o.tag!==0&&(o.suspendedLanes|=w&~(N&~l))}function Y(o,l,d){o.pendingLanes|=l,o.suspendedLanes&=~l;var p=31-Fn(l);o.entangledLanes|=l,o.entanglements[p]=o.entanglements[p]|1073741824|d&261930}function te(o,l){var d=o.entangledLanes|=l;for(o=o.entanglements;d;){var p=31-Fn(d),b=1<<p;b&l|o[p]&l&&(o[p]|=l),d&=~b}}function le(o,l){var d=l&-l;return d=(d&42)!==0?1:Se(d),(d&(o.suspendedLanes|l))!==0?0:d}function Se(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 _e(o){return o&=-o,2<o?8<o?(o&134217727)!==0?32:268435456:8:2}function He(){var o=V.p;return o!==0?o:(o=window.event,o===void 0?32:BR(o.type))}function Be(o,l){var d=V.p;try{return V.p=o,l()}finally{V.p=d}}var ze=Math.random().toString(36).slice(2),Le="__reactFiber$"+ze,Ve="__reactProps$"+ze,et="__reactContainer$"+ze,Je="__reactEvents$"+ze,mt="__reactListeners$"+ze,hn="__reactHandles$"+ze,zn="__reactResources$"+ze,Nn="__reactMarker$"+ze;function sn(o){delete o[Le],delete o[Ve],delete o[Je],delete o[mt],delete o[hn]}function Qt(o){var l=o[Le];if(l)return l;for(var d=o.parentNode;d;){if(l=d[et]||d[Le]){if(d=l.alternate,l.child!==null||d!==null&&d.child!==null)for(o=NR(o);o!==null;){if(d=o[Le])return d;o=NR(o)}return l}o=d,d=o.parentNode}return null}function fa(o){if(o=o[Le]||o[et]){var l=o.tag;if(l===5||l===6||l===13||l===31||l===26||l===27||l===3)return o}return null}function fs(o){var l=o.tag;if(l===5||l===26||l===27||l===6)return o.stateNode;throw Error(r(33))}function Zr(o){var l=o[zn];return l||(l=o[zn]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function on(o){o[Nn]=!0}var Tc=new Set,hi={};function Yr(o,l){hs(o,l),hs(o+"Capture",l)}function hs(o,l){for(hi[o]=l,o=0;o<l.length;o++)Tc.add(l[o])}var _c=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]*$"),Ut={},ur={};function mi(o){return Pe.call(ur,o)?!0:Pe.call(Ut,o)?!1:_c.test(o)?ur[o]=!0:(Ut[o]=!0,!1)}function Za(o,l,d){if(mi(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 vn(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 ha(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 Wr(o){switch(typeof o){case"bigint":case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function Vh(o){var l=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function AM(o,l,d){var p=Object.getOwnPropertyDescriptor(o.constructor.prototype,l);if(!o.hasOwnProperty(l)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var b=p.get,w=p.set;return Object.defineProperty(o,l,{configurable:!0,get:function(){return b.call(this)},set:function(N){d=""+N,w.call(this,N)}}),Object.defineProperty(o,l,{enumerable:p.enumerable}),{getValue:function(){return d},setValue:function(N){d=""+N},stopTracking:function(){o._valueTracker=null,delete o[l]}}}}function Wy(o){if(!o._valueTracker){var l=Vh(o)?"checked":"value";o._valueTracker=AM(o,l,""+o[l])}}function m2(o){if(!o)return!1;var l=o._valueTracker;if(!l)return!0;var d=l.getValue(),p="";return o&&(p=Vh(o)?o.checked?"true":"false":o.value),o=p,o!==d?(l.setValue(o),!0):!1}function $h(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 DM=/[\n"\\]/g;function Ya(o){return o.replace(DM,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function Qy(o,l,d,p,b,w,N,k){o.name="",N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?o.type=N:o.removeAttribute("type"),l!=null?N==="number"?(l===0&&o.value===""||o.value!=l)&&(o.value=""+Wr(l)):o.value!==""+Wr(l)&&(o.value=""+Wr(l)):N!=="submit"&&N!=="reset"||o.removeAttribute("value"),l!=null?Xy(o,N,Wr(l)):d!=null?Xy(o,N,Wr(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=""+Wr(k):o.removeAttribute("name")}function p2(o,l,d,p,b,w,N,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)){Wy(o);return}d=d!=null?""+Wr(d):"",l=l!=null?""+Wr(l):d,k||l===o.value||(o.value=l),o.defaultValue=l}p=p??b,p=typeof p!="function"&&typeof p!="symbol"&&!!p,o.checked=k?o.checked:!!p,o.defaultChecked=!!p,N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"&&(o.name=N),Wy(o)}function Xy(o,l,d){l==="number"&&$h(o.ownerDocument)===o||o.defaultValue===""+d||(o.defaultValue=""+d)}function Nc(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=""+Wr(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 g2(o,l,d){if(l!=null&&(l=""+Wr(l),l!==o.value&&(o.value=l),d==null)){o.defaultValue!==l&&(o.defaultValue=l);return}o.defaultValue=d!=null?""+Wr(d):""}function y2(o,l,d,p){if(l==null){if(p!=null){if(d!=null)throw Error(r(92));if(z(p)){if(1<p.length)throw Error(r(93));p=p[0]}d=p}d==null&&(d=""),l=d}d=Wr(l),o.defaultValue=d,p=o.textContent,p===d&&p!==""&&p!==null&&(o.value=p),Wy(o)}function Ac(o,l){if(l){var d=o.firstChild;if(d&&d===o.lastChild&&d.nodeType===3){d.nodeValue=l;return}}o.textContent=l}var OM=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 x2(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||OM.has(l)?l==="float"?o.cssFloat=d:o[l]=(""+d).trim():o[l]=d+"px"}function v2(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&&x2(o,b,p)}else for(var w in l)l.hasOwnProperty(w)&&x2(o,w,l[w])}function Jy(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 IM=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"]]),MM=/^[\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 Gh(o){return MM.test(""+o)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":o}function xo(){}var ex=null;function tx(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var Dc=null,Oc=null;function b2(o){var l=fa(o);if(l&&(o=l.stateNode)){var d=o[Ve]||null;e:switch(o=l.stateNode,l.type){case"input":if(Qy(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="'+Ya(""+l)+'"][type="radio"]'),l=0;l<d.length;l++){var p=d[l];if(p!==o&&p.form===o.form){var b=p[Ve]||null;if(!b)throw Error(r(90));Qy(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&&m2(p)}break e;case"textarea":g2(o,d.value,d.defaultValue);break e;case"select":l=d.value,l!=null&&Nc(o,!!d.multiple,l,!1)}}}var nx=!1;function S2(o,l,d){if(nx)return o(l,d);nx=!0;try{var p=o(l);return p}finally{if(nx=!1,(Dc!==null||Oc!==null)&&(Dm(),Dc&&(l=Dc,o=Oc,Oc=Dc=null,b2(l),o)))for(l=0;l<o.length;l++)b2(o[l])}}function xd(o,l){var d=o.stateNode;if(d===null)return null;var p=d[Ve]||null;if(p===null)return null;d=p[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(p=!p.disabled)||(o=o.type,p=!(o==="button"||o==="input"||o==="select"||o==="textarea")),o=!p;break e;default:o=!1}if(o)return null;if(d&&typeof d!="function")throw Error(r(231,l,typeof d));return d}var vo=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),rx=!1;if(vo)try{var vd={};Object.defineProperty(vd,"passive",{get:function(){rx=!0}}),window.addEventListener("test",vd,vd),window.removeEventListener("test",vd,vd)}catch{rx=!1}var pi=null,ax=null,Bh=null;function C2(){if(Bh)return Bh;var o,l=ax,d=l.length,p,b="value"in pi?pi.value:pi.textContent,w=b.length;for(o=0;o<d&&l[o]===b[o];o++);var N=d-o;for(p=1;p<=N&&l[d-p]===b[w-p];p++);return Bh=b.slice(o,1<p?1-p:void 0)}function qh(o){var l=o.keyCode;return"charCode"in o?(o=o.charCode,o===0&&l===13&&(o=13)):o=l,o===10&&(o=13),32<=o||o===13?o:0}function Kh(){return!0}function E2(){return!1}function ma(o){function l(d,p,b,w,N){this._reactName=d,this._targetInst=b,this.type=p,this.nativeEvent=w,this.target=N,this.currentTarget=null;for(var 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)?Kh:E2,this.isPropagationStopped=E2,this}return y(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=Kh)},stopPropagation:function(){var d=this.nativeEvent;d&&(d.stopPropagation?d.stopPropagation():typeof d.cancelBubble!="unknown"&&(d.cancelBubble=!0),this.isPropagationStopped=Kh)},persist:function(){},isPersistent:Kh}),l}var Dl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Zh=ma(Dl),bd=y({},Dl,{view:0,detail:0}),kM=ma(bd),sx,ox,Sd,Yh=y({},bd,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:lx,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!==Sd&&(Sd&&o.type==="mousemove"?(sx=o.screenX-Sd.screenX,ox=o.screenY-Sd.screenY):ox=sx=0,Sd=o),sx)},movementY:function(o){return"movementY"in o?o.movementY:ox}}),w2=ma(Yh),LM=y({},Yh,{dataTransfer:0}),PM=ma(LM),UM=y({},bd,{relatedTarget:0}),ix=ma(UM),FM=y({},Dl,{animationName:0,elapsedTime:0,pseudoElement:0}),zM=ma(FM),HM=y({},Dl,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),VM=ma(HM),$M=y({},Dl,{data:0}),R2=ma($M),GM={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},BM={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"},qM={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function KM(o){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(o):(o=qM[o])?!!l[o]:!1}function lx(){return KM}var ZM=y({},bd,{key:function(o){if(o.key){var l=GM[o.key]||o.key;if(l!=="Unidentified")return l}return o.type==="keypress"?(o=qh(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?BM[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:lx,charCode:function(o){return o.type==="keypress"?qh(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?qh(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),YM=ma(ZM),WM=y({},Yh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),j2=ma(WM),QM=y({},bd,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:lx}),XM=ma(QM),JM=y({},Dl,{propertyName:0,elapsedTime:0,pseudoElement:0}),e8=ma(JM),t8=y({},Yh,{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}),n8=ma(t8),r8=y({},Dl,{newState:0,oldState:0}),a8=ma(r8),s8=[9,13,27,32],cx=vo&&"CompositionEvent"in window,Cd=null;vo&&"documentMode"in document&&(Cd=document.documentMode);var o8=vo&&"TextEvent"in window&&!Cd,T2=vo&&(!cx||Cd&&8<Cd&&11>=Cd),_2=" ",N2=!1;function A2(o,l){switch(o){case"keyup":return s8.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function D2(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var Ic=!1;function i8(o,l){switch(o){case"compositionend":return D2(l);case"keypress":return l.which!==32?null:(N2=!0,_2);case"textInput":return o=l.data,o===_2&&N2?null:o;default:return null}}function l8(o,l){if(Ic)return o==="compositionend"||!cx&&A2(o,l)?(o=C2(),Bh=ax=pi=null,Ic=!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 T2&&l.locale!=="ko"?null:l.data;default:return null}}var c8={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 O2(o){var l=o&&o.nodeName&&o.nodeName.toLowerCase();return l==="input"?!!c8[o.type]:l==="textarea"}function I2(o,l,d,p){Dc?Oc?Oc.push(p):Oc=[p]:Dc=p,l=Um(l,"onChange"),0<l.length&&(d=new Zh("onChange","change",null,d,p),o.push({event:d,listeners:l}))}var Ed=null,wd=null;function u8(o){pR(o,0)}function Wh(o){var l=fs(o);if(m2(l))return o}function M2(o,l){if(o==="change")return l}var k2=!1;if(vo){var ux;if(vo){var dx="oninput"in document;if(!dx){var L2=document.createElement("div");L2.setAttribute("oninput","return;"),dx=typeof L2.oninput=="function"}ux=dx}else ux=!1;k2=ux&&(!document.documentMode||9<document.documentMode)}function P2(){Ed&&(Ed.detachEvent("onpropertychange",U2),wd=Ed=null)}function U2(o){if(o.propertyName==="value"&&Wh(wd)){var l=[];I2(l,wd,o,tx(o)),S2(u8,l)}}function d8(o,l,d){o==="focusin"?(P2(),Ed=l,wd=d,Ed.attachEvent("onpropertychange",U2)):o==="focusout"&&P2()}function f8(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return Wh(wd)}function h8(o,l){if(o==="click")return Wh(l)}function m8(o,l){if(o==="input"||o==="change")return Wh(l)}function p8(o,l){return o===l&&(o!==0||1/o===1/l)||o!==o&&l!==l}var Ta=typeof Object.is=="function"?Object.is:p8;function Rd(o,l){if(Ta(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(!Pe.call(l,b)||!Ta(o[b],l[b]))return!1}return!0}function F2(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function z2(o,l){var d=F2(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=F2(d)}}function H2(o,l){return o&&l?o===l?!0:o&&o.nodeType===3?!1:l&&l.nodeType===3?H2(o,l.parentNode):"contains"in o?o.contains(l):o.compareDocumentPosition?!!(o.compareDocumentPosition(l)&16):!1:!1}function V2(o){o=o!=null&&o.ownerDocument!=null&&o.ownerDocument.defaultView!=null?o.ownerDocument.defaultView:window;for(var l=$h(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=$h(o.document)}return l}function fx(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 g8=vo&&"documentMode"in document&&11>=document.documentMode,Mc=null,hx=null,jd=null,mx=!1;function $2(o,l,d){var p=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;mx||Mc==null||Mc!==$h(p)||(p=Mc,"selectionStart"in p&&fx(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}),jd&&Rd(jd,p)||(jd=p,p=Um(hx,"onSelect"),0<p.length&&(l=new Zh("onSelect","select",null,l,d),o.push({event:l,listeners:p}),l.target=Mc)))}function Ol(o,l){var d={};return d[o.toLowerCase()]=l.toLowerCase(),d["Webkit"+o]="webkit"+l,d["Moz"+o]="moz"+l,d}var kc={animationend:Ol("Animation","AnimationEnd"),animationiteration:Ol("Animation","AnimationIteration"),animationstart:Ol("Animation","AnimationStart"),transitionrun:Ol("Transition","TransitionRun"),transitionstart:Ol("Transition","TransitionStart"),transitioncancel:Ol("Transition","TransitionCancel"),transitionend:Ol("Transition","TransitionEnd")},px={},G2={};vo&&(G2=document.createElement("div").style,"AnimationEvent"in window||(delete kc.animationend.animation,delete kc.animationiteration.animation,delete kc.animationstart.animation),"TransitionEvent"in window||delete kc.transitionend.transition);function Il(o){if(px[o])return px[o];if(!kc[o])return o;var l=kc[o],d;for(d in l)if(l.hasOwnProperty(d)&&d in G2)return px[o]=l[d];return o}var B2=Il("animationend"),q2=Il("animationiteration"),K2=Il("animationstart"),y8=Il("transitionrun"),x8=Il("transitionstart"),v8=Il("transitioncancel"),Z2=Il("transitionend"),Y2=new Map,gx="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(" ");gx.push("scrollEnd");function ms(o,l){Y2.set(o,l),Yr(l,[o])}var Qh=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)},Wa=[],Lc=0,yx=0;function Xh(){for(var o=Lc,l=yx=Lc=0;l<o;){var d=Wa[l];Wa[l++]=null;var p=Wa[l];Wa[l++]=null;var b=Wa[l];Wa[l++]=null;var w=Wa[l];if(Wa[l++]=null,p!==null&&b!==null){var N=p.pending;N===null?b.next=b:(b.next=N.next,N.next=b),p.pending=b}w!==0&&W2(d,b,w)}}function Jh(o,l,d,p){Wa[Lc++]=o,Wa[Lc++]=l,Wa[Lc++]=d,Wa[Lc++]=p,yx|=p,o.lanes|=p,o=o.alternate,o!==null&&(o.lanes|=p)}function xx(o,l,d,p){return Jh(o,l,d,p),em(o)}function Ml(o,l){return Jh(o,null,null,l),em(o)}function W2(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-Fn(d),o=w.hiddenUpdates,p=o[b],p===null?o[b]=[l]:p.push(l),l.lane=d|536870912),w):null}function em(o){if(50<Zd)throw Zd=0,Tv=null,Error(r(185));for(var l=o.return;l!==null;)o=l,l=o.return;return o.tag===3?o.stateNode:null}var Pc={};function b8(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 _a(o,l,d,p){return new b8(o,l,d,p)}function vx(o){return o=o.prototype,!(!o||!o.isReactComponent)}function bo(o,l){var d=o.alternate;return d===null?(d=_a(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 Q2(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 tm(o,l,d,p,b,w){var N=0;if(p=o,typeof o=="function")vx(o)&&(N=1);else if(typeof o=="string")N=Rk(o,d,Q.current)?26:o==="html"||o==="head"||o==="body"?27:5;else e:switch(o){case L:return o=_a(31,d,l,b),o.elementType=L,o.lanes=w,o;case C:return kl(d.children,b,w,l);case E:N=8,b|=24;break;case R:return o=_a(12,d,l,b|2),o.elementType=R,o.lanes=w,o;case O:return o=_a(13,d,l,b),o.elementType=O,o.lanes=w,o;case I:return o=_a(19,d,l,b),o.elementType=I,o.lanes=w,o;default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case _:N=10;break e;case j:N=9;break e;case A:N=11;break e;case T:N=14;break e;case D:N=16,p=null;break e}N=29,d=Error(r(130,o===null?"null":typeof o,"")),p=null}return l=_a(N,d,l,b),l.elementType=o,l.type=p,l.lanes=w,l}function kl(o,l,d,p){return o=_a(7,o,p,l),o.lanes=d,o}function bx(o,l,d){return o=_a(6,o,null,l),o.lanes=d,o}function X2(o){var l=_a(18,null,null,0);return l.stateNode=o,l}function Sx(o,l,d){return l=_a(4,o.children!==null?o.children:[],o.key,l),l.lanes=d,l.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},l}var J2=new WeakMap;function Qa(o,l){if(typeof o=="object"&&o!==null){var d=J2.get(o);return d!==void 0?d:(l={value:o,source:l,stack:fn(l)},J2.set(o,l),l)}return{value:o,source:l,stack:fn(l)}}var Uc=[],Fc=0,nm=null,Td=0,Xa=[],Ja=0,gi=null,Hs=1,Vs="";function So(o,l){Uc[Fc++]=Td,Uc[Fc++]=nm,nm=o,Td=l}function eE(o,l,d){Xa[Ja++]=Hs,Xa[Ja++]=Vs,Xa[Ja++]=gi,gi=o;var p=Hs;o=Vs;var b=32-Fn(p)-1;p&=~(1<<b),d+=1;var w=32-Fn(l)+b;if(30<w){var N=b-b%5;w=(p&(1<<N)-1).toString(32),p>>=N,b-=N,Hs=1<<32-Fn(l)+b|d<<b|p,Vs=w+o}else Hs=1<<w|d<<b|p,Vs=o}function Cx(o){o.return!==null&&(So(o,1),eE(o,1,0))}function Ex(o){for(;o===nm;)nm=Uc[--Fc],Uc[Fc]=null,Td=Uc[--Fc],Uc[Fc]=null;for(;o===gi;)gi=Xa[--Ja],Xa[Ja]=null,Vs=Xa[--Ja],Xa[Ja]=null,Hs=Xa[--Ja],Xa[Ja]=null}function tE(o,l){Xa[Ja++]=Hs,Xa[Ja++]=Vs,Xa[Ja++]=gi,Hs=l.id,Vs=l.overflow,gi=o}var jr=null,wn=null,$t=!1,yi=null,es=!1,wx=Error(r(519));function xi(o){var l=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw _d(Qa(l,o)),wx}function nE(o){var l=o.stateNode,d=o.type,p=o.memoizedProps;switch(l[Le]=o,l[Ve]=p,d){case"dialog":Pt("cancel",l),Pt("close",l);break;case"iframe":case"object":case"embed":Pt("load",l);break;case"video":case"audio":for(d=0;d<Wd.length;d++)Pt(Wd[d],l);break;case"source":Pt("error",l);break;case"img":case"image":case"link":Pt("error",l),Pt("load",l);break;case"details":Pt("toggle",l);break;case"input":Pt("invalid",l),p2(l,p.value,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name,!0);break;case"select":Pt("invalid",l);break;case"textarea":Pt("invalid",l),y2(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||vR(l.textContent,d)?(p.popover!=null&&(Pt("beforetoggle",l),Pt("toggle",l)),p.onScroll!=null&&Pt("scroll",l),p.onScrollEnd!=null&&Pt("scrollend",l),p.onClick!=null&&(l.onclick=xo),l=!0):l=!1,l||xi(o,!0)}function rE(o){for(jr=o.return;jr;)switch(jr.tag){case 5:case 31:case 13:es=!1;return;case 27:case 3:es=!0;return;default:jr=jr.return}}function zc(o){if(o!==jr)return!1;if(!$t)return rE(o),$t=!0,!1;var l=o.tag,d;if((d=l!==3&&l!==27)&&((d=l===5)&&(d=o.type,d=!(d!=="form"&&d!=="button")||Vv(o.type,o.memoizedProps)),d=!d),d&&wn&&xi(o),rE(o),l===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));wn=_R(o)}else if(l===31){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));wn=_R(o)}else l===27?(l=wn,Oi(o.type)?(o=Kv,Kv=null,wn=o):wn=l):wn=jr?ns(o.stateNode.nextSibling):null;return!0}function Ll(){wn=jr=null,$t=!1}function Rx(){var o=yi;return o!==null&&(xa===null?xa=o:xa.push.apply(xa,o),yi=null),o}function _d(o){yi===null?yi=[o]:yi.push(o)}var jx=P(null),Pl=null,Co=null;function vi(o,l,d){$(jx,l._currentValue),l._currentValue=d}function Eo(o){o._currentValue=jx.current,U(jx)}function Tx(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 _x(o,l,d,p){var b=o.child;for(b!==null&&(b.return=o);b!==null;){var w=b.dependencies;if(w!==null){var N=b.child;w=w.firstContext;e:for(;w!==null;){var k=w;w=b;for(var W=0;W<l.length;W++)if(k.context===l[W]){w.lanes|=d,k=w.alternate,k!==null&&(k.lanes|=d),Tx(w.return,d,o),p||(N=null);break e}w=k.next}}else if(b.tag===18){if(N=b.return,N===null)throw Error(r(341));N.lanes|=d,w=N.alternate,w!==null&&(w.lanes|=d),Tx(N,d,o),N=null}else N=b.child;if(N!==null)N.return=b;else for(N=b;N!==null;){if(N===o){N=null;break}if(b=N.sibling,b!==null){b.return=N.return,N=b;break}N=N.return}b=N}}function Hc(o,l,d,p){o=null;for(var b=l,w=!1;b!==null;){if(!w){if((b.flags&524288)!==0)w=!0;else if((b.flags&262144)!==0)break}if(b.tag===10){var N=b.alternate;if(N===null)throw Error(r(387));if(N=N.memoizedProps,N!==null){var k=b.type;Ta(b.pendingProps.value,N.value)||(o!==null?o.push(k):o=[k])}}else if(b===J.current){if(N=b.alternate,N===null)throw Error(r(387));N.memoizedState.memoizedState!==b.memoizedState.memoizedState&&(o!==null?o.push(tf):o=[tf])}b=b.return}o!==null&&_x(l,o,d,p),l.flags|=262144}function rm(o){for(o=o.firstContext;o!==null;){if(!Ta(o.context._currentValue,o.memoizedValue))return!0;o=o.next}return!1}function Ul(o){Pl=o,Co=null,o=o.dependencies,o!==null&&(o.firstContext=null)}function Tr(o){return aE(Pl,o)}function am(o,l){return Pl===null&&Ul(o),aE(o,l)}function aE(o,l){var d=l._currentValue;if(l={context:l,memoizedValue:d,next:null},Co===null){if(o===null)throw Error(r(308));Co=l,o.dependencies={lanes:0,firstContext:l},o.flags|=524288}else Co=Co.next=l;return d}var S8=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()})}},C8=e.unstable_scheduleCallback,E8=e.unstable_NormalPriority,nr={$$typeof:_,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Nx(){return{controller:new S8,data:new Map,refCount:0}}function Nd(o){o.refCount--,o.refCount===0&&C8(E8,function(){o.controller.abort()})}var Ad=null,Ax=0,Vc=0,$c=null;function w8(o,l){if(Ad===null){var d=Ad=[];Ax=0,Vc=Iv(),$c={status:"pending",value:void 0,then:function(p){d.push(p)}}}return Ax++,l.then(sE,sE),l}function sE(){if(--Ax===0&&Ad!==null){$c!==null&&($c.status="fulfilled");var o=Ad;Ad=null,Vc=0,$c=null;for(var l=0;l<o.length;l++)(0,o[l])()}}function R8(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 oE=M.S;M.S=function(o,l){$w=we(),typeof l=="object"&&l!==null&&typeof l.then=="function"&&w8(o,l),oE!==null&&oE(o,l)};var Fl=P(null);function Dx(){var o=Fl.current;return o!==null?o:bn.pooledCache}function sm(o,l){l===null?$(Fl,Fl.current):$(Fl,l.pool)}function iE(){var o=Dx();return o===null?null:{parent:nr._currentValue,pool:o}}var Gc=Error(r(460)),Ox=Error(r(474)),om=Error(r(542)),im={then:function(){}};function lE(o){return o=o.status,o==="fulfilled"||o==="rejected"}function cE(o,l,d){switch(d=o[d],d===void 0?o.push(l):d!==l&&(l.then(xo,xo),l=d),l.status){case"fulfilled":return l.value;case"rejected":throw o=l.reason,dE(o),o;default:if(typeof l.status=="string")l.then(xo,xo);else{if(o=bn,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,dE(o),o}throw Hl=l,Gc}}function zl(o){try{var l=o._init;return l(o._payload)}catch(d){throw d!==null&&typeof d=="object"&&typeof d.then=="function"?(Hl=d,Gc):d}}var Hl=null;function uE(){if(Hl===null)throw Error(r(459));var o=Hl;return Hl=null,o}function dE(o){if(o===Gc||o===om)throw Error(r(483))}var Bc=null,Dd=0;function lm(o){var l=Dd;return Dd+=1,Bc===null&&(Bc=[]),cE(Bc,o,l)}function Od(o,l){l=l.props.ref,o.ref=l!==void 0?l:null}function cm(o,l){throw l.$$typeof===x?Error(r(525)):(o=Object.prototype.toString.call(l),Error(r(31,o==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":o)))}function fE(o){function l(ae,X){if(o){var oe=ae.deletions;oe===null?(ae.deletions=[X],ae.flags|=16):oe.push(X)}}function d(ae,X){if(!o)return null;for(;X!==null;)l(ae,X),X=X.sibling;return null}function p(ae){for(var X=new Map;ae!==null;)ae.key!==null?X.set(ae.key,ae):X.set(ae.index,ae),ae=ae.sibling;return X}function b(ae,X){return ae=bo(ae,X),ae.index=0,ae.sibling=null,ae}function w(ae,X,oe){return ae.index=oe,o?(oe=ae.alternate,oe!==null?(oe=oe.index,oe<X?(ae.flags|=67108866,X):oe):(ae.flags|=67108866,X)):(ae.flags|=1048576,X)}function N(ae){return o&&ae.alternate===null&&(ae.flags|=67108866),ae}function k(ae,X,oe,ye){return X===null||X.tag!==6?(X=bx(oe,ae.mode,ye),X.return=ae,X):(X=b(X,oe),X.return=ae,X)}function W(ae,X,oe,ye){var tt=oe.type;return tt===C?pe(ae,X,oe.props.children,ye,oe.key):X!==null&&(X.elementType===tt||typeof tt=="object"&&tt!==null&&tt.$$typeof===D&&zl(tt)===X.type)?(X=b(X,oe.props),Od(X,oe),X.return=ae,X):(X=tm(oe.type,oe.key,oe.props,null,ae.mode,ye),Od(X,oe),X.return=ae,X)}function ie(ae,X,oe,ye){return X===null||X.tag!==4||X.stateNode.containerInfo!==oe.containerInfo||X.stateNode.implementation!==oe.implementation?(X=Sx(oe,ae.mode,ye),X.return=ae,X):(X=b(X,oe.children||[]),X.return=ae,X)}function pe(ae,X,oe,ye,tt){return X===null||X.tag!==7?(X=kl(oe,ae.mode,ye,tt),X.return=ae,X):(X=b(X,oe),X.return=ae,X)}function xe(ae,X,oe){if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return X=bx(""+X,ae.mode,oe),X.return=ae,X;if(typeof X=="object"&&X!==null){switch(X.$$typeof){case v:return oe=tm(X.type,X.key,X.props,null,ae.mode,oe),Od(oe,X),oe.return=ae,oe;case S:return X=Sx(X,ae.mode,oe),X.return=ae,X;case D:return X=zl(X),xe(ae,X,oe)}if(z(X)||q(X))return X=kl(X,ae.mode,oe,null),X.return=ae,X;if(typeof X.then=="function")return xe(ae,lm(X),oe);if(X.$$typeof===_)return xe(ae,am(ae,X),oe);cm(ae,X)}return null}function ce(ae,X,oe,ye){var tt=X!==null?X.key:null;if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return tt!==null?null:k(ae,X,""+oe,ye);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case v:return oe.key===tt?W(ae,X,oe,ye):null;case S:return oe.key===tt?ie(ae,X,oe,ye):null;case D:return oe=zl(oe),ce(ae,X,oe,ye)}if(z(oe)||q(oe))return tt!==null?null:pe(ae,X,oe,ye,null);if(typeof oe.then=="function")return ce(ae,X,lm(oe),ye);if(oe.$$typeof===_)return ce(ae,X,am(ae,oe),ye);cm(ae,oe)}return null}function me(ae,X,oe,ye,tt){if(typeof ye=="string"&&ye!==""||typeof ye=="number"||typeof ye=="bigint")return ae=ae.get(oe)||null,k(X,ae,""+ye,tt);if(typeof ye=="object"&&ye!==null){switch(ye.$$typeof){case v:return ae=ae.get(ye.key===null?oe:ye.key)||null,W(X,ae,ye,tt);case S:return ae=ae.get(ye.key===null?oe:ye.key)||null,ie(X,ae,ye,tt);case D:return ye=zl(ye),me(ae,X,oe,ye,tt)}if(z(ye)||q(ye))return ae=ae.get(oe)||null,pe(X,ae,ye,tt,null);if(typeof ye.then=="function")return me(ae,X,oe,lm(ye),tt);if(ye.$$typeof===_)return me(ae,X,oe,am(X,ye),tt);cm(X,ye)}return null}function qe(ae,X,oe,ye){for(var tt=null,Xt=null,We=X,Ct=X=0,zt=null;We!==null&&Ct<oe.length;Ct++){We.index>Ct?(zt=We,We=null):zt=We.sibling;var Jt=ce(ae,We,oe[Ct],ye);if(Jt===null){We===null&&(We=zt);break}o&&We&&Jt.alternate===null&&l(ae,We),X=w(Jt,X,Ct),Xt===null?tt=Jt:Xt.sibling=Jt,Xt=Jt,We=zt}if(Ct===oe.length)return d(ae,We),$t&&So(ae,Ct),tt;if(We===null){for(;Ct<oe.length;Ct++)We=xe(ae,oe[Ct],ye),We!==null&&(X=w(We,X,Ct),Xt===null?tt=We:Xt.sibling=We,Xt=We);return $t&&So(ae,Ct),tt}for(We=p(We);Ct<oe.length;Ct++)zt=me(We,ae,Ct,oe[Ct],ye),zt!==null&&(o&&zt.alternate!==null&&We.delete(zt.key===null?Ct:zt.key),X=w(zt,X,Ct),Xt===null?tt=zt:Xt.sibling=zt,Xt=zt);return o&&We.forEach(function(Pi){return l(ae,Pi)}),$t&&So(ae,Ct),tt}function rt(ae,X,oe,ye){if(oe==null)throw Error(r(151));for(var tt=null,Xt=null,We=X,Ct=X=0,zt=null,Jt=oe.next();We!==null&&!Jt.done;Ct++,Jt=oe.next()){We.index>Ct?(zt=We,We=null):zt=We.sibling;var Pi=ce(ae,We,Jt.value,ye);if(Pi===null){We===null&&(We=zt);break}o&&We&&Pi.alternate===null&&l(ae,We),X=w(Pi,X,Ct),Xt===null?tt=Pi:Xt.sibling=Pi,Xt=Pi,We=zt}if(Jt.done)return d(ae,We),$t&&So(ae,Ct),tt;if(We===null){for(;!Jt.done;Ct++,Jt=oe.next())Jt=xe(ae,Jt.value,ye),Jt!==null&&(X=w(Jt,X,Ct),Xt===null?tt=Jt:Xt.sibling=Jt,Xt=Jt);return $t&&So(ae,Ct),tt}for(We=p(We);!Jt.done;Ct++,Jt=oe.next())Jt=me(We,ae,Ct,Jt.value,ye),Jt!==null&&(o&&Jt.alternate!==null&&We.delete(Jt.key===null?Ct:Jt.key),X=w(Jt,X,Ct),Xt===null?tt=Jt:Xt.sibling=Jt,Xt=Jt);return o&&We.forEach(function(Lk){return l(ae,Lk)}),$t&&So(ae,Ct),tt}function gn(ae,X,oe,ye){if(typeof oe=="object"&&oe!==null&&oe.type===C&&oe.key===null&&(oe=oe.props.children),typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case v:e:{for(var tt=oe.key;X!==null;){if(X.key===tt){if(tt=oe.type,tt===C){if(X.tag===7){d(ae,X.sibling),ye=b(X,oe.props.children),ye.return=ae,ae=ye;break e}}else if(X.elementType===tt||typeof tt=="object"&&tt!==null&&tt.$$typeof===D&&zl(tt)===X.type){d(ae,X.sibling),ye=b(X,oe.props),Od(ye,oe),ye.return=ae,ae=ye;break e}d(ae,X);break}else l(ae,X);X=X.sibling}oe.type===C?(ye=kl(oe.props.children,ae.mode,ye,oe.key),ye.return=ae,ae=ye):(ye=tm(oe.type,oe.key,oe.props,null,ae.mode,ye),Od(ye,oe),ye.return=ae,ae=ye)}return N(ae);case S:e:{for(tt=oe.key;X!==null;){if(X.key===tt)if(X.tag===4&&X.stateNode.containerInfo===oe.containerInfo&&X.stateNode.implementation===oe.implementation){d(ae,X.sibling),ye=b(X,oe.children||[]),ye.return=ae,ae=ye;break e}else{d(ae,X);break}else l(ae,X);X=X.sibling}ye=Sx(oe,ae.mode,ye),ye.return=ae,ae=ye}return N(ae);case D:return oe=zl(oe),gn(ae,X,oe,ye)}if(z(oe))return qe(ae,X,oe,ye);if(q(oe)){if(tt=q(oe),typeof tt!="function")throw Error(r(150));return oe=tt.call(oe),rt(ae,X,oe,ye)}if(typeof oe.then=="function")return gn(ae,X,lm(oe),ye);if(oe.$$typeof===_)return gn(ae,X,am(ae,oe),ye);cm(ae,oe)}return typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint"?(oe=""+oe,X!==null&&X.tag===6?(d(ae,X.sibling),ye=b(X,oe),ye.return=ae,ae=ye):(d(ae,X),ye=bx(oe,ae.mode,ye),ye.return=ae,ae=ye),N(ae)):d(ae,X)}return function(ae,X,oe,ye){try{Dd=0;var tt=gn(ae,X,oe,ye);return Bc=null,tt}catch(We){if(We===Gc||We===om)throw We;var Xt=_a(29,We,null,ae.mode);return Xt.lanes=ye,Xt.return=ae,Xt}finally{}}}var Vl=fE(!0),hE=fE(!1),bi=!1;function Ix(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Mx(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 Si(o){return{lane:o,tag:0,payload:null,callback:null,next:null}}function Ci(o,l,d){var p=o.updateQueue;if(p===null)return null;if(p=p.shared,(tn&2)!==0){var b=p.pending;return b===null?l.next=l:(l.next=b.next,b.next=l),p.pending=l,l=em(o),W2(o,null,d),l}return Jh(o,p,l,d),em(o)}function Id(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,te(o,d)}}function kx(o,l){var d=o.updateQueue,p=o.alternate;if(p!==null&&(p=p.updateQueue,d===p)){var b=null,w=null;if(d=d.firstBaseUpdate,d!==null){do{var N={lane:d.lane,tag:d.tag,payload:d.payload,callback:null,next:null};w===null?b=w=N:w=w.next=N,d=d.next}while(d!==null);w===null?b=w=l:w=w.next=l}else b=w=l;d={baseState:p.baseState,firstBaseUpdate:b,lastBaseUpdate:w,shared:p.shared,callbacks:p.callbacks},o.updateQueue=d;return}o=d.lastBaseUpdate,o===null?d.firstBaseUpdate=l:o.next=l,d.lastBaseUpdate=l}var Lx=!1;function Md(){if(Lx){var o=$c;if(o!==null)throw o}}function kd(o,l,d,p){Lx=!1;var b=o.updateQueue;bi=!1;var w=b.firstBaseUpdate,N=b.lastBaseUpdate,k=b.shared.pending;if(k!==null){b.shared.pending=null;var W=k,ie=W.next;W.next=null,N===null?w=ie:N.next=ie,N=W;var pe=o.alternate;pe!==null&&(pe=pe.updateQueue,k=pe.lastBaseUpdate,k!==N&&(k===null?pe.firstBaseUpdate=ie:k.next=ie,pe.lastBaseUpdate=W))}if(w!==null){var xe=b.baseState;N=0,pe=ie=W=null,k=w;do{var ce=k.lane&-536870913,me=ce!==k.lane;if(me?(Ft&ce)===ce:(p&ce)===ce){ce!==0&&ce===Vc&&(Lx=!0),pe!==null&&(pe=pe.next={lane:0,tag:k.tag,payload:k.payload,callback:null,next:null});e:{var qe=o,rt=k;ce=l;var gn=d;switch(rt.tag){case 1:if(qe=rt.payload,typeof qe=="function"){xe=qe.call(gn,xe,ce);break e}xe=qe;break e;case 3:qe.flags=qe.flags&-65537|128;case 0:if(qe=rt.payload,ce=typeof qe=="function"?qe.call(gn,xe,ce):qe,ce==null)break e;xe=y({},xe,ce);break e;case 2:bi=!0}}ce=k.callback,ce!==null&&(o.flags|=64,me&&(o.flags|=8192),me=b.callbacks,me===null?b.callbacks=[ce]:me.push(ce))}else me={lane:ce,tag:k.tag,payload:k.payload,callback:k.callback,next:null},pe===null?(ie=pe=me,W=xe):pe=pe.next=me,N|=ce;if(k=k.next,k===null){if(k=b.shared.pending,k===null)break;me=k,k=me.next,me.next=null,b.lastBaseUpdate=me,b.shared.pending=null}}while(!0);pe===null&&(W=xe),b.baseState=W,b.firstBaseUpdate=ie,b.lastBaseUpdate=pe,w===null&&(b.shared.lanes=0),Ti|=N,o.lanes=N,o.memoizedState=xe}}function mE(o,l){if(typeof o!="function")throw Error(r(191,o));o.call(l)}function pE(o,l){var d=o.callbacks;if(d!==null)for(o.callbacks=null,o=0;o<d.length;o++)mE(d[o],l)}var qc=P(null),um=P(0);function gE(o,l){o=Oo,$(um,o),$(qc,l),Oo=o|l.baseLanes}function Px(){$(um,Oo),$(qc,qc.current)}function Ux(){Oo=um.current,U(qc),U(um)}var Na=P(null),ts=null;function Ei(o){var l=o.alternate;$(Qn,Qn.current&1),$(Na,o),ts===null&&(l===null||qc.current!==null||l.memoizedState!==null)&&(ts=o)}function Fx(o){$(Qn,Qn.current),$(Na,o),ts===null&&(ts=o)}function yE(o){o.tag===22?($(Qn,Qn.current),$(Na,o),ts===null&&(ts=o)):wi()}function wi(){$(Qn,Qn.current),$(Na,Na.current)}function Aa(o){U(Na),ts===o&&(ts=null),U(Qn)}var Qn=P(0);function dm(o){for(var l=o;l!==null;){if(l.tag===13){var d=l.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||Bv(d)||qv(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 wo=0,xt=null,mn=null,rr=null,fm=!1,Kc=!1,$l=!1,hm=0,Ld=0,Zc=null,j8=0;function Hn(){throw Error(r(321))}function zx(o,l){if(l===null)return!1;for(var d=0;d<l.length&&d<o.length;d++)if(!Ta(o[d],l[d]))return!1;return!0}function Hx(o,l,d,p,b,w){return wo=w,xt=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,M.H=o===null||o.memoizedState===null?ew:nv,$l=!1,w=d(p,b),$l=!1,Kc&&(w=vE(l,d,p,b)),xE(o),w}function xE(o){M.H=Fd;var l=mn!==null&&mn.next!==null;if(wo=0,rr=mn=xt=null,fm=!1,Ld=0,Zc=null,l)throw Error(r(300));o===null||ar||(o=o.dependencies,o!==null&&rm(o)&&(ar=!0))}function vE(o,l,d,p){xt=o;var b=0;do{if(Kc&&(Zc=null),Ld=0,Kc=!1,25<=b)throw Error(r(301));if(b+=1,rr=mn=null,o.updateQueue!=null){var w=o.updateQueue;w.lastEffect=null,w.events=null,w.stores=null,w.memoCache!=null&&(w.memoCache.index=0)}M.H=tw,w=l(d,p)}while(Kc);return w}function T8(){var o=M.H,l=o.useState()[0];return l=typeof l.then=="function"?Pd(l):l,o=o.useState()[0],(mn!==null?mn.memoizedState:null)!==o&&(xt.flags|=1024),l}function Vx(){var o=hm!==0;return hm=0,o}function $x(o,l,d){l.updateQueue=o.updateQueue,l.flags&=-2053,o.lanes&=~d}function Gx(o){if(fm){for(o=o.memoizedState;o!==null;){var l=o.queue;l!==null&&(l.pending=null),o=o.next}fm=!1}wo=0,rr=mn=xt=null,Kc=!1,Ld=hm=0,Zc=null}function Qr(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return rr===null?xt.memoizedState=rr=o:rr=rr.next=o,rr}function Xn(){if(mn===null){var o=xt.alternate;o=o!==null?o.memoizedState:null}else o=mn.next;var l=rr===null?xt.memoizedState:rr.next;if(l!==null)rr=l,mn=o;else{if(o===null)throw xt.alternate===null?Error(r(467)):Error(r(310));mn=o,o={memoizedState:mn.memoizedState,baseState:mn.baseState,baseQueue:mn.baseQueue,queue:mn.queue,next:null},rr===null?xt.memoizedState=rr=o:rr=rr.next=o}return rr}function mm(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Pd(o){var l=Ld;return Ld+=1,Zc===null&&(Zc=[]),o=cE(Zc,o,l),l=xt,(rr===null?l.memoizedState:rr.next)===null&&(l=l.alternate,M.H=l===null||l.memoizedState===null?ew:nv),o}function pm(o){if(o!==null&&typeof o=="object"){if(typeof o.then=="function")return Pd(o);if(o.$$typeof===_)return Tr(o)}throw Error(r(438,String(o)))}function Bx(o){var l=null,d=xt.updateQueue;if(d!==null&&(l=d.memoCache),l==null){var p=xt.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=mm(),xt.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 Ro(o,l){return typeof l=="function"?l(o):l}function gm(o){var l=Xn();return qx(l,mn,o)}function qx(o,l,d){var p=o.queue;if(p===null)throw Error(r(311));p.lastRenderedReducer=d;var b=o.baseQueue,w=p.pending;if(w!==null){if(b!==null){var N=b.next;b.next=w.next,w.next=N}l.baseQueue=b=w,p.pending=null}if(w=o.baseState,b===null)o.memoizedState=w;else{l=b.next;var k=N=null,W=null,ie=l,pe=!1;do{var xe=ie.lane&-536870913;if(xe!==ie.lane?(Ft&xe)===xe:(wo&xe)===xe){var ce=ie.revertLane;if(ce===0)W!==null&&(W=W.next={lane:0,revertLane:0,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null}),xe===Vc&&(pe=!0);else if((wo&ce)===ce){ie=ie.next,ce===Vc&&(pe=!0);continue}else xe={lane:0,revertLane:ie.revertLane,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},W===null?(k=W=xe,N=w):W=W.next=xe,xt.lanes|=ce,Ti|=ce;xe=ie.action,$l&&d(w,xe),w=ie.hasEagerState?ie.eagerState:d(w,xe)}else ce={lane:xe,revertLane:ie.revertLane,gesture:ie.gesture,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},W===null?(k=W=ce,N=w):W=W.next=ce,xt.lanes|=xe,Ti|=xe;ie=ie.next}while(ie!==null&&ie!==l);if(W===null?N=w:W.next=k,!Ta(w,o.memoizedState)&&(ar=!0,pe&&(d=$c,d!==null)))throw d;o.memoizedState=w,o.baseState=N,o.baseQueue=W,p.lastRenderedState=w}return b===null&&(p.lanes=0),[o.memoizedState,p.dispatch]}function Kx(o){var l=Xn(),d=l.queue;if(d===null)throw Error(r(311));d.lastRenderedReducer=o;var p=d.dispatch,b=d.pending,w=l.memoizedState;if(b!==null){d.pending=null;var N=b=b.next;do w=o(w,N.action),N=N.next;while(N!==b);Ta(w,l.memoizedState)||(ar=!0),l.memoizedState=w,l.baseQueue===null&&(l.baseState=w),d.lastRenderedState=w}return[w,p]}function bE(o,l,d){var p=xt,b=Xn(),w=$t;if(w){if(d===void 0)throw Error(r(407));d=d()}else d=l();var N=!Ta((mn||b).memoizedState,d);if(N&&(b.memoizedState=d,ar=!0),b=b.queue,Wx(EE.bind(null,p,b,o),[o]),b.getSnapshot!==l||N||rr!==null&&rr.memoizedState.tag&1){if(p.flags|=2048,Yc(9,{destroy:void 0},CE.bind(null,p,b,d,l),null),bn===null)throw Error(r(349));w||(wo&127)!==0||SE(p,l,d)}return d}function SE(o,l,d){o.flags|=16384,o={getSnapshot:l,value:d},l=xt.updateQueue,l===null?(l=mm(),xt.updateQueue=l,l.stores=[o]):(d=l.stores,d===null?l.stores=[o]:d.push(o))}function CE(o,l,d,p){l.value=d,l.getSnapshot=p,wE(l)&&RE(o)}function EE(o,l,d){return d(function(){wE(l)&&RE(o)})}function wE(o){var l=o.getSnapshot;o=o.value;try{var d=l();return!Ta(o,d)}catch{return!0}}function RE(o){var l=Ml(o,2);l!==null&&va(l,o,2)}function Zx(o){var l=Qr();if(typeof o=="function"){var d=o;if(o=d(),$l){Er(!0);try{d()}finally{Er(!1)}}}return l.memoizedState=l.baseState=o,l.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ro,lastRenderedState:o},l}function jE(o,l,d,p){return o.baseState=d,qx(o,mn,typeof p=="function"?p:Ro)}function _8(o,l,d,p,b){if(vm(o))throw Error(r(485));if(o=l.action,o!==null){var w={payload:b,action:o,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(N){w.listeners.push(N)}};M.T!==null?d(!0):w.isTransition=!1,p(w),d=l.pending,d===null?(w.next=l.pending=w,TE(l,w)):(w.next=d.next,l.pending=d.next=w)}}function TE(o,l){var d=l.action,p=l.payload,b=o.state;if(l.isTransition){var w=M.T,N={};M.T=N;try{var k=d(b,p),W=M.S;W!==null&&W(N,k),_E(o,l,k)}catch(ie){Yx(o,l,ie)}finally{w!==null&&N.types!==null&&(w.types=N.types),M.T=w}}else try{w=d(b,p),_E(o,l,w)}catch(ie){Yx(o,l,ie)}}function _E(o,l,d){d!==null&&typeof d=="object"&&typeof d.then=="function"?d.then(function(p){NE(o,l,p)},function(p){return Yx(o,l,p)}):NE(o,l,d)}function NE(o,l,d){l.status="fulfilled",l.value=d,AE(l),o.state=d,l=o.pending,l!==null&&(d=l.next,d===l?o.pending=null:(d=d.next,l.next=d,TE(o,d)))}function Yx(o,l,d){var p=o.pending;if(o.pending=null,p!==null){p=p.next;do l.status="rejected",l.reason=d,AE(l),l=l.next;while(l!==p)}o.action=null}function AE(o){o=o.listeners;for(var l=0;l<o.length;l++)(0,o[l])()}function DE(o,l){return l}function OE(o,l){if($t){var d=bn.formState;if(d!==null){e:{var p=xt;if($t){if(wn){t:{for(var b=wn,w=es;b.nodeType!==8;){if(!w){b=null;break t}if(b=ns(b.nextSibling),b===null){b=null;break t}}w=b.data,b=w==="F!"||w==="F"?b:null}if(b){wn=ns(b.nextSibling),p=b.data==="F!";break e}}xi(p)}p=!1}p&&(l=d[0])}}return d=Qr(),d.memoizedState=d.baseState=l,p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:DE,lastRenderedState:l},d.queue=p,d=QE.bind(null,xt,p),p.dispatch=d,p=Zx(!1),w=tv.bind(null,xt,!1,p.queue),p=Qr(),b={state:l,dispatch:null,action:o,pending:null},p.queue=b,d=_8.bind(null,xt,b,w,d),b.dispatch=d,p.memoizedState=o,[l,d,!1]}function IE(o){var l=Xn();return ME(l,mn,o)}function ME(o,l,d){if(l=qx(o,l,DE)[0],o=gm(Ro)[0],typeof l=="object"&&l!==null&&typeof l.then=="function")try{var p=Pd(l)}catch(N){throw N===Gc?om:N}else p=l;l=Xn();var b=l.queue,w=b.dispatch;return d!==l.memoizedState&&(xt.flags|=2048,Yc(9,{destroy:void 0},N8.bind(null,b,d),null)),[p,w,o]}function N8(o,l){o.action=l}function kE(o){var l=Xn(),d=mn;if(d!==null)return ME(l,d,o);Xn(),l=l.memoizedState,d=Xn();var p=d.queue.dispatch;return d.memoizedState=o,[l,p,!1]}function Yc(o,l,d,p){return o={tag:o,create:d,deps:p,inst:l,next:null},l=xt.updateQueue,l===null&&(l=mm(),xt.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 LE(){return Xn().memoizedState}function ym(o,l,d,p){var b=Qr();xt.flags|=o,b.memoizedState=Yc(1|l,{destroy:void 0},d,p===void 0?null:p)}function xm(o,l,d,p){var b=Xn();p=p===void 0?null:p;var w=b.memoizedState.inst;mn!==null&&p!==null&&zx(p,mn.memoizedState.deps)?b.memoizedState=Yc(l,w,d,p):(xt.flags|=o,b.memoizedState=Yc(1|l,w,d,p))}function PE(o,l){ym(8390656,8,o,l)}function Wx(o,l){xm(2048,8,o,l)}function A8(o){xt.flags|=4;var l=xt.updateQueue;if(l===null)l=mm(),xt.updateQueue=l,l.events=[o];else{var d=l.events;d===null?l.events=[o]:d.push(o)}}function UE(o){var l=Xn().memoizedState;return A8({ref:l,nextImpl:o}),function(){if((tn&2)!==0)throw Error(r(440));return l.impl.apply(void 0,arguments)}}function FE(o,l){return xm(4,2,o,l)}function zE(o,l){return xm(4,4,o,l)}function HE(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 VE(o,l,d){d=d!=null?d.concat([o]):null,xm(4,4,HE.bind(null,l,o),d)}function Qx(){}function $E(o,l){var d=Xn();l=l===void 0?null:l;var p=d.memoizedState;return l!==null&&zx(l,p[1])?p[0]:(d.memoizedState=[o,l],o)}function GE(o,l){var d=Xn();l=l===void 0?null:l;var p=d.memoizedState;if(l!==null&&zx(l,p[1]))return p[0];if(p=o(),$l){Er(!0);try{o()}finally{Er(!1)}}return d.memoizedState=[p,l],p}function Xx(o,l,d){return d===void 0||(wo&1073741824)!==0&&(Ft&261930)===0?o.memoizedState=l:(o.memoizedState=d,o=Bw(),xt.lanes|=o,Ti|=o,d)}function BE(o,l,d,p){return Ta(d,l)?d:qc.current!==null?(o=Xx(o,d,p),Ta(o,l)||(ar=!0),o):(wo&42)===0||(wo&1073741824)!==0&&(Ft&261930)===0?(ar=!0,o.memoizedState=d):(o=Bw(),xt.lanes|=o,Ti|=o,l)}function qE(o,l,d,p,b){var w=V.p;V.p=w!==0&&8>w?w:8;var N=M.T,k={};M.T=k,tv(o,!1,l,d);try{var W=b(),ie=M.S;if(ie!==null&&ie(k,W),W!==null&&typeof W=="object"&&typeof W.then=="function"){var pe=R8(W,p);Ud(o,l,pe,Ia(o))}else Ud(o,l,p,Ia(o))}catch(xe){Ud(o,l,{then:function(){},status:"rejected",reason:xe},Ia())}finally{V.p=w,N!==null&&k.types!==null&&(N.types=k.types),M.T=N}}function D8(){}function Jx(o,l,d,p){if(o.tag!==5)throw Error(r(476));var b=KE(o).queue;qE(o,b,l,K,d===null?D8:function(){return ZE(o),d(p)})}function KE(o){var l=o.memoizedState;if(l!==null)return l;l={memoizedState:K,baseState:K,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ro,lastRenderedState:K},next:null};var d={};return l.next={memoizedState:d,baseState:d,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ro,lastRenderedState:d},next:null},o.memoizedState=l,o=o.alternate,o!==null&&(o.memoizedState=l),l}function ZE(o){var l=KE(o);l.next===null&&(l=o.alternate.memoizedState),Ud(o,l.next.queue,{},Ia())}function ev(){return Tr(tf)}function YE(){return Xn().memoizedState}function WE(){return Xn().memoizedState}function O8(o){for(var l=o.return;l!==null;){switch(l.tag){case 24:case 3:var d=Ia();o=Si(d);var p=Ci(l,o,d);p!==null&&(va(p,l,d),Id(p,l,d)),l={cache:Nx()},o.payload=l;return}l=l.return}}function I8(o,l,d){var p=Ia();d={lane:p,revertLane:0,gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},vm(o)?XE(l,d):(d=xx(o,l,d,p),d!==null&&(va(d,o,p),JE(d,l,p)))}function QE(o,l,d){var p=Ia();Ud(o,l,d,p)}function Ud(o,l,d,p){var b={lane:p,revertLane:0,gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null};if(vm(o))XE(l,b);else{var w=o.alternate;if(o.lanes===0&&(w===null||w.lanes===0)&&(w=l.lastRenderedReducer,w!==null))try{var N=l.lastRenderedState,k=w(N,d);if(b.hasEagerState=!0,b.eagerState=k,Ta(k,N))return Jh(o,l,b,0),bn===null&&Xh(),!1}catch{}finally{}if(d=xx(o,l,b,p),d!==null)return va(d,o,p),JE(d,l,p),!0}return!1}function tv(o,l,d,p){if(p={lane:2,revertLane:Iv(),gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},vm(o)){if(l)throw Error(r(479))}else l=xx(o,d,p,2),l!==null&&va(l,o,2)}function vm(o){var l=o.alternate;return o===xt||l!==null&&l===xt}function XE(o,l){Kc=fm=!0;var d=o.pending;d===null?l.next=l:(l.next=d.next,d.next=l),o.pending=l}function JE(o,l,d){if((d&4194048)!==0){var p=l.lanes;p&=o.pendingLanes,d|=p,l.lanes=d,te(o,d)}}var Fd={readContext:Tr,use:pm,useCallback:Hn,useContext:Hn,useEffect:Hn,useImperativeHandle:Hn,useLayoutEffect:Hn,useInsertionEffect:Hn,useMemo:Hn,useReducer:Hn,useRef:Hn,useState:Hn,useDebugValue:Hn,useDeferredValue:Hn,useTransition:Hn,useSyncExternalStore:Hn,useId:Hn,useHostTransitionStatus:Hn,useFormState:Hn,useActionState:Hn,useOptimistic:Hn,useMemoCache:Hn,useCacheRefresh:Hn};Fd.useEffectEvent=Hn;var ew={readContext:Tr,use:pm,useCallback:function(o,l){return Qr().memoizedState=[o,l===void 0?null:l],o},useContext:Tr,useEffect:PE,useImperativeHandle:function(o,l,d){d=d!=null?d.concat([o]):null,ym(4194308,4,HE.bind(null,l,o),d)},useLayoutEffect:function(o,l){return ym(4194308,4,o,l)},useInsertionEffect:function(o,l){ym(4,2,o,l)},useMemo:function(o,l){var d=Qr();l=l===void 0?null:l;var p=o();if($l){Er(!0);try{o()}finally{Er(!1)}}return d.memoizedState=[p,l],p},useReducer:function(o,l,d){var p=Qr();if(d!==void 0){var b=d(l);if($l){Er(!0);try{d(l)}finally{Er(!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=I8.bind(null,xt,o),[p.memoizedState,o]},useRef:function(o){var l=Qr();return o={current:o},l.memoizedState=o},useState:function(o){o=Zx(o);var l=o.queue,d=QE.bind(null,xt,l);return l.dispatch=d,[o.memoizedState,d]},useDebugValue:Qx,useDeferredValue:function(o,l){var d=Qr();return Xx(d,o,l)},useTransition:function(){var o=Zx(!1);return o=qE.bind(null,xt,o.queue,!0,!1),Qr().memoizedState=o,[!1,o]},useSyncExternalStore:function(o,l,d){var p=xt,b=Qr();if($t){if(d===void 0)throw Error(r(407));d=d()}else{if(d=l(),bn===null)throw Error(r(349));(Ft&127)!==0||SE(p,l,d)}b.memoizedState=d;var w={value:d,getSnapshot:l};return b.queue=w,PE(EE.bind(null,p,w,o),[o]),p.flags|=2048,Yc(9,{destroy:void 0},CE.bind(null,p,w,d,l),null),d},useId:function(){var o=Qr(),l=bn.identifierPrefix;if($t){var d=Vs,p=Hs;d=(p&~(1<<32-Fn(p)-1)).toString(32)+d,l="_"+l+"R_"+d,d=hm++,0<d&&(l+="H"+d.toString(32)),l+="_"}else d=j8++,l="_"+l+"r_"+d.toString(32)+"_";return o.memoizedState=l},useHostTransitionStatus:ev,useFormState:OE,useActionState:OE,useOptimistic:function(o){var l=Qr();l.memoizedState=l.baseState=o;var d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return l.queue=d,l=tv.bind(null,xt,!0,d),d.dispatch=l,[o,l]},useMemoCache:Bx,useCacheRefresh:function(){return Qr().memoizedState=O8.bind(null,xt)},useEffectEvent:function(o){var l=Qr(),d={impl:o};return l.memoizedState=d,function(){if((tn&2)!==0)throw Error(r(440));return d.impl.apply(void 0,arguments)}}},nv={readContext:Tr,use:pm,useCallback:$E,useContext:Tr,useEffect:Wx,useImperativeHandle:VE,useInsertionEffect:FE,useLayoutEffect:zE,useMemo:GE,useReducer:gm,useRef:LE,useState:function(){return gm(Ro)},useDebugValue:Qx,useDeferredValue:function(o,l){var d=Xn();return BE(d,mn.memoizedState,o,l)},useTransition:function(){var o=gm(Ro)[0],l=Xn().memoizedState;return[typeof o=="boolean"?o:Pd(o),l]},useSyncExternalStore:bE,useId:YE,useHostTransitionStatus:ev,useFormState:IE,useActionState:IE,useOptimistic:function(o,l){var d=Xn();return jE(d,mn,o,l)},useMemoCache:Bx,useCacheRefresh:WE};nv.useEffectEvent=UE;var tw={readContext:Tr,use:pm,useCallback:$E,useContext:Tr,useEffect:Wx,useImperativeHandle:VE,useInsertionEffect:FE,useLayoutEffect:zE,useMemo:GE,useReducer:Kx,useRef:LE,useState:function(){return Kx(Ro)},useDebugValue:Qx,useDeferredValue:function(o,l){var d=Xn();return mn===null?Xx(d,o,l):BE(d,mn.memoizedState,o,l)},useTransition:function(){var o=Kx(Ro)[0],l=Xn().memoizedState;return[typeof o=="boolean"?o:Pd(o),l]},useSyncExternalStore:bE,useId:YE,useHostTransitionStatus:ev,useFormState:kE,useActionState:kE,useOptimistic:function(o,l){var d=Xn();return mn!==null?jE(d,mn,o,l):(d.baseState=o,[o,d.queue.dispatch])},useMemoCache:Bx,useCacheRefresh:WE};tw.useEffectEvent=UE;function rv(o,l,d,p){l=o.memoizedState,d=d(p,l),d=d==null?l:y({},l,d),o.memoizedState=d,o.lanes===0&&(o.updateQueue.baseState=d)}var av={enqueueSetState:function(o,l,d){o=o._reactInternals;var p=Ia(),b=Si(p);b.payload=l,d!=null&&(b.callback=d),l=Ci(o,b,p),l!==null&&(va(l,o,p),Id(l,o,p))},enqueueReplaceState:function(o,l,d){o=o._reactInternals;var p=Ia(),b=Si(p);b.tag=1,b.payload=l,d!=null&&(b.callback=d),l=Ci(o,b,p),l!==null&&(va(l,o,p),Id(l,o,p))},enqueueForceUpdate:function(o,l){o=o._reactInternals;var d=Ia(),p=Si(d);p.tag=2,l!=null&&(p.callback=l),l=Ci(o,p,d),l!==null&&(va(l,o,d),Id(l,o,d))}};function nw(o,l,d,p,b,w,N){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(p,w,N):l.prototype&&l.prototype.isPureReactComponent?!Rd(d,p)||!Rd(b,w):!0}function rw(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&&av.enqueueReplaceState(l,l.state,null)}function Gl(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=y({},d));for(var b in o)d[b]===void 0&&(d[b]=o[b])}return d}function aw(o){Qh(o)}function sw(o){console.error(o)}function ow(o){Qh(o)}function bm(o,l){try{var d=o.onUncaughtError;d(l.value,{componentStack:l.stack})}catch(p){setTimeout(function(){throw p})}}function iw(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 sv(o,l,d){return d=Si(d),d.tag=3,d.payload={element:null},d.callback=function(){bm(o,l)},d}function lw(o){return o=Si(o),o.tag=3,o}function cw(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(){iw(l,d,p)}}var N=d.stateNode;N!==null&&typeof N.componentDidCatch=="function"&&(o.callback=function(){iw(l,d,p),typeof b!="function"&&(_i===null?_i=new Set([this]):_i.add(this));var k=p.stack;this.componentDidCatch(p.value,{componentStack:k!==null?k:""})})}function M8(o,l,d,p,b){if(d.flags|=32768,p!==null&&typeof p=="object"&&typeof p.then=="function"){if(l=d.alternate,l!==null&&Hc(l,d,b,!0),d=Na.current,d!==null){switch(d.tag){case 31:case 13:return ts===null?Om():d.alternate===null&&Vn===0&&(Vn=3),d.flags&=-257,d.flags|=65536,d.lanes=b,p===im?d.flags|=16384:(l=d.updateQueue,l===null?d.updateQueue=new Set([p]):l.add(p),Av(o,p,b)),!1;case 22:return d.flags|=65536,p===im?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)),Av(o,p,b)),!1}throw Error(r(435,d.tag))}return Av(o,p,b),Om(),!1}if($t)return l=Na.current,l!==null?((l.flags&65536)===0&&(l.flags|=256),l.flags|=65536,l.lanes=b,p!==wx&&(o=Error(r(422),{cause:p}),_d(Qa(o,d)))):(p!==wx&&(l=Error(r(423),{cause:p}),_d(Qa(l,d))),o=o.current.alternate,o.flags|=65536,b&=-b,o.lanes|=b,p=Qa(p,d),b=sv(o.stateNode,p,b),kx(o,b),Vn!==4&&(Vn=2)),!1;var w=Error(r(520),{cause:p});if(w=Qa(w,d),Kd===null?Kd=[w]:Kd.push(w),Vn!==4&&(Vn=2),l===null)return!0;p=Qa(p,d),d=l;do{switch(d.tag){case 3:return d.flags|=65536,o=b&-b,d.lanes|=o,o=sv(d.stateNode,p,o),kx(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"&&(_i===null||!_i.has(w))))return d.flags|=65536,b&=-b,d.lanes|=b,b=lw(b),cw(b,o,d,p),kx(d,b),!1}d=d.return}while(d!==null);return!1}var ov=Error(r(461)),ar=!1;function _r(o,l,d,p){l.child=o===null?hE(l,null,d,p):Vl(l,o.child,d,p)}function uw(o,l,d,p,b){d=d.render;var w=l.ref;if("ref"in p){var N={};for(var k in p)k!=="ref"&&(N[k]=p[k])}else N=p;return Ul(l),p=Hx(o,l,d,N,w,b),k=Vx(),o!==null&&!ar?($x(o,l,b),jo(o,l,b)):($t&&k&&Cx(l),l.flags|=1,_r(o,l,p,b),l.child)}function dw(o,l,d,p,b){if(o===null){var w=d.type;return typeof w=="function"&&!vx(w)&&w.defaultProps===void 0&&d.compare===null?(l.tag=15,l.type=w,fw(o,l,w,p,b)):(o=tm(d.type,null,p,l,l.mode,b),o.ref=l.ref,o.return=l,l.child=o)}if(w=o.child,!mv(o,b)){var N=w.memoizedProps;if(d=d.compare,d=d!==null?d:Rd,d(N,p)&&o.ref===l.ref)return jo(o,l,b)}return l.flags|=1,o=bo(w,p),o.ref=l.ref,o.return=l,l.child=o}function fw(o,l,d,p,b){if(o!==null){var w=o.memoizedProps;if(Rd(w,p)&&o.ref===l.ref)if(ar=!1,l.pendingProps=p=w,mv(o,b))(o.flags&131072)!==0&&(ar=!0);else return l.lanes=o.lanes,jo(o,l,b)}return iv(o,l,d,p,b)}function hw(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 mw(o,l,w,d,p)}if((d&536870912)!==0)l.memoizedState={baseLanes:0,cachePool:null},o!==null&&sm(l,w!==null?w.cachePool:null),w!==null?gE(l,w):Px(),yE(l);else return p=l.lanes=536870912,mw(o,l,w!==null?w.baseLanes|d:d,d,p)}else w!==null?(sm(l,w.cachePool),gE(l,w),wi(),l.memoizedState=null):(o!==null&&sm(l,null),Px(),wi());return _r(o,l,b,d),l.child}function zd(o,l){return o!==null&&o.tag===22||l.stateNode!==null||(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.sibling}function mw(o,l,d,p,b){var w=Dx();return w=w===null?null:{parent:nr._currentValue,pool:w},l.memoizedState={baseLanes:d,cachePool:w},o!==null&&sm(l,null),Px(),yE(l),o!==null&&Hc(o,l,p,!0),l.childLanes=b,null}function Sm(o,l){return l=Em({mode:l.mode,children:l.children},o.mode),l.ref=o.ref,o.child=l,l.return=o,l}function pw(o,l,d){return Vl(l,o.child,null,d),o=Sm(l,l.pendingProps),o.flags|=2,Aa(l),l.memoizedState=null,o}function k8(o,l,d){var p=l.pendingProps,b=(l.flags&128)!==0;if(l.flags&=-129,o===null){if($t){if(p.mode==="hidden")return o=Sm(l,p),l.lanes=536870912,zd(null,o);if(Fx(l),(o=wn)?(o=TR(o,es),o=o!==null&&o.data==="&"?o:null,o!==null&&(l.memoizedState={dehydrated:o,treeContext:gi!==null?{id:Hs,overflow:Vs}:null,retryLane:536870912,hydrationErrors:null},d=X2(o),d.return=l,l.child=d,jr=l,wn=null)):o=null,o===null)throw xi(l);return l.lanes=536870912,null}return Sm(l,p)}var w=o.memoizedState;if(w!==null){var N=w.dehydrated;if(Fx(l),b)if(l.flags&256)l.flags&=-257,l=pw(o,l,d);else if(l.memoizedState!==null)l.child=o.child,l.flags|=128,l=null;else throw Error(r(558));else if(ar||Hc(o,l,d,!1),b=(d&o.childLanes)!==0,ar||b){if(p=bn,p!==null&&(N=le(p,d),N!==0&&N!==w.retryLane))throw w.retryLane=N,Ml(o,N),va(p,o,N),ov;Om(),l=pw(o,l,d)}else o=w.treeContext,wn=ns(N.nextSibling),jr=l,$t=!0,yi=null,es=!1,o!==null&&tE(l,o),l=Sm(l,p),l.flags|=4096;return l}return o=bo(o.child,{mode:p.mode,children:p.children}),o.ref=l.ref,l.child=o,o.return=l,o}function Cm(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 iv(o,l,d,p,b){return Ul(l),d=Hx(o,l,d,p,void 0,b),p=Vx(),o!==null&&!ar?($x(o,l,b),jo(o,l,b)):($t&&p&&Cx(l),l.flags|=1,_r(o,l,d,b),l.child)}function gw(o,l,d,p,b,w){return Ul(l),l.updateQueue=null,d=vE(l,p,d,b),xE(o),p=Vx(),o!==null&&!ar?($x(o,l,w),jo(o,l,w)):($t&&p&&Cx(l),l.flags|=1,_r(o,l,d,w),l.child)}function yw(o,l,d,p,b){if(Ul(l),l.stateNode===null){var w=Pc,N=d.contextType;typeof N=="object"&&N!==null&&(w=Tr(N)),w=new d(p,w),l.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,w.updater=av,l.stateNode=w,w._reactInternals=l,w=l.stateNode,w.props=p,w.state=l.memoizedState,w.refs={},Ix(l),N=d.contextType,w.context=typeof N=="object"&&N!==null?Tr(N):Pc,w.state=l.memoizedState,N=d.getDerivedStateFromProps,typeof N=="function"&&(rv(l,d,N,p),w.state=l.memoizedState),typeof d.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(N=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),N!==w.state&&av.enqueueReplaceState(w,w.state,null),kd(l,p,w,b),Md(),w.state=l.memoizedState),typeof w.componentDidMount=="function"&&(l.flags|=4194308),p=!0}else if(o===null){w=l.stateNode;var k=l.memoizedProps,W=Gl(d,k);w.props=W;var ie=w.context,pe=d.contextType;N=Pc,typeof pe=="object"&&pe!==null&&(N=Tr(pe));var xe=d.getDerivedStateFromProps;pe=typeof xe=="function"||typeof w.getSnapshotBeforeUpdate=="function",k=l.pendingProps!==k,pe||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(k||ie!==N)&&rw(l,w,p,N),bi=!1;var ce=l.memoizedState;w.state=ce,kd(l,p,w,b),Md(),ie=l.memoizedState,k||ce!==ie||bi?(typeof xe=="function"&&(rv(l,d,xe,p),ie=l.memoizedState),(W=bi||nw(l,d,W,p,ce,ie,N))?(pe||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=ie),w.props=p,w.state=ie,w.context=N,p=W):(typeof w.componentDidMount=="function"&&(l.flags|=4194308),p=!1)}else{w=l.stateNode,Mx(o,l),N=l.memoizedProps,pe=Gl(d,N),w.props=pe,xe=l.pendingProps,ce=w.context,ie=d.contextType,W=Pc,typeof ie=="object"&&ie!==null&&(W=Tr(ie)),k=d.getDerivedStateFromProps,(ie=typeof k=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(N!==xe||ce!==W)&&rw(l,w,p,W),bi=!1,ce=l.memoizedState,w.state=ce,kd(l,p,w,b),Md();var me=l.memoizedState;N!==xe||ce!==me||bi||o!==null&&o.dependencies!==null&&rm(o.dependencies)?(typeof k=="function"&&(rv(l,d,k,p),me=l.memoizedState),(pe=bi||nw(l,d,pe,p,ce,me,W)||o!==null&&o.dependencies!==null&&rm(o.dependencies))?(ie||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(p,me,W),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(p,me,W)),typeof w.componentDidUpdate=="function"&&(l.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof w.componentDidUpdate!="function"||N===o.memoizedProps&&ce===o.memoizedState||(l.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||N===o.memoizedProps&&ce===o.memoizedState||(l.flags|=1024),l.memoizedProps=p,l.memoizedState=me),w.props=p,w.state=me,w.context=W,p=pe):(typeof w.componentDidUpdate!="function"||N===o.memoizedProps&&ce===o.memoizedState||(l.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||N===o.memoizedProps&&ce===o.memoizedState||(l.flags|=1024),p=!1)}return w=p,Cm(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=Vl(l,o.child,null,b),l.child=Vl(l,null,d,b)):_r(o,l,d,b),l.memoizedState=w.state,o=l.child):o=jo(o,l,b),o}function xw(o,l,d,p){return Ll(),l.flags|=256,_r(o,l,d,p),l.child}var lv={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function cv(o){return{baseLanes:o,cachePool:iE()}}function uv(o,l,d){return o=o!==null?o.childLanes&~d:0,l&&(o|=Oa),o}function vw(o,l,d){var p=l.pendingProps,b=!1,w=(l.flags&128)!==0,N;if((N=w)||(N=o!==null&&o.memoizedState===null?!1:(Qn.current&2)!==0),N&&(b=!0,l.flags&=-129),N=(l.flags&32)!==0,l.flags&=-33,o===null){if($t){if(b?Ei(l):wi(),(o=wn)?(o=TR(o,es),o=o!==null&&o.data!=="&"?o:null,o!==null&&(l.memoizedState={dehydrated:o,treeContext:gi!==null?{id:Hs,overflow:Vs}:null,retryLane:536870912,hydrationErrors:null},d=X2(o),d.return=l,l.child=d,jr=l,wn=null)):o=null,o===null)throw xi(l);return qv(o)?l.lanes=32:l.lanes=536870912,null}var k=p.children;return p=p.fallback,b?(wi(),b=l.mode,k=Em({mode:"hidden",children:k},b),p=kl(p,b,d,null),k.return=l,p.return=l,k.sibling=p,l.child=k,p=l.child,p.memoizedState=cv(d),p.childLanes=uv(o,N,d),l.memoizedState=lv,zd(null,p)):(Ei(l),dv(l,k))}var W=o.memoizedState;if(W!==null&&(k=W.dehydrated,k!==null)){if(w)l.flags&256?(Ei(l),l.flags&=-257,l=fv(o,l,d)):l.memoizedState!==null?(wi(),l.child=o.child,l.flags|=128,l=null):(wi(),k=p.fallback,b=l.mode,p=Em({mode:"visible",children:p.children},b),k=kl(k,b,d,null),k.flags|=2,p.return=l,k.return=l,p.sibling=k,l.child=p,Vl(l,o.child,null,d),p=l.child,p.memoizedState=cv(d),p.childLanes=uv(o,N,d),l.memoizedState=lv,l=zd(null,p));else if(Ei(l),qv(k)){if(N=k.nextSibling&&k.nextSibling.dataset,N)var ie=N.dgst;N=ie,p=Error(r(419)),p.stack="",p.digest=N,_d({value:p,source:null,stack:null}),l=fv(o,l,d)}else if(ar||Hc(o,l,d,!1),N=(d&o.childLanes)!==0,ar||N){if(N=bn,N!==null&&(p=le(N,d),p!==0&&p!==W.retryLane))throw W.retryLane=p,Ml(o,p),va(N,o,p),ov;Bv(k)||Om(),l=fv(o,l,d)}else Bv(k)?(l.flags|=192,l.child=o.child,l=null):(o=W.treeContext,wn=ns(k.nextSibling),jr=l,$t=!0,yi=null,es=!1,o!==null&&tE(l,o),l=dv(l,p.children),l.flags|=4096);return l}return b?(wi(),k=p.fallback,b=l.mode,W=o.child,ie=W.sibling,p=bo(W,{mode:"hidden",children:p.children}),p.subtreeFlags=W.subtreeFlags&65011712,ie!==null?k=bo(ie,k):(k=kl(k,b,d,null),k.flags|=2),k.return=l,p.return=l,p.sibling=k,l.child=p,zd(null,p),p=l.child,k=o.child.memoizedState,k===null?k=cv(d):(b=k.cachePool,b!==null?(W=nr._currentValue,b=b.parent!==W?{parent:W,pool:W}:b):b=iE(),k={baseLanes:k.baseLanes|d,cachePool:b}),p.memoizedState=k,p.childLanes=uv(o,N,d),l.memoizedState=lv,zd(o.child,p)):(Ei(l),d=o.child,o=d.sibling,d=bo(d,{mode:"visible",children:p.children}),d.return=l,d.sibling=null,o!==null&&(N=l.deletions,N===null?(l.deletions=[o],l.flags|=16):N.push(o)),l.child=d,l.memoizedState=null,d)}function dv(o,l){return l=Em({mode:"visible",children:l},o.mode),l.return=o,o.child=l}function Em(o,l){return o=_a(22,o,null,l),o.lanes=0,o}function fv(o,l,d){return Vl(l,o.child,null,d),o=dv(l,l.pendingProps.children),o.flags|=2,l.memoizedState=null,o}function bw(o,l,d){o.lanes|=l;var p=o.alternate;p!==null&&(p.lanes|=l),Tx(o.return,l,d)}function hv(o,l,d,p,b,w){var N=o.memoizedState;N===null?o.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:p,tail:d,tailMode:b,treeForkCount:w}:(N.isBackwards=l,N.rendering=null,N.renderingStartTime=0,N.last=p,N.tail=d,N.tailMode=b,N.treeForkCount=w)}function Sw(o,l,d){var p=l.pendingProps,b=p.revealOrder,w=p.tail;p=p.children;var N=Qn.current,k=(N&2)!==0;if(k?(N=N&1|2,l.flags|=128):N&=1,$(Qn,N),_r(o,l,p,d),p=$t?Td:0,!k&&o!==null&&(o.flags&128)!==0)e:for(o=l.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&bw(o,d,l);else if(o.tag===19)bw(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&&dm(o)===null&&(b=d),d=d.sibling;d=b,d===null?(b=l.child,l.child=null):(b=d.sibling,d.sibling=null),hv(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&&dm(o)===null){l.child=b;break}o=b.sibling,b.sibling=d,d=b,b=o}hv(l,!0,d,null,w,p);break;case"together":hv(l,!1,null,null,void 0,p);break;default:l.memoizedState=null}return l.child}function jo(o,l,d){if(o!==null&&(l.dependencies=o.dependencies),Ti|=l.lanes,(d&l.childLanes)===0)if(o!==null){if(Hc(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=bo(o,o.pendingProps),l.child=d,d.return=l;o.sibling!==null;)o=o.sibling,d=d.sibling=bo(o,o.pendingProps),d.return=l;d.sibling=null}return l.child}function mv(o,l){return(o.lanes&l)!==0?!0:(o=o.dependencies,!!(o!==null&&rm(o)))}function L8(o,l,d){switch(l.tag){case 3:he(l,l.stateNode.containerInfo),vi(l,nr,o.memoizedState.cache),Ll();break;case 27:case 5:Ee(l);break;case 4:he(l,l.stateNode.containerInfo);break;case 10:vi(l,l.type,l.memoizedProps.value);break;case 31:if(l.memoizedState!==null)return l.flags|=128,Fx(l),null;break;case 13:var p=l.memoizedState;if(p!==null)return p.dehydrated!==null?(Ei(l),l.flags|=128,null):(d&l.child.childLanes)!==0?vw(o,l,d):(Ei(l),o=jo(o,l,d),o!==null?o.sibling:null);Ei(l);break;case 19:var b=(o.flags&128)!==0;if(p=(d&l.childLanes)!==0,p||(Hc(o,l,d,!1),p=(d&l.childLanes)!==0),b){if(p)return Sw(o,l,d);l.flags|=128}if(b=l.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),$(Qn,Qn.current),p)break;return null;case 22:return l.lanes=0,hw(o,l,d,l.pendingProps);case 24:vi(l,nr,o.memoizedState.cache)}return jo(o,l,d)}function Cw(o,l,d){if(o!==null)if(o.memoizedProps!==l.pendingProps)ar=!0;else{if(!mv(o,d)&&(l.flags&128)===0)return ar=!1,L8(o,l,d);ar=(o.flags&131072)!==0}else ar=!1,$t&&(l.flags&1048576)!==0&&eE(l,Td,l.index);switch(l.lanes=0,l.tag){case 16:e:{var p=l.pendingProps;if(o=zl(l.elementType),l.type=o,typeof o=="function")vx(o)?(p=Gl(o,p),l.tag=1,l=yw(null,l,o,p,d)):(l.tag=0,l=iv(null,l,o,p,d));else{if(o!=null){var b=o.$$typeof;if(b===A){l.tag=11,l=uw(null,l,o,p,d);break e}else if(b===T){l.tag=14,l=dw(null,l,o,p,d);break e}}throw l=F(o)||o,Error(r(306,l,""))}}return l;case 0:return iv(o,l,l.type,l.pendingProps,d);case 1:return p=l.type,b=Gl(p,l.pendingProps),yw(o,l,p,b,d);case 3:e:{if(he(l,l.stateNode.containerInfo),o===null)throw Error(r(387));p=l.pendingProps;var w=l.memoizedState;b=w.element,Mx(o,l),kd(l,p,null,d);var N=l.memoizedState;if(p=N.cache,vi(l,nr,p),p!==w.cache&&_x(l,[nr],d,!0),Md(),p=N.element,w.isDehydrated)if(w={element:p,isDehydrated:!1,cache:N.cache},l.updateQueue.baseState=w,l.memoizedState=w,l.flags&256){l=xw(o,l,p,d);break e}else if(p!==b){b=Qa(Error(r(424)),l),_d(b),l=xw(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(wn=ns(o.firstChild),jr=l,$t=!0,yi=null,es=!0,d=hE(l,null,p,d),l.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling}else{if(Ll(),p===b){l=jo(o,l,d);break e}_r(o,l,p,d)}l=l.child}return l;case 26:return Cm(o,l),o===null?(d=IR(l.type,null,l.pendingProps,null))?l.memoizedState=d:$t||(d=l.type,o=l.pendingProps,p=Fm(ue.current).createElement(d),p[Le]=l,p[Ve]=o,Nr(p,d,o),on(p),l.stateNode=p):l.memoizedState=IR(l.type,o.memoizedProps,l.pendingProps,o.memoizedState),null;case 27:return Ee(l),o===null&&$t&&(p=l.stateNode=AR(l.type,l.pendingProps,ue.current),jr=l,es=!0,b=wn,Oi(l.type)?(Kv=b,wn=ns(p.firstChild)):wn=b),_r(o,l,l.pendingProps.children,d),Cm(o,l),o===null&&(l.flags|=4194304),l.child;case 5:return o===null&&$t&&((b=p=wn)&&(p=fk(p,l.type,l.pendingProps,es),p!==null?(l.stateNode=p,jr=l,wn=ns(p.firstChild),es=!1,b=!0):b=!1),b||xi(l)),Ee(l),b=l.type,w=l.pendingProps,N=o!==null?o.memoizedProps:null,p=w.children,Vv(b,w)?p=null:N!==null&&Vv(b,N)&&(l.flags|=32),l.memoizedState!==null&&(b=Hx(o,l,T8,null,null,d),tf._currentValue=b),Cm(o,l),_r(o,l,p,d),l.child;case 6:return o===null&&$t&&((o=d=wn)&&(d=hk(d,l.pendingProps,es),d!==null?(l.stateNode=d,jr=l,wn=null,o=!0):o=!1),o||xi(l)),null;case 13:return vw(o,l,d);case 4:return he(l,l.stateNode.containerInfo),p=l.pendingProps,o===null?l.child=Vl(l,null,p,d):_r(o,l,p,d),l.child;case 11:return uw(o,l,l.type,l.pendingProps,d);case 7:return _r(o,l,l.pendingProps,d),l.child;case 8:return _r(o,l,l.pendingProps.children,d),l.child;case 12:return _r(o,l,l.pendingProps.children,d),l.child;case 10:return p=l.pendingProps,vi(l,l.type,p.value),_r(o,l,p.children,d),l.child;case 9:return b=l.type._context,p=l.pendingProps.children,Ul(l),b=Tr(b),p=p(b),l.flags|=1,_r(o,l,p,d),l.child;case 14:return dw(o,l,l.type,l.pendingProps,d);case 15:return fw(o,l,l.type,l.pendingProps,d);case 19:return Sw(o,l,d);case 31:return k8(o,l,d);case 22:return hw(o,l,d,l.pendingProps);case 24:return Ul(l),p=Tr(nr),o===null?(b=Dx(),b===null&&(b=bn,w=Nx(),b.pooledCache=w,w.refCount++,w!==null&&(b.pooledCacheLanes|=d),b=w),l.memoizedState={parent:p,cache:b},Ix(l),vi(l,nr,b)):((o.lanes&d)!==0&&(Mx(o,l),kd(l,null,null,d),Md()),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),vi(l,nr,p)):(p=w.cache,vi(l,nr,p),p!==b.cache&&_x(l,[nr],d,!0))),_r(o,l,l.pendingProps.children,d),l.child;case 29:throw l.pendingProps}throw Error(r(156,l.tag))}function To(o){o.flags|=4}function pv(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(Yw())o.flags|=8192;else throw Hl=im,Ox}else o.flags&=-16777217}function Ew(o,l){if(l.type!=="stylesheet"||(l.state.loading&4)!==0)o.flags&=-16777217;else if(o.flags|=16777216,!UR(l))if(Yw())o.flags|=8192;else throw Hl=im,Ox}function wm(o,l){l!==null&&(o.flags|=4),o.flags&16384&&(l=o.tag!==22?Yn():536870912,o.lanes|=l,Jc|=l)}function Hd(o,l){if(!$t)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 Rn(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 P8(o,l,d){var p=l.pendingProps;switch(Ex(l),l.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Rn(l),null;case 1:return Rn(l),null;case 3:return d=l.stateNode,p=null,o!==null&&(p=o.memoizedState.cache),l.memoizedState.cache!==p&&(l.flags|=2048),Eo(nr),ge(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),(o===null||o.child===null)&&(zc(l)?To(l):o===null||o.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,Rx())),Rn(l),null;case 26:var b=l.type,w=l.memoizedState;return o===null?(To(l),w!==null?(Rn(l),Ew(l,w)):(Rn(l),pv(l,b,null,p,d))):w?w!==o.memoizedState?(To(l),Rn(l),Ew(l,w)):(Rn(l),l.flags&=-16777217):(o=o.memoizedProps,o!==p&&To(l),Rn(l),pv(l,b,o,p,d)),null;case 27:if(Me(l),d=ue.current,b=l.type,o!==null&&l.stateNode!=null)o.memoizedProps!==p&&To(l);else{if(!p){if(l.stateNode===null)throw Error(r(166));return Rn(l),null}o=Q.current,zc(l)?nE(l):(o=AR(b,p,d),l.stateNode=o,To(l))}return Rn(l),null;case 5:if(Me(l),b=l.type,o!==null&&l.stateNode!=null)o.memoizedProps!==p&&To(l);else{if(!p){if(l.stateNode===null)throw Error(r(166));return Rn(l),null}if(w=Q.current,zc(l))nE(l);else{var N=Fm(ue.current);switch(w){case 1:w=N.createElementNS("http://www.w3.org/2000/svg",b);break;case 2:w=N.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;default:switch(b){case"svg":w=N.createElementNS("http://www.w3.org/2000/svg",b);break;case"math":w=N.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;case"script":w=N.createElement("div"),w.innerHTML="<script><\/script>",w=w.removeChild(w.firstChild);break;case"select":w=typeof p.is=="string"?N.createElement("select",{is:p.is}):N.createElement("select"),p.multiple?w.multiple=!0:p.size&&(w.size=p.size);break;default:w=typeof p.is=="string"?N.createElement(b,{is:p.is}):N.createElement(b)}}w[Le]=l,w[Ve]=p;e:for(N=l.child;N!==null;){if(N.tag===5||N.tag===6)w.appendChild(N.stateNode);else if(N.tag!==4&&N.tag!==27&&N.child!==null){N.child.return=N,N=N.child;continue}if(N===l)break e;for(;N.sibling===null;){if(N.return===null||N.return===l)break e;N=N.return}N.sibling.return=N.return,N=N.sibling}l.stateNode=w;e:switch(Nr(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&&To(l)}}return Rn(l),pv(l,l.type,o===null?null:o.memoizedProps,l.pendingProps,d),null;case 6:if(o&&l.stateNode!=null)o.memoizedProps!==p&&To(l);else{if(typeof p!="string"&&l.stateNode===null)throw Error(r(166));if(o=ue.current,zc(l)){if(o=l.stateNode,d=l.memoizedProps,p=null,b=jr,b!==null)switch(b.tag){case 27:case 5:p=b.memoizedProps}o[Le]=l,o=!!(o.nodeValue===d||p!==null&&p.suppressHydrationWarning===!0||vR(o.nodeValue,d)),o||xi(l,!0)}else o=Fm(o).createTextNode(p),o[Le]=l,l.stateNode=o}return Rn(l),null;case 31:if(d=l.memoizedState,o===null||o.memoizedState!==null){if(p=zc(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 Ll(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Rn(l),o=!1}else d=Rx(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=d),o=!0;if(!o)return l.flags&256?(Aa(l),l):(Aa(l),null);if((l.flags&128)!==0)throw Error(r(558))}return Rn(l),null;case 13:if(p=l.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(b=zc(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 Ll(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Rn(l),b=!1}else b=Rx(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=b),b=!0;if(!b)return l.flags&256?(Aa(l),l):(Aa(l),null)}return Aa(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),wm(l,l.updateQueue),Rn(l),null);case 4:return ge(),o===null&&Pv(l.stateNode.containerInfo),Rn(l),null;case 10:return Eo(l.type),Rn(l),null;case 19:if(U(Qn),p=l.memoizedState,p===null)return Rn(l),null;if(b=(l.flags&128)!==0,w=p.rendering,w===null)if(b)Hd(p,!1);else{if(Vn!==0||o!==null&&(o.flags&128)!==0)for(o=l.child;o!==null;){if(w=dm(o),w!==null){for(l.flags|=128,Hd(p,!1),o=w.updateQueue,l.updateQueue=o,wm(l,o),l.subtreeFlags=0,o=d,d=l.child;d!==null;)Q2(d,o),d=d.sibling;return $(Qn,Qn.current&1|2),$t&&So(l,p.treeForkCount),l.child}o=o.sibling}p.tail!==null&&we()>Nm&&(l.flags|=128,b=!0,Hd(p,!1),l.lanes=4194304)}else{if(!b)if(o=dm(w),o!==null){if(l.flags|=128,b=!0,o=o.updateQueue,l.updateQueue=o,wm(l,o),Hd(p,!0),p.tail===null&&p.tailMode==="hidden"&&!w.alternate&&!$t)return Rn(l),null}else 2*we()-p.renderingStartTime>Nm&&d!==536870912&&(l.flags|=128,b=!0,Hd(p,!1),l.lanes=4194304);p.isBackwards?(w.sibling=l.child,l.child=w):(o=p.last,o!==null?o.sibling=w:l.child=w,p.last=w)}return p.tail!==null?(o=p.tail,p.rendering=o,p.tail=o.sibling,p.renderingStartTime=we(),o.sibling=null,d=Qn.current,$(Qn,b?d&1|2:d&1),$t&&So(l,p.treeForkCount),o):(Rn(l),null);case 22:case 23:return Aa(l),Ux(),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&&(Rn(l),l.subtreeFlags&6&&(l.flags|=8192)):Rn(l),d=l.updateQueue,d!==null&&wm(l,d.retryQueue),d=null,o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(d=o.memoizedState.cachePool.pool),p=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(p=l.memoizedState.cachePool.pool),p!==d&&(l.flags|=2048),o!==null&&U(Fl),null;case 24:return d=null,o!==null&&(d=o.memoizedState.cache),l.memoizedState.cache!==d&&(l.flags|=2048),Eo(nr),Rn(l),null;case 25:return null;case 30:return null}throw Error(r(156,l.tag))}function U8(o,l){switch(Ex(l),l.tag){case 1:return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 3:return Eo(nr),ge(),o=l.flags,(o&65536)!==0&&(o&128)===0?(l.flags=o&-65537|128,l):null;case 26:case 27:case 5:return Me(l),null;case 31:if(l.memoizedState!==null){if(Aa(l),l.alternate===null)throw Error(r(340));Ll()}return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 13:if(Aa(l),o=l.memoizedState,o!==null&&o.dehydrated!==null){if(l.alternate===null)throw Error(r(340));Ll()}return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 19:return U(Qn),null;case 4:return ge(),null;case 10:return Eo(l.type),null;case 22:case 23:return Aa(l),Ux(),o!==null&&U(Fl),o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 24:return Eo(nr),null;case 25:return null;default:return null}}function ww(o,l){switch(Ex(l),l.tag){case 3:Eo(nr),ge();break;case 26:case 27:case 5:Me(l);break;case 4:ge();break;case 31:l.memoizedState!==null&&Aa(l);break;case 13:Aa(l);break;case 19:U(Qn);break;case 10:Eo(l.type);break;case 22:case 23:Aa(l),Ux(),o!==null&&U(Fl);break;case 24:Eo(nr)}}function Vd(o,l){try{var d=l.updateQueue,p=d!==null?d.lastEffect:null;if(p!==null){var b=p.next;d=b;do{if((d.tag&o)===o){p=void 0;var w=d.create,N=d.inst;p=w(),N.destroy=p}d=d.next}while(d!==b)}}catch(k){cn(l,l.return,k)}}function Ri(o,l,d){try{var p=l.updateQueue,b=p!==null?p.lastEffect:null;if(b!==null){var w=b.next;p=w;do{if((p.tag&o)===o){var N=p.inst,k=N.destroy;if(k!==void 0){N.destroy=void 0,b=l;var W=d,ie=k;try{ie()}catch(pe){cn(b,W,pe)}}}p=p.next}while(p!==w)}}catch(pe){cn(l,l.return,pe)}}function Rw(o){var l=o.updateQueue;if(l!==null){var d=o.stateNode;try{pE(l,d)}catch(p){cn(o,o.return,p)}}}function jw(o,l,d){d.props=Gl(o.type,o.memoizedProps),d.state=o.memoizedState;try{d.componentWillUnmount()}catch(p){cn(o,l,p)}}function $d(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){cn(o,l,b)}}function $s(o,l){var d=o.ref,p=o.refCleanup;if(d!==null)if(typeof p=="function")try{p()}catch(b){cn(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){cn(o,l,b)}else d.current=null}function Tw(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){cn(o,o.return,b)}}function gv(o,l,d){try{var p=o.stateNode;ok(p,o.type,d,l),p[Ve]=l}catch(b){cn(o,o.return,b)}}function _w(o){return o.tag===5||o.tag===3||o.tag===26||o.tag===27&&Oi(o.type)||o.tag===4}function yv(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||_w(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&&Oi(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 xv(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=xo));else if(p!==4&&(p===27&&Oi(o.type)&&(d=o.stateNode,l=null),o=o.child,o!==null))for(xv(o,l,d),o=o.sibling;o!==null;)xv(o,l,d),o=o.sibling}function Rm(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&&Oi(o.type)&&(d=o.stateNode),o=o.child,o!==null))for(Rm(o,l,d),o=o.sibling;o!==null;)Rm(o,l,d),o=o.sibling}function Nw(o){var l=o.stateNode,d=o.memoizedProps;try{for(var p=o.type,b=l.attributes;b.length;)l.removeAttributeNode(b[0]);Nr(l,p,d),l[Le]=o,l[Ve]=d}catch(w){cn(o,o.return,w)}}var _o=!1,sr=!1,vv=!1,Aw=typeof WeakSet=="function"?WeakSet:Set,vr=null;function F8(o,l){if(o=o.containerInfo,zv=qm,o=V2(o),fx(o)){if("selectionStart"in o)var d={start:o.selectionStart,end:o.selectionEnd};else e:{d=(d=o.ownerDocument)&&d.defaultView||window;var p=d.getSelection&&d.getSelection();if(p&&p.rangeCount!==0){d=p.anchorNode;var b=p.anchorOffset,w=p.focusNode;p=p.focusOffset;try{d.nodeType,w.nodeType}catch{d=null;break e}var N=0,k=-1,W=-1,ie=0,pe=0,xe=o,ce=null;t:for(;;){for(var me;xe!==d||b!==0&&xe.nodeType!==3||(k=N+b),xe!==w||p!==0&&xe.nodeType!==3||(W=N+p),xe.nodeType===3&&(N+=xe.nodeValue.length),(me=xe.firstChild)!==null;)ce=xe,xe=me;for(;;){if(xe===o)break t;if(ce===d&&++ie===b&&(k=N),ce===w&&++pe===p&&(W=N),(me=xe.nextSibling)!==null)break;xe=ce,ce=xe.parentNode}xe=me}d=k===-1||W===-1?null:{start:k,end:W}}else d=null}d=d||{start:0,end:0}}else d=null;for(Hv={focusedElem:o,selectionRange:d},qm=!1,vr=l;vr!==null;)if(l=vr,o=l.child,(l.subtreeFlags&1028)!==0&&o!==null)o.return=l,vr=o;else for(;vr!==null;){switch(l=vr,w=l.alternate,o=l.flags,l.tag){case 0:if((o&4)!==0&&(o=l.updateQueue,o=o!==null?o.events:null,o!==null))for(d=0;d<o.length;d++)b=o[d],b.ref.impl=b.nextImpl;break;case 11:case 15:break;case 1:if((o&1024)!==0&&w!==null){o=void 0,d=l,b=w.memoizedProps,w=w.memoizedState,p=d.stateNode;try{var qe=Gl(d.type,b);o=p.getSnapshotBeforeUpdate(qe,w),p.__reactInternalSnapshotBeforeUpdate=o}catch(rt){cn(d,d.return,rt)}}break;case 3:if((o&1024)!==0){if(o=l.stateNode.containerInfo,d=o.nodeType,d===9)Gv(o);else if(d===1)switch(o.nodeName){case"HEAD":case"HTML":case"BODY":Gv(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,vr=o;break}vr=l.return}}function Dw(o,l,d){var p=d.flags;switch(d.tag){case 0:case 11:case 15:Ao(o,d),p&4&&Vd(5,d);break;case 1:if(Ao(o,d),p&4)if(o=d.stateNode,l===null)try{o.componentDidMount()}catch(N){cn(d,d.return,N)}else{var b=Gl(d.type,l.memoizedProps);l=l.memoizedState;try{o.componentDidUpdate(b,l,o.__reactInternalSnapshotBeforeUpdate)}catch(N){cn(d,d.return,N)}}p&64&&Rw(d),p&512&&$d(d,d.return);break;case 3:if(Ao(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{pE(o,l)}catch(N){cn(d,d.return,N)}}break;case 27:l===null&&p&4&&Nw(d);case 26:case 5:Ao(o,d),l===null&&p&4&&Tw(d),p&512&&$d(d,d.return);break;case 12:Ao(o,d);break;case 31:Ao(o,d),p&4&&Mw(o,d);break;case 13:Ao(o,d),p&4&&kw(o,d),p&64&&(o=d.memoizedState,o!==null&&(o=o.dehydrated,o!==null&&(d=Z8.bind(null,d),mk(o,d))));break;case 22:if(p=d.memoizedState!==null||_o,!p){l=l!==null&&l.memoizedState!==null||sr,b=_o;var w=sr;_o=p,(sr=l)&&!w?Do(o,d,(d.subtreeFlags&8772)!==0):Ao(o,d),_o=b,sr=w}break;case 30:break;default:Ao(o,d)}}function Ow(o){var l=o.alternate;l!==null&&(o.alternate=null,Ow(l)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(l=o.stateNode,l!==null&&sn(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 An=null,pa=!1;function No(o,l,d){for(d=d.child;d!==null;)Iw(o,l,d),d=d.sibling}function Iw(o,l,d){if(Un&&typeof Un.onCommitFiberUnmount=="function")try{Un.onCommitFiberUnmount(Zn,d)}catch{}switch(d.tag){case 26:sr||$s(d,l),No(o,l,d),d.memoizedState?d.memoizedState.count--:d.stateNode&&(d=d.stateNode,d.parentNode.removeChild(d));break;case 27:sr||$s(d,l);var p=An,b=pa;Oi(d.type)&&(An=d.stateNode,pa=!1),No(o,l,d),Xd(d.stateNode),An=p,pa=b;break;case 5:sr||$s(d,l);case 6:if(p=An,b=pa,An=null,No(o,l,d),An=p,pa=b,An!==null)if(pa)try{(An.nodeType===9?An.body:An.nodeName==="HTML"?An.ownerDocument.body:An).removeChild(d.stateNode)}catch(w){cn(d,l,w)}else try{An.removeChild(d.stateNode)}catch(w){cn(d,l,w)}break;case 18:An!==null&&(pa?(o=An,RR(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,d.stateNode),iu(o)):RR(An,d.stateNode));break;case 4:p=An,b=pa,An=d.stateNode.containerInfo,pa=!0,No(o,l,d),An=p,pa=b;break;case 0:case 11:case 14:case 15:Ri(2,d,l),sr||Ri(4,d,l),No(o,l,d);break;case 1:sr||($s(d,l),p=d.stateNode,typeof p.componentWillUnmount=="function"&&jw(d,l,p)),No(o,l,d);break;case 21:No(o,l,d);break;case 22:sr=(p=sr)||d.memoizedState!==null,No(o,l,d),sr=p;break;default:No(o,l,d)}}function Mw(o,l){if(l.memoizedState===null&&(o=l.alternate,o!==null&&(o=o.memoizedState,o!==null))){o=o.dehydrated;try{iu(o)}catch(d){cn(l,l.return,d)}}}function kw(o,l){if(l.memoizedState===null&&(o=l.alternate,o!==null&&(o=o.memoizedState,o!==null&&(o=o.dehydrated,o!==null))))try{iu(o)}catch(d){cn(l,l.return,d)}}function z8(o){switch(o.tag){case 31:case 13:case 19:var l=o.stateNode;return l===null&&(l=o.stateNode=new Aw),l;case 22:return o=o.stateNode,l=o._retryCache,l===null&&(l=o._retryCache=new Aw),l;default:throw Error(r(435,o.tag))}}function jm(o,l){var d=z8(o);l.forEach(function(p){if(!d.has(p)){d.add(p);var b=Y8.bind(null,o,p);p.then(b,b)}})}function ga(o,l){var d=l.deletions;if(d!==null)for(var p=0;p<d.length;p++){var b=d[p],w=o,N=l,k=N;e:for(;k!==null;){switch(k.tag){case 27:if(Oi(k.type)){An=k.stateNode,pa=!1;break e}break;case 5:An=k.stateNode,pa=!1;break e;case 3:case 4:An=k.stateNode.containerInfo,pa=!0;break e}k=k.return}if(An===null)throw Error(r(160));Iw(w,N,b),An=null,pa=!1,w=b.alternate,w!==null&&(w.return=null),b.return=null}if(l.subtreeFlags&13886)for(l=l.child;l!==null;)Lw(l,o),l=l.sibling}var ps=null;function Lw(o,l){var d=o.alternate,p=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:ga(l,o),ya(o),p&4&&(Ri(3,o,o.return),Vd(3,o),Ri(5,o,o.return));break;case 1:ga(l,o),ya(o),p&512&&(sr||d===null||$s(d,d.return)),p&64&&_o&&(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=ps;if(ga(l,o),ya(o),p&512&&(sr||d===null||$s(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[Nn]||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"))),Nr(w,p,d),w[Le]=o,on(w),p=w;break e;case"link":var N=LR("link","href",b).get(p+(d.href||""));if(N){for(var k=0;k<N.length;k++)if(w=N[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)){N.splice(k,1);break t}}w=b.createElement(p),Nr(w,p,d),b.head.appendChild(w);break;case"meta":if(N=LR("meta","content",b).get(p+(d.content||""))){for(k=0;k<N.length;k++)if(w=N[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)){N.splice(k,1);break t}}w=b.createElement(p),Nr(w,p,d),b.head.appendChild(w);break;default:throw Error(r(468,p))}w[Le]=o,on(w),p=w}o.stateNode=p}else PR(b,o.type,o.stateNode);else o.stateNode=kR(b,p,o.memoizedProps);else w!==p?(w===null?d.stateNode!==null&&(d=d.stateNode,d.parentNode.removeChild(d)):w.count--,p===null?PR(b,o.type,o.stateNode):kR(b,p,o.memoizedProps)):p===null&&o.stateNode!==null&&gv(o,o.memoizedProps,d.memoizedProps)}break;case 27:ga(l,o),ya(o),p&512&&(sr||d===null||$s(d,d.return)),d!==null&&p&4&&gv(o,o.memoizedProps,d.memoizedProps);break;case 5:if(ga(l,o),ya(o),p&512&&(sr||d===null||$s(d,d.return)),o.flags&32){b=o.stateNode;try{Ac(b,"")}catch(qe){cn(o,o.return,qe)}}p&4&&o.stateNode!=null&&(b=o.memoizedProps,gv(o,b,d!==null?d.memoizedProps:b)),p&1024&&(vv=!0);break;case 6:if(ga(l,o),ya(o),p&4){if(o.stateNode===null)throw Error(r(162));p=o.memoizedProps,d=o.stateNode;try{d.nodeValue=p}catch(qe){cn(o,o.return,qe)}}break;case 3:if(Vm=null,b=ps,ps=zm(l.containerInfo),ga(l,o),ps=b,ya(o),p&4&&d!==null&&d.memoizedState.isDehydrated)try{iu(l.containerInfo)}catch(qe){cn(o,o.return,qe)}vv&&(vv=!1,Pw(o));break;case 4:p=ps,ps=zm(o.stateNode.containerInfo),ga(l,o),ya(o),ps=p;break;case 12:ga(l,o),ya(o);break;case 31:ga(l,o),ya(o),p&4&&(p=o.updateQueue,p!==null&&(o.updateQueue=null,jm(o,p)));break;case 13:ga(l,o),ya(o),o.child.flags&8192&&o.memoizedState!==null!=(d!==null&&d.memoizedState!==null)&&(_m=we()),p&4&&(p=o.updateQueue,p!==null&&(o.updateQueue=null,jm(o,p)));break;case 22:b=o.memoizedState!==null;var W=d!==null&&d.memoizedState!==null,ie=_o,pe=sr;if(_o=ie||b,sr=pe||W,ga(l,o),sr=pe,_o=ie,ya(o),p&8192)e:for(l=o.stateNode,l._visibility=b?l._visibility&-2:l._visibility|1,b&&(d===null||W||_o||sr||Bl(o)),d=null,l=o;;){if(l.tag===5||l.tag===26){if(d===null){W=d=l;try{if(w=W.stateNode,b)N=w.style,typeof N.setProperty=="function"?N.setProperty("display","none","important"):N.display="none";else{k=W.stateNode;var xe=W.memoizedProps.style,ce=xe!=null&&xe.hasOwnProperty("display")?xe.display:null;k.style.display=ce==null||typeof ce=="boolean"?"":(""+ce).trim()}}catch(qe){cn(W,W.return,qe)}}}else if(l.tag===6){if(d===null){W=l;try{W.stateNode.nodeValue=b?"":W.memoizedProps}catch(qe){cn(W,W.return,qe)}}}else if(l.tag===18){if(d===null){W=l;try{var me=W.stateNode;b?jR(me,!0):jR(W.stateNode,!1)}catch(qe){cn(W,W.return,qe)}}}else if((l.tag!==22&&l.tag!==23||l.memoizedState===null||l===o)&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===o)break e;for(;l.sibling===null;){if(l.return===null||l.return===o)break e;d===l&&(d=null),l=l.return}d===l&&(d=null),l.sibling.return=l.return,l=l.sibling}p&4&&(p=o.updateQueue,p!==null&&(d=p.retryQueue,d!==null&&(p.retryQueue=null,jm(o,d))));break;case 19:ga(l,o),ya(o),p&4&&(p=o.updateQueue,p!==null&&(o.updateQueue=null,jm(o,p)));break;case 30:break;case 21:break;default:ga(l,o),ya(o)}}function ya(o){var l=o.flags;if(l&2){try{for(var d,p=o.return;p!==null;){if(_w(p)){d=p;break}p=p.return}if(d==null)throw Error(r(160));switch(d.tag){case 27:var b=d.stateNode,w=yv(o);Rm(o,w,b);break;case 5:var N=d.stateNode;d.flags&32&&(Ac(N,""),d.flags&=-33);var k=yv(o);Rm(o,k,N);break;case 3:case 4:var W=d.stateNode.containerInfo,ie=yv(o);xv(o,ie,W);break;default:throw Error(r(161))}}catch(pe){cn(o,o.return,pe)}o.flags&=-3}l&4096&&(o.flags&=-4097)}function Pw(o){if(o.subtreeFlags&1024)for(o=o.child;o!==null;){var l=o;Pw(l),l.tag===5&&l.flags&1024&&l.stateNode.reset(),o=o.sibling}}function Ao(o,l){if(l.subtreeFlags&8772)for(l=l.child;l!==null;)Dw(o,l.alternate,l),l=l.sibling}function Bl(o){for(o=o.child;o!==null;){var l=o;switch(l.tag){case 0:case 11:case 14:case 15:Ri(4,l,l.return),Bl(l);break;case 1:$s(l,l.return);var d=l.stateNode;typeof d.componentWillUnmount=="function"&&jw(l,l.return,d),Bl(l);break;case 27:Xd(l.stateNode);case 26:case 5:$s(l,l.return),Bl(l);break;case 22:l.memoizedState===null&&Bl(l);break;case 30:Bl(l);break;default:Bl(l)}o=o.sibling}}function Do(o,l,d){for(d=d&&(l.subtreeFlags&8772)!==0,l=l.child;l!==null;){var p=l.alternate,b=o,w=l,N=w.flags;switch(w.tag){case 0:case 11:case 15:Do(b,w,d),Vd(4,w);break;case 1:if(Do(b,w,d),p=w,b=p.stateNode,typeof b.componentDidMount=="function")try{b.componentDidMount()}catch(ie){cn(p,p.return,ie)}if(p=w,b=p.updateQueue,b!==null){var k=p.stateNode;try{var W=b.shared.hiddenCallbacks;if(W!==null)for(b.shared.hiddenCallbacks=null,b=0;b<W.length;b++)mE(W[b],k)}catch(ie){cn(p,p.return,ie)}}d&&N&64&&Rw(w),$d(w,w.return);break;case 27:Nw(w);case 26:case 5:Do(b,w,d),d&&p===null&&N&4&&Tw(w),$d(w,w.return);break;case 12:Do(b,w,d);break;case 31:Do(b,w,d),d&&N&4&&Mw(b,w);break;case 13:Do(b,w,d),d&&N&4&&kw(b,w);break;case 22:w.memoizedState===null&&Do(b,w,d),$d(w,w.return);break;case 30:break;default:Do(b,w,d)}l=l.sibling}}function bv(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&&Nd(d))}function Sv(o,l){o=null,l.alternate!==null&&(o=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==o&&(l.refCount++,o!=null&&Nd(o))}function gs(o,l,d,p){if(l.subtreeFlags&10256)for(l=l.child;l!==null;)Uw(o,l,d,p),l=l.sibling}function Uw(o,l,d,p){var b=l.flags;switch(l.tag){case 0:case 11:case 15:gs(o,l,d,p),b&2048&&Vd(9,l);break;case 1:gs(o,l,d,p);break;case 3:gs(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&&Nd(o)));break;case 12:if(b&2048){gs(o,l,d,p),o=l.stateNode;try{var w=l.memoizedProps,N=w.id,k=w.onPostCommit;typeof k=="function"&&k(N,l.alternate===null?"mount":"update",o.passiveEffectDuration,-0)}catch(W){cn(l,l.return,W)}}else gs(o,l,d,p);break;case 31:gs(o,l,d,p);break;case 13:gs(o,l,d,p);break;case 23:break;case 22:w=l.stateNode,N=l.alternate,l.memoizedState!==null?w._visibility&2?gs(o,l,d,p):Gd(o,l):w._visibility&2?gs(o,l,d,p):(w._visibility|=2,Wc(o,l,d,p,(l.subtreeFlags&10256)!==0||!1)),b&2048&&bv(N,l);break;case 24:gs(o,l,d,p),b&2048&&Sv(l.alternate,l);break;default:gs(o,l,d,p)}}function Wc(o,l,d,p,b){for(b=b&&((l.subtreeFlags&10256)!==0||!1),l=l.child;l!==null;){var w=o,N=l,k=d,W=p,ie=N.flags;switch(N.tag){case 0:case 11:case 15:Wc(w,N,k,W,b),Vd(8,N);break;case 23:break;case 22:var pe=N.stateNode;N.memoizedState!==null?pe._visibility&2?Wc(w,N,k,W,b):Gd(w,N):(pe._visibility|=2,Wc(w,N,k,W,b)),b&&ie&2048&&bv(N.alternate,N);break;case 24:Wc(w,N,k,W,b),b&&ie&2048&&Sv(N.alternate,N);break;default:Wc(w,N,k,W,b)}l=l.sibling}}function Gd(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:Gd(d,p),b&2048&&bv(p.alternate,p);break;case 24:Gd(d,p),b&2048&&Sv(p.alternate,p);break;default:Gd(d,p)}l=l.sibling}}var Bd=8192;function Qc(o,l,d){if(o.subtreeFlags&Bd)for(o=o.child;o!==null;)Fw(o,l,d),o=o.sibling}function Fw(o,l,d){switch(o.tag){case 26:Qc(o,l,d),o.flags&Bd&&o.memoizedState!==null&&jk(d,ps,o.memoizedState,o.memoizedProps);break;case 5:Qc(o,l,d);break;case 3:case 4:var p=ps;ps=zm(o.stateNode.containerInfo),Qc(o,l,d),ps=p;break;case 22:o.memoizedState===null&&(p=o.alternate,p!==null&&p.memoizedState!==null?(p=Bd,Bd=16777216,Qc(o,l,d),Bd=p):Qc(o,l,d));break;default:Qc(o,l,d)}}function zw(o){var l=o.alternate;if(l!==null&&(o=l.child,o!==null)){l.child=null;do l=o.sibling,o.sibling=null,o=l;while(o!==null)}}function qd(o){var l=o.deletions;if((o.flags&16)!==0){if(l!==null)for(var d=0;d<l.length;d++){var p=l[d];vr=p,Vw(p,o)}zw(o)}if(o.subtreeFlags&10256)for(o=o.child;o!==null;)Hw(o),o=o.sibling}function Hw(o){switch(o.tag){case 0:case 11:case 15:qd(o),o.flags&2048&&Ri(9,o,o.return);break;case 3:qd(o);break;case 12:qd(o);break;case 22:var l=o.stateNode;o.memoizedState!==null&&l._visibility&2&&(o.return===null||o.return.tag!==13)?(l._visibility&=-3,Tm(o)):qd(o);break;default:qd(o)}}function Tm(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];vr=p,Vw(p,o)}zw(o)}for(o=o.child;o!==null;){switch(l=o,l.tag){case 0:case 11:case 15:Ri(8,l,l.return),Tm(l);break;case 22:d=l.stateNode,d._visibility&2&&(d._visibility&=-3,Tm(l));break;default:Tm(l)}o=o.sibling}}function Vw(o,l){for(;vr!==null;){var d=vr;switch(d.tag){case 0:case 11:case 15:Ri(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:Nd(d.memoizedState.cache)}if(p=d.child,p!==null)p.return=d,vr=p;else e:for(d=o;vr!==null;){p=vr;var b=p.sibling,w=p.return;if(Ow(p),p===d){vr=null;break e}if(b!==null){b.return=w,vr=b;break e}vr=w}}}var H8={getCacheForType:function(o){var l=Tr(nr),d=l.data.get(o);return d===void 0&&(d=o(),l.data.set(o,d)),d},cacheSignal:function(){return Tr(nr).controller.signal}},V8=typeof WeakMap=="function"?WeakMap:Map,tn=0,bn=null,Lt=null,Ft=0,ln=0,Da=null,ji=!1,Xc=!1,Cv=!1,Oo=0,Vn=0,Ti=0,ql=0,Ev=0,Oa=0,Jc=0,Kd=null,xa=null,wv=!1,_m=0,$w=0,Nm=1/0,Am=null,_i=null,dr=0,Ni=null,eu=null,Io=0,Rv=0,jv=null,Gw=null,Zd=0,Tv=null;function Ia(){return(tn&2)!==0&&Ft!==0?Ft&-Ft:M.T!==null?Iv():He()}function Bw(){if(Oa===0)if((Ft&536870912)===0||$t){var o=zs;zs<<=1,(zs&3932160)===0&&(zs=262144),Oa=o}else Oa=536870912;return o=Na.current,o!==null&&(o.flags|=32),Oa}function va(o,l,d){(o===bn&&(ln===2||ln===9)||o.cancelPendingCommit!==null)&&(tu(o,0),Ai(o,Ft,Oa,!1)),da(o,d),((tn&2)===0||o!==bn)&&(o===bn&&((tn&2)===0&&(ql|=d),Vn===4&&Ai(o,Ft,Oa,!1)),Gs(o))}function qw(o,l,d){if((tn&6)!==0)throw Error(r(327));var p=!d&&(l&127)===0&&(l&o.expiredLanes)===0||wr(o,l),b=p?B8(o,l):Nv(o,l,!0),w=p;do{if(b===0){Xc&&!p&&Ai(o,l,0,!1);break}else{if(d=o.current.alternate,w&&!$8(d)){b=Nv(o,l,!1),w=!1;continue}if(b===2){if(w=l,o.errorRecoveryDisabledLanes&w)var N=0;else N=o.pendingLanes&-536870913,N=N!==0?N:N&536870912?536870912:0;if(N!==0){l=N;e:{var k=o;b=Kd;var W=k.current.memoizedState.isDehydrated;if(W&&(tu(k,N).flags|=256),N=Nv(k,N,!1),N!==2){if(Cv&&!W){k.errorRecoveryDisabledLanes|=w,ql|=w,b=4;break e}w=xa,xa=b,w!==null&&(xa===null?xa=w:xa.push.apply(xa,w))}b=N}if(w=!1,b!==2)continue}}if(b===1){tu(o,0),Ai(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:Ai(p,l,Oa,!ji);break e;case 2:xa=null;break;case 3:case 5:break;default:throw Error(r(329))}if((l&62914560)===l&&(b=_m+300-we(),10<b)){if(Ai(p,l,Oa,!ji),tr(p,0,!0)!==0)break e;Io=l,p.timeoutHandle=ER(Kw.bind(null,p,d,xa,Am,wv,l,Oa,ql,Jc,ji,w,"Throttled",-0,0),b);break e}Kw(p,d,xa,Am,wv,l,Oa,ql,Jc,ji,w,null,-0,0)}}break}while(!0);Gs(o)}function Kw(o,l,d,p,b,w,N,k,W,ie,pe,xe,ce,me){if(o.timeoutHandle=-1,xe=l.subtreeFlags,xe&8192||(xe&16785408)===16785408){xe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:xo},Fw(l,w,xe);var qe=(w&62914560)===w?_m-we():(w&4194048)===w?$w-we():0;if(qe=Tk(xe,qe),qe!==null){Io=w,o.cancelPendingCommit=qe(tR.bind(null,o,l,w,d,p,b,N,k,W,pe,xe,null,ce,me)),Ai(o,w,N,!ie);return}}tR(o,l,w,d,p,b,N,k,W)}function $8(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(!Ta(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 Ai(o,l,d,p){l&=~Ev,l&=~ql,o.suspendedLanes|=l,o.pingedLanes&=~l,p&&(o.warmLanes|=l),p=o.expirationTimes;for(var b=l;0<b;){var w=31-Fn(b),N=1<<w;p[w]=-1,b&=~N}d!==0&&Y(o,d,l)}function Dm(){return(tn&6)===0?(Yd(0),!1):!0}function _v(){if(Lt!==null){if(ln===0)var o=Lt.return;else o=Lt,Co=Pl=null,Gx(o),Bc=null,Dd=0,o=Lt;for(;o!==null;)ww(o.alternate,o),o=o.return;Lt=null}}function tu(o,l){var d=o.timeoutHandle;d!==-1&&(o.timeoutHandle=-1,ck(d)),d=o.cancelPendingCommit,d!==null&&(o.cancelPendingCommit=null,d()),Io=0,_v(),bn=o,Lt=d=bo(o.current,null),Ft=l,ln=0,Da=null,ji=!1,Xc=wr(o,l),Cv=!1,Jc=Oa=Ev=ql=Ti=Vn=0,xa=Kd=null,wv=!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-Fn(p),w=1<<b;l|=o[b],p&=~w}return Oo=l,Xh(),d}function Zw(o,l){xt=null,M.H=Fd,l===Gc||l===om?(l=uE(),ln=3):l===Ox?(l=uE(),ln=4):ln=l===ov?8:l!==null&&typeof l=="object"&&typeof l.then=="function"?6:1,Da=l,Lt===null&&(Vn=1,bm(o,Qa(l,o.current)))}function Yw(){var o=Na.current;return o===null?!0:(Ft&4194048)===Ft?ts===null:(Ft&62914560)===Ft||(Ft&536870912)!==0?o===ts:!1}function Ww(){var o=M.H;return M.H=Fd,o===null?Fd:o}function Qw(){var o=M.A;return M.A=H8,o}function Om(){Vn=4,ji||(Ft&4194048)!==Ft&&Na.current!==null||(Xc=!0),(Ti&134217727)===0&&(ql&134217727)===0||bn===null||Ai(bn,Ft,Oa,!1)}function Nv(o,l,d){var p=tn;tn|=2;var b=Ww(),w=Qw();(bn!==o||Ft!==l)&&(Am=null,tu(o,l)),l=!1;var N=Vn;e:do try{if(ln!==0&&Lt!==null){var k=Lt,W=Da;switch(ln){case 8:_v(),N=6;break e;case 3:case 2:case 9:case 6:Na.current===null&&(l=!0);var ie=ln;if(ln=0,Da=null,nu(o,k,W,ie),d&&Xc){N=0;break e}break;default:ie=ln,ln=0,Da=null,nu(o,k,W,ie)}}G8(),N=Vn;break}catch(pe){Zw(o,pe)}while(!0);return l&&o.shellSuspendCounter++,Co=Pl=null,tn=p,M.H=b,M.A=w,Lt===null&&(bn=null,Ft=0,Xh()),N}function G8(){for(;Lt!==null;)Xw(Lt)}function B8(o,l){var d=tn;tn|=2;var p=Ww(),b=Qw();bn!==o||Ft!==l?(Am=null,Nm=we()+500,tu(o,l)):Xc=wr(o,l);e:do try{if(ln!==0&&Lt!==null){l=Lt;var w=Da;t:switch(ln){case 1:ln=0,Da=null,nu(o,l,w,1);break;case 2:case 9:if(lE(w)){ln=0,Da=null,Jw(l);break}l=function(){ln!==2&&ln!==9||bn!==o||(ln=7),Gs(o)},w.then(l,l);break e;case 3:ln=7;break e;case 4:ln=5;break e;case 7:lE(w)?(ln=0,Da=null,Jw(l)):(ln=0,Da=null,nu(o,l,w,7));break;case 5:var N=null;switch(Lt.tag){case 26:N=Lt.memoizedState;case 5:case 27:var k=Lt;if(N?UR(N):k.stateNode.complete){ln=0,Da=null;var W=k.sibling;if(W!==null)Lt=W;else{var ie=k.return;ie!==null?(Lt=ie,Im(ie)):Lt=null}break t}}ln=0,Da=null,nu(o,l,w,5);break;case 6:ln=0,Da=null,nu(o,l,w,6);break;case 8:_v(),Vn=6;break e;default:throw Error(r(462))}}q8();break}catch(pe){Zw(o,pe)}while(!0);return Co=Pl=null,M.H=p,M.A=b,tn=d,Lt!==null?0:(bn=null,Ft=0,Xh(),Vn)}function q8(){for(;Lt!==null&&!de();)Xw(Lt)}function Xw(o){var l=Cw(o.alternate,o,Oo);o.memoizedProps=o.pendingProps,l===null?Im(o):Lt=l}function Jw(o){var l=o,d=l.alternate;switch(l.tag){case 15:case 0:l=gw(d,l,l.pendingProps,l.type,void 0,Ft);break;case 11:l=gw(d,l,l.pendingProps,l.type.render,l.ref,Ft);break;case 5:Gx(l);default:ww(d,l),l=Lt=Q2(l,Oo),l=Cw(d,l,Oo)}o.memoizedProps=o.pendingProps,l===null?Im(o):Lt=l}function nu(o,l,d,p){Co=Pl=null,Gx(l),Bc=null,Dd=0;var b=l.return;try{if(M8(o,b,l,d,Ft)){Vn=1,bm(o,Qa(d,o.current)),Lt=null;return}}catch(w){if(b!==null)throw Lt=b,w;Vn=1,bm(o,Qa(d,o.current)),Lt=null;return}l.flags&32768?($t||p===1?o=!0:Xc||(Ft&536870912)!==0?o=!1:(ji=o=!0,(p===2||p===9||p===3||p===6)&&(p=Na.current,p!==null&&p.tag===13&&(p.flags|=16384))),eR(l,o)):Im(l)}function Im(o){var l=o;do{if((l.flags&32768)!==0){eR(l,ji);return}o=l.return;var d=P8(l.alternate,l,Oo);if(d!==null){Lt=d;return}if(l=l.sibling,l!==null){Lt=l;return}Lt=l=o}while(l!==null);Vn===0&&(Vn=5)}function eR(o,l){do{var d=U8(o.alternate,o);if(d!==null){d.flags&=32767,Lt=d;return}if(d=o.return,d!==null&&(d.flags|=32768,d.subtreeFlags=0,d.deletions=null),!l&&(o=o.sibling,o!==null)){Lt=o;return}Lt=o=d}while(o!==null);Vn=6,Lt=null}function tR(o,l,d,p,b,w,N,k,W){o.cancelPendingCommit=null;do Mm();while(dr!==0);if((tn&6)!==0)throw Error(r(327));if(l!==null){if(l===o.current)throw Error(r(177));if(w=l.lanes|l.childLanes,w|=yx,Wn(o,d,w,N,k,W),o===bn&&(Lt=bn=null,Ft=0),eu=l,Ni=o,Io=d,Rv=w,jv=b,Gw=p,(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?(o.callbackNode=null,o.callbackPriority=0,W8(lt,function(){return oR(),null})):(o.callbackNode=null,o.callbackPriority=0),p=(l.flags&13878)!==0,(l.subtreeFlags&13878)!==0||p){p=M.T,M.T=null,b=V.p,V.p=2,N=tn,tn|=4;try{F8(o,l,d)}finally{tn=N,V.p=b,M.T=p}}dr=1,nR(),rR(),aR()}}function nR(){if(dr===1){dr=0;var o=Ni,l=eu,d=(l.flags&13878)!==0;if((l.subtreeFlags&13878)!==0||d){d=M.T,M.T=null;var p=V.p;V.p=2;var b=tn;tn|=4;try{Lw(l,o);var w=Hv,N=V2(o.containerInfo),k=w.focusedElem,W=w.selectionRange;if(N!==k&&k&&k.ownerDocument&&H2(k.ownerDocument.documentElement,k)){if(W!==null&&fx(k)){var ie=W.start,pe=W.end;if(pe===void 0&&(pe=ie),"selectionStart"in k)k.selectionStart=ie,k.selectionEnd=Math.min(pe,k.value.length);else{var xe=k.ownerDocument||document,ce=xe&&xe.defaultView||window;if(ce.getSelection){var me=ce.getSelection(),qe=k.textContent.length,rt=Math.min(W.start,qe),gn=W.end===void 0?rt:Math.min(W.end,qe);!me.extend&&rt>gn&&(N=gn,gn=rt,rt=N);var ae=z2(k,rt),X=z2(k,gn);if(ae&&X&&(me.rangeCount!==1||me.anchorNode!==ae.node||me.anchorOffset!==ae.offset||me.focusNode!==X.node||me.focusOffset!==X.offset)){var oe=xe.createRange();oe.setStart(ae.node,ae.offset),me.removeAllRanges(),rt>gn?(me.addRange(oe),me.extend(X.node,X.offset)):(oe.setEnd(X.node,X.offset),me.addRange(oe))}}}}for(xe=[],me=k;me=me.parentNode;)me.nodeType===1&&xe.push({element:me,left:me.scrollLeft,top:me.scrollTop});for(typeof k.focus=="function"&&k.focus(),k=0;k<xe.length;k++){var ye=xe[k];ye.element.scrollLeft=ye.left,ye.element.scrollTop=ye.top}}qm=!!zv,Hv=zv=null}finally{tn=b,V.p=p,M.T=d}}o.current=l,dr=2}}function rR(){if(dr===2){dr=0;var o=Ni,l=eu,d=(l.flags&8772)!==0;if((l.subtreeFlags&8772)!==0||d){d=M.T,M.T=null;var p=V.p;V.p=2;var b=tn;tn|=4;try{Dw(o,l.alternate,l)}finally{tn=b,V.p=p,M.T=d}}dr=3}}function aR(){if(dr===4||dr===3){dr=0,Ae();var o=Ni,l=eu,d=Io,p=Gw;(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?dr=5:(dr=0,eu=Ni=null,sR(o,o.pendingLanes));var b=o.pendingLanes;if(b===0&&(_i=null),_e(d),l=l.stateNode,Un&&typeof Un.onCommitFiberRoot=="function")try{Un.onCommitFiberRoot(Zn,l,void 0,(l.current.flags&128)===128)}catch{}if(p!==null){l=M.T,b=V.p,V.p=2,M.T=null;try{for(var w=o.onRecoverableError,N=0;N<p.length;N++){var k=p[N];w(k.value,{componentStack:k.stack})}}finally{M.T=l,V.p=b}}(Io&3)!==0&&Mm(),Gs(o),b=o.pendingLanes,(d&261930)!==0&&(b&42)!==0?o===Tv?Zd++:(Zd=0,Tv=o):Zd=0,Yd(0)}}function sR(o,l){(o.pooledCacheLanes&=l)===0&&(l=o.pooledCache,l!=null&&(o.pooledCache=null,Nd(l)))}function Mm(){return nR(),rR(),aR(),oR()}function oR(){if(dr!==5)return!1;var o=Ni,l=Rv;Rv=0;var d=_e(Io),p=M.T,b=V.p;try{V.p=32>d?32:d,M.T=null,d=jv,jv=null;var w=Ni,N=Io;if(dr=0,eu=Ni=null,Io=0,(tn&6)!==0)throw Error(r(331));var k=tn;if(tn|=4,Hw(w.current),Uw(w,w.current,N,d),tn=k,Yd(0,!1),Un&&typeof Un.onPostCommitFiberRoot=="function")try{Un.onPostCommitFiberRoot(Zn,w)}catch{}return!0}finally{V.p=b,M.T=p,sR(o,l)}}function iR(o,l,d){l=Qa(d,l),l=sv(o.stateNode,l,2),o=Ci(o,l,2),o!==null&&(da(o,2),Gs(o))}function cn(o,l,d){if(o.tag===3)iR(o,o,d);else for(;l!==null;){if(l.tag===3){iR(l,o,d);break}else if(l.tag===1){var p=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&(_i===null||!_i.has(p))){o=Qa(d,o),d=lw(2),p=Ci(l,d,2),p!==null&&(cw(d,p,l,o),da(p,2),Gs(p));break}}l=l.return}}function Av(o,l,d){var p=o.pingCache;if(p===null){p=o.pingCache=new V8;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)||(Cv=!0,b.add(d),o=K8.bind(null,o,l,d),l.then(o,o))}function K8(o,l,d){var p=o.pingCache;p!==null&&p.delete(l),o.pingedLanes|=o.suspendedLanes&d,o.warmLanes&=~d,bn===o&&(Ft&d)===d&&(Vn===4||Vn===3&&(Ft&62914560)===Ft&&300>we()-_m?(tn&2)===0&&tu(o,0):Ev|=d,Jc===Ft&&(Jc=0)),Gs(o)}function lR(o,l){l===0&&(l=Yn()),o=Ml(o,l),o!==null&&(da(o,l),Gs(o))}function Z8(o){var l=o.memoizedState,d=0;l!==null&&(d=l.retryLane),lR(o,d)}function Y8(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),lR(o,d)}function W8(o,l){return G(o,l)}var km=null,ru=null,Dv=!1,Lm=!1,Ov=!1,Di=0;function Gs(o){o!==ru&&o.next===null&&(ru===null?km=ru=o:ru=ru.next=o),Lm=!0,Dv||(Dv=!0,X8())}function Yd(o,l){if(!Ov&&Lm){Ov=!0;do for(var d=!1,p=km;p!==null;){if(o!==0){var b=p.pendingLanes;if(b===0)var w=0;else{var N=p.suspendedLanes,k=p.pingedLanes;w=(1<<31-Fn(42|o)+1)-1,w&=b&~(N&~k),w=w&201326741?w&201326741|1:w?w|2:0}w!==0&&(d=!0,fR(p,w))}else w=Ft,w=tr(p,p===bn?w:0,p.cancelPendingCommit!==null||p.timeoutHandle!==-1),(w&3)===0||wr(p,w)||(d=!0,fR(p,w));p=p.next}while(d);Ov=!1}}function Q8(){cR()}function cR(){Lm=Dv=!1;var o=0;Di!==0&&lk()&&(o=Di);for(var l=we(),d=null,p=km;p!==null;){var b=p.next,w=uR(p,l);w===0?(p.next=null,d===null?km=b:d.next=b,b===null&&(ru=d)):(d=p,(o!==0||(w&3)!==0)&&(Lm=!0)),p=b}dr!==0&&dr!==5||Yd(o),Di!==0&&(Di=0)}function uR(o,l){for(var d=o.suspendedLanes,p=o.pingedLanes,b=o.expirationTimes,w=o.pendingLanes&-62914561;0<w;){var N=31-Fn(w),k=1<<N,W=b[N];W===-1?((k&d)===0||(k&p)!==0)&&(b[N]=cr(k,l)):W<=l&&(o.expiredLanes|=k),w&=~k}if(l=bn,d=Ft,d=tr(o,o===l?d:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),p=o.callbackNode,d===0||o===l&&(ln===2||ln===9)||o.cancelPendingCommit!==null)return p!==null&&p!==null&&ee(p),o.callbackNode=null,o.callbackPriority=0;if((d&3)===0||wr(o,d)){if(l=d&-d,l===o.callbackPriority)return l;switch(p!==null&&ee(p),_e(d)){case 2:case 8:d=it;break;case 32:d=lt;break;case 268435456:d=Ka;break;default:d=lt}return p=dR.bind(null,o),d=G(d,p),o.callbackPriority=l,o.callbackNode=d,l}return p!==null&&p!==null&&ee(p),o.callbackPriority=2,o.callbackNode=null,2}function dR(o,l){if(dr!==0&&dr!==5)return o.callbackNode=null,o.callbackPriority=0,null;var d=o.callbackNode;if(Mm()&&o.callbackNode!==d)return null;var p=Ft;return p=tr(o,o===bn?p:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),p===0?null:(qw(o,p,l),uR(o,we()),o.callbackNode!=null&&o.callbackNode===d?dR.bind(null,o):null)}function fR(o,l){if(Mm())return null;qw(o,l,!0)}function X8(){uk(function(){(tn&6)!==0?G(Ye,Q8):cR()})}function Iv(){if(Di===0){var o=Vc;o===0&&(o=yo,yo<<=1,(yo&261888)===0&&(yo=256)),Di=o}return Di}function hR(o){return o==null||typeof o=="symbol"||typeof o=="boolean"?null:typeof o=="function"?o:Gh(""+o)}function mR(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 J8(o,l,d,p,b){if(l==="submit"&&d&&d.stateNode===b){var w=hR((b[Ve]||null).action),N=p.submitter;N&&(l=(l=N[Ve]||null)?hR(l.formAction):N.getAttribute("formAction"),l!==null&&(w=l,N=null));var k=new Zh("action","action",null,p,b);o.push({event:k,listeners:[{instance:null,listener:function(){if(p.defaultPrevented){if(Di!==0){var W=N?mR(b,N):new FormData(b);Jx(d,{pending:!0,data:W,method:b.method,action:w},null,W)}}else typeof w=="function"&&(k.preventDefault(),W=N?mR(b,N):new FormData(b),Jx(d,{pending:!0,data:W,method:b.method,action:w},w,W))},currentTarget:b}]})}}for(var Mv=0;Mv<gx.length;Mv++){var kv=gx[Mv],ek=kv.toLowerCase(),tk=kv[0].toUpperCase()+kv.slice(1);ms(ek,"on"+tk)}ms(B2,"onAnimationEnd"),ms(q2,"onAnimationIteration"),ms(K2,"onAnimationStart"),ms("dblclick","onDoubleClick"),ms("focusin","onFocus"),ms("focusout","onBlur"),ms(y8,"onTransitionRun"),ms(x8,"onTransitionStart"),ms(v8,"onTransitionCancel"),ms(Z2,"onTransitionEnd"),hs("onMouseEnter",["mouseout","mouseover"]),hs("onMouseLeave",["mouseout","mouseover"]),hs("onPointerEnter",["pointerout","pointerover"]),hs("onPointerLeave",["pointerout","pointerover"]),Yr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Yr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Yr("onBeforeInput",["compositionend","keypress","textInput","paste"]),Yr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Yr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Yr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Wd="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(" "),nk=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Wd));function pR(o,l){l=(l&4)!==0;for(var d=0;d<o.length;d++){var p=o[d],b=p.event;p=p.listeners;e:{var w=void 0;if(l)for(var N=p.length-1;0<=N;N--){var k=p[N],W=k.instance,ie=k.currentTarget;if(k=k.listener,W!==w&&b.isPropagationStopped())break e;w=k,b.currentTarget=ie;try{w(b)}catch(pe){Qh(pe)}b.currentTarget=null,w=W}else for(N=0;N<p.length;N++){if(k=p[N],W=k.instance,ie=k.currentTarget,k=k.listener,W!==w&&b.isPropagationStopped())break e;w=k,b.currentTarget=ie;try{w(b)}catch(pe){Qh(pe)}b.currentTarget=null,w=W}}}}function Pt(o,l){var d=l[Je];d===void 0&&(d=l[Je]=new Set);var p=o+"__bubble";d.has(p)||(gR(l,o,2,!1),d.add(p))}function Lv(o,l,d){var p=0;l&&(p|=4),gR(d,o,p,l)}var Pm="_reactListening"+Math.random().toString(36).slice(2);function Pv(o){if(!o[Pm]){o[Pm]=!0,Tc.forEach(function(d){d!=="selectionchange"&&(nk.has(d)||Lv(d,!1,o),Lv(d,!0,o))});var l=o.nodeType===9?o:o.ownerDocument;l===null||l[Pm]||(l[Pm]=!0,Lv("selectionchange",!1,l))}}function gR(o,l,d,p){switch(BR(l)){case 2:var b=Ak;break;case 8:b=Dk;break;default:b=Xv}d=b.bind(null,l,d,o),b=void 0,!rx||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 Uv(o,l,d,p,b){var w=p;if((l&1)===0&&(l&2)===0&&p!==null)e:for(;;){if(p===null)return;var N=p.tag;if(N===3||N===4){var k=p.stateNode.containerInfo;if(k===b)break;if(N===4)for(N=p.return;N!==null;){var W=N.tag;if((W===3||W===4)&&N.stateNode.containerInfo===b)return;N=N.return}for(;k!==null;){if(N=Qt(k),N===null)return;if(W=N.tag,W===5||W===6||W===26||W===27){p=w=N;continue e}k=k.parentNode}}p=p.return}S2(function(){var ie=w,pe=tx(d),xe=[];e:{var ce=Y2.get(o);if(ce!==void 0){var me=Zh,qe=o;switch(o){case"keypress":if(qh(d)===0)break e;case"keydown":case"keyup":me=YM;break;case"focusin":qe="focus",me=ix;break;case"focusout":qe="blur",me=ix;break;case"beforeblur":case"afterblur":me=ix;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":me=w2;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":me=PM;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":me=XM;break;case B2:case q2:case K2:me=zM;break;case Z2:me=e8;break;case"scroll":case"scrollend":me=kM;break;case"wheel":me=n8;break;case"copy":case"cut":case"paste":me=VM;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":me=j2;break;case"toggle":case"beforetoggle":me=a8}var rt=(l&4)!==0,gn=!rt&&(o==="scroll"||o==="scrollend"),ae=rt?ce!==null?ce+"Capture":null:ce;rt=[];for(var X=ie,oe;X!==null;){var ye=X;if(oe=ye.stateNode,ye=ye.tag,ye!==5&&ye!==26&&ye!==27||oe===null||ae===null||(ye=xd(X,ae),ye!=null&&rt.push(Qd(X,ye,oe))),gn)break;X=X.return}0<rt.length&&(ce=new me(ce,qe,null,d,pe),xe.push({event:ce,listeners:rt}))}}if((l&7)===0){e:{if(ce=o==="mouseover"||o==="pointerover",me=o==="mouseout"||o==="pointerout",ce&&d!==ex&&(qe=d.relatedTarget||d.fromElement)&&(Qt(qe)||qe[et]))break e;if((me||ce)&&(ce=pe.window===pe?pe:(ce=pe.ownerDocument)?ce.defaultView||ce.parentWindow:window,me?(qe=d.relatedTarget||d.toElement,me=ie,qe=qe?Qt(qe):null,qe!==null&&(gn=i(qe),rt=qe.tag,qe!==gn||rt!==5&&rt!==27&&rt!==6)&&(qe=null)):(me=null,qe=ie),me!==qe)){if(rt=w2,ye="onMouseLeave",ae="onMouseEnter",X="mouse",(o==="pointerout"||o==="pointerover")&&(rt=j2,ye="onPointerLeave",ae="onPointerEnter",X="pointer"),gn=me==null?ce:fs(me),oe=qe==null?ce:fs(qe),ce=new rt(ye,X+"leave",me,d,pe),ce.target=gn,ce.relatedTarget=oe,ye=null,Qt(pe)===ie&&(rt=new rt(ae,X+"enter",qe,d,pe),rt.target=oe,rt.relatedTarget=gn,ye=rt),gn=ye,me&&qe)t:{for(rt=rk,ae=me,X=qe,oe=0,ye=ae;ye;ye=rt(ye))oe++;ye=0;for(var tt=X;tt;tt=rt(tt))ye++;for(;0<oe-ye;)ae=rt(ae),oe--;for(;0<ye-oe;)X=rt(X),ye--;for(;oe--;){if(ae===X||X!==null&&ae===X.alternate){rt=ae;break t}ae=rt(ae),X=rt(X)}rt=null}else rt=null;me!==null&&yR(xe,ce,me,rt,!1),qe!==null&&gn!==null&&yR(xe,gn,qe,rt,!0)}}e:{if(ce=ie?fs(ie):window,me=ce.nodeName&&ce.nodeName.toLowerCase(),me==="select"||me==="input"&&ce.type==="file")var Xt=M2;else if(O2(ce))if(k2)Xt=m8;else{Xt=f8;var We=d8}else me=ce.nodeName,!me||me.toLowerCase()!=="input"||ce.type!=="checkbox"&&ce.type!=="radio"?ie&&Jy(ie.elementType)&&(Xt=M2):Xt=h8;if(Xt&&(Xt=Xt(o,ie))){I2(xe,Xt,d,pe);break e}We&&We(o,ce,ie),o==="focusout"&&ie&&ce.type==="number"&&ie.memoizedProps.value!=null&&Xy(ce,"number",ce.value)}switch(We=ie?fs(ie):window,o){case"focusin":(O2(We)||We.contentEditable==="true")&&(Mc=We,hx=ie,jd=null);break;case"focusout":jd=hx=Mc=null;break;case"mousedown":mx=!0;break;case"contextmenu":case"mouseup":case"dragend":mx=!1,$2(xe,d,pe);break;case"selectionchange":if(g8)break;case"keydown":case"keyup":$2(xe,d,pe)}var Ct;if(cx)e:{switch(o){case"compositionstart":var zt="onCompositionStart";break e;case"compositionend":zt="onCompositionEnd";break e;case"compositionupdate":zt="onCompositionUpdate";break e}zt=void 0}else Ic?A2(o,d)&&(zt="onCompositionEnd"):o==="keydown"&&d.keyCode===229&&(zt="onCompositionStart");zt&&(T2&&d.locale!=="ko"&&(Ic||zt!=="onCompositionStart"?zt==="onCompositionEnd"&&Ic&&(Ct=C2()):(pi=pe,ax="value"in pi?pi.value:pi.textContent,Ic=!0)),We=Um(ie,zt),0<We.length&&(zt=new R2(zt,o,null,d,pe),xe.push({event:zt,listeners:We}),Ct?zt.data=Ct:(Ct=D2(d),Ct!==null&&(zt.data=Ct)))),(Ct=o8?i8(o,d):l8(o,d))&&(zt=Um(ie,"onBeforeInput"),0<zt.length&&(We=new R2("onBeforeInput","beforeinput",null,d,pe),xe.push({event:We,listeners:zt}),We.data=Ct)),J8(xe,o,ie,d,pe)}pR(xe,l)})}function Qd(o,l,d){return{instance:o,listener:l,currentTarget:d}}function Um(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=xd(o,d),b!=null&&p.unshift(Qd(o,b,w)),b=xd(o,l),b!=null&&p.push(Qd(o,b,w))),o.tag===3)return p;o=o.return}return[]}function rk(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5&&o.tag!==27);return o||null}function yR(o,l,d,p,b){for(var w=l._reactName,N=[];d!==null&&d!==p;){var k=d,W=k.alternate,ie=k.stateNode;if(k=k.tag,W!==null&&W===p)break;k!==5&&k!==26&&k!==27||ie===null||(W=ie,b?(ie=xd(d,w),ie!=null&&N.unshift(Qd(d,ie,W))):b||(ie=xd(d,w),ie!=null&&N.push(Qd(d,ie,W)))),d=d.return}N.length!==0&&o.push({event:l,listeners:N})}var ak=/\r\n?/g,sk=/\u0000|\uFFFD/g;function xR(o){return(typeof o=="string"?o:""+o).replace(ak,`
|
|
49
|
-
`).replace(sk,"")}function vR(o,l){return l=xR(l),xR(o)===l}function pn(o,l,d,p,b,w){switch(d){case"children":typeof p=="string"?l==="body"||l==="textarea"&&p===""||Ac(o,p):(typeof p=="number"||typeof p=="bigint")&&l!=="body"&&Ac(o,""+p);break;case"className":vn(o,"class",p);break;case"tabIndex":vn(o,"tabindex",p);break;case"dir":case"role":case"viewBox":case"width":case"height":vn(o,d,p);break;case"style":v2(o,p,w);break;case"data":if(l!=="object"){vn(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=Gh(""+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"&&pn(o,l,"name",b.name,b,null),pn(o,l,"formEncType",b.formEncType,b,null),pn(o,l,"formMethod",b.formMethod,b,null),pn(o,l,"formTarget",b.formTarget,b,null)):(pn(o,l,"encType",b.encType,b,null),pn(o,l,"method",b.method,b,null),pn(o,l,"target",b.target,b,null)));if(p==null||typeof p=="symbol"||typeof p=="boolean"){o.removeAttribute(d);break}p=Gh(""+p),o.setAttribute(d,p);break;case"onClick":p!=null&&(o.onclick=xo);break;case"onScroll":p!=null&&Pt("scroll",o);break;case"onScrollEnd":p!=null&&Pt("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=Gh(""+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":Pt("beforetoggle",o),Pt("toggle",o),Za(o,"popover",p);break;case"xlinkActuate":ha(o,"http://www.w3.org/1999/xlink","xlink:actuate",p);break;case"xlinkArcrole":ha(o,"http://www.w3.org/1999/xlink","xlink:arcrole",p);break;case"xlinkRole":ha(o,"http://www.w3.org/1999/xlink","xlink:role",p);break;case"xlinkShow":ha(o,"http://www.w3.org/1999/xlink","xlink:show",p);break;case"xlinkTitle":ha(o,"http://www.w3.org/1999/xlink","xlink:title",p);break;case"xlinkType":ha(o,"http://www.w3.org/1999/xlink","xlink:type",p);break;case"xmlBase":ha(o,"http://www.w3.org/XML/1998/namespace","xml:base",p);break;case"xmlLang":ha(o,"http://www.w3.org/XML/1998/namespace","xml:lang",p);break;case"xmlSpace":ha(o,"http://www.w3.org/XML/1998/namespace","xml:space",p);break;case"is":Za(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=IM.get(d)||d,Za(o,d,p))}}function Fv(o,l,d,p,b,w){switch(d){case"style":v2(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"?Ac(o,p):(typeof p=="number"||typeof p=="bigint")&&Ac(o,""+p);break;case"onScroll":p!=null&&Pt("scroll",o);break;case"onScrollEnd":p!=null&&Pt("scrollend",o);break;case"onClick":p!=null&&(o.onclick=xo);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!hi.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[Ve]||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,""):Za(o,d,p)}}}function Nr(o,l,d){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Pt("error",o),Pt("load",o);var p=!1,b=!1,w;for(w in d)if(d.hasOwnProperty(w)){var N=d[w];if(N!=null)switch(w){case"src":p=!0;break;case"srcSet":b=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:pn(o,l,w,N,d,null)}}b&&pn(o,l,"srcSet",d.srcSet,d,null),p&&pn(o,l,"src",d.src,d,null);return;case"input":Pt("invalid",o);var k=w=N=b=null,W=null,ie=null;for(p in d)if(d.hasOwnProperty(p)){var pe=d[p];if(pe!=null)switch(p){case"name":b=pe;break;case"type":N=pe;break;case"checked":W=pe;break;case"defaultChecked":ie=pe;break;case"value":w=pe;break;case"defaultValue":k=pe;break;case"children":case"dangerouslySetInnerHTML":if(pe!=null)throw Error(r(137,l));break;default:pn(o,l,p,pe,d,null)}}p2(o,w,k,W,ie,N,b,!1);return;case"select":Pt("invalid",o),p=N=w=null;for(b in d)if(d.hasOwnProperty(b)&&(k=d[b],k!=null))switch(b){case"value":w=k;break;case"defaultValue":N=k;break;case"multiple":p=k;default:pn(o,l,b,k,d,null)}l=w,d=N,o.multiple=!!p,l!=null?Nc(o,!!p,l,!1):d!=null&&Nc(o,!!p,d,!0);return;case"textarea":Pt("invalid",o),w=b=p=null;for(N in d)if(d.hasOwnProperty(N)&&(k=d[N],k!=null))switch(N){case"value":p=k;break;case"defaultValue":b=k;break;case"children":w=k;break;case"dangerouslySetInnerHTML":if(k!=null)throw Error(r(91));break;default:pn(o,l,N,k,d,null)}y2(o,p,b,w);return;case"option":for(W in d)if(d.hasOwnProperty(W)&&(p=d[W],p!=null))switch(W){case"selected":o.selected=p&&typeof p!="function"&&typeof p!="symbol";break;default:pn(o,l,W,p,d,null)}return;case"dialog":Pt("beforetoggle",o),Pt("toggle",o),Pt("cancel",o),Pt("close",o);break;case"iframe":case"object":Pt("load",o);break;case"video":case"audio":for(p=0;p<Wd.length;p++)Pt(Wd[p],o);break;case"image":Pt("error",o),Pt("load",o);break;case"details":Pt("toggle",o);break;case"embed":case"source":case"link":Pt("error",o),Pt("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(ie in d)if(d.hasOwnProperty(ie)&&(p=d[ie],p!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:pn(o,l,ie,p,d,null)}return;default:if(Jy(l)){for(pe in d)d.hasOwnProperty(pe)&&(p=d[pe],p!==void 0&&Fv(o,l,pe,p,d,void 0));return}}for(k in d)d.hasOwnProperty(k)&&(p=d[k],p!=null&&pn(o,l,k,p,d,null))}function ok(o,l,d,p){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var b=null,w=null,N=null,k=null,W=null,ie=null,pe=null;for(me in d){var xe=d[me];if(d.hasOwnProperty(me)&&xe!=null)switch(me){case"checked":break;case"value":break;case"defaultValue":W=xe;default:p.hasOwnProperty(me)||pn(o,l,me,null,p,xe)}}for(var ce in p){var me=p[ce];if(xe=d[ce],p.hasOwnProperty(ce)&&(me!=null||xe!=null))switch(ce){case"type":w=me;break;case"name":b=me;break;case"checked":ie=me;break;case"defaultChecked":pe=me;break;case"value":N=me;break;case"defaultValue":k=me;break;case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(r(137,l));break;default:me!==xe&&pn(o,l,ce,me,p,xe)}}Qy(o,N,k,W,ie,pe,w,b);return;case"select":me=N=k=ce=null;for(w in d)if(W=d[w],d.hasOwnProperty(w)&&W!=null)switch(w){case"value":break;case"multiple":me=W;default:p.hasOwnProperty(w)||pn(o,l,w,null,p,W)}for(b in p)if(w=p[b],W=d[b],p.hasOwnProperty(b)&&(w!=null||W!=null))switch(b){case"value":ce=w;break;case"defaultValue":k=w;break;case"multiple":N=w;default:w!==W&&pn(o,l,b,w,p,W)}l=k,d=N,p=me,ce!=null?Nc(o,!!d,ce,!1):!!p!=!!d&&(l!=null?Nc(o,!!d,l,!0):Nc(o,!!d,d?[]:"",!1));return;case"textarea":me=ce=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:pn(o,l,k,null,p,b)}for(N in p)if(b=p[N],w=d[N],p.hasOwnProperty(N)&&(b!=null||w!=null))switch(N){case"value":ce=b;break;case"defaultValue":me=b;break;case"children":break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(r(91));break;default:b!==w&&pn(o,l,N,b,p,w)}g2(o,ce,me);return;case"option":for(var qe in d)if(ce=d[qe],d.hasOwnProperty(qe)&&ce!=null&&!p.hasOwnProperty(qe))switch(qe){case"selected":o.selected=!1;break;default:pn(o,l,qe,null,p,ce)}for(W in p)if(ce=p[W],me=d[W],p.hasOwnProperty(W)&&ce!==me&&(ce!=null||me!=null))switch(W){case"selected":o.selected=ce&&typeof ce!="function"&&typeof ce!="symbol";break;default:pn(o,l,W,ce,p,me)}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 rt in d)ce=d[rt],d.hasOwnProperty(rt)&&ce!=null&&!p.hasOwnProperty(rt)&&pn(o,l,rt,null,p,ce);for(ie in p)if(ce=p[ie],me=d[ie],p.hasOwnProperty(ie)&&ce!==me&&(ce!=null||me!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(r(137,l));break;default:pn(o,l,ie,ce,p,me)}return;default:if(Jy(l)){for(var gn in d)ce=d[gn],d.hasOwnProperty(gn)&&ce!==void 0&&!p.hasOwnProperty(gn)&&Fv(o,l,gn,void 0,p,ce);for(pe in p)ce=p[pe],me=d[pe],!p.hasOwnProperty(pe)||ce===me||ce===void 0&&me===void 0||Fv(o,l,pe,ce,p,me);return}}for(var ae in d)ce=d[ae],d.hasOwnProperty(ae)&&ce!=null&&!p.hasOwnProperty(ae)&&pn(o,l,ae,null,p,ce);for(xe in p)ce=p[xe],me=d[xe],!p.hasOwnProperty(xe)||ce===me||ce==null&&me==null||pn(o,l,xe,ce,p,me)}function bR(o){switch(o){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function ik(){if(typeof performance.getEntriesByType=="function"){for(var o=0,l=0,d=performance.getEntriesByType("resource"),p=0;p<d.length;p++){var b=d[p],w=b.transferSize,N=b.initiatorType,k=b.duration;if(w&&k&&bR(N)){for(N=0,k=b.responseEnd,p+=1;p<d.length;p++){var W=d[p],ie=W.startTime;if(ie>k)break;var pe=W.transferSize,xe=W.initiatorType;pe&&bR(xe)&&(W=W.responseEnd,N+=pe*(W<k?1:(k-ie)/(W-ie)))}if(--p,l+=8*(w+N)/(b.duration/1e3),o++,10<o)break}}if(0<o)return l/o/1e6}return navigator.connection&&(o=navigator.connection.downlink,typeof o=="number")?o:5}var zv=null,Hv=null;function Fm(o){return o.nodeType===9?o:o.ownerDocument}function SR(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 CR(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 Vv(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 $v=null;function lk(){var o=window.event;return o&&o.type==="popstate"?o===$v?!1:($v=o,!0):($v=null,!1)}var ER=typeof setTimeout=="function"?setTimeout:void 0,ck=typeof clearTimeout=="function"?clearTimeout:void 0,wR=typeof Promise=="function"?Promise:void 0,uk=typeof queueMicrotask=="function"?queueMicrotask:typeof wR<"u"?function(o){return wR.resolve(null).then(o).catch(dk)}:ER;function dk(o){setTimeout(function(){throw o})}function Oi(o){return o==="head"}function RR(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),iu(l);return}p--}else if(d==="$"||d==="$?"||d==="$~"||d==="$!"||d==="&")p++;else if(d==="html")Xd(o.ownerDocument.documentElement);else if(d==="head"){d=o.ownerDocument.head,Xd(d);for(var w=d.firstChild;w;){var N=w.nextSibling,k=w.nodeName;w[Nn]||k==="SCRIPT"||k==="STYLE"||k==="LINK"&&w.rel.toLowerCase()==="stylesheet"||d.removeChild(w),w=N}}else d==="body"&&Xd(o.ownerDocument.body);d=b}while(d);iu(l)}function jR(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 Gv(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":Gv(d),sn(d);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(d.rel.toLowerCase()==="stylesheet")continue}o.removeChild(d)}}function fk(o,l,d,p){for(;o.nodeType===1;){var b=d;if(o.nodeName.toLowerCase()!==l.toLowerCase()){if(!p&&(o.nodeName!=="INPUT"||o.type!=="hidden"))break}else if(p){if(!o[Nn])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=ns(o.nextSibling),o===null)break}return null}function hk(o,l,d){if(l==="")return null;for(;o.nodeType!==3;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!d||(o=ns(o.nextSibling),o===null))return null;return o}function TR(o,l){for(;o.nodeType!==8;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!l||(o=ns(o.nextSibling),o===null))return null;return o}function Bv(o){return o.data==="$?"||o.data==="$~"}function qv(o){return o.data==="$!"||o.data==="$?"&&o.ownerDocument.readyState!=="loading"}function mk(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 ns(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 Kv=null;function _R(o){o=o.nextSibling;for(var l=0;o;){if(o.nodeType===8){var d=o.data;if(d==="/$"||d==="/&"){if(l===0)return ns(o.nextSibling);l--}else d!=="$"&&d!=="$!"&&d!=="$?"&&d!=="$~"&&d!=="&"||l++}o=o.nextSibling}return null}function NR(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 AR(o,l,d){switch(l=Fm(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 Xd(o){for(var l=o.attributes;l.length;)o.removeAttributeNode(l[0]);sn(o)}var rs=new Map,DR=new Set;function zm(o){return typeof o.getRootNode=="function"?o.getRootNode():o.nodeType===9?o:o.ownerDocument}var Mo=V.d;V.d={f:pk,r:gk,D:yk,C:xk,L:vk,m:bk,X:Ck,S:Sk,M:Ek};function pk(){var o=Mo.f(),l=Dm();return o||l}function gk(o){var l=fa(o);l!==null&&l.tag===5&&l.type==="form"?ZE(l):Mo.r(o)}var au=typeof document>"u"?null:document;function OR(o,l,d){var p=au;if(p&&typeof l=="string"&&l){var b=Ya(l);b='link[rel="'+o+'"][href="'+b+'"]',typeof d=="string"&&(b+='[crossorigin="'+d+'"]'),DR.has(b)||(DR.add(b),o={rel:o,crossOrigin:d,href:l},p.querySelector(b)===null&&(l=p.createElement("link"),Nr(l,"link",o),on(l),p.head.appendChild(l)))}}function yk(o){Mo.D(o),OR("dns-prefetch",o,null)}function xk(o,l){Mo.C(o,l),OR("preconnect",o,l)}function vk(o,l,d){Mo.L(o,l,d);var p=au;if(p&&o&&l){var b='link[rel="preload"][as="'+Ya(l)+'"]';l==="image"&&d&&d.imageSrcSet?(b+='[imagesrcset="'+Ya(d.imageSrcSet)+'"]',typeof d.imageSizes=="string"&&(b+='[imagesizes="'+Ya(d.imageSizes)+'"]')):b+='[href="'+Ya(o)+'"]';var w=b;switch(l){case"style":w=su(o);break;case"script":w=ou(o)}rs.has(w)||(o=y({rel:"preload",href:l==="image"&&d&&d.imageSrcSet?void 0:o,as:l},d),rs.set(w,o),p.querySelector(b)!==null||l==="style"&&p.querySelector(Jd(w))||l==="script"&&p.querySelector(ef(w))||(l=p.createElement("link"),Nr(l,"link",o),on(l),p.head.appendChild(l)))}}function bk(o,l){Mo.m(o,l);var d=au;if(d&&o){var p=l&&typeof l.as=="string"?l.as:"script",b='link[rel="modulepreload"][as="'+Ya(p)+'"][href="'+Ya(o)+'"]',w=b;switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":w=ou(o)}if(!rs.has(w)&&(o=y({rel:"modulepreload",href:o},l),rs.set(w,o),d.querySelector(b)===null)){switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(d.querySelector(ef(w)))return}p=d.createElement("link"),Nr(p,"link",o),on(p),d.head.appendChild(p)}}}function Sk(o,l,d){Mo.S(o,l,d);var p=au;if(p&&o){var b=Zr(p).hoistableStyles,w=su(o);l=l||"default";var N=b.get(w);if(!N){var k={loading:0,preload:null};if(N=p.querySelector(Jd(w)))k.loading=5;else{o=y({rel:"stylesheet",href:o,"data-precedence":l},d),(d=rs.get(w))&&Zv(o,d);var W=N=p.createElement("link");on(W),Nr(W,"link",o),W._p=new Promise(function(ie,pe){W.onload=ie,W.onerror=pe}),W.addEventListener("load",function(){k.loading|=1}),W.addEventListener("error",function(){k.loading|=2}),k.loading|=4,Hm(N,l,p)}N={type:"stylesheet",instance:N,count:1,state:k},b.set(w,N)}}}function Ck(o,l){Mo.X(o,l);var d=au;if(d&&o){var p=Zr(d).hoistableScripts,b=ou(o),w=p.get(b);w||(w=d.querySelector(ef(b)),w||(o=y({src:o,async:!0},l),(l=rs.get(b))&&Yv(o,l),w=d.createElement("script"),on(w),Nr(w,"link",o),d.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},p.set(b,w))}}function Ek(o,l){Mo.M(o,l);var d=au;if(d&&o){var p=Zr(d).hoistableScripts,b=ou(o),w=p.get(b);w||(w=d.querySelector(ef(b)),w||(o=y({src:o,async:!0,type:"module"},l),(l=rs.get(b))&&Yv(o,l),w=d.createElement("script"),on(w),Nr(w,"link",o),d.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},p.set(b,w))}}function IR(o,l,d,p){var b=(b=ue.current)?zm(b):null;if(!b)throw Error(r(446));switch(o){case"meta":case"title":return null;case"style":return typeof d.precedence=="string"&&typeof d.href=="string"?(l=su(d.href),d=Zr(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=su(d.href);var w=Zr(b).hoistableStyles,N=w.get(o);if(N||(b=b.ownerDocument||b,N={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},w.set(o,N),(w=b.querySelector(Jd(o)))&&!w._p&&(N.instance=w,N.state.loading=5),rs.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},rs.set(o,d),w||wk(b,o,d,N.state))),l&&p===null)throw Error(r(528,""));return N}if(l&&p!==null)throw Error(r(529,""));return null;case"script":return l=d.async,d=d.src,typeof d=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=ou(d),d=Zr(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 su(o){return'href="'+Ya(o)+'"'}function Jd(o){return'link[rel="stylesheet"]['+o+"]"}function MR(o){return y({},o,{"data-precedence":o.precedence,precedence:null})}function wk(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}),Nr(l,"link",d),on(l),o.head.appendChild(l))}function ou(o){return'[src="'+Ya(o)+'"]'}function ef(o){return"script[async]"+o}function kR(o,l,d){if(l.count++,l.instance===null)switch(l.type){case"style":var p=o.querySelector('style[data-href~="'+Ya(d.href)+'"]');if(p)return l.instance=p,on(p),p;var b=y({},d,{"data-href":d.href,"data-precedence":d.precedence,href:null,precedence:null});return p=(o.ownerDocument||o).createElement("style"),on(p),Nr(p,"style",b),Hm(p,d.precedence,o),l.instance=p;case"stylesheet":b=su(d.href);var w=o.querySelector(Jd(b));if(w)return l.state.loading|=4,l.instance=w,on(w),w;p=MR(d),(b=rs.get(b))&&Zv(p,b),w=(o.ownerDocument||o).createElement("link"),on(w);var N=w;return N._p=new Promise(function(k,W){N.onload=k,N.onerror=W}),Nr(w,"link",p),l.state.loading|=4,Hm(w,d.precedence,o),l.instance=w;case"script":return w=ou(d.src),(b=o.querySelector(ef(w)))?(l.instance=b,on(b),b):(p=d,(b=rs.get(w))&&(p=y({},d),Yv(p,b)),o=o.ownerDocument||o,b=o.createElement("script"),on(b),Nr(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,Hm(p,d.precedence,o));return l.instance}function Hm(o,l,d){for(var p=d.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),b=p.length?p[p.length-1]:null,w=b,N=0;N<p.length;N++){var k=p[N];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 Zv(o,l){o.crossOrigin==null&&(o.crossOrigin=l.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=l.referrerPolicy),o.title==null&&(o.title=l.title)}function Yv(o,l){o.crossOrigin==null&&(o.crossOrigin=l.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=l.referrerPolicy),o.integrity==null&&(o.integrity=l.integrity)}var Vm=null;function LR(o,l,d){if(Vm===null){var p=new Map,b=Vm=new Map;b.set(d,p)}else b=Vm,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[Nn]||w[Le]||o==="link"&&w.getAttribute("rel")==="stylesheet")&&w.namespaceURI!=="http://www.w3.org/2000/svg"){var N=w.getAttribute(l)||"";N=o+N;var k=p.get(N);k?k.push(w):p.set(N,[w])}}return p}function PR(o,l,d){o=o.ownerDocument||o,o.head.insertBefore(d,l==="title"?o.querySelector("head > title"):null)}function Rk(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 UR(o){return!(o.type==="stylesheet"&&(o.state.loading&3)===0)}function jk(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=su(p.href),w=l.querySelector(Jd(b));if(w){l=w._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(o.count++,o=$m.bind(o),l.then(o,o)),d.state.loading|=4,d.instance=w,on(w);return}w=l.ownerDocument||l,p=MR(p),(b=rs.get(b))&&Zv(p,b),w=w.createElement("link"),on(w);var N=w;N._p=new Promise(function(k,W){N.onload=k,N.onerror=W}),Nr(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=$m.bind(o),l.addEventListener("load",d),l.addEventListener("error",d))}}var Wv=0;function Tk(o,l){return o.stylesheets&&o.count===0&&Bm(o,o.stylesheets),0<o.count||0<o.imgCount?function(d){var p=setTimeout(function(){if(o.stylesheets&&Bm(o,o.stylesheets),o.unsuspend){var w=o.unsuspend;o.unsuspend=null,w()}},6e4+l);0<o.imgBytes&&Wv===0&&(Wv=62500*ik());var b=setTimeout(function(){if(o.waitingForImages=!1,o.count===0&&(o.stylesheets&&Bm(o,o.stylesheets),o.unsuspend)){var w=o.unsuspend;o.unsuspend=null,w()}},(o.imgBytes>Wv?50:800)+l);return o.unsuspend=d,function(){o.unsuspend=null,clearTimeout(p),clearTimeout(b)}}:null}function $m(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Bm(this,this.stylesheets);else if(this.unsuspend){var o=this.unsuspend;this.unsuspend=null,o()}}}var Gm=null;function Bm(o,l){o.stylesheets=null,o.unsuspend!==null&&(o.count++,Gm=new Map,l.forEach(_k,o),Gm=null,$m.call(o))}function _k(o,l){if(!(l.state.loading&4)){var d=Gm.get(o);if(d)var p=d.get(null);else{d=new Map,Gm.set(o,d);for(var b=o.querySelectorAll("link[data-precedence],style[data-precedence]"),w=0;w<b.length;w++){var N=b[w];(N.nodeName==="LINK"||N.getAttribute("media")!=="not all")&&(d.set(N.dataset.precedence,N),p=N)}p&&d.set(null,p)}b=l.instance,N=b.getAttribute("data-precedence"),w=d.get(N)||p,w===p&&d.set(null,b),d.set(N,b),this.count++,p=$m.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 tf={$$typeof:_,Provider:null,Consumer:null,_currentValue:K,_currentValue2:K,_threadCount:0};function Nk(o,l,d,p,b,w,N,k,W){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=Rr(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Rr(0),this.hiddenUpdates=Rr(null),this.identifierPrefix=p,this.onUncaughtError=b,this.onCaughtError=w,this.onRecoverableError=N,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=W,this.incompleteTransitions=new Map}function FR(o,l,d,p,b,w,N,k,W,ie,pe,xe){return o=new Nk(o,l,d,N,W,ie,pe,xe,k),l=1,w===!0&&(l|=24),w=_a(3,null,null,l),o.current=w,w.stateNode=o,l=Nx(),l.refCount++,o.pooledCache=l,l.refCount++,w.memoizedState={element:p,isDehydrated:d,cache:l},Ix(w),o}function zR(o){return o?(o=Pc,o):Pc}function HR(o,l,d,p,b,w){b=zR(b),p.context===null?p.context=b:p.pendingContext=b,p=Si(l),p.payload={element:d},w=w===void 0?null:w,w!==null&&(p.callback=w),d=Ci(o,p,l),d!==null&&(va(d,o,l),Id(d,o,l))}function VR(o,l){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var d=o.retryLane;o.retryLane=d!==0&&d<l?d:l}}function Qv(o,l){VR(o,l),(o=o.alternate)&&VR(o,l)}function $R(o){if(o.tag===13||o.tag===31){var l=Ml(o,67108864);l!==null&&va(l,o,67108864),Qv(o,67108864)}}function GR(o){if(o.tag===13||o.tag===31){var l=Ia();l=Se(l);var d=Ml(o,l);d!==null&&va(d,o,l),Qv(o,l)}}var qm=!0;function Ak(o,l,d,p){var b=M.T;M.T=null;var w=V.p;try{V.p=2,Xv(o,l,d,p)}finally{V.p=w,M.T=b}}function Dk(o,l,d,p){var b=M.T;M.T=null;var w=V.p;try{V.p=8,Xv(o,l,d,p)}finally{V.p=w,M.T=b}}function Xv(o,l,d,p){if(qm){var b=Jv(p);if(b===null)Uv(o,l,p,Km,d),qR(o,p);else if(Ik(b,o,l,d,p))p.stopPropagation();else if(qR(o,p),l&4&&-1<Ok.indexOf(o)){for(;b!==null;){var w=fa(b);if(w!==null)switch(w.tag){case 3:if(w=w.stateNode,w.current.memoizedState.isDehydrated){var N=_n(w.pendingLanes);if(N!==0){var k=w;for(k.pendingLanes|=2,k.entangledLanes|=2;N;){var W=1<<31-Fn(N);k.entanglements[1]|=W,N&=~W}Gs(w),(tn&6)===0&&(Nm=we()+500,Yd(0))}}break;case 31:case 13:k=Ml(w,2),k!==null&&va(k,w,2),Dm(),Qv(w,2)}if(w=Jv(p),w===null&&Uv(o,l,p,Km,d),w===b)break;b=w}b!==null&&p.stopPropagation()}else Uv(o,l,p,null,d)}}function Jv(o){return o=tx(o),e0(o)}var Km=null;function e0(o){if(Km=null,o=Qt(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 Km=o,null}function BR(o){switch(o){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Te()){case Ye:return 2;case it:return 8;case lt:case Dn:return 32;case Ka:return 268435456;default:return 32}default:return 32}}var t0=!1,Ii=null,Mi=null,ki=null,nf=new Map,rf=new Map,Li=[],Ok="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 qR(o,l){switch(o){case"focusin":case"focusout":Ii=null;break;case"dragenter":case"dragleave":Mi=null;break;case"mouseover":case"mouseout":ki=null;break;case"pointerover":case"pointerout":nf.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":rf.delete(l.pointerId)}}function af(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=fa(l),l!==null&&$R(l)),o):(o.eventSystemFlags|=p,l=o.targetContainers,b!==null&&l.indexOf(b)===-1&&l.push(b),o)}function Ik(o,l,d,p,b){switch(l){case"focusin":return Ii=af(Ii,o,l,d,p,b),!0;case"dragenter":return Mi=af(Mi,o,l,d,p,b),!0;case"mouseover":return ki=af(ki,o,l,d,p,b),!0;case"pointerover":var w=b.pointerId;return nf.set(w,af(nf.get(w)||null,o,l,d,p,b)),!0;case"gotpointercapture":return w=b.pointerId,rf.set(w,af(rf.get(w)||null,o,l,d,p,b)),!0}return!1}function KR(o){var l=Qt(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,Be(o.priority,function(){GR(d)});return}}else if(l===31){if(l=u(d),l!==null){o.blockedOn=l,Be(o.priority,function(){GR(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 Zm(o){if(o.blockedOn!==null)return!1;for(var l=o.targetContainers;0<l.length;){var d=Jv(o.nativeEvent);if(d===null){d=o.nativeEvent;var p=new d.constructor(d.type,d);ex=p,d.target.dispatchEvent(p),ex=null}else return l=fa(d),l!==null&&$R(l),o.blockedOn=d,!1;l.shift()}return!0}function ZR(o,l,d){Zm(o)&&d.delete(l)}function Mk(){t0=!1,Ii!==null&&Zm(Ii)&&(Ii=null),Mi!==null&&Zm(Mi)&&(Mi=null),ki!==null&&Zm(ki)&&(ki=null),nf.forEach(ZR),rf.forEach(ZR)}function Ym(o,l){o.blockedOn===l&&(o.blockedOn=null,t0||(t0=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Mk)))}var Wm=null;function YR(o){Wm!==o&&(Wm=o,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Wm===o&&(Wm=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(e0(p||d)===null)continue;break}var w=fa(d);w!==null&&(o.splice(l,3),l-=3,Jx(w,{pending:!0,data:b,method:d.method,action:p},p,b))}}))}function iu(o){function l(W){return Ym(W,o)}Ii!==null&&Ym(Ii,o),Mi!==null&&Ym(Mi,o),ki!==null&&Ym(ki,o),nf.forEach(l),rf.forEach(l);for(var d=0;d<Li.length;d++){var p=Li[d];p.blockedOn===o&&(p.blockedOn=null)}for(;0<Li.length&&(d=Li[0],d.blockedOn===null);)KR(d),d.blockedOn===null&&Li.shift();if(d=(o.ownerDocument||o).$$reactFormReplay,d!=null)for(p=0;p<d.length;p+=3){var b=d[p],w=d[p+1],N=b[Ve]||null;if(typeof w=="function")N||YR(d);else if(N){var k=null;if(w&&w.hasAttribute("formAction")){if(b=w,N=w[Ve]||null)k=N.formAction;else if(e0(b)!==null)continue}else k=N.action;typeof k=="function"?d[p+1]=k:(d.splice(p,3),p-=3),YR(d)}}}function WR(){function o(w){w.canIntercept&&w.info==="react-transition"&&w.intercept({handler:function(){return new Promise(function(N){return b=N})},focusReset:"manual",scroll:"manual"})}function l(){b!==null&&(b(),b=null),p||setTimeout(d,20)}function d(){if(!p&&!navigation.transition){var w=navigation.currentEntry;w&&w.url!=null&&navigation.navigate(w.url,{state:w.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var p=!1,b=null;return navigation.addEventListener("navigate",o),navigation.addEventListener("navigatesuccess",l),navigation.addEventListener("navigateerror",l),setTimeout(d,100),function(){p=!0,navigation.removeEventListener("navigate",o),navigation.removeEventListener("navigatesuccess",l),navigation.removeEventListener("navigateerror",l),b!==null&&(b(),b=null)}}}function n0(o){this._internalRoot=o}Qm.prototype.render=n0.prototype.render=function(o){var l=this._internalRoot;if(l===null)throw Error(r(409));var d=l.current,p=Ia();HR(d,p,o,l,null,null)},Qm.prototype.unmount=n0.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var l=o.containerInfo;HR(o.current,2,null,o,null,null),Dm(),l[et]=null}};function Qm(o){this._internalRoot=o}Qm.prototype.unstable_scheduleHydration=function(o){if(o){var l=He();o={blockedOn:null,target:o,priority:l};for(var d=0;d<Li.length&&l!==0&&l<Li[d].priority;d++);Li.splice(d,0,o),d===0&&KR(o)}};var QR=t.version;if(QR!=="19.2.0")throw Error(r(527,QR,"19.2.0"));V.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?g(o):null,o=o===null?null:o.stateNode,o};var kk={bundleType:0,version:"19.2.0",rendererPackageName:"react-dom",currentDispatcherRef:M,reconcilerVersion:"19.2.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Xm=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Xm.isDisabled&&Xm.supportsFiber)try{Zn=Xm.inject(kk),Un=Xm}catch{}}return of.createRoot=function(o,l){if(!s(o))throw Error(r(299));var d=!1,p="",b=aw,w=sw,N=ow;return l!=null&&(l.unstable_strictMode===!0&&(d=!0),l.identifierPrefix!==void 0&&(p=l.identifierPrefix),l.onUncaughtError!==void 0&&(b=l.onUncaughtError),l.onCaughtError!==void 0&&(w=l.onCaughtError),l.onRecoverableError!==void 0&&(N=l.onRecoverableError)),l=FR(o,1,!1,null,null,d,p,null,b,w,N,WR),o[et]=l.current,Pv(o),new n0(l)},of.hydrateRoot=function(o,l,d){if(!s(o))throw Error(r(299));var p=!1,b="",w=aw,N=sw,k=ow,W=null;return d!=null&&(d.unstable_strictMode===!0&&(p=!0),d.identifierPrefix!==void 0&&(b=d.identifierPrefix),d.onUncaughtError!==void 0&&(w=d.onUncaughtError),d.onCaughtError!==void 0&&(N=d.onCaughtError),d.onRecoverableError!==void 0&&(k=d.onRecoverableError),d.formState!==void 0&&(W=d.formState)),l=FR(o,1,!0,l,d??null,p,b,W,w,N,k,WR),l.context=zR(null),d=l.current,p=Ia(),p=Se(p),b=Si(p),b.callback=null,Ci(d,b,p),d=p,l.current.lanes=d,da(l,d),Gs(l),o[et]=l.current,Pv(o),new Qm(l)},of.version="19.2.0",of}var ij;function Kk(){if(ij)return s0.exports;ij=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(),s0.exports=qk(),s0.exports}var Zk=Kk();/**
|
|
50
|
-
* react-router v7.9.6
|
|
51
|
-
*
|
|
52
|
-
* Copyright (c) Remix Software Inc.
|
|
53
|
-
*
|
|
54
|
-
* This source code is licensed under the MIT license found in the
|
|
55
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
56
|
-
*
|
|
57
|
-
* @license MIT
|
|
58
|
-
*/var wN=e=>{throw TypeError(e)},Yk=(e,t,n)=>t.has(e)||wN("Cannot "+n),c0=(e,t,n)=>(Yk(e,t,"read from private field"),n?n.call(e):t.get(e)),Wk=(e,t,n)=>t.has(e)?wN("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),lj="popstate";function Qk(e={}){function t(r,s){let{pathname:i,search:c,hash:u}=r.location;return Uf("",{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:oo(s)}return Jk(t,n,null,e)}function kt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Pn(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Xk(){return Math.random().toString(36).substring(2,10)}function cj(e,t){return{usr:e.state,key:e.key,idx:t}}function Uf(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?fl(t):t,state:n,key:t&&t.key||r||Xk()}}function oo({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 fl(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 Jk(e,t,n,r={}){let{window:s=document.defaultView,v5Compat:i=!1}=r,c=s.history,u="POP",f=null,m=g();m==null&&(m=0,c.replaceState({...c.state,idx:m},""));function g(){return(c.state||{idx:null}).idx}function y(){u="POP";let E=g(),R=E==null?null:E-m;m=E,f&&f({action:u,location:C.location,delta:R})}function x(E,R){u="PUSH";let j=Uf(C.location,E,R);m=g()+1;let _=cj(j,m),A=C.createHref(j);try{c.pushState(_,"",A)}catch(O){if(O instanceof DOMException&&O.name==="DataCloneError")throw O;s.location.assign(A)}i&&f&&f({action:u,location:C.location,delta:1})}function v(E,R){u="REPLACE";let j=Uf(C.location,E,R);m=g();let _=cj(j,m),A=C.createHref(j);c.replaceState(_,"",A),i&&f&&f({action:u,location:C.location,delta:0})}function S(E){return RN(E)}let C={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(lj,y),f=E,()=>{s.removeEventListener(lj,y),f=null}},createHref(E){return t(s,E)},createURL:S,encodeLocation(E){let R=S(E);return{pathname:R.pathname,search:R.search,hash:R.hash}},push:x,replace:v,go(E){return c.go(E)}};return C}function RN(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),kt(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:oo(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}var Sf,uj=class{constructor(e){if(Wk(this,Sf,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(c0(this,Sf).has(e))return c0(this,Sf).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){c0(this,Sf).set(e,t)}};Sf=new WeakMap;var e9=new Set(["lazy","caseSensitive","path","id","index","children"]);function t9(e){return e9.has(e)}var n9=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function r9(e){return n9.has(e)}function a9(e){return e.index===!0}function Ff(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(kt(i.index!==!0||!i.children,"Cannot specify children on an index route"),kt(s||!r[f],`Found a route id collision on id "${f}". Route id's must be globally unique within Data Router usages`),a9(i)){let m={...i,id:f};return r[f]=dj(m,t(m)),m}else{let m={...i,id:f,children:void 0};return r[f]=dj(m,t(m)),i.children&&(m.children=Ff(i.children,t,u,r,s)),m}})}function dj(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function Gi(e,t,n="/"){return Cf(e,t,n,!1)}function Cf(e,t,n,r){let s=typeof t=="string"?fl(t):t,i=ls(s.pathname||"/",n);if(i==null)return null;let c=jN(e);o9(c);let u=null;for(let f=0;u==null&&f<c.length;++f){let m=y9(i);u=p9(c[f],m,r)}return u}function s9(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 jN(e,t=[],n=[],r="",s=!1){let i=(c,u,f=s,m)=>{let g={relativePath:m===void 0?c.path||"":m,caseSensitive:c.caseSensitive===!0,childrenIndex:u,route:c};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(r)&&f)return;kt(g.relativePath.startsWith(r),`Absolute route path "${g.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(r.length)}let y=Js([r,g.relativePath]),x=n.concat(g);c.children&&c.children.length>0&&(kt(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),jN(c.children,t,x,y,f)),!(c.path==null&&!c.index)&&t.push({path:y,score:h9(y,c.index),routesMeta:x})};return e.forEach((c,u)=>{var f;if(c.path===""||!((f=c.path)!=null&&f.includes("?")))i(c,u);else for(let m of TN(c.path))i(c,u,!0,m)}),t}function TN(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=TN(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 o9(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:m9(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var i9=/^:[\w-]+$/,l9=3,c9=2,u9=1,d9=10,f9=-2,fj=e=>e==="*";function h9(e,t){let n=e.split("/"),r=n.length;return n.some(fj)&&(r+=f9),t&&(r+=c9),n.filter(s=>!fj(s)).reduce((s,i)=>s+(i9.test(i)?l9:i===""?u9:d9),r)}function m9(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 p9(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,g=i==="/"?t:t.slice(i.length)||"/",y=$p({path:f.relativePath,caseSensitive:f.caseSensitive,end:m},g),x=f.route;if(!y&&m&&n&&!r[r.length-1].route.index&&(y=$p({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},g)),!y)return null;Object.assign(s,y.params),c.push({params:s,pathname:Js([i,y.pathname]),pathnameBase:S9(Js([i,y.pathnameBase])),route:x}),y.pathnameBase!=="/"&&(i=Js([i,y.pathnameBase]))}return c}function $p(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=g9(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:g,isOptional:y},x)=>{if(g==="*"){let S=u[x]||"";c=i.slice(0,i.length-S.length).replace(/(.)\/+$/,"$1")}const v=u[x];return y&&!v?m[g]=void 0:m[g]=(v||"").replace(/%2F/g,"/"),m},{}),pathname:i,pathnameBase:c,pattern:e}}function g9(e,t=!1,n=!0){Pn(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 y9(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Pn(!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 ls(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 x9({basename:e,pathname:t}){return t==="/"?e:Js([e,t])}var v9=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Pg=e=>v9.test(e);function b9(e,t="/"){let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?fl(e):e,i;if(n)if(Pg(n))i=n;else{if(n.includes("//")){let c=n;n=n.replace(/\/\/+/g,"/"),Pn(!1,`Pathnames cannot have embedded double slashes - normalizing ${c} -> ${n}`)}n.startsWith("/")?i=hj(n.substring(1),"/"):i=hj(n,t)}else i=t;return{pathname:i,search:C9(r),hash:E9(s)}}function hj(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 u0(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 _N(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Ug(e){let t=_N(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Fg(e,t,n,r=!1){let s;typeof e=="string"?s=fl(e):(s={...e},kt(!s.pathname||!s.pathname.includes("?"),u0("?","pathname","search",s)),kt(!s.pathname||!s.pathname.includes("#"),u0("#","pathname","hash",s)),kt(!s.search||!s.search.includes("#"),u0("#","search","hash",s)));let i=e===""||s.pathname==="",c=i?"/":s.pathname,u;if(c==null)u=n;else{let y=t.length-1;if(!r&&c.startsWith("..")){let x=c.split("/");for(;x[0]==="..";)x.shift(),y-=1;s.pathname=x.join("/")}u=y>=0?t[y]:"/"}let f=b9(s,u),m=c&&c!=="/"&&c.endsWith("/"),g=(i||c===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(m||g)&&(f.pathname+="/"),f}var Js=e=>e.join("/").replace(/\/\/+/g,"/"),S9=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),C9=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,E9=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Gp=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 zf(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function Ab(e){return e.filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Yi=Symbol("Uninstrumented");function w9(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=ju(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=ju(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[Yi]??i,u=ju(n[s],c,(...f)=>mj(f[0]));u&&(u[Yi]=c,r[s]=u)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(s=>{let i=s[Yi]??s,c=ju(n.middleware,i,(...u)=>mj(u[0]));return c?(c[Yi]=i,c):s})),r}function R9(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[Yi]??e.navigate,s=ju(n.navigate,r,(...i)=>{let[c,u]=i;return{to:typeof c=="number"||typeof c=="string"?c:c?oo(c):".",...pj(e,u??{})}});s&&(s[Yi]=r,e.navigate=s)}if(n.fetch.length>0){let r=e.fetch[Yi]??e.fetch,s=ju(n.fetch,r,(...i)=>{let[c,,u,f]=i;return{href:u??".",fetcherKey:c,...pj(e,f??{})}});s&&(s[Yi]=r,e.fetch=s)}return e}function ju(e,t,n){return e.length===0?null:async(...r)=>{let s=await NN(e,n(...r),()=>t(...r),e.length-1);if(s.type==="error")throw s.value;return s.value}}async function NN(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=NN(e,t,n,r-1),i=await c,kt(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 mj(e){let{request:t,context:n,params:r,unstable_pattern:s}=e;return{request:j9(t),params:{...r},unstable_pattern:s,context:T9(n)}}function pj(e,t){return{currentUrl:oo(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 j9(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function T9(e){if(N9(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var _9=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function N9(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")===_9}var AN=["POST","PUT","PATCH","DELETE"],A9=new Set(AN),D9=["GET",...AN],O9=new Set(D9),I9=new Set([301,302,303,307,308]),M9=new Set([307,308]),d0={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},k9={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},lf={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},L9=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),DN="remix-router-transitions",ON=Symbol("ResetLoaderData");function P9(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";kt(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let r=e.hydrationRouteProperties||[],s=e.mapRouteProperties||L9,i=s;if(e.unstable_instrumentations){let Y=e.unstable_instrumentations;i=te=>({...s(te),...w9(Y.map(le=>le.route).filter(Boolean),te)})}let c={},u=Ff(e.routes,i,void 0,c),f,m=e.basename||"/";m.startsWith("/")||(m=`/${m}`);let g=e.dataStrategy||V9,y={...e.future},x=null,v=new Set,S=null,C=null,E=null,R=e.hydrationData!=null,j=Gi(u,e.history.location,m),_=!1,A=null,O;if(j==null&&!e.patchRoutesOnNavigation){let Y=as(404,{pathname:e.history.location.pathname}),{matches:te,route:le}=Jm(u);O=!0,j=te,A={[le.id]:Y}}else if(j&&!e.hydrationData&&cr(j,u,e.history.location.pathname).active&&(j=null),j)if(j.some(Y=>Y.route.lazy))O=!1;else if(!j.some(Y=>Db(Y.route)))O=!0;else{let Y=e.hydrationData?e.hydrationData.loaderData:null,te=e.hydrationData?e.hydrationData.errors:null;if(te){let le=j.findIndex(Se=>te[Se.route.id]!==void 0);O=j.slice(0,le+1).every(Se=>!g1(Se.route,Y,te))}else O=j.every(le=>!g1(le.route,Y,te))}else{O=!1,j=[];let Y=cr(null,u,e.history.location.pathname);Y.active&&Y.matches&&(_=!0,j=Y.matches)}let I,T={historyAction:e.history.action,location:e.history.location,matches:j,initialized:O,navigation:d0,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||A,fetchers:new Map,blockers:new Map},D="POP",L=!1,H,B=!1,q=new Map,Z=null,F=!1,z=!1,M=new Set,V=new Map,K=0,se=-1,ve=new Map,P=new Set,U=new Map,$=new Map,Q=new Set,ne=new Map,ue,J=null;function he(){if(x=e.history.listen(({action:Y,location:te,delta:le})=>{if(ue){ue(),ue=void 0;return}Pn(ne.size===0||le!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let Se=yo({currentLocation:T.location,nextLocation:te,historyAction:Y});if(Se&&le!=null){let _e=new Promise(He=>{ue=He});e.history.go(le*-1),fi(Se,{state:"blocked",location:te,proceed(){fi(Se,{state:"proceeding",proceed:void 0,reset:void 0,location:te}),_e.then(()=>e.history.go(le))},reset(){let He=new Map(T.blockers);He.set(Se,lf),Me({blockers:He})}});return}return Vt(Y,te)}),n){rL(t,q);let Y=()=>aL(t,q);t.addEventListener("pagehide",Y),Z=()=>t.removeEventListener("pagehide",Y)}return T.initialized||Vt("POP",T.location,{initialHydration:!0}),I}function ge(){x&&x(),Z&&Z(),v.clear(),H&&H.abort(),T.fetchers.forEach((Y,te)=>On(te)),T.blockers.forEach((Y,te)=>Fs(te))}function Ee(Y){return v.add(Y),()=>v.delete(Y)}function Me(Y,te={}){Y.matches&&(Y.matches=Y.matches.map(_e=>{let He=c[_e.route.id],Be=_e.route;return Be.element!==He.element||Be.errorElement!==He.errorElement||Be.hydrateFallbackElement!==He.hydrateFallbackElement?{..._e,route:He}:_e})),T={...T,...Y};let le=[],Se=[];T.fetchers.forEach((_e,He)=>{_e.state==="idle"&&(Q.has(He)?le.push(He):Se.push(He))}),Q.forEach(_e=>{!T.fetchers.has(_e)&&!V.has(_e)&&le.push(_e)}),[...v].forEach(_e=>_e(T,{deletedFetchers:le,viewTransitionOpts:te.viewTransitionOpts,flushSync:te.flushSync===!0})),le.forEach(_e=>On(_e)),Se.forEach(_e=>T.fetchers.delete(_e))}function Fe(Y,te,{flushSync:le}={}){var et,Je;let Se=T.actionData!=null&&T.navigation.formMethod!=null&&Jr(T.navigation.formMethod)&&T.navigation.state==="loading"&&((et=Y.state)==null?void 0:et._isRedirect)!==!0,_e;te.actionData?Object.keys(te.actionData).length>0?_e=te.actionData:_e=null:Se?_e=T.actionData:_e=null;let He=te.loaderData?Rj(T.loaderData,te.loaderData,te.matches||[],te.errors):T.loaderData,Be=T.blockers;Be.size>0&&(Be=new Map(Be),Be.forEach((mt,hn)=>Be.set(hn,lf)));let ze=F?!1:wr(Y,te.matches||T.matches),Le=L===!0||T.navigation.formMethod!=null&&Jr(T.navigation.formMethod)&&((Je=Y.state)==null?void 0:Je._isRedirect)!==!0;f&&(u=f,f=void 0),F||D==="POP"||(D==="PUSH"?e.history.push(Y,Y.state):D==="REPLACE"&&e.history.replace(Y,Y.state));let Ve;if(D==="POP"){let mt=q.get(T.location.pathname);mt&&mt.has(Y.pathname)?Ve={currentLocation:T.location,nextLocation:Y}:q.has(Y.pathname)&&(Ve={currentLocation:Y,nextLocation:T.location})}else if(B){let mt=q.get(T.location.pathname);mt?mt.add(Y.pathname):(mt=new Set([Y.pathname]),q.set(T.location.pathname,mt)),Ve={currentLocation:T.location,nextLocation:Y}}Me({...te,actionData:_e,loaderData:He,historyAction:D,location:Y,initialized:!0,navigation:d0,revalidation:"idle",restoreScrollPosition:ze,preventScrollReset:Le,blockers:Be},{viewTransitionOpts:Ve,flushSync:le===!0}),D="POP",L=!1,B=!1,F=!1,z=!1,J==null||J.resolve(),J=null}async function nt(Y,te){if(typeof Y=="number"){e.history.go(Y);return}let le=p1(T.location,T.matches,m,Y,te==null?void 0:te.fromRouteId,te==null?void 0:te.relative),{path:Se,submission:_e,error:He}=gj(!1,le,te),Be=T.location,ze=Uf(T.location,Se,te&&te.state);ze={...ze,...e.history.encodeLocation(ze)};let Le=te&&te.replace!=null?te.replace:void 0,Ve="PUSH";Le===!0?Ve="REPLACE":Le===!1||_e!=null&&Jr(_e.formMethod)&&_e.formAction===T.location.pathname+T.location.search&&(Ve="REPLACE");let et=te&&"preventScrollReset"in te?te.preventScrollReset===!0:void 0,Je=(te&&te.flushSync)===!0,mt=yo({currentLocation:Be,nextLocation:ze,historyAction:Ve});if(mt){fi(mt,{state:"blocked",location:ze,proceed(){fi(mt,{state:"proceeding",proceed:void 0,reset:void 0,location:ze}),nt(Y,te)},reset(){let hn=new Map(T.blockers);hn.set(mt,lf),Me({blockers:hn})}});return}await Vt(Ve,ze,{submission:_e,pendingError:He,preventScrollReset:et,replace:te&&te.replace,enableViewTransition:te&&te.viewTransition,flushSync:Je})}function ut(){J||(J=sL()),Ye(),Me({revalidation:"loading"});let Y=J.promise;return T.navigation.state==="submitting"?Y:T.navigation.state==="idle"?(Vt(T.historyAction,T.location,{startUninterruptedRevalidation:!0}),Y):(Vt(D||T.historyAction,T.navigation.location,{overrideNavigation:T.navigation,enableViewTransition:B===!0}),Y)}async function Vt(Y,te,le){H&&H.abort(),H=null,D=Y,F=(le&&le.startUninterruptedRevalidation)===!0,tr(T.location,T.matches),L=(le&&le.preventScrollReset)===!0,B=(le&&le.enableViewTransition)===!0;let Se=f||u,_e=le&&le.overrideNavigation,He=le!=null&&le.initialHydration&&T.matches&&T.matches.length>0&&!_?T.matches:Gi(Se,te,m),Be=(le&&le.flushSync)===!0;if(He&&T.initialized&&!z&&W9(T.location,te)&&!(le&&le.submission&&Jr(le.submission.formMethod))){Fe(te,{matches:He},{flushSync:Be});return}let ze=cr(He,Se,te.pathname);if(ze.active&&ze.matches&&(He=ze.matches),!He){let{error:Nn,notFoundMatches:sn,route:Qt}=zs(te.pathname);Fe(te,{matches:sn,loaderData:{},errors:{[Qt.id]:Nn}},{flushSync:Be});return}H=new AbortController;let Le=xu(e.history,te,H.signal,le&&le.submission),Ve=e.getContext?await e.getContext():new uj,et;if(le&&le.pendingError)et=[Bi(He).route.id,{type:"error",error:le.pendingError}];else if(le&&le.submission&&Jr(le.submission.formMethod)){let Nn=await xn(Le,te,le.submission,He,Ve,ze.active,le&&le.initialHydration===!0,{replace:le.replace,flushSync:Be});if(Nn.shortCircuited)return;if(Nn.pendingActionResult){let[sn,Qt]=Nn.pendingActionResult;if(ka(Qt)&&zf(Qt.error)&&Qt.error.status===404){H=null,Fe(te,{matches:Nn.matches,loaderData:{},errors:{[sn]:Qt.error}});return}}He=Nn.matches||He,et=Nn.pendingActionResult,_e=f0(te,le.submission),Be=!1,ze.active=!1,Le=xu(e.history,Le.url,Le.signal)}let{shortCircuited:Je,matches:mt,loaderData:hn,errors:zn}=await er(Le,te,He,Ve,ze.active,_e,le&&le.submission,le&&le.fetcherSubmission,le&&le.replace,le&&le.initialHydration===!0,Be,et);Je||(H=null,Fe(te,{matches:mt||He,...jj(et),loaderData:hn,errors:zn}))}async function xn(Y,te,le,Se,_e,He,Be,ze={}){Ye();let Le=tL(te,le);if(Me({navigation:Le},{flushSync:ze.flushSync===!0}),He){let Je=await Yn(Se,te.pathname,Y.signal);if(Je.type==="aborted")return{shortCircuited:!0};if(Je.type==="error"){if(Je.partialMatches.length===0){let{matches:hn,route:zn}=Jm(u);return{matches:hn,pendingActionResult:[zn.id,{type:"error",error:Je.error}]}}let mt=Bi(Je.partialMatches).route.id;return{matches:Je.partialMatches,pendingActionResult:[mt,{type:"error",error:Je.error}]}}else if(Je.matches)Se=Je.matches;else{let{notFoundMatches:mt,error:hn,route:zn}=zs(te.pathname);return{matches:mt,pendingActionResult:[zn.id,{type:"error",error:hn}]}}}let Ve,et=Np(Se,te);if(!et.route.action&&!et.route.lazy)Ve={type:"error",error:as(405,{method:Y.method,pathname:te.pathname,routeId:et.route.id})};else{let Je=Au(i,c,Y,Se,et,Be?[]:r,_e),mt=await we(Y,Je,_e,null);if(Ve=mt[et.route.id],!Ve){for(let hn of Se)if(mt[hn.route.id]){Ve=mt[hn.route.id];break}}if(Y.signal.aborted)return{shortCircuited:!0}}if(Xl(Ve)){let Je;return ze&&ze.replace!=null?Je=ze.replace:Je=Cj(Ve.response.headers.get("Location"),new URL(Y.url),m)===T.location.pathname+T.location.search,await Ae(Y,Ve,!0,{submission:le,replace:Je}),{shortCircuited:!0}}if(ka(Ve)){let Je=Bi(Se,et.route.id);return(ze&&ze.replace)!==!0&&(D="PUSH"),{matches:Se,pendingActionResult:[Je.route.id,Ve,et.route.id]}}return{matches:Se,pendingActionResult:[et.route.id,Ve]}}async function er(Y,te,le,Se,_e,He,Be,ze,Le,Ve,et,Je){let mt=He||f0(te,Be),hn=Be||ze||_j(mt),zn=!F&&!Ve;if(_e){if(zn){let ur=fn(Je);Me({navigation:mt,...ur!==void 0?{actionData:ur}:{}},{flushSync:et})}let Ut=await Yn(le,te.pathname,Y.signal);if(Ut.type==="aborted")return{shortCircuited:!0};if(Ut.type==="error"){if(Ut.partialMatches.length===0){let{matches:mi,route:Za}=Jm(u);return{matches:mi,loaderData:{},errors:{[Za.id]:Ut.error}}}let ur=Bi(Ut.partialMatches).route.id;return{matches:Ut.partialMatches,loaderData:{},errors:{[ur]:Ut.error}}}else if(Ut.matches)le=Ut.matches;else{let{error:ur,notFoundMatches:mi,route:Za}=zs(te.pathname);return{matches:mi,loaderData:{},errors:{[Za.id]:ur}}}}let Nn=f||u,{dsMatches:sn,revalidatingFetchers:Qt}=yj(Y,Se,i,c,e.history,T,le,hn,te,Ve?[]:r,Ve===!0,z,M,Q,U,P,Nn,m,e.patchRoutesOnNavigation!=null,Je);if(se=++K,!e.dataStrategy&&!sn.some(Ut=>Ut.shouldLoad)&&!sn.some(Ut=>Ut.route.middleware&&Ut.route.middleware.length>0)&&Qt.length===0){let Ut=Er();return Fe(te,{matches:le,loaderData:{},errors:Je&&ka(Je[1])?{[Je[0]]:Je[1].error}:null,...jj(Je),...Ut?{fetchers:new Map(T.fetchers)}:{}},{flushSync:et}),{shortCircuited:!0}}if(zn){let Ut={};if(!_e){Ut.navigation=mt;let ur=fn(Je);ur!==void 0&&(Ut.actionData=ur)}Qt.length>0&&(Ut.fetchers=Pe(Qt)),Me(Ut,{flushSync:et})}Qt.forEach(Ut=>{Zn(Ut.key),Ut.controller&&V.set(Ut.key,Ut.controller)});let fa=()=>Qt.forEach(Ut=>Zn(Ut.key));H&&H.signal.addEventListener("abort",fa);let{loaderResults:fs,fetcherResults:Zr}=await Te(sn,Qt,Y,Se);if(Y.signal.aborted)return{shortCircuited:!0};H&&H.signal.removeEventListener("abort",fa),Qt.forEach(Ut=>V.delete(Ut.key));let on=ep(fs);if(on)return await Ae(Y,on.result,!0,{replace:Le}),{shortCircuited:!0};if(on=ep(Zr),on)return P.add(on.key),await Ae(Y,on.result,!0,{replace:Le}),{shortCircuited:!0};let{loaderData:Tc,errors:hi}=wj(T,le,fs,Je,Qt,Zr);Ve&&T.errors&&(hi={...T.errors,...hi});let Yr=Er(),hs=Fn(se),_c=Yr||hs||Qt.length>0;return{matches:le,loaderData:Tc,errors:hi,..._c?{fetchers:new Map(T.fetchers)}:{}}}function fn(Y){if(Y&&!ka(Y[1]))return{[Y[0]]:Y[1].data};if(T.actionData)return Object.keys(T.actionData).length===0?null:T.actionData}function Pe(Y){return Y.forEach(te=>{let le=T.fetchers.get(te.key),Se=cf(void 0,le?le.data:void 0);T.fetchers.set(te.key,Se)}),new Map(T.fetchers)}async function G(Y,te,le,Se){Zn(Y);let _e=(Se&&Se.flushSync)===!0,He=f||u,Be=p1(T.location,T.matches,m,le,te,Se==null?void 0:Se.relative),ze=Gi(He,Be,m),Le=cr(ze,He,Be);if(Le.active&&Le.matches&&(ze=Le.matches),!ze){lt(Y,te,as(404,{pathname:Be}),{flushSync:_e});return}let{path:Ve,submission:et,error:Je}=gj(!0,Be,Se);if(Je){lt(Y,te,Je,{flushSync:_e});return}let mt=e.getContext?await e.getContext():new uj,hn=(Se&&Se.preventScrollReset)===!0;if(et&&Jr(et.formMethod)){await ee(Y,te,Ve,ze,mt,Le.active,_e,hn,et);return}U.set(Y,{routeId:te,path:Ve}),await de(Y,te,Ve,ze,mt,Le.active,_e,hn,et)}async function ee(Y,te,le,Se,_e,He,Be,ze,Le){Ye(),U.delete(Y);let Ve=T.fetchers.get(Y);it(Y,nL(Le,Ve),{flushSync:Be});let et=new AbortController,Je=xu(e.history,le,et.signal,Le);if(He){let vn=await Yn(Se,new URL(Je.url).pathname,Je.signal,Y);if(vn.type==="aborted")return;if(vn.type==="error"){lt(Y,te,vn.error,{flushSync:Be});return}else if(vn.matches)Se=vn.matches;else{lt(Y,te,as(404,{pathname:le}),{flushSync:Be});return}}let mt=Np(Se,le);if(!mt.route.action&&!mt.route.lazy){let vn=as(405,{method:Le.formMethod,pathname:le,routeId:te});lt(Y,te,vn,{flushSync:Be});return}V.set(Y,et);let hn=K,zn=Au(i,c,Je,Se,mt,r,_e),Nn=await we(Je,zn,_e,Y),sn=Nn[mt.route.id];if(!sn){for(let vn of zn)if(Nn[vn.route.id]){sn=Nn[vn.route.id];break}}if(Je.signal.aborted){V.get(Y)===et&&V.delete(Y);return}if(Q.has(Y)){if(Xl(sn)||ka(sn)){it(Y,Uo(void 0));return}}else{if(Xl(sn))if(V.delete(Y),se>hn){it(Y,Uo(void 0));return}else return P.add(Y),it(Y,cf(Le)),Ae(Je,sn,!1,{fetcherSubmission:Le,preventScrollReset:ze});if(ka(sn)){lt(Y,te,sn.error);return}}let Qt=T.navigation.location||T.location,fa=xu(e.history,Qt,et.signal),fs=f||u,Zr=T.navigation.state!=="idle"?Gi(fs,T.navigation.location,m):T.matches;kt(Zr,"Didn't find any matches after fetcher action");let on=++K;ve.set(Y,on);let Tc=cf(Le,sn.data);T.fetchers.set(Y,Tc);let{dsMatches:hi,revalidatingFetchers:Yr}=yj(fa,_e,i,c,e.history,T,Zr,Le,Qt,r,!1,z,M,Q,U,P,fs,m,e.patchRoutesOnNavigation!=null,[mt.route.id,sn]);Yr.filter(vn=>vn.key!==Y).forEach(vn=>{let ha=vn.key,Wr=T.fetchers.get(ha),Vh=cf(void 0,Wr?Wr.data:void 0);T.fetchers.set(ha,Vh),Zn(ha),vn.controller&&V.set(ha,vn.controller)}),Me({fetchers:new Map(T.fetchers)});let hs=()=>Yr.forEach(vn=>Zn(vn.key));et.signal.addEventListener("abort",hs);let{loaderResults:_c,fetcherResults:Ut}=await Te(hi,Yr,fa,_e);if(et.signal.aborted)return;if(et.signal.removeEventListener("abort",hs),ve.delete(Y),V.delete(Y),Yr.forEach(vn=>V.delete(vn.key)),T.fetchers.has(Y)){let vn=Uo(sn.data);T.fetchers.set(Y,vn)}let ur=ep(_c);if(ur)return Ae(fa,ur.result,!1,{preventScrollReset:ze});if(ur=ep(Ut),ur)return P.add(ur.key),Ae(fa,ur.result,!1,{preventScrollReset:ze});let{loaderData:mi,errors:Za}=wj(T,Zr,_c,void 0,Yr,Ut);Fn(on),T.navigation.state==="loading"&&on>se?(kt(D,"Expected pending action"),H&&H.abort(),Fe(T.navigation.location,{matches:Zr,loaderData:mi,errors:Za,fetchers:new Map(T.fetchers)})):(Me({errors:Za,loaderData:Rj(T.loaderData,mi,Zr,Za),fetchers:new Map(T.fetchers)}),z=!1)}async function de(Y,te,le,Se,_e,He,Be,ze,Le){let Ve=T.fetchers.get(Y);it(Y,cf(Le,Ve?Ve.data:void 0),{flushSync:Be});let et=new AbortController,Je=xu(e.history,le,et.signal);if(He){let Qt=await Yn(Se,new URL(Je.url).pathname,Je.signal,Y);if(Qt.type==="aborted")return;if(Qt.type==="error"){lt(Y,te,Qt.error,{flushSync:Be});return}else if(Qt.matches)Se=Qt.matches;else{lt(Y,te,as(404,{pathname:le}),{flushSync:Be});return}}let mt=Np(Se,le);V.set(Y,et);let hn=K,zn=Au(i,c,Je,Se,mt,r,_e),sn=(await we(Je,zn,_e,Y))[mt.route.id];if(V.get(Y)===et&&V.delete(Y),!Je.signal.aborted){if(Q.has(Y)){it(Y,Uo(void 0));return}if(Xl(sn))if(se>hn){it(Y,Uo(void 0));return}else{P.add(Y),await Ae(Je,sn,!1,{preventScrollReset:ze});return}if(ka(sn)){lt(Y,te,sn.error);return}it(Y,Uo(sn.data))}}async function Ae(Y,te,le,{submission:Se,fetcherSubmission:_e,preventScrollReset:He,replace:Be}={}){te.response.headers.has("X-Remix-Revalidate")&&(z=!0);let ze=te.response.headers.get("Location");kt(ze,"Expected a Location header on the redirect Response"),ze=Cj(ze,new URL(Y.url),m);let Le=Uf(T.location,ze,{_isRedirect:!0});if(n){let zn=!1;if(te.response.headers.has("X-Remix-Reload-Document"))zn=!0;else if(Pg(ze)){const Nn=RN(ze,!0);zn=Nn.origin!==t.location.origin||ls(Nn.pathname,m)==null}if(zn){Be?t.location.replace(ze):t.location.assign(ze);return}}H=null;let Ve=Be===!0||te.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:et,formAction:Je,formEncType:mt}=T.navigation;!Se&&!_e&&et&&Je&&mt&&(Se=_j(T.navigation));let hn=Se||_e;if(M9.has(te.response.status)&&hn&&Jr(hn.formMethod))await Vt(Ve,Le,{submission:{...hn,formAction:ze},preventScrollReset:He||L,enableViewTransition:le?B:void 0});else{let zn=f0(Le,Se);await Vt(Ve,Le,{overrideNavigation:zn,fetcherSubmission:_e,preventScrollReset:He||L,enableViewTransition:le?B:void 0})}}async function we(Y,te,le,Se){let _e,He={};try{_e=await G9(g,Y,te,Se,le,!1)}catch(Be){return te.filter(ze=>ze.shouldLoad).forEach(ze=>{He[ze.route.id]={type:"error",error:Be}}),He}if(Y.signal.aborted)return He;for(let[Be,ze]of Object.entries(_e))if(J9(ze)){let Le=ze.result;He[Be]={type:"redirect",response:Z9(Le,Y,Be,te,m)}}else He[Be]=await K9(ze);return He}async function Te(Y,te,le,Se){let _e=we(le,Y,Se,null),He=Promise.all(te.map(async Le=>{if(Le.matches&&Le.match&&Le.request&&Le.controller){let et=(await we(Le.request,Le.matches,Se,Le.key))[Le.match.route.id];return{[Le.key]:et}}else return Promise.resolve({[Le.key]:{type:"error",error:as(404,{pathname:Le.path})}})})),Be=await _e,ze=(await He).reduce((Le,Ve)=>Object.assign(Le,Ve),{});return{loaderResults:Be,fetcherResults:ze}}function Ye(){z=!0,U.forEach((Y,te)=>{V.has(te)&&M.add(te),Zn(te)})}function it(Y,te,le={}){T.fetchers.set(Y,te),Me({fetchers:new Map(T.fetchers)},{flushSync:(le&&le.flushSync)===!0})}function lt(Y,te,le,Se={}){let _e=Bi(T.matches,te);On(Y),Me({errors:{[_e.route.id]:le},fetchers:new Map(T.fetchers)},{flushSync:(Se&&Se.flushSync)===!0})}function Dn(Y){return $.set(Y,($.get(Y)||0)+1),Q.has(Y)&&Q.delete(Y),T.fetchers.get(Y)||k9}function Ka(Y,te){Zn(Y,te==null?void 0:te.reason),it(Y,Uo(null))}function On(Y){let te=T.fetchers.get(Y);V.has(Y)&&!(te&&te.state==="loading"&&ve.has(Y))&&Zn(Y),U.delete(Y),ve.delete(Y),P.delete(Y),Q.delete(Y),M.delete(Y),T.fetchers.delete(Y)}function di(Y){let te=($.get(Y)||0)-1;te<=0?($.delete(Y),Q.add(Y)):$.set(Y,te),Me({fetchers:new Map(T.fetchers)})}function Zn(Y,te){let le=V.get(Y);le&&(le.abort(te),V.delete(Y))}function Un(Y){for(let te of Y){let le=Dn(te),Se=Uo(le.data);T.fetchers.set(te,Se)}}function Er(){let Y=[],te=!1;for(let le of P){let Se=T.fetchers.get(le);kt(Se,`Expected fetcher: ${le}`),Se.state==="loading"&&(P.delete(le),Y.push(le),te=!0)}return Un(Y),te}function Fn(Y){let te=[];for(let[le,Se]of ve)if(Se<Y){let _e=T.fetchers.get(le);kt(_e,`Expected fetcher: ${le}`),_e.state==="loading"&&(Zn(le),ve.delete(le),te.push(le))}return Un(te),te.length>0}function Al(Y,te){let le=T.blockers.get(Y)||lf;return ne.get(Y)!==te&&ne.set(Y,te),le}function Fs(Y){T.blockers.delete(Y),ne.delete(Y)}function fi(Y,te){let le=T.blockers.get(Y)||lf;kt(le.state==="unblocked"&&te.state==="blocked"||le.state==="blocked"&&te.state==="blocked"||le.state==="blocked"&&te.state==="proceeding"||le.state==="blocked"&&te.state==="unblocked"||le.state==="proceeding"&&te.state==="unblocked",`Invalid blocker state transition: ${le.state} -> ${te.state}`);let Se=new Map(T.blockers);Se.set(Y,te),Me({blockers:Se})}function yo({currentLocation:Y,nextLocation:te,historyAction:le}){if(ne.size===0)return;ne.size>1&&Pn(!1,"A router only supports one blocker at a time");let Se=Array.from(ne.entries()),[_e,He]=Se[Se.length-1],Be=T.blockers.get(_e);if(!(Be&&Be.state==="proceeding")&&He({currentLocation:Y,nextLocation:te,historyAction:le}))return _e}function zs(Y){let te=as(404,{pathname:Y}),le=f||u,{matches:Se,route:_e}=Jm(le);return{notFoundMatches:Se,route:_e,error:te}}function In(Y,te,le){if(S=Y,E=te,C=le||null,!R&&T.navigation===d0){R=!0;let Se=wr(T.location,T.matches);Se!=null&&Me({restoreScrollPosition:Se})}return()=>{S=null,E=null,C=null}}function _n(Y,te){return C&&C(Y,te.map(Se=>s9(Se,T.loaderData)))||Y.key}function tr(Y,te){if(S&&E){let le=_n(Y,te);S[le]=E()}}function wr(Y,te){if(S){let le=_n(Y,te),Se=S[le];if(typeof Se=="number")return Se}return null}function cr(Y,te,le){if(e.patchRoutesOnNavigation)if(Y){if(Object.keys(Y[0].params).length>0)return{active:!0,matches:Cf(te,le,m,!0)}}else return{active:!0,matches:Cf(te,le,m,!0)||[]};return{active:!1,matches:null}}async function Yn(Y,te,le,Se){if(!e.patchRoutesOnNavigation)return{type:"success",matches:Y};let _e=Y;for(;;){let He=f==null,Be=f||u,ze=c;try{await e.patchRoutesOnNavigation({signal:le,path:te,matches:_e,fetcherKey:Se,patch:(et,Je)=>{le.aborted||xj(et,Je,Be,ze,i,!1)}})}catch(et){return{type:"error",error:et,partialMatches:_e}}finally{He&&!le.aborted&&(u=[...u])}if(le.aborted)return{type:"aborted"};let Le=Gi(Be,te,m),Ve=null;if(Le){if(Object.keys(Le[0].params).length===0)return{type:"success",matches:Le};if(Ve=Cf(Be,te,m,!0),!(Ve&&_e.length<Ve.length&&Rr(_e,Ve.slice(0,_e.length))))return{type:"success",matches:Le}}if(Ve||(Ve=Cf(Be,te,m,!0)),!Ve||Rr(_e,Ve))return{type:"success",matches:null};_e=Ve}}function Rr(Y,te){return Y.length===te.length&&Y.every((le,Se)=>le.route.id===te[Se].route.id)}function da(Y){c={},f=Ff(Y,i,void 0,c)}function Wn(Y,te,le=!1){let Se=f==null;xj(Y,te,f||u,c,i,le),Se&&(u=[...u],Me({}))}return I={get basename(){return m},get future(){return y},get state(){return T},get routes(){return u},get window(){return t},initialize:he,subscribe:Ee,enableScrollRestoration:In,navigate:nt,fetch:G,revalidate:ut,createHref:Y=>e.history.createHref(Y),encodeLocation:Y=>e.history.encodeLocation(Y),getFetcher:Dn,resetFetcher:Ka,deleteFetcher:di,dispose:ge,getBlocker:Al,deleteBlocker:Fs,patchRoutes:Wn,_internalFetchControllers:V,_internalSetRoutes:da,_internalSetStateDoNotUseOrYouWillBreakYourApp(Y){Me(Y)}},e.unstable_instrumentations&&(I=R9(I,e.unstable_instrumentations.map(Y=>Y.router).filter(Boolean))),I}function U9(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function p1(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=Fg(r||".",Ug(c),ls(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=Ob(f.search);if(u.route.index&&!m)f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index";else if(!u.route.index&&m){let g=new URLSearchParams(f.search),y=g.getAll("index");g.delete("index"),y.filter(v=>v).forEach(v=>g.append("index",v));let x=g.toString();f.search=x?`?${x}`:""}}return n!=="/"&&(f.pathname=x9({basename:n,pathname:f.pathname})),oo(f)}function gj(e,t,n){if(!n||!U9(n))return{path:t};if(n.formMethod&&!eL(n.formMethod))return{path:t,error:as(405,{method:n.formMethod})};let r=()=>({path:t,error:as(400,{type:"invalid-body"})}),i=(n.formMethod||"get").toUpperCase(),c=UN(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!Jr(i))return r();let y=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((x,[v,S])=>`${x}${v}=${S}
|
|
59
|
-
`,""):String(n.body);return{path:t,submission:{formMethod:i,formAction:c,formEncType:n.formEncType,formData:void 0,json:void 0,text:y}}}else if(n.formEncType==="application/json"){if(!Jr(i))return r();try{let y=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:y,text:void 0}}}catch{return r()}}}kt(typeof FormData=="function","FormData is not available in this environment");let u,f;if(n.formData)u=x1(n.formData),f=n.formData;else if(n.body instanceof FormData)u=x1(n.body),f=n.body;else if(n.body instanceof URLSearchParams)u=n.body,f=Ej(u);else if(n.body==null)u=new URLSearchParams,f=new FormData;else try{u=new URLSearchParams(n.body),f=Ej(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(Jr(m.formMethod))return{path:t,submission:m};let g=fl(t);return e&&g.search&&Ob(g.search)&&u.append("index",""),g.search=`?${u}`,{path:oo(g),submission:m}}function yj(e,t,n,r,s,i,c,u,f,m,g,y,x,v,S,C,E,R,j,_){var F;let A=_?ka(_[1])?_[1].error:_[1].data:void 0,O=s.createURL(i.location),I=s.createURL(f),T;if(g&&i.errors){let z=Object.keys(i.errors)[0];T=c.findIndex(M=>M.route.id===z)}else if(_&&ka(_[1])){let z=_[0];T=c.findIndex(M=>M.route.id===z)-1}let D=_?_[1].statusCode:void 0,L=D&&D>=400,H={currentUrl:O,currentParams:((F=i.matches[0])==null?void 0:F.params)||{},nextUrl:I,nextParams:c[0].params,...u,actionResult:A,actionStatus:D},B=Ab(c.map(z=>z.route.path)),q=c.map((z,M)=>{let{route:V}=z,K=null;if(T!=null&&M>T?K=!1:V.lazy?K=!0:Db(V)?g?K=g1(V,i.loaderData,i.errors):F9(i.loaderData,i.matches[M],z)&&(K=!0):K=!1,K!==null)return y1(n,r,e,B,z,m,t,K);let se=L?!1:y||O.pathname+O.search===I.pathname+I.search||O.search!==I.search||z9(i.matches[M],z),ve={...H,defaultShouldRevalidate:se},P=Bp(z,ve);return y1(n,r,e,B,z,m,t,P,ve)}),Z=[];return S.forEach((z,M)=>{if(g||!c.some(Q=>Q.route.id===z.routeId)||v.has(M))return;let V=i.fetchers.get(M),K=V&&V.state!=="idle"&&V.data===void 0,se=Gi(E,z.path,R);if(!se){if(j&&K)return;Z.push({key:M,routeId:z.routeId,path:z.path,matches:null,match:null,request:null,controller:null});return}if(C.has(M))return;let ve=Np(se,z.path),P=new AbortController,U=xu(s,z.path,P.signal),$=null;if(x.has(M))x.delete(M),$=Au(n,r,U,se,ve,m,t);else if(K)y&&($=Au(n,r,U,se,ve,m,t));else{let Q={...H,defaultShouldRevalidate:L?!1:y};Bp(ve,Q)&&($=Au(n,r,U,se,ve,m,t,Q))}$&&Z.push({key:M,routeId:z.routeId,path:z.path,matches:$,match:ve,request:U,controller:P})}),{dsMatches:q,revalidatingFetchers:Z}}function Db(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function g1(e,t,n){if(e.lazy)return!0;if(!Db(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 F9(e,t,n){let r=!t||n.route.id!==t.route.id,s=!e.hasOwnProperty(n.route.id);return r||s}function z9(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function Bp(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function xj(e,t,n,r,s,i){let c;if(e){let m=r[e];kt(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 g=c.find(y=>IN(m,y));g?f.push({existingRoute:g,newRoute:m}):u.push(m)}),u.length>0){let m=Ff(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:g,newRoute:y}=f[m],x=g,[v]=Ff([y],s,[],{},!0);Object.assign(x,{element:v.element?v.element:x.element,errorElement:v.errorElement?v.errorElement:x.errorElement,hydrateFallbackElement:v.hydrateFallbackElement?v.hydrateFallbackElement:x.hydrateFallbackElement})}}function IN(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=>IN(n,i))}):!1}var vj=new WeakMap,MN=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let s=n[t.id];if(kt(s,"No route found in manifest"),!s.lazy||typeof s.lazy!="object")return;let i=s.lazy[e];if(!i)return;let c=vj.get(s);c||(c={},vj.set(s,c));let u=c[e];if(u)return u;let f=(async()=>{let m=t9(e),y=s[e]!==void 0&&e!=="hasErrorBoundary";if(m)Pn(!m,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),c[e]=Promise.resolve();else if(y)Pn(!1,`Route "${s.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let x=await i();x!=null&&(Object.assign(s,{[e]:x}),Object.assign(s,r(s)))}typeof s.lazy=="object"&&(s.lazy[e]=void 0,Object.values(s.lazy).every(x=>x===void 0)&&(s.lazy=void 0))})();return c[e]=f,f},bj=new WeakMap;function H9(e,t,n,r,s){let i=n[e.id];if(kt(i,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let g=bj.get(i);if(g)return{lazyRoutePromise:g,lazyHandlerPromise:g};let y=(async()=>{kt(typeof e.lazy=="function","No lazy route function found");let x=await e.lazy(),v={};for(let S in x){let C=x[S];if(C===void 0)continue;let E=r9(S),j=i[S]!==void 0&&S!=="hasErrorBoundary";E?Pn(!E,"Route property "+S+" is not a supported property to be returned from a lazy route function. This property will be ignored."):j?Pn(!j,`Route "${i.id}" has a static property "${S}" defined but its lazy function is also returning a value for this property. The lazy route property "${S}" will be ignored.`):v[S]=C}Object.assign(i,v),Object.assign(i,{...r(i),lazy:void 0})})();return bj.set(i,y),y.catch(()=>{}),{lazyRoutePromise:y,lazyHandlerPromise:y}}let c=Object.keys(e.lazy),u=[],f;for(let g of c){if(s&&s.includes(g))continue;let y=MN({key:g,route:e,manifest:n,mapRouteProperties:r});y&&(u.push(y),g===t&&(f=y))}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 Sj(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 V9(e){return e.matches.some(t=>t.route.middleware)?kN(e,()=>Sj(e)):Sj(e)}function kN(e,t){return $9(e,t,r=>r,Q9,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.unstable_shouldCallHandler()),0)),f=Bi(c,c[u].route.id).route.id;return Promise.resolve({[f]:{type:"error",result:r}})}}}async function $9(e,t,n,r,s){let{matches:i,request:c,params:u,context:f,unstable_pattern:m}=e,g=i.flatMap(x=>x.route.middleware?x.route.middleware.map(v=>[x.route.id,v]):[]);return await LN({request:c,params:u,context:f,unstable_pattern:m},g,t,n,r,s)}async function LN(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,g]=f,y,x=async()=>{if(y)throw new Error("You may only call `next()` once per middleware");try{return y={value:await LN(e,t,n,r,s,i,c+1)},y.value}catch(v){return y={value:await i(v,m,y)},y.value}};try{let v=await g(e,x),S=v!=null?r(v):void 0;return s(S)?S:y?S??y.value:(y={value:await x()},y.value)}catch(v){return await i(v,m,y)}}function PN(e,t,n,r,s){let i=MN({key:"middleware",route:r.route,manifest:t,mapRouteProperties:e}),c=H9(r.route,Jr(n.method)?"action":"loader",t,e,s);return{middleware:i,route:c.lazyRoutePromise,handler:c.lazyHandlerPromise}}function y1(e,t,n,r,s,i,c,u,f=null){let m=!1,g=PN(e,t,n,s,i);return{...s,_lazyPromises:g,shouldLoad:u,unstable_shouldRevalidateArgs:f,unstable_shouldCallHandler(y){return m=!0,f?typeof y=="boolean"?Bp(s,{...f,defaultShouldRevalidate:y}):Bp(s,f):u},resolve(y){let{lazy:x,loader:v,middleware:S}=s.route,C=m||u||y&&!Jr(n.method)&&(x||v),E=S&&S.length>0&&!v&&!x;return C&&(Jr(n.method)||!E)?B9({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 Au(e,t,n,r,s,i,c,u=null){return r.map(f=>f.route.id!==s.route.id?{...f,shouldLoad:!1,unstable_shouldRevalidateArgs:u,unstable_shouldCallHandler:()=>!1,_lazyPromises:PN(e,t,n,f,i),resolve:()=>Promise.resolve({type:"data",result:void 0})}:y1(e,t,n,Ab(r.map(m=>m.route.path)),f,i,c,!0,u))}async function G9(e,t,n,r,s,i){n.some(m=>{var g;return(g=m._lazyPromises)==null?void 0:g.middleware})&&await Promise.all(n.map(m=>{var g;return(g=m._lazyPromises)==null?void 0:g.middleware}));let c={request:t,unstable_pattern:Ab(n.map(m=>m.route.path)),params:n[0].params,context:s,matches:n},f=await e({...c,fetcherKey:r,runClientMiddleware:m=>{let g=c;return kN(g,()=>m({...g,fetcherKey:r,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(n.flatMap(m=>{var g,y;return[(g=m._lazyPromises)==null?void 0:g.handler,(y=m._lazyPromises)==null?void 0:y.route]}))}catch{}return f}async function B9({request:e,unstable_pattern:t,match:n,lazyHandlerPromise:r,lazyRoutePromise:s,handlerOverride:i,scopedContext:c}){let u,f,m=Jr(e.method),g=m?"action":"loader",y=x=>{let v,S=new Promise((R,j)=>v=j);f=()=>v(),e.signal.addEventListener("abort",f);let C=R=>typeof x!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${g}" [routeId: ${n.route.id}]`)):x({request:e,unstable_pattern:t,params:n.params,context:c},...R!==void 0?[R]:[]),E=(async()=>{try{return{type:"data",result:await(i?i(j=>C(j)):C())}}catch(R){return{type:"error",result:R}}})();return Promise.race([E,S])};try{let x=m?n.route.action:n.route.loader;if(r||s)if(x){let v,[S]=await Promise.all([y(x).catch(C=>{v=C}),r,s]);if(v!==void 0)throw v;u=S}else{await r;let v=m?n.route.action:n.route.loader;if(v)[u]=await Promise.all([y(v),s]);else if(g==="action"){let S=new URL(e.url),C=S.pathname+S.search;throw as(405,{method:e.method,pathname:C,routeId:n.route.id})}else return{type:"data",result:void 0}}else if(x)u=await y(x);else{let v=new URL(e.url),S=v.pathname+v.search;throw as(404,{pathname:S})}}catch(x){return{type:"error",result:x}}finally{f&&e.signal.removeEventListener("abort",f)}return u}async function q9(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 K9(e){var r,s,i,c,u,f;let{result:t,type:n}=e;if(FN(t)){let m;try{m=await q9(t)}catch(g){return{type:"error",error:g}}return n==="error"?{type:"error",error:new Gp(t.status,t.statusText,m),statusCode:t.status,headers:t.headers}:{type:"data",data:m,statusCode:t.status,headers:t.headers}}return n==="error"?Tj(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:(r=t.init)==null?void 0:r.status,headers:(s=t.init)!=null&&s.headers?new Headers(t.init.headers):void 0}:{type:"error",error:new Gp(((i=t.init)==null?void 0:i.status)||500,void 0,t.data),statusCode:zf(t)?t.status:void 0,headers:(c=t.init)!=null&&c.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:zf(t)?t.status:void 0}:Tj(t)?{type:"data",data:t.data,statusCode:(u=t.init)==null?void 0:u.status,headers:(f=t.init)!=null&&f.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function Z9(e,t,n,r,s){let i=e.headers.get("Location");if(kt(i,"Redirects returned/thrown from loaders/actions must have a Location header"),!Pg(i)){let c=r.slice(0,r.findIndex(u=>u.route.id===n)+1);i=p1(new URL(t.url),c,s,i),e.headers.set("Location",i)}return e}function Cj(e,t,n){if(Pg(e)){let r=e,s=r.startsWith("//")?new URL(t.protocol+r):new URL(r),i=ls(s.pathname,n)!=null;if(s.origin===t.origin&&i)return s.pathname+s.search+s.hash}return e}function xu(e,t,n,r){let s=e.createURL(UN(t)).toString(),i={signal:n};if(r&&Jr(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=x1(r.formData):i.body=r.formData}return new Request(s,i)}function x1(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function Ej(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function Y9(e,t,n,r=!1,s=!1){let i={},c=null,u,f=!1,m={},g=n&&ka(n[1])?n[1].error:void 0;return e.forEach(y=>{if(!(y.route.id in t))return;let x=y.route.id,v=t[x];if(kt(!Xl(v),"Cannot handle redirect results in processLoaderData"),ka(v)){let S=v.error;if(g!==void 0&&(S=g,g=void 0),c=c||{},s)c[x]=S;else{let C=Bi(e,x);c[C.route.id]==null&&(c[C.route.id]=S)}r||(i[x]=ON),f||(f=!0,u=zf(v.error)?v.error.status:500),v.headers&&(m[x]=v.headers)}else i[x]=v.data,v.statusCode&&v.statusCode!==200&&!f&&(u=v.statusCode),v.headers&&(m[x]=v.headers)}),g!==void 0&&n&&(c={[n[0]]:g},n[2]&&(i[n[2]]=void 0)),{loaderData:i,errors:c,statusCode:u||200,loaderHeaders:m}}function wj(e,t,n,r,s,i){let{loaderData:c,errors:u}=Y9(t,n,r);return s.filter(f=>!f.matches||f.matches.some(m=>m.shouldLoad)).forEach(f=>{let{key:m,match:g,controller:y}=f;if(y&&y.signal.aborted)return;let x=i[m];if(kt(x,"Did not find corresponding fetcher result"),ka(x)){let v=Bi(e.matches,g==null?void 0:g.route.id);u&&u[v.route.id]||(u={...u,[v.route.id]:x.error}),e.fetchers.delete(m)}else if(Xl(x))kt(!1,"Unhandled fetcher revalidation redirect");else{let v=Uo(x.data);e.fetchers.set(m,v)}}),{loaderData:c,errors:u}}function Rj(e,t,n,r){let s=Object.entries(t).filter(([,i])=>i!==ON).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 jj(e){return e?ka(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Bi(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 Jm(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 as(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 Gp(e||500,c,new Error(u),!0)}function ep(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,s]=t[n];if(Xl(s))return{key:r,result:s}}}function UN(e){let t=typeof e=="string"?fl(e):e;return oo({...t,hash:""})}function W9(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function Q9(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,n])=>typeof t=="string"&&X9(n))}function X9(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function J9(e){return FN(e.result)&&I9.has(e.result.status)}function ka(e){return e.type==="error"}function Xl(e){return(e&&e.type)==="redirect"}function Tj(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function FN(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function eL(e){return O9.has(e.toUpperCase())}function Jr(e){return A9.has(e.toUpperCase())}function Ob(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Np(e,t){let n=typeof t=="string"?fl(t).search:t.search;if(e[e.length-1].route.index&&Ob(n||""))return e[e.length-1];let r=_N(e);return r[r.length-1]}function _j(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 f0(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 tL(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 cf(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 nL(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 Uo(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 rL(e,t){try{let n=e.sessionStorage.getItem(DN);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 aL(e,t){if(t.size>0){let n={};for(let[r,s]of t)n[r]=[...s];try{e.sessionStorage.setItem(DN,JSON.stringify(n))}catch(r){Pn(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function sL(){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 yc=h.createContext(null);yc.displayName="DataRouter";var ah=h.createContext(null);ah.displayName="DataRouterState";h.createContext(!1);var Ib=h.createContext({isTransitioning:!1});Ib.displayName="ViewTransition";var zN=h.createContext(new Map);zN.displayName="Fetchers";var oL=h.createContext(null);oL.displayName="Await";var Os=h.createContext(null);Os.displayName="Navigation";var zg=h.createContext(null);zg.displayName="Location";var cs=h.createContext({outlet:null,matches:[],isDataRoute:!1});cs.displayName="Route";var Mb=h.createContext(null);Mb.displayName="RouteError";function iL(e,{relative:t}={}){kt(Xu(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=h.useContext(Os),{hash:s,pathname:i,search:c}=sh(e,{relative:t}),u=i;return n!=="/"&&(u=i==="/"?n:Js([n,i])),r.createHref({pathname:u,search:c,hash:s})}function Xu(){return h.useContext(zg)!=null}function uo(){return kt(Xu(),"useLocation() may be used only in the context of a <Router> component."),h.useContext(zg).location}var HN="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function VN(e){h.useContext(Os).static||h.useLayoutEffect(e)}function xc(){let{isDataRoute:e}=h.useContext(cs);return e?SL():lL()}function lL(){kt(Xu(),"useNavigate() may be used only in the context of a <Router> component.");let e=h.useContext(yc),{basename:t,navigator:n}=h.useContext(Os),{matches:r}=h.useContext(cs),{pathname:s}=uo(),i=JSON.stringify(Ug(r)),c=h.useRef(!1);return VN(()=>{c.current=!0}),h.useCallback((f,m={})=>{if(Pn(c.current,HN),!c.current)return;if(typeof f=="number"){n.go(f);return}let g=Fg(f,JSON.parse(i),s,m.relative==="path");e==null&&t!=="/"&&(g.pathname=g.pathname==="/"?t:Js([t,g.pathname])),(m.replace?n.replace:n.push)(g,m.state,m)},[t,n,i,s,e])}var $N=h.createContext(null);function qa(){return h.useContext($N)}function cL(e){let t=h.useContext(cs).outlet;return h.useMemo(()=>t&&h.createElement($N.Provider,{value:e},t),[t,e])}function kb(){let{matches:e}=h.useContext(cs),t=e[e.length-1];return t?t.params:{}}function sh(e,{relative:t}={}){let{matches:n}=h.useContext(cs),{pathname:r}=uo(),s=JSON.stringify(Ug(n));return h.useMemo(()=>Fg(e,JSON.parse(s),r,t==="path"),[e,s,r,t])}function uL(e,t,n,r,s){kt(Xu(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=h.useContext(Os),{matches:c}=h.useContext(cs),u=c[c.length-1],f=u?u.params:{},m=u?u.pathname:"/",g=u?u.pathnameBase:"/",y=u&&u.route;{let j=y&&y.path||"";GN(m,!y||j.endsWith("*")||j.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${m}" (under <Route path="${j}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
60
|
-
|
|
61
|
-
Please change the parent <Route path="${j}"> to <Route path="${j==="/"?"*":`${j}/*`}">.`)}let x=uo(),v;v=x;let S=v.pathname||"/",C=S;if(g!=="/"){let j=g.replace(/^\//,"").split("/");C="/"+S.replace(/^\//,"").split("/").slice(j.length).join("/")}let E=Gi(e,{pathname:C});return Pn(y||E!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),Pn(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.`),pL(E&&E.map(j=>Object.assign({},j,{params:Object.assign({},f,j.params),pathname:Js([g,i.encodeLocation?i.encodeLocation(j.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:j.pathname]),pathnameBase:j.pathnameBase==="/"?g:Js([g,i.encodeLocation?i.encodeLocation(j.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:j.pathnameBase])})),c,n,r,s)}function dL(){let e=bL(),t=zf(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 fL=h.createElement(dL,null),hL=class extends h.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){return this.state.error!==void 0?h.createElement(cs.Provider,{value:this.props.routeContext},h.createElement(Mb.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function mL({routeContext:e,match:t,children:n}){let r=h.useContext(yc);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),h.createElement(cs.Provider,{value:e},n)}function pL(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 g=i.findIndex(y=>y.route.id&&(c==null?void 0:c[y.route.id])!==void 0);kt(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(c).join(",")}`),i=i.slice(0,Math.min(i.length,g+1))}let u=!1,f=-1;if(n)for(let g=0;g<i.length;g++){let y=i[g];if((y.route.HydrateFallback||y.route.hydrateFallbackElement)&&(f=g),y.route.id){let{loaderData:x,errors:v}=n,S=y.route.loader&&!x.hasOwnProperty(y.route.id)&&(!v||v[y.route.id]===void 0);if(y.route.lazy||S){u=!0,f>=0?i=i.slice(0,f+1):i=[i[0]];break}}}let m=n&&r?(g,y)=>{var x,v;r(g,{location:n.location,params:((v=(x=n.matches)==null?void 0:x[0])==null?void 0:v.params)??{},errorInfo:y})}:void 0;return i.reduceRight((g,y,x)=>{let v,S=!1,C=null,E=null;n&&(v=c&&y.route.id?c[y.route.id]:void 0,C=y.route.errorElement||fL,u&&(f<0&&x===0?(GN("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),S=!0,E=null):f===x&&(S=!0,E=y.route.hydrateFallbackElement||null)));let R=t.concat(i.slice(0,x+1)),j=()=>{let _;return v?_=C:S?_=E:y.route.Component?_=h.createElement(y.route.Component,null):y.route.element?_=y.route.element:_=g,h.createElement(mL,{match:y,routeContext:{outlet:g,matches:R,isDataRoute:n!=null},children:_})};return n&&(y.route.ErrorBoundary||y.route.errorElement||x===0)?h.createElement(hL,{location:n.location,revalidation:n.revalidation,component:C,error:v,children:j(),routeContext:{outlet:null,matches:R,isDataRoute:!0},onError:m}):j()},null)}function Lb(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function gL(e){let t=h.useContext(yc);return kt(t,Lb(e)),t}function yL(e){let t=h.useContext(ah);return kt(t,Lb(e)),t}function xL(e){let t=h.useContext(cs);return kt(t,Lb(e)),t}function Pb(e){let t=xL(e),n=t.matches[t.matches.length-1];return kt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function vL(){return Pb("useRouteId")}function bL(){var r;let e=h.useContext(Mb),t=yL("useRouteError"),n=Pb("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function SL(){let{router:e}=gL("useNavigate"),t=Pb("useNavigate"),n=h.useRef(!1);return VN(()=>{n.current=!0}),h.useCallback(async(s,i={})=>{Pn(n.current,HN),n.current&&(typeof s=="number"?e.navigate(s):await e.navigate(s,{fromRouteId:t,...i}))},[e,t])}var Nj={};function GN(e,t,n){!t&&!Nj[e]&&(Nj[e]=!0,Pn(!1,n))}var Aj={};function Dj(e,t){!e&&!Aj[t]&&(Aj[t]=!0,console.warn(t))}function CL(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&Pn(!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&&Pn(!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&&Pn(!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 EL=["HydrateFallback","hydrateFallbackElement"],wL=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 RL({router:e,flushSync:t,unstable_onError:n}){let[r,s]=h.useState(e.state),[i,c]=h.useState(),[u,f]=h.useState({isTransitioning:!1}),[m,g]=h.useState(),[y,x]=h.useState(),[v,S]=h.useState(),C=h.useRef(new Map),E=h.useCallback(O=>{s(I=>(O.errors&&n&&Object.entries(O.errors).forEach(([T,D])=>{var L,H;((L=I.errors)==null?void 0:L[T])!==D&&n(D,{location:O.location,params:((H=O.matches[0])==null?void 0:H.params)??{}})}),O))},[n]),R=h.useCallback((O,{deletedFetchers:I,flushSync:T,viewTransitionOpts:D})=>{O.fetchers.forEach((H,B)=>{H.data!==void 0&&C.current.set(B,H.data)}),I.forEach(H=>C.current.delete(H)),Dj(T===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let L=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(Dj(D==null||L,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!D||!L){t&&T?t(()=>E(O)):h.startTransition(()=>E(O));return}if(t&&T){t(()=>{y&&(m&&m.resolve(),y.skipTransition()),f({isTransitioning:!0,flushSync:!0,currentLocation:D.currentLocation,nextLocation:D.nextLocation})});let H=e.window.document.startViewTransition(()=>{t(()=>E(O))});H.finished.finally(()=>{t(()=>{g(void 0),x(void 0),c(void 0),f({isTransitioning:!1})})}),t(()=>x(H));return}y?(m&&m.resolve(),y.skipTransition(),S({state:O,currentLocation:D.currentLocation,nextLocation:D.nextLocation})):(c(O),f({isTransitioning:!0,flushSync:!1,currentLocation:D.currentLocation,nextLocation:D.nextLocation}))},[e.window,t,y,m,E]);h.useLayoutEffect(()=>e.subscribe(R),[e,R]),h.useEffect(()=>{u.isTransitioning&&!u.flushSync&&g(new wL)},[u]),h.useEffect(()=>{if(m&&i&&e.window){let O=i,I=m.promise,T=e.window.document.startViewTransition(async()=>{h.startTransition(()=>E(O)),await I});T.finished.finally(()=>{g(void 0),x(void 0),c(void 0),f({isTransitioning:!1})}),x(T)}},[i,m,e.window,E]),h.useEffect(()=>{m&&i&&r.location.key===i.location.key&&m.resolve()},[m,y,r.location,i]),h.useEffect(()=>{!u.isTransitioning&&v&&(c(v.state),f({isTransitioning:!0,flushSync:!1,currentLocation:v.currentLocation,nextLocation:v.nextLocation}),S(void 0))},[u.isTransitioning,v]);let j=h.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:O=>e.navigate(O),push:(O,I,T)=>e.navigate(O,{state:I,preventScrollReset:T==null?void 0:T.preventScrollReset}),replace:(O,I,T)=>e.navigate(O,{replace:!0,state:I,preventScrollReset:T==null?void 0:T.preventScrollReset})}),[e]),_=e.basename||"/",A=h.useMemo(()=>({router:e,navigator:j,static:!1,basename:_,unstable_onError:n}),[e,j,_,n]);return h.createElement(h.Fragment,null,h.createElement(yc.Provider,{value:A},h.createElement(ah.Provider,{value:r},h.createElement(zN.Provider,{value:C.current},h.createElement(Ib.Provider,{value:u},h.createElement(NL,{basename:_,location:r.location,navigationType:r.historyAction,navigator:j},h.createElement(jL,{routes:e.routes,future:e.future,state:r,unstable_onError:n})))))),null)}var jL=h.memo(TL);function TL({routes:e,future:t,state:n,unstable_onError:r}){return uL(e,void 0,n,r,t)}function _L({to:e,replace:t,state:n,relative:r}){kt(Xu(),"<Navigate> may be used only in the context of a <Router> component.");let{static:s}=h.useContext(Os);Pn(!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(cs),{pathname:c}=uo(),u=xc(),f=Fg(e,Ug(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 Ub(e){return cL(e.context)}function NL({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:s,static:i=!1}){kt(!Xu(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),u=h.useMemo(()=>({basename:c,navigator:s,static:i,future:{}}),[c,s,i]);typeof n=="string"&&(n=fl(n));let{pathname:f="/",search:m="",hash:g="",state:y=null,key:x="default"}=n,v=h.useMemo(()=>{let S=ls(f,c);return S==null?null:{location:{pathname:S,search:m,hash:g,state:y,key:x},navigationType:r}},[c,f,m,g,y,x,r]);return Pn(v!=null,`<Router basename="${c}"> is not able to match the URL "${f}${m}${g}" because it does not start with the basename, so the <Router> won't render anything.`),v==null?null:h.createElement(Os.Provider,{value:u},h.createElement(zg.Provider,{children:t,value:v}))}var Ap="get",Dp="application/x-www-form-urlencoded";function Hg(e){return e!=null&&typeof e.tagName=="string"}function AL(e){return Hg(e)&&e.tagName.toLowerCase()==="button"}function DL(e){return Hg(e)&&e.tagName.toLowerCase()==="form"}function OL(e){return Hg(e)&&e.tagName.toLowerCase()==="input"}function IL(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ML(e,t){return e.button===0&&(!t||t==="_self")&&!IL(e)}function v1(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 kL(e,t){let n=v1(e);return t&&t.forEach((r,s)=>{n.has(s)||t.getAll(s).forEach(i=>{n.append(s,i)})}),n}var tp=null;function LL(){if(tp===null)try{new FormData(document.createElement("form"),0),tp=!1}catch{tp=!0}return tp}var PL=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function h0(e){return e!=null&&!PL.has(e)?(Pn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Dp}"`),null):e}function UL(e,t){let n,r,s,i,c;if(DL(e)){let u=e.getAttribute("action");r=u?ls(u,t):null,n=e.getAttribute("method")||Ap,s=h0(e.getAttribute("enctype"))||Dp,i=new FormData(e)}else if(AL(e)||OL(e)&&(e.type==="submit"||e.type==="image")){let u=e.form;if(u==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let f=e.getAttribute("formaction")||u.getAttribute("action");if(r=f?ls(f,t):null,n=e.getAttribute("formmethod")||u.getAttribute("method")||Ap,s=h0(e.getAttribute("formenctype"))||h0(u.getAttribute("enctype"))||Dp,i=new FormData(u,e),!LL()){let{name:m,type:g,value:y}=e;if(g==="image"){let x=m?`${m}.`:"";i.append(`${x}x`,"0"),i.append(`${x}y`,"0")}else m&&i.append(m,y)}}else{if(Hg(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Ap,r=null,s=Dp,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 Fb(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function FL(e,t,n){let r=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r.pathname==="/"?r.pathname=`_root.${n}`:t&&ls(r.pathname,t)==="/"?r.pathname=`${t.replace(/\/$/,"")}/_root.${n}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${n}`,r}async function zL(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 HL(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 VL(e,t,n){let r=await Promise.all(e.map(async s=>{let i=t.routes[s.route.id];if(i){let c=await zL(i,n);return c.links?c.links():[]}return[]}));return qL(r.flat(1).filter(HL).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function Oj(e,t,n,r,s,i){let c=(f,m)=>n[m]?f.route.id!==n[m].route.id:!0,u=(f,m)=>{var g;return n[m].pathname!==f.pathname||((g=n[m].route.path)==null?void 0:g.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 y;let g=r.routes[f.route.id];if(!g||!g.hasLoader)return!1;if(c(f,m)||u(f,m))return!0;if(f.route.shouldRevalidate){let x=f.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:((y=n[0])==null?void 0:y.params)||{},nextUrl:new URL(e,window.origin),nextParams:f.params,defaultShouldRevalidate:!0});if(typeof x=="boolean")return x}return!0}):[]}function $L(e,t,{includeHydrateFallback:n}={}){return GL(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 GL(e){return[...new Set(e)]}function BL(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function qL(e,t){let n=new Set;return new Set(t),e.reduce((r,s)=>{let i=JSON.stringify(BL(s));return n.has(i)||(n.add(i),r.push({key:i,link:s})),r},[])}function BN(){let e=h.useContext(yc);return Fb(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function KL(){let e=h.useContext(ah);return Fb(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var zb=h.createContext(void 0);zb.displayName="FrameworkContext";function qN(){let e=h.useContext(zb);return Fb(e,"You must render this element inside a <HydratedRouter> element"),e}function ZL(e,t){let n=h.useContext(zb),[r,s]=h.useState(!1),[i,c]=h.useState(!1),{onFocus:u,onBlur:f,onMouseEnter:m,onMouseLeave:g,onTouchStart:y}=t,x=h.useRef(null);h.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let C=R=>{R.forEach(j=>{c(j.isIntersecting)})},E=new IntersectionObserver(C,{threshold:.5});return x.current&&E.observe(x.current),()=>{E.disconnect()}}},[e]),h.useEffect(()=>{if(r){let C=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(C)}}},[r]);let v=()=>{s(!0)},S=()=>{s(!1),c(!1)};return n?e!=="intent"?[i,x,{}]:[i,x,{onFocus:uf(u,v),onBlur:uf(f,S),onMouseEnter:uf(m,v),onMouseLeave:uf(g,S),onTouchStart:uf(y,v)}]:[!1,x,{}]}function uf(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function YL({page:e,...t}){let{router:n}=BN(),r=h.useMemo(()=>Gi(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?h.createElement(QL,{page:e,matches:r,...t}):null}function WL(e){let{manifest:t,routeModules:n}=qN(),[r,s]=h.useState([]);return h.useEffect(()=>{let i=!1;return VL(e,t,n).then(c=>{i||s(c)}),()=>{i=!0}},[e,t,n]),r}function QL({page:e,matches:t,...n}){let r=uo(),{manifest:s,routeModules:i}=qN(),{basename:c}=BN(),{loaderData:u,matches:f}=KL(),m=h.useMemo(()=>Oj(e,t,f,s,r,"data"),[e,t,f,s,r]),g=h.useMemo(()=>Oj(e,t,f,s,r,"assets"),[e,t,f,s,r]),y=h.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let S=new Set,C=!1;if(t.forEach(R=>{var _;let j=s.routes[R.route.id];!j||!j.hasLoader||(!m.some(A=>A.route.id===R.route.id)&&R.route.id in u&&((_=i[R.route.id])!=null&&_.shouldRevalidate)||j.hasClientLoader?C=!0:S.add(R.route.id))}),S.size===0)return[];let E=FL(e,c,"data");return C&&S.size>0&&E.searchParams.set("_routes",t.filter(R=>S.has(R.route.id)).map(R=>R.route.id).join(",")),[E.pathname+E.search]},[c,u,r,s,m,t,e,i]),x=h.useMemo(()=>$L(g,s),[g,s]),v=WL(g);return h.createElement(h.Fragment,null,y.map(S=>h.createElement("link",{key:S,rel:"prefetch",as:"fetch",href:S,...n})),x.map(S=>h.createElement("link",{key:S,rel:"modulepreload",href:S,...n})),v.map(({key:S,link:C})=>h.createElement("link",{key:S,nonce:n.nonce,...C})))}function XL(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var KN=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{KN&&(window.__reactRouterVersion="7.9.6")}catch{}function JL(e,t){return P9({basename:t==null?void 0:t.basename,getContext:t==null?void 0:t.getContext,future:t==null?void 0:t.future,history:Qk({window:t==null?void 0:t.window}),hydrationData:e7(),routes:e,mapRouteProperties:CL,hydrationRouteProperties:EL,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 e7(){let e=window==null?void 0:window.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:t7(e.errors)}),e}function t7(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 Gp(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 ZN=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,na=h.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:s,reloadDocument:i,replace:c,state:u,target:f,to:m,preventScrollReset:g,viewTransition:y,...x},v){let{basename:S}=h.useContext(Os),C=typeof m=="string"&&ZN.test(m),E,R=!1;if(typeof m=="string"&&C&&(E=m,KN))try{let L=new URL(window.location.href),H=m.startsWith("//")?new URL(L.protocol+m):new URL(m),B=ls(H.pathname,S);H.origin===L.origin&&B!=null?m=B+H.search+H.hash:R=!0}catch{Pn(!1,`<Link to="${m}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let j=iL(m,{relative:s}),[_,A,O]=ZL(r,x),I=a7(m,{replace:c,state:u,target:f,preventScrollReset:g,relative:s,viewTransition:y});function T(L){t&&t(L),L.defaultPrevented||I(L)}let D=h.createElement("a",{...x,...O,href:E||j,onClick:R||i?t:T,ref:XL(v,A),target:f,"data-discover":!C&&n==="render"?"true":void 0});return _&&!C?h.createElement(h.Fragment,null,D,h.createElement(YL,{page:j})):D});na.displayName="Link";var oh=h.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:s=!1,style:i,to:c,viewTransition:u,children:f,...m},g){let y=sh(c,{relative:m.relative}),x=uo(),v=h.useContext(ah),{navigator:S,basename:C}=h.useContext(Os),E=v!=null&&u7(y)&&u===!0,R=S.encodeLocation?S.encodeLocation(y).pathname:y.pathname,j=x.pathname,_=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;n||(j=j.toLowerCase(),_=_?_.toLowerCase():null,R=R.toLowerCase()),_&&C&&(_=ls(_,C)||_);const A=R!=="/"&&R.endsWith("/")?R.length-1:R.length;let O=j===R||!s&&j.startsWith(R)&&j.charAt(A)==="/",I=_!=null&&(_===R||!s&&_.startsWith(R)&&_.charAt(R.length)==="/"),T={isActive:O,isPending:I,isTransitioning:E},D=O?t:void 0,L;typeof r=="function"?L=r(T):L=[r,O?"active":null,I?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let H=typeof i=="function"?i(T):i;return h.createElement(na,{...m,"aria-current":D,className:L,ref:g,style:H,to:c,viewTransition:u},typeof f=="function"?f(T):f)});oh.displayName="NavLink";var n7=h.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:s,state:i,method:c=Ap,action:u,onSubmit:f,relative:m,preventScrollReset:g,viewTransition:y,...x},v)=>{let S=l7(),C=c7(u,{relative:m}),E=c.toLowerCase()==="get"?"get":"post",R=typeof u=="string"&&ZN.test(u),j=_=>{if(f&&f(_),_.defaultPrevented)return;_.preventDefault();let A=_.nativeEvent.submitter,O=(A==null?void 0:A.getAttribute("formmethod"))||c;S(A||_.currentTarget,{fetcherKey:t,method:O,navigate:n,replace:s,state:i,relative:m,preventScrollReset:g,viewTransition:y})};return h.createElement("form",{ref:v,method:E,action:C,onSubmit:r?f:j,...x,"data-discover":!R&&e==="render"?"true":void 0})});n7.displayName="Form";function r7(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function YN(e){let t=h.useContext(yc);return kt(t,r7(e)),t}function a7(e,{target:t,replace:n,state:r,preventScrollReset:s,relative:i,viewTransition:c}={}){let u=xc(),f=uo(),m=sh(e,{relative:i});return h.useCallback(g=>{if(ML(g,t)){g.preventDefault();let y=n!==void 0?n:oo(f)===oo(m);u(e,{replace:y,state:r,preventScrollReset:s,relative:i,viewTransition:c})}},[f,u,m,n,r,t,e,s,i,c])}function s7(e){Pn(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(v1(e)),n=h.useRef(!1),r=uo(),s=h.useMemo(()=>kL(r.search,n.current?null:t.current),[r.search]),i=xc(),c=h.useCallback((u,f)=>{const m=v1(typeof u=="function"?u(new URLSearchParams(s)):u);n.current=!0,i("?"+m,f)},[i,s]);return[s,c]}var o7=0,i7=()=>`__${String(++o7)}__`;function l7(){let{router:e}=YN("useSubmit"),{basename:t}=h.useContext(Os),n=vL();return h.useCallback(async(r,s={})=>{let{action:i,method:c,encType:u,formData:f,body:m}=UL(r,t);if(s.navigate===!1){let g=s.fetcherKey||i7();await e.fetch(g,n,s.action||i,{preventScrollReset:s.preventScrollReset,formData:f,body:m,formMethod:s.method||c,formEncType:s.encType||u,flushSync:s.flushSync})}else await e.navigate(s.action||i,{preventScrollReset:s.preventScrollReset,formData:f,body:m,formMethod:s.method||c,formEncType:s.encType||u,replace:s.replace,state:s.state,fromRouteId:n,flushSync:s.flushSync,viewTransition:s.viewTransition})},[e,t,n])}function c7(e,{relative:t}={}){let{basename:n}=h.useContext(Os),r=h.useContext(cs);kt(r,"useFormAction must be used inside a RouteContext");let[s]=r.matches.slice(-1),i={...sh(e||".",{relative:t})},c=uo();if(e==null){i.search=c.search;let u=new URLSearchParams(i.search),f=u.getAll("index");if(f.some(g=>g==="")){u.delete("index"),f.filter(y=>y).forEach(y=>u.append("index",y));let g=u.toString();i.search=g?`?${g}`:""}}return(!e||e===".")&&s.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(i.pathname=i.pathname==="/"?n:Js([n,i.pathname])),oo(i)}function u7(e,{relative:t}={}){let n=h.useContext(Ib);kt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=YN("useViewTransitionState"),s=sh(e,{relative:t});if(!n.isTransitioning)return!1;let i=ls(n.currentLocation.pathname,r)||n.currentLocation.pathname,c=ls(n.nextLocation.pathname,r)||n.nextLocation.pathname;return $p(s.pathname,c)!=null||$p(s.pathname,i)!=null}var ws=EN();const d7=CN(ws);function f7(e){return h.createElement(RL,{flushSync:ws.flushSync,...e})}function Ij(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function qr(...e){return t=>{let n=!1;const r=e.map(s=>{const i=Ij(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():Ij(e[s],null)}}}}function ht(...e){return h.useCallback(qr(...e),e)}var h7=Symbol.for("react.lazy"),qp=Lg[" use ".trim().toString()];function m7(e){return typeof e=="object"&&e!==null&&"then"in e}function WN(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===h7&&"_payload"in e&&m7(e._payload)}function Hb(e){const t=p7(e),n=h.forwardRef((r,s)=>{let{children:i,...c}=r;WN(i)&&typeof qp=="function"&&(i=qp(i._payload));const u=h.Children.toArray(i),f=u.find(y7);if(f){const m=f.props.children,g=u.map(y=>y===f?h.Children.count(m)>1?h.Children.only(null):h.isValidElement(m)?m.props.children:null:y);return a.jsx(t,{...c,ref:s,children:h.isValidElement(m)?h.cloneElement(m,void 0,g):null})}return a.jsx(t,{...c,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}var ih=Hb("Slot");function p7(e){const t=h.forwardRef((n,r)=>{let{children:s,...i}=n;if(WN(s)&&typeof qp=="function"&&(s=qp(s._payload)),h.isValidElement(s)){const c=v7(s),u=x7(i,s.props);return s.type!==h.Fragment&&(u.ref=r?qr(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 g7=Symbol("radix.slottable");function y7(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===g7}function x7(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 v7(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 QN(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=QN(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function XN(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=QN(e))&&(r&&(r+=" "),r+=t);return r}const Mj=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,kj=XN,Ju=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return kj(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 g=n==null?void 0:n[m],y=i==null?void 0:i[m];if(g===null)return null;const x=Mj(g)||Mj(y);return s[m][x]}),u=n&&Object.entries(n).reduce((m,g)=>{let[y,x]=g;return x===void 0||(m[y]=x),m},{}),f=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((m,g)=>{let{class:y,className:x,...v}=g;return Object.entries(v).every(S=>{let[C,E]=S;return Array.isArray(E)?E.includes({...i,...u}[C]):{...i,...u}[C]===E})?[...m,y,x]:m},[]);return kj(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 b7=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),JN=(...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 S7={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 C7=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,...S7,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:JN("lucide",s),...u},[...c.map(([m,g])=>h.createElement(m,g)),...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 Ne=(e,t)=>{const n=h.forwardRef(({className:r,...s},i)=>h.createElement(C7,{ref:i,iconNode:t,className:JN(`lucide-${b7(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 E7=[["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"}]],Vb=Ne("ArchiveRestore",E7);/**
|
|
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 w7=[["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"}]],Lj=Ne("ArrowDownZA",w7);/**
|
|
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 R7=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],j7=Ne("ArrowLeft",R7);/**
|
|
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 T7=[["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"}]],_7=Ne("ArrowRightLeft",T7);/**
|
|
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 N7=[["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"}]],Pj=Ne("ArrowUpAZ",N7);/**
|
|
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 A7=[["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"}]],Uj=Ne("ArrowUpDown",A7);/**
|
|
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 D7=[["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"}]],O7=Ne("Asterisk",D7);/**
|
|
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 I7=[["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"}]],M7=Ne("BadgeAlert",I7);/**
|
|
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 k7=[["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"}]],L7=Ne("Blocks",k7);/**
|
|
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 P7=[["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"}]],U7=Ne("BookOpen",P7);/**
|
|
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 F7=[["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"}]],Kp=Ne("Box",F7);/**
|
|
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 z7=[["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"}]],H7=Ne("BriefcaseBusiness",z7);/**
|
|
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 V7=[["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"}]],$b=Ne("CalendarClock",V7);/**
|
|
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 $7=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],ra=Ne("Check",$7);/**
|
|
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 G7=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],fo=Ne("ChevronDown",G7);/**
|
|
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 B7=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],q7=Ne("ChevronLeft",B7);/**
|
|
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 K7=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Ra=Ne("ChevronRight",K7);/**
|
|
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 Z7=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Hu=Ne("ChevronUp",Z7);/**
|
|
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 Y7=[["path",{d:"m7 20 5-5 5 5",key:"13a0gw"}],["path",{d:"m7 4 5 5 5-5",key:"1kwcof"}]],W7=Ne("ChevronsDownUp",Y7);/**
|
|
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 Q7=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],Gb=Ne("ChevronsUpDown",Q7);/**
|
|
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 X7=[["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"}]],lh=Ne("CircleAlert",X7);/**
|
|
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 J7=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],eP=Ne("CircleCheckBig",J7);/**
|
|
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 tP=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Vg=Ne("CircleCheck",tP);/**
|
|
197
|
-
* @license lucide-react v0.475.0 - ISC
|
|
198
|
-
*
|
|
199
|
-
* This source code is licensed under the ISC license.
|
|
200
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
201
|
-
*/const nP=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Zp=Ne("CircleX",nP);/**
|
|
202
|
-
* @license lucide-react v0.475.0 - ISC
|
|
203
|
-
*
|
|
204
|
-
* This source code is licensed under the ISC license.
|
|
205
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
206
|
-
*/const rP=[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]],Bb=Ne("Code",rP);/**
|
|
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 aP=[["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"}]],sP=Ne("Columns3",aP);/**
|
|
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 oP=[["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"}]],Hf=Ne("Copy",oP);/**
|
|
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 iP=[["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"}]],eA=Ne("DatabaseZap",iP);/**
|
|
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 lP=[["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=Ne("Database",lP);/**
|
|
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 cP=[["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"}]],uP=Ne("Download",cP);/**
|
|
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 dP=[["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"}]],tA=Ne("EllipsisVertical",dP);/**
|
|
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 fP=[["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"}]],Is=Ne("Ellipsis",fP);/**
|
|
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 hP=[["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"}]],Wo=Ne("ExternalLink",hP);/**
|
|
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 mP=[["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"}]],pP=Ne("EyeOff",mP);/**
|
|
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 gP=[["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"}]],nA=Ne("Eye",gP);/**
|
|
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 yP=[["path",{d:"m18 5-2.414-2.414A2 2 0 0 0 14.172 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2",key:"142zxg"}],["path",{d:"M21.378 12.626a1 1 0 0 0-3.004-3.004l-4.01 4.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"2t3380"}],["path",{d:"M8 18h1",key:"13wk12"}]],xP=Ne("FilePenLine",yP);/**
|
|
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 vP=[["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"}]],bP=Ne("FileScan",vP);/**
|
|
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 SP=[["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"}]],CP=Ne("FileText",SP);/**
|
|
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 EP=[["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"}]],wP=Ne("FlaskConical",EP);/**
|
|
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 RP=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],jP=Ne("FolderTree",RP);/**
|
|
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 TP=[["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"}]],Fj=Ne("Gem",TP);/**
|
|
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 _P=[["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"}]],NP=Ne("Goal",_P);/**
|
|
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 AP=[["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"}]],DP=Ne("GraduationCap",AP);/**
|
|
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 OP=[["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"}]],IP=Ne("Grid2x2Check",OP);/**
|
|
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 MP=[["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"}]],rA=Ne("GripVertical",MP);/**
|
|
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 kP=[["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"}]],LP=Ne("Grip",kP);/**
|
|
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 PP=[["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"}]],UP=Ne("Group",PP);/**
|
|
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 FP=[["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"}]],zP=Ne("History",FP);/**
|
|
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 HP=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Br=Ne("Info",HP);/**
|
|
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 VP=[["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"}]],b1=Ne("KeyRound",VP);/**
|
|
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 $P=[["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"}]],GP=Ne("Layers",$P);/**
|
|
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 BP=[["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"}]],qP=Ne("ListChecks",BP);/**
|
|
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 KP=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],ed=Ne("LoaderCircle",KP);/**
|
|
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 ZP=[["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"}]],YP=Ne("Lock",ZP);/**
|
|
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 WP=[["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"}]],QP=Ne("LogOut",WP);/**
|
|
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 XP=[["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"}]],JP=Ne("Menu",XP);/**
|
|
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 eU=[["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"}]],tU=Ne("MessageCircleQuestion",eU);/**
|
|
367
|
-
* @license lucide-react v0.475.0 - ISC
|
|
368
|
-
*
|
|
369
|
-
* This source code is licensed under the ISC license.
|
|
370
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
371
|
-
*/const nU=[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]],rU=Ne("MessageCircle",nU);/**
|
|
372
|
-
* @license lucide-react v0.475.0 - ISC
|
|
373
|
-
*
|
|
374
|
-
* This source code is licensed under the ISC license.
|
|
375
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
376
|
-
*/const aU=[["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"}]],aA=Ne("Monitor",aU);/**
|
|
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 sU=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],sA=Ne("Moon",sU);/**
|
|
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 oU=[["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"}]],iU=Ne("Network",oU);/**
|
|
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 lU=[["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"}]],cU=Ne("OctagonAlert",lU);/**
|
|
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 uU=[["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"}]],dU=Ne("OctagonX",uU);/**
|
|
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 fU=[["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"}]],hU=Ne("PackageSearch",fU);/**
|
|
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 mU=[["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"}]],pU=Ne("PenLine",mU);/**
|
|
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 gU=[["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"}]],td=Ne("Pencil",gU);/**
|
|
412
|
-
* @license lucide-react v0.475.0 - ISC
|
|
413
|
-
*
|
|
414
|
-
* This source code is licensed under the ISC license.
|
|
415
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
416
|
-
*/const yU=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],$g=Ne("Play",yU);/**
|
|
417
|
-
* @license lucide-react v0.475.0 - ISC
|
|
418
|
-
*
|
|
419
|
-
* This source code is licensed under the ISC license.
|
|
420
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
421
|
-
*/const xU=[["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"}]],qb=Ne("Plug",xU);/**
|
|
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 vU=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],ua=Ne("Plus",vU);/**
|
|
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 bU=[["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"}]],SU=Ne("RefreshCw",bU);/**
|
|
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 CU=[["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"}]],EU=Ne("Route",CU);/**
|
|
437
|
-
* @license lucide-react v0.475.0 - ISC
|
|
438
|
-
*
|
|
439
|
-
* This source code is licensed under the ISC license.
|
|
440
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
441
|
-
*/const wU=[["path",{d:"m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"7g6ntu"}],["path",{d:"m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"ijws7r"}],["path",{d:"M7 21h10",key:"1b0cd5"}],["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2",key:"3gwbw2"}]],RU=Ne("Scale",wU);/**
|
|
442
|
-
* @license lucide-react v0.475.0 - ISC
|
|
443
|
-
*
|
|
444
|
-
* This source code is licensed under the ISC license.
|
|
445
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
446
|
-
*/const jU=[["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"}]],TU=Ne("ScanSearch",jU);/**
|
|
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 _U=[["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"}]],NU=Ne("ScanText",_U);/**
|
|
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 AU=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],vc=Ne("Search",AU);/**
|
|
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 DU=[["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"}]],oA=Ne("Settings",DU);/**
|
|
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 OU=[["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"}]],Wi=Ne("Sparkles",OU);/**
|
|
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 IU=[["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"}]],MU=Ne("SquareChartGantt",IU);/**
|
|
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 kU=[["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"}]],LU=Ne("SquareCheckBig",kU);/**
|
|
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 PU=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"m9 8 6 4-6 4Z",key:"f1r3lt"}]],iA=Ne("SquarePlay",PU);/**
|
|
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 UU=[["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"}]],lA=Ne("Sun",UU);/**
|
|
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 FU=[["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"}]],zU=Ne("SwatchBook",FU);/**
|
|
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 HU=[["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"}]],cA=Ne("Table",HU);/**
|
|
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 VU=[["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"}]],$U=Ne("Telescope",VU);/**
|
|
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 GU=[["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"}]],us=Ne("Trash2",GU);/**
|
|
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 BU=[["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"}]],Gg=Ne("TriangleAlert",BU);/**
|
|
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 qU=[["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"}]],Vf=Ne("Unplug",qU);/**
|
|
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 KU=[["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"}]],zj=Ne("Users",KU);/**
|
|
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 ZU=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Vu=Ne("X",ZU),m0=768;function YU(){const[e,t]=h.useState(void 0);return h.useEffect(()=>{const n=window.matchMedia(`(max-width: ${m0-1}px)`),r=()=>{t(window.innerWidth<m0)};return n.addEventListener("change",r),t(window.innerWidth<m0),()=>n.removeEventListener("change",r)},[]),!!e}const WU=(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},QU=(e,t)=>({classGroupId:e,validator:t}),uA=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Yp="-",Hj=[],XU="arbitrary..",JU=e=>{const t=tF(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:c=>{if(c.startsWith("[")&&c.endsWith("]"))return eF(c);const u=c.split(Yp),f=u[0]===""&&u.length>1?1:0;return dA(u,f,t)},getConflictingClassGroupIds:(c,u)=>{if(u){const f=r[c],m=n[c];return f?m?WU(m,f):f:m||Hj}return n[c]||Hj}}},dA=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],i=n.nextPart.get(s);if(i){const m=dA(e,t+1,i);if(m)return m}const c=n.validators;if(c===null)return;const u=t===0?e.join(Yp):e.slice(t).join(Yp),f=c.length;for(let m=0;m<f;m++){const g=c[m];if(g.validator(u))return g.classGroupId}},eF=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?XU+r:void 0})(),tF=e=>{const{theme:t,classGroups:n}=e;return nF(n,t)},nF=(e,t)=>{const n=uA();for(const r in e){const s=e[r];Kb(s,n,r,t)}return n},Kb=(e,t,n,r)=>{const s=e.length;for(let i=0;i<s;i++){const c=e[i];rF(c,t,n,r)}},rF=(e,t,n,r)=>{if(typeof e=="string"){aF(e,t,n);return}if(typeof e=="function"){sF(e,t,n,r);return}oF(e,t,n,r)},aF=(e,t,n)=>{const r=e===""?t:fA(t,e);r.classGroupId=n},sF=(e,t,n,r)=>{if(iF(e)){Kb(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(QU(n,e))},oF=(e,t,n,r)=>{const s=Object.entries(e),i=s.length;for(let c=0;c<i;c++){const[u,f]=s[c];Kb(f,fA(t,u),n,r)}},fA=(e,t)=>{let n=e;const r=t.split(Yp),s=r.length;for(let i=0;i<s;i++){const c=r[i];let u=n.nextPart.get(c);u||(u=uA(),n.nextPart.set(c,u)),n=u}return n},iF=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,lF=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)}}},S1="!",Vj=":",cF=[],$j=(e,t,n,r,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),uF=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=s=>{const i=[];let c=0,u=0,f=0,m;const g=s.length;for(let C=0;C<g;C++){const E=s[C];if(c===0&&u===0){if(E===Vj){i.push(s.slice(f,C)),f=C+1;continue}if(E==="/"){m=C;continue}}E==="["?c++:E==="]"?c--:E==="("?u++:E===")"&&u--}const y=i.length===0?s:s.slice(f);let x=y,v=!1;y.endsWith(S1)?(x=y.slice(0,-1),v=!0):y.startsWith(S1)&&(x=y.slice(1),v=!0);const S=m&&m>f?m-f:void 0;return $j(i,v,x,S)};if(t){const s=t+Vj,i=r;r=c=>c.startsWith(s)?i(c.slice(s.length)):$j(cF,!1,c,void 0,!0)}if(n){const s=r;r=i=>n({className:i,parseClassName:s})}return r},dF=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}},fF=e=>({cache:lF(e.cacheSize),parseClassName:uF(e),sortModifiers:dF(e),...JU(e)}),hF=/\s+/,mF=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i}=t,c=[],u=e.trim().split(hF);let f="";for(let m=u.length-1;m>=0;m-=1){const g=u[m],{isExternal:y,modifiers:x,hasImportantModifier:v,baseClassName:S,maybePostfixModifierPosition:C}=n(g);if(y){f=g+(f.length>0?" "+f:f);continue}let E=!!C,R=r(E?S.substring(0,C):S);if(!R){if(!E){f=g+(f.length>0?" "+f:f);continue}if(R=r(S),!R){f=g+(f.length>0?" "+f:f);continue}E=!1}const j=x.length===0?"":x.length===1?x[0]:i(x).join(":"),_=v?j+S1:j,A=_+R;if(c.indexOf(A)>-1)continue;c.push(A);const O=s(R,E);for(let I=0;I<O.length;++I){const T=O[I];c.push(_+T)}f=g+(f.length>0?" "+f:f)}return f},pF=(...e)=>{let t=0,n,r,s="";for(;t<e.length;)(n=e[t++])&&(r=hA(n))&&(s&&(s+=" "),s+=r);return s},hA=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=hA(e[r]))&&(n&&(n+=" "),n+=t);return n},gF=(e,...t)=>{let n,r,s,i;const c=f=>{const m=t.reduce((g,y)=>y(g),e());return n=fF(m),r=n.cache.get,s=n.cache.set,i=u,u(f)},u=f=>{const m=r(f);if(m)return m;const g=mF(f,n);return s(f,g),g};return i=c,(...f)=>i(pF(...f))},yF=[],fr=e=>{const t=n=>n[e]||yF;return t.isThemeGetter=!0,t},mA=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,pA=/^\((?:(\w[\w-]*):)?(.+)\)$/i,xF=/^\d+\/\d+$/,vF=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,bF=/\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$/,SF=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,CF=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,EF=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,lu=e=>xF.test(e),It=e=>!!e&&!Number.isNaN(Number(e)),Ui=e=>!!e&&Number.isInteger(Number(e)),p0=e=>e.endsWith("%")&&It(e.slice(0,-1)),ko=e=>vF.test(e),wF=()=>!0,RF=e=>bF.test(e)&&!SF.test(e),gA=()=>!1,jF=e=>CF.test(e),TF=e=>EF.test(e),_F=e=>!Ke(e)&&!Ze(e),NF=e=>nd(e,vA,gA),Ke=e=>mA.test(e),Kl=e=>nd(e,bA,RF),g0=e=>nd(e,MF,It),Gj=e=>nd(e,yA,gA),AF=e=>nd(e,xA,TF),np=e=>nd(e,SA,jF),Ze=e=>pA.test(e),df=e=>rd(e,bA),DF=e=>rd(e,kF),Bj=e=>rd(e,yA),OF=e=>rd(e,vA),IF=e=>rd(e,xA),rp=e=>rd(e,SA,!0),nd=(e,t,n)=>{const r=mA.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},rd=(e,t,n=!1)=>{const r=pA.exec(e);return r?r[1]?t(r[1]):n:!1},yA=e=>e==="position"||e==="percentage",xA=e=>e==="image"||e==="url",vA=e=>e==="length"||e==="size"||e==="bg-size",bA=e=>e==="length",MF=e=>e==="number",kF=e=>e==="family-name",SA=e=>e==="shadow",LF=()=>{const e=fr("color"),t=fr("font"),n=fr("text"),r=fr("font-weight"),s=fr("tracking"),i=fr("leading"),c=fr("breakpoint"),u=fr("container"),f=fr("spacing"),m=fr("radius"),g=fr("shadow"),y=fr("inset-shadow"),x=fr("text-shadow"),v=fr("drop-shadow"),S=fr("blur"),C=fr("perspective"),E=fr("aspect"),R=fr("ease"),j=fr("animate"),_=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],O=()=>[...A(),Ze,Ke],I=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],D=()=>[Ze,Ke,f],L=()=>[lu,"full","auto",...D()],H=()=>[Ui,"none","subgrid",Ze,Ke],B=()=>["auto",{span:["full",Ui,Ze,Ke]},Ui,Ze,Ke],q=()=>[Ui,"auto",Ze,Ke],Z=()=>["auto","min","max","fr",Ze,Ke],F=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],z=()=>["start","end","center","stretch","center-safe","end-safe"],M=()=>["auto",...D()],V=()=>[lu,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...D()],K=()=>[e,Ze,Ke],se=()=>[...A(),Bj,Gj,{position:[Ze,Ke]}],ve=()=>["no-repeat",{repeat:["","x","y","space","round"]}],P=()=>["auto","cover","contain",OF,NF,{size:[Ze,Ke]}],U=()=>[p0,df,Kl],$=()=>["","none","full",m,Ze,Ke],Q=()=>["",It,df,Kl],ne=()=>["solid","dashed","dotted","double"],ue=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],J=()=>[It,p0,Bj,Gj],he=()=>["","none",S,Ze,Ke],ge=()=>["none",It,Ze,Ke],Ee=()=>["none",It,Ze,Ke],Me=()=>[It,Ze,Ke],Fe=()=>[lu,"full",...D()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ko],breakpoint:[ko],color:[wF],container:[ko],"drop-shadow":[ko],ease:["in","out","in-out"],font:[_F],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ko],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ko],shadow:[ko],spacing:["px",It],text:[ko],"text-shadow":[ko],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",lu,Ke,Ze,E]}],container:["container"],columns:[{columns:[It,Ke,Ze,u]}],"break-after":[{"break-after":_()}],"break-before":[{"break-before":_()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:O()}],overflow:[{overflow:I()}],"overflow-x":[{"overflow-x":I()}],"overflow-y":[{"overflow-y":I()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:L()}],"inset-x":[{"inset-x":L()}],"inset-y":[{"inset-y":L()}],start:[{start:L()}],end:[{end:L()}],top:[{top:L()}],right:[{right:L()}],bottom:[{bottom:L()}],left:[{left:L()}],visibility:["visible","invisible","collapse"],z:[{z:[Ui,"auto",Ze,Ke]}],basis:[{basis:[lu,"full","auto",u,...D()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[It,lu,"auto","initial","none",Ke]}],grow:[{grow:["",It,Ze,Ke]}],shrink:[{shrink:["",It,Ze,Ke]}],order:[{order:[Ui,"first","last","none",Ze,Ke]}],"grid-cols":[{"grid-cols":H()}],"col-start-end":[{col:B()}],"col-start":[{"col-start":q()}],"col-end":[{"col-end":q()}],"grid-rows":[{"grid-rows":H()}],"row-start-end":[{row:B()}],"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":Z()}],"auto-rows":[{"auto-rows":Z()}],gap:[{gap:D()}],"gap-x":[{"gap-x":D()}],"gap-y":[{"gap-y":D()}],"justify-content":[{justify:[...F(),"normal"]}],"justify-items":[{"justify-items":[...z(),"normal"]}],"justify-self":[{"justify-self":["auto",...z()]}],"align-content":[{content:["normal",...F()]}],"align-items":[{items:[...z(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...z(),{baseline:["","last"]}]}],"place-content":[{"place-content":F()}],"place-items":[{"place-items":[...z(),"baseline"]}],"place-self":[{"place-self":["auto",...z()]}],p:[{p:D()}],px:[{px:D()}],py:[{py:D()}],ps:[{ps:D()}],pe:[{pe:D()}],pt:[{pt:D()}],pr:[{pr:D()}],pb:[{pb:D()}],pl:[{pl:D()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":D()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":D()}],"space-y-reverse":["space-y-reverse"],size:[{size:V()}],w:[{w:[u,"screen",...V()]}],"min-w":[{"min-w":[u,"screen","none",...V()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[c]},...V()]}],h:[{h:["screen","lh",...V()]}],"min-h":[{"min-h":["screen","lh","none",...V()]}],"max-h":[{"max-h":["screen","lh",...V()]}],"font-size":[{text:["base",n,df,Kl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Ze,g0]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",p0,Ke]}],"font-family":[{font:[DF,Ke,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,Ze,Ke]}],"line-clamp":[{"line-clamp":[It,"none",Ze,g0]}],leading:[{leading:[i,...D()]}],"list-image":[{"list-image":["none",Ze,Ke]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ze,Ke]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:K()}],"text-color":[{text:K()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ne(),"wavy"]}],"text-decoration-thickness":[{decoration:[It,"from-font","auto",Ze,Kl]}],"text-decoration-color":[{decoration:K()}],"underline-offset":[{"underline-offset":[It,"auto",Ze,Ke]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ze,Ke]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ze,Ke]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:se()}],"bg-repeat":[{bg:ve()}],"bg-size":[{bg:P()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ui,Ze,Ke],radial:["",Ze,Ke],conic:[Ui,Ze,Ke]},IF,AF]}],"bg-color":[{bg:K()}],"gradient-from-pos":[{from:U()}],"gradient-via-pos":[{via:U()}],"gradient-to-pos":[{to:U()}],"gradient-from":[{from:K()}],"gradient-via":[{via:K()}],"gradient-to":[{to:K()}],rounded:[{rounded:$()}],"rounded-s":[{"rounded-s":$()}],"rounded-e":[{"rounded-e":$()}],"rounded-t":[{"rounded-t":$()}],"rounded-r":[{"rounded-r":$()}],"rounded-b":[{"rounded-b":$()}],"rounded-l":[{"rounded-l":$()}],"rounded-ss":[{"rounded-ss":$()}],"rounded-se":[{"rounded-se":$()}],"rounded-ee":[{"rounded-ee":$()}],"rounded-es":[{"rounded-es":$()}],"rounded-tl":[{"rounded-tl":$()}],"rounded-tr":[{"rounded-tr":$()}],"rounded-br":[{"rounded-br":$()}],"rounded-bl":[{"rounded-bl":$()}],"border-w":[{border:Q()}],"border-w-x":[{"border-x":Q()}],"border-w-y":[{"border-y":Q()}],"border-w-s":[{"border-s":Q()}],"border-w-e":[{"border-e":Q()}],"border-w-t":[{"border-t":Q()}],"border-w-r":[{"border-r":Q()}],"border-w-b":[{"border-b":Q()}],"border-w-l":[{"border-l":Q()}],"divide-x":[{"divide-x":Q()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Q()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ne(),"hidden","none"]}],"divide-style":[{divide:[...ne(),"hidden","none"]}],"border-color":[{border:K()}],"border-color-x":[{"border-x":K()}],"border-color-y":[{"border-y":K()}],"border-color-s":[{"border-s":K()}],"border-color-e":[{"border-e":K()}],"border-color-t":[{"border-t":K()}],"border-color-r":[{"border-r":K()}],"border-color-b":[{"border-b":K()}],"border-color-l":[{"border-l":K()}],"divide-color":[{divide:K()}],"outline-style":[{outline:[...ne(),"none","hidden"]}],"outline-offset":[{"outline-offset":[It,Ze,Ke]}],"outline-w":[{outline:["",It,df,Kl]}],"outline-color":[{outline:K()}],shadow:[{shadow:["","none",g,rp,np]}],"shadow-color":[{shadow:K()}],"inset-shadow":[{"inset-shadow":["none",y,rp,np]}],"inset-shadow-color":[{"inset-shadow":K()}],"ring-w":[{ring:Q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:K()}],"ring-offset-w":[{"ring-offset":[It,Kl]}],"ring-offset-color":[{"ring-offset":K()}],"inset-ring-w":[{"inset-ring":Q()}],"inset-ring-color":[{"inset-ring":K()}],"text-shadow":[{"text-shadow":["none",x,rp,np]}],"text-shadow-color":[{"text-shadow":K()}],opacity:[{opacity:[It,Ze,Ke]}],"mix-blend":[{"mix-blend":[...ue(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ue()}],"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":[It]}],"mask-image-linear-from-pos":[{"mask-linear-from":J()}],"mask-image-linear-to-pos":[{"mask-linear-to":J()}],"mask-image-linear-from-color":[{"mask-linear-from":K()}],"mask-image-linear-to-color":[{"mask-linear-to":K()}],"mask-image-t-from-pos":[{"mask-t-from":J()}],"mask-image-t-to-pos":[{"mask-t-to":J()}],"mask-image-t-from-color":[{"mask-t-from":K()}],"mask-image-t-to-color":[{"mask-t-to":K()}],"mask-image-r-from-pos":[{"mask-r-from":J()}],"mask-image-r-to-pos":[{"mask-r-to":J()}],"mask-image-r-from-color":[{"mask-r-from":K()}],"mask-image-r-to-color":[{"mask-r-to":K()}],"mask-image-b-from-pos":[{"mask-b-from":J()}],"mask-image-b-to-pos":[{"mask-b-to":J()}],"mask-image-b-from-color":[{"mask-b-from":K()}],"mask-image-b-to-color":[{"mask-b-to":K()}],"mask-image-l-from-pos":[{"mask-l-from":J()}],"mask-image-l-to-pos":[{"mask-l-to":J()}],"mask-image-l-from-color":[{"mask-l-from":K()}],"mask-image-l-to-color":[{"mask-l-to":K()}],"mask-image-x-from-pos":[{"mask-x-from":J()}],"mask-image-x-to-pos":[{"mask-x-to":J()}],"mask-image-x-from-color":[{"mask-x-from":K()}],"mask-image-x-to-color":[{"mask-x-to":K()}],"mask-image-y-from-pos":[{"mask-y-from":J()}],"mask-image-y-to-pos":[{"mask-y-to":J()}],"mask-image-y-from-color":[{"mask-y-from":K()}],"mask-image-y-to-color":[{"mask-y-to":K()}],"mask-image-radial":[{"mask-radial":[Ze,Ke]}],"mask-image-radial-from-pos":[{"mask-radial-from":J()}],"mask-image-radial-to-pos":[{"mask-radial-to":J()}],"mask-image-radial-from-color":[{"mask-radial-from":K()}],"mask-image-radial-to-color":[{"mask-radial-to":K()}],"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":A()}],"mask-image-conic-pos":[{"mask-conic":[It]}],"mask-image-conic-from-pos":[{"mask-conic-from":J()}],"mask-image-conic-to-pos":[{"mask-conic-to":J()}],"mask-image-conic-from-color":[{"mask-conic-from":K()}],"mask-image-conic-to-color":[{"mask-conic-to":K()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:se()}],"mask-repeat":[{mask:ve()}],"mask-size":[{mask:P()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ze,Ke]}],filter:[{filter:["","none",Ze,Ke]}],blur:[{blur:he()}],brightness:[{brightness:[It,Ze,Ke]}],contrast:[{contrast:[It,Ze,Ke]}],"drop-shadow":[{"drop-shadow":["","none",v,rp,np]}],"drop-shadow-color":[{"drop-shadow":K()}],grayscale:[{grayscale:["",It,Ze,Ke]}],"hue-rotate":[{"hue-rotate":[It,Ze,Ke]}],invert:[{invert:["",It,Ze,Ke]}],saturate:[{saturate:[It,Ze,Ke]}],sepia:[{sepia:["",It,Ze,Ke]}],"backdrop-filter":[{"backdrop-filter":["","none",Ze,Ke]}],"backdrop-blur":[{"backdrop-blur":he()}],"backdrop-brightness":[{"backdrop-brightness":[It,Ze,Ke]}],"backdrop-contrast":[{"backdrop-contrast":[It,Ze,Ke]}],"backdrop-grayscale":[{"backdrop-grayscale":["",It,Ze,Ke]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[It,Ze,Ke]}],"backdrop-invert":[{"backdrop-invert":["",It,Ze,Ke]}],"backdrop-opacity":[{"backdrop-opacity":[It,Ze,Ke]}],"backdrop-saturate":[{"backdrop-saturate":[It,Ze,Ke]}],"backdrop-sepia":[{"backdrop-sepia":["",It,Ze,Ke]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":D()}],"border-spacing-x":[{"border-spacing-x":D()}],"border-spacing-y":[{"border-spacing-y":D()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ze,Ke]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[It,"initial",Ze,Ke]}],ease:[{ease:["linear","initial",R,Ze,Ke]}],delay:[{delay:[It,Ze,Ke]}],animate:[{animate:["none",j,Ze,Ke]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[C,Ze,Ke]}],"perspective-origin":[{"perspective-origin":O()}],rotate:[{rotate:ge()}],"rotate-x":[{"rotate-x":ge()}],"rotate-y":[{"rotate-y":ge()}],"rotate-z":[{"rotate-z":ge()}],scale:[{scale:Ee()}],"scale-x":[{"scale-x":Ee()}],"scale-y":[{"scale-y":Ee()}],"scale-z":[{"scale-z":Ee()}],"scale-3d":["scale-3d"],skew:[{skew:Me()}],"skew-x":[{"skew-x":Me()}],"skew-y":[{"skew-y":Me()}],transform:[{transform:[Ze,Ke,"","none","gpu","cpu"]}],"transform-origin":[{origin:O()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Fe()}],"translate-x":[{"translate-x":Fe()}],"translate-y":[{"translate-y":Fe()}],"translate-z":[{"translate-z":Fe()}],"translate-none":["translate-none"],accent:[{accent:K()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:K()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ze,Ke]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ze,Ke]}],fill:[{fill:["none",...K()]}],"stroke-w":[{stroke:[It,df,Kl,g0]}],stroke:[{stroke:["none",...K()]}],"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"]}},PF=gF(LF);function re(...e){return PF(XN(e))}const Zb=Ju("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 Ce({className:e,variant:t,size:n,asChild:r=!1,...s}){const i=r?ih:"button";return a.jsx(i,{"data-slot":"button",className:re(Zb({variant:t,size:n,className:e})),...s})}function Tt({className:e,type:t,...n}){return a.jsx("input",{type:t,"data-slot":"input",className:re("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 UF=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],FF=UF.reduce((e,t)=>{const n=Hb(`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}},{}),zF="Separator",qj="horizontal",HF=["horizontal","vertical"],CA=h.forwardRef((e,t)=>{const{decorative:n,orientation:r=qj,...s}=e,i=VF(r)?r:qj,u=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return a.jsx(FF.div,{"data-orientation":i,...u,...s,ref:t})});CA.displayName=zF;function VF(e){return HF.includes(e)}var $F=CA;function EA({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return a.jsx($F,{"data-slot":"separator",decorative:n,orientation:t,className:re("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...r})}function Oe(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function GF(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 xr(e,t=[]){let n=[];function r(i,c){const u=h.createContext(c),f=n.length;n=[...n,c];const m=y=>{var R;const{scope:x,children:v,...S}=y,C=((R=x==null?void 0:x[e])==null?void 0:R[f])||u,E=h.useMemo(()=>S,Object.values(S));return a.jsx(C.Provider,{value:E,children:v})};m.displayName=i+"Provider";function g(y,x){var C;const v=((C=x==null?void 0:x[e])==null?void 0:C[f])||u,S=h.useContext(v);if(S)return S;if(c!==void 0)return c;throw new Error(`\`${y}\` must be used within \`${i}\``)}return[m,g]}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,BF(s,...t)]}function BF(...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 y=f(i)[`__scope${m}`];return{...u,...y}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}var Ir=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{},qF=Lg[" useId ".trim().toString()]||(()=>{}),KF=0;function qn(e){const[t,n]=h.useState(qF());return Ir(()=>{n(r=>r??String(KF++))},[e]),e||(t?`radix-${t}`:"")}var ZF=Lg[" useInsertionEffect ".trim().toString()]||Ir;function aa({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,i,c]=YF({defaultProp:t,onChange:n}),u=e!==void 0,f=u?e:s;{const g=h.useRef(e!==void 0);h.useEffect(()=>{const y=g.current;y!==u&&console.warn(`${r} is changing from ${y?"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.`),g.current=u},[u,r])}const m=h.useCallback(g=>{var y;if(u){const x=WF(g)?g(e):g;x!==e&&((y=c.current)==null||y.call(c,x))}else i(g)},[u,e,i,c]);return[f,m]}function YF({defaultProp:e,onChange:t}){const[n,r]=h.useState(e),s=h.useRef(n),i=h.useRef(t);return ZF(()=>{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 WF(e){return typeof e=="function"}function QF(e){const t=XF(e),n=h.forwardRef((r,s)=>{const{children:i,...c}=r,u=h.Children.toArray(i),f=u.find(ez);if(f){const m=f.props.children,g=u.map(y=>y===f?h.Children.count(m)>1?h.Children.only(null):h.isValidElement(m)?m.props.children:null:y);return a.jsx(t,{...c,ref:s,children:h.isValidElement(m)?h.cloneElement(m,void 0,g):null})}return a.jsx(t,{...c,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function XF(e){const t=h.forwardRef((n,r)=>{const{children:s,...i}=n;if(h.isValidElement(s)){const c=nz(s),u=tz(i,s.props);return s.type!==h.Fragment&&(u.ref=r?qr(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 JF=Symbol("radix.slottable");function ez(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===JF}function tz(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 nz(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 rz=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Xe=rz.reduce((e,t)=>{const n=QF(`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 wA(e,t){e&&ws.flushSync(()=>e.dispatchEvent(t))}function _s(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 az(e,t=globalThis==null?void 0:globalThis.document){const n=_s(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 sz="DismissableLayer",C1="dismissableLayer.update",oz="dismissableLayer.pointerDownOutside",iz="dismissableLayer.focusOutside",Kj,RA=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),bc=h.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:c,onDismiss:u,...f}=e,m=h.useContext(RA),[g,y]=h.useState(null),x=(g==null?void 0:g.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,v]=h.useState({}),S=ht(t,T=>y(T)),C=Array.from(m.layers),[E]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),R=C.indexOf(E),j=g?C.indexOf(g):-1,_=m.layersWithOutsidePointerEventsDisabled.size>0,A=j>=R,O=uz(T=>{const D=T.target,L=[...m.branches].some(H=>H.contains(D));!A||L||(s==null||s(T),c==null||c(T),T.defaultPrevented||u==null||u())},x),I=dz(T=>{const D=T.target;[...m.branches].some(H=>H.contains(D))||(i==null||i(T),c==null||c(T),T.defaultPrevented||u==null||u())},x);return az(T=>{j===m.layers.size-1&&(r==null||r(T),!T.defaultPrevented&&u&&(T.preventDefault(),u()))},x),h.useEffect(()=>{if(g)return n&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(Kj=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(g)),m.layers.add(g),Zj(),()=>{n&&m.layersWithOutsidePointerEventsDisabled.size===1&&(x.body.style.pointerEvents=Kj)}},[g,x,n,m]),h.useEffect(()=>()=>{g&&(m.layers.delete(g),m.layersWithOutsidePointerEventsDisabled.delete(g),Zj())},[g,m]),h.useEffect(()=>{const T=()=>v({});return document.addEventListener(C1,T),()=>document.removeEventListener(C1,T)},[]),a.jsx(Xe.div,{...f,ref:S,style:{pointerEvents:_?A?"auto":"none":void 0,...e.style},onFocusCapture:Oe(e.onFocusCapture,I.onFocusCapture),onBlurCapture:Oe(e.onBlurCapture,I.onBlurCapture),onPointerDownCapture:Oe(e.onPointerDownCapture,O.onPointerDownCapture)})});bc.displayName=sz;var lz="DismissableLayerBranch",cz=h.forwardRef((e,t)=>{const n=h.useContext(RA),r=h.useRef(null),s=ht(t,r);return h.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),a.jsx(Xe.div,{...e,ref:s})});cz.displayName=lz;function uz(e,t=globalThis==null?void 0:globalThis.document){const n=_s(e),r=h.useRef(!1),s=h.useRef(()=>{});return h.useEffect(()=>{const i=u=>{if(u.target&&!r.current){let f=function(){jA(oz,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 dz(e,t=globalThis==null?void 0:globalThis.document){const n=_s(e),r=h.useRef(!1);return h.useEffect(()=>{const s=i=>{i.target&&!r.current&&jA(iz,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 Zj(){const e=new CustomEvent(C1);document.dispatchEvent(e)}function jA(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?wA(s,i):s.dispatchEvent(i)}var y0="focusScope.autoFocusOnMount",x0="focusScope.autoFocusOnUnmount",Yj={bubbles:!1,cancelable:!0},fz="FocusScope",ch=h.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...c}=e,[u,f]=h.useState(null),m=_s(s),g=_s(i),y=h.useRef(null),x=ht(t,C=>f(C)),v=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(r){let C=function(_){if(v.paused||!u)return;const A=_.target;u.contains(A)?y.current=A:zi(y.current,{select:!0})},E=function(_){if(v.paused||!u)return;const A=_.relatedTarget;A!==null&&(u.contains(A)||zi(y.current,{select:!0}))},R=function(_){if(document.activeElement===document.body)for(const O of _)O.removedNodes.length>0&&zi(u)};document.addEventListener("focusin",C),document.addEventListener("focusout",E);const j=new MutationObserver(R);return u&&j.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",C),document.removeEventListener("focusout",E),j.disconnect()}}},[r,u,v.paused]),h.useEffect(()=>{if(u){Qj.add(v);const C=document.activeElement;if(!u.contains(C)){const R=new CustomEvent(y0,Yj);u.addEventListener(y0,m),u.dispatchEvent(R),R.defaultPrevented||(hz(xz(TA(u)),{select:!0}),document.activeElement===C&&zi(u))}return()=>{u.removeEventListener(y0,m),setTimeout(()=>{const R=new CustomEvent(x0,Yj);u.addEventListener(x0,g),u.dispatchEvent(R),R.defaultPrevented||zi(C??document.body,{select:!0}),u.removeEventListener(x0,g),Qj.remove(v)},0)}}},[u,m,g,v]);const S=h.useCallback(C=>{if(!n&&!r||v.paused)return;const E=C.key==="Tab"&&!C.altKey&&!C.ctrlKey&&!C.metaKey,R=document.activeElement;if(E&&R){const j=C.currentTarget,[_,A]=mz(j);_&&A?!C.shiftKey&&R===A?(C.preventDefault(),n&&zi(_,{select:!0})):C.shiftKey&&R===_&&(C.preventDefault(),n&&zi(A,{select:!0})):R===j&&C.preventDefault()}},[n,r,v.paused]);return a.jsx(Xe.div,{tabIndex:-1,...c,ref:x,onKeyDown:S})});ch.displayName=fz;function hz(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(zi(r,{select:t}),document.activeElement!==n)return}function mz(e){const t=TA(e),n=Wj(t,e),r=Wj(t.reverse(),e);return[n,r]}function TA(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 Wj(e,t){for(const n of e)if(!pz(n,{upTo:t}))return n}function pz(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 gz(e){return e instanceof HTMLInputElement&&"select"in e}function zi(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&gz(e)&&t&&e.select()}}var Qj=yz();function yz(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Xj(e,t),e.unshift(t)},remove(t){var n;e=Xj(e,t),(n=e[0])==null||n.resume()}}}function Xj(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function xz(e){return e.filter(t=>t.tagName!=="A")}var vz="Portal",Sc=h.forwardRef((e,t)=>{var u;const{container:n,...r}=e,[s,i]=h.useState(!1);Ir(()=>i(!0),[]);const c=n||s&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return c?d7.createPortal(a.jsx(Xe.div,{...r,ref:t}),c):null});Sc.displayName=vz;function bz(e,t){return h.useReducer((n,r)=>t[n][r]??n,e)}var kr=e=>{const{present:t,children:n}=e,r=Sz(t),s=typeof n=="function"?n({present:r.isPresent}):h.Children.only(n),i=ht(r.ref,Cz(s));return typeof n=="function"||r.isPresent?h.cloneElement(s,{ref:i}):null};kr.displayName="Presence";function Sz(e){const[t,n]=h.useState(),r=h.useRef(null),s=h.useRef(e),i=h.useRef("none"),c=e?"mounted":"unmounted",[u,f]=bz(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const m=ap(r.current);i.current=u==="mounted"?m:"none"},[u]),Ir(()=>{const m=r.current,g=s.current;if(g!==e){const x=i.current,v=ap(m);e?f("MOUNT"):v==="none"||(m==null?void 0:m.display)==="none"?f("UNMOUNT"):f(g&&x!==v?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,f]),Ir(()=>{if(t){let m;const g=t.ownerDocument.defaultView??window,y=v=>{const C=ap(r.current).includes(CSS.escape(v.animationName));if(v.target===t&&C&&(f("ANIMATION_END"),!s.current)){const E=t.style.animationFillMode;t.style.animationFillMode="forwards",m=g.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=E)})}},x=v=>{v.target===t&&(i.current=ap(r.current))};return t.addEventListener("animationstart",x),t.addEventListener("animationcancel",y),t.addEventListener("animationend",y),()=>{g.clearTimeout(m),t.removeEventListener("animationstart",x),t.removeEventListener("animationcancel",y),t.removeEventListener("animationend",y)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:h.useCallback(m=>{r.current=m?getComputedStyle(m):null,n(m)},[])}}function ap(e){return(e==null?void 0:e.animationName)||"none"}function Cz(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 v0=0;function Bg(){h.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Jj()),document.body.insertAdjacentElement("beforeend",e[1]??Jj()),v0++,()=>{v0===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),v0--}},[])}function Jj(){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 Ys=function(){return Ys=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},Ys.apply(this,arguments)};function _A(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 Ez(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 Op="right-scroll-bar-position",Ip="width-before-scroll-bar",wz="with-scroll-bars-hidden",Rz="--removed-body-scroll-bar-size";function b0(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function jz(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 Tz=typeof window<"u"?h.useLayoutEffect:h.useEffect,eT=new WeakMap;function _z(e,t){var n=jz(null,function(r){return e.forEach(function(s){return b0(s,r)})});return Tz(function(){var r=eT.get(n);if(r){var s=new Set(r),i=new Set(e),c=n.current;s.forEach(function(u){i.has(u)||b0(u,null)}),i.forEach(function(u){s.has(u)||b0(u,c)})}eT.set(n,e)},[e]),n}function Nz(e){return e}function Az(e,t){t===void 0&&(t=Nz);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 g=c;c=[],g.forEach(i)},m=function(){return Promise.resolve().then(f)};m(),n={push:function(g){c.push(g),m()},filter:function(g){return c=c.filter(g),n}}}};return s}function Dz(e){e===void 0&&(e={});var t=Az(null);return t.options=Ys({async:!0,ssr:!1},e),t}var NA=function(e){var t=e.sideCar,n=_A(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,Ys({},n))};NA.isSideCarExport=!0;function Oz(e,t){return e.useMedium(t),NA}var AA=Dz(),S0=function(){},qg=h.forwardRef(function(e,t){var n=h.useRef(null),r=h.useState({onScrollCapture:S0,onWheelCapture:S0,onTouchMoveCapture:S0}),s=r[0],i=r[1],c=e.forwardProps,u=e.children,f=e.className,m=e.removeScrollBar,g=e.enabled,y=e.shards,x=e.sideCar,v=e.noRelative,S=e.noIsolation,C=e.inert,E=e.allowPinchZoom,R=e.as,j=R===void 0?"div":R,_=e.gapMode,A=_A(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),O=x,I=_z([n,t]),T=Ys(Ys({},A),s);return h.createElement(h.Fragment,null,g&&h.createElement(O,{sideCar:AA,removeScrollBar:m,shards:y,noRelative:v,noIsolation:S,inert:C,setCallbacks:i,allowPinchZoom:!!E,lockRef:n,gapMode:_}),c?h.cloneElement(h.Children.only(u),Ys(Ys({},T),{ref:I})):h.createElement(j,Ys({},T,{className:f,ref:I}),u))});qg.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};qg.classNames={fullWidth:Ip,zeroRight:Op};var Iz=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Mz(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Iz();return t&&e.setAttribute("nonce",t),e}function kz(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Lz(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Pz=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Mz())&&(kz(t,n),Lz(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Uz=function(){var e=Pz();return function(t,n){h.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},DA=function(){var e=Uz(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},Fz={left:0,top:0,right:0,gap:0},C0=function(e){return parseInt(e||"",10)||0},zz=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[C0(n),C0(r),C0(s)]},Hz=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Fz;var t=zz(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])}},Vz=DA(),Du="data-scroll-locked",$z=function(e,t,n,r){var s=e.left,i=e.top,c=e.right,u=e.gap;return n===void 0&&(n="margin"),`
|
|
527
|
-
.`.concat(wz,` {
|
|
528
|
-
overflow: hidden `).concat(r,`;
|
|
529
|
-
padding-right: `).concat(u,"px ").concat(r,`;
|
|
530
|
-
}
|
|
531
|
-
body[`).concat(Du,`] {
|
|
532
|
-
overflow: hidden `).concat(r,`;
|
|
533
|
-
overscroll-behavior: contain;
|
|
534
|
-
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
535
|
-
padding-left: `.concat(s,`px;
|
|
536
|
-
padding-top: `).concat(i,`px;
|
|
537
|
-
padding-right: `).concat(c,`px;
|
|
538
|
-
margin-left:0;
|
|
539
|
-
margin-top:0;
|
|
540
|
-
margin-right: `).concat(u,"px ").concat(r,`;
|
|
541
|
-
`),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
542
|
-
}
|
|
543
|
-
|
|
544
|
-
.`).concat(Op,` {
|
|
545
|
-
right: `).concat(u,"px ").concat(r,`;
|
|
546
|
-
}
|
|
547
|
-
|
|
548
|
-
.`).concat(Ip,` {
|
|
549
|
-
margin-right: `).concat(u,"px ").concat(r,`;
|
|
550
|
-
}
|
|
551
|
-
|
|
552
|
-
.`).concat(Op," .").concat(Op,` {
|
|
553
|
-
right: 0 `).concat(r,`;
|
|
554
|
-
}
|
|
555
|
-
|
|
556
|
-
.`).concat(Ip," .").concat(Ip,` {
|
|
557
|
-
margin-right: 0 `).concat(r,`;
|
|
558
|
-
}
|
|
559
|
-
|
|
560
|
-
body[`).concat(Du,`] {
|
|
561
|
-
`).concat(Rz,": ").concat(u,`px;
|
|
562
|
-
}
|
|
563
|
-
`)},tT=function(){var e=parseInt(document.body.getAttribute(Du)||"0",10);return isFinite(e)?e:0},Gz=function(){h.useEffect(function(){return document.body.setAttribute(Du,(tT()+1).toString()),function(){var e=tT()-1;e<=0?document.body.removeAttribute(Du):document.body.setAttribute(Du,e.toString())}},[])},Bz=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;Gz();var i=h.useMemo(function(){return Hz(s)},[s]);return h.createElement(Vz,{styles:$z(i,!t,s,n?"":"!important")})},E1=!1;if(typeof window<"u")try{var sp=Object.defineProperty({},"passive",{get:function(){return E1=!0,!0}});window.addEventListener("test",sp,sp),window.removeEventListener("test",sp,sp)}catch{E1=!1}var cu=E1?{passive:!1}:!1,qz=function(e){return e.tagName==="TEXTAREA"},OA=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!qz(e)&&n[t]==="visible")},Kz=function(e){return OA(e,"overflowY")},Zz=function(e){return OA(e,"overflowX")},nT=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=IA(e,r);if(s){var i=MA(e,r),c=i[1],u=i[2];if(c>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Yz=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Wz=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},IA=function(e,t){return e==="v"?Kz(t):Zz(t)},MA=function(e,t){return e==="v"?Yz(t):Wz(t)},Qz=function(e,t){return e==="h"&&t==="rtl"?-1:1},Xz=function(e,t,n,r,s){var i=Qz(e,window.getComputedStyle(t).direction),c=i*r,u=n.target,f=t.contains(u),m=!1,g=c>0,y=0,x=0;do{if(!u)break;var v=MA(e,u),S=v[0],C=v[1],E=v[2],R=C-E-i*S;(S||R)&&IA(e,u)&&(y+=R,x+=S);var j=u.parentNode;u=j&&j.nodeType===Node.DOCUMENT_FRAGMENT_NODE?j.host:j}while(!f&&u!==document.body||f&&(t.contains(u)||t===u));return(g&&Math.abs(y)<1||!g&&Math.abs(x)<1)&&(m=!0),m},op=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},rT=function(e){return[e.deltaX,e.deltaY]},aT=function(e){return e&&"current"in e?e.current:e},Jz=function(e,t){return e[0]===t[0]&&e[1]===t[1]},eH=function(e){return`
|
|
564
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
565
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
566
|
-
`)},tH=0,uu=[];function nH(e){var t=h.useRef([]),n=h.useRef([0,0]),r=h.useRef(),s=h.useState(tH++)[0],i=h.useState(DA)[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 C=Ez([e.lockRef.current],(e.shards||[]).map(aT),!0).filter(Boolean);return C.forEach(function(E){return E.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),C.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var u=h.useCallback(function(C,E){if("touches"in C&&C.touches.length===2||C.type==="wheel"&&C.ctrlKey)return!c.current.allowPinchZoom;var R=op(C),j=n.current,_="deltaX"in C?C.deltaX:j[0]-R[0],A="deltaY"in C?C.deltaY:j[1]-R[1],O,I=C.target,T=Math.abs(_)>Math.abs(A)?"h":"v";if("touches"in C&&T==="h"&&I.type==="range")return!1;var D=window.getSelection(),L=D&&D.anchorNode,H=L?L===I||L.contains(I):!1;if(H)return!1;var B=nT(T,I);if(!B)return!0;if(B?O=T:(O=T==="v"?"h":"v",B=nT(T,I)),!B)return!1;if(!r.current&&"changedTouches"in C&&(_||A)&&(r.current=O),!O)return!0;var q=r.current||O;return Xz(q,E,C,q==="h"?_:A)},[]),f=h.useCallback(function(C){var E=C;if(!(!uu.length||uu[uu.length-1]!==i)){var R="deltaY"in E?rT(E):op(E),j=t.current.filter(function(O){return O.name===E.type&&(O.target===E.target||E.target===O.shadowParent)&&Jz(O.delta,R)})[0];if(j&&j.should){E.cancelable&&E.preventDefault();return}if(!j){var _=(c.current.shards||[]).map(aT).filter(Boolean).filter(function(O){return O.contains(E.target)}),A=_.length>0?u(E,_[0]):!c.current.noIsolation;A&&E.cancelable&&E.preventDefault()}}},[]),m=h.useCallback(function(C,E,R,j){var _={name:C,delta:E,target:R,should:j,shadowParent:rH(R)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(A){return A!==_})},1)},[]),g=h.useCallback(function(C){n.current=op(C),r.current=void 0},[]),y=h.useCallback(function(C){m(C.type,rT(C),C.target,u(C,e.lockRef.current))},[]),x=h.useCallback(function(C){m(C.type,op(C),C.target,u(C,e.lockRef.current))},[]);h.useEffect(function(){return uu.push(i),e.setCallbacks({onScrollCapture:y,onWheelCapture:y,onTouchMoveCapture:x}),document.addEventListener("wheel",f,cu),document.addEventListener("touchmove",f,cu),document.addEventListener("touchstart",g,cu),function(){uu=uu.filter(function(C){return C!==i}),document.removeEventListener("wheel",f,cu),document.removeEventListener("touchmove",f,cu),document.removeEventListener("touchstart",g,cu)}},[]);var v=e.removeScrollBar,S=e.inert;return h.createElement(h.Fragment,null,S?h.createElement(i,{styles:eH(s)}):null,v?h.createElement(Bz,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function rH(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const aH=Oz(AA,nH);var uh=h.forwardRef(function(e,t){return h.createElement(qg,Ys({},e,{ref:t,sideCar:aH}))});uh.classNames=qg.classNames;var sH=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},du=new WeakMap,ip=new WeakMap,lp={},E0=0,kA=function(e){return e&&(e.host||kA(e.parentNode))},oH=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=kA(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})},iH=function(e,t,n,r){var s=oH(t,Array.isArray(e)?e:[e]);lp[n]||(lp[n]=new WeakMap);var i=lp[n],c=[],u=new Set,f=new Set(s),m=function(y){!y||u.has(y)||(u.add(y),m(y.parentNode))};s.forEach(m);var g=function(y){!y||f.has(y)||Array.prototype.forEach.call(y.children,function(x){if(u.has(x))g(x);else try{var v=x.getAttribute(r),S=v!==null&&v!=="false",C=(du.get(x)||0)+1,E=(i.get(x)||0)+1;du.set(x,C),i.set(x,E),c.push(x),C===1&&S&&ip.set(x,!0),E===1&&x.setAttribute(n,"true"),S||x.setAttribute(r,"true")}catch(R){console.error("aria-hidden: cannot operate on ",x,R)}})};return g(t),u.clear(),E0++,function(){c.forEach(function(y){var x=du.get(y)-1,v=i.get(y)-1;du.set(y,x),i.set(y,v),x||(ip.has(y)||y.removeAttribute(r),ip.delete(y)),v||y.removeAttribute(n)}),E0--,E0||(du=new WeakMap,du=new WeakMap,ip=new WeakMap,lp={})}},Kg=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=sH(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),iH(r,s,n,"aria-hidden")):function(){return null}};function lH(e){const t=cH(e),n=h.forwardRef((r,s)=>{const{children:i,...c}=r,u=h.Children.toArray(i),f=u.find(dH);if(f){const m=f.props.children,g=u.map(y=>y===f?h.Children.count(m)>1?h.Children.only(null):h.isValidElement(m)?m.props.children:null:y);return a.jsx(t,{...c,ref:s,children:h.isValidElement(m)?h.cloneElement(m,void 0,g):null})}return a.jsx(t,{...c,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function cH(e){const t=h.forwardRef((n,r)=>{const{children:s,...i}=n;if(h.isValidElement(s)){const c=hH(s),u=fH(i,s.props);return s.type!==h.Fragment&&(u.ref=r?qr(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 uH=Symbol("radix.slottable");function dH(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===uH}function fH(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...u)=>{const f=i(...u);return s(...u),f}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function hH(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Zg="Dialog",[LA,PA]=xr(Zg),[mH,Ms]=LA(Zg),UA=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,g]=aa({prop:r,defaultProp:s??!1,onChange:i,caller:Zg});return a.jsx(mH,{scope:t,triggerRef:u,contentRef:f,contentId:qn(),titleId:qn(),descriptionId:qn(),open:m,onOpenChange:g,onOpenToggle:h.useCallback(()=>g(y=>!y),[g]),modal:c,children:n})};UA.displayName=Zg;var FA="DialogTrigger",zA=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ms(FA,n),i=ht(t,s.triggerRef);return a.jsx(Xe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Qb(s.open),...r,ref:i,onClick:Oe(e.onClick,s.onOpenToggle)})});zA.displayName=FA;var Yb="DialogPortal",[pH,HA]=LA(Yb,{forceMount:void 0}),VA=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,i=Ms(Yb,t);return a.jsx(pH,{scope:t,forceMount:n,children:h.Children.map(r,c=>a.jsx(kr,{present:n||i.open,children:a.jsx(Sc,{asChild:!0,container:s,children:c})}))})};VA.displayName=Yb;var Wp="DialogOverlay",$A=h.forwardRef((e,t)=>{const n=HA(Wp,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,i=Ms(Wp,e.__scopeDialog);return i.modal?a.jsx(kr,{present:r||i.open,children:a.jsx(yH,{...s,ref:t})}):null});$A.displayName=Wp;var gH=lH("DialogOverlay.RemoveScroll"),yH=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ms(Wp,n);return a.jsx(uh,{as:gH,allowPinchZoom:!0,shards:[s.contentRef],children:a.jsx(Xe.div,{"data-state":Qb(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),oc="DialogContent",GA=h.forwardRef((e,t)=>{const n=HA(oc,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,i=Ms(oc,e.__scopeDialog);return a.jsx(kr,{present:r||i.open,children:i.modal?a.jsx(xH,{...s,ref:t}):a.jsx(vH,{...s,ref:t})})});GA.displayName=oc;var xH=h.forwardRef((e,t)=>{const n=Ms(oc,e.__scopeDialog),r=h.useRef(null),s=ht(t,n.contentRef,r);return h.useEffect(()=>{const i=r.current;if(i)return Kg(i)},[]),a.jsx(BA,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Oe(e.onCloseAutoFocus,i=>{var c;i.preventDefault(),(c=n.triggerRef.current)==null||c.focus()}),onPointerDownOutside:Oe(e.onPointerDownOutside,i=>{const c=i.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0;(c.button===2||u)&&i.preventDefault()}),onFocusOutside:Oe(e.onFocusOutside,i=>i.preventDefault())})}),vH=h.forwardRef((e,t)=>{const n=Ms(oc,e.__scopeDialog),r=h.useRef(!1),s=h.useRef(!1);return a.jsx(BA,{...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()}})}),BA=h.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,...c}=e,u=Ms(oc,n),f=h.useRef(null),m=ht(t,f);return Bg(),a.jsxs(a.Fragment,{children:[a.jsx(ch,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:a.jsx(bc,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":Qb(u.open),...c,ref:m,onDismiss:()=>u.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(SH,{titleId:u.titleId}),a.jsx(EH,{contentRef:f,descriptionId:u.descriptionId})]})]})}),Wb="DialogTitle",qA=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ms(Wb,n);return a.jsx(Xe.h2,{id:s.titleId,...r,ref:t})});qA.displayName=Wb;var KA="DialogDescription",ZA=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ms(KA,n);return a.jsx(Xe.p,{id:s.descriptionId,...r,ref:t})});ZA.displayName=KA;var YA="DialogClose",WA=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ms(YA,n);return a.jsx(Xe.button,{type:"button",...r,ref:t,onClick:Oe(e.onClick,()=>s.onOpenChange(!1))})});WA.displayName=YA;function Qb(e){return e?"open":"closed"}var QA="DialogTitleWarning",[bH,XA]=GF(QA,{contentName:oc,titleName:Wb,docsSlug:"dialog"}),SH=({titleId:e})=>{const t=XA(QA),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
567
|
-
|
|
568
|
-
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
569
|
-
|
|
570
|
-
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},CH="DialogDescriptionWarning",EH=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${XA(CH).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},Yg=UA,wH=zA,Wg=VA,Qg=$A,Xg=GA,Xb=qA,Jb=ZA,Jg=WA;function ni({...e}){return a.jsx(Yg,{"data-slot":"sheet",...e})}function RH({...e}){return a.jsx(Wg,{"data-slot":"sheet-portal",...e})}function jH({className:e,...t}){return a.jsx(Qg,{"data-slot":"sheet-overlay",className:re("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 ri({className:e,children:t,side:n="right",...r}){return a.jsxs(RH,{children:[a.jsx(jH,{}),a.jsxs(Xg,{"data-slot":"sheet-content",className:re("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(Jg,{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(Vu,{className:"size-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function ai({className:e,...t}){return a.jsx("div",{"data-slot":"sheet-header",className:re("flex flex-col gap-1 border-b p-4",e),...t})}function si({className:e,...t}){return a.jsx(Xb,{"data-slot":"sheet-title",className:re("text-foreground font-semibold",e),...t})}function hl({className:e,...t}){return a.jsx(Jb,{"data-slot":"sheet-description",className:re("text-muted-foreground text-sm",e),...t})}function Dr({className:e,...t}){return a.jsx("div",{"data-slot":"skeleton",className:re("bg-accent animate-pulse rounded-md",e),...t})}const TH=["top","right","bottom","left"],il=Math.min,Fa=Math.max,Qp=Math.round,cp=Math.floor,eo=e=>({x:e,y:e}),_H={left:"right",right:"left",bottom:"top",top:"bottom"},NH={start:"end",end:"start"};function w1(e,t,n){return Fa(e,il(t,n))}function Qo(e,t){return typeof e=="function"?e(t):e}function Xo(e){return e.split("-")[0]}function ad(e){return e.split("-")[1]}function eS(e){return e==="x"?"y":"x"}function tS(e){return e==="y"?"height":"width"}const AH=new Set(["top","bottom"]);function Ws(e){return AH.has(Xo(e))?"y":"x"}function nS(e){return eS(Ws(e))}function DH(e,t,n){n===void 0&&(n=!1);const r=ad(e),s=nS(e),i=tS(s);let c=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(c=Xp(c)),[c,Xp(c)]}function OH(e){const t=Xp(e);return[R1(e),t,R1(t)]}function R1(e){return e.replace(/start|end/g,t=>NH[t])}const sT=["left","right"],oT=["right","left"],IH=["top","bottom"],MH=["bottom","top"];function kH(e,t,n){switch(e){case"top":case"bottom":return n?t?oT:sT:t?sT:oT;case"left":case"right":return t?IH:MH;default:return[]}}function LH(e,t,n,r){const s=ad(e);let i=kH(Xo(e),n==="start",r);return s&&(i=i.map(c=>c+"-"+s),t&&(i=i.concat(i.map(R1)))),i}function Xp(e){return e.replace(/left|right|bottom|top/g,t=>_H[t])}function PH(e){return{top:0,right:0,bottom:0,left:0,...e}}function JA(e){return typeof e!="number"?PH(e):{top:e,right:e,bottom:e,left:e}}function Jp(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 iT(e,t,n){let{reference:r,floating:s}=e;const i=Ws(t),c=nS(t),u=tS(c),f=Xo(t),m=i==="y",g=r.x+r.width/2-s.width/2,y=r.y+r.height/2-s.height/2,x=r[u]/2-s[u]/2;let v;switch(f){case"top":v={x:g,y:r.y-s.height};break;case"bottom":v={x:g,y:r.y+r.height};break;case"right":v={x:r.x+r.width,y};break;case"left":v={x:r.x-s.width,y};break;default:v={x:r.x,y:r.y}}switch(ad(t)){case"start":v[c]-=x*(n&&m?-1:1);break;case"end":v[c]+=x*(n&&m?-1:1);break}return v}const UH=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:g,y}=iT(m,r,f),x=r,v={},S=0;for(let C=0;C<u.length;C++){const{name:E,fn:R}=u[C],{x:j,y:_,data:A,reset:O}=await R({x:g,y,initialPlacement:r,placement:x,strategy:s,middlewareData:v,rects:m,platform:c,elements:{reference:e,floating:t}});g=j??g,y=_??y,v={...v,[E]:{...v[E],...A}},O&&S<=50&&(S++,typeof O=="object"&&(O.placement&&(x=O.placement),O.rects&&(m=O.rects===!0?await c.getElementRects({reference:e,floating:t,strategy:s}):O.rects),{x:g,y}=iT(m,x,f)),C=-1)}return{x:g,y,placement:x,strategy:s,middlewareData:v}};async function $f(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:g="viewport",elementContext:y="floating",altBoundary:x=!1,padding:v=0}=Qo(t,e),S=JA(v),E=u[x?y==="floating"?"reference":"floating":y],R=Jp(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:g,strategy:f})),j=y==="floating"?{x:r,y:s,width:c.floating.width,height:c.floating.height}:c.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u.floating)),A=await(i.isElement==null?void 0:i.isElement(_))?await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1}:{x:1,y:1},O=Jp(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:j,offsetParent:_,strategy:f}):j);return{top:(R.top-O.top+S.top)/A.y,bottom:(O.bottom-R.bottom+S.bottom)/A.y,left:(R.left-O.left+S.left)/A.x,right:(O.right-R.right+S.right)/A.x}}const FH=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:g=0}=Qo(e,t)||{};if(m==null)return{};const y=JA(g),x={x:n,y:r},v=nS(s),S=tS(v),C=await c.getDimensions(m),E=v==="y",R=E?"top":"left",j=E?"bottom":"right",_=E?"clientHeight":"clientWidth",A=i.reference[S]+i.reference[v]-x[v]-i.floating[S],O=x[v]-i.reference[v],I=await(c.getOffsetParent==null?void 0:c.getOffsetParent(m));let T=I?I[_]:0;(!T||!await(c.isElement==null?void 0:c.isElement(I)))&&(T=u.floating[_]||i.floating[S]);const D=A/2-O/2,L=T/2-C[S]/2-1,H=il(y[R],L),B=il(y[j],L),q=H,Z=T-C[S]-B,F=T/2-C[S]/2+D,z=w1(q,F,Z),M=!f.arrow&&ad(s)!=null&&F!==z&&i.reference[S]/2-(F<q?H:B)-C[S]/2<0,V=M?F<q?F-q:F-Z:0;return{[v]:x[v]+V,data:{[v]:z,centerOffset:F-z-V,...M&&{alignmentOffset:V}},reset:M}}}),zH=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:g=!0,crossAxis:y=!0,fallbackPlacements:x,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:C=!0,...E}=Qo(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const R=Xo(s),j=Ws(u),_=Xo(u)===u,A=await(f.isRTL==null?void 0:f.isRTL(m.floating)),O=x||(_||!C?[Xp(u)]:OH(u)),I=S!=="none";!x&&I&&O.push(...LH(u,C,S,A));const T=[u,...O],D=await $f(t,E),L=[];let H=((r=i.flip)==null?void 0:r.overflows)||[];if(g&&L.push(D[R]),y){const F=DH(s,c,A);L.push(D[F[0]],D[F[1]])}if(H=[...H,{placement:s,overflows:L}],!L.every(F=>F<=0)){var B,q;const F=(((B=i.flip)==null?void 0:B.index)||0)+1,z=T[F];if(z&&(!(y==="alignment"?j!==Ws(z):!1)||H.every(K=>Ws(K.placement)===j?K.overflows[0]>0:!0)))return{data:{index:F,overflows:H},reset:{placement:z}};let M=(q=H.filter(V=>V.overflows[0]<=0).sort((V,K)=>V.overflows[1]-K.overflows[1])[0])==null?void 0:q.placement;if(!M)switch(v){case"bestFit":{var Z;const V=(Z=H.filter(K=>{if(I){const se=Ws(K.placement);return se===j||se==="y"}return!0}).map(K=>[K.placement,K.overflows.filter(se=>se>0).reduce((se,ve)=>se+ve,0)]).sort((K,se)=>K[1]-se[1])[0])==null?void 0:Z[0];V&&(M=V);break}case"initialPlacement":M=u;break}if(s!==M)return{reset:{placement:M}}}return{}}}};function lT(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function cT(e){return TH.some(t=>e[t]>=0)}const HH=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...s}=Qo(e,t);switch(r){case"referenceHidden":{const i=await $f(t,{...s,elementContext:"reference"}),c=lT(i,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:cT(c)}}}case"escaped":{const i=await $f(t,{...s,altBoundary:!0}),c=lT(i,n.floating);return{data:{escapedOffsets:c,escaped:cT(c)}}}default:return{}}}}},e4=new Set(["left","top"]);async function VH(e,t){const{placement:n,platform:r,elements:s}=e,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),c=Xo(n),u=ad(n),f=Ws(n)==="y",m=e4.has(c)?-1:1,g=i&&f?-1:1,y=Qo(t,e);let{mainAxis:x,crossAxis:v,alignmentAxis:S}=typeof y=="number"?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:y.mainAxis||0,crossAxis:y.crossAxis||0,alignmentAxis:y.alignmentAxis};return u&&typeof S=="number"&&(v=u==="end"?S*-1:S),f?{x:v*g,y:x*m}:{x:x*m,y:v*g}}const $H=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 VH(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}}}}},GH=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s}=t,{mainAxis:i=!0,crossAxis:c=!1,limiter:u={fn:E=>{let{x:R,y:j}=E;return{x:R,y:j}}},...f}=Qo(e,t),m={x:n,y:r},g=await $f(t,f),y=Ws(Xo(s)),x=eS(y);let v=m[x],S=m[y];if(i){const E=x==="y"?"top":"left",R=x==="y"?"bottom":"right",j=v+g[E],_=v-g[R];v=w1(j,v,_)}if(c){const E=y==="y"?"top":"left",R=y==="y"?"bottom":"right",j=S+g[E],_=S-g[R];S=w1(j,S,_)}const C=u.fn({...t,[x]:v,[y]:S});return{...C,data:{x:C.x-n,y:C.y-r,enabled:{[x]:i,[y]:c}}}}}},BH=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}=Qo(e,t),g={x:n,y:r},y=Ws(s),x=eS(y);let v=g[x],S=g[y];const C=Qo(u,t),E=typeof C=="number"?{mainAxis:C,crossAxis:0}:{mainAxis:0,crossAxis:0,...C};if(f){const _=x==="y"?"height":"width",A=i.reference[x]-i.floating[_]+E.mainAxis,O=i.reference[x]+i.reference[_]-E.mainAxis;v<A?v=A:v>O&&(v=O)}if(m){var R,j;const _=x==="y"?"width":"height",A=e4.has(Xo(s)),O=i.reference[y]-i.floating[_]+(A&&((R=c.offset)==null?void 0:R[y])||0)+(A?0:E.crossAxis),I=i.reference[y]+i.reference[_]+(A?0:((j=c.offset)==null?void 0:j[y])||0)-(A?E.crossAxis:0);S<O?S=O:S>I&&(S=I)}return{[x]:v,[y]:S}}}},qH=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}=Qo(e,t),g=await $f(t,m),y=Xo(s),x=ad(s),v=Ws(s)==="y",{width:S,height:C}=i.floating;let E,R;y==="top"||y==="bottom"?(E=y,R=x===(await(c.isRTL==null?void 0:c.isRTL(u.floating))?"start":"end")?"left":"right"):(R=y,E=x==="end"?"top":"bottom");const j=C-g.top-g.bottom,_=S-g.left-g.right,A=il(C-g[E],j),O=il(S-g[R],_),I=!t.middlewareData.shift;let T=A,D=O;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(D=_),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=j),I&&!x){const H=Fa(g.left,0),B=Fa(g.right,0),q=Fa(g.top,0),Z=Fa(g.bottom,0);v?D=S-2*(H!==0||B!==0?H+B:Fa(g.left,g.right)):T=C-2*(q!==0||Z!==0?q+Z:Fa(g.top,g.bottom))}await f({...t,availableWidth:D,availableHeight:T});const L=await c.getDimensions(u.floating);return S!==L.width||C!==L.height?{reset:{rects:!0}}:{}}}};function ey(){return typeof window<"u"}function sd(e){return t4(e)?(e.nodeName||"").toLowerCase():"#document"}function Ha(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ho(e){var t;return(t=(t4(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function t4(e){return ey()?e instanceof Node||e instanceof Ha(e).Node:!1}function Ns(e){return ey()?e instanceof Element||e instanceof Ha(e).Element:!1}function io(e){return ey()?e instanceof HTMLElement||e instanceof Ha(e).HTMLElement:!1}function uT(e){return!ey()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ha(e).ShadowRoot}const KH=new Set(["inline","contents"]);function dh(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=As(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!KH.has(s)}const ZH=new Set(["table","td","th"]);function YH(e){return ZH.has(sd(e))}const WH=[":popover-open",":modal"];function ty(e){return WH.some(t=>{try{return e.matches(t)}catch{return!1}})}const QH=["transform","translate","scale","rotate","perspective"],XH=["transform","translate","scale","rotate","perspective","filter"],JH=["paint","layout","strict","content"];function rS(e){const t=aS(),n=Ns(e)?As(e):e;return QH.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)||XH.some(r=>(n.willChange||"").includes(r))||JH.some(r=>(n.contain||"").includes(r))}function eV(e){let t=ll(e);for(;io(t)&&!$u(t);){if(rS(t))return t;if(ty(t))return null;t=ll(t)}return null}function aS(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const tV=new Set(["html","body","#document"]);function $u(e){return tV.has(sd(e))}function As(e){return Ha(e).getComputedStyle(e)}function ny(e){return Ns(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ll(e){if(sd(e)==="html")return e;const t=e.assignedSlot||e.parentNode||uT(e)&&e.host||ho(e);return uT(t)?t.host:t}function n4(e){const t=ll(e);return $u(t)?e.ownerDocument?e.ownerDocument.body:e.body:io(t)&&dh(t)?t:n4(t)}function Gf(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=n4(e),i=s===((r=e.ownerDocument)==null?void 0:r.body),c=Ha(s);if(i){const u=j1(c);return t.concat(c,c.visualViewport||[],dh(s)?s:[],u&&n?Gf(u):[])}return t.concat(s,Gf(s,[],n))}function j1(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function r4(e){const t=As(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=io(e),i=s?e.offsetWidth:n,c=s?e.offsetHeight:r,u=Qp(n)!==i||Qp(r)!==c;return u&&(n=i,r=c),{width:n,height:r,$:u}}function sS(e){return Ns(e)?e:e.contextElement}function Ou(e){const t=sS(e);if(!io(t))return eo(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:i}=r4(t);let c=(i?Qp(n.width):n.width)/r,u=(i?Qp(n.height):n.height)/s;return(!c||!Number.isFinite(c))&&(c=1),(!u||!Number.isFinite(u))&&(u=1),{x:c,y:u}}const nV=eo(0);function a4(e){const t=Ha(e);return!aS()||!t.visualViewport?nV:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function rV(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ha(e)?!1:t}function ic(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),i=sS(e);let c=eo(1);t&&(r?Ns(r)&&(c=Ou(r)):c=Ou(e));const u=rV(i,n,r)?a4(i):eo(0);let f=(s.left+u.x)/c.x,m=(s.top+u.y)/c.y,g=s.width/c.x,y=s.height/c.y;if(i){const x=Ha(i),v=r&&Ns(r)?Ha(r):r;let S=x,C=j1(S);for(;C&&r&&v!==S;){const E=Ou(C),R=C.getBoundingClientRect(),j=As(C),_=R.left+(C.clientLeft+parseFloat(j.paddingLeft))*E.x,A=R.top+(C.clientTop+parseFloat(j.paddingTop))*E.y;f*=E.x,m*=E.y,g*=E.x,y*=E.y,f+=_,m+=A,S=Ha(C),C=j1(S)}}return Jp({width:g,height:y,x:f,y:m})}function ry(e,t){const n=ny(e).scrollLeft;return t?t.left+n:ic(ho(e)).left+n}function s4(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-ry(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function aV(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const i=s==="fixed",c=ho(r),u=t?ty(t.floating):!1;if(r===c||u&&i)return n;let f={scrollLeft:0,scrollTop:0},m=eo(1);const g=eo(0),y=io(r);if((y||!y&&!i)&&((sd(r)!=="body"||dh(c))&&(f=ny(r)),io(r))){const v=ic(r);m=Ou(r),g.x=v.x+r.clientLeft,g.y=v.y+r.clientTop}const x=c&&!y&&!i?s4(c,f):eo(0);return{width:n.width*m.x,height:n.height*m.y,x:n.x*m.x-f.scrollLeft*m.x+g.x+x.x,y:n.y*m.y-f.scrollTop*m.y+g.y+x.y}}function sV(e){return Array.from(e.getClientRects())}function oV(e){const t=ho(e),n=ny(e),r=e.ownerDocument.body,s=Fa(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Fa(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let c=-n.scrollLeft+ry(e);const u=-n.scrollTop;return As(r).direction==="rtl"&&(c+=Fa(t.clientWidth,r.clientWidth)-s),{width:s,height:i,x:c,y:u}}const dT=25;function iV(e,t){const n=Ha(e),r=ho(e),s=n.visualViewport;let i=r.clientWidth,c=r.clientHeight,u=0,f=0;if(s){i=s.width,c=s.height;const g=aS();(!g||g&&t==="fixed")&&(u=s.offsetLeft,f=s.offsetTop)}const m=ry(r);if(m<=0){const g=r.ownerDocument,y=g.body,x=getComputedStyle(y),v=g.compatMode==="CSS1Compat"&&parseFloat(x.marginLeft)+parseFloat(x.marginRight)||0,S=Math.abs(r.clientWidth-y.clientWidth-v);S<=dT&&(i-=S)}else m<=dT&&(i+=m);return{width:i,height:c,x:u,y:f}}const lV=new Set(["absolute","fixed"]);function cV(e,t){const n=ic(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,i=io(e)?Ou(e):eo(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 fT(e,t,n){let r;if(t==="viewport")r=iV(e,n);else if(t==="document")r=oV(ho(e));else if(Ns(t))r=cV(t,n);else{const s=a4(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Jp(r)}function o4(e,t){const n=ll(e);return n===t||!Ns(n)||$u(n)?!1:As(n).position==="fixed"||o4(n,t)}function uV(e,t){const n=t.get(e);if(n)return n;let r=Gf(e,[],!1).filter(u=>Ns(u)&&sd(u)!=="body"),s=null;const i=As(e).position==="fixed";let c=i?ll(e):e;for(;Ns(c)&&!$u(c);){const u=As(c),f=rS(c);!f&&u.position==="fixed"&&(s=null),(i?!f&&!s:!f&&u.position==="static"&&!!s&&lV.has(s.position)||dh(c)&&!f&&o4(e,c))?r=r.filter(g=>g!==c):s=u,c=ll(c)}return t.set(e,r),r}function dV(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const c=[...n==="clippingAncestors"?ty(t)?[]:uV(t,this._c):[].concat(n),r],u=c[0],f=c.reduce((m,g)=>{const y=fT(t,g,s);return m.top=Fa(y.top,m.top),m.right=il(y.right,m.right),m.bottom=il(y.bottom,m.bottom),m.left=Fa(y.left,m.left),m},fT(t,u,s));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function fV(e){const{width:t,height:n}=r4(e);return{width:t,height:n}}function hV(e,t,n){const r=io(t),s=ho(t),i=n==="fixed",c=ic(e,!0,i,t);let u={scrollLeft:0,scrollTop:0};const f=eo(0);function m(){f.x=ry(s)}if(r||!r&&!i)if((sd(t)!=="body"||dh(s))&&(u=ny(t)),r){const v=ic(t,!0,i,t);f.x=v.x+t.clientLeft,f.y=v.y+t.clientTop}else s&&m();i&&!r&&s&&m();const g=s&&!r&&!i?s4(s,u):eo(0),y=c.left+u.scrollLeft-f.x-g.x,x=c.top+u.scrollTop-f.y-g.y;return{x:y,y:x,width:c.width,height:c.height}}function w0(e){return As(e).position==="static"}function hT(e,t){if(!io(e)||As(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ho(e)===n&&(n=n.ownerDocument.body),n}function i4(e,t){const n=Ha(e);if(ty(e))return n;if(!io(e)){let s=ll(e);for(;s&&!$u(s);){if(Ns(s)&&!w0(s))return s;s=ll(s)}return n}let r=hT(e,t);for(;r&&YH(r)&&w0(r);)r=hT(r,t);return r&&$u(r)&&w0(r)&&!rS(r)?n:r||eV(e)||n}const mV=async function(e){const t=this.getOffsetParent||i4,n=this.getDimensions,r=await n(e.floating);return{reference:hV(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function pV(e){return As(e).direction==="rtl"}const gV={convertOffsetParentRelativeRectToViewportRelativeRect:aV,getDocumentElement:ho,getClippingRect:dV,getOffsetParent:i4,getElementRects:mV,getClientRects:sV,getDimensions:fV,getScale:Ou,isElement:Ns,isRTL:pV};function l4(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function yV(e,t){let n=null,r;const s=ho(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:g,top:y,width:x,height:v}=m;if(u||t(),!x||!v)return;const S=cp(y),C=cp(s.clientWidth-(g+x)),E=cp(s.clientHeight-(y+v)),R=cp(g),_={rootMargin:-S+"px "+-C+"px "+-E+"px "+-R+"px",threshold:Fa(0,il(1,f))||1};let A=!0;function O(I){const T=I[0].intersectionRatio;if(T!==f){if(!A)return c();T?c(!1,T):r=setTimeout(()=>{c(!1,1e-7)},1e3)}T===1&&!l4(m,e.getBoundingClientRect())&&c(),A=!1}try{n=new IntersectionObserver(O,{..._,root:s.ownerDocument})}catch{n=new IntersectionObserver(O,_)}n.observe(e)}return c(!0),i}function xV(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=sS(e),g=s||i?[...m?Gf(m):[],...Gf(t)]:[];g.forEach(R=>{s&&R.addEventListener("scroll",n,{passive:!0}),i&&R.addEventListener("resize",n)});const y=m&&u?yV(m,n):null;let x=-1,v=null;c&&(v=new ResizeObserver(R=>{let[j]=R;j&&j.target===m&&v&&(v.unobserve(t),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var _;(_=v)==null||_.observe(t)})),n()}),m&&!f&&v.observe(m),v.observe(t));let S,C=f?ic(e):null;f&&E();function E(){const R=ic(e);C&&!l4(C,R)&&n(),C=R,S=requestAnimationFrame(E)}return n(),()=>{var R;g.forEach(j=>{s&&j.removeEventListener("scroll",n),i&&j.removeEventListener("resize",n)}),y==null||y(),(R=v)==null||R.disconnect(),v=null,f&&cancelAnimationFrame(S)}}const vV=$H,bV=GH,SV=zH,CV=qH,EV=HH,mT=FH,wV=BH,RV=(e,t,n)=>{const r=new Map,s={platform:gV,...n},i={...s.platform,_c:r};return UH(e,t,{...s,platform:i})};var jV=typeof document<"u",TV=function(){},Mp=jV?h.useLayoutEffect:TV;function eg(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(!eg(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)&&!eg(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function c4(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function pT(e,t){const n=c4(e);return Math.round(t*n)/n}function R0(e){const t=h.useRef(e);return Mp(()=>{t.current=e}),t}function _V(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,[g,y]=h.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[x,v]=h.useState(r);eg(x,r)||v(r);const[S,C]=h.useState(null),[E,R]=h.useState(null),j=h.useCallback(K=>{K!==I.current&&(I.current=K,C(K))},[]),_=h.useCallback(K=>{K!==T.current&&(T.current=K,R(K))},[]),A=i||S,O=c||E,I=h.useRef(null),T=h.useRef(null),D=h.useRef(g),L=f!=null,H=R0(f),B=R0(s),q=R0(m),Z=h.useCallback(()=>{if(!I.current||!T.current)return;const K={placement:t,strategy:n,middleware:x};B.current&&(K.platform=B.current),RV(I.current,T.current,K).then(se=>{const ve={...se,isPositioned:q.current!==!1};F.current&&!eg(D.current,ve)&&(D.current=ve,ws.flushSync(()=>{y(ve)}))})},[x,t,n,B,q]);Mp(()=>{m===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,y(K=>({...K,isPositioned:!1})))},[m]);const F=h.useRef(!1);Mp(()=>(F.current=!0,()=>{F.current=!1}),[]),Mp(()=>{if(A&&(I.current=A),O&&(T.current=O),A&&O){if(H.current)return H.current(A,O,Z);Z()}},[A,O,Z,H,L]);const z=h.useMemo(()=>({reference:I,floating:T,setReference:j,setFloating:_}),[j,_]),M=h.useMemo(()=>({reference:A,floating:O}),[A,O]),V=h.useMemo(()=>{const K={position:n,left:0,top:0};if(!M.floating)return K;const se=pT(M.floating,g.x),ve=pT(M.floating,g.y);return u?{...K,transform:"translate("+se+"px, "+ve+"px)",...c4(M.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:se,top:ve}},[n,u,M.floating,g.x,g.y]);return h.useMemo(()=>({...g,update:Z,refs:z,elements:M,floatingStyles:V}),[g,Z,z,M,V])}const NV=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?mT({element:r.current,padding:s}).fn(n):{}:r?mT({element:r,padding:s}).fn(n):{}}}},AV=(e,t)=>({...vV(e),options:[e,t]}),DV=(e,t)=>({...bV(e),options:[e,t]}),OV=(e,t)=>({...wV(e),options:[e,t]}),IV=(e,t)=>({...SV(e),options:[e,t]}),MV=(e,t)=>({...CV(e),options:[e,t]}),kV=(e,t)=>({...EV(e),options:[e,t]}),LV=(e,t)=>({...NV(e),options:[e,t]});var PV="Arrow",u4=h.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...i}=e;return a.jsx(Xe.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"})})});u4.displayName=PV;var UV=u4;function oS(e){const[t,n]=h.useState(void 0);return Ir(()=>{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 iS="Popper",[d4,mo]=xr(iS),[FV,f4]=d4(iS),h4=e=>{const{__scopePopper:t,children:n}=e,[r,s]=h.useState(null);return a.jsx(FV,{scope:t,anchor:r,onAnchorChange:s,children:n})};h4.displayName=iS;var m4="PopperAnchor",p4=h.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,i=f4(m4,n),c=h.useRef(null),u=ht(t,c),f=h.useRef(null);return h.useEffect(()=>{const m=f.current;f.current=(r==null?void 0:r.current)||c.current,m!==f.current&&i.onAnchorChange(f.current)}),r?null:a.jsx(Xe.div,{...s,ref:u})});p4.displayName=m4;var lS="PopperContent",[zV,HV]=d4(lS),g4=h.forwardRef((e,t)=>{var J,he,ge,Ee,Me,Fe;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:i="center",alignOffset:c=0,arrowPadding:u=0,avoidCollisions:f=!0,collisionBoundary:m=[],collisionPadding:g=0,sticky:y="partial",hideWhenDetached:x=!1,updatePositionStrategy:v="optimized",onPlaced:S,...C}=e,E=f4(lS,n),[R,j]=h.useState(null),_=ht(t,nt=>j(nt)),[A,O]=h.useState(null),I=oS(A),T=(I==null?void 0:I.width)??0,D=(I==null?void 0:I.height)??0,L=r+(i!=="center"?"-"+i:""),H=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},B=Array.isArray(m)?m:[m],q=B.length>0,Z={padding:H,boundary:B.filter($V),altBoundary:q},{refs:F,floatingStyles:z,placement:M,isPositioned:V,middlewareData:K}=_V({strategy:"fixed",placement:L,whileElementsMounted:(...nt)=>xV(...nt,{animationFrame:v==="always"}),elements:{reference:E.anchor},middleware:[AV({mainAxis:s+D,alignmentAxis:c}),f&&DV({mainAxis:!0,crossAxis:!1,limiter:y==="partial"?OV():void 0,...Z}),f&&IV({...Z}),MV({...Z,apply:({elements:nt,rects:ut,availableWidth:Vt,availableHeight:xn})=>{const{width:er,height:fn}=ut.reference,Pe=nt.floating.style;Pe.setProperty("--radix-popper-available-width",`${Vt}px`),Pe.setProperty("--radix-popper-available-height",`${xn}px`),Pe.setProperty("--radix-popper-anchor-width",`${er}px`),Pe.setProperty("--radix-popper-anchor-height",`${fn}px`)}}),A&&LV({element:A,padding:u}),GV({arrowWidth:T,arrowHeight:D}),x&&kV({strategy:"referenceHidden",...Z})]}),[se,ve]=v4(M),P=_s(S);Ir(()=>{V&&(P==null||P())},[V,P]);const U=(J=K.arrow)==null?void 0:J.x,$=(he=K.arrow)==null?void 0:he.y,Q=((ge=K.arrow)==null?void 0:ge.centerOffset)!==0,[ne,ue]=h.useState();return Ir(()=>{R&&ue(window.getComputedStyle(R).zIndex)},[R]),a.jsx("div",{ref:F.setFloating,"data-radix-popper-content-wrapper":"",style:{...z,transform:V?z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ne,"--radix-popper-transform-origin":[(Ee=K.transformOrigin)==null?void 0:Ee.x,(Me=K.transformOrigin)==null?void 0:Me.y].join(" "),...((Fe=K.hide)==null?void 0:Fe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx(zV,{scope:n,placedSide:se,onArrowChange:O,arrowX:U,arrowY:$,shouldHideArrow:Q,children:a.jsx(Xe.div,{"data-side":se,"data-align":ve,...C,ref:_,style:{...C.style,animation:V?void 0:"none"}})})})});g4.displayName=lS;var y4="PopperArrow",VV={top:"bottom",right:"left",bottom:"top",left:"right"},x4=h.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,i=HV(y4,r),c=VV[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(UV,{...s,ref:n,style:{...s.style,display:"block"}})})});x4.displayName=y4;function $V(e){return e!==null}var GV=e=>({name:"transformOrigin",options:e,fn(t){var E,R,j;const{placement:n,rects:r,middlewareData:s}=t,c=((E=s.arrow)==null?void 0:E.centerOffset)!==0,u=c?0:e.arrowWidth,f=c?0:e.arrowHeight,[m,g]=v4(n),y={start:"0%",center:"50%",end:"100%"}[g],x=(((R=s.arrow)==null?void 0:R.x)??0)+u/2,v=(((j=s.arrow)==null?void 0:j.y)??0)+f/2;let S="",C="";return m==="bottom"?(S=c?y:`${x}px`,C=`${-f}px`):m==="top"?(S=c?y:`${x}px`,C=`${r.floating.height+f}px`):m==="right"?(S=`${-f}px`,C=c?y:`${v}px`):m==="left"&&(S=`${r.floating.width+f}px`,C=c?y:`${v}px`),{data:{x:S,y:C}}}});function v4(e){const[t,n="center"]=e.split("-");return[t,n]}var od=h4,id=p4,fh=g4,hh=x4,BV=Symbol("radix.slottable");function qV(e){const t=({children:n})=>a.jsx(a.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=BV,t}var b4=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"}),KV="VisuallyHidden",S4=h.forwardRef((e,t)=>a.jsx(Xe.span,{...e,ref:t,style:{...b4,...e.style}}));S4.displayName=KV;var ZV=S4,[ay]=xr("Tooltip",[mo]),sy=mo(),C4="TooltipProvider",YV=700,T1="tooltip.open",[WV,cS]=ay(C4),E4=e=>{const{__scopeTooltip:t,delayDuration:n=YV,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(WV,{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})};E4.displayName=C4;var Bf="Tooltip",[QV,mh]=ay(Bf),w4=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:s,onOpenChange:i,disableHoverableContent:c,delayDuration:u}=e,f=cS(Bf,e.__scopeTooltip),m=sy(t),[g,y]=h.useState(null),x=qn(),v=h.useRef(0),S=c??f.disableHoverableContent,C=u??f.delayDuration,E=h.useRef(!1),[R,j]=aa({prop:r,defaultProp:s??!1,onChange:T=>{T?(f.onOpen(),document.dispatchEvent(new CustomEvent(T1))):f.onClose(),i==null||i(T)},caller:Bf}),_=h.useMemo(()=>R?E.current?"delayed-open":"instant-open":"closed",[R]),A=h.useCallback(()=>{window.clearTimeout(v.current),v.current=0,E.current=!1,j(!0)},[j]),O=h.useCallback(()=>{window.clearTimeout(v.current),v.current=0,j(!1)},[j]),I=h.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>{E.current=!0,j(!0),v.current=0},C)},[C,j]);return h.useEffect(()=>()=>{v.current&&(window.clearTimeout(v.current),v.current=0)},[]),a.jsx(od,{...m,children:a.jsx(QV,{scope:t,contentId:x,open:R,stateAttribute:_,trigger:g,onTriggerChange:y,onTriggerEnter:h.useCallback(()=>{f.isOpenDelayedRef.current?I():A()},[f.isOpenDelayedRef,I,A]),onTriggerLeave:h.useCallback(()=>{S?O():(window.clearTimeout(v.current),v.current=0)},[O,S]),onOpen:A,onClose:O,disableHoverableContent:S,children:n})})};w4.displayName=Bf;var _1="TooltipTrigger",R4=h.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=mh(_1,n),i=cS(_1,n),c=sy(n),u=h.useRef(null),f=ht(t,u,s.onTriggerChange),m=h.useRef(!1),g=h.useRef(!1),y=h.useCallback(()=>m.current=!1,[]);return h.useEffect(()=>()=>document.removeEventListener("pointerup",y),[y]),a.jsx(id,{asChild:!0,...c,children:a.jsx(Xe.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:f,onPointerMove:Oe(e.onPointerMove,x=>{x.pointerType!=="touch"&&!g.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),g.current=!0)}),onPointerLeave:Oe(e.onPointerLeave,()=>{s.onTriggerLeave(),g.current=!1}),onPointerDown:Oe(e.onPointerDown,()=>{s.open&&s.onClose(),m.current=!0,document.addEventListener("pointerup",y,{once:!0})}),onFocus:Oe(e.onFocus,()=>{m.current||s.onOpen()}),onBlur:Oe(e.onBlur,s.onClose),onClick:Oe(e.onClick,s.onClose)})})});R4.displayName=_1;var uS="TooltipPortal",[XV,JV]=ay(uS,{forceMount:void 0}),j4=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:s}=e,i=mh(uS,t);return a.jsx(XV,{scope:t,forceMount:n,children:a.jsx(kr,{present:n||i.open,children:a.jsx(Sc,{asChild:!0,container:s,children:r})})})};j4.displayName=uS;var Gu="TooltipContent",T4=h.forwardRef((e,t)=>{const n=JV(Gu,e.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...i}=e,c=mh(Gu,e.__scopeTooltip);return a.jsx(kr,{present:r||c.open,children:c.disableHoverableContent?a.jsx(_4,{side:s,...i,ref:t}):a.jsx(e$,{side:s,...i,ref:t})})}),e$=h.forwardRef((e,t)=>{const n=mh(Gu,e.__scopeTooltip),r=cS(Gu,e.__scopeTooltip),s=h.useRef(null),i=ht(t,s),[c,u]=h.useState(null),{trigger:f,onClose:m}=n,g=s.current,{onPointerInTransitChange:y}=r,x=h.useCallback(()=>{u(null),y(!1)},[y]),v=h.useCallback((S,C)=>{const E=S.currentTarget,R={x:S.clientX,y:S.clientY},j=a$(R,E.getBoundingClientRect()),_=s$(R,j),A=o$(C.getBoundingClientRect()),O=l$([..._,...A]);u(O),y(!0)},[y]);return h.useEffect(()=>()=>x(),[x]),h.useEffect(()=>{if(f&&g){const S=E=>v(E,g),C=E=>v(E,f);return f.addEventListener("pointerleave",S),g.addEventListener("pointerleave",C),()=>{f.removeEventListener("pointerleave",S),g.removeEventListener("pointerleave",C)}}},[f,g,v,x]),h.useEffect(()=>{if(c){const S=C=>{const E=C.target,R={x:C.clientX,y:C.clientY},j=(f==null?void 0:f.contains(E))||(g==null?void 0:g.contains(E)),_=!i$(R,c);j?x():_&&(x(),m())};return document.addEventListener("pointermove",S),()=>document.removeEventListener("pointermove",S)}},[f,g,c,m,x]),a.jsx(_4,{...e,ref:i})}),[t$,n$]=ay(Bf,{isInside:!1}),r$=qV("TooltipContent"),_4=h.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:c,...u}=e,f=mh(Gu,n),m=sy(n),{onClose:g}=f;return h.useEffect(()=>(document.addEventListener(T1,g),()=>document.removeEventListener(T1,g)),[g]),h.useEffect(()=>{if(f.trigger){const y=x=>{const v=x.target;v!=null&&v.contains(f.trigger)&&g()};return window.addEventListener("scroll",y,{capture:!0}),()=>window.removeEventListener("scroll",y,{capture:!0})}},[f.trigger,g]),a.jsx(bc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:c,onFocusOutside:y=>y.preventDefault(),onDismiss:g,children:a.jsxs(fh,{"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(r$,{children:r}),a.jsx(t$,{scope:n,isInside:!0,children:a.jsx(ZV,{id:f.contentId,role:"tooltip",children:s||r})})]})})});T4.displayName=Gu;var N4="TooltipArrow",A4=h.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=sy(n);return n$(N4,n).isInside?null:a.jsx(hh,{...s,...r,ref:t})});A4.displayName=N4;function a$(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 s$(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 o$(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 i$(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,g=u.y,y=f.x,x=f.y;g>r!=x>r&&n<(y-m)*(r-g)/(x-g)+m&&(s=!s)}return s}function l$(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),c$(t)}function c$(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 u$=E4,d$=w4,f$=R4,h$=j4,m$=T4,p$=A4;function os({delayDuration:e=0,...t}){return a.jsx(u$,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function Nt({...e}){return a.jsx(os,{children:a.jsx(d$,{"data-slot":"tooltip",...e})})}function At({...e}){return a.jsx(f$,{"data-slot":"tooltip-trigger",...e})}function Dt({className:e,sideOffset:t=0,children:n,...r}){return a.jsx(h$,{children:a.jsxs(m$,{"data-slot":"tooltip-content",sideOffset:t,className:re("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(p$,{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 g$="sidebar_state",y$=3600*24*7,x$="16rem",v$="18rem",b$="3rem",S$="b",D4=h.createContext(null);function ph(){const e=h.useContext(D4);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function C$({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:s,children:i,...c}){const u=YU(),[f,m]=h.useState(!1),[g,y]=h.useState(e),x=t??g,v=h.useCallback(R=>{const j=typeof R=="function"?R(x):R;n?n(j):y(j),document.cookie=`${g$}=${j}; path=/; max-age=${y$}`},[n,x]),S=h.useCallback(()=>u?m(R=>!R):v(R=>!R),[u,v,m]);h.useEffect(()=>{const R=j=>{j.key===S$&&(j.metaKey||j.ctrlKey)&&(j.preventDefault(),S())};return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[S]);const C=x?"expanded":"collapsed",E=h.useMemo(()=>({state:C,open:x,setOpen:v,isMobile:u,openMobile:f,setOpenMobile:m,toggleSidebar:S}),[C,x,v,u,f,m,S]);return a.jsx(D4.Provider,{value:E,children:a.jsx(os,{delayDuration:0,children:a.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":x$,"--sidebar-width-icon":b$,...s},className:re("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",r),...c,children:i})})})}function E$({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:s,...i}){const{isMobile:c,state:u,openMobile:f,setOpenMobile:m}=ph();return n==="none"?a.jsx("div",{"data-slot":"sidebar",className:re("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",r),...i,children:s}):c?a.jsx(ni,{open:f,onOpenChange:m,...i,children:a.jsxs(ri,{"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":v$},side:e,children:[a.jsxs(ai,{className:"sr-only",children:[a.jsx(si,{children:"Sidebar"}),a.jsx(hl,{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:re("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:re("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 w$({className:e,onClick:t,...n}){const{toggleSidebar:r}=ph();return a.jsx("div",{className:"absolute top-4 left-0 z-10 md:hidden",children:a.jsxs(Ce,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:re("size-7",e),onClick:s=>{t==null||t(s),r()},...n,children:[a.jsx(JP,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})})}function R$({className:e,...t}){const{toggleSidebar:n}=ph();return a.jsx("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:n,title:"Toggle Sidebar",className:re("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 j$({className:e,...t}){return a.jsx("main",{"data-slot":"sidebar-inset",className:re("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 T$({className:e,...t}){return a.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:re("flex flex-col gap-2 p-2",e),...t})}function _$({className:e,...t}){return a.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:re("flex flex-col gap-2 p-2",e),...t})}function N$({className:e,...t}){return a.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:re("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function gT({className:e,...t}){return a.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:re("relative flex w-full min-w-0 flex-col p-2",e),...t})}function yT({className:e,...t}){return a.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:re("w-full text-sm",e),...t})}function A$({className:e,...t}){return a.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:re("flex w-full min-w-0 flex-col gap-1",e),...t})}function D$({className:e,...t}){return a.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:re("group/menu-item relative",e),...t})}const O$=Ju("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 I$({asChild:e=!1,isActive:t=!1,variant:n="default",size:r="default",tooltip:s,className:i,...c}){const u=e?ih:"button",{isMobile:f,state:m}=ph(),g=a.jsx(u,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":r,"data-active":t,className:re(O$({variant:n,size:r}),i),...c});return s?(typeof s=="string"&&(s={children:s}),a.jsxs(Nt,{children:[a.jsx(At,{asChild:!0,children:g}),a.jsx(Dt,{side:"right",align:"center",hidden:m!=="collapsed"||f,...s})]})):g}function N1(e){const t=M$(e),n=h.forwardRef((r,s)=>{const{children:i,...c}=r,u=h.Children.toArray(i),f=u.find(L$);if(f){const m=f.props.children,g=u.map(y=>y===f?h.Children.count(m)>1?h.Children.only(null):h.isValidElement(m)?m.props.children:null:y);return a.jsx(t,{...c,ref:s,children:h.isValidElement(m)?h.cloneElement(m,void 0,g):null})}return a.jsx(t,{...c,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function M$(e){const t=h.forwardRef((n,r)=>{const{children:s,...i}=n;if(h.isValidElement(s)){const c=U$(s),u=P$(i,s.props);return s.type!==h.Fragment&&(u.ref=r?qr(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 k$=Symbol("radix.slottable");function L$(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===k$}function P$(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 U$(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 F$(e){const t=e+"CollectionProvider",[n,r]=xr(t),[s,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=C=>{const{scope:E,children:R}=C,j=be.useRef(null),_=be.useRef(new Map).current;return a.jsx(s,{scope:E,itemMap:_,collectionRef:j,children:R})};c.displayName=t;const u=e+"CollectionSlot",f=N1(u),m=be.forwardRef((C,E)=>{const{scope:R,children:j}=C,_=i(u,R),A=ht(E,_.collectionRef);return a.jsx(f,{ref:A,children:j})});m.displayName=u;const g=e+"CollectionItemSlot",y="data-radix-collection-item",x=N1(g),v=be.forwardRef((C,E)=>{const{scope:R,children:j,..._}=C,A=be.useRef(null),O=ht(E,A),I=i(g,R);return be.useEffect(()=>(I.itemMap.set(A,{ref:A,..._}),()=>void I.itemMap.delete(A))),a.jsx(x,{[y]:"",ref:O,children:j})});v.displayName=g;function S(C){const E=i(e+"CollectionConsumer",C);return be.useCallback(()=>{const j=E.collectionRef.current;if(!j)return[];const _=Array.from(j.querySelectorAll(`[${y}]`));return Array.from(E.itemMap.values()).sort((I,T)=>_.indexOf(I.ref.current)-_.indexOf(T.ref.current))},[E.collectionRef,E.itemMap])}return[{Provider:c,Slot:m,ItemSlot:v},S,r]}var z$=h.createContext(void 0);function gh(e){const t=h.useContext(z$);return e||t||"ltr"}function xT(e){const t=H$(e),n=h.forwardRef((r,s)=>{const{children:i,...c}=r,u=h.Children.toArray(i),f=u.find($$);if(f){const m=f.props.children,g=u.map(y=>y===f?h.Children.count(m)>1?h.Children.only(null):h.isValidElement(m)?m.props.children:null:y);return a.jsx(t,{...c,ref:s,children:h.isValidElement(m)?h.cloneElement(m,void 0,g):null})}return a.jsx(t,{...c,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function H$(e){const t=h.forwardRef((n,r)=>{const{children:s,...i}=n;if(h.isValidElement(s)){const c=B$(s),u=G$(i,s.props);return s.type!==h.Fragment&&(u.ref=r?qr(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 V$=Symbol("radix.slottable");function $$(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===V$}function G$(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 q$(e){const t=e+"CollectionProvider",[n,r]=xr(t),[s,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=C=>{const{scope:E,children:R}=C,j=be.useRef(null),_=be.useRef(new Map).current;return a.jsx(s,{scope:E,itemMap:_,collectionRef:j,children:R})};c.displayName=t;const u=e+"CollectionSlot",f=xT(u),m=be.forwardRef((C,E)=>{const{scope:R,children:j}=C,_=i(u,R),A=ht(E,_.collectionRef);return a.jsx(f,{ref:A,children:j})});m.displayName=u;const g=e+"CollectionItemSlot",y="data-radix-collection-item",x=xT(g),v=be.forwardRef((C,E)=>{const{scope:R,children:j,..._}=C,A=be.useRef(null),O=ht(E,A),I=i(g,R);return be.useEffect(()=>(I.itemMap.set(A,{ref:A,..._}),()=>void I.itemMap.delete(A))),a.jsx(x,{[y]:"",ref:O,children:j})});v.displayName=g;function S(C){const E=i(e+"CollectionConsumer",C);return be.useCallback(()=>{const j=E.collectionRef.current;if(!j)return[];const _=Array.from(j.querySelectorAll(`[${y}]`));return Array.from(E.itemMap.values()).sort((I,T)=>_.indexOf(I.ref.current)-_.indexOf(T.ref.current))},[E.collectionRef,E.itemMap])}return[{Provider:c,Slot:m,ItemSlot:v},S,r]}var j0="rovingFocusGroup.onEntryFocus",K$={bubbles:!1,cancelable:!0},yh="RovingFocusGroup",[A1,O4,Z$]=q$(yh),[Y$,oy]=xr(yh,[Z$]),[W$,Q$]=Y$(yh),I4=h.forwardRef((e,t)=>a.jsx(A1.Provider,{scope:e.__scopeRovingFocusGroup,children:a.jsx(A1.Slot,{scope:e.__scopeRovingFocusGroup,children:a.jsx(X$,{...e,ref:t})})}));I4.displayName=yh;var X$=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:i,currentTabStopId:c,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:f,onEntryFocus:m,preventScrollOnEntryFocus:g=!1,...y}=e,x=h.useRef(null),v=ht(t,x),S=gh(i),[C,E]=aa({prop:c,defaultProp:u??null,onChange:f,caller:yh}),[R,j]=h.useState(!1),_=_s(m),A=O4(n),O=h.useRef(!1),[I,T]=h.useState(0);return h.useEffect(()=>{const D=x.current;if(D)return D.addEventListener(j0,_),()=>D.removeEventListener(j0,_)},[_]),a.jsx(W$,{scope:n,orientation:r,dir:S,loop:s,currentTabStopId:C,onItemFocus:h.useCallback(D=>E(D),[E]),onItemShiftTab:h.useCallback(()=>j(!0),[]),onFocusableItemAdd:h.useCallback(()=>T(D=>D+1),[]),onFocusableItemRemove:h.useCallback(()=>T(D=>D-1),[]),children:a.jsx(Xe.div,{tabIndex:R||I===0?-1:0,"data-orientation":r,...y,ref:v,style:{outline:"none",...e.style},onMouseDown:Oe(e.onMouseDown,()=>{O.current=!0}),onFocus:Oe(e.onFocus,D=>{const L=!O.current;if(D.target===D.currentTarget&&L&&!R){const H=new CustomEvent(j0,K$);if(D.currentTarget.dispatchEvent(H),!H.defaultPrevented){const B=A().filter(M=>M.focusable),q=B.find(M=>M.active),Z=B.find(M=>M.id===C),z=[q,Z,...B].filter(Boolean).map(M=>M.ref.current);L4(z,g)}}O.current=!1}),onBlur:Oe(e.onBlur,()=>j(!1))})})}),M4="RovingFocusGroupItem",k4=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:i,children:c,...u}=e,f=qn(),m=i||f,g=Q$(M4,n),y=g.currentTabStopId===m,x=O4(n),{onFocusableItemAdd:v,onFocusableItemRemove:S,currentTabStopId:C}=g;return h.useEffect(()=>{if(r)return v(),()=>S()},[r,v,S]),a.jsx(A1.ItemSlot,{scope:n,id:m,focusable:r,active:s,children:a.jsx(Xe.span,{tabIndex:y?0:-1,"data-orientation":g.orientation,...u,ref:t,onMouseDown:Oe(e.onMouseDown,E=>{r?g.onItemFocus(m):E.preventDefault()}),onFocus:Oe(e.onFocus,()=>g.onItemFocus(m)),onKeyDown:Oe(e.onKeyDown,E=>{if(E.key==="Tab"&&E.shiftKey){g.onItemShiftTab();return}if(E.target!==E.currentTarget)return;const R=tG(E,g.orientation,g.dir);if(R!==void 0){if(E.metaKey||E.ctrlKey||E.altKey||E.shiftKey)return;E.preventDefault();let _=x().filter(A=>A.focusable).map(A=>A.ref.current);if(R==="last")_.reverse();else if(R==="prev"||R==="next"){R==="prev"&&_.reverse();const A=_.indexOf(E.currentTarget);_=g.loop?nG(_,A+1):_.slice(A+1)}setTimeout(()=>L4(_))}}),children:typeof c=="function"?c({isCurrentTabStop:y,hasTabStop:C!=null}):c})})});k4.displayName=M4;var J$={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function eG(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function tG(e,t,n){const r=eG(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return J$[r]}function L4(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function nG(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var P4=I4,U4=k4,D1=["Enter"," "],rG=["ArrowDown","PageUp","Home"],F4=["ArrowUp","PageDown","End"],aG=[...rG,...F4],sG={ltr:[...D1,"ArrowRight"],rtl:[...D1,"ArrowLeft"]},oG={ltr:["ArrowLeft"],rtl:["ArrowRight"]},xh="Menu",[qf,iG,lG]=F$(xh),[Cc,z4]=xr(xh,[lG,mo,oy]),vh=mo(),H4=oy(),[V4,ml]=Cc(xh),[cG,bh]=Cc(xh),$4=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),g=h.useRef(!1),y=_s(i),x=gh(s);return h.useEffect(()=>{const v=()=>{g.current=!0,document.addEventListener("pointerdown",S,{capture:!0,once:!0}),document.addEventListener("pointermove",S,{capture:!0,once:!0})},S=()=>g.current=!1;return document.addEventListener("keydown",v,{capture:!0}),()=>{document.removeEventListener("keydown",v,{capture:!0}),document.removeEventListener("pointerdown",S,{capture:!0}),document.removeEventListener("pointermove",S,{capture:!0})}},[]),a.jsx(od,{...u,children:a.jsx(V4,{scope:t,open:n,onOpenChange:y,content:f,onContentChange:m,children:a.jsx(cG,{scope:t,onClose:h.useCallback(()=>y(!1),[y]),isUsingKeyboardRef:g,dir:x,modal:c,children:r})})})};$4.displayName=xh;var uG="MenuAnchor",dS=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=vh(n);return a.jsx(id,{...s,...r,ref:t})});dS.displayName=uG;var fS="MenuPortal",[dG,G4]=Cc(fS,{forceMount:void 0}),B4=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,i=ml(fS,t);return a.jsx(dG,{scope:t,forceMount:n,children:a.jsx(kr,{present:n||i.open,children:a.jsx(Sc,{asChild:!0,container:s,children:r})})})};B4.displayName=fS;var is="MenuContent",[fG,hS]=Cc(is),q4=h.forwardRef((e,t)=>{const n=G4(is,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,i=ml(is,e.__scopeMenu),c=bh(is,e.__scopeMenu);return a.jsx(qf.Provider,{scope:e.__scopeMenu,children:a.jsx(kr,{present:r||i.open,children:a.jsx(qf.Slot,{scope:e.__scopeMenu,children:c.modal?a.jsx(hG,{...s,ref:t}):a.jsx(mG,{...s,ref:t})})})})}),hG=h.forwardRef((e,t)=>{const n=ml(is,e.__scopeMenu),r=h.useRef(null),s=ht(t,r);return h.useEffect(()=>{const i=r.current;if(i)return Kg(i)},[]),a.jsx(mS,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Oe(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),mG=h.forwardRef((e,t)=>{const n=ml(is,e.__scopeMenu);return a.jsx(mS,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),pG=N1("MenuContent.ScrollLock"),mS=h.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:c,disableOutsidePointerEvents:u,onEntryFocus:f,onEscapeKeyDown:m,onPointerDownOutside:g,onFocusOutside:y,onInteractOutside:x,onDismiss:v,disableOutsideScroll:S,...C}=e,E=ml(is,n),R=bh(is,n),j=vh(n),_=H4(n),A=iG(n),[O,I]=h.useState(null),T=h.useRef(null),D=ht(t,T,E.onContentChange),L=h.useRef(0),H=h.useRef(""),B=h.useRef(0),q=h.useRef(null),Z=h.useRef("right"),F=h.useRef(0),z=S?uh:h.Fragment,M=S?{as:pG,allowPinchZoom:!0}:void 0,V=se=>{var J,he;const ve=H.current+se,P=A().filter(ge=>!ge.disabled),U=document.activeElement,$=(J=P.find(ge=>ge.ref.current===U))==null?void 0:J.textValue,Q=P.map(ge=>ge.textValue),ne=TG(Q,ve,$),ue=(he=P.find(ge=>ge.textValue===ne))==null?void 0:he.ref.current;(function ge(Ee){H.current=Ee,window.clearTimeout(L.current),Ee!==""&&(L.current=window.setTimeout(()=>ge(""),1e3))})(ve),ue&&setTimeout(()=>ue.focus())};h.useEffect(()=>()=>window.clearTimeout(L.current),[]),Bg();const K=h.useCallback(se=>{var P,U;return Z.current===((P=q.current)==null?void 0:P.side)&&NG(se,(U=q.current)==null?void 0:U.area)},[]);return a.jsx(fG,{scope:n,searchRef:H,onItemEnter:h.useCallback(se=>{K(se)&&se.preventDefault()},[K]),onItemLeave:h.useCallback(se=>{var ve;K(se)||((ve=T.current)==null||ve.focus(),I(null))},[K]),onTriggerLeave:h.useCallback(se=>{K(se)&&se.preventDefault()},[K]),pointerGraceTimerRef:B,onPointerGraceIntentChange:h.useCallback(se=>{q.current=se},[]),children:a.jsx(z,{...M,children:a.jsx(ch,{asChild:!0,trapped:s,onMountAutoFocus:Oe(i,se=>{var ve;se.preventDefault(),(ve=T.current)==null||ve.focus({preventScroll:!0})}),onUnmountAutoFocus:c,children:a.jsx(bc,{asChild:!0,disableOutsidePointerEvents:u,onEscapeKeyDown:m,onPointerDownOutside:g,onFocusOutside:y,onInteractOutside:x,onDismiss:v,children:a.jsx(P4,{asChild:!0,..._,dir:R.dir,orientation:"vertical",loop:r,currentTabStopId:O,onCurrentTabStopIdChange:I,onEntryFocus:Oe(f,se=>{R.isUsingKeyboardRef.current||se.preventDefault()}),preventScrollOnEntryFocus:!0,children:a.jsx(fh,{role:"menu","aria-orientation":"vertical","data-state":c3(E.open),"data-radix-menu-content":"",dir:R.dir,...j,...C,ref:D,style:{outline:"none",...C.style},onKeyDown:Oe(C.onKeyDown,se=>{const P=se.target.closest("[data-radix-menu-content]")===se.currentTarget,U=se.ctrlKey||se.altKey||se.metaKey,$=se.key.length===1;P&&(se.key==="Tab"&&se.preventDefault(),!U&&$&&V(se.key));const Q=T.current;if(se.target!==Q||!aG.includes(se.key))return;se.preventDefault();const ue=A().filter(J=>!J.disabled).map(J=>J.ref.current);F4.includes(se.key)&&ue.reverse(),RG(ue)}),onBlur:Oe(e.onBlur,se=>{se.currentTarget.contains(se.target)||(window.clearTimeout(L.current),H.current="")}),onPointerMove:Oe(e.onPointerMove,Kf(se=>{const ve=se.target,P=F.current!==se.clientX;if(se.currentTarget.contains(ve)&&P){const U=se.clientX>F.current?"right":"left";Z.current=U,F.current=se.clientX}}))})})})})})})});q4.displayName=is;var gG="MenuGroup",pS=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return a.jsx(Xe.div,{role:"group",...r,ref:t})});pS.displayName=gG;var yG="MenuLabel",K4=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return a.jsx(Xe.div,{...r,ref:t})});K4.displayName=yG;var tg="MenuItem",vT="menu.itemSelect",iy=h.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,i=h.useRef(null),c=bh(tg,e.__scopeMenu),u=hS(tg,e.__scopeMenu),f=ht(t,i),m=h.useRef(!1),g=()=>{const y=i.current;if(!n&&y){const x=new CustomEvent(vT,{bubbles:!0,cancelable:!0});y.addEventListener(vT,v=>r==null?void 0:r(v),{once:!0}),wA(y,x),x.defaultPrevented?m.current=!1:c.onClose()}};return a.jsx(Z4,{...s,ref:f,disabled:n,onClick:Oe(e.onClick,g),onPointerDown:y=>{var x;(x=e.onPointerDown)==null||x.call(e,y),m.current=!0},onPointerUp:Oe(e.onPointerUp,y=>{var x;m.current||(x=y.currentTarget)==null||x.click()}),onKeyDown:Oe(e.onKeyDown,y=>{const x=u.searchRef.current!=="";n||x&&y.key===" "||D1.includes(y.key)&&(y.currentTarget.click(),y.preventDefault())})})});iy.displayName=tg;var Z4=h.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...i}=e,c=hS(tg,n),u=H4(n),f=h.useRef(null),m=ht(t,f),[g,y]=h.useState(!1),[x,v]=h.useState("");return h.useEffect(()=>{const S=f.current;S&&v((S.textContent??"").trim())},[i.children]),a.jsx(qf.ItemSlot,{scope:n,disabled:r,textValue:s??x,children:a.jsx(U4,{asChild:!0,...u,focusable:!r,children:a.jsx(Xe.div,{role:"menuitem","data-highlighted":g?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:m,onPointerMove:Oe(e.onPointerMove,Kf(S=>{r?c.onItemLeave(S):(c.onItemEnter(S),S.defaultPrevented||S.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Oe(e.onPointerLeave,Kf(S=>c.onItemLeave(S))),onFocus:Oe(e.onFocus,()=>y(!0)),onBlur:Oe(e.onBlur,()=>y(!1))})})})}),xG="MenuCheckboxItem",Y4=h.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return a.jsx(e3,{scope:e.__scopeMenu,checked:n,children:a.jsx(iy,{role:"menuitemcheckbox","aria-checked":ng(n)?"mixed":n,...s,ref:t,"data-state":xS(n),onSelect:Oe(s.onSelect,()=>r==null?void 0:r(ng(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Y4.displayName=xG;var W4="MenuRadioGroup",[vG,bG]=Cc(W4,{value:void 0,onValueChange:()=>{}}),Q4=h.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,i=_s(r);return a.jsx(vG,{scope:e.__scopeMenu,value:n,onValueChange:i,children:a.jsx(pS,{...s,ref:t})})});Q4.displayName=W4;var X4="MenuRadioItem",J4=h.forwardRef((e,t)=>{const{value:n,...r}=e,s=bG(X4,e.__scopeMenu),i=n===s.value;return a.jsx(e3,{scope:e.__scopeMenu,checked:i,children:a.jsx(iy,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":xS(i),onSelect:Oe(r.onSelect,()=>{var c;return(c=s.onValueChange)==null?void 0:c.call(s,n)},{checkForDefaultPrevented:!1})})})});J4.displayName=X4;var gS="MenuItemIndicator",[e3,SG]=Cc(gS,{checked:!1}),t3=h.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,i=SG(gS,n);return a.jsx(kr,{present:r||ng(i.checked)||i.checked===!0,children:a.jsx(Xe.span,{...s,ref:t,"data-state":xS(i.checked)})})});t3.displayName=gS;var CG="MenuSeparator",n3=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return a.jsx(Xe.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});n3.displayName=CG;var EG="MenuArrow",r3=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=vh(n);return a.jsx(hh,{...s,...r,ref:t})});r3.displayName=EG;var yS="MenuSub",[wG,a3]=Cc(yS),s3=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:s}=e,i=ml(yS,t),c=vh(t),[u,f]=h.useState(null),[m,g]=h.useState(null),y=_s(s);return h.useEffect(()=>(i.open===!1&&y(!1),()=>y(!1)),[i.open,y]),a.jsx(od,{...c,children:a.jsx(V4,{scope:t,open:r,onOpenChange:y,content:m,onContentChange:g,children:a.jsx(wG,{scope:t,contentId:qn(),triggerId:qn(),trigger:u,onTriggerChange:f,children:n})})})};s3.displayName=yS;var Ef="MenuSubTrigger",o3=h.forwardRef((e,t)=>{const n=ml(Ef,e.__scopeMenu),r=bh(Ef,e.__scopeMenu),s=a3(Ef,e.__scopeMenu),i=hS(Ef,e.__scopeMenu),c=h.useRef(null),{pointerGraceTimerRef:u,onPointerGraceIntentChange:f}=i,m={__scopeMenu:e.__scopeMenu},g=h.useCallback(()=>{c.current&&window.clearTimeout(c.current),c.current=null},[]);return h.useEffect(()=>g,[g]),h.useEffect(()=>{const y=u.current;return()=>{window.clearTimeout(y),f(null)}},[u,f]),a.jsx(dS,{asChild:!0,...m,children:a.jsx(Z4,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":c3(n.open),...e,ref:qr(t,s.onTriggerChange),onClick:y=>{var x;(x=e.onClick)==null||x.call(e,y),!(e.disabled||y.defaultPrevented)&&(y.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Oe(e.onPointerMove,Kf(y=>{i.onItemEnter(y),!y.defaultPrevented&&!e.disabled&&!n.open&&!c.current&&(i.onPointerGraceIntentChange(null),c.current=window.setTimeout(()=>{n.onOpenChange(!0),g()},100))})),onPointerLeave:Oe(e.onPointerLeave,Kf(y=>{var v,S;g();const x=(v=n.content)==null?void 0:v.getBoundingClientRect();if(x){const C=(S=n.content)==null?void 0:S.dataset.side,E=C==="right",R=E?-5:5,j=x[E?"left":"right"],_=x[E?"right":"left"];i.onPointerGraceIntentChange({area:[{x:y.clientX+R,y:y.clientY},{x:j,y:x.top},{x:_,y:x.top},{x:_,y:x.bottom},{x:j,y:x.bottom}],side:C}),window.clearTimeout(u.current),u.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(y),y.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:Oe(e.onKeyDown,y=>{var v;const x=i.searchRef.current!=="";e.disabled||x&&y.key===" "||sG[r.dir].includes(y.key)&&(n.onOpenChange(!0),(v=n.content)==null||v.focus(),y.preventDefault())})})})});o3.displayName=Ef;var i3="MenuSubContent",l3=h.forwardRef((e,t)=>{const n=G4(is,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,i=ml(is,e.__scopeMenu),c=bh(is,e.__scopeMenu),u=a3(i3,e.__scopeMenu),f=h.useRef(null),m=ht(t,f);return a.jsx(qf.Provider,{scope:e.__scopeMenu,children:a.jsx(kr,{present:r||i.open,children:a.jsx(qf.Slot,{scope:e.__scopeMenu,children:a.jsx(mS,{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:g=>{var y;c.isUsingKeyboardRef.current&&((y=f.current)==null||y.focus()),g.preventDefault()},onCloseAutoFocus:g=>g.preventDefault(),onFocusOutside:Oe(e.onFocusOutside,g=>{g.target!==u.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:Oe(e.onEscapeKeyDown,g=>{c.onClose(),g.preventDefault()}),onKeyDown:Oe(e.onKeyDown,g=>{var v;const y=g.currentTarget.contains(g.target),x=oG[c.dir].includes(g.key);y&&x&&(i.onOpenChange(!1),(v=u.trigger)==null||v.focus(),g.preventDefault())})})})})})});l3.displayName=i3;function c3(e){return e?"open":"closed"}function ng(e){return e==="indeterminate"}function xS(e){return ng(e)?"indeterminate":e?"checked":"unchecked"}function RG(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function jG(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function TG(e,t,n){const s=t.length>1&&Array.from(t).every(m=>m===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let c=jG(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 _G(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,g=u.y,y=f.x,x=f.y;g>r!=x>r&&n<(y-m)*(r-g)/(x-g)+m&&(s=!s)}return s}function NG(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return _G(n,t)}function Kf(e){return t=>t.pointerType==="mouse"?e(t):void 0}var AG=$4,DG=dS,OG=B4,IG=q4,MG=pS,kG=K4,LG=iy,PG=Y4,UG=Q4,FG=J4,zG=t3,HG=n3,VG=r3,$G=s3,GG=o3,BG=l3,ly="DropdownMenu",[qG]=xr(ly,[z4]),Kr=z4(),[KG,u3]=qG(ly),d3=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:s,defaultOpen:i,onOpenChange:c,modal:u=!0}=e,f=Kr(t),m=h.useRef(null),[g,y]=aa({prop:s,defaultProp:i??!1,onChange:c,caller:ly});return a.jsx(KG,{scope:t,triggerId:qn(),triggerRef:m,contentId:qn(),open:g,onOpenChange:y,onOpenToggle:h.useCallback(()=>y(x=>!x),[y]),modal:u,children:a.jsx(AG,{...f,open:g,onOpenChange:y,dir:r,modal:u,children:n})})};d3.displayName=ly;var f3="DropdownMenuTrigger",h3=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...s}=e,i=u3(f3,n),c=Kr(n);return a.jsx(DG,{asChild:!0,...c,children:a.jsx(Xe.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:qr(t,i.triggerRef),onPointerDown:Oe(e.onPointerDown,u=>{!r&&u.button===0&&u.ctrlKey===!1&&(i.onOpenToggle(),i.open||u.preventDefault())}),onKeyDown:Oe(e.onKeyDown,u=>{r||(["Enter"," "].includes(u.key)&&i.onOpenToggle(),u.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})});h3.displayName=f3;var ZG="DropdownMenuPortal",m3=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Kr(t);return a.jsx(OG,{...r,...n})};m3.displayName=ZG;var p3="DropdownMenuContent",g3=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=u3(p3,n),i=Kr(n),c=h.useRef(!1);return a.jsx(IG,{id:s.contentId,"aria-labelledby":s.triggerId,...i,...r,ref:t,onCloseAutoFocus:Oe(e.onCloseAutoFocus,u=>{var f;c.current||(f=s.triggerRef.current)==null||f.focus(),c.current=!1,u.preventDefault()}),onInteractOutside:Oe(e.onInteractOutside,u=>{const f=u.detail.originalEvent,m=f.button===0&&f.ctrlKey===!0,g=f.button===2||m;(!s.modal||g)&&(c.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});g3.displayName=p3;var YG="DropdownMenuGroup",WG=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Kr(n);return a.jsx(MG,{...s,...r,ref:t})});WG.displayName=YG;var QG="DropdownMenuLabel",XG=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Kr(n);return a.jsx(kG,{...s,...r,ref:t})});XG.displayName=QG;var JG="DropdownMenuItem",y3=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Kr(n);return a.jsx(LG,{...s,...r,ref:t})});y3.displayName=JG;var eB="DropdownMenuCheckboxItem",tB=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Kr(n);return a.jsx(PG,{...s,...r,ref:t})});tB.displayName=eB;var nB="DropdownMenuRadioGroup",rB=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Kr(n);return a.jsx(UG,{...s,...r,ref:t})});rB.displayName=nB;var aB="DropdownMenuRadioItem",sB=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Kr(n);return a.jsx(FG,{...s,...r,ref:t})});sB.displayName=aB;var oB="DropdownMenuItemIndicator",iB=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Kr(n);return a.jsx(zG,{...s,...r,ref:t})});iB.displayName=oB;var lB="DropdownMenuSeparator",x3=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Kr(n);return a.jsx(HG,{...s,...r,ref:t})});x3.displayName=lB;var cB="DropdownMenuArrow",uB=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Kr(n);return a.jsx(VG,{...s,...r,ref:t})});uB.displayName=cB;var dB=e=>{const{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:s,defaultOpen:i}=e,c=Kr(t),[u,f]=aa({prop:r,defaultProp:i??!1,onChange:s,caller:"DropdownMenuSub"});return a.jsx($G,{...c,open:u,onOpenChange:f,children:n})},fB="DropdownMenuSubTrigger",v3=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Kr(n);return a.jsx(GG,{...s,...r,ref:t})});v3.displayName=fB;var hB="DropdownMenuSubContent",b3=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Kr(n);return a.jsx(BG,{...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)"}})});b3.displayName=hB;var mB=d3,pB=h3,S3=m3,gB=g3,yB=y3,xB=x3,vB=dB,bB=v3,SB=b3;function Lr({...e}){return a.jsx(mB,{"data-slot":"dropdown-menu",...e})}function CB({...e}){return a.jsx(S3,{"data-slot":"dropdown-menu-portal",...e})}function Pr({...e}){return a.jsx(pB,{"data-slot":"dropdown-menu-trigger",...e})}function Ur({className:e,sideOffset:t=4,...n}){return a.jsx(S3,{children:a.jsx(gB,{"data-slot":"dropdown-menu-content",sideOffset:t,className:re("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 Ot({className:e,inset:t,variant:n="default",...r}){return a.jsx(yB,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:re("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 wa({className:e,...t}){return a.jsx(xB,{"data-slot":"dropdown-menu-separator",className:re("bg-border -mx-1 my-1 h-px",e),...t})}function vS({...e}){return a.jsx(vB,{"data-slot":"dropdown-menu-sub",...e})}function bS({className:e,inset:t,children:n,...r}){return a.jsxs(bB,{"data-slot":"dropdown-menu-sub-trigger","data-inset":t,className:re("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(Ra,{className:"ml-auto size-4"})]})}function SS({className:e,...t}){return a.jsx(SB,{"data-slot":"dropdown-menu-sub-content",className:re("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 EB="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",wB=({width:e=45,height:t=36,className:n=""})=>a.jsx("img",{src:EB,alt:"OWOX Logo",width:e,height:t,className:n}),C3=h.createContext(null),E3=h.createContext(()=>{});function RB(){return h.useContext(E3)}function rg(e){const t=h.useContext(C3);if(t==null)throw new Error("useAppSelector must be used within StoreProvider");return e(t)}function w3(){return rg(e=>e.project)}function Sh(){const{data:e,callState:t,error:n}=rg(r=>r.flags);return{flags:e,callState:t,error:n}}function jB({isOpen:e}){const{title:t}=w3();return a.jsx(Pr,{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(wB,{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(fo,{className:`ml-auto size-4 transition-transform duration-200 ${e?"rotate-180":""}`})]})})}var $r=(e=>(e.LOADING="loading",e.AUTHENTICATED="authenticated",e.UNAUTHENTICATED="unauthenticated",e.ERROR="error",e))($r||{});function R3(e,t){return function(){return e.apply(t,arguments)}}const{toString:TB}=Object.prototype,{getPrototypeOf:CS}=Object,{iterator:cy,toStringTag:j3}=Symbol,uy=(e=>t=>{const n=TB.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),ks=e=>(e=e.toLowerCase(),t=>uy(t)===e),dy=e=>t=>typeof t===e,{isArray:ld}=Array,Bu=dy("undefined");function Ch(e){return e!==null&&!Bu(e)&&e.constructor!==null&&!Bu(e.constructor)&&Ca(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const T3=ks("ArrayBuffer");function _B(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&T3(e.buffer),t}const NB=dy("string"),Ca=dy("function"),_3=dy("number"),Eh=e=>e!==null&&typeof e=="object",AB=e=>e===!0||e===!1,kp=e=>{if(uy(e)!=="object")return!1;const t=CS(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(j3 in e)&&!(cy in e)},DB=e=>{if(!Eh(e)||Ch(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},OB=ks("Date"),IB=ks("File"),MB=ks("Blob"),kB=ks("FileList"),LB=e=>Eh(e)&&Ca(e.pipe),PB=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Ca(e.append)&&((t=uy(e))==="formdata"||t==="object"&&Ca(e.toString)&&e.toString()==="[object FormData]"))},UB=ks("URLSearchParams"),[FB,zB,HB,VB]=["ReadableStream","Request","Response","Headers"].map(ks),$B=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function wh(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),ld(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{if(Ch(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 N3(e,t){if(Ch(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 Jl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,A3=e=>!Bu(e)&&e!==Jl;function O1(){const{caseless:e,skipUndefined:t}=A3(this)&&this||{},n={},r=(s,i)=>{const c=e&&N3(n,i)||i;kp(n[c])&&kp(s)?n[c]=O1(n[c],s):kp(s)?n[c]=O1({},s):ld(s)?n[c]=s.slice():(!t||!Bu(s))&&(n[c]=s)};for(let s=0,i=arguments.length;s<i;s++)arguments[s]&&wh(arguments[s],r);return n}const GB=(e,t,n,{allOwnKeys:r}={})=>(wh(t,(s,i)=>{n&&Ca(s)?e[i]=R3(s,n):e[i]=s},{allOwnKeys:r}),e),BB=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),qB=(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)},KB=(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&&CS(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},ZB=(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},YB=e=>{if(!e)return null;if(ld(e))return e;let t=e.length;if(!_3(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},WB=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&CS(Uint8Array)),QB=(e,t)=>{const r=(e&&e[cy]).call(e);let s;for(;(s=r.next())&&!s.done;){const i=s.value;t.call(e,i[0],i[1])}},XB=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},JB=ks("HTMLFormElement"),eq=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),bT=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),tq=ks("RegExp"),D3=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};wh(n,(s,i)=>{let c;(c=t(s,i,e))!==!1&&(r[i]=c||s)}),Object.defineProperties(e,r)},nq=e=>{D3(e,(t,n)=>{if(Ca(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Ca(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+"'")})}})},rq=(e,t)=>{const n={},r=s=>{s.forEach(i=>{n[i]=!0})};return ld(e)?r(e):r(String(e).split(t)),n},aq=()=>{},sq=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function oq(e){return!!(e&&Ca(e.append)&&e[j3]==="FormData"&&e[cy])}const iq=e=>{const t=new Array(10),n=(r,s)=>{if(Eh(r)){if(t.indexOf(r)>=0)return;if(Ch(r))return r;if(!("toJSON"in r)){t[s]=r;const i=ld(r)?[]:{};return wh(r,(c,u)=>{const f=n(c,s+1);!Bu(f)&&(i[u]=f)}),t[s]=void 0,i}}return r};return n(e,0)},lq=ks("AsyncFunction"),cq=e=>e&&(Eh(e)||Ca(e))&&Ca(e.then)&&Ca(e.catch),O3=((e,t)=>e?setImmediate:t?((n,r)=>(Jl.addEventListener("message",({source:s,data:i})=>{s===Jl&&i===n&&r.length&&r.shift()()},!1),s=>{r.push(s),Jl.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Ca(Jl.postMessage)),uq=typeof queueMicrotask<"u"?queueMicrotask.bind(Jl):typeof process<"u"&&process.nextTick||O3,dq=e=>e!=null&&Ca(e[cy]),fe={isArray:ld,isArrayBuffer:T3,isBuffer:Ch,isFormData:PB,isArrayBufferView:_B,isString:NB,isNumber:_3,isBoolean:AB,isObject:Eh,isPlainObject:kp,isEmptyObject:DB,isReadableStream:FB,isRequest:zB,isResponse:HB,isHeaders:VB,isUndefined:Bu,isDate:OB,isFile:IB,isBlob:MB,isRegExp:tq,isFunction:Ca,isStream:LB,isURLSearchParams:UB,isTypedArray:WB,isFileList:kB,forEach:wh,merge:O1,extend:GB,trim:$B,stripBOM:BB,inherits:qB,toFlatObject:KB,kindOf:uy,kindOfTest:ks,endsWith:ZB,toArray:YB,forEachEntry:QB,matchAll:XB,isHTMLForm:JB,hasOwnProperty:bT,hasOwnProp:bT,reduceDescriptors:D3,freezeMethods:nq,toObjectSet:rq,toCamelCase:eq,noop:aq,toFiniteNumber:sq,findKey:N3,global:Jl,isContextDefined:A3,isSpecCompliantForm:oq,toJSONObject:iq,isAsyncFn:lq,isThenable:cq,setImmediate:O3,asap:uq,isIterable:dq};function bt(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)}fe.inherits(bt,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:fe.toJSONObject(this.config),code:this.code,status:this.status}}});const I3=bt.prototype,M3={};["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=>{M3[e]={value:e}});Object.defineProperties(bt,M3);Object.defineProperty(I3,"isAxiosError",{value:!0});bt.from=(e,t,n,r,s,i)=>{const c=Object.create(I3);fe.toFlatObject(e,c,function(g){return g!==Error.prototype},m=>m!=="isAxiosError");const u=e&&e.message?e.message:"Error",f=t==null&&e?e.code:t;return bt.call(c,u,f,n,r,s),e&&c.cause==null&&Object.defineProperty(c,"cause",{value:e,configurable:!0}),c.name=e&&e.name||"Error",i&&Object.assign(c,i),c};const fq=null;function I1(e){return fe.isPlainObject(e)||fe.isArray(e)}function k3(e){return fe.endsWith(e,"[]")?e.slice(0,-2):e}function ST(e,t,n){return e?e.concat(t).map(function(s,i){return s=k3(s),!n&&i?"["+s+"]":s}).join(n?".":""):t}function hq(e){return fe.isArray(e)&&!e.some(I1)}const mq=fe.toFlatObject(fe,{},null,function(t){return/^is[A-Z]/.test(t)});function fy(e,t,n){if(!fe.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=fe.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(C,E){return!fe.isUndefined(E[C])});const r=n.metaTokens,s=n.visitor||g,i=n.dots,c=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&fe.isSpecCompliantForm(t);if(!fe.isFunction(s))throw new TypeError("visitor must be a function");function m(S){if(S===null)return"";if(fe.isDate(S))return S.toISOString();if(fe.isBoolean(S))return S.toString();if(!f&&fe.isBlob(S))throw new bt("Blob is not supported. Use a Buffer instead.");return fe.isArrayBuffer(S)||fe.isTypedArray(S)?f&&typeof Blob=="function"?new Blob([S]):Buffer.from(S):S}function g(S,C,E){let R=S;if(S&&!E&&typeof S=="object"){if(fe.endsWith(C,"{}"))C=r?C:C.slice(0,-2),S=JSON.stringify(S);else if(fe.isArray(S)&&hq(S)||(fe.isFileList(S)||fe.endsWith(C,"[]"))&&(R=fe.toArray(S)))return C=k3(C),R.forEach(function(_,A){!(fe.isUndefined(_)||_===null)&&t.append(c===!0?ST([C],A,i):c===null?C:C+"[]",m(_))}),!1}return I1(S)?!0:(t.append(ST(E,C,i),m(S)),!1)}const y=[],x=Object.assign(mq,{defaultVisitor:g,convertValue:m,isVisitable:I1});function v(S,C){if(!fe.isUndefined(S)){if(y.indexOf(S)!==-1)throw Error("Circular reference detected in "+C.join("."));y.push(S),fe.forEach(S,function(R,j){(!(fe.isUndefined(R)||R===null)&&s.call(t,R,fe.isString(j)?j.trim():j,C,x))===!0&&v(R,C?C.concat(j):[j])}),y.pop()}}if(!fe.isObject(e))throw new TypeError("data must be an object");return v(e),t}function CT(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function ES(e,t){this._pairs=[],e&&fy(e,this,t)}const L3=ES.prototype;L3.append=function(t,n){this._pairs.push([t,n])};L3.toString=function(t){const n=t?function(r){return t.call(this,r,CT)}:CT;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function pq(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function P3(e,t,n){if(!t)return e;const r=n&&n.encode||pq;fe.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let i;if(s?i=s(t,n):i=fe.isURLSearchParams(t)?t.toString():new ES(t,n).toString(r),i){const c=e.indexOf("#");c!==-1&&(e=e.slice(0,c)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class ET{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){fe.forEach(this.handlers,function(r){r!==null&&t(r)})}}const U3={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},gq=typeof URLSearchParams<"u"?URLSearchParams:ES,yq=typeof FormData<"u"?FormData:null,xq=typeof Blob<"u"?Blob:null,vq={isBrowser:!0,classes:{URLSearchParams:gq,FormData:yq,Blob:xq},protocols:["http","https","file","blob","url","data"]},wS=typeof window<"u"&&typeof document<"u",M1=typeof navigator=="object"&&navigator||void 0,bq=wS&&(!M1||["ReactNative","NativeScript","NS"].indexOf(M1.product)<0),Sq=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Cq=wS&&window.location.href||"http://localhost",Eq=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:wS,hasStandardBrowserEnv:bq,hasStandardBrowserWebWorkerEnv:Sq,navigator:M1,origin:Cq},Symbol.toStringTag,{value:"Module"})),Vr={...Eq,...vq};function wq(e,t){return fy(e,new Vr.classes.URLSearchParams,{visitor:function(n,r,s,i){return Vr.isNode&&fe.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function Rq(e){return fe.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function jq(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 F3(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&&fe.isArray(s)?s.length:c,f?(fe.hasOwnProp(s,c)?s[c]=[s[c],r]:s[c]=r,!u):((!s[c]||!fe.isObject(s[c]))&&(s[c]=[]),t(n,r,s[c],i)&&fe.isArray(s[c])&&(s[c]=jq(s[c])),!u)}if(fe.isFormData(e)&&fe.isFunction(e.entries)){const n={};return fe.forEachEntry(e,(r,s)=>{t(Rq(r),s,n,0)}),n}return null}function Tq(e,t,n){if(fe.isString(e))try{return(t||JSON.parse)(e),fe.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const Rh={transitional:U3,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,i=fe.isObject(t);if(i&&fe.isHTMLForm(t)&&(t=new FormData(t)),fe.isFormData(t))return s?JSON.stringify(F3(t)):t;if(fe.isArrayBuffer(t)||fe.isBuffer(t)||fe.isStream(t)||fe.isFile(t)||fe.isBlob(t)||fe.isReadableStream(t))return t;if(fe.isArrayBufferView(t))return t.buffer;if(fe.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 wq(t,this.formSerializer).toString();if((u=fe.isFileList(t))||r.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return fy(u?{"files[]":t}:t,f&&new f,this.formSerializer)}}return i||s?(n.setContentType("application/json",!1),Tq(t)):t}],transformResponse:[function(t){const n=this.transitional||Rh.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(fe.isResponse(t)||fe.isReadableStream(t))return t;if(t&&fe.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"?bt.from(u,bt.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:Vr.classes.FormData,Blob:Vr.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};fe.forEach(["delete","get","head","post","put","patch"],e=>{Rh.headers[e]={}});const _q=fe.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"]),Nq=e=>{const t={};let n,r,s;return e&&e.split(`
|
|
571
|
-
`).forEach(function(c){s=c.indexOf(":"),n=c.substring(0,s).trim().toLowerCase(),r=c.substring(s+1).trim(),!(!n||t[n]&&_q[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},wT=Symbol("internals");function ff(e){return e&&String(e).trim().toLowerCase()}function Lp(e){return e===!1||e==null?e:fe.isArray(e)?e.map(Lp):String(e)}function Aq(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 Dq=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function T0(e,t,n,r,s){if(fe.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!fe.isString(t)){if(fe.isString(r))return t.indexOf(r)!==-1;if(fe.isRegExp(r))return r.test(t)}}function Oq(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function Iq(e,t){const n=fe.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 Ea=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function i(u,f,m){const g=ff(f);if(!g)throw new Error("header name must be a non-empty string");const y=fe.findKey(s,g);(!y||s[y]===void 0||m===!0||m===void 0&&s[y]!==!1)&&(s[y||f]=Lp(u))}const c=(u,f)=>fe.forEach(u,(m,g)=>i(m,g,f));if(fe.isPlainObject(t)||t instanceof this.constructor)c(t,n);else if(fe.isString(t)&&(t=t.trim())&&!Dq(t))c(Nq(t),n);else if(fe.isObject(t)&&fe.isIterable(t)){let u={},f,m;for(const g of t){if(!fe.isArray(g))throw TypeError("Object iterator must return a key-value pair");u[m=g[0]]=(f=u[m])?fe.isArray(f)?[...f,g[1]]:[f,g[1]]:g[1]}c(u,n)}else t!=null&&i(n,t,r);return this}get(t,n){if(t=ff(t),t){const r=fe.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return Aq(s);if(fe.isFunction(n))return n.call(this,s,r);if(fe.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=ff(t),t){const r=fe.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||T0(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function i(c){if(c=ff(c),c){const u=fe.findKey(r,c);u&&(!n||T0(r,r[u],u,n))&&(delete r[u],s=!0)}}return fe.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||T0(this,this[i],i,t,!0))&&(delete this[i],s=!0)}return s}normalize(t){const n=this,r={};return fe.forEach(this,(s,i)=>{const c=fe.findKey(r,i);if(c){n[c]=Lp(s),delete n[i];return}const u=t?Oq(i):String(i).trim();u!==i&&delete n[i],n[u]=Lp(s),r[u]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return fe.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&fe.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(`
|
|
572
|
-
`)}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[wT]=this[wT]={accessors:{}}).accessors,s=this.prototype;function i(c){const u=ff(c);r[u]||(Iq(s,c),r[u]=!0)}return fe.isArray(t)?t.forEach(i):i(t),this}};Ea.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);fe.reduceDescriptors(Ea.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});fe.freezeMethods(Ea);function _0(e,t){const n=this||Rh,r=t||n,s=Ea.from(r.headers);let i=r.data;return fe.forEach(e,function(u){i=u.call(n,i,s.normalize(),t?t.status:void 0)}),s.normalize(),i}function z3(e){return!!(e&&e.__CANCEL__)}function cd(e,t,n){bt.call(this,e??"canceled",bt.ERR_CANCELED,t,n),this.name="CanceledError"}fe.inherits(cd,bt,{__CANCEL__:!0});function H3(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new bt("Request failed with status code "+n.status,[bt.ERR_BAD_REQUEST,bt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Mq(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function kq(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(),g=r[i];c||(c=m),n[s]=f,r[s]=m;let y=i,x=0;for(;y!==s;)x+=n[y++],y=y%e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),m-c<t)return;const v=g&&m-g;return v?Math.round(x*1e3/v):void 0}}function Lq(e,t){let n=0,r=1e3/t,s,i;const c=(m,g=Date.now())=>{n=g,s=null,i&&(clearTimeout(i),i=null),e(...m)};return[(...m)=>{const g=Date.now(),y=g-n;y>=r?c(m,g):(s=m,i||(i=setTimeout(()=>{i=null,c(s)},r-y)))},()=>s&&c(s)]}const ag=(e,t,n=3)=>{let r=0;const s=kq(50,250);return Lq(i=>{const c=i.loaded,u=i.lengthComputable?i.total:void 0,f=c-r,m=s(f),g=c<=u;r=c;const y={loaded:c,total:u,progress:u?c/u:void 0,bytes:f,rate:m||void 0,estimated:m&&u&&g?(u-c)/m:void 0,event:i,lengthComputable:u!=null,[t?"download":"upload"]:!0};e(y)},n)},RT=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},jT=e=>(...t)=>fe.asap(()=>e(...t)),Pq=Vr.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Vr.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Vr.origin),Vr.navigator&&/(msie|trident)/i.test(Vr.navigator.userAgent)):()=>!0,Uq=Vr.hasStandardBrowserEnv?{write(e,t,n,r,s,i,c){if(typeof document>"u")return;const u=[`${e}=${encodeURIComponent(t)}`];fe.isNumber(n)&&u.push(`expires=${new Date(n).toUTCString()}`),fe.isString(r)&&u.push(`path=${r}`),fe.isString(s)&&u.push(`domain=${s}`),i===!0&&u.push("secure"),fe.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 Fq(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function zq(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function V3(e,t,n){let r=!Fq(t);return e&&(r||n==!1)?zq(e,t):t}const TT=e=>e instanceof Ea?{...e}:e;function lc(e,t){t=t||{};const n={};function r(m,g,y,x){return fe.isPlainObject(m)&&fe.isPlainObject(g)?fe.merge.call({caseless:x},m,g):fe.isPlainObject(g)?fe.merge({},g):fe.isArray(g)?g.slice():g}function s(m,g,y,x){if(fe.isUndefined(g)){if(!fe.isUndefined(m))return r(void 0,m,y,x)}else return r(m,g,y,x)}function i(m,g){if(!fe.isUndefined(g))return r(void 0,g)}function c(m,g){if(fe.isUndefined(g)){if(!fe.isUndefined(m))return r(void 0,m)}else return r(void 0,g)}function u(m,g,y){if(y in t)return r(m,g);if(y 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,g,y)=>s(TT(m),TT(g),y,!0)};return fe.forEach(Object.keys({...e,...t}),function(g){const y=f[g]||s,x=y(e[g],t[g],g);fe.isUndefined(x)&&y!==u||(n[g]=x)}),n}const $3=e=>{const t=lc({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:i,headers:c,auth:u}=t;if(t.headers=c=Ea.from(c),t.url=P3(V3(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),u&&c.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):""))),fe.isFormData(n)){if(Vr.hasStandardBrowserEnv||Vr.hasStandardBrowserWebWorkerEnv)c.setContentType(void 0);else if(fe.isFunction(n.getHeaders)){const f=n.getHeaders(),m=["content-type","content-length"];Object.entries(f).forEach(([g,y])=>{m.includes(g.toLowerCase())&&c.set(g,y)})}}if(Vr.hasStandardBrowserEnv&&(r&&fe.isFunction(r)&&(r=r(t)),r||r!==!1&&Pq(t.url))){const f=s&&i&&Uq.read(i);f&&c.set(s,f)}return t},Hq=typeof XMLHttpRequest<"u",Vq=Hq&&function(e){return new Promise(function(n,r){const s=$3(e);let i=s.data;const c=Ea.from(s.headers).normalize();let{responseType:u,onUploadProgress:f,onDownloadProgress:m}=s,g,y,x,v,S;function C(){v&&v(),S&&S(),s.cancelToken&&s.cancelToken.unsubscribe(g),s.signal&&s.signal.removeEventListener("abort",g)}let E=new XMLHttpRequest;E.open(s.method.toUpperCase(),s.url,!0),E.timeout=s.timeout;function R(){if(!E)return;const _=Ea.from("getAllResponseHeaders"in E&&E.getAllResponseHeaders()),O={data:!u||u==="text"||u==="json"?E.responseText:E.response,status:E.status,statusText:E.statusText,headers:_,config:e,request:E};H3(function(T){n(T),C()},function(T){r(T),C()},O),E=null}"onloadend"in E?E.onloadend=R:E.onreadystatechange=function(){!E||E.readyState!==4||E.status===0&&!(E.responseURL&&E.responseURL.indexOf("file:")===0)||setTimeout(R)},E.onabort=function(){E&&(r(new bt("Request aborted",bt.ECONNABORTED,e,E)),E=null)},E.onerror=function(A){const O=A&&A.message?A.message:"Network Error",I=new bt(O,bt.ERR_NETWORK,e,E);I.event=A||null,r(I),E=null},E.ontimeout=function(){let A=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const O=s.transitional||U3;s.timeoutErrorMessage&&(A=s.timeoutErrorMessage),r(new bt(A,O.clarifyTimeoutError?bt.ETIMEDOUT:bt.ECONNABORTED,e,E)),E=null},i===void 0&&c.setContentType(null),"setRequestHeader"in E&&fe.forEach(c.toJSON(),function(A,O){E.setRequestHeader(O,A)}),fe.isUndefined(s.withCredentials)||(E.withCredentials=!!s.withCredentials),u&&u!=="json"&&(E.responseType=s.responseType),m&&([x,S]=ag(m,!0),E.addEventListener("progress",x)),f&&E.upload&&([y,v]=ag(f),E.upload.addEventListener("progress",y),E.upload.addEventListener("loadend",v)),(s.cancelToken||s.signal)&&(g=_=>{E&&(r(!_||_.type?new cd(null,e,E):_),E.abort(),E=null)},s.cancelToken&&s.cancelToken.subscribe(g),s.signal&&(s.signal.aborted?g():s.signal.addEventListener("abort",g)));const j=Mq(s.url);if(j&&Vr.protocols.indexOf(j)===-1){r(new bt("Unsupported protocol "+j+":",bt.ERR_BAD_REQUEST,e));return}E.send(i||null)})},$q=(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 g=m instanceof Error?m:this.reason;r.abort(g instanceof bt?g:new cd(g instanceof Error?g.message:g))}};let c=t&&setTimeout(()=>{c=null,i(new bt(`timeout ${t} of ms exceeded`,bt.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=()=>fe.asap(u),f}},Gq=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},Bq=async function*(e,t){for await(const n of qq(e))yield*Gq(n,t)},qq=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=Bq(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:g}=await s.next();if(m){u(),f.close();return}let y=g.byteLength;if(n){let x=i+=y;n(x)}f.enqueue(new Uint8Array(g))}catch(m){throw u(m),m}},cancel(f){return u(f),s.return()}},{highWaterMark:2})},NT=64*1024,{isFunction:up}=fe,Kq=(({Request:e,Response:t})=>({Request:e,Response:t}))(fe.global),{ReadableStream:AT,TextEncoder:DT}=fe.global,OT=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Zq=e=>{e=fe.merge.call({skipUndefined:!0},Kq,e);const{fetch:t,Request:n,Response:r}=e,s=t?up(t):typeof fetch=="function",i=up(n),c=up(r);if(!s)return!1;const u=s&&up(AT),f=s&&(typeof DT=="function"?(S=>C=>S.encode(C))(new DT):async S=>new Uint8Array(await new n(S).arrayBuffer())),m=i&&u&&OT(()=>{let S=!1;const C=new n(Vr.origin,{body:new AT,method:"POST",get duplex(){return S=!0,"half"}}).headers.has("Content-Type");return S&&!C}),g=c&&u&&OT(()=>fe.isReadableStream(new r("").body)),y={stream:g&&(S=>S.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(S=>{!y[S]&&(y[S]=(C,E)=>{let R=C&&C[S];if(R)return R.call(C);throw new bt(`Response type '${S}' is not supported`,bt.ERR_NOT_SUPPORT,E)})});const x=async S=>{if(S==null)return 0;if(fe.isBlob(S))return S.size;if(fe.isSpecCompliantForm(S))return(await new n(Vr.origin,{method:"POST",body:S}).arrayBuffer()).byteLength;if(fe.isArrayBufferView(S)||fe.isArrayBuffer(S))return S.byteLength;if(fe.isURLSearchParams(S)&&(S=S+""),fe.isString(S))return(await f(S)).byteLength},v=async(S,C)=>{const E=fe.toFiniteNumber(S.getContentLength());return E??x(C)};return async S=>{let{url:C,method:E,data:R,signal:j,cancelToken:_,timeout:A,onDownloadProgress:O,onUploadProgress:I,responseType:T,headers:D,withCredentials:L="same-origin",fetchOptions:H}=$3(S),B=t||fetch;T=T?(T+"").toLowerCase():"text";let q=$q([j,_&&_.toAbortSignal()],A),Z=null;const F=q&&q.unsubscribe&&(()=>{q.unsubscribe()});let z;try{if(I&&m&&E!=="get"&&E!=="head"&&(z=await v(D,R))!==0){let P=new n(C,{method:"POST",body:R,duplex:"half"}),U;if(fe.isFormData(R)&&(U=P.headers.get("content-type"))&&D.setContentType(U),P.body){const[$,Q]=RT(z,ag(jT(I)));R=_T(P.body,NT,$,Q)}}fe.isString(L)||(L=L?"include":"omit");const M=i&&"credentials"in n.prototype,V={...H,signal:q,method:E.toUpperCase(),headers:D.normalize().toJSON(),body:R,duplex:"half",credentials:M?L:void 0};Z=i&&new n(C,V);let K=await(i?B(Z,H):B(C,V));const se=g&&(T==="stream"||T==="response");if(g&&(O||se&&F)){const P={};["status","statusText","headers"].forEach(ne=>{P[ne]=K[ne]});const U=fe.toFiniteNumber(K.headers.get("content-length")),[$,Q]=O&&RT(U,ag(jT(O),!0))||[];K=new r(_T(K.body,NT,$,()=>{Q&&Q(),F&&F()}),P)}T=T||"text";let ve=await y[fe.findKey(y,T)||"text"](K,S);return!se&&F&&F(),await new Promise((P,U)=>{H3(P,U,{data:ve,headers:Ea.from(K.headers),status:K.status,statusText:K.statusText,config:S,request:Z})})}catch(M){throw F&&F(),M&&M.name==="TypeError"&&/Load failed|fetch/i.test(M.message)?Object.assign(new bt("Network Error",bt.ERR_NETWORK,S,Z),{cause:M.cause||M}):bt.from(M,M&&M.code,S,Z)}}},Yq=new Map,G3=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,g=Yq;for(;u--;)f=i[u],m=g.get(f),m===void 0&&g.set(f,m=u?new Map:Zq(t)),g=m;return m};G3();const RS={http:fq,xhr:Vq,fetch:{get:G3}};fe.forEach(RS,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const IT=e=>`- ${e}`,Wq=e=>fe.isFunction(e)||e===null||e===!1;function Qq(e,t){e=fe.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,!Wq(r)&&(s=RS[(u=String(r)).toLowerCase()],s===void 0))throw new bt(`Unknown adapter '${u}'`);if(s&&(fe.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 :
|
|
573
|
-
`+c.map(IT).join(`
|
|
574
|
-
`):" "+IT(c[0]):"as no adapter specified";throw new bt("There is no suitable adapter to dispatch the request "+u,"ERR_NOT_SUPPORT")}return s}const B3={getAdapter:Qq,adapters:RS};function N0(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new cd(null,e)}function MT(e){return N0(e),e.headers=Ea.from(e.headers),e.data=_0.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),B3.getAdapter(e.adapter||Rh.adapter,e)(e).then(function(r){return N0(e),r.data=_0.call(e,e.transformResponse,r),r.headers=Ea.from(r.headers),r},function(r){return z3(r)||(N0(e),r&&r.response&&(r.response.data=_0.call(e,e.transformResponse,r.response),r.response.headers=Ea.from(r.response.headers))),Promise.reject(r)})}const q3="1.13.2",hy={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{hy[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const kT={};hy.transitional=function(t,n,r){function s(i,c){return"[Axios v"+q3+"] Transitional option '"+i+"'"+c+(r?". "+r:"")}return(i,c,u)=>{if(t===!1)throw new bt(s(c," has been removed"+(n?" in "+n:"")),bt.ERR_DEPRECATED);return n&&!kT[c]&&(kT[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}};hy.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function Xq(e,t,n){if(typeof e!="object")throw new bt("options must be an object",bt.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 bt("option "+i+" must be "+f,bt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new bt("Unknown option "+i,bt.ERR_BAD_OPTION)}}const Pp={assertOptions:Xq,validators:hy},qs=Pp.validators;let nc=class{constructor(t){this.defaults=t||{},this.interceptors={request:new ET,response:new ET}}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+=`
|
|
575
|
-
`+i):r.stack=i}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=lc(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:i}=n;r!==void 0&&Pp.assertOptions(r,{silentJSONParsing:qs.transitional(qs.boolean),forcedJSONParsing:qs.transitional(qs.boolean),clarifyTimeoutError:qs.transitional(qs.boolean)},!1),s!=null&&(fe.isFunction(s)?n.paramsSerializer={serialize:s}:Pp.assertOptions(s,{encode:qs.function,serialize:qs.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Pp.assertOptions(n,{baseUrl:qs.spelling("baseURL"),withXsrfToken:qs.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let c=i&&fe.merge(i.common,i[n.method]);i&&fe.forEach(["delete","get","head","post","put","patch","common"],S=>{delete i[S]}),n.headers=Ea.concat(c,i);const u=[];let f=!0;this.interceptors.request.forEach(function(C){typeof C.runWhen=="function"&&C.runWhen(n)===!1||(f=f&&C.synchronous,u.unshift(C.fulfilled,C.rejected))});const m=[];this.interceptors.response.forEach(function(C){m.push(C.fulfilled,C.rejected)});let g,y=0,x;if(!f){const S=[MT.bind(this),void 0];for(S.unshift(...u),S.push(...m),x=S.length,g=Promise.resolve(n);y<x;)g=g.then(S[y++],S[y++]);return g}x=u.length;let v=n;for(;y<x;){const S=u[y++],C=u[y++];try{v=S(v)}catch(E){C.call(this,E);break}}try{g=MT.call(this,v)}catch(S){return Promise.reject(S)}for(y=0,x=m.length;y<x;)g=g.then(m[y++],m[y++]);return g}getUri(t){t=lc(this.defaults,t);const n=V3(t.baseURL,t.url,t.allowAbsoluteUrls);return P3(n,t.params,t.paramsSerializer)}};fe.forEach(["delete","get","head","options"],function(t){nc.prototype[t]=function(n,r){return this.request(lc(r||{},{method:t,url:n,data:(r||{}).data}))}});fe.forEach(["post","put","patch"],function(t){function n(r){return function(i,c,u){return this.request(lc(u||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:c}))}}nc.prototype[t]=n(),nc.prototype[t+"Form"]=n(!0)});let Jq=class K3{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 cd(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 K3(function(s){t=s}),cancel:t}}};function eK(e){return function(n){return e.apply(null,n)}}function tK(e){return fe.isObject(e)&&e.isAxiosError===!0}const k1={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(k1).forEach(([e,t])=>{k1[t]=e});function Z3(e){const t=new nc(e),n=R3(nc.prototype.request,t);return fe.extend(n,nc.prototype,t,{allOwnKeys:!0}),fe.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return Z3(lc(e,s))},n}const Kn=Z3(Rh);Kn.Axios=nc;Kn.CanceledError=cd;Kn.CancelToken=Jq;Kn.isCancel=z3;Kn.VERSION=q3;Kn.toFormData=fy;Kn.AxiosError=bt;Kn.Cancel=Kn.CanceledError;Kn.all=function(t){return Promise.all(t)};Kn.spread=eK;Kn.isAxiosError=tK;Kn.mergeConfig=lc;Kn.AxiosHeaders=Ea;Kn.formToJSON=e=>F3(fe.isHTMLForm(e)?new FormData(e):e);Kn.getAdapter=B3.getAdapter;Kn.HttpStatusCode=k1;Kn.default=Kn;const{Axios:Zfe,AxiosError:LT,CanceledError:Yfe,isCancel:Wfe,CancelToken:Qfe,VERSION:Xfe,all:Jfe,Cancel:ehe,isAxiosError:the,spread:nhe,toFormData:rhe,AxiosHeaders:nK,HttpStatusCode:ahe,formToJSON:she,getAdapter:ohe,mergeConfig:ihe}=Kn;function rK(e){return{id:e.userId,email:e.email,fullName:e.fullName,roles:e.roles,projectId:e.projectId,projectTitle:e.projectTitle,avatar:e.avatar}}const qu={SIGN_IN:"/auth/sign-in",SIGN_OUT:"/auth/sign-out",ACCESS_TOKEN:"/auth/access-token",API_USER:"/auth/api/user",API_PROJECTS:"/auth/api/projects"};function aK(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 jS=Kn.create({baseURL:"/",timeout:3e4,headers:{"Content-Type":"application/json",Accept:"application/json"},withCredentials:!0});function sK(){const e=window.location.pathname+window.location.search,t=new URL(qu.SIGN_IN,window.location.origin);e.startsWith("/auth/")||t.searchParams.set("redirect",e),window.location.href=t.toString()}function oK(){const e=new URL(qu.SIGN_OUT,window.location.origin);e.searchParams.set("redirect",qu.SIGN_IN),window.location.href=e.toString()}async function iK(){try{return(await jS.post(qu.ACCESS_TOKEN,{})).data}catch(e){const t=aK(e);throw new Error(t.message)}}async function lK(e){const t=await jS.get(qu.API_USER,{headers:{"X-OWOX-Authorization":`Bearer ${e}`}});return rK(t.data)}async function cK(e){return(await jS.get(qu.API_PROJECTS,{headers:{"X-OWOX-Authorization":`Bearer ${e}`}})).data}const Y3=h.createContext(null);class uK{constructor(t,n){Bs(this,"getToken");Bs(this,"refreshFn");this.getToken=t,this.refreshFn=n}getAccessToken(){return this.getToken()}async refreshToken(){return await this.refreshFn()}}let TS=null;function dK(e){TS=e}function _S(){return TS}function dp(){TS=null}const fK=()=>{typeof window<"u"&&!window.dataLayer&&(window.dataLayer=[])},Ie=e=>{e.timestamp=e.timestamp??Date.now(),e.eventType=e.eventType??"app",W3(e)},hK=e=>{Ie({event:"system_user_identified",eventType:"system",category:"UserSession",action:"Identified",...e})},mK=()=>{Ie({event:"system_user_logged_out",eventType:"system",category:"UserSession",action:"Logout"})},W3=e=>{var t;if(typeof window<"u"){fK();try{(t=window.dataLayer)==null||t.push(e)}catch(n){console.error("Failed to push data to dataLayer",n)}}};function pK(e,t){switch(t.type){case"SET_LOADING":return{...e,status:$r.LOADING,error:void 0};case"SET_AUTHENTICATED":return{...e,status:$r.AUTHENTICATED,session:t.payload.session,error:void 0};case"SET_UNAUTHENTICATED":return{...e,status:$r.UNAUTHENTICATED,session:null,error:void 0};case"SET_USER":return{...e,user:t.payload.user};case"SET_ERROR":return{...e,status:$r.ERROR,error:t.payload};case"CLEAR_ERROR":return{...e,error:void 0};default:return e}}const gK={status:$r.LOADING,session:null,user:null};function yK({children:e}){var g;const[t,n]=h.useReducer(pK,gK);h.useEffect(()=>{var y;if((y=t.session)!=null&&y.accessToken){const x=new uK(()=>{var v;return((v=t.session)==null?void 0:v.accessToken)??null},async()=>await s());dK(x)}else dp()},[(g=t.session)==null?void 0:g.accessToken]);const r=h.useCallback(()=>{sK()},[]);async function s(){try{const x=(await iK()).accessToken;if(!x)throw new Error("Invalid token received");const v={accessToken:x},S=await lK(x);return n({type:"SET_USER",payload:{user:S}}),n({type:"SET_AUTHENTICATED",payload:{session:v}}),x}catch(y){throw dp(),n({type:"SET_UNAUTHENTICATED"}),y}}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(y){console.error("Failed to initialize auth:",y),dp(),n({type:"SET_UNAUTHENTICATED"})}},[i,r]),u=h.useCallback(()=>{try{mK()}finally{oK()}},[]),f=h.useCallback(()=>{n({type:"CLEAR_ERROR"})},[]);h.useEffect(()=>{c()},[c]),h.useEffect(()=>{t.user&&(W3({projectId:t.user.projectId}),hK({userId:t.user.id,userEmail:t.user.email,userFullName:t.user.fullName}))},[t.user]),h.useEffect(()=>{const y=()=>{u()};return window.addEventListener("auth:logout",y),()=>{window.removeEventListener("auth:logout",y),dp()}},[u]);const m={...t,signIn:r,signOut:u,refreshToken:i,clearError:f};return a.jsx(Y3.Provider,{value:m,children:e})}function oi(){const e=h.useContext(Y3);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e}function Q3(){const{status:e,session:t,user:n,error:r}=oi();return{status:e,session:t,user:n,error:r,isLoading:e===$r.LOADING,isAuthenticated:e===$r.AUTHENTICATED,isUnauthenticated:e===$r.UNAUTHENTICATED,hasError:e===$r.ERROR}}function xK(){const{user:e}=oi();return e}function Iu({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 PT({message:e}){return a.jsx(Iu,{fullScreen:!0,message:e})}function UT(){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(Ce,{onClick:()=>window.location.href="/api/auth/sign-in",children:"Sign In"})]})})}function vK({children:e,fallback:t,redirectTo:n}){const{isLoading:r,isAuthenticated:s,isUnauthenticated:i}=Q3();return r?a.jsx(PT,{}):s?a.jsx(a.Fragment,{children:e}):i?n?(window.location.href=n,a.jsx(PT,{})):t?a.jsx(a.Fragment,{children:t}):a.jsx(UT,{}):t?a.jsx(a.Fragment,{children:t}):a.jsx(UT,{})}const X3=h.createContext(null);function J3(){const e=h.useContext(X3);if(!e)throw new Error("useProjects must be used within a ProjectsProvider");return e}const bK="/ui",SK=()=>bK,sg=(e,t)=>{const n=SK(),r=t.startsWith("/")?t:`/${t}`;return`${n}/${e}${r}`};function CK(){const{projects:e,loadProjects:t,error:n,isLoading:r}=J3(),{user:s}=oi();return a.jsxs(vS,{children:[a.jsx(wa,{}),a.jsxs(bS,{className:"flex items-center gap-2",children:[a.jsx(_7,{className:"h-4 w-4"}),"Switch project"]}),a.jsx(CB,{children:a.jsxs(SS,{children:[r&&a.jsx(Ot,{disabled:!0,children:a.jsxs("span",{className:"flex items-center gap-2",children:[a.jsx(ed,{className:"h-4 w-4 animate-spin"})," Loading projects..."]})}),!r&&n&&a.jsxs(a.Fragment,{children:[a.jsx(Ot,{disabled:!0,children:"Unable to load projects. Please try again."}),a.jsx(Ot,{onClick:()=>void t(),children:"Retry"})]}),!r&&!n&&e.map(i=>{const c=i.id===(s==null?void 0:s.projectId);return a.jsx(Ot,{asChild:!0,children:a.jsxs(oh,{to:sg(encodeURIComponent(i.id),"/"),className:"flex items-center gap-2",children:[c?a.jsx(ra,{className:"h-4 w-4"}):a.jsx("span",{className:"h-4 w-4"}),i.title]})},i.id)})]})})]})}function EK(){return a.jsx(CK,{})}const wK=({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"})}),eD=({className:e,size:t=24})=>a.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,style:{minWidth:t,minHeight:t},children:[a.jsx("path",{d:"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"})]}),tD=({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"})]}),RK=({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"})]}),jK=({className:e,size:t=24})=>a.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,style:{minWidth:t,minHeight:t},children:[a.jsx("path",{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"})]}),TK=({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"})]}),nD=({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"})]}),_K=({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"})}),NK=({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"})]}),AK=({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"})]})]})]}),Ec=({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}}),DK=({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"})]}),OK=({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"})]}),IK=({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"})]}),MK=({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"})]}),kK=({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"})]}),LK=({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"})]}),PK=({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"})]}),UK=({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"})]}),FK=({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)"})})]})]}),zK=({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"})]}),HK=({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 po({className:e,...t}){return a.jsx("textarea",{"data-slot":"textarea",className:re("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 rD({value:e,onChange:t,keysToMask:n=[],className:r,minHeightClass:s="min-h-[150px]",displayOnly:i=!1,showCopyButton:c=!1}){const u=(E,R)=>{if(!E||R.length===0)return!1;try{const j=JSON.parse(E),_=A=>typeof A!="object"||A===null?!1:Array.isArray(A)?A.some(O=>typeof O=="object"&&O!==null&&_(O)):Object.keys(A).some(O=>R.includes(O)||typeof A[O]=="object"&&A[O]!==null&&_(A[O]));return _(j)}catch{return!1}},f=i?!1:!e||n.length===0||!u(e,n),[m,g]=h.useState(f),[y,x]=h.useState(!1);h.useEffect(()=>{i?g(!1):(!e||n.length===0||!u(e,n))&&g(!0)},[e,n,i]),h.useEffect(()=>{if(y){const E=setTimeout(()=>{x(!1)},2e3);return()=>{clearTimeout(E)}}},[y]);const v=()=>{navigator.clipboard.writeText(e),x(!0)},S=E=>{if(!E)return"";try{const R=JSON.parse(E),j=O=>{if(typeof O!="object"||O===null)return O;const I=Array.isArray(O)?[...O]:{...O};return Array.isArray(I)?I.forEach((T,D)=>{typeof T=="object"&&T!==null&&(I[D]=j(T))}):Object.entries(I).forEach(([T,D])=>{if(n.includes(T))if(typeof D=="string"){const L=D.length;L>30?I[T]="*".repeat(Math.min(20,Math.ceil(L/3))):L>10?I[T]="*".repeat(Math.min(10,Math.ceil(L/2))):I[T]="*".repeat(L)}else I[T]="***";else typeof D=="object"&&D!==null&&(I[T]=j(D))}),I},A=j(typeof R=="object"?R:{});return JSON.stringify(A,null,2)}catch{return E}},C=e&&n.length>0&&u(e,n);return a.jsxs("div",{className:"relative",children:[!m&&C&&!i&&a.jsx(os,{children:a.jsxs(Nt,{children:[a.jsx(At,{asChild:!0,children:a.jsx("div",{className:"absolute top-2 left-2 z-10",children:a.jsx(YP,{className:"h-4 w-4 text-gray-500"})})}),a.jsx(Dt,{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:S(e)}):a.jsx(po,{value:m?e:S(e),onChange:E=>{(m||!C)&&t&&t(E.target.value)},onFocus:E=>{!m&&C&&E.target.blur()},readOnly:!!(!m&&C),className:`font-mono ${r??""} ${!m&&C?"cursor-not-allowed opacity-70":""} ${s}`,rows:8}),C&&!i&&a.jsx(Ce,{type:"button",variant:"ghost",className:"absolute top-2 right-2",onClick:()=>{g(!m)},children:m?a.jsx(os,{children:a.jsxs(Nt,{children:[a.jsx(At,{asChild:!0,children:a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(pP,{className:"h-4 w-4"}),a.jsx("span",{className:"text-xs",children:"Mask & Lock"})]})}),a.jsx(Dt,{children:a.jsx("p",{children:"Mask sensitive data and lock editing"})})]})}):a.jsx(os,{children:a.jsxs(Nt,{children:[a.jsx(At,{asChild:!0,children:a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(nA,{className:"h-4 w-4"}),a.jsx("span",{className:"text-xs",children:"Show & Edit"})]})}),a.jsx(Dt,{children:a.jsx("p",{children:"Show sensitive data and enable editing"})})]})})}),c&&a.jsx(Ce,{type:"button",variant:"ghost",className:`absolute ${C&&!i?"top-2 right-24":"top-2 right-2"}`,onClick:v,children:a.jsx(os,{children:a.jsxs(Nt,{children:[a.jsx(At,{asChild:!0,children:a.jsx("div",{className:"flex items-center gap-1",children:y?a.jsxs(a.Fragment,{children:[a.jsx(ra,{className:"h-4 w-4"}),a.jsx("span",{className:"text-xs",children:"Copied!"})]}):a.jsxs(a.Fragment,{children:[a.jsx(Hf,{className:"h-4 w-4"}),a.jsx("span",{className:"text-xs",children:"Copy"})]})})}),a.jsx(Dt,{children:a.jsx("p",{children:"Copy content to clipboard"})})]})})})]})}var Yt;(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})(Yt||(Yt={}));var FT;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(FT||(FT={}));const Ge=Yt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Vi=e=>{switch(typeof e){case"undefined":return Ge.undefined;case"string":return Ge.string;case"number":return Number.isNaN(e)?Ge.nan:Ge.number;case"boolean":return Ge.boolean;case"function":return Ge.function;case"bigint":return Ge.bigint;case"symbol":return Ge.symbol;case"object":return Array.isArray(e)?Ge.array:e===null?Ge.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Ge.promise:typeof Map<"u"&&e instanceof Map?Ge.map:typeof Set<"u"&&e instanceof Set?Ge.set:typeof Date<"u"&&e instanceof Date?Ge.date:Ge.object;default:return Ge.unknown}},je=Yt.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 Jo 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 Jo))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Yt.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()}}Jo.create=e=>new Jo(e);const L1=(e,t)=>{let n;switch(e.code){case je.invalid_type:e.received===Ge.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case je.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Yt.jsonStringifyReplacer)}`;break;case je.unrecognized_keys:n=`Unrecognized key(s) in object: ${Yt.joinValues(e.keys,", ")}`;break;case je.invalid_union:n="Invalid input";break;case je.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Yt.joinValues(e.options)}`;break;case je.invalid_enum_value:n=`Invalid enum value. Expected ${Yt.joinValues(e.options)}, received '${e.received}'`;break;case je.invalid_arguments:n="Invalid function arguments";break;case je.invalid_return_type:n="Invalid function return type";break;case je.invalid_date:n="Invalid date";break;case je.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}"`:Yt.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case je.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 je.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 je.custom:n="Invalid input";break;case je.invalid_intersection_types:n="Intersection results could not be merged";break;case je.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case je.not_finite:n="Number must be finite";break;default:n=t.defaultError,Yt.assertNever(e)}return{message:n}};let VK=L1;function $K(){return VK}const GK=e=>{const{data:t,path:n,errorMaps:r,issueData:s}=e,i=[...n,...s.path||[]],c={...s,path:i};if(s.message!==void 0)return{...s,path:i,message:s.message};let u="";const f=r.filter(m=>!!m).slice().reverse();for(const m of f)u=m(c,{data:t,defaultError:u}).message;return{...s,path:i,message:u}};function Ue(e,t){const n=$K(),r=GK({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===L1?void 0:L1].filter(s=>!!s)});e.common.issues.push(r)}class sa{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 ct;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 sa.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 ct;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 ct=Object.freeze({status:"aborted"}),wf=e=>({status:"dirty",value:e}),ds=e=>({status:"valid",value:e}),zT=e=>e.status==="aborted",HT=e=>e.status==="dirty",Ku=e=>e.status==="valid",og=e=>typeof Promise<"u"&&e instanceof Promise;var Qe;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Qe||(Qe={}));class lo{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 VT=(e,t)=>{if(Ku(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 Jo(e.common.issues);return this._error=n,this._error}}};function wt(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 Ht{get description(){return this._def.description}_getType(t){return Vi(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Vi(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new sa,ctx:{common:t.parent.common,data:t.data,parsedType:Vi(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(og(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:Vi(t)},s=this._parseSync({data:t,path:r.path,parent:r});return VT(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:Vi(t)};if(!this["~standard"].async)try{const i=this._parseSync({data:t,path:[],parent:n});return Ku(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=>Ku(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:Vi(t)},s=this._parse({data:t,path:r.path,parent:r}),i=await(og(s)?s:Promise.resolve(s));return VT(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:je.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 dc({schema:this,typeName:dt.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return qo.create(this,this._def)}nullable(){return fc.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return to.create(this)}promise(){return mg.create(this,this._def)}or(t){return cg.create([this,t],this._def)}and(t){return ug.create(this,t,this._def)}transform(t){return new dc({...wt(this._def),schema:this,typeName:dt.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new pg({...wt(this._def),innerType:this,defaultValue:n,typeName:dt.ZodDefault})}brand(){return new iD({typeName:dt.ZodBranded,type:this,...wt(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new gg({...wt(this._def),innerType:this,catchValue:n,typeName:dt.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return AS.create(this,t)}readonly(){return yg.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const BK=/^c[^\s-]{8,}$/i,qK=/^[0-9a-z]+$/,KK=/^[0-9A-HJKMNP-TV-Z]{26}$/i,ZK=/^[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,YK=/^[a-z0-9_-]{21}$/i,WK=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,QK=/^[-+]?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)?)??$/,XK=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,JK="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let A0;const eZ=/^(?:(?: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])$/,tZ=/^(?:(?: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])$/,nZ=/^(([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]))$/,rZ=/^(([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])$/,aZ=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,sZ=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,aD="((\\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])))",oZ=new RegExp(`^${aD}$`);function sD(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 iZ(e){return new RegExp(`^${sD(e)}$`)}function lZ(e){let t=`${aD}T${sD(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 cZ(e,t){return!!((t==="v4"||!t)&&eZ.test(e)||(t==="v6"||!t)&&nZ.test(e))}function uZ(e,t){if(!WK.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 dZ(e,t){return!!((t==="v4"||!t)&&tZ.test(e)||(t==="v6"||!t)&&rZ.test(e))}class Bo extends Ht{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Ge.string){const i=this._getOrReturnCtx(t);return Ue(i,{code:je.invalid_type,expected:Ge.string,received:i.parsedType}),ct}const r=new sa;let s;for(const i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(s=this._getOrReturnCtx(t,s),Ue(s,{code:je.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")t.data.length>i.value&&(s=this._getOrReturnCtx(t,s),Ue(s,{code:je.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){const c=t.data.length>i.value,u=t.data.length<i.value;(c||u)&&(s=this._getOrReturnCtx(t,s),c?Ue(s,{code:je.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):u&&Ue(s,{code:je.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")XK.test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"email",code:je.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")A0||(A0=new RegExp(JK,"u")),A0.test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"emoji",code:je.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")ZK.test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"uuid",code:je.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")YK.test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"nanoid",code:je.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")BK.test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"cuid",code:je.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")qK.test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"cuid2",code:je.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")KK.test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"ulid",code:je.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{s=this._getOrReturnCtx(t,s),Ue(s,{validation:"url",code:je.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"regex",code:je.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(s=this._getOrReturnCtx(t,s),Ue(s,{code:je.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(s=this._getOrReturnCtx(t,s),Ue(s,{code:je.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(s=this._getOrReturnCtx(t,s),Ue(s,{code:je.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?lZ(i).test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{code:je.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?oZ.test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{code:je.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?iZ(i).test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{code:je.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?QK.test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"duration",code:je.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?cZ(t.data,i.version)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"ip",code:je.invalid_string,message:i.message}),r.dirty()):i.kind==="jwt"?uZ(t.data,i.alg)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"jwt",code:je.invalid_string,message:i.message}),r.dirty()):i.kind==="cidr"?dZ(t.data,i.version)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"cidr",code:je.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?aZ.test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"base64",code:je.invalid_string,message:i.message}),r.dirty()):i.kind==="base64url"?sZ.test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"base64url",code:je.invalid_string,message:i.message}),r.dirty()):Yt.assertNever(i);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(s=>t.test(s),{validation:n,code:je.invalid_string,...Qe.errToObj(r)})}_addCheck(t){return new Bo({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Qe.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Qe.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Qe.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Qe.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Qe.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Qe.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Qe.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Qe.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Qe.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...Qe.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...Qe.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Qe.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...Qe.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...Qe.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...Qe.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...Qe.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Qe.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...Qe.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Qe.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Qe.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Qe.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Qe.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Qe.errToObj(n)})}nonempty(t){return this.min(1,Qe.errToObj(t))}trim(){return new Bo({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Bo({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Bo({...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}}Bo.create=e=>new Bo({checks:[],typeName:dt.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...wt(e)});function fZ(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,s=n>r?n:r,i=Number.parseInt(e.toFixed(s).replace(".","")),c=Number.parseInt(t.toFixed(s).replace(".",""));return i%c/10**s}class Zu extends Ht{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Ge.number){const i=this._getOrReturnCtx(t);return Ue(i,{code:je.invalid_type,expected:Ge.number,received:i.parsedType}),ct}let r;const s=new sa;for(const i of this._def.checks)i.kind==="int"?Yt.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),Ue(r,{code:je.invalid_type,expected:"integer",received:"float",message:i.message}),s.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(r=this._getOrReturnCtx(t,r),Ue(r,{code:je.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),Ue(r,{code:je.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?fZ(t.data,i.value)!==0&&(r=this._getOrReturnCtx(t,r),Ue(r,{code:je.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),Ue(r,{code:je.not_finite,message:i.message}),s.dirty()):Yt.assertNever(i);return{status:s.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Qe.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Qe.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Qe.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Qe.toString(n))}setLimit(t,n,r,s){return new Zu({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Qe.toString(s)}]})}_addCheck(t){return new Zu({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Qe.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Qe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Qe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Qe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Qe.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Qe.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Qe.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Qe.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Qe.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Yt.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)}}Zu.create=e=>new Zu({checks:[],typeName:dt.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...wt(e)});class Zf extends Ht{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==Ge.bigint)return this._getInvalidInput(t);let r;const s=new sa;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(r=this._getOrReturnCtx(t,r),Ue(r,{code:je.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),Ue(r,{code:je.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),Ue(r,{code:je.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):Yt.assertNever(i);return{status:s.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return Ue(n,{code:je.invalid_type,expected:Ge.bigint,received:n.parsedType}),ct}gte(t,n){return this.setLimit("min",t,!0,Qe.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Qe.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Qe.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Qe.toString(n))}setLimit(t,n,r,s){return new Zf({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Qe.toString(s)}]})}_addCheck(t){return new Zf({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Qe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Qe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Qe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Qe.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Qe.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Zf.create=e=>new Zf({checks:[],typeName:dt.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...wt(e)});class P1 extends Ht{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Ge.boolean){const r=this._getOrReturnCtx(t);return Ue(r,{code:je.invalid_type,expected:Ge.boolean,received:r.parsedType}),ct}return ds(t.data)}}P1.create=e=>new P1({typeName:dt.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...wt(e)});class ig extends Ht{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Ge.date){const i=this._getOrReturnCtx(t);return Ue(i,{code:je.invalid_type,expected:Ge.date,received:i.parsedType}),ct}if(Number.isNaN(t.data.getTime())){const i=this._getOrReturnCtx(t);return Ue(i,{code:je.invalid_date}),ct}const r=new sa;let s;for(const i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(s=this._getOrReturnCtx(t,s),Ue(s,{code:je.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(s=this._getOrReturnCtx(t,s),Ue(s,{code:je.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):Yt.assertNever(i);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new ig({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Qe.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Qe.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}ig.create=e=>new ig({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:dt.ZodDate,...wt(e)});class $T extends Ht{_parse(t){if(this._getType(t)!==Ge.symbol){const r=this._getOrReturnCtx(t);return Ue(r,{code:je.invalid_type,expected:Ge.symbol,received:r.parsedType}),ct}return ds(t.data)}}$T.create=e=>new $T({typeName:dt.ZodSymbol,...wt(e)});class U1 extends Ht{_parse(t){if(this._getType(t)!==Ge.undefined){const r=this._getOrReturnCtx(t);return Ue(r,{code:je.invalid_type,expected:Ge.undefined,received:r.parsedType}),ct}return ds(t.data)}}U1.create=e=>new U1({typeName:dt.ZodUndefined,...wt(e)});class lg extends Ht{_parse(t){if(this._getType(t)!==Ge.null){const r=this._getOrReturnCtx(t);return Ue(r,{code:je.invalid_type,expected:Ge.null,received:r.parsedType}),ct}return ds(t.data)}}lg.create=e=>new lg({typeName:dt.ZodNull,...wt(e)});class GT extends Ht{constructor(){super(...arguments),this._any=!0}_parse(t){return ds(t.data)}}GT.create=e=>new GT({typeName:dt.ZodAny,...wt(e)});class F1 extends Ht{constructor(){super(...arguments),this._unknown=!0}_parse(t){return ds(t.data)}}F1.create=e=>new F1({typeName:dt.ZodUnknown,...wt(e)});class cl extends Ht{_parse(t){const n=this._getOrReturnCtx(t);return Ue(n,{code:je.invalid_type,expected:Ge.never,received:n.parsedType}),ct}}cl.create=e=>new cl({typeName:dt.ZodNever,...wt(e)});class BT extends Ht{_parse(t){if(this._getType(t)!==Ge.undefined){const r=this._getOrReturnCtx(t);return Ue(r,{code:je.invalid_type,expected:Ge.void,received:r.parsedType}),ct}return ds(t.data)}}BT.create=e=>new BT({typeName:dt.ZodVoid,...wt(e)});class to extends Ht{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),s=this._def;if(n.parsedType!==Ge.array)return Ue(n,{code:je.invalid_type,expected:Ge.array,received:n.parsedType}),ct;if(s.exactLength!==null){const c=n.data.length>s.exactLength.value,u=n.data.length<s.exactLength.value;(c||u)&&(Ue(n,{code:c?je.too_big:je.too_small,minimum:u?s.exactLength.value:void 0,maximum:c?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),r.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(Ue(n,{code:je.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),r.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(Ue(n,{code:je.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 lo(n,c,n.path,u)))).then(c=>sa.mergeArray(r,c));const i=[...n.data].map((c,u)=>s.type._parseSync(new lo(n,c,n.path,u)));return sa.mergeArray(r,i)}get element(){return this._def.type}min(t,n){return new to({...this._def,minLength:{value:t,message:Qe.toString(n)}})}max(t,n){return new to({...this._def,maxLength:{value:t,message:Qe.toString(n)}})}length(t,n){return new to({...this._def,exactLength:{value:t,message:Qe.toString(n)}})}nonempty(t){return this.min(1,t)}}to.create=(e,t)=>new to({type:e,minLength:null,maxLength:null,exactLength:null,typeName:dt.ZodArray,...wt(t)});function vu(e){if(e instanceof ir){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=qo.create(vu(r))}return new ir({...e._def,shape:()=>t})}else return e instanceof to?new to({...e._def,type:vu(e.element)}):e instanceof qo?qo.create(vu(e.unwrap())):e instanceof fc?fc.create(vu(e.unwrap())):e instanceof cc?cc.create(e.items.map(t=>vu(t))):e}class ir extends Ht{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=Yt.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==Ge.object){const m=this._getOrReturnCtx(t);return Ue(m,{code:je.invalid_type,expected:Ge.object,received:m.parsedType}),ct}const{status:r,ctx:s}=this._processInputParams(t),{shape:i,keys:c}=this._getCached(),u=[];if(!(this._def.catchall instanceof cl&&this._def.unknownKeys==="strip"))for(const m in s.data)c.includes(m)||u.push(m);const f=[];for(const m of c){const g=i[m],y=s.data[m];f.push({key:{status:"valid",value:m},value:g._parse(new lo(s,y,s.path,m)),alwaysSet:m in s.data})}if(this._def.catchall instanceof cl){const m=this._def.unknownKeys;if(m==="passthrough")for(const g of u)f.push({key:{status:"valid",value:g},value:{status:"valid",value:s.data[g]}});else if(m==="strict")u.length>0&&(Ue(s,{code:je.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 g of u){const y=s.data[g];f.push({key:{status:"valid",value:g},value:m._parse(new lo(s,y,s.path,g)),alwaysSet:g in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const m=[];for(const g of f){const y=await g.key,x=await g.value;m.push({key:y,value:x,alwaysSet:g.alwaysSet})}return m}).then(m=>sa.mergeObjectSync(r,m)):sa.mergeObjectSync(r,f)}get shape(){return this._def.shape()}strict(t){return Qe.errToObj,new ir({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var i,c;const s=((c=(i=this._def).errorMap)==null?void 0:c.call(i,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:Qe.errToObj(t).message??s}:{message:s}}}:{}})}strip(){return new ir({...this._def,unknownKeys:"strip"})}passthrough(){return new ir({...this._def,unknownKeys:"passthrough"})}extend(t){return new ir({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new ir({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:dt.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new ir({...this._def,catchall:t})}pick(t){const n={};for(const r of Yt.objectKeys(t))t[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new ir({...this._def,shape:()=>n})}omit(t){const n={};for(const r of Yt.objectKeys(this.shape))t[r]||(n[r]=this.shape[r]);return new ir({...this._def,shape:()=>n})}deepPartial(){return vu(this)}partial(t){const n={};for(const r of Yt.objectKeys(this.shape)){const s=this.shape[r];t&&!t[r]?n[r]=s:n[r]=s.optional()}return new ir({...this._def,shape:()=>n})}required(t){const n={};for(const r of Yt.objectKeys(this.shape))if(t&&!t[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof qo;)i=i._def.innerType;n[r]=i}return new ir({...this._def,shape:()=>n})}keyof(){return oD(Yt.objectKeys(this.shape))}}ir.create=(e,t)=>new ir({shape:()=>e,unknownKeys:"strip",catchall:cl.create(),typeName:dt.ZodObject,...wt(t)});ir.strictCreate=(e,t)=>new ir({shape:()=>e,unknownKeys:"strict",catchall:cl.create(),typeName:dt.ZodObject,...wt(t)});ir.lazycreate=(e,t)=>new ir({shape:e,unknownKeys:"strip",catchall:cl.create(),typeName:dt.ZodObject,...wt(t)});class cg extends Ht{_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 Jo(u.ctx.common.issues));return Ue(n,{code:je.invalid_union,unionErrors:c}),ct}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},g=f._parseSync({data:n.data,path:n.path,parent:m});if(g.status==="valid")return g;g.status==="dirty"&&!i&&(i={result:g,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 Jo(f));return Ue(n,{code:je.invalid_union,unionErrors:u}),ct}}get options(){return this._def.options}}cg.create=(e,t)=>new cg({options:e,typeName:dt.ZodUnion,...wt(t)});const Fo=e=>e instanceof H1?Fo(e.schema):e instanceof dc?Fo(e.innerType()):e instanceof fg?[e.value]:e instanceof uc?e.options:e instanceof hg?Yt.objectValues(e.enum):e instanceof pg?Fo(e._def.innerType):e instanceof U1?[void 0]:e instanceof lg?[null]:e instanceof qo?[void 0,...Fo(e.unwrap())]:e instanceof fc?[null,...Fo(e.unwrap())]:e instanceof iD||e instanceof yg?Fo(e.unwrap()):e instanceof gg?Fo(e._def.innerType):[];class NS extends Ht{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Ge.object)return Ue(n,{code:je.invalid_type,expected:Ge.object,received:n.parsedType}),ct;const r=this.discriminator,s=n.data[r],i=this.optionsMap.get(s);return i?n.common.async?i._parseAsync({data:n.data,path:n.path,parent:n}):i._parseSync({data:n.data,path:n.path,parent:n}):(Ue(n,{code:je.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),ct)}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=Fo(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 NS({typeName:dt.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:s,...wt(r)})}}function z1(e,t){const n=Vi(e),r=Vi(t);if(e===t)return{valid:!0,data:e};if(n===Ge.object&&r===Ge.object){const s=Yt.objectKeys(t),i=Yt.objectKeys(e).filter(u=>s.indexOf(u)!==-1),c={...e,...t};for(const u of i){const f=z1(e[u],t[u]);if(!f.valid)return{valid:!1};c[u]=f.data}return{valid:!0,data:c}}else if(n===Ge.array&&r===Ge.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let i=0;i<e.length;i++){const c=e[i],u=t[i],f=z1(c,u);if(!f.valid)return{valid:!1};s.push(f.data)}return{valid:!0,data:s}}else return n===Ge.date&&r===Ge.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class ug extends Ht{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),s=(i,c)=>{if(zT(i)||zT(c))return ct;const u=z1(i.value,c.value);return u.valid?((HT(i)||HT(c))&&n.dirty(),{status:n.value,value:u.data}):(Ue(r,{code:je.invalid_intersection_types}),ct)};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}))}}ug.create=(e,t,n)=>new ug({left:e,right:t,typeName:dt.ZodIntersection,...wt(n)});class cc extends Ht{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Ge.array)return Ue(r,{code:je.invalid_type,expected:Ge.array,received:r.parsedType}),ct;if(r.data.length<this._def.items.length)return Ue(r,{code:je.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ct;!this._def.rest&&r.data.length>this._def.items.length&&(Ue(r,{code:je.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 lo(r,c,r.path,u)):null}).filter(c=>!!c);return r.common.async?Promise.all(i).then(c=>sa.mergeArray(n,c)):sa.mergeArray(n,i)}get items(){return this._def.items}rest(t){return new cc({...this._def,rest:t})}}cc.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new cc({items:e,typeName:dt.ZodTuple,rest:null,...wt(t)})};class dg extends Ht{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Ge.object)return Ue(r,{code:je.invalid_type,expected:Ge.object,received:r.parsedType}),ct;const s=[],i=this._def.keyType,c=this._def.valueType;for(const u in r.data)s.push({key:i._parse(new lo(r,u,r.path,u)),value:c._parse(new lo(r,r.data[u],r.path,u)),alwaysSet:u in r.data});return r.common.async?sa.mergeObjectAsync(n,s):sa.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Ht?new dg({keyType:t,valueType:n,typeName:dt.ZodRecord,...wt(r)}):new dg({keyType:Bo.create(),valueType:t,typeName:dt.ZodRecord,...wt(n)})}}class qT extends Ht{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Ge.map)return Ue(r,{code:je.invalid_type,expected:Ge.map,received:r.parsedType}),ct;const s=this._def.keyType,i=this._def.valueType,c=[...r.data.entries()].map(([u,f],m)=>({key:s._parse(new lo(r,u,r.path,[m,"key"])),value:i._parse(new lo(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,g=await f.value;if(m.status==="aborted"||g.status==="aborted")return ct;(m.status==="dirty"||g.status==="dirty")&&n.dirty(),u.set(m.value,g.value)}return{status:n.value,value:u}})}else{const u=new Map;for(const f of c){const m=f.key,g=f.value;if(m.status==="aborted"||g.status==="aborted")return ct;(m.status==="dirty"||g.status==="dirty")&&n.dirty(),u.set(m.value,g.value)}return{status:n.value,value:u}}}}qT.create=(e,t,n)=>new qT({valueType:t,keyType:e,typeName:dt.ZodMap,...wt(n)});class Yf extends Ht{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Ge.set)return Ue(r,{code:je.invalid_type,expected:Ge.set,received:r.parsedType}),ct;const s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(Ue(r,{code:je.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&r.data.size>s.maxSize.value&&(Ue(r,{code:je.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 g of f){if(g.status==="aborted")return ct;g.status==="dirty"&&n.dirty(),m.add(g.value)}return{status:n.value,value:m}}const u=[...r.data.values()].map((f,m)=>i._parse(new lo(r,f,r.path,m)));return r.common.async?Promise.all(u).then(f=>c(f)):c(u)}min(t,n){return new Yf({...this._def,minSize:{value:t,message:Qe.toString(n)}})}max(t,n){return new Yf({...this._def,maxSize:{value:t,message:Qe.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}Yf.create=(e,t)=>new Yf({valueType:e,minSize:null,maxSize:null,typeName:dt.ZodSet,...wt(t)});class H1 extends Ht{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})}}H1.create=(e,t)=>new H1({getter:e,typeName:dt.ZodLazy,...wt(t)});class fg extends Ht{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return Ue(n,{received:n.data,code:je.invalid_literal,expected:this._def.value}),ct}return{status:"valid",value:t.data}}get value(){return this._def.value}}fg.create=(e,t)=>new fg({value:e,typeName:dt.ZodLiteral,...wt(t)});function oD(e,t){return new uc({values:e,typeName:dt.ZodEnum,...wt(t)})}class uc extends Ht{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return Ue(n,{expected:Yt.joinValues(r),received:n.parsedType,code:je.invalid_type}),ct}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return Ue(n,{received:n.data,code:je.invalid_enum_value,options:r}),ct}return ds(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 uc.create(t,{...this._def,...n})}exclude(t,n=this._def){return uc.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}uc.create=oD;class hg extends Ht{_parse(t){const n=Yt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==Ge.string&&r.parsedType!==Ge.number){const s=Yt.objectValues(n);return Ue(r,{expected:Yt.joinValues(s),received:r.parsedType,code:je.invalid_type}),ct}if(this._cache||(this._cache=new Set(Yt.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const s=Yt.objectValues(n);return Ue(r,{received:r.data,code:je.invalid_enum_value,options:s}),ct}return ds(t.data)}get enum(){return this._def.values}}hg.create=(e,t)=>new hg({values:e,typeName:dt.ZodNativeEnum,...wt(t)});class mg extends Ht{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Ge.promise&&n.common.async===!1)return Ue(n,{code:je.invalid_type,expected:Ge.promise,received:n.parsedType}),ct;const r=n.parsedType===Ge.promise?n.data:Promise.resolve(n.data);return ds(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}mg.create=(e,t)=>new mg({type:e,typeName:dt.ZodPromise,...wt(t)});class dc extends Ht{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===dt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),s=this._def.effect||null,i={addIssue:c=>{Ue(r,c),c.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),s.type==="preprocess"){const c=s.transform(r.data,i);if(r.common.async)return Promise.resolve(c).then(async u=>{if(n.value==="aborted")return ct;const f=await this._def.schema._parseAsync({data:u,path:r.path,parent:r});return f.status==="aborted"?ct:f.status==="dirty"||n.value==="dirty"?wf(f.value):f});{if(n.value==="aborted")return ct;const u=this._def.schema._parseSync({data:c,path:r.path,parent:r});return u.status==="aborted"?ct:u.status==="dirty"||n.value==="dirty"?wf(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"?ct:(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"?ct:(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(!Ku(c))return ct;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=>Ku(c)?Promise.resolve(s.transform(c.value,i)).then(u=>({status:n.value,value:u})):ct);Yt.assertNever(s)}}dc.create=(e,t,n)=>new dc({schema:e,typeName:dt.ZodEffects,effect:t,...wt(n)});dc.createWithPreprocess=(e,t,n)=>new dc({schema:t,effect:{type:"preprocess",transform:e},typeName:dt.ZodEffects,...wt(n)});class qo extends Ht{_parse(t){return this._getType(t)===Ge.undefined?ds(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}qo.create=(e,t)=>new qo({innerType:e,typeName:dt.ZodOptional,...wt(t)});class fc extends Ht{_parse(t){return this._getType(t)===Ge.null?ds(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}fc.create=(e,t)=>new fc({innerType:e,typeName:dt.ZodNullable,...wt(t)});class pg extends Ht{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===Ge.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}pg.create=(e,t)=>new pg({innerType:e,typeName:dt.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...wt(t)});class gg extends Ht{_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 og(s)?s.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Jo(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Jo(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}gg.create=(e,t)=>new gg({innerType:e,typeName:dt.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...wt(t)});class KT extends Ht{_parse(t){if(this._getType(t)!==Ge.nan){const r=this._getOrReturnCtx(t);return Ue(r,{code:je.invalid_type,expected:Ge.nan,received:r.parsedType}),ct}return{status:"valid",value:t.data}}}KT.create=e=>new KT({typeName:dt.ZodNaN,...wt(e)});class iD extends Ht{_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 AS extends Ht{_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"?ct:i.status==="dirty"?(n.dirty(),wf(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"?ct: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 AS({in:t,out:n,typeName:dt.ZodPipeline})}}class yg extends Ht{_parse(t){const n=this._def.innerType._parse(t),r=s=>(Ku(s)&&(s.value=Object.freeze(s.value)),s);return og(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}}yg.create=(e,t)=>new yg({innerType:e,typeName:dt.ZodReadonly,...wt(t)});var dt;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(dt||(dt={}));const Rt=Bo.create,hZ=Zu.create,mZ=P1.create,pZ=lg.create,gZ=F1.create;cl.create;const V1=to.create,Wt=ir.create,yZ=cg.create,DS=NS.create;ug.create;cc.create;const xZ=dg.create,Fr=fg.create;uc.create;const my=hg.create;mg.create;qo.create;const vZ=fc.create,D0=ct,lD=Wt({serviceAccount:Rt().min(1,"Service Account Key is required").transform((e,t)=>{try{const n=JSON.parse(e);return typeof n!="object"?(t.addIssue({code:je.custom,message:"Service Account must be a valid JSON object"}),D0):n.client_email?e:(t.addIssue({code:je.custom,message:"Service Account must contain a client_email field"}),D0)}catch(n){return console.error(n),t.addIssue({code:je.custom,message:"Service Account must be a valid JSON string"}),D0}})}),bZ=[{type:"menu-item",title:"GitHub Community",href:"https://github.com/OWOX/owox-data-marts",icon:wK,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:Fj,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:oA,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:Fj,visible:{flagKey:"IDP_PROVIDER",expectedValue:"owox"},group:"project"},{type:"menu-item",title:"Subscription",href:"https://platform.owox.com/ui/p/none/settings/subscription",icon:H7,visible:{flagKey:"IDP_PROVIDER",expectedValue:"owox"},group:"project"},{type:"menu-item",title:"Members",href:"https://platform.owox.com/ui/p/none/settings/members",icon:zj,visible:{flagKey:"IDP_PROVIDER",expectedValue:"owox"},group:"project"},{type:"menu-item",title:"Members",href:"/auth",icon:zj,visible:{flagKey:"IDP_PROVIDER",expectedValue:"better-auth"},group:"project"},{type:"menu-item",title:"Documentation",href:"https://docs.owox.com/?utm_source=community_edition&utm_medium=organic&utm_campaign=documentation&utm_content=header_dropdown",icon:Br,visible:{flagKey:"MENU_DOCUMENTATION_COMMUNITY_EDITION_VISIBLE",expectedValue:"true"},group:"feedback"},{type:"menu-item",title:"Documentation",href:"https://docs.owox.com/?utm_source=app_owox_com&utm_medium=organic&utm_campaign=documentation&utm_content=header_dropdown",icon:Br,visible:{flagKey:"MENU_DOCUMENTATION_OWOX_CLOUD_VISIBLE",expectedValue:"true"},group:"feedback"},{type:"menu-item",title:"Leave Feedback",href:"https://github.com/OWOX/owox-data-marts/discussions",icon:rU,visible:{flagKey:"MENU_FEEDBACK_VISIBLE",expectedValue:"true"},group:"feedback"},{type:"menu-item",title:"Issues",href:"https://github.com/OWOX/owox-data-marts/issues",icon:M7,visible:{flagKey:"MENU_ISSUES_VISIBLE",expectedValue:"true"},group:"feedback"},{type:"menu-item",title:"Slack Community",href:"https://join.slack.com/t/owox-data-marts/shared_invite/zt-3fffrsau9-UlobJVlXzRLpXmvs0ffvoQ",icon:IK,visible:{flagKey:"MENU_SLACK_COMMUNITY_VISIBLE",expectedValue:"true"},group:"feedback"},{type:"menu-item",title:"License",href:"https://github.com/OWOX/owox-data-marts#License-1-ov-file",icon:RU,visible:{flagKey:"MENU_LICENSE_VISIBLE",expectedValue:"true"},group:"legal"},{type:"menu-item",title:"OWOX BI",href:"https://bi.owox.com/",icon:DK,visible:{flagKey:"MENU_OWOX_BI_VISIBLE",expectedValue:"true"},group:"external"}];function ZT(e,t,n){if(!n||typeof n!="object")return!1;const r=n[e];return t===void 0?!!r:r===t}function SZ(){const{flags:e}=Sh(),{loadProjects:t,projects:n}=J3(),{id:r}=w3(),s=ZT("IDP_PROVIDER","owox",e);h.useEffect(()=>{s&&t()},[t,s]);const i=n.length>1;return{visibleMenuItems:h.useMemo(()=>{const f=bZ.filter(x=>typeof x.visible=="boolean"?x.visible:ZT(x.visible.flagKey,x.visible.expectedValue,e)).map(x=>{if(x.group==="project"&&x.href&&r)try{const v=x.href.replace("/p/none/",`/p/${r}/`);return{...x,href:v}}catch{return x}return x}),m=new Map;f.forEach(x=>{const v=x.group||"default";m.has(v)||m.set(v,[]);const S=m.get(v);S&&S.push(x)});const g=[],y=Array.from(m.entries()).filter(([,x])=>x.length>0);return y.forEach(([,x],v)=>{g.push(...x),v<y.length-1&&g.push({type:"separator",visible:!0})}),g},[e,r]),canSwitchProject:i}}function CZ(){const{visibleMenuItems:e,canSwitchProject:t}=SZ();return a.jsxs(Ur,{align:"start",sideOffset:8,className:"w-56",children:[e.map((n,r)=>{if(n.type==="separator")return a.jsx(wa,{},`separator-${String(r)}`);const s=n.icon;return a.jsx(Ot,{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(EK,{},"switch-project")]})}var vt=(e=>(e.IDLE="idle",e.LOADING="loading",e.LOADED="loaded",e.ERROR="error",e))(vt||{});let EZ={data:""},wZ=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||EZ},RZ=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,jZ=/\/\*[^]*?\*\/| +/g,YT=/\n+/g,qi=(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"?qi(c,i):i+"{"+qi(c,i[1]=="k"?"":t)+"}":typeof c=="object"?r+=qi(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+=qi.p?qi.p(i,c):i+":"+c+";")}return n+(t&&s?t+"{"+s+"}":s)+r},Lo={},cD=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+cD(e[n]);return t}return e},TZ=(e,t,n,r,s)=>{let i=cD(e),c=Lo[i]||(Lo[i]=(f=>{let m=0,g=11;for(;m<f.length;)g=101*g+f.charCodeAt(m++)>>>0;return"go"+g})(i));if(!Lo[c]){let f=i!==e?e:(m=>{let g,y,x=[{}];for(;g=RZ.exec(m.replace(jZ,""));)g[4]?x.shift():g[3]?(y=g[3].replace(YT," ").trim(),x.unshift(x[0][y]=x[0][y]||{})):x[0][g[1]]=g[2].replace(YT," ").trim();return x[0]})(e);Lo[c]=qi(s?{["@keyframes "+c]:f}:f,n?"":"."+c)}let u=n&&Lo.g?Lo.g:null;return n&&(Lo.g=Lo[c]),((f,m,g,y)=>{y?m.data=m.data.replace(y,f):m.data.indexOf(f)===-1&&(m.data=g?f+m.data:m.data+f)})(Lo[c],t,r,u),c},_Z=(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?"":qi(u,""):u===!1?"":u}return r+s+(c??"")},"");function py(e){let t=this||{},n=e.call?e(t.p):e;return TZ(n.unshift?n.raw?_Z(n,[].slice.call(arguments,1),t.p):n.reduce((r,s)=>Object.assign(r,s&&s.call?s(t.p):s),{}):n,wZ(t.target),t.g,t.o,t.k)}let uD,$1,G1;py.bind({g:1});let ei=py.bind({k:1});function NZ(e,t,n,r){qi.p=t,uD=e,$1=n,G1=r}function pl(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:$1&&$1()},u),n.o=/ *go\d+/.test(f),u.className=py.apply(n,r)+(f?" "+f:"");let m=e;return e[0]&&(m=u.as||e,delete u.as),G1&&m[0]&&G1(u),uD(m,u)}return s}}var AZ=e=>typeof e=="function",xg=(e,t)=>AZ(e)?e(t):e,DZ=(()=>{let e=0;return()=>(++e).toString()})(),dD=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),OZ=20,OS="default",fD=(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 fD(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}))}}},Up=[],hD={toasts:[],pausedAt:void 0,settings:{toastLimit:OZ}},Qs={},mD=(e,t=OS)=>{Qs[t]=fD(Qs[t]||hD,e),Up.forEach(([n,r])=>{n===t&&r(Qs[t])})},pD=e=>Object.keys(Qs).forEach(t=>mD(e,t)),IZ=e=>Object.keys(Qs).find(t=>Qs[t].toasts.some(n=>n.id===e)),gy=(e=OS)=>t=>{mD(t,e)},MZ={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},kZ=(e={},t=OS)=>{let[n,r]=h.useState(Qs[t]||hD),s=h.useRef(Qs[t]);h.useEffect(()=>(s.current!==Qs[t]&&r(Qs[t]),Up.push([t,r]),()=>{let c=Up.findIndex(([u])=>u===t);c>-1&&Up.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)||MZ[c.type],style:{...e.style,...(m=e[c.type])==null?void 0:m.style,...c.style}}});return{...n,toasts:i}},LZ=(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)||DZ()}),jh=e=>(t,n)=>{let r=LZ(t,e,n);return gy(r.toasterId||IZ(r.id))({type:2,toast:r}),r.id},Sn=(e,t)=>jh("blank")(e,t);Sn.error=jh("error");Sn.success=jh("success");Sn.loading=jh("loading");Sn.custom=jh("custom");Sn.dismiss=(e,t)=>{let n={type:3,toastId:e};t?gy(t)(n):pD(n)};Sn.dismissAll=e=>Sn.dismiss(void 0,e);Sn.remove=(e,t)=>{let n={type:4,toastId:e};t?gy(t)(n):pD(n)};Sn.removeAll=e=>Sn.remove(void 0,e);Sn.promise=(e,t,n)=>{let r=Sn.loading(t.loading,{...n,...n==null?void 0:n.loading});return typeof e=="function"&&(e=e()),e.then(s=>{let i=t.success?xg(t.success,s):void 0;return i?Sn.success(i,{id:r,...n,...n==null?void 0:n.success}):Sn.dismiss(r),s}).catch(s=>{let i=t.error?xg(t.error,s):void 0;i?Sn.error(i,{id:r,...n,...n==null?void 0:n.error}):Sn.dismiss(r)}),e};var PZ=1e3,UZ=(e,t="default")=>{let{toasts:n,pausedAt:r}=kZ(e,t),s=h.useRef(new Map).current,i=h.useCallback((y,x=PZ)=>{if(s.has(y))return;let v=setTimeout(()=>{s.delete(y),c({type:4,toastId:y})},x);s.set(y,v)},[]);h.useEffect(()=>{if(r)return;let y=Date.now(),x=n.map(v=>{if(v.duration===1/0)return;let S=(v.duration||0)+v.pauseDuration-(y-v.createdAt);if(S<0){v.visible&&Sn.dismiss(v.id);return}return setTimeout(()=>Sn.dismiss(v.id,t),S)});return()=>{x.forEach(v=>v&&clearTimeout(v))}},[n,r,t]);let c=h.useCallback(gy(t),[t]),u=h.useCallback(()=>{c({type:5,time:Date.now()})},[c]),f=h.useCallback((y,x)=>{c({type:1,toast:{id:y,height:x}})},[c]),m=h.useCallback(()=>{r&&c({type:6,time:Date.now()})},[r,c]),g=h.useCallback((y,x)=>{let{reverseOrder:v=!1,gutter:S=8,defaultPosition:C}=x||{},E=n.filter(_=>(_.position||C)===(y.position||C)&&_.height),R=E.findIndex(_=>_.id===y.id),j=E.filter((_,A)=>A<R&&_.visible).length;return E.filter(_=>_.visible).slice(...v?[j+1]:[0,j]).reduce((_,A)=>_+(A.height||0)+S,0)},[n]);return h.useEffect(()=>{n.forEach(y=>{if(y.dismissed)i(y.id,y.removeDelay);else{let x=s.get(y.id);x&&(clearTimeout(x),s.delete(y.id))}})},[n,i]),{toasts:n,handlers:{updateHeight:f,startPause:u,endPause:m,calculateOffset:g}}},FZ=ei`
|
|
576
|
-
from {
|
|
577
|
-
transform: scale(0) rotate(45deg);
|
|
578
|
-
opacity: 0;
|
|
579
|
-
}
|
|
580
|
-
to {
|
|
581
|
-
transform: scale(1) rotate(45deg);
|
|
582
|
-
opacity: 1;
|
|
583
|
-
}`,zZ=ei`
|
|
584
|
-
from {
|
|
585
|
-
transform: scale(0);
|
|
586
|
-
opacity: 0;
|
|
587
|
-
}
|
|
588
|
-
to {
|
|
589
|
-
transform: scale(1);
|
|
590
|
-
opacity: 1;
|
|
591
|
-
}`,HZ=ei`
|
|
592
|
-
from {
|
|
593
|
-
transform: scale(0) rotate(90deg);
|
|
594
|
-
opacity: 0;
|
|
595
|
-
}
|
|
596
|
-
to {
|
|
597
|
-
transform: scale(1) rotate(90deg);
|
|
598
|
-
opacity: 1;
|
|
599
|
-
}`,VZ=pl("div")`
|
|
600
|
-
width: 20px;
|
|
601
|
-
opacity: 0;
|
|
602
|
-
height: 20px;
|
|
603
|
-
border-radius: 10px;
|
|
604
|
-
background: ${e=>e.primary||"#ff4b4b"};
|
|
605
|
-
position: relative;
|
|
606
|
-
transform: rotate(45deg);
|
|
607
|
-
|
|
608
|
-
animation: ${FZ} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
609
|
-
forwards;
|
|
610
|
-
animation-delay: 100ms;
|
|
611
|
-
|
|
612
|
-
&:after,
|
|
613
|
-
&:before {
|
|
614
|
-
content: '';
|
|
615
|
-
animation: ${zZ} 0.15s ease-out forwards;
|
|
616
|
-
animation-delay: 150ms;
|
|
617
|
-
position: absolute;
|
|
618
|
-
border-radius: 3px;
|
|
619
|
-
opacity: 0;
|
|
620
|
-
background: ${e=>e.secondary||"#fff"};
|
|
621
|
-
bottom: 9px;
|
|
622
|
-
left: 4px;
|
|
623
|
-
height: 2px;
|
|
624
|
-
width: 12px;
|
|
625
|
-
}
|
|
626
|
-
|
|
627
|
-
&:before {
|
|
628
|
-
animation: ${HZ} 0.15s ease-out forwards;
|
|
629
|
-
animation-delay: 180ms;
|
|
630
|
-
transform: rotate(90deg);
|
|
631
|
-
}
|
|
632
|
-
`,$Z=ei`
|
|
633
|
-
from {
|
|
634
|
-
transform: rotate(0deg);
|
|
635
|
-
}
|
|
636
|
-
to {
|
|
637
|
-
transform: rotate(360deg);
|
|
638
|
-
}
|
|
639
|
-
`,GZ=pl("div")`
|
|
640
|
-
width: 12px;
|
|
641
|
-
height: 12px;
|
|
642
|
-
box-sizing: border-box;
|
|
643
|
-
border: 2px solid;
|
|
644
|
-
border-radius: 100%;
|
|
645
|
-
border-color: ${e=>e.secondary||"#e0e0e0"};
|
|
646
|
-
border-right-color: ${e=>e.primary||"#616161"};
|
|
647
|
-
animation: ${$Z} 1s linear infinite;
|
|
648
|
-
`,BZ=ei`
|
|
649
|
-
from {
|
|
650
|
-
transform: scale(0) rotate(45deg);
|
|
651
|
-
opacity: 0;
|
|
652
|
-
}
|
|
653
|
-
to {
|
|
654
|
-
transform: scale(1) rotate(45deg);
|
|
655
|
-
opacity: 1;
|
|
656
|
-
}`,qZ=ei`
|
|
657
|
-
0% {
|
|
658
|
-
height: 0;
|
|
659
|
-
width: 0;
|
|
660
|
-
opacity: 0;
|
|
661
|
-
}
|
|
662
|
-
40% {
|
|
663
|
-
height: 0;
|
|
664
|
-
width: 6px;
|
|
665
|
-
opacity: 1;
|
|
666
|
-
}
|
|
667
|
-
100% {
|
|
668
|
-
opacity: 1;
|
|
669
|
-
height: 10px;
|
|
670
|
-
}`,KZ=pl("div")`
|
|
671
|
-
width: 20px;
|
|
672
|
-
opacity: 0;
|
|
673
|
-
height: 20px;
|
|
674
|
-
border-radius: 10px;
|
|
675
|
-
background: ${e=>e.primary||"#61d345"};
|
|
676
|
-
position: relative;
|
|
677
|
-
transform: rotate(45deg);
|
|
678
|
-
|
|
679
|
-
animation: ${BZ} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
680
|
-
forwards;
|
|
681
|
-
animation-delay: 100ms;
|
|
682
|
-
&:after {
|
|
683
|
-
content: '';
|
|
684
|
-
box-sizing: border-box;
|
|
685
|
-
animation: ${qZ} 0.2s ease-out forwards;
|
|
686
|
-
opacity: 0;
|
|
687
|
-
animation-delay: 200ms;
|
|
688
|
-
position: absolute;
|
|
689
|
-
border-right: 2px solid;
|
|
690
|
-
border-bottom: 2px solid;
|
|
691
|
-
border-color: ${e=>e.secondary||"#fff"};
|
|
692
|
-
bottom: 6px;
|
|
693
|
-
left: 6px;
|
|
694
|
-
height: 10px;
|
|
695
|
-
width: 6px;
|
|
696
|
-
}
|
|
697
|
-
`,ZZ=pl("div")`
|
|
698
|
-
position: absolute;
|
|
699
|
-
`,YZ=pl("div")`
|
|
700
|
-
position: relative;
|
|
701
|
-
display: flex;
|
|
702
|
-
justify-content: center;
|
|
703
|
-
align-items: center;
|
|
704
|
-
min-width: 20px;
|
|
705
|
-
min-height: 20px;
|
|
706
|
-
`,WZ=ei`
|
|
707
|
-
from {
|
|
708
|
-
transform: scale(0.6);
|
|
709
|
-
opacity: 0.4;
|
|
710
|
-
}
|
|
711
|
-
to {
|
|
712
|
-
transform: scale(1);
|
|
713
|
-
opacity: 1;
|
|
714
|
-
}`,QZ=pl("div")`
|
|
715
|
-
position: relative;
|
|
716
|
-
transform: scale(0.6);
|
|
717
|
-
opacity: 0.4;
|
|
718
|
-
min-width: 20px;
|
|
719
|
-
animation: ${WZ} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
720
|
-
forwards;
|
|
721
|
-
`,XZ=({toast:e})=>{let{icon:t,type:n,iconTheme:r}=e;return t!==void 0?typeof t=="string"?h.createElement(QZ,null,t):t:n==="blank"?null:h.createElement(YZ,null,h.createElement(GZ,{...r}),n!=="loading"&&h.createElement(ZZ,null,n==="error"?h.createElement(VZ,{...r}):h.createElement(KZ,{...r})))},JZ=e=>`
|
|
722
|
-
0% {transform: translate3d(0,${e*-200}%,0) scale(.6); opacity:.5;}
|
|
723
|
-
100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
|
|
724
|
-
`,eY=e=>`
|
|
725
|
-
0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
|
|
726
|
-
100% {transform: translate3d(0,${e*-150}%,-1px) scale(.6); opacity:0;}
|
|
727
|
-
`,tY="0%{opacity:0;} 100%{opacity:1;}",nY="0%{opacity:1;} 100%{opacity:0;}",rY=pl("div")`
|
|
728
|
-
display: flex;
|
|
729
|
-
align-items: center;
|
|
730
|
-
background: #fff;
|
|
731
|
-
color: #363636;
|
|
732
|
-
line-height: 1.3;
|
|
733
|
-
will-change: transform;
|
|
734
|
-
box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05);
|
|
735
|
-
max-width: 350px;
|
|
736
|
-
pointer-events: auto;
|
|
737
|
-
padding: 8px 10px;
|
|
738
|
-
border-radius: 8px;
|
|
739
|
-
`,aY=pl("div")`
|
|
740
|
-
display: flex;
|
|
741
|
-
justify-content: center;
|
|
742
|
-
margin: 4px 10px;
|
|
743
|
-
color: inherit;
|
|
744
|
-
flex: 1 1 auto;
|
|
745
|
-
white-space: pre-line;
|
|
746
|
-
`,sY=(e,t)=>{let n=e.includes("top")?1:-1,[r,s]=dD()?[tY,nY]:[JZ(n),eY(n)];return{animation:t?`${ei(r)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${ei(s)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},oY=h.memo(({toast:e,position:t,style:n,children:r})=>{let s=e.height?sY(e.position||t||"top-center",e.visible):{opacity:0},i=h.createElement(XZ,{toast:e}),c=h.createElement(aY,{...e.ariaProps},xg(e.message,e));return h.createElement(rY,{className:e.className,style:{...s,...n,...e.style}},typeof r=="function"?r({icon:i,message:c}):h.createElement(h.Fragment,null,i,c))});NZ(h.createElement);var iY=({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)},lY=(e,t)=>{let n=e.includes("top"),r=n?{top:0}:{bottom:0},s=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:dD()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...r,...s}},cY=py`
|
|
747
|
-
z-index: 9999;
|
|
748
|
-
> * {
|
|
749
|
-
pointer-events: auto;
|
|
750
|
-
}
|
|
751
|
-
`,fp=16,uY=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:s,toasterId:i,containerStyle:c,containerClassName:u})=>{let{toasts:f,handlers:m}=UZ(n,i);return h.createElement("div",{"data-rht-toaster":i||"",style:{position:"fixed",zIndex:9999,top:fp,left:fp,right:fp,bottom:fp,pointerEvents:"none",...c},className:u,onMouseEnter:m.startPause,onMouseLeave:m.endPause},f.map(g=>{let y=g.position||t,x=m.calculateOffset(g,{reverseOrder:e,gutter:r,defaultPosition:t}),v=lY(y,x);return h.createElement(iY,{id:g.id,key:g.id,onHeightUpdate:m.updateHeight,className:g.visible?cY:"",style:v},g.type==="custom"?xg(g.message,g):s?s(g):h.createElement(oY,{toast:g,position:y}))}))},Mt=Sn;const en=e=>{var n;return(n=e.response)==null?void 0:n.data};function WT(e,t="Something went wrong"){var s,i;const n=en(e);let r=n.message.trim()||t;(i=(s=n.errorDetails)==null?void 0:s.error)!=null&&i.trim()&&(r=`${r}. ${n.errorDetails.error}`),Mt.error(r)}function gD(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 dY{constructor(){Bs(this,"isRefreshingToken",!1);Bs(this,"refreshTokenPromise",null);Bs(this,"accessToken",null)}getAccessToken(){return this.accessToken}setAccessToken(t){this.accessToken=t}isRefreshing(){return this.isRefreshingToken}async refreshToken(t){if(this.isRefreshingToken&&this.refreshTokenPromise)return await this.refreshTokenPromise;this.isRefreshingToken=!0,this.refreshTokenPromise=this.performRefresh(t);try{const n=await this.refreshTokenPromise;return this.setAccessToken(n),n}finally{this.isRefreshingToken=!1,this.refreshTokenPromise=null}}clear(){this.accessToken=null,this.isRefreshingToken=!1,this.refreshTokenPromise=null}async performRefresh(t){try{return await t()}catch(n){throw this.clear(),n}}}const fY={baseURL:"/api",timeout:3e4,headers:{"Content-Type":"application/json",Accept:"application/json"}},Sa=Kn.create(fY),B1=new dY;Sa.interceptors.request.use(e=>{if(e.skipAuthHeader||new nK(e.headers).has("X-OWOX-Authorization"))return e;const n=_S(),r=(n==null?void 0:n.getAccessToken())??B1.getAccessToken();return r&&(e.headers["X-OWOX-Authorization"]=`Bearer ${r}`),e},e=>Promise.reject(e instanceof Error?e:new Error("Unknown error")));Sa.interceptors.response.use(e=>e,async e=>{var n,r,s;const t=e.config;if(((n=e.response)==null?void 0:n.status)===401&&!t._retry){t._retry=!0;try{const i=_S();if(!i)throw new Error("No token provider available");const c=await B1.refreshToken(()=>i.refreshToken());return t.headers["X-OWOX-Authorization"]=`Bearer ${c}`,await Sa(t)}catch{return B1.clear(),window.dispatchEvent(new CustomEvent("auth:logout",{detail:{reason:"token_refresh_failed"}})),Promise.reject(new Error("Token refresh failed"))}}return((r=e.response)==null?void 0:r.status)===403&&WT(e,"Access forbidden - insufficient permissions"),((s=e.response)==null?void 0:s.status)===400&&WT(e,"Bad request"),Promise.reject(e)});const yD={projects:[],callState:vt.IDLE,error:null};function hY(e,t){switch(t.type){case"LOADING":return{...e,callState:vt.LOADING,error:null};case"SUCCESS":return{projects:t.payload,callState:vt.LOADED,error:null};case"ERROR":return{...e,callState:vt.ERROR,error:t.payload};case"RESET":return{...yD};default:return e}}function mY({children:e}){const[t,n]=h.useReducer(hY,yD),r=h.useCallback(async()=>{n({type:"LOADING"});try{const u=_S();if(!u){n({type:"ERROR",payload:en(new LT("No token provider"))});return}const f=u.getAccessToken();if(!f){n({type:"ERROR",payload:en(new LT("Unable to obtain access token"))});return}const m=await cK(f);n({type:"SUCCESS",payload:m})}catch(u){n({type:"ERROR",payload:en(u)})}},[]),s=h.useCallback(()=>{n({type:"RESET"})},[]),i=t.callState===vt.LOADING,c={...t,loadProjects:r,reset:s,isLoading:i};return a.jsx(X3.Provider,{value:c,children:e})}function pY(){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(Lr,{open:e,onOpenChange:t,children:[a.jsx(jB,{isOpen:e}),a.jsx(mY,{children:a.jsx(CZ,{})})]})})})})}var gY=(e,t,n,r,s,i,c,u)=>{let f=document.documentElement,m=["light","dark"];function g(v){(Array.isArray(e)?e:[e]).forEach(S=>{let C=S==="class",E=C&&i?s.map(R=>i[R]||R):s;C?(f.classList.remove(...E),f.classList.add(i&&i[v]?i[v]:v)):f.setAttribute(S,v)}),y(v)}function y(v){u&&m.includes(v)&&(f.style.colorScheme=v)}function x(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(r)g(r);else try{let v=localStorage.getItem(t)||n,S=c&&v==="system"?x():v;g(S)}catch{}},QT=["light","dark"],xD="(prefers-color-scheme: dark)",yY=typeof window>"u",IS=h.createContext(void 0),xY={setTheme:e=>{},themes:[]},Th=()=>{var e;return(e=h.useContext(IS))!=null?e:xY},vY=e=>h.useContext(IS)?h.createElement(h.Fragment,null,e.children):h.createElement(SY,{...e}),bY=["light","dark"],SY=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:s="theme",themes:i=bY,defaultTheme:c=n?"system":"light",attribute:u="data-theme",value:f,children:m,nonce:g,scriptProps:y})=>{let[x,v]=h.useState(()=>EY(s,c)),[S,C]=h.useState(()=>x==="system"?O0():x),E=f?Object.values(f):i,R=h.useCallback(O=>{let I=O;if(!I)return;O==="system"&&n&&(I=O0());let T=f?f[I]:I,D=t?wY(g):null,L=document.documentElement,H=B=>{B==="class"?(L.classList.remove(...E),T&&L.classList.add(T)):B.startsWith("data-")&&(T?L.setAttribute(B,T):L.removeAttribute(B))};if(Array.isArray(u)?u.forEach(H):H(u),r){let B=QT.includes(c)?c:null,q=QT.includes(I)?I:B;L.style.colorScheme=q}D==null||D()},[g]),j=h.useCallback(O=>{let I=typeof O=="function"?O(x):O;v(I);try{localStorage.setItem(s,I)}catch{}},[x]),_=h.useCallback(O=>{let I=O0(O);C(I),x==="system"&&n&&!e&&R("system")},[x,e]);h.useEffect(()=>{let O=window.matchMedia(xD);return O.addListener(_),_(O),()=>O.removeListener(_)},[_]),h.useEffect(()=>{let O=I=>{I.key===s&&(I.newValue?v(I.newValue):j(c))};return window.addEventListener("storage",O),()=>window.removeEventListener("storage",O)},[j]),h.useEffect(()=>{R(e??x)},[e,x]);let A=h.useMemo(()=>({theme:x,setTheme:j,forcedTheme:e,resolvedTheme:x==="system"?S:x,themes:n?[...i,"system"]:i,systemTheme:n?S:void 0}),[x,j,e,S,n,i]);return h.createElement(IS.Provider,{value:A},h.createElement(CY,{forcedTheme:e,storageKey:s,attribute:u,enableSystem:n,enableColorScheme:r,defaultTheme:c,value:f,themes:i,nonce:g,scriptProps:y}),m)},CY=h.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:s,defaultTheme:i,value:c,themes:u,nonce:f,scriptProps:m})=>{let g=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:`(${gY.toString()})(${g})`}})}),EY=(e,t)=>{if(yY)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},wY=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)}},O0=e=>(e||(e=window.matchMedia(xD)),e.matches?"dark":"light");const RY=({theme:e,setTheme:t,signOut:n})=>[{type:"submenu",title:"Appearance",icon:jY(e),submenu:{value:e,onChange:r=>{t(r)},options:[{value:"system",label:"System",icon:aA},{value:"light",label:"Light",icon:lA},{value:"dark",label:"Dark",icon:sA}]}},{type:"separator"},{type:"item",title:"Sign out",icon:QP,onClick:n,className:"text-red-600 focus:text-red-600"}];function jY(e){switch(e){case"light":return lA;case"dark":return sA;case"system":default:return aA}}var Mu=(e=>(e.LARGE="LARGE",e.NORMAL="NORMAL",e.SMALL="SMALL",e))(Mu||{});function q1({avatar:e,initials:t,displayName:n,size:r=Mu.NORMAL}){let s,i,c;switch(r){case Mu.SMALL:s="w-6 h-6",i="w-5 h-5",c="text-[10px]";break;case Mu.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 TY({isOpen:e,displayName:t,email:n,avatar:r,initials:s}){return a.jsx(Pr,{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(q1,{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(fo,{className:`ml-auto size-4 transition-transform duration-200 group-data-[collapsible=icon]:hidden ${e?"rotate-180":""}`})]})})}function _Y({items:e}){return a.jsx(Ur,{align:"start",side:"top",sideOffset:8,className:"w-56",children:e.map((t,n)=>{if(t.type==="separator")return a.jsx(wa,{},`sep-${String(n)}`);if(t.type==="submenu"){const{submenu:r}=t;return a.jsxs(vS,{children:[a.jsxs(bS,{className:"flex items-center gap-2 px-2 py-1.5",children:[a.jsx(t.icon,{className:"size-4"}),t.title]}),a.jsx(SS,{children:r.options.map(s=>a.jsxs(Ot,{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(ra,{className:"ml-auto size-4"})]},s.value))})]},t.title)}return a.jsxs(Ot,{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 NY(){const{user:e,signOut:t}=oi(),{setTheme:n,theme:r}=Th(),[s,i]=h.useState(!1);if(!e)return null;const{fullName:c,email:u,avatar:f}=e,m=c??u??"Unknown User",g=gD(c,u);return a.jsx("div",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:"group/menu-item relative",children:a.jsxs(Lr,{open:s,onOpenChange:i,children:[a.jsx(TY,{isOpen:s,displayName:m,email:u,avatar:f,initials:g}),a.jsx(_Y,{items:RY({theme:r,setTheme:n,signOut:t})})]})})}function AY(){const{user:e,status:t}=oi();return t===$r.LOADING||t===$r.UNAUTHENTICATED||!(e!=null&&e.projectId)?null:e.projectId}function ii(){const e=xc(),t=AY(),n=h.useCallback((i,c)=>{if(!t){e("/",{replace:!0});return}const u=sg(t,i);e(u,c)},[e,t]),r=h.useCallback(i=>t?sg(t,i):i,[t]);return h.useMemo(()=>({navigate:n,scope:r,projectId:t}),[n,r,t])}function DY(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 OY(){const{scope:e}=ii();return a.jsxs(oh,{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(ua,{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 IY=[{title:"Data Marts",url:"/data-marts",icon:Kp},{title:"Storages",url:"/data-storages",icon:sc},{title:"Destinations",url:"/data-destinations",icon:Vb}];function MY(){const{scope:e}=ii();return a.jsx(A$,{children:IY.map(t=>{const n=t.icon;return a.jsx(D$,{children:a.jsx(oh,{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(Nt,{delayDuration:500,children:[a.jsx(At,{asChild:!0,children:a.jsxs(I$,{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(Dt,{side:"right",children:t.title})]})})},t.title)})})}function kY({variant:e="inset",collapsible:t="icon"}){return a.jsxs(E$,{variant:e,collapsible:t,children:[a.jsx(T$,{children:a.jsx(pY,{})}),a.jsxs(N$,{children:[a.jsx(gT,{children:a.jsx(yT,{children:a.jsx(OY,{})})}),a.jsx(gT,{children:a.jsx(yT,{children:a.jsx(MY,{})})})]}),a.jsx(_$,{children:a.jsx(NY,{})}),a.jsx(R$,{})]})}function LY({children:e,...t}){return a.jsx(vY,{attribute:"class",defaultTheme:"system",enableSystem:!0,...t,children:e})}class gl{constructor(t){Bs(this,"baseUrl");this.baseUrl=t}async get(t,n,r){const s=this.createUrl(t);return(await Sa.get(s,{...r,params:n})).data}async post(t,n,r){const s=this.createUrl(t);return(await Sa.post(s,n,r)).data}async put(t,n,r){const s=this.createUrl(t);return(await Sa.put(s,n,r)).data}async patch(t,n,r){const s=this.createUrl(t);return(await Sa.patch(s,n,r)).data}async delete(t,n){const r=this.createUrl(t);return(await Sa.delete(r,n)).data}createUrl(t){return this.baseUrl?`${this.baseUrl}${t}`:t}}class PY{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 Xs=new PY;class UY{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 FY=new UY;function zY({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:re("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 vD=h.createContext({isLoading:!1});function HY({children:e}){const[t,n]=h.useState(0),r=t>0;return h.useEffect(()=>{const s=Sa.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=Sa.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()=>{Sa.interceptors.request.eject(s),Sa.interceptors.response.eject(i)}},[]),a.jsx(vD.Provider,{value:{isLoading:r},children:e})}function VY(){return h.useContext(vD)}function $Y(){return a.jsx(uY,{position:"top-center",toastOptions:{duration:3e3,style:{borderRadius:"32px",boxShadow:"none",padding:"0.4rem 1rem",maxWidth:"800px",fontSize:"0.875rem",borderBottomWidth:"1px",borderBottomStyle:"solid"},success:{style:{background:"#ECFDF5",color:"#166534",borderBottomColor:"#D6DFE6"}},error:{style:{background:"#FEE2E2",color:"#991B1B",borderBottomColor:"#EAD1D1"},duration:6e3},loading:{style:{background:"#E8EDFB",color:"#1D4ED8",borderBottomColor:"#CAD5F6",borderBottomWidth:"1px",borderBottomStyle:"solid"}}}})}function GY({children:e}){const{isLoading:t}=Q3(),n=xK(),r=kb(),s=uo();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 XT="sidebar_state";function BY(){const{state:e,isMobile:t}=ph(),r=t||e==="collapsed",{isLoading:s}=VY();return a.jsxs(a.Fragment,{children:[a.jsx($Y,{}),a.jsx(zY,{isLoading:s}),a.jsxs(vK,{redirectTo:"/auth/sign-in",children:[a.jsx(kY,{variant:"inset",collapsible:"icon"}),a.jsxs(j$,{children:[r&&a.jsx(w$,{}),a.jsx(GY,{children:a.jsx(Ub,{})})]})]})]})}function qY(){const[e,t]=h.useState(()=>Xs.get(XT,"boolean")??!0),n=r=>{t(r),Xs.set(XT,r)};return a.jsx(LY,{children:a.jsx(HY,{children:a.jsx(C$,{open:e,onOpenChange:n,children:a.jsx(BY,{})})})})}function KY(){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 JT(){return a.jsxs("div",{className:"dm-empty-state-404page",children:[a.jsxs("div",{className:"dm-empty-state-404page-foreground",children:[a.jsx($U,{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(Ce,{variant:"default",asChild:!0,children:a.jsxs(na,{to:"/",className:"flex items-center gap-1","aria-label":"Guide Me Home",children:["Guide Me Home",a.jsx(Ra,{className:"h-4 w-4"})]})})]}),a.jsx("div",{className:"dm-empty-state-404page-background"})]})}const ZY={items:[],loading:!1,error:null};function YY(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 bD=h.createContext(void 0);function WY({children:e}){const[t,n]=h.useReducer(YY,ZY);return a.jsx(bD.Provider,{value:{state:t,dispatch:n},children:e})}function QY(){const e=h.useContext(bD);if(e===void 0)throw new Error("useDataMartListContext must be used within a DataMartListProvider");return e}class XY extends gl{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 yn=new XY;var Or=(e=>(e.DRAFT="DRAFT",e.PUBLISHED="PUBLISHED",e))(Or||{}),$e=(e=>(e.SQL="SQL",e.TABLE="TABLE",e.VIEW="VIEW",e.TABLE_PATTERN="TABLE_PATTERN",e.CONNECTOR="CONNECTOR",e))($e||{}),Fp=(e=>(e.ALREADY_PUBLISHED="ALREADY_PUBLISHED",e.INVALID_STORAGE="INVALID_STORAGE",e.MISSING_DEFINITION="MISSING_DEFINITION",e))(Fp||{});const JY={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 SD=(e=>(e.SCHEDULED="scheduled",e.MANUAL="manual",e))(SD||{}),Ar=(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))(Ar||{}),Mn=(e=>(e.RUNNING="RUNNING",e.SUCCESS="SUCCESS",e.FAILED="FAILED",e.CANCELLED="CANCELLED",e.INTERRUPTED="INTERRUPTED",e.PENDING="PENDING",e))(Mn||{});const CD={statuses:{[Or.DRAFT]:{code:Or.DRAFT,displayName:"Draft",description:"Data mart is in draft mode and not yet published"},[Or.PUBLISHED]:{code:Or.PUBLISHED,displayName:"Published",description:"Data mart is published and available for use"}},getInfo(e){return this.statuses[e]},getAllStatuses(){return Object.values(this.statuses)}},ED=e=>e?/^[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+$/.test(e):!1,wD=e=>e?/^[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+\.[a-zA-Z0-9_\-*]+$/.test(e):!1,eW=e=>e?ED(e)?"":"Invalid format. Expected: project.dataset.object":"Fully qualified name is required",tW=e=>e?wD(e)?"":"Invalid format. Expected: project.dataset.table_* (with wildcards)":"Table pattern is required",RD=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)},jD=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)},nW=e=>e?RD(e)?"":"Invalid format. Expected: database.object or catalog.database.object":"Fully qualified name is required",rW=e=>e?jD(e)?"":"Invalid format. Expected: database.table_* or catalog.database.table_* (with wildcards)":"Table pattern is required";var Rs=(e=>(e.PASSWORD="PASSWORD",e.KEY_PAIR="KEY_PAIR",e))(Rs||{});const aW=[{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 sW(e){return"projectId"in e}function oW(e){return"outputBucket"in e}var Re=(e=>(e.GOOGLE_BIGQUERY="GOOGLE_BIGQUERY",e.AWS_ATHENA="AWS_ATHENA",e.SNOWFLAKE="SNOWFLAKE",e.DATABRICKS="DATABRICKS",e.AWS_REDSHIFT="AWS_REDSHIFT",e.AZURE_SYNAPSE="AZURE_SYNAPSE",e))(Re||{}),$o=(e=>(e.ACTIVE="active",e.COMING_SOON="coming_soon",e))($o||{});const iW=({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})]})},lW=({type:e,config:t})=>{const n={[Re.GOOGLE_BIGQUERY]:[{label:"Project ID",key:"projectId"},{label:"Location",key:"location"}],[Re.AWS_ATHENA]:[{label:"Region",key:"region"},{label:"Output Bucket",key:"outputBucket"}],[Re.SNOWFLAKE]:[],[Re.DATABRICKS]:[],[Re.AWS_REDSHIFT]:[],[Re.AZURE_SYNAPSE]:[]},r=t&&(e===Re.GOOGLE_BIGQUERY&&sW(t)||e===Re.AWS_ATHENA&&oW(t));return a.jsx("div",{className:"grid gap-2",children:n[e].map(({label:s,key:i})=>{let c;return r&&(c=(e===Re.GOOGLE_BIGQUERY,t[i])),a.jsx(iW,{label:s,value:c},i)})})},cW=({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(lW,{type:e,config:t})]})}),uW=Ju("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 Sr({className:e,variant:t,asChild:n=!1,...r}){const s=n?ih:"span";return a.jsx(s,{"data-slot":"badge",className:re(uW({variant:t}),e),...r})}function TD(e){return e.type===Re.GOOGLE_BIGQUERY}function _D(e){return e.type===Re.AWS_ATHENA}function ND(e){return e.type===Re.SNOWFLAKE}const yl={types:{[Re.GOOGLE_BIGQUERY]:{type:Re.GOOGLE_BIGQUERY,displayName:"Google BigQuery",icon:eD,status:$o.ACTIVE},[Re.AWS_ATHENA]:{type:Re.AWS_ATHENA,displayName:"AWS Athena",icon:tD,status:$o.ACTIVE},[Re.SNOWFLAKE]:{type:Re.SNOWFLAKE,displayName:"Snowflake",icon:nD,status:$o.ACTIVE},[Re.DATABRICKS]:{type:Re.DATABRICKS,displayName:"Databricks",icon:_K,status:$o.COMING_SOON},[Re.AWS_REDSHIFT]:{type:Re.AWS_REDSHIFT,displayName:"AWS Redshift",icon:NK,status:$o.COMING_SOON},[Re.AZURE_SYNAPSE]:{type:Re.AZURE_SYNAPSE,displayName:"Azure Synapse",icon:AK,status:$o.COMING_SOON}},getInfo(e){return this.types[e]},getAllTypes(){return Object.values(this.types)}};function dW({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(Dr,{className:"h-5 w-24"}),a.jsx(Dr,{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(Sr,{variant:"secondary",className:"flex h-7 items-center gap-2",children:(()=>{const{displayName:c,icon:u}=yl.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(cW,{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 fW(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 hW(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 mW(e){return`https://console.aws.amazon.com/athena/home?region=${encodeURIComponent(e)}#/query-editor`}function pW(e){return`https://${e}.snowflakecomputing.com/`}function gW(e,t){const n=fW(t);if(!n)return null;const{dataset:r,table:s}=n;return TD(e)?hW(e.config.projectId,r,s):_D(e)?mW(e.config.region):ND(e)?pW(e.config.account):null}function yW(e,t){const n=gW(e,t);return n?(window.open(n,"_blank","noopener,noreferrer"),!0):!1}function xW(e){return TD(e)?"Open table in Google BigQuery":_D(e)?"Open region in AWS Athena":ND(e)?"Open console in Snowflake":"Open data in storage"}function AD(e){switch(e.type){case Re.GOOGLE_BIGQUERY:return!!(e.config.projectId&&e.config.location);case Re.AWS_ATHENA:return!!(e.config.region&&e.config.outputBucket);case Re.SNOWFLAKE:return!!(e.config.account&&e.config.warehouse);default:return!1}}const vW=Wt({accessKeyId:Rt().min(1,"Access Key ID is required"),secretAccessKey:Rt().min(1,"Secret Access Key is required")}),bW=Wt({authMethod:Fr(Rs.PASSWORD),username:Rt().min(1,"Username is required"),password:Rt().min(1,"Password is required")}),SW=Wt({authMethod:Fr(Rs.KEY_PAIR),username:Rt().min(1,"Username is required"),privateKey:Rt().min(1,"Private Key is required"),privateKeyPassphrase:Rt().optional()}),CW=DS("authMethod",[bW,SW]),EW=Wt({projectId:Rt().min(1,"Project ID is required"),location:Rt().min(1,"Location is required")}),wW=Wt({region:Rt().min(1,"Region is required"),outputBucket:Rt().min(1,"Output Bucket is required")}),RW=Wt({account:Rt().min(1,"Account is required"),warehouse:Rt().min(1,"Warehouse is required")}),MS=Wt({title:Rt().min(1,"Title is required").max(255,"Title must be 255 characters or less")}),jW=MS.extend({type:Fr(Re.GOOGLE_BIGQUERY),credentials:lD,config:EW}),TW=MS.extend({type:Fr(Re.AWS_ATHENA),credentials:vW,config:wW}),_W=MS.extend({type:Fr(Re.SNOWFLAKE),credentials:CW,config:RW}),NW=DS("type",[jW,TW,_W]),DD=e=>{if(!e)return!1;const t='(?:[a-zA-Z0-9_$]+|"[^"]+")';return new RegExp(`^[a-zA-Z0-9_$]+\\.${t}\\.${t}$`).test(e)},OD=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)},AW=e=>e?DD(e)?"":"Invalid format. Expected: database.schema.object":"Fully qualified name is required",DW=e=>e?OD(e)?"":"Invalid format. Expected: database.schema.table_* (with wildcards)":"Table pattern is required",OW=(e,t)=>{if(!e)return!1;switch(t){case Re.GOOGLE_BIGQUERY:return ED(e);case Re.AWS_ATHENA:return RD(e);case Re.SNOWFLAKE:return DD(e);default:return!1}},IW=(e,t)=>{if(!e)return!1;switch(t){case Re.GOOGLE_BIGQUERY:return wD(e);case Re.AWS_ATHENA:return jD(e);case Re.SNOWFLAKE:return OD(e);default:return!1}},MW=(e,t)=>{if(!e)return"Fully qualified name is required";switch(t){case Re.GOOGLE_BIGQUERY:return eW(e);case Re.AWS_ATHENA:return nW(e);case Re.SNOWFLAKE:return AW(e);default:return"Unsupported storage type"}},kW=(e,t)=>{if(!e)return"Table pattern is required";switch(t){case Re.GOOGLE_BIGQUERY:return tW(e);case Re.AWS_ATHENA:return rW(e);case Re.SNOWFLAKE:return DW(e);default:return"Unsupported storage type"}},ID=e=>{switch(e){case Re.GOOGLE_BIGQUERY:return"project.dataset.table";case Re.AWS_ATHENA:return"database.table or catalog.database.table";case Re.SNOWFLAKE:return"database.schema.table";default:return""}},LW=e=>{switch(e){case Re.GOOGLE_BIGQUERY:return"project.dataset.table_*";case Re.AWS_ATHENA:return"database.table_* or catalog.database.table_*";case Re.SNOWFLAKE:return"database.schema.table_*";default:return""}},MD=e=>{switch(e){case Re.GOOGLE_BIGQUERY:return"Enter the fully qualified name of the table (e.g., project.dataset.table)";case Re.AWS_ATHENA:return"Enter the fully qualified name of the table (e.g., database.table or catalog.database.table)";case Re.SNOWFLAKE:return"Enter the fully qualified name of the table (e.g., database.schema.table)";default:return""}},PW=e=>{switch(e){case Re.GOOGLE_BIGQUERY:return'Enter a pattern to match multiple tables (e.g., project.dataset.table_* will match all tables starting with "table_")';case Re.AWS_ATHENA:return'Enter a pattern to match multiple tables (e.g., database.table_* will match all tables starting with "table_")';case Re.SNOWFLAKE:return'Enter a pattern to match multiple tables (e.g., database.schema.table_* will match all tables starting with "table_")';default:return""}};var Bn=(e=>(e.SUCCESS="success",e.ERROR="error",e.WARNING="warning",e.INFO="info",e.NEUTRAL="neutral",e))(Bn||{});const UW={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:""},FW=e=>UW[e],zW={[Bn.SUCCESS]:{icon:Vg,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"}},[Bn.ERROR]:{icon:dU,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"}},[Bn.WARNING]:{icon:Gg,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"}},[Bn.INFO]:{icon:Br,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"}},[Bn.NEUTRAL]:{icon:Br,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 _h({type:e=Bn.NEUTRAL,variant:t="ghost",showIcon:n=!0,children:r,className:s}){const{icon:i,colors:c}=zW[e],u=f=>{const m="inline-flex items-center gap-1 text-sm",g=FW(f),y=c[f];return re(m,g,y,s)};return a.jsxs("span",{className:u(t),children:[n&&a.jsx(i,{className:"h-4 w-4","data-testid":"icon"}),r]})}const kD=/^https:\/\/(docs|spreadsheets)\.google\.com\/spreadsheets\/d\/([a-zA-Z0-9-_]+)/,HW=/[#&]gid=([0-9]+)/;function LD(e){return kD.test(e)}function VW(e){const t=kD.exec(e);return t?t[2]:""}function $W(e){const t=HW.exec(e);return t?t[1]:"0"}function GW(e){return{spreadsheetId:VW(e),sheetId:parseInt($W(e),10)}}function kS(e,t){return`https://docs.google.com/spreadsheets/d/${e}/edit#gid=${String(t)}`}function BW(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 I0(e){return BW(e,"client_email")}const PD=h.createContext(void 0);var at=(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))(at||{}),Cr=(e=>(e.GOOGLE_SHEETS_CONFIG="google-sheets-config",e.LOOKER_STUDIO_CONFIG="looker-studio-config",e.EMAIL_CONFIG="email-config",e))(Cr||{}),En=(e=>(e.SUCCESS="SUCCESS",e.RUNNING="RUNNING",e.ERROR="ERROR",e.CANCELLED="CANCELLED",e))(En||{}),Cn=(e=>(e.EDIT="edit",e.CREATE="create",e))(Cn||{});const qW={reports:[],destinations:[],currentReport:null,loading:!1,error:null,polledReportIds:[]};function KW(e,t){switch(t.type){case at.FETCH_REPORTS_START:case at.FETCH_REPORT_START:case at.CREATE_REPORT_START:case at.UPDATE_REPORT_START:case at.DELETE_REPORT_START:return{...e,loading:!0,error:null};case at.FETCH_REPORTS_SUCCESS:return{...e,reports:t.payload,loading:!1,error:null};case at.FETCH_DESTINATIONS_SUCCESS:return{...e,destinations:t.payload,loading:!1,error:null};case at.FETCH_REPORT_SUCCESS:return{...e,currentReport:t.payload,loading:!1,error:null};case at.CREATE_REPORT_SUCCESS:return{...e,reports:[...e.reports,t.payload],loading:!1,error:null};case at.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 at.DELETE_REPORT_SUCCESS:return{...e,reports:e.reports.filter(n=>n.id!==t.payload),loading:!1,error:null};case at.FETCH_REPORTS_ERROR:case at.FETCH_REPORT_ERROR:case at.FETCH_DESTINATIONS_ERROR:case at.CREATE_REPORT_ERROR:case at.UPDATE_REPORT_ERROR:case at.DELETE_REPORT_ERROR:return{...e,loading:!1,error:t.payload};case at.CLEAR_CURRENT_REPORT:return{...e,currentReport:null};case at.CLEAR_ERROR:return{...e,error:null};case at.START_POLLING_REPORT:return{...e,polledReportIds:[...e.polledReportIds,t.payload]};case at.STOP_POLLING_REPORT:return{...e,polledReportIds:e.polledReportIds.filter(n=>n!==t.payload)};case at.STOP_ALL_POLLING:return{...e,polledReportIds:[]};case at.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 UD({children:e}){const[t,n]=h.useReducer(KW,qW);return a.jsx(PD.Provider,{value:{state:t,dispatch:n},children:e})}function ZW(){const e=h.useContext(PD);if(e===void 0)throw new Error("useReportContext must be used within a ReportProvider");return e}class YW extends gl{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 Ho=new YW,WW={initialPollingIntervalMs:2e3,initialPollCount:3,regularPollingIntervalMs:5e3};class QW{constructor(){Bs(this,"pollingTimers",new Map);Bs(this,"pollCounters",new Map);Bs(this,"config",WW)}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 Ho.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 hp=new QW;var De=(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))(De||{}),xs=(e=>(e.ACTIVE="Active",e.COMING_SOON="Coming soon",e.CLOUD_ONLY="Cloud only",e))(xs||{}),no=(e=>(e.GOOGLE_SHEETS_CREDENTIALS="google-sheets-credentials",e.LOOKER_STUDIO_CREDENTIALS="looker-studio-credentials",e.EMAIL_CREDENTIALS="email-credentials",e))(no||{});class XW extends gl{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 Yl=new XW,ea={types:{[De.GOOGLE_SHEETS]:{type:De.GOOGLE_SHEETS,displayName:"Google Sheets",icon:RK,status:xs.ACTIVE},[De.LOOKER_STUDIO]:{type:De.LOOKER_STUDIO,displayName:"Looker Studio",icon:jK,status:xs.ACTIVE},[De.EMAIL]:{type:De.EMAIL,displayName:"Email",icon:HK,status:xs.CLOUD_ONLY},[De.SLACK]:{type:De.SLACK,displayName:"Slack",icon:OK,status:xs.CLOUD_ONLY},[De.MS_TEAMS]:{type:De.MS_TEAMS,displayName:"Microsoft Teams",icon:FK,status:xs.CLOUD_ONLY},[De.GOOGLE_CHAT]:{type:De.GOOGLE_CHAT,displayName:"Google Chat",icon:zK,status:xs.CLOUD_ONLY},[De.ODATA]:{type:De.ODATA,displayName:"OData",icon:TK,status:xs.COMING_SOON}},getInfo(e){return this.types[e]},getAllTypes(){return Object.values(this.types)}},JW=Wt({deploymentUrl:Rt().optional(),destinationId:Rt().optional(),destinationSecretKey:Rt().optional()}),eQ=Wt({to:V1(Rt().email()).min(1)}),LS=Wt({title:Rt().min(1,"Title is required"),type:my(De)}),tQ=LS.extend({type:Fr(De.GOOGLE_SHEETS),credentials:lD}),nQ=LS.extend({type:Fr(De.LOOKER_STUDIO),credentials:JW.optional()}),yy=LS.extend({credentials:eQ.optional()}),rQ=yy.extend({type:Fr(De.EMAIL)}),aQ=yy.extend({type:Fr(De.SLACK)}),sQ=yy.extend({type:Fr(De.MS_TEAMS)}),oQ=yy.extend({type:Fr(De.GOOGLE_CHAT)}),iQ=DS("type",[tQ,nQ,rQ,aQ,sQ,oQ]),FD=h.createContext(void 0);var Kt=(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))(Kt||{});const lQ={dataDestinations:[],currentDataDestination:null,loading:!1,error:null};function cQ(e,t){switch(t.type){case Kt.FETCH_DESTINATIONS_START:case Kt.FETCH_DESTINATION_START:case Kt.CREATE_DESTINATION_START:case Kt.UPDATE_DESTINATION_START:case Kt.DELETE_DESTINATION_START:return{...e,loading:!0,error:null};case Kt.FETCH_DESTINATIONS_SUCCESS:return{...e,dataDestinations:t.payload,loading:!1,error:null};case Kt.FETCH_DESTINATION_SUCCESS:return{...e,currentDataDestination:t.payload,loading:!1,error:null};case Kt.CREATE_DESTINATION_SUCCESS:return{...e,dataDestinations:[...e.dataDestinations,t.payload],loading:!1,error:null};case Kt.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 Kt.DELETE_DESTINATION_SUCCESS:return{...e,dataDestinations:e.dataDestinations.filter(n=>n.id!==t.payload),loading:!1,error:null};case Kt.FETCH_DESTINATIONS_ERROR:case Kt.FETCH_DESTINATION_ERROR:case Kt.CREATE_DESTINATION_ERROR:case Kt.UPDATE_DESTINATION_ERROR:case Kt.DELETE_DESTINATION_ERROR:return{...e,loading:!1,error:t.payload};case Kt.CLEAR_CURRENT_DESTINATION:return{...e,currentDataDestination:null};case Kt.CLEAR_ERROR:return{...e,error:null};default:return e}}function Nh({children:e}){const[t,n]=h.useReducer(cQ,lQ);return a.jsx(FD.Provider,{value:{state:t,dispatch:n},children:e})}function uQ(){const e=h.useContext(FD);if(e===void 0)throw new Error("useDataDestinationContext must be used within a DataDestinationProvider");return e}class mp{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:no.EMAIL_CREDENTIALS,to:s}}return r}mapToCreateRequest(t){const n=t,r=n.credentials.to;return{title:n.title,type:this.type,credentials:{type:no.EMAIL_CREDENTIALS,to:r}}}extractCredentials(t){return t.type===no.EMAIL_CREDENTIALS?{to:t.to}:{to:[]}}}class dQ{mapFromDto(t){let n="";try{t.credentials.type===no.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:De.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:no.GOOGLE_SHEETS_CREDENTIALS}),r}mapToCreateRequest(t){const n=t;return{title:n.title,type:De.GOOGLE_SHEETS,credentials:{serviceAccountKey:JSON.parse(n.credentials.serviceAccount),type:no.GOOGLE_SHEETS_CREDENTIALS}}}}class fQ{mapFromDto(t){const n=this.extractLookerStudioCredentials(t.credentials);return{id:t.id,title:t.title,type:De.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:no.LOOKER_STUDIO_CREDENTIALS}}}mapToCreateRequest(t){return{title:t.title,type:De.LOOKER_STUDIO,credentials:{type:no.LOOKER_STUDIO_CREDENTIALS}}}extractLookerStudioCredentials(t){return t.type===no.LOOKER_STUDIO_CREDENTIALS?{deploymentUrl:t.deploymentUrl,destinationId:t.destinationId,destinationSecretKey:t.destinationSecretKey}:{deploymentUrl:"",destinationId:"",destinationSecretKey:""}}}const zD={getMapper(e){switch(e){case De.GOOGLE_SHEETS:return new dQ;case De.LOOKER_STUDIO:return new fQ;case De.EMAIL:return new mp(De.EMAIL);case De.SLACK:return new mp(De.SLACK);case De.MS_TEAMS:return new mp(De.MS_TEAMS);case De.GOOGLE_CHAT:return new mp(De.GOOGLE_CHAT);default:throw new Error(`Unknown destination type: ${e}`)}}};function bu(e){return zD.getMapper(e.type).mapFromDto(e)}function Ah(){const{state:e,dispatch:t}=uQ(),n=h.useCallback(async()=>{t({type:Kt.FETCH_DESTINATIONS_START});try{const g=(await Yl.getDataDestinations()).map(bu);t({type:Kt.FETCH_DESTINATIONS_SUCCESS,payload:g})}catch(m){const g=m instanceof Error?m.message:"Failed to load destinations";t({type:Kt.FETCH_DESTINATIONS_ERROR,payload:g}),Ie({event:"data_destination_error",category:"DataDestination",action:"ListError",label:g})}},[t]),r=h.useCallback(async m=>{try{const g=await Yl.getDataDestinationById(m),y=bu(g);t({type:Kt.FETCH_DESTINATION_SUCCESS,payload:y})}catch(g){const y=g instanceof Error?g.message:"Failed to load destination";t({type:Kt.FETCH_DESTINATION_ERROR,payload:y}),Ie({event:"data_destination_error",category:"DataDestination",action:"GetError",label:y})}},[t]),s=h.useCallback(async m=>{t({type:Kt.CREATE_DESTINATION_START});try{const g=await Yl.createDataDestination(m),y=bu(g);return t({type:Kt.CREATE_DESTINATION_SUCCESS,payload:y}),Ie({event:"data_destination_created",category:"DataDestination",action:"Create",label:y.type}),Mt.success("Destination created"),y}catch(g){const y=g instanceof Error?g.message:"Failed to create destination";return t({type:Kt.CREATE_DESTINATION_ERROR,payload:y}),Ie({event:"data_destination_error",category:"DataDestination",action:"CreateError",label:m.type}),null}},[t]),i=h.useCallback(async(m,g)=>{t({type:Kt.UPDATE_DESTINATION_START});try{const y=await Yl.updateDataDestination(m,g),x=bu(y);return t({type:Kt.UPDATE_DESTINATION_SUCCESS,payload:x}),Ie({event:"data_destination_updated",category:"DataDestination",action:"Update",label:x.type}),Mt.success("Destination updated"),x}catch(y){const x=y instanceof Error?y.message:"Failed to update destination";return t({type:Kt.UPDATE_DESTINATION_ERROR,payload:x}),Ie({event:"data_destination_error",category:"DataDestination",action:"UpdateError",label:x}),null}},[t]),c=h.useCallback(async m=>{t({type:Kt.DELETE_DESTINATION_START});try{await Yl.deleteDataDestination(m),t({type:Kt.DELETE_DESTINATION_SUCCESS,payload:m}),Ie({event:"data_destination_deleted",category:"DataDestination",action:"Delete"}),Mt.success("Destination deleted")}catch(g){const y=g instanceof Error?g.message:"Failed to delete destination";throw t({type:Kt.DELETE_DESTINATION_ERROR,payload:y}),Ie({event:"data_destination_error",category:"DataDestination",action:"DeleteError",label:y}),g}},[t]),u=h.useCallback(()=>{t({type:Kt.CLEAR_CURRENT_DESTINATION})},[t]),f=h.useCallback(async m=>{try{const g=await Yl.rotateSecretKey(m),y=bu(g);return Ie({event:"data_destination_updated",category:"DataDestination",action:"RotateSecretKey",label:y.type}),y}catch(g){const y=g instanceof Error?g.message:"Failed to rotate secret key";throw Ie({event:"data_destination_error",category:"DataDestination",action:"RotateSecretKeyError",label:y}),console.error("Failed to rotate secret key:",g),g}},[]);return{dataDestinations:e.dataDestinations,currentDataDestination:e.currentDataDestination,loading:e.loading,error:e.error,fetchDataDestinations:n,getDataDestinationById:r,createDataDestination:s,updateDataDestination:i,deleteDataDestination:c,clearCurrentDataDestination:u,rotateSecretKey:f}}function hQ(e){const t=ea.getInfo(e.type),n=t.status!==xs.COMING_SOON;return{destinationInfo:t,isVisible:n}}function mQ(){const{dataMart:e}=qa(),{fetchReportsByDataMartId:t}=Ls(),{dataDestinations:n,fetchDataDestinations:r,loading:s}=Ah(),[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 PS(e){return JSON.stringify(e,null,2)}class pQ{mapFromDto(t){if(t.type!==Cr.EMAIL_CONFIG)throw new Error("Invalid destination config type");return{type:Cr.EMAIL_CONFIG,reportCondition:t.reportCondition,subject:t.subject,messageTemplate:t.messageTemplate}}}class gQ{mapFromDto(t){if(t.type!==Cr.GOOGLE_SHEETS_CONFIG)throw new Error("Invalid destination config type");return{type:Cr.GOOGLE_SHEETS_CONFIG,spreadsheetId:t.spreadsheetId,sheetId:t.sheetId.toString()}}}class yQ{mapFromDto(t){if(t.type!==Cr.LOOKER_STUDIO_CONFIG)throw new Error("Invalid destination config type");return{type:Cr.LOOKER_STUDIO_CONFIG,cacheLifetime:t.cacheLifetime}}}const xQ={getMapper(e){switch(e){case Cr.GOOGLE_SHEETS_CONFIG:return new gQ;case Cr.LOOKER_STUDIO_CONFIG:return new yQ;case Cr.EMAIL_CONFIG:return new pQ;default:throw new Error(`Unknown destination config type: ${String(e)}`)}}};function vQ(e){return xQ.getMapper(e.type).mapFromDto(e)}function Wl(e){const t=vQ(e.destinationConfig);return{id:e.id,title:e.title,dataMart:{id:e.dataMart.id},dataDestination:bu(e.dataDestinationAccess),destinationConfig:t,lastRunDate:e.lastRunAt?new Date(e.lastRunAt):null,lastRunStatus:e.lastRunStatus,lastRunError:e.lastRunError,runsCount:e.runsCount,createdAt:new Date(e.createdAt),modifiedAt:new Date(e.modifiedAt)}}function Ls(){const{state:e,dispatch:t}=ZW(),n=h.useCallback(async()=>{t({type:at.FETCH_DESTINATIONS_START});try{const E=await Yl.getDataDestinations();t({type:at.FETCH_DESTINATIONS_SUCCESS,payload:E})}catch(E){const R=E instanceof Error?E.message:"Failed to fetch destinations";t({type:at.FETCH_DESTINATIONS_ERROR,payload:R}),Ie({event:"report_error",category:"Report",action:"DestinationsListError",label:R})}},[t]),r=h.useCallback(async()=>{t({type:at.FETCH_REPORTS_START});try{const R=(await Ho.getReportsByProject()).map(Wl);t({type:at.FETCH_REPORTS_SUCCESS,payload:R})}catch(E){const R=E instanceof Error?E.message:"Failed to fetch reports";t({type:at.FETCH_REPORTS_ERROR,payload:R}),Ie({event:"report_error",category:"Report",action:"ListError",label:R})}},[t]),s=h.useCallback(async(E,R)=>{R!=null&&R.silent||t({type:at.FETCH_REPORTS_START});try{const _=(await Ho.getReportsByDataMartId(E,R!=null&&R.silent?{skipLoadingIndicator:!0}:void 0)).map(Wl);t({type:at.FETCH_REPORTS_SUCCESS,payload:_})}catch(j){const _=j instanceof Error?j.message:"Failed to fetch reports";t({type:at.FETCH_REPORTS_ERROR,payload:_}),Ie({event:"report_error",category:"Report",action:"ListError",label:_})}},[t]),i=h.useCallback(async E=>{t({type:at.FETCH_REPORT_START});try{const R=await Ho.getReportById(E),j=Wl(R);t({type:at.FETCH_REPORT_SUCCESS,payload:j})}catch(R){const j=R instanceof Error?R.message:"Failed to fetch report";t({type:at.FETCH_REPORT_ERROR,payload:j}),Ie({event:"report_error",category:"Report",action:"GetError",label:j})}},[t]),c=h.useCallback(async E=>{t({type:at.CREATE_REPORT_START});try{const R=await Ho.createReport(E),j=Wl(R);return t({type:at.CREATE_REPORT_SUCCESS,payload:j}),Ie({event:"report_created",category:"Report",action:"Create",label:j.dataDestination.type}),Mt.success("Report created"),j}catch(R){const j=R instanceof Error?R.message:"Failed to create report";return t({type:at.CREATE_REPORT_ERROR,payload:j}),Ie({event:"report_error",category:"Report",action:"CreateError",label:E.destinationConfig.type}),null}},[t]),u=h.useCallback(async(E,R)=>{t({type:at.UPDATE_REPORT_START});try{const j=await Ho.updateReport(E,R),_=Wl(j);return t({type:at.UPDATE_REPORT_SUCCESS,payload:_}),Ie({event:"report_updated",category:"Report",action:"Update",label:_.dataDestination.type}),Mt.success("Report updated"),_}catch(j){const _=j instanceof Error?j.message:"Failed to update report";return t({type:at.UPDATE_REPORT_ERROR,payload:_}),Ie({event:"report_error",category:"Report",action:"UpdateError",label:_}),null}},[t]),f=h.useCallback(async E=>{t({type:at.DELETE_REPORT_START});try{await Ho.deleteReport(E),t({type:at.DELETE_REPORT_SUCCESS,payload:E}),Ie({event:"report_deleted",category:"Report",action:"Delete"}),Mt.success("Report deleted")}catch(R){const j=R instanceof Error?R.message:"Failed to delete report";t({type:at.DELETE_REPORT_ERROR,payload:j}),Ie({event:"report_error",category:"Report",action:"DeleteError",label:j})}},[t]),m=h.useCallback(()=>{t({type:at.CLEAR_CURRENT_REPORT})},[t]),g=h.useCallback(()=>{t({type:at.CLEAR_ERROR})},[t]),y=h.useCallback(E=>{hp.stopPolling(E),t({type:at.STOP_POLLING_REPORT,payload:E})},[t]),x=h.useCallback(E=>{e.polledReportIds.includes(E)&&y(E),t({type:at.START_POLLING_REPORT,payload:E}),hp.startPolling(E,R=>{const j=Wl(R);t({type:at.UPDATE_POLLED_REPORT,payload:j})})},[t,e.polledReportIds,y]),v=h.useCallback(()=>{hp.stopAllPolling(),t({type:at.STOP_ALL_POLLING})},[t]),S=h.useCallback(E=>{hp.setConfig(E)},[]),C=h.useCallback(async E=>{try{y(E),await Ho.runReport(E),await i(E),x(E),Ie({event:"report_run_started",category:"Report",action:"Run",label:E}),Mt.success("Report run started")}catch(R){const j=R instanceof Error?R.message:"Failed to run report";Ie({event:"report_error",category:"Report",action:"RunError",label:j}),console.error("Failed to run report:",R)}},[i,x,y]);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:C,startPollingReport:x,stopPollingReport:y,stopAllPolling:v,setPollingConfig:S,clearCurrentReport:m,clearError:g}}En.SUCCESS+"",En.SUCCESS,En.RUNNING+"",En.RUNNING,En.ERROR+"",En.ERROR,En.CANCELLED+"",En.CANCELLED;var M0,xy="HoverCard",[HD]=xr(xy,[mo]),vy=mo(),[bQ,by]=HD(xy),VD=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:s,onOpenChange:i,openDelay:c=700,closeDelay:u=300}=e,f=vy(t),m=h.useRef(0),g=h.useRef(0),y=h.useRef(!1),x=h.useRef(!1),[v,S]=aa({prop:r,defaultProp:s??!1,onChange:i,caller:xy}),C=h.useCallback(()=>{clearTimeout(g.current),m.current=window.setTimeout(()=>S(!0),c)},[c,S]),E=h.useCallback(()=>{clearTimeout(m.current),!y.current&&!x.current&&(g.current=window.setTimeout(()=>S(!1),u))},[u,S]),R=h.useCallback(()=>S(!1),[S]);return h.useEffect(()=>()=>{clearTimeout(m.current),clearTimeout(g.current)},[]),a.jsx(bQ,{scope:t,open:v,onOpenChange:S,onOpen:C,onClose:E,onDismiss:R,hasSelectionRef:y,isPointerDownOnContentRef:x,children:a.jsx(od,{...f,children:n})})};VD.displayName=xy;var $D="HoverCardTrigger",GD=h.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,s=by($D,n),i=vy(n);return a.jsx(id,{asChild:!0,...i,children:a.jsx(Xe.a,{"data-state":s.open?"open":"closed",...r,ref:t,onPointerEnter:Oe(e.onPointerEnter,bg(s.onOpen)),onPointerLeave:Oe(e.onPointerLeave,bg(s.onClose)),onFocus:Oe(e.onFocus,s.onOpen),onBlur:Oe(e.onBlur,s.onClose),onTouchStart:Oe(e.onTouchStart,c=>c.preventDefault())})})});GD.displayName=$D;var US="HoverCardPortal",[SQ,CQ]=HD(US,{forceMount:void 0}),BD=e=>{const{__scopeHoverCard:t,forceMount:n,children:r,container:s}=e,i=by(US,t);return a.jsx(SQ,{scope:t,forceMount:n,children:a.jsx(kr,{present:n||i.open,children:a.jsx(Sc,{asChild:!0,container:s,children:r})})})};BD.displayName=US;var vg="HoverCardContent",qD=h.forwardRef((e,t)=>{const n=CQ(vg,e.__scopeHoverCard),{forceMount:r=n.forceMount,...s}=e,i=by(vg,e.__scopeHoverCard);return a.jsx(kr,{present:r||i.open,children:a.jsx(EQ,{"data-state":i.open?"open":"closed",...s,onPointerEnter:Oe(e.onPointerEnter,bg(i.onOpen)),onPointerLeave:Oe(e.onPointerLeave,bg(i.onClose)),ref:t})})});qD.displayName=vg;var EQ=h.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:c,...u}=e,f=by(vg,n),m=vy(n),g=h.useRef(null),y=ht(t,g),[x,v]=h.useState(!1);return h.useEffect(()=>{if(x){const S=document.body;return M0=S.style.userSelect||S.style.webkitUserSelect,S.style.userSelect="none",S.style.webkitUserSelect="none",()=>{S.style.userSelect=M0,S.style.webkitUserSelect=M0}}},[x]),h.useEffect(()=>{if(g.current){const S=()=>{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",S),()=>{document.removeEventListener("pointerup",S),f.hasSelectionRef.current=!1,f.isPointerDownOnContentRef.current=!1}}},[f.isPointerDownOnContentRef,f.hasSelectionRef]),h.useEffect(()=>{g.current&&jQ(g.current).forEach(C=>C.setAttribute("tabindex","-1"))}),a.jsx(bc,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:c,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:Oe(i,S=>{S.preventDefault()}),onDismiss:f.onDismiss,children:a.jsx(fh,{...m,...u,onPointerDown:Oe(u.onPointerDown,S=>{S.currentTarget.contains(S.target)&&v(!0),f.hasSelectionRef.current=!1,f.isPointerDownOnContentRef.current=!0}),ref:y,style:{...u.style,userSelect:x?"text":void 0,WebkitUserSelect:x?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),wQ="HoverCardArrow",RQ=h.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,s=vy(n);return a.jsx(hh,{...s,...r,ref:t})});RQ.displayName=wQ;function bg(e){return t=>t.pointerType==="touch"?void 0:e()}function jQ(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 TQ=VD,_Q=GD,NQ=BD,AQ=qD;const Sy=({...e})=>a.jsx(TQ,{"data-slot":"hover-card",...e});Sy.displayName="HoverCard";const Cy=h.forwardRef(({...e},t)=>a.jsx(_Q,{"data-slot":"hover-card-trigger",ref:t,...e}));Cy.displayName="HoverCardTrigger";const Ey=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(NQ,{children:a.jsx(AQ,{ref:i,align:t,sideOffset:n,className:re("bg-popover text-popover-foreground z-50 w-110 rounded-lg border px-6 py-4 shadow-md outline-none","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2","data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),onClick:c,...s})})});Ey.displayName="HoverCardContent";const FS=h.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:re("border-border flex gap-4 border-b pb-4",e),...t}));FS.displayName="HoverCardHeader";const zS=h.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:re("bg-muted flex h-14 min-h-[56px] w-14 min-w-[56px] shrink-0 items-center justify-center rounded-full",e),...t}));zS.displayName="HoverCardHeaderIcon";const HS=h.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:re("flex flex-col space-y-1",e),...t}));HS.displayName="HoverCardHeaderText";const VS=h.forwardRef(({className:e,...t},n)=>a.jsx("h2",{ref:n,className:re("text-md pt-1 leading-snug font-semibold",e),...t}));VS.displayName="HoverCardHeaderTitle";const $S=h.forwardRef(({className:e,...t},n)=>a.jsx("p",{ref:n,className:re("text-muted-foreground text-sm",e),...t}));$S.displayName="HoverCardHeaderDescription";const GS=h.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:re("flex flex-col",e),...t}));GS.displayName="HoverCardBody";const Qi=h.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:re("border-border flex items-center justify-between border-b py-4",e),...t}));Qi.displayName="HoverCardItem";const Xi=h.forwardRef(({className:e,...t},n)=>a.jsx("span",{ref:n,className:re("text-muted-foreground text-sm",e),...t}));Xi.displayName="HoverCardItemLabel";const Ji=h.forwardRef(({className:e,...t},n)=>a.jsx("span",{ref:n,className:re("text-sm",e),...t}));Ji.displayName="HoverCardItemValue";const BS=h.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:re("pt-4 pb-2",e),...t}));BS.displayName="HoverCardFooter";function wy(e){return e.type===Cr.GOOGLE_SHEETS_CONFIG}function KD(e){return e.type===Cr.LOOKER_STUDIO_CONFIG}function k0(e){return e.type===Cr.EMAIL_CONFIG}function ti({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)),g=Math.floor(m/7),y=Math.floor(m/30),x=Math.floor(m/365),v=C=>C.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0}),S=C=>C.toLocaleDateString("en-US",{weekday:"long"});if(u<1)return c?"Just now":"In a moment";if(u<60)return c?u===1?"1 minute ago":`${u} minutes ago`:u===1?"In 1 minute":`In ${u} minutes`;if(f<24)return c?f===1?"1 hour ago":`${f} hours ago`:f===1?"In 1 hour":`In ${f} hours`;if(m===1){const C=v(e);return c?`Yesterday at ${C}`:`Tomorrow at ${C}`}if(m<7){const C=S(e),E=v(e);return c?`Last ${C} at ${E}`:`This ${C} at ${E}`}if(m<14){const C=S(e),E=v(e);return c?`Last ${C} at ${E}`:`Next ${C} at ${E}`}return g<4?c?g===2?"2 weeks ago":"3 weeks ago":g===2?"In 2 weeks":"In 3 weeks":y<12?c?y===1?"1 month ago":`${y} months ago`:y===1?"In 1 month":`In ${y} months`:c?x===1?"1 year ago":`${x} years ago`:x===1?"In 1 year":`In ${x} years`},[e]);return a.jsx("span",{className:`${t}`,title:e.toLocaleString(),children:n})}const DQ=()=>{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}},OQ=be.memo(function({report:t,children:n}){const{detailedDateFormatter:r,shortDateFormatter:s}=DQ(),i=h.useMemo(()=>t.lastRunStatus?{statusType:kQ(t.lastRunStatus),statusText:PQ(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(()=>ea.getInfo(t.dataDestination.type).icon,[t.dataDestination.type]),f=h.useMemo(()=>wy(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 g=kS(f.spreadsheetId,f.sheetId);window.open(g,"_blank","noopener,noreferrer")},[f]);return a.jsxs(Sy,{children:[a.jsx(Cy,{asChild:!0,children:a.jsx("span",{children:n})}),a.jsxs(Ey,{children:[a.jsxs(FS,{children:[a.jsx(zS,{children:a.jsx(u,{size:20})}),a.jsxs(HS,{children:[a.jsx(VS,{children:t.title||"Unnamed Report"}),a.jsxs($S,{children:["Last modified ",a.jsx(ti,{date:new Date(t.modifiedAt)})]})]})]}),a.jsxs(GS,{children:[a.jsxs(Qi,{children:[a.jsx(Xi,{children:"Last run status:"}),a.jsx(Ji,{children:i?a.jsx(_h,{type:i.statusType,variant:"ghost",children:i.statusText}):"Not run yet"})]}),a.jsxs(Qi,{children:[a.jsx(Xi,{children:"Last run date:"}),a.jsx(Ji,{children:t.lastRunDate?a.jsx(ti,{date:t.lastRunDate}):"Never run"})]}),t.lastRunError&&a.jsxs(Qi,{children:[a.jsx(Xi,{children:"Error message:"}),a.jsx(Ji,{children:t.lastRunError})]}),a.jsxs(Qi,{children:[a.jsx(Xi,{children:"Total runs:"}),a.jsxs(Ji,{children:[t.runsCount||0," runs",c.createdAt&&a.jsxs(a.Fragment,{children:[", since ",c.createdAt]})]})]})]}),f.isGoogleSheets&&a.jsx(BS,{children:a.jsxs(Ce,{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(Wo,{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 Va=(e=>(e.IDLE="IDLE",e.READY="READY",e.PROCESSING="PROCESSING",e.SUCCESS="SUCCESS",e.ERROR="ERROR",e.CANCELLING="CANCELLING",e.CANCELLED="CANCELLED",e))(Va||{});const IQ=e=>{switch(e){case Or.DRAFT:return Bn.NEUTRAL;case Or.PUBLISHED:return Bn.SUCCESS;default:return Bn.NEUTRAL}},MQ=e=>{switch(e){case Mn.SUCCESS:return Bn.SUCCESS;case Mn.RUNNING:return Bn.INFO;case Mn.FAILED:case Mn.CANCELLED:case Mn.INTERRUPTED:return Bn.ERROR;default:return Bn.NEUTRAL}},kQ=e=>{switch(e){case En.SUCCESS:return Bn.SUCCESS;case En.RUNNING:return Bn.INFO;case En.ERROR:return Bn.ERROR;default:return Bn.NEUTRAL}},LQ=e=>{switch(e){case Mn.SUCCESS:return"Success";case Mn.RUNNING:return"Running";case Mn.FAILED:return"Failed";case Mn.CANCELLED:return"Cancelled";case Mn.INTERRUPTED:return"Interrupted";case Mn.PENDING:return"Pending";default:return"Unknown"}},PQ=e=>{switch(e){case En.SUCCESS:return"Success";case En.RUNNING:return"Running";case En.ERROR:return"Failed";default:return"Unknown"}},UQ=e=>e?[Mn.SUCCESS,Mn.FAILED,Mn.CANCELLED,Mn.INTERRUPTED].includes(e):!0,FQ=e=>e?[Va.SUCCESS,Va.ERROR,Va.CANCELLED].includes(e):!0,ZD=e=>Wt({fullyQualifiedName:Rt().min(1,"Fully qualified name is required").refine(t=>OW(t,e),t=>({message:MW(t,e)}))}),zQ=e=>Wt({pattern:Rt().min(1,"Table pattern is required").refine(t=>IW(t,e),t=>({message:kW(t,e)}))}),HQ=e=>{const t=[];return e.status.code===Or.PUBLISHED&&t.push(Fp.ALREADY_PUBLISHED),AD(e.storage)||t.push(Fp.INVALID_STORAGE),e.definition||t.push(Fp.MISSING_DEFINITION),t},VQ=e=>e.map(t=>JY[t]);function $Q(e){return e.map(t=>({id:t.id,title:t.title,status:CD.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 YD(){const{state:e,dispatch:t}=QY(),n=h.useCallback(async()=>{t({type:"SET_LOADING"});try{const i=await yn.getDataMarts(),c=$Q(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 yn.deleteDataMart(i),Ie({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}),Ie({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}}/**
|
|
752
|
-
* table-core
|
|
753
|
-
*
|
|
754
|
-
* Copyright (c) TanStack
|
|
755
|
-
*
|
|
756
|
-
* This source code is licensed under the MIT license found in the
|
|
757
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
758
|
-
*
|
|
759
|
-
* @license MIT
|
|
760
|
-
*/function el(e,t){return typeof e=="function"?e(t):e}function Ga(e,t){return n=>{t.setState(r=>({...r,[e]:el(n,r[e])}))}}function Ry(e){return e instanceof Function}function GQ(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function BQ(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 st(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((g,y)=>r[y]!==g)))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 g=Math.round((Date.now()-c)*100)/100,y=Math.round((Date.now()-m)*100)/100,x=y/16,v=(S,C)=>{for(S=String(S);S.length<C;)S=" "+S;return S};console.info(`%c⏱ ${v(y,5)} /${v(g,5)} ms`,`
|
|
761
|
-
font-size: .6rem;
|
|
762
|
-
font-weight: bold;
|
|
763
|
-
color: hsl(${Math.max(0,Math.min(120-120*x,120))}deg 100% 31%);`,n==null?void 0:n.key)}return s}}function ot(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 qQ(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:st(()=>[e,n,t,i],(c,u,f,m)=>({table:c,column:u,row:f,cell:m,getValue:m.getValue,renderValue:m.renderValue}),ot(e.options,"debugCells"))};return e._features.forEach(c=>{c.createCell==null||c.createCell(i,n,t,e)},{}),i}function KQ(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,g;if(u.accessorFn?g=u.accessorFn:f&&(f.includes(".")?g=x=>{let v=x;for(const C of f.split(".")){var S;v=(S=v)==null?void 0:S[C]}return v}:g=x=>x[u.accessorKey]),!m)throw new Error;let y={id:`${String(m)}`,accessorFn:g,parent:r,depth:n,columnDef:u,columns:[],getFlatColumns:st(()=>[!0],()=>{var x;return[y,...(x=y.columns)==null?void 0:x.flatMap(v=>v.getFlatColumns())]},ot(e.options,"debugColumns")),getLeafColumns:st(()=>[e._getOrderColumnsFn()],x=>{var v;if((v=y.columns)!=null&&v.length){let S=y.columns.flatMap(C=>C.getLeafColumns());return x(S)}return[y]},ot(e.options,"debugColumns"))};for(const x of e._features)x.createColumn==null||x.createColumn(y,e);return y}const Hr="debugHeaders";function e_(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 ZQ={createTable:e=>{e.getHeaderGroups=st(()=>[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(y=>n.find(x=>x.id===y)).filter(Boolean))!=null?i:[],f=(c=s==null?void 0:s.map(y=>n.find(x=>x.id===y)).filter(Boolean))!=null?c:[],m=n.filter(y=>!(r!=null&&r.includes(y.id))&&!(s!=null&&s.includes(y.id)));return pp(t,[...u,...m,...f],e)},ot(e.options,Hr)),e.getCenterHeaderGroups=st(()=>[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))),pp(t,n,e,"center")),ot(e.options,Hr)),e.getLeftHeaderGroups=st(()=>[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 pp(t,i,e,"left")},ot(e.options,Hr)),e.getRightHeaderGroups=st(()=>[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 pp(t,i,e,"right")},ot(e.options,Hr)),e.getFooterGroups=st(()=>[e.getHeaderGroups()],t=>[...t].reverse(),ot(e.options,Hr)),e.getLeftFooterGroups=st(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),ot(e.options,Hr)),e.getCenterFooterGroups=st(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),ot(e.options,Hr)),e.getRightFooterGroups=st(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),ot(e.options,Hr)),e.getFlatHeaders=st(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),ot(e.options,Hr)),e.getLeftFlatHeaders=st(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),ot(e.options,Hr)),e.getCenterFlatHeaders=st(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),ot(e.options,Hr)),e.getRightFlatHeaders=st(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),ot(e.options,Hr)),e.getCenterLeafHeaders=st(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ot(e.options,Hr)),e.getLeftLeafHeaders=st(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ot(e.options,Hr)),e.getRightLeafHeaders=st(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ot(e.options,Hr)),e.getLeafHeaders=st(()=>[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(g=>g.getLeafHeaders()).flat()},ot(e.options,Hr))}};function pp(e,t,n,r){var s,i;let c=0;const u=function(x,v){v===void 0&&(v=1),c=Math.max(c,v),x.filter(S=>S.getIsVisible()).forEach(S=>{var C;(C=S.columns)!=null&&C.length&&u(S.columns,v+1)},0)};u(e);let f=[];const m=(x,v)=>{const S={depth:v,id:[r,`${v}`].filter(Boolean).join("_"),headers:[]},C=[];x.forEach(E=>{const R=[...C].reverse()[0],j=E.column.depth===S.depth;let _,A=!1;if(j&&E.column.parent?_=E.column.parent:(_=E.column,A=!0),R&&(R==null?void 0:R.column)===_)R.subHeaders.push(E);else{const O=e_(n,_,{id:[r,v,_.id,E==null?void 0:E.id].filter(Boolean).join("_"),isPlaceholder:A,placeholderId:A?`${C.filter(I=>I.column===_).length}`:void 0,depth:v,index:C.length});O.subHeaders.push(E),C.push(O)}S.headers.push(E),E.headerGroup=S}),f.push(S),v>0&&m(C,v-1)},g=t.map((x,v)=>e_(n,x,{depth:c,index:v}));m(g,c-1),f.reverse();const y=x=>x.filter(S=>S.column.getIsVisible()).map(S=>{let C=0,E=0,R=[0];S.subHeaders&&S.subHeaders.length?(R=[],y(S.subHeaders).forEach(_=>{let{colSpan:A,rowSpan:O}=_;C+=A,R.push(O)})):C=1;const j=Math.min(...R);return E=E+j,S.colSpan=C,S.rowSpan=E,{colSpan:C,rowSpan:E}});return y((s=(i=f[0])==null?void 0:i.headers)!=null?s:[]),f}const qS=(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:()=>BQ(u.subRows,f=>f.subRows),getParentRow:()=>u.parentId?e.getRow(u.parentId,!0):void 0,getParentRows:()=>{let f=[],m=u;for(;;){const g=m.getParentRow();if(!g)break;f.push(g),m=g}return f.reverse()},getAllCells:st(()=>[e.getAllLeafColumns()],f=>f.map(m=>qQ(e,u,m,m.id)),ot(e.options,"debugRows")),_getAllCellsByColumnId:st(()=>[u.getAllCells()],f=>f.reduce((m,g)=>(m[g.column.id]=g,m),{}),ot(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},YQ={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()}}},WD=(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))};WD.autoRemove=e=>js(e);const QD=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};QD.autoRemove=e=>js(e);const XD=(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())};XD.autoRemove=e=>js(e);const JD=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};JD.autoRemove=e=>js(e);const eO=(e,t,n)=>!n.some(r=>{var s;return!((s=e.getValue(t))!=null&&s.includes(r))});eO.autoRemove=e=>js(e)||!(e!=null&&e.length);const tO=(e,t,n)=>n.some(r=>{var s;return(s=e.getValue(t))==null?void 0:s.includes(r)});tO.autoRemove=e=>js(e)||!(e!=null&&e.length);const nO=(e,t,n)=>e.getValue(t)===n;nO.autoRemove=e=>js(e);const rO=(e,t,n)=>e.getValue(t)==n;rO.autoRemove=e=>js(e);const KS=(e,t,n)=>{let[r,s]=n;const i=e.getValue(t);return i>=r&&i<=s};KS.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]};KS.autoRemove=e=>js(e)||js(e[0])&&js(e[1]);const Vo={includesString:WD,includesStringSensitive:QD,equalsString:XD,arrIncludes:JD,arrIncludesAll:eO,arrIncludesSome:tO,equals:nO,weakEquals:rO,inNumberRange:KS};function js(e){return e==null||e===""}const WQ={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Ga("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);return typeof r=="string"?Vo.includesString:typeof r=="number"?Vo.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?Vo.equals:Array.isArray(r)?Vo.arrIncludes:Vo.weakEquals},e.getFilterFn=()=>{var n,r;return Ry(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:Vo[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(g=>g.id===e.id),c=el(n,i?i.value:void 0);if(t_(s,c,e)){var u;return(u=r==null?void 0:r.filter(g=>g.id!==e.id))!=null?u:[]}const f={id:e.id,value:c};if(i){var m;return(m=r==null?void 0:r.map(g=>g.id===e.id?f:g))!=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=el(t,s))==null?void 0:i.filter(c=>{const u=n.find(f=>f.id===c.id);if(u){const f=u.getFilterFn();if(t_(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 t_(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const QQ=(e,t,n)=>n.reduce((r,s)=>{const i=s.getValue(e);return r+(typeof i=="number"?i:0)},0),XQ=(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},JQ=(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},eX=(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]},tX=(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},nX=(e,t)=>{if(!t.length)return;const n=t.map(i=>i.getValue(e));if(!GQ(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},rX=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),aX=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,sX=(e,t)=>t.length,L0={sum:QQ,min:XQ,max:JQ,extent:eX,mean:tX,median:nX,unique:rX,uniqueCount:aX,count:sX},oX={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:Ga("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((r=t.options.enableGrouping)!=null?r:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);if(typeof r=="number")return L0.sum;if(Object.prototype.toString.call(r)==="[object Date]")return L0.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return Ry(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:L0[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 iX(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 lX={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Ga("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=st(n=>[Af(t,n)],n=>n.findIndex(r=>r.id===e.id),ot(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var r;return((r=Af(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const s=Af(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=st(()=>[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(g=>g.id===f);m>-1&&i.push(u.splice(m,1)[0])}i=[...i,...u]}return iX(i,n,r)},ot(e.options,"debugTable"))}},P0=()=>({left:[],right:[]}),cX={getInitialState:e=>({columnPinning:P0(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Ga("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(s=>s.id).filter(Boolean);t.setColumnPinning(s=>{var i,c;if(n==="right"){var u,f;return{left:((u=s==null?void 0:s.left)!=null?u:[]).filter(y=>!(r!=null&&r.includes(y))),right:[...((f=s==null?void 0:s.right)!=null?f:[]).filter(y=>!(r!=null&&r.includes(y))),...r]}}if(n==="left"){var m,g;return{left:[...((m=s==null?void 0:s.left)!=null?m:[]).filter(y=>!(r!=null&&r.includes(y))),...r],right:((g=s==null?void 0:s.right)!=null?g:[]).filter(y=>!(r!=null&&r.includes(y)))}}return{left:((i=s==null?void 0:s.left)!=null?i:[]).filter(y=>!(r!=null&&r.includes(y))),right:((c=s==null?void 0:s.right)!=null?c:[]).filter(y=>!(r!=null&&r.includes(y)))}})},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=st(()=>[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))},ot(t.options,"debugRows")),e.getLeftVisibleCells=st(()=>[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"})),ot(t.options,"debugRows")),e.getRightVisibleCells=st(()=>[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"})),ot(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?P0():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:P0())},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=st(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(s=>s.id===r)).filter(Boolean),ot(e.options,"debugColumns")),e.getRightLeafColumns=st(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(s=>s.id===r)).filter(Boolean),ot(e.options,"debugColumns")),e.getCenterLeafColumns=st(()=>[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))},ot(e.options,"debugColumns"))}};function uX(e){return e||(typeof document<"u"?document:null)}const gp={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},U0=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),dX={getDefaultColumnDef:()=>gp,getInitialState:e=>({columnSizing:{},columnSizingInfo:U0(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Ga("columnSizing",e),onColumnSizingInfoChange:Ga("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,s;const i=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:gp.minSize,(r=i??e.columnDef.size)!=null?r:gp.size),(s=e.columnDef.maxSize)!=null?s:gp.maxSize)},e.getStart=st(n=>[n,Af(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((s,i)=>s+i.getSize(),0),ot(t.options,"debugColumns")),e.getAfter=st(n=>[n,Af(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((s,i)=>s+i.getSize(),0),ot(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(),F0(i)&&i.touches&&i.touches.length>1))return;const c=e.getSize(),u=e?e.getLeafHeaders().map(R=>[R.column.id,R.column.getSize()]):[[r.id,r.getSize()]],f=F0(i)?Math.round(i.touches[0].clientX):i.clientX,m={},g=(R,j)=>{typeof j=="number"&&(t.setColumnSizingInfo(_=>{var A,O;const I=t.options.columnResizeDirection==="rtl"?-1:1,T=(j-((A=_==null?void 0:_.startOffset)!=null?A:0))*I,D=Math.max(T/((O=_==null?void 0:_.startSize)!=null?O:0),-.999999);return _.columnSizingStart.forEach(L=>{let[H,B]=L;m[H]=Math.round(Math.max(B+B*D,0)*100)/100}),{..._,deltaOffset:T,deltaPercentage:D}}),(t.options.columnResizeMode==="onChange"||R==="end")&&t.setColumnSizing(_=>({..._,...m})))},y=R=>g("move",R),x=R=>{g("end",R),t.setColumnSizingInfo(j=>({...j,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},v=uX(n),S={moveHandler:R=>y(R.clientX),upHandler:R=>{v==null||v.removeEventListener("mousemove",S.moveHandler),v==null||v.removeEventListener("mouseup",S.upHandler),x(R.clientX)}},C={moveHandler:R=>(R.cancelable&&(R.preventDefault(),R.stopPropagation()),y(R.touches[0].clientX),!1),upHandler:R=>{var j;v==null||v.removeEventListener("touchmove",C.moveHandler),v==null||v.removeEventListener("touchend",C.upHandler),R.cancelable&&(R.preventDefault(),R.stopPropagation()),x((j=R.touches[0])==null?void 0:j.clientX)}},E=fX()?{passive:!1}:!1;F0(i)?(v==null||v.addEventListener("touchmove",C.moveHandler,E),v==null||v.addEventListener("touchend",C.upHandler,E)):(v==null||v.addEventListener("mousemove",S.moveHandler,E),v==null||v.addEventListener("mouseup",S.upHandler,E)),t.setColumnSizingInfo(R=>({...R,startOffset:f,startSize:c,deltaOffset:0,deltaPercentage:0,columnSizingStart:u,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?U0():(n=e.initialState.columnSizingInfo)!=null?n:U0())},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 yp=null;function fX(){if(typeof yp=="boolean")return yp;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 yp=e,yp}function F0(e){return e.type==="touchstart"}const hX={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Ga("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const s=e.columns;return(n=s.length?s.some(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=st(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),ot(t.options,"debugRows")),e.getVisibleCells=st(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,s)=>[...n,...r,...s],ot(t.options,"debugRows"))},createTable:e=>{const t=(n,r)=>st(()=>[r(),r().filter(s=>s.getIsVisible()).map(s=>s.id).join("_")],s=>s.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),ot(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 Af(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const mX={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()}}},pX={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Ga("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,r,s,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=()=>Vo.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return Ry(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:Vo[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},gX={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Ga("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,s;if(!t){e._queue(()=>{t=!0});return}if((r=(s=e.options.autoResetAll)!=null?s:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var s,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()}}}},K1=0,Z1=10,z0=()=>({pageIndex:K1,pageSize:Z1}),yX={getInitialState:e=>({...e,pagination:{...z0(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Ga("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,s;if(!t){e._queue(()=>{t=!0});return}if((r=(s=e.options.autoResetAll)!=null?s:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const s=i=>el(r,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(s)},e.resetPagination=r=>{var s;e.setPagination(r?z0():(s=e.initialState.pagination)!=null?s:z0())},e.setPageIndex=r=>{e.setPagination(s=>{let i=el(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?K1:(s=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?s:K1)},e.resetPageSize=r=>{var s,i;e.setPageSize(r?Z1:(s=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?s:Z1)},e.setPageSize=r=>{e.setPagination(s=>{const i=Math.max(1,el(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=el(r,(i=e.options.pageCount)!=null?i:-1);return typeof c=="number"&&(c=Math.max(-1,c)),{...s,pageCount:c}}),e.getPageOptions=st(()=>[e.getPageCount()],r=>{let s=[];return r&&r>0&&(s=[...new Array(r)].fill(null).map((i,c)=>c)),s},ot(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}}},H0=()=>({top:[],bottom:[]}),xX={getInitialState:e=>({rowPinning:H0(),...e}),getDefaultOptions:e=>({onRowPinningChange:Ga("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,g;if(n==="bottom"){var y,x;return{top:((y=f==null?void 0:f.top)!=null?y:[]).filter(C=>!(u!=null&&u.has(C))),bottom:[...((x=f==null?void 0:f.bottom)!=null?x:[]).filter(C=>!(u!=null&&u.has(C))),...Array.from(u)]}}if(n==="top"){var v,S;return{top:[...((v=f==null?void 0:f.top)!=null?v:[]).filter(C=>!(u!=null&&u.has(C))),...Array.from(u)],bottom:((S=f==null?void 0:f.bottom)!=null?S:[]).filter(C=>!(u!=null&&u.has(C)))}}return{top:((m=f==null?void 0:f.top)!=null?m:[]).filter(C=>!(u!=null&&u.has(C))),bottom:((g=f==null?void 0:f.bottom)!=null?g:[]).filter(C=>!(u!=null&&u.has(C)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:s}=t.options;return typeof r=="function"?r(e):(n=r??s)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:s}=t.getState().rowPinning,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?H0():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:H0())},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=st(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),ot(e.options,"debugRows")),e.getBottomRows=st(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),ot(e.options,"debugRows")),e.getCenterRows=st(()=>[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))},ot(e.options,"debugRows"))}},vX={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Ga("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},s=e.getPreGroupedRowModel().flatRows;return t?s.forEach(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=>{Y1(s,i.id,r,!0,e)}),s}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=st(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?V0(e,n):{rows:[],flatRows:[],rowsById:{}},ot(e.options,"debugTable")),e.getFilteredSelectedRowModel=st(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?V0(e,n):{rows:[],flatRows:[],rowsById:{}},ot(e.options,"debugTable")),e.getGroupedSelectedRowModel=st(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?V0(e,n):{rows:[],flatRows:[],rowsById:{}},ot(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 Y1(u,e.id,n,(c=r==null?void 0:r.selectChildren)!=null?c:!0,t),u})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return ZS(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return W1(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return W1(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)}}}},Y1=(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=>Y1(e,u.id,n,r,s))};function V0(e,t){const n=e.getState().rowSelection,r=[],s={},i=function(c,u){return c.map(f=>{var m;const g=ZS(f,n);if(g&&(r.push(f),s[f.id]=f),(m=f.subRows)!=null&&m.length&&(f={...f,subRows:i(f.subRows)}),g)return f}).filter(Boolean)};return{rows:i(t.rows),flatRows:r,rowsById:s}}function ZS(e,t){var n;return(n=t[e.id])!=null?n:!1}function W1(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()&&(ZS(c,t)?i=!0:s=!1),c.subRows&&c.subRows.length)){const u=W1(c,t);u==="all"?i=!0:(u==="some"&&(i=!0),s=!1)}}),s?"all":i?"some":!1}const Q1=/([0-9]+)/gm,bX=(e,t,n)=>aO(ul(e.getValue(n)).toLowerCase(),ul(t.getValue(n)).toLowerCase()),SX=(e,t,n)=>aO(ul(e.getValue(n)),ul(t.getValue(n))),CX=(e,t,n)=>YS(ul(e.getValue(n)).toLowerCase(),ul(t.getValue(n)).toLowerCase()),EX=(e,t,n)=>YS(ul(e.getValue(n)),ul(t.getValue(n))),wX=(e,t,n)=>{const r=e.getValue(n),s=t.getValue(n);return r>s?1:r<s?-1:0},RX=(e,t,n)=>YS(e.getValue(n),t.getValue(n));function YS(e,t){return e===t?0:e>t?1:-1}function ul(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function aO(e,t){const n=e.split(Q1).filter(Boolean),r=t.split(Q1).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 hf={alphanumeric:bX,alphanumericCaseSensitive:SX,text:CX,textCaseSensitive:EX,datetime:wX,basic:RX},jX={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Ga("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const s of n){const i=s==null?void 0:s.getValue(e.id);if(Object.prototype.toString.call(i)==="[object Date]")return hf.datetime;if(typeof i=="string"&&(r=!0,i.split(Q1).length>1))return hf.alphanumeric}return r?hf.text:hf.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 Ry(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:hf[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=[],g,y=i?n:s==="desc";if(c!=null&&c.length&&e.getCanMultiSort()&&r?u?g="toggle":g="add":c!=null&&c.length&&f!==c.length-1?g="replace":u?g="toggle":g="replace",g==="toggle"&&(i||s||(g="remove")),g==="add"){var x;m=[...c,{id:e.id,desc:y}],m.splice(0,m.length-((x=t.options.maxMultiSortColCount)!=null?x:Number.MAX_SAFE_INTEGER))}else g==="toggle"?m=c.map(v=>v.id===e.id?{...v,desc:y}:v):g==="remove"?m=c.filter(v=>v.id!==e.id):m=[{id:e.id,desc:y}];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())}},TX=[ZQ,hX,lX,cX,YQ,WQ,mX,pX,jX,oX,gX,yX,xX,vX,dX];function _X(e){var t,n;const r=[...TX,...(t=e._features)!=null?t:[]];let s={_features:r};const i=s._features.reduce((x,v)=>Object.assign(x,v.getDefaultOptions==null?void 0:v.getDefaultOptions(s)),{}),c=x=>s.options.mergeOptions?s.options.mergeOptions(i,x):{...i,...x};let f={...{},...(n=e.initialState)!=null?n:{}};s._features.forEach(x=>{var v;f=(v=x.getInitialState==null?void 0:x.getInitialState(f))!=null?v:f});const m=[];let g=!1;const y={_features:r,options:{...i,...e},initialState:f,_queue:x=>{m.push(x),g||(g=!0,Promise.resolve().then(()=>{for(;m.length;)m.shift()();g=!1}).catch(v=>setTimeout(()=>{throw v})))},reset:()=>{s.setState(s.initialState)},setOptions:x=>{const v=el(x,s.options);s.options=c(v)},getState:()=>s.options.state,setState:x=>{s.options.onStateChange==null||s.options.onStateChange(x)},_getRowId:(x,v,S)=>{var C;return(C=s.options.getRowId==null?void 0:s.options.getRowId(x,v,S))!=null?C:`${S?[S.id,v].join("."):v}`},getCoreRowModel:()=>(s._getCoreRowModel||(s._getCoreRowModel=s.options.getCoreRowModel(s)),s._getCoreRowModel()),getRowModel:()=>s.getPaginationRowModel(),getRow:(x,v)=>{let S=(v?s.getPrePaginationRowModel():s.getRowModel()).rowsById[x];if(!S&&(S=s.getCoreRowModel().rowsById[x],!S))throw new Error;return S},_getDefaultColumnDef:st(()=>[s.options.defaultColumn],x=>{var v;return x=(v=x)!=null?v:{},{header:S=>{const C=S.header.column.columnDef;return C.accessorKey?C.accessorKey:C.accessorFn?C.id:null},cell:S=>{var C,E;return(C=(E=S.renderValue())==null||E.toString==null?void 0:E.toString())!=null?C:null},...s._features.reduce((S,C)=>Object.assign(S,C.getDefaultColumnDef==null?void 0:C.getDefaultColumnDef()),{}),...x}},ot(e,"debugColumns")),_getColumnDefs:()=>s.options.columns,getAllColumns:st(()=>[s._getColumnDefs()],x=>{const v=function(S,C,E){return E===void 0&&(E=0),S.map(R=>{const j=KQ(s,R,E,C),_=R;return j.columns=_.columns?v(_.columns,j,E+1):[],j})};return v(x)},ot(e,"debugColumns")),getAllFlatColumns:st(()=>[s.getAllColumns()],x=>x.flatMap(v=>v.getFlatColumns()),ot(e,"debugColumns")),_getAllFlatColumnsById:st(()=>[s.getAllFlatColumns()],x=>x.reduce((v,S)=>(v[S.id]=S,v),{}),ot(e,"debugColumns")),getAllLeafColumns:st(()=>[s.getAllColumns(),s._getOrderColumnsFn()],(x,v)=>{let S=x.flatMap(C=>C.getLeafColumns());return v(S)},ot(e,"debugColumns")),getColumn:x=>s._getAllFlatColumnsById()[x]};Object.assign(s,y);for(let x=0;x<s._features.length;x++){const v=s._features[x];v==null||v.createTable==null||v.createTable(s)}return s}function xl(){return e=>st(()=>[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 g=qS(e,e._getRowId(s[m],m,c),s[m],m,i,void 0,c==null?void 0:c.id);if(n.flatRows.push(g),n.rowsById[g.id]=g,u.push(g),e.options.getSubRows){var f;g.originalSubRows=e.options.getSubRows(s[m],m),(f=g.originalSubRows)!=null&&f.length&&(g.subRows=r(g.originalSubRows,i+1,g))}}return u};return n.rows=r(t),n},ot(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function NX(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 AX(e,t,n){return n.options.filterFromLeafRows?DX(e,t,n):OX(e,t,n)}function DX(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 g=[];for(let x=0;x<f.length;x++){var y;let v=f[x];const S=qS(n,v.id,v.original,v.index,v.depth,void 0,v.parentId);if(S.columnFilters=v.columnFilters,(y=v.subRows)!=null&&y.length&&m<c){if(S.subRows=u(v.subRows,m+1),v=S,t(v)&&!S.subRows.length){g.push(v),i[v.id]=v,s.push(v);continue}if(t(v)||S.subRows.length){g.push(v),i[v.id]=v,s.push(v);continue}}else v=S,t(v)&&(g.push(v),i[v.id]=v,s.push(v))}return g};return{rows:u(e),flatRows:s,rowsById:i}}function OX(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 g=[];for(let x=0;x<f.length;x++){let v=f[x];if(t(v)){var y;if((y=v.subRows)!=null&&y.length&&m<c){const C=qS(n,v.id,v.original,v.index,v.depth,void 0,v.parentId);C.subRows=u(v.subRows,m+1),v=C}g.push(v),s.push(v),i[v.id]=v}}return g};return{rows:u(e),flatRows:s,rowsById:i}}function ud(){return e=>st(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,r)=>{if(!t.rows.length||!(n!=null&&n.length)&&!r){for(let x=0;x<t.flatRows.length;x++)t.flatRows[x].columnFilters={},t.flatRows[x].columnFiltersMeta={};return t}const s=[],i=[];(n??[]).forEach(x=>{var v;const S=e.getColumn(x.id);if(!S)return;const C=S.getFilterFn();C&&s.push({id:x.id,filterFn:C,resolvedValue:(v=C.resolveFilterValue==null?void 0:C.resolveFilterValue(x.value))!=null?v:x.value})});const c=(n??[]).map(x=>x.id),u=e.getGlobalFilterFn(),f=e.getAllLeafColumns().filter(x=>x.getCanGlobalFilter());r&&u&&f.length&&(c.push("__global__"),f.forEach(x=>{var v;i.push({id:x.id,filterFn:u,resolvedValue:(v=u.resolveFilterValue==null?void 0:u.resolveFilterValue(r))!=null?v:r})}));let m,g;for(let x=0;x<t.flatRows.length;x++){const v=t.flatRows[x];if(v.columnFilters={},s.length)for(let S=0;S<s.length;S++){m=s[S];const C=m.id;v.columnFilters[C]=m.filterFn(v,C,m.resolvedValue,E=>{v.columnFiltersMeta[C]=E})}if(i.length){for(let S=0;S<i.length;S++){g=i[S];const C=g.id;if(g.filterFn(v,C,g.resolvedValue,E=>{v.columnFiltersMeta[C]=E})){v.columnFilters.__global__=!0;break}}v.columnFilters.__global__!==!0&&(v.columnFilters.__global__=!1)}}const y=x=>{for(let v=0;v<c.length;v++)if(x.columnFilters[c[v]]===!1)return!1;return!0};return AX(t.rows,y,e)},ot(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function Dh(e){return t=>st(()=>[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,g=m+s;c=c.slice(m,g);let y;t.options.paginateExpandedRows?y={rows:c,flatRows:u,rowsById:f}:y=NX({rows:c,flatRows:u,rowsById:f}),y.flatRows=[];const x=v=>{y.flatRows.push(v),v.subRows.length&&v.subRows.forEach(x)};return y.rows.forEach(x),y},ot(t.options,"debugTable"))}function wc(){return e=>st(()=>[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(g=>({...g}));return m.sort((g,y)=>{for(let v=0;v<i.length;v+=1){var x;const S=i[v],C=c[S.id],E=C.sortUndefined,R=(x=S==null?void 0:S.desc)!=null?x:!1;let j=0;if(E){const _=g.getValue(S.id),A=y.getValue(S.id),O=_===void 0,I=A===void 0;if(O||I){if(E==="first")return O?-1:1;if(E==="last")return O?1:-1;j=O&&I?0:O?E:-E}}if(j===0&&(j=C.sortingFn(g,y,S.id)),j!==0)return R&&(j*=-1),C.invertSorting&&(j*=-1),j}return g.index-y.index}),m.forEach(g=>{var y;s.push(g),(y=g.subRows)!=null&&y.length&&(g.subRows=u(g.subRows))}),m};return{rows:u(n.rows),flatRows:s,rowsById:n.rowsById}},ot(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/**
|
|
764
|
-
* react-table
|
|
765
|
-
*
|
|
766
|
-
* Copyright (c) TanStack
|
|
767
|
-
*
|
|
768
|
-
* This source code is licensed under the MIT license found in the
|
|
769
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
770
|
-
*
|
|
771
|
-
* @license MIT
|
|
772
|
-
*/function Yu(e,t){return e?IX(e)?h.createElement(e,t):e:null}function IX(e){return MX(e)||typeof e=="function"||kX(e)}function MX(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function kX(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function vl(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=h.useState(()=>({current:_X(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 bl({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:re("w-full caption-bottom text-sm",e),...t})})}function Sl({className:e,...t}){return a.jsx("thead",{"data-slot":"table-header",className:re("[&_tr]:border-b",e),...t})}function Cl({className:e,...t}){return a.jsx("tbody",{"data-slot":"table-body",className:re("[&_tr:last-child]:border-0",e),...t})}function Tn({className:e,...t}){return a.jsx("tr",{"data-slot":"table-row",className:re("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function El({className:e,...t}){return a.jsx("th",{"data-slot":"table-head",className:re("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 Mr({className:e,...t}){return a.jsx("td",{"data-slot":"table-cell",className:re("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}var LX=Symbol("radix.slottable");function PX(e){const t=({children:n})=>a.jsx(a.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=LX,t}var sO="AlertDialog",[UX]=xr(sO,[PA]),li=PA(),oO=e=>{const{__scopeAlertDialog:t,...n}=e,r=li(t);return a.jsx(Yg,{...r,...n,modal:!0})};oO.displayName=sO;var FX="AlertDialogTrigger",zX=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=li(n);return a.jsx(wH,{...s,...r,ref:t})});zX.displayName=FX;var HX="AlertDialogPortal",iO=e=>{const{__scopeAlertDialog:t,...n}=e,r=li(t);return a.jsx(Wg,{...r,...n})};iO.displayName=HX;var VX="AlertDialogOverlay",lO=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=li(n);return a.jsx(Qg,{...s,...r,ref:t})});lO.displayName=VX;var ku="AlertDialogContent",[$X,GX]=UX(ku),BX=PX("AlertDialogContent"),cO=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...s}=e,i=li(n),c=h.useRef(null),u=ht(t,c),f=h.useRef(null);return a.jsx(bH,{contentName:ku,titleName:uO,docsSlug:"alert-dialog",children:a.jsx($X,{scope:n,cancelRef:f,children:a.jsxs(Xg,{role:"alertdialog",...i,...s,ref:u,onOpenAutoFocus:Oe(s.onOpenAutoFocus,m=>{var g;m.preventDefault(),(g=f.current)==null||g.focus({preventScroll:!0})}),onPointerDownOutside:m=>m.preventDefault(),onInteractOutside:m=>m.preventDefault(),children:[a.jsx(BX,{children:r}),a.jsx(KX,{contentRef:c})]})})})});cO.displayName=ku;var uO="AlertDialogTitle",dO=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=li(n);return a.jsx(Xb,{...s,...r,ref:t})});dO.displayName=uO;var fO="AlertDialogDescription",hO=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=li(n);return a.jsx(Jb,{...s,...r,ref:t})});hO.displayName=fO;var qX="AlertDialogAction",mO=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=li(n);return a.jsx(Jg,{...s,...r,ref:t})});mO.displayName=qX;var pO="AlertDialogCancel",gO=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:s}=GX(pO,n),i=li(n),c=ht(t,s);return a.jsx(Jg,{...i,...r,ref:c})});gO.displayName=pO;var KX=({contentRef:e})=>{const t=`\`${ku}\` requires a description for the component to be accessible for screen reader users.
|
|
773
|
-
|
|
774
|
-
You can add a description to the \`${ku}\` by passing a \`${fO}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
775
|
-
|
|
776
|
-
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 \`${ku}\`. 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.
|
|
777
|
-
|
|
778
|
-
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},ZX=oO,YX=iO,WX=lO,QX=cO,XX=mO,JX=gO,eJ=dO,tJ=hO;function nJ({...e}){return a.jsx(ZX,{"data-slot":"alert-dialog",...e})}function rJ({...e}){return a.jsx(YX,{"data-slot":"alert-dialog-portal",...e})}function aJ({className:e,...t}){return a.jsx(WX,{"data-slot":"alert-dialog-overlay",className:re("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 sJ({className:e,...t}){return a.jsxs(rJ,{children:[a.jsx(aJ,{}),a.jsx(QX,{"data-slot":"alert-dialog-content",className:re("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 oJ({className:e,...t}){return a.jsx("div",{"data-slot":"alert-dialog-header",className:re("flex flex-col gap-2 text-center sm:text-left",e),...t})}function iJ({className:e,...t}){return a.jsx("div",{"data-slot":"alert-dialog-footer",className:re("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function lJ({className:e,...t}){return a.jsx(eJ,{"data-slot":"alert-dialog-title",className:re("text-lg font-semibold",e),...t})}function cJ({className:e,...t}){return a.jsx(tJ,{"data-slot":"alert-dialog-description",className:re("text-muted-foreground text-sm",e),...t})}function uJ({className:e,...t}){return a.jsx(XX,{className:re(Zb(),e),...t})}function dJ({className:e,...t}){return a.jsx(JX,{className:re(Zb({variant:"outline"}),e),...t})}const yO=["facebook","linkedin","tiktok","microsoft","connector","sql","blank"],xO={facebook:{title:"Facebook Ads",datamartTitle:"Facebook Ads Data Mart",connectorSourceTitle:"FacebookMarketing",definitionType:$e.CONNECTOR,icon:kK},linkedin:{title:"LinkedIn Ads",datamartTitle:"LinkedIn Ads Data Mart",connectorSourceTitle:"LinkedInAds",definitionType:$e.CONNECTOR,icon:LK},tiktok:{title:"TikTok Ads",datamartTitle:"TikTok Ads Data Mart",connectorSourceTitle:"TikTokAds",definitionType:$e.CONNECTOR,icon:PK},microsoft:{title:"Microsoft Ads",datamartTitle:"Microsoft Ads Data Mart",connectorSourceTitle:"MicrosoftAds",definitionType:$e.CONNECTOR,icon:UK},connector:{title:"Other connector",datamartTitle:"Connector-based Data Mart",definitionType:$e.CONNECTOR,icon:qb},sql:{title:"SQL query",datamartTitle:"SQL-based Data Mart",definitionType:$e.SQL,icon:Bb},blank:{title:"Blank Data Mart",datamartTitle:"New Data Mart",icon:Kp}},n_=yO.map(e=>({key:e,...xO[e]}));function fJ(e){if(!e||!yO.includes(e))return;const t=e;return{key:t,...xO[t]}}function hJ({children:e,className:t="",...n}){return a.jsx("div",{className:"dm-card",children:a.jsx("div",{className:re("-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 mJ({children:e,className:t="",...n}){return a.jsx("div",{className:re("pb-2",t),...n,children:e})}function pJ({children:e,className:t="",...n}){return a.jsx("h2",{className:re("mb-6 text-4xl font-semibold xl:text-5xl",t),...n,children:e})}function gJ({children:e,className:t="",...n}){return a.jsx("p",{className:re("text-muted-foreground text-lg",t),...n,children:e})}function yJ({children:e,rings:t=7,className:n="",...r}){return a.jsxs("div",{className:re("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 xJ({children:e,className:t="",...n}){return a.jsx("div",{className:re("w-full space-y-8 lg:w-[70%] 2xl:w-[65%]",t),...n,children:e})}function $0({separator:e=!0,children:t,className:n="",...r}){return a.jsx("section",{className:re("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 r_({children:e,className:t="",...n}){return a.jsx("h3",{className:re("mb-4 text-xl font-medium",t),...n,children:e})}function G0({children:e,className:t="",...n}){return a.jsx("div",{className:re("flex flex-wrap items-center gap-4",t),...n,children:e})}function xp({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:re("flex items-center gap-2"),children:[t,n]});return e?a.jsx(Ce,{asChild:!0,variant:r,size:s??f,className:re(r==="ghost"?"text-muted-foreground":"",i),...u,children:a.jsx(na,{to:e,target:c,children:m})}):a.jsx(Ce,{variant:r,size:s??f,className:i,...u,children:m})}function vJ(){const{scope:e}=ii(),t=n_.filter(r=>r.definitionType===$e.CONNECTOR),n=n_.filter(r=>r.definitionType!==$e.CONNECTOR);return a.jsxs(hJ,{children:[a.jsx(yJ,{children:a.jsx(MK,{className:"animate-icon-entrance","aria-label":"Data Mart creation illustration"})}),a.jsxs(xJ,{children:[a.jsxs(mJ,{children:[a.jsx(pJ,{children:"Let’s Build Your First Data Mart"}),a.jsx(gJ,{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($0,{children:[a.jsx(r_,{children:"Connect a data source"}),a.jsx(G0,{children:t.map(r=>a.jsx(xp,{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($0,{children:[a.jsx(r_,{children:"Use existing SQL or start from scratch"}),a.jsx(G0,{children:n.map((r,s)=>a.jsxs(a.Fragment,{children:[a.jsx(xp,{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($0,{separator:!1,children:a.jsxs(G0,{children:[a.jsx(xp,{href:"https://www.youtube.com/playlist?list=PLvcNVLV5BVbHHCekyAZBEIVnlC4i1qcHx",icon:a.jsx(iA,{className:"h-4 w-4"}),title:"Watch a 2-minute demo",variant:"ghost",target:"_blank"}),a.jsx(xp,{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(DP,{className:"h-4 w-4"}),title:"Core concepts",variant:"ghost",target:"_blank"})]})})]})]})}function bJ(){return a.jsx(Dr,{className:"bg-muted/50 h-72 w-full rounded-md border-b border-gray-200 dark:border-white/10 dark:bg-white/4"})}const fu={DEFAULT_SORTING_COLUMN:"createdAt",DEFAULT_EXCLUDED_COLUMNS:["actions"],STORAGE_KEYS:{SORTING_SUFFIX:"-sorting",COLUMN_VISIBILITY_SUFFIX:"-column-visibility"}},SJ={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 Rc({columns:e,storageKeyPrefix:t,defaultSortingColumn:n=fu.DEFAULT_SORTING_COLUMN,defaultColumnVisibility:r={},excludedColumnsFromSorting:s=fu.DEFAULT_EXCLUDED_COLUMNS,excludedColumnsFromVisibility:i=fu.DEFAULT_EXCLUDED_COLUMNS}){const c=h.useMemo(()=>({SORTING:`${t}${fu.STORAGE_KEYS.SORTING_SUFFIX}`,COLUMN_VISIBILITY:`${t}${fu.STORAGE_KEYS.COLUMN_VISIBILITY_SUFFIX}`}),[t]),u=h.useMemo(()=>SJ.extractColumnIds(e),[e]),f=h.useMemo(()=>u.filter(C=>!s.includes(C)),[u,s]),m=h.useCallback(()=>{const C=Xs.get(c.SORTING,"json");return C&&Array.isArray(C)&&C.length>0?C:[{id:f.includes(n)?n:f[0]??fu.DEFAULT_SORTING_COLUMN,desc:!0}]},[c.SORTING,f,n]),g=h.useCallback(()=>{const C=Xs.get(c.COLUMN_VISIBILITY,"json");if(C&&typeof C=="object"&&!Array.isArray(C)){const E={};for(const R of u)i.includes(R)||(E[R]=C[R]);return E}return r},[c.COLUMN_VISIBILITY,u,i,r]),[y,x]=h.useState(m),[v,S]=h.useState(g);return h.useEffect(()=>{y.length>0&&f.includes(y[0].id)&&Xs.set(c.SORTING,y)},[y,f,c.SORTING]),h.useEffect(()=>{const C={};for(const E of u){if(i.includes(E))continue;const R=v[E];typeof R=="boolean"&&(C[E]=R)}Xs.set(c.COLUMN_VISIBILITY,C)},[v,u,i,c.COLUMN_VISIBILITY]),{sorting:y,setSorting:x,columnVisibility:v,setColumnVisibility:S}}function CJ({columns:e,data:t,deleteDataMart:n,refetchDataMarts:r,isLoading:s}){var I;const{navigate:i,scope:c}=ii(),{sorting:u,setSorting:f,columnVisibility:m,setColumnVisibility:g}=Rc({columns:e,storageKeyPrefix:"data-mart-list",defaultColumnVisibility:{triggersCount:!1,reportsCount:!1,createdByUser:!1}}),[y,x]=h.useState([]),[v,S]=h.useState({}),[C,E]=h.useState(!1),[R,j]=h.useState(!1),_=async()=>{try{j(!0);const D=O.getSelectedRowModel().rows.map(L=>L.original.id);for(const L of D)await n(L);Sn.success(`Successfully deleted ${String(D.length)} data mart${D.length!==1?"s":""}`),S({}),await r()}catch(T){console.error("Error deleting data marts:",T),Sn.error("Failed to delete some data marts. Please try again.")}finally{j(!1),E(!1)}},A=Object.keys(v).length>0,O=vl({data:t,columns:[{id:"select",size:40,header:({table:T})=>a.jsx("button",{type:"button",role:"checkbox","aria-checked":T.getIsAllRowsSelected(),"data-state":T.getIsAllRowsSelected()?"checked":"unchecked","aria-label":"Select all rows",className:"peer border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border bg-white shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-white/8",onClick:T.getToggleAllRowsSelectedHandler(),children:T.getIsAllRowsSelected()&&a.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:a.jsx(ra,{className:"size-3.5 text-white"})})}),cell:({row:T})=>a.jsx("button",{type:"button",role:"checkbox","aria-checked":T.getIsSelected(),"data-state":T.getIsSelected()?"checked":"unchecked","aria-label":"Select row",className:"peer border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border bg-white shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-white/8",onClick:T.getToggleSelectedHandler(),children:T.getIsSelected()&&a.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:a.jsx(ra,{className:"size-3.5 text-white"})})}),enableSorting:!1,enableHiding:!1},...e],getCoreRowModel:xl(),getPaginationRowModel:Dh(),onSortingChange:f,getSortedRowModel:wc(),onColumnFiltersChange:x,getFilteredRowModel:ud(),onColumnVisibilityChange:g,onRowSelectionChange:S,state:{sorting:u,columnFilters:y,columnVisibility:m,rowSelection:v},enableRowSelection:!0});return s?a.jsx("div",{children:a.jsx(bJ,{})}):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:[A&&a.jsx(Ce,{variant:"destructive",size:"sm",className:"dm-card-toolbar-btn-delete",onClick:()=>{E(!0)},disabled:R,children:a.jsx(us,{className:"h-4 w-4"})}),a.jsxs("div",{className:"dm-card-toolbar-search",children:[a.jsx(vc,{className:"dm-card-toolbar-search-icon"}),a.jsx(Tt,{placeholder:"Search by title",value:(I=O.getColumn("title"))==null?void 0:I.getFilterValue(),onChange:T=>{var D;return(D=O.getColumn("title"))==null?void 0:D.setFilterValue(T.target.value)},className:"dm-card-toolbar-search-input"})]})]}),a.jsx("div",{className:"dm-card-toolbar-right",children:a.jsx(na,{to:c("/data-marts/create"),children:a.jsxs(Ce,{variant:"outline",className:"dm-card-toolbar-btn-primary",children:[a.jsx(ua,{className:"h-4 w-4"}),"New Data Mart"]})})})]}),a.jsx("div",{className:"dm-card-table-wrap",children:a.jsxs(bl,{className:"dm-card-table",role:"table","aria-label":"Data Marts table",children:[a.jsx(Sl,{className:"dm-card-table-header",children:O.getHeaderGroups().map(T=>a.jsx(Tn,{className:"dm-card-table-header-row",children:T.headers.map(D=>a.jsx(El,{className:"[&:has([role=checkbox])]:pl-6 [&>[role=checkbox]]:translate-y-[2px]",style:D.column.id==="select"?{width:40,minWidth:40,maxWidth:40}:D.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(D.getSize())}%`},children:D.isPlaceholder?null:Yu(D.column.columnDef.header,D.getContext())},D.id))},T.id))}),a.jsx(Cl,{className:"dm-card-table-body",children:O.getRowModel().rows.length?O.getRowModel().rows.map(T=>a.jsx(Tn,{"data-state":T.getIsSelected()&&"selected",className:"dm-card-table-body-row group",onClick:D=>{if(D.target instanceof HTMLElement&&(D.target.closest('[role="checkbox"]')||D.target.closest(".actions-cell")||D.target.closest('[role="menuitem"]')||D.target.closest('[data-state="open"]')))return;const L=T.original.id;i(`/data-marts/${L}/data-setup`)},children:T.getVisibleCells().map(D=>a.jsx(Mr,{className:`[&:has([role=checkbox])]pr-0 px-6 whitespace-normal [&>[role=checkbox]]:translate-y-[2px] ${D.column.id==="actions"?"actions-cell":""} ${D.column.id==="createdAt"?"whitespace-nowrap":""}`,style:D.column.id==="select"?{width:40,minWidth:40,maxWidth:40}:D.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(D.column.getSize())}%`},children:Yu(D.column.columnDef.cell,D.getContext())},D.id))},T.id)):a.jsx(Tn,{children:a.jsx(Mr,{colSpan:e.length+1,className:"dm-card-table-body-row-empty",children:"No results"})})})]})}),a.jsxs("div",{className:"dm-card-pagination",children:[a.jsx(Ce,{variant:"outline",size:"sm",onClick:()=>{O.previousPage()},disabled:!O.getCanPreviousPage(),children:"Previous"}),a.jsx(Ce,{variant:"outline",size:"sm",onClick:()=>{O.nextPage()},disabled:!O.getCanNextPage(),children:"Next"})]}),a.jsx(nJ,{open:C,onOpenChange:E,children:a.jsxs(sJ,{children:[a.jsxs(oJ,{children:[a.jsx(lJ,{children:"Are you sure?"}),a.jsxs(cJ,{children:["You're about to delete ",Object.keys(v).length," selected data mart",Object.keys(v).length!==1?"s":"",". This action cannot be undone."]})]}),a.jsxs(iJ,{children:[a.jsx(dJ,{disabled:R,children:"Cancel"}),a.jsx(uJ,{onClick:()=>{_()},disabled:R,className:"bg-destructive hover:bg-destructive/90",children:R?"Deleting...":"Delete"})]})]})})]}):a.jsx(vJ,{})}function vO({userProjection:e}){const{fullName:t,email:n,avatar:r}=e,s=t??n??"Unknown User",i=gD(t,n);return a.jsxs(Sy,{children:[a.jsx(Cy,{asChild:!0,children:a.jsxs("div",{className:"mx-1 inline-flex min-w-max items-center gap-1 rounded-full bg-neutral-100 py-1 pr-3 pl-1 dark:bg-neutral-900",children:[a.jsx(q1,{avatar:r,initials:i,displayName:s,size:Mu.SMALL}),a.jsx("span",{className:"text-muted-foreground inline text-sm leading-tight","aria-label":s,children:s})]})}),a.jsx(Ey,{side:"top",align:"start",className:"w-max p-3",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(q1,{avatar:r,initials:i,displayName:s,size:Mu.LARGE}),a.jsxs("div",{className:"grid text-left text-sm leading-tight",children:[a.jsx("span",{className:"truncate font-medium",children:t??n??"Unknown User"}),n&&a.jsx("span",{className:"text-muted-foreground truncate text-xs",children:n})]})]})})]})}function WS({...e}){return a.jsx(Yg,{"data-slot":"dialog",...e})}function EJ({...e}){return a.jsx(Wg,{"data-slot":"dialog-portal",...e})}function wJ({className:e,...t}){return a.jsx(Qg,{"data-slot":"dialog-overlay",className:re("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 QS({className:e,children:t,showCloseButton:n=!0,...r}){return a.jsxs(EJ,{"data-slot":"dialog-portal",children:[a.jsx(wJ,{}),a.jsxs(Xg,{"data-slot":"dialog-content",className:re("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(Jg,{"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(Vu,{}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function XS({className:e,...t}){return a.jsx("div",{"data-slot":"dialog-header",className:re("flex flex-col gap-2 text-center sm:text-left",e),...t})}function RJ({className:e,...t}){return a.jsx("div",{"data-slot":"dialog-footer",className:re("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function JS({className:e,...t}){return a.jsx(Xb,{"data-slot":"dialog-title",className:re("text-lg leading-none font-semibold",e),...t})}function eC({className:e,...t}){return a.jsx(Jb,{"data-slot":"dialog-description",className:re("text-muted-foreground text-sm",e),...t})}const jJ=Ju("",{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 Lu({className:e,variant:t,...n}){return t==="brand"?a.jsx(Ce,{variant:"default",className:re(jJ({variant:t}),e),...n}):a.jsx(Ce,{variant:t,className:e,...n})}const yr=({open:e,onOpenChange:t,title:n,description:r,confirmLabel:s="Confirm",cancelLabel:i,onConfirm:c,onCancel:u,variant:f="destructive",children:m})=>{const g=()=>{t(!1),u==null||u()};return a.jsx(WS,{open:e,onOpenChange:t,children:a.jsxs(QS,{children:[a.jsxs(XS,{children:[a.jsx(JS,{children:n}),a.jsx(eC,{children:r})]}),m,a.jsxs(RJ,{children:[i&&a.jsx(Lu,{variant:"secondary",onClick:g,children:i}),a.jsx(Lu,{variant:f,onClick:c,children:s})]})]})})},TJ=({row:e,onDeleteSuccess:t})=>{const{scope:n}=ii(),[r,s]=h.useState(!1),[i,c]=h.useState(!1),{deleteDataMart:u,refreshList:f}=YD(),m=async()=>{try{await u(e.original.id),s(!1),await f(),t==null||t()}catch(g){console.error("Failed to delete data mart:",g)}};return a.jsxs("div",{className:"text-right",children:[a.jsxs(Lr,{open:i,onOpenChange:c,children:[a.jsx(Pr,{asChild:!0,children:a.jsx(Ce,{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(Is,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsxs(Ur,{align:"end",children:[a.jsx(Ot,{children:a.jsxs(na,{to:n(`/data-marts/${e.original.id}/data-setup`),className:"flex gap-2 text-left",children:[a.jsx(td,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),a.jsx("span",{children:"Edit"})]})}),a.jsx(wa,{}),a.jsxs(Ot,{onClick:()=>{s(!0)},children:[a.jsx(us,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),a.jsx("span",{className:"text-red-600",children:"Delete"})]})]})]}),a.jsx(yr,{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"})]})},a_={types:{[$e.SQL]:{type:$e.SQL,displayName:"SQL",icon:Bb},[$e.TABLE]:{type:$e.TABLE,displayName:"Table",icon:cA},[$e.VIEW]:{type:$e.VIEW,displayName:"View",icon:LP},[$e.TABLE_PATTERN]:{type:$e.TABLE_PATTERN,displayName:"Pattern",icon:O7},[$e.CONNECTOR]:{type:$e.CONNECTOR,displayName:"Connector",icon:qb}},getInfo(e){return e?this.types[e]:{type:null,displayName:"—",icon:()=>null}}};var jn=(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))(jn||{});const Fi={[jn.TITLE]:"Title",[jn.DEFINITION_TYPE]:"Input Source",[jn.STORAGE_TYPE]:"Storage",[jn.STATUS]:"Status",[jn.TRIGGERS_COUNT]:"Triggers",[jn.REPORTS_COUNT]:"Reports",[jn.CREATED_AT]:"Created at",[jn.CREATED_BY_USER]:"Created by"};function pr({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(Ce,{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(Hu,{className:"text-foreground h-4 w-4"}),r==="desc"&&a.jsx(fo,{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(Hu,{className:"text-muted-foreground h-4 w-4"})})]})]})}function dd({table:e,getColumnLabel:t}){return a.jsx("div",{className:"text-right",children:a.jsxs(Lr,{children:[a.jsx(Pr,{asChild:!0,children:a.jsx(Ce,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:a.jsx(Is,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsx(Ur,{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(Ot,{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(ra,{className:"size-3.5 text-white"})})}),a.jsx("span",{children:r})]})},n.id)})})]})})}const _J=({onDeleteSuccess:e,connectors:t=[]}={})=>[{accessorKey:jn.TITLE,size:40,header:({column:n})=>a.jsx(pr,{column:n,children:Fi[jn.TITLE]}),cell:({row:n})=>a.jsx("div",{children:n.getValue("title")})},{accessorFn:n=>{const r=n.definitionType;if(r===$e.CONNECTOR){const s=n.definition,i=t.find(c=>c.name===s.connector.source.name);return(i==null?void 0:i.displayName)??(i==null?void 0:i.name)??"Unknown"}else{const{displayName:s}=a_.getInfo(r);return s}},id:jn.DEFINITION_TYPE,size:15,header:({column:n})=>a.jsx(pr,{column:n,children:Fi[jn.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(Ec,{base64:i.logoBase64,size:18}),(i==null?void 0:i.displayName)??"Unknown"]})}default:{const{displayName:s,icon:i}=a_.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:jn.STORAGE_TYPE,size:15,header:({column:n})=>a.jsx(pr,{column:n,children:Fi[jn.STORAGE_TYPE]}),cell:({row:n})=>{const r=n.getValue("storageType"),s=n.original.storageTitle,{displayName:i,icon:c}=yl.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:jn.CREATED_AT,size:15,header:({column:n})=>a.jsx(pr,{column:n,children:Fi[jn.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:jn.CREATED_BY_USER,size:15,accessorFn:n=>{const r=n.createdByUser;return(r==null?void 0:r.fullName)??(r==null?void 0:r.email)},header:({column:n})=>a.jsx(pr,{column:n,children:Fi[jn.CREATED_BY_USER]}),cell:({row:n})=>{const r=n.original.createdByUser;return r?a.jsx(vO,{userProjection:r}):a.jsx("div",{className:"text-muted-foreground",children:"—"})}},{accessorKey:jn.STATUS,size:15,header:({column:n})=>a.jsx(pr,{column:n,children:Fi[jn.STATUS]}),cell:({row:n})=>{const r=n.getValue("status");return a.jsx(_h,{type:IQ(r.code),variant:"ghost",showIcon:!1,children:r.displayName})}},{accessorKey:jn.TRIGGERS_COUNT,size:15,header:({column:n})=>a.jsx(pr,{column:n,children:Fi[jn.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:jn.REPORTS_COUNT,size:15,header:({column:n})=>a.jsx(pr,{column:n,children:Fi[jn.REPORTS_COUNT]}),cell:({row:n})=>{const r=n.getValue("reportsCount")>0?n.getValue("reportsCount"):"—";return a.jsx("div",{className:"text-muted-foreground",children:r})}},{id:"actions",size:80,header:({table:n})=>a.jsx(dd,{table:n}),cell:({row:n})=>a.jsx(TJ,{row:n,onDeleteSuccess:e})}];var mr=(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))(mr||{});const NJ={connectors:[],connectorSpecification:null,connectorFields:null,loading:!1,loadingSpecification:!1,loadingFields:!1,error:null};function AJ(e,t){switch(t.type){case mr.FETCH_CONNECTORS_START:return{...e,loading:!0,error:null};case mr.FETCH_CONNECTORS_SUCCESS:return{...e,connectors:t.payload,loading:!1,error:null};case mr.FETCH_CONNECTORS_ERROR:return{...e,loading:!1,error:t.payload};case mr.FETCH_CONNECTOR_SPECIFICATION_START:return{...e,loadingSpecification:!0,error:null};case mr.FETCH_CONNECTOR_SPECIFICATION_SUCCESS:return{...e,connectorSpecification:t.payload,loadingSpecification:!1,error:null};case mr.FETCH_CONNECTOR_SPECIFICATION_ERROR:return{...e,loadingSpecification:!1,error:t.payload};case mr.FETCH_CONNECTOR_FIELDS_START:return{...e,loadingFields:!0,error:null};case mr.FETCH_CONNECTOR_FIELDS_SUCCESS:return{...e,connectorFields:t.payload,loadingFields:!1,error:null};case mr.FETCH_CONNECTOR_FIELDS_ERROR:return{...e,loadingFields:!1,error:t.payload};default:return e}}const bO=h.createContext(void 0);function Wu({children:e}){const[t,n]=h.useReducer(AJ,NJ);return a.jsx(bO.Provider,{value:{state:t,dispatch:n},children:e})}function DJ(){const e=h.useContext(bO);if(!e)throw new Error("useConnectorContext must be used within a ConnectorContextProvider");return e}var bs=(e=>(e.STRING="string",e.NUMBER="number",e.BOOLEAN="boolean",e.OBJECT="object",e.ARRAY="array",e.DATE="date",e))(bs||{});class Df extends gl{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 SO(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 jc(){const{state:e,dispatch:t}=DJ(),n=h.useMemo(()=>SO(e.connectors),[e.connectors]),r=h.useCallback(async()=>{t({type:mr.FETCH_CONNECTORS_START});try{const u=await new Df().getAvailableConnectors();t({type:mr.FETCH_CONNECTORS_SUCCESS,payload:u})}catch(c){const u=c instanceof Error?c.message:"Unknown error";t({type:mr.FETCH_CONNECTORS_ERROR,payload:u}),Ie({event:"connector_error",category:"Connector",action:"ListError",label:u})}},[t]),s=h.useCallback(async c=>{t({type:mr.FETCH_CONNECTOR_SPECIFICATION_START});try{const f=await new Df().getConnectorSpecification(c);t({type:mr.FETCH_CONNECTOR_SPECIFICATION_SUCCESS,payload:f})}catch(u){const f=u instanceof Error?u.message:"Unknown error";t({type:mr.FETCH_CONNECTOR_SPECIFICATION_ERROR,payload:f}),Ie({event:"connector_error",category:"Connector",action:"SpecificationError",label:c})}},[t]),i=h.useCallback(async c=>{t({type:mr.FETCH_CONNECTOR_FIELDS_START});try{const f=await new Df().getConnectorFields(c);t({type:mr.FETCH_CONNECTOR_FIELDS_SUCCESS,payload:f})}catch(u){const f=u instanceof Error?u.message:"Unknown error";t({type:mr.FETCH_CONNECTOR_FIELDS_ERROR,payload:f}),Ie({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 OJ=()=>{const{items:e,loadDataMarts:t,deleteDataMart:n,refreshList:r,loading:s}=YD(),{connectors:i,fetchAvailableConnectors:c}=jc();return h.useEffect(()=>{c()},[c]),h.useEffect(()=>{t()},[t]),a.jsx(CJ,{columns:_J({connectors:i}),data:e,deleteDataMart:n,refetchDataMarts:r,isLoading:s})};function s_(){return a.jsxs("div",{className:"dm-page",children:[a.jsx("header",{className:"dm-page-header",children:a.jsx("h1",{className:"dm-page-header-title",children:"Data Marts"})}),a.jsx("div",{className:"dm-page-content",children:a.jsx(WY,{children:a.jsx(Wu,{children:a.jsx(OJ,{})})})})]})}const CO=h.createContext(void 0),mf=e=>{const t=HQ(e);return{...e,canPublish:t.length===0,validationErrors:t}};var $a=(e=>(e.CONNECTED="CONNECTED",e.CONNECTED_WITH_DEFINITION_MISMATCH="CONNECTED_WITH_DEFINITION_MISMATCH",e.DISCONNECTED="DISCONNECTED",e))($a||{}),Wf=(e=>(e.NULLABLE="NULLABLE",e.REQUIRED="REQUIRED",e.REPEATED="REPEATED",e))(Wf||{}),Jn=(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))(Jn||{}),tC=(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))(tC||{}),nC=(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))(nC||{});const IJ=(e,t)=>e!==$e.CONNECTOR||t===null?!0:t.fields.some(r=>r.status===$a.CONNECTED),EO={dataMart:null,isLoading:!1,error:null,runs:[]};function MJ(e,t){switch(t.type){case"FETCH_DATA_MART_START":case"CREATE_DATA_MART_START":case"UPDATE_DATA_MART_START":case"UPDATE_DATA_MART_TITLE_START":case"UPDATE_DATA_MART_DESCRIPTION_START":case"UPDATE_DATA_MART_DEFINITION_START":case"DELETE_DATA_MART_START":case"PUBLISH_DATA_MART_START":case"RUN_DATA_MART_START":case"ACTUALIZE_DATA_MART_SCHEMA_START":case"UPDATE_DATA_MART_SCHEMA_START":case"FETCH_DATA_MART_RUNS_START":case"LOAD_MORE_DATA_MART_RUNS_START":return{...e,isLoading:!0,error:null};case"CREATE_DATA_MART_SUCCESS":return{...e,isLoading:!1,error:null};case"FETCH_DATA_MART_SUCCESS":case"UPDATE_DATA_MART_SUCCESS":case"PUBLISH_DATA_MART_SUCCESS":case"ACTUALIZE_DATA_MART_SCHEMA_SUCCESS":case"UPDATE_DATA_MART_SCHEMA_SUCCESS":return{...e,isLoading:!1,error:null,dataMart:mf(t.payload)};case"UPDATE_DATA_MART_TITLE_SUCCESS":return e.dataMart?{...e,isLoading:!1,error:null,dataMart:mf({...e.dataMart,title:t.payload,modifiedAt:new Date})}:e;case"UPDATE_DATA_MART_DESCRIPTION_SUCCESS":return e.dataMart?{...e,isLoading:!1,error:null,dataMart:mf({...e.dataMart,description:t.payload,modifiedAt:new Date})}:e;case"UPDATE_DATA_MART_STORAGE":return e.dataMart?{...e,dataMart:mf({...e.dataMart,storage:t.payload,modifiedAt:new Date})}:e;case"UPDATE_DATA_MART_DEFINITION_SUCCESS":return e.dataMart?{...e,isLoading:!1,error:null,dataMart:mf({...e.dataMart,definitionType:t.payload.definitionType,definition:t.payload.definition,modifiedAt:new Date})}:e;case"DELETE_DATA_MART_SUCCESS":return{...e,isLoading:!1,error:null,dataMart:null};case"RUN_DATA_MART_SUCCESS":return{...e,isLoading:!1,error:null};case"FETCH_DATA_MART_RUNS_SUCCESS":return{...e,isLoading:!1,error:null,runs:t.payload};case"LOAD_MORE_DATA_MART_RUNS_SUCCESS":return{...e,isLoading:!1,error:null,runs:[...e.runs,...t.payload]};case"FETCH_DATA_MART_ERROR":case"CREATE_DATA_MART_ERROR":case"UPDATE_DATA_MART_ERROR":case"UPDATE_DATA_MART_TITLE_ERROR":case"UPDATE_DATA_MART_DESCRIPTION_ERROR":case"UPDATE_DATA_MART_DEFINITION_ERROR":case"DELETE_DATA_MART_ERROR":case"PUBLISH_DATA_MART_ERROR":case"RUN_DATA_MART_ERROR":case"ACTUALIZE_DATA_MART_SCHEMA_ERROR":case"UPDATE_DATA_MART_SCHEMA_ERROR":case"FETCH_DATA_MART_RUNS_ERROR":case"LOAD_MORE_DATA_MART_RUNS_ERROR":return{...e,isLoading:!1,error:t.payload};case"RESET":return EO;default:return e}}function Ps(){const e=h.useContext(CO);if(e===void 0)throw new Error("useDataMartContext must be used within a DataMartProvider");return e}class kJ{mapFromDto(t){const n=t.config,r=t.credentials;let s="";return r&&Object.keys(r).length>0&&(s=JSON.stringify(r,null,2)),{id:t.id,title:t.title,type:Re.GOOGLE_BIGQUERY,createdAt:new Date(t.createdAt),modifiedAt:new Date(t.modifiedAt),credentials:{serviceAccount:s},config:{projectId:(n==null?void 0:n.projectId)??"",location:(n==null?void 0:n.location)??""}}}mapToUpdateRequest(t){const n={config:{projectId:t.config.projectId,location:t.config.location}};return t.credentials&&(n.credentials={...JSON.parse(t.credentials.serviceAccount)}),n}}class LJ{mapFromDto(t){const n=t.config,r=t.credentials;return{id:t.id,title:t.title,type:Re.AWS_ATHENA,createdAt:new Date(t.createdAt),modifiedAt:new Date(t.modifiedAt),credentials:{accessKeyId:(r==null?void 0:r.accessKeyId)??"",secretAccessKey:(r==null?void 0:r.secretAccessKey)??""},config:{region:(n==null?void 0:n.region)??"",outputBucket:(n==null?void 0:n.outputBucket)??""}}}mapToUpdateRequest(t){const n={config:{region:t.config.region,outputBucket:t.config.outputBucket}};return t.credentials&&(n.credentials={accessKeyId:t.credentials.accessKeyId,secretAccessKey:t.credentials.secretAccessKey}),n}}class PJ{mapFromDto(t){const n=t.config,r=t.credentials,s=r?r.authMethod==="KEY_PAIR"?{authMethod:Rs.KEY_PAIR,username:r.username??"",privateKey:r.privateKey??"",privateKeyPassphrase:r.privateKeyPassphrase}:{authMethod:Rs.PASSWORD,username:r.username??"",password:r.password??""}:void 0;return{id:t.id,title:t.title,type:Re.SNOWFLAKE,createdAt:new Date(t.createdAt),modifiedAt:new Date(t.modifiedAt),credentials:s??{authMethod:Rs.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===Rs.PASSWORD?{password:r.password}:{privateKey:r.privateKey,privateKeyPassphrase:r.privateKeyPassphrase}}}return n}}const wO={getMapper(e){switch(e){case Re.GOOGLE_BIGQUERY:return new kJ;case Re.AWS_ATHENA:return new LJ;case Re.SNOWFLAKE:return new PJ;default:throw new Error(`Unknown storage type: ${e}`)}}};function zp(e){return wO.getMapper(e.type).mapFromDto(e)}function UJ(e){const t=wO.getMapper(e.type);return{title:e.title,...t.mapToUpdateRequest(e)}}function FJ(e){return{id:e.id,type:e.type,title:e.title,createdAt:new Date(e.createdAt),modifiedAt:new Date(e.modifiedAt)}}function zJ(e){return{type:e}}let vp=null;async function HJ(){if(vp)return vp;const e=await VJ();return vp=SO(e),vp}async function VJ(){return await new Df().getAvailableConnectors()}async function $J(e){const t=await HJ();return t.length===0?null:t.find(r=>r.name===e)??null}function GJ(e,t){const n=t.find(r=>r.name===e.source.name);return(n==null?void 0:n.displayName)??e.source.name}function BJ(e){return{sqlQuery:e.sqlQuery}}function qJ(e){return{sqlQuery:e.sqlQuery}}function KJ(e){return{fullyQualifiedName:e.fullyQualifiedName}}function ZJ(e){return{fullyQualifiedName:e.fullyQualifiedName}}function YJ(e){return{fullyQualifiedName:e.fullyQualifiedName}}function WJ(e){return{fullyQualifiedName:e.fullyQualifiedName}}function QJ(e){return{pattern:e.pattern}}function XJ(e){return{pattern:e.pattern}}function JJ(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 eee(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 tee(e,t){if(!e||!t)return null;switch(e){case $e.SQL:return qJ(t);case $e.TABLE:return ZJ(t);case $e.VIEW:return WJ(t);case $e.TABLE_PATTERN:return XJ(t);case $e.CONNECTOR:{const n=eee(t);return n.connector.info=await $J(n.connector.source.name),n}default:return console.warn(`Unknown definition type: ${String(e)}`),null}}async function hu(e){const t={id:e.id,title:e.title,description:e.description,status:CD.getInfo(e.status),storage:zp(e.storage),definitionType:e.definitionType,definition:await tee(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=IJ(t.definitionType,t.schema),t}function nee(e){return{id:e.id,title:e.title}}const ree=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}),o_=e=>e.runs.map(ree),RO=e=>{if(!e)return"—";let t;if(typeof e=="string"){if(t=new Date(e),isNaN(t.getTime()))return"—"}else if(t=e,isNaN(t.getTime()))return"—";return new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(t)},jy=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(y=>[y.type,y.value])),i=s.get("year")??"",c=s.get("month")??"",u=s.get("day")??"",f=s.get("hour")??"",m=s.get("minute")??"",g=s.get("second")??"";return`${i}-${c}-${u} ${f}:${m}:${g}`},mu=e=>jy(jO(e).toISOString()),jO=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},aee=(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 TO(e){return JSON.parse(JSON.stringify(e))}function see(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 _O=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 oee(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}function iee(e){return!e||typeof e!="object"?!0:e.LICENSED_APP_EDITION==="COMMUNITY"}const lee=e=>e?e.split(",").map(t=>t.trim()).filter(Boolean):[];function NO({children:e}){const[t,n]=h.useReducer(MJ,EO),r=h.useCallback(async I=>{try{n({type:"FETCH_DATA_MART_START"});const T=await yn.getDataMartById(I),D=await hu(T);n({type:"FETCH_DATA_MART_SUCCESS",payload:D})}catch(T){n({type:"FETCH_DATA_MART_ERROR",payload:en(T)})}},[]),s=h.useCallback(async I=>{try{n({type:"CREATE_DATA_MART_START"});const T=await yn.createDataMart(I),D=nee(T);return n({type:"CREATE_DATA_MART_SUCCESS",payload:D}),Ie({event:"data_mart_created",category:"DataMart",action:"Create",label:D.id}),Mt.success("Data Mart created"),D}catch(T){const D=en(T);throw n({type:"CREATE_DATA_MART_ERROR",payload:D}),Ie({event:"data_mart_error",category:"DataMart",action:"CreateError",label:D.message}),T}},[]),i=h.useCallback(async(I,T)=>{try{n({type:"UPDATE_DATA_MART_START"});const D=await yn.updateDataMart(I,T),L=await hu(D);n({type:"UPDATE_DATA_MART_SUCCESS",payload:L}),Ie({event:"data_mart_updated",category:"DataMart",action:"Update",label:L.id})}catch(D){const L=en(D);n({type:"UPDATE_DATA_MART_ERROR",payload:L}),Ie({event:"data_mart_error",category:"DataMart",action:"UpdateError",label:L.message})}},[]),c=h.useCallback(async I=>{try{n({type:"DELETE_DATA_MART_START"}),await yn.deleteDataMart(I),n({type:"DELETE_DATA_MART_SUCCESS"}),Ie({event:"data_mart_deleted",category:"DataMart",action:"Delete",label:I}),Mt.success("Data Mart deleted")}catch(T){const D=en(T);n({type:"DELETE_DATA_MART_ERROR",payload:D}),Ie({event:"data_mart_error",category:"DataMart",action:"DeleteError",label:D.message})}},[]),u=h.useCallback(async(I,T)=>{try{n({type:"UPDATE_DATA_MART_TITLE_START"}),await yn.updateDataMartTitle(I,T),n({type:"UPDATE_DATA_MART_TITLE_SUCCESS",payload:T}),Ie({event:"data_mart_updated",category:"DataMart",action:"UpdateTitle",label:T}),Mt.success("Title updated")}catch(D){const L=en(D);n({type:"UPDATE_DATA_MART_TITLE_ERROR",payload:L}),Ie({event:"data_mart_error",category:"DataMart",action:"UpdateTitleError",label:L.message})}},[]),f=h.useCallback(async(I,T)=>{try{n({type:"UPDATE_DATA_MART_DESCRIPTION_START"}),await yn.updateDataMartDescription(I,T),n({type:"UPDATE_DATA_MART_DESCRIPTION_SUCCESS",payload:T??""}),Ie({event:"data_mart_updated",category:"DataMart",action:"UpdateDescription"}),Mt.success("Description updated")}catch(D){const L=en(D);n({type:"UPDATE_DATA_MART_DESCRIPTION_ERROR",payload:L}),Ie({event:"data_mart_error",category:"DataMart",action:"UpdateDescriptionError",label:L.message})}},[]),m=h.useCallback(I=>{n({type:"UPDATE_DATA_MART_STORAGE",payload:I})},[]),g=h.useCallback(async(I,T,D)=>{try{n({type:"UPDATE_DATA_MART_DEFINITION_START"});let L;switch(T){case $e.SQL:L={definitionType:T,definition:BJ(D)};break;case $e.TABLE:L={definitionType:T,definition:KJ(D)};break;case $e.VIEW:L={definitionType:T,definition:YJ(D)};break;case $e.TABLE_PATTERN:L={definitionType:T,definition:QJ(D)};break;case $e.CONNECTOR:{const q=D;let Z;for(const F of q.connector.source.configuration){const z=F;if(z._copiedFrom){Z=z._copiedFrom.dataMartId;break}}L={definitionType:$e.CONNECTOR,definition:JJ(q),sourceDataMartId:Z};break}default:throw new Error(`Unsupported definition type: ${String(T)}`)}const H=await yn.updateDataMartDefinition(I,L),B=await hu(H);n({type:"UPDATE_DATA_MART_DEFINITION_SUCCESS",payload:{definitionType:T,definition:D}}),n({type:"UPDATE_DATA_MART_SUCCESS",payload:B}),Ie({event:"data_mart_updated",category:"DataMart",action:"UpdateDefinition",label:T})}catch(L){const H=en(L);n({type:"UPDATE_DATA_MART_DEFINITION_ERROR",payload:H}),Ie({event:"data_mart_error",category:"DataMart",action:"UpdateDefinitionError",label:H.message})}},[]),y=h.useCallback(async I=>{try{n({type:"PUBLISH_DATA_MART_START"});const T=await yn.publishDataMart(I),D=await hu(T);n({type:"PUBLISH_DATA_MART_SUCCESS",payload:D}),Mt.success("Data Mart published")}catch(T){const D=en(T);throw n({type:"PUBLISH_DATA_MART_ERROR",payload:D}),Ie({event:"data_mart_error",category:"DataMart",action:"PublishError",label:D.message}),T}},[]),x=h.useCallback(async(I,T=5,D=0,L)=>{try{L!=null&&L.silent||n({type:"FETCH_DATA_MART_RUNS_START"});const H=await yn.getDataMartRuns(I,T,D,L!=null&&L.silent?{skipLoadingIndicator:!0}:void 0),B=o_(H);return n({type:"FETCH_DATA_MART_RUNS_SUCCESS",payload:B}),B}catch(H){throw n({type:"FETCH_DATA_MART_RUNS_ERROR",payload:en(H)}),H}},[]),v=h.useCallback(async(I,T,D=5)=>{try{n({type:"LOAD_MORE_DATA_MART_RUNS_START"});const L=await yn.getDataMartRuns(I,D,T),H=o_(L);return n({type:"LOAD_MORE_DATA_MART_RUNS_SUCCESS",payload:H}),H}catch(L){throw n({type:"LOAD_MORE_DATA_MART_RUNS_ERROR",payload:en(L)}),L}},[]),S=h.useCallback(async I=>{const T=Mt.loading("Manual run started");try{n({type:"RUN_DATA_MART_START"}),await yn.runDataMart(I.id,I.payload),n({type:"RUN_DATA_MART_SUCCESS"})}catch(D){Mt.dismiss(T);const L=en(D);n({type:"RUN_DATA_MART_ERROR",payload:L}),Ie({event:"data_mart_error",category:"DataMart",action:"RunError",label:L.message})}},[]),C=h.useCallback(async(I,T)=>{try{await yn.cancelDataMartRun(I,T),await x(I),Mt.success("Data Mart run canceled")}catch(D){const L=en(D);n({type:"RUN_DATA_MART_ERROR",payload:L}),Ie({event:"data_mart_error",category:"DataMart",action:"CancelRunError",label:L.message})}},[x]),E=h.useCallback(async(I,T)=>{try{return await yn.getDataMartRunById(I,T)}catch(D){const L=en(D);throw Ie({event:"data_mart_error",category:"DataMart",action:"FetchRunDetailsError",label:L.message}),D}},[]),R=h.useCallback(async I=>{try{n({type:"ACTUALIZE_DATA_MART_SCHEMA_START"});const T=await yn.actualizeDataMartSchema(I),D=await hu(T);n({type:"ACTUALIZE_DATA_MART_SCHEMA_SUCCESS",payload:D}),Mt.success("Output schema actualized")}catch(T){const D=en(T);n({type:"ACTUALIZE_DATA_MART_SCHEMA_ERROR",payload:D}),Ie({event:"data_mart_error",category:"DataMart",action:"ActualizeSchemaError",label:D.message})}},[]),j=h.useCallback(async(I,T)=>{try{n({type:"UPDATE_DATA_MART_SCHEMA_START"});const D=await yn.updateDataMartSchema(I,{schema:T}),L=await hu(D);n({type:"UPDATE_DATA_MART_SCHEMA_SUCCESS",payload:L}),Mt.success("Output schema updated")}catch(D){const L=en(D);n({type:"UPDATE_DATA_MART_SCHEMA_ERROR",payload:L}),Ie({event:"data_mart_error",category:"DataMart",action:"UpdateSchemaError",label:L.message})}},[]),_=h.useCallback(()=>{n({type:"RESET"})},[]),A=h.useCallback(()=>t.error?t.error.message:null,[t.error]),O={...t,getDataMart:r,createDataMart:s,updateDataMart:i,deleteDataMart:c,updateDataMartTitle:u,updateDataMartDescription:f,updateDataMartStorage:m,updateDataMartDefinition:g,publishDataMart:y,runDataMart:S,cancelDataMartRun:C,actualizeDataMartSchema:R,updateDataMartSchema:j,getDataMartRuns:x,getDataMartRunById:E,loadMoreDataMartRuns:v,getErrorMessage:A,reset:_};return a.jsx(CO.Provider,{value:O,children:e})}var Oh=e=>e.type==="checkbox",ec=e=>e instanceof Date,ba=e=>e==null;const AO=e=>typeof e=="object";var lr=e=>!ba(e)&&!Array.isArray(e)&&AO(e)&&!ec(e),DO=e=>lr(e)&&e.target?Oh(e.target)?e.target.checked:e.target.value:e,cee=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,OO=(e,t)=>e.has(cee(t)),uee=e=>{const t=e.constructor&&e.constructor.prototype;return lr(t)&&t.hasOwnProperty("isPrototypeOf")},rC=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function hr(e){let t;const n=Array.isArray(e),r=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(!(rC&&(e instanceof Blob||r))&&(n||lr(e)))if(t=n?[]:Object.create(Object.getPrototypeOf(e)),!n&&!uee(e))t=e;else for(const s in e)e.hasOwnProperty(s)&&(t[s]=hr(e[s]));else return e;return t}var Ty=e=>/^\w*$/.test(e),$n=e=>e===void 0,aC=e=>Array.isArray(e)?e.filter(Boolean):[],sC=e=>aC(e.replace(/["|']|\]/g,"").split(/\.|\[/)),ke=(e,t,n)=>{if(!t||!lr(e))return n;const r=(Ty(t)?[t]:sC(t)).reduce((s,i)=>ba(s)?s:s[i],e);return $n(r)||r===e?$n(e[t])?n:e[t]:r},La=e=>typeof e=="boolean",un=(e,t,n)=>{let r=-1;const s=Ty(t)?[t]:sC(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=lr(m)||Array.isArray(m)?m:isNaN(+s[r+1])?{}:[]}if(u==="__proto__"||u==="constructor"||u==="prototype")return;e[u]=f,e=e[u]}};const Sg={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Ss={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Po={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},oC=be.createContext(null);oC.displayName="HookFormContext";const fd=()=>be.useContext(oC),IO=e=>{const{children:t,...n}=e;return be.createElement(oC.Provider,{value:n},t)};var MO=(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]!==Ss.all&&(t._proxyFormState[c]=!r||Ss.all),n&&(n[c]=!0),e[c]}});return s};const iC=typeof window<"u"?be.useLayoutEffect:be.useEffect;function kO(e){const t=fd(),{control:n=t.control,disabled:r,name:s,exact:i}=e||{},[c,u]=be.useState(n._formState),f=be.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return iC(()=>n._subscribe({name:s,formState:f.current,exact:i,callback:m=>{!r&&u({...n._formState,...m})}}),[s,r,i]),be.useEffect(()=>{f.current.isValid&&n._setValid(!0)},[n]),be.useMemo(()=>MO(c,n,f.current,!1),[c,n])}var za=e=>typeof e=="string",X1=(e,t,n,r,s)=>za(e)?(r&&t.watch.add(e),ke(n,e,s)):Array.isArray(e)?e.map(i=>(r&&t.watch.add(i),ke(n,i))):(r&&(t.watchAll=!0),n),J1=e=>ba(e)||!AO(e);function Cs(e,t,n=new WeakSet){if(J1(e)||J1(t))return Object.is(e,t);if(ec(e)&&ec(t))return e.getTime()===t.getTime();const r=Object.keys(e),s=Object.keys(t);if(r.length!==s.length)return!1;if(n.has(e)||n.has(t))return!0;n.add(e),n.add(t);for(const i of r){const c=e[i];if(!s.includes(i))return!1;if(i!=="ref"){const u=t[i];if(ec(c)&&ec(u)||lr(c)&&lr(u)||Array.isArray(c)&&Array.isArray(u)?!Cs(c,u,n):!Object.is(c,u))return!1}}return!0}function dee(e){const t=fd(),{control:n=t.control,name:r,defaultValue:s,disabled:i,exact:c,compute:u}=e||{},f=be.useRef(s),m=be.useRef(u),g=be.useRef(void 0),y=be.useRef(n),x=be.useRef(r);m.current=u;const[v,S]=be.useState(()=>{const A=n._getWatch(r,f.current);return m.current?m.current(A):A}),C=be.useCallback(A=>{const O=X1(r,n._names,A||n._formValues,!1,f.current);return m.current?m.current(O):O},[n._formValues,n._names,r]),E=be.useCallback(A=>{if(!i){const O=X1(r,n._names,A||n._formValues,!1,f.current);if(m.current){const I=m.current(O);Cs(I,g.current)||(S(I),g.current=I)}else S(O)}},[n._formValues,n._names,i,r]);iC(()=>((y.current!==n||!Cs(x.current,r))&&(y.current=n,x.current=r,E()),n._subscribe({name:r,formState:{values:!0},exact:c,callback:A=>{E(A.values)}})),[n,c,r,E]),be.useEffect(()=>n._removeUnmounted());const R=y.current!==n,j=x.current,_=be.useMemo(()=>{if(i)return null;const A=!R&&!Cs(j,r);return R||A?C():null},[i,R,r,j,C]);return _!==null?_:v}function fee(e){const t=fd(),{name:n,disabled:r,control:s=t.control,shouldUnregister:i,defaultValue:c,exact:u=!0}=e,f=OO(s._names.array,n),m=be.useMemo(()=>ke(s._formValues,n,ke(s._defaultValues,n,c)),[s,n,c]),g=dee({control:s,name:n,defaultValue:m,exact:u}),y=kO({control:s,name:n,exact:u}),x=be.useRef(e),v=be.useRef(void 0),S=be.useRef(s.register(n,{...e.rules,value:g,...La(e.disabled)?{disabled:e.disabled}:{}}));x.current=e;const C=be.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!ke(y.errors,n)},isDirty:{enumerable:!0,get:()=>!!ke(y.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!ke(y.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!ke(y.validatingFields,n)},error:{enumerable:!0,get:()=>ke(y.errors,n)}}),[y,n]),E=be.useCallback(A=>S.current.onChange({target:{value:DO(A),name:n},type:Sg.CHANGE}),[n]),R=be.useCallback(()=>S.current.onBlur({target:{value:ke(s._formValues,n),name:n},type:Sg.BLUR}),[n,s._formValues]),j=be.useCallback(A=>{const O=ke(s._fields,n);O&&A&&(O._f.ref={focus:()=>A.focus&&A.focus(),select:()=>A.select&&A.select(),setCustomValidity:I=>A.setCustomValidity(I),reportValidity:()=>A.reportValidity()})},[s._fields,n]),_=be.useMemo(()=>({name:n,value:g,...La(r)||y.disabled?{disabled:y.disabled||r}:{},onChange:E,onBlur:R,ref:j}),[n,r,y.disabled,E,R,j,g]);return be.useEffect(()=>{const A=s._options.shouldUnregister||i,O=v.current;O&&O!==n&&!f&&s.unregister(O),s.register(n,{...x.current.rules,...La(x.current.disabled)?{disabled:x.current.disabled}:{}});const I=(T,D)=>{const L=ke(s._fields,T);L&&L._f&&(L._f.mount=D)};if(I(n,!0),A){const T=hr(ke(s._options.defaultValues,n,x.current.defaultValue));un(s._defaultValues,n,T),$n(ke(s._formValues,n))&&un(s._formValues,n,T)}return!f&&s.register(n),v.current=n,()=>{(f?A&&!s._state.action:A)?s.unregister(n):I(n,!1)}},[n,s,f,i]),be.useEffect(()=>{s._setDisabledField({disabled:r,name:n})},[r,n,s]),be.useMemo(()=>({field:_,formState:y,fieldState:C}),[_,y,C])}const hee=e=>e.render(fee(e));var lC=(e,t,n,r,s)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:s||!0}}:{},Of=e=>Array.isArray(e)?e:[e],i_=()=>{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 LO(e,t){const n={};for(const r in e)if(e.hasOwnProperty(r)){const s=e[r],i=t[r];if(s&&lr(s)&&i){const c=LO(s,i);lr(c)&&(n[r]=c)}else e[r]&&(n[r]=i)}return n}var Xr=e=>lr(e)&&!Object.keys(e).length,cC=e=>e.type==="file",Es=e=>typeof e=="function",Cg=e=>{if(!rC)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},PO=e=>e.type==="select-multiple",uC=e=>e.type==="radio",mee=e=>uC(e)||Oh(e),B0=e=>Cg(e)&&e.isConnected;function pee(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=$n(e)?r++:e[t[r++]];return e}function gee(e){for(const t in e)if(e.hasOwnProperty(t)&&!$n(e[t]))return!1;return!0}function or(e,t){const n=Array.isArray(t)?t:Ty(t)?[t]:sC(t),r=n.length===1?e:pee(e,n),s=n.length-1,i=n[s];return r&&delete r[i],s!==0&&(lr(r)&&Xr(r)||Array.isArray(r)&&gee(r))&&or(e,n.slice(0,-1)),e}var yee=e=>{for(const t in e)if(Es(e[t]))return!0;return!1};function UO(e){return Array.isArray(e)||lr(e)&&!yee(e)}function eb(e,t={}){for(const n in e){const r=e[n];UO(r)?(t[n]=Array.isArray(r)?[]:{},eb(r,t[n])):$n(r)||(t[n]=!0)}return t}function Su(e,t,n){n||(n=eb(t));for(const r in e){const s=e[r];if(UO(s))$n(t)||J1(n[r])?n[r]=eb(s,Array.isArray(s)?[]:{}):Su(s,ba(t)?{}:t[r],n[r]);else{const i=t[r];n[r]=!Cs(s,i)}}return n}const l_={value:!1,isValid:!1},c_={value:!0,isValid:!0};var FO=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&&!$n(e[0].attributes.value)?$n(e[0].value)||e[0].value===""?c_:{value:e[0].value,isValid:!0}:c_:l_}return l_},zO=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>$n(e)?e:t?e===""?NaN:e&&+e:n&&za(e)?new Date(e):r?r(e):e;const u_={isValid:!1,value:null};var HO=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,u_):u_;function d_(e){const t=e.ref;return cC(t)?t.files:uC(t)?HO(e.refs).value:PO(t)?[...t.selectedOptions].map(({value:n})=>n):Oh(t)?FO(e.refs).value:zO($n(t.value)?e.ref.value:t.value,e)}var xee=(e,t,n,r)=>{const s={};for(const i of e){const c=ke(t,i);c&&un(s,i,c._f)}return{criteriaMode:n,names:[...e],fields:s,shouldUseNativeValidation:r}},Eg=e=>e instanceof RegExp,pf=e=>$n(e)?e:Eg(e)?e.source:lr(e)?Eg(e.value)?e.value.source:e.value:e,f_=e=>({isOnSubmit:!e||e===Ss.onSubmit,isOnBlur:e===Ss.onBlur,isOnChange:e===Ss.onChange,isOnAll:e===Ss.all,isOnTouch:e===Ss.onTouched});const h_="AsyncFunction";var vee=e=>!!e&&!!e.validate&&!!(Es(e.validate)&&e.validate.constructor.name===h_||lr(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===h_)),bee=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),m_=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const If=(e,t,n,r)=>{for(const s of n||Object.keys(e)){const i=ke(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(If(u,t))break}else if(lr(u)&&If(u,t))break}}};function p_(e,t,n){const r=ke(e,n);if(r||Ty(n))return{error:r,name:n};const s=n.split(".");for(;s.length;){const i=s.join("."),c=ke(t,i),u=ke(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 See=(e,t,n,r)=>{n(e);const{name:s,...i}=e;return Xr(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(c=>t[c]===(!r||Ss.all))},Cee=(e,t,n)=>!e||!t||e===t||Of(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r))),Eee=(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,wee=(e,t)=>!aC(ke(e,t)).length&&or(e,t),Ree=(e,t,n)=>{const r=Of(ke(e,n));return un(r,"root",t[n]),un(e,n,r),e};function g_(e,t,n="validate"){if(za(e)||Array.isArray(e)&&e.every(za)||La(e)&&!e)return{type:n,message:za(e)?e:"",ref:t}}var pu=e=>lr(e)&&!Eg(e)?e:{value:e,message:""},y_=async(e,t,n,r,s,i)=>{const{ref:c,refs:u,required:f,maxLength:m,minLength:g,min:y,max:x,pattern:v,validate:S,name:C,valueAsNumber:E,mount:R}=e._f,j=ke(n,C);if(!R||t.has(C))return{};const _=u?u[0]:c,A=q=>{s&&_.reportValidity&&(_.setCustomValidity(La(q)?"":q||""),_.reportValidity())},O={},I=uC(c),T=Oh(c),D=I||T,L=(E||cC(c))&&$n(c.value)&&$n(j)||Cg(c)&&c.value===""||j===""||Array.isArray(j)&&!j.length,H=lC.bind(null,C,r,O),B=(q,Z,F,z=Po.maxLength,M=Po.minLength)=>{const V=q?Z:F;O[C]={type:q?z:M,message:V,ref:c,...H(q?z:M,V)}};if(i?!Array.isArray(j)||!j.length:f&&(!D&&(L||ba(j))||La(j)&&!j||T&&!FO(u).isValid||I&&!HO(u).isValid)){const{value:q,message:Z}=za(f)?{value:!!f,message:f}:pu(f);if(q&&(O[C]={type:Po.required,message:Z,ref:_,...H(Po.required,Z)},!r))return A(Z),O}if(!L&&(!ba(y)||!ba(x))){let q,Z;const F=pu(x),z=pu(y);if(!ba(j)&&!isNaN(j)){const M=c.valueAsNumber||j&&+j;ba(F.value)||(q=M>F.value),ba(z.value)||(Z=M<z.value)}else{const M=c.valueAsDate||new Date(j),V=ve=>new Date(new Date().toDateString()+" "+ve),K=c.type=="time",se=c.type=="week";za(F.value)&&j&&(q=K?V(j)>V(F.value):se?j>F.value:M>new Date(F.value)),za(z.value)&&j&&(Z=K?V(j)<V(z.value):se?j<z.value:M<new Date(z.value))}if((q||Z)&&(B(!!q,F.message,z.message,Po.max,Po.min),!r))return A(O[C].message),O}if((m||g)&&!L&&(za(j)||i&&Array.isArray(j))){const q=pu(m),Z=pu(g),F=!ba(q.value)&&j.length>+q.value,z=!ba(Z.value)&&j.length<+Z.value;if((F||z)&&(B(F,q.message,Z.message),!r))return A(O[C].message),O}if(v&&!L&&za(j)){const{value:q,message:Z}=pu(v);if(Eg(q)&&!j.match(q)&&(O[C]={type:Po.pattern,message:Z,ref:c,...H(Po.pattern,Z)},!r))return A(Z),O}if(S){if(Es(S)){const q=await S(j,n),Z=g_(q,_);if(Z&&(O[C]={...Z,...H(Po.validate,Z.message)},!r))return A(Z.message),O}else if(lr(S)){let q={};for(const Z in S){if(!Xr(q)&&!r)break;const F=g_(await S[Z](j,n),_,Z);F&&(q={...F,...H(Z,F.message)},A(F.message),r&&(O[C]=q))}if(!Xr(q)&&(O[C]={ref:_,...q},!r))return O}}return A(!0),O};const jee={mode:Ss.onSubmit,reValidateMode:Ss.onChange,shouldFocusError:!0};function Tee(e={}){let t={...jee,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:Es(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},s=lr(t.defaultValues)||lr(t.values)?hr(t.defaultValues||t.values)||{}:{},i=t.shouldUnregister?{}:hr(s),c={action:!1,mount:!1,watch:!1},u={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},f,m=0;const g={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let y={...g};const x={array:i_(),state:i_()},v=t.criteriaMode===Ss.all,S=G=>ee=>{clearTimeout(m),m=setTimeout(G,ee)},C=async G=>{if(!t.disabled&&(g.isValid||y.isValid||G)){const ee=t.resolver?Xr((await T()).errors):await L(r,!0);ee!==n.isValid&&x.state.next({isValid:ee})}},E=(G,ee)=>{!t.disabled&&(g.isValidating||g.validatingFields||y.isValidating||y.validatingFields)&&((G||Array.from(u.mount)).forEach(de=>{de&&(ee?un(n.validatingFields,de,ee):or(n.validatingFields,de))}),x.state.next({validatingFields:n.validatingFields,isValidating:!Xr(n.validatingFields)}))},R=(G,ee=[],de,Ae,we=!0,Te=!0)=>{if(Ae&&de&&!t.disabled){if(c.action=!0,Te&&Array.isArray(ke(r,G))){const Ye=de(ke(r,G),Ae.argA,Ae.argB);we&&un(r,G,Ye)}if(Te&&Array.isArray(ke(n.errors,G))){const Ye=de(ke(n.errors,G),Ae.argA,Ae.argB);we&&un(n.errors,G,Ye),wee(n.errors,G)}if((g.touchedFields||y.touchedFields)&&Te&&Array.isArray(ke(n.touchedFields,G))){const Ye=de(ke(n.touchedFields,G),Ae.argA,Ae.argB);we&&un(n.touchedFields,G,Ye)}(g.dirtyFields||y.dirtyFields)&&(n.dirtyFields=Su(s,i)),x.state.next({name:G,isDirty:B(G,ee),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else un(i,G,ee)},j=(G,ee)=>{un(n.errors,G,ee),x.state.next({errors:n.errors})},_=G=>{n.errors=G,x.state.next({errors:n.errors,isValid:!1})},A=(G,ee,de,Ae)=>{const we=ke(r,G);if(we){const Te=ke(i,G,$n(de)?ke(s,G):de);$n(Te)||Ae&&Ae.defaultChecked||ee?un(i,G,ee?Te:d_(we._f)):F(G,Te),c.mount&&!c.action&&C()}},O=(G,ee,de,Ae,we)=>{let Te=!1,Ye=!1;const it={name:G};if(!t.disabled){if(!de||Ae){(g.isDirty||y.isDirty)&&(Ye=n.isDirty,n.isDirty=it.isDirty=B(),Te=Ye!==it.isDirty);const lt=Cs(ke(s,G),ee);Ye=!!ke(n.dirtyFields,G),lt?or(n.dirtyFields,G):un(n.dirtyFields,G,!0),it.dirtyFields=n.dirtyFields,Te=Te||(g.dirtyFields||y.dirtyFields)&&Ye!==!lt}if(de){const lt=ke(n.touchedFields,G);lt||(un(n.touchedFields,G,de),it.touchedFields=n.touchedFields,Te=Te||(g.touchedFields||y.touchedFields)&<!==de)}Te&&we&&x.state.next(it)}return Te?it:{}},I=(G,ee,de,Ae)=>{const we=ke(n.errors,G),Te=(g.isValid||y.isValid)&&La(ee)&&n.isValid!==ee;if(t.delayError&&de?(f=S(()=>j(G,de)),f(t.delayError)):(clearTimeout(m),f=null,de?un(n.errors,G,de):or(n.errors,G)),(de?!Cs(we,de):we)||!Xr(Ae)||Te){const Ye={...Ae,...Te&&La(ee)?{isValid:ee}:{},errors:n.errors,name:G};n={...n,...Ye},x.state.next(Ye)}},T=async G=>{E(G,!0);const ee=await t.resolver(i,t.context,xee(G||u.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return E(G),ee},D=async G=>{const{errors:ee}=await T(G);if(G)for(const de of G){const Ae=ke(ee,de);Ae?un(n.errors,de,Ae):or(n.errors,de)}else n.errors=ee;return ee},L=async(G,ee,de={valid:!0})=>{for(const Ae in G){const we=G[Ae];if(we){const{_f:Te,...Ye}=we;if(Te){const it=u.array.has(Te.name),lt=we._f&&vee(we._f);lt&&g.validatingFields&&E([Te.name],!0);const Dn=await y_(we,u.disabled,i,v,t.shouldUseNativeValidation&&!ee,it);if(lt&&g.validatingFields&&E([Te.name]),Dn[Te.name]&&(de.valid=!1,ee))break;!ee&&(ke(Dn,Te.name)?it?Ree(n.errors,Dn,Te.name):un(n.errors,Te.name,Dn[Te.name]):or(n.errors,Te.name))}!Xr(Ye)&&await L(Ye,ee,de)}}return de.valid},H=()=>{for(const G of u.unMount){const ee=ke(r,G);ee&&(ee._f.refs?ee._f.refs.every(de=>!B0(de)):!B0(ee._f.ref))&&J(G)}u.unMount=new Set},B=(G,ee)=>!t.disabled&&(G&&ee&&un(i,G,ee),!Cs(ve(),s)),q=(G,ee,de)=>X1(G,u,{...c.mount?i:$n(ee)?s:za(G)?{[G]:ee}:ee},de,ee),Z=G=>aC(ke(c.mount?i:s,G,t.shouldUnregister?ke(s,G,[]):[])),F=(G,ee,de={})=>{const Ae=ke(r,G);let we=ee;if(Ae){const Te=Ae._f;Te&&(!Te.disabled&&un(i,G,zO(ee,Te)),we=Cg(Te.ref)&&ba(ee)?"":ee,PO(Te.ref)?[...Te.ref.options].forEach(Ye=>Ye.selected=we.includes(Ye.value)):Te.refs?Oh(Te.ref)?Te.refs.forEach(Ye=>{(!Ye.defaultChecked||!Ye.disabled)&&(Array.isArray(we)?Ye.checked=!!we.find(it=>it===Ye.value):Ye.checked=we===Ye.value||!!we)}):Te.refs.forEach(Ye=>Ye.checked=Ye.value===we):cC(Te.ref)?Te.ref.value="":(Te.ref.value=we,Te.ref.type||x.state.next({name:G,values:hr(i)})))}(de.shouldDirty||de.shouldTouch)&&O(G,we,de.shouldTouch,de.shouldDirty,!0),de.shouldValidate&&se(G)},z=(G,ee,de)=>{for(const Ae in ee){if(!ee.hasOwnProperty(Ae))return;const we=ee[Ae],Te=G+"."+Ae,Ye=ke(r,Te);(u.array.has(G)||lr(we)||Ye&&!Ye._f)&&!ec(we)?z(Te,we,de):F(Te,we,de)}},M=(G,ee,de={})=>{const Ae=ke(r,G),we=u.array.has(G),Te=hr(ee);un(i,G,Te),we?(x.array.next({name:G,values:hr(i)}),(g.isDirty||g.dirtyFields||y.isDirty||y.dirtyFields)&&de.shouldDirty&&x.state.next({name:G,dirtyFields:Su(s,i),isDirty:B(G,Te)})):Ae&&!Ae._f&&!ba(Te)?z(G,Te,de):F(G,Te,de),m_(G,u)&&x.state.next({...n,name:G}),x.state.next({name:c.mount?G:void 0,values:hr(i)})},V=async G=>{c.mount=!0;const ee=G.target;let de=ee.name,Ae=!0;const we=ke(r,de),Te=lt=>{Ae=Number.isNaN(lt)||ec(lt)&&isNaN(lt.getTime())||Cs(lt,ke(i,de,lt))},Ye=f_(t.mode),it=f_(t.reValidateMode);if(we){let lt,Dn;const Ka=ee.type?d_(we._f):DO(G),On=G.type===Sg.BLUR||G.type===Sg.FOCUS_OUT,di=!bee(we._f)&&!t.resolver&&!ke(n.errors,de)&&!we._f.deps||Eee(On,ke(n.touchedFields,de),n.isSubmitted,it,Ye),Zn=m_(de,u,On);un(i,de,Ka),On?(!ee||!ee.readOnly)&&(we._f.onBlur&&we._f.onBlur(G),f&&f(0)):we._f.onChange&&we._f.onChange(G);const Un=O(de,Ka,On),Er=!Xr(Un)||Zn;if(!On&&x.state.next({name:de,type:G.type,values:hr(i)}),di)return(g.isValid||y.isValid)&&(t.mode==="onBlur"?On&&C():On||C()),Er&&x.state.next({name:de,...Zn?{}:Un});if(!On&&Zn&&x.state.next({...n}),t.resolver){const{errors:Fn}=await T([de]);if(Te(Ka),Ae){const Al=p_(n.errors,r,de),Fs=p_(Fn,r,Al.name||de);lt=Fs.error,de=Fs.name,Dn=Xr(Fn)}}else E([de],!0),lt=(await y_(we,u.disabled,i,v,t.shouldUseNativeValidation))[de],E([de]),Te(Ka),Ae&&(lt?Dn=!1:(g.isValid||y.isValid)&&(Dn=await L(r,!0)));Ae&&(we._f.deps&&(!Array.isArray(we._f.deps)||we._f.deps.length>0)&&se(we._f.deps),I(de,Dn,lt,Un))}},K=(G,ee)=>{if(ke(n.errors,ee)&&G.focus)return G.focus(),1},se=async(G,ee={})=>{let de,Ae;const we=Of(G);if(t.resolver){const Te=await D($n(G)?G:we);de=Xr(Te),Ae=G?!we.some(Ye=>ke(Te,Ye)):de}else G?(Ae=(await Promise.all(we.map(async Te=>{const Ye=ke(r,Te);return await L(Ye&&Ye._f?{[Te]:Ye}:Ye)}))).every(Boolean),!(!Ae&&!n.isValid)&&C()):Ae=de=await L(r);return x.state.next({...!za(G)||(g.isValid||y.isValid)&&de!==n.isValid?{}:{name:G},...t.resolver||!G?{isValid:de}:{},errors:n.errors}),ee.shouldFocus&&!Ae&&If(r,K,G?we:u.mount),Ae},ve=(G,ee)=>{let de={...c.mount?i:s};return ee&&(de=LO(ee.dirtyFields?n.dirtyFields:n.touchedFields,de)),$n(G)?de:za(G)?ke(de,G):G.map(Ae=>ke(de,Ae))},P=(G,ee)=>({invalid:!!ke((ee||n).errors,G),isDirty:!!ke((ee||n).dirtyFields,G),error:ke((ee||n).errors,G),isValidating:!!ke(n.validatingFields,G),isTouched:!!ke((ee||n).touchedFields,G)}),U=G=>{G&&Of(G).forEach(ee=>or(n.errors,ee)),x.state.next({errors:G?n.errors:{}})},$=(G,ee,de)=>{const Ae=(ke(r,G,{_f:{}})._f||{}).ref,we=ke(n.errors,G)||{},{ref:Te,message:Ye,type:it,...lt}=we;un(n.errors,G,{...lt,...ee,ref:Ae}),x.state.next({name:G,errors:n.errors,isValid:!1}),de&&de.shouldFocus&&Ae&&Ae.focus&&Ae.focus()},Q=(G,ee)=>Es(G)?x.state.subscribe({next:de=>"values"in de&&G(q(void 0,ee),de)}):q(G,ee,!0),ne=G=>x.state.subscribe({next:ee=>{Cee(G.name,ee.name,G.exact)&&See(ee,G.formState||g,er,G.reRenderRoot)&&G.callback({values:{...i},...n,...ee,defaultValues:s})}}).unsubscribe,ue=G=>(c.mount=!0,y={...y,...G.formState},ne({...G,formState:y})),J=(G,ee={})=>{for(const de of G?Of(G):u.mount)u.mount.delete(de),u.array.delete(de),ee.keepValue||(or(r,de),or(i,de)),!ee.keepError&&or(n.errors,de),!ee.keepDirty&&or(n.dirtyFields,de),!ee.keepTouched&&or(n.touchedFields,de),!ee.keepIsValidating&&or(n.validatingFields,de),!t.shouldUnregister&&!ee.keepDefaultValue&&or(s,de);x.state.next({values:hr(i)}),x.state.next({...n,...ee.keepDirty?{isDirty:B()}:{}}),!ee.keepIsValid&&C()},he=({disabled:G,name:ee})=>{(La(G)&&c.mount||G||u.disabled.has(ee))&&(G?u.disabled.add(ee):u.disabled.delete(ee))},ge=(G,ee={})=>{let de=ke(r,G);const Ae=La(ee.disabled)||La(t.disabled);return un(r,G,{...de||{},_f:{...de&&de._f?de._f:{ref:{name:G}},name:G,mount:!0,...ee}}),u.mount.add(G),de?he({disabled:La(ee.disabled)?ee.disabled:t.disabled,name:G}):A(G,!0,ee.value),{...Ae?{disabled:ee.disabled||t.disabled}:{},...t.progressive?{required:!!ee.required,min:pf(ee.min),max:pf(ee.max),minLength:pf(ee.minLength),maxLength:pf(ee.maxLength),pattern:pf(ee.pattern)}:{},name:G,onChange:V,onBlur:V,ref:we=>{if(we){ge(G,ee),de=ke(r,G);const Te=$n(we.value)&&we.querySelectorAll&&we.querySelectorAll("input,select,textarea")[0]||we,Ye=mee(Te),it=de._f.refs||[];if(Ye?it.find(lt=>lt===Te):Te===de._f.ref)return;un(r,G,{_f:{...de._f,...Ye?{refs:[...it.filter(B0),Te,...Array.isArray(ke(s,G))?[{}]:[]],ref:{type:Te.type,name:G}}:{ref:Te}}}),A(G,!1,void 0,Te)}else de=ke(r,G,{}),de._f&&(de._f.mount=!1),(t.shouldUnregister||ee.shouldUnregister)&&!(OO(u.array,G)&&c.action)&&u.unMount.add(G)}}},Ee=()=>t.shouldFocusError&&If(r,K,u.mount),Me=G=>{La(G)&&(x.state.next({disabled:G}),If(r,(ee,de)=>{const Ae=ke(r,de);Ae&&(ee.disabled=Ae._f.disabled||G,Array.isArray(Ae._f.refs)&&Ae._f.refs.forEach(we=>{we.disabled=Ae._f.disabled||G}))},0,!1))},Fe=(G,ee)=>async de=>{let Ae;de&&(de.preventDefault&&de.preventDefault(),de.persist&&de.persist());let we=hr(i);if(x.state.next({isSubmitting:!0}),t.resolver){const{errors:Te,values:Ye}=await T();n.errors=Te,we=hr(Ye)}else await L(r);if(u.disabled.size)for(const Te of u.disabled)or(we,Te);if(or(n.errors,"root"),Xr(n.errors)){x.state.next({errors:{}});try{await G(we,de)}catch(Te){Ae=Te}}else ee&&await ee({...n.errors},de),Ee(),setTimeout(Ee);if(x.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Xr(n.errors)&&!Ae,submitCount:n.submitCount+1,errors:n.errors}),Ae)throw Ae},nt=(G,ee={})=>{ke(r,G)&&($n(ee.defaultValue)?M(G,hr(ke(s,G))):(M(G,ee.defaultValue),un(s,G,hr(ee.defaultValue))),ee.keepTouched||or(n.touchedFields,G),ee.keepDirty||(or(n.dirtyFields,G),n.isDirty=ee.defaultValue?B(G,hr(ke(s,G))):B()),ee.keepError||(or(n.errors,G),g.isValid&&C()),x.state.next({...n}))},ut=(G,ee={})=>{const de=G?hr(G):s,Ae=hr(de),we=Xr(G),Te=we?s:Ae;if(ee.keepDefaultValues||(s=de),!ee.keepValues){if(ee.keepDirtyValues){const Ye=new Set([...u.mount,...Object.keys(Su(s,i))]);for(const it of Array.from(Ye))ke(n.dirtyFields,it)?un(Te,it,ke(i,it)):M(it,ke(Te,it))}else{if(rC&&$n(G))for(const Ye of u.mount){const it=ke(r,Ye);if(it&&it._f){const lt=Array.isArray(it._f.refs)?it._f.refs[0]:it._f.ref;if(Cg(lt)){const Dn=lt.closest("form");if(Dn){Dn.reset();break}}}}if(ee.keepFieldsRef)for(const Ye of u.mount)M(Ye,ke(Te,Ye));else r={}}i=t.shouldUnregister?ee.keepDefaultValues?hr(s):{}:hr(Te),x.array.next({values:{...Te}}),x.state.next({values:{...Te}})}u={mount:ee.keepDirtyValues?u.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},c.mount=!g.isValid||!!ee.keepIsValid||!!ee.keepDirtyValues||!t.shouldUnregister&&!Xr(Te),c.watch=!!t.shouldUnregister,x.state.next({submitCount:ee.keepSubmitCount?n.submitCount:0,isDirty:we?!1:ee.keepDirty?n.isDirty:!!(ee.keepDefaultValues&&!Cs(G,s)),isSubmitted:ee.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:we?{}:ee.keepDirtyValues?ee.keepDefaultValues&&i?Su(s,i):n.dirtyFields:ee.keepDefaultValues&&G?Su(s,G):ee.keepDirty?n.dirtyFields:{},touchedFields:ee.keepTouched?n.touchedFields:{},errors:ee.keepErrors?n.errors:{},isSubmitSuccessful:ee.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:s})},Vt=(G,ee)=>ut(Es(G)?G(i):G,ee),xn=(G,ee={})=>{const de=ke(r,G),Ae=de&&de._f;if(Ae){const we=Ae.refs?Ae.refs[0]:Ae.ref;we.focus&&(we.focus(),ee.shouldSelect&&Es(we.select)&&we.select())}},er=G=>{n={...n,...G}},Pe={control:{register:ge,unregister:J,getFieldState:P,handleSubmit:Fe,setError:$,_subscribe:ne,_runSchema:T,_focusError:Ee,_getWatch:q,_getDirty:B,_setValid:C,_setFieldArray:R,_setDisabledField:he,_setErrors:_,_getFieldArray:Z,_reset:ut,_resetDefaultValues:()=>Es(t.defaultValues)&&t.defaultValues().then(G=>{Vt(G,t.resetOptions),x.state.next({isLoading:!1})}),_removeUnmounted:H,_disableForm:Me,_subjects:x,_proxyFormState:g,get _fields(){return r},get _formValues(){return i},get _state(){return c},set _state(G){c=G},get _defaultValues(){return s},get _names(){return u},set _names(G){u=G},get _formState(){return n},get _options(){return t},set _options(G){t={...t,...G}}},subscribe:ue,trigger:se,register:ge,handleSubmit:Fe,watch:Q,setValue:M,getValues:ve,reset:Vt,resetField:nt,clearErrors:U,unregister:J,setError:$,setFocus:xn,getFieldState:P};return{...Pe,formControl:Pe}}function go(e={}){const t=be.useRef(void 0),n=be.useRef(void 0),[r,s]=be.useState({isDirty:!1,isValidating:!1,isLoading:Es(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:Es(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:r},e.defaultValues&&!Es(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:c,...u}=Tee(e);t.current={...u,formState:r}}const i=t.current.control;return i._options=e,iC(()=>{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]),be.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),be.useEffect(()=>{e.mode&&(i._options.mode=e.mode),e.reValidateMode&&(i._options.reValidateMode=e.reValidateMode)},[i,e.mode,e.reValidateMode]),be.useEffect(()=>{e.errors&&(i._setErrors(e.errors),i._focusError())},[i,e.errors]),be.useEffect(()=>{e.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,e.shouldUnregister]),be.useEffect(()=>{if(i._proxyFormState.isDirty){const c=i._getDirty();c!==r.isDirty&&i._subjects.state.next({isDirty:c})}},[i,r.isDirty]),be.useEffect(()=>{var c;e.values&&!Cs(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]),be.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=MO(r,i),t.current}var _ee=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Nee=_ee.reduce((e,t)=>{const n=Hb(`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}},{}),Aee="Label",VO=h.forwardRef((e,t)=>a.jsx(Nee.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())}}));VO.displayName=Aee;var Dee=VO;function Ba({className:e,...t}){return a.jsx(Dee,{"data-slot":"label",className:re("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 wl=IO,$O=h.createContext({}),Et=({...e})=>a.jsx($O.Provider,{value:{name:e.name},children:a.jsx(hee,{...e})}),Ih=()=>{const e=h.useContext($O),t=h.useContext(GO),{getFieldState:n}=fd(),r=kO({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}},GO=h.createContext({});function yt({className:e="",...t}){const n=h.useId();return a.jsx(GO.Provider,{value:{id:n},children:a.jsx("div",{"data-slot":"form-item",className:re("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 gt({className:e="",tooltip:t,tooltipProps:n,children:r,...s}){const{error:i,formItemId:c}=Ih();return a.jsxs(Ba,{"data-slot":"form-label","data-error":!!i,className:re("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(Nt,{...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(Br,{className:"text-muted-foreground/50 hover:text-muted-foreground size-4 shrink-0 transition-colors","aria-hidden":"true"})})}),a.jsx(Dt,{side:"top",align:"center",role:"tooltip",children:t})]})]})}function St({...e}){const{error:t,formItemId:n,formDescriptionId:r,formMessageId:s}=Ih();return a.jsx(ih,{"data-slot":"form-control",id:n,"aria-describedby":t?`${r} ${s}`:`${r}`,"aria-invalid":!!t,...e})}function an({className:e,...t}){const{formDescriptionId:n}=Ih();return a.jsx("div",{"data-slot":"form-description",id:n,className:re("text-muted-foreground text-sm",e),...t})}function _t({className:e,...t}){const{error:n,formMessageId:r}=Ih(),s=n?String((n==null?void 0:n.message)??""):t.children;return s?a.jsx("p",{"data-slot":"form-message",id:r,className:re("text-destructive text-sm",e),...t,children:s}):null}function Rl({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:re("flex min-h-full flex-col gap-4",t),children:e})})}function jl({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:re(r,e),children:t})}function Gr({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 Oee({value:e,label:t,checked:n,onChange:r,disabled:s=!1,orientation:i="vertical",className:c=""}){const{formItemId:u}=Ih();return a.jsxs("label",{htmlFor:`${u}-${e}`,className:re("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:re("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:re("peer-disabled:cursor-not-allowed peer-disabled:opacity-50"),children:t})]})}function Iee({options:e,value:t,onChange:n,orientation:r="vertical",className:s=""}){return a.jsx("div",{tabIndex:-1,className:re(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(Oee,{value:i.value,label:i.label,checked:t===i.value,onChange:c=>n(c.target.value),disabled:i.disabled,orientation:r},i.value))})}const ci=h.forwardRef(({children:e,className:t="",...n},r)=>a.jsx("form",{ref:r,className:re("flex flex-1 flex-col overflow-hidden",t),...n,children:e}));ci.displayName="AppForm";function x_(e,[t,n]){return Math.min(n,Math.max(t,e))}function tb(e){const t=Mee(e),n=h.forwardRef((r,s)=>{const{children:i,...c}=r,u=h.Children.toArray(i),f=u.find(Lee);if(f){const m=f.props.children,g=u.map(y=>y===f?h.Children.count(m)>1?h.Children.only(null):h.isValidElement(m)?m.props.children:null:y);return a.jsx(t,{...c,ref:s,children:h.isValidElement(m)?h.cloneElement(m,void 0,g):null})}return a.jsx(t,{...c,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function Mee(e){const t=h.forwardRef((n,r)=>{const{children:s,...i}=n;if(h.isValidElement(s)){const c=Uee(s),u=Pee(i,s.props);return s.type!==h.Fragment&&(u.ref=r?qr(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 kee=Symbol("radix.slottable");function Lee(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===kee}function Pee(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 Uee(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 Fee(e){const t=e+"CollectionProvider",[n,r]=xr(t),[s,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=C=>{const{scope:E,children:R}=C,j=be.useRef(null),_=be.useRef(new Map).current;return a.jsx(s,{scope:E,itemMap:_,collectionRef:j,children:R})};c.displayName=t;const u=e+"CollectionSlot",f=tb(u),m=be.forwardRef((C,E)=>{const{scope:R,children:j}=C,_=i(u,R),A=ht(E,_.collectionRef);return a.jsx(f,{ref:A,children:j})});m.displayName=u;const g=e+"CollectionItemSlot",y="data-radix-collection-item",x=tb(g),v=be.forwardRef((C,E)=>{const{scope:R,children:j,..._}=C,A=be.useRef(null),O=ht(E,A),I=i(g,R);return be.useEffect(()=>(I.itemMap.set(A,{ref:A,..._}),()=>void I.itemMap.delete(A))),a.jsx(x,{[y]:"",ref:O,children:j})});v.displayName=g;function S(C){const E=i(e+"CollectionConsumer",C);return be.useCallback(()=>{const j=E.collectionRef.current;if(!j)return[];const _=Array.from(j.querySelectorAll(`[${y}]`));return Array.from(E.itemMap.values()).sort((I,T)=>_.indexOf(I.ref.current)-_.indexOf(T.ref.current))},[E.collectionRef,E.itemMap])}return[{Provider:c,Slot:m,ItemSlot:v},S,r]}function dC(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 zee=[" ","Enter","ArrowUp","ArrowDown"],Hee=[" ","Enter"],hc="Select",[_y,Ny,Vee]=Fee(hc),[hd]=xr(hc,[Vee,mo]),Ay=mo(),[$ee,Tl]=hd(hc),[Gee,Bee]=hd(hc),BO=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:s,onOpenChange:i,value:c,defaultValue:u,onValueChange:f,dir:m,name:g,autoComplete:y,disabled:x,required:v,form:S}=e,C=Ay(t),[E,R]=h.useState(null),[j,_]=h.useState(null),[A,O]=h.useState(!1),I=gh(m),[T,D]=aa({prop:r,defaultProp:s??!1,onChange:i,caller:hc}),[L,H]=aa({prop:c,defaultProp:u,onChange:f,caller:hc}),B=h.useRef(null),q=E?S||!!E.closest("form"):!0,[Z,F]=h.useState(new Set),z=Array.from(Z).map(M=>M.props.value).join(";");return a.jsx(od,{...C,children:a.jsxs($ee,{required:v,scope:t,trigger:E,onTriggerChange:R,valueNode:j,onValueNodeChange:_,valueNodeHasChildren:A,onValueNodeHasChildrenChange:O,contentId:qn(),value:L,onValueChange:H,open:T,onOpenChange:D,dir:I,triggerPointerDownPosRef:B,disabled:x,children:[a.jsx(_y.Provider,{scope:t,children:a.jsx(Gee,{scope:e.__scopeSelect,onNativeOptionAdd:h.useCallback(M=>{F(V=>new Set(V).add(M))},[]),onNativeOptionRemove:h.useCallback(M=>{F(V=>{const K=new Set(V);return K.delete(M),K})},[]),children:n})}),q?a.jsxs(p5,{"aria-hidden":!0,required:v,tabIndex:-1,name:g,autoComplete:y,value:L,onChange:M=>H(M.target.value),disabled:x,form:S,children:[L===void 0?a.jsx("option",{value:""}):null,Array.from(Z)]},z):null]})})};BO.displayName=hc;var qO="SelectTrigger",KO=h.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,i=Ay(n),c=Tl(qO,n),u=c.disabled||r,f=ht(t,c.onTriggerChange),m=Ny(n),g=h.useRef("touch"),[y,x,v]=y5(C=>{const E=m().filter(_=>!_.disabled),R=E.find(_=>_.value===c.value),j=x5(E,C,R);j!==void 0&&c.onValueChange(j.value)}),S=C=>{u||(c.onOpenChange(!0),v()),C&&(c.triggerPointerDownPosRef.current={x:Math.round(C.pageX),y:Math.round(C.pageY)})};return a.jsx(id,{asChild:!0,...i,children:a.jsx(Xe.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":g5(c.value)?"":void 0,...s,ref:f,onClick:Oe(s.onClick,C=>{C.currentTarget.focus(),g.current!=="mouse"&&S(C)}),onPointerDown:Oe(s.onPointerDown,C=>{g.current=C.pointerType;const E=C.target;E.hasPointerCapture(C.pointerId)&&E.releasePointerCapture(C.pointerId),C.button===0&&C.ctrlKey===!1&&C.pointerType==="mouse"&&(S(C),C.preventDefault())}),onKeyDown:Oe(s.onKeyDown,C=>{const E=y.current!=="";!(C.ctrlKey||C.altKey||C.metaKey)&&C.key.length===1&&x(C.key),!(E&&C.key===" ")&&zee.includes(C.key)&&(S(),C.preventDefault())})})})});KO.displayName=qO;var ZO="SelectValue",YO=h.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:i,placeholder:c="",...u}=e,f=Tl(ZO,n),{onValueNodeHasChildrenChange:m}=f,g=i!==void 0,y=ht(t,f.onValueNodeChange);return Ir(()=>{m(g)},[m,g]),a.jsx(Xe.span,{...u,ref:y,style:{pointerEvents:"none"},children:g5(f.value)?a.jsx(a.Fragment,{children:c}):i})});YO.displayName=ZO;var qee="SelectIcon",WO=h.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return a.jsx(Xe.span,{"aria-hidden":!0,...s,ref:t,children:r||"▼"})});WO.displayName=qee;var Kee="SelectPortal",QO=e=>a.jsx(Sc,{asChild:!0,...e});QO.displayName=Kee;var mc="SelectContent",XO=h.forwardRef((e,t)=>{const n=Tl(mc,e.__scopeSelect),[r,s]=h.useState();if(Ir(()=>{s(new DocumentFragment)},[]),!n.open){const i=r;return i?ws.createPortal(a.jsx(JO,{scope:e.__scopeSelect,children:a.jsx(_y.Slot,{scope:e.__scopeSelect,children:a.jsx("div",{children:e.children})})}),i):null}return a.jsx(e5,{...e,ref:t})});XO.displayName=mc;var ys=10,[JO,_l]=hd(mc),Zee="SelectContentImpl",Yee=tb("SelectContent.RemoveScroll"),e5=h.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:i,onPointerDownOutside:c,side:u,sideOffset:f,align:m,alignOffset:g,arrowPadding:y,collisionBoundary:x,collisionPadding:v,sticky:S,hideWhenDetached:C,avoidCollisions:E,...R}=e,j=Tl(mc,n),[_,A]=h.useState(null),[O,I]=h.useState(null),T=ht(t,J=>A(J)),[D,L]=h.useState(null),[H,B]=h.useState(null),q=Ny(n),[Z,F]=h.useState(!1),z=h.useRef(!1);h.useEffect(()=>{if(_)return Kg(_)},[_]),Bg();const M=h.useCallback(J=>{const[he,...ge]=q().map(Fe=>Fe.ref.current),[Ee]=ge.slice(-1),Me=document.activeElement;for(const Fe of J)if(Fe===Me||(Fe==null||Fe.scrollIntoView({block:"nearest"}),Fe===he&&O&&(O.scrollTop=0),Fe===Ee&&O&&(O.scrollTop=O.scrollHeight),Fe==null||Fe.focus(),document.activeElement!==Me))return},[q,O]),V=h.useCallback(()=>M([D,_]),[M,D,_]);h.useEffect(()=>{Z&&V()},[Z,V]);const{onOpenChange:K,triggerPointerDownPosRef:se}=j;h.useEffect(()=>{if(_){let J={x:0,y:0};const he=Ee=>{var Me,Fe;J={x:Math.abs(Math.round(Ee.pageX)-(((Me=se.current)==null?void 0:Me.x)??0)),y:Math.abs(Math.round(Ee.pageY)-(((Fe=se.current)==null?void 0:Fe.y)??0))}},ge=Ee=>{J.x<=10&&J.y<=10?Ee.preventDefault():_.contains(Ee.target)||K(!1),document.removeEventListener("pointermove",he),se.current=null};return se.current!==null&&(document.addEventListener("pointermove",he),document.addEventListener("pointerup",ge,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",he),document.removeEventListener("pointerup",ge,{capture:!0})}}},[_,K,se]),h.useEffect(()=>{const J=()=>K(!1);return window.addEventListener("blur",J),window.addEventListener("resize",J),()=>{window.removeEventListener("blur",J),window.removeEventListener("resize",J)}},[K]);const[ve,P]=y5(J=>{const he=q().filter(Me=>!Me.disabled),ge=he.find(Me=>Me.ref.current===document.activeElement),Ee=x5(he,J,ge);Ee&&setTimeout(()=>Ee.ref.current.focus())}),U=h.useCallback((J,he,ge)=>{const Ee=!z.current&&!ge;(j.value!==void 0&&j.value===he||Ee)&&(L(J),Ee&&(z.current=!0))},[j.value]),$=h.useCallback(()=>_==null?void 0:_.focus(),[_]),Q=h.useCallback((J,he,ge)=>{const Ee=!z.current&&!ge;(j.value!==void 0&&j.value===he||Ee)&&B(J)},[j.value]),ne=r==="popper"?nb:t5,ue=ne===nb?{side:u,sideOffset:f,align:m,alignOffset:g,arrowPadding:y,collisionBoundary:x,collisionPadding:v,sticky:S,hideWhenDetached:C,avoidCollisions:E}:{};return a.jsx(JO,{scope:n,content:_,viewport:O,onViewportChange:I,itemRefCallback:U,selectedItem:D,onItemLeave:$,itemTextRefCallback:Q,focusSelectedItem:V,selectedItemText:H,position:r,isPositioned:Z,searchRef:ve,children:a.jsx(uh,{as:Yee,allowPinchZoom:!0,children:a.jsx(ch,{asChild:!0,trapped:j.open,onMountAutoFocus:J=>{J.preventDefault()},onUnmountAutoFocus:Oe(s,J=>{var he;(he=j.trigger)==null||he.focus({preventScroll:!0}),J.preventDefault()}),children:a.jsx(bc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:c,onFocusOutside:J=>J.preventDefault(),onDismiss:()=>j.onOpenChange(!1),children:a.jsx(ne,{role:"listbox",id:j.contentId,"data-state":j.open?"open":"closed",dir:j.dir,onContextMenu:J=>J.preventDefault(),...R,...ue,onPlaced:()=>F(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...R.style},onKeyDown:Oe(R.onKeyDown,J=>{const he=J.ctrlKey||J.altKey||J.metaKey;if(J.key==="Tab"&&J.preventDefault(),!he&&J.key.length===1&&P(J.key),["ArrowUp","ArrowDown","Home","End"].includes(J.key)){let Ee=q().filter(Me=>!Me.disabled).map(Me=>Me.ref.current);if(["ArrowUp","End"].includes(J.key)&&(Ee=Ee.slice().reverse()),["ArrowUp","ArrowDown"].includes(J.key)){const Me=J.target,Fe=Ee.indexOf(Me);Ee=Ee.slice(Fe+1)}setTimeout(()=>M(Ee)),J.preventDefault()}})})})})})})});e5.displayName=Zee;var Wee="SelectItemAlignedPosition",t5=h.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,i=Tl(mc,n),c=_l(mc,n),[u,f]=h.useState(null),[m,g]=h.useState(null),y=ht(t,T=>g(T)),x=Ny(n),v=h.useRef(!1),S=h.useRef(!0),{viewport:C,selectedItem:E,selectedItemText:R,focusSelectedItem:j}=c,_=h.useCallback(()=>{if(i.trigger&&i.valueNode&&u&&m&&C&&E&&R){const T=i.trigger.getBoundingClientRect(),D=m.getBoundingClientRect(),L=i.valueNode.getBoundingClientRect(),H=R.getBoundingClientRect();if(i.dir!=="rtl"){const Me=H.left-D.left,Fe=L.left-Me,nt=T.left-Fe,ut=T.width+nt,Vt=Math.max(ut,D.width),xn=window.innerWidth-ys,er=x_(Fe,[ys,Math.max(ys,xn-Vt)]);u.style.minWidth=ut+"px",u.style.left=er+"px"}else{const Me=D.right-H.right,Fe=window.innerWidth-L.right-Me,nt=window.innerWidth-T.right-Fe,ut=T.width+nt,Vt=Math.max(ut,D.width),xn=window.innerWidth-ys,er=x_(Fe,[ys,Math.max(ys,xn-Vt)]);u.style.minWidth=ut+"px",u.style.right=er+"px"}const B=x(),q=window.innerHeight-ys*2,Z=C.scrollHeight,F=window.getComputedStyle(m),z=parseInt(F.borderTopWidth,10),M=parseInt(F.paddingTop,10),V=parseInt(F.borderBottomWidth,10),K=parseInt(F.paddingBottom,10),se=z+M+Z+K+V,ve=Math.min(E.offsetHeight*5,se),P=window.getComputedStyle(C),U=parseInt(P.paddingTop,10),$=parseInt(P.paddingBottom,10),Q=T.top+T.height/2-ys,ne=q-Q,ue=E.offsetHeight/2,J=E.offsetTop+ue,he=z+M+J,ge=se-he;if(he<=Q){const Me=B.length>0&&E===B[B.length-1].ref.current;u.style.bottom="0px";const Fe=m.clientHeight-C.offsetTop-C.offsetHeight,nt=Math.max(ne,ue+(Me?$:0)+Fe+V),ut=he+nt;u.style.height=ut+"px"}else{const Me=B.length>0&&E===B[0].ref.current;u.style.top="0px";const nt=Math.max(Q,z+C.offsetTop+(Me?U:0)+ue)+ge;u.style.height=nt+"px",C.scrollTop=he-Q+C.offsetTop}u.style.margin=`${ys}px 0`,u.style.minHeight=ve+"px",u.style.maxHeight=q+"px",r==null||r(),requestAnimationFrame(()=>v.current=!0)}},[x,i.trigger,i.valueNode,u,m,C,E,R,i.dir,r]);Ir(()=>_(),[_]);const[A,O]=h.useState();Ir(()=>{m&&O(window.getComputedStyle(m).zIndex)},[m]);const I=h.useCallback(T=>{T&&S.current===!0&&(_(),j==null||j(),S.current=!1)},[_,j]);return a.jsx(Xee,{scope:n,contentWrapper:u,shouldExpandOnScrollRef:v,onScrollButtonChange:I,children:a.jsx("div",{ref:f,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:A},children:a.jsx(Xe.div,{...s,ref:y,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});t5.displayName=Wee;var Qee="SelectPopperPosition",nb=h.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=ys,...i}=e,c=Ay(n);return a.jsx(fh,{...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)"}})});nb.displayName=Qee;var[Xee,fC]=hd(mc,{}),rb="SelectViewport",n5=h.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,i=_l(rb,n),c=fC(rb,n),u=ht(t,i.onViewportChange),f=h.useRef(0);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),a.jsx(_y.Slot,{scope:n,children:a.jsx(Xe.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:Oe(s.onScroll,m=>{const g=m.currentTarget,{contentWrapper:y,shouldExpandOnScrollRef:x}=c;if(x!=null&&x.current&&y){const v=Math.abs(f.current-g.scrollTop);if(v>0){const S=window.innerHeight-ys*2,C=parseFloat(y.style.minHeight),E=parseFloat(y.style.height),R=Math.max(C,E);if(R<S){const j=R+v,_=Math.min(S,j),A=j-_;y.style.height=_+"px",y.style.bottom==="0px"&&(g.scrollTop=A>0?A:0,y.style.justifyContent="flex-end")}}}f.current=g.scrollTop})})})]})});n5.displayName=rb;var r5="SelectGroup",[Jee,ete]=hd(r5),a5=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=qn();return a.jsx(Jee,{scope:n,id:s,children:a.jsx(Xe.div,{role:"group","aria-labelledby":s,...r,ref:t})})});a5.displayName=r5;var s5="SelectLabel",tte=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=ete(s5,n);return a.jsx(Xe.div,{id:s.id,...r,ref:t})});tte.displayName=s5;var wg="SelectItem",[nte,o5]=hd(wg),i5=h.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:i,...c}=e,u=Tl(wg,n),f=_l(wg,n),m=u.value===r,[g,y]=h.useState(i??""),[x,v]=h.useState(!1),S=ht(t,j=>{var _;return(_=f.itemRefCallback)==null?void 0:_.call(f,j,r,s)}),C=qn(),E=h.useRef("touch"),R=()=>{s||(u.onValueChange(r),u.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return a.jsx(nte,{scope:n,value:r,disabled:s,textId:C,isSelected:m,onItemTextChange:h.useCallback(j=>{y(_=>_||((j==null?void 0:j.textContent)??"").trim())},[]),children:a.jsx(_y.ItemSlot,{scope:n,value:r,disabled:s,textValue:g,children:a.jsx(Xe.div,{role:"option","aria-labelledby":C,"data-highlighted":x?"":void 0,"aria-selected":m&&x,"data-state":m?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...c,ref:S,onFocus:Oe(c.onFocus,()=>v(!0)),onBlur:Oe(c.onBlur,()=>v(!1)),onClick:Oe(c.onClick,()=>{E.current!=="mouse"&&R()}),onPointerUp:Oe(c.onPointerUp,()=>{E.current==="mouse"&&R()}),onPointerDown:Oe(c.onPointerDown,j=>{E.current=j.pointerType}),onPointerMove:Oe(c.onPointerMove,j=>{var _;E.current=j.pointerType,s?(_=f.onItemLeave)==null||_.call(f):E.current==="mouse"&&j.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Oe(c.onPointerLeave,j=>{var _;j.currentTarget===document.activeElement&&((_=f.onItemLeave)==null||_.call(f))}),onKeyDown:Oe(c.onKeyDown,j=>{var A;((A=f.searchRef)==null?void 0:A.current)!==""&&j.key===" "||(Hee.includes(j.key)&&R(),j.key===" "&&j.preventDefault())})})})})});i5.displayName=wg;var Rf="SelectItemText",l5=h.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...i}=e,c=Tl(Rf,n),u=_l(Rf,n),f=o5(Rf,n),m=Bee(Rf,n),[g,y]=h.useState(null),x=ht(t,R=>y(R),f.onItemTextChange,R=>{var j;return(j=u.itemTextRefCallback)==null?void 0:j.call(u,R,f.value,f.disabled)}),v=g==null?void 0:g.textContent,S=h.useMemo(()=>a.jsx("option",{value:f.value,disabled:f.disabled,children:v},f.value),[f.disabled,f.value,v]),{onNativeOptionAdd:C,onNativeOptionRemove:E}=m;return Ir(()=>(C(S),()=>E(S)),[C,E,S]),a.jsxs(a.Fragment,{children:[a.jsx(Xe.span,{id:f.textId,...i,ref:x}),f.isSelected&&c.valueNode&&!c.valueNodeHasChildren?ws.createPortal(i.children,c.valueNode):null]})});l5.displayName=Rf;var c5="SelectItemIndicator",u5=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return o5(c5,n).isSelected?a.jsx(Xe.span,{"aria-hidden":!0,...r,ref:t}):null});u5.displayName=c5;var ab="SelectScrollUpButton",d5=h.forwardRef((e,t)=>{const n=_l(ab,e.__scopeSelect),r=fC(ab,e.__scopeSelect),[s,i]=h.useState(!1),c=ht(t,r.onScrollButtonChange);return Ir(()=>{if(n.viewport&&n.isPositioned){let u=function(){const m=f.scrollTop>0;i(m)};const f=n.viewport;return u(),f.addEventListener("scroll",u),()=>f.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),s?a.jsx(h5,{...e,ref:c,onAutoScroll:()=>{const{viewport:u,selectedItem:f}=n;u&&f&&(u.scrollTop=u.scrollTop-f.offsetHeight)}}):null});d5.displayName=ab;var sb="SelectScrollDownButton",f5=h.forwardRef((e,t)=>{const n=_l(sb,e.__scopeSelect),r=fC(sb,e.__scopeSelect),[s,i]=h.useState(!1),c=ht(t,r.onScrollButtonChange);return Ir(()=>{if(n.viewport&&n.isPositioned){let u=function(){const m=f.scrollHeight-f.clientHeight,g=Math.ceil(f.scrollTop)<m;i(g)};const f=n.viewport;return u(),f.addEventListener("scroll",u),()=>f.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),s?a.jsx(h5,{...e,ref:c,onAutoScroll:()=>{const{viewport:u,selectedItem:f}=n;u&&f&&(u.scrollTop=u.scrollTop+f.offsetHeight)}}):null});f5.displayName=sb;var h5=h.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,i=_l("SelectScrollButton",n),c=h.useRef(null),u=Ny(n),f=h.useCallback(()=>{c.current!==null&&(window.clearInterval(c.current),c.current=null)},[]);return h.useEffect(()=>()=>f(),[f]),Ir(()=>{var g;const m=u().find(y=>y.ref.current===document.activeElement);(g=m==null?void 0:m.ref.current)==null||g.scrollIntoView({block:"nearest"})},[u]),a.jsx(Xe.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:Oe(s.onPointerDown,()=>{c.current===null&&(c.current=window.setInterval(r,50))}),onPointerMove:Oe(s.onPointerMove,()=>{var m;(m=i.onItemLeave)==null||m.call(i),c.current===null&&(c.current=window.setInterval(r,50))}),onPointerLeave:Oe(s.onPointerLeave,()=>{f()})})}),rte="SelectSeparator",m5=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return a.jsx(Xe.div,{"aria-hidden":!0,...r,ref:t})});m5.displayName=rte;var ob="SelectArrow",ate=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Ay(n),i=Tl(ob,n),c=_l(ob,n);return i.open&&c.position==="popper"?a.jsx(hh,{...s,...r,ref:t}):null});ate.displayName=ob;var ste="SelectBubbleInput",p5=h.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const s=h.useRef(null),i=ht(r,s),c=dC(t);return h.useEffect(()=>{const u=s.current;if(!u)return;const f=window.HTMLSelectElement.prototype,g=Object.getOwnPropertyDescriptor(f,"value").set;if(c!==t&&g){const y=new Event("change",{bubbles:!0});g.call(u,t),u.dispatchEvent(y)}},[c,t]),a.jsx(Xe.select,{...n,style:{...b4,...n.style},ref:i,defaultValue:t})});p5.displayName=ste;function g5(e){return e===""||e===void 0}function y5(e){const t=_s(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 x5(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=ote(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 ote(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var ite=BO,lte=KO,cte=YO,ute=WO,dte=QO,fte=XO,hte=n5,mte=a5,pte=i5,gte=l5,yte=u5,xte=d5,vte=f5,bte=m5;function oa({...e}){return a.jsx(ite,{"data-slot":"select",...e})}function Dy({...e}){return a.jsx(mte,{"data-slot":"select-group",...e})}function ia({...e}){return a.jsx(cte,{"data-slot":"select-value",...e})}function la({className:e,size:t="default",children:n,...r}){return a.jsxs(lte,{"data-slot":"select-trigger","data-size":t,className:re("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(ute,{asChild:!0,children:a.jsx(fo,{className:"size-4 opacity-50"})})]})}function ca({className:e,children:t,position:n="popper",...r}){return a.jsx(dte,{children:a.jsxs(fte,{"data-slot":"select-content",className:re("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(Cte,{}),a.jsx(hte,{className:re("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(Ete,{})]})})}function Ln({className:e,children:t,...n}){return a.jsxs(pte,{"data-slot":"select-item",className:re("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(yte,{children:a.jsx(ra,{className:"size-4"})})}),a.jsx(gte,{children:t})]})}function Ste({className:e,...t}){return a.jsx(bte,{"data-slot":"select-separator",className:re("bg-border pointer-events-none -mx-1 my-1 h-px",e),...t})}function Cte({className:e,...t}){return a.jsx(xte,{"data-slot":"select-scroll-up-button",className:re("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(Hu,{className:"size-4"})})}function Ete({className:e,...t}){return a.jsx(vte,{"data-slot":"select-scroll-down-button",className:re("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(fo,{className:"size-4"})})}const wte=Wt({title:Rt().min(1,"Title is required").max(100,"Title must be less than 100 characters"),storageId:Rt().min(1,"Storage is required")});function Rte(){const{createDataMart:e,isLoading:t,error:n}=Ps();return{handleCreate:h.useCallback(async s=>{try{return await e(s)}catch(i){return console.error(i),null}},[e]),isSubmitting:t,serverError:n}}function jte(e){const{getDataMart:t,deleteDataMart:n,updateDataMartTitle:r,updateDataMartDescription:s,updateDataMartDefinition:i,updateDataMartSchema:c,actualizeDataMartSchema:u,publishDataMart:f,runDataMart:m,cancelDataMartRun:g,getDataMartRuns:y,loadMoreDataMartRuns:x,reset:v,dataMart:S,isLoading:C,error:E,getErrorMessage:R,runs:j}=Ps();return h.useEffect(()=>(e?t(e):v(),()=>{v()}),[e,t,v]),{dataMart:S,isLoading:C,error:E,getErrorMessage:R,deleteDataMart:n,updateDataMartTitle:r,updateDataMartDescription:s,updateDataMartDefinition:i,updateDataMartSchema:c,actualizeDataMartSchema:u,publishDataMart:f,runDataMart:m,cancelDataMartRun:g,getDataMartRuns:y,loadMoreDataMartRuns:x,runs:j,getDataMart:t}}const v_=(e,t,n)=>{if(e&&"reportValidity"in e){const r=ke(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},ib=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?v_(r.ref,n,e):r&&r.refs&&r.refs.forEach(s=>v_(s,n,e))}},b_=(e,t)=>{t.shouldUseNativeValidation&&ib(e,t);const n={};for(const r in e){const s=ke(t.fields,r),i=Object.assign(e[r]||{},{ref:s&&s.ref});if(Tte(t.names||Object.keys(e),r)){const c=Object.assign({},ke(n,r));un(c,"root",i),un(n,r,c)}else un(n,r,i)}return n},Tte=(e,t)=>{const n=S_(t);return e.some(r=>S_(r).match(`^${n}\\.\\d+`))};function S_(e){return e.replace(/\]|\[/g,"")}function v5(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 g in c.prototype)g in u||Object.defineProperty(u,g,{value:c.prototype[g].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 g of m._zod.deferred)g();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 _te extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const Nte={};function b5(e){return Nte}function Ate(e,t){return typeof t=="bigint"?t.toString():t}const S5=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function bp(e){return typeof e=="string"?e:e==null?void 0:e.message}function C5(e,t,n){var s,i,c,u,f,m;const r={...e,path:e.path??[]};if(!e.message){const g=bp((c=(i=(s=e.inst)==null?void 0:s._zod.def)==null?void 0:i.error)==null?void 0:c.call(i,e))??bp((u=t==null?void 0:t.error)==null?void 0:u.call(t,e))??bp((f=n.customError)==null?void 0:f.call(n,e))??bp((m=n.localeError)==null?void 0:m.call(n,e))??"Invalid input";r.message=g}return delete r.inst,delete r.continue,t!=null&&t.reportInput||delete r.input,r}const E5=(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,Ate,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Dte=v5("$ZodError",E5),w5=v5("$ZodError",E5,{Parent:Error}),Ote=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 _te;if(c.issues.length){const u=new((s==null?void 0:s.Err)??e)(c.issues.map(f=>C5(f,i,b5())));throw S5(u,s==null?void 0:s.callee),u}return c.value},Ite=Ote(w5),Mte=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=>C5(f,i,b5())));throw S5(u,s==null?void 0:s.callee),u}return c.value},kte=Mte(w5);function C_(e,t){try{var n=e()}catch(r){return t(r)}return n&&n.then?n.then(void 0,t):n}function Lte(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(g){return g.errors.forEach(function(y){return e.push(y)})}),t){var f=n[c].types,m=f&&f[r.code];n[c]=lC(c,t,n,s,m?[].concat(m,r.message):r.message)}e.shift()}return n}function Pte(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(g){return g.forEach(function(y){return e.push(y)})}),t){var f=n[c].types,m=f&&f[r.code];n[c]=lC(c,t,n,s,m?[].concat(m,r.message):r.message)}e.shift()}return n}function ui(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(C_(function(){return Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(c){return i.shouldUseNativeValidation&&ib({},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:b_(Lte(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(C_(function(){return Promise.resolve((n.mode==="sync"?Ite:kte)(e,r,t)).then(function(c){return i.shouldUseNativeValidation&&ib({},i),{errors:{},values:n.raw?Object.assign({},r):c}})},function(c){if((function(u){return u instanceof Dte})(c))return{values:{},errors:b_(Pte(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 R5=h.createContext(void 0);function Ute(){const e=h.useContext(R5);if(e===void 0)throw new Error("useDataStorageContext must be used within a DataStorageProvider");return e}var Zt=(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))(Zt||{});const Fte={dataStorages:[],currentDataStorage:null,loading:!1,error:null};function zte(e,t){switch(t.type){case Zt.FETCH_STORAGES_START:case Zt.FETCH_STORAGE_START:case Zt.CREATE_STORAGE_START:case Zt.UPDATE_STORAGE_START:return{...e,error:null};case Zt.DELETE_STORAGE_START:return{...e,loading:!0,error:null};case Zt.FETCH_STORAGES_SUCCESS:return{...e,dataStorages:t.payload,loading:!1,error:null};case Zt.FETCH_STORAGE_SUCCESS:return{...e,currentDataStorage:t.payload,loading:!1,error:null};case Zt.CREATE_STORAGE_SUCCESS:return{...e,dataStorages:[...e.dataStorages,t.payload],loading:!1,error:null};case Zt.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 Zt.DELETE_STORAGE_SUCCESS:return{...e,dataStorages:e.dataStorages.filter(n=>n.id!==t.payload),loading:!1,error:null};case Zt.FETCH_STORAGES_ERROR:case Zt.FETCH_STORAGE_ERROR:case Zt.CREATE_STORAGE_ERROR:case Zt.UPDATE_STORAGE_ERROR:case Zt.DELETE_STORAGE_ERROR:return{...e,loading:!1,error:t.payload};case Zt.CLEAR_CURRENT_STORAGE:return{...e,currentDataStorage:null};case Zt.CLEAR_ERROR:return{...e,error:null};default:return e}}function hC({children:e}){const[t,n]=h.useReducer(zte,Fte);return a.jsx(R5.Provider,{value:{state:t,dispatch:n},children:e})}class Hte extends gl{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 gf=new Hte;function Oy(){const{state:e,dispatch:t}=Ute(),n=h.useCallback(async()=>{t({type:Zt.FETCH_STORAGES_START});try{const f=await gf.getDataStorages();t({type:Zt.FETCH_STORAGES_SUCCESS,payload:f.map(FJ)})}catch(f){throw t({type:Zt.FETCH_STORAGES_ERROR,payload:en(f)}),f}},[t]),r=h.useCallback(async f=>{try{const m=await gf.getDataStorageById(f),g=zp(m);t({type:Zt.FETCH_STORAGE_SUCCESS,payload:g})}catch(m){throw t({type:Zt.FETCH_STORAGE_ERROR,payload:en(m)}),m}},[t]),s=h.useCallback(async f=>{t({type:Zt.CREATE_STORAGE_START});try{const m=zJ(f),g=await gf.createDataStorage(m),y=zp(g);return t({type:Zt.CREATE_STORAGE_SUCCESS,payload:y}),Ie({event:"data_storage_created",category:"DataStorage",action:"Create",label:y.type}),Mt.success("Storage created"),y}catch(m){return t({type:Zt.CREATE_STORAGE_ERROR,payload:en(m)}),null}},[t]),i=h.useCallback(async(f,m)=>{t({type:Zt.UPDATE_STORAGE_START});try{const g=UJ(m),y=await gf.updateDataStorage(f,g),x=zp(y);return t({type:Zt.UPDATE_STORAGE_SUCCESS,payload:x}),Ie({event:"data_storage_updated",category:"DataStorage",action:"Update",label:x.type}),Mt.success("Storage updated"),x}catch(g){return t({type:Zt.UPDATE_STORAGE_ERROR,payload:en(g)}),null}},[t]),c=h.useCallback(async f=>{t({type:Zt.DELETE_STORAGE_START});try{await gf.deleteDataStorage(f),t({type:Zt.DELETE_STORAGE_SUCCESS,payload:f}),Ie({event:"data_storage_deleted",category:"DataStorage",action:"Delete",label:f}),Mt.success("Storage deleted")}catch(m){throw t({type:Zt.DELETE_STORAGE_ERROR,payload:en(m)}),m}},[t]),u=h.useCallback(()=>{t({type:Zt.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 j5=({isOpen:e,onClose:t,onSelect:n,isCreatingDataStorage:r})=>{const{trigger:s,isLocked:i}=DY(n,1e3);return a.jsx(WS,{open:e,onOpenChange:t,children:a.jsxs(QS,{className:"sm:max-w-sm",children:[a.jsxs(XS,{children:[a.jsx(JS,{children:"New Storage"}),a.jsx(eC,{children:"Choose the type of storage you want to create"})]}),a.jsx("div",{className:"flex flex-col gap-4 py-4",children:yl.getAllTypes().map(c=>{const u=c.icon,f=c.status===$o.ACTIVE;return a.jsxs(Ce,{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(Sr,{variant:"secondary",children:"Coming soon"})]},c.type)})})]})})};function Vte({initialData:e,onSuccess:t}){const{handleCreate:n,isSubmitting:r,serverError:s}=Rte(),{dataStorages:i,loading:c,fetchDataStorages:u,createDataStorage:f,getDataStorageById:m}=Oy(),[g,y]=h.useState(!1),[x,v]=h.useState(!1);h.useEffect(()=>{u()},[u]);const S=go({resolver:ui(wte),defaultValues:{title:(e==null?void 0:e.title)??"",storageId:""},mode:"onTouched"}),C=async j=>{const _=await n(j);_&&t&&t(_)},E=()=>{y(!0)},R=async j=>{v(!0);try{const _=await f(j);_!=null&&_.id&&(await m(_.id),S.setValue("storageId",_.id))}catch(_){console.error("Failed to create storage:",_)}y(!1),v(!1)};return a.jsxs(a.Fragment,{children:[a.jsx(wl,{...S,children:a.jsxs(ci,{onSubmit:j=>{S.handleSubmit(C)(j)},children:[a.jsxs(Rl,{variant:"light",children:[s&&a.jsx("div",{className:"rounded bg-red-100 p-3 text-red-700",children:s.message}),a.jsx(Et,{control:S.control,name:"title",render:({field:j})=>a.jsxs(yt,{children:[a.jsx(gt,{children:"Title"}),a.jsx(St,{children:a.jsx(Tt,{id:"title",placeholder:"Enter title",...j,disabled:r})}),a.jsx(_t,{})]})}),a.jsx(Et,{control:S.control,name:"storageId",render:({field:j})=>a.jsxs(yt,{children:[a.jsx(gt,{children:"Storage"}),a.jsx(St,{children:a.jsxs(oa,{onValueChange:_=>{_==="create_new"?E():j.onChange(_)},value:j.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(Dy,{children:[c&&a.jsx(Ln,{value:"loading",disabled:!0,children:"Loading..."}),!c&&i.map(_=>{const A=yl.getInfo(_.type).icon;return a.jsx(Ln,{value:_.id,children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(A,{size:20}),a.jsx("span",{children:_.title})]})},_.id)}),!c&&i.length>0&&a.jsx(Ste,{}),a.jsx(Ln,{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(ua,{size:20})}),a.jsx("span",{children:"Create new storage"})]})})]})})]})}),a.jsx(_t,{})]})})]}),a.jsxs(jl,{variant:"light",children:[a.jsx(Ce,{type:"submit",children:"Create Data Mart"}),a.jsx(Ce,{variant:"outline",type:"button",onClick:()=>{window.history.back()},children:"Go back"})]})]})}),a.jsx(j5,{isOpen:g,onClose:()=>{y(!1)},onSelect:j=>R(j),isCreatingDataStorage:x})]})}function T5({title:e,onUpdate:t,className:n,errorMessage:r="Title cannot be empty",minWidth:s="200px"}){const[i,c]=h.useState(e),[u,f]=h.useState(!1),m=h.useRef(null);h.useEffect(()=>{c(e)},[e]),h.useEffect(()=>{m.current&&(m.current.style.height="auto",m.current.style.height=`${String(m.current.scrollHeight)}px`)},[i]);const g=async()=>{if(i.trim()===""){c(e);return}if(i.trim()!==e)try{f(!0),await t(i.trim())}catch(x){c(e),console.error(x)}finally{f(!1)}},y=x=>{if(x.key==="Enter"&&!x.shiftKey){if(x.preventDefault(),i.trim()===""){Mt.error(r),c(e);return}g()}else x.key==="Escape"&&c(e)};return a.jsx("h2",{className:re("m-0 cursor-pointer p-0 hover:opacity-80",n),children:a.jsx(po,{ref:m,value:i,onChange:x=>{c(x.target.value);const v=x.target;v.style.height="auto",v.style.height=`${String(v.scrollHeight)}px`},onBlur:()=>void g(),onKeyDown:y,className:re("m-0 w-full border-0 p-0 shadow-none","bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0",{"opacity-50":u}),style:{fontSize:"inherit",fontWeight:"inherit",lineHeight:"inherit",fontFamily:"inherit",color:"inherit",resize:"none",overflow:"hidden",minHeight:"inherit",height:"auto",minWidth:s},disabled:u})})}var Ql=(e=>(e.MANUAL_BACKFILL="MANUAL_BACKFILL",e.INCREMENTAL="INCREMENTAL",e))(Ql||{}),_5=(e=>(e.MANUAL_BACKFILL="MANUAL_BACKFILL",e.HIDE_IN_CONFIG_FORM="HIDE_IN_CONFIG_FORM",e))(_5||{}),Iy="Tabs",[$te]=xr(Iy,[oy]),N5=oy(),[Gte,mC]=$te(Iy),A5=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:i,orientation:c="horizontal",dir:u,activationMode:f="automatic",...m}=e,g=gh(u),[y,x]=aa({prop:r,onChange:s,defaultProp:i??"",caller:Iy});return a.jsx(Gte,{scope:n,baseId:qn(),value:y,onValueChange:x,orientation:c,dir:g,activationMode:f,children:a.jsx(Xe.div,{dir:g,"data-orientation":c,...m,ref:t})})});A5.displayName=Iy;var D5="TabsList",O5=h.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...s}=e,i=mC(D5,n),c=N5(n);return a.jsx(P4,{asChild:!0,...c,orientation:i.orientation,dir:i.dir,loop:r,children:a.jsx(Xe.div,{role:"tablist","aria-orientation":i.orientation,...s,ref:t})})});O5.displayName=D5;var I5="TabsTrigger",M5=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...i}=e,c=mC(I5,n),u=N5(n),f=P5(c.baseId,r),m=U5(c.baseId,r),g=r===c.value;return a.jsx(U4,{asChild:!0,...u,focusable:!s,active:g,children:a.jsx(Xe.button,{type:"button",role:"tab","aria-selected":g,"aria-controls":m,"data-state":g?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:f,...i,ref:t,onMouseDown:Oe(e.onMouseDown,y=>{!s&&y.button===0&&y.ctrlKey===!1?c.onValueChange(r):y.preventDefault()}),onKeyDown:Oe(e.onKeyDown,y=>{[" ","Enter"].includes(y.key)&&c.onValueChange(r)}),onFocus:Oe(e.onFocus,()=>{const y=c.activationMode!=="manual";!g&&!s&&y&&c.onValueChange(r)})})})});M5.displayName=I5;var k5="TabsContent",L5=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:s,children:i,...c}=e,u=mC(k5,n),f=P5(u.baseId,r),m=U5(u.baseId,r),g=r===u.value,y=h.useRef(g);return h.useEffect(()=>{const x=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(x)},[]),a.jsx(kr,{present:s||g,children:({present:x})=>a.jsx(Xe.div,{"data-state":g?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":f,hidden:!x,id:m,tabIndex:0,...c,ref:t,style:{...e.style,animationDuration:y.current?"0s":void 0},children:x&&i})})});L5.displayName=k5;function P5(e,t){return`${e}-trigger-${t}`}function U5(e,t){return`${e}-content-${t}`}var Bte=A5,qte=O5,Kte=M5,Zte=L5;function pC({className:e,...t}){return a.jsx(Bte,{"data-slot":"tabs",className:re("flex flex-col gap-2",e),...t})}function gC({className:e,...t}){return a.jsx(qte,{"data-slot":"tabs-list",className:re("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function Qf({className:e,...t}){return a.jsx(Kte,{"data-slot":"tabs-trigger",className:re("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 Yte({className:e,...t}){return a.jsx(Zte,{"data-slot":"tabs-content",className:re("flex-1 outline-none",e),...t})}var My="Collapsible",[Wte,F5]=xr(My),[Qte,yC]=Wte(My),z5=h.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:i,onOpenChange:c,...u}=e,[f,m]=aa({prop:r,defaultProp:s??!1,onChange:c,caller:My});return a.jsx(Qte,{scope:n,disabled:i,contentId:qn(),open:f,onOpenToggle:h.useCallback(()=>m(g=>!g),[m]),children:a.jsx(Xe.div,{"data-state":SC(f),"data-disabled":i?"":void 0,...u,ref:t})})});z5.displayName=My;var H5="CollapsibleTrigger",xC=h.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,s=yC(H5,n);return a.jsx(Xe.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":SC(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:t,onClick:Oe(e.onClick,s.onOpenToggle)})});xC.displayName=H5;var vC="CollapsibleContent",bC=h.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=yC(vC,e.__scopeCollapsible);return a.jsx(kr,{present:n||s.open,children:({present:i})=>a.jsx(Xte,{...r,ref:t,present:i})})});bC.displayName=vC;var Xte=h.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:s,...i}=e,c=yC(vC,n),[u,f]=h.useState(r),m=h.useRef(null),g=ht(t,m),y=h.useRef(0),x=y.current,v=h.useRef(0),S=v.current,C=c.open||u,E=h.useRef(C),R=h.useRef(void 0);return h.useEffect(()=>{const j=requestAnimationFrame(()=>E.current=!1);return()=>cancelAnimationFrame(j)},[]),Ir(()=>{const j=m.current;if(j){R.current=R.current||{transitionDuration:j.style.transitionDuration,animationName:j.style.animationName},j.style.transitionDuration="0s",j.style.animationName="none";const _=j.getBoundingClientRect();y.current=_.height,v.current=_.width,E.current||(j.style.transitionDuration=R.current.transitionDuration,j.style.animationName=R.current.animationName),f(r)}},[c.open,r]),a.jsx(Xe.div,{"data-state":SC(c.open),"data-disabled":c.disabled?"":void 0,id:c.contentId,hidden:!C,...i,ref:g,style:{"--radix-collapsible-content-height":x?`${x}px`:void 0,"--radix-collapsible-content-width":S?`${S}px`:void 0,...e.style},children:C&&s})});function SC(e){return e?"open":"closed"}var V5=z5,Jte=xC,ene=bC;const tne=V5,nne=xC,rne=bC;function ane({children:e,className:t="",...n}){return a.jsx("div",{className:re("flex flex-1 flex-col overflow-hidden",t),...n,children:e})}function sne({children:e,className:t="",...n}){return a.jsx("div",{className:re("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 one({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:re(s,t),...r,children:e})}function Hi({children:e,className:t="",...n}){return a.jsx("div",{"data-slot":"wizard-step-item",className:re("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 ine({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:re("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(pC,{value:s,onValueChange:i,children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx(Pa,{required:c,tooltip:u,className:"w-full",children:e}),r.length>1&&a.jsx(gC,{children:r.map(m=>a.jsx(Qf,{value:m.value,children:m.label},m.value))})]}),t]})})}function $5({title:e,children:t,defaultOpen:n=!1,className:r=""}){const[s,i]=h.useState(n);return a.jsxs(tne,{open:s,onOpenChange:i,"data-slot":"wizard-collapsible",className:re("group/collapsible flex flex-col gap-2 py-3",r),children:[a.jsx(nne,{asChild:!0,children:a.jsxs("button",{type:"button",className:re("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(Ra,{className:re("text-foreground/75 h-3.5 w-3.5 transition-transform duration-200",s&&"rotate-90")})]})}),a.jsx(rne,{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 Pa({children:e,required:t=!1,tooltip:n,tooltipProps:r,className:s="",...i}){return a.jsxs(Ba,{"data-slot":"wizard-step-label",className:re("text-foreground flex items-center justify-between gap-2 text-sm font-medium",s),...i,children:[t?a.jsxs(Nt,{...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(Dt,{side:"top",align:"center",role:"tooltip",children:"Required"})]}):a.jsx("span",{children:e}),n&&a.jsxs(Nt,{...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(Br,{className:"text-muted-foreground/50 hover:text-muted-foreground size-4 shrink-0 transition-colors","aria-hidden":"true"})})}),a.jsx(Dt,{side:"top",align:"center",role:"tooltip",children:n})]})]})}function tl({title:e,children:t,className:n="",...r}){return a.jsxs("section",{"data-slot":"wizard-step-section",className:re("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 Ko({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:re("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(Ce,{variant:"outline",asChild:!0,children:a.jsxs(na,{to:r,target:"_blank",rel:"noopener noreferrer",children:["Documentation",a.jsx(Wo,{className:"h-4 w-4"})]})})]}):a.jsxs("div",{"data-slot":"wizard-step-hero",className:re("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(Ce,{variant:"outline",className:"mt-3 mb-6",asChild:!0,children:a.jsxs(na,{to:r,target:"_blank",rel:"noopener noreferrer",children:["Documentation",a.jsx(Wo,{className:"h-4 w-4"})]})})]})}function Zo({children:e,className:t="",...n}){return a.jsx("div",{"data-slot":"wizard-step",className:re("space-y-4",t),...n,children:e})}function lne({children:e,className:t="",...n}){return a.jsx("div",{className:re("grid grid-cols-1 gap-4 md:grid-cols-2",t),...n,children:e})}function cne({icon:e,title:t,selected:n=!1,disabled:r=!1,onClick:s,onDoubleClick:i,className:c="",...u}){return a.jsxs("div",{className:re("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(Nt,{children:[a.jsx(At,{asChild:!0,children:a.jsx("span",{className:"cursor-not-allowed text-sm font-medium opacity-70",children:t})}),a.jsx(Dt,{side:"top",align:"center",children:"Coming soon"})]}):a.jsx("span",{className:"text-sm font-medium",children:t})]})}function G5({type:e,id:t,name:n,value:r,label:s,checked:i,selected:c=!1,disabled:u=!1,tooltip:f,rightIcon:m,onChange:g,className:y="",...x}){const v=C=>{g&&g(e==="checkbox"?C.target.checked:C.target.value)},S=h.useRef(null);return a.jsxs("div",{"data-slot":"wizard-step-card-item",onClick:C=>{if(u)return;const E=C.target;E.tagName==="INPUT"||E.tagName==="LABEL"||E.closest("label")||S.current&&S.current.click()},className:re("group border-border flex items-center gap-2 rounded-md border-b bg-white px-4 py-3 transition-shadow duration-200 select-none hover:shadow-sm dark:border-transparent dark:bg-white/4",u?"cursor-not-allowed":"cursor-pointer hover:shadow-sm dark:hover:bg-white/8",c?"ring-primary border-transparent ring-2 dark:bg-white/8":"",y),children:[a.jsx("input",{ref:S,id:t,type:e,name:n,value:r,checked:i,disabled:u,onChange:v,className:re("text-primary focus:ring-primary border-border cursor-pointer",e==="radio"||e==="checkbox"?"h-4 w-4":"h-8 w-full rounded-md border px-2"),...x}),s&&a.jsx(Pa,{htmlFor:t,className:re("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(Nt,{children:[a.jsx(At,{asChild:!0,children:a.jsx(Br,{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(Dt,{side:"top",align:"center",children:f})]}),m&&a.jsx("div",{className:"flex items-center",children:m})]})]})}function CC({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:re(s,n),children:Array.from({length:r}).map((i,c)=>a.jsx(Dr,{className:"border-border h-12 rounded-md border-b bg-white dark:bg-white/4"},c))})}function E_(e){const t=une(e),n=h.forwardRef((r,s)=>{const{children:i,...c}=r,u=h.Children.toArray(i),f=u.find(fne);if(f){const m=f.props.children,g=u.map(y=>y===f?h.Children.count(m)>1?h.Children.only(null):h.isValidElement(m)?m.props.children:null:y);return a.jsx(t,{...c,ref:s,children:h.isValidElement(m)?h.cloneElement(m,void 0,g):null})}return a.jsx(t,{...c,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function une(e){const t=h.forwardRef((n,r)=>{const{children:s,...i}=n;if(h.isValidElement(s)){const c=mne(s),u=hne(i,s.props);return s.type!==h.Fragment&&(u.ref=r?qr(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 dne=Symbol("radix.slottable");function fne(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===dne}function hne(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 mne(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 pne(e){const t=e+"CollectionProvider",[n,r]=xr(t),[s,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=C=>{const{scope:E,children:R}=C,j=be.useRef(null),_=be.useRef(new Map).current;return a.jsx(s,{scope:E,itemMap:_,collectionRef:j,children:R})};c.displayName=t;const u=e+"CollectionSlot",f=E_(u),m=be.forwardRef((C,E)=>{const{scope:R,children:j}=C,_=i(u,R),A=ht(E,_.collectionRef);return a.jsx(f,{ref:A,children:j})});m.displayName=u;const g=e+"CollectionItemSlot",y="data-radix-collection-item",x=E_(g),v=be.forwardRef((C,E)=>{const{scope:R,children:j,..._}=C,A=be.useRef(null),O=ht(E,A),I=i(g,R);return be.useEffect(()=>(I.itemMap.set(A,{ref:A,..._}),()=>void I.itemMap.delete(A))),a.jsx(x,{[y]:"",ref:O,children:j})});v.displayName=g;function S(C){const E=i(e+"CollectionConsumer",C);return be.useCallback(()=>{const j=E.collectionRef.current;if(!j)return[];const _=Array.from(j.querySelectorAll(`[${y}]`));return Array.from(E.itemMap.values()).sort((I,T)=>_.indexOf(I.ref.current)-_.indexOf(T.ref.current))},[E.collectionRef,E.itemMap])}return[{Provider:c,Slot:m,ItemSlot:v},S,r]}var Us="Accordion",gne=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[EC,yne,xne]=pne(Us),[ky]=xr(Us,[xne,F5]),wC=F5(),B5=be.forwardRef((e,t)=>{const{type:n,...r}=e,s=r,i=r;return a.jsx(EC.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?a.jsx(Cne,{...i,ref:t}):a.jsx(Sne,{...s,ref:t})})});B5.displayName=Us;var[q5,vne]=ky(Us),[K5,bne]=ky(Us,{collapsible:!1}),Sne=be.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},collapsible:i=!1,...c}=e,[u,f]=aa({prop:n,defaultProp:r??"",onChange:s,caller:Us});return a.jsx(q5,{scope:e.__scopeAccordion,value:be.useMemo(()=>u?[u]:[],[u]),onItemOpen:f,onItemClose:be.useCallback(()=>i&&f(""),[i,f]),children:a.jsx(K5,{scope:e.__scopeAccordion,collapsible:i,children:a.jsx(Z5,{...c,ref:t})})})}),Cne=be.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},...i}=e,[c,u]=aa({prop:n,defaultProp:r??[],onChange:s,caller:Us}),f=be.useCallback(g=>u((y=[])=>[...y,g]),[u]),m=be.useCallback(g=>u((y=[])=>y.filter(x=>x!==g)),[u]);return a.jsx(q5,{scope:e.__scopeAccordion,value:c,onItemOpen:f,onItemClose:m,children:a.jsx(K5,{scope:e.__scopeAccordion,collapsible:!0,children:a.jsx(Z5,{...i,ref:t})})})}),[Ene,Ly]=ky(Us),Z5=be.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:s,orientation:i="vertical",...c}=e,u=be.useRef(null),f=ht(u,t),m=yne(n),y=gh(s)==="ltr",x=Oe(e.onKeyDown,v=>{var D;if(!gne.includes(v.key))return;const S=v.target,C=m().filter(L=>{var H;return!((H=L.ref.current)!=null&&H.disabled)}),E=C.findIndex(L=>L.ref.current===S),R=C.length;if(E===-1)return;v.preventDefault();let j=E;const _=0,A=R-1,O=()=>{j=E+1,j>A&&(j=_)},I=()=>{j=E-1,j<_&&(j=A)};switch(v.key){case"Home":j=_;break;case"End":j=A;break;case"ArrowRight":i==="horizontal"&&(y?O():I());break;case"ArrowDown":i==="vertical"&&O();break;case"ArrowLeft":i==="horizontal"&&(y?I():O());break;case"ArrowUp":i==="vertical"&&I();break}const T=j%R;(D=C[T].ref.current)==null||D.focus()});return a.jsx(Ene,{scope:n,disabled:r,direction:s,orientation:i,children:a.jsx(EC.Slot,{scope:n,children:a.jsx(Xe.div,{...c,"data-orientation":i,ref:f,onKeyDown:r?void 0:x})})})}),Rg="AccordionItem",[wne,RC]=ky(Rg),Y5=be.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...s}=e,i=Ly(Rg,n),c=vne(Rg,n),u=wC(n),f=qn(),m=r&&c.value.includes(r)||!1,g=i.disabled||e.disabled;return a.jsx(wne,{scope:n,open:m,disabled:g,triggerId:f,children:a.jsx(V5,{"data-orientation":i.orientation,"data-state":t6(m),...u,...s,ref:t,disabled:g,open:m,onOpenChange:y=>{y?c.onItemOpen(r):c.onItemClose(r)}})})});Y5.displayName=Rg;var W5="AccordionHeader",Q5=be.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=Ly(Us,n),i=RC(W5,n);return a.jsx(Xe.h3,{"data-orientation":s.orientation,"data-state":t6(i.open),"data-disabled":i.disabled?"":void 0,...r,ref:t})});Q5.displayName=W5;var lb="AccordionTrigger",X5=be.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=Ly(Us,n),i=RC(lb,n),c=bne(lb,n),u=wC(n);return a.jsx(EC.ItemSlot,{scope:n,children:a.jsx(Jte,{"aria-disabled":i.open&&!c.collapsible||void 0,"data-orientation":s.orientation,id:i.triggerId,...u,...r,ref:t})})});X5.displayName=lb;var J5="AccordionContent",e6=be.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=Ly(Us,n),i=RC(J5,n),c=wC(n);return a.jsx(ene,{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}})});e6.displayName=J5;function t6(e){return e?"open":"closed"}var Rne=B5,jne=Y5,Tne=Q5,_ne=X5,Nne=e6;const jC={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(tU,{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}},n6=h.createContext("default");function dn({variant:e="default",...t}){return a.jsx(n6.Provider,{value:e,children:a.jsx(Rne,{"data-slot":"accordion",...t})})}function TC(e){const t=h.useContext(n6);return e??t??"default"}function Gt({className:e,variant:t,...n}){const r=TC(t),{itemClass:s}=jC[r];return a.jsx(jne,{"data-slot":"accordion-item",className:re(s,e),...n})}function Bt({className:e,children:t,variant:n,...r}){const s=TC(n),{triggerClass:i,icon:c,chevronClass:u,headerClass:f}=jC[s];return a.jsx(Tne,{className:f,children:a.jsxs(_ne,{"data-slot":"accordion-trigger",className:re(i,e),...r,children:[c,t,a.jsx(fo,{className:u,"aria-hidden":"true"})]})})}function qt({className:e,children:t,variant:n,...r}){const s=TC(n),{contentClass:i,contentInnerClass:c}=jC[s];return a.jsx(Nne,{"data-slot":"accordion-content",className:re(i,e),...r,children:a.jsx("div",{className:c,children:t})})}function rn({href:e,children:t,className:n,...r}){return a.jsxs("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:re("text-muted-foreground hover:bg-muted inline-flex items-center px-1 font-medium hover:rounded-md",n),...r,children:[t,a.jsx(Wo,{className:"ml-1 inline h-3 w-3","aria-hidden":"true"})]})}function w_(){return a.jsx(dn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Gt,{value:"connector-state-details",children:[a.jsx(Bt,{children:"What’s connector state?"}),a.jsxs(qt,{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(rn,{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 Ane({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($5,{title:"State Info",children:c.length===0?a.jsxs(yt,{children:[a.jsx(gt,{children:"Connector state"}),a.jsx(St,{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(an,{children:a.jsx(w_,{})})]}):a.jsx(a.Fragment,{children:c.map(({state:u,index:f})=>{const m=u.at||"",g=m?jy(jO(m).toISOString()):"—",y=u.state,x=(()=>{try{return JSON.stringify(y,null,2)}catch{return typeof y=="string"?y:'"—"'}})();return a.jsxs(yt,{children:[a.jsx(gt,{tooltip:`Created at ${g}`,children:`Connector state of configuration #${String(f+1)}`}),a.jsx(St,{children:a.jsx(rD,{value:x,displayOnly:!0,className:"bg-muted overflow-auto rounded-md text-sm",minHeightClass:"min-h-0",showCopyButton:!0})}),a.jsx(an,{children:a.jsx(w_,{})})]},u._id)})})})}function Dne({configuration:e,onClose:t,onSubmit:n}){const[r,s]=h.useState(new Set),i=h.useId(),c=go({defaultValues:{runType:Ql.INCREMENTAL}}),{loading:u,loadingSpecification:f,connectorSpecification:m,fetchConnectorSpecification:g}=jc(),{dataMart:y}=Ps(),x=h.useCallback(async E=>{!r.has(E)&&!f&&(s(R=>new Set(R).add(E)),await g(E))},[r,f,g]);h.useEffect(()=>{e!=null&&e.connector.source.name&&x(e.connector.source.name)},[e,u,x]);const v=E=>{n&&n(E)},S=()=>{t&&t()},C=E=>{if(!E)return"text";switch(E){case bs.DATE:return"date";case bs.NUMBER:return"number";default:return"text"}};return f?a.jsx("div",{children:"Loading..."}):m?a.jsx(wl,{...c,children:a.jsxs(ci,{id:i,noValidate:!0,onSubmit:E=>void c.handleSubmit(v)(E),children:[a.jsxs(Rl,{children:[a.jsxs(Gr,{title:"General",children:[a.jsx(Et,{control:c.control,name:"runType",render:({field:E})=>a.jsxs(yt,{children:[a.jsx(gt,{tooltip:"Select how you want to load data: incremental updates or full backfill for a period",children:"Run type"}),a.jsx(St,{children:a.jsxs(a.Fragment,{children:[a.jsx(Iee,{options:[{value:Ql.INCREMENTAL,label:"Incremental load"},{value:Ql.MANUAL_BACKFILL,label:"Backfill (custom period)"}],value:E.value,onChange:E.onChange,orientation:"horizontal"}),a.jsx(an,{children:c.watch("runType")===Ql.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")===Ql.INCREMENTAL&&a.jsx(Ane,{configuration:e,connectorState:(y==null?void 0:y.connectorState)??null})]}),c.watch("runType")===Ql.MANUAL_BACKFILL&&a.jsx(Gr,{title:"Run configuration",children:m.filter(E=>{var R;return(R=E.attributes)==null?void 0:R.includes(_5.MANUAL_BACKFILL)}).map(E=>a.jsx(Et,{control:c.control,name:`data.${E.name}`,render:()=>a.jsxs(yt,{children:[a.jsx(gt,{tooltip:E.description,children:E.title??E.name}),a.jsx(St,{children:a.jsx(Tt,{id:E.name,placeholder:E.description,type:C(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(_t,{})]},E.name)}))})]}),a.jsxs(jl,{children:[a.jsx(Ce,{type:"submit",disabled:!c.formState.isValid||f,children:"Run"}),a.jsx(Ce,{type:"button",variant:"outline",onClick:S,children:"Cancel"})]})]})}):a.jsx("div",{children:"No connector specification found"})}function One({isOpen:e,onClose:t,configuration:n,onSubmit:r}){return a.jsx(ni,{open:e,onOpenChange:t,children:a.jsxs(ri,{children:[a.jsx(ai,{children:a.jsx(si,{children:"Manual Run"})}),a.jsx(Dne,{configuration:n,onClose:t,onSubmit:r})]})})}function r6({children:e,configuration:t,onManualRun:n,open:r}){const[s,i]=h.useState(r??!1),c=()=>{i(!0)},u=m=>{n(m),i(!1)},f=()=>e?a.jsx("div",{onClick:c,style:{cursor:"pointer"},children:e}):null;return a.jsxs(a.Fragment,{children:[f(),s&&a.jsx(Wu,{children:a.jsx(One,{isOpen:s,onClose:()=>{i(!1)},configuration:t,onSubmit:u})})]})}const Ine=1e3;function Mne(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 g=h.useCallback(E=>{f.current&&r(E)},[]),y=h.useCallback(E=>{f.current&&i(E)},[]),x=h.useCallback((E,R)=>{const j=E instanceof Error?E.message:"Schema actualization failed";Mt.dismiss(R),y(j),g(!1),c.current=null,u.current=null,Mt.error(j,{duration:void 0,id:R})},[y,g]),v=h.useCallback(async()=>{var R;const E=c.current;if((R=u.current)==null||R.abort(),E){Mt.dismiss(E);try{await yn.abortSchemaActualizeTrigger(e,E)}catch{}}c.current=null,u.current=null,g(!1)},[e,g]),S=h.useCallback(async(E,R)=>{var _;const j=A=>A===Va.SUCCESS||A===Va.ERROR||A===Va.CANCELLED;for(;!R.aborted&&c.current===E;)try{const A=await yn.getSchemaActualizeTriggerStatus(e,E);if(j(A)){try{const O=await yn.getSchemaActualizeTriggerResponse(e,E);if(Mt.dismiss(E),O.success)(_=m.current)==null||_.call(m),Mt.success("Output schema actualized",{duration:void 0,id:E});else{const I=O.error??"Schema actualization failed";y(I),Mt.error(I,{duration:void 0,id:E})}}catch(O){const I=O instanceof Error?O.message:"Schema actualization failed";Mt.dismiss(E),y(I),Mt.error(I,{duration:void 0,id:E})}g(!1),c.current=null,u.current=null;return}await new Promise(O=>setTimeout(O,Ine))}catch(A){x(A,E)}},[e,y,g,x]),C=h.useCallback(async()=>{c.current&&await v(),y(null),g(!0);try{const{triggerId:E}=await yn.createSchemaActualizeTrigger(e);Mt.loading("Synchronizing schema with the data storage state. This may take a while.",{duration:1/0,id:E}),c.current=E;const R=new AbortController;u.current=R;try{await S(E,R.signal)}catch(j){x(j,E)}}catch(E){g(!1),y(E instanceof Error?E.message:"Failed to start schema actualization")}},[e,v,S,y,g,x]);return h.useEffect(()=>(f.current=!0,()=>{var R;f.current=!1;const E=c.current;(R=u.current)==null||R.abort(),E&&(Mt.dismiss(E),yn.abortSchemaActualizeTrigger(e,E).catch(()=>{})),c.current=null,u.current=null}),[e]),{run:C,isLoading:n,cancel:v,error:s}}function kne({id:e}){const{navigate:t}=ii(),{user:n}=oi(),{flags:r}=Sh(),{dataMart:s,deleteDataMart:i,updateDataMartTitle:c,updateDataMartDescription:u,updateDataMartDefinition:f,actualizeDataMartSchema:m,updateDataMartSchema:g,publishDataMart:y,runDataMart:x,cancelDataMartRun:v,getDataMartRuns:S,loadMoreDataMartRuns:C,isLoading:E,error:R,getErrorMessage:j,runs:_,getDataMart:A}=jte(e),[O,I]=h.useState(!1),[T,D]=h.useState(!1),{id:L="",canPublish:H=!1,canActualizeSchema:B=!1,status:q={code:null,displayName:"",description:""},title:Z="",definition:F=null,definitionType:z=null,validationErrors:M=[]}=s??{},V=h.useCallback(()=>{L&&A(L)},[L,A]),{run:K,isLoading:se}=Mne(L,V),ve=h.useCallback(async()=>{B&&await K()},[B,K]),P=r==null?void 0:r.INSIGHTS_ENABLED_PROJECT_IDS,U=(n==null?void 0:n.projectId)??"",$=U.length>0&&lee(P??"").includes(U),Q=[{name:"Overview",path:"overview"},{name:"Data Setup",path:"data-setup"},...$?[{name:"Insights",path:"insights"}]:[],{name:"Destinations",path:"reports"},{name:"Triggers",path:"triggers"},{name:"Run History",path:"run-history"}],ne=h.useCallback(async he=>{L&&await c(L,he)},[L,c]),ue=h.useCallback(async()=>{if(L){D(!0);try{await y(L),ve()}catch(he){console.log(he instanceof Error?he.message:"Failed to publish Data Mart")}finally{D(!1)}}},[L,y,ve]),J=h.useCallback(async he=>{if(L){if(q.code!==Or.PUBLISHED){Sn.error("Manual run is only available for published Data Marts");return}await x({id:L,payload:he})}},[L,q,x]);return s?a.jsxs("div",{className:"px-12 py-6",children:[a.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center space-x-1 md:-ml-10",children:[a.jsx(Lu,{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(j7,{className:"h-5 w-5"})}),a.jsx(T5,{title:Z,onUpdate:ne,className:"text-2xl font-medium"})]}),a.jsxs("div",{className:"flex items-center gap-2"+(T?" opacity-50":""),style:{minWidth:"120px"},children:[a.jsxs("div",{className:"ml-4 flex items-center gap-2",children:[a.jsxs(Nt,{children:[a.jsx(At,{asChild:!0,children:a.jsx("div",{children:a.jsx(_h,{type:q.code===Or.PUBLISHED?Bn.SUCCESS:Bn.NEUTRAL,variant:"subtle",children:q.displayName})})}),a.jsx(Dt,{children:q.code===Or.PUBLISHED?"Your published Data Mart is ready for scheduled runs":"Draft Data Mart is not available for scheduled runs. Publish it to activate scheduling."})]}),q.code===Or.DRAFT&&a.jsxs(Nt,{children:[a.jsx(At,{asChild:!0,children:a.jsx("div",{children:a.jsxs(Lu,{variant:"default",onClick:()=>{ue()},disabled:T||!H,className:"ml-2 flex items-center gap-1",children:[a.jsx(Vg,{className:"h-4 w-4"}),"Publish Data Mart"]})})}),!H&&a.jsxs(Dt,{children:[a.jsx("div",{children:"Cannot publish Data Mart. Fix the issues below."}),M.length>0&&a.jsx("ul",{className:"mt-1 list-disc space-y-1 pl-4",children:VQ(M).map((he,ge)=>a.jsx("li",{children:he},ge))})]})]})]}),a.jsxs(Lr,{children:[a.jsx(Pr,{asChild:!0,children:a.jsx(Lu,{variant:"ghost",children:a.jsx(tA,{className:"h-5 w-5"})})}),a.jsxs(Ur,{align:"end",children:[z===$e.CONNECTOR&&a.jsxs(a.Fragment,{children:[a.jsx(r6,{configuration:F??null,onManualRun:he=>{J({runType:he.runType,data:he.data})},children:a.jsxs(Ot,{onClick:he=>{he.preventDefault()},children:[a.jsx($g,{className:"text-foreground h-4 w-4"}),a.jsx("span",{children:"Manual Run..."})]})}),a.jsx(wa,{})]}),a.jsxs(Ot,{onClick:()=>{I(!0)},children:[a.jsx(us,{className:"h-4 w-4 text-red-600"}),a.jsx("span",{className:"text-red-600",children:"Delete Data Mart"})]})]})]})]})]}),a.jsx("div",{children:a.jsx("nav",{className:"-mb-px flex space-x-4 border-b","aria-label":"Tabs",role:"tablist",children:Q.map(he=>a.jsx(oh,{to:he.path,className:({isActive:ge})=>re("border-b-2 px-4 py-2 text-sm font-medium whitespace-nowrap",ge?"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(Ub,{context:{dataMart:s,isLoading:E,error:R,getErrorMessage:j,updateDataMartDescription:u,updateDataMartDefinition:f,actualizeDataMartSchema:m,updateDataMartSchema:g,runDataMart:x,cancelDataMartRun:v,getDataMartRuns:S,loadMoreDataMartRuns:C,runs:_,getDataMart:A,runSchemaActualization:ve,isSchemaActualizationLoading:se}})}),a.jsx(yr,{open:O,onOpenChange:I,title:"Delete Data Mart",description:a.jsxs(a.Fragment,{children:["Are you sure you want to delete ",a.jsxs("strong",{children:['"',Z,'"']}),"? This action cannot be undone."]}),confirmLabel:"Delete",cancelLabel:"Cancel",variant:"destructive",onConfirm:()=>{(async()=>{try{await i(L),I(!1),t("/data-marts")}catch(he){console.error("Failed to delete Data Mart:",he)}})()}})]}):a.jsxs("div",{className:"dm-page-content flex flex-col gap-4 py-4 md:py-8",children:[a.jsx(Dr,{className:"h-16 w-full"},0),Array.from({length:3}).map((he,ge)=>a.jsx(Dr,{className:"h-48 w-full"},ge+1))]})}function Lne({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),[g,y]=h.useState(!1),x=h.useRef(null);h.useEffect(()=>{u(e??"")},[e]),h.useEffect(()=>{if(x.current&&f){x.current.focus();const R=x.current.value.length;x.current.setSelectionRange(R,R),v(x.current)}},[f]);const v=R=>{R.style.height="auto",R.style.height=`${String(R.scrollHeight)}px`},S=R=>{u(R.target.value),v(R.target)},C=async()=>{const R=c.trim();if(R===(e??"")){m(!1);return}try{y(!0),await t(R===""?null:R),m(!1)}catch(_){console.error("Failed to update description:",_),u(e??"")}finally{y(!1)}},E=R=>{R.key==="Enter"&&R.ctrlKey?(R.preventDefault(),C()):R.key==="Escape"&&(R.preventDefault(),u(e??""),m(!1))};return f?a.jsxs("div",{className:"w-full",children:[a.jsx(po,{ref:x,value:c,onChange:S,onBlur:()=>void C(),onKeyDown:E,placeholder:r,className:re("m-0 w-full border-0 bg-white p-2 shadow-none dark:bg-white/4","focus-visible:ring-primary focus-visible:ring-0",{"opacity-50":g}),style:{fontSize:"inherit",lineHeight:"inherit",fontFamily:"inherit",resize:"vertical",minHeight:i,minWidth:s},disabled:g}),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:re("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 Pne(){const{dataMart:e,updateDataMartDescription:t}=qa(),n=async r=>{await t(e.id,r)};return a.jsx("div",{children:a.jsx(Lne,{description:e.description,onUpdate:n,placeholder:"Add a description for this Data Mart..."})})}function R_(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 Une(e){if(Array.isArray(e))return e}function Fne(e,t,n){return(t=qne(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zne(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(g){m=!0,s=g}finally{try{if(!f&&n.return!=null&&(c=n.return(),Object(c)!==c))return}finally{if(m)throw s}}return u}}function Hne(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
779
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function j_(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 T_(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?j_(Object(n),!0).forEach(function(r){Fne(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Vne(e,t){if(e==null)return{};var n,r,s=$ne(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 $ne(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 Gne(e,t){return Une(e)||zne(e,t)||Kne(e,t)||Hne()}function Bne(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 qne(e){var t=Bne(e,"string");return typeof t=="symbol"?t:t+""}function Kne(e,t){if(e){if(typeof e=="string")return R_(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)?R_(e,t):void 0}}function Zne(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function __(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function N_(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?__(Object(n),!0).forEach(function(r){Zne(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):__(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Yne(){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 jf(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 jg(e){return{}.toString.call(e).includes("Object")}function Wne(e){return!Object.keys(e).length}function Xf(e){return typeof e=="function"}function Qne(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Xne(e,t){return jg(t)||al("changeType"),Object.keys(t).some(function(n){return!Qne(e,n)})&&al("changeField"),t}function Jne(e){Xf(e)||al("selectorType")}function ere(e){Xf(e)||jg(e)||al("handlerType"),jg(e)&&Object.values(e).some(function(t){return!Xf(t)})&&al("handlersType")}function tre(e){e||al("initialIsRequired"),jg(e)||al("initialType"),Wne(e)&&al("initialContent")}function nre(e,t){throw new Error(e[t]||e.default)}var rre={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"},al=jf(nre)(rre),Sp={changes:Xne,selector:Jne,handler:ere,initial:tre};function are(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Sp.initial(e),Sp.handler(t);var n={current:e},r=jf(ire)(n,t),s=jf(ore)(n),i=jf(Sp.changes)(e),c=jf(sre)(n);function u(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(g){return g};return Sp.selector(m),m(n.current)}function f(m){Yne(r,s,i,c)(m)}return[u,f]}function sre(e,t){return Xf(t)?t(e.current):t}function ore(e,t){return e.current=N_(N_({},e.current),t),t}function ire(e,t,n){return Xf(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 lre={create:are},cre={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function ure(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 dre(e){return{}.toString.call(e).includes("Object")}function fre(e){return e||A_("configIsRequired"),dre(e)||A_("configType"),e.urls?(hre(),{paths:{vs:e.urls.monacoBase}}):e}function hre(){console.warn(a6.deprecation)}function mre(e,t){throw new Error(e[t]||e.default)}var a6={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!
|
|
780
|
-
You are using deprecated way of configuration.
|
|
781
|
-
|
|
782
|
-
Instead of using
|
|
783
|
-
monaco.config({ urls: { monacoBase: '...' } })
|
|
784
|
-
use
|
|
785
|
-
monaco.config({ paths: { vs: '...' } })
|
|
786
|
-
|
|
787
|
-
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
788
|
-
`},A_=ure(mre)(a6),pre={config:fre},gre=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 s6(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],s6(e[n],t[n]))}),T_(T_({},e),t)}var yre={type:"cancelation",msg:"operation is manually canceled"};function q0(e){var t=!1,n=new Promise(function(r,s){e.then(function(i){return t?s(yre):r(i)}),e.catch(s)});return n.cancel=function(){return t=!0},n}var xre=["monaco"],vre=lre.create({config:cre,isInitialized:!1,resolve:null,reject:null,monaco:null}),o6=Gne(vre,2),Mh=o6[0],Py=o6[1];function bre(e){var t=pre.config(e),n=t.monaco,r=Vne(t,xre);Py(function(s){return{config:s6(s.config,r),monaco:n}})}function Sre(){var e=Mh(function(t){var n=t.monaco,r=t.isInitialized,s=t.resolve;return{monaco:n,isInitialized:r,resolve:s}});if(!e.isInitialized){if(Py({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),q0(K0);if(window.monaco&&window.monaco.editor)return i6(window.monaco),e.resolve(window.monaco),q0(K0);gre(Cre,wre)(Rre)}return q0(K0)}function Cre(e){return document.body.appendChild(e)}function Ere(e){var t=document.createElement("script");return e&&(t.src=e),t}function wre(e){var t=Mh(function(r){var s=r.config,i=r.reject;return{config:s,reject:i}}),n=Ere("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function Rre(){var e=Mh(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;i6(r),e.resolve(r)},function(n){e.reject(n)})}function i6(e){Mh().monaco||Py({monaco:e})}function jre(){return Mh(function(e){var t=e.monaco;return t})}var K0=new Promise(function(e,t){return Py({resolve:e,reject:t})}),l6={config:bre,init:Sre,__getMonacoInstance:jre},Tre={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},Z0=Tre,_re={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},Nre=_re;function Are({children:e}){return be.createElement("div",{style:Nre.container},e)}var Dre=Are,Ore=Dre;function Ire({width:e,height:t,isEditorReady:n,loading:r,_ref:s,className:i,wrapperProps:c}){return be.createElement("section",{style:{...Z0.wrapper,width:e,height:t},...c},!n&&be.createElement(Ore,null,r),be.createElement("div",{ref:s,style:{...Z0.fullWidth,...!n&&Z0.hide},className:i}))}var Mre=Ire,c6=h.memo(Mre);function kre(e){h.useEffect(e,[])}var u6=kre;function Lre(e,t,n=!0){let r=h.useRef(!0);h.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var Ua=Lre;function Mf(){}function Tu(e,t,n,r){return Pre(e,r)||Ure(e,t,n,r)}function Pre(e,t){return e.editor.getModel(d6(e,t))}function Ure(e,t,n,r){return e.editor.createModel(t,n,r?d6(e,r):void 0)}function d6(e,t){return e.Uri.parse(t)}function Fre({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:s,originalModelPath:i,modifiedModelPath:c,keepCurrentOriginalModel:u=!1,keepCurrentModifiedModel:f=!1,theme:m="light",loading:g="Loading...",options:y={},height:x="100%",width:v="100%",className:S,wrapperProps:C={},beforeMount:E=Mf,onMount:R=Mf}){let[j,_]=h.useState(!1),[A,O]=h.useState(!0),I=h.useRef(null),T=h.useRef(null),D=h.useRef(null),L=h.useRef(R),H=h.useRef(E),B=h.useRef(!1);u6(()=>{let z=l6.init();return z.then(M=>(T.current=M)&&O(!1)).catch(M=>(M==null?void 0:M.type)!=="cancelation"&&console.error("Monaco initialization: error:",M)),()=>I.current?F():z.cancel()}),Ua(()=>{if(I.current&&T.current){let z=I.current.getOriginalEditor(),M=Tu(T.current,e||"",r||n||"text",i||"");M!==z.getModel()&&z.setModel(M)}},[i],j),Ua(()=>{if(I.current&&T.current){let z=I.current.getModifiedEditor(),M=Tu(T.current,t||"",s||n||"text",c||"");M!==z.getModel()&&z.setModel(M)}},[c],j),Ua(()=>{let z=I.current.getModifiedEditor();z.getOption(T.current.editor.EditorOption.readOnly)?z.setValue(t||""):t!==z.getValue()&&(z.executeEdits("",[{range:z.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),z.pushUndoStop())},[t],j),Ua(()=>{var z,M;(M=(z=I.current)==null?void 0:z.getModel())==null||M.original.setValue(e||"")},[e],j),Ua(()=>{let{original:z,modified:M}=I.current.getModel();T.current.editor.setModelLanguage(z,r||n||"text"),T.current.editor.setModelLanguage(M,s||n||"text")},[n,r,s],j),Ua(()=>{var z;(z=T.current)==null||z.editor.setTheme(m)},[m],j),Ua(()=>{var z;(z=I.current)==null||z.updateOptions(y)},[y],j);let q=h.useCallback(()=>{var V;if(!T.current)return;H.current(T.current);let z=Tu(T.current,e||"",r||n||"text",i||""),M=Tu(T.current,t||"",s||n||"text",c||"");(V=I.current)==null||V.setModel({original:z,modified:M})},[n,t,s,e,r,i,c]),Z=h.useCallback(()=>{var z;!B.current&&D.current&&(I.current=T.current.editor.createDiffEditor(D.current,{automaticLayout:!0,...y}),q(),(z=T.current)==null||z.editor.setTheme(m),_(!0),B.current=!0)},[y,m,q]);h.useEffect(()=>{j&&L.current(I.current,T.current)},[j]),h.useEffect(()=>{!A&&!j&&Z()},[A,j,Z]);function F(){var M,V,K,se;let z=(M=I.current)==null?void 0:M.getModel();u||((V=z==null?void 0:z.original)==null||V.dispose()),f||((K=z==null?void 0:z.modified)==null||K.dispose()),(se=I.current)==null||se.dispose()}return be.createElement(c6,{width:v,height:x,isEditorReady:j,loading:g,_ref:D,className:S,wrapperProps:C})}var zre=Fre;h.memo(zre);function Hre(e){let t=h.useRef();return h.useEffect(()=>{t.current=e},[e]),t.current}var Vre=Hre,Cp=new Map;function $re({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:s,path:i,theme:c="light",line:u,loading:f="Loading...",options:m={},overrideServices:g={},saveViewState:y=!0,keepCurrentModel:x=!1,width:v="100%",height:S="100%",className:C,wrapperProps:E={},beforeMount:R=Mf,onMount:j=Mf,onChange:_,onValidate:A=Mf}){let[O,I]=h.useState(!1),[T,D]=h.useState(!0),L=h.useRef(null),H=h.useRef(null),B=h.useRef(null),q=h.useRef(j),Z=h.useRef(R),F=h.useRef(),z=h.useRef(r),M=Vre(i),V=h.useRef(!1),K=h.useRef(!1);u6(()=>{let P=l6.init();return P.then(U=>(L.current=U)&&D(!1)).catch(U=>(U==null?void 0:U.type)!=="cancelation"&&console.error("Monaco initialization: error:",U)),()=>H.current?ve():P.cancel()}),Ua(()=>{var U,$,Q,ne;let P=Tu(L.current,e||r||"",t||s||"",i||n||"");P!==((U=H.current)==null?void 0:U.getModel())&&(y&&Cp.set(M,($=H.current)==null?void 0:$.saveViewState()),(Q=H.current)==null||Q.setModel(P),y&&((ne=H.current)==null||ne.restoreViewState(Cp.get(i))))},[i],O),Ua(()=>{var P;(P=H.current)==null||P.updateOptions(m)},[m],O),Ua(()=>{!H.current||r===void 0||(H.current.getOption(L.current.editor.EditorOption.readOnly)?H.current.setValue(r):r!==H.current.getValue()&&(K.current=!0,H.current.executeEdits("",[{range:H.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),H.current.pushUndoStop(),K.current=!1))},[r],O),Ua(()=>{var U,$;let P=(U=H.current)==null?void 0:U.getModel();P&&s&&(($=L.current)==null||$.editor.setModelLanguage(P,s))},[s],O),Ua(()=>{var P;u!==void 0&&((P=H.current)==null||P.revealLine(u))},[u],O),Ua(()=>{var P;(P=L.current)==null||P.editor.setTheme(c)},[c],O);let se=h.useCallback(()=>{var P;if(!(!B.current||!L.current)&&!V.current){Z.current(L.current);let U=i||n,$=Tu(L.current,r||e||"",t||s||"",U||"");H.current=(P=L.current)==null?void 0:P.editor.create(B.current,{model:$,automaticLayout:!0,...m},g),y&&H.current.restoreViewState(Cp.get(U)),L.current.editor.setTheme(c),u!==void 0&&H.current.revealLine(u),I(!0),V.current=!0}},[e,t,n,r,s,i,m,g,y,c,u]);h.useEffect(()=>{O&&q.current(H.current,L.current)},[O]),h.useEffect(()=>{!T&&!O&&se()},[T,O,se]),z.current=r,h.useEffect(()=>{var P,U;O&&_&&((P=F.current)==null||P.dispose(),F.current=(U=H.current)==null?void 0:U.onDidChangeModelContent($=>{K.current||_(H.current.getValue(),$)}))},[O,_]),h.useEffect(()=>{if(O){let P=L.current.editor.onDidChangeMarkers(U=>{var Q;let $=(Q=H.current.getModel())==null?void 0:Q.uri;if($&&U.find(ne=>ne.path===$.path)){let ne=L.current.editor.getModelMarkers({resource:$});A==null||A(ne)}});return()=>{P==null||P.dispose()}}return()=>{}},[O,A]);function ve(){var P,U;(P=F.current)==null||P.dispose(),x?y&&Cp.set(i,H.current.saveViewState()):(U=H.current.getModel())==null||U.dispose(),H.current.dispose()}return be.createElement(c6,{width:v,height:S,isEditorReady:O,loading:f,_ref:B,className:C,wrapperProps:E})}var Gre=$re,_C=h.memo(Gre);function Bre({initialValue:e,onChange:t}){const[n,r]=h.useState((e==null?void 0:e.sqlQuery)??""),{resolvedTheme:s}=Th();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(_C,{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 cb({icon:e,title:t,subtitle:n,rightContent:r,onClick:s,className:i}){const c=e;return a.jsxs("div",{className:re("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(Ra,{className:"text-muted-foreground/75 dark:text-muted-foreground/50 h-4 w-4"})})]})]})}var D_=1,qre=.9,Kre=.8,Zre=.17,Y0=.1,W0=.999,Yre=.9999,Wre=.99,Qre=/[\\\/_+.#"@\[\(\{&]/,Xre=/[\\\/_+.#"@\[\(\{&]/g,Jre=/[\s-]/,f6=/[\s-]/g;function ub(e,t,n,r,s,i,c){if(i===t.length)return s===e.length?D_:Wre;var u=`${s},${i}`;if(c[u]!==void 0)return c[u];for(var f=r.charAt(i),m=n.indexOf(f,s),g=0,y,x,v,S;m>=0;)y=ub(e,t,n,r,m+1,i+1,c),y>g&&(m===s?y*=D_:Qre.test(e.charAt(m-1))?(y*=Kre,v=e.slice(s,m-1).match(Xre),v&&s>0&&(y*=Math.pow(W0,v.length))):Jre.test(e.charAt(m-1))?(y*=qre,S=e.slice(s,m-1).match(f6),S&&s>0&&(y*=Math.pow(W0,S.length))):(y*=Zre,s>0&&(y*=Math.pow(W0,m-s))),e.charAt(m)!==t.charAt(i)&&(y*=Yre)),(y<Y0&&n.charAt(m-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(m-1)!==r.charAt(i))&&(x=ub(e,t,n,r,m+1,i+2,c),x*Y0>y&&(y=x*Y0)),y>g&&(g=y),m=n.indexOf(f,m+1);return c[u]=g,g}function O_(e){return e.toLowerCase().replace(f6," ")}function eae(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,ub(e,t,O_(e),O_(t),0,0,{})}var yf='[cmdk-group=""]',Q0='[cmdk-group-items=""]',tae='[cmdk-group-heading=""]',h6='[cmdk-item=""]',I_=`${h6}:not([aria-disabled="true"])`,db="cmdk-item-select",Cu="data-value",nae=(e,t,n)=>eae(e,t,n),m6=h.createContext(void 0),kh=()=>h.useContext(m6),p6=h.createContext(void 0),NC=()=>h.useContext(p6),g6=h.createContext(void 0),y6=h.forwardRef((e,t)=>{let n=Eu(()=>{var U,$;return{search:"",value:($=(U=e.value)!=null?U:e.defaultValue)!=null?$:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Eu(()=>new Set),s=Eu(()=>new Map),i=Eu(()=>new Map),c=Eu(()=>new Set),u=x6(e),{label:f,children:m,value:g,onValueChange:y,filter:x,shouldFilter:v,loop:S,disablePointerSelection:C=!1,vimBindings:E=!0,...R}=e,j=qn(),_=qn(),A=qn(),O=h.useRef(null),I=hae();pc(()=>{if(g!==void 0){let U=g.trim();n.current.value=U,T.emit()}},[g]),pc(()=>{I(6,Z)},[]);let T=h.useMemo(()=>({subscribe:U=>(c.current.add(U),()=>c.current.delete(U)),snapshot:()=>n.current,setState:(U,$,Q)=>{var ne,ue,J,he;if(!Object.is(n.current[U],$)){if(n.current[U]=$,U==="search")q(),H(),I(1,B);else if(U==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let ge=document.getElementById(A);ge?ge.focus():(ne=document.getElementById(j))==null||ne.focus()}if(I(7,()=>{var ge;n.current.selectedItemId=(ge=F())==null?void 0:ge.id,T.emit()}),Q||I(5,Z),((ue=u.current)==null?void 0:ue.value)!==void 0){let ge=$??"";(he=(J=u.current).onValueChange)==null||he.call(J,ge);return}}T.emit()}},emit:()=>{c.current.forEach(U=>U())}}),[]),D=h.useMemo(()=>({value:(U,$,Q)=>{var ne;$!==((ne=i.current.get(U))==null?void 0:ne.value)&&(i.current.set(U,{value:$,keywords:Q}),n.current.filtered.items.set(U,L($,Q)),I(2,()=>{H(),T.emit()}))},item:(U,$)=>(r.current.add(U),$&&(s.current.has($)?s.current.get($).add(U):s.current.set($,new Set([U]))),I(3,()=>{q(),H(),n.current.value||B(),T.emit()}),()=>{i.current.delete(U),r.current.delete(U),n.current.filtered.items.delete(U);let Q=F();I(4,()=>{q(),(Q==null?void 0:Q.getAttribute("id"))===U&&B(),T.emit()})}),group:U=>(s.current.has(U)||s.current.set(U,new Set),()=>{i.current.delete(U),s.current.delete(U)}),filter:()=>u.current.shouldFilter,label:f||e["aria-label"],getDisablePointerSelection:()=>u.current.disablePointerSelection,listId:j,inputId:A,labelId:_,listInnerRef:O}),[]);function L(U,$){var Q,ne;let ue=(ne=(Q=u.current)==null?void 0:Q.filter)!=null?ne:nae;return U?ue(U,n.current.search,$):0}function H(){if(!n.current.search||u.current.shouldFilter===!1)return;let U=n.current.filtered.items,$=[];n.current.filtered.groups.forEach(ne=>{let ue=s.current.get(ne),J=0;ue.forEach(he=>{let ge=U.get(he);J=Math.max(ge,J)}),$.push([ne,J])});let Q=O.current;z().sort((ne,ue)=>{var J,he;let ge=ne.getAttribute("id"),Ee=ue.getAttribute("id");return((J=U.get(Ee))!=null?J:0)-((he=U.get(ge))!=null?he:0)}).forEach(ne=>{let ue=ne.closest(Q0);ue?ue.appendChild(ne.parentElement===ue?ne:ne.closest(`${Q0} > *`)):Q.appendChild(ne.parentElement===Q?ne:ne.closest(`${Q0} > *`))}),$.sort((ne,ue)=>ue[1]-ne[1]).forEach(ne=>{var ue;let J=(ue=O.current)==null?void 0:ue.querySelector(`${yf}[${Cu}="${encodeURIComponent(ne[0])}"]`);J==null||J.parentElement.appendChild(J)})}function B(){let U=z().find(Q=>Q.getAttribute("aria-disabled")!=="true"),$=U==null?void 0:U.getAttribute(Cu);T.setState("value",$||void 0)}function q(){var U,$,Q,ne;if(!n.current.search||u.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let ue=0;for(let J of r.current){let he=($=(U=i.current.get(J))==null?void 0:U.value)!=null?$:"",ge=(ne=(Q=i.current.get(J))==null?void 0:Q.keywords)!=null?ne:[],Ee=L(he,ge);n.current.filtered.items.set(J,Ee),Ee>0&&ue++}for(let[J,he]of s.current)for(let ge of he)if(n.current.filtered.items.get(ge)>0){n.current.filtered.groups.add(J);break}n.current.filtered.count=ue}function Z(){var U,$,Q;let ne=F();ne&&(((U=ne.parentElement)==null?void 0:U.firstChild)===ne&&((Q=($=ne.closest(yf))==null?void 0:$.querySelector(tae))==null||Q.scrollIntoView({block:"nearest"})),ne.scrollIntoView({block:"nearest"}))}function F(){var U;return(U=O.current)==null?void 0:U.querySelector(`${h6}[aria-selected="true"]`)}function z(){var U;return Array.from(((U=O.current)==null?void 0:U.querySelectorAll(I_))||[])}function M(U){let $=z()[U];$&&T.setState("value",$.getAttribute(Cu))}function V(U){var $;let Q=F(),ne=z(),ue=ne.findIndex(he=>he===Q),J=ne[ue+U];($=u.current)!=null&&$.loop&&(J=ue+U<0?ne[ne.length-1]:ue+U===ne.length?ne[0]:ne[ue+U]),J&&T.setState("value",J.getAttribute(Cu))}function K(U){let $=F(),Q=$==null?void 0:$.closest(yf),ne;for(;Q&&!ne;)Q=U>0?dae(Q,yf):fae(Q,yf),ne=Q==null?void 0:Q.querySelector(I_);ne?T.setState("value",ne.getAttribute(Cu)):V(U)}let se=()=>M(z().length-1),ve=U=>{U.preventDefault(),U.metaKey?se():U.altKey?K(1):V(1)},P=U=>{U.preventDefault(),U.metaKey?M(0):U.altKey?K(-1):V(-1)};return h.createElement(Xe.div,{ref:t,tabIndex:-1,...R,"cmdk-root":"",onKeyDown:U=>{var $;($=R.onKeyDown)==null||$.call(R,U);let Q=U.nativeEvent.isComposing||U.keyCode===229;if(!(U.defaultPrevented||Q))switch(U.key){case"n":case"j":{E&&U.ctrlKey&&ve(U);break}case"ArrowDown":{ve(U);break}case"p":case"k":{E&&U.ctrlKey&&P(U);break}case"ArrowUp":{P(U);break}case"Home":{U.preventDefault(),M(0);break}case"End":{U.preventDefault(),se();break}case"Enter":{U.preventDefault();let ne=F();if(ne){let ue=new Event(db);ne.dispatchEvent(ue)}}}}},h.createElement("label",{"cmdk-label":"",htmlFor:D.inputId,id:D.labelId,style:pae},f),Uy(e,U=>h.createElement(p6.Provider,{value:T},h.createElement(m6.Provider,{value:D},U))))}),rae=h.forwardRef((e,t)=>{var n,r;let s=qn(),i=h.useRef(null),c=h.useContext(g6),u=kh(),f=x6(e),m=(r=(n=f.current)==null?void 0:n.forceMount)!=null?r:c==null?void 0:c.forceMount;pc(()=>{if(!m)return u.item(s,c==null?void 0:c.id)},[m]);let g=v6(s,i,[e.value,e.children,i],e.keywords),y=NC(),x=dl(I=>I.value&&I.value===g.current),v=dl(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(db,S),()=>I.removeEventListener(db,S)},[v,e.onSelect,e.disabled]);function S(){var I,T;C(),(T=(I=f.current).onSelect)==null||T.call(I,g.current)}function C(){y.setState("value",g.current,!0)}if(!v)return null;let{disabled:E,value:R,onSelect:j,forceMount:_,keywords:A,...O}=e;return h.createElement(Xe.div,{ref:qr(i,t),...O,id:s,"cmdk-item":"",role:"option","aria-disabled":!!E,"aria-selected":!!x,"data-disabled":!!E,"data-selected":!!x,onPointerMove:E||u.getDisablePointerSelection()?void 0:C,onClick:E?void 0:S},e.children)}),aae=h.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:s,...i}=e,c=qn(),u=h.useRef(null),f=h.useRef(null),m=qn(),g=kh(),y=dl(v=>s||g.filter()===!1?!0:v.search?v.filtered.groups.has(c):!0);pc(()=>g.group(c),[]),v6(c,u,[e.value,e.heading,f]);let x=h.useMemo(()=>({id:c,forceMount:s}),[s]);return h.createElement(Xe.div,{ref:qr(u,t),...i,"cmdk-group":"",role:"presentation",hidden:y?void 0:!0},n&&h.createElement("div",{ref:f,"cmdk-group-heading":"","aria-hidden":!0,id:m},n),Uy(e,v=>h.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?m:void 0},h.createElement(g6.Provider,{value:x},v))))}),sae=h.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,s=h.useRef(null),i=dl(c=>!c.search);return!n&&!i?null:h.createElement(Xe.div,{ref:qr(s,t),...r,"cmdk-separator":"",role:"separator"})}),oae=h.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,s=e.value!=null,i=NC(),c=dl(m=>m.search),u=dl(m=>m.selectedItemId),f=kh();return h.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),h.createElement(Xe.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)}})}),iae=h.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...s}=e,i=h.useRef(null),c=h.useRef(null),u=dl(m=>m.selectedItemId),f=kh();return h.useEffect(()=>{if(c.current&&i.current){let m=c.current,g=i.current,y,x=new ResizeObserver(()=>{y=requestAnimationFrame(()=>{let v=m.offsetHeight;g.style.setProperty("--cmdk-list-height",v.toFixed(1)+"px")})});return x.observe(m),()=>{cancelAnimationFrame(y),x.unobserve(m)}}},[]),h.createElement(Xe.div,{ref:qr(i,t),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":u,"aria-label":r,id:f.listId},Uy(e,m=>h.createElement("div",{ref:qr(c,f.listInnerRef),"cmdk-list-sizer":""},m)))}),lae=h.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:s,contentClassName:i,container:c,...u}=e;return h.createElement(Yg,{open:n,onOpenChange:r},h.createElement(Wg,{container:c},h.createElement(Qg,{"cmdk-overlay":"",className:s}),h.createElement(Xg,{"aria-label":e.label,"cmdk-dialog":"",className:i},h.createElement(y6,{ref:t,...u}))))}),cae=h.forwardRef((e,t)=>dl(n=>n.filtered.count===0)?h.createElement(Xe.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),uae=h.forwardRef((e,t)=>{let{progress:n,children:r,label:s="Loading...",...i}=e;return h.createElement(Xe.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},Uy(e,c=>h.createElement("div",{"aria-hidden":!0},c)))}),md=Object.assign(y6,{List:iae,Item:rae,Input:oae,Group:aae,Separator:sae,Dialog:lae,Empty:cae,Loading:uae});function dae(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function fae(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function x6(e){let t=h.useRef(e);return pc(()=>{t.current=e}),t}var pc=typeof window>"u"?h.useEffect:h.useLayoutEffect;function Eu(e){let t=h.useRef();return t.current===void 0&&(t.current=e()),t}function dl(e){let t=NC(),n=()=>e(t.snapshot());return h.useSyncExternalStore(t.subscribe,n,n)}function v6(e,t,n,r=[]){let s=h.useRef(),i=kh();return pc(()=>{var c;let u=(()=>{var m;for(let g of n){if(typeof g=="string")return g.trim();if(typeof g=="object"&&"current"in g)return g.current?(m=g.current.textContent)==null?void 0:m.trim():s.current}})(),f=r.map(m=>m.trim());i.value(e,u,f),(c=t.current)==null||c.setAttribute(Cu,u),s.current=u}),s}var hae=()=>{let[e,t]=h.useState(),n=Eu(()=>new Map);return pc(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,s)=>{n.current.set(r,s),t({})}};function mae(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Uy({asChild:e,children:t},n){return e&&h.isValidElement(t)?h.cloneElement(mae(t),{ref:t.ref},n(t.props.children)):n(t)}var pae={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function b6({className:e,...t}){return a.jsx(md,{"data-slot":"command",className:re("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}function S6({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(vc,{className:"size-4 shrink-0 opacity-50"}),a.jsx(md.Input,{"data-slot":"command-input",className:re("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 gae({className:e,...t}){return a.jsx(md.List,{"data-slot":"command-list",className:re("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function C6({...e}){return a.jsx(md.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function E6({className:e,...t}){return a.jsx(md.Group,{"data-slot":"command-group",className:re("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 w6({className:e,...t}){return a.jsx(md.Item,{"data-slot":"command-item",className:re("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 yae(e){const t=xae(e),n=h.forwardRef((r,s)=>{const{children:i,...c}=r,u=h.Children.toArray(i),f=u.find(bae);if(f){const m=f.props.children,g=u.map(y=>y===f?h.Children.count(m)>1?h.Children.only(null):h.isValidElement(m)?m.props.children:null:y);return a.jsx(t,{...c,ref:s,children:h.isValidElement(m)?h.cloneElement(m,void 0,g):null})}return a.jsx(t,{...c,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function xae(e){const t=h.forwardRef((n,r)=>{const{children:s,...i}=n;if(h.isValidElement(s)){const c=Cae(s),u=Sae(i,s.props);return s.type!==h.Fragment&&(u.ref=r?qr(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 vae=Symbol("radix.slottable");function bae(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===vae}function Sae(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 Cae(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 Fy="Popover",[R6]=xr(Fy,[mo]),Lh=mo(),[Eae,Nl]=R6(Fy),j6=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:c=!1}=e,u=Lh(t),f=h.useRef(null),[m,g]=h.useState(!1),[y,x]=aa({prop:r,defaultProp:s??!1,onChange:i,caller:Fy});return a.jsx(od,{...u,children:a.jsx(Eae,{scope:t,contentId:qn(),triggerRef:f,open:y,onOpenChange:x,onOpenToggle:h.useCallback(()=>x(v=>!v),[x]),hasCustomAnchor:m,onCustomAnchorAdd:h.useCallback(()=>g(!0),[]),onCustomAnchorRemove:h.useCallback(()=>g(!1),[]),modal:c,children:n})})};j6.displayName=Fy;var T6="PopoverAnchor",wae=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Nl(T6,n),i=Lh(n),{onCustomAnchorAdd:c,onCustomAnchorRemove:u}=s;return h.useEffect(()=>(c(),()=>u()),[c,u]),a.jsx(id,{...i,...r,ref:t})});wae.displayName=T6;var _6="PopoverTrigger",N6=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Nl(_6,n),i=Lh(n),c=ht(t,s.triggerRef),u=a.jsx(Xe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":M6(s.open),...r,ref:c,onClick:Oe(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?u:a.jsx(id,{asChild:!0,...i,children:u})});N6.displayName=_6;var AC="PopoverPortal",[Rae,jae]=R6(AC,{forceMount:void 0}),A6=e=>{const{__scopePopover:t,forceMount:n,children:r,container:s}=e,i=Nl(AC,t);return a.jsx(Rae,{scope:t,forceMount:n,children:a.jsx(kr,{present:n||i.open,children:a.jsx(Sc,{asChild:!0,container:s,children:r})})})};A6.displayName=AC;var Qu="PopoverContent",D6=h.forwardRef((e,t)=>{const n=jae(Qu,e.__scopePopover),{forceMount:r=n.forceMount,...s}=e,i=Nl(Qu,e.__scopePopover);return a.jsx(kr,{present:r||i.open,children:i.modal?a.jsx(_ae,{...s,ref:t}):a.jsx(Nae,{...s,ref:t})})});D6.displayName=Qu;var Tae=yae("PopoverContent.RemoveScroll"),_ae=h.forwardRef((e,t)=>{const n=Nl(Qu,e.__scopePopover),r=h.useRef(null),s=ht(t,r),i=h.useRef(!1);return h.useEffect(()=>{const c=r.current;if(c)return Kg(c)},[]),a.jsx(uh,{as:Tae,allowPinchZoom:!0,children:a.jsx(O6,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Oe(e.onCloseAutoFocus,c=>{var u;c.preventDefault(),i.current||(u=n.triggerRef.current)==null||u.focus()}),onPointerDownOutside:Oe(e.onPointerDownOutside,c=>{const u=c.detail.originalEvent,f=u.button===0&&u.ctrlKey===!0,m=u.button===2||f;i.current=m},{checkForDefaultPrevented:!1}),onFocusOutside:Oe(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1})})})}),Nae=h.forwardRef((e,t)=>{const n=Nl(Qu,e.__scopePopover),r=h.useRef(!1),s=h.useRef(!1);return a.jsx(O6,{...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()}})}),O6=h.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:c,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:m,onInteractOutside:g,...y}=e,x=Nl(Qu,n),v=Lh(n);return Bg(),a.jsx(ch,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:a.jsx(bc,{asChild:!0,disableOutsidePointerEvents:c,onInteractOutside:g,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:m,onDismiss:()=>x.onOpenChange(!1),children:a.jsx(fh,{"data-state":M6(x.open),role:"dialog",id:x.contentId,...v,...y,ref:t,style:{...y.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)"}})})})}),I6="PopoverClose",Aae=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Nl(I6,n);return a.jsx(Xe.button,{type:"button",...r,ref:t,onClick:Oe(e.onClick,()=>s.onOpenChange(!1))})});Aae.displayName=I6;var Dae="PopoverArrow",Oae=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Lh(n);return a.jsx(hh,{...s,...r,ref:t})});Oae.displayName=Dae;function M6(e){return e?"open":"closed"}var Iae=j6,Mae=N6,kae=A6,Lae=D6;function DC({...e}){return a.jsx(Iae,{"data-slot":"popover",...e})}function OC({...e}){return a.jsx(Mae,{"data-slot":"popover-trigger",...e})}function IC({className:e,align:t="center",sideOffset:n=4,...r}){return a.jsx(kae,{children:a.jsx(Lae,{"data-slot":"popover-content",align:t,sideOffset:n,className:re("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 MC({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,g]=h.useState(""),y=h.useMemo(()=>{const S={};return e.forEach(C=>{const E=C.group??"";Object.prototype.hasOwnProperty.call(S,E)||(S[E]=[]),S[E].push(C)}),S},[e]),x=e.find(S=>S.value===t),v=h.useCallback(S=>{n(S),requestAnimationFrame(()=>{g(""),f(!1)})},[n]);return a.jsxs(DC,{open:u,onOpenChange:f,modal:!0,children:[a.jsx(OC,{asChild:!0,children:a.jsxs(Ce,{variant:"outline",role:"combobox","aria-expanded":u,className:re("w-full justify-between",!t&&"text-muted-foreground",i),disabled:c,children:[x?x.label:r,a.jsx(Gb,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),a.jsx(IC,{className:"max-h-[300px] min-w-[300px] overflow-auto p-0",align:"start",sideOffset:5,children:a.jsxs(b6,{children:[a.jsx(S6,{placeholder:`Search ${r.toLowerCase()}...`,value:m,onValueChange:g}),a.jsx(C6,{children:s}),Object.entries(y).map(([S,C])=>a.jsx(E6,{heading:S,children:C.map(E=>a.jsxs(w6,{value:E.value,onSelect:()=>{v(E.value)},keywords:[E.label],children:[a.jsx(ra,{className:re("mr-2 h-4 w-4",t===E.value?"opacity-100":"opacity-0")}),E.label]},E.value))},S||"default"))]})})]})}function Pae(){return a.jsx(dn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Gt,{value:"service-account-details",children:[a.jsx(Bt,{children:"How do I get a Service Account JSON key?"}),a.jsxs(qt,{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(rn,{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 Uae(){return a.jsx(dn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Gt,{value:"project-id-details",children:[a.jsx(Bt,{children:"How do I find my Project ID?"}),a.jsxs(qt,{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(rn,{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 Fae(){return a.jsx(dn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Gt,{value:"gbq-location-details",children:[a.jsx(Bt,{children:"How do I find my dataset location?"}),a.jsxs(qt,{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(rn,{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 zae=({form:e})=>{const[t,n]=h.useState(!1);if(e.watch("type")!==Re.GOOGLE_BIGQUERY)return null;const r=()=>{n(!0),e.setValue("credentials.serviceAccount","",{shouldDirty:!0})},s=()=>{n(!1),e.resetField("credentials.serviceAccount")},i=e.watch("credentials.serviceAccount"),c=i?_O(i):null;return a.jsxs(a.Fragment,{children:[a.jsxs(Gr,{title:"Connection Settings",children:[a.jsx(Et,{control:e.control,name:"config.projectId",render:({field:u})=>a.jsxs(yt,{children:[a.jsx(gt,{tooltip:"Enter the ID of your Google Cloud project where BigQuery usage will be billed",children:"Project ID"}),a.jsx(St,{children:a.jsx(Tt,{...u,placeholder:"Enter a Project Id"})}),a.jsx(an,{children:a.jsx(Uae,{})}),a.jsx(_t,{})]})}),a.jsx(Et,{control:e.control,name:"config.location",render:({field:u})=>a.jsxs(yt,{children:[a.jsx(gt,{tooltip:"Choose the same region where your BigQuery data is stored to ensure queries work correctly",children:"Location"}),a.jsx(St,{children:a.jsx(MC,{options:aW,value:u.value??"",onValueChange:u.onChange,placeholder:"Select a location",emptyMessage:"No locations found",className:"w-full"})}),a.jsx(an,{children:a.jsx(Fae,{})}),a.jsx(_t,{})]})})]}),a.jsx(Gr,{title:"Authentication",children:a.jsx(Et,{control:e.control,name:"credentials.serviceAccount",render:({field:u})=>a.jsxs(yt,{children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(gt,{tooltip:"Paste a JSON key from a service account that has access to the selected storage provider",children:"Service Account"}),!t&&i&&a.jsx(Ce,{variant:"ghost",size:"sm",onClick:r,type:"button",children:"Edit"}),t&&a.jsx(Ce,{variant:"ghost",size:"sm",onClick:s,type:"button",children:"Cancel"})]}),a.jsx(St,{children:!t&&c?a.jsxs(Nt,{children:[a.jsx(At,{asChild:!0,children:a.jsx(rn,{href:c.url,children:c.email})}),a.jsx(Dt,{children:a.jsx("p",{children:"View in Google Cloud Console"})})]}):a.jsx(po,{...u,className:"min-h-[150px] font-mono",rows:8,placeholder:"Paste your service account JSON here"})}),a.jsx(an,{children:a.jsx(Pae,{})}),a.jsx(_t,{})]})})})]})};function Hae(){return a.jsx(dn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Gt,{value:"athena-region-details",children:[a.jsx(Bt,{children:"How do I find my Athena region?"}),a.jsxs(qt,{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(rn,{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 Vae(){return a.jsx(dn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Gt,{value:"athena-output-bucket-details",children:[a.jsx(Bt,{children:"How do I find a bucket?"}),a.jsxs(qt,{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(rn,{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 $ae(){return a.jsx(dn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Gt,{value:"athena-access-key-id-details",children:[a.jsx(Bt,{children:"How do I get my AWS Access Key ID?"}),a.jsxs(qt,{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(rn,{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(EA,{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(rn,{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 Gae(){return a.jsx(dn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Gt,{value:"athena-secret-access-key-details",children:[a.jsx(Bt,{children:"How do I get my AWS Secret Access Key?"}),a.jsxs(qt,{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(rn,{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 Bae=({form:e})=>{const[t,n]=h.useState("");return h.useEffect(()=>{const r=e.getValues("credentials.accessKeyId");if(r){const s="_".repeat(r.length);n(s),e.setValue("credentials.secretAccessKey",s,{shouldDirty:!1})}},[e]),e.watch("type")!==Re.AWS_ATHENA?null:a.jsxs(a.Fragment,{children:[a.jsxs(Gr,{title:"Connection Settings",children:[a.jsx(Et,{control:e.control,name:"config.region",render:({field:r})=>a.jsxs(yt,{children:[a.jsx(gt,{tooltip:"Enter the AWS region where your Athena service is active",children:"Region"}),a.jsx(St,{children:a.jsx(Tt,{...r,placeholder:"Enter a region"})}),a.jsx(an,{children:a.jsx(Hae,{})}),a.jsx(_t,{})]})}),a.jsx(Et,{control:e.control,name:"config.outputBucket",render:({field:r})=>a.jsxs(yt,{children:[a.jsx(gt,{tooltip:"Specify the S3 bucket where Athena query results will be stored",children:"Output Bucket"}),a.jsx(St,{children:a.jsx(Tt,{...r,placeholder:"Enter an output bucket"})}),a.jsx(an,{children:a.jsx(Vae,{})}),a.jsx(_t,{})]})})]}),a.jsxs(Gr,{title:"Authentication",children:[a.jsx(Et,{control:e.control,name:"credentials.accessKeyId",render:({field:r})=>a.jsxs(yt,{children:[a.jsx(gt,{tooltip:"Your AWS Access Key ID used for authentication",children:"Access Key ID"}),a.jsx(St,{children:a.jsx(Tt,{...r,placeholder:"Enter an access key id"})}),a.jsx(an,{children:a.jsx($ae,{})}),a.jsx(_t,{})]})}),a.jsx(Et,{control:e.control,name:"credentials.secretAccessKey",render:({field:r})=>a.jsxs(yt,{children:[a.jsx(gt,{tooltip:"Your AWS Secret Access Key used for authentication",children:"Secret Access Key"}),a.jsx(St,{children:a.jsx(Tt,{...r,type:"password",placeholder:t||"Enter a secret access key"})}),a.jsx(an,{children:a.jsx(Gae,{})}),a.jsx(_t,{})]})})]})]})};function qae(){return a.jsx(dn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Gt,{value:"snowflake-account-details",children:[a.jsx(Bt,{children:"How do I find my Snowflake account identifier?"}),a.jsxs(qt,{children:[a.jsxs("p",{className:"mb-2",children:["To find the region and locator for your account, see"," ",a.jsx(rn,{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(rn,{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(rn,{className:"underline",href:"https://docs.owox.com/docs/storages/supported-storages/snowflake/",children:"OWOX Snowflake documentation"}),"."]})]})]})})}function Kae(){return a.jsx(dn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Gt,{value:"snowflake-warehouse-details",children:[a.jsx(Bt,{children:"How do I find my Snowflake warehouse?"}),a.jsxs(qt,{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 Zae(){return a.jsx(dn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Gt,{value:"snowflake-auth-method-details",children:[a.jsx(Bt,{children:"Which authentication method should I choose?"}),a.jsxs(qt,{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(rn,{className:"underline",href:"https://docs.snowflake.com/en/user-guide/key-pair-auth.html",children:"key pair authentication"}),"."]})]})]})]})]})})}function Yae(){return a.jsx(dn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Gt,{value:"snowflake-username-details",children:[a.jsx(Bt,{children:"How do I find my Snowflake username?"}),a.jsxs(qt,{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 Wae(){return a.jsx(dn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Gt,{value:"snowflake-password-details",children:[a.jsx(Bt,{children:"How do I manage my Snowflake password?"}),a.jsxs(qt,{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(rn,{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 Qae(){return a.jsx(dn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Gt,{value:"snowflake-keypair-details",children:[a.jsx(Bt,{children:"How do I set up key pair authentication?"}),a.jsxs(qt,{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(rn,{className:"underline",href:"https://docs.snowflake.com/en/user-guide/key-pair-auth.html",children:"Snowflake's key pair authentication documentation"}),"."]})]})]})})}function Xae(){return a.jsx(dn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Gt,{value:"snowflake-passphrase-details",children:[a.jsx(Bt,{children:"What is a passphrase and when do I need it?"}),a.jsxs(qt,{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 Jae=({form:e})=>{const t=e.watch("credentials.authMethod");return e.watch("type")!==Re.SNOWFLAKE?null:a.jsxs(a.Fragment,{children:[a.jsxs(Gr,{title:"Connection Settings",children:[a.jsx(Et,{control:e.control,name:"config.account",render:({field:n})=>a.jsxs(yt,{children:[a.jsx(gt,{tooltip:"Enter your Snowflake account identifier",children:"Account"}),a.jsx(St,{children:a.jsx(Tt,{...n,placeholder:"e.g., xy12345.us-east-1"})}),a.jsx(an,{children:a.jsx(qae,{})}),a.jsx(_t,{})]})}),a.jsx(Et,{control:e.control,name:"config.warehouse",render:({field:n})=>a.jsxs(yt,{children:[a.jsx(gt,{tooltip:"Specify the Snowflake warehouse to use for query execution",children:"Warehouse"}),a.jsx(St,{children:a.jsx(Tt,{...n,placeholder:"Enter warehouse name"})}),a.jsx(an,{children:a.jsx(Kae,{})}),a.jsx(_t,{})]})})]}),a.jsxs(Gr,{title:"Authentication",children:[a.jsx(Et,{control:e.control,name:"credentials.authMethod",render:({field:n})=>a.jsxs(yt,{children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(gt,{children:"Authentication Method"}),a.jsx(pC,{value:n.value,onValueChange:n.onChange,children:a.jsxs(gC,{children:[a.jsx(Qf,{value:Rs.PASSWORD,children:"Username & Password"}),a.jsx(Qf,{value:Rs.KEY_PAIR,children:"Key Pair"})]})})]}),a.jsx(an,{children:a.jsx(Zae,{})}),a.jsx(_t,{})]})}),a.jsx(Et,{control:e.control,name:"credentials.username",render:({field:n})=>a.jsxs(yt,{children:[a.jsx(gt,{tooltip:"Your Snowflake username",children:"Username"}),a.jsx(St,{children:a.jsx(Tt,{...n,placeholder:"Enter username"})}),a.jsx(an,{children:a.jsx(Yae,{})}),a.jsx(_t,{})]})}),t===Rs.PASSWORD&&a.jsx(Et,{control:e.control,name:"credentials.password",render:({field:n})=>a.jsxs(yt,{children:[a.jsx(gt,{tooltip:"Your Snowflake password",children:"Password"}),a.jsx(St,{children:a.jsx(Tt,{...n,type:"password",placeholder:"Enter password"})}),a.jsx(an,{children:a.jsx(Wae,{})}),a.jsx(_t,{})]})}),t===Rs.KEY_PAIR&&a.jsxs(a.Fragment,{children:[a.jsx(Et,{control:e.control,name:"credentials.privateKey",render:({field:n})=>a.jsxs(yt,{children:[a.jsx(gt,{tooltip:"Paste your private key in PEM format",children:"Private Key"}),a.jsx(St,{children:a.jsx(po,{...n,placeholder:`-----BEGIN PRIVATE KEY-----
|
|
789
|
-
...
|
|
790
|
-
-----END PRIVATE KEY-----`,rows:6})}),a.jsx(an,{children:a.jsx(Qae,{})}),a.jsx(_t,{})]})}),a.jsx(Et,{control:e.control,name:"credentials.privateKeyPassphrase",render:({field:n})=>a.jsxs(yt,{children:[a.jsx(gt,{tooltip:"Enter the passphrase if your private key is encrypted",children:"Passphrase (Optional)"}),a.jsx(St,{children:a.jsx(Tt,{...n,type:"password",value:n.value??"",placeholder:"Enter passphrase if key is encrypted"})}),a.jsx(an,{children:a.jsx(Xae,{})}),a.jsx(_t,{})]})})]})]})]})},ese=()=>a.jsx(a.Fragment,{children:a.jsx(dn,{variant:"common",type:"single",collapsible:!0,className:"mt-2",children:a.jsxs(Gt,{value:"snowflake-setup",children:[a.jsx(Bt,{children:"How do I get started with Snowflake?"}),a.jsxs(qt,{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(rn,{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 tse(){return a.jsx(dn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Gt,{value:"bigquery-api-details",children:[a.jsx(Bt,{children:"How do I enable the BigQuery API?"}),a.jsxs(qt,{children:[a.jsxs("p",{className:"mb-2",children:["To run queries and process data in Google BigQuery, you need to enable the"," ",a.jsx(rn,{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 nse(){return a.jsx(dn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Gt,{value:"athena-api-details",children:[a.jsx(Bt,{children:"How do I activate Athena API?"}),a.jsxs(qt,{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(rn,{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 rse({initialData:e,onSubmit:t,onCancel:n,onDirtyChange:r}){const s=go({resolver:ui(NW),defaultValues:e}),{watch:i,control:c,formState:{isDirty:u,isSubmitting:f}}=s,m=i("type");be.useEffect(()=>{r==null||r(u)},[u,r]);const g=async y=>{const{dirtyFields:x}=s.formState,v=TO(y);return x.credentials||delete v.credentials,t(v)};return a.jsx(wl,{...s,children:a.jsxs(ci,{onSubmit:y=>{s.handleSubmit(g)(y)},noValidate:!0,children:[a.jsxs(Rl,{children:[a.jsxs(Gr,{title:"General",children:[a.jsx(Et,{control:c,name:"title",render:({field:y})=>a.jsxs(yt,{children:[a.jsx(gt,{tooltip:"Name the storage to clarify its purpose",children:"Title"}),a.jsx(St,{children:a.jsx(Tt,{...y,placeholder:"Storage title"})}),a.jsx(_t,{})]})}),a.jsx(Et,{control:c,name:"type",render:({field:y})=>a.jsxs(yt,{children:[a.jsx(gt,{tooltip:"The selected source will be used to process data in your Data Marts",children:"Storage Type"}),a.jsx(St,{children:a.jsxs(oa,{value:y.value,onValueChange:y.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(Dy,{children:yl.getAllTypes().map(({type:x,displayName:v,icon:S,status:C})=>a.jsx(Ln,{value:x,disabled:C===$o.COMING_SOON,children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(S,{size:20}),v]})},x))})})]})}),a.jsxs(an,{children:[m===Re.GOOGLE_BIGQUERY&&a.jsx(tse,{}),m===Re.AWS_ATHENA&&a.jsx(nse,{}),m===Re.SNOWFLAKE&&a.jsx(ese,{})]}),a.jsx(_t,{})]})})]}),m===Re.GOOGLE_BIGQUERY&&a.jsx(zae,{form:s}),m===Re.AWS_ATHENA&&a.jsx(Bae,{form:s}),m===Re.SNOWFLAKE&&a.jsx(Jae,{form:s})]}),a.jsxs(jl,{children:[a.jsx(Ce,{variant:"default",type:"submit",className:"w-full","aria-label":"Save",disabled:!u||f,children:"Save"}),a.jsx(Ce,{variant:"outline",type:"button",onClick:n,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})}function k6({isOpen:e,onClose:t,dataStorage:n,onSaveSuccess:r}){const{updateDataStorage:s}=Oy(),[i,c]=h.useState(!1),[u,f]=h.useState(!1),m=h.useCallback(()=>{u?c(!0):t()},[u,t]),g=h.useCallback(()=>{c(!1),f(!1),t()},[t]),y=h.useCallback(S=>{f(S)},[]),x=async S=>{if(n){const C=await s(n.id,S);C&&(r(C),t())}},v=h.useRef(!1);return h.useEffect(()=>{const S=n?"Edit":"Create";e&&!v.current?(Ie({event:"data_storage_config_open",category:"DataStorage",action:S,label:n==null?void 0:n.type}),v.current=!0):!e&&v.current&&(Ie({event:"data_storage_config_close",category:"DataStorage",action:S,label:n==null?void 0:n.type}),v.current=!1)},[e,n]),a.jsxs(a.Fragment,{children:[a.jsx(ni,{open:e,onOpenChange:S=>{S||m()},children:a.jsxs(ri,{children:[a.jsxs(ai,{children:[a.jsx(si,{children:"Configure Storage Provider"}),a.jsx(hl,{children:"Customize settings for your storage provider"})]}),a.jsx(rse,{initialData:n??void 0,onSubmit:x,onCancel:m,onDirtyChange:y})]})}),a.jsx(yr,{open:i,onOpenChange:c,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:g,variant:"destructive"})]})}const ase=({dataStorage:e,onDataStorageChange:t})=>{const[n,r]=h.useState(!1),s=yl.getInfo(e.type),i=()=>{r(!0)},c=()=>{r(!1)},u=()=>{if(!AD(e))return a.jsxs("div",{className:"flex items-center space-x-2 text-sm",children:[a.jsx(Gg,{className:"h-4 w-4 text-red-500"}),a.jsx("span",{className:"text-red-500",children:"Storage configuration is incomplete"})]});const m=(y,x)=>a.jsxs("span",{children:[a.jsxs("span",{className:"text-muted-foreground/75",children:[y,":"]})," ",a.jsx("span",{className:"text-muted-foreground font-medium",children:x})]}),g=(y,x,v)=>a.jsxs("span",{children:[a.jsxs("span",{className:"text-muted-foreground/75",children:[y,":"]})," ",a.jsx(rn,{href:v,onClick:S=>{S.stopPropagation()},children:x})]});switch(e.type){case Re.GOOGLE_BIGQUERY:{const y=e.config.projectId,x=e.config.location,v=`https://console.cloud.google.com/bigquery?project=${y}`;return a.jsxs("div",{className:"flex flex-wrap gap-2",children:[g("Project ID",y,v),a.jsx("span",{className:"text-muted-foreground",children:"•"}),m("Location",x)]})}case Re.AWS_ATHENA:{const y=e.config.region,x=e.config.outputBucket,v=`https://s3.console.aws.amazon.com/s3/buckets/${x}?region=${y}`;return a.jsxs("div",{className:"flex flex-wrap gap-2",children:[m("Region",y),a.jsx("span",{className:"text-muted-foreground",children:"•"}),g("Bucket",x,v)]})}case Re.SNOWFLAKE:{const y=e.config.account,x=e.config.warehouse;return a.jsxs("div",{className:"flex flex-wrap gap-2",children:[g("Account",y,"https://app.snowflake.com/"),a.jsx("span",{className:"text-muted-foreground",children:"•"}),m("Warehouse",x)]})}default:return"Unknown storage type configuration"}};return a.jsxs(a.Fragment,{children:[a.jsx(cb,{title:e.title,icon:s.icon,subtitle:u(),onClick:i}),a.jsx(hC,{children:a.jsx(k6,{isOpen:n,onClose:c,dataStorage:e,onSaveSuccess:f=>{t&&t(f)}})})]})};function sse({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(Ba,{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(Dy,{children:i.map(u=>a.jsxs(Ln,{value:u.type,children:[u.label,a.jsx("span",{className:"text-muted-foreground/80 ml-2",children:u.description})]},u.type))})})]})]})}const ose=Wt({definitionType:Fr($e.SQL),definition:Wt({sqlQuery:Rt().min(1,"SQL query is required")})}),ise=e=>{const t=ZD(e);return Wt({definitionType:Fr($e.TABLE),definition:t})},lse=e=>{const t=ZD(e);return Wt({definitionType:Fr($e.VIEW),definition:t})},cse=e=>{const t=zQ(e);return Wt({definitionType:Fr($e.TABLE_PATTERN),definition:t})},use=Wt({definitionType:Fr($e.CONNECTOR),definition:Wt({connector:Wt({source:Wt({name:Rt().min(1,"Connector name is required"),configuration:V1(xZ(gZ())).min(1,"At least one configuration is required"),node:Rt().min(1,"Node is required"),fields:V1(Rt()).min(1,"At least one field is required")}),storage:Wt({fullyQualifiedName:Rt().min(1,"fully qualified name is required")})})})}),dse=(e,t)=>{if(!e)return Wt({definitionType:vZ(my($e)),definition:Wt({}).optional()});switch(e){case $e.SQL:return ose;case $e.TABLE:return ise(t);case $e.VIEW:return lse(t);case $e.TABLE_PATTERN:return cse(t);case $e.CONNECTOR:return use;default:return Wt({})}};function fse({control:e}){return a.jsx(Et,{control:e,name:"definition.sqlQuery",render:({field:t})=>a.jsxs(yt,{className:"dm-card-block",children:[a.jsx(gt,{className:"text-foreground",children:"SQL Query"}),a.jsx(St,{children:a.jsx(Bre,{initialValue:t.value?{sqlQuery:t.value}:void 0,onChange:n=>{t.onChange(n.sqlQuery)}})}),a.jsx(_t,{})]})})}function hse({control:e,storageType:t}){const n=ID(t),r=MD(t);return a.jsx(Et,{control:e,name:"definition.fullyQualifiedName",render:({field:s})=>a.jsxs(yt,{className:"dm-card-block",children:[a.jsx(gt,{children:"Fully Qualified Table Name"}),a.jsx(St,{children:a.jsx(Tt,{placeholder:n,value:s.value??"",onChange:s.onChange,className:"dm-card-formcontrol"})}),a.jsx(an,{className:"text-muted-foreground/75",children:r}),a.jsx(_t,{})]})})}function mse({control:e,storageType:t}){const n=ID(t),r=MD(t);return a.jsx(Et,{control:e,name:"definition.fullyQualifiedName",render:({field:s})=>a.jsxs(yt,{className:"dm-card-block",children:[a.jsx(gt,{children:"Fully Qualified View Name"}),a.jsx(St,{children:a.jsx(Tt,{placeholder:n,value:s.value??"",onChange:s.onChange,className:"dm-card-formcontrol"})}),a.jsx(an,{className:"text-muted-foreground/75",children:r}),a.jsx(_t,{})]})})}function pse({control:e,storageType:t}){const n=LW(t),r=PW(t);return a.jsx(Et,{control:e,name:"definition.pattern",render:({field:s})=>a.jsxs(yt,{className:"dm-card-block",children:[a.jsx(gt,{children:"Table Pattern"}),a.jsx(St,{children:a.jsx(Tt,{placeholder:n,value:s.value??"",onChange:s.onChange,className:"dm-card-formcontrol"})}),a.jsx(an,{className:"text-muted-foreground/75",children:r}),a.jsx(_t,{})]})})}const kC=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{}}},gse=Ju("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 LC({className:e,variant:t,...n}){return a.jsx("div",{"data-slot":"alert",role:"alert",className:re(gse({variant:t}),e),...n})}function L6({className:e,...t}){return a.jsx("div",{"data-slot":"alert-title",className:re("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),...t})}function PC({className:e,...t}){return a.jsx("div",{"data-slot":"alert-description",className:re("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",e),...t})}function yse({connectors:e,selectedConnector:t,loading:n,error:r,onConnectorSelect:s,onConnectorDoubleClick:i}){return n?a.jsx(CC,{variant:"grid"}):r?a.jsxs(LC,{variant:"destructive",children:[a.jsx(lh,{className:"h-4 w-4"}),a.jsx(PC,{children:"Failed to load available connectors. Please try again."})]}):a.jsxs(Zo,{children:[a.jsx(tl,{title:"Choose Connector",children:a.jsx(lne,{children:e.map(c=>a.jsx(cne,{icon:c.logoBase64?a.jsx(Ec,{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(Ko,{icon:a.jsx(Vf,{size:56,strokeWidth:1}),title:"No connectors available",subtitle:"Ask your administrator to configure connectors."})]})}function xse({currentStep:e,totalSteps:t,canGoNext:n,canGoBack:r,isLoading:s=!1,onNext:i,onBack:c,onFinish:u,nextLabel:f="Next",backLabel:m="Back",finishLabel:g="Save"}){const y=e===t;return t===1?a.jsx("div",{className:"w-full",children:a.jsx(Ce,{className:"w-full",variant:"default",onClick:u,disabled:!n||s,children:g})}):a.jsxs("div",{className:"flex w-full items-center justify-between gap-4",children:[a.jsx("div",{className:"flex-1",children:r&&a.jsxs(Ce,{variant:"outline",onClick:c,disabled:s,children:[a.jsx(q7,{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:y?a.jsx(Ce,{variant:"default",onClick:u,disabled:!n||s,children:g}):a.jsxs(Ce,{variant:"default",onClick:i,disabled:!n||s,children:[f,a.jsx(Ra,{className:"h-4 w-4"})]})})]})}function rc({connector:e,size:t=24,variant:n="compact"}){return a.jsx(Ko,{icon:a.jsx(Ec,{base64:e.logoBase64,size:t}),title:e.displayName,docUrl:e.docUrl,variant:n})}function Pu({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(Ce,{variant:"outline",asChild:!0,children:a.jsxs(na,{to:"https://github.com/OWOX/owox-data-marts/issues",target:"_blank",rel:"noopener noreferrer",children:[e," Open issue here",a.jsx(Wo,{className:"h-4 w-4"})]})})})}const fb="**********";function vse({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(Tt,{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(Ba,{htmlFor:c,className:"cursor-pointer text-sm",children:a.jsx(Pa,{htmlFor:c,required:e.required,tooltip:e.description,children:i})})]})}function bse({specification:e,configuration:t,onValueChange:n}){const{name:r,placeholder:s}=e,i=e.title??e.name;return a.jsx(Tt,{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 Sse({specification:e,configuration:t,onValueChange:n}){const{name:r,placeholder:s,default:i}=e,c=e.title??e.name;return a.jsx(po,{id:r,name:r,value:Array.isArray(t[r])?t[r].join(`
|
|
791
|
-
`):Array.isArray(i)?i.join(`
|
|
792
|
-
`):"",placeholder:s??`Enter ${c.toLowerCase()} (one per line)`,rows:4,onChange:u=>{const f=u.target.value.split(`
|
|
793
|
-
`).filter(m=>m.trim());n(r,f)}})}function Cse({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 g=new Date(m);return isNaN(g.getTime())?"":g.toISOString().split("T")[0]}catch{return""}};return a.jsx(Tt,{id:r,name:r,type:"date",value:t[r]||u(i)||"",placeholder:s??`Enter ${c.toLowerCase()}`,onChange:f=>{n(r,f.target.value)}})}function Ese({specification:e,configuration:t,onValueChange:n}){const{name:r,placeholder:s}=e,i=e.title??e.name;return a.jsx(Tt,{id:r,name:r,type:"text",value:t[r]||"",placeholder:s??`Enter ${i.toLowerCase()}`,onChange:c=>{n(r,c.target.value)}})}function wse({specification:e,configuration:t,onValueChange:n}){const r=e.title??e.name,{name:s,placeholder:i,default:c}=e;return a.jsx(po,{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 Rse({specification:e,configuration:t,onValueChange:n,isEditingExisting:r,isSecretEditing:s}){const i=e.title??e.name,c=r&&!s;return a.jsx(Tt,{id:e.name,...c?{}:{name:e.name},type:c?"password":"text",autoComplete:c?"new-password":"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,value:c?fb: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 jse({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(MC,{options:f,value:t[s]||c||"",onValueChange:m=>{n(s,m)},placeholder:i??`Select ${u.toLowerCase()}`,emptyMessage:"No options available",className:"w-full"})}function Tse(){const e=h.useRef(new Df),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 xf=null;function _se({appId:e,scope:t,onSuccess:n,onError:r,disabled:s=!1,children:i}){const[c,u]=h.useState(!1),[f,m]=h.useState(!1),[g,y]=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(xf&&xf!==e){console.warn("Facebook SDK already initialized with different appId");return}xf??(xf=e),window.fbAsyncInit=function(){window.FB&&xf&&(window.FB.init({appId:xf,cookie:!0,xfbml:!0,version:"v23.0"}),m(!0))};const C=document.createElement("script");C.id="facebook-jssdk",C.src="https://connect.facebook.net/en_US/sdk.js",C.async=!0,C.defer=!0,C.crossOrigin="anonymous",document.body.appendChild(C)},[e]);const x=()=>{if(!window.FB||!f){const C=new Error("Facebook SDK not loaded or not ready");y(C.message),r==null||r(C);return}u(!0),y(null),window.FB.login(C=>{var E;if(C.status==="connected"&&C.authResponse){const{accessToken:R,expiresIn:j,userID:_}=C.authResponse;(E=window.FB)==null||E.api("/me?fields=name,email",A=>{const O={accessToken:R,expiresIn:j,userID:_,userName:A.name,userEmail:A.email};n(O),u(!1)})}else{const R=new Error("User cancelled login or did not fully authorize");y(R.message),r==null||r(R),u(!1)}},{scope:t})},v=s||c||!f,S=()=>c?"Connecting...":i||(f?"Continue with Facebook":"Loading...");return a.jsxs("div",{className:"flex flex-col gap-2",children:[a.jsxs(Ce,{type:"button",onClick:x,disabled:v,className:"flex items-center justify-center gap-2 rounded-md border-none bg-[#1877F2] px-4 py-2.5 text-sm font-semibold text-white hover:bg-[#166FE5] disabled:cursor-not-allowed disabled:opacity-60",children:[a.jsx("svg",{width:20,height:20,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:a.jsx("path",{d:"M9.101 23.691v-7.98H6.627v-3.667h2.474v-1.58c0-4.085 1.848-5.978 5.858-5.978.401 0 .955.042 1.468.103a8.68 8.68 0 0 1 1.141.195v3.325a8.623 8.623 0 0 0-.653-.036 26.805 26.805 0 0 0-.733-.009c-.707 0-1.259.096-1.675.309a1.686 1.686 0 0 0-.679.622c-.258.42-.374.995-.374 1.752v1.297h3.919l-.386 2.103-.287 1.564h-3.246v8.245C19.396 23.238 24 18.179 24 12.044c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.628 3.874 10.35 9.101 11.647Z"})}),S()]}),g&&a.jsx("div",{className:"mt-1 text-xs text-red-600",children:g})]})}function Nse({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(_se,{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 P6({specification:e,option:t,configuration:n,onValueChange:r,connectorName:s,onSecretEditToggle:i,secretEditing:c={},isEditingExisting:u=!1}){const[f,m]=h.useState(!1),[g,y]=h.useState(null),[x,v]=h.useState(null),[S,C]=h.useState(null),E=h.useMemo(()=>{const Z=n[e.name],F=t!=null&&t.value&&Z?Z[t.value]:Z;return F==null?void 0:F._source_credential_id},[n,e.name,t==null?void 0:t.value]),R=h.useMemo(()=>t?`${e.name}.${t.value}`:e.name,[e.name,t]),j=h.useMemo(()=>{const Z=n[e.name];if(t!=null&&t.value&&Z){const F=Z[t.value];return F&&typeof F=="object"&&!Array.isArray(F)?F:{}}return Z&&typeof Z=="object"&&!Array.isArray(Z)?Z:{}},[n,e.name,t==null?void 0:t.value]),_=h.useMemo(()=>{const Z=j;return"_source_credential_id"in Z?!1:!!(t!=null&&t.items&&Object.keys(t.items).some(z=>z in Z&&Z[z]!==void 0&&Z[z]!==""))},[j,t]),[A,O]=h.useState(_);h.useEffect(()=>{const Z="_source_credential_id"in j,F=(t==null?void 0:t.items)&&Object.keys(t.items).some(z=>z in j&&j[z]!==void 0&&j[z]!=="");Z&&A?O(!1):F&&!A&&O(!0)},[j,t,A]);const I=(Z,F)=>{if(!(t!=null&&t.value))return;const z=n[e.name]&&typeof n[e.name]=="object"?n[e.name]:{};r(e.name,{...z,[t.value]:{...typeof z[t.value]=="object"&&z[t.value]!==null?z[t.value]:{},[Z]:F}})},{checkStatus:T,getSettings:D,exchangeCredentials:L}=Tse(),H=async Z=>{try{m(!0),C(null);const F=await L(s,Z,R),z=n[e.name];t?r(e.name,{...z,[t.value]:{_source_credential_id:F.credentialId}}):r(e.name,{_source_credential_id:F.credentialId})}catch(F){const z=F instanceof Error?F.message:"Failed to exchange OAuth credentials";console.error("Failed to exchange OAuth credentials:",F),C(z)}finally{m(!1)}};h.useEffect(()=>{if(!E){y(null),m(!1);return}let Z=!1;return(async()=>{try{m(!0);const z=await T(s,E);Z||y(z)}catch(z){Z||(console.error("Failed to validate credentials:",z),y({valid:!1}))}finally{Z||m(!1)}})(),()=>{Z=!0}},[E,s,T]),h.useEffect(()=>{(async()=>{try{const F=await D(s,R);v(F)}catch(F){console.error("Failed to fetch settings:",F),v(null)}})()},[s,R,D]);const B=!!(x!=null&&x.isEnabled);if((A||!B)&&(t!=null&&t.items))return a.jsxs("div",{className:"space-y-4",children:[Object.entries(t.items).map(([Z,F])=>{const z=Array.isArray(F.attributes)?F.attributes.includes("SECRET")&&j[Z]!==void 0:!1,M=c[e.name]??!1;return a.jsxs("div",{className:"mb-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(Pa,{htmlFor:Z,required:F.required,tooltip:F.description,className:"mb-2 justify-start",children:F.title??Z}),z&&u&&i&&a.jsx(Ce,{variant:"ghost",size:"sm",type:"button",onClick:()=>{i(e.name,!M)},children:M?"Cancel":"Edit"})]}),UC({specification:{...F,name:Z},configuration:j,onValueChange:(V,K)=>{I(V,K)},flags:{isEditingExisting:u,isSecret:z,isSecretEditing:M},connectorName:s})]},Z)}),B&&a.jsx(Ce,{variant:"link",size:"sm",type:"button",onClick:()=>{r(e.name,{[t.value]:{}}),O(!1),m(!1)},className:"px-0",children:"Back to OAuth"})]});const q=(()=>{switch(s){case"FacebookMarketing":return a.jsx(Nse,{isLoading:f,status:g,settings:x,onOAuthSuccess:H});default:return null}})();return a.jsxs("div",{className:"space-y-3",children:[q,S&&a.jsx("div",{className:"text-destructive text-sm",children:S}),(t==null?void 0:t.items)&&Object.keys(t.items).length>0&&a.jsx(Ce,{variant:"link",size:"sm",type:"button",onClick:()=>{r(e.name,{[t.value]:{}}),O(!0)},className:"px-0",children:"Manually"})]})}function UC({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(P6,{specification:e,configuration:t,onValueChange:n,connectorName:s});if(u)return a.jsx(Rse,{specification:e,configuration:t,onValueChange:n,isEditingExisting:f,isSecretEditing:m});if(c&&c.length>0)return a.jsx(jse,{specification:e,configuration:t,onValueChange:n,specOptions:c});switch(i){case bs.BOOLEAN:return a.jsx(vse,{specification:e,configuration:t,onValueChange:n});case bs.NUMBER:return a.jsx(bse,{specification:e,configuration:t,onValueChange:n});case bs.ARRAY:return a.jsx(Sse,{specification:e,configuration:t,onValueChange:n});case bs.OBJECT:return a.jsx(wse,{specification:e,configuration:t,onValueChange:n});case bs.DATE:return a.jsx(Cse,{specification:e,configuration:t,onValueChange:n});case bs.STRING:default:return a.jsx(Ese,{specification:e,configuration:t,onValueChange:n})}}function Ase({specification:e,configuration:t,isEditingExisting:n,isSecretEditing:r,isSecret:s,onValueChange:i,onSecretEditToggle:c,connectorName:u}){return a.jsxs(Hi,{children:[e.requiredType!==bs.BOOLEAN&&a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(Pa,{htmlFor:e.name,required:e.required,tooltip:e.description,children:e.title??e.name}),s&&n&&a.jsx(Ce,{variant:"ghost",size:"sm",type:"button",onClick:()=>{c(e.name,!r)},children:r?"Cancel":"Edit"})]}),UC({specification:e,configuration:t,onValueChange:i,flags:{isSecret:s,isEditingExisting:n,isSecretEditing:r},connectorName:u})]},e.name)}function Dse({specification:e,configuration:t,onValueChange:n,isEditingExisting:r,isSecretEditing:s,onSecretEditToggle:i,connectorName:c}){const u=h.useMemo(()=>{var v,S;const x=t[e.name];if(x&&typeof x=="object"){const C=Object.keys(x);if(C.length>0)return C[0]}return((S=(v=e.oneOf)==null?void 0:v[0])==null?void 0:S.value)??""},[t,e.name,e.oneOf]),[f,m]=h.useState(u);if(h.useEffect(()=>{m(u)},[u]),h.useEffect(()=>{if(f){const x=t[e.name];x&&typeof x=="object"&&f in x||n(e.name,{[f]:{}})}},[f,e.name]),!e.oneOf)return null;const g=x=>{m(x)},y=(x,v,S)=>{const C=t[e.name]&&typeof t[e.name]=="object"?t[e.name]:{};n(e.name,{[x]:{...typeof C[x]=="object"&&C[x]!==null?C[x]:{},[v]:S}})};return a.jsx(ine,{label:e.title??e.name,options:e.oneOf.map(x=>({value:x.value,label:x.label})),value:f,onValueChange:g,children:e.oneOf.map(x=>{const v=x.attributes&&Array.isArray(x.attributes)&&x.attributes.includes("OAUTH_FLOW");return a.jsx(Yte,{value:x.value,children:v?a.jsx(P6,{specification:e,option:x,configuration:t,onValueChange:n,connectorName:c,onSecretEditToggle:i,secretEditing:{[e.name]:s},isEditingExisting:r}):Object.entries(x.items).map(([S,C])=>{const E=t[e.name]&&typeof t[e.name]=="object"?t[e.name]:{},R=Array.isArray(C.attributes)&&Object.keys(E)[0]===x.value?C.attributes.includes("SECRET"):!1,j=typeof t[e.name]=="object"&&t[e.name]!==null?t[e.name]:{},_=typeof j[x.value]=="object"&&j[x.value]!==null?j[x.value]:{};return a.jsxs("div",{className:"mb-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(Pa,{htmlFor:S,required:C.required,tooltip:C.description,className:"mb-2 justify-start",children:S}),R&&r&&a.jsx(Ce,{variant:"ghost",size:"sm",type:"button",onClick:()=>{i(e.name,!s)},children:s?"Cancel":"Edit"})]}),UC({specification:{...C,name:S},configuration:_,onValueChange:(A,O)=>{y(x.value,A,O)},flags:{isEditingExisting:r,isSecret:R,isSecretEditing:s},connectorName:c})]},S)})},x.value)})},e.name)}function M_(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===bs.OBJECT?a.jsx(Dse,{specification:u,configuration:t,onValueChange:n,isEditingExisting:i,isSecretEditing:m,onSecretEditToggle:r,connectorName:c},u.name):a.jsx(Ase,{specification:u,configuration:t,isEditingExisting:i,isSecret:f,isSecretEditing:m,onValueChange:n,onSecretEditToggle:r,connectorName:c},u.name)})}function k_({collapsibleTitle:e,items:t,configuration:n,onValueChange:r,onSecretEditToggle:s,secretEditing:i,isEditingExisting:c,connectorName:u}){return e?a.jsx($5,{title:e,children:M_(t,n,r,s,i,c,u)}):M_(t,n,r,s,i,c,u)}function Ose({currentConnectorName:e,onCopyConfiguration:t,connectorSpecification:n}){const[r,s]=h.useState([]),[i,c]=h.useState(!1),[u,f]=h.useState(!1),m=h.useCallback(async()=>{c(!0);try{const x=await yn.getDataMartsByConnectorName(e);s(x)}catch{s([])}finally{c(!1)}},[e]);h.useEffect(()=>{u&&m()},[u,m]);const g=(x,v)=>{const S=v._id;if(!S){console.error("Configuration does not have _id field");return}t({dataMartId:x.id,dataMartTitle:x.title,configId:S,configuration:v}),f(!1)},y=x=>{const S=[],C=R=>{if(!n)return!0;const j=n.find(_=>_.name===R);return(j==null?void 0:j.required)??!1},E=(R,j,_=0,A=!0)=>{if(R.startsWith("_")||A&&_===0&&!C(R))return;let O=null;if(j==null)O="N/A";else if(typeof j=="string")O=j;else if(typeof j=="number"||typeof j=="boolean")O=String(j);else if(Array.isArray(j))O=JSON.stringify(j);else if(typeof j=="object"){S.push({key:R,value:"{",indent:_}),Object.entries(j).forEach(([I,T])=>{E(I,T,_+1,!1)}),S.push({key:"",value:"}",indent:_});return}else O=JSON.stringify(j);S.push({key:R,value:O,indent:_})};for(const[R,j]of Object.entries(x))E(R,j);return a.jsx("div",{className:"space-y-1 font-mono text-xs",children:S.map(({key:R,value:j,indent:_},A)=>a.jsxs("div",{className:"flex gap-2",style:{paddingLeft:`${String(_*12)}px`},children:[R&&a.jsxs("span",{className:"font-medium",children:[R,":"]}),a.jsx("span",{className:"text-muted-foreground truncate",title:j,children:j})]},A))})};return a.jsx(os,{children:a.jsxs(Lr,{open:u,onOpenChange:f,children:[a.jsx(Pr,{asChild:!0,children:a.jsxs(Ce,{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(Ra,{className:re("text-foreground/75 h-3.5 w-3.5 transition-transform duration-200",u&&"rotate-90")})]})}),a.jsx(Ur,{side:"bottom",align:"end",className:"w-72",children:i?a.jsx(Ot,{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(hU,{className:"text-muted-foreground h-6 w-6",strokeWidth:1.5})}),a.jsx("span",{className:"text-foreground text-sm font-medium",children:"No matching Data Marts"}),a.jsx("span",{className:"text-muted-foreground text-sm",children:"You can reuse configuration settings only from connector-based Data Marts that use the same source."})]}):a.jsxs("div",{className:"flex flex-col gap-2",children:[a.jsx("div",{className:"text-muted-foreground border-b p-2 text-sm",children:"Select one of your existing Data Marts to reuse its configuration settings."}),a.jsx("div",{children:r.map(x=>{const S=x.definition.connector.source.configuration;return S.length===0?null:S.length===1?a.jsxs(Nt,{delayDuration:300,children:[a.jsx(At,{asChild:!0,children:a.jsxs(Ot,{onSelect:()=>{g(x,S[0])},children:[a.jsx(Kp,{className:"text-foreground h-4 w-4"}),x.title]})}),a.jsx(Dt,{side:"right",className:"max-w-sm",children:y(S[0])})]},x.id):a.jsxs(vS,{children:[a.jsxs(bS,{className:"flex items-center gap-2",children:[a.jsx(Kp,{className:"text-foreground h-4 w-4"}),a.jsx("span",{children:x.title})]}),a.jsx(SS,{children:S.map((C,E)=>a.jsxs(Nt,{delayDuration:300,children:[a.jsx(At,{asChild:!0,children:a.jsxs(Ot,{onSelect:()=>{g(x,C)},children:["Configuration ",E+1]})}),a.jsx(Dt,{side:"right",className:"max-w-sm",children:y(C)})]},E))})]},x.id)})})]})})]})})}function L_({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),g=h.useRef(!1),[y,x]=h.useState({});h.useEffect(()=>{if(t){g.current=!0;const I={...s??{}};t.forEach(T=>{const D=Array.isArray(T.attributes)?T.attributes.includes("SECRET"):!1;I[T.name]===void 0&&T.default!==void 0&&(I[T.name]=T.default),c&&D&&(I[T.name]=fb)}),f(I),m.current=!0,setTimeout(()=>{g.current=!1},0)}},[t,s,c]),h.useEffect(()=>{m.current&&s&&Object.keys(s).length>0&&(g.current=!0,f({...s}),setTimeout(()=>{g.current=!1},0))},[s]),h.useEffect(()=>{m.current&&!g.current&&Object.keys(u).length>0&&(n==null||n(u))},[u,n]);const v=(I,T)=>{f(D=>({...D,[I]:T}))},S=h.useCallback(I=>!(I==null||typeof I=="string"&&I.trim()===""||typeof I=="number"&&isNaN(I)||Array.isArray(I)&&I.length===0),[]),C=h.useCallback((I,T)=>{var L,H;if(typeof I!="object"||I===null)return S(I);if((L=T.attributes)!=null&&L.includes("OAUTH_FLOW")&&"_source_credential_id"in I)return!0;const D=(H=T.oneOf)==null?void 0:H.filter(B=>B.value===Object.keys(I)[0]);return D?D.every(B=>{var q;if((q=B.attributes)!=null&&q.includes("OAUTH_FLOW")){const Z=I[B.value];if(typeof Z=="object"&&Z!==null){if("_source_credential_id"in Z)return!0;const F=Object.entries(B.items).filter(([,z])=>z.required);if(F.length>0)return F.every(([z])=>{const M=Z[z];return S(M)})}return!1}return Object.entries(B.items).every(([,Z])=>B.value in I?C(I[B.value],Z):!1)}):S(I[T.name])},[S]),E=h.useCallback((I,T)=>{const D=T.filter(q=>q.required&&q.oneOf),L=D.length===0?!0:D.some(q=>C(I[q.name],q)),B=T.filter(q=>q.required&&q.name!=="Fields").every(q=>S(I[q.name]));return L&&B},[S,C]),R=(I,T)=>{x(D=>({...D,[I]:T})),f(T?D=>({...D,[I]:""}):D=>({...D,[I]:fb}))},j=I=>{const T={...u};Object.entries(I.configuration).forEach(([D,L])=>{["_id","_copiedFrom"].includes(D)||(T[D]=L)}),T._copiedFrom={dataMartId:I.dataMartId,dataMartTitle:I.dataMartTitle,configId:I.configId},f(T)};if(h.useEffect(()=>{if(t&&r){const I=E(u,t);r(I)}},[u,t,r,E]),i)return a.jsx(CC,{variant:"list"});if(!t||t.length===0)return a.jsxs(Zo,{children:[a.jsx(rc,{connector:e}),a.jsx(Ko,{icon:a.jsx(Vf,{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(Pu,{label:"Need configuration?"})]});const _=[...t].filter(I=>{var T;return I.name!=="Fields"&&!((T=I.attributes)!=null&&T.includes("HIDE_IN_CONFIG_FORM"))}).sort((I,T)=>{const D=L=>{const H=L.default!=null&&L.default!=="";return L.required&&!H?1:L.required&&H?2:!L.required&&!H?3:4};return D(I)-D(T)}),A=_.filter(I=>{var T;return!((T=I.attributes)!=null&&T.includes("ADVANCED"))}),O=_.filter(I=>{var T;return(T=I.attributes)==null?void 0:T.includes("ADVANCED")});return a.jsx(a.Fragment,{children:a.jsxs(Zo,{children:[a.jsx(rc,{connector:e}),a.jsxs(tl,{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(Ose,{currentConnectorName:e.name,onCopyConfiguration:j,connectorSpecification:t})]}),A.length>0&&a.jsx(k_,{items:A,configuration:u,onValueChange:v,onSecretEditToggle:R,secretEditing:y,isEditingExisting:c,connectorName:e.name}),O.length>0&&a.jsx(k_,{collapsibleTitle:"Advanced Settings",items:O,configuration:u,onValueChange:v,onSecretEditToggle:R,secretEditing:y,isEditingExisting:c,connectorName:e.name})]})]})})}function Ise({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(CC,{variant:"list"}):!t||t.length===0?a.jsxs(Zo,{children:[a.jsx(rc,{connector:e}),a.jsx(Ko,{icon:a.jsx(Vf,{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(Pu,{label:"Missing some data?"})]}):a.jsxs(Zo,{children:[a.jsx(rc,{connector:e}),a.jsxs(tl,{title:c,children:[t.map(u=>a.jsx(G5,{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(na,{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(Ra,{className:"h-3 w-3"})]})]}),selected:n===u.name},u.name)),a.jsx(Pu,{label:"Missing some data?"})]})]})}var Zs=(e=>(e.ASC="asc",e.DESC="desc",e.ORIGINAL="original",e))(Zs||{});function P_({connector:e,connectorFields:t,selectedField:n,selectedFields:r,onFieldToggle:s}){const i=h.useRef(null),[c,u]=h.useState(""),[f,m]=h.useState(Zs.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]),x=h.useMemo(()=>(g==null?void 0:g.uniqueKeys)??[],[g==null?void 0:g.uniqueKeys]),v=h.useMemo(()=>{const R=new Map;return y.forEach((j,_)=>R.set(j.name,_)),R},[y]),S=h.useMemo(()=>{const R=y.filter(_=>_.name.toLowerCase().includes(c.toLowerCase().trim())),j=(_,A)=>{const O=x.includes(_.name),I=x.includes(A.name);if(O&&!I)return-1;if(!O&&I)return 1;if(f===Zs.ASC)return _.name.localeCompare(A.name);if(f===Zs.DESC)return A.name.localeCompare(_.name);const T=v.get(_.name)??0,D=v.get(A.name)??0;return T-D};return[...R].sort(j)},[y,c,x,f,v]),C=y.map(R=>R.name),E=r.filter(R=>C.includes(R)).length;return h.useEffect(()=>{if(x.length>0){const R=x.filter(j=>y.some(_=>_.name===j)&&!r.includes(j));R.length>0&&R.forEach(j=>{s(j,!0)})}},[n,x,y,r,s]),h.useEffect(()=>{const R=j=>{const A=(j.ctrlKey||j.metaKey)&&j.shiftKey&&j.key.toLowerCase()==="a",O=document.activeElement.tagName;if(!(O==="INPUT"||O==="TEXTAREA")&&A){j.preventDefault();const I=y.map(L=>L.name),D=I.filter(L=>!r.includes(L)).length>0;I.forEach(L=>{s(L,D)})}};return window.addEventListener("keydown",R),()=>{window.removeEventListener("keydown",R)}},[y,r,s]),!n||!t?a.jsxs(Zo,{children:[a.jsx(rc,{connector:e}),a.jsx(Ko,{icon:a.jsx(Vf,{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(Pu,{label:"Need fields?"})]}):y.length?a.jsx(Zo,{children:a.jsxs(a.Fragment,{children:[a.jsx(rc,{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(vc,{className:"text-muted-foreground absolute top-1/2 left-3 h-4 w-4 -translate-y-1/2 cursor-text",onClick:()=>{var R;(R=i.current)==null||R.focus()}}),a.jsx("input",{ref:i,type:"text",placeholder:"Search field",value:c,onChange:R=>{u(R.target.value)},className:"h-12 w-full rounded-none border-0 pl-9 text-sm outline-none"}),c&&a.jsx("button",{type:"button",onClick:()=>{u("")},className:"text-muted-foreground hover:text-foreground absolute top-1/2 right-0 -translate-y-1/2",children:a.jsx(Vu,{className:"h-4 w-4"})})]}),a.jsxs(Lr,{children:[a.jsx(Pr,{asChild:!0,children:a.jsxs(Ce,{variant:"ghost",size:"icon","aria-label":"Sort fields",children:[f===Zs.ASC&&a.jsx(Pj,{className:"text-muted-foreground h-4 w-4"}),f===Zs.DESC&&a.jsx(Lj,{className:"text-muted-foreground h-4 w-4"}),f===Zs.ORIGINAL&&a.jsx(Uj,{className:"text-muted-foreground h-4 w-4"})]})}),a.jsxs(Ur,{align:"end",children:[a.jsxs(Ot,{onSelect:()=>{m(Zs.ASC)},children:[a.jsx(Pj,{className:"text-muted-foreground mr-2 h-4 w-4"}),"A–Z"]}),a.jsxs(Ot,{onSelect:()=>{m(Zs.DESC)},children:[a.jsx(Lj,{className:"text-muted-foreground mr-2 h-4 w-4"}),"Z–A"]}),a.jsxs(Ot,{onSelect:()=>{m(Zs.ORIGINAL)},children:[a.jsx(Uj,{className:"text-muted-foreground mr-2 h-4 w-4"}),"Original"]})]})]})]}),a.jsxs(tl,{title:`Selected ${String(E)} of ${String(C.length)} fields for "${n}" data`,children:[S.map(R=>{const j=x.includes(R.name);return a.jsx(G5,{type:"checkbox",id:`field-${R.name}`,name:"selectedFields",value:R.name,checked:r.includes(R.name),selected:r.includes(R.name)||j,disabled:j,onChange:_=>{s(R.name,_)},label:R.name,tooltip:a.jsxs("div",{className:"flex flex-col gap-2 py-1",children:[j&&a.jsxs("p",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"font-semibold",children:"Unique key"})," ",a.jsx(b1,{className:"text-secondary h-3 w-3"})]}),a.jsxs("p",{children:[a.jsx("span",{className:"font-semibold",children:"Type:"})," ",R.type]}),R.description&&a.jsxs("p",{children:[a.jsx("span",{className:"font-semibold",children:"Description:"})," ",R.description]})]}),rightIcon:j?a.jsx(b1,{className:"text-muted-foreground/75 h-4 w-4"}):void 0},R.name)}),S.length===0&&c&&a.jsxs("div",{className:"text-muted-foreground pt-8 pb-4 text-center text-sm",children:['No fields match "',c,'"']}),a.jsx(Pu,{label:"Need another field?"})]})]})}):a.jsxs(Zo,{children:[a.jsx(rc,{connector:e}),a.jsx(Ko,{icon:a.jsx(Vf,{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(Pu,{label:"Need fields?"})]})}const U6=h.createContext(void 0),F6={triggers:[],selectedTrigger:null,isLoading:!1,error:null};function Mse(e,t){switch(t.type){case"FETCH_TRIGGERS_START":case"FETCH_TRIGGER_START":case"CREATE_TRIGGER_START":case"UPDATE_TRIGGER_START":case"DELETE_TRIGGER_START":return{...e,isLoading:!0,error:null};case"FETCH_TRIGGERS_SUCCESS":return{...e,triggers:t.payload,isLoading:!1};case"FETCH_TRIGGER_SUCCESS":return{...e,selectedTrigger:t.payload,isLoading:!1};case"CREATE_TRIGGER_SUCCESS":return{...e,triggers:[...e.triggers,t.payload],isLoading:!1};case"UPDATE_TRIGGER_SUCCESS":return{...e,triggers:e.triggers.map(n=>n.id===t.payload.id?t.payload:n),selectedTrigger:e.selectedTrigger&&e.selectedTrigger.id===t.payload.id?t.payload:e.selectedTrigger,isLoading:!1};case"DELETE_TRIGGER_SUCCESS":return{...e,triggers:e.triggers.filter(n=>n.id!==t.payload),selectedTrigger:e.selectedTrigger&&e.selectedTrigger.id===t.payload?null:e.selectedTrigger,isLoading:!1};case"FETCH_TRIGGERS_ERROR":case"FETCH_TRIGGER_ERROR":case"CREATE_TRIGGER_ERROR":case"UPDATE_TRIGGER_ERROR":case"DELETE_TRIGGER_ERROR":return{...e,isLoading:!1,error:t.payload};case"SELECT_TRIGGER":return{...e,selectedTrigger:t.payload};case"RESET":return F6;default:return e}}class kse extends gl{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 gu=new kse;var kn=(e=>(e.REPORT_RUN="REPORT_RUN",e.CONNECTOR_RUN="CONNECTOR_RUN",e))(kn||{});const _u={SCHEDULED_REPORT_RUN:"scheduled-report-run-config"};class hb{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!==kn.REPORT_RUN)return t;const n=t.triggerConfig;if(!n.reportId)return t;try{const r=await Ho.getReportById(n.reportId),s=Wl(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:kn.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 Lse{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:kn.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 X0={getMapper(e){switch(e){case kn.REPORT_RUN:return new hb;case kn.CONNECTOR_RUN:return new Lse;default:throw new Error(`Unknown scheduled trigger type: ${String(e)}`)}}},vf={mapFromDto(e){return X0.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 kn.REPORT_RUN:return new hb().enhanceWithReportData(n);case kn.CONNECTOR_RUN:{const r=t.definition;return{...n,triggerConfig:{...n.triggerConfig,connector:r}}}default:return n}},async mapFromDtoListWithReportData(e,t){const n=new hb,r=this.mapFromDtoList(e),s=r.filter(c=>c.type===kn.REPORT_RUN),i=await n.enhanceTriggersWithReportData(s);return r.map(c=>{switch(c.type){case kn.REPORT_RUN:return i.find(u=>u.id===c.id)??c;case kn.CONNECTOR_RUN:{const u=t.definition;return{...c,triggerConfig:{...c.triggerConfig,connector:u}}}default:return c}})},mapToCreateRequest(e){return X0.getMapper(e.type).mapToCreateRequest(e)},mapToUpdateRequest(e){return X0.getMapper(e.type).mapToUpdateRequest(e)}};function Pse({children:e}){const[t,n]=h.useReducer(Mse,F6),{dataMart:r}=Ps(),{fetchAvailableConnectors:s}=jc();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 S=await gu.getScheduledTriggers(v),C=await vf.mapFromDtoListWithReportData(S,r);n({type:"FETCH_TRIGGERS_SUCCESS",payload:C})}catch(S){const C=S instanceof Error?S.message:"Failed to fetch scheduled triggers";n({type:"FETCH_TRIGGERS_ERROR",payload:C}),Ie({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"ListError",label:C})}},[r,s]),c=h.useCallback(async(v,S)=>{n({type:"FETCH_TRIGGERS_START"});try{const E=(await gu.getScheduledTriggers(v)).filter(j=>j.type===S),R=await vf.mapFromDtoListWithReportData(E,r);n({type:"FETCH_TRIGGERS_SUCCESS",payload:R})}catch(C){const E=C instanceof Error?C.message:"Failed to fetch scheduled triggers";n({type:"FETCH_TRIGGERS_ERROR",payload:E}),Ie({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"ListError",label:E})}},[r]),u=h.useCallback(async(v,S)=>{n({type:"FETCH_TRIGGER_START"});try{const C=await gu.getScheduledTrigger(v,S),E=await vf.mapFromDtoWithReportData(C,r);n({type:"FETCH_TRIGGER_SUCCESS",payload:E})}catch(C){const E=C instanceof Error?C.message:"Failed to fetch scheduled trigger";n({type:"FETCH_TRIGGER_ERROR",payload:E}),Ie({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"GetError",label:E})}},[r]),f=h.useCallback(async(v,S,C,E,R,j)=>{n({type:"CREATE_TRIGGER_START"});try{const _={type:S,cronExpression:C,timeZone:E,isActive:R,triggerConfig:j},A=await gu.createScheduledTrigger(v,_),O=await vf.mapFromDtoWithReportData(A,r);return n({type:"CREATE_TRIGGER_SUCCESS",payload:O}),Ie({event:"scheduled_trigger_created",category:"ScheduledTrigger",action:"Create",label:S}),Sn.success("Trigger created"),O}catch(_){const A=_ instanceof Error?_.message:"Failed to create scheduled trigger";throw n({type:"CREATE_TRIGGER_ERROR",payload:A}),Ie({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"CreateError",label:A}),_}},[r]),m=h.useCallback(async(v,S,C,E,R)=>{n({type:"UPDATE_TRIGGER_START"});try{const j={cronExpression:C,timeZone:E,isActive:R},_=await gu.updateScheduledTrigger(v,S,j),A=await vf.mapFromDtoWithReportData(_,r);n({type:"UPDATE_TRIGGER_SUCCESS",payload:A}),Ie({event:"scheduled_trigger_updated",category:"ScheduledTrigger",action:"Update",label:A.type}),Sn.success("Trigger updated")}catch(j){const _=j instanceof Error?j.message:"Failed to update scheduled trigger";throw n({type:"UPDATE_TRIGGER_ERROR",payload:_}),Ie({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"UpdateError",label:_}),j}},[r]),g=h.useCallback(async(v,S)=>{n({type:"DELETE_TRIGGER_START"});try{await gu.deleteScheduledTrigger(v,S),n({type:"DELETE_TRIGGER_SUCCESS",payload:S}),Ie({event:"scheduled_trigger_deleted",category:"ScheduledTrigger",action:"Delete",label:S}),Sn.success("Trigger deleted")}catch(C){const E=C instanceof Error?C.message:"Failed to delete scheduled trigger";throw n({type:"DELETE_TRIGGER_ERROR",payload:E}),Ie({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"DeleteError",label:E}),C}},[]),y=h.useCallback(v=>{n({type:"SELECT_TRIGGER",payload:v})},[]),x=h.useCallback(()=>{n({type:"RESET"})},[]);return a.jsx(U6.Provider,{value:{...t,getScheduledTriggers:i,getScheduledTriggersByType:c,getScheduledTrigger:u,createScheduledTrigger:f,updateScheduledTrigger:m,deleteScheduledTrigger:g,selectScheduledTrigger:y,reset:x},children:e})}function z6(){const e=h.useContext(U6);if(e===void 0)throw new Error("useScheduledTriggerContext must be used within a ScheduledTriggerProvider");return e}function Use(e){const{getScheduledTriggers:t,getScheduledTriggersByType:n,getScheduledTrigger:r,createScheduledTrigger:s,updateScheduledTrigger:i,deleteScheduledTrigger:c,selectScheduledTrigger:u,reset:f,triggers:m,selectedTrigger:g,isLoading:y,error:x}=z6();return h.useEffect(()=>(e?t(e):f(),()=>{f()}),[e,t,f]),{triggers:m,selectedTrigger:g,isLoading:y,error:x,getScheduledTriggers:v=>t(v),getScheduledTriggersByType:(v,S)=>n(v,S),getScheduledTrigger:(v,S)=>r(v,S),createScheduledTrigger:(v,S,C,E,R,j)=>s(v,S,C,E,R,j),updateScheduledTrigger:(v,S,C,E,R)=>i(v,S,C,E,R),deleteScheduledTrigger:(v,S)=>c(v,S),selectScheduledTrigger:u}}const Fse=Wt({type:Fr(_u.SCHEDULED_REPORT_RUN),reportId:Rt().min(1,"Report ID is required")}),zse=pZ(),Hse=Wt({type:my(kn),cronExpression:Rt().min(1,"Cron expression is required"),timeZone:Rt().min(1,"Time zone is required"),isActive:mZ(),triggerConfig:yZ([Fse,zse])});function Vse({initialData:e,preSelectedReportId:t,preSelectedType:n,onSubmit:r}){const s=go({resolver:ui(Hse),defaultValues:{type:e?e.type:n??kn.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:_u.SCHEDULED_REPORT_RUN,reportId:t??""}}});h.useEffect(()=>{t&&s.getValues("type")===kn.REPORT_RUN&&s.setValue("triggerConfig",{type:_u.SCHEDULED_REPORT_RUN,reportId:t})},[t,s]),h.useEffect(()=>{n&&(s.setValue("type",n),n===kn.REPORT_RUN?s.setValue("triggerConfig",{type:_u.SCHEDULED_REPORT_RUN,reportId:t??""}):s.setValue("triggerConfig",null))},[n,t,s]);const i=u=>{s.setValue("type",u),u===kn.REPORT_RUN?s.setValue("triggerConfig",{type:_u.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 $se=[De.GOOGLE_SHEETS,De.EMAIL,De.SLACK,De.MS_TEAMS,De.GOOGLE_CHAT];function Gse({value:e,onChange:t,disabled:n}){const{reports:r,fetchReportsByDataMartId:s}=Ls(),{dataMart:i}=Ps();h.useEffect(()=>{i&&s(i.id)},[s,i]);const c=r.filter(u=>$se.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=ea.getInfo(u.dataDestination.type).icon;return a.jsx(Ln,{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 zy="Switch",[Bse]=xr(zy),[qse,Kse]=Bse(zy),H6=h.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:i,required:c,disabled:u,value:f="on",onCheckedChange:m,form:g,...y}=e,[x,v]=h.useState(null),S=ht(t,_=>v(_)),C=h.useRef(!1),E=x?g||!!x.closest("form"):!0,[R,j]=aa({prop:s,defaultProp:i??!1,onChange:m,caller:zy});return a.jsxs(qse,{scope:n,checked:R,disabled:u,children:[a.jsx(Xe.button,{type:"button",role:"switch","aria-checked":R,"aria-required":c,"data-state":B6(R),"data-disabled":u?"":void 0,disabled:u,value:f,...y,ref:S,onClick:Oe(e.onClick,_=>{j(A=>!A),E&&(C.current=_.isPropagationStopped(),C.current||_.stopPropagation())})}),E&&a.jsx(G6,{control:x,bubbles:!C.current,name:r,value:f,checked:R,required:c,disabled:u,form:g,style:{transform:"translateX(-100%)"}})]})});H6.displayName=zy;var V6="SwitchThumb",$6=h.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,s=Kse(V6,n);return a.jsx(Xe.span,{"data-state":B6(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t})});$6.displayName=V6;var Zse="SwitchBubbleInput",G6=h.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...s},i)=>{const c=h.useRef(null),u=ht(c,i),f=dC(n),m=oS(t);return h.useEffect(()=>{const g=c.current;if(!g)return;const y=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(y,"checked").set;if(f!==n&&v){const S=new Event("click",{bubbles:r});v.call(g,n),g.dispatchEvent(S)}},[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}})});G6.displayName=Zse;function B6(e){return e?"checked":"unchecked"}var Yse=H6,Wse=$6;function q6({className:e,...t}){return a.jsx(Yse,{"data-slot":"switch",className:re("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(Wse,{"data-slot":"switch-thumb",className:re("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 Qse(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 mb(e,t="UTC"){const n=Qse(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 y=Number.parseInt(r.substring(2));if(!isNaN(y))return{type:"interval",time:"09:00",weekdays:[1,2,3,4,5],monthDays:[1],customCron:e,intervalType:"minutes",intervalValue:y,timezone:t}}if(r!=="*"&&s.startsWith("*/")&&i==="*"&&c==="*"&&u==="*"){const y=Number.parseInt(s.substring(2));if(!isNaN(y)&&r==="0")return{type:"interval",time:"09:00",weekdays:[1,2,3,4,5],monthDays:[1],customCron:e,intervalType:"hours",intervalValue:y,timezone:t}}const f=Number.parseInt(r),m=Number.parseInt(s),g=!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:g,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 y=u.split(",").map(x=>Number.parseInt(x.trim())).filter(x=>!isNaN(x)&&x>=0&&x<=6);if(y.length>0)return{type:"weekly",time:g,weekdays:y,monthDays:[1],customCron:e,intervalType:"minutes",intervalValue:15,timezone:t}}if(!isNaN(f)&&!isNaN(m)&&i!=="*"&&c==="*"&&u==="*"){const y=i.split(",").map(x=>Number.parseInt(x.trim())).filter(x=>!isNaN(x)&&x>=1&&x<=31);if(y.length>0)return{type:"monthly",time:g,weekdays:[1,2,3,4,5],monthDays:y,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 K6({options:e,selected:t,onSelectionChange:n,placeholder:r="Select items...",searchPlaceholder:s="Search...",maxDisplayItems:i=3}){const[c,u]=h.useState(!1),f=y=>{const x=t.includes(y)?t.filter(v=>v!==y):[...t,y].sort((v,S)=>v-S);n(x)},m=(y,x)=>{x.preventDefault(),x.stopPropagation(),n(t.filter(v=>v!==y))},g=()=>{if(t.length===0)return a.jsx("span",{className:"text-muted-foreground text-sm",children:r});const y=t.map(x=>e.find(v=>v.value===x)).filter(Boolean);return y.length<=i?a.jsx("div",{className:"flex flex-wrap gap-1",children:y.map(x=>a.jsxs(Sr,{variant:"secondary",className:"h-5 text-xs",children:[x.label,a.jsx("span",{className:"hover:bg-secondary-foreground/20 ml-1 inline-flex cursor-pointer items-center justify-center rounded-full p-0.5",onClick:v=>m(x.value,v),children:a.jsx(Vu,{className:"h-2 w-2"})})]},x.value))}):a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsxs(Sr,{variant:"secondary",className:"h-5 text-xs",children:[y[0].label,a.jsx("span",{className:"hover:bg-secondary-foreground/20 ml-1 inline-flex cursor-pointer items-center justify-center rounded-full p-0.5",onClick:x=>m(y[0].value,x),children:a.jsx(Vu,{className:"h-2 w-2"})})]}),y.length>1&&a.jsxs(Sr,{variant:"outline",className:"h-5 text-xs",children:["+",y.length-1]})]})};return a.jsxs(DC,{open:c,onOpenChange:u,modal:!0,children:[a.jsx(OC,{asChild:!0,children:a.jsxs(Ce,{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:g()}),a.jsx(Gb,{className:"ml-2 h-3 w-3 shrink-0 opacity-50"})]})}),a.jsx(IC,{className:"max-h-[400px] w-full overflow-y-auto p-0",style:{padding:0},children:a.jsxs(b6,{className:"h-full overflow-visible",children:[a.jsx(S6,{placeholder:s,className:"h-8"}),a.jsxs(gae,{className:"h-full max-h-[350px] overflow-y-auto",children:[a.jsx(C6,{children:"No items found."}),a.jsx(E6,{className:"h-full overflow-visible",children:e.map(y=>a.jsxs(w6,{value:y.value.toString(),onSelect:()=>f(y.value),className:"text-sm",children:[a.jsx(ra,{className:re("mr-2 h-3 w-3",t.includes(y.value)?"opacity-100":"opacity-0")}),y.label]},y.value))})]})]})})]})}const Z6=[{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"}],Ep=()=>{try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return"UTC"}};function Y6(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=Z6.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 Xse(e,t,n=!0){const r=mb(e,t);return Y6(r,n)}const Jse=Array.from({length:31},(e,t)=>({value:t+1,label:`${String(t+1)}${t===0?"st":t===1?"nd":t===2?"rd":"th"}`})),pb=[5,10,15,30],gb=[1,2,3,4,6,8,12],eoe=({value:e,onChange:t,disabled:n})=>a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ba,{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(Ln,{value:"daily",children:"Daily"}),a.jsx(Ln,{value:"weekly",children:"Weekly"}),a.jsx(Ln,{value:"monthly",children:"Monthly"}),a.jsx(Ln,{value:"interval",children:"Interval"})]})]})]}),toe=({value:e,onChange:t,disabled:n})=>a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ba,{children:"Time"}),a.jsx("div",{className:"flex items-center gap-2",children:a.jsx(Tt,{className:"w-24",type:"time",value:e,onChange:r=>{t(r.target.value)},disabled:n})})]}),U_=({value:e,onChange:t,disabled:n,timezones:r})=>a.jsxs("div",{className:"w-full space-y-2",children:[a.jsx(Ba,{children:"Timezone"}),a.jsx("div",{className:"flex items-center gap-2",children:a.jsx(MC,{options:r,value:e,onValueChange:t,placeholder:"Select timezone",emptyMessage:"No timezones found",disabled:n,className:"w-full"})})]}),noe=({value:e,onChange:t,disabled:n})=>a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ba,{children:"Days of Week"}),a.jsx("div",{className:n?"pointer-events-none":"",children:a.jsx(K6,{options:Z6,selected:e,onSelectionChange:t,placeholder:"Select days...",maxDisplayItems:3})})]}),roe=({value:e,onChange:t,disabled:n})=>a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ba,{children:"Days of Month"}),a.jsx("div",{className:n?"pointer-events-none":"",children:a.jsx(K6,{options:Jse,selected:e,onSelectionChange:t,placeholder:"Select days...",maxDisplayItems:4})})]}),aoe=({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(Ba,{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(Ln,{value:"minutes",children:"Minutes"}),a.jsx(Ln,{value:"hours",children:"Hours"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ba,{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"?pb:gb).map(i=>a.jsxs(Ln,{value:i.toString(),children:[i," ",e==="minutes"?"min":"hr"]},i))})]})]})]}),soe=({value:e,onChange:t,disabled:n})=>a.jsxs("div",{className:"space-y-1",children:[a.jsx(Ba,{className:"text-sm",children:"Cron Expression"}),a.jsx(Tt,{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 ooe({cron:e="0 9 * * *",timezone:t,enabled:n=!0,onChange:r,className:s,showPreview:i=!0,showSaveButton:c=!1}){const[u,f]=h.useState(n),[m,g]=h.useState(t??Ep()),[y,x]=h.useState(!1),v=h.useMemo(()=>FY.getTimezonesWithOffset().map(F=>({value:F.identifier,label:F.displayName,offset:F.offsetString,isDST:F.isDST})),[]),[S,C]=h.useState(()=>mb(e,m)),[E,R]=h.useState(""),[j,_]=h.useState("");h.useEffect(()=>{f(n)},[n]),h.useEffect(()=>{const F=t??Ep();g(F)},[t]),h.useEffect(()=>{if(e){const F=mb(e,m);C(F)}},[e,m]);const A=F=>{const[z,M]=F.time.split(":").map(Number);switch(F.type){case"daily":return`${String(M)} ${String(z)} * * *`;case"weekly":return`${String(M)} ${String(z)} * * ${F.weekdays.join(",")}`;case"monthly":return`${String(M)} ${String(z)} ${F.monthDays.join(",")} * *`;case"interval":return F.intervalType==="minutes"?`*/${String(F.intervalValue)} * * * *`:`0 */${String(F.intervalValue)} * * *`;case"custom":return F.customCron;default:return`${String(M)} ${String(z)} * * *`}},O=h.useCallback(F=>{C(z=>{if(z.intervalType===F)return console.log("Type unchanged, skipping update"),z;const V=(F==="minutes"?pb:gb)[0];return{...z,intervalType:F,intervalValue:V}})},[]),I=h.useCallback(F=>{C(z=>(z.intervalType==="minutes"?pb:gb).includes(F)?{...z,intervalValue:F}:z)},[]),T=h.useMemo(()=>F=>Y6(F,u),[u]);h.useEffect(()=>{const F=A(S);R(F),_(T(S))},[S,u,m,T]);const D=h.useRef(""),L=h.useRef(""),H=h.useRef(!1);h.useEffect(()=>{const F=A(S);r&&(D.current!==F||L.current!==m||H.current!==u)&&(r({cron:F,timezone:m,enabled:u}),D.current=F,L.current=m,H.current=u)},[S,m,u,r]);const B=F=>{f(F)},q=F=>{g(F),C(z=>({...z,timezone:F}))},Z=["daily","weekly","monthly"].includes(S.type);return a.jsxs("div",{className:s,children:[a.jsx("div",{className:"mb-4 space-y-4 pt-0",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h3",{className:"text-foreground flex items-center gap-1.5 font-medium",children:"Schedule Settings"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Ba,{htmlFor:"schedule-enabled",className:"text-sm font-normal",children:u?"Enabled":"Disabled"}),a.jsx(q6,{id:"schedule-enabled",checked:u,onCheckedChange:B})]})]})}),a.jsxs("div",{className:"space-y-4 pt-0",children:[a.jsxs("div",{className:`space-y-4 ${u?"":"opacity-50"}`,children:[a.jsx(eoe,{value:S.type,onChange:F=>{C(z=>({...z,type:F}))},disabled:!u}),S.type!=="custom"&&S.type!=="interval"&&a.jsxs("div",{className:"flex gap-3",children:[a.jsx(toe,{value:S.time,onChange:F=>{C(z=>({...z,time:F}))},disabled:!u}),Z&&a.jsx(U_,{value:m,onChange:q,disabled:!u,timezones:v})]}),(S.type==="interval"||S.type==="custom")&&a.jsx(U_,{value:m,onChange:q,disabled:!u,timezones:v}),S.type==="weekly"&&a.jsx(noe,{value:S.weekdays,onChange:F=>{C(z=>({...z,weekdays:F}))},disabled:!u}),S.type==="monthly"&&a.jsx(roe,{value:S.monthDays,onChange:F=>{C(z=>({...z,monthDays:F}))},disabled:!u}),S.type==="interval"&&a.jsx(aoe,{intervalType:S.intervalType,intervalValue:S.intervalValue,onTypeChange:O,onValueChange:I,disabled:!u}),S.type==="custom"&&a.jsx(soe,{value:S.customCron,onChange:F=>{C(z=>({...z,customCron:F}))},disabled:!u})]}),i&&a.jsxs(a.Fragment,{children:[a.jsx(EA,{className:"my-3"}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex cursor-pointer items-center justify-between",onClick:()=>{x(!y)},children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(oA,{className:"h-4 w-4"}),a.jsx("span",{className:"text-sm font-medium",children:"Preview"})]}),y?a.jsx(Hu,{className:"text-muted-foreground h-4 w-4"}):a.jsx(fo,{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(Sr,{variant:u?"default":"secondary",className:"text-xs",children:u?"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(Sr,{variant:"secondary",className:"font-mono text-xs",children:E})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-muted-foreground text-xs",children:"Timezone:"}),a.jsx(Sr,{variant:"outline",className:"text-xs",children:m})]}),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:j})]})]}),u&&Z&&m!==Ep()&&a.jsxs(LC,{className:"border-amber-200 bg-amber-50",children:[a.jsx(lh,{className:"h-4 w-4"}),a.jsx(L6,{children:"Time Zone"}),a.jsxs(PC,{children:["Schedule runs in ",m," (not your local ",Ep()," ","time). Execution time may differ from expected."]})]})]})]})]}),c&&a.jsx(Ce,{className:"w-full",disabled:!u,children:"Save Schedule"})]})]})}function ioe(){return a.jsx(dn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Gt,{value:"trigger-type-options-description-details",children:[a.jsx(Bt,{children:"How do I choose a type?"}),a.jsxs(qt,{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 loe(){return a.jsx(dn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Gt,{value:"trigger-type-change-description-details",children:[a.jsx(Bt,{children:"How do I change the trigger type?"}),a.jsx(qt,{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 coe(){return a.jsx(dn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Gt,{value:"report-change-description-details",children:[a.jsx(Bt,{children:"How do I change a report?"}),a.jsx(qt,{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 uoe(){return a.jsx(dn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Gt,{value:"report-select-description-details",children:[a.jsx(Bt,{children:"How do I choose the report?"}),a.jsxs(qt,{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 doe({initialData:e,preSelectedReportId:t,preSelectedType:n,onSubmit:r,onCancel:s,onDirtyChange:i}){const[c,u]=h.useState(!1),{form:f,handleTypeChange:m,handleSubmit:g,isDirty:y}=Vse({initialData:e,preSelectedReportId:t,preSelectedType:n,onSubmit:async E=>{u(!0);try{await r(E)}finally{u(!1)}}});h.useEffect(()=>{i==null||i(y)},[y,i]);const{control:x,watch:v}=f,C=v("type")===kn.REPORT_RUN;return a.jsx(wl,{...f,children:a.jsxs(ci,{onSubmit:E=>void g(E),noValidate:!1,children:[a.jsxs(Rl,{children:[a.jsx(Et,{control:x,name:"type",render:({field:E})=>a.jsxs(yt,{children:[a.jsx(gt,{tooltip:"Choose what you want this trigger to run - a report or a connector",children:"Trigger Type"}),a.jsxs(oa,{onValueChange:R=>{E.onChange(R),m(R)},defaultValue:E.value,disabled:!!n||!!e||!!v("triggerConfig.reportId"),children:[a.jsx(St,{children:a.jsx(la,{className:"w-full",children:a.jsx(ia,{placeholder:"Select trigger type"})})}),a.jsxs(ca,{children:[a.jsx(Ln,{value:kn.REPORT_RUN,children:"Report Run"}),a.jsx(Ln,{value:kn.CONNECTOR_RUN,children:"Connector Run"})]})]}),a.jsx(an,{children:e?a.jsx(loe,{}):a.jsx(ioe,{})}),a.jsx(_t,{})]})}),C&&a.jsx(Et,{control:x,name:"triggerConfig.reportId",render:({field:E})=>a.jsxs(yt,{children:[a.jsx(gt,{tooltip:"Select the report that will be run by this trigger",children:"Report"}),a.jsx(St,{children:a.jsx(UD,{children:a.jsx(Gse,{value:E.value??"",onChange:E.onChange,disabled:!!t||!!e})})}),a.jsx(an,{children:e!=null&&e.triggerConfig?a.jsx(coe,{}):a.jsx(uoe,{})}),a.jsx(_t,{})]})}),a.jsx(ooe,{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(jl,{children:[a.jsx(Ce,{variant:"default",type:"submit",className:"w-full","aria-label":e?"Save changes":"Create trigger",disabled:!y||c,children:c?e?"Saving...":"Creating...":e?"Save changes":"Create trigger"}),s&&a.jsx(Ce,{variant:"outline",type:"button",onClick:s,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})}function foe({cronExpression:e,timeZone:t,isEnabled:n=!0}){const r=h.useMemo(()=>Xse(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 hoe({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(Lr,{open:r,onOpenChange:s,children:[a.jsx(Pr,{asChild:!0,children:a.jsx(Ce,{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(Is,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsxs(Ur,{align:"end",children:[a.jsxs(Ot,{onClick:()=>{t(e.id)},children:[a.jsx(td,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),"Edit trigger"]}),a.jsx(wa,{}),a.jsxs(Ot,{onClick:()=>{c(!0)},children:[a.jsx(us,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),a.jsx("span",{className:"text-red-600",children:"Delete trigger"})]})]})]}),a.jsx(yr,{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 moe({connector:e}){const{connectors:t}=jc(),n=GJ(e,t);return a.jsx(a.Fragment,{children:n})}function W6({connector:e}){return a.jsx(moe,{connector:e})}function poe(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 goe=e=>{const{connectors:t}=jc();return h.useMemo(()=>t.find(n=>n.name===e),[t,e])},yoe=be.memo(function({connector:t,children:n}){const r=goe(t.source.name),{dataMart:s,runs:i,getDataMartRuns:c}=Ps();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(Ec,{base64:r.logoBase64,size:20}):null,[r==null?void 0:r.logoBase64]),f=h.useCallback(()=>{s!=null&&s.storage&&yW(s.storage,t.storage.fullyQualifiedName)},[s==null?void 0:s.storage,t.storage.fullyQualifiedName]),m=h.useMemo(()=>poe(i),[i]),g=h.useMemo(()=>!m.lastRunDate||!m.lastRunStatus?null:{statusType:MQ(m.lastRunStatus),statusText:LQ(m.lastRunStatus),date:m.lastRunDate},[m]),y=h.useMemo(()=>(s==null?void 0:s.storage)&&xW(s.storage),[s]),x=h.useMemo(()=>{const v=t.source.fields.length.toString();return`${t.source.node} • ${v} fields`},[t.source.node,t.source.fields.length]);return a.jsxs(Sy,{children:[a.jsx(Cy,{asChild:!0,children:a.jsx("span",{children:n})}),a.jsxs(Ey,{children:[a.jsxs(FS,{children:[a.jsx(zS,{children:u}),a.jsxs(HS,{children:[a.jsx(VS,{children:a.jsx(W6,{connector:t})}),a.jsx($S,{children:x})]})]}),a.jsxs(GS,{children:[a.jsxs(Qi,{children:[a.jsx(Xi,{children:"Last run status:"}),a.jsx(Ji,{children:g?a.jsx(_h,{type:g.statusType,variant:"ghost",children:g.statusText}):"Not run yet"})]}),a.jsxs(Qi,{children:[a.jsx(Xi,{children:"Last run date:"}),a.jsx(Ji,{children:g?a.jsx(ti,{date:g.date}):"Never run"})]}),a.jsxs(Qi,{children:[a.jsx(Xi,{children:"Total runs:"}),a.jsxs(Ji,{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(BS,{children:a.jsxs(Ce,{className:"w-full",variant:"default",onClick:f,title:"Open Storage","aria-label":"Open Storage",children:[y,a.jsx(Wo,{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 xoe(e){const t=e.triggerConfig,n=ea.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(OQ,{report:t.report,children:a.jsx(Br,{className:"inline-block h-4 w-4 align-text-bottom opacity-0 transition-opacity duration-200 group-hover:opacity-100"})})]})}function voe(e){var s;const t=e.triggerConfig,{connector:n}=t.connector,r=(s=n.info)!=null&&s.logoBase64?a.jsx(Ec,{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(W6,{connector:n}),a.jsx(yoe,{connector:n,children:a.jsx(Br,{className:"inline-block h-4 w-4 align-text-bottom opacity-0 transition-opacity duration-200 group-hover:opacity-100"})})]})}function boe({trigger:e}){switch(e.type){case kn.REPORT_RUN:return xoe(e);case kn.CONNECTOR_RUN:return voe(e);default:return a.jsx("div",{className:"text-muted-foreground text-sm",children:"—"})}}function Soe({onEditTrigger:e,onDeleteTrigger:t}){return[{accessorKey:"type",size:150,header:"Trigger Type",cell:({row:n})=>{const s=n.getValue("type")===kn.REPORT_RUN?"Report Run":"Connector Run";return a.jsx(Sr,{variant:"outline",children:s})},meta:{title:"Trigger Type"}},{accessorKey:"triggerConfig",size:35,header:"Run Target",cell:({row:n})=>a.jsx(boe,{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(foe,{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(ti,{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(ti,{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(_h,{type:r?Bn.SUCCESS:Bn.NEUTRAL,variant:"ghost",showIcon:!1,children:r?"Enabled":"Disabled"})},meta:{title:"Trigger Status"}},{id:"actions",size:80,header:({table:n})=>a.jsx(dd,{table:n}),cell:({row:n})=>a.jsx(hoe,{trigger:n.original,onEditTrigger:e,onDeleteTrigger:t}),meta:{title:"Actions"}}]}function Coe({table:e,onPreviousClick:t,onNextClick:n}){return a.jsxs("div",{className:"dm-card-pagination",role:"navigation","aria-label":"Table pagination",children:[a.jsx(Ce,{variant:"outline",size:"sm",onClick:t,disabled:!e.getCanPreviousPage(),"aria-label":"Go to previous page",children:"Previous"}),a.jsx(Ce,{variant:"outline",size:"sm",onClick:n,disabled:!e.getCanNextPage(),"aria-label":"Go to next page",children:"Next"})]})}function FC({isOpen:e,onClose:t,dataMartId:n,preSelectedReportId:r,preSelectedType:s}){const{createScheduledTrigger:i,updateScheduledTrigger:c,selectedTrigger:u}=z6(),[f,m]=h.useState(!1),[g,y]=h.useState(!1),x=h.useCallback(()=>{g?m(!0):t()},[g,t]),v=h.useCallback(()=>{m(!1),y(!1),t()},[t]),S=h.useCallback(A=>{y(A)},[]),C=h.useCallback(()=>{y(!1),t()},[t]),E=!!u,R=h.useMemo(()=>u?{type:u.type,cronExpression:u.cronExpression,timeZone:u.timeZone,isActive:u.isActive,triggerConfig:u.type===kn.REPORT_RUN?{type:_u.SCHEDULED_REPORT_RUN,reportId:u.triggerConfig.reportId}:null}:void 0,[u]),j=async A=>{E?await c(n,u.id,A.cronExpression,A.timeZone,A.isActive):await i(n,A.type,A.cronExpression,A.timeZone,A.isActive,A.triggerConfig),C()},_=h.useRef(!1);return h.useEffect(()=>{const A=E?"Edit":"Create",O=(u==null?void 0:u.type)??s;e&&!_.current?(Ie({event:"scheduled_trigger_config_open",category:"ScheduledTrigger",action:A,label:O}),_.current=!0):!e&&_.current&&(Ie({event:"scheduled_trigger_config_close",category:"ScheduledTrigger",action:A,label:O}),_.current=!1)},[e,E,u,s]),a.jsxs(a.Fragment,{children:[a.jsx(ni,{open:e,onOpenChange:A=>{A||x()},children:a.jsxs(ri,{children:[a.jsxs(ai,{children:[a.jsxs(si,{children:[E?"Edit":"Create"," Scheduled Trigger"]}),a.jsx(hl,{children:"Configure automatic runs for your reports or connectors."})]}),a.jsx(doe,{preSelectedReportId:r,preSelectedType:s,initialData:R,onSubmit:j,onCancel:x,onDirtyChange:S})]})}),a.jsx(yr,{open:f,onOpenChange:m,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:v,variant:"destructive"})]})}function Eoe({triggers:e,dataMartId:t,onEditTrigger:n,onDeleteTrigger:r}){const[s,i]=h.useState(!1),c=h.useCallback(()=>{i(!1)},[]),u=h.useCallback(R=>{r(R)},[r]),f=h.useMemo(()=>Soe({onEditTrigger:n,onDeleteTrigger:u}),[n,u]),{sorting:m,setSorting:g,columnVisibility:y,setColumnVisibility:x}=Rc({columns:f,storageKeyPrefix:"data-mart-scheduled-triggers",defaultSortingColumn:"type"}),v=vl({data:e,columns:f,getCoreRowModel:xl(),getPaginationRowModel:Dh(),onSortingChange:g,getSortedRowModel:wc(),getFilteredRowModel:ud(),state:{sorting:m,columnVisibility:y},onColumnVisibilityChange:x,enableGlobalFilter:!0,enableColumnResizing:!1}),S=h.useCallback(()=>{v.previousPage()},[v]),C=h.useCallback(()=>{v.nextPage()},[v]);return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"dm-card-table-wrap",children:a.jsxs(bl,{id:"scheduled-triggers-table",className:"dm-card-table",role:"table","aria-label":"Scheduled Triggers",children:[a.jsx(Sl,{className:"dm-card-table-header",children:v.getHeaderGroups().map(R=>a.jsx(Tn,{className:"dm-card-table-header-row",children:R.headers.map(j=>a.jsx(El,{className:"[&:has([role=checkbox])]:pl-6 [&>[role=checkbox]]:translate-y-[2px]",scope:"col",style:j.column.id==="type"?{width:150,minWidth:150,maxWidth:150}:j.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(j.getSize())}%`},children:j.isPlaceholder?null:typeof j.column.columnDef.header=="function"?j.column.columnDef.header(j.getContext()):j.column.columnDef.header},j.id))},R.id))}),a.jsx(Cl,{className:"dm-card-table-body",children:v.getRowModel().rows.length?v.getRowModel().rows.map((R,j)=>a.jsx(Tn,{onClick:()=>{n(R.original.id)},className:"dm-card-table-body-row group",role:"row","aria-rowindex":j+1,children:R.getVisibleCells().map((_,A)=>a.jsx(Mr,{className:`whitespace-normal ${_.column.id==="actions"?"actions-cell":""}`,role:"cell","aria-colindex":A+1,style:_.column.id==="type"?{width:150,minWidth:150,maxWidth:150}:_.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(_.column.getSize())}%`},children:typeof _.column.columnDef.cell=="function"?_.column.columnDef.cell(_.getContext()):_.column.columnDef.cell},_.id))},R.id)):a.jsx(Tn,{children:a.jsx(Mr,{colSpan:f.length,className:"dm-card-table-body-row-empty",role:"cell",children:a.jsx("span",{role:"status","aria-live":"polite",children:"No scheduled triggers found."})})})})]})}),a.jsx(Coe,{table:v,onPreviousClick:S,onNextClick:C}),a.jsx(FC,{isOpen:s,onClose:c,dataMartId:t})]})}function woe({dataMartId:e}){const{triggers:t,deleteScheduledTrigger:n,selectScheduledTrigger:r,selectedTrigger:s}=Use(e),[i,c]=h.useState(!1);h.useEffect(()=>{s&&c(!0)},[s]);const u=g=>{const y=t.find(x=>x.id===g);y&&r(y)},f=()=>{c(!1),r(null)},m=async g=>{try{await n(e,g)}catch(y){console.error("Error deleting trigger:",y)}};return a.jsxs(a.Fragment,{children:[a.jsx(Eoe,{triggers:t,dataMartId:e,onEditTrigger:u,onDeleteTrigger:g=>void m(g)}),a.jsx(FC,{isOpen:i,onClose:f,dataMartId:e})]})}function zC(){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($b,{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 wp(e){return e.startsWith('"')&&e.endsWith('"')?e:`"${e}"`}function Tg(e){return e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}function Roe({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,g]=h.useState(""),[y,x]=h.useState(""),[v,S]=h.useState(null),[C,E]=h.useState(null),[R,j]=h.useState(null),_=(D,L=!1)=>D.trim()?L&&D.startsWith('"')&&D.endsWith('"')?D.slice(1,-1)?null:"Quoted identifier cannot be empty":/^[A-Za-z][A-Za-z0-9_]*$/.test(D)?null:"Use letters, numbers, and underscores; start with a letter":"This field is required",A=h.useCallback((D,L,H,B,q,Z)=>{let F;if(e===Re.SNOWFLAKE&&q){const M=wp(q),V=wp(L);F=`${D}.${M}.${V}`}else F=`${D}.${L}`;const z=e===Re.SNOWFLAKE?!!(D&&q&&L&&H===null&&Z===null&&B===null):!!(D&&L&&H===null&&B===null);s({fullyQualifiedName:F,isValid:z})},[s,e]);h.useEffect(()=>{let D="",L="",H="";if(t!=null&&t.fullyQualifiedName){const M=t.fullyQualifiedName.match(/(?:[^."]+|"[^"]*")+/g)??[];if(e===Re.SNOWFLAKE&&M.length===3){const V=M[0],K=M[1],se=M[2];V&&K&&se&&(D=V,L=Tg(K),H=Tg(se))}else if(M.length>=2){const V=M[0],K=M[1];V&&K&&(D=V,H=K)}}else D=`${c}_owox`,e===Re.SNOWFLAKE&&(L="PUBLIC"),H=i;const B=_(D),q=e===Re.SNOWFLAKE?_(L,!0):null,Z=_(H,e===Re.SNOWFLAKE);f(D),g(L),x(H),S(B),E(q),j(Z);const F=e===Re.SNOWFLAKE&&L?`${D}.${wp(L)}.${wp(H)}`:`${D}.${H}`,z=e===Re.SNOWFLAKE?!!(D&&L&&H&&B===null&&q===null&&Z===null):!!(D&&H&&B===null&&Z===null);((t==null?void 0:t.fullyQualifiedName)!==F||t.isValid!==z)&&A(D,H,B,Z,L,q)},[t,i,c,e,A]);const O=D=>{f(D);const L=_(D);S(L),A(D,y,L,R,m,C)},I=D=>{g(D);const L=_(D,!0);E(L),A(u,y,v,R,D,L)},T=D=>{x(D);const L=_(D,e===Re.SNOWFLAKE);j(L),A(u,D,v,L,m,C)};return a.jsxs(Zo,{children:[e===Re.GOOGLE_BIGQUERY&&a.jsxs(a.Fragment,{children:[a.jsx(Ko,{icon:a.jsx(eD,{}),title:"Google BigQuery",docUrl:"https://docs.owox.com/docs/storages/supported-storages/google-bigquery/",variant:"compact"}),a.jsxs(tl,{title:"Choose where to store your data",children:[a.jsxs(Hi,{children:[a.jsx(Pa,{required:!0,htmlFor:"dataset-name",tooltip:"Enter dataset name for Google BigQuery where the connector data will be stored.",children:"Dataset name"}),a.jsx(Tt,{type:"text",id:"dataset-name",placeholder:"Enter dataset name",autoComplete:"off",className:"box-border w-full",value:u,"aria-invalid":!!v,"aria-describedby":v?"dataset-name-error":void 0,onChange:D=>{O(D.target.value)},required:!0}),a.jsx("p",{className:"text-muted-foreground text-sm",children:"Dataset is auto-created on first run if it doesn’t exist"}),v&&a.jsx("p",{id:"dataset-name-error",className:"text-destructive text-sm",children:v})]}),a.jsxs(Hi,{children:[a.jsx(Pa,{required:!0,htmlFor:"table-name",tooltip:"Enter table name where the connector data will be stored.",children:"Table name"}),a.jsx(Tt,{type:"text",id:"table-name",placeholder:"Enter table name",autoComplete:"off",className:"box-border w-full",value:y,"aria-invalid":!!R,"aria-describedby":R?"table-name-error":void 0,onChange:D=>{T(D.target.value)},required:!0}),a.jsx("p",{className:"text-muted-foreground text-sm",children:"Table is auto-created on first run if it doesn’t exist"}),R&&a.jsx("p",{id:"table-name-error",className:"text-destructive text-sm",children:R})]})]})]}),e===Re.AWS_ATHENA&&a.jsxs(a.Fragment,{children:[a.jsx(Ko,{icon:a.jsx(tD,{}),title:"AWS Athena",docUrl:"https://docs.owox.com/docs/storages/supported-storages/aws-athena/",variant:"compact"}),a.jsxs(tl,{title:"Choose where to store your data",children:[a.jsxs(Hi,{children:[a.jsx(Pa,{required:!0,htmlFor:"database-name",tooltip:"Enter database name for Amazon Athena where the connector data will be stored.",children:"Database name"}),a.jsx(Tt,{type:"text",id:"database-name",placeholder:"Enter database name",autoComplete:"off",className:"box-border w-full",value:u,"aria-invalid":!!v,"aria-describedby":v?"database-name-error":void 0,onChange:D=>{O(D.target.value)},required:!0}),a.jsx("p",{className:"text-muted-foreground text-sm",children:"Database is auto-created on first run if it doesn’t exist"}),v&&a.jsx("p",{id:"database-name-error",className:"text-destructive text-sm",children:v})]}),a.jsxs(Hi,{children:[a.jsx(Pa,{required:!0,htmlFor:"athena-table-name",tooltip:"Enter table name where the connector data will be stored.",children:"Table name"}),a.jsx(Tt,{type:"text",id:"athena-table-name",placeholder:"Enter table name",autoComplete:"off",className:"box-border w-full",value:y,"aria-invalid":!!R,"aria-describedby":R?"athena-table-name-error":void 0,onChange:D=>{T(D.target.value)},required:!0}),a.jsx("p",{className:"text-muted-foreground text-sm",children:"Table is auto-created on first run if it doesn’t exist"}),R&&a.jsx("p",{id:"athena-table-name-error",className:"text-destructive text-sm",children:R})]})]})]}),e===Re.SNOWFLAKE&&a.jsxs(a.Fragment,{children:[a.jsx(Ko,{icon:a.jsx(nD,{}),title:"Snowflake",docUrl:"https://docs.owox.com/docs/storages/supported-storages/snowflake/",variant:"compact"}),a.jsxs(tl,{title:"Choose where to store your data",children:[a.jsxs(Hi,{children:[a.jsx(Pa,{required:!0,htmlFor:"snowflake-database-name",tooltip:"Enter database name for Snowflake where the connector data will be stored.",children:"Database name"}),a.jsx(Tt,{type:"text",id:"snowflake-database-name",placeholder:"Enter database name",autoComplete:"off",className:"box-border w-full",value:u,"aria-invalid":!!v,"aria-describedby":v?"snowflake-database-name-error":void 0,onChange:D=>{O(D.target.value)},required:!0}),a.jsx("p",{className:"text-muted-foreground text-sm",children:"Database is auto-created on first run if it doesn't exist"}),v&&a.jsx("p",{id:"snowflake-database-name-error",className:"text-destructive text-sm",children:v})]}),a.jsxs(Hi,{children:[a.jsx(Pa,{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(Tt,{type:"text",id:"snowflake-schema-name",placeholder:"PUBLIC",autoComplete:"off",className:"box-border w-full",value:m,"aria-invalid":!!C,"aria-describedby":C?"snowflake-schema-name-error":void 0,onChange:D=>{I(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"}),C&&a.jsx("p",{id:"snowflake-schema-name-error",className:"text-destructive text-sm",children:C})]}),a.jsxs(Hi,{children:[a.jsx(Pa,{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(Tt,{type:"text",id:"snowflake-table-name",placeholder:"my_table",autoComplete:"off",className:"box-border w-full",value:y,"aria-invalid":!!R,"aria-describedby":R?"snowflake-table-name-error":void 0,onChange:D=>{T(D.target.value)},required:!0}),a.jsx("p",{className:"text-muted-foreground text-sm",children:"Table is auto-created on first run if it doesn't exist"}),R&&a.jsx("p",{id:"snowflake-table-name-error",className:"text-destructive text-sm",children:R})]})]})]}),a.jsx(tl,{title:"Schedule updates",children:a.jsx(zC,{})})]})}function joe({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),[g,y]=h.useState(null),[x,v]=h.useState(""),[S,C]=h.useState([]),[E,R]=h.useState(1),[j,_]=h.useState({}),[A,O]=h.useState(!1),[I,T]=h.useState(new Set),[D,L]=h.useState(new Set),{connectors:H,connectorSpecification:B,connectorFields:q,loading:Z,loadingSpecification:F,loadingFields:z,error:M,fetchAvailableConnectors:V,fetchConnectorSpecification:K,fetchConnectorFields:se}=jc();h.useEffect(()=>{u==null||u(f)},[f,u]);const[ve,P]=h.useState(null),U=h.useMemo(()=>n?[{id:1,title:"Configuration",description:"Set up connector parameters"}]:s==="fields-only"?[{id:1,title:"Select Fields",description:"Pick specific fields"}]:[{id:1,title:"Select Connector",description:"Choose a data source"},{id:2,title:"Configuration",description:"Set up connector parameters"},{id:3,title:"Select Nodes",description:"Choose data nodes"},{id:4,title:"Select Fields",description:"Pick specific fields"},{id:5,title:"Target Setup",description:"Configure destination"}],[n,s]),$=U.length,Q=h.useCallback(async Pe=>{!I.has(Pe)&&!F&&(T(G=>new Set(G).add(Pe)),await K(Pe))},[I,F,K]),ne=h.useCallback(async Pe=>{D.has(Pe)||(L(G=>new Set(G).add(Pe)),await se(Pe))},[D,se]);h.useEffect(()=>{if(!c||g||H.length===0)return;const Pe=H.find(G=>G.name===c);Pe&&(y(Pe),R(i??2),Q(Pe.name),!n&&s!=="fields-only"&&ne(Pe.name))},[c,H,g,i,n,s,Q,ne]),h.useEffect(()=>{if(H.length===0&&!Z&&V(),r&&H.length>0&&!g){const{source:Pe,storage:G}=r;v(Pe.node),C(Pe.fields),_(Pe.configuration[0]||{}),P({fullyQualifiedName:G.fullyQualifiedName,isValid:!0});const ee=H.find(de=>de.name===Pe.name);ee&&(y(ee),Q(ee.name),!n&&s!=="fields-only"&&ne(ee.name),s==="fields-only"&&ne(ee.name))}if(n&&H.length>0&&!g&&!r){const Pe=H[0];y(Pe),Q(Pe.name)}},[s,r,H,n,Z,V,Q,ne,g]);const ue=Pe=>{y(Pe),_({}),O(!1),m(!0),T(G=>{const ee=new Set(G);return ee.delete(Pe.name),ee}),Q(Pe.name),ne(Pe.name),Ie({event:"connector_setup",category:Pe.name,action:"connector_selected",label:Pe.displayName})},J=Pe=>{v(Pe),C([]),m(!0)},he=(Pe,G)=>{C(G?ee=>ee.includes(Pe)?ee:[...ee,Pe]:ee=>ee.filter(de=>de!==Pe)),m(!0)},ge=(Pe,G)=>{C(G?ee=>{const de=Pe.filter(Ae=>!ee.includes(Ae));return[...ee,...de]}:ee=>ee.filter(de=>!Pe.includes(de))),m(!0)},Ee=Pe=>{P(Pe),m(!0)},Me=h.useCallback(Pe=>{_(Pe),m(!0)},[]),Fe=h.useCallback(Pe=>{O(Pe)},[]);h.useEffect(()=>{B&&(B.some(G=>G.required&&G.name!=="Fields")||O(!0))},[B]),h.useEffect(()=>{var G;const Pe=((G=U[E-1])==null?void 0:G.title)??`Step ${String(E)}`;Ie({event:"connector_setup",category:(g==null?void 0:g.name)??"unknown",action:"step",label:Pe})},[E,g]);const nt=()=>{E<$&&R(E+1)},ut=()=>{E>1&&R(E-1)},Vt=()=>{if(n)return g!==null&&A;if(s==="fields-only")switch(E){case 1:return S.length>0;default:return!1}switch(E){case 1:return g!==null;case 2:return A;case 3:return x!=="";case 4:return S.length>0;case 5:return ve!==null&&ve.fullyQualifiedName!==""&&ve.isValid;default:return!1}},xn=()=>E>1,er=(Pe,G)=>{if(!Pe)return G;const ee=Pe.find(de=>de.name===G);return(ee==null?void 0:ee.destinationName)??G},fn=()=>{if(n&&E===1)return B&&g?a.jsx(L_,{connector:g,connectorSpecification:B,onConfigurationChange:Me,onValidationChange:Fe,initialConfiguration:j,loading:F,isEditingExisting:!!(r!=null&&r.source.configuration.length)}):null;if(s==="fields-only")switch(E){case 1:return g&&x&&q?a.jsx(P_,{connector:g,connectorFields:q,selectedField:x,selectedFields:S,onFieldToggle:he,onSelectAllFields:ge}):null;default:return null}switch(E){case 1:return a.jsx(yse,{connectors:H,selectedConnector:g,loading:Z,error:M,onConnectorSelect:ue,onConnectorDoubleClick:()=>{R(Pe=>Pe<$?Pe+1:Pe)}});case 2:return g&&B?a.jsx(L_,{connector:g,connectorSpecification:B,onConfigurationChange:Me,onValidationChange:Fe,initialConfiguration:j,loading:F,isEditingExisting:!1}):null;case 3:return g&&q?a.jsx(Ise,{connectorFields:q,connector:g,selectedField:x,connectorName:g.displayName,loading:z,onFieldSelect:J}):null;case 4:return g&&x&&q?a.jsx(P_,{connector:g,connectorFields:q,selectedField:x,selectedFields:S,onFieldToggle:he,onSelectAllFields:ge}):null;case 5:return x&&q?a.jsx(Roe,{dataStorageType:t,destinationName:er(q,x),connectorName:(g==null?void 0:g.displayName)??"",target:ve,onTargetChange:Ee}):null;default:return null}};return a.jsxs(ane,{children:[a.jsx(sne,{children:fn()}),a.jsx(one,{variant:"horizontal",children:a.jsx(xse,{currentStep:E,totalSteps:$,canGoNext:Vt(),canGoBack:xn(),isLoading:F||z,onNext:nt,onBack:ut,onFinish:()=>{n&&g?(e({source:{name:g.name,configuration:[j],node:(r==null?void 0:r.source.node)??x,fields:(r==null?void 0:r.source.fields)??S},storage:(r==null?void 0:r.storage)??{fullyQualifiedName:(r==null?void 0:r.storage.fullyQualifiedName)??""}}),Ie({event:"connector_setup",category:g.name,action:"created",label:"configuration-only"})):s==="fields-only"&&r?(e({source:{...r.source,fields:S},storage:r.storage}),Ie({event:"connector_setup",category:r.source.name,action:"created",label:"fields-only"})):g&&ve&&(e({source:{name:g.name,configuration:[j],node:x,fields:S},storage:{fullyQualifiedName:ve.fullyQualifiedName}}),Ie({event:"connector_setup",category:g.name,action:"created",label:"full"})),m(!1)}})})]})}const Q6=20,X6=20;function J6({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 Toe(e=30,t=0){J6({vertical:X6+e,horizontal:Q6+t})}function yb(){J6({vertical:X6,horizontal:Q6})}function eI({isOpen:e,onClose:t,dataStorageType:n,onSubmit:r,configurationOnly:s=!1,existingConnector:i=null,mode:c="full",initialStep:u,preselectedConnector:f}){h.useEffect(()=>(e?Toe(55):yb(),()=>{yb()}),[e]);const[m,g]=h.useState(!1),[y,x]=h.useState(!1),v=h.useCallback(()=>{y?g(!0):t()},[y,t]),S=h.useCallback(()=>{g(!1),x(!1),t()},[t]),C=h.useCallback(E=>{x(E)},[]);return a.jsxs(a.Fragment,{children:[a.jsx(ni,{open:e,onOpenChange:v,children:a.jsxs(ri,{children:[a.jsxs(ai,{children:[a.jsx(si,{children:c==="fields-only"?"Connector Fields":i!=null&&i.source.name?"Edit Connector":"Set Up Connector"}),a.jsx(hl,{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(joe,{onSubmit:E=>{r(E),t()},dataStorageType:n,configurationOnly:s||c==="configuration-only",existingConnector:i,mode:c,initialStep:u,preselectedConnector:f,onDirtyChange:C})]})}),a.jsx(yr,{open:m,onOpenChange:g,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:S,variant:"destructive"})]})}const HC=({dataStorageType:e,onSubmit:t,children:n,configurationOnly:r=!1,existingConnector:s=null,preset:i,isOpen:c,onClose:u})=>{const[f,m]=h.useState(!1),[g,y]=h.useState(1),[x,v]=h.useState();h.useEffect(()=>{c!==void 0&&m(c)},[c]);const S=()=>{v(void 0),y(1),m(!0)},C=()=>{m(!1),u==null||u()};return h.useEffect(()=>{i&&(i==="connector"?(v(void 0),y(1),m(!0)):(v(i),y(2),m(!0)))},[i]),a.jsxs(a.Fragment,{children:[n&&a.jsx("div",{onClick:S,style:{cursor:"pointer"},children:n}),a.jsx(Wu,{children:a.jsx(eI,{isOpen:f,onClose:C,dataStorageType:e,onSubmit:t,configurationOnly:r,existingConnector:s,initialStep:g,preselectedConnector:x})})]})};function _oe({storageType:e,onSetupConnector:t,preset:n,isOpen:r,onClose:s}){return a.jsx(HC,{dataStorageType:e,onSubmit:t,configurationOnly:!1,preset:n,isOpen:r,onClose:s,children:a.jsxs(Ce,{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(qb,{className:"h-4 w-4",strokeWidth:2.25})}),a.jsx("span",{children:"Setup Connector"}),a.jsx(Ra,{className:"h-6 w-6"})]})})}const Noe=e=>{switch(e){case Re.GOOGLE_BIGQUERY:return"Google BigQuery";case Re.AWS_ATHENA:return"AWS Athena";case Re.SNOWFLAKE:return"Snowflake";default:return e}},wu=e=>typeof e=="object"&&"connector"in e,bf=e=>{if(!wu(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 Aoe({configIndex:e,connectorDef:t,onRemoveConfiguration:n,onUpdateConfiguration:r,totalConfigurations:s,dataStorage:i}){const c=yl.getInfo(i.type),{connectors:u,fetchAvailableConnectors:f}=jc();h.useEffect(()=>{f()},[f]);const m=S=>{const C=u.find(E=>E.name===S);if(C!=null&&C.logoBase64)return()=>a.jsx(Ec,{base64:C.logoBase64,size:24})},g=()=>{const S=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:S}),a.jsx("span",{className:"text-muted-foreground",children:"•"}),a.jsxs(Nt,{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(Ra,{className:"h-3 w-3"})]})}),a.jsx(Dt,{children:"Edit connector configuration"})]})]})},y=(S,C,E)=>a.jsxs("span",{children:[a.jsxs("span",{className:"text-muted-foreground/75",children:[S,":"]})," ",a.jsx(rn,{href:E,onClick:R=>{R.stopPropagation()},children:C})]}),x=()=>{switch(i.type){case Re.GOOGLE_BIGQUERY:{const S=i.config.projectId,C=t.connector.storage.fullyQualifiedName,E=C.split(".")[0],R=C.split(".")[1],j=`https://console.cloud.google.com/bigquery?project=${S}&ws=!1m4!1m3!3m2!1s${S}!2s${E}`,_=`https://console.cloud.google.com/bigquery?project=${S}&ws=!1m4!1m3!3m2!1s${S}!2s${E}!3s${R}`;return a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[y("Dataset",E,j),a.jsx("span",{className:"text-muted-foreground",children:"•"}),y("Table",R,_),a.jsxs(Nt,{children:[a.jsx(At,{asChild:!0,children:a.jsx(Br,{className:"h-4 w-4"})}),a.jsx(Dt,{children:"The dataset and table are automatically created during the first run of the data mart, if they don't already exist"})]})]})}case Re.AWS_ATHENA:{const S=i.config.region,C=t.connector.storage.fullyQualifiedName,[E,R]=C.split("."),j=`https://console.aws.amazon.com/athena/home?region=${S}#/query-editor`;return a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[y("Database",E,j),a.jsx("span",{className:"text-muted-foreground",children:"•"}),y("Table",R,j),a.jsxs(Nt,{children:[a.jsx(At,{asChild:!0,children:a.jsx(Br,{className:"h-4 w-4"})}),a.jsx(Dt,{children:"The database and table are automatically created during the first run of the data mart, if they don't already exist"})]})]})}case Re.SNOWFLAKE:{const S=i.config.account,E=t.connector.storage.fullyQualifiedName.split("."),R=E[0],j=E[1],_=E[2],A=`https://${S}.snowflakecomputing.com`,O=`${A}/#/data/databases/${R}`,I=`${A}/#/data/databases/${R}/schemas/${j}`,T=`${A}/#/data/databases/${R}/schemas/${j}/table/${_}`;return a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[y("Database",R,O),a.jsx("span",{className:"text-muted-foreground",children:"•"}),y("Schema",Tg(j),I),a.jsx("span",{className:"text-muted-foreground",children:"•"}),y("Table",Tg(_),T),a.jsxs(Nt,{children:[a.jsx(At,{asChild:!0,children:a.jsx(Br,{className:"h-4 w-4"})}),a.jsx(Dt,{children:"The database, schema and table are automatically created during the first run of the data mart, if they don't already exist"})]})]})}default:return"Unknown storage type configuration"}},v=()=>s!==1;return a.jsxs("div",{className:"border-border flex w-full items-center rounded-lg border-1 p-1 dark:bg-white/2",children:[a.jsx("div",{className:"flex-grow",children:a.jsxs("div",{className:"grid grid-cols-2 items-center gap-4",children:[a.jsx(HC,{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(cb,{icon:m(t.connector.source.name),title:t.connector.source.name||"Connector",subtitle:g(),className:"bg-background hover:bg-muted min-h-[80px] cursor-pointer border-0 transition-colors hover:shadow-none"})}),a.jsx(cb,{title:Noe(i.type),icon:c.icon,subtitle:x(),className:"bg-background min-h-[80px] cursor-default border-0 hover:shadow-none dark:bg-white/2"})]})}),a.jsx("div",{className:"shrink-0 px-4",children:a.jsxs(Nt,{children:[a.jsx(At,{asChild:!0,children:a.jsx("span",{children:a.jsx(Ce,{type:"button",variant:"ghost",onClick:()=>{v()&&n(e)},disabled:!v(),children:a.jsx(us,{className:"h-4 w-4"})})})}),!v()&&a.jsx(Dt,{children:"Remove last configuration only after adding a new one."})]})})]})}function Doe({storageType:e,onAddConfiguration:t,existingConnector:n}){return a.jsx("div",{children:a.jsx(HC,{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(Ce,{type:"button",variant:"outline",className:"dm-card-table-add-field-btn cursor-pointer",children:[a.jsx(ua,{className:"h-4 w-4"}),a.jsx("span",{children:"Configuration"})]})})})}function Ooe({control:e,storageType:t,preset:n,autoOpen:r=!1,saveDataMartDefinition:s}){const{dataMart:i,runDataMart:c}=qa(),{setValue:u,getValues:f,trigger:m}=fd(),[g,y]=h.useState(!1),[x,v]=h.useState(!1);h.useEffect(()=>{r&&v(!0)},[r]);const S=(i==null?void 0:i.status)??Or.DRAFT,C=async F=>{u("definition",F,{shouldDirty:!0,shouldTouch:!0}),await m("definition")&&s&&s()},E=async F=>{const z=F.source,M=F.storage;await C({connector:{source:z,storage:M}})},R=async F=>{if(i){if(i.status.code!==Or.PUBLISHED){Mt.error("Manual run is only available for published data marts");return}await c({id:i.id,payload:F})}},j=F=>async z=>{const V=f().definition;if(typeof V=="object"&&wu(V)){const K=[...V.connector.source.configuration];K[F]=z.source.configuration[0]||{};const se={connector:{...V.connector,source:{...V.connector.source,configuration:K}}};await C(se)}},_=async F=>{const M=f().definition;if(typeof M=="object"&&wu(M)){const V={connector:{...M.connector,source:{...M.connector.source,fields:F.source.fields}}};await C(V)}y(!1)},A=F=>{R({runType:F.runType,data:F.data})},O=F=>{const z=F.connector.source.fields.length;return a.jsxs(Ce,{type:"button",variant:"outline",onClick:()=>{y(!0)},className:"dm-card-table-add-field-btn cursor-pointer",children:[a.jsx(pU,{className:"h-4 w-4"}),a.jsxs("span",{children:["Edit Fields (",String(z),")"]})]})},[I,T]=h.useState(null),[D,L]=h.useState(!1),H=F=>{T(F),L(!0)},B=async()=>{I!==null&&(await q(I),T(null),L(!1))},q=async F=>{const M=f().definition;if(wu(M)&&M.connector.source.configuration.length<=1){const V=kC($e.CONNECTOR);await C(V)}if(typeof M=="object"&&wu(M)&&M.connector.source.configuration.length>1){const V={...M.connector.source,configuration:M.connector.source.configuration.filter((se,ve)=>ve!==F)},K={connector:{...M.connector,source:V}};await C(K)}},Z=async F=>{const M=f().definition;if(wu(M)){const V={...M.connector.source,configuration:[...M.connector.source.configuration,F]},K={connector:{...M.connector,source:V}};await C(K)}};return a.jsxs(a.Fragment,{children:[a.jsx(Et,{control:e,name:"definition",render:({field:F})=>a.jsxs(yt,{className:"dark:bg-white/2",children:[a.jsx(St,{children:a.jsx("div",{className:"space-y-3",children:!bf(F.value)||S===Or.DRAFT?a.jsx(_oe,{storageType:t,onSetupConnector:z=>{E(z),v(!1)},preset:n,isOpen:x,onClose:()=>{v(!1)}}):a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Doe,{storageType:t,onAddConfiguration:z=>void Z(z),existingConnector:bf(F.value)?{source:F.value.connector.source,storage:F.value.connector.storage}:void 0}),bf(F.value)&&O(F.value)]}),a.jsx("div",{className:"flex items-center gap-2",children:i&&i.definitionType===$e.CONNECTOR&&a.jsx(r6,{configuration:i.definition,onManualRun:A,children:a.jsxs(Ce,{variant:"outline",children:[a.jsx($g,{className:"h-4 w-4"}),a.jsx("span",{children:"Manual Run..."})]})})})]}),a.jsx("div",{className:"space-y-3",children:bf(F.value)&&(i!=null&&i.storage)?F.value.connector.source.configuration.map((z,M)=>{const V=F.value;return a.jsx(Wu,{children:a.jsx(Aoe,{configIndex:M,connectorDef:V,dataStorage:i.storage,onRemoveConfiguration:K=>{H(K)},onUpdateConfiguration:K=>j(K),dataMartStatus:typeof S=="object"?S.code:S,totalConfigurations:V.connector.source.configuration.length},M)},M)}):null})]})})}),a.jsx(_t,{})]})}),a.jsx(Wu,{children:a.jsx(eI,{isOpen:g,onClose:()=>{y(!1)},onSubmit:F=>void _(F),dataStorageType:t,existingConnector:bf(f().definition)?{source:f().definition.connector.source,storage:f().definition.connector.storage}:void 0,mode:"fields-only"})}),a.jsx(yr,{open:D,onOpenChange:L,title:"Delete Configuration",description:"Are you sure you want to delete this configuration? This action cannot be undone.",confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:()=>{B()},onCancel:()=>{T(null)},variant:"destructive"})]})}function Ioe({definitionType:e,storageType:t,preset:n,saveDataMartDefinition:r}){const{control:s}=fd(),[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(fse,{control:s}),e===$e.TABLE&&a.jsx(hse,{control:s,storageType:t}),e===$e.VIEW&&a.jsx(mse,{control:s,storageType:t}),e===$e.TABLE_PATTERN&&a.jsx(pse,{control:s,storageType:t}),e===$e.CONNECTOR&&a.jsx(Ooe,{control:s,storageType:t,preset:n,autoOpen:i,saveDataMartDefinition:r})]})}function tI(){const[e]=s7(),t=e.get("preset");return h.useMemo(()=>{if(!t)return;const n=t.toLowerCase();return fJ(n)},[t])}function Moe(e,t){const[n,r]=h.useState(e);return h.useEffect(()=>{const s=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(s)}},[e,t]),n}const koe=1e3,Loe=[Va.SUCCESS,Va.ERROR,Va.CANCELLED];function Poe(e){const[t,n]=h.useState(!1),[r,s]=h.useState(null),i=h.useRef({triggerId:null,abortController:null}),c=h.useCallback(y=>i.current.triggerId===y,[]),u=h.useCallback(y=>{s({isValid:!1,error:y instanceof Error?y.message:"Validation failed"}),n(!1)},[]),f=h.useCallback(async()=>{const{triggerId:y,abortController:x}=i.current;if(y){x==null||x.abort(),i.current={triggerId:null,abortController:null},s(null),n(!1);try{await yn.abortSqlDryRunTrigger(e,y)}catch(v){console.error("Failed to cancel trigger:",v)}}},[e]),m=h.useCallback(async(y,x)=>{for(;!x.aborted&&c(y);)try{const v=await yn.getSqlDryRunTriggerStatus(e,y);if(Loe.includes(v)){const S=await yn.getSqlDryRunTriggerResponse(e,y);s({isValid:S.isValid,error:S.error??void 0,bytes:S.bytes}),n(!1),i.current={triggerId:null,abortController:null};return}await new Promise(S=>setTimeout(S,koe))}catch(v){u(v),i.current={triggerId:null,abortController:null};return}},[e,c,u]),g=h.useCallback(async y=>{await f(),n(!0),s(null);try{const{triggerId:x}=await yn.createSqlDryRunTrigger(e,y),v=new AbortController;i.current={triggerId:x,abortController:v},await m(x,v.signal)}catch(x){u(x)}},[e,f,m,u]);return h.useEffect(()=>()=>{const{triggerId:y,abortController:x}=i.current;x==null||x.abort(),y&&yn.abortSqlDryRunTrigger(e,y).catch(()=>{})},[e]),{validateSql:g,isLoading:t,result:r,cancel:f}}const Uoe=300;function Foe({sql:e,dataMartId:t,debounceDelay:n=Uoe,className:r="",onValidationStateChange:s}){const i=Moe(e.trim(),n),{validateSql:c,isLoading:u,result:f,cancel:m}=Poe(t);h.useEffect(()=>{if(!i){m();const y={isLoading:!1,isValid:null,error:null,bytes:null};s==null||s(y);return}c(i)},[i,c,m,s]),h.useEffect(()=>{const y={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(y)},[u,f,s]);const g=()=>u?a.jsxs("div",{className:"flex h-5 items-center gap-2",children:[a.jsx(ed,{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(eP,{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(Nt,{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:see(f.bytes)})]})}),a.jsx(Dt,{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(Zp,{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:g()})}const zoe={isValid:null,isLoading:!1,error:null},Hoe=(e,t)=>{if(e!==$e.SQL)return"";const n=t;return(n==null?void 0:n.sqlQuery)??""},Voe=e=>kC(e);function $oe({definitionType:e,initialDefinitionType:t,setDefinitionType:n}){const{dataMart:r,updateDataMartDefinition:s,runSchemaActualization:i}=qa(),c=tI();if(!r)throw new Error("Data mart not found");const{definition:u,id:f,storage:{type:m}}=r,[,g]=h.useState(zoe),[y,x]=h.useState(!1),v=h.useCallback(()=>{if(!e)return;const Z={definitionType:e,definition:kC(e)};return u?{definitionType:e,definition:u}:Z},[e,u]),S=h.useCallback(()=>{if(!e)return;const Z=dse(e,m);return ui(Z)},[e,m]),C=go({resolver:S(),defaultValues:v(),mode:"onChange"}),{handleSubmit:E,reset:R,watch:j,formState:{isDirty:_,isValid:A}}=C,O=j("definition"),I=Hoe(e,O);h.useEffect(()=>{e&&R(v())},[e,R,v]),h.useEffect(()=>{if(!e&&!t&&(c!=null&&c.definitionType)){n(c.definitionType);const Z={definitionType:c.definitionType,definition:Voe(c.definitionType)};R(Z)}},[c,e,t,R,n]);const T=h.useCallback(Z=>{g({isLoading:Z.isLoading,isValid:Z.isValid,error:Z.error})},[]),D=h.useCallback(Z=>{n(Z)},[n]),L=h.useCallback(async Z=>{if(e&&f)try{await s(f,Z.definitionType,Z.definition),x(!0),R(Z)}catch(F){console.error("Failed to update data mart definition:",F)}},[f,e,s,R]);h.useEffect(()=>{y&&(x(!1),i==null||i())},[y,i]);const H=h.useCallback(Z=>{Z==null||Z.preventDefault(),E(L)(Z)},[E,L]),B=h.useCallback(()=>{R(v())},[R,v]),q=()=>e?a.jsxs("form",{onSubmit:H,className:"space-y-4",children:[a.jsx(Ioe,{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(Ce,{variant:"default",type:"submit",disabled:!A||!_,children:"Save"}),a.jsx(Ce,{type:"button",variant:"ghost",onClick:B,disabled:!_,children:"Discard"}),e===$e.SQL&&I&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"h-6 w-px bg-gray-300"}),a.jsx(Foe,{sql:I,dataMartId:f,onValidationStateChange:T})]})]})]}):null;return a.jsx(IO,{...C,children:a.jsxs("div",{className:"space-y-4",children:[!t&&a.jsx(sse,{initialType:e,onTypeSelect:D}),q()]})})}function Goe(e){switch(e){case Re.GOOGLE_BIGQUERY:return{type:"bigquery-data-mart-schema",fields:[]};case Re.AWS_ATHENA:return{type:"athena-data-mart-schema",fields:[]};case Re.SNOWFLAKE:return{type:"snowflake-data-mart-schema",fields:[]};default:throw new Error(`Unsupported storage type: ${e}`)}}function nI(e){return e.type==="bigquery-data-mart-schema"}function rI(e){return e.type==="athena-data-mart-schema"}function aI(e){return e.type==="snowflake-data-mart-schema"}function F_(e){return e!==null&&typeof e=="object"&&"mode"in e}function z_(e){return e!==null&&typeof e=="object"&&"isPrimaryKey"in e}function H_(e){return e!==null&&typeof e=="object"&&"isPrimaryKey"in e&&!("mode"in e)}function Boe(e){return e==null?"":typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):""}function J0(e){return e==null?e:JSON.parse(JSON.stringify(e))}function qoe(e){const t=J0(e),[n,r]=h.useState(t),[s,i]=h.useState(!1);h.useEffect(()=>{const f=J0(e);r(f),i(!1)},[e]);const c=h.useCallback(f=>{n?nI(n)&&f.every(F_)?(r({...n,fields:f}),i(!0)):rI(n)&&f.every(z_)?(r({...n,fields:f}),i(!0)):aI(n)&&f.every(H_)&&(r({...n,fields:f}),i(!0)):f.length>0&&(F_(f[0])?(r({type:"bigquery-data-mart-schema",fields:f}),i(!0)):z_(f[0])?(r({type:"athena-data-mart-schema",fields:f}),i(!0)):H_(f[0])&&(r({type:"snowflake-data-mart-schema",fields:f}),i(!0)))},[n]),u=h.useCallback(()=>{const f=J0(e);r(f),i(!1)},[e]);return{schema:n,isDirty:s,updateSchema:c,resetSchema:u,setIsDirty:i}}function Koe(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 Zoe(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 sI(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=>sI(c,t)):!1}function oI(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 g=oI(s.fields,t,c);g.length>0&&(r.includes(c)||r.push(c),r.push(...g))}}),r}function Yoe(e,t,n){const r=e.original;if(!n)return!0;const s=n.toLowerCase();return sI(r,s)}function Woe(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 Qoe(e){const[t,n]=h.useState(new Set),[r,s]=h.useState(null),i=h.useRef(""),c=h.useMemo(()=>{const S=C=>C.some(E=>E.type===Jn.RECORD||E.type===Jn.STRUCT||E.fields&&S(E.fields));return S(e)},[e]),u=h.useCallback(S=>{n(C=>{const E=new Set(C);return E.has(S)?E.delete(S):E.add(S),E})},[]),f=h.useCallback(()=>{const S=[],C=(E,R="")=>{E.forEach((j,_)=>{const A=R?`${R}.${String(_)}`:String(_);(j.type===Jn.RECORD||j.type===Jn.STRUCT)&&j.fields&&j.fields.length>0&&(S.push(A),C(j.fields,A))})};C(e),n(E=>S.every(j=>E.has(j))?new Set:new Set(S))},[e]),m=h.useMemo(()=>{const S=[],C=(E,R="",j=0)=>{E.forEach((_,A)=>{const O=R?`${R}.${String(A)}`:String(A),I=_.type===Jn.RECORD||_.type===Jn.STRUCT;S.push({..._,path:O,level:j}),I&&_.fields&&t.has(O)&&C(_.fields,O,j+1)})};return C(e),S},[e,t]),g=h.useCallback(S=>{if(S!==i.current)if(i.current=S,S){r===null&&s(new Set(t));const E=oI(e,S).filter(R=>{const j=R.split(".").map(Number);let _=e,A;for(let O=0;O<j.length;O++){if(A=_[j[O]],!A)return!1;if((A.type===Jn.RECORD||A.type===Jn.STRUCT)&&A.fields&&A.fields.length>0)return!0;O<j.length-1&&(_=A.fields??[])}return!1});n(R=>{const j=new Set(R);return E.forEach(_=>{j.add(_)}),j})}else r!==null&&(n(r),s(null))},[e,t,r]),y=h.useCallback(S=>{const C=m[S];return C.type===Jn.RECORD||C.type===Jn.STRUCT},[m]),x=h.useMemo(()=>e.map(S=>({...S,fields:void 0})),[e]),v=h.useMemo(()=>{const S=[],C=(E,R="")=>{E.forEach((j,_)=>{const A=R?`${R}.${String(_)}`:String(_);(j.type===Jn.RECORD||j.type===Jn.STRUCT)&&j.fields&&j.fields.length>0&&(S.push(A),C(j.fields,A))})};return C(e),S.length===0?!1:S.every(E=>t.has(E))},[e,t]);return{expandedRecords:t,hasRecordFields:c,toggleRecordExpansion:u,toggleAllRecords:f,flattenedFields:m,handleSearchChange:g,isRecordType:y,topLevelFields:x,allExpanded:v}}function Xoe(e,t,n,r){const s=h.useCallback((f,m)=>{if(n){const g=[...e],y=t[f].path;if(!y)g[f]={...g[f],...m};else{const x=y.split(".").map(Number);let v=g,S;for(let E=0;E<x.length-1;E++)S=v[x[E]],v=S.fields??[];const C=x[x.length-1];v[C]&&(v[C]={...v[C],...m})}n(g)}},[e,t,n]),i=h.useCallback(()=>{if(n){const f={name:"",type:Jn.STRING,mode:Wf.NULLABLE,isPrimaryKey:!1,status:$a.DISCONNECTED};n([...e,f])}},[e,n]),c=h.useCallback(f=>{if(n){const m=[...e],g=t[f].path;if(!g)m.splice(f,1);else{const y=g.split(".").map(Number);let x=m,v;for(let C=0;C<y.length-1;C++)v=x[y[C]],x=v.fields??[];const S=y[y.length-1];x.splice(S,1)}n(m)}},[e,t,n]),u=h.useCallback(f=>{var m,g;if(n&&r){const y=[...e],x=t[f].path,v={name:"",type:Jn.STRING,mode:Wf.NULLABLE,isPrimaryKey:!1,status:$a.DISCONNECTED};if(!x)(m=y[f]).fields??(m.fields=[]),y[f].fields.push(v);else{const S=x.split(".").map(Number);let C=y;for(let E=0;E<S.length;E++){const R=S[E];E===S.length-1?((g=C[R]).fields??(g.fields=[]),C[R].fields.push(v)):C=C[R].fields??[]}}n(y)}},[e,t,n,r]);return{updateField:s,handleAddRow:i,handleDeleteRow:c,handleAddNestedField:u}}function VC(e,t,n){return{handleDragEnd:h.useCallback(s=>{const{active:i,over:c}=s;if(!c||i.id===c.id||!t)return;if(!n){const x=Number(i.id),v=Number(c.id),S=[...e],[C]=S.splice(x,1);S.splice(v,0,C),t(S);return}const u=n.findIndex((x,v)=>(x.path??String(v))===i.id),f=n.findIndex((x,v)=>(x.path??String(v))===c.id);if(u===-1||f===-1)return;const m=n[u].path,g=n[f].path,y=[...e];if(!m&&!g){const[x]=y.splice(u,1);y.splice(f,0,x),t(y);return}if(m&&g){const x=m.split(".").map(Number),v=g.split(".").map(Number);if(x.length===v.length&&x.slice(0,-1).join(".")===v.slice(0,-1).join(".")){let S=y;for(let j=0;j<x.length-1;j++)S=S[x[j]].fields??[];const C=x[x.length-1],E=v[v.length-1],[R]=S.splice(C,1);S.splice(E,0,R),t(y)}}},[e,n,t])}}function Joe(){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 Hy=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function pd(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function $C(e){return"nodeType"in e}function ja(e){var t,n;return e?pd(e)?e:$C(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function GC(e){const{Document:t}=ja(e);return e instanceof t}function Ph(e){return pd(e)?!1:e instanceof ja(e).HTMLElement}function iI(e){return e instanceof ja(e).SVGElement}function gd(e){return e?pd(e)?e.document:$C(e)?GC(e)?e:Ph(e)||iI(e)?e.ownerDocument:document:document:document}const co=Hy?h.useLayoutEffect:h.useEffect;function BC(e){const t=h.useRef(e);return co(()=>{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 eie(){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 Jf(e,t){t===void 0&&(t=[e]);const n=h.useRef(e);return co(()=>{n.current!==e&&(n.current=e)},t),n}function Uh(e,t){const n=h.useRef();return h.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function _g(e){const t=BC(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 xb(e){const t=h.useRef();return h.useEffect(()=>{t.current=e},[e]),t.current}let e1={};function Fh(e,t){return h.useMemo(()=>{if(t)return t;const n=e1[e]==null?0:e1[e]+1;return e1[e]=n,e+"-"+n},[e,t])}function lI(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 g=i[f];g!=null&&(i[f]=g+e*m)}return i},{...t})}}const Uu=lI(1),Ng=lI(-1);function tie(e){return"clientX"in e&&"clientY"in e}function qC(e){if(!e)return!1;const{KeyboardEvent:t}=ja(e.target);return t&&e instanceof t}function nie(e){if(!e)return!1;const{TouchEvent:t}=ja(e.target);return t&&e instanceof t}function vb(e){if(nie(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 tie(e)?{x:e.clientX,y:e.clientY}:null}const eh=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[eh.Translate.toString(e),eh.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),V_="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function rie(e){return e.matches(V_)?e:e.querySelector(V_)}const aie={display:"none"};function sie(e){let{id:t,value:n}=e;return be.createElement("div",{id:t,style:aie},n)}function oie(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 be.createElement("div",{id:t,style:s,role:"status","aria-live":r,"aria-atomic":!0},n)}function iie(){const[e,t]=h.useState("");return{announce:h.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const cI=h.createContext(null);function lie(e){const t=h.useContext(cI);h.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function cie(){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 uie={draggable:`
|
|
794
|
-
To pick up a draggable item, press the space bar.
|
|
795
|
-
While dragging, use the arrow keys to move the item.
|
|
796
|
-
Press space again to drop the item in its new position, or press escape to cancel.
|
|
797
|
-
`},die={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 fie(e){let{announcements:t=die,container:n,hiddenTextDescribedById:r,screenReaderInstructions:s=uie}=e;const{announce:i,announcement:c}=iie(),u=Fh("DndLiveRegion"),[f,m]=h.useState(!1);if(h.useEffect(()=>{m(!0)},[]),lie(h.useMemo(()=>({onDragStart(y){let{active:x}=y;i(t.onDragStart({active:x}))},onDragMove(y){let{active:x,over:v}=y;t.onDragMove&&i(t.onDragMove({active:x,over:v}))},onDragOver(y){let{active:x,over:v}=y;i(t.onDragOver({active:x,over:v}))},onDragEnd(y){let{active:x,over:v}=y;i(t.onDragEnd({active:x,over:v}))},onDragCancel(y){let{active:x,over:v}=y;i(t.onDragCancel({active:x,over:v}))}}),[i,t])),!f)return null;const g=be.createElement(be.Fragment,null,be.createElement(sie,{id:r,value:s.draggable}),be.createElement(oie,{id:u,announcement:c}));return n?ws.createPortal(g,n):g}var gr;(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"})(gr||(gr={}));function Ag(){}function KC(e,t){return h.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function ZC(){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 Ds=Object.freeze({x:0,y:0});function hie(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function mie(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function pie(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function gie(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function $_(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 YC=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const s=$_(t,t.left,t.top),i=[];for(const c of r){const{id:u}=c,f=n.get(u);if(f){const m=hie($_(f),s);i.push({id:u,data:{droppableContainer:c,value:m}})}}return i.sort(mie)};function yie(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,g=c*u,y=g/(f+m-g);return Number(y.toFixed(4))}return 0}const xie=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=yie(u,t);f>0&&s.push({id:c,data:{droppableContainer:i,value:f}})}}return s.sort(pie)};function vie(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function uI(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Ds}function bie(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 Sie=bie(1);function Cie(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 Eie(e,t,n){const r=Cie(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)),g=s?e.width/s:e.width,y=i?e.height/i:e.height;return{width:g,height:y,top:m,right:f+g,bottom:m+y,left:f}}const wie={ignoreTransform:!1};function yd(e,t){t===void 0&&(t=wie);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:m,transformOrigin:g}=ja(e).getComputedStyle(e);m&&(n=Eie(n,m,g))}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 G_(e){return yd(e,{ignoreTransform:!0})}function Rie(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function jie(e,t){return t===void 0&&(t=ja(e).getComputedStyle(e)),t.position==="fixed"}function Tie(e,t){t===void 0&&(t=ja(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 WC(e,t){const n=[];function r(s){if(t!=null&&n.length>=t||!s)return n;if(GC(s)&&s.scrollingElement!=null&&!n.includes(s.scrollingElement))return n.push(s.scrollingElement),n;if(!Ph(s)||iI(s)||n.includes(s))return n;const i=ja(e).getComputedStyle(s);return s!==e&&Tie(s,i)&&n.push(s),jie(s,i)?n:r(s.parentNode)}return e?r(e):n}function dI(e){const[t]=WC(e,1);return t??null}function t1(e){return!Hy||!e?null:pd(e)?e:$C(e)?GC(e)||e===gd(e).scrollingElement?window:Ph(e)?e:null:null}function fI(e){return pd(e)?e.scrollX:e.scrollLeft}function hI(e){return pd(e)?e.scrollY:e.scrollTop}function bb(e){return{x:fI(e),y:hI(e)}}var br;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(br||(br={}));function mI(e){return!Hy||!e?!1:e===document.scrollingElement}function pI(e){const t={x:0,y:0},n=mI(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 _ie={x:.2,y:.2};function Nie(e,t,n,r,s){let{top:i,left:c,right:u,bottom:f}=n;r===void 0&&(r=10),s===void 0&&(s=_ie);const{isTop:m,isBottom:g,isLeft:y,isRight:x}=pI(e),v={x:0,y:0},S={x:0,y:0},C={height:t.height*s.y,width:t.width*s.x};return!m&&i<=t.top+C.height?(v.y=br.Backward,S.y=r*Math.abs((t.top+C.height-i)/C.height)):!g&&f>=t.bottom-C.height&&(v.y=br.Forward,S.y=r*Math.abs((t.bottom-C.height-f)/C.height)),!x&&u>=t.right-C.width?(v.x=br.Forward,S.x=r*Math.abs((t.right-C.width-u)/C.width)):!y&&c<=t.left+C.width&&(v.x=br.Backward,S.x=r*Math.abs((t.left+C.width-c)/C.width)),{direction:v,speed:S}}function Aie(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:c}=window;return{top:0,left:0,right:i,bottom:c,width:i,height:c}}const{top:t,left:n,right:r,bottom:s}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:s,width:e.clientWidth,height:e.clientHeight}}function gI(e){return e.reduce((t,n)=>Uu(t,bb(n)),Ds)}function Die(e){return e.reduce((t,n)=>t+fI(n),0)}function Oie(e){return e.reduce((t,n)=>t+hI(n),0)}function Iie(e,t){if(t===void 0&&(t=yd),!e)return;const{top:n,left:r,bottom:s,right:i}=t(e);dI(e)&&(s<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Mie=[["x",["left","right"],Die],["y",["top","bottom"],Oie]];class QC{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=WC(n),s=gI(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,c,u]of Mie)for(const f of c)Object.defineProperty(this,f,{get:()=>{const m=u(r),g=s[i]-m;return this.rect[f]+g},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class kf{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 kie(e){const{EventTarget:t}=ja(e);return e instanceof t?e:gd(e)}function n1(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 ss;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(ss||(ss={}));function B_(e){e.preventDefault()}function Lie(e){e.stopPropagation()}var nn;(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"})(nn||(nn={}));const yI={start:[nn.Space,nn.Enter],cancel:[nn.Esc],end:[nn.Space,nn.Enter,nn.Tab]},Pie=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case nn.Right:return{...n,x:n.x+25};case nn.Left:return{...n,x:n.x-25};case nn.Down:return{...n,y:n.y+25};case nn.Up:return{...n,y:n.y-25}}};class xI{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 kf(gd(n)),this.windowListeners=new kf(ja(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(ss.Resize,this.handleCancel),this.windowListeners.add(ss.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(ss.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&Iie(r),n(Ds)}handleKeyDown(t){if(qC(t)){const{active:n,context:r,options:s}=this.props,{keyboardCodes:i=yI,coordinateGetter:c=Pie,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,g=m?{x:m.left,y:m.top}:Ds;this.referenceCoordinates||(this.referenceCoordinates=g);const y=c(t,{active:n,context:r.current,currentCoordinates:g});if(y){const x=Ng(y,g),v={x:0,y:0},{scrollableAncestors:S}=r.current;for(const C of S){const E=t.code,{isTop:R,isRight:j,isLeft:_,isBottom:A,maxScroll:O,minScroll:I}=pI(C),T=Aie(C),D={x:Math.min(E===nn.Right?T.right-T.width/2:T.right,Math.max(E===nn.Right?T.left:T.left+T.width/2,y.x)),y:Math.min(E===nn.Down?T.bottom-T.height/2:T.bottom,Math.max(E===nn.Down?T.top:T.top+T.height/2,y.y))},L=E===nn.Right&&!j||E===nn.Left&&!_,H=E===nn.Down&&!A||E===nn.Up&&!R;if(L&&D.x!==y.x){const B=C.scrollLeft+x.x,q=E===nn.Right&&B<=O.x||E===nn.Left&&B>=I.x;if(q&&!x.y){C.scrollTo({left:B,behavior:u});return}q?v.x=C.scrollLeft-B:v.x=E===nn.Right?C.scrollLeft-O.x:C.scrollLeft-I.x,v.x&&C.scrollBy({left:-v.x,behavior:u});break}else if(H&&D.y!==y.y){const B=C.scrollTop+x.y,q=E===nn.Down&&B<=O.y||E===nn.Up&&B>=I.y;if(q&&!x.x){C.scrollTo({top:B,behavior:u});return}q?v.y=C.scrollTop-B:v.y=E===nn.Down?C.scrollTop-O.y:C.scrollTop-I.y,v.y&&C.scrollBy({top:-v.y,behavior:u});break}}this.handleMove(t,Uu(Ng(y,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()}}xI.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=yI,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 q_(e){return!!(e&&"distance"in e)}function K_(e){return!!(e&&"delay"in e)}class XC{constructor(t,n,r){var s;r===void 0&&(r=kie(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=gd(c),this.documentListeners=new kf(this.document),this.listeners=new kf(r),this.windowListeners=new kf(ja(c)),this.initialCoordinates=(s=vb(i))!=null?s:Ds,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(ss.Resize,this.handleCancel),this.windowListeners.add(ss.DragStart,B_),this.windowListeners.add(ss.VisibilityChange,this.handleCancel),this.windowListeners.add(ss.ContextMenu,B_),this.documentListeners.add(ss.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(K_(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(q_(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(ss.Click,Lie,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(ss.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=vb(t))!=null?n:Ds,m=Ng(s,f);if(!r&&u){if(q_(u)){if(u.tolerance!=null&&n1(m,u.tolerance))return this.handleCancel();if(n1(m,u.distance))return this.handleStart()}if(K_(u)&&n1(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===nn.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Uie={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class zh extends XC{constructor(t){const{event:n}=t,r=gd(n.target);super(t,Uie,r)}}zh.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 Fie={move:{name:"mousemove"},end:{name:"mouseup"}};var Sb;(function(e){e[e.RightClick=2]="RightClick"})(Sb||(Sb={}));class zie extends XC{constructor(t){super(t,Fie,gd(t.event.target))}}zie.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===Sb.RightClick?!1:(r==null||r({event:n}),!0)}}];const r1={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Hie extends XC{constructor(t){super(t,r1)}static setup(){return window.addEventListener(r1.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(r1.move.name,t)};function t(){}}}Hie.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 Lf;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Lf||(Lf={}));var Dg;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Dg||(Dg={}));function Vie(e){let{acceleration:t,activator:n=Lf.Pointer,canScroll:r,draggingRect:s,enabled:i,interval:c=5,order:u=Dg.TreeOrder,pointerCoordinates:f,scrollableAncestors:m,scrollableAncestorRects:g,delta:y,threshold:x}=e;const v=Gie({delta:y,disabled:!i}),[S,C]=eie(),E=h.useRef({x:0,y:0}),R=h.useRef({x:0,y:0}),j=h.useMemo(()=>{switch(n){case Lf.Pointer:return f?{top:f.y,bottom:f.y,left:f.x,right:f.x}:null;case Lf.DraggableRect:return s}},[n,s,f]),_=h.useRef(null),A=h.useCallback(()=>{const I=_.current;if(!I)return;const T=E.current.x*R.current.x,D=E.current.y*R.current.y;I.scrollBy(T,D)},[]),O=h.useMemo(()=>u===Dg.TreeOrder?[...m].reverse():m,[u,m]);h.useEffect(()=>{if(!i||!m.length||!j){C();return}for(const I of O){if((r==null?void 0:r(I))===!1)continue;const T=m.indexOf(I),D=g[T];if(!D)continue;const{direction:L,speed:H}=Nie(I,D,j,t,x);for(const B of["x","y"])v[B][L[B]]||(H[B]=0,L[B]=0);if(H.x>0||H.y>0){C(),_.current=I,S(A,c),E.current=H,R.current=L;return}}E.current={x:0,y:0},R.current={x:0,y:0},C()},[t,A,r,C,i,c,JSON.stringify(j),JSON.stringify(v),S,m,O,g,JSON.stringify(x)])}const $ie={x:{[br.Backward]:!1,[br.Forward]:!1},y:{[br.Backward]:!1,[br.Forward]:!1}};function Gie(e){let{delta:t,disabled:n}=e;const r=xb(t);return Uh(s=>{if(n||!r||!s)return $ie;const i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[br.Backward]:s.x[br.Backward]||i.x===-1,[br.Forward]:s.x[br.Forward]||i.x===1},y:{[br.Backward]:s.y[br.Backward]||i.y===-1,[br.Forward]:s.y[br.Forward]||i.y===1}}},[n,t,r])}function Bie(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return Uh(s=>{var i;return t==null?null:(i=r??s)!=null?i:null},[r,t])}function qie(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 th;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(th||(th={}));var Cb;(function(e){e.Optimized="optimized"})(Cb||(Cb={}));const Z_=new Map;function Kie(e,t){let{dragging:n,dependencies:r,config:s}=t;const[i,c]=h.useState(null),{frequency:u,measure:f,strategy:m}=s,g=h.useRef(e),y=E(),x=Jf(y),v=h.useCallback(function(R){R===void 0&&(R=[]),!x.current&&c(j=>j===null?R:j.concat(R.filter(_=>!j.includes(_))))},[x]),S=h.useRef(null),C=Uh(R=>{if(y&&!n)return Z_;if(!R||R===Z_||g.current!==e||i!=null){const j=new Map;for(let _ of e){if(!_)continue;if(i&&i.length>0&&!i.includes(_.id)&&_.rect.current){j.set(_.id,_.rect.current);continue}const A=_.node.current,O=A?new QC(f(A),A):null;_.rect.current=O,O&&j.set(_.id,O)}return j}return R},[e,i,n,y,f]);return h.useEffect(()=>{g.current=e},[e]),h.useEffect(()=>{y||v()},[n,y]),h.useEffect(()=>{i&&i.length>0&&c(null)},[JSON.stringify(i)]),h.useEffect(()=>{y||typeof u!="number"||S.current!==null||(S.current=setTimeout(()=>{v(),S.current=null},u))},[u,y,v,...r]),{droppableRects:C,measureDroppableContainers:v,measuringScheduled:i!=null};function E(){switch(m){case th.Always:return!1;case th.BeforeDragging:return n;default:return!n}}}function vI(e,t){return Uh(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Zie(e,t){return vI(e,t)}function Yie(e){let{callback:t,disabled:n}=e;const r=BC(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 Vy(e){let{callback:t,disabled:n}=e;const r=BC(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 Wie(e){return new QC(yd(e),e)}function Y_(e,t,n){t===void 0&&(t=Wie);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 g=t(e);return JSON.stringify(f)===JSON.stringify(g)?f:g})}const c=Yie({callback(f){if(e)for(const m of f){const{type:g,target:y}=m;if(g==="childList"&&y instanceof HTMLElement&&y.contains(e)){i();break}}}}),u=Vy({callback:i});return co(()=>{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 Qie(e){const t=vI(e);return uI(e,t)}const W_=[];function Xie(e){const t=h.useRef(e),n=Uh(r=>e?r&&r!==W_&&e&&t.current&&e.parentNode===t.current.parentNode?r:WC(e):W_,[e]);return h.useEffect(()=>{t.current=e},[e]),n}function Jie(e){const[t,n]=h.useState(null),r=h.useRef(e),s=h.useCallback(i=>{const c=t1(i.target);c&&n(u=>u?(u.set(c,bb(c)),new Map(u)):null)},[]);return h.useEffect(()=>{const i=r.current;if(e!==i){c(i);const u=e.map(f=>{const m=t1(f);return m?(m.addEventListener("scroll",s,{passive:!0}),[m,bb(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=t1(f);m==null||m.removeEventListener("scroll",s)})}},[s,e]),h.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,c)=>Uu(i,c),Ds):gI(e):Ds,[e,t])}function Q_(e,t){t===void 0&&(t=[]);const n=h.useRef(null);return h.useEffect(()=>{n.current=null},t),h.useEffect(()=>{const r=e!==Ds;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Ng(e,n.current):Ds}function ele(e){h.useEffect(()=>{if(!Hy)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 tle(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 bI(e){return h.useMemo(()=>e?Rie(e):null,[e])}const X_=[];function nle(e,t){t===void 0&&(t=yd);const[n]=e,r=bI(n?ja(n):null),[s,i]=h.useState(X_);function c(){i(()=>e.length?e.map(f=>mI(f)?r:new QC(t(f),f)):X_)}const u=Vy({callback:c});return co(()=>{u==null||u.disconnect(),c(),e.forEach(f=>u==null?void 0:u.observe(f))},[e]),s}function rle(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Ph(t)?t:e}function ale(e){let{measure:t}=e;const[n,r]=h.useState(null),s=h.useCallback(m=>{for(const{target:g}of m)if(Ph(g)){r(y=>{const x=t(g);return y?{...y,width:x.width,height:x.height}:x});break}},[t]),i=Vy({callback:s}),c=h.useCallback(m=>{const g=rle(m);i==null||i.disconnect(),g&&(i==null||i.observe(g)),r(g?t(g):null)},[t,i]),[u,f]=_g(c);return h.useMemo(()=>({nodeRef:u,rect:n,setRef:f}),[n,u,f])}const sle=[{sensor:zh,options:{}},{sensor:xI,options:{}}],ole={current:{}},Hp={draggable:{measure:G_},droppable:{measure:G_,strategy:th.WhileDragging,frequency:Cb.Optimized},dragOverlay:{measure:yd}};class Pf 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 ile={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Pf,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Ag},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Hp,measureDroppableContainers:Ag,windowRect:null,measuringScheduled:!1},lle={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Ag,draggableNodes:new Map,over:null,measureDroppableContainers:Ag},$y=h.createContext(lle),SI=h.createContext(ile);function cle(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Pf}}}function ule(e,t){switch(t.type){case gr.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case gr.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 gr.DragEnd:case gr.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case gr.RegisterDroppable:{const{element:n}=t,{id:r}=n,s=new Pf(e.droppable.containers);return s.set(r,n),{...e,droppable:{...e.droppable,containers:s}}}case gr.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 Pf(e.droppable.containers);return c.set(n,{...i,disabled:s}),{...e,droppable:{...e.droppable,containers:c}}}case gr.UnregisterDroppable:{const{id:n,key:r}=t,s=e.droppable.containers.get(n);if(!s||r!==s.key)return e;const i=new Pf(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function dle(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:s}=h.useContext($y),i=xb(r),c=xb(n==null?void 0:n.id);return h.useEffect(()=>{if(!t&&!r&&i&&c!=null){if(!qC(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 g of[f.current,m.current]){if(!g)continue;const y=rie(g);if(y){y.focus();break}}})}},[r,t,s,c,i]),null}function fle(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((s,i)=>i({transform:s,...r}),n):n}function hle(e){return h.useMemo(()=>({draggable:{...Hp.draggable,...e==null?void 0:e.draggable},droppable:{...Hp.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Hp.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 mle(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;co(()=>{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 g=n(m),y=uI(g,r);if(c||(y.x=0),u||(y.y=0),i.current=!0,Math.abs(y.x)>0||Math.abs(y.y)>0){const x=dI(m);x&&x.scrollBy({top:y.y,left:y.x})}},[t,c,u,r,n])}const CI=h.createContext({...Ds,scaleX:1,scaleY:1});var $i;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})($i||($i={}));const JC=h.memo(function(t){var n,r,s,i;let{id:c,accessibility:u,autoScroll:f=!0,children:m,sensors:g=sle,collisionDetection:y=xie,measuring:x,modifiers:v,...S}=t;const C=h.useReducer(ule,void 0,cle),[E,R]=C,[j,_]=cie(),[A,O]=h.useState($i.Uninitialized),I=A===$i.Initialized,{draggable:{active:T,nodes:D,translate:L},droppable:{containers:H}}=E,B=T!=null?D.get(T):null,q=h.useRef({initial:null,translated:null}),Z=h.useMemo(()=>{var In;return T!=null?{id:T,data:(In=B==null?void 0:B.data)!=null?In:ole,rect:q}:null},[T,B]),F=h.useRef(null),[z,M]=h.useState(null),[V,K]=h.useState(null),se=Jf(S,Object.values(S)),ve=Fh("DndDescribedBy",c),P=h.useMemo(()=>H.getEnabled(),[H]),U=hle(x),{droppableRects:$,measureDroppableContainers:Q,measuringScheduled:ne}=Kie(P,{dragging:I,dependencies:[L.x,L.y],config:U.droppable}),ue=Bie(D,T),J=h.useMemo(()=>V?vb(V):null,[V]),he=zs(),ge=Zie(ue,U.draggable.measure);mle({activeNode:T!=null?D.get(T):null,config:he.layoutShiftCompensation,initialRect:ge,measure:U.draggable.measure});const Ee=Y_(ue,U.draggable.measure,ge),Me=Y_(ue?ue.parentElement:null),Fe=h.useRef({activatorEvent:null,active:null,activeNode:ue,collisionRect:null,collisions:null,droppableRects:$,draggableNodes:D,draggingNode:null,draggingNodeRect:null,droppableContainers:H,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),nt=H.getNodeFor((n=Fe.current.over)==null?void 0:n.id),ut=ale({measure:U.dragOverlay.measure}),Vt=(r=ut.nodeRef.current)!=null?r:ue,xn=I?(s=ut.rect)!=null?s:Ee:null,er=!!(ut.nodeRef.current&&ut.rect),fn=Qie(er?null:Ee),Pe=bI(Vt?ja(Vt):null),G=Xie(I?nt??ue:null),ee=nle(G),de=fle(v,{transform:{x:L.x-fn.x,y:L.y-fn.y,scaleX:1,scaleY:1},activatorEvent:V,active:Z,activeNodeRect:Ee,containerNodeRect:Me,draggingNodeRect:xn,over:Fe.current.over,overlayNodeRect:ut.rect,scrollableAncestors:G,scrollableAncestorRects:ee,windowRect:Pe}),Ae=J?Uu(J,L):null,we=Jie(G),Te=Q_(we),Ye=Q_(we,[Ee]),it=Uu(de,Te),lt=xn?Sie(xn,de):null,Dn=Z&<?y({active:Z,collisionRect:lt,droppableRects:$,droppableContainers:P,pointerCoordinates:Ae}):null,Ka=gie(Dn,"id"),[On,di]=h.useState(null),Zn=er?de:Uu(de,Ye),Un=vie(Zn,(i=On==null?void 0:On.rect)!=null?i:null,Ee),Er=h.useRef(null),Fn=h.useCallback((In,_n)=>{let{sensor:tr,options:wr}=_n;if(F.current==null)return;const cr=D.get(F.current);if(!cr)return;const Yn=In.nativeEvent,Rr=new tr({active:F.current,activeNode:cr,event:Yn,options:wr,context:Fe,onAbort(Wn){if(!D.get(Wn))return;const{onDragAbort:te}=se.current,le={id:Wn};te==null||te(le),j({type:"onDragAbort",event:le})},onPending(Wn,Y,te,le){if(!D.get(Wn))return;const{onDragPending:_e}=se.current,He={id:Wn,constraint:Y,initialCoordinates:te,offset:le};_e==null||_e(He),j({type:"onDragPending",event:He})},onStart(Wn){const Y=F.current;if(Y==null)return;const te=D.get(Y);if(!te)return;const{onDragStart:le}=se.current,Se={activatorEvent:Yn,active:{id:Y,data:te.data,rect:q}};ws.unstable_batchedUpdates(()=>{le==null||le(Se),O($i.Initializing),R({type:gr.DragStart,initialCoordinates:Wn,active:Y}),j({type:"onDragStart",event:Se}),M(Er.current),K(Yn)})},onMove(Wn){R({type:gr.DragMove,coordinates:Wn})},onEnd:da(gr.DragEnd),onCancel:da(gr.DragCancel)});Er.current=Rr;function da(Wn){return async function(){const{active:te,collisions:le,over:Se,scrollAdjustedTranslate:_e}=Fe.current;let He=null;if(te&&_e){const{cancelDrop:Be}=se.current;He={activatorEvent:Yn,active:te,collisions:le,delta:_e,over:Se},Wn===gr.DragEnd&&typeof Be=="function"&&await Promise.resolve(Be(He))&&(Wn=gr.DragCancel)}F.current=null,ws.unstable_batchedUpdates(()=>{R({type:Wn}),O($i.Uninitialized),di(null),M(null),K(null),Er.current=null;const Be=Wn===gr.DragEnd?"onDragEnd":"onDragCancel";if(He){const ze=se.current[Be];ze==null||ze(He),j({type:Be,event:He})}})}}},[D]),Al=h.useCallback((In,_n)=>(tr,wr)=>{const cr=tr.nativeEvent,Yn=D.get(wr);if(F.current!==null||!Yn||cr.dndKit||cr.defaultPrevented)return;const Rr={active:Yn};In(tr,_n.options,Rr)===!0&&(cr.dndKit={capturedBy:_n.sensor},F.current=wr,Fn(tr,_n))},[D,Fn]),Fs=qie(g,Al);ele(g),co(()=>{Ee&&A===$i.Initializing&&O($i.Initialized)},[Ee,A]),h.useEffect(()=>{const{onDragMove:In}=se.current,{active:_n,activatorEvent:tr,collisions:wr,over:cr}=Fe.current;if(!_n||!tr)return;const Yn={active:_n,activatorEvent:tr,collisions:wr,delta:{x:it.x,y:it.y},over:cr};ws.unstable_batchedUpdates(()=>{In==null||In(Yn),j({type:"onDragMove",event:Yn})})},[it.x,it.y]),h.useEffect(()=>{const{active:In,activatorEvent:_n,collisions:tr,droppableContainers:wr,scrollAdjustedTranslate:cr}=Fe.current;if(!In||F.current==null||!_n||!cr)return;const{onDragOver:Yn}=se.current,Rr=wr.get(Ka),da=Rr&&Rr.rect.current?{id:Rr.id,rect:Rr.rect.current,data:Rr.data,disabled:Rr.disabled}:null,Wn={active:In,activatorEvent:_n,collisions:tr,delta:{x:cr.x,y:cr.y},over:da};ws.unstable_batchedUpdates(()=>{di(da),Yn==null||Yn(Wn),j({type:"onDragOver",event:Wn})})},[Ka]),co(()=>{Fe.current={activatorEvent:V,active:Z,activeNode:ue,collisionRect:lt,collisions:Dn,droppableRects:$,draggableNodes:D,draggingNode:Vt,draggingNodeRect:xn,droppableContainers:H,over:On,scrollableAncestors:G,scrollAdjustedTranslate:it},q.current={initial:xn,translated:lt}},[Z,ue,Dn,lt,D,Vt,xn,$,H,On,G,it]),Vie({...he,delta:L,draggingRect:lt,pointerCoordinates:Ae,scrollableAncestors:G,scrollableAncestorRects:ee});const fi=h.useMemo(()=>({active:Z,activeNode:ue,activeNodeRect:Ee,activatorEvent:V,collisions:Dn,containerNodeRect:Me,dragOverlay:ut,draggableNodes:D,droppableContainers:H,droppableRects:$,over:On,measureDroppableContainers:Q,scrollableAncestors:G,scrollableAncestorRects:ee,measuringConfiguration:U,measuringScheduled:ne,windowRect:Pe}),[Z,ue,Ee,V,Dn,Me,ut,D,H,$,On,Q,G,ee,U,ne,Pe]),yo=h.useMemo(()=>({activatorEvent:V,activators:Fs,active:Z,activeNodeRect:Ee,ariaDescribedById:{draggable:ve},dispatch:R,draggableNodes:D,over:On,measureDroppableContainers:Q}),[V,Fs,Z,Ee,R,ve,D,On,Q]);return be.createElement(cI.Provider,{value:_},be.createElement($y.Provider,{value:yo},be.createElement(SI.Provider,{value:fi},be.createElement(CI.Provider,{value:Un},m)),be.createElement(dle,{disabled:(u==null?void 0:u.restoreFocus)===!1})),be.createElement(fie,{...u,hiddenTextDescribedById:ve}));function zs(){const In=(z==null?void 0:z.autoScrollEnabled)===!1,_n=typeof f=="object"?f.enabled===!1:f===!1,tr=I&&!In&&!_n;return typeof f=="object"?{...f,enabled:tr}:{enabled:tr}}}),ple=h.createContext(null),J_="button",gle="Draggable";function yle(e){let{id:t,data:n,disabled:r=!1,attributes:s}=e;const i=Fh(gle),{activators:c,activatorEvent:u,active:f,activeNodeRect:m,ariaDescribedById:g,draggableNodes:y,over:x}=h.useContext($y),{role:v=J_,roleDescription:S="draggable",tabIndex:C=0}=s??{},E=(f==null?void 0:f.id)===t,R=h.useContext(E?CI:ple),[j,_]=_g(),[A,O]=_g(),I=tle(c,t),T=Jf(n);co(()=>(y.set(t,{id:t,key:i,node:j,activatorNode:A,data:T}),()=>{const L=y.get(t);L&&L.key===i&&y.delete(t)}),[y,t]);const D=h.useMemo(()=>({role:v,tabIndex:C,"aria-disabled":r,"aria-pressed":E&&v===J_?!0:void 0,"aria-roledescription":S,"aria-describedby":g.draggable}),[r,v,C,E,S,g.draggable]);return{active:f,activatorEvent:u,activeNodeRect:m,attributes:D,isDragging:E,listeners:r?void 0:I,node:j,over:x,setNodeRef:_,setActivatorNodeRef:O,transform:R}}function xle(){return h.useContext(SI)}const vle="Droppable",ble={timeout:25};function Sle(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:s}=e;const i=Fh(vle),{active:c,dispatch:u,over:f,measureDroppableContainers:m}=h.useContext($y),g=h.useRef({disabled:n}),y=h.useRef(!1),x=h.useRef(null),v=h.useRef(null),{disabled:S,updateMeasurementsFor:C,timeout:E}={...ble,...s},R=Jf(C??r),j=h.useCallback(()=>{if(!y.current){y.current=!0;return}v.current!=null&&clearTimeout(v.current),v.current=setTimeout(()=>{m(Array.isArray(R.current)?R.current:[R.current]),v.current=null},E)},[E]),_=Vy({callback:j,disabled:S||!c}),A=h.useCallback((D,L)=>{_&&(L&&(_.unobserve(L),y.current=!1),D&&_.observe(D))},[_]),[O,I]=_g(A),T=Jf(t);return h.useEffect(()=>{!_||!O.current||(_.disconnect(),y.current=!1,_.observe(O.current))},[O,_]),h.useEffect(()=>(u({type:gr.RegisterDroppable,element:{id:r,key:i,disabled:n,node:O,rect:x,data:T}}),()=>u({type:gr.UnregisterDroppable,key:i,id:r})),[r]),h.useEffect(()=>{n!==g.current.disabled&&(u({type:gr.SetDroppableDisabled,id:r,key:i,disabled:n}),g.current.disabled=n)},[r,i,n,u]),{active:c,rect:x,isOver:(f==null?void 0:f.id)===r,node:O,over:f,setNodeRef:I}}function EI(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function Cle(e,t){return e.reduce((n,r,s)=>{const i=t.get(r);return i&&(n[s]=i),n},Array(e.length))}function Rp(e){return e!==null&&e>=0}function Ele(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 wle(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const wI=e=>{let{rects:t,activeIndex:n,overIndex:r,index:s}=e;const i=EI(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}},jp={scaleX:1,scaleY:1},e2=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,...jp}:null}const f=Rle(i,s,n);return s>n&&s<=c?{x:0,y:-u.height-f,...jp}:s<n&&s>=c?{x:0,y:u.height+f,...jp}:{x:0,y:0,...jp}};function Rle(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 RI="Sortable",jI=be.createContext({activeIndex:-1,containerId:RI,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:wI,disabled:{draggable:!1,droppable:!1}});function t2(e){let{children:t,id:n,items:r,strategy:s=wI,disabled:i=!1}=e;const{active:c,dragOverlay:u,droppableRects:f,over:m,measureDroppableContainers:g}=xle(),y=Fh(RI,n),x=u.rect!==null,v=h.useMemo(()=>r.map(I=>typeof I=="object"&&"id"in I?I.id:I),[r]),S=c!=null,C=c?v.indexOf(c.id):-1,E=m?v.indexOf(m.id):-1,R=h.useRef(v),j=!Ele(v,R.current),_=E!==-1&&C===-1||j,A=wle(i);co(()=>{j&&S&&g(v)},[j,v,S,g]),h.useEffect(()=>{R.current=v},[v]);const O=h.useMemo(()=>({activeIndex:C,containerId:y,disabled:A,disableTransforms:_,items:v,overIndex:E,useDragOverlay:x,sortedRects:Cle(v,f),strategy:s}),[C,y,A.draggable,A.droppable,_,v,E,f,x,s]);return be.createElement(jI.Provider,{value:O},t)}const jle=e=>{let{id:t,items:n,activeIndex:r,overIndex:s}=e;return EI(n,r,s).indexOf(t)},Tle=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},_le={duration:200,easing:"ease"},TI="transform",Nle=eh.Transition.toString({property:TI,duration:0,easing:"linear"}),Ale={roleDescription:"sortable"};function Dle(e){let{disabled:t,index:n,node:r,rect:s}=e;const[i,c]=h.useState(null),u=h.useRef(n);return co(()=>{if(!t&&n!==u.current&&r.current){const f=s.current;if(f){const m=yd(r.current,{ignoreTransform:!0}),g={x:f.left-m.left,y:f.top-m.top,scaleX:f.width/m.width,scaleY:f.height/m.height};(g.x||g.y)&&c(g)}}n!==u.current&&(u.current=n)},[t,n,r,s]),h.useEffect(()=>{i&&c(null)},[i]),i}function Ole(e){let{animateLayoutChanges:t=Tle,attributes:n,disabled:r,data:s,getNewIndex:i=jle,id:c,strategy:u,resizeObserverConfig:f,transition:m=_le}=e;const{items:g,containerId:y,activeIndex:x,disabled:v,disableTransforms:S,sortedRects:C,overIndex:E,useDragOverlay:R,strategy:j}=h.useContext(jI),_=Ile(r,v),A=g.indexOf(c),O=h.useMemo(()=>({sortable:{containerId:y,index:A,items:g},...s}),[y,s,A,g]),I=h.useMemo(()=>g.slice(g.indexOf(c)),[g,c]),{rect:T,node:D,isOver:L,setNodeRef:H}=Sle({id:c,data:O,disabled:_.droppable,resizeObserverConfig:{updateMeasurementsFor:I,...f}}),{active:B,activatorEvent:q,activeNodeRect:Z,attributes:F,setNodeRef:z,listeners:M,isDragging:V,over:K,setActivatorNodeRef:se,transform:ve}=yle({id:c,data:O,attributes:{...Ale,...n},disabled:_.draggable}),P=Joe(H,z),U=!!B,$=U&&!S&&Rp(x)&&Rp(E),Q=!R&&V,ne=Q&&$?ve:null,J=$?ne??(u??j)({rects:C,activeNodeRect:Z,activeIndex:x,overIndex:E,index:A}):null,he=Rp(x)&&Rp(E)?i({id:c,items:g,activeIndex:x,overIndex:E}):A,ge=B==null?void 0:B.id,Ee=h.useRef({activeId:ge,items:g,newIndex:he,containerId:y}),Me=g!==Ee.current.items,Fe=t({active:B,containerId:y,isDragging:V,isSorting:U,id:c,index:A,items:g,newIndex:Ee.current.newIndex,previousItems:Ee.current.items,previousContainerId:Ee.current.containerId,transition:m,wasDragging:Ee.current.activeId!=null}),nt=Dle({disabled:!Fe,index:A,node:D,rect:T});return h.useEffect(()=>{U&&Ee.current.newIndex!==he&&(Ee.current.newIndex=he),y!==Ee.current.containerId&&(Ee.current.containerId=y),g!==Ee.current.items&&(Ee.current.items=g)},[U,he,y,g]),h.useEffect(()=>{if(ge===Ee.current.activeId)return;if(ge&&!Ee.current.activeId){Ee.current.activeId=ge;return}const Vt=setTimeout(()=>{Ee.current.activeId=ge},50);return()=>clearTimeout(Vt)},[ge]),{active:B,activeIndex:x,attributes:F,data:O,rect:T,index:A,newIndex:he,items:g,isOver:L,isSorting:U,isDragging:V,listeners:M,node:D,overIndex:E,over:K,setNodeRef:P,setActivatorNodeRef:se,setDroppableNodeRef:H,setDraggableNodeRef:z,transform:nt??J,transition:ut()};function ut(){if(nt||Me&&Ee.current.newIndex===A)return Nle;if(!(Q&&!qC(q)||!m)&&(U||Fe))return eh.Transition.toString({...m,property:TI})}}function Ile(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}}nn.Down,nn.Right,nn.Up,nn.Left;function Fu({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),[g,y]=h.useState(e),x=h.useRef(null),v=j=>{y(j.target.value)},S=()=>{n&&g!==e&&n(g.trim()),m(!1)},C=()=>{y(e),m(!1)},E=j=>{j.key==="Enter"&&!j.shiftKey?(r===1||j.ctrlKey)&&(j.preventDefault(),S()):j.key==="Escape"&&(j.preventDefault(),C())},R=j=>{m(j),j?(y(e),setTimeout(()=>{x.current&&x.current.focus()},0)):C()};return a.jsxs(DC,{open:f,onOpenChange:R,children:[a.jsx(OC,{asChild:!0,children:a.jsx("div",{className:re("cursor-edit w-full min-w-[100px]",!e&&"text-gray-400",s&&"font-medium",i),children:e||t})}),a.jsxs(IC,{className:"w-auto max-w-[600px] min-w-[300px] p-2",align:"start",children:[a.jsx(po,{ref:x,value:g,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(Ce,{variant:"outline",size:"sm",onClick:C,className:"h-7 cursor-pointer px-2 text-xs",children:u}),a.jsx(Ce,{size:"sm",onClick:S,className:"h-7 cursor-pointer px-2 text-xs",children:c})]})]})]})}function Mle({isAllExpanded:e,onToggle:t}){return a.jsx(Ce,{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(W7,{className:"h-4 w-4"}):a.jsx(Gb,{className:"h-4 w-4"})})}function kle({isExpanded:e,onToggle:t,ariaLabel:n}){return a.jsx(Ce,{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(fo,{className:"h-4 w-4"}):a.jsx(Ra,{className:"h-4 w-4"})})}function Lle({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(rA,{className:"h-4 w-4 text-gray-400"})})}function n2({id:e,children:t}){const{attributes:n,listeners:r,setNodeRef:s,transform:i,transition:c,isDragging:u}=Ole({id:e}),f={transform:eh.Transform.toString(i),transition:c,opacity:u?.75:1},m=h.Children.toArray(t),g=[a.jsx(Mr,{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(Lle,{...n,...r})},"drag-handle-cell"),...m.slice(1)];return a.jsx(Tn,{ref:s,style:f,className:"group",children:g})}function _I({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(Lr,{children:[a.jsx(Pr,{asChild:!0,children:a.jsx(Ce,{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(Is,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsxs(Ur,{align:"end",children:[u&&a.jsxs(Ot,{className:"cursor-pointer",onClick:()=>{n(e.index)},children:[a.jsx(ua,{className:"mr-2 h-4 w-4"}),"Add nested field"]}),m&&a.jsx(wa,{}),f&&a.jsxs(Ot,{onClick:()=>{i(!0)},children:[a.jsx(us,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),a.jsx("span",{className:"text-red-600",children:"Delete field"})]})]})]}),a.jsx(yr,{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 Ple({mode:e,onModeChange:t}){const n=Object.values(Wf),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(Ln,{value:s,children:s},s))})]})}var Gy="Checkbox",[Ule]=xr(Gy),[Fle,r2]=Ule(Gy);function zle(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:s,disabled:i,form:c,name:u,onCheckedChange:f,required:m,value:g="on",internal_do_not_use_render:y}=e,[x,v]=aa({prop:n,defaultProp:s??!1,onChange:f,caller:Gy}),[S,C]=h.useState(null),[E,R]=h.useState(null),j=h.useRef(!1),_=S?!!c||!!S.closest("form"):!0,A={checked:x,disabled:i,setChecked:v,control:S,setControl:C,name:u,form:c,value:g,hasConsumerStoppedPropagationRef:j,required:m,defaultChecked:sl(s)?!1:s,isFormControl:_,bubbleInput:E,setBubbleInput:R};return a.jsx(Fle,{scope:t,...A,children:Hle(y)?y(A):r})}var NI="CheckboxTrigger",AI=h.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},s)=>{const{control:i,value:c,disabled:u,checked:f,required:m,setControl:g,setChecked:y,hasConsumerStoppedPropagationRef:x,isFormControl:v,bubbleInput:S}=r2(NI,e),C=ht(s,g),E=h.useRef(f);return h.useEffect(()=>{const R=i==null?void 0:i.form;if(R){const j=()=>y(E.current);return R.addEventListener("reset",j),()=>R.removeEventListener("reset",j)}},[i,y]),a.jsx(Xe.button,{type:"button",role:"checkbox","aria-checked":sl(f)?"mixed":f,"aria-required":m,"data-state":LI(f),"data-disabled":u?"":void 0,disabled:u,value:c,...r,ref:C,onKeyDown:Oe(t,R=>{R.key==="Enter"&&R.preventDefault()}),onClick:Oe(n,R=>{y(j=>sl(j)?!0:!j),S&&v&&(x.current=R.isPropagationStopped(),x.current||R.stopPropagation())})})});AI.displayName=NI;var DI=h.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:s,defaultChecked:i,required:c,disabled:u,value:f,onCheckedChange:m,form:g,...y}=e;return a.jsx(zle,{__scopeCheckbox:n,checked:s,defaultChecked:i,disabled:u,required:c,onCheckedChange:m,name:r,form:g,value:f,internal_do_not_use_render:({isFormControl:x})=>a.jsxs(a.Fragment,{children:[a.jsx(AI,{...y,ref:t,__scopeCheckbox:n}),x&&a.jsx(kI,{__scopeCheckbox:n})]})})});DI.displayName=Gy;var OI="CheckboxIndicator",II=h.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...s}=e,i=r2(OI,n);return a.jsx(kr,{present:r||sl(i.checked)||i.checked===!0,children:a.jsx(Xe.span,{"data-state":LI(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:t,style:{pointerEvents:"none",...e.style}})})});II.displayName=OI;var MI="CheckboxBubbleInput",kI=h.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:s,checked:i,defaultChecked:c,required:u,disabled:f,name:m,value:g,form:y,bubbleInput:x,setBubbleInput:v}=r2(MI,e),S=ht(n,v),C=dC(i),E=oS(r);h.useEffect(()=>{const j=x;if(!j)return;const _=window.HTMLInputElement.prototype,O=Object.getOwnPropertyDescriptor(_,"checked").set,I=!s.current;if(C!==i&&O){const T=new Event("click",{bubbles:I});j.indeterminate=sl(i),O.call(j,sl(i)?!1:i),j.dispatchEvent(T)}},[x,C,i,s]);const R=h.useRef(sl(i)?!1:i);return a.jsx(Xe.input,{type:"checkbox","aria-hidden":!0,defaultChecked:c??R.current,required:u,disabled:f,name:m,value:g,form:y,...t,tabIndex:-1,ref:S,style:{...t.style,...E,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});kI.displayName=MI;function Hle(e){return typeof e=="function"}function sl(e){return e==="indeterminate"}function LI(e){return sl(e)?"indeterminate":e?"checked":"unchecked"}function Vle({className:e,...t}){return a.jsx(DI,{"data-slot":"checkbox",className:re("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(II,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:a.jsx(ra,{className:"size-3.5"})})})}function PI({isPrimaryKey:e,onPrimaryKeyChange:t}){const n=!!e,r=s=>{t&&t(s)};return a.jsx(Vle,{className:"cursor-pointer",checked:n,onCheckedChange:r,"aria-label":"Primary Key"})}const eN={[$a.CONNECTED]:{icon:Vg,color:"text-green-500",label:"Connected",description:"Field is connected to the data source"},[$a.CONNECTED_WITH_DEFINITION_MISMATCH]:{icon:Gg,color:"text-orange-500",label:"Connected with issues",description:"Field is connected but has definition mismatches"},[$a.DISCONNECTED]:{icon:cU,color:"text-red-500",label:"Disconnected",description:"Field is not connected to the data source"}};function UI({status:e}){if(!(e in eN))return null;const t=eN[e],{icon:n,color:r,label:s,description:i}=t,c=`schema-field-status-tooltip-${e}`;return a.jsx(os,{children:a.jsxs(Nt,{children:[a.jsx(At,{asChild:!0,children:a.jsx(n,{className:re("h-5 w-5",r),role:"img","aria-label":s,"aria-describedby":c,tabIndex:0})}),a.jsxs(Dt,{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 a2({type:e,storageType:t,onTypeChange:n}){const r=t===Re.GOOGLE_BIGQUERY?Object.values(Jn):t===Re.AWS_ATHENA?Object.values(tC):Object.values(nC),s=i=>{n&&(t===Re.GOOGLE_BIGQUERY||Re.AWS_ATHENA,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(Ln,{value:i,children:i},i))})]})}function $le({table:e}){return a.jsx("div",{className:"px-3 text-right",children:a.jsxs(Lr,{children:[a.jsx(Pr,{asChild:!0,children:a.jsx(Ce,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:a.jsx(Is,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsx(Ur,{align:"end",children:e.getAllColumns().filter(t=>t.getCanHide()&&t.id!=="actions").map(t=>a.jsx(Ot,{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(ra,{className:"size-3.5 text-white"})})}),a.jsx("span",{children:t.columnDef.meta?t.columnDef.meta.title??t.id:t.id})]})},t.id))})]})})}function Gle({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 g=h.useCallback(y=>{const x=y.target.value;f(x);const v=setTimeout(()=>{r(x)},s);return()=>{clearTimeout(v)}},[r,s]);return a.jsxs("div",{className:"dm-card-toolbar-search",children:[a.jsx(vc,{className:"dm-card-toolbar-search-icon","aria-hidden":"true"}),a.jsx(Tt,{id:e,placeholder:t,value:u,onChange:g,className:i??"dm-card-toolbar-search-input","aria-label":c??t})]})}function Ble({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(Gle,{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(UI,{status:c}),a.jsx("span",{className:"text-sm font-medium text-gray-500",children:u})]},c))}),a.jsxs(Ce,{variant:"outline",className:"dm-card-table-add-field-btn cursor-pointer",onClick:t,disabled:i,"aria-label":"Add new field",children:[a.jsx(ua,{className:"h-4 w-4","aria-hidden":"true"}),"Add Field"]})]})]})}const qle={dragHandle:{left:0,zIndex:1},status:{left:20,zIndex:1},name:{left:56,zIndex:1},actions:{right:0,zIndex:1}};function tN(e,t={}){const n=qle[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 Kle({fields:e,columns:t,onAddRow:n,fieldsForStatusCount:r,onSearchChange:s,dragContext:i,dragContextProps:c,rowComponent:u=Tn,getRowId:f}){const{isSchemaActualizationLoading:m}=qa(),g=t,y=i,x=u,{columnVisibility:v,setColumnVisibility:S}=Zoe(g),C=vl({data:e,columns:g,getCoreRowModel:xl(),getFilteredRowModel:ud(),columnResizeMode:"onChange",enableColumnResizing:!0,state:{columnVisibility:v},onColumnVisibilityChange:S,enableGlobalFilter:!0,globalFilterFn:Yoe,defaultColumn:{enableResizing:!0,size:0,minSize:0}}),{value:E,onChange:R,searchValue:j}=Woe(C),_=h.useRef("");h.useEffect(()=>{s&&j!==_.current&&(_.current=j,s(j))},[j,s]);const A=h.useMemo(()=>{const T={[$a.CONNECTED]:0,[$a.CONNECTED_WITH_DEFINITION_MISMATCH]:0,[$a.DISCONNECTED]:0};return(r??e).forEach(L=>{L.status in T&&T[L.status]++}),T},[e,r]);return a.jsxs("div",{className:"space-y-4",children:[n&&a.jsx(Ble,{table:C,searchInputId:"schema-fields-search-input",onAddField:n,filterValue:E,onFilterChange:R,statusCounts:A,disabled:m}),a.jsx("div",{className:"dm-card-table-wrap mb-0",children:a.jsxs(bl,{id:"schema-fields-table",className:"w-full table-auto",role:"table",children:[a.jsx(Sl,{className:"dm-card-table-header",children:C.getHeaderGroups().map(T=>a.jsx(Tn,{className:"dm-card-table-header-row",children:T.headers.map(D=>a.jsx(El,{className:"bg-secondary dark:bg-background",style:tN(D.column.id,{width:D.getSize()!==0?D.getSize():void 0,whiteSpace:"nowrap",cursor:"default"}),children:D.isPlaceholder?null:typeof D.column.columnDef.header=="function"?D.column.columnDef.header(D.getContext()):D.column.columnDef.header},D.id))},T.id))}),a.jsx(Cl,{className:"dm-card-table-body",children:C.getRowModel().rows.length?a.jsx(y,{...c,children:C.getRowModel().rows.map(T=>a.jsx(x,{id:f?f(T):T.index,row:T,children:T.getVisibleCells().map(D=>a.jsx(Mr,{className:"bg-background dark:bg-muted",style:tN(D.column.id,{width:D.column.getSize()!==0?D.column.getSize():void 0,whiteSpace:"pre",paddingTop:8,paddingBottom:8}),children:D.column.columnDef.cell&&typeof D.column.columnDef.cell=="function"?D.column.columnDef.cell(D.getContext()):null},D.id))},T.id))}):a.jsx(Tn,{children:a.jsx(Mr,{colSpan:g.length,className:"text-center text-gray-400",style:{whiteSpace:"nowrap"},children:"Output schema has no configured fields"})})})]})}),n&&a.jsxs(Ce,{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(ua,{className:"h-4 w-4","aria-hidden":"true"}),"Add Field"]})]})}function s2({fields:e,onFieldsChange:t,onAddRow:n,createNewField:r,renderTypeCell:s,additionalColumns:i=[],fieldsForStatusCount:c,onSearchChange:u,nameColumnHeader:f,nameColumnCell:m,primaryKeyColumnCell:g,aliasColumnCell:y,descriptionColumnCell:x,actionsColumnCell:v,dragContext:S,dragContextProps:C,rowComponent:E,getRowId:R}){const j=h.useCallback((T,D)=>{if(t){const L=[...e];L[T]={...L[T],...D},t(L)}},[e,t]),_=h.useCallback(()=>{if(t){const T=r();t([...e,T])}},[e,t,r]),A=h.useCallback(T=>{if(t){const D=[...e];D.splice(T,1),t(D)}},[e,t]),O=h.useMemo(()=>[{id:"dragHandle",header:"",size:24,enableHiding:!1},{accessorKey:"status",header:"",size:36,cell:({row:T})=>a.jsx(UI,{status:T.getValue("status")}),enableHiding:!1},{accessorKey:"name",header:f??(()=>a.jsxs(Nt,{children:[a.jsx(At,{className:"cursor-default",children:"Name"}),a.jsx(Dt,{children:"Field name in the output schema"})]})),size:80,cell:({row:T})=>m?m({row:T,updateField:j}):a.jsx(Fu,{value:Boe(T.getValue("name")),onValueChange:D=>{j(T.index,{name:D})},placeholder:"Field name is required",isBold:!0}),enableHiding:!1},{accessorKey:"isPrimaryKey",header:()=>a.jsxs(Nt,{children:[a.jsx(At,{className:"cursor-default",children:"PK"}),a.jsx(Dt,{children:"Is field must be considered as a part of the output Primary Key"})]}),size:36,cell:({row:T})=>g?g({row:T,updateField:j}):a.jsx(PI,{isPrimaryKey:T.getValue("isPrimaryKey"),onPrimaryKeyChange:D=>{j(T.index,{isPrimaryKey:D})}}),enableHiding:!1},{accessorKey:"alias",header:()=>a.jsxs(Nt,{children:[a.jsx(At,{className:"cursor-default",children:"Alias"}),a.jsx(Dt,{children:"Alternative name for the field"})]}),size:80,cell:({row:T})=>y?y({row:T,updateField:j}):a.jsx(Fu,{value:T.getValue("alias"),onValueChange:D=>{j(T.index,{alias:D})},placeholder:"-"})},{accessorKey:"description",header:()=>a.jsxs(Nt,{children:[a.jsx(At,{className:"cursor-default",children:"Description"}),a.jsx(Dt,{children:"Detailed information about the field"})]}),cell:({row:T})=>x?x({row:T,updateField:j}):a.jsx(Fu,{value:T.getValue("description"),onValueChange:D=>{j(T.index,{description:D})},minRows:5,placeholder:"-"})},{id:"actions",header:({table:T})=>a.jsx($le,{table:T}),cell:({row:T,table:D})=>v?v({row:T,table:D}):a.jsx(_I,{row:T,onDeleteRow:t?A:void 0}),size:40,enableResizing:!1,enableHiding:!1}],[j,A,t,f,m,g,y,x,v]),I=h.useMemo(()=>{const D={accessorKey:"type",header:()=>a.jsxs(Nt,{children:[a.jsx(At,{className:"cursor-default pl-[12px]",children:"Type"}),a.jsx(Dt,{children:"Data type of the field"})]}),size:80,cell:H=>s({row:H.row,updateField:j}),enableHiding:!1},L=[...O];if(L.splice(3,0,D),i.length>0){const H=[...i];H.sort((B,q)=>{const Z=B.columnIndex??1/0,F=q.columnIndex??1/0;return Z-F}),H.forEach(B=>{if(B.columnIndex!==void 0){const q=Math.min(Math.max(0,B.columnIndex),L.length);L.splice(q,0,B)}else L.splice(L.length-1,0,B)})}return L},[O,s,j,i]);return a.jsx(Kle,{fields:e,columns:I,onFieldsChange:t,onAddRow:n??(t?_:void 0),fieldsForStatusCount:c,onSearchChange:u,dragContext:S,dragContextProps:C,rowComponent:E,getRowId:R})}function Zle({fields:e,onFieldsChange:t}){const{expandedRecords:n,hasRecordFields:r,toggleRecordExpansion:s,toggleAllRecords:i,flattenedFields:c,handleSearchChange:u,isRecordType:f,topLevelFields:m,allExpanded:g}=Qoe(e),{updateField:y,handleDeleteRow:x,handleAddNestedField:v,handleAddRow:S}=Xoe(e,c,t,B=>B),C=h.useCallback(()=>({name:"",type:Jn.STRING,mode:Wf.NULLABLE,isPrimaryKey:!1,status:$a.DISCONNECTED}),[]),E=h.useCallback(({row:B})=>a.jsx(a2,{type:B.getValue("type"),storageType:Re.GOOGLE_BIGQUERY,onTypeChange:q=>{y(B.index,{type:q})}}),[y]),R=h.useMemo(()=>[{accessorKey:"mode",header:()=>a.jsxs(Nt,{children:[a.jsx(At,{className:"cursor-default pl-[12px]",children:"Mode"}),a.jsx(Dt,{style:{whiteSpace:"pre"},children:`BigQuery Field mode:
|
|
798
|
-
NULLABLE - field can be NULL
|
|
799
|
-
REQUIRED - field cant be NULL
|
|
800
|
-
REPEATED - field is an Array of Type`})]}),size:80,cell:({row:B})=>a.jsx(Ple,{mode:B.getValue("mode"),onModeChange:q=>{y(B.index,{mode:q})}}),columnIndex:4}],[y]),j=h.useCallback(()=>a.jsxs("div",{className:"flex items-center",children:[r&&a.jsx(Mle,{isAllExpanded:g,onToggle:i}),a.jsxs(Nt,{children:[a.jsx(At,{className:"cursor-default",children:"Name"}),a.jsx(Dt,{children:"Field name in the output schema"})]})]}),[r,g,i]),_=h.useCallback(({row:B})=>{const q=c[B.index],F=(q.type===Jn.RECORD||q.type===Jn.STRUCT)&&q.fields&&q.fields.length>0,z=q.path??"",M=q.level??0,V=n.has(z);return a.jsxs("div",{className:"flex items-center",children:[M>0&&a.jsx("div",{style:{width:`${String(M*16-(F?4:0))}px`},className:"flex-shrink-0"}),F?a.jsx(kle,{isExpanded:V,onToggle:()=>{s(z)},ariaLabel:V?"Collapse nested fields":"Expand nested fields"}):r&&a.jsx("div",{className:"w-5"}),a.jsx(Fu,{value:B.getValue("name"),onValueChange:K=>{y(B.index,{name:K})},placeholder:"Field name is required",isBold:!0})]})},[c,n,r,s,y]),A=h.useCallback(({row:B})=>{const q=c[B.index],Z=q.type===Jn.RECORD||q.type===Jn.STRUCT;return(q.level??0)===0&&!Z?a.jsx(PI,{isPrimaryKey:B.getValue("isPrimaryKey"),onPrimaryKeyChange:z=>{y(B.index,{isPrimaryKey:z})}}):a.jsx("div",{})},[c,y]),O=h.useCallback(({row:B})=>a.jsx(Fu,{value:B.getValue("description"),onValueChange:q=>{y(B.index,{description:q})},minRows:5,placeholder:"-"}),[y]),I=h.useCallback(({row:B})=>a.jsx(Fu,{value:B.getValue("alias"),onValueChange:q=>{y(B.index,{alias:q})},placeholder:"-"}),[y]),T=h.useCallback(({row:B})=>a.jsx(_I,{row:B,onDeleteRow:t?x:void 0,onAddNestedField:t?v:void 0,isRecordType:f}),[t,x,v,f]),{handleDragEnd:D}=VC(e,t,c),L=h.useCallback(B=>{const q=c[B.index];return q.path??String(c.indexOf(q))},[c]),H=ZC(KC(zh,{activationConstraint:{distance:5}}));return a.jsx(JC,{sensors:H,collisionDetection:YC,onDragEnd:D,children:a.jsx(s2,{fields:c,onFieldsChange:t,onAddRow:S,createNewField:C,renderTypeCell:E,additionalColumns:R,fieldsForStatusCount:m,onSearchChange:u,nameColumnHeader:j,nameColumnCell:_,primaryKeyColumnCell:A,aliasColumnCell:I,descriptionColumnCell:O,actionsColumnCell:T,dragContext:t2,dragContextProps:{items:c.map(B=>B.path??String(c.indexOf(B))),strategy:e2},rowComponent:n2,getRowId:L})})}function Yle({fields:e,onFieldsChange:t}){const n=h.useCallback(()=>({name:"",type:tC.STRING,isPrimaryKey:!1,status:$a.DISCONNECTED}),[]),r=h.useCallback(({row:c,updateField:u})=>a.jsx(a2,{type:c.getValue("type"),storageType:Re.AWS_ATHENA,onTypeChange:f=>{u(c.index,{type:f})}}),[]),{handleDragEnd:s}=VC(e,t),i=ZC(KC(zh,{activationConstraint:{distance:5}}));return a.jsx(JC,{sensors:i,collisionDetection:YC,onDragEnd:s,children:a.jsx(s2,{fields:e,onFieldsChange:t,createNewField:n,renderTypeCell:r,dragContext:t2,dragContextProps:{items:e.map((c,u)=>u),strategy:e2},rowComponent:n2})})}function Wle({fields:e,onFieldsChange:t}){const n=h.useCallback(()=>({name:"",type:nC.VARCHAR,isPrimaryKey:!1,status:$a.DISCONNECTED}),[]),r=h.useCallback(({row:c,updateField:u})=>a.jsx(a2,{type:c.getValue("type"),storageType:Re.SNOWFLAKE,onTypeChange:f=>{u(c.index,{type:f})}}),[]),{handleDragEnd:s}=VC(e,t),i=ZC(KC(zh,{activationConstraint:{distance:5}}));return a.jsx(JC,{sensors:i,collisionDetection:YC,onDragEnd:s,children:a.jsx(s2,{fields:e,onFieldsChange:t,createNewField:n,renderTypeCell:r,dragContext:t2,dragContextProps:{items:e.map((c,u)=>u),strategy:e2},rowComponent:n2})})}function Qle({schema:e,storageType:t,onFieldsChange:n}){const r=h.useMemo(()=>{if(!e){const s=Goe(t);return n(s.fields),s}return e},[e,t,n]);return nI(r)?a.jsx(Zle,{fields:r.fields,onFieldsChange:n}):rI(r)?a.jsx(Yle,{fields:r.fields,onFieldsChange:n}):aI(r)?a.jsx(Wle,{fields:r.fields,onFieldsChange:n}):a.jsx("div",{className:"p-4 text-center",children:a.jsx("p",{children:"Unsupported schema type"})})}function Xle({definitionType:e}){const{dataMart:t,updateDataMartSchema:n,isLoading:r,error:s,runSchemaActualization:i,isSchemaActualizationLoading:c}=qa(),{id:u="",schema:f}=t??{},{schema:m,isDirty:g,updateSchema:y,resetSchema:x}=qoe(f),{operationStatus:v,startSaveOperation:S}=Koe(r,s);h.useEffect(()=>{v==="success"&&x()},[v,x]);const C=h.useCallback(A=>{y(A)},[y]),E=h.useCallback(()=>{u&&m&&(S(),n(u,m).then(()=>{i==null||i()}))},[u,m,S,n,i]),R=h.useCallback(()=>{i==null||i()},[i]),j=h.useCallback(()=>{x()},[x]),_=r||c;return t?a.jsxs("div",{className:"space-y-4",children:[a.jsx(Qle,{schema:m,storageType:t.storage.type,onFieldsChange:C}),a.jsxs("div",{className:"align-items-center mt-8 flex justify-between",children:[a.jsxs("div",{className:"flex space-x-4",children:[a.jsx(Ce,{variant:"default",onClick:E,disabled:!g||_,children:"Save"}),a.jsx(Ce,{type:"button",variant:"ghost",onClick:j,disabled:!g||_,children:"Discard"})]}),a.jsx(Ce,{type:"button",variant:"outline",onClick:R,disabled:!e||_,children:"Refresh schema"})]})]}):a.jsx("div",{children:"Error: Data mart not found"})}function Jle(){const e=kb(),{id:t,projectId:n}=e;return t?n?a.jsx("div",{className:"dm-page",children:a.jsx(NO,{children:a.jsx(kne,{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 ece({className:e,...t}){return a.jsx("div",{"data-slot":"card",className:re("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function tce({className:e,...t}){return a.jsx("div",{"data-slot":"card-header",className:re("@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 nce({className:e,...t}){return a.jsx("div",{"data-slot":"card-title",className:re("leading-none font-semibold",e),...t})}function rce({className:e,...t}){return a.jsx("div",{"data-slot":"card-description",className:re("text-muted-foreground text-sm",e),...t})}function ace({className:e,...t}){return a.jsx("div",{"data-slot":"card-content",className:re("px-6",e),...t})}function sce({className:e,...t}){return a.jsx("div",{"data-slot":"card-footer",className:re("flex items-center px-6 [.border-t]:pt-6",e),...t})}const o2=h.createContext({isCollapsed:!1,collapsible:!1,handleCollapse:()=>{throw new Error("CollapsibleCardContext: handleCollapse not implemented")}});function ro({icon:e,tooltip:t,subtitle:n,children:r}){const{isCollapsed:s}=h.useContext(o2);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(nce,{className:"text-md text-foreground leading-none font-medium",children:r})]}),n&&a.jsx(rce,{className:re("text-md text-muted-foreground/50",!s&&"hidden"),children:n}),t&&a.jsx(os,{children:a.jsxs(Nt,{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(Br,{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(Dt,{children:a.jsx("p",{children:t})})]})})]})}ro.displayName="CollapsibleCardHeaderTitle";function Hh({children:e,className:t}){const n=r=>{r.stopPropagation()};return a.jsx("div",{className:re("flex items-center gap-2 self-center",t),onClick:n,children:e})}Hh.displayName="CollapsibleCardHeaderActions";function ao({children:e}){const{collapsible:t,isCollapsed:n,handleCollapse:r}=h.useContext(o2);let s,i;return h.Children.forEach(e,c=>{if(h.isValidElement(c))switch(c.type){case ro:s=c;break;case Hh:i=c;break}}),a.jsxs(tce,{className:re("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:re("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:re("transform transition-transform duration-200",n?"rotate-0":"rotate-180"),children:a.jsx(fo,{className:"text-muted-foreground/75 dark:text-muted-foreground/50 h-4 w-4"})})})]})]})}ao.displayName="CollapsibleCardHeader";function so({children:e}){return a.jsx(ace,{className:"px-4 pt-1",children:e})}so.displayName="CollapsibleCardContent";function Yo({left:e,right:t}){return a.jsxs(sce,{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})]})}Yo.displayName="CollapsibleCardFooter";const nN="collapsed-card-";function ol({children:e,className:t,variant:n="default",collapsible:r=!1,defaultCollapsed:s=!1,onCollapsedChange:i,name:c}){const u=c?Xs.get(`${nN}${c}`,"boolean")??s:s,[f,m]=h.useState(u);h.useEffect(()=>{c&&Xs.set(`${nN}${c}`,f)},[f,c]);const g=()=>{const C=!f;m(C),i==null||i(C)};let y,x,v;h.Children.forEach(e,C=>{if(h.isValidElement(C))switch(C.type){case ao:y=C;break;case so:x=C;break;case Yo:v=C;break}});const S={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(o2.Provider,{value:{isCollapsed:f,collapsible:r,handleCollapse:g},children:a.jsxs(ece,{className:re(S[n],t),children:[y,a.jsx("div",{className:re("grid transition-all duration-200",f?"grid-rows-[0fr]":"grid-rows-[1fr]"),children:a.jsxs("div",{className:"overflow-hidden",children:[x,v]})})]})})}function oce(){const{dataMart:e,updateDataMartStorage:t}=Ps(),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(ol,{collapsible:!0,name:"data-storage",children:[a.jsx(ao,{children:a.jsx(ro,{icon:sc,tooltip:"Configure where your data will be stored",children:"Storage"})}),a.jsx(so,{children:(e==null?void 0:e.storage)&&a.jsx(ase,{dataStorage:e.storage,onDataStorageChange:t})}),a.jsx(Yo,{})]}),a.jsxs(ol,{collapsible:!0,name:"input-source",children:[a.jsx(ao,{children:a.jsx(ro,{icon:Bb,tooltip:"Configure how to extract data from your data warehouse",children:"Input Source"})}),a.jsx(so,{children:e&&a.jsx($oe,{definitionType:r,initialDefinitionType:n,setDefinitionType:s})}),a.jsx(Yo,{})]}),a.jsxs(ol,{collapsible:!0,name:"output-schema",children:[a.jsx(ao,{children:a.jsx(ro,{icon:sP,tooltip:"Configure your data mart output schema",children:"Output Schema"})}),a.jsx(so,{children:e&&a.jsx(Xle,{definitionType:r})}),a.jsx(Yo,{})]})]})}function ice({row:e,onDeleteSuccess:t,onEditReport:n}){const[r,s]=h.useState(!1),[i,c]=h.useState(!1),[u,f]=h.useState(!1),{deleteReport:m,fetchReportsByDataMartId:g,runReport:y}=Ls(),x=`actions-menu-${e.original.id}`,v=h.useCallback(async()=>{try{await m(e.original.id),await g(e.original.dataMart.id),t==null||t(),f(!1)}catch(R){console.error("Failed to delete Google Sheet:",R)}},[m,g,t,e.original.id,e.original.dataMart.id]),S=h.useCallback(()=>{n==null||n(e.original),c(!1)},[n,e.original]),C=h.useCallback(async()=>{try{s(!0),await y(e.original.id)}catch(R){console.error("Failed to run report:",R)}finally{s(!1)}},[y,e.original.id]),E=h.useCallback(()=>{f(!0),c(!1)},[]);return a.jsxs("div",{className:"text-right",onClick:R=>{R.stopPropagation()},children:[a.jsxs(Lr,{open:i,onOpenChange:c,children:[a.jsx(Pr,{asChild:!0,children:a.jsxs(Ce,{variant:"ghost",className:`dm-card-table-body-row-actionbtn opacity-0 transition-opacity ${i?"opacity-100":"group-hover:opacity-100"}`,"aria-label":`Actions for report: ${e.original.title}`,"aria-haspopup":"true","aria-expanded":i,"aria-controls":x,children:[a.jsx("span",{className:"sr-only",children:"Open menu"}),a.jsx(Is,{className:"dm-card-table-body-row-actionbtn-icon","aria-hidden":"true"})]})}),a.jsxs(Ur,{id:x,align:"end",role:"menu",children:[a.jsxs(Ot,{onClick:R=>{R.stopPropagation(),S()},role:"menuitem",children:[a.jsx(td,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),"Edit report"]}),wy(e.original.destinationConfig)&&a.jsxs(a.Fragment,{children:[a.jsx(wa,{}),a.jsxs(Ot,{onClick:R=>{R.stopPropagation(),C()},disabled:r,role:"menuitem","aria-label":r?"Running report...":`Run report: ${e.original.title}`,children:[a.jsx($g,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),r?"Running...":"Run report"]}),a.jsx(Ot,{asChild:!0,children:a.jsxs("a",{href:kS(e.original.destinationConfig.spreadsheetId,e.original.destinationConfig.sheetId),target:"_blank",rel:"noopener noreferrer",role:"menuitem",onClick:R=>{R.stopPropagation()},children:[a.jsx(CP,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),"Open document"]})})]}),a.jsx(wa,{}),a.jsxs(Ot,{onClick:R=>{R.stopPropagation(),E()},role:"menuitem","aria-label":`Delete report: ${e.original.title}`,children:[a.jsx(us,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),a.jsx("span",{className:"text-red-600",children:"Delete report"})]})]})]}),a.jsx(yr,{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 lce={[En.SUCCESS]:{icon:Vg,color:"text-green-500",label:"Success"},[En.ERROR]:{icon:Zp,color:"text-red-500",label:"Fail"},[En.RUNNING]:{icon:ed,color:"text-primary animate-spin",label:"In progress"},[En.CANCELLED]:{icon:Zp,color:"text-gray-500",label:"Cancelled"}};function FI({status:e,error:t}){if(!e)return null;const n=lce[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(os,{children:a.jsxs(Nt,{children:[a.jsx(At,{asChild:!0,children:a.jsx(r,{className:re("h-5 w-5",s),role:"img","aria-label":u(),"aria-describedby":c,tabIndex:0})}),a.jsxs(Dt,{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 nl=(e=>(e.TITLE="title",e.LAST_RUN_DATE="lastRunDate",e.LAST_RUN_STATUS="lastRunStatus",e))(nl||{});const cce={[nl.TITLE]:"Title",[nl.LAST_RUN_DATE]:"Last Run Date",[nl.LAST_RUN_STATUS]:"Last Run Status"},uce=({onDeleteSuccess:e,onEditReport:t}={})=>[{accessorKey:nl.TITLE,header:({column:n})=>a.jsx(pr,{column:n,children:cce[nl.TITLE]}),cell:({row:n})=>n.original.title,enableColumnFilter:!0,size:50},{accessorKey:nl.LAST_RUN_DATE,header:({column:n})=>a.jsx(pr,{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(ti,{date:new Date(r)}):"Never run"})},size:25},{accessorKey:nl.LAST_RUN_STATUS,header:({column:n})=>a.jsx(pr,{column:n,children:"Last Run Status"}),cell:({row:n})=>n.original.lastRunStatus?a.jsx(FI,{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(dd,{table:n}),cell:({row:n})=>a.jsx(ice,{row:n,onDeleteSuccess:e,onEditReport:t}),size:80}];function dce({destination:e,onEditReport:t}){const{reports:n,setPollingConfig:r}=Ls(),s=h.useMemo(()=>n.filter(x=>x.dataDestination.type===De.GOOGLE_SHEETS&&x.dataDestination.id===e.id),[n,e.id]);h.useEffect(()=>{r({initialPollingIntervalMs:2e3,initialPollCount:3,regularPollingIntervalMs:5e3})},[r]);const i=h.useMemo(()=>uce({onDeleteSuccess:()=>{},onEditReport:t}),[t]),{sorting:c,setSorting:u,columnVisibility:f,setColumnVisibility:m}=Rc({columns:i,storageKeyPrefix:`data-mart-google-sheets-reports-${e.id}`,defaultSortingColumn:"lastRunDate"}),g=vl({data:s,columns:i,getCoreRowModel:xl(),onSortingChange:u,getSortedRowModel:wc(),state:{sorting:c,columnVisibility:f},onColumnVisibilityChange:m}),y=`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(bl,{id:y,className:"dm-card-table",role:"table","aria-label":`${e.title} reports`,children:[a.jsx(Sl,{className:"dm-card-table-header",children:g.getHeaderGroups().map(x=>a.jsx(Tn,{className:"dm-card-table-header-row",children:x.headers.map(v=>a.jsx(El,{style:v.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(v.column.getSize())}%`},scope:"col",children:v.isPlaceholder?null:typeof v.column.columnDef.header=="function"?v.column.columnDef.header(v.getContext()):v.column.columnDef.header},v.id))},x.id))}),a.jsx(Cl,{className:"dm-card-table-body",children:g.getRowModel().rows.length?g.getRowModel().rows.map((x,v)=>a.jsx(Tn,{onClick:()=>{const S=n.find(C=>C.id===x.original.id);S&&t(S)},className:"dm-card-table-body-row group",role:"row","aria-rowindex":v+1,children:x.getVisibleCells().map((S,C)=>a.jsx(Mr,{className:`px-6 whitespace-normal ${S.column.id==="actions"?"actions-cell":""}`,style:S.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(S.column.getSize())}%`},role:"cell","aria-colindex":C+1,children:typeof S.column.columnDef.cell=="function"?S.column.columnDef.cell(S.getContext()):S.column.columnDef.cell},S.id))},x.id)):a.jsx(Tn,{children:a.jsx(Mr,{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 fce({row:e,onDeleteSuccess:t,onEditReport:n}){const[r,s]=h.useState(!1),[i,c]=h.useState(!1),[u,f]=h.useState(!1),{deleteReport:m,fetchReportsByDataMartId:g,runReport:y}=Ls(),x=`actions-menu-${e.original.id}`,v=h.useCallback(async()=>{try{await m(e.original.id),await g(e.original.dataMart.id),t==null||t(),f(!1)}catch(R){console.error("Failed to delete report:",R)}},[m,g,t,e.original.id,e.original.dataMart.id]),S=h.useCallback(()=>{n==null||n(e.original),c(!1)},[n,e.original]),C=h.useCallback(async()=>{try{s(!0),await y(e.original.id)}catch(R){console.error("Failed to run report:",R)}finally{s(!1)}},[y,e.original.id]),E=h.useCallback(()=>{f(!0),c(!1)},[]);return a.jsxs("div",{className:"text-right",onClick:R=>{R.stopPropagation()},children:[a.jsxs(Lr,{open:i,onOpenChange:c,children:[a.jsx(Pr,{asChild:!0,children:a.jsxs(Ce,{variant:"ghost",className:`dm-card-table-body-row-actionbtn opacity-0 transition-opacity ${i?"opacity-100":"group-hover:opacity-100"}`,"aria-label":`Actions for report: ${e.original.title}`,"aria-haspopup":"true","aria-expanded":i,"aria-controls":x,children:[a.jsx("span",{className:"sr-only",children:"Open menu"}),a.jsx(Is,{className:"dm-card-table-body-row-actionbtn-icon","aria-hidden":"true"})]})}),a.jsxs(Ur,{id:x,align:"end",role:"menu",children:[a.jsxs(Ot,{onClick:R=>{R.stopPropagation(),S()},role:"menuitem",children:[a.jsx(td,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),"Edit report"]}),a.jsx(wa,{}),a.jsxs(Ot,{onClick:R=>{R.stopPropagation(),C()},disabled:r,role:"menuitem","aria-label":r?"Running report...":`Run report: ${e.original.title}`,children:[a.jsx($g,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),r?"Running...":"Run report"]}),a.jsx(wa,{}),a.jsxs(Ot,{onClick:R=>{R.stopPropagation(),E()},role:"menuitem","aria-label":`Delete report: ${e.original.title}`,children:[a.jsx(us,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),a.jsx("span",{className:"text-red-600",children:"Delete report"})]})]})]}),a.jsx(yr,{open:u,onOpenChange:f,title:"Delete Report",description:`Are you sure you want to delete "${e.original.title}"? This action cannot be undone.`,confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:()=>{v()},variant:"destructive"})]})}function a1({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(Ce,{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(Hu,{className:"text-foreground h-4 w-4"}),r==="desc"&&a.jsx(fo,{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(Hu,{className:"text-muted-foreground h-4 w-4"})})]})]})}var rl=(e=>(e.TITLE="title",e.LAST_RUN_DATE="lastRunDate",e.LAST_RUN_STATUS="lastRunStatus",e))(rl||{});const zI={[rl.TITLE]:"Title",[rl.LAST_RUN_DATE]:"Last Run Date",[rl.LAST_RUN_STATUS]:"Last Run Status"};function hce({table:e}){return a.jsx("div",{className:"px-4 text-right",children:a.jsxs(Lr,{children:[a.jsx(Pr,{asChild:!0,children:a.jsx(Ce,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:a.jsx(Is,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsx(Ur,{align:"end",children:e.getAllColumns().filter(t=>t.getCanHide()&&t.id!=="actions").map(t=>{const n=zI[t.id]||t.id;return a.jsx(Ot,{className:"capitalize",children:a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("button",{type:"button",role:"checkbox","aria-checked":t.getIsVisible(),"data-state":t.getIsVisible()?"checked":"unchecked","aria-label":`Toggle column ${t.id}`,className:"peer border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border bg-white shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-white/8",onClick:()=>{t.toggleVisibility(!t.getIsVisible())},children:t.getIsVisible()&&a.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:a.jsx(ra,{className:"size-3.5 text-white"})})}),a.jsx("span",{children:n})]})},t.id)})})]})})}const mce=({onDeleteSuccess:e,onEditReport:t}={})=>[{accessorKey:rl.TITLE,header:({column:n})=>a.jsx(a1,{column:n,children:zI[rl.TITLE]}),cell:({row:n})=>n.original.title,enableColumnFilter:!0,size:50},{accessorKey:rl.LAST_RUN_DATE,header:({column:n})=>a.jsx(a1,{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(ti,{date:new Date(r)}):"Never run"})},size:25},{accessorKey:rl.LAST_RUN_STATUS,header:({column:n})=>a.jsx(a1,{column:n,children:"Last Run Status"}),cell:({row:n})=>n.original.lastRunStatus?a.jsx(FI,{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(hce,{table:n}),cell:({row:n})=>a.jsx(fce,{row:n,onDeleteSuccess:e,onEditReport:t}),size:80}];function pce({destinationType:e,destination:t,onEditReport:n}){const{reports:r,setPollingConfig:s}=Ls(),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(()=>mce({onDeleteSuccess:()=>{},onEditReport:n}),[n]),{sorting:u,setSorting:f,columnVisibility:m,setColumnVisibility:g}=Rc({columns:c,storageKeyPrefix:`data-mart-email-reports-${t.id}`,defaultSortingColumn:"lastRunDate"}),y=vl({data:i,columns:c,getCoreRowModel:xl(),onSortingChange:f,getSortedRowModel:wc(),state:{sorting:u,columnVisibility:m},onColumnVisibilityChange:g}),x=`email-reports-table-${t.id}`;return a.jsx("div",{className:"w-full",children:a.jsx("div",{className:"dm-card-table-wrap",children:a.jsxs(bl,{id:x,className:"dm-card-table",role:"table","aria-label":`${t.title} reports`,children:[a.jsx(Sl,{className:"dm-card-table-header",children:y.getHeaderGroups().map(v=>a.jsx(Tn,{className:"dm-card-table-header-row",children:v.headers.map(S=>a.jsx(El,{style:S.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(S.column.getSize())}%`},scope:"col",children:S.isPlaceholder?null:typeof S.column.columnDef.header=="function"?S.column.columnDef.header(S.getContext()):S.column.columnDef.header},S.id))},v.id))}),a.jsx(Cl,{className:"dm-card-table-body",children:y.getRowModel().rows.length?y.getRowModel().rows.map((v,S)=>a.jsx(Tn,{onClick:()=>{const C=r.find(E=>E.id===v.original.id);C&&n(C)},className:"dm-card-table-body-row group",role:"row","aria-rowindex":S+1,children:v.getVisibleCells().map((C,E)=>a.jsx(Mr,{className:`px-6 whitespace-normal ${C.column.id==="actions"?"actions-cell":""}`,style:C.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(C.column.getSize())}%`},role:"cell","aria-colindex":E+1,children:typeof C.column.columnDef.cell=="function"?C.column.columnDef.cell(C.getContext()):C.column.columnDef.cell},C.id))},v.id)):a.jsx(Tn,{children:a.jsx(Mr,{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 gce({children:e,className:t,...n}){return a.jsx("div",{className:re("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 yce({children:e,className:t,...n}){return a.jsx("div",{className:re("flex flex-grow flex-col gap-1 py-4",t),...n,children:e})}function xce({children:e,className:t,...n}){return a.jsx("div",{className:re("text-md font-medium",t),...n,children:e})}function vce({children:e,className:t,...n}){return a.jsx("div",{className:re("text-muted-foreground text-sm",t),...n,children:e})}function bce({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(Nt,{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(ed,{className:"text-muted-foreground h-5 w-5 animate-spin"}):a.jsx(q6,{checked:e,disabled:t,onCheckedChange:r})})}),a.jsx(Dt,{children:u})]})}function Sce({icon:e,className:t,...n}){return a.jsx("div",{className:re("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(Ra,{className:"text-muted-foreground/75 dark:text-muted-foreground/50 h-4 w-4"})})})}function Cce(e){const{dataMart:t}=qa(),{reports:n,createReport:r,deleteReport:s,fetchReportsByDataMartId:i}=Ls(),[c,u]=h.useState(!1),f=h.useMemo(()=>n.find(v=>v.dataDestination.type===De.LOOKER_STUDIO&&v.dataDestination.id===e.id),[n,e.id]),m=h.useMemo(()=>(t==null?void 0:t.status.code)===Or.PUBLISHED,[t==null?void 0:t.status.code]),g=h.useMemo(()=>!!f,[f]),y=h.useMemo(()=>g?"Available in Looker Studio":"Not available in Looker Studio",[g]),x=h.useCallback(async v=>{if(!(!t||!m)){u(!0);try{if(v){const S={title:`Looker Studio Report - ${e.title}`,dataMartId:t.id,dataDestinationId:e.id,destinationConfig:{type:Cr.LOOKER_STUDIO_CONFIG,cacheLifetime:300}};await r(S),await i(t.id)}else f&&(await s(f.id),await i(t.id))}catch(S){console.error("Failed to toggle Looker Studio report:",S)}finally{u(!1)}}},[t,m,e,f,r,s,i]);return{existingReport:f,isLoading:c,isEnabled:m,isChecked:g,dynamicTitle:y,handleSwitchChange:x}}function Ece({destination:e,onEditReport:t,...n}){const{existingReport:r,isLoading:s,isEnabled:i,isChecked:c,dynamicTitle:u,handleSwitchChange:f}=Cce(e),m=h.useCallback(()=>{r&&t(r)},[r,t]);return a.jsxs(gce,{className:r?"cursor-pointer dark:hover:bg-white/5":"",onClick:r?m:void 0,...n,children:[a.jsx(bce,{checked:c,disabled:!i,loading:s,onCheckedChange:g=>void f(g),tooltipTextSwitchOn:"Switch off to remove access",tooltipTextSwitchOff:"Switch on to enable access",tooltipTextSwitchDisabled:"Publish the Data Mart first to enable access in Looker Studio"}),a.jsxs(yce,{children:[a.jsx(xce,{children:u}),a.jsx(vce,{children:c&&r?a.jsx(a.Fragment,{children:r.lastRunDate?a.jsxs(a.Fragment,{children:["Last fetched"," ",r.lastRunStatus===En.SUCCESS&&"successfully ",a.jsx(ti,{date:new Date(r.lastRunDate)}),r.lastRunStatus===En.ERROR&&" but failed with error",r.lastRunError&&a.jsx("div",{className:"mt-1 text-red-600 dark:text-red-400",children:r.lastRunError})]}):"Waiting for Looker Studio to fetch data"}):"Switch on to enable access"})]}),c&&r&&a.jsx(Sce,{})]})}function wce(){const{scope:e}=ii();return a.jsx("div",{className:"dm-card",children:a.jsxs("div",{className:"dm-empty-state",children:[a.jsx(Vb,{className:"dm-empty-state-ico",strokeWidth:1}),a.jsx("h2",{className:"dm-empty-state-title",children:"Google Sheets, Looker Studio… and friends!"}),a.jsx("p",{className:"dm-empty-state-subtitle",children:"To send your Data Mart's data to your favorite tools, create a Destination first."}),a.jsx(Ce,{variant:"outline",asChild:!0,children:a.jsxs(na,{to:e("/data-destinations"),className:"flex items-center gap-1",children:["Go to Destinations",a.jsx(Ra,{className:"h-4 w-4"})]})})]})})}function Rce(){const[e,t]=h.useState(!1),[n,r]=h.useState(Cn.CREATE),[s,i]=h.useState(null);return{isOpen:e,mode:n,editingReport:s,handleAddReport:()=>{r(Cn.CREATE),i(null),t(!0),Ie({event:"report_open",category:"Report",action:"CreateReport",label:"ReportForm"})},handleEditReport:m=>{r(Cn.EDIT),i(m),t(!0),Ie({event:"report_open",category:"Report",action:"EditReport",label:m.dataDestination.type})},handleCloseModal:()=>{t(!1),i(null),Ie({event:"report_close",category:"Report",action:n===Cn.EDIT?"Edit":"Create",label:"ReportForm"})}}}const jce=[De.GOOGLE_SHEETS,De.EMAIL,De.SLACK,De.MS_TEAMS,De.GOOGLE_CHAT];function Tce({destination:e,dataMartStatus:t}){const{destinationInfo:n,isVisible:r}=hQ(e),{isOpen:s,mode:i,editingReport:c,handleAddReport:u,handleEditReport:f,handleCloseModal:m}=Rce();return r?a.jsxs(a.Fragment,{children:[a.jsxs(ol,{name:e.id,collapsible:!0,defaultCollapsed:!1,children:[a.jsxs(ao,{children:[a.jsx(ro,{icon:n.icon,children:e.title}),a.jsx(Hh,{children:jce.includes(e.type)&&a.jsx(_ce,{dataMartStatus:t,onAddReport:u})})]}),a.jsx(so,{children:a.jsx(tue,{destination:e,onEditReport:f})}),a.jsx(Yo,{})]}),a.jsx(eue,{destination:e,isOpen:s,onClose:m,mode:i,initialReport:c})]}):null}function _ce({dataMartStatus:e,onAddReport:t}){const n=(e==null?void 0:e.code)===Or.DRAFT;return a.jsxs(Nt,{children:[a.jsx(At,{asChild:!0,children:a.jsx("span",{children:a.jsxs(Ce,{onClick:t,variant:"outline",size:"sm","aria-label":"Add new report",disabled:n,children:[a.jsx(ua,{className:"h-4 w-4"}),"Add Report"]})})}),n&&a.jsx(Dt,{children:a.jsx("p",{children:"To create a report, publish the Data Mart first"})})]})}function Nce({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 Ace=Wt({title:Rt().min(1,"Title is required"),documentUrl:Rt().refine(LD,"Enter a valid Google Sheets URL"),dataDestinationId:Rt().min(1,"Destination is required")});function Dce({initialReport:e,mode:t,dataMartId:n,onSuccess:r,preSelectedDestination:s}){const[i,c]=h.useState(null),[u,f]=h.useState(!1),{updateReport:m,createReport:g,error:y,clearError:x}=Ls();h.useEffect(()=>{u&&y&&(c(y),f(!1))},[y,u]);const v=go({resolver:ui(Ace),defaultValues:{title:(e==null?void 0:e.title)??"",documentUrl:e!=null&&e.destinationConfig&&wy(e.destinationConfig)?`https://docs.google.com/spreadsheets/d/${e.destinationConfig.spreadsheetId}/edit#gid=${e.destinationConfig.sheetId}`:"",dataDestinationId:(e==null?void 0:e.dataDestination.id)??(s==null?void 0:s.id)??""},mode:"onTouched"}),{register:S,handleSubmit:C,formState:E,reset:R}=v,{errors:j,isDirty:_}=E,A=h.useCallback(async O=>{try{c(null),x(),f(!0);const{spreadsheetId:I,sheetId:T}=GW(O.documentUrl);if(!I){c("Invalid Google Sheets URL");return}let D;if(t===Cn.CREATE)D=await g({title:O.title,dataMartId:n,dataDestinationId:O.dataDestinationId,destinationConfig:{type:Cr.GOOGLE_SHEETS_CONFIG,spreadsheetId:I,sheetId:T}});else{if(!e){c("Initial report is required for edit mode");return}D=await m(e.id,{title:O.title,dataDestinationId:O.dataDestinationId,destinationConfig:{type:Cr.GOOGLE_SHEETS_CONFIG,spreadsheetId:I,sheetId:T}})}if(!D||y){c(y??"An error occurred while submitting the form");return}r==null||r()}catch(I){console.error("Error submitting form:",I),c("An error occurred while submitting the form")}},[t,e,n,g,m,r,x,y]);return{form:v,register:S,handleSubmit:C,errors:j,isDirty:_,reset:R,formError:i,isSubmitting:u,setFormError:c,getValues:v.getValues,onSubmit:A}}function Oce(){return a.jsx(dn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Gt,{value:"service-account-details",children:[a.jsx(Bt,{children:"How do I get a correct document link?"}),a.jsxs(qt,{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 s1(e){return"serviceAccount"in e}function HI({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(os,{children:a.jsxs(Nt,{children:[a.jsx(At,{asChild:!0,children:a.jsxs("div",{role:"button",tabIndex:0,onClick:i,onKeyDown:c=>c.key==="Enter"&&i(),className:re("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(ra,{className:"h-4 w-4 text-green-500"}):a.jsx(Hf,{className:"h-4 w-4"})]})}),a.jsx(Dt,{children:a.jsx("p",{children:r?"Copied!":"Click to copy"})})]})})}const Ice=h.forwardRef(({initialReport:e,mode:t=Cn.EDIT,onDirtyChange:n,onFormErrorChange:r,onSubmit:s,onCancel:i,preSelectedDestination:c},u)=>{const f="google-sheets-edit-form",m="google-sheets-title-input",g="google-sheets-document-url-input",y="google-sheets-data-destination-select",{dataMart:x}=qa(),{scope:v}=ii(),{dataDestinations:S,fetchDataDestinations:C,loading:E}=Ah(),[R,j]=h.useState([]);h.useEffect(()=>{x&&C()},[x,C]),h.useEffect(()=>{if(S.length>0){const B=S.filter(q=>q.type===De.GOOGLE_SHEETS);j(B)}},[S]),Nce({elementId:m,isOpen:!0,delay:150});const{isDirty:_,reset:A,form:O,isSubmitting:I,formError:T,onSubmit:D}=Dce({initialReport:e,mode:t,dataMartId:(x==null?void 0:x.id)??"",onSuccess:()=>{s==null||s()},preSelectedDestination:c});h.useEffect(()=>{r&&r(T)},[T,r]),h.useEffect(()=>{if(t===Cn.EDIT&&e&&wy(e.destinationConfig))A({title:e.title,documentUrl:kS(e.destinationConfig.spreadsheetId,e.destinationConfig.sheetId),dataDestinationId:e.dataDestination.id});else if(t===Cn.CREATE){const B=(c==null?void 0:c.id)??"";A({title:"",documentUrl:"",dataDestinationId:B})}},[e,t,A,c]),h.useEffect(()=>{n==null||n(_)},[_,n]);const L=O.watch("documentUrl"),H=L&&LD(L.trim());return a.jsx(wl,{...O,children:a.jsxs(ci,{id:f,ref:u,noValidate:!0,onSubmit:B=>void O.handleSubmit(D)(B),children:[a.jsxs(Rl,{children:[a.jsxs(Gr,{title:"General",children:[a.jsx(Et,{control:O.control,name:"title",render:({field:B})=>a.jsxs(yt,{children:[a.jsx(gt,{tooltip:"Add a title that reflects the report`s purpose",children:"Title"}),a.jsx(St,{children:a.jsx(Tt,{id:m,placeholder:"Enter a report title",...B})}),a.jsx(_t,{})]})}),a.jsx(Et,{control:O.control,name:"dataDestinationId",render:({field:B})=>a.jsxs(yt,{children:[a.jsx(gt,{tooltip:"Select one of your existing destinations",children:"Destination"}),a.jsxs(oa,{onValueChange:B.onChange,value:B.value,disabled:E||R.length===0,children:[a.jsx(St,{children:a.jsx(la,{id:y,className:"w-full max-w-full overflow-hidden",children:a.jsx(ia,{className:"truncate",placeholder:"Select a destination",children:B.value&&R.length>0&&(()=>{const q=R.find(Z=>Z.id===B.value);if(q){const F=ea.getInfo(q.type).icon;return a.jsxs("div",{className:"flex w-full min-w-0 items-center gap-2",children:[a.jsx(F,{className:"flex-shrink-0",size:18}),a.jsx("div",{className:"flex min-w-0 flex-col",children:a.jsx("span",{className:"truncate",children:q.title})})]})}return null})()})})}),a.jsx(ca,{children:R.map(q=>{const F=ea.getInfo(q.type).icon;return a.jsx(Ln,{value:q.id,children:a.jsxs("div",{className:"flex w-full min-w-0 items-center gap-2",children:[a.jsx(F,{className:"flex-shrink-0",size:18}),a.jsxs("div",{className:"flex min-w-0 flex-col",children:[a.jsx("span",{className:"truncate",children:q.title}),a.jsx("span",{className:"text-muted-foreground truncate text-xs",children:(s1(q.credentials)&&I0(q.credentials.serviceAccount))??"No email found"})]})]})},q.id)})})]}),R.length===0&&!E&&a.jsxs(LC,{className:"mt-2",children:[a.jsx(lh,{className:"h-4 w-4"}),a.jsx(L6,{children:"No destinations available"}),a.jsxs(PC,{children:["You need to create a Destination before you can create a report."," ",a.jsx(na,{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"})]})]}),B.value&&R.length>0&&(()=>{const q=R.find(Z=>Z.id===B.value);return q?a.jsxs("div",{className:"mt-2 flex flex-col gap-1",children:[a.jsx(gt,{children:"Service Account Email"}),a.jsx(HI,{value:s1(q.credentials)?I0(q.credentials.serviceAccount)??"No email found":"",children:s1(q.credentials)?I0(q.credentials.serviceAccount):"No email found"})]}):null})(),a.jsx(_t,{})]})}),a.jsx(Et,{control:O.control,name:"documentUrl",render:({field:B})=>a.jsxs(yt,{children:[a.jsx(gt,{tooltip:"The link must include the Sheet ID to insert data into the correct tab",children:"Document Link with Sheet ID (GID)"}),a.jsx(St,{children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Tt,{id:g,placeholder:"Document URL",className:"flex-1",...B}),a.jsxs(Nt,{children:[a.jsx(At,{asChild:!0,children:a.jsx("button",{type:"button",className:`flex-shrink-0 rounded-md p-2 transition-all duration-200 ${H?"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:()=>{H&&window.open(L.trim(),"_blank","noopener,noreferrer")},disabled:!H,"aria-label":H?"Open document in new tab":"Document link is not valid",children:a.jsx(Wo,{className:"h-4 w-4","aria-hidden":"true"})})}),a.jsx(Dt,{side:"top",align:"center",role:"tooltip",children:H?"Open document in new tab":"Enter a valid URL to enable link"})]})]})}),a.jsx(an,{children:a.jsx(Oce,{})}),a.jsx(_t,{})]})})]}),a.jsx(Gr,{title:"Automate Report Runs",children:a.jsx(zC,{})})]}),a.jsxs(jl,{children:[a.jsx(Ce,{variant:"default",type:"submit",className:"w-full","aria-label":t===Cn.CREATE?"Create new report":"Save changes to report",disabled:!_||I,children:I?t===Cn.CREATE?"Creating...":"Saving...":t===Cn.CREATE?"Create new report":"Save changes to report"}),i&&a.jsx(Ce,{variant:"outline",type:"button",onClick:i,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})});function Mce({isOpen:e,onClose:t,initialReport:n,mode:r,preSelectedDestination:s}){const[i,c]=h.useState(!1),[u,f]=h.useState(!1),m=h.useCallback(()=>{u?c(!0):t()},[u,t]),g=h.useCallback(()=>{c(!1),f(!1),t()},[t]),y=h.useCallback(v=>{f(v)},[]),x=h.useCallback(()=>{f(!1),t()},[t]);return a.jsxs(a.Fragment,{children:[a.jsx(ni,{open:e,onOpenChange:v=>{v||m()},children:a.jsxs(ri,{children:[a.jsxs(ai,{children:[a.jsx(si,{children:r===Cn.CREATE?"Create new report":"Edit report"}),a.jsx(hl,{children:r===Cn.CREATE?"Fill in the details to create a new Google Sheets report":"Update details of an existing Google Sheets report"})]}),a.jsx(Nh,{children:a.jsx(Ice,{initialReport:n,mode:r,onDirtyChange:y,onSubmit:x,onCancel:m,preSelectedDestination:s})})]})}),a.jsx(yr,{open:i,onOpenChange:c,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:g,variant:"destructive"})]})}const kce=Wt({cacheLifetime:hZ().min(300,"Cache time must be at least 5 minutes (300 seconds)")});function Lce({initialReport:e,dataMartId:t,onSuccess:n,preSelectedDestination:r}){const[s,i]=h.useState(null),{createReport:c,updateReport:u}=Ls(),f=go({resolver:ui(kce),defaultValues:{cacheLifetime:e!=null&&e.destinationConfig&&KD(e.destinationConfig)?e.destinationConfig.cacheLifetime:300},mode:"onTouched"});return{form:f,onSubmit:async g=>{try{i(null);const{cacheLifetime:y}=g,x={type:Cr.LOOKER_STUDIO_CONFIG,cacheLifetime:y};e?await u(e.id,{title:"Looker Studio Report",dataDestinationId:e.dataDestination.id,destinationConfig:x}):await c({title:"Looker Studio Report",dataMartId:t,dataDestinationId:(r==null?void 0:r.id)??"",destinationConfig:x}),n==null||n()}catch(y){console.error("Error submitting form:",y),i("Failed to save report. Please try again.")}},formError:s,isSubmitting:f.formState.isSubmitting,isDirty:f.formState.isDirty,reset:f.reset}}function Pce(){return a.jsx(dn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Gt,{value:"cache-lifetime-details",children:[a.jsx(Bt,{children:"What is the Cache Lifetime for Looker Studio?"}),a.jsx(qt,{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 Uce=[{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"}],Fce=h.forwardRef(({initialReport:e,mode:t=Cn.EDIT,onDirtyChange:n,onFormErrorChange:r,onSubmit:s,onCancel:i,preSelectedDestination:c},u)=>{const f="looker-studio-edit-form",{dataMart:m}=qa(),{isDirty:g,reset:y,form:x,isSubmitting:v,formError:S,onSubmit:C}=Lce({initialReport:e,dataMartId:(m==null?void 0:m.id)??"",onSuccess:()=>{s==null||s()},preSelectedDestination:c});return h.useEffect(()=>{r&&r(S)},[S,r]),h.useEffect(()=>{t===Cn.EDIT&&e&&KD(e.destinationConfig)?y({cacheLifetime:e.destinationConfig.cacheLifetime}):t===Cn.CREATE&&y({cacheLifetime:300})},[e,t,y]),h.useEffect(()=>{n==null||n(g)},[g,n]),a.jsx(wl,{...x,children:a.jsxs(ci,{id:f,ref:u,noValidate:!0,onSubmit:E=>void x.handleSubmit(C)(E),children:[a.jsx(Rl,{children:a.jsx(Gr,{title:"Cache Configuration",children:a.jsx(Et,{control:x.control,name:"cacheLifetime",render:({field:E})=>{var R;return a.jsxs(yt,{children:[a.jsx(gt,{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:((R=E.value)==null?void 0:R.toString())??"300",defaultValue:"300",children:[a.jsx(St,{children:a.jsx(la,{className:"w-full",children:a.jsx(ia,{placeholder:"Select cache time"})})}),a.jsx(ca,{children:Uce.map(j=>a.jsx(Ln,{value:j.value.toString(),children:j.label},j.value))})]}),a.jsx(_t,{}),a.jsx(an,{children:a.jsx(Pce,{})})]})}})})}),a.jsxs(jl,{children:[a.jsx(Ce,{variant:"default",type:"submit",className:"w-full","aria-label":t===Cn.CREATE?"Create":"Save changes",disabled:!g||v,children:v?t===Cn.CREATE?"Creating...":"Saving...":t===Cn.CREATE?"Create":"Save changes"}),i&&a.jsx(Ce,{variant:"outline",type:"button",onClick:i,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})});function zce({isOpen:e,onClose:t,initialReport:n,mode:r,preSelectedDestination:s}){const[i,c]=h.useState(!1),[u,f]=h.useState(!1),m=h.useCallback(()=>{u?c(!0):t()},[u,t]),g=h.useCallback(()=>{c(!1),f(!1),t()},[t]),y=h.useCallback(v=>{f(v)},[]),x=h.useCallback(()=>{f(!1),t()},[t]);return a.jsxs(a.Fragment,{children:[a.jsx(ni,{open:e,onOpenChange:v=>{v||m()},children:a.jsxs(ri,{children:[a.jsxs(ai,{children:[a.jsx(si,{children:(s==null?void 0:s.title)??"Looker Studio"}),a.jsx(hl,{children:r===Cn.CREATE?"Set up Data Mart as a data source":"Update connection details"})]}),a.jsx(Nh,{children:a.jsx(Fce,{initialReport:n,mode:r,onDirtyChange:y,onSubmit:x,onCancel:m,preSelectedDestination:s})})]})}),a.jsx(yr,{open:i,onOpenChange:c,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:g,variant:"destructive"})]})}const rN=({destination:e})=>{const n=ea.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 Hce(e){return"to"in e}const Vce=({destination:e})=>{if(!e)return null;const t=e.credentials,n=Hce(t)&&t.to.length?t.to.join(", "):"";return a.jsxs("div",{className:"mt-2 flex flex-col gap-1",children:[a.jsx(gt,{children:"Recipients of this report"}),a.jsx(HI,{doNotTruncateContent:!0,value:n,children:n||"No recipients found"})]})};var tc=(e=>(e.ALWAYS="ALWAYS",e.RESULT_IS_EMPTY="RESULT_IS_EMPTY",e.RESULT_IS_NOT_EMPTY="RESULT_IS_NOT_EMPTY",e))(tc||{});const $ce=Wt({title:Rt().min(1,"Title is required"),dataDestinationId:Rt().min(1,"Destination is required"),reportCondition:my(tc),subject:Rt().min(1,"Subject is required"),messageTemplate:Rt().min(1,"Message body is required")});function Gce({initialReport:e,mode:t,dataMartId:n,onSuccess:r,preSelectedDestination:s}){const[i,c]=h.useState(null),[u,f]=h.useState(!1),{updateReport:m,createReport:g,error:y,clearError:x}=Ls();h.useEffect(()=>{u&&y&&(c(y),f(!1))},[y,u]);const v=go({resolver:ui($ce),defaultValues:{title:(e==null?void 0:e.title)??"",dataDestinationId:(e==null?void 0:e.dataDestination.id)??(s==null?void 0:s.id)??"",reportCondition:e!=null&&e.destinationConfig&&k0(e.destinationConfig)?e.destinationConfig.reportCondition:tc.ALWAYS,subject:e!=null&&e.destinationConfig&&k0(e.destinationConfig)?e.destinationConfig.subject:"",messageTemplate:e!=null&&e.destinationConfig&&k0(e.destinationConfig)?e.destinationConfig.messageTemplate:""},mode:"onTouched"}),{handleSubmit:S,formState:C,reset:E}=v,{isDirty:R,errors:j}=C,_=h.useCallback(async A=>{try{c(null),x(),f(!0);let O;const I={type:Cr.EMAIL_CONFIG,reportCondition:A.reportCondition,subject:A.subject,messageTemplate:A.messageTemplate};if(t===Cn.CREATE)O=await g({title:A.title,dataMartId:n,dataDestinationId:A.dataDestinationId,destinationConfig:I});else{if(!e){c("Initial report is required for edit mode");return}O=await m(e.id,{title:A.title,dataDestinationId:A.dataDestinationId,destinationConfig:I})}if(!O||y){c(y??"An error occurred while submitting the form");return}r==null||r()}catch(O){console.error("Error submitting form:",O),c("An error occurred while submitting the form")}},[t,e,n,g,m,r,x,y]);return{form:v,handleSubmit:S,errors:j,isDirty:R,reset:E,formError:i,isSubmitting:u,setFormError:c,onSubmit:_}}function Bce({value:e,onChange:t,onBlur:n,height:r=240,theme:s="light",options:i,className:c,placeholder:u="Start writing your message…"}){const f=m=>{n&&m.onDidBlurEditorText(n)};return a.jsx(_C,{language:"markdown",height:r,value:e,onChange:m=>{t(m??"")},onMount:f,theme:s,options:{wordWrap:"on",minimap:{enabled:!1},lineNumbers:"off",folding:!1,scrollBeyondLastLine:!1,automaticLayout:!0,placeholder:u,...i},className:c})}const qce=()=>a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Dr,{className:"h-6 w-3/4"}),a.jsx(Dr,{className:"h-4 w-1/2"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Dr,{className:"h-4 w-full"}),a.jsx(Dr,{className:"h-4 w-5/6"}),a.jsx(Dr,{className:"h-4 w-4/5"}),a.jsx(Dr,{className:"h-4 w-3/4"})]})]});function VI({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}=Th(),[u,f]=h.useState({bg:"#fff",fg:"#000"});return h.useEffect(()=>{if(typeof window>"u")return;let m;const g=requestAnimationFrame(()=>{m=requestAnimationFrame(()=>{const y=getComputedStyle(document.documentElement),x=y.getPropertyValue("--background").trim()||"#fff",v=y.getPropertyValue("--foreground").trim()||"#000";f({bg:x,fg:v})})});return()=>{cancelAnimationFrame(g),cancelAnimationFrame(m)}},[c]),a.jsxs("div",{className:`bg-background overflow-auto rounded-md pl-2 ${s??""}`,style:{height:r},children:[t&&a.jsx(qce,{}),!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>
|
|
801
|
-
<html lang='en' style="background:${u.bg};color:${u.fg}">
|
|
802
|
-
<head>
|
|
803
|
-
<meta charset='utf-8'/>
|
|
804
|
-
<base target='_blank'>
|
|
805
|
-
</head>
|
|
806
|
-
<body>${e}</body>
|
|
807
|
-
</html>`,className:"h-full w-full border-0"})]})}function Kce({value:e,onChange:t}){return a.jsx(pC,{value:e,onValueChange:n=>{t(n)},children:a.jsxs(gC,{children:[a.jsx(Qf,{value:"markdown",children:"Markdown"}),a.jsx(Qf,{value:"preview",children:"Preview"})]})})}function Zce({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),g=h.useRef(null);return h.useEffect(()=>{var S;if(!t)return;const y=e;if(!y.trim()){i(""),m(null),u(!1);return}const x=new AbortController;(S=g.current)==null||S.abort(),g.current=x,u(!0),m(null);const v=setTimeout(()=>{r(y,x.signal).then(C=>{i(C)}).catch(C=>{if(x.signal.aborted)return;const E=C instanceof Error?C.message:"Failed to load preview";m(E)}).finally(()=>{x.signal.aborted||u(!1)})},n);return()=>{clearTimeout(v),x.abort()}},[e,t,n,r]),{html:s,loading:c,error:f}}function Yce(e,t){return Sa.post("/markdown/parse-to-html",{markdown:e},{headers:{"Content-Type":"application/json"},responseType:"text",signal:t}).then(n=>n.data)}function $I(e){const t=h.useCallback(Yce,[]);return Zce({...e,toHtml:t})}function Wce(){return a.jsx(dn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Gt,{value:"message-details",children:[a.jsx(Bt,{children:"How can I format my message?"}),a.jsxs(qt,{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(rn,{className:"underline",href:"https://www.markdownguide.org/basic-syntax/",children:"quick guide"})]})]})]})})}function Qce(){return a.jsx(dn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Gt,{value:"sending-condition-details",children:[a.jsx(Bt,{children:"What are Data Mart Run results?"}),a.jsxs(qt,{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."})]})]})})}const Xce=[De.EMAIL,De.SLACK,De.GOOGLE_CHAT,De.MS_TEAMS],GI=h.forwardRef(({initialReport:e,mode:t=Cn.EDIT,onDirtyChange:n,onFormErrorChange:r,onSubmit:s,onCancel:i,preSelectedDestination:c},u)=>{const f="email-report-edit-form",{dataMart:m}=qa(),{dataDestinations:g,fetchDataDestinations:y,loading:x}=Ah(),[v,S]=h.useState([]);h.useEffect(()=>{m&&y()},[m,y]),h.useEffect(()=>{if(g.length>0){const M=c!=null&&c.type?[c.type]:Xce,V=g.filter(K=>M.includes(K.type));S(V)}},[g,c==null?void 0:c.type]);const{isDirty:C,reset:E,form:R,isSubmitting:j,formError:_,onSubmit:A}=Gce({initialReport:e,mode:t,dataMartId:(m==null?void 0:m.id)??"",onSuccess:()=>{s==null||s()},preSelectedDestination:c});h.useEffect(()=>{r&&r(_)},[_,r]),h.useEffect(()=>{if(!(t===Cn.EDIT&&e)){if(t===Cn.CREATE){const M=(c==null?void 0:c.id)??"";E({title:"",dataDestinationId:M,reportCondition:tc.ALWAYS,subject:"",messageTemplate:""})}}},[e,t,E,c]),h.useEffect(()=>{n==null||n(C)},[C,n]);const O=h.useMemo(()=>[{value:tc.ALWAYS,label:"Send always"},{value:tc.RESULT_IS_EMPTY,label:"Send only when result is empty"},{value:tc.RESULT_IS_NOT_EMPTY,label:"Send only when result is not empty"}],[]),{resolvedTheme:I}=Th(),T=I==="dark"?"vs-dark":"light",[D,L]=h.useState("markdown"),H=R.watch("messageTemplate"),{html:B,loading:q,error:Z}=$I({markdown:H,enabled:D==="preview"}),F=R.watch("dataDestinationId"),z=h.useMemo(()=>F&&v.length>0?v.find(M=>M.id===F)??null:null,[F,v]);return a.jsx(wl,{...R,children:a.jsxs(ci,{id:f,ref:u,noValidate:!0,onSubmit:M=>{R.handleSubmit(A)(M)},children:[a.jsxs(Rl,{children:[a.jsxs(Gr,{title:"General",children:[a.jsx(Et,{control:R.control,name:"title",render:({field:M})=>a.jsxs(yt,{children:[a.jsx(gt,{tooltip:"Add a title that reflects the report`s purpose",children:"Title"}),a.jsx(St,{children:a.jsx(Tt,{placeholder:"Enter a report title",...M})}),a.jsx(_t,{})]})}),a.jsx(Et,{control:R.control,name:"dataDestinationId",render:({field:M})=>a.jsxs(yt,{children:[a.jsx(gt,{tooltip:"Select one of your existing destinations",children:"Destination"}),a.jsxs(oa,{onValueChange:M.onChange,value:M.value,disabled:x||v.length===0,children:[a.jsx(St,{children:a.jsx(la,{className:"w-full max-w-full overflow-hidden",children:a.jsx(ia,{className:"truncate",placeholder:"Select a destination",children:z&&a.jsx(rN,{destination:z})})})}),a.jsx(ca,{children:v.map(V=>a.jsx(Ln,{value:V.id,children:a.jsx(rN,{destination:V})},V.id))})]}),a.jsx(Vce,{destination:z}),a.jsx(_t,{})]})})]}),a.jsxs(Gr,{title:"Template",children:[a.jsx(Et,{control:R.control,name:"subject",render:({field:M})=>a.jsxs(yt,{children:[a.jsx(gt,{tooltip:"Add a short, clear subject line for your report",children:"Subject"}),a.jsx(St,{children:a.jsx(Tt,{placeholder:"Enter a message title",...M})}),a.jsx(_t,{})]})}),a.jsx(Et,{control:R.control,name:"messageTemplate",render:({field:M})=>a.jsxs(yt,{children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsx(gt,{tooltip:"Write your report message in Markdown and check the final format in Preview",children:"Message"}),a.jsx(Kce,{value:D,onChange:L})]}),a.jsx(St,{children:a.jsx("div",{className:"overflow-hidden rounded-md border",children:D==="markdown"?a.jsx(Bce,{value:M.value??"",onChange:V=>{M.onChange(V)},onBlur:M.onBlur,height:240,theme:T}):a.jsx(VI,{html:B,loading:q,error:Z,height:240})})}),a.jsx(an,{children:a.jsx(Wce,{})}),a.jsx(_t,{})]})})]}),a.jsx(Gr,{title:"Sending conditions",children:a.jsx(Et,{control:R.control,name:"reportCondition",render:({field:M})=>a.jsxs(yt,{children:[a.jsx(gt,{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:M.onChange,value:M.value,children:[a.jsx(St,{children:a.jsx(la,{className:"w-full max-w-full overflow-hidden",children:a.jsx(ia,{})})}),a.jsx(ca,{children:O.map(V=>a.jsx(Ln,{value:V.value,children:V.label},V.value))})]}),a.jsx(an,{children:a.jsx(Qce,{})}),a.jsx(_t,{})]})})}),a.jsx(Gr,{title:"Automate Report Runs",children:a.jsx(zC,{})})]}),a.jsxs(jl,{children:[a.jsx(Ce,{variant:"default",type:"submit",disabled:j,children:t===Cn.CREATE?"Create new report":"Save changes to report"}),a.jsx(Ce,{variant:"outline",type:"button",onClick:i,disabled:j,children:"Cancel"})]})]})})});GI.displayName="EmailReportEditForm";function Jce({isOpen:e,onClose:t,initialReport:n,mode:r,preSelectedDestination:s}){const[i,c]=h.useState(!1),[u,f]=h.useState(!1),m=h.useCallback(()=>{u?c(!0):t()},[u,t]),g=h.useCallback(()=>{c(!1),f(!1),t()},[t]),y=h.useCallback(v=>{f(v)},[]),x=h.useCallback(()=>{f(!1),t()},[t]);return a.jsxs(a.Fragment,{children:[a.jsx(ni,{open:e,onOpenChange:v=>{v||m()},children:a.jsxs(ri,{children:[a.jsxs(ai,{children:[a.jsx(si,{children:(s==null?void 0:s.title)??"Report"}),a.jsx(hl,{children:r===Cn.CREATE?"Fill in the details to create a new report":"Update details of an existing report"})]}),a.jsx(Nh,{children:a.jsx(GI,{initialReport:n,mode:r,onDirtyChange:y,onSubmit:x,onCancel:m,preSelectedDestination:s})})]})}),a.jsx(yr,{open:i,onOpenChange:c,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:g,variant:"destructive"})]})}function eue({destination:e,isOpen:t,onClose:n,mode:r,initialReport:s}){switch(e.type){case De.GOOGLE_SHEETS:return a.jsx(Mce,{isOpen:t,onClose:n,mode:r,preSelectedDestination:e,initialReport:s??void 0});case De.LOOKER_STUDIO:return a.jsx(zce,{isOpen:t,onClose:n,mode:r,preSelectedDestination:e,initialReport:s??void 0});case De.EMAIL:case De.SLACK:case De.GOOGLE_CHAT:case De.MS_TEAMS:return a.jsx(Jce,{isOpen:t,onClose:n,mode:r,preSelectedDestination:e,initialReport:s??void 0});default:return null}}function tue({destination:e,onEditReport:t}){switch(e.type){case De.GOOGLE_SHEETS:return a.jsx(dce,{destination:e,onEditReport:t});case De.EMAIL:case De.SLACK:case De.GOOGLE_CHAT:case De.MS_TEAMS:return a.jsx(pce,{destinationType:e.type,destination:e,onEditReport:t});case De.LOOKER_STUDIO:return a.jsx(Ece,{destination:e,onEditReport:t});default:return null}}function BI(){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(Dr,{className:"h-4 w-4 rounded-full"}),a.jsx(Dr,{className:"h-4 w-40"}),a.jsx(Dr,{className:"h-3 w-32"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Dr,{className:"h-6 w-16 rounded-full"}),a.jsx(Dr,{className:"h-4 w-4"})]})]})},t))})})}function i2({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 nue({enabled:e=!0,intervalMs:t=5e3}={}){const{dataMart:n}=qa(),{fetchReportsByDataMartId:r}=Ls(),s=n==null?void 0:n.id;h.useEffect(()=>{s&&r(s)},[s,r]),i2({enabled:!!s&&e,intervalMs:t,onTick:()=>{s&&r(s,{silent:!0})}})}function rue(){const{dataMart:e}=qa(),{dataDestinations:t,isLoading:n}=mQ();return nue({enabled:!0,intervalMs:5e3}),e?a.jsx("div",{className:"flex flex-col gap-4",children:n?a.jsx(BI,{}):t.length===0?a.jsx(wce,{}):t.map(r=>a.jsx(Tce,{destination:r,dataMartStatus:e.status},r.id))}):null}function aue(){return a.jsx(Nh,{children:a.jsx(UD,{children:a.jsx(rue,{})})})}function aN(){return a.jsxs(ol,{children:[a.jsx(ao,{children:a.jsx(ro,{icon:U7,tooltip:"Description of the Data Mart",children:"Description"})}),a.jsx(so,{children:a.jsx(Pne,{})}),a.jsx(Yo,{})]})}function sue(){const{dataMart:e}=Ps(),[t,n]=h.useState(!1),r=h.useCallback(()=>{n(!0)},[]),s=h.useCallback(()=>{n(!1)},[]);return a.jsxs(ol,{children:[a.jsxs(ao,{children:[a.jsx(ro,{icon:$b,tooltip:"Time triggers allow you to schedule Data Mart runs at specific times",children:"Time triggers"}),a.jsx(Hh,{children:a.jsxs(Ce,{variant:"outline",onClick:r,"aria-label":"Add new trigger",children:[a.jsx(ua,{className:"h-4 w-4","aria-hidden":"true"}),"Add Trigger"]})})]}),a.jsx(so,{children:a.jsx(Wu,{children:a.jsx(Pse,{children:e&&a.jsxs(a.Fragment,{children:[a.jsx(woe,{dataMartId:e.id}),a.jsx(FC,{isOpen:t,onClose:s,dataMartId:e.id})]})})})}),a.jsx(Yo,{})]})}const oue={list:[],listLoadingStatus:vt.IDLE,activeInsight:null,activeInsightLoadingStatus:vt.IDLE,executionStatus:vt.IDLE,executionTriggerId:null,error:null};var ft=(e=>(e.FETCH_INSIGHTS_START="FETCH_INSIGHTS_START",e.FETCH_INSIGHTS_SUCCESS="FETCH_INSIGHTS_SUCCESS",e.FETCH_INSIGHTS_ERROR="FETCH_INSIGHTS_ERROR",e.GET_INSIGHT_START="GET_INSIGHT_START",e.GET_INSIGHT_SUCCESS="GET_INSIGHT_SUCCESS",e.GET_INSIGHT_ERROR="GET_INSIGHT_ERROR",e.CREATE_INSIGHT_START="CREATE_INSIGHT_START",e.CREATE_INSIGHT_SUCCESS="CREATE_INSIGHT_SUCCESS",e.CREATE_INSIGHT_ERROR="CREATE_INSIGHT_ERROR",e.UPDATE_INSIGHT_START="UPDATE_INSIGHT_START",e.UPDATE_INSIGHT_SUCCESS="UPDATE_INSIGHT_SUCCESS",e.UPDATE_INSIGHT_ERROR="UPDATE_INSIGHT_ERROR",e.DELETE_INSIGHT_START="DELETE_INSIGHT_START",e.DELETE_INSIGHT_SUCCESS="DELETE_INSIGHT_SUCCESS",e.DELETE_INSIGHT_ERROR="DELETE_INSIGHT_ERROR",e.RUN_INSIGHT_START="RUN_INSIGHT_START",e.RUN_INSIGHT_START_ERROR="RUN_INSIGHT_START_ERROR",e.RUN_INSIGHT_STARTED="RUN_INSIGHT_STARTED",e.RUN_INSIGHT_SUCCESS="RUN_INSIGHT_SUCCESS",e.RUN_INSIGHT_ERROR="RUN_INSIGHT_ERROR",e.CLEAR_ERROR="CLEAR_ERROR",e))(ft||{});class iue extends gl{constructor(){super("/data-marts")}async getInsights(t){return this.get(`/${t}/insights`)}async getInsightById(t,n){return await this.get(`/${t}/insights/${n}`)}async createInsight(t,n){return this.post(`/${t}/insights`,n)}async updateInsight(t,n,r){return this.put(`/${t}/insights/${n}`,r)}async updateInsightTitle(t,n,r){return this.put(`/${t}/insights/${n}/title`,r)}async deleteInsight(t,n){return this.delete(`/${t}/insights/${n}`)}async startInsightExecution(t,n){return this.post(`/${t}/insights/${n}/run-triggers`,{})}async checkInsightExecutionStatus(t,n,r,s){return this.get(`/${t}/insights/${r}/run-triggers/${n}/status`,null,s)}async getInsightRunTriggers(t,n,r){return this.get(`/${t}/insights/${n}/run-triggers/`,null,r)}}const zo=new iue,Tf=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)}),lue=e=>e.data.map(Tf),cue=e=>({title:e.title,template:e.template??null}),uue=e=>({title:e.title,template:e.template??null}),qI=h.createContext(void 0);function KI(){const e=h.useContext(qI);if(!e)throw new Error("useInsightsContext must be used within InsightsProvider");return e}function l2(){const{state:e,dispatch:t}=KI(),{dataMart:n}=Ps();if(!n)throw new Error("useInsights must be used within a DataMart context");const r=h.useCallback(async()=>{t({type:ft.FETCH_INSIGHTS_START});try{const v=await zo.getInsights(n.id),S=lue(v);t({type:ft.FETCH_INSIGHTS_SUCCESS,payload:S})}catch(v){throw t({type:ft.FETCH_INSIGHTS_ERROR,payload:en(v)}),v}},[n.id,t]),s=h.useCallback(async v=>{t({type:ft.GET_INSIGHT_START});try{const S=await zo.getInsightById(n.id,v),C=Tf(S);return t({type:ft.GET_INSIGHT_SUCCESS,payload:C}),C}catch(S){throw t({type:ft.GET_INSIGHT_ERROR,payload:en(S)}),S}},[n.id,t]),i=h.useCallback(async v=>{t({type:ft.CREATE_INSIGHT_START});try{const S=cue(v),C=await zo.createInsight(n.id,S),E=Tf(C);return t({type:ft.CREATE_INSIGHT_SUCCESS,payload:E}),Ie({event:"insight_created",category:"Insights",action:"Create",label:E.id}),Mt.success("Insight created"),E}catch(S){return t({type:ft.CREATE_INSIGHT_ERROR,payload:en(S)}),null}},[n.id,t]),c=h.useCallback(async(v,S)=>{t({type:ft.UPDATE_INSIGHT_START});try{const C=uue(S),E=await zo.updateInsight(n.id,v,C),R=Tf(E);return t({type:ft.UPDATE_INSIGHT_SUCCESS,payload:R}),Ie({event:"insight_updated",category:"Insights",action:"Update",label:R.id}),Mt.success("Insight updated"),R}catch(C){return t({type:ft.UPDATE_INSIGHT_ERROR,payload:en(C)}),null}},[n.id,t]),u=h.useCallback(async v=>{t({type:ft.DELETE_INSIGHT_START});try{await zo.deleteInsight(n.id,v),t({type:ft.DELETE_INSIGHT_SUCCESS,payload:v}),Ie({event:"insight_deleted",category:"Insights",action:"Delete",label:v}),Mt.success("Insight deleted")}catch(S){throw t({type:ft.DELETE_INSIGHT_ERROR,payload:en(S)}),S}},[n.id,t]),f=h.useCallback(async(v,S)=>{t({type:ft.UPDATE_INSIGHT_START});try{const C=await zo.updateInsightTitle(n.id,v,{title:S}),E=Tf(C),R=e.list.find(_=>_.id===v)??e.activeInsight,j=R?{...E,template:R.template}:E;return t({type:ft.UPDATE_INSIGHT_SUCCESS,payload:j}),Ie({event:"insight_title_updated",category:"Insights",action:"Update title",label:j.id}),Mt.success("Title updated"),j}catch(C){return t({type:ft.UPDATE_INSIGHT_ERROR,payload:en(C)}),null}},[n.id,t,e.activeInsight,e.list]),m=h.useCallback(async v=>{t({type:ft.RUN_INSIGHT_START});try{const S=await zo.startInsightExecution(n.id,v);t({type:ft.RUN_INSIGHT_STARTED,payload:{triggerId:S.triggerId}})}catch(S){t({type:ft.RUN_INSIGHT_ERROR,payload:en(S)})}},[t,n.id]),g=h.useCallback(()=>{t({type:ft.RUN_INSIGHT_SUCCESS,payload:{triggerId:""}})},[t]),y=h.useCallback(v=>{t({type:ft.RUN_INSIGHT_STARTED,payload:{triggerId:v}})},[t]),x=h.useCallback(async()=>{const v=e.activeInsight;if(!(!v||!n.id)&&!e.executionTriggerId&&!(!v.lastRun||UQ(v.lastRun.status)))try{const C=(await zo.getInsightRunTriggers(n.id,v.id,{skipLoadingIndicator:!0})).data.sort((E,R)=>new Date(R.modifiedAt).getTime()-new Date(E.modifiedAt).getTime()).find(E=>!FQ(E.status));C!=null&&C.id&&(t({type:ft.RUN_INSIGHT_START}),t({type:ft.RUN_INSIGHT_STARTED,payload:{triggerId:C.id}}))}catch(S){t({type:ft.RUN_INSIGHT_ERROR,payload:en(S)})}},[e.activeInsight,e.executionTriggerId,n.id,t]);return{insights:e.list,activeInsight:e.activeInsight,listLoading:e.listLoadingStatus===vt.LOADING,insightLoading:e.activeInsightLoadingStatus===vt.LOADING,isRunning:e.executionStatus===vt.LOADING,triggerId:e.executionTriggerId,error:e.error,fetchInsights:r,getInsight:s,createInsight:i,updateInsight:c,updateInsightTitle:f,deleteInsight:u,runInsight:m,setTriggerId:y,resetTriggerId:g,ensureActiveRunPolling:x}}function due(){const{state:e}=KI(),t=h.useMemo(()=>e.list,[e.list]),n=h.useMemo(()=>e.listLoadingStatus===vt.LOADING,[e.listLoadingStatus]),r=h.useMemo(()=>e.listLoadingStatus===vt.LOADED||e.listLoadingStatus===vt.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 fue(e,t){var n,r;switch(t.type){case ft.FETCH_INSIGHTS_START:return{...e,listLoadingStatus:vt.LOADING,error:null};case ft.GET_INSIGHT_START:return{...e,activeInsightLoadingStatus:vt.LOADING,error:null};case ft.CREATE_INSIGHT_START:return{...e,activeInsightLoadingStatus:vt.LOADING,error:null};case ft.UPDATE_INSIGHT_START:return{...e,error:null};case ft.DELETE_INSIGHT_START:return{...e,listLoadingStatus:vt.LOADING,error:null};case ft.FETCH_INSIGHTS_SUCCESS:return{...e,list:t.payload,listLoadingStatus:vt.LOADED,error:null};case ft.GET_INSIGHT_SUCCESS:return{...e,activeInsight:t.payload,activeInsightLoadingStatus:vt.LOADED,error:null};case ft.CREATE_INSIGHT_SUCCESS:return{...e,list:[...e.list,t.payload],listLoadingStatus:vt.LOADED,activeInsightLoadingStatus:vt.LOADED,error:null};case ft.UPDATE_INSIGHT_SUCCESS:return{...e,list:e.list.map(s=>s.id===t.payload.id?t.payload:s),activeInsight:((n=e.activeInsight)==null?void 0:n.id)===t.payload.id?t.payload:e.activeInsight,listLoadingStatus:vt.LOADED,error:null};case ft.DELETE_INSIGHT_SUCCESS:return{...e,list:e.list.filter(s=>s.id!==t.payload),activeInsight:((r=e.activeInsight)==null?void 0:r.id)===t.payload?null:e.activeInsight,listLoadingStatus:vt.LOADED,error:null};case ft.FETCH_INSIGHTS_ERROR:return{...e,listLoadingStatus:vt.ERROR,error:t.payload};case ft.GET_INSIGHT_ERROR:return{...e,activeInsightLoadingStatus:vt.ERROR,error:t.payload};case ft.CREATE_INSIGHT_ERROR:return{...e,listLoadingStatus:vt.ERROR,activeInsightLoadingStatus:vt.ERROR,error:t.payload};case ft.UPDATE_INSIGHT_ERROR:case ft.DELETE_INSIGHT_ERROR:return{...e,listLoadingStatus:vt.ERROR,error:t.payload};case ft.RUN_INSIGHT_START:return{...e,executionStatus:vt.LOADING,error:null};case ft.RUN_INSIGHT_STARTED:return{...e,executionTriggerId:t.payload.triggerId,error:null};case ft.RUN_INSIGHT_SUCCESS:return{...e,executionStatus:vt.LOADED,executionTriggerId:null,error:null};case ft.CLEAR_ERROR:return{...e,error:null};default:return e}}function ZI({children:e,initialState:t}){const[n,r]=h.useReducer(fue,t??oue);return a.jsx(qI.Provider,{value:{state:n,dispatch:r},children:e})}function hue(){return a.jsx(ZI,{children:a.jsx(Ub,{})})}function mue({status:e}){switch(e){case Mn.RUNNING:return a.jsx(Sr,{variant:"secondary",className:"text-primary bg-primary/10",children:"Running"});case Mn.SUCCESS:return a.jsx(Sr,{variant:"secondary",className:"bg-green-50 text-green-600 dark:bg-green-950 dark:text-green-400",children:"Success"});case Mn.FAILED:return a.jsx(Sr,{variant:"secondary",className:"bg-red-50 text-red-600 dark:bg-red-950 dark:text-red-400",children:"Failed"});case Mn.CANCELLED:return a.jsx(Sr,{variant:"secondary",className:"bg-gray-50 text-gray-500 dark:bg-gray-950 dark:text-gray-400",children:"Cancelled"});case Mn.INTERRUPTED:return a.jsx(Sr,{variant:"secondary",className:"bg-gray-50 text-gray-500 dark:bg-gray-950 dark:text-gray-400",children:"Interrupted"});case Mn.PENDING:return a.jsx(Sr,{variant:"secondary",className:"bg-gray-50 text-gray-500 dark:bg-gray-950 dark:text-gray-400",children:"Pending"});default:return a.jsx(Sr,{variant:"secondary",className:"bg-gray-50 text-gray-500 dark:bg-gray-950 dark:text-gray-400",children:"Unknown"})}}var ta=(e=>(e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.SYSTEM="SYSTEM",e))(ta||{}),vs=(e=>(e.STRUCTURED="structured",e.RAW="raw",e.CONFIGURATION="configuration",e))(vs||{});const sN=(e,t,n=!1)=>{var c,u,f,m;const r=e.split(`
|
|
808
|
-
`).filter(g=>g.trim()!=="");if(r.length>=3){const g=r[0],y=r[1],x=r.slice(2).join(`
|
|
809
|
-
`);if(g.includes("T")&&g.includes("Z")){const v=o1(x);return{id:`log-${t.toString()}`,timestamp:mu(g),level:n?ta.ERROR:ta.INFO,message:v.message,metadata:{at:(c=v.metadata)!=null&&c.at?mu(v.metadata.at):mu(g),type:((u=v.metadata)==null?void 0:u.type)??(y!=="unknown"?y:null)}}}}const s=/^\[(.*?)\]\s*\[(.*?)\]\s*(.*)$/.exec(e);if(s){const g=o1(s[3]);return{id:`log-${t.toString()}`,timestamp:mu(s[1]),level:n?ta.ERROR:s[2],message:g.message,metadata:(f=g.metadata)!=null&&f.at?{...g.metadata,at:mu(g.metadata.at)}:g.metadata}}const i=o1(e);return{id:`log-${t.toString()}`,timestamp:"N/A",level:n?ta.ERROR:ta.INFO,message:i.message,metadata:(m=i.metadata)!=null&&m.at?{...i.metadata,at:mu(i.metadata.at)}:i.metadata}},o1=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}},YI=e=>{var t;return(t=e.metadata)!=null&&t.type?e.metadata.type:e.level},pue=(e,t)=>{var i,c;let n="",r="";switch(e.type){case Ar.CONNECTOR:n=t??"",r="connector";break;case Ar.LOOKER_STUDIO:n="Looker Studio data fetching",r="report";break;case Ar.GOOGLE_SHEETS_EXPORT:case Ar.EMAIL:case Ar.SLACK:case Ar.MS_TEAMS:case Ar.GOOGLE_CHAT:n=((i=e.reportDefinition)==null?void 0:i.title)??"",r="report";break;case Ar.INSIGHT:n=((c=e.insightDefinition)==null?void 0:c.title)??"",r="insight";break}return[oee(`${e.triggerType} ${r} run`.trim()),n]},gue=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)},yue=e=>{const t=e.startedAt??e.createdAt;return jy(t.toISOString())},xue=e=>{const t=oN(e.startedAt),n=oN(e.finishedAt);let r="";return e.startedAt&&e.finishedAt&&(r=aee(e.startedAt,e.finishedAt)),{startedAt:t,finishedAt:n,duration:r}},oN=e=>e?jy(e.toISOString()):"N/A";function vue({logViewType:e,setLogViewType:t,searchTerm:n,setSearchTerm:r,run:s,cancelDataMartRun:i,dataMartId:c}){const u=g=>{g.stopPropagation()},f=async g=>{if(g.stopPropagation(),c)try{await i(c,s.id),Sn.success("Data mart run cancelled successfully")}catch(y){Sn.error(y instanceof Error?y.message:"Failed to cancel data mart run")}},m=g=>`px-3 py-2 text-sm font-medium transition-colors rounded-none ${g?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground hover:bg-accent"}`;return 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:g=>{g.stopPropagation(),t(vs.STRUCTURED)},className:`${m(e===vs.STRUCTURED)} rounded-l-lg`,children:"Structured"}),a.jsx("button",{onClick:g=>{g.stopPropagation(),t(vs.RAW)},className:`${m(e===vs.RAW)} rounded-none`,children:"Raw"}),a.jsx("button",{onClick:g=>{g.stopPropagation(),t(vs.CONFIGURATION)},className:`${m(e===vs.CONFIGURATION)} rounded-r-lg`,children:"Configuration"})]}),e!==vs.CONFIGURATION&&a.jsxs("div",{className:"relative",children:[a.jsx(vc,{className:"text-muted-foreground absolute top-2.5 left-2 h-4 w-4"}),a.jsx(Tt,{type:"text",placeholder:"Search logs...",value:n,onChange:g=>{r(g.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===Mn.RUNNING&&a.jsxs(Ce,{variant:"destructive",size:"sm",onClick:g=>void f(g),children:[a.jsx(Vu,{className:"h-4 w-4"}),"Cancel"]}),a.jsxs(Ce,{variant:"outline",size:"sm",onClick:g=>{g.stopPropagation(),gue(s)},className:"flex items-center gap-2",children:[a.jsx(uP,{className:"h-4 w-4"}),"JSON"]})]})]})}function bue(e){switch(e){case ta.INFO:return a.jsx(Br,{className:"h-3 w-3 text-blue-500"});case ta.WARNING:return a.jsx(Gg,{className:"h-3 w-3 text-yellow-500"});case ta.ERROR:return a.jsx(Zp,{className:"h-3 w-3 text-red-500"});case ta.SYSTEM:return a.jsx(lh,{className:"text-muted-foreground h-3 w-3"});default:return a.jsx(Br,{className:"text-muted-foreground h-3 w-3"})}}function Sue(e){switch(e){case ta.INFO:return"text-blue-600 dark:text-blue-400";case ta.WARNING:return"text-yellow-600 dark:text-yellow-400";case ta.ERROR:return"text-red-600 dark:text-red-400";case ta.SYSTEM:return"text-muted-foreground";default:return"text-muted-foreground"}}function Cue(e){return e===SD.SCHEDULED?a.jsx($b,{size:18}):a.jsx(iA,{size:18})}function Eue({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:[bue(r.level),a.jsx("span",{className:`text-xs font-medium ${Sue(r.level)}`,children:YI(r)})]}),a.jsx("div",{className:`min-w-0 flex-1 text-xs break-words ${r.level===ta.ERROR?"text-red-700 dark:text-red-300":"text-foreground"}`,children:r.message.includes(`
|
|
810
|
-
`)?a.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap",children:r.message}):a.jsx("span",{children:r.message})})]},r.id))})})}var Og=(e=>(e.ERROR="error",e.DEFAULT="default",e))(Og||{});function Ig({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:g=>{s(e,t),g.stopPropagation()},className:`${f} ${m}`,title:`Copy ${t} to clipboard`,children:i?a.jsx(a.Fragment,{children:u?a.jsx(ra,{className:"h-3 w-3"}):a.jsx(Hf,{className:"h-3 w-3"})}):u?a.jsxs(a.Fragment,{children:[a.jsx(ra,{className:"h-3 w-3"}),"Copied"]}):a.jsxs(a.Fragment,{children:[a.jsx(Hf,{className:"h-3 w-3"}),"Copy"]})})}function c2(){const[e,t]=h.useState(null),n=async(s,i)=>{try{await navigator.clipboard.writeText(s),t(i),setTimeout(()=>{t(null)},2e3)}catch(c){console.error("Failed to copy text: ",c)}};return{copiedSection:e,copyToClipboard:n,handleCopy:(s,i)=>{n(s,i)}}}function wue({logs:e,errors:t}){const{copiedSection:n,handleCopy:r}=c2(),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(lh,{className:"h-4 w-4 text-red-500"}),"Error Output:"]}),a.jsx(Ig,{text:t.join(`
|
|
811
|
-
`),section:"errors",variant:Og.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(Br,{className:"h-4 w-4 text-blue-500"}),"Standard Output:"]}),a.jsx(Ig,{text:e.join(`
|
|
812
|
-
`),section:"logs",variant:Og.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 Rue({definitionRun:e,reportDefinition:t,insightDefinition:n}){const{copiedSection:r,handleCopy:s}=c2(),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(Ig,{text:JSON.stringify(e,null,2),section:"configuration",variant:Og.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 Ks=18;function jue({type:e,base64Icon:t}){switch(e){case Ar.CONNECTOR:return t?a.jsx(Ec,{base64:t,size:Ks}):a.jsx(sc,{className:"text-muted-foreground",size:Ks});case Ar.GOOGLE_SHEETS_EXPORT:{const n=ea.getInfo(De.GOOGLE_SHEETS).icon;return a.jsx(n,{size:Ks})}case Ar.LOOKER_STUDIO:{const n=ea.getInfo(De.LOOKER_STUDIO).icon;return a.jsx(n,{size:Ks})}case Ar.EMAIL:{const n=ea.getInfo(De.EMAIL).icon;return a.jsx(n,{size:Ks})}case Ar.SLACK:{const n=ea.getInfo(De.SLACK).icon;return a.jsx(n,{size:Ks})}case Ar.MS_TEAMS:{const n=ea.getInfo(De.MS_TEAMS).icon;return a.jsx(n,{size:Ks})}case Ar.GOOGLE_CHAT:{const n=ea.getInfo(De.GOOGLE_CHAT).icon;return a.jsx(n,{size:Ks})}case Ar.INSIGHT:return a.jsx(Wi,{className:"text-brand-blue-500",size:Ks});default:return a.jsx(sc,{className:"text-muted-foreground",size:Ks})}}function Tue({run:e,isExpanded:t,onToggle:n,logViewType:r,setLogViewType:s,searchTerm:i,setSearchTerm:c,cancelDataMartRun:u,dataMartId:f,dataMartConnectorInfo:m}){const{copiedSection:g,handleCopy:y}=c2(),x=h.useMemo(()=>{if(e.logs.length===0&&e.errors.length===0)return[];const j=e.logs.map((O,I)=>sN(O,I)),_=e.errors.map((O,I)=>sN(O,e.logs.length+I,!0));return[...j,..._].filter(O=>{const I=YI(O);return i===""||O.message.toLowerCase().includes(i.toLowerCase())||I.toLowerCase().includes(i.toLowerCase())})},[e.logs,e.errors,i]),v=h.useCallback(()=>r===vs.STRUCTURED?a.jsx(Eue,{logs:x}):r===vs.RAW?a.jsx(wue,{logs:e.logs,errors:e.errors}):a.jsx(Rue,{definitionRun:e.definitionRun,reportDefinition:e.reportDefinition,insightDefinition:e.insightDefinition}),[r,x,e.logs,e.errors,e.definitionRun,e.reportDefinition,e.insightDefinition]),S=yue(e),C=xue(e),[E,R]=pue(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(jue,{type:e.type,base64Icon:m==null?void 0:m.logoBase64})}),a.jsxs(Nt,{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:S})}),a.jsx(Dt,{children:a.jsxs("div",{className:"space-y-1",children:[a.jsxs("div",{children:["Started At: ",C.startedAt]}),a.jsxs("div",{children:["Finished At: ",C.finishedAt]}),C.duration&&a.jsxs("div",{children:["Duration: ",C.duration]})]})})]}),a.jsxs("div",{className:"text-muted-foreground flex items-center gap-2 text-sm",children:[Cue(e.triggerType),a.jsxs("span",{className:"inline-flex items-center",children:[E,e.createdByUser&&a.jsxs(a.Fragment,{children:[" by ",a.jsx(vO,{userProjection:e.createdByUser})]}),R&&a.jsxs(a.Fragment,{children:[" • ",R]})]})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(mue,{status:e.status}),a.jsx(Ra,{className:`text-muted-foreground h-4 w-4 transition-transform ${t?"rotate-90":""}`})]})]}),t&&a.jsxs("div",{className:"border-border bg-muted/30 space-y-4 border-t p-4",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsxs("h3",{className:"text-foreground mr-2 font-medium",children:["Run ID: ",e.id]}),a.jsx(Ig,{text:e.id,section:"run-id",onCopy:y,copiedSection:g,iconOnly:!0})]}),a.jsx(vue,{logViewType:r,setLogViewType:s,searchTerm:i,setSearchTerm:c,run:e,cancelDataMartRun:u,dataMartId:f}),v()]})]})}function _ue(){const{dataMart:t,getDataMartRuns:n,loadMoreDataMartRuns:r,cancelDataMartRun:s,runs:i=[],isLoading:c}=qa(),[u,f]=h.useState(!1),[m,g]=h.useState(!0),[y,x]=h.useState(0),[v,S]=h.useState(null),[C,E]=h.useState(vs.STRUCTURED),[R,j]=h.useState(""),_=h.useCallback(async()=>{if(!(t!=null&&t.id))return;const T=await n(t.id,20,0);x(T.length),g(T.length===20)},[t==null?void 0:t.id,n,20]),A=h.useCallback(async()=>{if(!(t!=null&&t.id)||u)return;f(!0);const T=await r(t.id,y,20);x(D=>D+T.length),g(T.length===20),f(!1)},[t==null?void 0:t.id,r,y,u,20]);h.useEffect(()=>{t!=null&&t.id&&_()},[t==null?void 0:t.id,_]);const O=h.useMemo(()=>(t==null?void 0:t.definitionType)===$e.CONNECTOR&&t.definition&&"connector"in t.definition?t.definition.connector.info??null:null,[t]),I=T=>{S(v===T?null:T)};return c?a.jsx(BI,{}):a.jsx("div",{className:"flex flex-col gap-4 pb-4",children:i.length===0?a.jsx("div",{className:"text-muted-foreground py-8 text-center",children:"No runs found for this Data Mart"}):a.jsxs("div",{className:"space-y-2",children:[i.map(T=>a.jsx(Tue,{run:T,isExpanded:v===T.id,onToggle:I,logViewType:C,setLogViewType:E,searchTerm:R,setSearchTerm:j,cancelDataMartRun:s,dataMartId:t==null?void 0:t.id,dataMartConnectorInfo:O},T.id)),m&&a.jsx("div",{className:"flex justify-center pt-4",children:a.jsx(Lu,{variant:"outline",size:"sm",onClick:()=>void A(),disabled:u,className:"flex items-center gap-2",children:u?a.jsxs(a.Fragment,{children:[a.jsx(SU,{className:"h-4 w-4 animate-spin"}),"Loading..."]}):"Load More"})})]})})}const Nue=5e3,Aue=20;function Due(){const{dataMart:e,getDataMartRuns:t}=Ps();return i2({enabled:!!(e!=null&&e.id),intervalMs:Nue,onTick:()=>{e!=null&&e.id&&t(e.id,Aue,0,{silent:!0})}}),a.jsx("div",{className:"flex flex-col gap-4",children:a.jsxs(ol,{collapsible:!1,name:"run-history",children:[a.jsx(ao,{children:a.jsx(ro,{icon:zP,tooltip:"View all Data Mart execution runs with detailed logs and errors",children:"Run History"})}),a.jsx(so,{children:a.jsx(_ue,{})})]})})}function Oue(){const e=tI(),{navigate:t}=ii(),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(hC,{children:a.jsx(NO,{children:a.jsx(Vte,{initialData:{title:(e==null?void 0:e.datamartTitle)??"New Data Mart"},onSuccess:n})})})]})})})}function WI({isOpen:e,onClose:t,id:n}){const{getDataStorageById:r,currentDataStorage:s,loading:i,clearCurrentDataStorage:c}=Oy();h.useEffect(()=>(e&&n&&r(n),()=>{e||c()}),[e,n,r,c]);const u=()=>{c(),t()};return a.jsx(WS,{open:e,onOpenChange:f=>{f||u()},children:a.jsxs(QS,{children:[a.jsxs(XS,{children:[a.jsx(JS,{children:"Storage Details"}),a.jsx(eC,{children:"View detailed information about this storage."})]}),a.jsx("div",{className:"py-4",children:a.jsx(dW,{dataStorage:s,isLoading:i})})]})})}const Iue=({id:e,onViewDetails:t,onEdit:n,onDelete:r})=>{const[s,i]=h.useState(!1);return a.jsx("div",{className:"text-right",children:a.jsxs(Lr,{open:s,onOpenChange:i,children:[a.jsx(Pr,{asChild:!0,children:a.jsx(Ce,{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(Is,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsxs(Ur,{align:"end",children:[a.jsxs(Ot,{onClick:()=>t==null?void 0:t(e),children:[a.jsx(nA,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),a.jsx("span",{children:"View details"})]}),a.jsxs(Ot,{onClick:()=>void(n==null?void 0:n(e)),children:[a.jsx(td,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),a.jsx("span",{children:"Edit"})]}),a.jsx(wa,{}),a.jsxs(Ot,{onClick:()=>r==null?void 0:r(e),children:[a.jsx(us,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),a.jsx("span",{className:"text-red-600",children:"Delete"})]})]})]})})},Mue=({onViewDetails:e,onEdit:t,onDelete:n}={})=>[{accessorKey:"title",size:50,header:({column:r})=>a.jsx(pr,{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(pr,{column:r,children:"Type"}),cell:({row:r})=>{const s=r.getValue("type"),{displayName:i,icon:c}=yl.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(pr,{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(dd,{table:r}),cell:({row:r})=>a.jsx(Iue,{id:r.original.id,onViewDetails:e,onEdit:t,onDelete:n})}];function kue({onOpenTypeDialog:e}){return a.jsxs("div",{className:"dm-empty-state",children:[a.jsx(eA,{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(Ce,{variant:"outline",onClick:e,children:[a.jsx(ua,{className:"h-4 w-4"}),"New Storage"]})]})}function Lue({columns:e,data:t,onEdit:n,onOpenTypeDialog:r}){var R;const{sorting:s,setSorting:i,columnVisibility:c,setColumnVisibility:u}=Rc({columns:e,storageKeyPrefix:"data-storage-list"}),[f,m]=h.useState([]),[g,y]=h.useState({}),[x,v]=h.useState(!1),[S]=h.useState(null),C=vl({data:t,columns:[...e],getCoreRowModel:xl(),getPaginationRowModel:Dh(),onSortingChange:i,getSortedRowModel:wc(),onColumnFiltersChange:m,getFilteredRowModel:ud(),onColumnVisibilityChange:u,onRowSelectionChange:y,state:{sorting:s,columnFilters:f,columnVisibility:c,rowSelection:g},enableRowSelection:!0}),E=(j,_)=>{_.target instanceof HTMLElement&&(_.target.closest('[role="checkbox"]')||_.target.closest(".actions-cell")||_.target.closest('[role="menuitem"]'))||n==null||n(j)};return t.length?a.jsxs("div",{children:[S&&a.jsx(WI,{isOpen:x,onClose:()=>{v(!1)},id:S.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(vc,{className:"dm-card-toolbar-search-icon"}),a.jsx(Tt,{placeholder:"Search by title",value:(R=C.getColumn("title"))==null?void 0:R.getFilterValue(),onChange:j=>{var _;return(_=C.getColumn("title"))==null?void 0:_.setFilterValue(j.target.value)},className:"dm-card-toolbar-search-input"})]})}),a.jsx("div",{className:"dm-card-toolbar-right",children:a.jsxs(Ce,{variant:"outline",className:"dm-card-toolbar-btn-primary",onClick:()=>{r==null||r()},children:[a.jsx(ua,{className:"h-4 w-4"}),"New Storage"]})})]}),a.jsx("div",{className:"dm-card-table-wrap",children:a.jsxs(bl,{className:"dm-card-table",role:"table","aria-label":"Storages table",children:[a.jsx(Sl,{className:"dm-card-table-header",children:C.getHeaderGroups().map(j=>a.jsx(Tn,{className:"dm-card-table-header-row",children:j.headers.map(_=>a.jsx(El,{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:Yu(_.column.columnDef.header,_.getContext())},_.id))},j.id))}),a.jsx(Cl,{className:"dm-card-table-body",children:C.getRowModel().rows.length?C.getRowModel().rows.map(j=>a.jsx(Tn,{"data-state":j.getIsSelected()&&"selected",className:"dm-card-table-body-row group",onClick:_=>{const A=j.original.id;E(A,_)},children:j.getVisibleCells().map(_=>a.jsx(Mr,{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:Yu(_.column.columnDef.cell,_.getContext())},_.id))},j.id)):a.jsx(Tn,{children:a.jsx(Mr,{colSpan:e.length+1,className:"dm-card-table-body-row-empty",children:"No results"})})})]})}),a.jsxs("div",{className:"dm-card-pagination",children:[a.jsx(Ce,{variant:"outline",size:"sm",onClick:()=>{C.previousPage()},disabled:!C.getCanPreviousPage(),children:"Previous"}),a.jsx(Ce,{variant:"outline",size:"sm",onClick:()=>{C.nextPage()},disabled:!C.getCanNextPage(),children:"Next"})]})]})]}):a.jsx("div",{className:"dm-card",children:a.jsx(kue,{onOpenTypeDialog:r})})}const Pue=({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:g,deleteDataStorage:y,createDataStorage:x}=Oy();h.useEffect(()=>{m()},[m]),h.useEffect(()=>{r(e)},[e]);const v=()=>{r(!1),t==null||t()},[S,C]=h.useState(!1),[E,R]=h.useState(!1),[j,_]=h.useState(null),[A,O]=h.useState(!1),[I,T]=h.useState(null),D=async K=>{i(!0);try{const se=await x(K);v(),se!=null&&se.id&&(await g(se.id),C(!0),i(!1))}catch(se){console.error("Failed to create storage:",se)}},L=K=>{T(K),O(!0)},H=()=>{O(!1),T(null)},B=async K=>{await g(K),C(!0)},q=K=>{_(K),R(!0)},Z=async()=>{if(j)try{await y(j),await m()}catch(K){console.error("Failed to delete storage:",K)}finally{R(!1),_(null)}},F=async()=>{try{C(!1),await m()}catch(K){console.error("Failed to save storage:",K)}},z=()=>{C(!1),f()},M=c.map(K=>({id:K.id,title:K.title,type:K.type,createdAt:K.createdAt,modifiedAt:K.modifiedAt})),V=Mue({onViewDetails:L,onEdit:B,onDelete:q});return a.jsxs("div",{children:[a.jsx(Lue,{columns:V,data:M,onEdit:B,onOpenTypeDialog:()=>{r(!0)}}),a.jsx(WI,{isOpen:A,onClose:H,id:I??""}),a.jsx(j5,{isOpen:n,onClose:v,onSelect:D,isCreatingDataStorage:s}),a.jsx(k6,{isOpen:S,onClose:z,dataStorage:u,onSaveSuccess:()=>void F()}),a.jsx(yr,{open:E,onOpenChange:R,title:"Delete Storage",description:"Are you sure you want to delete this storage? This action cannot be undone.",confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:()=>{Z()},onCancel:()=>{_(null)},variant:"destructive"})]})},Uue=()=>{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(hC,{children:a.jsx(Pue,{initialTypeDialogOpen:e,onTypeDialogClose:()=>{t(!1)}})})})]})};function Fue({onOpenTypeDialog:e}){return a.jsxs("div",{className:"dm-empty-state",children:[a.jsx(Vb,{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(Ce,{variant:"outline",onClick:e,children:[a.jsx(ua,{className:"h-4 w-4"}),"New Destination"]})]})}function zue({columns:e,data:t,onEdit:n,onOpenTypeDialog:r}){var S;const{sorting:s,setSorting:i,columnVisibility:c,setColumnVisibility:u}=Rc({columns:e,storageKeyPrefix:"data-destination-list"}),[f,m]=h.useState([]),[g,y]=h.useState({}),x=vl({data:t,columns:[...e],getCoreRowModel:xl(),getPaginationRowModel:Dh(),onSortingChange:i,getSortedRowModel:wc(),onColumnFiltersChange:m,getFilteredRowModel:ud(),onColumnVisibilityChange:u,onRowSelectionChange:y,state:{sorting:s,columnFilters:f,columnVisibility:c,rowSelection:g},enableRowSelection:!0}),v=(C,E)=>{E.target instanceof HTMLElement&&(E.target.closest('[role="checkbox"]')||E.target.closest(".actions-cell")||E.target.closest('[role="menuitem"]'))||n==null||n(C)};return t.length?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(vc,{className:"dm-card-toolbar-search-icon"}),a.jsx(Tt,{placeholder:"Search by title",value:(S=x.getColumn("title"))==null?void 0:S.getFilterValue(),onChange:C=>{var E;return(E=x.getColumn("title"))==null?void 0:E.setFilterValue(C.target.value)},className:"dm-card-toolbar-search-input"})]})}),a.jsx("div",{className:"dm-card-toolbar-right",children:a.jsxs(Ce,{variant:"outline",className:"dm-card-toolbar-btn-primary",onClick:()=>{r==null||r()},children:[a.jsx(ua,{className:"h-4 w-4"}),"New Destination"]})})]}),a.jsx("div",{className:"dm-card-table-wrap",children:a.jsxs(bl,{className:"dm-card-table",role:"table","aria-label":"Destinations table",children:[a.jsx(Sl,{className:"dm-card-table-header",children:x.getHeaderGroups().map(C=>a.jsx(Tn,{className:"dm-card-table-header-row",children:C.headers.map(E=>a.jsx(El,{className:"[&:has([role=checkbox])]:pl-6 [&>[role=checkbox]]:translate-y-[2px]",style:E.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(E.getSize())}%`},children:E.isPlaceholder?null:Yu(E.column.columnDef.header,E.getContext())},E.id))},C.id))}),a.jsx(Cl,{className:"dm-card-table-body",children:x.getRowModel().rows.length?x.getRowModel().rows.map(C=>a.jsx(Tn,{"data-state":C.getIsSelected()&&"selected",className:"dm-card-table-body-row group",onClick:E=>{const R=C.original.id;v(R,E)},children:C.getVisibleCells().map(E=>a.jsx(Mr,{className:`[&:has([role=checkbox])]pr-0 px-6 whitespace-normal [&>[role=checkbox]]:translate-y-[2px] ${E.column.id==="actions"?"actions-cell":""} ${E.column.id==="createdAt"?"whitespace-nowrap":""}`,style:E.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(E.column.getSize())}%`},children:Yu(E.column.columnDef.cell,E.getContext())},E.id))},C.id)):a.jsx(Tn,{children:a.jsx(Mr,{colSpan:e.length+1,className:"dm-card-table-body-row-empty",children:"No results"})})})]})}),a.jsxs("div",{className:"dm-card-pagination",children:[a.jsx(Ce,{variant:"outline",size:"sm",onClick:()=>{x.previousPage()},disabled:!x.getCanPreviousPage(),children:"Previous"}),a.jsx(Ce,{variant:"outline",size:"sm",onClick:()=>{x.nextPage()},disabled:!x.getCanNextPage(),children:"Next"})]})]})}):a.jsx("div",{className:"dm-card",children:a.jsx(Fue,{onOpenTypeDialog:r})})}function u2(e){return"destinationSecretKey"in e}const Hue=({id:e,type:t,credentials:n,onEdit:r,onDelete:s,onRotateSecretKey:i})=>{const[c,u]=h.useState(!1),f=()=>{if(n&&u2(n)){const y=PS(n);navigator.clipboard.writeText(y),Mt.success("JSON Config copied to clipboard")}},m=t===De.LOOKER_STUDIO,g=n&&"destinationSecretKey"in n&&n.destinationSecretKey;return a.jsx(a.Fragment,{children:a.jsx("div",{className:"text-right",children:a.jsxs(Lr,{open:c,onOpenChange:u,children:[a.jsx(Pr,{asChild:!0,children:a.jsx(Ce,{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(Is,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsxs(Ur,{align:"end",children:[a.jsxs(Ot,{onClick:()=>void(r==null?void 0:r(e)),children:[a.jsx(td,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),a.jsx("span",{children:"Edit"})]}),m&&g&&a.jsxs(a.Fragment,{children:[a.jsx(wa,{}),a.jsxs(Ot,{onClick:f,children:[a.jsx(Hf,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),a.jsx("span",{children:"Copy JSON Config"})]}),a.jsxs(Ot,{onClick:()=>{i==null||i(e)},children:[a.jsx(b1,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),a.jsx("span",{children:"Rotate Secret Key"})]})]}),a.jsx(wa,{}),a.jsxs(Ot,{onClick:()=>s==null?void 0:s(e),children:[a.jsx(us,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),a.jsx("span",{className:"text-red-600",children:"Delete"})]})]})]})})})},Vue=({onEdit:e,onDelete:t,onRotateSecretKey:n}={})=>[{accessorKey:"title",size:50,header:({column:r})=>a.jsx(pr,{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(pr,{column:r,children:"Type"}),cell:({row:r})=>{const s=r.getValue("type"),{displayName:i,icon:c}=ea.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(pr,{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(dd,{table:r}),cell:({row:r})=>a.jsx(Hue,{id:r.original.id,type:r.original.type,credentials:r.original.credentials,onEdit:e,onDelete:t,onRotateSecretKey:n})}];function $ue(){return a.jsx(dn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Gt,{value:"service-account-details",children:[a.jsx(Bt,{children:"How do I get a Service Account JSON key?"}),a.jsxs(qt,{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(rn,{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 Gue({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?_O(i):null;return a.jsx(Et,{control:e.control,name:"credentials.serviceAccount",render:({field:u})=>a.jsxs(yt,{children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(gt,{tooltip:"Paste a JSON key from a service account that has access to the selected destination provider",children:"Service Account"}),!t&&i&&a.jsx(Ce,{variant:"ghost",size:"sm",onClick:r,type:"button",children:"Edit"}),t&&a.jsx(Ce,{variant:"ghost",size:"sm",onClick:s,type:"button",children:"Cancel"})]}),a.jsx(St,{children:!t&&c?a.jsxs(Nt,{children:[a.jsx(At,{asChild:!0,children:a.jsx(rn,{href:c.url,children:c.email})}),a.jsx(Dt,{children:a.jsx("p",{children:"View in Google Cloud Console"})})]}):a.jsx(po,{...u,className:"min-h-[150px] font-mono",rows:8,placeholder:"Paste your service account JSON here"})}),a.jsx(an,{children:a.jsx($ue,{})}),a.jsx(_t,{})]})})}function Bue(){return a.jsx(dn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Gt,{value:"json-config-details",children:[a.jsx(Bt,{children:"What is the JSON Config for Looker Studio?"}),a.jsxs(qt,{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 que({form:e}){const t=e.getValues("credentials"),n=h.useMemo(()=>t&&u2(t)?t:{deploymentUrl:"",destinationId:"",destinationSecretKey:""},[t]),r=h.useMemo(()=>PS(n),[n]);return a.jsx(a.Fragment,{children:n.destinationSecretKey&&a.jsx(Et,{control:e.control,name:"credentials.destinationSecretKey",render:()=>a.jsxs(yt,{children:[a.jsx(gt,{children:"JSON Config"}),a.jsx(St,{children:a.jsx(rD,{value:r,displayOnly:!0,keysToMask:["destinationSecretKey"],className:"bg-muted overflow-auto rounded-md text-sm",showCopyButton:!0})}),a.jsx(_t,{}),a.jsx(an,{children:a.jsx(Bue,{})})]})})})}const QI="credentials.to",Kue=/[,;\n]/,Zue=", ",XI="Enter emails separated by comma, semicolon or newline",Yue="Emails list";function iN(e){const t=new Set,n=[];for(const r of e.split(Kue)){const s=r.trim();if(!s)continue;const i=s.toLowerCase();t.has(i)||(t.add(i),n.push(s))}return n}function i1(e){return e.join(Zue)}function lN(e,t){e.setValue(QI,t,{shouldDirty:!0,shouldTouch:!0})}function Wue({field:e,form:t}){const n=Array.isArray(e.value)?i1(e.value):"",[r,s]=h.useState(n),[i,c]=h.useState(!1),u=Array.isArray(e.value)?i1(e.value):"";h.useEffect(()=>{i||s(u)},[u,i]);const f=y=>{const x=y.target.value;s(x),lN(t,iN(x))},m=()=>{c(!0)},g=y=>{c(!1),e.onBlur();const x=iN(y.target.value);lN(t,x),s(i1(x))};return a.jsx(po,{name:e.name,ref:e.ref,onFocus:m,onBlur:g,value:r,onChange:f,className:"min-h-[150px] font-mono",rows:8,placeholder:XI})}function Tp({form:e,emailsFieldTitle:t=Yue}){return a.jsx(Et,{control:e.control,name:QI,render:({field:n})=>a.jsxs(yt,{children:[a.jsx("div",{className:"flex items-center justify-between",children:a.jsx(gt,{tooltip:XI,children:t})}),a.jsx(St,{children:a.jsx(Wue,{field:n,form:e})}),a.jsx(_t,{})]})})}function Que(){return a.jsxs(Gt,{value:"sheets-api-details",children:[a.jsx(Bt,{children:"How do I enable the Google Sheets API?"}),a.jsxs(qt,{children:[a.jsxs("p",{className:"mb-2",children:["To send data to Google Sheets, you need to enable the"," ",a.jsx(rn,{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 Xue(){return a.jsxs(Gt,{value:"looker-studio-details",children:[a.jsx(Bt,{children:"How do I connect to Looker Studio?"}),a.jsxs(qt,{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(rn,{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(rn,{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 Jue(){return a.jsxs(Gt,{value:"odata-details",children:[a.jsx(Bt,{children:"How do I use OData?"}),a.jsxs(qt,{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 ede(){return a.jsxs(Gt,{value:"email-details",children:[a.jsx(Bt,{children:"How do I start sending Email?"}),a.jsxs(qt,{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(rn,{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 tde(){return a.jsxs(Gt,{value:"slack-details",children:[a.jsx(Bt,{children:"How do I start sending to Slack?"}),a.jsxs(qt,{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(rn,{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 nde(){return a.jsxs(Gt,{value:"msteams-details",children:[a.jsx(Bt,{children:"How do I start sending to Microsoft Teams?"}),a.jsxs(qt,{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(rn,{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 rde(){return a.jsxs(Gt,{value:"googlechat-details",children:[a.jsx(Bt,{children:"How do I start sending to Google Chat?"}),a.jsxs(qt,{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(rn,{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 ade={[De.GOOGLE_SHEETS]:Que,[De.LOOKER_STUDIO]:Xue,[De.ODATA]:Jue,[De.EMAIL]:ede,[De.SLACK]:tde,[De.MS_TEAMS]:nde,[De.GOOGLE_CHAT]:rde};function sde({destinationType:e}){const t=ade[e];return a.jsx(dn,{variant:"common",type:"single",collapsible:!0,children:a.jsx(t,{})})}function ode({form:e,initialData:t}){const{flags:n}=Sh();return a.jsx(Et,{control:e.control,name:"type",render:({field:r})=>a.jsxs(yt,{children:[a.jsx(gt,{tooltip:"Select the destination to send your data",children:"Destination Type"}),a.jsxs(oa,{onValueChange:r.onChange,defaultValue:r.value,disabled:!!t,children:[a.jsx(St,{children:a.jsx(la,{className:"w-full",children:a.jsx(ia,{placeholder:"Select a destination type"})})}),a.jsx(ca,{children:a.jsx(Dy,{children:ea.getAllTypes().map(({type:s,displayName:i,icon:c,status:u})=>{const f=u===xs.COMING_SOON,m=u===xs.CLOUD_ONLY&&iee(n);return a.jsx(a.Fragment,{children:m?a.jsxs(Nt,{children:[a.jsx(At,{asChild:!0,children:a.jsx("div",{children:a.jsx(Ln,{value:s,disabled:!0,children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(c,{size:18}),i,a.jsx(Sr,{variant:"secondary",children:"Cloud & Enterprise"})]})},s)})}),a.jsxs(Dt,{side:"left",align:"start",className:"w-[220px]",children:["Available only in"," ",a.jsxs(na,{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(Wo,{className:"h-3 w-3"})]})," ","or with"," ",a.jsxs(na,{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(Wo,{className:"h-3 w-3"})]}),"."]})]}):a.jsx(Ln,{value:s,disabled:f,children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(c,{size:18}),i,f&&a.jsx(Sr,{variant:"outline",children:u})]})},s)})})})})]}),r.value&&a.jsx(an,{children:a.jsx(sde,{destinationType:r.value})}),a.jsx(_t,{})]})})}function ide({initialData:e,onSubmit:t,onCancel:n,onDirtyChange:r}){const s=go({resolver:ui(iQ),defaultValues:e??{title:"New Destination",type:De.GOOGLE_SHEETS},mode:"onTouched"}),i=s.watch("type");h.useEffect(()=>{r==null||r(s.formState.isDirty)},[s.formState.isDirty,r]);const c=async u=>{const{dirtyFields:f}=s.formState,m=TO(u);return f.credentials||delete m.credentials,t(m)};return a.jsx(wl,{...s,children:a.jsxs(ci,{onSubmit:u=>{s.handleSubmit(c)(u)},children:[a.jsxs(Rl,{children:[a.jsx(Et,{control:s.control,name:"title",render:({field:u})=>a.jsxs(yt,{children:[a.jsx(gt,{tooltip:"Name the destination to clarify its purpose",children:"Title"}),a.jsx(St,{children:a.jsx(Tt,{placeholder:"Enter title",...u})}),a.jsx(_t,{})]})}),a.jsx(ode,{form:s,initialData:e}),i===De.GOOGLE_SHEETS&&a.jsx(Gue,{form:s}),i===De.LOOKER_STUDIO&&a.jsx(que,{form:s}),i===De.EMAIL&&a.jsx(Tp,{form:s,emailsFieldTitle:"Enter user emails list"}),i===De.SLACK&&a.jsx(Tp,{form:s,emailsFieldTitle:"Enter Slack channel emails list"}),i===De.MS_TEAMS&&a.jsx(Tp,{form:s,emailsFieldTitle:"Enter Microsoft Teams channel emails list"}),i===De.GOOGLE_CHAT&&a.jsx(Tp,{form:s,emailsFieldTitle:"Enter Google Chat channel emails list"})]}),a.jsxs(jl,{children:[a.jsxs(Ce,{variant:"default",type:"submit",className:"w-full","aria-label":"Save",disabled:!s.formState.isDirty||s.formState.isSubmitting,children:[s.formState.isSubmitting&&a.jsx(ed,{className:"mr-2 h-4 w-4 animate-spin"}),"Save"]}),a.jsx(Ce,{variant:"outline",type:"button",onClick:n,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})}function lde({isOpen:e,onClose:t,dataDestination:n,onSaveSuccess:r}){const{updateDataDestination:s,createDataDestination:i}=Ah(),[c,u]=h.useState(!1),[f,m]=h.useState(!1),g=h.useCallback(()=>{f?u(!0):t()},[f,t]),y=h.useCallback(()=>{u(!1),m(!1),t()},[t]),x=h.useCallback(C=>{m(C)},[]),v=async C=>{const E=zD.getMapper(C.type);if(n){const R=E.mapToUpdateRequest(C),j=await s(n.id,R);j&&r(j)}else{const R=E.mapToCreateRequest(C),j=await i(R);j&&r(j)}t()},S=h.useRef(!1);return h.useEffect(()=>{const C=n?"Edit":"Create";e&&!S.current?(Ie({event:"data_destination_config_open",category:"DataDestination",action:C,label:n==null?void 0:n.type}),S.current=!0):!e&&S.current&&(Ie({event:"data_destination_config_close",category:"DataDestination",action:C,label:n==null?void 0:n.type}),S.current=!1)},[e,n]),a.jsxs(a.Fragment,{children:[a.jsx(ni,{open:e,onOpenChange:C=>{C||g()},children:a.jsxs(ri,{children:[a.jsxs(ai,{children:[a.jsx(si,{children:"Configure destination"}),a.jsx(hl,{children:"Customize settings for your destination"})]}),a.jsx(ide,{initialData:n??void 0,onSubmit:v,onCancel:g,onDirtyChange:x})]})}),a.jsx(yr,{open:c,onOpenChange:u,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:y,variant:"destructive"})]})}const cde=({isCreateSheetInitiallyOpen:e=!1,onCreateSheetClose:t})=>{const{dataDestinations:n,currentDataDestination:r,clearCurrentDataDestination:s,fetchDataDestinations:i,getDataDestinationById:c,deleteDataDestination:u,rotateSecretKey:f}=Ah(),m=h.useCallback(()=>{s(),y(!0),t==null||t()},[s,t]),[g,y]=h.useState(!1),[x,v]=h.useState(!1),[S,C]=h.useState(!1),[E,R]=h.useState(null),[j,_]=h.useState(null);h.useEffect(()=>{i()},[i]),h.useEffect(()=>{e&&m()},[e,m]);const A=async Z=>{await c(Z),y(!0)},O=Z=>{R(Z),v(!0)},I=Z=>{_(Z),C(!0)},T=async()=>{if(j)try{const Z=await f(j);if(u2(Z.credentials)){Mt.success("New JSON Config copied to clipboard");const F=PS(Z.credentials);navigator.clipboard.writeText(F)}await i()}catch(Z){console.error("Failed to rotate secret key:",Z)}finally{C(!1),_(null)}},D=async()=>{if(E)try{await u(E),await i()}catch(Z){console.error("Failed to delete destination:",Z)}finally{v(!1),R(null)}},L=async()=>{try{y(!1),await i()}catch(Z){console.error("Failed to save destination:",Z)}},H=()=>{y(!1),s()},B=n.map(Z=>({id:Z.id,title:Z.title,type:Z.type,createdAt:Z.createdAt,modifiedAt:Z.modifiedAt,credentials:Z.credentials})),q=Vue({onEdit:A,onDelete:O,onRotateSecretKey:I});return a.jsxs("div",{children:[a.jsx(zue,{columns:q,data:B,onEdit:A,onDelete:O,onRotateSecretKey:I,onOpenTypeDialog:m}),a.jsx(lde,{isOpen:g,onClose:H,dataDestination:r,onSaveSuccess:()=>void L()}),a.jsx(yr,{open:x,onOpenChange:v,title:"Delete Destination",description:"Are you sure you want to delete this destination? This action cannot be undone.",confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:()=>{D()},onCancel:()=>{R(null)},variant:"destructive"}),a.jsx(yr,{open:S,onOpenChange:C,title:"Rotate Secret Key",description:"Rotating the secret key will invalidate the previous key",confirmLabel:"Rotate Key",cancelLabel:"Cancel",onConfirm:()=>void T(),onCancel:()=>{C(!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?"})]})})]})},ude=()=>{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(Nh,{children:a.jsx(cde,{isCreateSheetInitiallyOpen:e,onCreateSheetClose:()=>{t(!1)}})})})]})};function Eb({className:e,...t}){return a.jsx("div",{"data-slot":"empty",className:re("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 wb({className:e,...t}){return a.jsx("div",{"data-slot":"empty-header",className:re("flex max-w-sm flex-col items-center gap-2 text-center",e),...t})}const dde=Ju("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 Rb({className:e,variant:t="default",...n}){return a.jsx("div",{"data-slot":"empty-icon","data-variant":t,className:re(dde({variant:t,className:e})),...n})}function jb({className:e,...t}){return a.jsx("div",{"data-slot":"empty-title",className:re("text-muted-foreground text-lg font-medium tracking-tight",e),...t})}function Tb({className:e,...t}){return a.jsx("div",{"data-slot":"empty-description",className:re("text-muted-foreground [&>a:hover]:text-primary text-sm/relaxed [&>a]:underline [&>a]:underline-offset-4",e),...t})}function fde({className:e,...t}){return a.jsx("div",{"data-slot":"empty-content",className:re("flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance",e),...t})}const hde=()=>{const e=xc(),{createInsight:t,insightLoading:n}=l2(),r=()=>{(async()=>{const s=await t({title:"Untitled insight"});s&&e(s.id)})()};return a.jsxs(Eb,{children:[a.jsxs(wb,{children:[a.jsx(Rb,{variant:"icon",children:a.jsx(Wi,{})}),a.jsx(jb,{children:"Create your first Insight"}),a.jsx(Tb,{children:"Create an Insight to prompt your Data Mart and discover the story behind your data."})]}),a.jsx(fde,{children:a.jsxs(Ce,{variant:"outline",onClick:r,disabled:n,children:[a.jsx(ua,{className:"h-4 w-4"}),"New Insight"]})})]})};function mde({id:e,onDelete:t}){const[n,r]=h.useState(!1);return a.jsx("div",{className:"text-right",onClick:s=>{s.stopPropagation()},children:a.jsxs(Lr,{open:n,onOpenChange:r,children:[a.jsx(Pr,{asChild:!0,children:a.jsx(Ce,{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(Is,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsx(Ur,{align:"end",children:a.jsxs(Ot,{className:"text-destructive",onClick:()=>t==null?void 0:t(e),children:[a.jsx(us,{className:"h-4 w-4 text-red-600"}),a.jsx("span",{className:"text-red-600",children:"Delete insight"})]})})]})})}const pde=({onDelete:e}={})=>[{accessorKey:"title",size:50,header:({column:t})=>a.jsx(pr,{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(pr,{column:t,children:"Last run"}),cell:({row:t})=>{const n=t.getValue("lastRun");return a.jsx("div",{className:"text-muted-foreground",children:RO(n)})},meta:{title:"Last run"}},{id:"actions",size:80,header:({table:t})=>a.jsx(dd,{table:t}),cell:({row:t})=>a.jsx(mde,{id:t.original.id,onDelete:e}),meta:{title:"Actions"}}];function gde({items:e,onRowClick:t,onDelete:n}){const r=h.useMemo(()=>pde({onDelete:n}),[n]),{sorting:s,setSorting:i,columnVisibility:c,setColumnVisibility:u}=Rc({columns:r,storageKeyPrefix:"data-mart-insights",defaultSortingColumn:"lastRun"}),f=vl({data:e,columns:r,getCoreRowModel:xl(),getPaginationRowModel:Dh(),onSortingChange:i,getSortedRowModel:wc(),getFilteredRowModel:ud(),state:{sorting:s,columnVisibility:c},onColumnVisibilityChange:u,enableGlobalFilter:!0,enableColumnResizing:!1}),m=h.useCallback(()=>{f.previousPage()},[f]),g=h.useCallback(()=>{f.nextPage()},[f]);return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"dm-card-table-wrap",children:a.jsxs(bl,{id:"insights-table",className:"dm-card-table",role:"table","aria-label":"Insights",children:[a.jsx(Sl,{className:"dm-card-table-header",children:f.getHeaderGroups().map(x=>a.jsx(Tn,{className:"dm-card-table-header-row",children:x.headers.map(v=>a.jsx(El,{scope:"col",style:v.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(v.getSize())}%`},children:v.isPlaceholder?null:typeof v.column.columnDef.header=="function"?v.column.columnDef.header(v.getContext()):v.column.columnDef.header},v.id))},x.id))}),a.jsx(Cl,{className:"dm-card-table-body",children:f.getRowModel().rows.length?f.getRowModel().rows.map((x,v)=>a.jsx(Tn,{onClick:()=>{t(x.original.id)},className:"dm-card-table-body-row group",role:"row","aria-rowindex":v+1,children:x.getVisibleCells().map((S,C)=>a.jsx(Mr,{className:`px-6 whitespace-normal ${S.column.id==="actions"?"actions-cell":""}`,role:"cell","aria-colindex":C+1,style:S.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(S.column.getSize())}%`},children:typeof S.column.columnDef.cell=="function"?S.column.columnDef.cell(S.getContext()):S.column.columnDef.cell},S.id))},x.id)):a.jsx(Tn,{children:a.jsx(Mr,{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(Ce,{variant:"outline",size:"sm",onClick:m,disabled:!f.getCanPreviousPage(),"aria-label":"Go to previous page",children:"Previous"}),a.jsx(Ce,{variant:"outline",size:"sm",onClick:g,disabled:!f.getCanNextPage(),"aria-label":"Go to next page",children:"Next"})]})]})}function yde(){const e=xc(),{fetchInsights:t,deleteInsight:n,createInsight:r,insightLoading:s}=l2(),{insights:i,isLoading:c,error:u,hasInsights:f}=due(),[m,g]=h.useState(null);h.useEffect(()=>{t()},[t]);const y=S=>{e(S)},x=()=>{(async()=>{const S=await r({title:"Untitled insight"});S&&e(S.id)})()},v=()=>{(async()=>{if(m)try{await n(m)}finally{g(null)}})()};return a.jsxs(ol,{children:[a.jsxs(ao,{children:[a.jsx(ro,{tooltip:"Manage and review your insights",icon:Wi,children:"Insights"}),f&&a.jsx(Hh,{children:a.jsxs(Ce,{variant:"outline","aria-label":"Add new insight",disabled:s,onClick:x,children:[a.jsx(ua,{className:"h-4 w-4","aria-hidden":"true"}),"New insight"]})})]}),a.jsxs(so,{children:[c&&!f?a.jsx("div",{className:"text-muted-foreground p-4 text-sm",children:"Loading insights…"}):u?a.jsx("div",{className:"text-destructive p-4 text-sm",children:"Failed to load insights"}):f?a.jsx(gde,{items:i.map(S=>({id:S.id,title:S.title,lastRun:S.outputUpdatedAt})),onRowClick:y,onDelete:S=>{g(S)}}):a.jsx(hde,{}),a.jsx(yr,{open:!!m,onOpenChange:S=>{S||g(null)},title:"Delete Insight",description:"Are you sure you want to delete this insight? This action cannot be undone.",confirmLabel:"Delete",cancelLabel:"Cancel",variant:"destructive",onConfirm:v})]}),a.jsx(Yo,{})]})}function xde(){return a.jsx(ZI,{children:a.jsx(yde,{})})}const By=h.createContext(null);By.displayName="PanelGroupContext";const Gn={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"},d2=10,ac=h.useLayoutEffect,cN=Lg.useId,vde=typeof cN=="function"?cN:()=>null;let bde=0;function f2(e=null){const t=vde(),n=h.useRef(e||t||null);return n.current===null&&(n.current=""+bde++),e??n.current}function JI({children:e,className:t="",collapsedSize:n,collapsible:r,defaultSize:s,forwardedRef:i,id:c,maxSize:u,minSize:f,onCollapse:m,onExpand:g,onResize:y,order:x,style:v,tagName:S="div",...C}){const E=h.useContext(By);if(E===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:R,expandPanel:j,getPanelSize:_,getPanelStyle:A,groupId:O,isPanelCollapsed:I,reevaluatePanelConstraints:T,registerPanel:D,resizePanel:L,unregisterPanel:H}=E,B=f2(c),q=h.useRef({callbacks:{onCollapse:m,onExpand:g,onResize:y},constraints:{collapsedSize:n,collapsible:r,defaultSize:s,maxSize:u,minSize:f},id:B,idIsFromProps:c!==void 0,order:x});h.useRef({didLogMissingDefaultSizeWarning:!1}),ac(()=>{const{callbacks:F,constraints:z}=q.current,M={...z};q.current.id=B,q.current.idIsFromProps=c!==void 0,q.current.order=x,F.onCollapse=m,F.onExpand=g,F.onResize=y,z.collapsedSize=n,z.collapsible=r,z.defaultSize=s,z.maxSize=u,z.minSize=f,(M.collapsedSize!==z.collapsedSize||M.collapsible!==z.collapsible||M.maxSize!==z.maxSize||M.minSize!==z.minSize)&&T(q.current,M)}),ac(()=>{const F=q.current;return D(F),()=>{H(F)}},[x,B,D,H]),h.useImperativeHandle(i,()=>({collapse:()=>{R(q.current)},expand:F=>{j(q.current,F)},getId(){return B},getSize(){return _(q.current)},isCollapsed(){return I(q.current)},isExpanded(){return!I(q.current)},resize:F=>{L(q.current,F)}}),[R,j,_,I,B,L]);const Z=A(q.current,s);return h.createElement(S,{...C,children:e,className:t,id:B,style:{...Z,...v},[Gn.groupId]:O,[Gn.panel]:"",[Gn.panelCollapsible]:r||void 0,[Gn.panelId]:B,[Gn.panelSize]:parseFloat(""+Z.flexGrow).toFixed(1)})}const eM=h.forwardRef((e,t)=>h.createElement(JI,{...e,forwardedRef:t}));JI.displayName="Panel";eM.displayName="forwardRef(Panel)";let _b=null,Vp=-1,Ki=null;function Sde(e,t,n){const r=(t&sM)!==0,s=(t&oM)!==0,i=(t&iM)!==0,c=(t&lM)!==0;if(t){if(r)return i?"se-resize":c?"ne-resize":"e-resize";if(s)return i?"sw-resize":c?"nw-resize":"w-resize";if(i)return"s-resize";if(c)return"n-resize"}switch(e){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function Cde(){Ki!==null&&(document.head.removeChild(Ki),_b=null,Ki=null,Vp=-1)}function l1(e,t,n){var r,s;const i=Sde(e,t);if(_b!==i){if(_b=i,Ki===null&&(Ki=document.createElement("style"),document.head.appendChild(Ki)),Vp>=0){var c;(c=Ki.sheet)===null||c===void 0||c.removeRule(Vp)}Vp=(r=(s=Ki.sheet)===null||s===void 0?void 0:s.insertRule(`*{cursor: ${i} !important;}`))!==null&&r!==void 0?r:-1}}function tM(e){return e.type==="keydown"}function nM(e){return e.type.startsWith("pointer")}function rM(e){return e.type.startsWith("mouse")}function qy(e){if(nM(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(rM(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}function Ede(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function wde(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 Rde(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:fN(e),b:fN(t)};let r;for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),r=e;jt(r,"Stacking order can only be calculated for elements with a common ancestor");const s={a:dN(uN(n.a)),b:dN(uN(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 jde=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Tde(e){var t;const n=getComputedStyle((t=aM(e))!==null&&t!==void 0?t:e).display;return n==="flex"||n==="inline-flex"}function _de(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||Tde(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"||jde.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function uN(e){let t=e.length;for(;t--;){const n=e[t];if(jt(n,"Missing node"),_de(n))return n}return null}function dN(e){return e&&Number(getComputedStyle(e).zIndex)||0}function fN(e){const t=[];for(;e;)t.push(e),e=aM(e);return t}function aM(e){const{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}const sM=1,oM=2,iM=4,lM=8,Nde=Ede()==="coarse";let Ts=[],zu=!1,Zi=new Map,Ky=new Map;const nh=new Set;function Ade(e,t,n,r,s){var i;const{ownerDocument:c}=t,u={direction:n,element:t,hitAreaMargins:r,setResizeHandlerState:s},f=(i=Zi.get(c))!==null&&i!==void 0?i:0;return Zi.set(c,f+1),nh.add(u),Mg(),function(){var g;Ky.delete(e),nh.delete(u);const y=(g=Zi.get(c))!==null&&g!==void 0?g:1;if(Zi.set(c,y-1),Mg(),y===1&&Zi.delete(c),Ts.includes(u)){const x=Ts.indexOf(u);x>=0&&Ts.splice(x,1),Zy(),s("up",!0,null)}}}function Dde(e){const{target:t}=e,{x:n,y:r}=qy(e);zu=!0,h2({target:t,x:n,y:r}),Mg(),Ts.length>0&&(kg("down",e),Zy(),e.preventDefault(),cM(t)||e.stopImmediatePropagation())}function c1(e){const{x:t,y:n}=qy(e);if(zu&&e.type!=="pointerleave"&&e.buttons===0&&(zu=!1,kg("up",e)),!zu){const{target:r}=e;h2({target:r,x:t,y:n})}kg("move",e),Zy(),Ts.length>0&&e.preventDefault()}function u1(e){const{target:t}=e,{x:n,y:r}=qy(e);Ky.clear(),zu=!1,Ts.length>0&&(e.preventDefault(),cM(t)||e.stopImmediatePropagation()),kg("up",e),h2({target:t,x:n,y:r}),Zy(),Mg()}function cM(e){let t=e;for(;t;){if(t.hasAttribute(Gn.resizeHandle))return!0;t=t.parentElement}return!1}function h2({target:e,x:t,y:n}){Ts.splice(0);let r=null;(e instanceof HTMLElement||e instanceof SVGElement)&&(r=e),nh.forEach(s=>{const{element:i,hitAreaMargins:c}=s,u=i.getBoundingClientRect(),{bottom:f,left:m,right:g,top:y}=u,x=Nde?c.coarse:c.fine;if(t>=m-x&&t<=g+x&&n>=y-x&&n<=f+x){if(r!==null&&document.contains(r)&&i!==r&&!i.contains(r)&&!r.contains(i)&&Rde(r,i)>0){let S=r,C=!1;for(;S&&!S.contains(i);){if(wde(S.getBoundingClientRect(),u)){C=!0;break}S=S.parentElement}if(C)return}Ts.push(s)}})}function d1(e,t){Ky.set(e,t)}function Zy(){let e=!1,t=!1;Ts.forEach(r=>{const{direction:s}=r;s==="horizontal"?e=!0:t=!0});let n=0;Ky.forEach(r=>{n|=r}),e&&t?l1("intersection",n):e?l1("horizontal",n):t?l1("vertical",n):Cde()}let f1;function Mg(){var e;(e=f1)===null||e===void 0||e.abort(),f1=new AbortController;const t={capture:!0,signal:f1.signal};nh.size&&(zu?(Ts.length>0&&Zi.forEach((n,r)=>{const{body:s}=r;n>0&&(s.addEventListener("contextmenu",u1,t),s.addEventListener("pointerleave",c1,t),s.addEventListener("pointermove",c1,t))}),Zi.forEach((n,r)=>{const{body:s}=r;s.addEventListener("pointerup",u1,t),s.addEventListener("pointercancel",u1,t)})):Zi.forEach((n,r)=>{const{body:s}=r;n>0&&(s.addEventListener("pointerdown",Dde,t),s.addEventListener("pointermove",c1,t))}))}function kg(e,t){nh.forEach(n=>{const{setResizeHandlerState:r}=n,s=Ts.includes(n);r(e,s,t)})}function Ode(){const[e,t]=h.useState(0);return h.useCallback(()=>t(n=>n+1),[])}function jt(e,t){if(!e)throw console.error(t),Error(t)}function gc(e,t,n=d2){return e.toFixed(n)===t.toFixed(n)?0:e>t?1:-1}function Go(e,t,n=d2){return gc(e,t,n)===0}function Ma(e,t,n){return gc(e,t,n)===0}function Ide(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(!Ma(s,i,n))return!1}return!0}function Nu({panelConstraints:e,panelIndex:t,size:n}){const r=e[t];jt(r!=null,`Panel constraints not found for index ${t}`);let{collapsedSize:s=0,collapsible:i,maxSize:c=100,minSize:u=0}=r;if(gc(n,u)<0)if(i){const f=(s+u)/2;gc(n,f)<0?n=s:n=u}else n=u;return n=Math.min(c,n),n=parseFloat(n.toFixed(d2)),n}function _f({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:s,trigger:i}){if(Ma(e,0))return t;const c=[...t],[u,f]=r;jt(u!=null,"Invalid first pivot index"),jt(f!=null,"Invalid second pivot index");let m=0;if(i==="keyboard"){{const y=e<0?f:u,x=n[y];jt(x,`Panel constraints not found for index ${y}`);const{collapsedSize:v=0,collapsible:S,minSize:C=0}=x;if(S){const E=t[y];if(jt(E!=null,`Previous layout not found for panel index ${y}`),Ma(E,v)){const R=C-E;gc(R,Math.abs(e))>0&&(e=e<0?0-R:R)}}}{const y=e<0?u:f,x=n[y];jt(x,`No panel constraints found for index ${y}`);const{collapsedSize:v=0,collapsible:S,minSize:C=0}=x;if(S){const E=t[y];if(jt(E!=null,`Previous layout not found for panel index ${y}`),Ma(E,C)){const R=E-v;gc(R,Math.abs(e))>0&&(e=e<0?0-R:R)}}}}{const y=e<0?1:-1;let x=e<0?f:u,v=0;for(;;){const C=t[x];jt(C!=null,`Previous layout not found for panel index ${x}`);const R=Nu({panelConstraints:n,panelIndex:x,size:100})-C;if(v+=R,x+=y,x<0||x>=n.length)break}const S=Math.min(Math.abs(e),Math.abs(v));e=e<0?0-S:S}{let x=e<0?u:f;for(;x>=0&&x<n.length;){const v=Math.abs(e)-Math.abs(m),S=t[x];jt(S!=null,`Previous layout not found for panel index ${x}`);const C=S-v,E=Nu({panelConstraints:n,panelIndex:x,size:C});if(!Ma(S,E)&&(m+=S-E,c[x]=E,m.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?x--:x++}}if(Ide(s,c))return s;{const y=e<0?f:u,x=t[y];jt(x!=null,`Previous layout not found for panel index ${y}`);const v=x+m,S=Nu({panelConstraints:n,panelIndex:y,size:v});if(c[y]=S,!Ma(S,v)){let C=v-S,R=e<0?f:u;for(;R>=0&&R<n.length;){const j=c[R];jt(j!=null,`Previous layout not found for panel index ${R}`);const _=j+C,A=Nu({panelConstraints:n,panelIndex:R,size:_});if(Ma(j,A)||(C-=A-j,c[R]=A),Ma(C,0))break;e>0?R--:R++}}}const g=c.reduce((y,x)=>x+y,0);return Ma(g,100)?c:s}function Mde({layout:e,panelsArray:t,pivotIndices:n}){let r=0,s=100,i=0,c=0;const u=n[0];jt(u!=null,"No pivot index found"),t.forEach((y,x)=>{const{constraints:v}=y,{maxSize:S=100,minSize:C=0}=v;x===u?(r=C,s=S):(i+=C,c+=S)});const f=Math.min(s,100-i),m=Math.max(r,100-c),g=e[u];return{valueMax:f,valueMin:m,valueNow:g}}function rh(e,t=document){return Array.from(t.querySelectorAll(`[${Gn.resizeHandleId}][data-panel-group-id="${e}"]`))}function uM(e,t,n=document){const s=rh(e,n).findIndex(i=>i.getAttribute(Gn.resizeHandleId)===t);return s??null}function dM(e,t,n){const r=uM(e,t,n);return r!=null?[r,r+1]:[-1,-1]}function kde(e){return e instanceof HTMLElement?!0:typeof e=="object"&&e!==null&&"tagName"in e&&"getAttribute"in e}function fM(e,t=document){if(kde(t)&&t.dataset.panelGroupId==e)return t;const n=t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return n||null}function Yy(e,t=document){const n=t.querySelector(`[${Gn.resizeHandleId}="${e}"]`);return n||null}function Lde(e,t,n,r=document){var s,i,c,u;const f=Yy(t,r),m=rh(e,r),g=f?m.indexOf(f):-1,y=(s=(i=n[g])===null||i===void 0?void 0:i.id)!==null&&s!==void 0?s:null,x=(c=(u=n[g+1])===null||u===void 0?void 0:u.id)!==null&&c!==void 0?c:null;return[y,x]}function Pde({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:s,panelGroupElement:i,setLayout:c}){h.useRef({didWarnAboutMissingResizeHandle:!1}),ac(()=>{if(!i)return;const u=rh(n,i);for(let f=0;f<s.length-1;f++){const{valueMax:m,valueMin:g,valueNow:y}=Mde({layout:r,panelsArray:s,pivotIndices:[f,f+1]}),x=u[f];if(x!=null){const v=s[f];jt(v,`No panel data found for index "${f}"`),x.setAttribute("aria-controls",v.id),x.setAttribute("aria-valuemax",""+Math.round(m)),x.setAttribute("aria-valuemin",""+Math.round(g)),x.setAttribute("aria-valuenow",y!=null?""+Math.round(y):"")}}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;jt(u,"Eager values not found");const{panelDataArray:f}=u,m=fM(n,i);jt(m!=null,`No group found for id "${n}"`);const g=rh(n,i);jt(g,`No resize handles found for group id "${n}"`);const y=g.map(x=>{const v=x.getAttribute(Gn.resizeHandleId);jt(v,"Resize handle element has no handle id attribute");const[S,C]=Lde(n,v,f,i);if(S==null||C==null)return()=>{};const E=R=>{if(!R.defaultPrevented)switch(R.key){case"Enter":{R.preventDefault();const j=f.findIndex(_=>_.id===S);if(j>=0){const _=f[j];jt(_,`No panel data found for index ${j}`);const A=r[j],{collapsedSize:O=0,collapsible:I,minSize:T=0}=_.constraints;if(A!=null&&I){const D=_f({delta:Ma(A,O)?T-O:O-A,initialLayout:r,panelConstraints:f.map(L=>L.constraints),pivotIndices:dM(n,v,i),prevLayout:r,trigger:"keyboard"});r!==D&&c(D)}}break}}};return x.addEventListener("keydown",E),()=>{x.removeEventListener("keydown",E)}});return()=>{y.forEach(x=>x())}},[i,e,t,n,r,s,c])}function hN(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function hM(e,t){const n=e==="horizontal",{x:r,y:s}=qy(t);return n?r:s}function Ude(e,t,n,r,s){const i=n==="horizontal",c=Yy(t,s);jt(c,`No resize handle element found for id "${t}"`);const u=c.getAttribute(Gn.groupId);jt(u,"Resize handle element has no group id attribute");let{initialCursorPosition:f}=r;const m=hM(n,e),g=fM(u,s);jt(g,`No group element found for id "${u}"`);const y=g.getBoundingClientRect(),x=i?y.width:y.height;return(m-f)/x*100}function Fde(e,t,n,r,s,i){if(tM(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:Ude(e,t,n,r,i)}function zde({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];jt(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];jt(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 yu(e,t,n){t.forEach((r,s)=>{const i=e[s];jt(i,`Panel data not found for index ${s}`);const{callbacks:c,constraints:u,id:f}=i,{collapsedSize:m=0,collapsible:g}=u,y=n[f];if(y==null||r!==y){n[f]=r;const{onCollapse:x,onExpand:v,onResize:S}=c;S&&S(r,y),g&&(x||v)&&(v&&(y==null||Go(y,m))&&!Go(r,m)&&v(),x&&(y==null||!Go(y,m))&&Go(r,m)&&x())}})}function _p(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 Hde({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 Vde(e,t=10){let n=null;return(...s)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...s)},t)}}function mN(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 mM(e){return`react-resizable-panels:${e}`}function pM(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 gM(e,t){try{const n=mM(e),r=t.getItem(n);if(r){const s=JSON.parse(r);if(typeof s=="object"&&s!=null)return s}}catch{}return null}function $de(e,t,n){var r,s;const i=(r=gM(e,n))!==null&&r!==void 0?r:{},c=pM(t);return(s=i[c])!==null&&s!==void 0?s:null}function Gde(e,t,n,r,s){var i;const c=mM(e),u=pM(t),f=(i=gM(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 pN({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(!Ma(r,100)&&n.length>0)for(let i=0;i<t.length;i++){const c=n[i];jt(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];jt(c!=null,`No layout data found for index ${i}`);const u=Nu({panelConstraints:t,panelIndex:i,size:c});c!=u&&(s+=c-u,n[i]=u)}if(!Ma(s,0))for(let i=0;i<t.length;i++){const c=n[i];jt(c!=null,`No layout data found for index ${i}`);const u=c+s,f=Nu({panelConstraints:t,panelIndex:i,size:u});if(c!==f&&(s-=f-c,n[i]=f,Ma(s,0)))break}return n}const Bde=100,Nf={getItem:e=>(mN(Nf),Nf.getItem(e)),setItem:(e,t)=>{mN(Nf),Nf.setItem(e,t)}},gN={};function yM({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:s,id:i=null,onLayout:c=null,keyboardResizeBy:u=null,storage:f=Nf,style:m,tagName:g="div",...y}){const x=f2(i),v=h.useRef(null),[S,C]=h.useState(null),[E,R]=h.useState([]),j=Ode(),_=h.useRef({}),A=h.useRef(new Map),O=h.useRef(0),I=h.useRef({autoSaveId:e,direction:r,dragState:S,id:x,keyboardResizeBy:u,onLayout:c,storage:f}),T=h.useRef({layout:E,panelDataArray:[],panelDataArrayChanged:!1});h.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),h.useImperativeHandle(s,()=>({getId:()=>I.current.id,getLayout:()=>{const{layout:$}=T.current;return $},setLayout:$=>{const{onLayout:Q}=I.current,{layout:ne,panelDataArray:ue}=T.current,J=pN({layout:$,panelConstraints:ue.map(he=>he.constraints)});hN(ne,J)||(R(J),T.current.layout=J,Q&&Q(J),yu(ue,J,_.current))}}),[]),ac(()=>{I.current.autoSaveId=e,I.current.direction=r,I.current.dragState=S,I.current.id=x,I.current.onLayout=c,I.current.storage=f}),Pde({committedValuesRef:I,eagerValuesRef:T,groupId:x,layout:E,panelDataArray:T.current.panelDataArray,setLayout:R,panelGroupElement:v.current}),h.useEffect(()=>{const{panelDataArray:$}=T.current;if(e){if(E.length===0||E.length!==$.length)return;let Q=gN[e];Q==null&&(Q=Vde(Gde,Bde),gN[e]=Q);const ne=[...$],ue=new Map(A.current);Q(e,ne,ue,E,f)}},[e,E,f]),h.useEffect(()=>{});const D=h.useCallback($=>{const{onLayout:Q}=I.current,{layout:ne,panelDataArray:ue}=T.current;if($.constraints.collapsible){const J=ue.map(Me=>Me.constraints),{collapsedSize:he=0,panelSize:ge,pivotIndices:Ee}=Zl(ue,$,ne);if(jt(ge!=null,`Panel size not found for panel "${$.id}"`),!Go(ge,he)){A.current.set($.id,ge);const Fe=Ru(ue,$)===ue.length-1?ge-he:he-ge,nt=_f({delta:Fe,initialLayout:ne,panelConstraints:J,pivotIndices:Ee,prevLayout:ne,trigger:"imperative-api"});_p(ne,nt)||(R(nt),T.current.layout=nt,Q&&Q(nt),yu(ue,nt,_.current))}}},[]),L=h.useCallback(($,Q)=>{const{onLayout:ne}=I.current,{layout:ue,panelDataArray:J}=T.current;if($.constraints.collapsible){const he=J.map(ut=>ut.constraints),{collapsedSize:ge=0,panelSize:Ee=0,minSize:Me=0,pivotIndices:Fe}=Zl(J,$,ue),nt=Q??Me;if(Go(Ee,ge)){const ut=A.current.get($.id),Vt=ut!=null&&ut>=nt?ut:nt,er=Ru(J,$)===J.length-1?Ee-Vt:Vt-Ee,fn=_f({delta:er,initialLayout:ue,panelConstraints:he,pivotIndices:Fe,prevLayout:ue,trigger:"imperative-api"});_p(ue,fn)||(R(fn),T.current.layout=fn,ne&&ne(fn),yu(J,fn,_.current))}}},[]),H=h.useCallback($=>{const{layout:Q,panelDataArray:ne}=T.current,{panelSize:ue}=Zl(ne,$,Q);return jt(ue!=null,`Panel size not found for panel "${$.id}"`),ue},[]),B=h.useCallback(($,Q)=>{const{panelDataArray:ne}=T.current,ue=Ru(ne,$);return Hde({defaultSize:Q,dragState:S,layout:E,panelData:ne,panelIndex:ue})},[S,E]),q=h.useCallback($=>{const{layout:Q,panelDataArray:ne}=T.current,{collapsedSize:ue=0,collapsible:J,panelSize:he}=Zl(ne,$,Q);return jt(he!=null,`Panel size not found for panel "${$.id}"`),J===!0&&Go(he,ue)},[]),Z=h.useCallback($=>{const{layout:Q,panelDataArray:ne}=T.current,{collapsedSize:ue=0,collapsible:J,panelSize:he}=Zl(ne,$,Q);return jt(he!=null,`Panel size not found for panel "${$.id}"`),!J||gc(he,ue)>0},[]),F=h.useCallback($=>{const{panelDataArray:Q}=T.current;Q.push($),Q.sort((ne,ue)=>{const J=ne.order,he=ue.order;return J==null&&he==null?0:J==null?-1:he==null?1:J-he}),T.current.panelDataArrayChanged=!0,j()},[j]);ac(()=>{if(T.current.panelDataArrayChanged){T.current.panelDataArrayChanged=!1;const{autoSaveId:$,onLayout:Q,storage:ne}=I.current,{layout:ue,panelDataArray:J}=T.current;let he=null;if($){const Ee=$de($,J,ne);Ee&&(A.current=new Map(Object.entries(Ee.expandToSizes)),he=Ee.layout)}he==null&&(he=zde({panelDataArray:J}));const ge=pN({layout:he,panelConstraints:J.map(Ee=>Ee.constraints)});hN(ue,ge)||(R(ge),T.current.layout=ge,Q&&Q(ge),yu(J,ge,_.current))}}),ac(()=>{const $=T.current;return()=>{$.layout=[]}},[]);const z=h.useCallback($=>{let Q=!1;const ne=v.current;return ne&&window.getComputedStyle(ne,null).getPropertyValue("direction")==="rtl"&&(Q=!0),function(J){J.preventDefault();const he=v.current;if(!he)return()=>null;const{direction:ge,dragState:Ee,id:Me,keyboardResizeBy:Fe,onLayout:nt}=I.current,{layout:ut,panelDataArray:Vt}=T.current,{initialLayout:xn}=Ee??{},er=dM(Me,$,he);let fn=Fde(J,$,ge,Ee,Fe,he);const Pe=ge==="horizontal";Pe&&Q&&(fn=-fn);const G=Vt.map(Ae=>Ae.constraints),ee=_f({delta:fn,initialLayout:xn??ut,panelConstraints:G,pivotIndices:er,prevLayout:ut,trigger:tM(J)?"keyboard":"mouse-or-touch"}),de=!_p(ut,ee);(nM(J)||rM(J))&&O.current!=fn&&(O.current=fn,!de&&fn!==0?Pe?d1($,fn<0?sM:oM):d1($,fn<0?iM:lM):d1($,0)),de&&(R(ee),T.current.layout=ee,nt&&nt(ee),yu(Vt,ee,_.current))}},[]),M=h.useCallback(($,Q)=>{const{onLayout:ne}=I.current,{layout:ue,panelDataArray:J}=T.current,he=J.map(ut=>ut.constraints),{panelSize:ge,pivotIndices:Ee}=Zl(J,$,ue);jt(ge!=null,`Panel size not found for panel "${$.id}"`);const Fe=Ru(J,$)===J.length-1?ge-Q:Q-ge,nt=_f({delta:Fe,initialLayout:ue,panelConstraints:he,pivotIndices:Ee,prevLayout:ue,trigger:"imperative-api"});_p(ue,nt)||(R(nt),T.current.layout=nt,ne&&ne(nt),yu(J,nt,_.current))},[]),V=h.useCallback(($,Q)=>{const{layout:ne,panelDataArray:ue}=T.current,{collapsedSize:J=0,collapsible:he}=Q,{collapsedSize:ge=0,collapsible:Ee,maxSize:Me=100,minSize:Fe=0}=$.constraints,{panelSize:nt}=Zl(ue,$,ne);nt!=null&&(he&&Ee&&Go(nt,J)?Go(J,ge)||M($,ge):nt<Fe?M($,Fe):nt>Me&&M($,Me))},[M]),K=h.useCallback(($,Q)=>{const{direction:ne}=I.current,{layout:ue}=T.current;if(!v.current)return;const J=Yy($,v.current);jt(J,`Drag handle element not found for id "${$}"`);const he=hM(ne,Q);C({dragHandleId:$,dragHandleRect:J.getBoundingClientRect(),initialCursorPosition:he,initialLayout:ue})},[]),se=h.useCallback(()=>{C(null)},[]),ve=h.useCallback($=>{const{panelDataArray:Q}=T.current,ne=Ru(Q,$);ne>=0&&(Q.splice(ne,1),delete _.current[$.id],T.current.panelDataArrayChanged=!0,j())},[j]),P=h.useMemo(()=>({collapsePanel:D,direction:r,dragState:S,expandPanel:L,getPanelSize:H,getPanelStyle:B,groupId:x,isPanelCollapsed:q,isPanelExpanded:Z,reevaluatePanelConstraints:V,registerPanel:F,registerResizeHandle:z,resizePanel:M,startDragging:K,stopDragging:se,unregisterPanel:ve,panelGroupElement:v.current}),[D,S,r,L,H,B,x,q,Z,V,F,z,M,K,se,ve]),U={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return h.createElement(By.Provider,{value:P},h.createElement(g,{...y,children:t,className:n,id:i,ref:v,style:{...U,...m},[Gn.group]:"",[Gn.groupDirection]:r,[Gn.groupId]:x}))}const xM=h.forwardRef((e,t)=>h.createElement(yM,{...e,forwardedRef:t}));yM.displayName="PanelGroup";xM.displayName="forwardRef(PanelGroup)";function Ru(e,t){return e.findIndex(n=>n===t||n.id===t.id)}function Zl(e,t,n){const r=Ru(e,t),i=r===e.length-1?[r-1,r]:[r,r+1],c=n[r];return{...t.constraints,panelSize:c,pivotIndices:i}}function qde({disabled:e,handleId:t,resizeHandler:n,panelGroupElement:r}){h.useEffect(()=>{if(e||n==null||r==null)return;const s=Yy(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(Gn.groupId);jt(u,`No group element found for id "${u}"`);const f=rh(u,r),m=uM(u,t,r);jt(m!==null,`No resize element found for id "${t}"`);const g=c.shiftKey?m>0?m-1:f.length-1:m+1<f.length?m+1:0;f[g].focus();break}}};return s.addEventListener("keydown",i),()=>{s.removeEventListener("keydown",i)}},[r,e,t,n])}function vM({children:e=null,className:t="",disabled:n=!1,hitAreaMargins:r,id:s,onBlur:i,onClick:c,onDragging:u,onFocus:f,onPointerDown:m,onPointerUp:g,style:y={},tabIndex:x=0,tagName:v="div",...S}){var C,E;const R=h.useRef(null),j=h.useRef({onClick:c,onDragging:u,onPointerDown:m,onPointerUp:g});h.useEffect(()=>{j.current.onClick=c,j.current.onDragging=u,j.current.onPointerDown=m,j.current.onPointerUp=g});const _=h.useContext(By);if(_===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:A,groupId:O,registerResizeHandle:I,startDragging:T,stopDragging:D,panelGroupElement:L}=_,H=f2(s),[B,q]=h.useState("inactive"),[Z,F]=h.useState(!1),[z,M]=h.useState(null),V=h.useRef({state:B});ac(()=>{V.current.state=B}),h.useEffect(()=>{if(n)M(null);else{const P=I(H);M(()=>P)}},[n,H,I]);const K=(C=r==null?void 0:r.coarse)!==null&&C!==void 0?C:15,se=(E=r==null?void 0:r.fine)!==null&&E!==void 0?E:5;h.useEffect(()=>{if(n||z==null)return;const P=R.current;jt(P,"Element ref not attached");let U=!1;return Ade(H,P,A,{coarse:K,fine:se},(Q,ne,ue)=>{if(!ne){q("inactive");return}switch(Q){case"down":{q("drag"),U=!1,jt(ue,'Expected event to be defined for "down" action'),T(H,ue);const{onDragging:J,onPointerDown:he}=j.current;J==null||J(!0),he==null||he();break}case"move":{const{state:J}=V.current;U=!0,J!=="drag"&&q("hover"),jt(ue,'Expected event to be defined for "move" action'),z(ue);break}case"up":{q("hover"),D();const{onClick:J,onDragging:he,onPointerUp:ge}=j.current;he==null||he(!1),ge==null||ge(),U||J==null||J();break}}})},[K,A,n,se,I,H,z,T,D]),qde({disabled:n,handleId:H,resizeHandler:z,panelGroupElement:L});const ve={touchAction:"none",userSelect:"none"};return h.createElement(v,{...S,children:e,className:t,id:s,onBlur:()=>{F(!1),i==null||i()},onFocus:()=>{F(!0),f==null||f()},ref:R,role:"separator",style:{...ve,...y},tabIndex:x,[Gn.groupDirection]:A,[Gn.groupId]:O,[Gn.resizeHandle]:"",[Gn.resizeHandleActive]:B==="drag"?"pointer":Z?"keyboard":void 0,[Gn.resizeHandleEnabled]:!n,[Gn.resizeHandleId]:H,[Gn.resizeHandleState]:B})}vM.displayName="PanelResizeHandle";function Kde({className:e,...t}){return a.jsx(xM,{"data-slot":"resizable-panel-group",className:re("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t})}function yN({...e}){return a.jsx(eM,{"data-slot":"resizable-panel",...e})}function Zde({withHandle:e,className:t,...n}){return a.jsx(vM,{"data-slot":"resizable-handle",className:re("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(rA,{className:"size-2.5"})})})}function Yde({storageKey:e,left:t,right:n,initialRatio:r=.5,minWidth:s=240,className:i}){const c=h.useMemo(()=>{const x=Xs.get(e);if(x!==null){const v=Number(x);if(!Number.isNaN(v))return h1(v,.1,.9)}return h1(r,.1,.9)},[e,r]),u=Math.round(c*100),f=100-u,g=Math.min(45,Math.max(5,Math.round(s/1200*100)));function y(x){const v=x[0],S=h1(v/100,.1,.9);Xs.set(e,S)}return a.jsxs(Kde,{direction:"horizontal",onLayout:y,className:re("relative flex h-full w-full items-stretch overflow-hidden",i),children:[a.jsx(yN,{defaultSize:u,minSize:g,className:"overflow-auto",children:t}),a.jsx(Zde,{withHandle:!0}),a.jsx(yN,{defaultSize:f,minSize:g,className:"overflow-auto",children:n})]})}function h1(e,t,n){return Math.max(t,Math.min(n,e))}const Wde=[{label:"prompt",insertText:`{{#prompt}}
|
|
813
|
-
$0
|
|
814
|
-
{{/prompt}}`,documentation:"Insert a {{#prompt}} template for generative queries"}],xN=new Set;function Qde(e,t){xN.has(t)||(e.languages.registerCompletionItemProvider(t,{triggerCharacters:["/"],provideCompletionItems:(n,r)=>{const s=r.lineNumber,i=r.column,c=n.getValueInRange({startLineNumber:s,startColumn:1,endLineNumber:s,endColumn:i}),u=c.lastIndexOf("/");if(u!==-1){const f=c.substring(u+1),m={startLineNumber:s,endLineNumber:s,startColumn:u+2,endColumn:i},g=[];return Wde.forEach(y=>{y.label.startsWith(f)&&g.push({label:y.label,insertText:y.insertText,documentation:{value:y.documentation,isTrusted:!0},detail:y.documentation,kind:e.languages.CompletionItemKind.Field,insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:m,additionalTextEdits:[{range:{startLineNumber:s,endLineNumber:s,startColumn:u+1,endColumn:u+2},text:""}]})}),{suggestions:g}}return{suggestions:[]}}}),xN.add(t))}const Xde=(e,t)=>{Qde(t,"markdown")};function vN({value:e,onChange:t,height:n="60vh",className:r,readOnly:s}){const{resolvedTheme:i}=Th();return a.jsx("div",{className:r,children:a.jsx(_C,{height:n,language:"markdown",theme:i==="dark"?"vs-dark":"light",className:"overflow-hidden rounded-tl-md",value:e,onChange:c=>{t(c??"")},onMount:Xde,options:{minimap:{enabled:!1},scrollBeyondLastLine:!1,wordWrap:"on",overviewRulerBorder:!1,automaticLayout:!0,overviewRulerLanes:0,placeholder:"Press '/' for commands",readOnly:!!s}})})}function Jde({...e}){return a.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...e})}function efe({className:e,...t}){return a.jsx("ol",{"data-slot":"breadcrumb-list",className:re("text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",e),...t})}function bN({className:e,...t}){return a.jsx("li",{"data-slot":"breadcrumb-item",className:re("inline-flex items-center gap-1.5",e),...t})}function tfe({asChild:e,className:t,...n}){const r=e?ih:"a";return a.jsx(r,{"data-slot":"breadcrumb-link",className:re("hover:text-foreground transition-colors",t),...n})}function nfe({children:e,className:t,...n}){return a.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:re("[&>svg]:size-3.5",t),...n,children:e??a.jsx(Ra,{})})}function rfe({dataMartId:e,triggerId:t,insightId:n,onRunFinished:r,onError:s}){const i=h.useCallback(async c=>{if(!(!e||!t))try{const u=await zo.checkInsightExecutionStatus(e,t,n,{skipLoadingIndicator:!0,signal:c});[Va.SUCCESS,Va.ERROR,Va.CANCELLED].includes(u.status)&&r()}catch(u){s(u)}},[e,t,n,r,s]);i2({enabled:!!(e&&t),intervalMs:2500,onlyWhenVisible:!0,onTick:i})}const afe=Wt({title:Rt().min(1,"Title cannot be empty"),template:Rt().optional()}),sfe=(e,t,n)=>{const{register:r,watch:s,handleSubmit:i,reset:c,resetField:u,setValue:f,formState:{isSubmitting:m,dirtyFields:g}}=go({resolver:ui(afe),defaultValues:{title:(e==null?void 0:e.title)??"",template:(e==null?void 0:e.template)??""}}),y=s("title"),x=s("template"),v=!!g.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 S=h.useCallback(async E=>{if(!e)return;const R=E.trim();f("title",R,{shouldDirty:!0,shouldValidate:!0}),await n(e.id,R),u("title",{defaultValue:R})},[e,u,f,n]),C=h.useCallback(async E=>{if(!e)return;const R={title:E.title.trim(),template:E.template&&E.template.trim().length>0?E.template:null},j=await t(e.id,R);j&&c({title:j.title,template:j.template??""})},[e,c,t]);return{register:r,handleSubmit:i,setValue:f,isTemplateDirty:v,isSubmitting:m,titleValue:y,templateValue:x,handleTitleUpdate:S,onSubmit:C}},m1=[{icon:Wi,text:"Initializing intelligence..."},{icon:eA,text:"Connecting to data sources..."},{icon:iU,text:"Mapping data relationships..."},{icon:jP,text:"Exploring dataset structure..."},{icon:NU,text:"Scanning available fields..."},{icon:MU,text:"Analyzing data patterns..."},{icon:EU,text:"Selecting optimal insight path..."},{icon:cA,text:"Preparing aggregated tables..."},{icon:GP,text:"Building visual model..."},{icon:xP,text:"Finalizing insight output..."},{icon:zU,text:"Validating field consistency..."},{icon:TU,text:"Checking for missing values..."},{icon:wP,text:"Detecting anomalies in data..."},{icon:qP,text:"Cross-referencing data sources..."},{icon:LU,text:"Verifying aggregation results..."},{icon:UP,text:"Ensuring data relationships are correct..."},{icon:L7,text:"Refining visual model parameters..."},{icon:IP,text:"Confirming data integrity..."},{icon:bP,text:"Preparing final output for insights..."},{icon:NP,text:"Performing final quality checks..."}],ofe=()=>{const[e,t]=h.useState(0);h.useEffect(()=>{const r=setInterval(()=>{t(s=>(s+1)%m1.length)},5e3);return()=>{clearInterval(r)}},[]);const n=m1[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:m1[e].text},`${String(e)}-text`)]})})};function ife(){const e=xc(),{insightId:t}=kb(),n=h.useMemo(()=>"insight_details_split",[]),[r,s]=h.useState(!1),{dataMart:i}=Ps(),{activeInsight:c,insightLoading:u,isRunning:f,triggerId:m,updateInsight:g,updateInsightTitle:y,getInsight:x,runInsight:v,deleteInsight:S,resetTriggerId:C,ensureActiveRunPolling:E}=l2(),{handleSubmit:R,setValue:j,isTemplateDirty:_,isSubmitting:A,titleValue:O,templateValue:I,handleTitleUpdate:T,onSubmit:D}=sfe(c,g,y),L=$I({markdown:(c==null?void 0:c.output)??"",enabled:!!(c!=null&&c.output),debounceMs:0}),[H,B]=h.useState(!1);h.useEffect(()=>{const M=V=>{(V.metaKey||V.ctrlKey)&&V.shiftKey&&(V.key==="M"||V.key==="m")&&(V.preventDefault(),B(se=>!se))};return window.addEventListener("keydown",M),()=>{window.removeEventListener("keydown",M)}},[]);const q=h.useCallback(async()=>{c&&(await S(c.id),e(".."))},[c,S,e]),Z=!u&&!(c!=null&&c.output);h.useEffect(()=>{t&&x(t)},[t,x]),h.useEffect(()=>{c!=null&&c.id&&E()},[c==null?void 0:c.id,E]),rfe({triggerId:m,dataMartId:(i==null?void 0:i.id)??"",insightId:(c==null?void 0:c.id)??"",onRunFinished:h.useCallback(()=>{C(),c!=null&&c.id&&x(c.id)},[c==null?void 0:c.id,x,C]),onError:h.useCallback(()=>{C()},[C])});const F=h.useCallback(async()=>{if(!(c!=null&&c.id)){console.error("Insight ID is not available");return}try{await v(c.id)}catch(M){throw console.error("Failed to run insight"),M}},[c==null?void 0:c.id,v]),z=h.useCallback(()=>R(async M=>{if(await D(M),!(c!=null&&c.id)){console.error("Insight ID is not available");return}try{await v(c.id)}catch(V){throw console.error("Failed to run insight"),V}})(),[R,c==null?void 0:c.id,D,v]);return u?a.jsx("div",{className:"text-muted-foreground flex flex-col gap-2 text-sm",children:"Loading..."}):!c||!i?a.jsxs(Eb,{children:[a.jsx(wb,{children:a.jsx(Rb,{variant:"icon",children:a.jsx(Wi,{})})}),a.jsx(jb,{children:"Insight not found"}),a.jsx(Tb,{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(Jde,{children:a.jsxs(efe,{children:[a.jsx(bN,{children:a.jsx(tfe,{asChild:!0,children:a.jsx(na,{to:"..",children:"Insights"})})}),a.jsx(nfe,{}),a.jsx(bN,{children:a.jsx("span",{"aria-current":"page",className:"block max-w-[480px] truncate",children:a.jsx(T5,{title:O||"Untitled insight",onUpdate:T,className:"font-medium",errorMessage:"Title cannot be empty",minWidth:"200px"})})})]})}),a.jsx("div",{className:"flex items-center gap-2",children:a.jsxs(Lr,{children:[a.jsx(Pr,{asChild:!0,children:a.jsx(Ce,{variant:"ghost",size:"icon","aria-label":"Insight actions",children:a.jsx(tA,{className:"h-4 w-4"})})}),a.jsx(Ur,{align:"end",children:a.jsxs(Ot,{onClick:()=>{s(!0)},className:"text-destructive",children:[a.jsx(us,{className:"h-4 w-4 text-red-600"})," ",a.jsx("span",{className:"text-red-600",children:"Delete insight"})]})})]})})]}),a.jsx("div",{className:"bg-background flex-1 rounded-md border",children:a.jsx(Yde,{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(vN,{value:I??"",onChange:M=>{j("template",M,{shouldDirty:!0})},height:"calc(100vh - 275px)",placeholder:"Type / to view available commands...",readOnly:f})}),a.jsxs("div",{className:"flex items-center justify-between gap-4 border-t px-4 py-2",children:[a.jsx(Ce,{variant:"default",size:"default",disabled:A||f,onClick:()=>void(_?z():F()),children:f?a.jsxs("span",{className:"inline-flex items-center gap-2",children:[a.jsx(ed,{className:"h-3 w-3 animate-spin"})," Running…"]}):_?a.jsxs("span",{className:"inline-flex items-center gap-2",children:[a.jsx(Wi,{})," Save & Run Insight"]}):a.jsxs("span",{className:"inline-flex items-center gap-2",children:[a.jsx(Wi,{})," Run Insight"]})}),c.outputUpdatedAt&&a.jsx(os,{children:a.jsxs(Nt,{children:[a.jsx(At,{asChild:!0,children:a.jsx("div",{className:"text-muted-foreground/75 text-sm",children:a.jsx(ti,{date:c.outputUpdatedAt})})}),a.jsx(Dt,{side:"top",children:a.jsxs("p",{children:["Last run: ",RO(c.outputUpdatedAt)]})})]})})]})]}),right:a.jsx("div",{className:"h-full",children:f?a.jsx(ofe,{}):Z?a.jsx(Eb,{className:"h-full",children:a.jsxs(wb,{children:[a.jsx(Rb,{variant:"icon",children:a.jsx(Wi,{})}),a.jsx(jb,{children:"Even data needs a little spark"}),a.jsx(Tb,{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:"min-h-0 flex-1 overflow-hidden",children:H?a.jsx(vN,{value:c.output??"",onChange:()=>{},height:"100%",className:"h-full",readOnly:!0}):L.error?a.jsx("div",{className:"text-destructive",children:L.error}):a.jsx(VI,{html:L.html,loading:L.loading,error:L.error,height:"100%"})})})})})}),a.jsx(yr,{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:()=>{q()}})]})}const lfe=[{path:"overview",element:a.jsx(aN,{})},{path:"data-setup",element:a.jsx(oce,{})},{path:"insights",element:a.jsx(hue,{}),children:[{index:!0,element:a.jsx(xde,{})},{path:":insightId",element:a.jsx(ife,{})}]},{path:"reports",element:a.jsx(aue,{})},{path:"triggers",element:a.jsx(sue,{})},{path:"run-history",element:a.jsx(Due,{})},{index:!0,element:a.jsx(aN,{})}];function cfe({to:e="/data-marts"}){const{user:t,status:n}=oi();if(n===$r.LOADING)return a.jsx(Iu,{fullScreen:!0,message:"Loading..."});if(n===$r.UNAUTHENTICATED||!t)return a.jsx(Iu,{fullScreen:!0,message:"Authentication..."});if(t.projectId){const r=sg(t.projectId,e);return a.jsx(_L,{to:r,replace:!0})}return a.jsx(Iu,{fullScreen:!0,message:"Project not found"})}const ufe=[{index:!0,path:"/",element:a.jsx(cfe,{})},{path:"/ui/:projectId",element:a.jsx(qY,{}),children:[{path:"about",element:a.jsx(KY,{})},{index:!0,element:a.jsx(s_,{})},{path:"data-marts",element:a.jsx(s_,{})},{path:"data-marts/create",element:a.jsx(Oue,{})},{path:"data-marts/:id",element:a.jsx(Jle,{}),children:lfe},{path:"data-storages",element:a.jsx(Uue,{})},{path:"data-destinations",element:a.jsx(ude,{})},{path:"*",element:a.jsx(JT,{})}]},{path:"*",element:a.jsx(JT,{})}],bM="gtm-script",SM="gtm-noscript",dfe="GOOGLE_TAG_MANAGER_CONTAINER_ID";function ffe(){return!!document.getElementById(bM)}function hfe(e){const t=document.createElement("script");return t.id=bM,t.innerHTML=`
|
|
815
|
-
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
|
|
816
|
-
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
|
|
817
|
-
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
|
|
818
|
-
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
|
|
819
|
-
})(window,document,'script','dataLayer','${e}');
|
|
820
|
-
`,t}function mfe(e){const t=document.createElement("noscript");return t.id=SM,t.innerHTML=`
|
|
821
|
-
<iframe src="https://www.googletagmanager.com/ns.html?id=${e}"
|
|
822
|
-
height="0"
|
|
823
|
-
width="0"
|
|
824
|
-
style="display:none;visibility:hidden">
|
|
825
|
-
</iframe>
|
|
826
|
-
`,t}function pfe(e){if(ffe())return;const t=hfe(e);document.head.prepend(t)}function gfe(e){if(document.getElementById(SM))return;const t=mfe(e);document.body.firstChild?document.body.insertBefore(t,document.body.firstChild):document.body.appendChild(t)}function yfe(e){try{pfe(e),gfe(e)}catch(t){console.warn("Failed to initialize Google Tag Manager:",t)}}function xfe(e){return(e[dfe]??"").trim()}function vfe(){const{flags:e,callState:t}=Sh();return h.useEffect(()=>{if(t!==vt.LOADED||!e)return;const n=xfe(e);n&&yfe(n)},[e,t]),null}const bfe="INTERCOM_APP_ID",CM="intercom-widget-script";function Sfe(){return!!document.getElementById(CM)}function Cfe(e,t){if(Sfe()){t();return}const n=document.createElement("script");n.id=CM,n.src=`https://widget.intercom.io/widget/${e}`,n.async=!0,n.onload=()=>{t()},document.head.appendChild(n)}async function Efe(){try{return(await Sa.post("/intercom/jwt")).data.token}catch(e){return console.warn("Failed to fetch Intercom JWT",e),null}}function wfe(e,t){const n={app_id:e,user_id:t.id};return t.email&&(n.email=t.email),t.fullName&&(n.name=t.fullName),t.projectTitle&&(n.Name_project=t.projectTitle),n}async function Rfe(e,t){if(!t)return;const n=wfe(e,t),r=await Efe();if(r){n.intercom_user_jwt=r;try{window.Intercom&&window.Intercom("boot",n)}catch(s){console.warn("Failed to boot Intercom",s)}}}function jfe(){const{flags:e,callState:t}=Sh(),{user:n}=oi(),r=h.useRef(!1);return h.useEffect(()=>{if(r.current||t!==vt.LOADED||!e)return;const s=e[bfe],i=(typeof s=="string"?s:"").trim();i&&Cfe(i,()=>{Rfe(i,n).then(()=>{r.current=!0,yb()})})},[e,t,n]),null}function Tfe({initialState:e,reducer:t,children:n}){const[r,s]=h.useReducer(t,e),i=h.useMemo(()=>s,[s]);return a.jsx(C3.Provider,{value:r,children:a.jsx(E3.Provider,{value:i,children:n})})}function _fe(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 SN={id:null,title:null},EM="project/SET_PROJECT",Nfe="project/CLEAR_PROJECT";function Afe(e){return{type:EM,payload:e}}function Dfe(e=SN,t){switch(t.type){case EM:{const{id:n,title:r}=t.payload;return{id:n,title:r??null}}case Nfe:return{...SN};default:return e}}class Ofe extends gl{getFlags(){return this.get("/flags")}}const Ife=new Ofe(""),wM={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"},Mfe={data:{...wM},callState:vt.IDLE},RM="settings/LOAD_FLAGS",jM="settings/LOAD_FLAGS_SUCCESS",TM="settings/LOAD_FLAGS_ERROR";function kfe(){return{type:RM}}function Lfe(e){return{type:jM,payload:e}}function Pfe(e){return{type:TM,payload:e}}function Ufe(e=Mfe,t){switch(t.type){case RM:return{...e,callState:vt.LOADING,error:void 0};case jM:return{...e,callState:vt.LOADED,data:{...wM,...t.payload}};case TM:return{...e,callState:vt.ERROR,error:t.payload};default:return e}}async function Ffe(e){try{e(kfe());const t=await Ife.getFlags();e(Lfe(t))}catch(t){const n=t instanceof Error?t.message:"Failed to load settings";e(Pfe(n))}}const _M="app/SET_READY";function zfe(e={ready:!1},t){switch(t.type){case _M:return{...e,ready:!!t.payload};default:return e}}const Hfe=_fe({project:Dfe,flags:Ufe,app:zfe});function Vfe({children:e}){return a.jsx(Tfe,{reducer:Hfe,initialState:{project:{id:null,title:null},flags:{data:null,callState:vt.IDLE},app:{ready:!1}},children:e})}function $fe({children:e}){const t=RB(),{user:n,status:r}=oi(),s=rg(f=>f.flags),i=s.callState,c=rg(f=>f.app.ready);h.useEffect(()=>{r===$r.AUTHENTICATED&&(n!=null&&n.projectId)&&(t(Afe({id:n.projectId,title:n.projectTitle??null})),i===vt.IDLE&&Ffe(t))},[r,n==null?void 0:n.projectId,n==null?void 0:n.projectTitle,i,t]),h.useEffect(()=>{const f=r===$r.AUTHENTICATED&&!!(n!=null&&n.projectId)&&i===vt.LOADED;t({type:_M,payload:f})},[r,n==null?void 0:n.projectId,i,t]);const u=h.useMemo(()=>a.jsx(Iu,{fullScreen:!0,message:"Loading application..."}),[]);return c?a.jsx(a.Fragment,{children:e}):i===vt.ERROR?a.jsx(Iu,{fullScreen:!0,message:`Failed to load app flags: ${s.error??""}`}):u}function Gfe(){const e=JL(ufe);return a.jsx(yK,{children:a.jsx(Vfe,{children:a.jsxs($fe,{children:[a.jsx(vfe,{}),a.jsx(jfe,{}),a.jsx(f7,{router:e})]})})})}const NM=document.getElementById("root");if(!NM)throw new Error("Root element not found");Zk.createRoot(NM).render(a.jsx(h.StrictMode,{children:a.jsx(Gfe,{})}));
|