react-semaphor 0.0.233 → 0.0.234
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{dashboard-plus-z4Wyb_NH.js → dashboard-plus-0Wc18x9Q.js} +1 -1
- package/dist/chunks/{dashboard-plus-dlar5KWI.js → dashboard-plus-apJaIXwW.js} +1 -1
- package/dist/chunks/{index-FUU9yXrS.js → index-J7GWM1f-.js} +1 -1
- package/dist/chunks/{index-wQr3ACRV.js → index-x2wG2JFp.js} +1 -1
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +4 -4
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { O as D, b as k, j as e, P as Ss, Q as ks, R as w, U as ws, V as zs, W as Fs, X as Os, Y as Ms, Z as _, _ as he, $ as la, J as ia, M as Ae, a0 as Qa, a1 as Wa, a2 as Ya, a3 as Za, a4 as Xa, a5 as et, a6 as Js, a7 as $e, a8 as Ue, a9 as oa, aa as rs, T as Ts, e as ca, g as Ds, ab as Oe, ac as Me, f as Y, ad as Te, ae as De, af as Pe, ag as Le, ah as ee, ai as As, G as c, aj as Ls, ak as Es, al as Is, w as da, v as ha, t as ue, am as st, r as at, N as ma, s as tt, an as nt, B as rt, ao as ua, ap as lt, S as Vs, z as it, n as Us, aq as bs, A as xa, ar as ys, u as Qe, as as me, at as be, au as Ke, av as pa, aw as fa, ax as ot, ay as ct, az as ga, aA as dt, aB as ht, aC as mt, aD as ut, aE as xt, aF as vs, aG as pt, aH as Be, aI as Ns, aJ as Fe, aK as Cs, aL as Qs, aM as ft, aN as gt, aO as jt, aP as bt, aQ as yt, aR as js, aS as vt, aT as Ws, aU as Nt, aV as Ys, aW as Ct, aX as St, aY as kt, c as wt, aZ as ja, l as zt, C as Ft, E as as, d as Ot, h as Mt, a_ as Tt, i as Dt, o as At, a$ as Lt, m as Et, H as qs, b0 as It, b1 as ba, b2 as ya, b3 as ts, b4 as va, b5 as ns, b6 as Zs, b7 as os, b8 as cs, b9 as ds, K as Vt, ba as qt, bb as Rt, bc as Na, bd as Rs, be as Ee, bf as Ca, bg as _t, bh as Ht, bi as Bt, bj as $t, bk as Pt, bl as Xs, bm as Kt, bn as Gt, bo as Jt, bp as Ut, bq as Qt, br as Wt, bs as Yt, bt as Zt, bu as Ce, bv as B, bw as $, bx as _s, by as P, bz as ea, bA as Xt, bB as en, bC as sn, bD as an, bE as tn, bF as nn, bG as rn, bH as ln, bI as on, bJ as cn } from "./index-
|
|
1
|
+
import { O as D, b as k, j as e, P as Ss, Q as ks, R as w, U as ws, V as zs, W as Fs, X as Os, Y as Ms, Z as _, _ as he, $ as la, J as ia, M as Ae, a0 as Qa, a1 as Wa, a2 as Ya, a3 as Za, a4 as Xa, a5 as et, a6 as Js, a7 as $e, a8 as Ue, a9 as oa, aa as rs, T as Ts, e as ca, g as Ds, ab as Oe, ac as Me, f as Y, ad as Te, ae as De, af as Pe, ag as Le, ah as ee, ai as As, G as c, aj as Ls, ak as Es, al as Is, w as da, v as ha, t as ue, am as st, r as at, N as ma, s as tt, an as nt, B as rt, ao as ua, ap as lt, S as Vs, z as it, n as Us, aq as bs, A as xa, ar as ys, u as Qe, as as me, at as be, au as Ke, av as pa, aw as fa, ax as ot, ay as ct, az as ga, aA as dt, aB as ht, aC as mt, aD as ut, aE as xt, aF as vs, aG as pt, aH as Be, aI as Ns, aJ as Fe, aK as Cs, aL as Qs, aM as ft, aN as gt, aO as jt, aP as bt, aQ as yt, aR as js, aS as vt, aT as Ws, aU as Nt, aV as Ys, aW as Ct, aX as St, aY as kt, c as wt, aZ as ja, l as zt, C as Ft, E as as, d as Ot, h as Mt, a_ as Tt, i as Dt, o as At, a$ as Lt, m as Et, H as qs, b0 as It, b1 as ba, b2 as ya, b3 as ts, b4 as va, b5 as ns, b6 as Zs, b7 as os, b8 as cs, b9 as ds, K as Vt, ba as qt, bb as Rt, bc as Na, bd as Rs, be as Ee, bf as Ca, bg as _t, bh as Ht, bi as Bt, bj as $t, bk as Pt, bl as Xs, bm as Kt, bn as Gt, bo as Jt, bp as Ut, bq as Qt, br as Wt, bs as Yt, bt as Zt, bu as Ce, bv as B, bw as $, bx as _s, by as P, bz as ea, bA as Xt, bB as en, bC as sn, bD as an, bE as tn, bF as nn, bG as rn, bH as ln, bI as on, bJ as cn } from "./index-x2wG2JFp.js";
|
|
2
2
|
import * as sa from "react";
|
|
3
3
|
import xe, { useState as M, useEffect as U, useMemo as dn, useRef as Ge } from "react";
|
|
4
4
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const e=require("./index-
|
|
1
|
+
"use strict";const e=require("./index-J7GWM1f-.js"),b=require("react");function ht(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const s in t)if(s!=="default"){const n=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(r,s,n.get?n:{enumerable:!0,get:()=>t[s]})}}return r.default=t,Object.freeze(r)}const Be=ht(b);/**
|
|
2
2
|
* @license lucide-react v0.379.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -322,7 +322,7 @@ Valid keys: `+JSON.stringify(Object.keys($),null," "));var Q=ye(pe,ae,Y,le,ue+"
|
|
|
322
322
|
`)},W_=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r,i=L.useMemo(function(){return Pne(o)},[o]);return L.createElement(One,{styles:$ne(i,!t,o,n?"":"!important")})},f1=!1;if(typeof window<"u")try{var Wp=Object.defineProperty({},"passive",{get:function(){return f1=!0,!0}});window.addEventListener("test",Wp,Wp),window.removeEventListener("test",Wp,Wp)}catch{f1=!1}var sc=f1?{passive:!1}:!1,Tne=function(e){return e.tagName==="TEXTAREA"},VM=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Tne(e)&&n[t]==="visible")},Dne=function(e){return VM(e,"overflowY")},Ane=function(e){return VM(e,"overflowX")},_$=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=HM(e,n);if(r){var o=WM(e,n),i=o[1],s=o[2];if(i>s)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},kne=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Mne=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},HM=function(e,t){return e==="v"?Dne(t):Ane(t)},WM=function(e,t){return e==="v"?kne(t):Mne(t)},Ine=function(e,t){return e==="h"&&t==="rtl"?-1:1},Nne=function(e,t,n,r,o){var i=Ine(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,l=t.contains(a),c=!1,u=s>0,f=0,p=0;do{var h=WM(e,a),b=h[0],v=h[1],w=h[2],y=v-w-i*b;(b||y)&&HM(e,a)&&(f+=y,p+=b),a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(u&&(o&&f===0||!o&&s>f)||!u&&(o&&p===0||!o&&-s>p))&&(c=!0),c},Up=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},S$=function(e){return[e.deltaX,e.deltaY]},C$=function(e){return e&&"current"in e?e.current:e},Lne=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Fne=function(e){return`
|
|
323
323
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
324
324
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
325
|
-
`)},jne=0,ac=[];function zne(e){var t=L.useRef([]),n=L.useRef([0,0]),r=L.useRef(),o=L.useState(jne++)[0],i=L.useState(function(){return cv()})[0],s=L.useRef(e);L.useEffect(function(){s.current=e},[e]),L.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var v=z_([e.lockRef.current],(e.shards||[]).map(C$),!0).filter(Boolean);return v.forEach(function(w){return w.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),v.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=L.useCallback(function(v,w){if("touches"in v&&v.touches.length===2)return!s.current.allowPinchZoom;var y=Up(v),_=n.current,S="deltaX"in v?v.deltaX:_[0]-y[0],C="deltaY"in v?v.deltaY:_[1]-y[1],E,O=v.target,T=Math.abs(S)>Math.abs(C)?"h":"v";if("touches"in v&&T==="h"&&O.type==="range")return!1;var N=_$(T,O);if(!N)return!0;if(N?E=T:(E=T==="v"?"h":"v",N=_$(T,O)),!N)return!1;if(!r.current&&"changedTouches"in v&&(S||C)&&(r.current=E),!E)return!0;var I=r.current||E;return Nne(I,w,v,I==="h"?S:C,!0)},[]),l=L.useCallback(function(v){var w=v;if(!(!ac.length||ac[ac.length-1]!==i)){var y="deltaY"in w?S$(w):Up(w),_=t.current.filter(function(E){return E.name===w.type&&E.target===w.target&&Lne(E.delta,y)})[0];if(_&&_.should){w.cancelable&&w.preventDefault();return}if(!_){var S=(s.current.shards||[]).map(C$).filter(Boolean).filter(function(E){return E.contains(w.target)}),C=S.length>0?a(w,S[0]):!s.current.noIsolation;C&&w.cancelable&&w.preventDefault()}}},[]),c=L.useCallback(function(v,w,y,_){var S={name:v,delta:w,target:y,should:_};t.current.push(S),setTimeout(function(){t.current=t.current.filter(function(C){return C!==S})},1)},[]),u=L.useCallback(function(v){n.current=Up(v),r.current=void 0},[]),f=L.useCallback(function(v){c(v.type,S$(v),v.target,a(v,e.lockRef.current))},[]),p=L.useCallback(function(v){c(v.type,Up(v),v.target,a(v,e.lockRef.current))},[]);L.useEffect(function(){return ac.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",l,sc),document.addEventListener("touchmove",l,sc),document.addEventListener("touchstart",u,sc),function(){ac=ac.filter(function(v){return v!==i}),document.removeEventListener("wheel",l,sc),document.removeEventListener("touchmove",l,sc),document.removeEventListener("touchstart",u,sc)}},[]);var h=e.removeScrollBar,b=e.inert;return L.createElement(L.Fragment,null,b?L.createElement(i,{styles:Fne(o)}):null,h?L.createElement(W_,{gapMode:"margin"}):null)}const Bne=H_(BM,zne);var UM=L.forwardRef(function(e,t){return L.createElement(lv,En({},e,{ref:t,sideCar:Bne}))});UM.classNames=lv.classNames;const U_=UM,Vne=[" ","Enter","ArrowUp","ArrowDown"],Hne=[" ","Enter"],uv="Select",[dv,fv,Wne]=Am(uv),[xu,w1e]=er(uv,[Wne,Di]),q_=Di(),[Une,Dl]=xu(uv),[qne,Gne]=xu(uv),Yne=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:i,value:s,defaultValue:a,onValueChange:l,dir:c,name:u,autoComplete:f,disabled:p,required:h}=e,b=q_(t),[v,w]=m.useState(null),[y,_]=m.useState(null),[S,C]=m.useState(!1),E=Pl(c),[O=!1,T]=_r({prop:r,defaultProp:o,onChange:i}),[N,I]=_r({prop:s,defaultProp:a,onChange:l}),A=m.useRef(null),F=v?!!v.closest("form"):!0,[z,J]=m.useState(new Set),te=Array.from(z).map(H=>H.props.value).join(";");return m.createElement(th,b,m.createElement(Une,{required:h,scope:t,trigger:v,onTriggerChange:w,valueNode:y,onValueNodeChange:_,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:Zo(),value:N,onValueChange:I,open:O,onOpenChange:T,dir:E,triggerPointerDownPosRef:A,disabled:p},m.createElement(dv.Provider,{scope:t},m.createElement(qne,{scope:e.__scopeSelect,onNativeOptionAdd:m.useCallback(H=>{J(Z=>new Set(Z).add(H))},[]),onNativeOptionRemove:m.useCallback(H=>{J(Z=>{const X=new Set(Z);return X.delete(H),X})},[])},n)),F?m.createElement(XM,{key:te,"aria-hidden":!0,required:h,tabIndex:-1,name:u,autoComplete:f,value:N,onChange:H=>I(H.target.value),disabled:p},N===void 0?m.createElement("option",{value:""}):null,Array.from(z)):null))},Kne="SelectTrigger",Xne=m.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=q_(n),s=Dl(Kne,n),a=s.disabled||r,l=_t(t,s.onTriggerChange),c=fv(n),[u,f,p]=QM(b=>{const v=c().filter(_=>!_.disabled),w=v.find(_=>_.value===s.value),y=JM(v,b,w);y!==void 0&&s.onValueChange(y.value)}),h=()=>{a||(s.onOpenChange(!0),p())};return m.createElement(nh,de({asChild:!0},i),m.createElement(Qe.button,de({type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":KM(s.value)?"":void 0},o,{ref:l,onClick:Me(o.onClick,b=>{b.currentTarget.focus()}),onPointerDown:Me(o.onPointerDown,b=>{const v=b.target;v.hasPointerCapture(b.pointerId)&&v.releasePointerCapture(b.pointerId),b.button===0&&b.ctrlKey===!1&&(h(),s.triggerPointerDownPosRef.current={x:Math.round(b.pageX),y:Math.round(b.pageY)},b.preventDefault())}),onKeyDown:Me(o.onKeyDown,b=>{const v=u.current!=="";!(b.ctrlKey||b.altKey||b.metaKey)&&b.key.length===1&&f(b.key),!(v&&b.key===" ")&&Vne.includes(b.key)&&(h(),b.preventDefault())})})))}),Qne="SelectValue",Jne=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:s="",...a}=e,l=Dl(Qne,n),{onValueNodeHasChildrenChange:c}=l,u=i!==void 0,f=_t(t,l.onValueNodeChange);return ur(()=>{c(u)},[c,u]),m.createElement(Qe.span,de({},a,{ref:f,style:{pointerEvents:"none"}}),KM(l.value)?m.createElement(m.Fragment,null,s):i)}),Zne=m.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return m.createElement(Qe.span,de({"aria-hidden":!0},o,{ref:t}),r||"▼")}),ere=e=>m.createElement(w_,de({asChild:!0},e)),uu="SelectContent",tre=m.forwardRef((e,t)=>{const n=Dl(uu,e.__scopeSelect),[r,o]=m.useState();if(ur(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?Cr.createPortal(m.createElement(qM,{scope:e.__scopeSelect},m.createElement(dv.Slot,{scope:e.__scopeSelect},m.createElement("div",null,e.children))),i):null}return m.createElement(nre,de({},e,{ref:t}))}),Qi=10,[qM,Al]=xu(uu),nre=m.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:f,collisionBoundary:p,collisionPadding:h,sticky:b,hideWhenDetached:v,avoidCollisions:w,...y}=e,_=Dl(uu,n),[S,C]=m.useState(null),[E,O]=m.useState(null),T=_t(t,pe=>C(pe)),[N,I]=m.useState(null),[A,F]=m.useState(null),z=fv(n),[J,te]=m.useState(!1),H=m.useRef(!1);m.useEffect(()=>{if(S)return ih(S)},[S]),F_();const Z=m.useCallback(pe=>{const[oe,...ne]=z().map(Q=>Q.ref.current),[ae]=ne.slice(-1),ye=document.activeElement;for(const Q of pe)if(Q===ye||(Q==null||Q.scrollIntoView({block:"nearest"}),Q===oe&&E&&(E.scrollTop=0),Q===ae&&E&&(E.scrollTop=E.scrollHeight),Q==null||Q.focus(),document.activeElement!==ye))return},[z,E]),X=m.useCallback(()=>Z([N,S]),[Z,N,S]);m.useEffect(()=>{J&&X()},[J,X]);const{onOpenChange:K,triggerPointerDownPosRef:W}=_;m.useEffect(()=>{if(S){let pe={x:0,y:0};const oe=ae=>{var ye,Q,be,Se;pe={x:Math.abs(Math.round(ae.pageX)-((ye=(Q=W.current)===null||Q===void 0?void 0:Q.x)!==null&&ye!==void 0?ye:0)),y:Math.abs(Math.round(ae.pageY)-((be=(Se=W.current)===null||Se===void 0?void 0:Se.y)!==null&&be!==void 0?be:0))}},ne=ae=>{pe.x<=10&&pe.y<=10?ae.preventDefault():S.contains(ae.target)||K(!1),document.removeEventListener("pointermove",oe),W.current=null};return W.current!==null&&(document.addEventListener("pointermove",oe),document.addEventListener("pointerup",ne,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",oe),document.removeEventListener("pointerup",ne,{capture:!0})}}},[S,K,W]),m.useEffect(()=>{const pe=()=>K(!1);return window.addEventListener("blur",pe),window.addEventListener("resize",pe),()=>{window.removeEventListener("blur",pe),window.removeEventListener("resize",pe)}},[K]);const[$,V]=QM(pe=>{const oe=z().filter(ye=>!ye.disabled),ne=oe.find(ye=>ye.ref.current===document.activeElement),ae=JM(oe,pe,ne);ae&&setTimeout(()=>ae.ref.current.focus())}),U=m.useCallback((pe,oe,ne)=>{const ae=!H.current&&!ne;(_.value!==void 0&&_.value===oe||ae)&&(I(pe),ae&&(H.current=!0))},[_.value]),M=m.useCallback(()=>S==null?void 0:S.focus(),[S]),Y=m.useCallback((pe,oe,ne)=>{const ae=!H.current&&!ne;(_.value!==void 0&&_.value===oe||ae)&&F(pe)},[_.value]),le=r==="popper"?E$:rre,ue=le===E$?{side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:f,collisionBoundary:p,collisionPadding:h,sticky:b,hideWhenDetached:v,avoidCollisions:w}:{};return m.createElement(qM,{scope:n,content:S,viewport:E,onViewportChange:O,itemRefCallback:U,selectedItem:N,onItemLeave:M,itemTextRefCallback:Y,focusSelectedItem:X,selectedItemText:A,position:r,isPositioned:J,searchRef:$},m.createElement(U_,{as:FM,allowPinchZoom:!0},m.createElement(j_,{asChild:!0,trapped:_.open,onMountAutoFocus:pe=>{pe.preventDefault()},onUnmountAutoFocus:Me(o,pe=>{var oe;(oe=_.trigger)===null||oe===void 0||oe.focus({preventScroll:!0}),pe.preventDefault()})},m.createElement(Zf,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:pe=>pe.preventDefault(),onDismiss:()=>_.onOpenChange(!1)},m.createElement(le,de({role:"listbox",id:_.contentId,"data-state":_.open?"open":"closed",dir:_.dir,onContextMenu:pe=>pe.preventDefault()},y,ue,{onPlaced:()=>te(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:Me(y.onKeyDown,pe=>{const oe=pe.ctrlKey||pe.altKey||pe.metaKey;if(pe.key==="Tab"&&pe.preventDefault(),!oe&&pe.key.length===1&&V(pe.key),["ArrowUp","ArrowDown","Home","End"].includes(pe.key)){let ae=z().filter(ye=>!ye.disabled).map(ye=>ye.ref.current);if(["ArrowUp","End"].includes(pe.key)&&(ae=ae.slice().reverse()),["ArrowUp","ArrowDown"].includes(pe.key)){const ye=pe.target,Q=ae.indexOf(ye);ae=ae.slice(Q+1)}setTimeout(()=>Z(ae)),pe.preventDefault()}})}))))))}),rre=m.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=Dl(uu,n),s=Al(uu,n),[a,l]=m.useState(null),[c,u]=m.useState(null),f=_t(t,T=>u(T)),p=fv(n),h=m.useRef(!1),b=m.useRef(!0),{viewport:v,selectedItem:w,selectedItemText:y,focusSelectedItem:_}=s,S=m.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&c&&v&&w&&y){const T=i.trigger.getBoundingClientRect(),N=c.getBoundingClientRect(),I=i.valueNode.getBoundingClientRect(),A=y.getBoundingClientRect();if(i.dir!=="rtl"){const ye=A.left-N.left,Q=I.left-ye,be=T.left-Q,Se=T.width+be,Oe=Math.max(Se,N.width),Te=window.innerWidth-Qi,Ue=u1(Q,[Qi,Te-Oe]);a.style.minWidth=Se+"px",a.style.left=Ue+"px"}else{const ye=N.right-A.right,Q=window.innerWidth-I.right-ye,be=window.innerWidth-T.right-Q,Se=T.width+be,Oe=Math.max(Se,N.width),Te=window.innerWidth-Qi,Ue=u1(Q,[Qi,Te-Oe]);a.style.minWidth=Se+"px",a.style.right=Ue+"px"}const F=p(),z=window.innerHeight-Qi*2,J=v.scrollHeight,te=window.getComputedStyle(c),H=parseInt(te.borderTopWidth,10),Z=parseInt(te.paddingTop,10),X=parseInt(te.borderBottomWidth,10),K=parseInt(te.paddingBottom,10),W=H+Z+J+K+X,$=Math.min(w.offsetHeight*5,W),V=window.getComputedStyle(v),U=parseInt(V.paddingTop,10),M=parseInt(V.paddingBottom,10),Y=T.top+T.height/2-Qi,le=z-Y,ue=w.offsetHeight/2,pe=w.offsetTop+ue,oe=H+Z+pe,ne=W-oe;if(oe<=Y){const ye=w===F[F.length-1].ref.current;a.style.bottom="0px";const Q=c.clientHeight-v.offsetTop-v.offsetHeight,be=Math.max(le,ue+(ye?M:0)+Q+X),Se=oe+be;a.style.height=Se+"px"}else{const ye=w===F[0].ref.current;a.style.top="0px";const be=Math.max(Y,H+v.offsetTop+(ye?U:0)+ue)+ne;a.style.height=be+"px",v.scrollTop=oe-Y+v.offsetTop}a.style.margin=`${Qi}px 0`,a.style.minHeight=$+"px",a.style.maxHeight=z+"px",r==null||r(),requestAnimationFrame(()=>h.current=!0)}},[p,i.trigger,i.valueNode,a,c,v,w,y,i.dir,r]);ur(()=>S(),[S]);const[C,E]=m.useState();ur(()=>{c&&E(window.getComputedStyle(c).zIndex)},[c]);const O=m.useCallback(T=>{T&&b.current===!0&&(S(),_==null||_(),b.current=!1)},[S,_]);return m.createElement(ore,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:h,onScrollButtonChange:O},m.createElement("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C}},m.createElement(Qe.div,de({},o,{ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}}))))}),E$=m.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Qi,...i}=e,s=q_(n);return m.createElement(rh,de({},s,i,{ref:t,align:r,collisionPadding:o,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)"}}))}),[ore,G_]=xu(uu,{}),R$="SelectViewport",ire=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Al(R$,n),i=G_(R$,n),s=_t(t,o.onViewportChange),a=m.useRef(0);return m.createElement(m.Fragment,null,m.createElement("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}"}}),m.createElement(dv.Slot,{scope:n},m.createElement(Qe.div,de({"data-radix-select-viewport":"",role:"presentation"},r,{ref:s,style:{position:"relative",flex:1,overflow:"auto",...r.style},onScroll:Me(r.onScroll,l=>{const c=l.currentTarget,{contentWrapper:u,shouldExpandOnScrollRef:f}=i;if(f!=null&&f.current&&u){const p=Math.abs(a.current-c.scrollTop);if(p>0){const h=window.innerHeight-Qi*2,b=parseFloat(u.style.minHeight),v=parseFloat(u.style.height),w=Math.max(b,v);if(w<h){const y=w+p,_=Math.min(h,y),S=y-_;u.style.height=_+"px",u.style.bottom==="0px"&&(c.scrollTop=S>0?S:0,u.style.justifyContent="flex-end")}}}a.current=c.scrollTop})}))))}),sre="SelectGroup",[are,lre]=xu(sre),cre=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Zo();return m.createElement(are,{scope:n,id:o},m.createElement(Qe.div,de({role:"group","aria-labelledby":o},r,{ref:t})))}),ure="SelectLabel",dre=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=lre(ure,n);return m.createElement(Qe.div,de({id:o.id},r,{ref:t}))}),h1="SelectItem",[fre,GM]=xu(h1),hre=m.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...s}=e,a=Dl(h1,n),l=Al(h1,n),c=a.value===r,[u,f]=m.useState(i??""),[p,h]=m.useState(!1),b=_t(t,y=>{var _;return(_=l.itemRefCallback)===null||_===void 0?void 0:_.call(l,y,r,o)}),v=Zo(),w=()=>{o||(a.onValueChange(r),a.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 m.createElement(fre,{scope:n,value:r,disabled:o,textId:v,isSelected:c,onItemTextChange:m.useCallback(y=>{f(_=>{var S;return _||((S=y==null?void 0:y.textContent)!==null&&S!==void 0?S:"").trim()})},[])},m.createElement(dv.ItemSlot,{scope:n,value:r,disabled:o,textValue:u},m.createElement(Qe.div,de({role:"option","aria-labelledby":v,"data-highlighted":p?"":void 0,"aria-selected":c&&p,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1},s,{ref:b,onFocus:Me(s.onFocus,()=>h(!0)),onBlur:Me(s.onBlur,()=>h(!1)),onPointerUp:Me(s.onPointerUp,w),onPointerMove:Me(s.onPointerMove,y=>{if(o){var _;(_=l.onItemLeave)===null||_===void 0||_.call(l)}else y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Me(s.onPointerLeave,y=>{if(y.currentTarget===document.activeElement){var _;(_=l.onItemLeave)===null||_===void 0||_.call(l)}}),onKeyDown:Me(s.onKeyDown,y=>{var _;((_=l.searchRef)===null||_===void 0?void 0:_.current)!==""&&y.key===" "||(Hne.includes(y.key)&&w(),y.key===" "&&y.preventDefault())})}))))}),qp="SelectItemText",pre=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,s=Dl(qp,n),a=Al(qp,n),l=GM(qp,n),c=Gne(qp,n),[u,f]=m.useState(null),p=_t(t,y=>f(y),l.onItemTextChange,y=>{var _;return(_=a.itemTextRefCallback)===null||_===void 0?void 0:_.call(a,y,l.value,l.disabled)}),h=u==null?void 0:u.textContent,b=m.useMemo(()=>m.createElement("option",{key:l.value,value:l.value,disabled:l.disabled},h),[l.disabled,l.value,h]),{onNativeOptionAdd:v,onNativeOptionRemove:w}=c;return ur(()=>(v(b),()=>w(b)),[v,w,b]),m.createElement(m.Fragment,null,m.createElement(Qe.span,de({id:l.textId},i,{ref:p})),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Cr.createPortal(i.children,s.valueNode):null)}),gre="SelectItemIndicator",mre=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return GM(gre,n).isSelected?m.createElement(Qe.span,de({"aria-hidden":!0},r,{ref:t})):null}),P$="SelectScrollUpButton",vre=m.forwardRef((e,t)=>{const n=Al(P$,e.__scopeSelect),r=G_(P$,e.__scopeSelect),[o,i]=m.useState(!1),s=_t(t,r.onScrollButtonChange);return ur(()=>{if(n.viewport&&n.isPositioned){let l=function(){const c=a.scrollTop>0;i(c)};const a=n.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),o?m.createElement(YM,de({},e,{ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}})):null}),O$="SelectScrollDownButton",bre=m.forwardRef((e,t)=>{const n=Al(O$,e.__scopeSelect),r=G_(O$,e.__scopeSelect),[o,i]=m.useState(!1),s=_t(t,r.onScrollButtonChange);return ur(()=>{if(n.viewport&&n.isPositioned){let l=function(){const c=a.scrollHeight-a.clientHeight,u=Math.ceil(a.scrollTop)<c;i(u)};const a=n.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),o?m.createElement(YM,de({},e,{ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}})):null}),YM=m.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=Al("SelectScrollButton",n),s=m.useRef(null),a=fv(n),l=m.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return m.useEffect(()=>()=>l(),[l]),ur(()=>{var c;const u=a().find(f=>f.ref.current===document.activeElement);u==null||(c=u.ref.current)===null||c===void 0||c.scrollIntoView({block:"nearest"})},[a]),m.createElement(Qe.div,de({"aria-hidden":!0},o,{ref:t,style:{flexShrink:0,...o.style},onPointerDown:Me(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:Me(o.onPointerMove,()=>{var c;(c=i.onItemLeave)===null||c===void 0||c.call(i),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:Me(o.onPointerLeave,()=>{l()})}))}),yre=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return m.createElement(Qe.div,de({"aria-hidden":!0},r,{ref:t}))});function KM(e){return e===""||e===void 0}const XM=m.forwardRef((e,t)=>{const{value:n,...r}=e,o=m.useRef(null),i=_t(t,o),s=sv(n);return m.useEffect(()=>{const a=o.current,l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==n&&u){const f=new Event("change",{bubbles:!0});u.call(a,n),a.dispatchEvent(f)}},[s,n]),m.createElement(aM,{asChild:!0},m.createElement("select",de({},r,{ref:i,defaultValue:n})))});XM.displayName="BubbleSelect";function QM(e){const t=jn(e),n=m.useRef(""),r=m.useRef(0),o=m.useCallback(s=>{const a=n.current+s;t(a),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(a)},[t]),i=m.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function JM(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=xre(e,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function xre(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const wre=Yne,ZM=Xne,_re=Jne,Sre=Zne,Cre=ere,eI=tre,Ere=ire,Rre=cre,tI=dre,nI=hre,Pre=pre,Ore=mre,rI=vre,oI=bre,iI=yre,Vs=wre,yc=Rre,Hs=_re,Zi=L.forwardRef(({className:e,children:t,...n},r)=>R.jsxs(ZM,{ref:r,className:_e("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,R.jsx(Sre,{asChild:!0,children:R.jsx(d_,{className:"h-4 w-4 opacity-50"})})]}));Zi.displayName=ZM.displayName;const sI=L.forwardRef(({className:e,...t},n)=>R.jsx(rI,{ref:n,className:_e("flex cursor-default items-center justify-center py-1",e),...t,children:R.jsx(OJ,{className:"h-4 w-4"})}));sI.displayName=rI.displayName;const aI=L.forwardRef(({className:e,...t},n)=>R.jsx(oI,{ref:n,className:_e("flex cursor-default items-center justify-center py-1",e),...t,children:R.jsx(d_,{className:"h-4 w-4"})}));aI.displayName=oI.displayName;const es=L.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>R.jsx(Cre,{children:R.jsx(yu,{children:R.jsxs(eI,{ref:o,className:_e("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md 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",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:[R.jsx(sI,{}),R.jsx(Ere,{className:_e("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),R.jsx(aI,{})]})})}));es.displayName=eI.displayName;const Ua=L.forwardRef(({className:e,...t},n)=>R.jsx(tI,{ref:n,className:_e("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Ua.displayName=tI.displayName;const Un=L.forwardRef(({className:e,children:t,...n},r)=>R.jsxs(nI,{ref:r,className:_e("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[R.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:R.jsx(Ore,{children:R.jsx(Qf,{className:"h-4 w-4"})})}),R.jsx(Pre,{children:t})]}));Un.displayName=nI.displayName;const im=L.forwardRef(({className:e,...t},n)=>R.jsx(iI,{ref:n,className:_e("-mx-1 my-1 h-px bg-muted",e),...t}));im.displayName=iI.displayName;function $re(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Tre(...e){return t=>e.forEach(n=>$re(n,t))}var hv=L.forwardRef((e,t)=>{const{children:n,...r}=e,o=L.Children.toArray(n),i=o.find(Dre);if(i){const s=i.props.children,a=o.map(l=>l===i?L.Children.count(s)>1?L.Children.only(null):L.isValidElement(s)?s.props.children:null:l);return R.jsx(p1,{...r,ref:t,children:L.isValidElement(s)?L.cloneElement(s,void 0,a):null})}return R.jsx(p1,{...r,ref:t,children:n})});hv.displayName="Slot";var p1=L.forwardRef((e,t)=>{const{children:n,...r}=e;if(L.isValidElement(n)){const o=kre(n);return L.cloneElement(n,{...Are(r,n.props),ref:t?Tre(t,o):o})}return L.Children.count(n)>1?L.Children.only(null):null});p1.displayName="SlotClone";var lI=({children:e})=>R.jsx(R.Fragment,{children:e});function Dre(e){return L.isValidElement(e)&&e.type===lI}function Are(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function kre(e){var r,o;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=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const $$=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,T$=Ag,Y_=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return T$(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(c=>{const u=n==null?void 0:n[c],f=i==null?void 0:i[c];if(u===null)return null;const p=$$(u)||$$(f);return o[c][p]}),a=n&&Object.entries(n).reduce((c,u)=>{let[f,p]=u;return p===void 0||(c[f]=p),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:f,className:p,...h}=u;return Object.entries(h).every(b=>{let[v,w]=b;return Array.isArray(w)?w.includes({...i,...a}[v]):{...i,...a}[v]===w})?[...c,f,p]:c},[]);return T$(e,s,l,n==null?void 0:n.class,n==null?void 0:n.className)},ef=Y_("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),xr=L.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},i)=>{const s=r?hv:"button";return R.jsx(s,{className:_e(ef({variant:t,size:n,className:e})),ref:i,...o})});xr.displayName="Button";const Mre=m.forwardRef((e,t)=>m.createElement(Qe.label,de({},e,{ref:t,onMouseDown:n=>{var r;(r=e.onMouseDown)===null||r===void 0||r.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault()}}))),cI=Mre,Ire=Y_("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Fn=L.forwardRef(({className:e,...t},n)=>R.jsx(cI,{ref:n,className:_e(Ire(),e),...t}));Fn.displayName=cI.displayName;const uI=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(Lre);if(i){const s=i.props.children,a=o.map(l=>l===i?m.Children.count(s)>1?m.Children.only(null):m.isValidElement(s)?s.props.children:null:l);return m.createElement(g1,de({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(g1,de({},r,{ref:t}),n)});uI.displayName="Slot";const g1=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...Fre(r,n.props),ref:t?us(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});g1.displayName="SlotClone";const Nre=({children:e})=>m.createElement(m.Fragment,null,e);function Lre(e){return m.isValidElement(e)&&e.type===Nre}function Fre(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}const dI="Popover",[fI,_1e]=er(dI,[Di]),K_=Di(),[jre,wu]=fI(dI),zre=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!1}=e,a=K_(t),l=m.useRef(null),[c,u]=m.useState(!1),[f=!1,p]=_r({prop:r,defaultProp:o,onChange:i});return m.createElement(th,a,m.createElement(jre,{scope:t,contentId:Zo(),triggerRef:l,open:f,onOpenChange:p,onOpenToggle:m.useCallback(()=>p(h=>!h),[p]),hasCustomAnchor:c,onCustomAnchorAdd:m.useCallback(()=>u(!0),[]),onCustomAnchorRemove:m.useCallback(()=>u(!1),[]),modal:s},n))},Bre="PopoverTrigger",Vre=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=wu(Bre,n),i=K_(n),s=_t(t,o.triggerRef),a=m.createElement(Qe.button,de({type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":gI(o.open)},r,{ref:s,onClick:Me(e.onClick,o.onOpenToggle)}));return o.hasCustomAnchor?a:m.createElement(nh,de({asChild:!0},i),a)}),hI="PopoverPortal",[Hre,Wre]=fI(hI,{forceMount:void 0}),Ure=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,i=wu(hI,t);return m.createElement(Hre,{scope:t,forceMount:n},m.createElement(tr,{present:n||i.open},m.createElement(w_,{asChild:!0,container:o},r)))},tf="PopoverContent",qre=m.forwardRef((e,t)=>{const n=Wre(tf,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,i=wu(tf,e.__scopePopover);return m.createElement(tr,{present:r||i.open},i.modal?m.createElement(Gre,de({},o,{ref:t})):m.createElement(Yre,de({},o,{ref:t})))}),Gre=m.forwardRef((e,t)=>{const n=wu(tf,e.__scopePopover),r=m.useRef(null),o=_t(t,r),i=m.useRef(!1);return m.useEffect(()=>{const s=r.current;if(s)return ih(s)},[]),m.createElement(U_,{as:uI,allowPinchZoom:!0},m.createElement(pI,de({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Me(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),i.current||(a=n.triggerRef.current)===null||a===void 0||a.focus()}),onPointerDownOutside:Me(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,c=a.button===2||l;i.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:Me(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})))}),Yre=m.forwardRef((e,t)=>{const n=wu(tf,e.__scopePopover),r=m.useRef(!1),o=m.useRef(!1);return m.createElement(pI,de({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s;if((s=e.onCloseAutoFocus)===null||s===void 0||s.call(e,i),!i.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),i.preventDefault()}r.current=!1,o.current=!1},onInteractOutside:i=>{var s,a;(s=e.onInteractOutside)===null||s===void 0||s.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const l=i.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}}))}),pI=m.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...f}=e,p=wu(tf,n),h=K_(n);return F_(),m.createElement(j_,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i},m.createElement(Zf,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>p.onOpenChange(!1)},m.createElement(rh,de({"data-state":gI(p.open),role:"dialog",id:p.contentId},h,f,{ref:t,style:{...f.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)"}}))))});function gI(e){return e?"open":"closed"}const Kre=zre,Xre=Vre,Qre=Ure,mI=qre,pv=Kre,gv=Xre,sh=L.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>R.jsx(Qre,{children:R.jsx(yu,{children:R.jsx(mI,{ref:o,align:t,sideOffset:n,className:_e("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground 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),...r})})}));sh.displayName=mI.displayName;function Jre(e,t){switch(t){case"full-date-time":return{locale:e,format:"full-date-time",options:{weekday:"short",year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!0}};case"short-date-time":return{locale:e,format:"short-date-time",options:{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!0}};case"hours-date-time":return{locale:e,format:"hours-date-time",options:{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}};case"short-date":return{format:"short-date",locale:e,options:{}};case"long-date":return{format:"long-date",locale:e,options:{year:"numeric",month:"long",day:"numeric"}};default:return{format:"short-date-time",locale:e,options:{}}}}const Dc=L.forwardRef(({className:e,type:t,...n},r)=>R.jsx("input",{type:t,className:_e("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...n}));Dc.displayName="Input";function vI({colorRanges:e,setColorRanges:t}){const n={start:-1/0,end:100,color:""};function r(s,a,l){const c=[...e];c[s]={...c[s],[a]:l},t(c)}function o(s){const a=[...e];a.splice(s,1),t(a)}function i(){t([...e,n])}return R.jsxs("div",{className:"space-y-3",children:[R.jsxs("div",{className:"flex items-center gap-2",children:[R.jsx(Fn,{children:"Color Range"}),R.jsx(xr,{onClick:i,variant:"secondary",className:"h-5 p-1 text-muted-foreground",children:R.jsx(h_,{className:"size-3"})})]}),e.map((s,a)=>R.jsxs("div",{className:"flex items-center gap-2 px-2",children:[R.jsx(Dc,{onChange:l=>r(a,"start",l.target.value),value:s.start,className:_e(`h-7 ${vg}`)}),R.jsx("span",{children:"-"}),R.jsx(Dc,{value:s.end,onChange:l=>r(a,"end",l.target.value),className:_e(`h-7 ${vg}`)}),R.jsx(Dc,{onChange:l=>r(a,"color",l.target.value),value:s.color,className:_e(`h-7 min-w-14 p-0 ${vg}`),type:"color",list:"presetColors"}),R.jsxs("datalist",{id:"presetColors",children:[R.jsx("option",{children:Bt.green[600]}),R.jsx("option",{children:Bt.red[500]}),R.jsx("option",{children:Bt.yellow[400]}),R.jsx("option",{children:Bt.orange[500]})]}),R.jsx(xr,{onClick:()=>o(a),variant:"secondary",className:"h-5 p-1 text-muted-foreground",children:R.jsx(Jf,{className:"size-3"})})]},a))]})}const Zre=m.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r=!1,onPressedChange:o,...i}=e,[s=!1,a]=_r({prop:n,onChange:o,defaultProp:r});return m.createElement(Qe.button,de({type:"button","aria-pressed":s,"data-state":s?"on":"off","data-disabled":e.disabled?"":void 0},i,{ref:t,onClick:Me(e.onClick,()=>{e.disabled||a(!s)})}))}),bI=Zre,eoe=Y_("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-3",sm:"h-9 px-2.5",lg:"h-11 px-5"}},defaultVariants:{variant:"default",size:"default"}}),X_=L.forwardRef(({className:e,variant:t,size:n,...r},o)=>R.jsx(bI,{ref:o,className:_e(eoe({variant:t,size:n,className:e})),...r}));X_.displayName=bI.displayName;function toe(e,t){var r;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(o=>o.columnIdx===t);return n==null?void 0:n.type}function noe(e,t){var r,o;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(i=>i.columnIdx===t);return((o=n==null?void 0:n.options)==null?void 0:o.locale)||"en-US"}function roe(e,t){var r,o;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(i=>i.columnIdx===t&&i.type==="date");return((o=n==null?void 0:n.options)==null?void 0:o.format)||"short-date-time"}function ooe(e,t){var r,o;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(i=>i.columnIdx===t);return(o=n==null?void 0:n.options)==null?void 0:o.currency}function ioe(e,t){var r,o,i;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(s=>s.columnIdx===t);return((i=(o=n==null?void 0:n.options)==null?void 0:o.options)==null?void 0:i.minimumFractionDigits)||0}function soe(e,t){var r,o;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(i=>i.columnIdx===t);return((o=n==null?void 0:n.options)==null?void 0:o.colorRanges)||[]}function aoe(e,t){var r,o,i;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(s=>s.columnIdx===t);return((i=(o=n==null?void 0:n.options)==null?void 0:o.options)==null?void 0:i.style)==="percent"}function loe({columnIndex:e,columnName:t}){const[n,r]=m.useState(!1),o=br(I=>{var A;return(A=I.card)==null?void 0:A.preferences}),[i,s]=m.useState(toe(o,e)),[a,l]=m.useState(soe(o,e)),[c,u]=m.useState(noe(o,e)),[f,p]=m.useState(roe(o,e)),[h,b]=m.useState(ooe(o,e)),[v,w]=m.useState(ioe(o,e).toString()),[y,_]=m.useState(aoe(o,e));m.useState("");const S=br(I=>I.actions.setCardPreferences);function C(){const I=[...new Set(nx.map(A=>A.currency))];return R.jsx(R.Fragment,{children:R.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[R.jsx(Fn,{className:"col-span-3",htmlFor:"format",children:"Locale"}),R.jsxs(Vs,{value:c,onValueChange:A=>u(A),children:[R.jsx(Zi,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:R.jsx(Hs,{})}),R.jsx(es,{children:R.jsxs(yc,{children:[R.jsx(Ua,{children:"Locale"}),nx.map(A=>R.jsx(Un,{value:A.locale,children:A.locale},A.locale))]})})]}),R.jsx(Fn,{className:"col-span-3",htmlFor:"format",children:"Currency"}),R.jsxs(Vs,{value:h||"none",onValueChange:A=>b(A==="none"?void 0:A),children:[R.jsx(Zi,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:R.jsx(Hs,{})}),R.jsx(es,{children:R.jsxs(yc,{children:[R.jsx(Ua,{children:"Currency"}),R.jsx(Un,{value:"none",children:"None"}),I.map(A=>R.jsx(Un,{value:A,children:A},A))]})})]}),R.jsx(Fn,{className:"col-span-3",htmlFor:"format",children:"Decimals"}),R.jsxs(Vs,{value:v,onValueChange:A=>w(A),children:[R.jsx(Zi,{className:"col-span-3 h-8 w-full focus:ring-1 focus:ring-offset-0",children:R.jsx(Hs,{})}),R.jsx(es,{children:["0","1","2","3","4"].map(A=>R.jsx(Un,{value:A,children:A},A))})]}),!h&&R.jsx(X_,{onPressedChange:A=>_(A),variant:"outline",size:"sm",className:"col-span-3 h-8","aria-label":"Toggle italic",children:R.jsx(AJ,{className:"size-3"})})]})})}function E(){return R.jsx(R.Fragment,{children:R.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[R.jsx(Fn,{className:"col-span-3",htmlFor:"format",children:"Locale"}),R.jsxs(Vs,{defaultValue:"en-US",value:c,onValueChange:I=>u(I),children:[R.jsx(Zi,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:R.jsx(Hs,{})}),R.jsx(es,{children:iV.map(I=>R.jsxs(yc,{children:[R.jsx(Ua,{children:I.label}),I.locales.map(A=>R.jsx(Un,{value:A.code,children:A.name},A.code))]},I.label))})]}),R.jsx(Fn,{className:"col-span-3",htmlFor:"format",children:"Format"}),R.jsxs(Vs,{defaultValue:"short-date-time",value:f,onValueChange:I=>{console.log("format",I),p(I)},children:[R.jsx(Zi,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:R.jsx(Hs,{})}),R.jsx(es,{className:"",id:"type",children:R.jsxs(yc,{children:[R.jsx(Ua,{children:"Option"}),R.jsx(Un,{value:"full-date-time",children:"Full Date-Time"}),R.jsx(Un,{value:"short-date-time",children:"Short Date-Time"}),R.jsx(Un,{value:"hours-date-time",children:"24-Hour Date-Time"}),R.jsx(Un,{value:"short-date",children:"Short Date"}),R.jsx(Un,{value:"long-date",children:"Long Date"})]})})]})]})})}function O(){S({...o,columnSettings:[]})}function T(){var I;S({...o,columnSettings:[...((I=o==null?void 0:o.columnSettings)==null?void 0:I.filter(A=>A.columnIdx!==e))||[]]})}function N(){var I,A,F;if(i==="date"){const z=Jre(c,f),J={columnIdx:e,type:i,options:z};S({...o,columnSettings:[...((I=o==null?void 0:o.columnSettings)==null?void 0:I.filter(te=>te.columnIdx!==e))||[],J]})}else if(i==="number"){let z;h?z={locale:c,currency:h,options:{style:"currency",currency:h,minimumFractionDigits:Number(v)},colorRanges:a.length>0?a:void 0}:z={locale:c,currency:void 0,options:{style:y?"percent":"decimal",minimumFractionDigits:Number(v)},colorRanges:a.length>0?a:void 0};const J={columnIdx:e,type:i,options:z};S({...o,columnSettings:[...((A=o==null?void 0:o.columnSettings)==null?void 0:A.filter(te=>te.columnIdx!==e))||[],J]})}else S({...o,columnSettings:[...((F=o==null?void 0:o.columnSettings)==null?void 0:F.filter(z=>z.columnIdx!==e))||[]]})}return R.jsxs(pv,{onOpenChange:I=>r(I),children:[R.jsx(gv,{asChild:!0,children:R.jsx(p_,{className:"size-3.5 cursor-pointer text-muted"})}),R.jsx(sh,{align:"center",className:"max-w-70",children:R.jsxs("div",{className:"grid gap-4",children:[R.jsxs("div",{className:"space-y-2",children:[R.jsx("h4",{className:"font-medium leading-none",children:"Display Settings"}),R.jsx("p",{className:"text-sm text-muted-foreground",children:`Display setting for '${t}'`})]}),R.jsxs("div",{className:"grid gap-2",children:[R.jsxs("div",{className:"grid grid-cols-3 items-center gap-2",children:[R.jsx(Fn,{htmlFor:"scale",children:"Type"}),R.jsxs(Vs,{value:i||"none",onValueChange:I=>s(I),children:[R.jsx(Zi,{className:"col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0",children:R.jsx(Hs,{})}),R.jsx(es,{id:"type",children:R.jsxs(yc,{children:[R.jsx(Ua,{children:"Option"}),R.jsx(Un,{value:"number",children:"Number"}),R.jsx(Un,{value:"date",children:"Date"}),R.jsx(Un,{value:"none",children:"None"})]})})]})]}),i==="number"&&C(),i==="date"&&E(),i==="number"&&R.jsxs(R.Fragment,{children:[R.jsx(im,{}),R.jsx(vI,{colorRanges:a,setColorRanges:l})]}),R.jsx(im,{}),R.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[R.jsx(xr,{onClick:O,variant:"secondary",className:"col-span-1 col-start-1 h-8 w-full text-destructive",children:"Reset All"}),R.jsx(xr,{onClick:T,variant:"secondary",className:"col-span-1 col-start-2 h-8 w-full",children:"Reset"}),R.jsx(xr,{onClick:N,variant:"secondary",className:"col-span-1 col-start-3 h-8 w-full",children:"Apply"})]})]})]})})]})}function coe(e){const t=new Date(e);return!isNaN(t.getTime())}function yI({data:e,card:t}){var C,E,O,T;const[n,r]=m.useState([]),{keys:o}=lr(e),i=$e(N=>N.filteringCards),s=$e(N=>N.themeStyle),a=$e(N=>N.isVisualEditing),l=i==null?void 0:i.find(N=>N.id===t.id),c=(C=t==null?void 0:t.preferences)==null?void 0:C.onClickFilter,{addOrUpdateFilterValues:u,addFilteringCard:f,removeFilterValue:p,removeFilteringCard:h}=wr(),b=t==null?void 0:t.preferences;function v(N,I){if((I==null?void 0:I.type)==="date"&&coe(N)){const{locale:A,options:F}=I.options,z=new Date(N);return new Date(z.getTime()).toLocaleDateString(A,F)}if((I==null?void 0:I.type)==="number"){const{locale:A,currency:F,options:z}=I.options;return F?new Intl.NumberFormat(A,{style:"currency",currency:F,...z}).format(N):new Intl.NumberFormat(A,z).format(N)}return N}const w=o.map((N,I)=>({accessorKey:N,header:({column:A})=>{const F=A.getIsSorted();return R.jsxs("div",{className:"flex items-center justify-between gap-2",children:[R.jsxs("div",{className:"flex cursor-pointer items-center",onClick:()=>A.toggleSorting(A.getIsSorted()==="asc"),children:[N,F==="asc"?R.jsx(u_,{className:"ml-2 h-5 w-5"}):F==="desc"?R.jsx(c_,{className:"ml-2 h-5 w-5"}):null]}),a&&R.jsx(loe,{columnName:A.id,columnIndex:I})]})},cell:({cell:A})=>{var H,Z;const F=A.getValue(),z=(H=b==null?void 0:b.columnSettings)==null?void 0:H.find(X=>X.columnIdx===I),J=v(F,z),te=hM(F,(Z=z==null?void 0:z.options)==null?void 0:Z.colorRanges);return R.jsx("div",{className:"px-2 py-1",style:{backgroundColor:te},children:J})}})),y=NM({data:e,columns:w,getCoreRowModel:kM(),getPaginationRowModel:IM(),onSortingChange:r,getSortedRowModel:MM(),manualPagination:!0,state:{sorting:n}}),_=y.getSelectedRowModel().rows;m.useEffect(()=>{if(_.length===0){if(l){const N=t.id;p(N),h(t)}return}if(c){const{dimensionKeys:N}=lr(e),I=c.map(A=>{const F=N==null?void 0:N[A.columnIndex],z=_.map(te=>te.getValue(F));return{filterId:t.id+"-"+F,connectionId:t==null?void 0:t.connectionId,tableName:t.lastSelectedTable,name:F,expression:A.expression,valueType:Bd(z[0]===void 0?"":z[0]),operation:"in",values:z}});u(I),f(t)}},[f,u,t,e,l,c,p,h,_]);function S(N){N.toggleSelected()}return R.jsxs(D_,{className:"",containerClassName:"rounded-md",containerStyle:{borderTopRightRadius:(E=s==null?void 0:s.chart)==null?void 0:E.options.borderRadius,borderTopLeftRadius:(O=s==null?void 0:s.chart)==null?void 0:O.options.borderRadius},onMouseDown:N=>N.stopPropagation(),children:[R.jsx(A_,{children:y.getHeaderGroups().map(N=>R.jsx(kd,{children:N.headers.map((I,A)=>{var F,z,J,te,H,Z,X;return R.jsx(M_,{style:{backgroundColor:(J=(z=(F=s==null?void 0:s.chart)==null?void 0:F.dataset)==null?void 0:z.backgroundColor)==null?void 0:J[0],color:Zc((Z=(H=(te=s==null?void 0:s.chart)==null?void 0:te.dataset)==null?void 0:H.backgroundColor)==null?void 0:Z[0])},className:_e("sticky -top-[1px] z-50 h-9 bg-muted-foreground px-2 text-background",{"border-x":A>0&&A<N.headers.length-1,"border-l":A===1&&N.headers.length==2},(X=s==null?void 0:s.table)==null?void 0:X.tableHeaderColor),children:I.isPlaceholder?null:c1(I.column.columnDef.header,I.getContext())},I.id)})},N.id))}),R.jsx(k_,{children:(T=y.getRowModel().rows)!=null&&T.length?y.getRowModel().rows.map((N,I)=>R.jsx(kd,{onClick:()=>S(N),className:_e("whitespace-nowrap p-1",{"cursor-pointer data-[state=selected]:border-2 data-[state=selected]:border-dashed":c&&(c==null?void 0:c.length)>0}),"data-state":N.getIsSelected()&&"selected",children:N.getVisibleCells().map((A,F)=>{var z;return R.jsx(rm,{onClick:J=>{var H;const te=((H=window==null?void 0:window.getSelection())==null?void 0:H.toString())||"";(te==null?void 0:te.length)>0&&J.stopPropagation()},className:_e("p-0",{"border-x":F>0&&F<w.length-1||F===1&&w.length==2,"border-l":F==0,"border-r":F===w.length-1,"border-b":I===((z=y.getRowModel().rows)==null?void 0:z.length)-1}),children:c1(A.column.columnDef.cell,A.getContext())},A.id)})},N.id)):R.jsx(kd,{children:R.jsx(rm,{colSpan:w.length,className:"p-1 text-center",children:"No results."})})})]})}/*! @license DOMPurify 3.1.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.6/LICENSE */const{entries:xI,setPrototypeOf:D$,isFrozen:uoe,getPrototypeOf:doe,getOwnPropertyDescriptor:foe}=Object;let{freeze:Sr,seal:Io,create:wI}=Object,{apply:m1,construct:v1}=typeof Reflect<"u"&&Reflect;Sr||(Sr=function(t){return t});Io||(Io=function(t){return t});m1||(m1=function(t,n,r){return t.apply(n,r)});v1||(v1=function(t,n){return new t(...n)});const Gp=po(Array.prototype.forEach),A$=po(Array.prototype.pop),nd=po(Array.prototype.push),Og=po(String.prototype.toLowerCase),q0=po(String.prototype.toString),k$=po(String.prototype.match),rd=po(String.prototype.replace),hoe=po(String.prototype.indexOf),poe=po(String.prototype.trim),qo=po(Object.prototype.hasOwnProperty),gr=po(RegExp.prototype.test),od=goe(TypeError);function po(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return m1(e,t,r)}}function goe(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return v1(e,n)}}function $t(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Og;D$&&D$(e,null);let r=t.length;for(;r--;){let o=t[r];if(typeof o=="string"){const i=n(o);i!==o&&(uoe(t)||(t[r]=i),o=i)}e[o]=!0}return e}function moe(e){for(let t=0;t<e.length;t++)qo(e,t)||(e[t]=null);return e}function Va(e){const t=wI(null);for(const[n,r]of xI(e))qo(e,n)&&(Array.isArray(r)?t[n]=moe(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=Va(r):t[n]=r);return t}function id(e,t){for(;e!==null;){const r=foe(e,t);if(r){if(r.get)return po(r.get);if(typeof r.value=="function")return po(r.value)}e=doe(e)}function n(){return null}return n}const M$=Sr(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),G0=Sr(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Y0=Sr(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),voe=Sr(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),K0=Sr(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),boe=Sr(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),I$=Sr(["#text"]),N$=Sr(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),X0=Sr(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),L$=Sr(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Yp=Sr(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),yoe=Io(/\{\{[\w\W]*|[\w\W]*\}\}/gm),xoe=Io(/<%[\w\W]*|[\w\W]*%>/gm),woe=Io(/\${[\w\W]*}/gm),_oe=Io(/^data-[\-\w.\u00B7-\uFFFF]/),Soe=Io(/^aria-[\-\w]+$/),_I=Io(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Coe=Io(/^(?:\w+script|data):/i),Eoe=Io(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),SI=Io(/^html$/i),Roe=Io(/^[a-z][.\w]*(-[.\w]+)+$/i);var F$=Object.freeze({__proto__:null,MUSTACHE_EXPR:yoe,ERB_EXPR:xoe,TMPLIT_EXPR:woe,DATA_ATTR:_oe,ARIA_ATTR:Soe,IS_ALLOWED_URI:_I,IS_SCRIPT_OR_DATA:Coe,ATTR_WHITESPACE:Eoe,DOCTYPE_NAME:SI,CUSTOM_ELEMENT:Roe});const sd={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Poe=function(){return typeof window>"u"?null:window},Ooe=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const o="data-tt-policy-suffix";n&&n.hasAttribute(o)&&(r=n.getAttribute(o));const i="dompurify"+(r?"#"+r:"");try{return t.createPolicy(i,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}};function CI(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Poe();const t=Ae=>CI(Ae);if(t.version="3.1.6",t.removed=[],!e||!e.document||e.document.nodeType!==sd.document)return t.isSupported=!1,t;let{document:n}=e;const r=n,o=r.currentScript,{DocumentFragment:i,HTMLTemplateElement:s,Node:a,Element:l,NodeFilter:c,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:f,DOMParser:p,trustedTypes:h}=e,b=l.prototype,v=id(b,"cloneNode"),w=id(b,"remove"),y=id(b,"nextSibling"),_=id(b,"childNodes"),S=id(b,"parentNode");if(typeof s=="function"){const Ae=n.createElement("template");Ae.content&&Ae.content.ownerDocument&&(n=Ae.content.ownerDocument)}let C,E="";const{implementation:O,createNodeIterator:T,createDocumentFragment:N,getElementsByTagName:I}=n,{importNode:A}=r;let F={};t.isSupported=typeof xI=="function"&&typeof S=="function"&&O&&O.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:z,ERB_EXPR:J,TMPLIT_EXPR:te,DATA_ATTR:H,ARIA_ATTR:Z,IS_SCRIPT_OR_DATA:X,ATTR_WHITESPACE:K,CUSTOM_ELEMENT:W}=F$;let{IS_ALLOWED_URI:$}=F$,V=null;const U=$t({},[...M$,...G0,...Y0,...K0,...I$]);let M=null;const Y=$t({},[...N$,...X0,...L$,...Yp]);let le=Object.seal(wI(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ue=null,pe=null,oe=!0,ne=!0,ae=!1,ye=!0,Q=!1,be=!0,Se=!1,Oe=!1,Te=!1,Ue=!1,Be=!1,Ie=!1,Ke=!0,lt=!1;const It="user-content-";let Dt=!0,Ht=!1,he={},Ee=null;const Le=$t({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ge=null;const Ze=$t({},["audio","video","img","source","image","track"]);let Wt=null;const Zt=$t({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Kt="http://www.w3.org/1998/Math/MathML",vn="http://www.w3.org/2000/svg",ln="http://www.w3.org/1999/xhtml";let Lt=ln,tn=!1,xn=null;const nt=$t({},[Kt,vn,ln],q0);let ht=null;const At=["application/xhtml+xml","text/html"],Xt="text/html";let bt=null,On=null;const Fo=n.createElement("form"),vs=function(G){return G instanceof RegExp||G instanceof Function},jo=function(){let G=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(On&&On===G)){if((!G||typeof G!="object")&&(G={}),G=Va(G),ht=At.indexOf(G.PARSER_MEDIA_TYPE)===-1?Xt:G.PARSER_MEDIA_TYPE,bt=ht==="application/xhtml+xml"?q0:Og,V=qo(G,"ALLOWED_TAGS")?$t({},G.ALLOWED_TAGS,bt):U,M=qo(G,"ALLOWED_ATTR")?$t({},G.ALLOWED_ATTR,bt):Y,xn=qo(G,"ALLOWED_NAMESPACES")?$t({},G.ALLOWED_NAMESPACES,q0):nt,Wt=qo(G,"ADD_URI_SAFE_ATTR")?$t(Va(Zt),G.ADD_URI_SAFE_ATTR,bt):Zt,Ge=qo(G,"ADD_DATA_URI_TAGS")?$t(Va(Ze),G.ADD_DATA_URI_TAGS,bt):Ze,Ee=qo(G,"FORBID_CONTENTS")?$t({},G.FORBID_CONTENTS,bt):Le,ue=qo(G,"FORBID_TAGS")?$t({},G.FORBID_TAGS,bt):{},pe=qo(G,"FORBID_ATTR")?$t({},G.FORBID_ATTR,bt):{},he=qo(G,"USE_PROFILES")?G.USE_PROFILES:!1,oe=G.ALLOW_ARIA_ATTR!==!1,ne=G.ALLOW_DATA_ATTR!==!1,ae=G.ALLOW_UNKNOWN_PROTOCOLS||!1,ye=G.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Q=G.SAFE_FOR_TEMPLATES||!1,be=G.SAFE_FOR_XML!==!1,Se=G.WHOLE_DOCUMENT||!1,Ue=G.RETURN_DOM||!1,Be=G.RETURN_DOM_FRAGMENT||!1,Ie=G.RETURN_TRUSTED_TYPE||!1,Te=G.FORCE_BODY||!1,Ke=G.SANITIZE_DOM!==!1,lt=G.SANITIZE_NAMED_PROPS||!1,Dt=G.KEEP_CONTENT!==!1,Ht=G.IN_PLACE||!1,$=G.ALLOWED_URI_REGEXP||_I,Lt=G.NAMESPACE||ln,le=G.CUSTOM_ELEMENT_HANDLING||{},G.CUSTOM_ELEMENT_HANDLING&&vs(G.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(le.tagNameCheck=G.CUSTOM_ELEMENT_HANDLING.tagNameCheck),G.CUSTOM_ELEMENT_HANDLING&&vs(G.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(le.attributeNameCheck=G.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),G.CUSTOM_ELEMENT_HANDLING&&typeof G.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(le.allowCustomizedBuiltInElements=G.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Q&&(ne=!1),Be&&(Ue=!0),he&&(V=$t({},I$),M=[],he.html===!0&&($t(V,M$),$t(M,N$)),he.svg===!0&&($t(V,G0),$t(M,X0),$t(M,Yp)),he.svgFilters===!0&&($t(V,Y0),$t(M,X0),$t(M,Yp)),he.mathMl===!0&&($t(V,K0),$t(M,L$),$t(M,Yp))),G.ADD_TAGS&&(V===U&&(V=Va(V)),$t(V,G.ADD_TAGS,bt)),G.ADD_ATTR&&(M===Y&&(M=Va(M)),$t(M,G.ADD_ATTR,bt)),G.ADD_URI_SAFE_ATTR&&$t(Wt,G.ADD_URI_SAFE_ATTR,bt),G.FORBID_CONTENTS&&(Ee===Le&&(Ee=Va(Ee)),$t(Ee,G.FORBID_CONTENTS,bt)),Dt&&(V["#text"]=!0),Se&&$t(V,["html","head","body"]),V.table&&($t(V,["tbody"]),delete ue.tbody),G.TRUSTED_TYPES_POLICY){if(typeof G.TRUSTED_TYPES_POLICY.createHTML!="function")throw od('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof G.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw od('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');C=G.TRUSTED_TYPES_POLICY,E=C.createHTML("")}else C===void 0&&(C=Ooe(h,o)),C!==null&&typeof E=="string"&&(E=C.createHTML(""));Sr&&Sr(G),On=G}},ki=$t({},["mi","mo","mn","ms","mtext"]),ri=$t({},["foreignobject","annotation-xml"]),Mi=$t({},["title","style","font","a","script"]),bs=$t({},[...G0,...Y0,...voe]),oi=$t({},[...K0,...boe]),Ii=function(G){let me=S(G);(!me||!me.tagName)&&(me={namespaceURI:Lt,tagName:"template"});const ke=Og(G.tagName),st=Og(me.tagName);return xn[G.namespaceURI]?G.namespaceURI===vn?me.namespaceURI===ln?ke==="svg":me.namespaceURI===Kt?ke==="svg"&&(st==="annotation-xml"||ki[st]):!!bs[ke]:G.namespaceURI===Kt?me.namespaceURI===ln?ke==="math":me.namespaceURI===vn?ke==="math"&&ri[st]:!!oi[ke]:G.namespaceURI===ln?me.namespaceURI===vn&&!ri[st]||me.namespaceURI===Kt&&!ki[st]?!1:!oi[ke]&&(Mi[ke]||!bs[ke]):!!(ht==="application/xhtml+xml"&&xn[G.namespaceURI]):!1},Bn=function(G){nd(t.removed,{element:G});try{S(G).removeChild(G)}catch{w(G)}},ii=function(G,me){try{nd(t.removed,{attribute:me.getAttributeNode(G),from:me})}catch{nd(t.removed,{attribute:null,from:me})}if(me.removeAttribute(G),G==="is"&&!M[G])if(Ue||Be)try{Bn(me)}catch{}else try{me.setAttribute(G,"")}catch{}},ys=function(G){let me=null,ke=null;if(Te)G="<remove></remove>"+G;else{const ft=k$(G,/^[\r\n\t ]+/);ke=ft&&ft[0]}ht==="application/xhtml+xml"&&Lt===ln&&(G='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+G+"</body></html>");const st=C?C.createHTML(G):G;if(Lt===ln)try{me=new p().parseFromString(st,ht)}catch{}if(!me||!me.documentElement){me=O.createDocument(Lt,"template",null);try{me.documentElement.innerHTML=tn?E:st}catch{}}const bn=me.body||me.documentElement;return G&&ke&&bn.insertBefore(n.createTextNode(ke),bn.childNodes[0]||null),Lt===ln?I.call(me,Se?"html":"body")[0]:Se?me.documentElement:bn},xs=function(G){return T.call(G.ownerDocument||G,G,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},D=function(G){return G instanceof f&&(typeof G.nodeName!="string"||typeof G.textContent!="string"||typeof G.removeChild!="function"||!(G.attributes instanceof u)||typeof G.removeAttribute!="function"||typeof G.setAttribute!="function"||typeof G.namespaceURI!="string"||typeof G.insertBefore!="function"||typeof G.hasChildNodes!="function")},re=function(G){return typeof a=="function"&&G instanceof a},fe=function(G,me,ke){F[G]&&Gp(F[G],st=>{st.call(t,me,ke,On)})},Pe=function(G){let me=null;if(fe("beforeSanitizeElements",G,null),D(G))return Bn(G),!0;const ke=bt(G.nodeName);if(fe("uponSanitizeElement",G,{tagName:ke,allowedTags:V}),G.hasChildNodes()&&!re(G.firstElementChild)&&gr(/<[/\w]/g,G.innerHTML)&&gr(/<[/\w]/g,G.textContent)||G.nodeType===sd.progressingInstruction||be&&G.nodeType===sd.comment&&gr(/<[/\w]/g,G.data))return Bn(G),!0;if(!V[ke]||ue[ke]){if(!ue[ke]&&qe(ke)&&(le.tagNameCheck instanceof RegExp&&gr(le.tagNameCheck,ke)||le.tagNameCheck instanceof Function&&le.tagNameCheck(ke)))return!1;if(Dt&&!Ee[ke]){const st=S(G)||G.parentNode,bn=_(G)||G.childNodes;if(bn&&st){const ft=bn.length;for(let nr=ft-1;nr>=0;--nr){const vo=v(bn[nr],!0);vo.__removalCount=(G.__removalCount||0)+1,st.insertBefore(vo,y(G))}}}return Bn(G),!0}return G instanceof l&&!Ii(G)||(ke==="noscript"||ke==="noembed"||ke==="noframes")&&gr(/<\/no(script|embed|frames)/i,G.innerHTML)?(Bn(G),!0):(Q&&G.nodeType===sd.text&&(me=G.textContent,Gp([z,J,te],st=>{me=rd(me,st," ")}),G.textContent!==me&&(nd(t.removed,{element:G.cloneNode()}),G.textContent=me)),fe("afterSanitizeElements",G,null),!1)},He=function(G,me,ke){if(Ke&&(me==="id"||me==="name")&&(ke in n||ke in Fo))return!1;if(!(ne&&!pe[me]&&gr(H,me))){if(!(oe&&gr(Z,me))){if(!M[me]||pe[me]){if(!(qe(G)&&(le.tagNameCheck instanceof RegExp&&gr(le.tagNameCheck,G)||le.tagNameCheck instanceof Function&&le.tagNameCheck(G))&&(le.attributeNameCheck instanceof RegExp&&gr(le.attributeNameCheck,me)||le.attributeNameCheck instanceof Function&&le.attributeNameCheck(me))||me==="is"&&le.allowCustomizedBuiltInElements&&(le.tagNameCheck instanceof RegExp&&gr(le.tagNameCheck,ke)||le.tagNameCheck instanceof Function&&le.tagNameCheck(ke))))return!1}else if(!Wt[me]){if(!gr($,rd(ke,K,""))){if(!((me==="src"||me==="xlink:href"||me==="href")&&G!=="script"&&hoe(ke,"data:")===0&&Ge[G])){if(!(ae&&!gr(X,rd(ke,K,"")))){if(ke)return!1}}}}}}return!0},qe=function(G){return G!=="annotation-xml"&&k$(G,W)},ze=function(G){fe("beforeSanitizeAttributes",G,null);const{attributes:me}=G;if(!me)return;const ke={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:M};let st=me.length;for(;st--;){const bn=me[st],{name:ft,namespaceURI:nr,value:vo}=bn,wa=bt(ft);let Vn=ft==="value"?vo:poe(vo);if(ke.attrName=wa,ke.attrValue=Vn,ke.keepAttr=!0,ke.forceKeepAttr=void 0,fe("uponSanitizeAttribute",G,ke),Vn=ke.attrValue,be&&gr(/((--!?|])>)|<\/(style|title)/i,Vn)){ii(ft,G);continue}if(ke.forceKeepAttr||(ii(ft,G),!ke.keepAttr))continue;if(!ye&&gr(/\/>/i,Vn)){ii(ft,G);continue}Q&&Gp([z,J,te],Pu=>{Vn=rd(Vn,Pu," ")});const Ru=bt(G.nodeName);if(He(Ru,wa,Vn)){if(lt&&(wa==="id"||wa==="name")&&(ii(ft,G),Vn=It+Vn),C&&typeof h=="object"&&typeof h.getAttributeType=="function"&&!nr)switch(h.getAttributeType(Ru,wa)){case"TrustedHTML":{Vn=C.createHTML(Vn);break}case"TrustedScriptURL":{Vn=C.createScriptURL(Vn);break}}try{nr?G.setAttributeNS(nr,ft,Vn):G.setAttribute(ft,Vn),D(G)?Bn(G):A$(t.removed)}catch{}}}fe("afterSanitizeAttributes",G,null)},Fe=function Ae(G){let me=null;const ke=xs(G);for(fe("beforeSanitizeShadowDOM",G,null);me=ke.nextNode();)fe("uponSanitizeShadowNode",me,null),!Pe(me)&&(me.content instanceof i&&Ae(me.content),ze(me));fe("afterSanitizeShadowDOM",G,null)};return t.sanitize=function(Ae){let G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},me=null,ke=null,st=null,bn=null;if(tn=!Ae,tn&&(Ae="<!-->"),typeof Ae!="string"&&!re(Ae))if(typeof Ae.toString=="function"){if(Ae=Ae.toString(),typeof Ae!="string")throw od("dirty is not a string, aborting")}else throw od("toString is not a function");if(!t.isSupported)return Ae;if(Oe||jo(G),t.removed=[],typeof Ae=="string"&&(Ht=!1),Ht){if(Ae.nodeName){const vo=bt(Ae.nodeName);if(!V[vo]||ue[vo])throw od("root node is forbidden and cannot be sanitized in-place")}}else if(Ae instanceof a)me=ys("<!---->"),ke=me.ownerDocument.importNode(Ae,!0),ke.nodeType===sd.element&&ke.nodeName==="BODY"||ke.nodeName==="HTML"?me=ke:me.appendChild(ke);else{if(!Ue&&!Q&&!Se&&Ae.indexOf("<")===-1)return C&&Ie?C.createHTML(Ae):Ae;if(me=ys(Ae),!me)return Ue?null:Ie?E:""}me&&Te&&Bn(me.firstChild);const ft=xs(Ht?Ae:me);for(;st=ft.nextNode();)Pe(st)||(st.content instanceof i&&Fe(st.content),ze(st));if(Ht)return Ae;if(Ue){if(Be)for(bn=N.call(me.ownerDocument);me.firstChild;)bn.appendChild(me.firstChild);else bn=me;return(M.shadowroot||M.shadowrootmode)&&(bn=A.call(r,bn,!0)),bn}let nr=Se?me.outerHTML:me.innerHTML;return Se&&V["!doctype"]&&me.ownerDocument&&me.ownerDocument.doctype&&me.ownerDocument.doctype.name&&gr(SI,me.ownerDocument.doctype.name)&&(nr="<!DOCTYPE "+me.ownerDocument.doctype.name+`>
|
|
325
|
+
`)},jne=0,ac=[];function zne(e){var t=L.useRef([]),n=L.useRef([0,0]),r=L.useRef(),o=L.useState(jne++)[0],i=L.useState(function(){return cv()})[0],s=L.useRef(e);L.useEffect(function(){s.current=e},[e]),L.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var v=z_([e.lockRef.current],(e.shards||[]).map(C$),!0).filter(Boolean);return v.forEach(function(w){return w.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),v.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=L.useCallback(function(v,w){if("touches"in v&&v.touches.length===2)return!s.current.allowPinchZoom;var y=Up(v),_=n.current,S="deltaX"in v?v.deltaX:_[0]-y[0],C="deltaY"in v?v.deltaY:_[1]-y[1],E,O=v.target,T=Math.abs(S)>Math.abs(C)?"h":"v";if("touches"in v&&T==="h"&&O.type==="range")return!1;var N=_$(T,O);if(!N)return!0;if(N?E=T:(E=T==="v"?"h":"v",N=_$(T,O)),!N)return!1;if(!r.current&&"changedTouches"in v&&(S||C)&&(r.current=E),!E)return!0;var I=r.current||E;return Nne(I,w,v,I==="h"?S:C,!0)},[]),l=L.useCallback(function(v){var w=v;if(!(!ac.length||ac[ac.length-1]!==i)){var y="deltaY"in w?S$(w):Up(w),_=t.current.filter(function(E){return E.name===w.type&&E.target===w.target&&Lne(E.delta,y)})[0];if(_&&_.should){w.cancelable&&w.preventDefault();return}if(!_){var S=(s.current.shards||[]).map(C$).filter(Boolean).filter(function(E){return E.contains(w.target)}),C=S.length>0?a(w,S[0]):!s.current.noIsolation;C&&w.cancelable&&w.preventDefault()}}},[]),c=L.useCallback(function(v,w,y,_){var S={name:v,delta:w,target:y,should:_};t.current.push(S),setTimeout(function(){t.current=t.current.filter(function(C){return C!==S})},1)},[]),u=L.useCallback(function(v){n.current=Up(v),r.current=void 0},[]),f=L.useCallback(function(v){c(v.type,S$(v),v.target,a(v,e.lockRef.current))},[]),p=L.useCallback(function(v){c(v.type,Up(v),v.target,a(v,e.lockRef.current))},[]);L.useEffect(function(){return ac.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",l,sc),document.addEventListener("touchmove",l,sc),document.addEventListener("touchstart",u,sc),function(){ac=ac.filter(function(v){return v!==i}),document.removeEventListener("wheel",l,sc),document.removeEventListener("touchmove",l,sc),document.removeEventListener("touchstart",u,sc)}},[]);var h=e.removeScrollBar,b=e.inert;return L.createElement(L.Fragment,null,b?L.createElement(i,{styles:Fne(o)}):null,h?L.createElement(W_,{gapMode:"margin"}):null)}const Bne=H_(BM,zne);var UM=L.forwardRef(function(e,t){return L.createElement(lv,En({},e,{ref:t,sideCar:Bne}))});UM.classNames=lv.classNames;const U_=UM,Vne=[" ","Enter","ArrowUp","ArrowDown"],Hne=[" ","Enter"],uv="Select",[dv,fv,Wne]=Am(uv),[xu,w1e]=er(uv,[Wne,Di]),q_=Di(),[Une,Dl]=xu(uv),[qne,Gne]=xu(uv),Yne=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:i,value:s,defaultValue:a,onValueChange:l,dir:c,name:u,autoComplete:f,disabled:p,required:h}=e,b=q_(t),[v,w]=m.useState(null),[y,_]=m.useState(null),[S,C]=m.useState(!1),E=Pl(c),[O=!1,T]=_r({prop:r,defaultProp:o,onChange:i}),[N,I]=_r({prop:s,defaultProp:a,onChange:l}),A=m.useRef(null),F=v?!!v.closest("form"):!0,[z,J]=m.useState(new Set),te=Array.from(z).map(H=>H.props.value).join(";");return m.createElement(th,b,m.createElement(Une,{required:h,scope:t,trigger:v,onTriggerChange:w,valueNode:y,onValueNodeChange:_,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:Zo(),value:N,onValueChange:I,open:O,onOpenChange:T,dir:E,triggerPointerDownPosRef:A,disabled:p},m.createElement(dv.Provider,{scope:t},m.createElement(qne,{scope:e.__scopeSelect,onNativeOptionAdd:m.useCallback(H=>{J(Z=>new Set(Z).add(H))},[]),onNativeOptionRemove:m.useCallback(H=>{J(Z=>{const X=new Set(Z);return X.delete(H),X})},[])},n)),F?m.createElement(XM,{key:te,"aria-hidden":!0,required:h,tabIndex:-1,name:u,autoComplete:f,value:N,onChange:H=>I(H.target.value),disabled:p},N===void 0?m.createElement("option",{value:""}):null,Array.from(z)):null))},Kne="SelectTrigger",Xne=m.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=q_(n),s=Dl(Kne,n),a=s.disabled||r,l=_t(t,s.onTriggerChange),c=fv(n),[u,f,p]=QM(b=>{const v=c().filter(_=>!_.disabled),w=v.find(_=>_.value===s.value),y=JM(v,b,w);y!==void 0&&s.onValueChange(y.value)}),h=()=>{a||(s.onOpenChange(!0),p())};return m.createElement(nh,de({asChild:!0},i),m.createElement(Qe.button,de({type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":KM(s.value)?"":void 0},o,{ref:l,onClick:Me(o.onClick,b=>{b.currentTarget.focus()}),onPointerDown:Me(o.onPointerDown,b=>{const v=b.target;v.hasPointerCapture(b.pointerId)&&v.releasePointerCapture(b.pointerId),b.button===0&&b.ctrlKey===!1&&(h(),s.triggerPointerDownPosRef.current={x:Math.round(b.pageX),y:Math.round(b.pageY)},b.preventDefault())}),onKeyDown:Me(o.onKeyDown,b=>{const v=u.current!=="";!(b.ctrlKey||b.altKey||b.metaKey)&&b.key.length===1&&f(b.key),!(v&&b.key===" ")&&Vne.includes(b.key)&&(h(),b.preventDefault())})})))}),Qne="SelectValue",Jne=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:s="",...a}=e,l=Dl(Qne,n),{onValueNodeHasChildrenChange:c}=l,u=i!==void 0,f=_t(t,l.onValueNodeChange);return ur(()=>{c(u)},[c,u]),m.createElement(Qe.span,de({},a,{ref:f,style:{pointerEvents:"none"}}),KM(l.value)?m.createElement(m.Fragment,null,s):i)}),Zne=m.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return m.createElement(Qe.span,de({"aria-hidden":!0},o,{ref:t}),r||"▼")}),ere=e=>m.createElement(w_,de({asChild:!0},e)),uu="SelectContent",tre=m.forwardRef((e,t)=>{const n=Dl(uu,e.__scopeSelect),[r,o]=m.useState();if(ur(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?Cr.createPortal(m.createElement(qM,{scope:e.__scopeSelect},m.createElement(dv.Slot,{scope:e.__scopeSelect},m.createElement("div",null,e.children))),i):null}return m.createElement(nre,de({},e,{ref:t}))}),Qi=10,[qM,Al]=xu(uu),nre=m.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:f,collisionBoundary:p,collisionPadding:h,sticky:b,hideWhenDetached:v,avoidCollisions:w,...y}=e,_=Dl(uu,n),[S,C]=m.useState(null),[E,O]=m.useState(null),T=_t(t,pe=>C(pe)),[N,I]=m.useState(null),[A,F]=m.useState(null),z=fv(n),[J,te]=m.useState(!1),H=m.useRef(!1);m.useEffect(()=>{if(S)return ih(S)},[S]),F_();const Z=m.useCallback(pe=>{const[oe,...ne]=z().map(Q=>Q.ref.current),[ae]=ne.slice(-1),ye=document.activeElement;for(const Q of pe)if(Q===ye||(Q==null||Q.scrollIntoView({block:"nearest"}),Q===oe&&E&&(E.scrollTop=0),Q===ae&&E&&(E.scrollTop=E.scrollHeight),Q==null||Q.focus(),document.activeElement!==ye))return},[z,E]),X=m.useCallback(()=>Z([N,S]),[Z,N,S]);m.useEffect(()=>{J&&X()},[J,X]);const{onOpenChange:K,triggerPointerDownPosRef:W}=_;m.useEffect(()=>{if(S){let pe={x:0,y:0};const oe=ae=>{var ye,Q,be,Se;pe={x:Math.abs(Math.round(ae.pageX)-((ye=(Q=W.current)===null||Q===void 0?void 0:Q.x)!==null&&ye!==void 0?ye:0)),y:Math.abs(Math.round(ae.pageY)-((be=(Se=W.current)===null||Se===void 0?void 0:Se.y)!==null&&be!==void 0?be:0))}},ne=ae=>{pe.x<=10&&pe.y<=10?ae.preventDefault():S.contains(ae.target)||K(!1),document.removeEventListener("pointermove",oe),W.current=null};return W.current!==null&&(document.addEventListener("pointermove",oe),document.addEventListener("pointerup",ne,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",oe),document.removeEventListener("pointerup",ne,{capture:!0})}}},[S,K,W]),m.useEffect(()=>{const pe=()=>K(!1);return window.addEventListener("blur",pe),window.addEventListener("resize",pe),()=>{window.removeEventListener("blur",pe),window.removeEventListener("resize",pe)}},[K]);const[$,V]=QM(pe=>{const oe=z().filter(ye=>!ye.disabled),ne=oe.find(ye=>ye.ref.current===document.activeElement),ae=JM(oe,pe,ne);ae&&setTimeout(()=>ae.ref.current.focus())}),U=m.useCallback((pe,oe,ne)=>{const ae=!H.current&&!ne;(_.value!==void 0&&_.value===oe||ae)&&(I(pe),ae&&(H.current=!0))},[_.value]),M=m.useCallback(()=>S==null?void 0:S.focus(),[S]),Y=m.useCallback((pe,oe,ne)=>{const ae=!H.current&&!ne;(_.value!==void 0&&_.value===oe||ae)&&F(pe)},[_.value]),le=r==="popper"?E$:rre,ue=le===E$?{side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:f,collisionBoundary:p,collisionPadding:h,sticky:b,hideWhenDetached:v,avoidCollisions:w}:{};return m.createElement(qM,{scope:n,content:S,viewport:E,onViewportChange:O,itemRefCallback:U,selectedItem:N,onItemLeave:M,itemTextRefCallback:Y,focusSelectedItem:X,selectedItemText:A,position:r,isPositioned:J,searchRef:$},m.createElement(U_,{as:FM,allowPinchZoom:!0},m.createElement(j_,{asChild:!0,trapped:_.open,onMountAutoFocus:pe=>{pe.preventDefault()},onUnmountAutoFocus:Me(o,pe=>{var oe;(oe=_.trigger)===null||oe===void 0||oe.focus({preventScroll:!0}),pe.preventDefault()})},m.createElement(Zf,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:pe=>pe.preventDefault(),onDismiss:()=>_.onOpenChange(!1)},m.createElement(le,de({role:"listbox",id:_.contentId,"data-state":_.open?"open":"closed",dir:_.dir,onContextMenu:pe=>pe.preventDefault()},y,ue,{onPlaced:()=>te(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:Me(y.onKeyDown,pe=>{const oe=pe.ctrlKey||pe.altKey||pe.metaKey;if(pe.key==="Tab"&&pe.preventDefault(),!oe&&pe.key.length===1&&V(pe.key),["ArrowUp","ArrowDown","Home","End"].includes(pe.key)){let ae=z().filter(ye=>!ye.disabled).map(ye=>ye.ref.current);if(["ArrowUp","End"].includes(pe.key)&&(ae=ae.slice().reverse()),["ArrowUp","ArrowDown"].includes(pe.key)){const ye=pe.target,Q=ae.indexOf(ye);ae=ae.slice(Q+1)}setTimeout(()=>Z(ae)),pe.preventDefault()}})}))))))}),rre=m.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=Dl(uu,n),s=Al(uu,n),[a,l]=m.useState(null),[c,u]=m.useState(null),f=_t(t,T=>u(T)),p=fv(n),h=m.useRef(!1),b=m.useRef(!0),{viewport:v,selectedItem:w,selectedItemText:y,focusSelectedItem:_}=s,S=m.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&c&&v&&w&&y){const T=i.trigger.getBoundingClientRect(),N=c.getBoundingClientRect(),I=i.valueNode.getBoundingClientRect(),A=y.getBoundingClientRect();if(i.dir!=="rtl"){const ye=A.left-N.left,Q=I.left-ye,be=T.left-Q,Se=T.width+be,Oe=Math.max(Se,N.width),Te=window.innerWidth-Qi,Ue=u1(Q,[Qi,Te-Oe]);a.style.minWidth=Se+"px",a.style.left=Ue+"px"}else{const ye=N.right-A.right,Q=window.innerWidth-I.right-ye,be=window.innerWidth-T.right-Q,Se=T.width+be,Oe=Math.max(Se,N.width),Te=window.innerWidth-Qi,Ue=u1(Q,[Qi,Te-Oe]);a.style.minWidth=Se+"px",a.style.right=Ue+"px"}const F=p(),z=window.innerHeight-Qi*2,J=v.scrollHeight,te=window.getComputedStyle(c),H=parseInt(te.borderTopWidth,10),Z=parseInt(te.paddingTop,10),X=parseInt(te.borderBottomWidth,10),K=parseInt(te.paddingBottom,10),W=H+Z+J+K+X,$=Math.min(w.offsetHeight*5,W),V=window.getComputedStyle(v),U=parseInt(V.paddingTop,10),M=parseInt(V.paddingBottom,10),Y=T.top+T.height/2-Qi,le=z-Y,ue=w.offsetHeight/2,pe=w.offsetTop+ue,oe=H+Z+pe,ne=W-oe;if(oe<=Y){const ye=w===F[F.length-1].ref.current;a.style.bottom="0px";const Q=c.clientHeight-v.offsetTop-v.offsetHeight,be=Math.max(le,ue+(ye?M:0)+Q+X),Se=oe+be;a.style.height=Se+"px"}else{const ye=w===F[0].ref.current;a.style.top="0px";const be=Math.max(Y,H+v.offsetTop+(ye?U:0)+ue)+ne;a.style.height=be+"px",v.scrollTop=oe-Y+v.offsetTop}a.style.margin=`${Qi}px 0`,a.style.minHeight=$+"px",a.style.maxHeight=z+"px",r==null||r(),requestAnimationFrame(()=>h.current=!0)}},[p,i.trigger,i.valueNode,a,c,v,w,y,i.dir,r]);ur(()=>S(),[S]);const[C,E]=m.useState();ur(()=>{c&&E(window.getComputedStyle(c).zIndex)},[c]);const O=m.useCallback(T=>{T&&b.current===!0&&(S(),_==null||_(),b.current=!1)},[S,_]);return m.createElement(ore,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:h,onScrollButtonChange:O},m.createElement("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C}},m.createElement(Qe.div,de({},o,{ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}}))))}),E$=m.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Qi,...i}=e,s=q_(n);return m.createElement(rh,de({},s,i,{ref:t,align:r,collisionPadding:o,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)"}}))}),[ore,G_]=xu(uu,{}),R$="SelectViewport",ire=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Al(R$,n),i=G_(R$,n),s=_t(t,o.onViewportChange),a=m.useRef(0);return m.createElement(m.Fragment,null,m.createElement("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}"}}),m.createElement(dv.Slot,{scope:n},m.createElement(Qe.div,de({"data-radix-select-viewport":"",role:"presentation"},r,{ref:s,style:{position:"relative",flex:1,overflow:"auto",...r.style},onScroll:Me(r.onScroll,l=>{const c=l.currentTarget,{contentWrapper:u,shouldExpandOnScrollRef:f}=i;if(f!=null&&f.current&&u){const p=Math.abs(a.current-c.scrollTop);if(p>0){const h=window.innerHeight-Qi*2,b=parseFloat(u.style.minHeight),v=parseFloat(u.style.height),w=Math.max(b,v);if(w<h){const y=w+p,_=Math.min(h,y),S=y-_;u.style.height=_+"px",u.style.bottom==="0px"&&(c.scrollTop=S>0?S:0,u.style.justifyContent="flex-end")}}}a.current=c.scrollTop})}))))}),sre="SelectGroup",[are,lre]=xu(sre),cre=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Zo();return m.createElement(are,{scope:n,id:o},m.createElement(Qe.div,de({role:"group","aria-labelledby":o},r,{ref:t})))}),ure="SelectLabel",dre=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=lre(ure,n);return m.createElement(Qe.div,de({id:o.id},r,{ref:t}))}),h1="SelectItem",[fre,GM]=xu(h1),hre=m.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...s}=e,a=Dl(h1,n),l=Al(h1,n),c=a.value===r,[u,f]=m.useState(i??""),[p,h]=m.useState(!1),b=_t(t,y=>{var _;return(_=l.itemRefCallback)===null||_===void 0?void 0:_.call(l,y,r,o)}),v=Zo(),w=()=>{o||(a.onValueChange(r),a.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 m.createElement(fre,{scope:n,value:r,disabled:o,textId:v,isSelected:c,onItemTextChange:m.useCallback(y=>{f(_=>{var S;return _||((S=y==null?void 0:y.textContent)!==null&&S!==void 0?S:"").trim()})},[])},m.createElement(dv.ItemSlot,{scope:n,value:r,disabled:o,textValue:u},m.createElement(Qe.div,de({role:"option","aria-labelledby":v,"data-highlighted":p?"":void 0,"aria-selected":c&&p,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1},s,{ref:b,onFocus:Me(s.onFocus,()=>h(!0)),onBlur:Me(s.onBlur,()=>h(!1)),onPointerUp:Me(s.onPointerUp,w),onPointerMove:Me(s.onPointerMove,y=>{if(o){var _;(_=l.onItemLeave)===null||_===void 0||_.call(l)}else y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Me(s.onPointerLeave,y=>{if(y.currentTarget===document.activeElement){var _;(_=l.onItemLeave)===null||_===void 0||_.call(l)}}),onKeyDown:Me(s.onKeyDown,y=>{var _;((_=l.searchRef)===null||_===void 0?void 0:_.current)!==""&&y.key===" "||(Hne.includes(y.key)&&w(),y.key===" "&&y.preventDefault())})}))))}),qp="SelectItemText",pre=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,s=Dl(qp,n),a=Al(qp,n),l=GM(qp,n),c=Gne(qp,n),[u,f]=m.useState(null),p=_t(t,y=>f(y),l.onItemTextChange,y=>{var _;return(_=a.itemTextRefCallback)===null||_===void 0?void 0:_.call(a,y,l.value,l.disabled)}),h=u==null?void 0:u.textContent,b=m.useMemo(()=>m.createElement("option",{key:l.value,value:l.value,disabled:l.disabled},h),[l.disabled,l.value,h]),{onNativeOptionAdd:v,onNativeOptionRemove:w}=c;return ur(()=>(v(b),()=>w(b)),[v,w,b]),m.createElement(m.Fragment,null,m.createElement(Qe.span,de({id:l.textId},i,{ref:p})),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Cr.createPortal(i.children,s.valueNode):null)}),gre="SelectItemIndicator",mre=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return GM(gre,n).isSelected?m.createElement(Qe.span,de({"aria-hidden":!0},r,{ref:t})):null}),P$="SelectScrollUpButton",vre=m.forwardRef((e,t)=>{const n=Al(P$,e.__scopeSelect),r=G_(P$,e.__scopeSelect),[o,i]=m.useState(!1),s=_t(t,r.onScrollButtonChange);return ur(()=>{if(n.viewport&&n.isPositioned){let l=function(){const c=a.scrollTop>0;i(c)};const a=n.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),o?m.createElement(YM,de({},e,{ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}})):null}),O$="SelectScrollDownButton",bre=m.forwardRef((e,t)=>{const n=Al(O$,e.__scopeSelect),r=G_(O$,e.__scopeSelect),[o,i]=m.useState(!1),s=_t(t,r.onScrollButtonChange);return ur(()=>{if(n.viewport&&n.isPositioned){let l=function(){const c=a.scrollHeight-a.clientHeight,u=Math.ceil(a.scrollTop)<c;i(u)};const a=n.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),o?m.createElement(YM,de({},e,{ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}})):null}),YM=m.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=Al("SelectScrollButton",n),s=m.useRef(null),a=fv(n),l=m.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return m.useEffect(()=>()=>l(),[l]),ur(()=>{var c;const u=a().find(f=>f.ref.current===document.activeElement);u==null||(c=u.ref.current)===null||c===void 0||c.scrollIntoView({block:"nearest"})},[a]),m.createElement(Qe.div,de({"aria-hidden":!0},o,{ref:t,style:{flexShrink:0,...o.style},onPointerDown:Me(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:Me(o.onPointerMove,()=>{var c;(c=i.onItemLeave)===null||c===void 0||c.call(i),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:Me(o.onPointerLeave,()=>{l()})}))}),yre=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return m.createElement(Qe.div,de({"aria-hidden":!0},r,{ref:t}))});function KM(e){return e===""||e===void 0}const XM=m.forwardRef((e,t)=>{const{value:n,...r}=e,o=m.useRef(null),i=_t(t,o),s=sv(n);return m.useEffect(()=>{const a=o.current,l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==n&&u){const f=new Event("change",{bubbles:!0});u.call(a,n),a.dispatchEvent(f)}},[s,n]),m.createElement(aM,{asChild:!0},m.createElement("select",de({},r,{ref:i,defaultValue:n})))});XM.displayName="BubbleSelect";function QM(e){const t=jn(e),n=m.useRef(""),r=m.useRef(0),o=m.useCallback(s=>{const a=n.current+s;t(a),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(a)},[t]),i=m.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function JM(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=xre(e,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function xre(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const wre=Yne,ZM=Xne,_re=Jne,Sre=Zne,Cre=ere,eI=tre,Ere=ire,Rre=cre,tI=dre,nI=hre,Pre=pre,Ore=mre,rI=vre,oI=bre,iI=yre,Vs=wre,yc=Rre,Hs=_re,Zi=L.forwardRef(({className:e,children:t,...n},r)=>R.jsxs(ZM,{ref:r,className:_e("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,R.jsx(Sre,{asChild:!0,children:R.jsx(d_,{className:"h-4 w-4 opacity-50"})})]}));Zi.displayName=ZM.displayName;const sI=L.forwardRef(({className:e,...t},n)=>R.jsx(rI,{ref:n,className:_e("flex cursor-default items-center justify-center py-1",e),...t,children:R.jsx(OJ,{className:"h-4 w-4"})}));sI.displayName=rI.displayName;const aI=L.forwardRef(({className:e,...t},n)=>R.jsx(oI,{ref:n,className:_e("flex cursor-default items-center justify-center py-1",e),...t,children:R.jsx(d_,{className:"h-4 w-4"})}));aI.displayName=oI.displayName;const es=L.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>R.jsx(Cre,{children:R.jsx(yu,{children:R.jsxs(eI,{ref:o,className:_e("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md 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",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:[R.jsx(sI,{}),R.jsx(Ere,{className:_e("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),R.jsx(aI,{})]})})}));es.displayName=eI.displayName;const Ua=L.forwardRef(({className:e,...t},n)=>R.jsx(tI,{ref:n,className:_e("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Ua.displayName=tI.displayName;const Un=L.forwardRef(({className:e,children:t,...n},r)=>R.jsxs(nI,{ref:r,className:_e("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[R.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:R.jsx(Ore,{children:R.jsx(Qf,{className:"h-4 w-4"})})}),R.jsx(Pre,{children:t})]}));Un.displayName=nI.displayName;const im=L.forwardRef(({className:e,...t},n)=>R.jsx(iI,{ref:n,className:_e("-mx-1 my-1 h-px bg-muted",e),...t}));im.displayName=iI.displayName;function $re(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Tre(...e){return t=>e.forEach(n=>$re(n,t))}var hv=L.forwardRef((e,t)=>{const{children:n,...r}=e,o=L.Children.toArray(n),i=o.find(Dre);if(i){const s=i.props.children,a=o.map(l=>l===i?L.Children.count(s)>1?L.Children.only(null):L.isValidElement(s)?s.props.children:null:l);return R.jsx(p1,{...r,ref:t,children:L.isValidElement(s)?L.cloneElement(s,void 0,a):null})}return R.jsx(p1,{...r,ref:t,children:n})});hv.displayName="Slot";var p1=L.forwardRef((e,t)=>{const{children:n,...r}=e;if(L.isValidElement(n)){const o=kre(n);return L.cloneElement(n,{...Are(r,n.props),ref:t?Tre(t,o):o})}return L.Children.count(n)>1?L.Children.only(null):null});p1.displayName="SlotClone";var lI=({children:e})=>R.jsx(R.Fragment,{children:e});function Dre(e){return L.isValidElement(e)&&e.type===lI}function Are(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function kre(e){var r,o;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=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const $$=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,T$=Ag,Y_=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return T$(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(c=>{const u=n==null?void 0:n[c],f=i==null?void 0:i[c];if(u===null)return null;const p=$$(u)||$$(f);return o[c][p]}),a=n&&Object.entries(n).reduce((c,u)=>{let[f,p]=u;return p===void 0||(c[f]=p),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:f,className:p,...h}=u;return Object.entries(h).every(b=>{let[v,w]=b;return Array.isArray(w)?w.includes({...i,...a}[v]):{...i,...a}[v]===w})?[...c,f,p]:c},[]);return T$(e,s,l,n==null?void 0:n.class,n==null?void 0:n.className)},ef=Y_("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),xr=L.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},i)=>{const s=r?hv:"button";return R.jsx(s,{className:_e(ef({variant:t,size:n,className:e})),ref:i,...o})});xr.displayName="Button";const Mre=m.forwardRef((e,t)=>m.createElement(Qe.label,de({},e,{ref:t,onMouseDown:n=>{var r;(r=e.onMouseDown)===null||r===void 0||r.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault()}}))),cI=Mre,Ire=Y_("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Fn=L.forwardRef(({className:e,...t},n)=>R.jsx(cI,{ref:n,className:_e(Ire(),e),...t}));Fn.displayName=cI.displayName;const uI=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(Lre);if(i){const s=i.props.children,a=o.map(l=>l===i?m.Children.count(s)>1?m.Children.only(null):m.isValidElement(s)?s.props.children:null:l);return m.createElement(g1,de({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(g1,de({},r,{ref:t}),n)});uI.displayName="Slot";const g1=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...Fre(r,n.props),ref:t?us(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});g1.displayName="SlotClone";const Nre=({children:e})=>m.createElement(m.Fragment,null,e);function Lre(e){return m.isValidElement(e)&&e.type===Nre}function Fre(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}const dI="Popover",[fI,_1e]=er(dI,[Di]),K_=Di(),[jre,wu]=fI(dI),zre=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!1}=e,a=K_(t),l=m.useRef(null),[c,u]=m.useState(!1),[f=!1,p]=_r({prop:r,defaultProp:o,onChange:i});return m.createElement(th,a,m.createElement(jre,{scope:t,contentId:Zo(),triggerRef:l,open:f,onOpenChange:p,onOpenToggle:m.useCallback(()=>p(h=>!h),[p]),hasCustomAnchor:c,onCustomAnchorAdd:m.useCallback(()=>u(!0),[]),onCustomAnchorRemove:m.useCallback(()=>u(!1),[]),modal:s},n))},Bre="PopoverTrigger",Vre=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=wu(Bre,n),i=K_(n),s=_t(t,o.triggerRef),a=m.createElement(Qe.button,de({type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":gI(o.open)},r,{ref:s,onClick:Me(e.onClick,o.onOpenToggle)}));return o.hasCustomAnchor?a:m.createElement(nh,de({asChild:!0},i),a)}),hI="PopoverPortal",[Hre,Wre]=fI(hI,{forceMount:void 0}),Ure=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,i=wu(hI,t);return m.createElement(Hre,{scope:t,forceMount:n},m.createElement(tr,{present:n||i.open},m.createElement(w_,{asChild:!0,container:o},r)))},tf="PopoverContent",qre=m.forwardRef((e,t)=>{const n=Wre(tf,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,i=wu(tf,e.__scopePopover);return m.createElement(tr,{present:r||i.open},i.modal?m.createElement(Gre,de({},o,{ref:t})):m.createElement(Yre,de({},o,{ref:t})))}),Gre=m.forwardRef((e,t)=>{const n=wu(tf,e.__scopePopover),r=m.useRef(null),o=_t(t,r),i=m.useRef(!1);return m.useEffect(()=>{const s=r.current;if(s)return ih(s)},[]),m.createElement(U_,{as:uI,allowPinchZoom:!0},m.createElement(pI,de({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Me(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),i.current||(a=n.triggerRef.current)===null||a===void 0||a.focus()}),onPointerDownOutside:Me(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,c=a.button===2||l;i.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:Me(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})))}),Yre=m.forwardRef((e,t)=>{const n=wu(tf,e.__scopePopover),r=m.useRef(!1),o=m.useRef(!1);return m.createElement(pI,de({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s;if((s=e.onCloseAutoFocus)===null||s===void 0||s.call(e,i),!i.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),i.preventDefault()}r.current=!1,o.current=!1},onInteractOutside:i=>{var s,a;(s=e.onInteractOutside)===null||s===void 0||s.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const l=i.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}}))}),pI=m.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...f}=e,p=wu(tf,n),h=K_(n);return F_(),m.createElement(j_,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i},m.createElement(Zf,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>p.onOpenChange(!1)},m.createElement(rh,de({"data-state":gI(p.open),role:"dialog",id:p.contentId},h,f,{ref:t,style:{...f.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)"}}))))});function gI(e){return e?"open":"closed"}const Kre=zre,Xre=Vre,Qre=Ure,mI=qre,pv=Kre,gv=Xre,sh=L.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>R.jsx(Qre,{children:R.jsx(yu,{children:R.jsx(mI,{ref:o,align:t,sideOffset:n,className:_e("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground 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),...r})})}));sh.displayName=mI.displayName;function Jre(e,t){switch(t){case"full-date-time":return{locale:e,format:"full-date-time",options:{weekday:"short",year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!0}};case"short-date-time":return{locale:e,format:"short-date-time",options:{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!0}};case"hours-date-time":return{locale:e,format:"hours-date-time",options:{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}};case"short-date":return{format:"short-date",locale:e,options:{}};case"long-date":return{format:"long-date",locale:e,options:{year:"numeric",month:"long",day:"numeric"}};default:return{format:"short-date-time",locale:e,options:{}}}}const Dc=L.forwardRef(({className:e,type:t,...n},r)=>R.jsx("input",{type:t,className:_e("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...n}));Dc.displayName="Input";function vI({colorRanges:e,setColorRanges:t}){const n={start:-1/0,end:100,color:""};function r(s,a,l){const c=[...e];c[s]={...c[s],[a]:l},t(c)}function o(s){const a=[...e];a.splice(s,1),t(a)}function i(){t([...e,n])}return R.jsxs("div",{className:"space-y-3",children:[R.jsxs("div",{className:"flex items-center gap-2",children:[R.jsx(Fn,{children:"Color Range"}),R.jsx(xr,{onClick:i,variant:"secondary",className:"h-5 p-1 text-muted-foreground",children:R.jsx(h_,{className:"size-3"})})]}),e.map((s,a)=>R.jsxs("div",{className:"flex items-center gap-2 px-2",children:[R.jsx(Dc,{onChange:l=>r(a,"start",l.target.value),value:s.start,className:_e(`h-7 ${vg}`)}),R.jsx("span",{children:"-"}),R.jsx(Dc,{value:s.end,onChange:l=>r(a,"end",l.target.value),className:_e(`h-7 ${vg}`)}),R.jsx(Dc,{onChange:l=>r(a,"color",l.target.value),value:s.color,className:_e(`h-7 min-w-14 p-0 ${vg}`),type:"color",list:"presetColors"}),R.jsxs("datalist",{id:"presetColors",children:[R.jsx("option",{children:Bt.green[600]}),R.jsx("option",{children:Bt.red[500]}),R.jsx("option",{children:Bt.yellow[400]}),R.jsx("option",{children:Bt.orange[500]})]}),R.jsx(xr,{onClick:()=>o(a),variant:"secondary",className:"h-5 p-1 text-muted-foreground",children:R.jsx(Jf,{className:"size-3"})})]},a))]})}const Zre=m.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r=!1,onPressedChange:o,...i}=e,[s=!1,a]=_r({prop:n,onChange:o,defaultProp:r});return m.createElement(Qe.button,de({type:"button","aria-pressed":s,"data-state":s?"on":"off","data-disabled":e.disabled?"":void 0},i,{ref:t,onClick:Me(e.onClick,()=>{e.disabled||a(!s)})}))}),bI=Zre,eoe=Y_("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-3",sm:"h-9 px-2.5",lg:"h-11 px-5"}},defaultVariants:{variant:"default",size:"default"}}),X_=L.forwardRef(({className:e,variant:t,size:n,...r},o)=>R.jsx(bI,{ref:o,className:_e(eoe({variant:t,size:n,className:e})),...r}));X_.displayName=bI.displayName;function toe(e,t){var r;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(o=>o.columnIdx===t);return n==null?void 0:n.type}function noe(e,t){var r,o;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(i=>i.columnIdx===t);return((o=n==null?void 0:n.options)==null?void 0:o.locale)||"en-US"}function roe(e,t){var r,o;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(i=>i.columnIdx===t&&i.type==="date");return((o=n==null?void 0:n.options)==null?void 0:o.format)||"short-date-time"}function ooe(e,t){var r,o;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(i=>i.columnIdx===t);return(o=n==null?void 0:n.options)==null?void 0:o.currency}function ioe(e,t){var r,o,i;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(s=>s.columnIdx===t);return((i=(o=n==null?void 0:n.options)==null?void 0:o.options)==null?void 0:i.minimumFractionDigits)||0}function soe(e,t){var r,o;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(i=>i.columnIdx===t);return((o=n==null?void 0:n.options)==null?void 0:o.colorRanges)||[]}function aoe(e,t){var r,o,i;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(s=>s.columnIdx===t);return((i=(o=n==null?void 0:n.options)==null?void 0:o.options)==null?void 0:i.style)==="percent"}function loe({columnIndex:e,columnName:t}){const[n,r]=m.useState(!1),o=br(I=>{var A;return(A=I.card)==null?void 0:A.preferences}),[i,s]=m.useState(toe(o,e)),[a,l]=m.useState(soe(o,e)),[c,u]=m.useState(noe(o,e)),[f,p]=m.useState(roe(o,e)),[h,b]=m.useState(ooe(o,e)),[v,w]=m.useState(ioe(o,e).toString()),[y,_]=m.useState(aoe(o,e));m.useState("");const S=br(I=>I.actions.setCardPreferences);function C(){const I=[...new Set(nx.map(A=>A.currency))];return R.jsx(R.Fragment,{children:R.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[R.jsx(Fn,{className:"col-span-3",htmlFor:"format",children:"Locale"}),R.jsxs(Vs,{value:c,onValueChange:A=>u(A),children:[R.jsx(Zi,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:R.jsx(Hs,{})}),R.jsx(es,{children:R.jsxs(yc,{children:[R.jsx(Ua,{children:"Locale"}),nx.map(A=>R.jsx(Un,{value:A.locale,children:A.locale},A.locale))]})})]}),R.jsx(Fn,{className:"col-span-3",htmlFor:"format",children:"Currency"}),R.jsxs(Vs,{value:h||"none",onValueChange:A=>b(A==="none"?void 0:A),children:[R.jsx(Zi,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:R.jsx(Hs,{})}),R.jsx(es,{children:R.jsxs(yc,{children:[R.jsx(Ua,{children:"Currency"}),R.jsx(Un,{value:"none",children:"None"}),I.map(A=>R.jsx(Un,{value:A,children:A},A))]})})]}),R.jsx(Fn,{className:"col-span-3",htmlFor:"format",children:"Decimals"}),R.jsxs(Vs,{value:v,onValueChange:A=>w(A),children:[R.jsx(Zi,{className:"col-span-3 h-8 w-full focus:ring-1 focus:ring-offset-0",children:R.jsx(Hs,{})}),R.jsx(es,{children:["0","1","2","3","4"].map(A=>R.jsx(Un,{value:A,children:A},A))})]}),!h&&R.jsx(X_,{onPressedChange:A=>_(A),variant:"outline",size:"sm",className:"col-span-3 h-8","aria-label":"Toggle italic",children:R.jsx(AJ,{className:"size-3"})})]})})}function E(){return R.jsx(R.Fragment,{children:R.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[R.jsx(Fn,{className:"col-span-3",htmlFor:"format",children:"Locale"}),R.jsxs(Vs,{defaultValue:"en-US",value:c,onValueChange:I=>u(I),children:[R.jsx(Zi,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:R.jsx(Hs,{})}),R.jsx(es,{children:iV.map(I=>R.jsxs(yc,{children:[R.jsx(Ua,{children:I.label}),I.locales.map(A=>R.jsx(Un,{value:A.code,children:A.name},A.code))]},I.label))})]}),R.jsx(Fn,{className:"col-span-3",htmlFor:"format",children:"Format"}),R.jsxs(Vs,{defaultValue:"short-date-time",value:f,onValueChange:I=>{console.log("format",I),p(I)},children:[R.jsx(Zi,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:R.jsx(Hs,{})}),R.jsx(es,{className:"",id:"type",children:R.jsxs(yc,{children:[R.jsx(Ua,{children:"Option"}),R.jsx(Un,{value:"full-date-time",children:"Full Date-Time"}),R.jsx(Un,{value:"short-date-time",children:"Short Date-Time"}),R.jsx(Un,{value:"hours-date-time",children:"24-Hour Date-Time"}),R.jsx(Un,{value:"short-date",children:"Short Date"}),R.jsx(Un,{value:"long-date",children:"Long Date"})]})})]})]})})}function O(){S({...o,columnSettings:[]})}function T(){var I;S({...o,columnSettings:[...((I=o==null?void 0:o.columnSettings)==null?void 0:I.filter(A=>A.columnIdx!==e))||[]]})}function N(){var I,A,F;if(i==="date"){const z=Jre(c,f),J={columnIdx:e,type:i,options:z};S({...o,columnSettings:[...((I=o==null?void 0:o.columnSettings)==null?void 0:I.filter(te=>te.columnIdx!==e))||[],J]})}else if(i==="number"){let z;h?z={locale:c,currency:h,options:{style:"currency",currency:h,minimumFractionDigits:Number(v)},colorRanges:a.length>0?a:void 0}:z={locale:c,currency:void 0,options:{style:y?"percent":"decimal",minimumFractionDigits:Number(v)},colorRanges:a.length>0?a:void 0};const J={columnIdx:e,type:i,options:z};S({...o,columnSettings:[...((A=o==null?void 0:o.columnSettings)==null?void 0:A.filter(te=>te.columnIdx!==e))||[],J]})}else S({...o,columnSettings:[...((F=o==null?void 0:o.columnSettings)==null?void 0:F.filter(z=>z.columnIdx!==e))||[]]})}return R.jsxs(pv,{onOpenChange:I=>r(I),children:[R.jsx(gv,{asChild:!0,children:R.jsx(p_,{className:"size-3.5 cursor-pointer text-muted"})}),R.jsx(sh,{align:"center",className:"max-w-70",children:R.jsxs("div",{className:"grid gap-4",children:[R.jsxs("div",{className:"space-y-2",children:[R.jsx("h4",{className:"font-medium leading-none",children:"Display Settings"}),R.jsx("p",{className:"text-sm text-muted-foreground",children:`Display setting for '${t}'`})]}),R.jsxs("div",{className:"grid gap-2",children:[R.jsxs("div",{className:"grid grid-cols-3 items-center gap-2",children:[R.jsx(Fn,{htmlFor:"scale",children:"Type"}),R.jsxs(Vs,{value:i||"none",onValueChange:I=>s(I),children:[R.jsx(Zi,{className:"col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0",children:R.jsx(Hs,{})}),R.jsx(es,{id:"type",children:R.jsxs(yc,{children:[R.jsx(Ua,{children:"Option"}),R.jsx(Un,{value:"number",children:"Number"}),R.jsx(Un,{value:"date",children:"Date"}),R.jsx(Un,{value:"none",children:"None"})]})})]})]}),i==="number"&&C(),i==="date"&&E(),i==="number"&&R.jsxs(R.Fragment,{children:[R.jsx(im,{}),R.jsx(vI,{colorRanges:a,setColorRanges:l})]}),R.jsx(im,{}),R.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[R.jsx(xr,{onClick:O,variant:"secondary",className:"col-span-1 col-start-1 h-8 w-full text-destructive",children:"Reset All"}),R.jsx(xr,{onClick:T,variant:"secondary",className:"col-span-1 col-start-2 h-8 w-full",children:"Reset"}),R.jsx(xr,{onClick:N,variant:"secondary",className:"col-span-1 col-start-3 h-8 w-full",children:"Apply"})]})]})]})})]})}function coe(e){const t=new Date(e);return!isNaN(t.getTime())}function yI({data:e,card:t}){var C,E,O,T;const[n,r]=m.useState([]),{keys:o}=lr(e),i=$e(N=>N.filteringCards),s=$e(N=>N.themeStyle),a=$e(N=>N.isVisualEditing),l=i==null?void 0:i.find(N=>N.id===t.id),c=(C=t==null?void 0:t.preferences)==null?void 0:C.onClickFilter,{addOrUpdateFilterValues:u,addFilteringCard:f,removeFilterValue:p,removeFilteringCard:h}=wr(),b=t==null?void 0:t.preferences;function v(N,I){if((I==null?void 0:I.type)==="date"&&coe(N)){const{locale:A,options:F}=I.options,z=new Date(N);return new Date(z.getTime()).toLocaleDateString(A,F)}if((I==null?void 0:I.type)==="number"){const{locale:A,currency:F,options:z}=I.options;return F?new Intl.NumberFormat(A,{style:"currency",currency:F,...z}).format(N):new Intl.NumberFormat(A,z).format(N)}return N}const w=o.map((N,I)=>({accessorKey:N,header:({column:A})=>{const F=A.getIsSorted();return R.jsxs("div",{className:"flex items-center justify-between gap-2",children:[R.jsxs("div",{className:"flex cursor-pointer items-center",onClick:()=>A.toggleSorting(A.getIsSorted()==="asc"),children:[N,F==="asc"?R.jsx(u_,{className:"ml-2 h-5 w-5"}):F==="desc"?R.jsx(c_,{className:"ml-2 h-5 w-5"}):null]}),a&&R.jsx(loe,{columnName:A.id,columnIndex:I})]})},cell:({cell:A})=>{var H,Z;const F=A.getValue(),z=(H=b==null?void 0:b.columnSettings)==null?void 0:H.find(X=>X.columnIdx===I),J=v(F,z),te=hM(F,(Z=z==null?void 0:z.options)==null?void 0:Z.colorRanges);return R.jsx("div",{className:"px-2 py-1",style:{backgroundColor:te},children:J})}})),y=NM({data:e,columns:w,getCoreRowModel:kM(),getPaginationRowModel:IM(),onSortingChange:r,getSortedRowModel:MM(),manualPagination:!0,state:{sorting:n}}),_=y.getSelectedRowModel().rows;m.useEffect(()=>{if(_.length===0){if(l){const N=t.id;p(N),h(t)}return}if(c){const{dimensionKeys:N}=lr(e),I=c.map(A=>{const F=N==null?void 0:N[A.columnIndex],z=_.map(te=>te.getValue(F));return{filterId:t.id+"-"+F,connectionId:t==null?void 0:t.connectionId,tableName:t.lastSelectedTable,name:F,expression:A.expression,valueType:Bd(z[0]===void 0?"":z[0]),operation:"in",values:z}});u(I),f(t)}},[f,u,t,e,l,c,p,h,_]);function S(N){N.toggleSelected()}return R.jsxs(D_,{className:"",containerClassName:"rounded-md",containerStyle:{borderTopRightRadius:(E=s==null?void 0:s.chart)==null?void 0:E.options.borderRadius,borderTopLeftRadius:(O=s==null?void 0:s.chart)==null?void 0:O.options.borderRadius},onMouseDown:N=>N.stopPropagation(),children:[R.jsx(A_,{children:y.getHeaderGroups().map(N=>R.jsx(kd,{children:N.headers.map((I,A)=>{var F,z,J,te,H,Z,X;return R.jsx(M_,{style:{backgroundColor:(J=(z=(F=s==null?void 0:s.chart)==null?void 0:F.dataset)==null?void 0:z.backgroundColor)==null?void 0:J[0],color:Zc((Z=(H=(te=s==null?void 0:s.chart)==null?void 0:te.dataset)==null?void 0:H.backgroundColor)==null?void 0:Z[0])},className:_e("sticky -top-[1px] h-9 bg-muted-foreground px-2 text-background",{"border-x":A>0&&A<N.headers.length-1,"border-l":A===1&&N.headers.length==2},(X=s==null?void 0:s.table)==null?void 0:X.tableHeaderColor),children:I.isPlaceholder?null:c1(I.column.columnDef.header,I.getContext())},I.id)})},N.id))}),R.jsx(k_,{children:(T=y.getRowModel().rows)!=null&&T.length?y.getRowModel().rows.map((N,I)=>R.jsx(kd,{onClick:()=>S(N),className:_e("whitespace-nowrap p-1",{"cursor-pointer data-[state=selected]:border-2 data-[state=selected]:border-dashed":c&&(c==null?void 0:c.length)>0}),"data-state":N.getIsSelected()&&"selected",children:N.getVisibleCells().map((A,F)=>{var z;return R.jsx(rm,{onClick:J=>{var H;const te=((H=window==null?void 0:window.getSelection())==null?void 0:H.toString())||"";(te==null?void 0:te.length)>0&&J.stopPropagation()},className:_e("p-0",{"border-x":F>0&&F<w.length-1||F===1&&w.length==2,"border-l":F==0,"border-r":F===w.length-1,"border-b":I===((z=y.getRowModel().rows)==null?void 0:z.length)-1}),children:c1(A.column.columnDef.cell,A.getContext())},A.id)})},N.id)):R.jsx(kd,{children:R.jsx(rm,{colSpan:w.length,className:"p-1 text-center",children:"No results."})})})]})}/*! @license DOMPurify 3.1.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.6/LICENSE */const{entries:xI,setPrototypeOf:D$,isFrozen:uoe,getPrototypeOf:doe,getOwnPropertyDescriptor:foe}=Object;let{freeze:Sr,seal:Io,create:wI}=Object,{apply:m1,construct:v1}=typeof Reflect<"u"&&Reflect;Sr||(Sr=function(t){return t});Io||(Io=function(t){return t});m1||(m1=function(t,n,r){return t.apply(n,r)});v1||(v1=function(t,n){return new t(...n)});const Gp=po(Array.prototype.forEach),A$=po(Array.prototype.pop),nd=po(Array.prototype.push),Og=po(String.prototype.toLowerCase),q0=po(String.prototype.toString),k$=po(String.prototype.match),rd=po(String.prototype.replace),hoe=po(String.prototype.indexOf),poe=po(String.prototype.trim),qo=po(Object.prototype.hasOwnProperty),gr=po(RegExp.prototype.test),od=goe(TypeError);function po(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return m1(e,t,r)}}function goe(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return v1(e,n)}}function $t(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Og;D$&&D$(e,null);let r=t.length;for(;r--;){let o=t[r];if(typeof o=="string"){const i=n(o);i!==o&&(uoe(t)||(t[r]=i),o=i)}e[o]=!0}return e}function moe(e){for(let t=0;t<e.length;t++)qo(e,t)||(e[t]=null);return e}function Va(e){const t=wI(null);for(const[n,r]of xI(e))qo(e,n)&&(Array.isArray(r)?t[n]=moe(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=Va(r):t[n]=r);return t}function id(e,t){for(;e!==null;){const r=foe(e,t);if(r){if(r.get)return po(r.get);if(typeof r.value=="function")return po(r.value)}e=doe(e)}function n(){return null}return n}const M$=Sr(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),G0=Sr(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Y0=Sr(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),voe=Sr(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),K0=Sr(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),boe=Sr(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),I$=Sr(["#text"]),N$=Sr(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),X0=Sr(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),L$=Sr(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Yp=Sr(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),yoe=Io(/\{\{[\w\W]*|[\w\W]*\}\}/gm),xoe=Io(/<%[\w\W]*|[\w\W]*%>/gm),woe=Io(/\${[\w\W]*}/gm),_oe=Io(/^data-[\-\w.\u00B7-\uFFFF]/),Soe=Io(/^aria-[\-\w]+$/),_I=Io(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Coe=Io(/^(?:\w+script|data):/i),Eoe=Io(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),SI=Io(/^html$/i),Roe=Io(/^[a-z][.\w]*(-[.\w]+)+$/i);var F$=Object.freeze({__proto__:null,MUSTACHE_EXPR:yoe,ERB_EXPR:xoe,TMPLIT_EXPR:woe,DATA_ATTR:_oe,ARIA_ATTR:Soe,IS_ALLOWED_URI:_I,IS_SCRIPT_OR_DATA:Coe,ATTR_WHITESPACE:Eoe,DOCTYPE_NAME:SI,CUSTOM_ELEMENT:Roe});const sd={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Poe=function(){return typeof window>"u"?null:window},Ooe=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const o="data-tt-policy-suffix";n&&n.hasAttribute(o)&&(r=n.getAttribute(o));const i="dompurify"+(r?"#"+r:"");try{return t.createPolicy(i,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}};function CI(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Poe();const t=Ae=>CI(Ae);if(t.version="3.1.6",t.removed=[],!e||!e.document||e.document.nodeType!==sd.document)return t.isSupported=!1,t;let{document:n}=e;const r=n,o=r.currentScript,{DocumentFragment:i,HTMLTemplateElement:s,Node:a,Element:l,NodeFilter:c,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:f,DOMParser:p,trustedTypes:h}=e,b=l.prototype,v=id(b,"cloneNode"),w=id(b,"remove"),y=id(b,"nextSibling"),_=id(b,"childNodes"),S=id(b,"parentNode");if(typeof s=="function"){const Ae=n.createElement("template");Ae.content&&Ae.content.ownerDocument&&(n=Ae.content.ownerDocument)}let C,E="";const{implementation:O,createNodeIterator:T,createDocumentFragment:N,getElementsByTagName:I}=n,{importNode:A}=r;let F={};t.isSupported=typeof xI=="function"&&typeof S=="function"&&O&&O.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:z,ERB_EXPR:J,TMPLIT_EXPR:te,DATA_ATTR:H,ARIA_ATTR:Z,IS_SCRIPT_OR_DATA:X,ATTR_WHITESPACE:K,CUSTOM_ELEMENT:W}=F$;let{IS_ALLOWED_URI:$}=F$,V=null;const U=$t({},[...M$,...G0,...Y0,...K0,...I$]);let M=null;const Y=$t({},[...N$,...X0,...L$,...Yp]);let le=Object.seal(wI(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ue=null,pe=null,oe=!0,ne=!0,ae=!1,ye=!0,Q=!1,be=!0,Se=!1,Oe=!1,Te=!1,Ue=!1,Be=!1,Ie=!1,Ke=!0,lt=!1;const It="user-content-";let Dt=!0,Ht=!1,he={},Ee=null;const Le=$t({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ge=null;const Ze=$t({},["audio","video","img","source","image","track"]);let Wt=null;const Zt=$t({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Kt="http://www.w3.org/1998/Math/MathML",vn="http://www.w3.org/2000/svg",ln="http://www.w3.org/1999/xhtml";let Lt=ln,tn=!1,xn=null;const nt=$t({},[Kt,vn,ln],q0);let ht=null;const At=["application/xhtml+xml","text/html"],Xt="text/html";let bt=null,On=null;const Fo=n.createElement("form"),vs=function(G){return G instanceof RegExp||G instanceof Function},jo=function(){let G=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(On&&On===G)){if((!G||typeof G!="object")&&(G={}),G=Va(G),ht=At.indexOf(G.PARSER_MEDIA_TYPE)===-1?Xt:G.PARSER_MEDIA_TYPE,bt=ht==="application/xhtml+xml"?q0:Og,V=qo(G,"ALLOWED_TAGS")?$t({},G.ALLOWED_TAGS,bt):U,M=qo(G,"ALLOWED_ATTR")?$t({},G.ALLOWED_ATTR,bt):Y,xn=qo(G,"ALLOWED_NAMESPACES")?$t({},G.ALLOWED_NAMESPACES,q0):nt,Wt=qo(G,"ADD_URI_SAFE_ATTR")?$t(Va(Zt),G.ADD_URI_SAFE_ATTR,bt):Zt,Ge=qo(G,"ADD_DATA_URI_TAGS")?$t(Va(Ze),G.ADD_DATA_URI_TAGS,bt):Ze,Ee=qo(G,"FORBID_CONTENTS")?$t({},G.FORBID_CONTENTS,bt):Le,ue=qo(G,"FORBID_TAGS")?$t({},G.FORBID_TAGS,bt):{},pe=qo(G,"FORBID_ATTR")?$t({},G.FORBID_ATTR,bt):{},he=qo(G,"USE_PROFILES")?G.USE_PROFILES:!1,oe=G.ALLOW_ARIA_ATTR!==!1,ne=G.ALLOW_DATA_ATTR!==!1,ae=G.ALLOW_UNKNOWN_PROTOCOLS||!1,ye=G.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Q=G.SAFE_FOR_TEMPLATES||!1,be=G.SAFE_FOR_XML!==!1,Se=G.WHOLE_DOCUMENT||!1,Ue=G.RETURN_DOM||!1,Be=G.RETURN_DOM_FRAGMENT||!1,Ie=G.RETURN_TRUSTED_TYPE||!1,Te=G.FORCE_BODY||!1,Ke=G.SANITIZE_DOM!==!1,lt=G.SANITIZE_NAMED_PROPS||!1,Dt=G.KEEP_CONTENT!==!1,Ht=G.IN_PLACE||!1,$=G.ALLOWED_URI_REGEXP||_I,Lt=G.NAMESPACE||ln,le=G.CUSTOM_ELEMENT_HANDLING||{},G.CUSTOM_ELEMENT_HANDLING&&vs(G.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(le.tagNameCheck=G.CUSTOM_ELEMENT_HANDLING.tagNameCheck),G.CUSTOM_ELEMENT_HANDLING&&vs(G.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(le.attributeNameCheck=G.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),G.CUSTOM_ELEMENT_HANDLING&&typeof G.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(le.allowCustomizedBuiltInElements=G.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Q&&(ne=!1),Be&&(Ue=!0),he&&(V=$t({},I$),M=[],he.html===!0&&($t(V,M$),$t(M,N$)),he.svg===!0&&($t(V,G0),$t(M,X0),$t(M,Yp)),he.svgFilters===!0&&($t(V,Y0),$t(M,X0),$t(M,Yp)),he.mathMl===!0&&($t(V,K0),$t(M,L$),$t(M,Yp))),G.ADD_TAGS&&(V===U&&(V=Va(V)),$t(V,G.ADD_TAGS,bt)),G.ADD_ATTR&&(M===Y&&(M=Va(M)),$t(M,G.ADD_ATTR,bt)),G.ADD_URI_SAFE_ATTR&&$t(Wt,G.ADD_URI_SAFE_ATTR,bt),G.FORBID_CONTENTS&&(Ee===Le&&(Ee=Va(Ee)),$t(Ee,G.FORBID_CONTENTS,bt)),Dt&&(V["#text"]=!0),Se&&$t(V,["html","head","body"]),V.table&&($t(V,["tbody"]),delete ue.tbody),G.TRUSTED_TYPES_POLICY){if(typeof G.TRUSTED_TYPES_POLICY.createHTML!="function")throw od('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof G.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw od('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');C=G.TRUSTED_TYPES_POLICY,E=C.createHTML("")}else C===void 0&&(C=Ooe(h,o)),C!==null&&typeof E=="string"&&(E=C.createHTML(""));Sr&&Sr(G),On=G}},ki=$t({},["mi","mo","mn","ms","mtext"]),ri=$t({},["foreignobject","annotation-xml"]),Mi=$t({},["title","style","font","a","script"]),bs=$t({},[...G0,...Y0,...voe]),oi=$t({},[...K0,...boe]),Ii=function(G){let me=S(G);(!me||!me.tagName)&&(me={namespaceURI:Lt,tagName:"template"});const ke=Og(G.tagName),st=Og(me.tagName);return xn[G.namespaceURI]?G.namespaceURI===vn?me.namespaceURI===ln?ke==="svg":me.namespaceURI===Kt?ke==="svg"&&(st==="annotation-xml"||ki[st]):!!bs[ke]:G.namespaceURI===Kt?me.namespaceURI===ln?ke==="math":me.namespaceURI===vn?ke==="math"&&ri[st]:!!oi[ke]:G.namespaceURI===ln?me.namespaceURI===vn&&!ri[st]||me.namespaceURI===Kt&&!ki[st]?!1:!oi[ke]&&(Mi[ke]||!bs[ke]):!!(ht==="application/xhtml+xml"&&xn[G.namespaceURI]):!1},Bn=function(G){nd(t.removed,{element:G});try{S(G).removeChild(G)}catch{w(G)}},ii=function(G,me){try{nd(t.removed,{attribute:me.getAttributeNode(G),from:me})}catch{nd(t.removed,{attribute:null,from:me})}if(me.removeAttribute(G),G==="is"&&!M[G])if(Ue||Be)try{Bn(me)}catch{}else try{me.setAttribute(G,"")}catch{}},ys=function(G){let me=null,ke=null;if(Te)G="<remove></remove>"+G;else{const ft=k$(G,/^[\r\n\t ]+/);ke=ft&&ft[0]}ht==="application/xhtml+xml"&&Lt===ln&&(G='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+G+"</body></html>");const st=C?C.createHTML(G):G;if(Lt===ln)try{me=new p().parseFromString(st,ht)}catch{}if(!me||!me.documentElement){me=O.createDocument(Lt,"template",null);try{me.documentElement.innerHTML=tn?E:st}catch{}}const bn=me.body||me.documentElement;return G&&ke&&bn.insertBefore(n.createTextNode(ke),bn.childNodes[0]||null),Lt===ln?I.call(me,Se?"html":"body")[0]:Se?me.documentElement:bn},xs=function(G){return T.call(G.ownerDocument||G,G,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},D=function(G){return G instanceof f&&(typeof G.nodeName!="string"||typeof G.textContent!="string"||typeof G.removeChild!="function"||!(G.attributes instanceof u)||typeof G.removeAttribute!="function"||typeof G.setAttribute!="function"||typeof G.namespaceURI!="string"||typeof G.insertBefore!="function"||typeof G.hasChildNodes!="function")},re=function(G){return typeof a=="function"&&G instanceof a},fe=function(G,me,ke){F[G]&&Gp(F[G],st=>{st.call(t,me,ke,On)})},Pe=function(G){let me=null;if(fe("beforeSanitizeElements",G,null),D(G))return Bn(G),!0;const ke=bt(G.nodeName);if(fe("uponSanitizeElement",G,{tagName:ke,allowedTags:V}),G.hasChildNodes()&&!re(G.firstElementChild)&&gr(/<[/\w]/g,G.innerHTML)&&gr(/<[/\w]/g,G.textContent)||G.nodeType===sd.progressingInstruction||be&&G.nodeType===sd.comment&&gr(/<[/\w]/g,G.data))return Bn(G),!0;if(!V[ke]||ue[ke]){if(!ue[ke]&&qe(ke)&&(le.tagNameCheck instanceof RegExp&&gr(le.tagNameCheck,ke)||le.tagNameCheck instanceof Function&&le.tagNameCheck(ke)))return!1;if(Dt&&!Ee[ke]){const st=S(G)||G.parentNode,bn=_(G)||G.childNodes;if(bn&&st){const ft=bn.length;for(let nr=ft-1;nr>=0;--nr){const vo=v(bn[nr],!0);vo.__removalCount=(G.__removalCount||0)+1,st.insertBefore(vo,y(G))}}}return Bn(G),!0}return G instanceof l&&!Ii(G)||(ke==="noscript"||ke==="noembed"||ke==="noframes")&&gr(/<\/no(script|embed|frames)/i,G.innerHTML)?(Bn(G),!0):(Q&&G.nodeType===sd.text&&(me=G.textContent,Gp([z,J,te],st=>{me=rd(me,st," ")}),G.textContent!==me&&(nd(t.removed,{element:G.cloneNode()}),G.textContent=me)),fe("afterSanitizeElements",G,null),!1)},He=function(G,me,ke){if(Ke&&(me==="id"||me==="name")&&(ke in n||ke in Fo))return!1;if(!(ne&&!pe[me]&&gr(H,me))){if(!(oe&&gr(Z,me))){if(!M[me]||pe[me]){if(!(qe(G)&&(le.tagNameCheck instanceof RegExp&&gr(le.tagNameCheck,G)||le.tagNameCheck instanceof Function&&le.tagNameCheck(G))&&(le.attributeNameCheck instanceof RegExp&&gr(le.attributeNameCheck,me)||le.attributeNameCheck instanceof Function&&le.attributeNameCheck(me))||me==="is"&&le.allowCustomizedBuiltInElements&&(le.tagNameCheck instanceof RegExp&&gr(le.tagNameCheck,ke)||le.tagNameCheck instanceof Function&&le.tagNameCheck(ke))))return!1}else if(!Wt[me]){if(!gr($,rd(ke,K,""))){if(!((me==="src"||me==="xlink:href"||me==="href")&&G!=="script"&&hoe(ke,"data:")===0&&Ge[G])){if(!(ae&&!gr(X,rd(ke,K,"")))){if(ke)return!1}}}}}}return!0},qe=function(G){return G!=="annotation-xml"&&k$(G,W)},ze=function(G){fe("beforeSanitizeAttributes",G,null);const{attributes:me}=G;if(!me)return;const ke={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:M};let st=me.length;for(;st--;){const bn=me[st],{name:ft,namespaceURI:nr,value:vo}=bn,wa=bt(ft);let Vn=ft==="value"?vo:poe(vo);if(ke.attrName=wa,ke.attrValue=Vn,ke.keepAttr=!0,ke.forceKeepAttr=void 0,fe("uponSanitizeAttribute",G,ke),Vn=ke.attrValue,be&&gr(/((--!?|])>)|<\/(style|title)/i,Vn)){ii(ft,G);continue}if(ke.forceKeepAttr||(ii(ft,G),!ke.keepAttr))continue;if(!ye&&gr(/\/>/i,Vn)){ii(ft,G);continue}Q&&Gp([z,J,te],Pu=>{Vn=rd(Vn,Pu," ")});const Ru=bt(G.nodeName);if(He(Ru,wa,Vn)){if(lt&&(wa==="id"||wa==="name")&&(ii(ft,G),Vn=It+Vn),C&&typeof h=="object"&&typeof h.getAttributeType=="function"&&!nr)switch(h.getAttributeType(Ru,wa)){case"TrustedHTML":{Vn=C.createHTML(Vn);break}case"TrustedScriptURL":{Vn=C.createScriptURL(Vn);break}}try{nr?G.setAttributeNS(nr,ft,Vn):G.setAttribute(ft,Vn),D(G)?Bn(G):A$(t.removed)}catch{}}}fe("afterSanitizeAttributes",G,null)},Fe=function Ae(G){let me=null;const ke=xs(G);for(fe("beforeSanitizeShadowDOM",G,null);me=ke.nextNode();)fe("uponSanitizeShadowNode",me,null),!Pe(me)&&(me.content instanceof i&&Ae(me.content),ze(me));fe("afterSanitizeShadowDOM",G,null)};return t.sanitize=function(Ae){let G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},me=null,ke=null,st=null,bn=null;if(tn=!Ae,tn&&(Ae="<!-->"),typeof Ae!="string"&&!re(Ae))if(typeof Ae.toString=="function"){if(Ae=Ae.toString(),typeof Ae!="string")throw od("dirty is not a string, aborting")}else throw od("toString is not a function");if(!t.isSupported)return Ae;if(Oe||jo(G),t.removed=[],typeof Ae=="string"&&(Ht=!1),Ht){if(Ae.nodeName){const vo=bt(Ae.nodeName);if(!V[vo]||ue[vo])throw od("root node is forbidden and cannot be sanitized in-place")}}else if(Ae instanceof a)me=ys("<!---->"),ke=me.ownerDocument.importNode(Ae,!0),ke.nodeType===sd.element&&ke.nodeName==="BODY"||ke.nodeName==="HTML"?me=ke:me.appendChild(ke);else{if(!Ue&&!Q&&!Se&&Ae.indexOf("<")===-1)return C&&Ie?C.createHTML(Ae):Ae;if(me=ys(Ae),!me)return Ue?null:Ie?E:""}me&&Te&&Bn(me.firstChild);const ft=xs(Ht?Ae:me);for(;st=ft.nextNode();)Pe(st)||(st.content instanceof i&&Fe(st.content),ze(st));if(Ht)return Ae;if(Ue){if(Be)for(bn=N.call(me.ownerDocument);me.firstChild;)bn.appendChild(me.firstChild);else bn=me;return(M.shadowroot||M.shadowrootmode)&&(bn=A.call(r,bn,!0)),bn}let nr=Se?me.outerHTML:me.innerHTML;return Se&&V["!doctype"]&&me.ownerDocument&&me.ownerDocument.doctype&&me.ownerDocument.doctype.name&&gr(SI,me.ownerDocument.doctype.name)&&(nr="<!DOCTYPE "+me.ownerDocument.doctype.name+`>
|
|
326
326
|
`+nr),Q&&Gp([z,J,te],vo=>{nr=rd(nr,vo," ")}),C&&Ie?C.createHTML(nr):nr},t.setConfig=function(){let Ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};jo(Ae),Oe=!0},t.clearConfig=function(){On=null,Oe=!1},t.isValidAttribute=function(Ae,G,me){On||jo({});const ke=bt(Ae),st=bt(G);return He(ke,st,me)},t.addHook=function(Ae,G){typeof G=="function"&&(F[Ae]=F[Ae]||[],nd(F[Ae],G))},t.removeHook=function(Ae){if(F[Ae])return A$(F[Ae])},t.removeHooks=function(Ae){F[Ae]&&(F[Ae]=[])},t.removeAllHooks=function(){F={}},t}var j$=CI();function EI({card:e,isLoading:t}){var f,p;const n=(e==null?void 0:e.data)||[],{keys:r}=lr(n),o=$e(h=>h.selectedSheetId),i=$e(h=>h.isVisualEditing),s=(p=(f=e==null?void 0:e.preferences)==null?void 0:f.textVisualOptions)==null?void 0:p.isDynamicText,{setCardDescription:a}=wr(),{setCard:l}=Jm();function c(){var w;if(t)return R.jsx($m,{className:"h-7 animate-pulse bg-muted"});const h=(w=n==null?void 0:n[0])==null?void 0:w[r[0]],b=j$.sanitize(h),v=R.jsx("div",{dangerouslySetInnerHTML:{__html:b}});return R.jsx("div",{className:"hover:cursor-text",onMouseDown:y=>y.stopPropagation(),children:v})}function u(){return R.jsx("div",{onMouseDown:h=>h.stopPropagation(),children:R.jsx(xi,{type:"textarea",className:"w-full",text:(e==null?void 0:e.description)||"Double click to add description",onSave:h=>{i===!1&&a(o,e.id,h),i===!0&&l({...e,description:h})},children:R.jsx("div",{dangerouslySetInnerHTML:{__html:j$.sanitize((e==null?void 0:e.description)||"")}})})})}return R.jsxs("div",{className:"break-words p-6",children:[!s&&u(),s===!0&&c()]})}function $oe(){var p,h;const e=$e(b=>b.themeStyle),t=$e(b=>b.filterValues),n=$e(b=>b.dashboard.filters),r=$e(b=>b.filteringCards),{removeFilterValue:o,removeFilteringCard:i,setFilterValues:s,setFilteringCards:a}=wr();if(!t||t.length===0)return null;const l=t.map(b=>{const v=n==null?void 0:n.find(w=>w.id===b.filterId);return{filterId:b.filterId,name:(v==null?void 0:v.title)||b.name,values:b.values}});function c(b){return b instanceof Date?b.toLocaleDateString():b}function u(b){const v=r==null?void 0:r.find(w=>b.filterId.startsWith(w.id));v&&i(v),o(b.filterId)}function f(b){var v,w;return R.jsxs("div",{className:"space-y-2 px-5",children:[R.jsxs("div",{style:{borderRadius:(w=(v=e==null?void 0:e.chart)==null?void 0:v.options)==null?void 0:w.borderRadius},className:"flex w-fit items-center gap-2 bg-muted-foreground px-2 py-1 font-semibold text-muted",children:[R.jsx("span",{className:"break-words",children:b.name}),R.jsx(Jf,{onClick:()=>u(b),className:"size-3.5 text-muted hover:cursor-pointer hover:text-background"})]}),R.jsx("div",{className:"flex flex-wrap gap-1",children:b.values.map(y=>{var _,S;return R.jsx("span",{style:{borderRadius:(S=(_=e==null?void 0:e.chart)==null?void 0:_.options)==null?void 0:S.borderRadius},className:"inline-block bg-muted px-2 py-1",children:c(y)},y.toString())})})]},b.name)}return R.jsxs(ov,{openDelay:100,children:[R.jsx(iv,{children:R.jsx(Hk,{className:"z-100 size-3.5 text-muted-foreground/40"})}),R.jsxs(oh,{style:{borderRadius:(h=(p=e==null?void 0:e.chart)==null?void 0:p.options)==null?void 0:h.borderRadius},className:"relative flex min-h-fit w-[300px] flex-col px-0 text-xs",align:"start",children:[R.jsx(Vk,{onClick:()=>{a([]),s([])},className:"absolute right-4 size-3.5 text-muted-foreground/40 hover:cursor-pointer"}),R.jsx("div",{className:"h-fit max-h-[150px] min-h-0 grow overflow-auto",children:(l==null?void 0:l.length)>0&&R.jsx("div",{className:"space-y-2",children:l.map(b=>f(b))})})]})]})}function Toe({frame:e,footer:t,className:n,...r}){var $,V,U,M;const{customCards:o}=ba(),i=m.useRef(null),s=$e(Y=>Y.themeStyle),a=$e(Y=>Y.selectedSheetId),l=$e(Y=>Y.selectedFrameId),c=$e(Y=>Y.isDashboardEditing),u=$e(Y=>Y.dashboard.filters);$e(Y=>Y.filteringCards);const f=u==null?void 0:u.find(Y=>Y.id===e.filterId);$e(Y=>Y.filterValues);const{updateFrame:p}=wr(),h=e.cards.find(Y=>Y.id===e.activeCardId);nte(e,i);const{isError:b,isLoading:v,isFetching:w,cfg:y,visualKey:_,handleDatapointClick:S}=O_(h),{setCardTitle:C,setCardDescription:E,setSelectedFrameId:O,updateFilter:T,getCardFrame:N}=wr(),{setSelectedConnectionId:I,setSelectedDatabaseName:A,setSelectedSchemaName:F,setSelectedTableName:z}=Jm();function J(Y){Y.stopPropagation(),O(e.id),h!=null&&h.connectionId&&I(h==null?void 0:h.connectionId),h!=null&&h.lastSelectedDatabase&&A(h==null?void 0:h.lastSelectedDatabase),h!=null&&h.lastSelectedSchema&&F(h==null?void 0:h.lastSelectedSchema),h!=null&&h.lastSelectedTable&&z(h==null?void 0:h.lastSelectedTable)}function te(){if(o&&o.length>0){const Y=o.find(le=>le.cardId===h.id);if(Y&&Y.replaceDefault){const le=Y.content;if(le)return R.jsx(le,{card:h})}}return h.type==="kpi"?R.jsx(pM,{isLoading:v||w,card:h}):h.type==="text"?R.jsx(EI,{isLoading:v||w,card:h}):W}function H(){return["{{ filters | where }}","{{ filters | and }}"].some(le=>{var ue;return(ue=h.sql)==null?void 0:ue.includes(le)})?R.jsx($oe,{}):null}function Z(){if(b)return R.jsx("p",{className:"text-sm",children:"Oops! It seems like something went wrong. Please review your connection or filters."});if(h.type==="table"&&h.data&&h.data.length>0)return R.jsx("div",{className:"relative flex min-h-0 flex-1 grow basis-0",children:R.jsx(yI,{card:h,data:h.data})});if(o&&o.length>0){const Y=o.find(le=>le.cardId===h.id);if(Y&&Y.content){const le=Y.content;return R.jsx(le,{card:h})}}if(y)return R.jsx(l_,{cfg:y,onDatapointClick:S},_)}function X(){if(o&&o.length>0){const Y=o.find(le=>le.cardId===h.id);if(Y&&Y.footer){const le=Y.footer;if(le)return R.jsx(le,{card:h})}}return t||null}if(!h.id)return null;function K(){var Y,le,ue,pe;return R.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[R.jsx(yw,{value:e.activeCardId,className:"flex items-center justify-end gap-3",onValueChange:oe=>{const ne={...e,activeCardId:oe};p(a,ne)},children:R.jsx(km,{style:{borderRadius:(le=(Y=s==null?void 0:s.chart)==null?void 0:Y.options)==null?void 0:le.borderRadius},className:"flex-end flex-wrap items-center",children:e.cards.map(oe=>{var ne,ae;return R.jsx(Mm,{style:{borderRadius:(ae=(ne=s==null?void 0:s.chart)==null?void 0:ne.options)==null?void 0:ae.borderRadius},value:oe.id,children:oe.tabTitle||oe.title},oe.id)})})}),R.jsx("div",{children:f&&R.jsxs("div",{style:{borderRadius:(pe=(ue=s==null?void 0:s.chart)==null?void 0:ue.options)==null?void 0:pe.borderRadius},role:"frame-filter-container",className:"flex h-10 shrink-0 items-center bg-muted p-1",children:[R.jsx(xi,{className:"my-1",text:f.title||f.column,onSave:oe=>T({...f,title:oe}),children:R.jsx(Fn,{className:"px-3",children:f.title})}),yS(f)]})})]})}const W=R.jsxs(R.Fragment,{children:[R.jsx(Tm,{children:R.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[R.jsxs("div",{children:[R.jsxs("div",{role:"carc-title-container",className:"flex items-center gap-3",children:[R.jsx(xi,{text:h.title,onSave:Y=>C(a,h.id,Y),children:R.jsx(Wf,{className:_e("text-base",{}),children:h.title})}),(c||h.info)&&R.jsx(pte,{card:h}),h.refreshInterval&&R.jsxs(dM,{children:[R.jsx(fM,{className:"pr-1",children:R.jsx("div",{className:_e("h-2 w-2 rounded-full bg-green-500 transition-opacity",{"opacity-10":v||w})})}),R.jsx(E_,{side:"right",align:"center",children:R.jsx("p",{className:"text-xs",children:`Realtime (${h==null?void 0:h.refreshInterval})`})})]}),H()]}),R.jsx("div",{role:"card-description-container",children:R.jsx(xi,{text:(h==null?void 0:h.description)||"",onSave:Y=>E(a,h.id,Y),children:R.jsxs(hw,{className:_e("",{}),children:[" ",h.description]})})})]}),e.cards.length>1&&K()]})}),R.jsx(Dm,{className:"relative flex grow flex-col",children:Z()}),R.jsx(pw,{children:X()})]});return R.jsxs(fw,{tabIndex:-1,ref:i,role:"card-frame",onClick:J,style:{borderRadius:(V=($=s==null?void 0:s.chart)==null?void 0:$.options)==null?void 0:V.borderRadius,fontFamily:(M=(U=s==null?void 0:s.chart)==null?void 0:U.font)==null?void 0:M.family},className:_e("relative flex h-full flex-col rounded-sm",{"border-dashed border-foreground/50":l===e.id&&c,"animate-pulse":v},s==null?void 0:s.dashboardCard,n,"semaphor-card-frame"),...r,children:[R.jsx(FJ,{frame:e}),te()]})}function Nt(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function go(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function yr(e,t){const n=Nt(e);return isNaN(t)?go(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function ei(e,t){const n=Nt(e);if(isNaN(t))return go(e,NaN);if(!t)return n;const r=n.getDate(),o=go(e,n.getTime());o.setMonth(n.getMonth()+t+1,0);const i=o.getDate();return r>=i?o:(n.setFullYear(o.getFullYear(),o.getMonth(),r),n)}const Q_=6048e5,Doe=864e5;let Aoe={};function ah(){return Aoe}function Ri(e,t){var a,l,c,u;const n=ah(),r=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,o=Nt(e),i=o.getDay(),s=(i<r?7:0)+i-r;return o.setDate(o.getDate()-s),o.setHours(0,0,0,0),o}function wl(e){return Ri(e,{weekStartsOn:1})}function RI(e){const t=Nt(e),n=t.getFullYear(),r=go(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const o=wl(r),i=go(e,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const s=wl(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function du(e){const t=Nt(e);return t.setHours(0,0,0,0),t}function sm(e){const t=Nt(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function yi(e,t){const n=du(e),r=du(t),o=+n-sm(n),i=+r-sm(r);return Math.round((o-i)/Doe)}function koe(e){const t=RI(e),n=go(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),wl(n)}function b1(e,t){const n=t*7;return yr(e,n)}function Moe(e,t){return ei(e,t*12)}function Ioe(e){let t;return e.forEach(function(n){const r=Nt(n);(t===void 0||t<r||isNaN(Number(r)))&&(t=r)}),t||new Date(NaN)}function Noe(e){let t;return e.forEach(n=>{const r=Nt(n);(!t||t>r||isNaN(+r))&&(t=r)}),t||new Date(NaN)}function jr(e,t){const n=du(e),r=du(t);return+n==+r}function J_(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Loe(e){if(!J_(e)&&typeof e!="number")return!1;const t=Nt(e);return!isNaN(Number(t))}function nf(e,t){const n=Nt(e),r=Nt(t),o=n.getFullYear()-r.getFullYear(),i=n.getMonth()-r.getMonth();return o*12+i}function Foe(e,t,n){const r=Ri(e,n),o=Ri(t,n),i=+r-sm(r),s=+o-sm(o);return Math.round((i-s)/Q_)}function Z_(e){const t=Nt(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function zr(e){const t=Nt(e);return t.setDate(1),t.setHours(0,0,0,0),t}function PI(e){const t=Nt(e),n=go(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function eS(e,t){var a,l,c,u;const n=ah(),r=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,o=Nt(e),i=o.getDay(),s=(i<r?-7:0)+6-(i-r);return o.setDate(o.getDate()+s),o.setHours(23,59,59,999),o}function OI(e){return eS(e,{weekStartsOn:1})}const joe={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},zoe=(e,t,n)=>{let r;const o=joe[e];return typeof o=="string"?r=o:t===1?r=o.one:r=o.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Q0(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Boe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Voe={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Hoe={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Woe={date:Q0({formats:Boe,defaultWidth:"full"}),time:Q0({formats:Voe,defaultWidth:"full"}),dateTime:Q0({formats:Hoe,defaultWidth:"full"})},Uoe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},qoe=(e,t,n,r)=>Uoe[e];function ad(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let o;if(r==="formatting"&&e.formattingValues){const s=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):s;o=e.formattingValues[a]||e.formattingValues[s]}else{const s=e.defaultWidth,a=n!=null&&n.width?String(n.width):e.defaultWidth;o=e.values[a]||e.values[s]}const i=e.argumentCallback?e.argumentCallback(t):t;return o[i]}}const Goe={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Yoe={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Koe={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Xoe={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Qoe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Joe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Zoe=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},eie={ordinalNumber:Zoe,era:ad({values:Goe,defaultWidth:"wide"}),quarter:ad({values:Yoe,defaultWidth:"wide",argumentCallback:e=>e-1}),month:ad({values:Koe,defaultWidth:"wide"}),day:ad({values:Xoe,defaultWidth:"wide"}),dayPeriod:ad({values:Qoe,defaultWidth:"wide",formattingValues:Joe,defaultFormattingWidth:"wide"})};function ld(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(o);if(!i)return null;const s=i[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?nie(a,f=>f.test(s)):tie(a,f=>f.test(s));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const u=t.slice(s.length);return{value:c,rest:u}}}function tie(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function nie(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function rie(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const o=r[0],i=t.match(e.parsePattern);if(!i)return null;let s=e.valueCallback?e.valueCallback(i[0]):i[0];s=n.valueCallback?n.valueCallback(s):s;const a=t.slice(o.length);return{value:s,rest:a}}}const oie=/^(\d+)(th|st|nd|rd)?/i,iie=/\d+/i,sie={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},aie={any:[/^b/i,/^(a|c)/i]},lie={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},cie={any:[/1/i,/2/i,/3/i,/4/i]},uie={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},die={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},fie={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},hie={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},pie={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},gie={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},mie={ordinalNumber:rie({matchPattern:oie,parsePattern:iie,valueCallback:e=>parseInt(e,10)}),era:ld({matchPatterns:sie,defaultMatchWidth:"wide",parsePatterns:aie,defaultParseWidth:"any"}),quarter:ld({matchPatterns:lie,defaultMatchWidth:"wide",parsePatterns:cie,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ld({matchPatterns:uie,defaultMatchWidth:"wide",parsePatterns:die,defaultParseWidth:"any"}),day:ld({matchPatterns:fie,defaultMatchWidth:"wide",parsePatterns:hie,defaultParseWidth:"any"}),dayPeriod:ld({matchPatterns:pie,defaultMatchWidth:"any",parsePatterns:gie,defaultParseWidth:"any"})},$I={code:"en-US",formatDistance:zoe,formatLong:Woe,formatRelative:qoe,localize:eie,match:mie,options:{weekStartsOn:0,firstWeekContainsDate:1}};function vie(e){const t=Nt(e);return yi(t,PI(t))+1}function TI(e){const t=Nt(e),n=+wl(t)-+koe(t);return Math.round(n/Q_)+1}function DI(e,t){var u,f,p,h;const n=Nt(e),r=n.getFullYear(),o=ah(),i=(t==null?void 0:t.firstWeekContainsDate)??((f=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??o.firstWeekContainsDate??((h=(p=o.locale)==null?void 0:p.options)==null?void 0:h.firstWeekContainsDate)??1,s=go(e,0);s.setFullYear(r+1,0,i),s.setHours(0,0,0,0);const a=Ri(s,t),l=go(e,0);l.setFullYear(r,0,i),l.setHours(0,0,0,0);const c=Ri(l,t);return n.getTime()>=a.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function bie(e,t){var a,l,c,u;const n=ah(),r=(t==null?void 0:t.firstWeekContainsDate)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)??n.firstWeekContainsDate??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.firstWeekContainsDate)??1,o=DI(e,t),i=go(e,0);return i.setFullYear(o,0,r),i.setHours(0,0,0,0),Ri(i,t)}function AI(e,t){const n=Nt(e),r=+Ri(n,t)-+bie(n,t);return Math.round(r/Q_)+1}function Jt(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Ms={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Jt(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Jt(n+1,2)},d(e,t){return Jt(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return Jt(e.getHours()%12||12,t.length)},H(e,t){return Jt(e.getHours(),t.length)},m(e,t){return Jt(e.getMinutes(),t.length)},s(e,t){return Jt(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return Jt(o,t.length)}},lc={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},z$={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return Ms.y(e,t)},Y:function(e,t,n,r){const o=DI(e,r),i=o>0?o:1-o;if(t==="YY"){const s=i%100;return Jt(s,2)}return t==="Yo"?n.ordinalNumber(i,{unit:"year"}):Jt(i,t.length)},R:function(e,t){const n=RI(e);return Jt(n,t.length)},u:function(e,t){const n=e.getFullYear();return Jt(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return Jt(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return Jt(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return Ms.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return Jt(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=AI(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):Jt(o,t.length)},I:function(e,t,n){const r=TI(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Jt(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Ms.d(e,t)},D:function(e,t,n){const r=vie(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Jt(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return Jt(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});case"eeee":default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return Jt(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});case"cccc":default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=r===0?7:r;switch(t){case"i":return String(o);case"ii":return Jt(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(r===12?o=lc.noon:r===0?o=lc.midnight:o=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(r>=17?o=lc.evening:r>=12?o=lc.afternoon:r>=4?o=lc.morning:o=lc.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Ms.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Ms.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Jt(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Jt(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Ms.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Ms.s(e,t)},S:function(e,t){return Ms.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return V$(r);case"XXXX":case"XX":return Ha(r);case"XXXXX":case"XXX":default:return Ha(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return V$(r);case"xxxx":case"xx":return Ha(r);case"xxxxx":case"xxx":default:return Ha(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+B$(r,":");case"OOOO":default:return"GMT"+Ha(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+B$(r,":");case"zzzz":default:return"GMT"+Ha(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return Jt(r,t.length)},T:function(e,t,n){const r=e.getTime();return Jt(r,t.length)}};function B$(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),i=r%60;return i===0?n+String(o):n+String(o)+t+Jt(i,2)}function V$(e,t){return e%60===0?(e>0?"-":"+")+Jt(Math.abs(e)/60,2):Ha(e,t)}function Ha(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Jt(Math.trunc(r/60),2),i=Jt(r%60,2);return n+o+t+i}const H$=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},kI=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},yie=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return H$(e,t);let i;switch(r){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;case"PPPP":default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",H$(r,t)).replace("{{time}}",kI(o,t))},xie={p:kI,P:yie},wie=/^D+$/,_ie=/^Y+$/,Sie=["D","DD","YY","YYYY"];function Cie(e){return wie.test(e)}function Eie(e){return _ie.test(e)}function Rie(e,t,n){const r=Pie(e,t,n);if(console.warn(r),Sie.includes(e))throw new RangeError(r)}function Pie(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Oie=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,$ie=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Tie=/^'([^]*?)'?$/,Die=/''/g,Aie=/[a-zA-Z]/;function _i(e,t,n){var u,f,p,h,b,v,w,y;const r=ah(),o=(n==null?void 0:n.locale)??r.locale??$I,i=(n==null?void 0:n.firstWeekContainsDate)??((f=(u=n==null?void 0:n.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??r.firstWeekContainsDate??((h=(p=r.locale)==null?void 0:p.options)==null?void 0:h.firstWeekContainsDate)??1,s=(n==null?void 0:n.weekStartsOn)??((v=(b=n==null?void 0:n.locale)==null?void 0:b.options)==null?void 0:v.weekStartsOn)??r.weekStartsOn??((y=(w=r.locale)==null?void 0:w.options)==null?void 0:y.weekStartsOn)??0,a=Nt(e);if(!Loe(a))throw new RangeError("Invalid time value");let l=t.match($ie).map(_=>{const S=_[0];if(S==="p"||S==="P"){const C=xie[S];return C(_,o.formatLong)}return _}).join("").match(Oie).map(_=>{if(_==="''")return{isToken:!1,value:"'"};const S=_[0];if(S==="'")return{isToken:!1,value:kie(_)};if(z$[S])return{isToken:!0,value:_};if(S.match(Aie))throw new RangeError("Format string contains an unescaped latin alphabet character `"+S+"`");return{isToken:!1,value:_}});o.localize.preprocessor&&(l=o.localize.preprocessor(a,l));const c={firstWeekContainsDate:i,weekStartsOn:s,locale:o};return l.map(_=>{if(!_.isToken)return _.value;const S=_.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&Eie(S)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&Cie(S))&&Rie(S,t,String(e));const C=z$[S[0]];return C(a,S,o.localize,c)}).join("")}function kie(e){const t=e.match(Tie);return t?t[1].replace(Die,"'"):e}function Mie(e){const t=Nt(e),n=t.getFullYear(),r=t.getMonth(),o=go(e,0);return o.setFullYear(n,r+1,0),o.setHours(0,0,0,0),o.getDate()}function Iie(e){return Math.trunc(+Nt(e)/1e3)}function Nie(e){const t=Nt(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}function Lie(e,t){return Foe(Nie(e),zr(e),t)+1}function y1(e,t){const n=Nt(e),r=Nt(t);return n.getTime()>r.getTime()}function MI(e,t){const n=Nt(e),r=Nt(t);return+n<+r}function tS(e,t){const n=Nt(e),r=Nt(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function Fie(e,t){const n=Nt(e),r=Nt(t);return n.getFullYear()===r.getFullYear()}function J0(e,t){return yr(e,-t)}function Z0(e,t){const n=Nt(e),r=n.getFullYear(),o=n.getDate(),i=go(e,0);i.setFullYear(r,t,15),i.setHours(0,0,0,0);const s=Mie(i);return n.setMonth(t,Math.min(o,s)),n}function W$(e,t){const n=Nt(e);return isNaN(+n)?go(e,NaN):(n.setFullYear(t),n)}var rt=function(){return rt=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},rt.apply(this,arguments)};function jie(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 o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function II(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;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 x1={exports:{}},cd={};/**
|
|
327
327
|
* @license React
|
|
328
328
|
* react-jsx-runtime.development.js
|
|
@@ -35503,7 +35503,7 @@ function Ire({ data: e, card: t }) {
|
|
|
35503
35503
|
)
|
|
35504
35504
|
},
|
|
35505
35505
|
className: Re(
|
|
35506
|
-
"sticky -top-[1px]
|
|
35506
|
+
"sticky -top-[1px] h-9 bg-muted-foreground px-2 text-background",
|
|
35507
35507
|
{
|
|
35508
35508
|
// 'rounded-tl-md border-r': idx === 0,
|
|
35509
35509
|
// 'rounded-tr-md border-l':
|
package/dist/dashboard/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/index-J7GWM1f-.js");require("react");require("react-dom");exports.Dashboard=e.Dashboard;
|
package/dist/dashboard/index.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/index-J7GWM1f-.js"),n=require("./chunks/dashboard-plus-apJaIXwW.js"),I=require("react");require("react-dom");function N({card:t,footer:u,className:m,...c}){const{customCards:r}=e.useSemaphorContext(),h=I.useRef(null),{isError:p,isLoading:i,isFetching:a,cfg:x,visualKey:C,handleDatapointClick:f}=e.useDashboardCard(t),l=e.useDashboardStore(s=>s.themeStyle),d=e.useDashboardStore(s=>s.selectedSheetId),E=e.useDashboardStore(s=>s.selectedCardId),j=e.useDashboardStore(s=>s.isDashboardEditing),{setCardTitle:g,setCardDescription:D,setSelectedCardId:b}=e.useDashboardActions();function S(s){s.stopPropagation(),b(d,t.id)}function T(){if(r&&r.length>0){const s=r.find(o=>o.cardId===t.id);if(s&&s.replaceDefault){const o=s.content;if(o)return e.jsxRuntimeExports.jsx(o,{card:t})}}return t.type==="kpi"?t.data&&t.data.length>0&&e.jsxRuntimeExports.jsx(e.KPICard,{isLoading:i||a,card:t}):y}function R(){if(p)return e.jsxRuntimeExports.jsx("p",{className:"text-sm",children:"Oops! It seems like something went wrong. Please review your connection or filters."});if(t.type==="table"&&t.data&&t.data.length>0)return e.jsxRuntimeExports.jsxs(e.ScrollArea,{children:[e.jsxRuntimeExports.jsx(e.TableVisual,{card:t,data:t.data}),e.jsxRuntimeExports.jsx(e.ScrollBar,{orientation:"horizontal"})]});if(r&&r.length>0){const s=r.find(o=>o.cardId===t.id);if(s&&s.content){const o=s.content;return e.jsxRuntimeExports.jsx(o,{card:t})}}if(x)return e.jsxRuntimeExports.jsx(e.ChartJsVisual,{cfg:x,onDatapointClick:f},C)}function A(){if(r&&r.length>0){const s=r.find(o=>o.cardId===t.id);if(s&&s.footer){const o=s.footer;if(o)return e.jsxRuntimeExports.jsx(o,{card:t})}}return u||null}if(!t.id)return null;const y=e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs(e.CardHeader,{className:"pb-4",children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxRuntimeExports.jsx(e.Editable,{text:t.title,onSave:s=>g(d,t.id,s),children:e.jsxRuntimeExports.jsx(e.CardTitle,{className:"text-base",children:t.title})}),t.refreshInterval&&e.jsxRuntimeExports.jsxs(e.Tooltip,{children:[e.jsxRuntimeExports.jsx(e.TooltipTrigger,{className:"pr-1",children:e.jsxRuntimeExports.jsx("div",{className:e.cn("h-2 w-2 rounded-full bg-green-500 transition-opacity",{"opacity-10":i||a})})}),e.jsxRuntimeExports.jsx(e.TooltipContent,{side:"right",align:"center",children:e.jsxRuntimeExports.jsx("p",{className:"text-xs",children:`Realtime (${t==null?void 0:t.refreshInterval})`})})]}),!t.refreshInterval&&(i||a)&&e.jsxRuntimeExports.jsx(n.LoaderCircle,{className:"h-4 w-4 animate-spin text-muted-foreground"})]}),e.jsxRuntimeExports.jsx(e.Editable,{text:(t==null?void 0:t.description)||"",onSave:s=>D(d,t.id,s),children:e.jsxRuntimeExports.jsxs(e.CardDescription,{children:[" ",t.description]})})]}),e.jsxRuntimeExports.jsx(e.CardContent,{className:"relative flex grow flex-col overflow-auto pb-0",children:R()}),e.jsxRuntimeExports.jsx(e.CardFooter,{children:A()})]});return e.jsxRuntimeExports.jsx(e.Card,{tabIndex:-1,ref:h,role:"dashboard-card",onClick:S,className:e.cn("relative flex h-full flex-col rounded-sm",{"border-dashed border-foreground/50":E===t.id&&j},l==null?void 0:l.dashboardCard,m),...c,children:T()})}exports.BOOLEAN_DATA_TYPES=e.BOOLEAN_DATA_TYPES;exports.DATE_DATA_TYPES=e.DATE_DATA_TYPES;exports.Dashboard=e.Dashboard;exports.DashboardWC=e.DashboardWC;exports.NUMBER_DATA_TYPES=e.NUMBER_DATA_TYPES;exports.SemaphorQueryClient=e.SemaphorQueryClient;exports.TEXT_DATA_TYPES=e.TEXT_DATA_TYPES;exports.cleanCard=e.cleanCard;exports.createSqlGenConfig=e.createSqlGenConfig;exports.fmt=e.fmt;exports.getBookmarkKey=e.getBookmarkKey;exports.getColumnDataType=e.getColumnDataType;exports.getDashbaordStateWithoutData=e.getDashbaordStateWithoutData;exports.getFilterValueType=e.getFilterValueType;exports.getQualifiedTableName=e.getQualifiedTableName;exports.getSql=e.getSql;exports.isColumnInSqlGen=e.isColumnInSqlGen;exports.resolveDataType=e.resolveDataType;exports.useCard=e.useCard;exports.useDashboardActions=e.useDashboardActions;exports.useDashboardStore=e.useDashboardStore;exports.useEditorActions=e.useEditorActions;exports.useEditorStore=e.useEditorStore;exports.SelectComponent=n.SelectComponent;exports.Surfboard=n.DashboardPlus;exports.useEditorAside=n.useEditorAside;exports.DashboardCard=N;
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { u as _, a as k, b as r, c as w, j as t, C as F, E as f, d as P, T as L, e as R, f as h, g as B, h as q, i as K, k as Y, l as G, K as O, S as V, m as z, n as H, o as J } from "./chunks/index-
|
|
2
|
-
import { B as se, s as ae, D as oe, q as re, N as ne, I as ie, r as le, L as de, w as ue, t as ce, M as fe, y as he, J as Ce, x as me, A as xe, v as pe, z as ge, F as je, p as De, H as be, G as Se } from "./chunks/index-
|
|
3
|
-
import { L as M } from "./chunks/dashboard-plus-
|
|
4
|
-
import { S as Ee, D as Ie, u as Ae } from "./chunks/dashboard-plus-
|
|
1
|
+
import { u as _, a as k, b as r, c as w, j as t, C as F, E as f, d as P, T as L, e as R, f as h, g as B, h as q, i as K, k as Y, l as G, K as O, S as V, m as z, n as H, o as J } from "./chunks/index-x2wG2JFp.js";
|
|
2
|
+
import { B as se, s as ae, D as oe, q as re, N as ne, I as ie, r as le, L as de, w as ue, t as ce, M as fe, y as he, J as Ce, x as me, A as xe, v as pe, z as ge, F as je, p as De, H as be, G as Se } from "./chunks/index-x2wG2JFp.js";
|
|
3
|
+
import { L as M } from "./chunks/dashboard-plus-0Wc18x9Q.js";
|
|
4
|
+
import { S as Ee, D as Ie, u as Ae } from "./chunks/dashboard-plus-0Wc18x9Q.js";
|
|
5
5
|
import Q from "react";
|
|
6
6
|
import "react-dom";
|
|
7
7
|
function Z({
|
package/dist/surfboard/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../chunks/dashboard-plus-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../chunks/dashboard-plus-apJaIXwW.js");require("../chunks/index-J7GWM1f-.js");require("react");require("react-dom");exports.Surfboard=r.DashboardPlus;
|
package/dist/surfboard/index.js
CHANGED