react-semaphor 0.0.205 → 0.0.206
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-gT512BZS.js → dashboard-plus-wP98d1VM.js} +2 -2
- package/dist/chunks/dashboard-plus-z6ljHA5H.js +210 -0
- package/dist/chunks/{index-vBFniV1K.js → index-FKRPJKTT.js} +2 -2
- package/dist/chunks/{index-LQVSHEGJ.js → index-tjnD7EOn.js} +11 -11
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +3 -3
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunks/dashboard-plus--d0M3NZV.js +0 -210
|
@@ -312,7 +312,7 @@ Valid keys: `+JSON.stringify(Object.keys($),null," "));var G=ye(pe,ae,ce,le,de+
|
|
|
312
312
|
`)},Lk=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r,i=V.useMemo(function(){return Gee(o)},[o]);return V.createElement(Yee,{styles:Kee(i,!t,o,n?"":"!important")})},Tx=!1;if(typeof window<"u")try{var Cp=Object.defineProperty({},"passive",{get:function(){return Tx=!0,!0}});window.addEventListener("test",Cp,Cp),window.removeEventListener("test",Cp,Cp)}catch{Tx=!1}var ec=Tx?{passive:!1}:!1,Xee=function(e){return e.tagName==="TEXTAREA"},Fk=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Xee(e)&&n[t]==="visible")},Qee=function(e){return Fk(e,"overflowY")},Jee=function(e){return Fk(e,"overflowX")},PP=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=jk(e,n);if(r){var o=zk(e,n),i=o[1],s=o[2];if(i>s)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},Zee=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},ete=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},jk=function(e,t){return e==="v"?Qee(t):Jee(t)},zk=function(e,t){return e==="v"?Zee(t):ete(t)},tte=function(e,t){return e==="h"&&t==="rtl"?-1:1},nte=function(e,t,n,r,o){var i=tte(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,l=t.contains(a),c=!1,u=s>0,f=0,h=0;do{var g=zk(e,a),v=g[0],b=g[1],x=g[2],w=b-x-i*v;(v||w)&&jk(e,a)&&(f+=w,h+=v),a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(u&&(o&&f===0||!o&&s>f)||!u&&(o&&h===0||!o&&-s>h))&&(c=!0),c},Ep=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},TP=function(e){return[e.deltaX,e.deltaY]},DP=function(e){return e&&"current"in e?e.current:e},rte=function(e,t){return e[0]===t[0]&&e[1]===t[1]},ote=function(e){return`
|
|
313
313
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
314
314
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
315
|
-
`)},ite=0,tc=[];function ste(e){var t=V.useRef([]),n=V.useRef([0,0]),r=V.useRef(),o=V.useState(ite++)[0],i=V.useState(function(){return e_()})[0],s=V.useRef(e);V.useEffect(function(){s.current=e},[e]),V.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var b=$k([e.lockRef.current],(e.shards||[]).map(DP),!0).filter(Boolean);return b.forEach(function(x){return x.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),b.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=V.useCallback(function(b,x){if("touches"in b&&b.touches.length===2)return!s.current.allowPinchZoom;var w=Ep(b),_=n.current,S="deltaX"in b?b.deltaX:_[0]-w[0],R="deltaY"in b?b.deltaY:_[1]-w[1],C,P=b.target,A=Math.abs(S)>Math.abs(R)?"h":"v";if("touches"in b&&A==="h"&&P.type==="range")return!1;var k=PP(A,P);if(!k)return!0;if(k?C=A:(C=A==="v"?"h":"v",k=PP(A,P)),!k)return!1;if(!r.current&&"changedTouches"in b&&(S||R)&&(r.current=C),!C)return!0;var D=r.current||C;return nte(D,x,b,D==="h"?S:R,!0)},[]),l=V.useCallback(function(b){var x=b;if(!(!tc.length||tc[tc.length-1]!==i)){var w="deltaY"in x?TP(x):Ep(x),_=t.current.filter(function(C){return C.name===x.type&&C.target===x.target&&rte(C.delta,w)})[0];if(_&&_.should){x.cancelable&&x.preventDefault();return}if(!_){var S=(s.current.shards||[]).map(DP).filter(Boolean).filter(function(C){return C.contains(x.target)}),R=S.length>0?a(x,S[0]):!s.current.noIsolation;R&&x.cancelable&&x.preventDefault()}}},[]),c=V.useCallback(function(b,x,w,_){var S={name:b,delta:x,target:w,should:_};t.current.push(S),setTimeout(function(){t.current=t.current.filter(function(R){return R!==S})},1)},[]),u=V.useCallback(function(b){n.current=Ep(b),r.current=void 0},[]),f=V.useCallback(function(b){c(b.type,TP(b),b.target,a(b,e.lockRef.current))},[]),h=V.useCallback(function(b){c(b.type,Ep(b),b.target,a(b,e.lockRef.current))},[]);V.useEffect(function(){return tc.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",l,ec),document.addEventListener("touchmove",l,ec),document.addEventListener("touchstart",u,ec),function(){tc=tc.filter(function(b){return b!==i}),document.removeEventListener("wheel",l,ec),document.removeEventListener("touchmove",l,ec),document.removeEventListener("touchstart",u,ec)}},[]);var g=e.removeScrollBar,v=e.inert;return V.createElement(V.Fragment,null,v?V.createElement(i,{styles:ote(o)}):null,g?V.createElement(Lk,{gapMode:"margin"}):null)}const ate=Ik(Nk,ste);var Bk=V.forwardRef(function(e,t){return V.createElement(Lm,lr({},e,{ref:t,sideCar:ate}))});Bk.classNames=Lm.classNames;const t_=Bk,lte=[" ","Enter","ArrowUp","ArrowDown"],cte=[" ","Enter"],Fm="Select",[jm,zm,ute]=lm(Fm),[au,pye]=Zn(Fm,[ute,Ti]),n_=Ti(),[dte,Rl]=au(Fm),[fte,hte]=au(Fm),pte=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:h,required:g}=e,v=n_(t),[b,x]=m.useState(null),[w,_]=m.useState(null),[S,R]=m.useState(!1),C=_l(c),[P=!1,A]=xr({prop:r,defaultProp:o,onChange:i}),[k,D]=xr({prop:s,defaultProp:a,onChange:l}),I=m.useRef(null),F=b?!!b.closest("form"):!0,[B,K]=m.useState(new Set),Z=Array.from(B).map(z=>z.props.value).join(";");return m.createElement(zf,v,m.createElement(dte,{required:g,scope:t,trigger:b,onTriggerChange:x,valueNode:w,onValueNodeChange:_,valueNodeHasChildren:S,onValueNodeHasChildrenChange:R,contentId:Jo(),value:k,onValueChange:D,open:P,onOpenChange:A,dir:C,triggerPointerDownPosRef:I,disabled:h},m.createElement(jm.Provider,{scope:t},m.createElement(fte,{scope:e.__scopeSelect,onNativeOptionAdd:m.useCallback(z=>{K(Q=>new Set(Q).add(z))},[]),onNativeOptionRemove:m.useCallback(z=>{K(Q=>{const W=new Set(Q);return W.delete(z),W})},[])},n)),F?m.createElement(qk,{key:Z,"aria-hidden":!0,required:g,tabIndex:-1,name:u,autoComplete:f,value:k,onChange:z=>D(z.target.value),disabled:h},k===void 0?m.createElement("option",{value:""}):null,Array.from(B)):null))},gte="SelectTrigger",mte=m.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=n_(n),s=Rl(gte,n),a=s.disabled||r,l=_t(t,s.onTriggerChange),c=zm(n),[u,f,h]=Gk(v=>{const b=c().filter(_=>!_.disabled),x=b.find(_=>_.value===s.value),w=Yk(b,v,x);w!==void 0&&s.onValueChange(w.value)}),g=()=>{a||(s.onOpenChange(!0),h())};return m.createElement(Bf,he({asChild:!0},i),m.createElement(Qe.button,he({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":Uk(s.value)?"":void 0},o,{ref:l,onClick:Me(o.onClick,v=>{v.currentTarget.focus()}),onPointerDown:Me(o.onPointerDown,v=>{const b=v.target;b.hasPointerCapture(v.pointerId)&&b.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&(g(),s.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)},v.preventDefault())}),onKeyDown:Me(o.onKeyDown,v=>{const b=u.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&f(v.key),!(b&&v.key===" ")&<e.includes(v.key)&&(g(),v.preventDefault())})})))}),vte="SelectValue",bte=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:s="",...a}=e,l=Rl(vte,n),{onValueNodeHasChildrenChange:c}=l,u=i!==void 0,f=_t(t,l.onValueNodeChange);return ur(()=>{c(u)},[c,u]),m.createElement(Qe.span,he({},a,{ref:f,style:{pointerEvents:"none"}}),Uk(l.value)?m.createElement(m.Fragment,null,s):i)}),yte=m.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return m.createElement(Qe.span,he({"aria-hidden":!0},o,{ref:t}),r||"▼")}),xte=e=>m.createElement(A1,he({asChild:!0},e)),Jc="SelectContent",wte=m.forwardRef((e,t)=>{const n=Rl(Jc,e.__scopeSelect),[r,o]=m.useState();if(ur(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?ko.createPortal(m.createElement(Vk,{scope:e.__scopeSelect},m.createElement(jm.Slot,{scope:e.__scopeSelect},m.createElement("div",null,e.children))),i):null}return m.createElement(_te,he({},e,{ref:t}))}),Ki=10,[Vk,Ol]=au(Jc),_te=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:h,collisionPadding:g,sticky:v,hideWhenDetached:b,avoidCollisions:x,...w}=e,_=Rl(Jc,n),[S,R]=m.useState(null),[C,P]=m.useState(null),A=_t(t,pe=>R(pe)),[k,D]=m.useState(null),[I,F]=m.useState(null),B=zm(n),[K,Z]=m.useState(!1),z=m.useRef(!1);m.useEffect(()=>{if(S)return Nm(S)},[S]),Q1();const Q=m.useCallback(pe=>{const[ie,...te]=B().map(G=>G.ref.current),[ae]=te.slice(-1),ye=document.activeElement;for(const G of pe)if(G===ye||(G==null||G.scrollIntoView({block:"nearest"}),G===ie&&C&&(C.scrollTop=0),G===ae&&C&&(C.scrollTop=C.scrollHeight),G==null||G.focus(),document.activeElement!==ye))return},[B,C]),W=m.useCallback(()=>Q([k,S]),[Q,k,S]);m.useEffect(()=>{K&&W()},[K,W]);const{onOpenChange:Y,triggerPointerDownPosRef:oe}=_;m.useEffect(()=>{if(S){let pe={x:0,y:0};const ie=ae=>{var ye,G,be,_e;pe={x:Math.abs(Math.round(ae.pageX)-((ye=(G=oe.current)===null||G===void 0?void 0:G.x)!==null&&ye!==void 0?ye:0)),y:Math.abs(Math.round(ae.pageY)-((be=(_e=oe.current)===null||_e===void 0?void 0:_e.y)!==null&&be!==void 0?be:0))}},te=ae=>{pe.x<=10&&pe.y<=10?ae.preventDefault():S.contains(ae.target)||Y(!1),document.removeEventListener("pointermove",ie),oe.current=null};return oe.current!==null&&(document.addEventListener("pointermove",ie),document.addEventListener("pointerup",te,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ie),document.removeEventListener("pointerup",te,{capture:!0})}}},[S,Y,oe]),m.useEffect(()=>{const pe=()=>Y(!1);return window.addEventListener("blur",pe),window.addEventListener("resize",pe),()=>{window.removeEventListener("blur",pe),window.removeEventListener("resize",pe)}},[Y]);const[$,H]=Gk(pe=>{const ie=B().filter(ye=>!ye.disabled),te=ie.find(ye=>ye.ref.current===document.activeElement),ae=Yk(ie,pe,te);ae&&setTimeout(()=>ae.ref.current.focus())}),J=m.useCallback((pe,ie,te)=>{const ae=!z.current&&!te;(_.value!==void 0&&_.value===ie||ae)&&(D(pe),ae&&(z.current=!0))},[_.value]),N=m.useCallback(()=>S==null?void 0:S.focus(),[S]),ce=m.useCallback((pe,ie,te)=>{const ae=!z.current&&!te;(_.value!==void 0&&_.value===ie||ae)&&F(pe)},[_.value]),le=r==="popper"?$P:Ste,de=le===$P?{side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:f,collisionBoundary:h,collisionPadding:g,sticky:v,hideWhenDetached:b,avoidCollisions:x}:{};return m.createElement(Vk,{scope:n,content:S,viewport:C,onViewportChange:P,itemRefCallback:J,selectedItem:k,onItemLeave:N,itemTextRefCallback:ce,focusSelectedItem:W,selectedItemText:I,position:r,isPositioned:K,searchRef:$},m.createElement(t_,{as:Tk,allowPinchZoom:!0},m.createElement(J1,{asChild:!0,trapped:_.open,onMountAutoFocus:pe=>{pe.preventDefault()},onUnmountAutoFocus:Me(o,pe=>{var ie;(ie=_.trigger)===null||ie===void 0||ie.focus({preventScroll:!0}),pe.preventDefault()})},m.createElement(Ff,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:pe=>pe.preventDefault(),onDismiss:()=>_.onOpenChange(!1)},m.createElement(le,he({role:"listbox",id:_.contentId,"data-state":_.open?"open":"closed",dir:_.dir,onContextMenu:pe=>pe.preventDefault()},w,de,{onPlaced:()=>Z(!0),ref:A,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:Me(w.onKeyDown,pe=>{const ie=pe.ctrlKey||pe.altKey||pe.metaKey;if(pe.key==="Tab"&&pe.preventDefault(),!ie&&pe.key.length===1&&H(pe.key),["ArrowUp","ArrowDown","Home","End"].includes(pe.key)){let ae=B().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,G=ae.indexOf(ye);ae=ae.slice(G+1)}setTimeout(()=>Q(ae)),pe.preventDefault()}})}))))))}),Ste=m.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=Rl(Jc,n),s=Ol(Jc,n),[a,l]=m.useState(null),[c,u]=m.useState(null),f=_t(t,A=>u(A)),h=zm(n),g=m.useRef(!1),v=m.useRef(!0),{viewport:b,selectedItem:x,selectedItemText:w,focusSelectedItem:_}=s,S=m.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&c&&b&&x&&w){const A=i.trigger.getBoundingClientRect(),k=c.getBoundingClientRect(),D=i.valueNode.getBoundingClientRect(),I=w.getBoundingClientRect();if(i.dir!=="rtl"){const ye=I.left-k.left,G=D.left-ye,be=A.left-G,_e=A.width+be,Pe=Math.max(_e,k.width),Te=window.innerWidth-Ki,Ue=Ox(G,[Ki,Te-Pe]);a.style.minWidth=_e+"px",a.style.left=Ue+"px"}else{const ye=k.right-I.right,G=window.innerWidth-D.right-ye,be=window.innerWidth-A.right-G,_e=A.width+be,Pe=Math.max(_e,k.width),Te=window.innerWidth-Ki,Ue=Ox(G,[Ki,Te-Pe]);a.style.minWidth=_e+"px",a.style.right=Ue+"px"}const F=h(),B=window.innerHeight-Ki*2,K=b.scrollHeight,Z=window.getComputedStyle(c),z=parseInt(Z.borderTopWidth,10),Q=parseInt(Z.paddingTop,10),W=parseInt(Z.borderBottomWidth,10),Y=parseInt(Z.paddingBottom,10),oe=z+Q+K+Y+W,$=Math.min(x.offsetHeight*5,oe),H=window.getComputedStyle(b),J=parseInt(H.paddingTop,10),N=parseInt(H.paddingBottom,10),ce=A.top+A.height/2-Ki,le=B-ce,de=x.offsetHeight/2,pe=x.offsetTop+de,ie=z+Q+pe,te=oe-ie;if(ie<=ce){const ye=x===F[F.length-1].ref.current;a.style.bottom="0px";const G=c.clientHeight-b.offsetTop-b.offsetHeight,be=Math.max(le,de+(ye?N:0)+G+W),_e=ie+be;a.style.height=_e+"px"}else{const ye=x===F[0].ref.current;a.style.top="0px";const be=Math.max(ce,z+b.offsetTop+(ye?J:0)+de)+te;a.style.height=be+"px",b.scrollTop=ie-ce+b.offsetTop}a.style.margin=`${Ki}px 0`,a.style.minHeight=$+"px",a.style.maxHeight=B+"px",r==null||r(),requestAnimationFrame(()=>g.current=!0)}},[h,i.trigger,i.valueNode,a,c,b,x,w,i.dir,r]);ur(()=>S(),[S]);const[R,C]=m.useState();ur(()=>{c&&C(window.getComputedStyle(c).zIndex)},[c]);const P=m.useCallback(A=>{A&&v.current===!0&&(S(),_==null||_(),v.current=!1)},[S,_]);return m.createElement(Cte,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:g,onScrollButtonChange:P},m.createElement("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:R}},m.createElement(Qe.div,he({},o,{ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}}))))}),$P=m.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Ki,...i}=e,s=n_(n);return m.createElement(Vf,he({},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)"}}))}),[Cte,r_]=au(Jc,{}),AP="SelectViewport",Ete=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Ol(AP,n),i=r_(AP,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(jm.Slot,{scope:n},m.createElement(Qe.div,he({"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 h=Math.abs(a.current-c.scrollTop);if(h>0){const g=window.innerHeight-Ki*2,v=parseFloat(u.style.minHeight),b=parseFloat(u.style.height),x=Math.max(v,b);if(x<g){const w=x+h,_=Math.min(g,w),S=w-_;u.style.height=_+"px",u.style.bottom==="0px"&&(c.scrollTop=S>0?S:0,u.style.justifyContent="flex-end")}}}a.current=c.scrollTop})}))))}),Rte="SelectGroup",[Ote,Pte]=au(Rte),Tte=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Jo();return m.createElement(Ote,{scope:n,id:o},m.createElement(Qe.div,he({role:"group","aria-labelledby":o},r,{ref:t})))}),Dte="SelectLabel",$te=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Pte(Dte,n);return m.createElement(Qe.div,he({id:o.id},r,{ref:t}))}),Dx="SelectItem",[Ate,Hk]=au(Dx),kte=m.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...s}=e,a=Rl(Dx,n),l=Ol(Dx,n),c=a.value===r,[u,f]=m.useState(i??""),[h,g]=m.useState(!1),v=_t(t,w=>{var _;return(_=l.itemRefCallback)===null||_===void 0?void 0:_.call(l,w,r,o)}),b=Jo(),x=()=>{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(Ate,{scope:n,value:r,disabled:o,textId:b,isSelected:c,onItemTextChange:m.useCallback(w=>{f(_=>{var S;return _||((S=w==null?void 0:w.textContent)!==null&&S!==void 0?S:"").trim()})},[])},m.createElement(jm.ItemSlot,{scope:n,value:r,disabled:o,textValue:u},m.createElement(Qe.div,he({role:"option","aria-labelledby":b,"data-highlighted":h?"":void 0,"aria-selected":c&&h,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1},s,{ref:v,onFocus:Me(s.onFocus,()=>g(!0)),onBlur:Me(s.onBlur,()=>g(!1)),onPointerUp:Me(s.onPointerUp,x),onPointerMove:Me(s.onPointerMove,w=>{if(o){var _;(_=l.onItemLeave)===null||_===void 0||_.call(l)}else w.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Me(s.onPointerLeave,w=>{if(w.currentTarget===document.activeElement){var _;(_=l.onItemLeave)===null||_===void 0||_.call(l)}}),onKeyDown:Me(s.onKeyDown,w=>{var _;((_=l.searchRef)===null||_===void 0?void 0:_.current)!==""&&w.key===" "||(cte.includes(w.key)&&x(),w.key===" "&&w.preventDefault())})}))))}),Rp="SelectItemText",Mte=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,s=Rl(Rp,n),a=Ol(Rp,n),l=Hk(Rp,n),c=hte(Rp,n),[u,f]=m.useState(null),h=_t(t,w=>f(w),l.onItemTextChange,w=>{var _;return(_=a.itemTextRefCallback)===null||_===void 0?void 0:_.call(a,w,l.value,l.disabled)}),g=u==null?void 0:u.textContent,v=m.useMemo(()=>m.createElement("option",{key:l.value,value:l.value,disabled:l.disabled},g),[l.disabled,l.value,g]),{onNativeOptionAdd:b,onNativeOptionRemove:x}=c;return ur(()=>(b(v),()=>x(v)),[b,x,v]),m.createElement(m.Fragment,null,m.createElement(Qe.span,he({id:l.textId},i,{ref:h})),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?ko.createPortal(i.children,s.valueNode):null)}),Ite="SelectItemIndicator",Nte=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Hk(Ite,n).isSelected?m.createElement(Qe.span,he({"aria-hidden":!0},r,{ref:t})):null}),kP="SelectScrollUpButton",Lte=m.forwardRef((e,t)=>{const n=Ol(kP,e.__scopeSelect),r=r_(kP,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(Wk,he({},e,{ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}})):null}),MP="SelectScrollDownButton",Fte=m.forwardRef((e,t)=>{const n=Ol(MP,e.__scopeSelect),r=r_(MP,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(Wk,he({},e,{ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}})):null}),Wk=m.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=Ol("SelectScrollButton",n),s=m.useRef(null),a=zm(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,he({"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()})}))}),jte=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return m.createElement(Qe.div,he({"aria-hidden":!0},r,{ref:t}))});function Uk(e){return e===""||e===void 0}const qk=m.forwardRef((e,t)=>{const{value:n,...r}=e,o=m.useRef(null),i=_t(t,o),s=Im(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(JA,{asChild:!0},m.createElement("select",he({},r,{ref:i,defaultValue:n})))});qk.displayName="BubbleSelect";function Gk(e){const t=Ln(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 Yk(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=zte(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 zte(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const Bte=pte,Kk=mte,Vte=bte,Hte=yte,Wte=xte,Xk=wte,Ute=Ete,qte=Tte,Qk=$te,Jk=kte,Gte=Mte,Yte=Nte,Zk=Lte,eM=Fte,tM=jte,zs=Bte,dc=qte,Bs=Vte,Qi=V.forwardRef(({className:e,children:t,...n},r)=>O.jsxs(Kk,{ref:r,className:Ee("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,O.jsx(Hte,{asChild:!0,children:O.jsx(Om,{className:"h-4 w-4 opacity-50"})})]}));Qi.displayName=Kk.displayName;const nM=V.forwardRef(({className:e,...t},n)=>O.jsx(Zk,{ref:n,className:Ee("flex cursor-default items-center justify-center py-1",e),...t,children:O.jsx(KX,{className:"h-4 w-4"})}));nM.displayName=Zk.displayName;const rM=V.forwardRef(({className:e,...t},n)=>O.jsx(eM,{ref:n,className:Ee("flex cursor-default items-center justify-center py-1",e),...t,children:O.jsx(Om,{className:"h-4 w-4"})}));rM.displayName=eM.displayName;const Ji=V.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>O.jsx(Wte,{children:O.jsxs(Xk,{ref:o,className:Ee("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:[O.jsx(nM,{}),O.jsx(Ute,{className:Ee("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),O.jsx(rM,{})]})}));Ji.displayName=Xk.displayName;const Va=V.forwardRef(({className:e,...t},n)=>O.jsx(Qk,{ref:n,className:Ee("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Va.displayName=Qk.displayName;const Hn=V.forwardRef(({className:e,children:t,...n},r)=>O.jsxs(Jk,{ref:r,className:Ee("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:[O.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:O.jsx(Yte,{children:O.jsx(Lf,{className:"h-4 w-4"})})}),O.jsx(Gte,{children:t})]}));Hn.displayName=Jk.displayName;const Ng=V.forwardRef(({className:e,...t},n)=>O.jsx(tM,{ref:n,className:Ee("-mx-1 my-1 h-px bg-muted",e),...t}));Ng.displayName=tM.displayName;function Kte(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Xte(...e){return t=>e.forEach(n=>Kte(n,t))}var Bm=V.forwardRef((e,t)=>{const{children:n,...r}=e,o=V.Children.toArray(n),i=o.find(Qte);if(i){const s=i.props.children,a=o.map(l=>l===i?V.Children.count(s)>1?V.Children.only(null):V.isValidElement(s)?s.props.children:null:l);return O.jsx($x,{...r,ref:t,children:V.isValidElement(s)?V.cloneElement(s,void 0,a):null})}return O.jsx($x,{...r,ref:t,children:n})});Bm.displayName="Slot";var $x=V.forwardRef((e,t)=>{const{children:n,...r}=e;if(V.isValidElement(n)){const o=Zte(n);return V.cloneElement(n,{...Jte(r,n.props),ref:t?Xte(t,o):o})}return V.Children.count(n)>1?V.Children.only(null):null});$x.displayName="SlotClone";var oM=({children:e})=>O.jsx(O.Fragment,{children:e});function Qte(e){return V.isValidElement(e)&&e.type===oM}function Jte(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 Zte(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 IP=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,NP=cg,o_=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return NP(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 h=IP(u)||IP(f);return o[c][h]}),a=n&&Object.entries(n).reduce((c,u)=>{let[f,h]=u;return h===void 0||(c[f]=h),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:f,className:h,...g}=u;return Object.entries(g).every(v=>{let[b,x]=v;return Array.isArray(x)?x.includes({...i,...a}[b]):{...i,...a}[b]===x})?[...c,f,h]:c},[]);return NP(e,s,l,n==null?void 0:n.class,n==null?void 0:n.className)},Bd=o_("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"}}),yr=V.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},i)=>{const s=r?Bm:"button";return O.jsx(s,{className:Ee(Bd({variant:t,size:n,className:e})),ref:i,...o})});yr.displayName="Button";const ene=m.forwardRef((e,t)=>m.createElement(Qe.label,he({},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()}}))),iM=ene,tne=o_("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Wn=V.forwardRef(({className:e,...t},n)=>O.jsx(iM,{ref:n,className:Ee(tne(),e),...t}));Wn.displayName=iM.displayName;const sM=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(rne);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(Ax,he({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(Ax,he({},r,{ref:t}),n)});sM.displayName="Slot";const Ax=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...one(r,n.props),ref:t?cs(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});Ax.displayName="SlotClone";const nne=({children:e})=>m.createElement(m.Fragment,null,e);function rne(e){return m.isValidElement(e)&&e.type===nne}function one(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 aM="Popover",[lM,gye]=Zn(aM,[Ti]),i_=Ti(),[ine,lu]=lM(aM),sne=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!1}=e,a=i_(t),l=m.useRef(null),[c,u]=m.useState(!1),[f=!1,h]=xr({prop:r,defaultProp:o,onChange:i});return m.createElement(zf,a,m.createElement(ine,{scope:t,contentId:Jo(),triggerRef:l,open:f,onOpenChange:h,onOpenToggle:m.useCallback(()=>h(g=>!g),[h]),hasCustomAnchor:c,onCustomAnchorAdd:m.useCallback(()=>u(!0),[]),onCustomAnchorRemove:m.useCallback(()=>u(!1),[]),modal:s},n))},ane="PopoverTrigger",lne=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=lu(ane,n),i=i_(n),s=_t(t,o.triggerRef),a=m.createElement(Qe.button,he({type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":dM(o.open)},r,{ref:s,onClick:Me(e.onClick,o.onOpenToggle)}));return o.hasCustomAnchor?a:m.createElement(Bf,he({asChild:!0},i),a)}),cM="PopoverPortal",[cne,une]=lM(cM,{forceMount:void 0}),dne=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,i=lu(cM,t);return m.createElement(cne,{scope:t,forceMount:n},m.createElement(er,{present:n||i.open},m.createElement(A1,{asChild:!0,container:o},r)))},Vd="PopoverContent",fne=m.forwardRef((e,t)=>{const n=une(Vd,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,i=lu(Vd,e.__scopePopover);return m.createElement(er,{present:r||i.open},i.modal?m.createElement(hne,he({},o,{ref:t})):m.createElement(pne,he({},o,{ref:t})))}),hne=m.forwardRef((e,t)=>{const n=lu(Vd,e.__scopePopover),r=m.useRef(null),o=_t(t,r),i=m.useRef(!1);return m.useEffect(()=>{const s=r.current;if(s)return Nm(s)},[]),m.createElement(t_,{as:sM,allowPinchZoom:!0},m.createElement(uM,he({},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})})))}),pne=m.forwardRef((e,t)=>{const n=lu(Vd,e.__scopePopover),r=m.useRef(!1),o=m.useRef(!1);return m.createElement(uM,he({},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()}}))}),uM=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,h=lu(Vd,n),g=i_(n);return Q1(),m.createElement(J1,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i},m.createElement(Ff,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>h.onOpenChange(!1)},m.createElement(Vf,he({"data-state":dM(h.open),role:"dialog",id:h.contentId},g,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 dM(e){return e?"open":"closed"}const gne=sne,mne=lne,vne=dne,fM=fne,Vm=gne,Hm=mne,Hf=V.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>O.jsx(vne,{children:O.jsx(fM,{ref:o,align:t,sideOffset:n,className:Ee("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})}));Hf.displayName=fM.displayName;function bne(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 xc=V.forwardRef(({className:e,type:t,...n},r)=>O.jsx("input",{type:t,className:Ee("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}));xc.displayName="Input";function hM({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 O.jsxs("div",{className:"space-y-3",children:[O.jsxs("div",{className:"flex items-center gap-2",children:[O.jsx(Wn,{children:"Color Range"}),O.jsx(yr,{onClick:i,variant:"secondary",className:"h-5 p-1 text-muted-foreground",children:O.jsx(C1,{className:"size-3"})})]}),e.map((s,a)=>O.jsxs("div",{className:"flex items-center gap-2 px-2",children:[O.jsx(xc,{onChange:l=>r(a,"start",l.target.value),value:s.start,className:Ee(`h-7 ${Yp}`)}),O.jsx("span",{children:"-"}),O.jsx(xc,{value:s.end,onChange:l=>r(a,"end",l.target.value),className:Ee(`h-7 ${Yp}`)}),O.jsx(xc,{onChange:l=>r(a,"color",l.target.value),value:s.color,className:Ee(`h-7 min-w-14 p-0 ${Yp}`),type:"color",list:"presetColors"}),O.jsxs("datalist",{id:"presetColors",children:[O.jsx("option",{children:Bt.green[600]}),O.jsx("option",{children:Bt.red[500]}),O.jsx("option",{children:Bt.yellow[400]}),O.jsx("option",{children:Bt.orange[500]})]}),O.jsx(yr,{onClick:()=>o(a),variant:"secondary",className:"h-5 p-1 text-muted-foreground",children:O.jsx(Pm,{className:"size-3"})})]},a))]})}const yne=m.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r=!1,onPressedChange:o,...i}=e,[s=!1,a]=xr({prop:n,onChange:o,defaultProp:r});return m.createElement(Qe.button,he({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)})}))}),pM=yne,xne=o_("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"}}),s_=V.forwardRef(({className:e,variant:t,size:n,...r},o)=>O.jsx(pM,{ref:o,className:Ee(xne({variant:t,size:n,className:e})),...r}));s_.displayName=pM.displayName;function wne(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 _ne(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 Sne(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 Cne(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 Ene(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 Rne(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 One(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 Pne({columnIndex:e,columnName:t}){const[n,r]=m.useState(!1),o=Ar(D=>{var I;return(I=D.card)==null?void 0:I.preferences}),[i,s]=m.useState(wne(o,e)),[a,l]=m.useState(Rne(o,e)),[c,u]=m.useState(_ne(o,e)),[f,h]=m.useState(Sne(o,e)),[g,v]=m.useState(Cne(o,e)),[b,x]=m.useState(Ene(o,e).toString()),[w,_]=m.useState(One(o,e));m.useState("");const S=Ar(D=>D.actions.setCardPreferences);function R(){const D=[...new Set(y0.map(I=>I.currency))];return O.jsx(O.Fragment,{children:O.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[O.jsx(Wn,{className:"col-span-3",htmlFor:"format",children:"Locale"}),O.jsxs(zs,{value:c,onValueChange:I=>u(I),children:[O.jsx(Qi,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:O.jsx(Bs,{})}),O.jsx(Ji,{children:O.jsxs(dc,{children:[O.jsx(Va,{children:"Locale"}),y0.map(I=>O.jsx(Hn,{value:I.locale,children:I.locale},I.locale))]})})]}),O.jsx(Wn,{className:"col-span-3",htmlFor:"format",children:"Currency"}),O.jsxs(zs,{value:g||"none",onValueChange:I=>v(I==="none"?void 0:I),children:[O.jsx(Qi,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:O.jsx(Bs,{})}),O.jsx(Ji,{children:O.jsxs(dc,{children:[O.jsx(Va,{children:"Currency"}),O.jsx(Hn,{value:"none",children:"None"}),D.map(I=>O.jsx(Hn,{value:I,children:I},I))]})})]}),O.jsx(Wn,{className:"col-span-3",htmlFor:"format",children:"Decimals"}),O.jsxs(zs,{value:b,onValueChange:I=>x(I),children:[O.jsx(Qi,{className:"col-span-3 h-8 w-full focus:ring-1 focus:ring-offset-0",children:O.jsx(Bs,{})}),O.jsx(Ji,{children:["0","1","2","3","4"].map(I=>O.jsx(Hn,{value:I,children:I},I))})]}),!g&&O.jsx(s_,{onPressedChange:I=>_(I),variant:"outline",size:"sm",className:"col-span-3 h-8","aria-label":"Toggle italic",children:O.jsx(ZX,{className:"size-3"})})]})})}function C(){return O.jsx(O.Fragment,{children:O.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[O.jsx(Wn,{className:"col-span-3",htmlFor:"format",children:"Locale"}),O.jsxs(zs,{defaultValue:"en-US",value:c,onValueChange:D=>u(D),children:[O.jsx(Qi,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:O.jsx(Bs,{})}),O.jsx(Ji,{children:Pz.map(D=>O.jsxs(dc,{children:[O.jsx(Va,{children:D.label}),D.locales.map(I=>O.jsx(Hn,{value:I.code,children:I.name},I.code))]},D.label))})]}),O.jsx(Wn,{className:"col-span-3",htmlFor:"format",children:"Format"}),O.jsxs(zs,{defaultValue:"short-date-time",value:f,onValueChange:D=>{console.log("format",D),h(D)},children:[O.jsx(Qi,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:O.jsx(Bs,{})}),O.jsx(Ji,{className:"",id:"type",children:O.jsxs(dc,{children:[O.jsx(Va,{children:"Option"}),O.jsx(Hn,{value:"full-date-time",children:"Full Date-Time"}),O.jsx(Hn,{value:"short-date-time",children:"Short Date-Time"}),O.jsx(Hn,{value:"hours-date-time",children:"24-Hour Date-Time"}),O.jsx(Hn,{value:"short-date",children:"Short Date"}),O.jsx(Hn,{value:"long-date",children:"Long Date"})]})})]})]})})}function P(){S({...o,columnSettings:[]})}function A(){var D;S({...o,columnSettings:[...((D=o==null?void 0:o.columnSettings)==null?void 0:D.filter(I=>I.columnIdx!==e))||[]]})}function k(){var D,I,F;if(i==="date"){const B=bne(c,f),K={columnIdx:e,type:i,options:B};S({...o,columnSettings:[...((D=o==null?void 0:o.columnSettings)==null?void 0:D.filter(Z=>Z.columnIdx!==e))||[],K]})}else if(i==="number"){let B;g?B={locale:c,currency:g,options:{style:"currency",currency:g,minimumFractionDigits:Number(b)},colorRanges:a.length>0?a:void 0}:B={locale:c,currency:void 0,options:{style:w?"percent":"decimal",minimumFractionDigits:Number(b)},colorRanges:a.length>0?a:void 0};const K={columnIdx:e,type:i,options:B};S({...o,columnSettings:[...((I=o==null?void 0:o.columnSettings)==null?void 0:I.filter(Z=>Z.columnIdx!==e))||[],K]})}else S({...o,columnSettings:[...((F=o==null?void 0:o.columnSettings)==null?void 0:F.filter(B=>B.columnIdx!==e))||[]]})}return O.jsxs(Vm,{onOpenChange:D=>r(D),children:[O.jsx(Hm,{asChild:!0,children:O.jsx(E1,{className:"size-3.5 cursor-pointer text-muted"})}),O.jsx(Hf,{align:"center",className:"max-w-70",children:O.jsxs("div",{className:"grid gap-4",children:[O.jsxs("div",{className:"space-y-2",children:[O.jsx("h4",{className:"font-medium leading-none",children:"Display Settings"}),O.jsx("p",{className:"text-sm text-muted-foreground",children:`Display setting for '${t}'`})]}),O.jsxs("div",{className:"grid gap-2",children:[O.jsxs("div",{className:"grid grid-cols-3 items-center gap-2",children:[O.jsx(Wn,{htmlFor:"scale",children:"Type"}),O.jsxs(zs,{value:i||"none",onValueChange:D=>s(D),children:[O.jsx(Qi,{className:"col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0",children:O.jsx(Bs,{})}),O.jsx(Ji,{id:"type",children:O.jsxs(dc,{children:[O.jsx(Va,{children:"Option"}),O.jsx(Hn,{value:"number",children:"Number"}),O.jsx(Hn,{value:"date",children:"Date"}),O.jsx(Hn,{value:"none",children:"None"})]})})]})]}),i==="number"&&R(),i==="date"&&C(),i==="number"&&O.jsxs(O.Fragment,{children:[O.jsx(Ng,{}),O.jsx(hM,{colorRanges:a,setColorRanges:l})]}),O.jsx(Ng,{}),O.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[O.jsx(yr,{onClick:P,variant:"secondary",className:"col-span-1 col-start-1 h-8 w-full text-destructive",children:"Reset All"}),O.jsx(yr,{onClick:A,variant:"secondary",className:"col-span-1 col-start-2 h-8 w-full",children:"Reset"}),O.jsx(yr,{onClick:k,variant:"secondary",className:"col-span-1 col-start-3 h-8 w-full",children:"Apply"})]})]})]})})]})}function Tne(e){const t=new Date(e);return!isNaN(t.getTime())}function gM({data:e,card:t}){var R,C,P,A;const[n,r]=m.useState([]),{keys:o}=ar(e),i=ke(k=>k.filteringCards),s=ke(k=>k.themeStyle),a=ke(k=>k.isVisualEditing),l=i==null?void 0:i.find(k=>k.id===t.id),c=(R=t==null?void 0:t.preferences)==null?void 0:R.onClickFilter,{addOrUpdateFilterValues:u,addFilteringCard:f,removeFilterValue:h,removeFilteringCard:g}=Mo(),v=t==null?void 0:t.preferences;function b(k,D){if((D==null?void 0:D.type)==="date"&&Tne(k)){const{locale:I,options:F}=D.options,B=new Date(k);return new Date(B.getTime()).toLocaleDateString(I,F)}if((D==null?void 0:D.type)==="number"){const{locale:I,currency:F,options:B}=D.options;return F?new Intl.NumberFormat(I,{style:"currency",currency:F,...B}).format(k):new Intl.NumberFormat(I,B).format(k)}return k}const x=o.map((k,D)=>({accessorKey:k,header:({column:I})=>{const F=I.getIsSorted();return O.jsxs("div",{className:"flex items-center justify-between gap-2",children:[O.jsxs("div",{className:"flex cursor-pointer items-center",onClick:()=>I.toggleSorting(I.getIsSorted()==="asc"),children:[k,F==="asc"?O.jsx(w1,{className:"ml-2 h-5 w-5"}):F==="desc"?O.jsx(x1,{className:"ml-2 h-5 w-5"}):null]}),a&&O.jsx(Pne,{columnName:I.id,columnIndex:D})]})},cell:({cell:I})=>{var z,Q;const F=I.getValue(),B=(z=v==null?void 0:v.columnSettings)==null?void 0:z.find(W=>W.columnIdx===D),K=b(F,B),Z=ok(F,(Q=B==null?void 0:B.options)==null?void 0:Q.colorRanges);return O.jsx("div",{className:"px-2 py-1",style:{backgroundColor:Z},children:K})}})),w=Ok({data:e,columns:x,getCoreRowModel:Ck(),getPaginationRowModel:Rk(),onSortingChange:r,getSortedRowModel:Ek(),manualPagination:!0,state:{sorting:n}}),_=w.getSelectedRowModel().rows;m.useEffect(()=>{if(_.length===0){if(l){const k=t.id;h(k),g(t)}return}if(c){const{dimensionKeys:k}=ar(e),D=c.map(I=>{const F=k==null?void 0:k[I.columnIndex],B=_.map(Z=>Z.getValue(F));return{filterId:t.id+"-"+F,connectionId:t==null?void 0:t.connectionId,tableName:t.lastSelectedTable,name:F,expression:I.expression,valueType:Pd(B[0]===void 0?"":B[0]),operation:"in",values:B}});u(D),f(t)}},[f,u,t,e,l,c,h,g,_]);function S(k){k.toggleSelected()}return O.jsxs(W1,{className:"",containerClassName:"rounded-md",containerStyle:{borderTopRightRadius:(C=s==null?void 0:s.chart)==null?void 0:C.options.borderRadius,borderTopLeftRadius:(P=s==null?void 0:s.chart)==null?void 0:P.options.borderRadius},onMouseDown:k=>k.stopPropagation(),children:[O.jsx(U1,{children:w.getHeaderGroups().map(k=>O.jsx(bd,{children:k.headers.map((D,I)=>{var F,B,K,Z,z,Q,W;return O.jsx(G1,{style:{backgroundColor:(K=(B=(F=s==null?void 0:s.chart)==null?void 0:F.dataset)==null?void 0:B.backgroundColor)==null?void 0:K[0],color:Bc((Q=(z=(Z=s==null?void 0:s.chart)==null?void 0:Z.dataset)==null?void 0:z.backgroundColor)==null?void 0:Q[0])},className:Ee("sticky -top-[1px] z-50 h-9 bg-muted-foreground px-2 text-background",{"border-x":I>0&&I<k.headers.length-1,"border-l":I===1&&k.headers.length==2},(W=s==null?void 0:s.table)==null?void 0:W.tableHeaderColor),children:D.isPlaceholder?null:Rx(D.column.columnDef.header,D.getContext())},D.id)})},k.id))}),O.jsx(q1,{children:(A=w.getRowModel().rows)!=null&&A.length?w.getRowModel().rows.map((k,D)=>O.jsx(bd,{onClick:()=>S(k),className:Ee("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":k.getIsSelected()&&"selected",children:k.getVisibleCells().map((I,F)=>{var B;return O.jsx(Mg,{onClick:K=>{var z;const Z=((z=window==null?void 0:window.getSelection())==null?void 0:z.toString())||"";(Z==null?void 0:Z.length)>0&&K.stopPropagation()},className:Ee("p-0",{"border-x":F>0&&F<x.length-1||F===1&&x.length==2,"border-l":F==0,"border-r":F===x.length-1,"border-b":D===((B=w.getRowModel().rows)==null?void 0:B.length)-1}),children:Rx(I.column.columnDef.cell,I.getContext())},I.id)})},k.id)):O.jsx(bd,{children:O.jsx(Mg,{colSpan:x.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:mM,setPrototypeOf:LP,isFrozen:Dne,getPrototypeOf:$ne,getOwnPropertyDescriptor:Ane}=Object;let{freeze:wr,seal:Ao,create:vM}=Object,{apply:kx,construct:Mx}=typeof Reflect<"u"&&Reflect;wr||(wr=function(t){return t});Ao||(Ao=function(t){return t});kx||(kx=function(t,n,r){return t.apply(n,r)});Mx||(Mx=function(t,n){return new t(...n)});const Op=uo(Array.prototype.forEach),FP=uo(Array.prototype.pop),Vu=uo(Array.prototype.push),ig=uo(String.prototype.toLowerCase),vy=uo(String.prototype.toString),jP=uo(String.prototype.match),Hu=uo(String.prototype.replace),kne=uo(String.prototype.indexOf),Mne=uo(String.prototype.trim),Uo=uo(Object.prototype.hasOwnProperty),gr=uo(RegExp.prototype.test),Wu=Ine(TypeError);function uo(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 kx(e,t,r)}}function Ine(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Mx(e,n)}}function Tt(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ig;LP&&LP(e,null);let r=t.length;for(;r--;){let o=t[r];if(typeof o=="string"){const i=n(o);i!==o&&(Dne(t)||(t[r]=i),o=i)}e[o]=!0}return e}function Nne(e){for(let t=0;t<e.length;t++)Uo(e,t)||(e[t]=null);return e}function za(e){const t=vM(null);for(const[n,r]of mM(e))Uo(e,n)&&(Array.isArray(r)?t[n]=Nne(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=za(r):t[n]=r);return t}function Uu(e,t){for(;e!==null;){const r=Ane(e,t);if(r){if(r.get)return uo(r.get);if(typeof r.value=="function")return uo(r.value)}e=$ne(e)}function n(){return null}return n}const zP=wr(["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"]),by=wr(["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"]),yy=wr(["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"]),Lne=wr(["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"]),xy=wr(["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"]),Fne=wr(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),BP=wr(["#text"]),VP=wr(["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"]),wy=wr(["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"]),HP=wr(["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"]),Pp=wr(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),jne=Ao(/\{\{[\w\W]*|[\w\W]*\}\}/gm),zne=Ao(/<%[\w\W]*|[\w\W]*%>/gm),Bne=Ao(/\${[\w\W]*}/gm),Vne=Ao(/^data-[\-\w.\u00B7-\uFFFF]/),Hne=Ao(/^aria-[\-\w]+$/),bM=Ao(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Wne=Ao(/^(?:\w+script|data):/i),Une=Ao(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),yM=Ao(/^html$/i),qne=Ao(/^[a-z][.\w]*(-[.\w]+)+$/i);var WP=Object.freeze({__proto__:null,MUSTACHE_EXPR:jne,ERB_EXPR:zne,TMPLIT_EXPR:Bne,DATA_ATTR:Vne,ARIA_ATTR:Hne,IS_ALLOWED_URI:bM,IS_SCRIPT_OR_DATA:Wne,ATTR_WHITESPACE:Une,DOCTYPE_NAME:yM,CUSTOM_ELEMENT:qne});const qu={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Gne=function(){return typeof window>"u"?null:window},Yne=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 xM(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Gne();const t=$e=>xM($e);if(t.version="3.1.6",t.removed=[],!e||!e.document||e.document.nodeType!==qu.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:h,trustedTypes:g}=e,v=l.prototype,b=Uu(v,"cloneNode"),x=Uu(v,"remove"),w=Uu(v,"nextSibling"),_=Uu(v,"childNodes"),S=Uu(v,"parentNode");if(typeof s=="function"){const $e=n.createElement("template");$e.content&&$e.content.ownerDocument&&(n=$e.content.ownerDocument)}let R,C="";const{implementation:P,createNodeIterator:A,createDocumentFragment:k,getElementsByTagName:D}=n,{importNode:I}=r;let F={};t.isSupported=typeof mM=="function"&&typeof S=="function"&&P&&P.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:B,ERB_EXPR:K,TMPLIT_EXPR:Z,DATA_ATTR:z,ARIA_ATTR:Q,IS_SCRIPT_OR_DATA:W,ATTR_WHITESPACE:Y,CUSTOM_ELEMENT:oe}=WP;let{IS_ALLOWED_URI:$}=WP,H=null;const J=Tt({},[...zP,...by,...yy,...xy,...BP]);let N=null;const ce=Tt({},[...VP,...wy,...HP,...Pp]);let le=Object.seal(vM(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}})),de=null,pe=null,ie=!0,te=!0,ae=!1,ye=!0,G=!1,be=!0,_e=!1,Pe=!1,Te=!1,Ue=!1,Be=!1,Ie=!1,Ke=!0,lt=!1;const It="user-content-";let $t=!0,Ht=!1,fe={},Ce=null;const Le=Tt({},["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=Tt({},["audio","video","img","source","image","track"]);let Wt=null;const Zt=Tt({},["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=Tt({},[Kt,vn,ln],vy);let ht=null;const At=["application/xhtml+xml","text/html"],Xt="text/html";let bt=null,Rn=null;const Lo=n.createElement("form"),ms=function(q){return q instanceof RegExp||q instanceof Function},Fo=function(){let q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Rn&&Rn===q)){if((!q||typeof q!="object")&&(q={}),q=za(q),ht=At.indexOf(q.PARSER_MEDIA_TYPE)===-1?Xt:q.PARSER_MEDIA_TYPE,bt=ht==="application/xhtml+xml"?vy:ig,H=Uo(q,"ALLOWED_TAGS")?Tt({},q.ALLOWED_TAGS,bt):J,N=Uo(q,"ALLOWED_ATTR")?Tt({},q.ALLOWED_ATTR,bt):ce,xn=Uo(q,"ALLOWED_NAMESPACES")?Tt({},q.ALLOWED_NAMESPACES,vy):nt,Wt=Uo(q,"ADD_URI_SAFE_ATTR")?Tt(za(Zt),q.ADD_URI_SAFE_ATTR,bt):Zt,Ge=Uo(q,"ADD_DATA_URI_TAGS")?Tt(za(Ze),q.ADD_DATA_URI_TAGS,bt):Ze,Ce=Uo(q,"FORBID_CONTENTS")?Tt({},q.FORBID_CONTENTS,bt):Le,de=Uo(q,"FORBID_TAGS")?Tt({},q.FORBID_TAGS,bt):{},pe=Uo(q,"FORBID_ATTR")?Tt({},q.FORBID_ATTR,bt):{},fe=Uo(q,"USE_PROFILES")?q.USE_PROFILES:!1,ie=q.ALLOW_ARIA_ATTR!==!1,te=q.ALLOW_DATA_ATTR!==!1,ae=q.ALLOW_UNKNOWN_PROTOCOLS||!1,ye=q.ALLOW_SELF_CLOSE_IN_ATTR!==!1,G=q.SAFE_FOR_TEMPLATES||!1,be=q.SAFE_FOR_XML!==!1,_e=q.WHOLE_DOCUMENT||!1,Ue=q.RETURN_DOM||!1,Be=q.RETURN_DOM_FRAGMENT||!1,Ie=q.RETURN_TRUSTED_TYPE||!1,Te=q.FORCE_BODY||!1,Ke=q.SANITIZE_DOM!==!1,lt=q.SANITIZE_NAMED_PROPS||!1,$t=q.KEEP_CONTENT!==!1,Ht=q.IN_PLACE||!1,$=q.ALLOWED_URI_REGEXP||bM,Lt=q.NAMESPACE||ln,le=q.CUSTOM_ELEMENT_HANDLING||{},q.CUSTOM_ELEMENT_HANDLING&&ms(q.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(le.tagNameCheck=q.CUSTOM_ELEMENT_HANDLING.tagNameCheck),q.CUSTOM_ELEMENT_HANDLING&&ms(q.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(le.attributeNameCheck=q.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),q.CUSTOM_ELEMENT_HANDLING&&typeof q.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(le.allowCustomizedBuiltInElements=q.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),G&&(te=!1),Be&&(Ue=!0),fe&&(H=Tt({},BP),N=[],fe.html===!0&&(Tt(H,zP),Tt(N,VP)),fe.svg===!0&&(Tt(H,by),Tt(N,wy),Tt(N,Pp)),fe.svgFilters===!0&&(Tt(H,yy),Tt(N,wy),Tt(N,Pp)),fe.mathMl===!0&&(Tt(H,xy),Tt(N,HP),Tt(N,Pp))),q.ADD_TAGS&&(H===J&&(H=za(H)),Tt(H,q.ADD_TAGS,bt)),q.ADD_ATTR&&(N===ce&&(N=za(N)),Tt(N,q.ADD_ATTR,bt)),q.ADD_URI_SAFE_ATTR&&Tt(Wt,q.ADD_URI_SAFE_ATTR,bt),q.FORBID_CONTENTS&&(Ce===Le&&(Ce=za(Ce)),Tt(Ce,q.FORBID_CONTENTS,bt)),$t&&(H["#text"]=!0),_e&&Tt(H,["html","head","body"]),H.table&&(Tt(H,["tbody"]),delete de.tbody),q.TRUSTED_TYPES_POLICY){if(typeof q.TRUSTED_TYPES_POLICY.createHTML!="function")throw Wu('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof q.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Wu('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');R=q.TRUSTED_TYPES_POLICY,C=R.createHTML("")}else R===void 0&&(R=Yne(g,o)),R!==null&&typeof C=="string"&&(C=R.createHTML(""));wr&&wr(q),Rn=q}},$i=Tt({},["mi","mo","mn","ms","mtext"]),ni=Tt({},["foreignobject","annotation-xml"]),Ai=Tt({},["title","style","font","a","script"]),vs=Tt({},[...by,...yy,...Lne]),ri=Tt({},[...xy,...Fne]),ki=function(q){let me=S(q);(!me||!me.tagName)&&(me={namespaceURI:Lt,tagName:"template"});const Ae=ig(q.tagName),st=ig(me.tagName);return xn[q.namespaceURI]?q.namespaceURI===vn?me.namespaceURI===ln?Ae==="svg":me.namespaceURI===Kt?Ae==="svg"&&(st==="annotation-xml"||$i[st]):!!vs[Ae]:q.namespaceURI===Kt?me.namespaceURI===ln?Ae==="math":me.namespaceURI===vn?Ae==="math"&&ni[st]:!!ri[Ae]:q.namespaceURI===ln?me.namespaceURI===vn&&!ni[st]||me.namespaceURI===Kt&&!$i[st]?!1:!ri[Ae]&&(Ai[Ae]||!vs[Ae]):!!(ht==="application/xhtml+xml"&&xn[q.namespaceURI]):!1},jn=function(q){Vu(t.removed,{element:q});try{S(q).removeChild(q)}catch{x(q)}},oi=function(q,me){try{Vu(t.removed,{attribute:me.getAttributeNode(q),from:me})}catch{Vu(t.removed,{attribute:null,from:me})}if(me.removeAttribute(q),q==="is"&&!N[q])if(Ue||Be)try{jn(me)}catch{}else try{me.setAttribute(q,"")}catch{}},bs=function(q){let me=null,Ae=null;if(Te)q="<remove></remove>"+q;else{const ft=jP(q,/^[\r\n\t ]+/);Ae=ft&&ft[0]}ht==="application/xhtml+xml"&&Lt===ln&&(q='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+q+"</body></html>");const st=R?R.createHTML(q):q;if(Lt===ln)try{me=new h().parseFromString(st,ht)}catch{}if(!me||!me.documentElement){me=P.createDocument(Lt,"template",null);try{me.documentElement.innerHTML=tn?C:st}catch{}}const bn=me.body||me.documentElement;return q&&Ae&&bn.insertBefore(n.createTextNode(Ae),bn.childNodes[0]||null),Lt===ln?D.call(me,_e?"html":"body")[0]:_e?me.documentElement:bn},ys=function(q){return A.call(q.ownerDocument||q,q,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},T=function(q){return q instanceof f&&(typeof q.nodeName!="string"||typeof q.textContent!="string"||typeof q.removeChild!="function"||!(q.attributes instanceof u)||typeof q.removeAttribute!="function"||typeof q.setAttribute!="function"||typeof q.namespaceURI!="string"||typeof q.insertBefore!="function"||typeof q.hasChildNodes!="function")},ee=function(q){return typeof a=="function"&&q instanceof a},ue=function(q,me,Ae){F[q]&&Op(F[q],st=>{st.call(t,me,Ae,Rn)})},Oe=function(q){let me=null;if(ue("beforeSanitizeElements",q,null),T(q))return jn(q),!0;const Ae=bt(q.nodeName);if(ue("uponSanitizeElement",q,{tagName:Ae,allowedTags:H}),q.hasChildNodes()&&!ee(q.firstElementChild)&&gr(/<[/\w]/g,q.innerHTML)&&gr(/<[/\w]/g,q.textContent)||q.nodeType===qu.progressingInstruction||be&&q.nodeType===qu.comment&&gr(/<[/\w]/g,q.data))return jn(q),!0;if(!H[Ae]||de[Ae]){if(!de[Ae]&&qe(Ae)&&(le.tagNameCheck instanceof RegExp&&gr(le.tagNameCheck,Ae)||le.tagNameCheck instanceof Function&&le.tagNameCheck(Ae)))return!1;if($t&&!Ce[Ae]){const st=S(q)||q.parentNode,bn=_(q)||q.childNodes;if(bn&&st){const ft=bn.length;for(let tr=ft-1;tr>=0;--tr){const po=b(bn[tr],!0);po.__removalCount=(q.__removalCount||0)+1,st.insertBefore(po,w(q))}}}return jn(q),!0}return q instanceof l&&!ki(q)||(Ae==="noscript"||Ae==="noembed"||Ae==="noframes")&&gr(/<\/no(script|embed|frames)/i,q.innerHTML)?(jn(q),!0):(G&&q.nodeType===qu.text&&(me=q.textContent,Op([B,K,Z],st=>{me=Hu(me,st," ")}),q.textContent!==me&&(Vu(t.removed,{element:q.cloneNode()}),q.textContent=me)),ue("afterSanitizeElements",q,null),!1)},He=function(q,me,Ae){if(Ke&&(me==="id"||me==="name")&&(Ae in n||Ae in Lo))return!1;if(!(te&&!pe[me]&&gr(z,me))){if(!(ie&&gr(Q,me))){if(!N[me]||pe[me]){if(!(qe(q)&&(le.tagNameCheck instanceof RegExp&&gr(le.tagNameCheck,q)||le.tagNameCheck instanceof Function&&le.tagNameCheck(q))&&(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,Ae)||le.tagNameCheck instanceof Function&&le.tagNameCheck(Ae))))return!1}else if(!Wt[me]){if(!gr($,Hu(Ae,Y,""))){if(!((me==="src"||me==="xlink:href"||me==="href")&&q!=="script"&&kne(Ae,"data:")===0&&Ge[q])){if(!(ae&&!gr(W,Hu(Ae,Y,"")))){if(Ae)return!1}}}}}}return!0},qe=function(q){return q!=="annotation-xml"&&jP(q,oe)},ze=function(q){ue("beforeSanitizeAttributes",q,null);const{attributes:me}=q;if(!me)return;const Ae={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:N};let st=me.length;for(;st--;){const bn=me[st],{name:ft,namespaceURI:tr,value:po}=bn,ya=bt(ft);let zn=ft==="value"?po:Mne(po);if(Ae.attrName=ya,Ae.attrValue=zn,Ae.keepAttr=!0,Ae.forceKeepAttr=void 0,ue("uponSanitizeAttribute",q,Ae),zn=Ae.attrValue,be&&gr(/((--!?|])>)|<\/(style|title)/i,zn)){oi(ft,q);continue}if(Ae.forceKeepAttr||(oi(ft,q),!Ae.keepAttr))continue;if(!ye&&gr(/\/>/i,zn)){oi(ft,q);continue}G&&Op([B,K,Z],hu=>{zn=Hu(zn,hu," ")});const fu=bt(q.nodeName);if(He(fu,ya,zn)){if(lt&&(ya==="id"||ya==="name")&&(oi(ft,q),zn=It+zn),R&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!tr)switch(g.getAttributeType(fu,ya)){case"TrustedHTML":{zn=R.createHTML(zn);break}case"TrustedScriptURL":{zn=R.createScriptURL(zn);break}}try{tr?q.setAttributeNS(tr,ft,zn):q.setAttribute(ft,zn),T(q)?jn(q):FP(t.removed)}catch{}}}ue("afterSanitizeAttributes",q,null)},Fe=function $e(q){let me=null;const Ae=ys(q);for(ue("beforeSanitizeShadowDOM",q,null);me=Ae.nextNode();)ue("uponSanitizeShadowNode",me,null),!Oe(me)&&(me.content instanceof i&&$e(me.content),ze(me));ue("afterSanitizeShadowDOM",q,null)};return t.sanitize=function($e){let q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},me=null,Ae=null,st=null,bn=null;if(tn=!$e,tn&&($e="<!-->"),typeof $e!="string"&&!ee($e))if(typeof $e.toString=="function"){if($e=$e.toString(),typeof $e!="string")throw Wu("dirty is not a string, aborting")}else throw Wu("toString is not a function");if(!t.isSupported)return $e;if(Pe||Fo(q),t.removed=[],typeof $e=="string"&&(Ht=!1),Ht){if($e.nodeName){const po=bt($e.nodeName);if(!H[po]||de[po])throw Wu("root node is forbidden and cannot be sanitized in-place")}}else if($e instanceof a)me=bs("<!---->"),Ae=me.ownerDocument.importNode($e,!0),Ae.nodeType===qu.element&&Ae.nodeName==="BODY"||Ae.nodeName==="HTML"?me=Ae:me.appendChild(Ae);else{if(!Ue&&!G&&!_e&&$e.indexOf("<")===-1)return R&&Ie?R.createHTML($e):$e;if(me=bs($e),!me)return Ue?null:Ie?C:""}me&&Te&&jn(me.firstChild);const ft=ys(Ht?$e:me);for(;st=ft.nextNode();)Oe(st)||(st.content instanceof i&&Fe(st.content),ze(st));if(Ht)return $e;if(Ue){if(Be)for(bn=k.call(me.ownerDocument);me.firstChild;)bn.appendChild(me.firstChild);else bn=me;return(N.shadowroot||N.shadowrootmode)&&(bn=I.call(r,bn,!0)),bn}let tr=_e?me.outerHTML:me.innerHTML;return _e&&H["!doctype"]&&me.ownerDocument&&me.ownerDocument.doctype&&me.ownerDocument.doctype.name&&gr(yM,me.ownerDocument.doctype.name)&&(tr="<!DOCTYPE "+me.ownerDocument.doctype.name+`>
|
|
315
|
+
`)},ite=0,tc=[];function ste(e){var t=V.useRef([]),n=V.useRef([0,0]),r=V.useRef(),o=V.useState(ite++)[0],i=V.useState(function(){return e_()})[0],s=V.useRef(e);V.useEffect(function(){s.current=e},[e]),V.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var b=$k([e.lockRef.current],(e.shards||[]).map(DP),!0).filter(Boolean);return b.forEach(function(x){return x.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),b.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=V.useCallback(function(b,x){if("touches"in b&&b.touches.length===2)return!s.current.allowPinchZoom;var w=Ep(b),_=n.current,S="deltaX"in b?b.deltaX:_[0]-w[0],R="deltaY"in b?b.deltaY:_[1]-w[1],C,P=b.target,A=Math.abs(S)>Math.abs(R)?"h":"v";if("touches"in b&&A==="h"&&P.type==="range")return!1;var k=PP(A,P);if(!k)return!0;if(k?C=A:(C=A==="v"?"h":"v",k=PP(A,P)),!k)return!1;if(!r.current&&"changedTouches"in b&&(S||R)&&(r.current=C),!C)return!0;var D=r.current||C;return nte(D,x,b,D==="h"?S:R,!0)},[]),l=V.useCallback(function(b){var x=b;if(!(!tc.length||tc[tc.length-1]!==i)){var w="deltaY"in x?TP(x):Ep(x),_=t.current.filter(function(C){return C.name===x.type&&C.target===x.target&&rte(C.delta,w)})[0];if(_&&_.should){x.cancelable&&x.preventDefault();return}if(!_){var S=(s.current.shards||[]).map(DP).filter(Boolean).filter(function(C){return C.contains(x.target)}),R=S.length>0?a(x,S[0]):!s.current.noIsolation;R&&x.cancelable&&x.preventDefault()}}},[]),c=V.useCallback(function(b,x,w,_){var S={name:b,delta:x,target:w,should:_};t.current.push(S),setTimeout(function(){t.current=t.current.filter(function(R){return R!==S})},1)},[]),u=V.useCallback(function(b){n.current=Ep(b),r.current=void 0},[]),f=V.useCallback(function(b){c(b.type,TP(b),b.target,a(b,e.lockRef.current))},[]),h=V.useCallback(function(b){c(b.type,Ep(b),b.target,a(b,e.lockRef.current))},[]);V.useEffect(function(){return tc.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",l,ec),document.addEventListener("touchmove",l,ec),document.addEventListener("touchstart",u,ec),function(){tc=tc.filter(function(b){return b!==i}),document.removeEventListener("wheel",l,ec),document.removeEventListener("touchmove",l,ec),document.removeEventListener("touchstart",u,ec)}},[]);var g=e.removeScrollBar,v=e.inert;return V.createElement(V.Fragment,null,v?V.createElement(i,{styles:ote(o)}):null,g?V.createElement(Lk,{gapMode:"margin"}):null)}const ate=Ik(Nk,ste);var Bk=V.forwardRef(function(e,t){return V.createElement(Lm,lr({},e,{ref:t,sideCar:ate}))});Bk.classNames=Lm.classNames;const t_=Bk,lte=[" ","Enter","ArrowUp","ArrowDown"],cte=[" ","Enter"],Fm="Select",[jm,zm,ute]=lm(Fm),[au,pye]=Zn(Fm,[ute,Ti]),n_=Ti(),[dte,Rl]=au(Fm),[fte,hte]=au(Fm),pte=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:h,required:g}=e,v=n_(t),[b,x]=m.useState(null),[w,_]=m.useState(null),[S,R]=m.useState(!1),C=_l(c),[P=!1,A]=xr({prop:r,defaultProp:o,onChange:i}),[k,D]=xr({prop:s,defaultProp:a,onChange:l}),I=m.useRef(null),F=b?!!b.closest("form"):!0,[B,K]=m.useState(new Set),Z=Array.from(B).map(z=>z.props.value).join(";");return m.createElement(zf,v,m.createElement(dte,{required:g,scope:t,trigger:b,onTriggerChange:x,valueNode:w,onValueNodeChange:_,valueNodeHasChildren:S,onValueNodeHasChildrenChange:R,contentId:Jo(),value:k,onValueChange:D,open:P,onOpenChange:A,dir:C,triggerPointerDownPosRef:I,disabled:h},m.createElement(jm.Provider,{scope:t},m.createElement(fte,{scope:e.__scopeSelect,onNativeOptionAdd:m.useCallback(z=>{K(Q=>new Set(Q).add(z))},[]),onNativeOptionRemove:m.useCallback(z=>{K(Q=>{const W=new Set(Q);return W.delete(z),W})},[])},n)),F?m.createElement(qk,{key:Z,"aria-hidden":!0,required:g,tabIndex:-1,name:u,autoComplete:f,value:k,onChange:z=>D(z.target.value),disabled:h},k===void 0?m.createElement("option",{value:""}):null,Array.from(B)):null))},gte="SelectTrigger",mte=m.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=n_(n),s=Rl(gte,n),a=s.disabled||r,l=_t(t,s.onTriggerChange),c=zm(n),[u,f,h]=Gk(v=>{const b=c().filter(_=>!_.disabled),x=b.find(_=>_.value===s.value),w=Yk(b,v,x);w!==void 0&&s.onValueChange(w.value)}),g=()=>{a||(s.onOpenChange(!0),h())};return m.createElement(Bf,he({asChild:!0},i),m.createElement(Qe.button,he({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":Uk(s.value)?"":void 0},o,{ref:l,onClick:Me(o.onClick,v=>{v.currentTarget.focus()}),onPointerDown:Me(o.onPointerDown,v=>{const b=v.target;b.hasPointerCapture(v.pointerId)&&b.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&(g(),s.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)},v.preventDefault())}),onKeyDown:Me(o.onKeyDown,v=>{const b=u.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&f(v.key),!(b&&v.key===" ")&<e.includes(v.key)&&(g(),v.preventDefault())})})))}),vte="SelectValue",bte=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:s="",...a}=e,l=Rl(vte,n),{onValueNodeHasChildrenChange:c}=l,u=i!==void 0,f=_t(t,l.onValueNodeChange);return ur(()=>{c(u)},[c,u]),m.createElement(Qe.span,he({},a,{ref:f,style:{pointerEvents:"none"}}),Uk(l.value)?m.createElement(m.Fragment,null,s):i)}),yte=m.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return m.createElement(Qe.span,he({"aria-hidden":!0},o,{ref:t}),r||"▼")}),xte=e=>m.createElement(A1,he({asChild:!0},e)),Jc="SelectContent",wte=m.forwardRef((e,t)=>{const n=Rl(Jc,e.__scopeSelect),[r,o]=m.useState();if(ur(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?ko.createPortal(m.createElement(Vk,{scope:e.__scopeSelect},m.createElement(jm.Slot,{scope:e.__scopeSelect},m.createElement("div",null,e.children))),i):null}return m.createElement(_te,he({},e,{ref:t}))}),Ki=10,[Vk,Ol]=au(Jc),_te=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:h,collisionPadding:g,sticky:v,hideWhenDetached:b,avoidCollisions:x,...w}=e,_=Rl(Jc,n),[S,R]=m.useState(null),[C,P]=m.useState(null),A=_t(t,pe=>R(pe)),[k,D]=m.useState(null),[I,F]=m.useState(null),B=zm(n),[K,Z]=m.useState(!1),z=m.useRef(!1);m.useEffect(()=>{if(S)return Nm(S)},[S]),Q1();const Q=m.useCallback(pe=>{const[ie,...te]=B().map(G=>G.ref.current),[ae]=te.slice(-1),ye=document.activeElement;for(const G of pe)if(G===ye||(G==null||G.scrollIntoView({block:"nearest"}),G===ie&&C&&(C.scrollTop=0),G===ae&&C&&(C.scrollTop=C.scrollHeight),G==null||G.focus(),document.activeElement!==ye))return},[B,C]),W=m.useCallback(()=>Q([k,S]),[Q,k,S]);m.useEffect(()=>{K&&W()},[K,W]);const{onOpenChange:Y,triggerPointerDownPosRef:oe}=_;m.useEffect(()=>{if(S){let pe={x:0,y:0};const ie=ae=>{var ye,G,be,_e;pe={x:Math.abs(Math.round(ae.pageX)-((ye=(G=oe.current)===null||G===void 0?void 0:G.x)!==null&&ye!==void 0?ye:0)),y:Math.abs(Math.round(ae.pageY)-((be=(_e=oe.current)===null||_e===void 0?void 0:_e.y)!==null&&be!==void 0?be:0))}},te=ae=>{pe.x<=10&&pe.y<=10?ae.preventDefault():S.contains(ae.target)||Y(!1),document.removeEventListener("pointermove",ie),oe.current=null};return oe.current!==null&&(document.addEventListener("pointermove",ie),document.addEventListener("pointerup",te,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ie),document.removeEventListener("pointerup",te,{capture:!0})}}},[S,Y,oe]),m.useEffect(()=>{const pe=()=>Y(!1);return window.addEventListener("blur",pe),window.addEventListener("resize",pe),()=>{window.removeEventListener("blur",pe),window.removeEventListener("resize",pe)}},[Y]);const[$,H]=Gk(pe=>{const ie=B().filter(ye=>!ye.disabled),te=ie.find(ye=>ye.ref.current===document.activeElement),ae=Yk(ie,pe,te);ae&&setTimeout(()=>ae.ref.current.focus())}),J=m.useCallback((pe,ie,te)=>{const ae=!z.current&&!te;(_.value!==void 0&&_.value===ie||ae)&&(D(pe),ae&&(z.current=!0))},[_.value]),N=m.useCallback(()=>S==null?void 0:S.focus(),[S]),ce=m.useCallback((pe,ie,te)=>{const ae=!z.current&&!te;(_.value!==void 0&&_.value===ie||ae)&&F(pe)},[_.value]),le=r==="popper"?$P:Ste,de=le===$P?{side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:f,collisionBoundary:h,collisionPadding:g,sticky:v,hideWhenDetached:b,avoidCollisions:x}:{};return m.createElement(Vk,{scope:n,content:S,viewport:C,onViewportChange:P,itemRefCallback:J,selectedItem:k,onItemLeave:N,itemTextRefCallback:ce,focusSelectedItem:W,selectedItemText:I,position:r,isPositioned:K,searchRef:$},m.createElement(t_,{as:Tk,allowPinchZoom:!0},m.createElement(J1,{asChild:!0,trapped:_.open,onMountAutoFocus:pe=>{pe.preventDefault()},onUnmountAutoFocus:Me(o,pe=>{var ie;(ie=_.trigger)===null||ie===void 0||ie.focus({preventScroll:!0}),pe.preventDefault()})},m.createElement(Ff,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:pe=>pe.preventDefault(),onDismiss:()=>_.onOpenChange(!1)},m.createElement(le,he({role:"listbox",id:_.contentId,"data-state":_.open?"open":"closed",dir:_.dir,onContextMenu:pe=>pe.preventDefault()},w,de,{onPlaced:()=>Z(!0),ref:A,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:Me(w.onKeyDown,pe=>{const ie=pe.ctrlKey||pe.altKey||pe.metaKey;if(pe.key==="Tab"&&pe.preventDefault(),!ie&&pe.key.length===1&&H(pe.key),["ArrowUp","ArrowDown","Home","End"].includes(pe.key)){let ae=B().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,G=ae.indexOf(ye);ae=ae.slice(G+1)}setTimeout(()=>Q(ae)),pe.preventDefault()}})}))))))}),Ste=m.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=Rl(Jc,n),s=Ol(Jc,n),[a,l]=m.useState(null),[c,u]=m.useState(null),f=_t(t,A=>u(A)),h=zm(n),g=m.useRef(!1),v=m.useRef(!0),{viewport:b,selectedItem:x,selectedItemText:w,focusSelectedItem:_}=s,S=m.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&c&&b&&x&&w){const A=i.trigger.getBoundingClientRect(),k=c.getBoundingClientRect(),D=i.valueNode.getBoundingClientRect(),I=w.getBoundingClientRect();if(i.dir!=="rtl"){const ye=I.left-k.left,G=D.left-ye,be=A.left-G,_e=A.width+be,Pe=Math.max(_e,k.width),Te=window.innerWidth-Ki,Ue=Ox(G,[Ki,Te-Pe]);a.style.minWidth=_e+"px",a.style.left=Ue+"px"}else{const ye=k.right-I.right,G=window.innerWidth-D.right-ye,be=window.innerWidth-A.right-G,_e=A.width+be,Pe=Math.max(_e,k.width),Te=window.innerWidth-Ki,Ue=Ox(G,[Ki,Te-Pe]);a.style.minWidth=_e+"px",a.style.right=Ue+"px"}const F=h(),B=window.innerHeight-Ki*2,K=b.scrollHeight,Z=window.getComputedStyle(c),z=parseInt(Z.borderTopWidth,10),Q=parseInt(Z.paddingTop,10),W=parseInt(Z.borderBottomWidth,10),Y=parseInt(Z.paddingBottom,10),oe=z+Q+K+Y+W,$=Math.min(x.offsetHeight*5,oe),H=window.getComputedStyle(b),J=parseInt(H.paddingTop,10),N=parseInt(H.paddingBottom,10),ce=A.top+A.height/2-Ki,le=B-ce,de=x.offsetHeight/2,pe=x.offsetTop+de,ie=z+Q+pe,te=oe-ie;if(ie<=ce){const ye=x===F[F.length-1].ref.current;a.style.bottom="0px";const G=c.clientHeight-b.offsetTop-b.offsetHeight,be=Math.max(le,de+(ye?N:0)+G+W),_e=ie+be;a.style.height=_e+"px"}else{const ye=x===F[0].ref.current;a.style.top="0px";const be=Math.max(ce,z+b.offsetTop+(ye?J:0)+de)+te;a.style.height=be+"px",b.scrollTop=ie-ce+b.offsetTop}a.style.margin=`${Ki}px 0`,a.style.minHeight=$+"px",a.style.maxHeight=B+"px",r==null||r(),requestAnimationFrame(()=>g.current=!0)}},[h,i.trigger,i.valueNode,a,c,b,x,w,i.dir,r]);ur(()=>S(),[S]);const[R,C]=m.useState();ur(()=>{c&&C(window.getComputedStyle(c).zIndex)},[c]);const P=m.useCallback(A=>{A&&v.current===!0&&(S(),_==null||_(),v.current=!1)},[S,_]);return m.createElement(Cte,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:g,onScrollButtonChange:P},m.createElement("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:R}},m.createElement(Qe.div,he({},o,{ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}}))))}),$P=m.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Ki,...i}=e,s=n_(n);return m.createElement(Vf,he({},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)"}}))}),[Cte,r_]=au(Jc,{}),AP="SelectViewport",Ete=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Ol(AP,n),i=r_(AP,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(jm.Slot,{scope:n},m.createElement(Qe.div,he({"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 h=Math.abs(a.current-c.scrollTop);if(h>0){const g=window.innerHeight-Ki*2,v=parseFloat(u.style.minHeight),b=parseFloat(u.style.height),x=Math.max(v,b);if(x<g){const w=x+h,_=Math.min(g,w),S=w-_;u.style.height=_+"px",u.style.bottom==="0px"&&(c.scrollTop=S>0?S:0,u.style.justifyContent="flex-end")}}}a.current=c.scrollTop})}))))}),Rte="SelectGroup",[Ote,Pte]=au(Rte),Tte=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Jo();return m.createElement(Ote,{scope:n,id:o},m.createElement(Qe.div,he({role:"group","aria-labelledby":o},r,{ref:t})))}),Dte="SelectLabel",$te=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Pte(Dte,n);return m.createElement(Qe.div,he({id:o.id},r,{ref:t}))}),Dx="SelectItem",[Ate,Hk]=au(Dx),kte=m.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...s}=e,a=Rl(Dx,n),l=Ol(Dx,n),c=a.value===r,[u,f]=m.useState(i??""),[h,g]=m.useState(!1),v=_t(t,w=>{var _;return(_=l.itemRefCallback)===null||_===void 0?void 0:_.call(l,w,r,o)}),b=Jo(),x=()=>{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(Ate,{scope:n,value:r,disabled:o,textId:b,isSelected:c,onItemTextChange:m.useCallback(w=>{f(_=>{var S;return _||((S=w==null?void 0:w.textContent)!==null&&S!==void 0?S:"").trim()})},[])},m.createElement(jm.ItemSlot,{scope:n,value:r,disabled:o,textValue:u},m.createElement(Qe.div,he({role:"option","aria-labelledby":b,"data-highlighted":h?"":void 0,"aria-selected":c&&h,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1},s,{ref:v,onFocus:Me(s.onFocus,()=>g(!0)),onBlur:Me(s.onBlur,()=>g(!1)),onPointerUp:Me(s.onPointerUp,x),onPointerMove:Me(s.onPointerMove,w=>{if(o){var _;(_=l.onItemLeave)===null||_===void 0||_.call(l)}else w.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Me(s.onPointerLeave,w=>{if(w.currentTarget===document.activeElement){var _;(_=l.onItemLeave)===null||_===void 0||_.call(l)}}),onKeyDown:Me(s.onKeyDown,w=>{var _;((_=l.searchRef)===null||_===void 0?void 0:_.current)!==""&&w.key===" "||(cte.includes(w.key)&&x(),w.key===" "&&w.preventDefault())})}))))}),Rp="SelectItemText",Mte=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,s=Rl(Rp,n),a=Ol(Rp,n),l=Hk(Rp,n),c=hte(Rp,n),[u,f]=m.useState(null),h=_t(t,w=>f(w),l.onItemTextChange,w=>{var _;return(_=a.itemTextRefCallback)===null||_===void 0?void 0:_.call(a,w,l.value,l.disabled)}),g=u==null?void 0:u.textContent,v=m.useMemo(()=>m.createElement("option",{key:l.value,value:l.value,disabled:l.disabled},g),[l.disabled,l.value,g]),{onNativeOptionAdd:b,onNativeOptionRemove:x}=c;return ur(()=>(b(v),()=>x(v)),[b,x,v]),m.createElement(m.Fragment,null,m.createElement(Qe.span,he({id:l.textId},i,{ref:h})),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?ko.createPortal(i.children,s.valueNode):null)}),Ite="SelectItemIndicator",Nte=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Hk(Ite,n).isSelected?m.createElement(Qe.span,he({"aria-hidden":!0},r,{ref:t})):null}),kP="SelectScrollUpButton",Lte=m.forwardRef((e,t)=>{const n=Ol(kP,e.__scopeSelect),r=r_(kP,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(Wk,he({},e,{ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}})):null}),MP="SelectScrollDownButton",Fte=m.forwardRef((e,t)=>{const n=Ol(MP,e.__scopeSelect),r=r_(MP,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(Wk,he({},e,{ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}})):null}),Wk=m.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=Ol("SelectScrollButton",n),s=m.useRef(null),a=zm(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,he({"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()})}))}),jte=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return m.createElement(Qe.div,he({"aria-hidden":!0},r,{ref:t}))});function Uk(e){return e===""||e===void 0}const qk=m.forwardRef((e,t)=>{const{value:n,...r}=e,o=m.useRef(null),i=_t(t,o),s=Im(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(JA,{asChild:!0},m.createElement("select",he({},r,{ref:i,defaultValue:n})))});qk.displayName="BubbleSelect";function Gk(e){const t=Ln(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 Yk(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=zte(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 zte(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const Bte=pte,Kk=mte,Vte=bte,Hte=yte,Wte=xte,Xk=wte,Ute=Ete,qte=Tte,Qk=$te,Jk=kte,Gte=Mte,Yte=Nte,Zk=Lte,eM=Fte,tM=jte,zs=Bte,dc=qte,Bs=Vte,Qi=V.forwardRef(({className:e,children:t,...n},r)=>O.jsxs(Kk,{ref:r,className:Ee("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,O.jsx(Hte,{asChild:!0,children:O.jsx(Om,{className:"h-4 w-4 opacity-50"})})]}));Qi.displayName=Kk.displayName;const nM=V.forwardRef(({className:e,...t},n)=>O.jsx(Zk,{ref:n,className:Ee("flex cursor-default items-center justify-center py-1",e),...t,children:O.jsx(KX,{className:"h-4 w-4"})}));nM.displayName=Zk.displayName;const rM=V.forwardRef(({className:e,...t},n)=>O.jsx(eM,{ref:n,className:Ee("flex cursor-default items-center justify-center py-1",e),...t,children:O.jsx(Om,{className:"h-4 w-4"})}));rM.displayName=eM.displayName;const Ji=V.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>O.jsx(Wte,{children:O.jsx("div",{id:"semaphor-scope",children:O.jsxs(Xk,{ref:o,className:Ee("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:[O.jsx(nM,{}),O.jsx(Ute,{className:Ee("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),O.jsx(rM,{})]})})}));Ji.displayName=Xk.displayName;const Va=V.forwardRef(({className:e,...t},n)=>O.jsx(Qk,{ref:n,className:Ee("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Va.displayName=Qk.displayName;const Hn=V.forwardRef(({className:e,children:t,...n},r)=>O.jsxs(Jk,{ref:r,className:Ee("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:[O.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:O.jsx(Yte,{children:O.jsx(Lf,{className:"h-4 w-4"})})}),O.jsx(Gte,{children:t})]}));Hn.displayName=Jk.displayName;const Ng=V.forwardRef(({className:e,...t},n)=>O.jsx(tM,{ref:n,className:Ee("-mx-1 my-1 h-px bg-muted",e),...t}));Ng.displayName=tM.displayName;function Kte(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Xte(...e){return t=>e.forEach(n=>Kte(n,t))}var Bm=V.forwardRef((e,t)=>{const{children:n,...r}=e,o=V.Children.toArray(n),i=o.find(Qte);if(i){const s=i.props.children,a=o.map(l=>l===i?V.Children.count(s)>1?V.Children.only(null):V.isValidElement(s)?s.props.children:null:l);return O.jsx($x,{...r,ref:t,children:V.isValidElement(s)?V.cloneElement(s,void 0,a):null})}return O.jsx($x,{...r,ref:t,children:n})});Bm.displayName="Slot";var $x=V.forwardRef((e,t)=>{const{children:n,...r}=e;if(V.isValidElement(n)){const o=Zte(n);return V.cloneElement(n,{...Jte(r,n.props),ref:t?Xte(t,o):o})}return V.Children.count(n)>1?V.Children.only(null):null});$x.displayName="SlotClone";var oM=({children:e})=>O.jsx(O.Fragment,{children:e});function Qte(e){return V.isValidElement(e)&&e.type===oM}function Jte(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 Zte(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 IP=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,NP=cg,o_=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return NP(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 h=IP(u)||IP(f);return o[c][h]}),a=n&&Object.entries(n).reduce((c,u)=>{let[f,h]=u;return h===void 0||(c[f]=h),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:f,className:h,...g}=u;return Object.entries(g).every(v=>{let[b,x]=v;return Array.isArray(x)?x.includes({...i,...a}[b]):{...i,...a}[b]===x})?[...c,f,h]:c},[]);return NP(e,s,l,n==null?void 0:n.class,n==null?void 0:n.className)},Bd=o_("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"}}),yr=V.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},i)=>{const s=r?Bm:"button";return O.jsx(s,{className:Ee(Bd({variant:t,size:n,className:e})),ref:i,...o})});yr.displayName="Button";const ene=m.forwardRef((e,t)=>m.createElement(Qe.label,he({},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()}}))),iM=ene,tne=o_("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Wn=V.forwardRef(({className:e,...t},n)=>O.jsx(iM,{ref:n,className:Ee(tne(),e),...t}));Wn.displayName=iM.displayName;const sM=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(rne);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(Ax,he({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(Ax,he({},r,{ref:t}),n)});sM.displayName="Slot";const Ax=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...one(r,n.props),ref:t?cs(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});Ax.displayName="SlotClone";const nne=({children:e})=>m.createElement(m.Fragment,null,e);function rne(e){return m.isValidElement(e)&&e.type===nne}function one(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 aM="Popover",[lM,gye]=Zn(aM,[Ti]),i_=Ti(),[ine,lu]=lM(aM),sne=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!1}=e,a=i_(t),l=m.useRef(null),[c,u]=m.useState(!1),[f=!1,h]=xr({prop:r,defaultProp:o,onChange:i});return m.createElement(zf,a,m.createElement(ine,{scope:t,contentId:Jo(),triggerRef:l,open:f,onOpenChange:h,onOpenToggle:m.useCallback(()=>h(g=>!g),[h]),hasCustomAnchor:c,onCustomAnchorAdd:m.useCallback(()=>u(!0),[]),onCustomAnchorRemove:m.useCallback(()=>u(!1),[]),modal:s},n))},ane="PopoverTrigger",lne=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=lu(ane,n),i=i_(n),s=_t(t,o.triggerRef),a=m.createElement(Qe.button,he({type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":dM(o.open)},r,{ref:s,onClick:Me(e.onClick,o.onOpenToggle)}));return o.hasCustomAnchor?a:m.createElement(Bf,he({asChild:!0},i),a)}),cM="PopoverPortal",[cne,une]=lM(cM,{forceMount:void 0}),dne=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,i=lu(cM,t);return m.createElement(cne,{scope:t,forceMount:n},m.createElement(er,{present:n||i.open},m.createElement(A1,{asChild:!0,container:o},r)))},Vd="PopoverContent",fne=m.forwardRef((e,t)=>{const n=une(Vd,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,i=lu(Vd,e.__scopePopover);return m.createElement(er,{present:r||i.open},i.modal?m.createElement(hne,he({},o,{ref:t})):m.createElement(pne,he({},o,{ref:t})))}),hne=m.forwardRef((e,t)=>{const n=lu(Vd,e.__scopePopover),r=m.useRef(null),o=_t(t,r),i=m.useRef(!1);return m.useEffect(()=>{const s=r.current;if(s)return Nm(s)},[]),m.createElement(t_,{as:sM,allowPinchZoom:!0},m.createElement(uM,he({},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})})))}),pne=m.forwardRef((e,t)=>{const n=lu(Vd,e.__scopePopover),r=m.useRef(!1),o=m.useRef(!1);return m.createElement(uM,he({},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()}}))}),uM=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,h=lu(Vd,n),g=i_(n);return Q1(),m.createElement(J1,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i},m.createElement(Ff,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>h.onOpenChange(!1)},m.createElement(Vf,he({"data-state":dM(h.open),role:"dialog",id:h.contentId},g,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 dM(e){return e?"open":"closed"}const gne=sne,mne=lne,vne=dne,fM=fne,Vm=gne,Hm=mne,Hf=V.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>O.jsx(vne,{children:O.jsx("div",{id:"semaphor-scope",children:O.jsx(fM,{ref:o,align:t,sideOffset:n,className:Ee("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})})}));Hf.displayName=fM.displayName;function bne(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 xc=V.forwardRef(({className:e,type:t,...n},r)=>O.jsx("input",{type:t,className:Ee("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}));xc.displayName="Input";function hM({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 O.jsxs("div",{className:"space-y-3",children:[O.jsxs("div",{className:"flex items-center gap-2",children:[O.jsx(Wn,{children:"Color Range"}),O.jsx(yr,{onClick:i,variant:"secondary",className:"h-5 p-1 text-muted-foreground",children:O.jsx(C1,{className:"size-3"})})]}),e.map((s,a)=>O.jsxs("div",{className:"flex items-center gap-2 px-2",children:[O.jsx(xc,{onChange:l=>r(a,"start",l.target.value),value:s.start,className:Ee(`h-7 ${Yp}`)}),O.jsx("span",{children:"-"}),O.jsx(xc,{value:s.end,onChange:l=>r(a,"end",l.target.value),className:Ee(`h-7 ${Yp}`)}),O.jsx(xc,{onChange:l=>r(a,"color",l.target.value),value:s.color,className:Ee(`h-7 min-w-14 p-0 ${Yp}`),type:"color",list:"presetColors"}),O.jsxs("datalist",{id:"presetColors",children:[O.jsx("option",{children:Bt.green[600]}),O.jsx("option",{children:Bt.red[500]}),O.jsx("option",{children:Bt.yellow[400]}),O.jsx("option",{children:Bt.orange[500]})]}),O.jsx(yr,{onClick:()=>o(a),variant:"secondary",className:"h-5 p-1 text-muted-foreground",children:O.jsx(Pm,{className:"size-3"})})]},a))]})}const yne=m.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r=!1,onPressedChange:o,...i}=e,[s=!1,a]=xr({prop:n,onChange:o,defaultProp:r});return m.createElement(Qe.button,he({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)})}))}),pM=yne,xne=o_("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"}}),s_=V.forwardRef(({className:e,variant:t,size:n,...r},o)=>O.jsx(pM,{ref:o,className:Ee(xne({variant:t,size:n,className:e})),...r}));s_.displayName=pM.displayName;function wne(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 _ne(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 Sne(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 Cne(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 Ene(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 Rne(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 One(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 Pne({columnIndex:e,columnName:t}){const[n,r]=m.useState(!1),o=Ar(D=>{var I;return(I=D.card)==null?void 0:I.preferences}),[i,s]=m.useState(wne(o,e)),[a,l]=m.useState(Rne(o,e)),[c,u]=m.useState(_ne(o,e)),[f,h]=m.useState(Sne(o,e)),[g,v]=m.useState(Cne(o,e)),[b,x]=m.useState(Ene(o,e).toString()),[w,_]=m.useState(One(o,e));m.useState("");const S=Ar(D=>D.actions.setCardPreferences);function R(){const D=[...new Set(y0.map(I=>I.currency))];return O.jsx(O.Fragment,{children:O.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[O.jsx(Wn,{className:"col-span-3",htmlFor:"format",children:"Locale"}),O.jsxs(zs,{value:c,onValueChange:I=>u(I),children:[O.jsx(Qi,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:O.jsx(Bs,{})}),O.jsx(Ji,{children:O.jsxs(dc,{children:[O.jsx(Va,{children:"Locale"}),y0.map(I=>O.jsx(Hn,{value:I.locale,children:I.locale},I.locale))]})})]}),O.jsx(Wn,{className:"col-span-3",htmlFor:"format",children:"Currency"}),O.jsxs(zs,{value:g||"none",onValueChange:I=>v(I==="none"?void 0:I),children:[O.jsx(Qi,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:O.jsx(Bs,{})}),O.jsx(Ji,{children:O.jsxs(dc,{children:[O.jsx(Va,{children:"Currency"}),O.jsx(Hn,{value:"none",children:"None"}),D.map(I=>O.jsx(Hn,{value:I,children:I},I))]})})]}),O.jsx(Wn,{className:"col-span-3",htmlFor:"format",children:"Decimals"}),O.jsxs(zs,{value:b,onValueChange:I=>x(I),children:[O.jsx(Qi,{className:"col-span-3 h-8 w-full focus:ring-1 focus:ring-offset-0",children:O.jsx(Bs,{})}),O.jsx(Ji,{children:["0","1","2","3","4"].map(I=>O.jsx(Hn,{value:I,children:I},I))})]}),!g&&O.jsx(s_,{onPressedChange:I=>_(I),variant:"outline",size:"sm",className:"col-span-3 h-8","aria-label":"Toggle italic",children:O.jsx(ZX,{className:"size-3"})})]})})}function C(){return O.jsx(O.Fragment,{children:O.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[O.jsx(Wn,{className:"col-span-3",htmlFor:"format",children:"Locale"}),O.jsxs(zs,{defaultValue:"en-US",value:c,onValueChange:D=>u(D),children:[O.jsx(Qi,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:O.jsx(Bs,{})}),O.jsx(Ji,{children:Pz.map(D=>O.jsxs(dc,{children:[O.jsx(Va,{children:D.label}),D.locales.map(I=>O.jsx(Hn,{value:I.code,children:I.name},I.code))]},D.label))})]}),O.jsx(Wn,{className:"col-span-3",htmlFor:"format",children:"Format"}),O.jsxs(zs,{defaultValue:"short-date-time",value:f,onValueChange:D=>{console.log("format",D),h(D)},children:[O.jsx(Qi,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:O.jsx(Bs,{})}),O.jsx(Ji,{className:"",id:"type",children:O.jsxs(dc,{children:[O.jsx(Va,{children:"Option"}),O.jsx(Hn,{value:"full-date-time",children:"Full Date-Time"}),O.jsx(Hn,{value:"short-date-time",children:"Short Date-Time"}),O.jsx(Hn,{value:"hours-date-time",children:"24-Hour Date-Time"}),O.jsx(Hn,{value:"short-date",children:"Short Date"}),O.jsx(Hn,{value:"long-date",children:"Long Date"})]})})]})]})})}function P(){S({...o,columnSettings:[]})}function A(){var D;S({...o,columnSettings:[...((D=o==null?void 0:o.columnSettings)==null?void 0:D.filter(I=>I.columnIdx!==e))||[]]})}function k(){var D,I,F;if(i==="date"){const B=bne(c,f),K={columnIdx:e,type:i,options:B};S({...o,columnSettings:[...((D=o==null?void 0:o.columnSettings)==null?void 0:D.filter(Z=>Z.columnIdx!==e))||[],K]})}else if(i==="number"){let B;g?B={locale:c,currency:g,options:{style:"currency",currency:g,minimumFractionDigits:Number(b)},colorRanges:a.length>0?a:void 0}:B={locale:c,currency:void 0,options:{style:w?"percent":"decimal",minimumFractionDigits:Number(b)},colorRanges:a.length>0?a:void 0};const K={columnIdx:e,type:i,options:B};S({...o,columnSettings:[...((I=o==null?void 0:o.columnSettings)==null?void 0:I.filter(Z=>Z.columnIdx!==e))||[],K]})}else S({...o,columnSettings:[...((F=o==null?void 0:o.columnSettings)==null?void 0:F.filter(B=>B.columnIdx!==e))||[]]})}return O.jsxs(Vm,{onOpenChange:D=>r(D),children:[O.jsx(Hm,{asChild:!0,children:O.jsx(E1,{className:"size-3.5 cursor-pointer text-muted"})}),O.jsx(Hf,{align:"center",className:"max-w-70",children:O.jsxs("div",{className:"grid gap-4",children:[O.jsxs("div",{className:"space-y-2",children:[O.jsx("h4",{className:"font-medium leading-none",children:"Display Settings"}),O.jsx("p",{className:"text-sm text-muted-foreground",children:`Display setting for '${t}'`})]}),O.jsxs("div",{className:"grid gap-2",children:[O.jsxs("div",{className:"grid grid-cols-3 items-center gap-2",children:[O.jsx(Wn,{htmlFor:"scale",children:"Type"}),O.jsxs(zs,{value:i||"none",onValueChange:D=>s(D),children:[O.jsx(Qi,{className:"col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0",children:O.jsx(Bs,{})}),O.jsx(Ji,{id:"type",children:O.jsxs(dc,{children:[O.jsx(Va,{children:"Option"}),O.jsx(Hn,{value:"number",children:"Number"}),O.jsx(Hn,{value:"date",children:"Date"}),O.jsx(Hn,{value:"none",children:"None"})]})})]})]}),i==="number"&&R(),i==="date"&&C(),i==="number"&&O.jsxs(O.Fragment,{children:[O.jsx(Ng,{}),O.jsx(hM,{colorRanges:a,setColorRanges:l})]}),O.jsx(Ng,{}),O.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[O.jsx(yr,{onClick:P,variant:"secondary",className:"col-span-1 col-start-1 h-8 w-full text-destructive",children:"Reset All"}),O.jsx(yr,{onClick:A,variant:"secondary",className:"col-span-1 col-start-2 h-8 w-full",children:"Reset"}),O.jsx(yr,{onClick:k,variant:"secondary",className:"col-span-1 col-start-3 h-8 w-full",children:"Apply"})]})]})]})})]})}function Tne(e){const t=new Date(e);return!isNaN(t.getTime())}function gM({data:e,card:t}){var R,C,P,A;const[n,r]=m.useState([]),{keys:o}=ar(e),i=ke(k=>k.filteringCards),s=ke(k=>k.themeStyle),a=ke(k=>k.isVisualEditing),l=i==null?void 0:i.find(k=>k.id===t.id),c=(R=t==null?void 0:t.preferences)==null?void 0:R.onClickFilter,{addOrUpdateFilterValues:u,addFilteringCard:f,removeFilterValue:h,removeFilteringCard:g}=Mo(),v=t==null?void 0:t.preferences;function b(k,D){if((D==null?void 0:D.type)==="date"&&Tne(k)){const{locale:I,options:F}=D.options,B=new Date(k);return new Date(B.getTime()).toLocaleDateString(I,F)}if((D==null?void 0:D.type)==="number"){const{locale:I,currency:F,options:B}=D.options;return F?new Intl.NumberFormat(I,{style:"currency",currency:F,...B}).format(k):new Intl.NumberFormat(I,B).format(k)}return k}const x=o.map((k,D)=>({accessorKey:k,header:({column:I})=>{const F=I.getIsSorted();return O.jsxs("div",{className:"flex items-center justify-between gap-2",children:[O.jsxs("div",{className:"flex cursor-pointer items-center",onClick:()=>I.toggleSorting(I.getIsSorted()==="asc"),children:[k,F==="asc"?O.jsx(w1,{className:"ml-2 h-5 w-5"}):F==="desc"?O.jsx(x1,{className:"ml-2 h-5 w-5"}):null]}),a&&O.jsx(Pne,{columnName:I.id,columnIndex:D})]})},cell:({cell:I})=>{var z,Q;const F=I.getValue(),B=(z=v==null?void 0:v.columnSettings)==null?void 0:z.find(W=>W.columnIdx===D),K=b(F,B),Z=ok(F,(Q=B==null?void 0:B.options)==null?void 0:Q.colorRanges);return O.jsx("div",{className:"px-2 py-1",style:{backgroundColor:Z},children:K})}})),w=Ok({data:e,columns:x,getCoreRowModel:Ck(),getPaginationRowModel:Rk(),onSortingChange:r,getSortedRowModel:Ek(),manualPagination:!0,state:{sorting:n}}),_=w.getSelectedRowModel().rows;m.useEffect(()=>{if(_.length===0){if(l){const k=t.id;h(k),g(t)}return}if(c){const{dimensionKeys:k}=ar(e),D=c.map(I=>{const F=k==null?void 0:k[I.columnIndex],B=_.map(Z=>Z.getValue(F));return{filterId:t.id+"-"+F,connectionId:t==null?void 0:t.connectionId,tableName:t.lastSelectedTable,name:F,expression:I.expression,valueType:Pd(B[0]===void 0?"":B[0]),operation:"in",values:B}});u(D),f(t)}},[f,u,t,e,l,c,h,g,_]);function S(k){k.toggleSelected()}return O.jsxs(W1,{className:"",containerClassName:"rounded-md",containerStyle:{borderTopRightRadius:(C=s==null?void 0:s.chart)==null?void 0:C.options.borderRadius,borderTopLeftRadius:(P=s==null?void 0:s.chart)==null?void 0:P.options.borderRadius},onMouseDown:k=>k.stopPropagation(),children:[O.jsx(U1,{children:w.getHeaderGroups().map(k=>O.jsx(bd,{children:k.headers.map((D,I)=>{var F,B,K,Z,z,Q,W;return O.jsx(G1,{style:{backgroundColor:(K=(B=(F=s==null?void 0:s.chart)==null?void 0:F.dataset)==null?void 0:B.backgroundColor)==null?void 0:K[0],color:Bc((Q=(z=(Z=s==null?void 0:s.chart)==null?void 0:Z.dataset)==null?void 0:z.backgroundColor)==null?void 0:Q[0])},className:Ee("sticky -top-[1px] z-50 h-9 bg-muted-foreground px-2 text-background",{"border-x":I>0&&I<k.headers.length-1,"border-l":I===1&&k.headers.length==2},(W=s==null?void 0:s.table)==null?void 0:W.tableHeaderColor),children:D.isPlaceholder?null:Rx(D.column.columnDef.header,D.getContext())},D.id)})},k.id))}),O.jsx(q1,{children:(A=w.getRowModel().rows)!=null&&A.length?w.getRowModel().rows.map((k,D)=>O.jsx(bd,{onClick:()=>S(k),className:Ee("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":k.getIsSelected()&&"selected",children:k.getVisibleCells().map((I,F)=>{var B;return O.jsx(Mg,{onClick:K=>{var z;const Z=((z=window==null?void 0:window.getSelection())==null?void 0:z.toString())||"";(Z==null?void 0:Z.length)>0&&K.stopPropagation()},className:Ee("p-0",{"border-x":F>0&&F<x.length-1||F===1&&x.length==2,"border-l":F==0,"border-r":F===x.length-1,"border-b":D===((B=w.getRowModel().rows)==null?void 0:B.length)-1}),children:Rx(I.column.columnDef.cell,I.getContext())},I.id)})},k.id)):O.jsx(bd,{children:O.jsx(Mg,{colSpan:x.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:mM,setPrototypeOf:LP,isFrozen:Dne,getPrototypeOf:$ne,getOwnPropertyDescriptor:Ane}=Object;let{freeze:wr,seal:Ao,create:vM}=Object,{apply:kx,construct:Mx}=typeof Reflect<"u"&&Reflect;wr||(wr=function(t){return t});Ao||(Ao=function(t){return t});kx||(kx=function(t,n,r){return t.apply(n,r)});Mx||(Mx=function(t,n){return new t(...n)});const Op=uo(Array.prototype.forEach),FP=uo(Array.prototype.pop),Vu=uo(Array.prototype.push),ig=uo(String.prototype.toLowerCase),vy=uo(String.prototype.toString),jP=uo(String.prototype.match),Hu=uo(String.prototype.replace),kne=uo(String.prototype.indexOf),Mne=uo(String.prototype.trim),Uo=uo(Object.prototype.hasOwnProperty),gr=uo(RegExp.prototype.test),Wu=Ine(TypeError);function uo(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 kx(e,t,r)}}function Ine(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Mx(e,n)}}function Tt(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ig;LP&&LP(e,null);let r=t.length;for(;r--;){let o=t[r];if(typeof o=="string"){const i=n(o);i!==o&&(Dne(t)||(t[r]=i),o=i)}e[o]=!0}return e}function Nne(e){for(let t=0;t<e.length;t++)Uo(e,t)||(e[t]=null);return e}function za(e){const t=vM(null);for(const[n,r]of mM(e))Uo(e,n)&&(Array.isArray(r)?t[n]=Nne(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=za(r):t[n]=r);return t}function Uu(e,t){for(;e!==null;){const r=Ane(e,t);if(r){if(r.get)return uo(r.get);if(typeof r.value=="function")return uo(r.value)}e=$ne(e)}function n(){return null}return n}const zP=wr(["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"]),by=wr(["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"]),yy=wr(["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"]),Lne=wr(["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"]),xy=wr(["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"]),Fne=wr(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),BP=wr(["#text"]),VP=wr(["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"]),wy=wr(["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"]),HP=wr(["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"]),Pp=wr(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),jne=Ao(/\{\{[\w\W]*|[\w\W]*\}\}/gm),zne=Ao(/<%[\w\W]*|[\w\W]*%>/gm),Bne=Ao(/\${[\w\W]*}/gm),Vne=Ao(/^data-[\-\w.\u00B7-\uFFFF]/),Hne=Ao(/^aria-[\-\w]+$/),bM=Ao(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Wne=Ao(/^(?:\w+script|data):/i),Une=Ao(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),yM=Ao(/^html$/i),qne=Ao(/^[a-z][.\w]*(-[.\w]+)+$/i);var WP=Object.freeze({__proto__:null,MUSTACHE_EXPR:jne,ERB_EXPR:zne,TMPLIT_EXPR:Bne,DATA_ATTR:Vne,ARIA_ATTR:Hne,IS_ALLOWED_URI:bM,IS_SCRIPT_OR_DATA:Wne,ATTR_WHITESPACE:Une,DOCTYPE_NAME:yM,CUSTOM_ELEMENT:qne});const qu={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Gne=function(){return typeof window>"u"?null:window},Yne=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 xM(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Gne();const t=$e=>xM($e);if(t.version="3.1.6",t.removed=[],!e||!e.document||e.document.nodeType!==qu.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:h,trustedTypes:g}=e,v=l.prototype,b=Uu(v,"cloneNode"),x=Uu(v,"remove"),w=Uu(v,"nextSibling"),_=Uu(v,"childNodes"),S=Uu(v,"parentNode");if(typeof s=="function"){const $e=n.createElement("template");$e.content&&$e.content.ownerDocument&&(n=$e.content.ownerDocument)}let R,C="";const{implementation:P,createNodeIterator:A,createDocumentFragment:k,getElementsByTagName:D}=n,{importNode:I}=r;let F={};t.isSupported=typeof mM=="function"&&typeof S=="function"&&P&&P.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:B,ERB_EXPR:K,TMPLIT_EXPR:Z,DATA_ATTR:z,ARIA_ATTR:Q,IS_SCRIPT_OR_DATA:W,ATTR_WHITESPACE:Y,CUSTOM_ELEMENT:oe}=WP;let{IS_ALLOWED_URI:$}=WP,H=null;const J=Tt({},[...zP,...by,...yy,...xy,...BP]);let N=null;const ce=Tt({},[...VP,...wy,...HP,...Pp]);let le=Object.seal(vM(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}})),de=null,pe=null,ie=!0,te=!0,ae=!1,ye=!0,G=!1,be=!0,_e=!1,Pe=!1,Te=!1,Ue=!1,Be=!1,Ie=!1,Ke=!0,lt=!1;const It="user-content-";let $t=!0,Ht=!1,fe={},Ce=null;const Le=Tt({},["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=Tt({},["audio","video","img","source","image","track"]);let Wt=null;const Zt=Tt({},["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=Tt({},[Kt,vn,ln],vy);let ht=null;const At=["application/xhtml+xml","text/html"],Xt="text/html";let bt=null,Rn=null;const Lo=n.createElement("form"),ms=function(q){return q instanceof RegExp||q instanceof Function},Fo=function(){let q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Rn&&Rn===q)){if((!q||typeof q!="object")&&(q={}),q=za(q),ht=At.indexOf(q.PARSER_MEDIA_TYPE)===-1?Xt:q.PARSER_MEDIA_TYPE,bt=ht==="application/xhtml+xml"?vy:ig,H=Uo(q,"ALLOWED_TAGS")?Tt({},q.ALLOWED_TAGS,bt):J,N=Uo(q,"ALLOWED_ATTR")?Tt({},q.ALLOWED_ATTR,bt):ce,xn=Uo(q,"ALLOWED_NAMESPACES")?Tt({},q.ALLOWED_NAMESPACES,vy):nt,Wt=Uo(q,"ADD_URI_SAFE_ATTR")?Tt(za(Zt),q.ADD_URI_SAFE_ATTR,bt):Zt,Ge=Uo(q,"ADD_DATA_URI_TAGS")?Tt(za(Ze),q.ADD_DATA_URI_TAGS,bt):Ze,Ce=Uo(q,"FORBID_CONTENTS")?Tt({},q.FORBID_CONTENTS,bt):Le,de=Uo(q,"FORBID_TAGS")?Tt({},q.FORBID_TAGS,bt):{},pe=Uo(q,"FORBID_ATTR")?Tt({},q.FORBID_ATTR,bt):{},fe=Uo(q,"USE_PROFILES")?q.USE_PROFILES:!1,ie=q.ALLOW_ARIA_ATTR!==!1,te=q.ALLOW_DATA_ATTR!==!1,ae=q.ALLOW_UNKNOWN_PROTOCOLS||!1,ye=q.ALLOW_SELF_CLOSE_IN_ATTR!==!1,G=q.SAFE_FOR_TEMPLATES||!1,be=q.SAFE_FOR_XML!==!1,_e=q.WHOLE_DOCUMENT||!1,Ue=q.RETURN_DOM||!1,Be=q.RETURN_DOM_FRAGMENT||!1,Ie=q.RETURN_TRUSTED_TYPE||!1,Te=q.FORCE_BODY||!1,Ke=q.SANITIZE_DOM!==!1,lt=q.SANITIZE_NAMED_PROPS||!1,$t=q.KEEP_CONTENT!==!1,Ht=q.IN_PLACE||!1,$=q.ALLOWED_URI_REGEXP||bM,Lt=q.NAMESPACE||ln,le=q.CUSTOM_ELEMENT_HANDLING||{},q.CUSTOM_ELEMENT_HANDLING&&ms(q.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(le.tagNameCheck=q.CUSTOM_ELEMENT_HANDLING.tagNameCheck),q.CUSTOM_ELEMENT_HANDLING&&ms(q.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(le.attributeNameCheck=q.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),q.CUSTOM_ELEMENT_HANDLING&&typeof q.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(le.allowCustomizedBuiltInElements=q.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),G&&(te=!1),Be&&(Ue=!0),fe&&(H=Tt({},BP),N=[],fe.html===!0&&(Tt(H,zP),Tt(N,VP)),fe.svg===!0&&(Tt(H,by),Tt(N,wy),Tt(N,Pp)),fe.svgFilters===!0&&(Tt(H,yy),Tt(N,wy),Tt(N,Pp)),fe.mathMl===!0&&(Tt(H,xy),Tt(N,HP),Tt(N,Pp))),q.ADD_TAGS&&(H===J&&(H=za(H)),Tt(H,q.ADD_TAGS,bt)),q.ADD_ATTR&&(N===ce&&(N=za(N)),Tt(N,q.ADD_ATTR,bt)),q.ADD_URI_SAFE_ATTR&&Tt(Wt,q.ADD_URI_SAFE_ATTR,bt),q.FORBID_CONTENTS&&(Ce===Le&&(Ce=za(Ce)),Tt(Ce,q.FORBID_CONTENTS,bt)),$t&&(H["#text"]=!0),_e&&Tt(H,["html","head","body"]),H.table&&(Tt(H,["tbody"]),delete de.tbody),q.TRUSTED_TYPES_POLICY){if(typeof q.TRUSTED_TYPES_POLICY.createHTML!="function")throw Wu('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof q.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Wu('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');R=q.TRUSTED_TYPES_POLICY,C=R.createHTML("")}else R===void 0&&(R=Yne(g,o)),R!==null&&typeof C=="string"&&(C=R.createHTML(""));wr&&wr(q),Rn=q}},$i=Tt({},["mi","mo","mn","ms","mtext"]),ni=Tt({},["foreignobject","annotation-xml"]),Ai=Tt({},["title","style","font","a","script"]),vs=Tt({},[...by,...yy,...Lne]),ri=Tt({},[...xy,...Fne]),ki=function(q){let me=S(q);(!me||!me.tagName)&&(me={namespaceURI:Lt,tagName:"template"});const Ae=ig(q.tagName),st=ig(me.tagName);return xn[q.namespaceURI]?q.namespaceURI===vn?me.namespaceURI===ln?Ae==="svg":me.namespaceURI===Kt?Ae==="svg"&&(st==="annotation-xml"||$i[st]):!!vs[Ae]:q.namespaceURI===Kt?me.namespaceURI===ln?Ae==="math":me.namespaceURI===vn?Ae==="math"&&ni[st]:!!ri[Ae]:q.namespaceURI===ln?me.namespaceURI===vn&&!ni[st]||me.namespaceURI===Kt&&!$i[st]?!1:!ri[Ae]&&(Ai[Ae]||!vs[Ae]):!!(ht==="application/xhtml+xml"&&xn[q.namespaceURI]):!1},jn=function(q){Vu(t.removed,{element:q});try{S(q).removeChild(q)}catch{x(q)}},oi=function(q,me){try{Vu(t.removed,{attribute:me.getAttributeNode(q),from:me})}catch{Vu(t.removed,{attribute:null,from:me})}if(me.removeAttribute(q),q==="is"&&!N[q])if(Ue||Be)try{jn(me)}catch{}else try{me.setAttribute(q,"")}catch{}},bs=function(q){let me=null,Ae=null;if(Te)q="<remove></remove>"+q;else{const ft=jP(q,/^[\r\n\t ]+/);Ae=ft&&ft[0]}ht==="application/xhtml+xml"&&Lt===ln&&(q='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+q+"</body></html>");const st=R?R.createHTML(q):q;if(Lt===ln)try{me=new h().parseFromString(st,ht)}catch{}if(!me||!me.documentElement){me=P.createDocument(Lt,"template",null);try{me.documentElement.innerHTML=tn?C:st}catch{}}const bn=me.body||me.documentElement;return q&&Ae&&bn.insertBefore(n.createTextNode(Ae),bn.childNodes[0]||null),Lt===ln?D.call(me,_e?"html":"body")[0]:_e?me.documentElement:bn},ys=function(q){return A.call(q.ownerDocument||q,q,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},T=function(q){return q instanceof f&&(typeof q.nodeName!="string"||typeof q.textContent!="string"||typeof q.removeChild!="function"||!(q.attributes instanceof u)||typeof q.removeAttribute!="function"||typeof q.setAttribute!="function"||typeof q.namespaceURI!="string"||typeof q.insertBefore!="function"||typeof q.hasChildNodes!="function")},ee=function(q){return typeof a=="function"&&q instanceof a},ue=function(q,me,Ae){F[q]&&Op(F[q],st=>{st.call(t,me,Ae,Rn)})},Oe=function(q){let me=null;if(ue("beforeSanitizeElements",q,null),T(q))return jn(q),!0;const Ae=bt(q.nodeName);if(ue("uponSanitizeElement",q,{tagName:Ae,allowedTags:H}),q.hasChildNodes()&&!ee(q.firstElementChild)&&gr(/<[/\w]/g,q.innerHTML)&&gr(/<[/\w]/g,q.textContent)||q.nodeType===qu.progressingInstruction||be&&q.nodeType===qu.comment&&gr(/<[/\w]/g,q.data))return jn(q),!0;if(!H[Ae]||de[Ae]){if(!de[Ae]&&qe(Ae)&&(le.tagNameCheck instanceof RegExp&&gr(le.tagNameCheck,Ae)||le.tagNameCheck instanceof Function&&le.tagNameCheck(Ae)))return!1;if($t&&!Ce[Ae]){const st=S(q)||q.parentNode,bn=_(q)||q.childNodes;if(bn&&st){const ft=bn.length;for(let tr=ft-1;tr>=0;--tr){const po=b(bn[tr],!0);po.__removalCount=(q.__removalCount||0)+1,st.insertBefore(po,w(q))}}}return jn(q),!0}return q instanceof l&&!ki(q)||(Ae==="noscript"||Ae==="noembed"||Ae==="noframes")&&gr(/<\/no(script|embed|frames)/i,q.innerHTML)?(jn(q),!0):(G&&q.nodeType===qu.text&&(me=q.textContent,Op([B,K,Z],st=>{me=Hu(me,st," ")}),q.textContent!==me&&(Vu(t.removed,{element:q.cloneNode()}),q.textContent=me)),ue("afterSanitizeElements",q,null),!1)},He=function(q,me,Ae){if(Ke&&(me==="id"||me==="name")&&(Ae in n||Ae in Lo))return!1;if(!(te&&!pe[me]&&gr(z,me))){if(!(ie&&gr(Q,me))){if(!N[me]||pe[me]){if(!(qe(q)&&(le.tagNameCheck instanceof RegExp&&gr(le.tagNameCheck,q)||le.tagNameCheck instanceof Function&&le.tagNameCheck(q))&&(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,Ae)||le.tagNameCheck instanceof Function&&le.tagNameCheck(Ae))))return!1}else if(!Wt[me]){if(!gr($,Hu(Ae,Y,""))){if(!((me==="src"||me==="xlink:href"||me==="href")&&q!=="script"&&kne(Ae,"data:")===0&&Ge[q])){if(!(ae&&!gr(W,Hu(Ae,Y,"")))){if(Ae)return!1}}}}}}return!0},qe=function(q){return q!=="annotation-xml"&&jP(q,oe)},ze=function(q){ue("beforeSanitizeAttributes",q,null);const{attributes:me}=q;if(!me)return;const Ae={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:N};let st=me.length;for(;st--;){const bn=me[st],{name:ft,namespaceURI:tr,value:po}=bn,ya=bt(ft);let zn=ft==="value"?po:Mne(po);if(Ae.attrName=ya,Ae.attrValue=zn,Ae.keepAttr=!0,Ae.forceKeepAttr=void 0,ue("uponSanitizeAttribute",q,Ae),zn=Ae.attrValue,be&&gr(/((--!?|])>)|<\/(style|title)/i,zn)){oi(ft,q);continue}if(Ae.forceKeepAttr||(oi(ft,q),!Ae.keepAttr))continue;if(!ye&&gr(/\/>/i,zn)){oi(ft,q);continue}G&&Op([B,K,Z],hu=>{zn=Hu(zn,hu," ")});const fu=bt(q.nodeName);if(He(fu,ya,zn)){if(lt&&(ya==="id"||ya==="name")&&(oi(ft,q),zn=It+zn),R&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!tr)switch(g.getAttributeType(fu,ya)){case"TrustedHTML":{zn=R.createHTML(zn);break}case"TrustedScriptURL":{zn=R.createScriptURL(zn);break}}try{tr?q.setAttributeNS(tr,ft,zn):q.setAttribute(ft,zn),T(q)?jn(q):FP(t.removed)}catch{}}}ue("afterSanitizeAttributes",q,null)},Fe=function $e(q){let me=null;const Ae=ys(q);for(ue("beforeSanitizeShadowDOM",q,null);me=Ae.nextNode();)ue("uponSanitizeShadowNode",me,null),!Oe(me)&&(me.content instanceof i&&$e(me.content),ze(me));ue("afterSanitizeShadowDOM",q,null)};return t.sanitize=function($e){let q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},me=null,Ae=null,st=null,bn=null;if(tn=!$e,tn&&($e="<!-->"),typeof $e!="string"&&!ee($e))if(typeof $e.toString=="function"){if($e=$e.toString(),typeof $e!="string")throw Wu("dirty is not a string, aborting")}else throw Wu("toString is not a function");if(!t.isSupported)return $e;if(Pe||Fo(q),t.removed=[],typeof $e=="string"&&(Ht=!1),Ht){if($e.nodeName){const po=bt($e.nodeName);if(!H[po]||de[po])throw Wu("root node is forbidden and cannot be sanitized in-place")}}else if($e instanceof a)me=bs("<!---->"),Ae=me.ownerDocument.importNode($e,!0),Ae.nodeType===qu.element&&Ae.nodeName==="BODY"||Ae.nodeName==="HTML"?me=Ae:me.appendChild(Ae);else{if(!Ue&&!G&&!_e&&$e.indexOf("<")===-1)return R&&Ie?R.createHTML($e):$e;if(me=bs($e),!me)return Ue?null:Ie?C:""}me&&Te&&jn(me.firstChild);const ft=ys(Ht?$e:me);for(;st=ft.nextNode();)Oe(st)||(st.content instanceof i&&Fe(st.content),ze(st));if(Ht)return $e;if(Ue){if(Be)for(bn=k.call(me.ownerDocument);me.firstChild;)bn.appendChild(me.firstChild);else bn=me;return(N.shadowroot||N.shadowrootmode)&&(bn=I.call(r,bn,!0)),bn}let tr=_e?me.outerHTML:me.innerHTML;return _e&&H["!doctype"]&&me.ownerDocument&&me.ownerDocument.doctype&&me.ownerDocument.doctype.name&&gr(yM,me.ownerDocument.doctype.name)&&(tr="<!DOCTYPE "+me.ownerDocument.doctype.name+`>
|
|
316
316
|
`+tr),G&&Op([B,K,Z],po=>{tr=Hu(tr,po," ")}),R&&Ie?R.createHTML(tr):tr},t.setConfig=function(){let $e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Fo($e),Pe=!0},t.clearConfig=function(){Rn=null,Pe=!1},t.isValidAttribute=function($e,q,me){Rn||Fo({});const Ae=bt($e),st=bt(q);return He(Ae,st,me)},t.addHook=function($e,q){typeof q=="function"&&(F[$e]=F[$e]||[],Vu(F[$e],q))},t.removeHook=function($e){if(F[$e])return FP(F[$e])},t.removeHooks=function($e){F[$e]&&(F[$e]=[])},t.removeAllHooks=function(){F={}},t}var UP=xM();function wM({card:e,isLoading:t}){var f,h;const n=(e==null?void 0:e.data)||[],{keys:r}=ar(n),o=ke(g=>g.selectedSheetId),i=ke(g=>g.isVisualEditing),s=(h=(f=e==null?void 0:e.preferences)==null?void 0:f.textVisualOptions)==null?void 0:h.isDynamicText,{setCardDescription:a}=Mo(),{setCard:l}=Rm();function c(){var x;if(t)return O.jsx(im,{className:"h-7 animate-pulse bg-muted"});const g=(x=n==null?void 0:n[0])==null?void 0:x[r[0]],v=UP.sanitize(g),b=O.jsx("div",{dangerouslySetInnerHTML:{__html:v}});return O.jsx("div",{className:"hover:cursor-text",onMouseDown:w=>w.stopPropagation(),children:b})}function u(){return O.jsx("div",{onMouseDown:g=>g.stopPropagation(),children:O.jsx(is,{type:"textarea",className:"w-full",text:(e==null?void 0:e.description)||"Double click to add description",onSave:g=>{i===!1&&a(o,e.id,g),i===!0&&l({...e,description:g})},children:O.jsx("div",{dangerouslySetInnerHTML:{__html:UP.sanitize((e==null?void 0:e.description)||"")}})})})}return O.jsxs("div",{className:"break-words p-6",children:[!s&&u(),s===!0&&c()]})}function Kne({frame:e,footer:t,className:n,...r}){var K,Z,z,Q;const{customCards:o}=ma(),i=m.useRef(null),s=ke(W=>W.themeStyle),a=ke(W=>W.selectedSheetId),l=ke(W=>W.selectedFrameId),c=ke(W=>W.isDashboardEditing),u=e.cards.find(W=>W.id===e.activeCardId);_Z(e,i);const{isError:f,isLoading:h,isFetching:g,cfg:v,visualKey:b,handleDatapointClick:x}=j1(u),{setCardTitle:w,setCardDescription:_,setSelectedFrameId:S}=Mo(),{setSelectedConnectionId:R,setSelectedDatabaseName:C,setSelectedSchemaName:P,setSelectedTableName:A}=Rm();function k(W){W.stopPropagation(),S(e.id),u!=null&&u.connectionId&&R(u==null?void 0:u.connectionId),u!=null&&u.lastSelectedDatabase&&C(u==null?void 0:u.lastSelectedDatabase),u!=null&&u.lastSelectedSchema&&P(u==null?void 0:u.lastSelectedSchema),u!=null&&u.lastSelectedTable&&A(u==null?void 0:u.lastSelectedTable)}function D(){if(o&&o.length>0){const W=o.find(Y=>Y.cardId===u.id);if(W&&W.replaceDefault){const Y=W.content;if(Y)return O.jsx(Y,{card:u})}}return u.type==="kpi"?O.jsx(ik,{isLoading:h||g,card:u}):u.type==="text"?O.jsx(wM,{isLoading:h||g,card:u}):B}function I(){if(f)return O.jsx("p",{className:"text-sm",children:"Oops! It seems like something went wrong. Please review your connection or filters."});if(u.type==="table"&&u.data&&u.data.length>0)return O.jsx("div",{className:"relative flex min-h-0 flex-1 grow basis-0",children:O.jsx(gM,{card:u,data:u.data})});if(o&&o.length>0){const W=o.find(Y=>Y.cardId===u.id);if(W&&W.content){const Y=W.content;return O.jsx(Y,{card:u})}}if(v)return O.jsx(y1,{cfg:v,onDatapointClick:x},b)}function F(){if(o&&o.length>0){const W=o.find(Y=>Y.cardId===u.id);if(W&&W.footer){const Y=W.footer;if(Y)return O.jsx(Y,{card:u})}}return t||null}if(!u.id)return null;const B=O.jsxs(O.Fragment,{children:[O.jsxs(sm,{className:"pb-4",children:[O.jsxs("div",{className:"flex items-center gap-2",children:[O.jsx(is,{text:u.title,onSave:W=>w(a,u.id,W),children:O.jsx(Df,{className:"text-base",children:u.title})}),(c||u.info)&&O.jsx(MZ,{card:u}),u.refreshInterval&&O.jsxs(nk,{children:[O.jsx(rk,{className:"pr-1",children:O.jsx("div",{className:Ee("h-2 w-2 rounded-full bg-green-500 transition-opacity",{"opacity-10":h||g})})}),O.jsx(N1,{side:"right",align:"center",children:O.jsx("p",{className:"text-xs",children:`Realtime (${u==null?void 0:u.refreshInterval})`})})]}),!u.refreshInterval&&(h||g)&&O.jsx(S1,{className:"h-4 w-4 animate-spin text-muted-foreground"})]}),O.jsx(is,{text:(u==null?void 0:u.description)||"",onSave:W=>_(a,u.id,W),children:O.jsxs(Sw,{children:[" ",u.description]})})]}),O.jsx(am,{className:"relative flex grow flex-col",children:I()}),O.jsx(Cw,{children:F()})]});return O.jsxs(_w,{tabIndex:-1,ref:i,role:"card-frame",onClick:k,style:{borderRadius:(Z=(K=s==null?void 0:s.chart)==null?void 0:K.options)==null?void 0:Z.borderRadius,fontFamily:(Q=(z=s==null?void 0:s.chart)==null?void 0:z.font)==null?void 0:Q.family},className:Ee("relative flex h-full flex-col rounded-sm",{"border-dashed border-foreground/50":l===e.id&&c},s==null?void 0:s.dashboardCard,n,"semaphor-card-frame"),...r,children:[O.jsx(oQ,{frame:e}),D()]})}const a_=V.forwardRef(({className:e,...t},n)=>O.jsx("textarea",{className:Ee("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background 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:n,...t}));a_.displayName="Textarea";const Ix="horizontal",Xne=["horizontal","vertical"],_M=m.forwardRef((e,t)=>{const{decorative:n,orientation:r=Ix,...o}=e,i=SM(r)?r:Ix,a=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return m.createElement(Qe.div,he({"data-orientation":i},a,o,{ref:t}))});_M.propTypes={orientation(e,t,n){const r=e[t],o=String(r);return r&&!SM(r)?new Error(Qne(o,n)):null}};function Qne(e,t){return`Invalid prop \`orientation\` of value \`${e}\` supplied to \`${t}\`, expected one of:
|
|
317
317
|
- horizontal
|
|
318
318
|
- vertical
|
|
@@ -422,7 +422,7 @@ You can add a description to the \`${Sc}\` by passing a \`${S5}\` component as a
|
|
|
422
422
|
|
|
423
423
|
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Sc}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
|
424
424
|
|
|
425
|
-
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return V.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},Zpe=v5,ege=b5,P5=y5,T5=x5,D5=E5,$5=O5,A5=_5,k5=C5;const tge=Zpe,nge=ege,M5=V.forwardRef(({className:e,...t},n)=>O.jsx(P5,{className:Ee("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));M5.displayName=P5.displayName;const I5=V.forwardRef(({className:e,...t},n)=>O.jsxs(nge,{children:[O.jsx(M5,{}),O.jsx(T5,{ref:n,className:Ee("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));I5.displayName=T5.displayName;const N5=({className:e,...t})=>O.jsx("div",{className:Ee("flex flex-col space-y-2 text-center sm:text-left",e),...t});N5.displayName="AlertDialogHeader";const L5=({className:e,...t})=>O.jsx("div",{className:Ee("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});L5.displayName="AlertDialogFooter";const F5=V.forwardRef(({className:e,...t},n)=>O.jsx(A5,{ref:n,className:Ee("text-lg font-semibold",e),...t}));F5.displayName=A5.displayName;const j5=V.forwardRef(({className:e,...t},n)=>O.jsx(k5,{ref:n,className:Ee("text-sm text-muted-foreground",e),...t}));j5.displayName=k5.displayName;const z5=V.forwardRef(({className:e,...t},n)=>O.jsx(D5,{ref:n,className:Ee(Bd(),e),...t}));z5.displayName=D5.displayName;const B5=V.forwardRef(({className:e,...t},n)=>O.jsx($5,{ref:n,className:Ee(Bd({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));B5.displayName=$5.displayName;function rge({open:e,setOpen:t}){const n=ke(i=>i.selectedSheetId),{deleteSheet:r}=Mo();function o(){n&&(r(n),t(!1))}return O.jsx(tge,{open:e,onOpenChange:t,children:O.jsxs(I5,{children:[O.jsxs(N5,{children:[O.jsx(F5,{children:"Delete Sheet"}),O.jsx(j5,{children:"Are you sure you want to delete this sheet along with all its cards? This action cannot be undone."})]}),O.jsxs(L5,{children:[O.jsx(B5,{children:"Cancel"}),O.jsx(z5,{onClick:o,children:"Delete"})]})]})})}function V5(){var b,x;const[e,t]=m.useState(!1),n=ke(w=>{var _;return(_=w.dashboard)==null?void 0:_.sheets}),{showAssistant:r}=ma(),o=m.useRef(null),[i,s]=m.useState(!1),a=ke(w=>w.isDashboardEditing),l=ke(w=>w.themeStyle);ke(w=>w.isVisualEditing);const c=ke(w=>w.selectedSheetId),{setSelectedSheetId:u,setSheetTitle:f,addSheet:h}=Mo();if(!n)return null;function g(w){var _,S;w?((_=o.current)==null||_.resize(35),s(!0)):(s(!1),(S=o.current)==null||S.resize(0))}function v(){const w={id:la(),title:"New Sheet"};h(w)}return O.jsxs(MD,{role:"dashboard-tabs-container",className:Ee("relative flex grow",l==null?void 0:l.dashboardTabsContainer),onValueChange:w=>{u(w)},value:c||n[0].id,children:[O.jsxs(LN,{direction:"horizontal",children:[O.jsx(rw,{children:O.jsxs("div",{style:{},children:[(n.length>1||a)&&O.jsxs(Tw,{role:"tab-list",className:"flex h-11 items-center justify-start gap-2 rounded-none bg-transparent px-2.5 py-3",children:[n==null?void 0:n.map(w=>{var _,S;return O.jsx(is,{text:w.title,onSave:R=>f(w.id,R),children:O.jsxs(Dw,{style:{borderRadius:(S=(_=l==null?void 0:l.chart)==null?void 0:_.options)==null?void 0:S.borderRadius},onClick:()=>u(w.id),className:"flex items-center gap-1 rounded-none border px-2 py-1",value:w.id,children:[w.title,a&&c===w.id&&n.length>1&&O.jsx(Pm,{className:"ml-1 size-3",onClick:()=>t(!0)})]})},w.id)}),a&&O.jsx("div",{style:{borderRadius:(x=(b=l==null?void 0:l.chart)==null?void 0:b.options)==null?void 0:x.borderRadius},className:"flex h-7 items-center justify-center border-none bg-muted p-2 hover:cursor-pointer dark:border-l-background",onClick:v,children:O.jsx(C1,{className:"size-3"})})]}),n==null?void 0:n.map(w=>O.jsx($w,{className:Ee("mt-0",{"bg-muted":(l==null?void 0:l.canvasTheme)==="muted"||!(l!=null&&l.canvasTheme)}),value:w.id,children:O.jsx(Sae,{})},w.id))]})}),r===!0&&O.jsxs(O.Fragment,{children:[O.jsx(Fhe,{open:i,onTabClick:g,withHandle:!0}),O.jsx(rw,{onResize:w=>{w<1?s(!1):i||s(!0)},defaultSize:0,ref:o,children:O.jsx(vhe,{})})]})]}),O.jsx(rge,{open:e,setOpen:t})]})}function H5({children:e}){return O.jsx(gB,{defaultTheme:"system",storageKey:"vite-ui-theme",children:O.jsx(RJ,{delayDuration:0,children:e})})}function W5(e){return O.jsx(lk,{dashboardProps:e,children:O.jsx(H5,{children:O.jsx(_D,{...e,children:O.jsx(V5,{})})})})}const U5=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(ige);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(sw,he({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(sw,he({},r,{ref:t}),n)});U5.displayName="Slot";const sw=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...sge(r,n.props),ref:t?cs(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});sw.displayName="SlotClone";const oge=({children:e})=>m.createElement(m.Fragment,null,e);function ige(e){return m.isValidElement(e)&&e.type===oge}function sge(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 aw=["Enter"," "],age=["ArrowDown","PageUp","Home"],q5=["ArrowUp","PageDown","End"],lge=[...age,...q5],cge={ltr:[...aw,"ArrowRight"],rtl:[...aw,"ArrowLeft"]},uge={ltr:["ArrowLeft"],rtl:["ArrowRight"]},av="Menu",[df,dge,fge]=lm(av),[Al,G5]=Zn(av,[fge,Ti,ou]),oS=Ti(),Y5=ou(),[hge,kl]=Al(av),[pge,Zf]=Al(av),gge=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:s=!0}=e,a=oS(t),[l,c]=m.useState(null),u=m.useRef(!1),f=Ln(i),h=_l(o);return m.useEffect(()=>{const g=()=>{u.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>u.current=!1;return document.addEventListener("keydown",g,{capture:!0}),()=>{document.removeEventListener("keydown",g,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),m.createElement(zf,a,m.createElement(hge,{scope:t,open:n,onOpenChange:f,content:l,onContentChange:c},m.createElement(pge,{scope:t,onClose:m.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:u,dir:h,modal:s},r)))},K5=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=oS(n);return m.createElement(Bf,he({},o,r,{ref:t}))}),X5="MenuPortal",[mge,Q5]=Al(X5,{forceMount:void 0}),vge=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,i=kl(X5,t);return m.createElement(mge,{scope:t,forceMount:n},m.createElement(er,{present:n||i.open},m.createElement(A1,{asChild:!0,container:o},r)))},Qo="MenuContent",[bge,iS]=Al(Qo),yge=m.forwardRef((e,t)=>{const n=Q5(Qo,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=kl(Qo,e.__scopeMenu),s=Zf(Qo,e.__scopeMenu);return m.createElement(df.Provider,{scope:e.__scopeMenu},m.createElement(er,{present:r||i.open},m.createElement(df.Slot,{scope:e.__scopeMenu},s.modal?m.createElement(xge,he({},o,{ref:t})):m.createElement(wge,he({},o,{ref:t})))))}),xge=m.forwardRef((e,t)=>{const n=kl(Qo,e.__scopeMenu),r=m.useRef(null),o=_t(t,r);return m.useEffect(()=>{const i=r.current;if(i)return Nm(i)},[]),m.createElement(sS,he({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Me(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))}),wge=m.forwardRef((e,t)=>{const n=kl(Qo,e.__scopeMenu);return m.createElement(sS,he({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))}),sS=m.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:h,onDismiss:g,disableOutsideScroll:v,...b}=e,x=kl(Qo,n),w=Zf(Qo,n),_=oS(n),S=Y5(n),R=dge(n),[C,P]=m.useState(null),A=m.useRef(null),k=_t(t,A,x.onContentChange),D=m.useRef(0),I=m.useRef(""),F=m.useRef(0),B=m.useRef(null),K=m.useRef("right"),Z=m.useRef(0),z=v?t_:m.Fragment,Q=v?{as:U5,allowPinchZoom:!0}:void 0,W=oe=>{var $,H;const J=I.current+oe,N=R().filter(te=>!te.disabled),ce=document.activeElement,le=($=N.find(te=>te.ref.current===ce))===null||$===void 0?void 0:$.textValue,de=N.map(te=>te.textValue),pe=zge(de,J,le),ie=(H=N.find(te=>te.textValue===pe))===null||H===void 0?void 0:H.ref.current;(function te(ae){I.current=ae,window.clearTimeout(D.current),ae!==""&&(D.current=window.setTimeout(()=>te(""),1e3))})(J),ie&&setTimeout(()=>ie.focus())};m.useEffect(()=>()=>window.clearTimeout(D.current),[]),Q1();const Y=m.useCallback(oe=>{var $,H;return K.current===(($=B.current)===null||$===void 0?void 0:$.side)&&Vge(oe,(H=B.current)===null||H===void 0?void 0:H.area)},[]);return m.createElement(bge,{scope:n,searchRef:I,onItemEnter:m.useCallback(oe=>{Y(oe)&&oe.preventDefault()},[Y]),onItemLeave:m.useCallback(oe=>{var $;Y(oe)||(($=A.current)===null||$===void 0||$.focus(),P(null))},[Y]),onTriggerLeave:m.useCallback(oe=>{Y(oe)&&oe.preventDefault()},[Y]),pointerGraceTimerRef:F,onPointerGraceIntentChange:m.useCallback(oe=>{B.current=oe},[])},m.createElement(z,Q,m.createElement(J1,{asChild:!0,trapped:o,onMountAutoFocus:Me(i,oe=>{var $;oe.preventDefault(),($=A.current)===null||$===void 0||$.focus()}),onUnmountAutoFocus:s},m.createElement(Ff,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:h,onDismiss:g},m.createElement(Rw,he({asChild:!0},S,{dir:w.dir,orientation:"vertical",loop:r,currentTabStopId:C,onCurrentTabStopIdChange:P,onEntryFocus:Me(l,oe=>{w.isUsingKeyboardRef.current||oe.preventDefault()})}),m.createElement(Vf,he({role:"menu","aria-orientation":"vertical","data-state":nL(x.open),"data-radix-menu-content":"",dir:w.dir},_,b,{ref:k,style:{outline:"none",...b.style},onKeyDown:Me(b.onKeyDown,oe=>{const H=oe.target.closest("[data-radix-menu-content]")===oe.currentTarget,J=oe.ctrlKey||oe.altKey||oe.metaKey,N=oe.key.length===1;H&&(oe.key==="Tab"&&oe.preventDefault(),!J&&N&&W(oe.key));const ce=A.current;if(oe.target!==ce||!lge.includes(oe.key))return;oe.preventDefault();const de=R().filter(pe=>!pe.disabled).map(pe=>pe.ref.current);q5.includes(oe.key)&&de.reverse(),Fge(de)}),onBlur:Me(e.onBlur,oe=>{oe.currentTarget.contains(oe.target)||(window.clearTimeout(D.current),I.current="")}),onPointerMove:Me(e.onPointerMove,ff(oe=>{const $=oe.target,H=Z.current!==oe.clientX;if(oe.currentTarget.contains($)&&H){const J=oe.clientX>Z.current?"right":"left";K.current=J,Z.current=oe.clientX}}))})))))))}),_ge=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(Qe.div,he({role:"group"},r,{ref:t}))}),Sge=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(Qe.div,he({},r,{ref:t}))}),lw="MenuItem",C2="menu.itemSelect",aS=m.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,i=m.useRef(null),s=Zf(lw,e.__scopeMenu),a=iS(lw,e.__scopeMenu),l=_t(t,i),c=m.useRef(!1),u=()=>{const f=i.current;if(!n&&f){const h=new CustomEvent(C2,{bubbles:!0,cancelable:!0});f.addEventListener(C2,g=>r==null?void 0:r(g),{once:!0}),CD(f,h),h.defaultPrevented?c.current=!1:s.onClose()}};return m.createElement(J5,he({},o,{ref:l,disabled:n,onClick:Me(e.onClick,u),onPointerDown:f=>{var h;(h=e.onPointerDown)===null||h===void 0||h.call(e,f),c.current=!0},onPointerUp:Me(e.onPointerUp,f=>{var h;c.current||(h=f.currentTarget)===null||h===void 0||h.click()}),onKeyDown:Me(e.onKeyDown,f=>{const h=a.searchRef.current!=="";n||h&&f.key===" "||aw.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})}))}),J5=m.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=e,s=iS(lw,n),a=Y5(n),l=m.useRef(null),c=_t(t,l),[u,f]=m.useState(!1),[h,g]=m.useState("");return m.useEffect(()=>{const v=l.current;if(v){var b;g(((b=v.textContent)!==null&&b!==void 0?b:"").trim())}},[i.children]),m.createElement(df.ItemSlot,{scope:n,disabled:r,textValue:o??h},m.createElement(Ow,he({asChild:!0},a,{focusable:!r}),m.createElement(Qe.div,he({role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},i,{ref:c,onPointerMove:Me(e.onPointerMove,ff(v=>{r?s.onItemLeave(v):(s.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus())})),onPointerLeave:Me(e.onPointerLeave,ff(v=>s.onItemLeave(v))),onFocus:Me(e.onFocus,()=>f(!0)),onBlur:Me(e.onBlur,()=>f(!1))}))))}),Cge=m.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return m.createElement(eL,{scope:e.__scopeMenu,checked:n},m.createElement(aS,he({role:"menuitemcheckbox","aria-checked":Xg(n)?"mixed":n},o,{ref:t,"data-state":lS(n),onSelect:Me(o.onSelect,()=>r==null?void 0:r(Xg(n)?!0:!n),{checkForDefaultPrevented:!1})})))}),Ege="MenuRadioGroup",[Rge,Oge]=Al(Ege,{value:void 0,onValueChange:()=>{}}),Pge=m.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,i=Ln(r);return m.createElement(Rge,{scope:e.__scopeMenu,value:n,onValueChange:i},m.createElement(_ge,he({},o,{ref:t})))}),Tge="MenuRadioItem",Dge=m.forwardRef((e,t)=>{const{value:n,...r}=e,o=Oge(Tge,e.__scopeMenu),i=n===o.value;return m.createElement(eL,{scope:e.__scopeMenu,checked:i},m.createElement(aS,he({role:"menuitemradio","aria-checked":i},r,{ref:t,"data-state":lS(i),onSelect:Me(r.onSelect,()=>{var s;return(s=o.onValueChange)===null||s===void 0?void 0:s.call(o,n)},{checkForDefaultPrevented:!1})})))}),Z5="MenuItemIndicator",[eL,$ge]=Al(Z5,{checked:!1}),Age=m.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,i=$ge(Z5,n);return m.createElement(er,{present:r||Xg(i.checked)||i.checked===!0},m.createElement(Qe.span,he({},o,{ref:t,"data-state":lS(i.checked)})))}),kge=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(Qe.div,he({role:"separator","aria-orientation":"horizontal"},r,{ref:t}))}),Mge="MenuSub",[wye,tL]=Al(Mge),Vp="MenuSubTrigger",Ige=m.forwardRef((e,t)=>{const n=kl(Vp,e.__scopeMenu),r=Zf(Vp,e.__scopeMenu),o=tL(Vp,e.__scopeMenu),i=iS(Vp,e.__scopeMenu),s=m.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=i,c={__scopeMenu:e.__scopeMenu},u=m.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return m.useEffect(()=>u,[u]),m.useEffect(()=>{const f=a.current;return()=>{window.clearTimeout(f),l(null)}},[a,l]),m.createElement(K5,he({asChild:!0},c),m.createElement(J5,he({id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":nL(n.open)},e,{ref:cs(t,o.onTriggerChange),onClick:f=>{var h;(h=e.onClick)===null||h===void 0||h.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Me(e.onPointerMove,ff(f=>{i.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(i.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:Me(e.onPointerLeave,ff(f=>{var h;u();const g=(h=n.content)===null||h===void 0?void 0:h.getBoundingClientRect();if(g){var v;const b=(v=n.content)===null||v===void 0?void 0:v.dataset.side,x=b==="right",w=x?-5:5,_=g[x?"left":"right"],S=g[x?"right":"left"];i.onPointerGraceIntentChange({area:[{x:f.clientX+w,y:f.clientY},{x:_,y:g.top},{x:S,y:g.top},{x:S,y:g.bottom},{x:_,y:g.bottom}],side:b}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(f),f.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:Me(e.onKeyDown,f=>{const h=i.searchRef.current!=="";if(!(e.disabled||h&&f.key===" ")&&cge[r.dir].includes(f.key)){var g;n.onOpenChange(!0),(g=n.content)===null||g===void 0||g.focus(),f.preventDefault()}})})))}),Nge="MenuSubContent",Lge=m.forwardRef((e,t)=>{const n=Q5(Qo,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=kl(Qo,e.__scopeMenu),s=Zf(Qo,e.__scopeMenu),a=tL(Nge,e.__scopeMenu),l=m.useRef(null),c=_t(t,l);return m.createElement(df.Provider,{scope:e.__scopeMenu},m.createElement(er,{present:r||i.open},m.createElement(df.Slot,{scope:e.__scopeMenu},m.createElement(sS,he({id:a.contentId,"aria-labelledby":a.triggerId},o,{ref:c,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var f;s.isUsingKeyboardRef.current&&((f=l.current)===null||f===void 0||f.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:Me(e.onFocusOutside,u=>{u.target!==a.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:Me(e.onEscapeKeyDown,u=>{s.onClose(),u.preventDefault()}),onKeyDown:Me(e.onKeyDown,u=>{const f=u.currentTarget.contains(u.target),h=uge[s.dir].includes(u.key);if(f&&h){var g;i.onOpenChange(!1),(g=a.trigger)===null||g===void 0||g.focus(),u.preventDefault()}})})))))});function nL(e){return e?"open":"closed"}function Xg(e){return e==="indeterminate"}function lS(e){return Xg(e)?"indeterminate":e?"checked":"unchecked"}function Fge(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function jge(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function zge(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=jge(e,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function Bge(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const a=t[i].x,l=t[i].y,c=t[s].x,u=t[s].y;l>r!=u>r&&n<(c-a)*(r-l)/(u-l)+a&&(o=!o)}return o}function Vge(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Bge(n,t)}function ff(e){return t=>t.pointerType==="mouse"?e(t):void 0}const Hge=gge,Wge=K5,Uge=vge,qge=yge,Gge=Sge,Yge=aS,Kge=Cge,Xge=Pge,Qge=Dge,Jge=Age,Zge=kge,eme=Ige,tme=Lge,rL="DropdownMenu",[nme,_ye]=Zn(rL,[G5]),ho=G5(),[rme,oL]=nme(rL),ome=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:s,modal:a=!0}=e,l=ho(t),c=m.useRef(null),[u=!1,f]=xr({prop:o,defaultProp:i,onChange:s});return m.createElement(rme,{scope:t,triggerId:Jo(),triggerRef:c,contentId:Jo(),open:u,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(h=>!h),[f]),modal:a},m.createElement(Hge,he({},l,{open:u,onOpenChange:f,dir:r,modal:a}),n))},ime="DropdownMenuTrigger",sme=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,i=oL(ime,n),s=ho(n);return m.createElement(Wge,he({asChild:!0},s),m.createElement(Qe.button,he({type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r},o,{ref:cs(t,i.triggerRef),onPointerDown:Me(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(i.onOpenToggle(),i.open||a.preventDefault())}),onKeyDown:Me(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&i.onOpenToggle(),a.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})))}),ame=e=>{const{__scopeDropdownMenu:t,...n}=e,r=ho(t);return m.createElement(Uge,he({},r,n))},lme="DropdownMenuContent",cme=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=oL(lme,n),i=ho(n),s=m.useRef(!1);return m.createElement(qge,he({id:o.contentId,"aria-labelledby":o.triggerId},i,r,{ref:t,onCloseAutoFocus:Me(e.onCloseAutoFocus,a=>{var l;s.current||(l=o.triggerRef.current)===null||l===void 0||l.focus(),s.current=!1,a.preventDefault()}),onInteractOutside:Me(e.onInteractOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;(!o.modal||u)&&(s.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),ume=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ho(n);return m.createElement(Gge,he({},o,r,{ref:t}))}),dme=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ho(n);return m.createElement(Yge,he({},o,r,{ref:t}))}),fme=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ho(n);return m.createElement(Kge,he({},o,r,{ref:t}))}),hme=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ho(n);return m.createElement(Xge,he({},o,r,{ref:t}))}),pme=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ho(n);return m.createElement(Qge,he({},o,r,{ref:t}))}),gme=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ho(n);return m.createElement(Jge,he({},o,r,{ref:t}))}),mme=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ho(n);return m.createElement(Zge,he({},o,r,{ref:t}))}),vme=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ho(n);return m.createElement(eme,he({},o,r,{ref:t}))}),bme=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ho(n);return m.createElement(tme,he({},o,r,{ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),yme=ome,xme=sme,wme=ame,iL=cme,sL=ume,aL=dme,lL=fme,_me=hme,cL=pme,uL=gme,dL=mme,fL=vme,hL=bme,Sme=yme,Cme=xme,Eme=_me,Rme=V.forwardRef(({className:e,inset:t,children:n,...r},o)=>O.jsxs(fL,{ref:o,className:Ee("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...r,children:[n,O.jsx(_1,{className:"ml-auto h-4 w-4"})]}));Rme.displayName=fL.displayName;const Ome=V.forwardRef(({className:e,...t},n)=>O.jsx(hL,{ref:n,className:Ee("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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),...t}));Ome.displayName=hL.displayName;const pL=V.forwardRef(({className:e,sideOffset:t=4,...n},r)=>O.jsx(wme,{children:O.jsx(iL,{ref:r,sideOffset:t,className:Ee("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 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",e),...n})}));pL.displayName=iL.displayName;const Pme=V.forwardRef(({className:e,inset:t,...n},r)=>O.jsx(aL,{ref:r,className:Ee("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));Pme.displayName=aL.displayName;const Tme=V.forwardRef(({className:e,children:t,checked:n,...r},o)=>O.jsxs(lL,{ref:o,className:Ee("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[O.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:O.jsx(uL,{children:O.jsx(Lf,{className:"h-4 w-4"})})}),t]}));Tme.displayName=lL.displayName;const gL=V.forwardRef(({className:e,children:t,...n},r)=>O.jsxs(cL,{ref:r,className:Ee("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[O.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:O.jsx(uL,{children:O.jsx(MA,{className:"h-2 w-2 fill-current"})})}),t]}));gL.displayName=cL.displayName;const mL=V.forwardRef(({className:e,inset:t,...n},r)=>O.jsx(sL,{ref:r,className:Ee("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));mL.displayName=sL.displayName;const vL=V.forwardRef(({className:e,...t},n)=>O.jsx(dL,{ref:n,className:Ee("-mx-1 my-1 h-px bg-muted",e),...t}));vL.displayName=dL.displayName;function Dme(e){var t;return{...e,sheets:(t=e==null?void 0:e.sheets)==null?void 0:t.map(n=>{var r;return{...n,frames:(r=n.frames)==null?void 0:r.map(o=>{var i;return{...o,cards:(i=o.cards)==null?void 0:i.map(s=>bL(s))}})}})}}function bL(e){var t,n,r,o;return{...e,cfg:{...e.cfg,data:{...(t=e.cfg)==null?void 0:t.data,labels:[],datasets:(o=(r=(n=e.cfg)==null?void 0:n.data)==null?void 0:r.datasets)==null?void 0:o.map(i=>({...i,data:[]}))}},customCfg:$me(e.customCfg),data:[]}}function $me(e){var t,n;return e?{...e,data:{...e==null?void 0:e.data,labels:[],datasets:(n=(t=e==null?void 0:e.data)==null?void 0:t.datasets)==null?void 0:n.map(r=>({...r,data:[]}))}}:null}function yL(e){return`semaphor:bookmark:${e}`}const Ame=h5,kme=p5,Mme=g5,xL=V.forwardRef(({className:e,...t},n)=>O.jsx(Z_,{ref:n,className:Ee("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));xL.displayName=Z_.displayName;const wL=V.forwardRef(({className:e,children:t,...n},r)=>O.jsxs(Mme,{children:[O.jsx(xL,{}),O.jsxs(eS,{ref:r,className:Ee("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,O.jsxs(rS,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[O.jsx(Pm,{className:"h-4 w-4"}),O.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));wL.displayName=eS.displayName;const _L=({className:e,...t})=>O.jsx("div",{className:Ee("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});_L.displayName="DialogHeader";const SL=({className:e,...t})=>O.jsx("div",{className:Ee("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});SL.displayName="DialogFooter";const CL=V.forwardRef(({className:e,...t},n)=>O.jsx(tS,{ref:n,className:Ee("text-lg font-semibold leading-none tracking-tight",e),...t}));CL.displayName=tS.displayName;const EL=V.forwardRef(({className:e,...t},n)=>O.jsx(nS,{ref:n,className:Ee("text-sm text-muted-foreground",e),...t}));EL.displayName=nS.displayName;const RL="Checkbox",[Ime,Sye]=Zn(RL),[Nme,Lme]=Ime(RL),Fme=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:i,required:s,disabled:a,value:l="on",onCheckedChange:c,...u}=e,[f,h]=m.useState(null),g=_t(t,S=>h(S)),v=m.useRef(!1),b=f?!!f.closest("form"):!0,[x=!1,w]=xr({prop:o,defaultProp:i,onChange:c}),_=m.useRef(x);return m.useEffect(()=>{const S=f==null?void 0:f.form;if(S){const R=()=>w(_.current);return S.addEventListener("reset",R),()=>S.removeEventListener("reset",R)}},[f,w]),m.createElement(Nme,{scope:n,state:x,disabled:a},m.createElement(Qe.button,he({type:"button",role:"checkbox","aria-checked":dl(x)?"mixed":x,"aria-required":s,"data-state":OL(x),"data-disabled":a?"":void 0,disabled:a,value:l},u,{ref:g,onKeyDown:Me(e.onKeyDown,S=>{S.key==="Enter"&&S.preventDefault()}),onClick:Me(e.onClick,S=>{w(R=>dl(R)?!0:!R),b&&(v.current=S.isPropagationStopped(),v.current||S.stopPropagation())})})),b&&m.createElement(Bme,{control:f,bubbles:!v.current,name:r,value:l,checked:x,required:s,disabled:a,style:{transform:"translateX(-100%)"}}))}),jme="CheckboxIndicator",zme=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,i=Lme(jme,n);return m.createElement(er,{present:r||dl(i.state)||i.state===!0},m.createElement(Qe.span,he({"data-state":OL(i.state),"data-disabled":i.disabled?"":void 0},o,{ref:t,style:{pointerEvents:"none",...e.style}})))}),Bme=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=m.useRef(null),s=Im(n),a=$m(t);return m.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&f){const h=new Event("click",{bubbles:r});l.indeterminate=dl(n),f.call(l,dl(n)?!1:n),l.dispatchEvent(h)}},[s,n,r]),m.createElement("input",he({type:"checkbox","aria-hidden":!0,defaultChecked:dl(n)?!1:n},o,{tabIndex:-1,ref:i,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function dl(e){return e==="indeterminate"}function OL(e){return dl(e)?"indeterminate":e?"checked":"unchecked"}const PL=Fme,Vme=zme,TL=V.forwardRef(({className:e,...t},n)=>O.jsx(PL,{ref:n,className:Ee("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:O.jsx(Vme,{className:Ee("flex items-center justify-center text-current"),children:O.jsx(Lf,{className:"h-4 w-4"})})}));TL.displayName=PL.displayName;const DL=m.forwardRef(({className:e,...t},n)=>O.jsx("div",{role:"editor-panel",ref:n,className:Ee("flex grow h-full",e),...t}));DL.displayName="EditorPanel";const $L=m.forwardRef(({className:e,...t},n)=>O.jsx("div",{ref:n,className:Ee(" flex flex-col space-y-2 w-[270px]",e),...t}));$L.displayName="EditorAside";const AL=m.forwardRef(({className:e,...t},n)=>O.jsx("div",{ref:n,className:Ee(" grow",e),...t}));AL.displayName="EditorMain";function Hme(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function E2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function R2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?E2(Object(n),!0).forEach(function(r){Hme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Wme(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function Ume(e,t){if(e==null)return{};var n=Wme(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)r=i[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function qme(e,t){return Gme(e)||Yme(e,t)||Kme(e,t)||Xme()}function Gme(e){if(Array.isArray(e))return e}function Yme(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,o=!1,i=void 0;try{for(var s=e[Symbol.iterator](),a;!(r=(a=s.next()).done)&&(n.push(a.value),!(t&&n.length===t));r=!0);}catch(l){o=!0,i=l}finally{try{!r&&s.return!=null&&s.return()}finally{if(o)throw i}}return n}}function Kme(e,t){if(e){if(typeof e=="string")return O2(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return O2(e,t)}}function O2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Xme(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
425
|
+
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return V.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},Zpe=v5,ege=b5,P5=y5,T5=x5,D5=E5,$5=O5,A5=_5,k5=C5;const tge=Zpe,nge=ege,M5=V.forwardRef(({className:e,...t},n)=>O.jsx(P5,{className:Ee("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));M5.displayName=P5.displayName;const I5=V.forwardRef(({className:e,...t},n)=>O.jsx(nge,{children:O.jsxs("div",{id:"semaphor-scope",children:[O.jsx(M5,{}),O.jsx(T5,{ref:n,className:Ee("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]})}));I5.displayName=T5.displayName;const N5=({className:e,...t})=>O.jsx("div",{className:Ee("flex flex-col space-y-2 text-center sm:text-left",e),...t});N5.displayName="AlertDialogHeader";const L5=({className:e,...t})=>O.jsx("div",{className:Ee("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});L5.displayName="AlertDialogFooter";const F5=V.forwardRef(({className:e,...t},n)=>O.jsx(A5,{ref:n,className:Ee("text-lg font-semibold",e),...t}));F5.displayName=A5.displayName;const j5=V.forwardRef(({className:e,...t},n)=>O.jsx(k5,{ref:n,className:Ee("text-sm text-muted-foreground",e),...t}));j5.displayName=k5.displayName;const z5=V.forwardRef(({className:e,...t},n)=>O.jsx(D5,{ref:n,className:Ee(Bd(),e),...t}));z5.displayName=D5.displayName;const B5=V.forwardRef(({className:e,...t},n)=>O.jsx($5,{ref:n,className:Ee(Bd({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));B5.displayName=$5.displayName;function rge({open:e,setOpen:t}){const n=ke(i=>i.selectedSheetId),{deleteSheet:r}=Mo();function o(){n&&(r(n),t(!1))}return O.jsx(tge,{open:e,onOpenChange:t,children:O.jsxs(I5,{children:[O.jsxs(N5,{children:[O.jsx(F5,{children:"Delete Sheet"}),O.jsx(j5,{children:"Are you sure you want to delete this sheet along with all its cards? This action cannot be undone."})]}),O.jsxs(L5,{children:[O.jsx(B5,{children:"Cancel"}),O.jsx(z5,{onClick:o,children:"Delete"})]})]})})}function V5(){var b,x;const[e,t]=m.useState(!1),n=ke(w=>{var _;return(_=w.dashboard)==null?void 0:_.sheets}),{showAssistant:r}=ma(),o=m.useRef(null),[i,s]=m.useState(!1),a=ke(w=>w.isDashboardEditing),l=ke(w=>w.themeStyle);ke(w=>w.isVisualEditing);const c=ke(w=>w.selectedSheetId),{setSelectedSheetId:u,setSheetTitle:f,addSheet:h}=Mo();if(!n)return null;function g(w){var _,S;w?((_=o.current)==null||_.resize(35),s(!0)):(s(!1),(S=o.current)==null||S.resize(0))}function v(){const w={id:la(),title:"New Sheet"};h(w)}return O.jsxs(MD,{role:"dashboard-tabs-container",className:Ee("relative flex grow",l==null?void 0:l.dashboardTabsContainer),onValueChange:w=>{u(w)},value:c||n[0].id,children:[O.jsxs(LN,{direction:"horizontal",children:[O.jsx(rw,{children:O.jsxs("div",{style:{},children:[(n.length>1||a)&&O.jsxs(Tw,{role:"tab-list",className:"flex h-11 items-center justify-start gap-2 rounded-none bg-transparent px-2.5 py-3",children:[n==null?void 0:n.map(w=>{var _,S;return O.jsx(is,{text:w.title,onSave:R=>f(w.id,R),children:O.jsxs(Dw,{style:{borderRadius:(S=(_=l==null?void 0:l.chart)==null?void 0:_.options)==null?void 0:S.borderRadius},onClick:()=>u(w.id),className:"flex items-center gap-1 rounded-none border px-2 py-1",value:w.id,children:[w.title,a&&c===w.id&&n.length>1&&O.jsx(Pm,{className:"ml-1 size-3",onClick:()=>t(!0)})]})},w.id)}),a&&O.jsx("div",{style:{borderRadius:(x=(b=l==null?void 0:l.chart)==null?void 0:b.options)==null?void 0:x.borderRadius},className:"flex h-7 items-center justify-center border-none bg-muted p-2 hover:cursor-pointer dark:border-l-background",onClick:v,children:O.jsx(C1,{className:"size-3"})})]}),n==null?void 0:n.map(w=>O.jsx($w,{className:Ee("mt-0",{"bg-muted":(l==null?void 0:l.canvasTheme)==="muted"||!(l!=null&&l.canvasTheme)}),value:w.id,children:O.jsx(Sae,{})},w.id))]})}),r===!0&&O.jsxs(O.Fragment,{children:[O.jsx(Fhe,{open:i,onTabClick:g,withHandle:!0}),O.jsx(rw,{onResize:w=>{w<1?s(!1):i||s(!0)},defaultSize:0,ref:o,children:O.jsx(vhe,{})})]})]}),O.jsx(rge,{open:e,setOpen:t})]})}function H5({children:e}){return O.jsx(gB,{defaultTheme:"system",storageKey:"vite-ui-theme",children:O.jsx(RJ,{delayDuration:0,children:e})})}function W5(e){return O.jsx(lk,{dashboardProps:e,children:O.jsx(H5,{children:O.jsx(_D,{...e,children:O.jsx(V5,{})})})})}const U5=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(ige);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(sw,he({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(sw,he({},r,{ref:t}),n)});U5.displayName="Slot";const sw=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...sge(r,n.props),ref:t?cs(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});sw.displayName="SlotClone";const oge=({children:e})=>m.createElement(m.Fragment,null,e);function ige(e){return m.isValidElement(e)&&e.type===oge}function sge(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 aw=["Enter"," "],age=["ArrowDown","PageUp","Home"],q5=["ArrowUp","PageDown","End"],lge=[...age,...q5],cge={ltr:[...aw,"ArrowRight"],rtl:[...aw,"ArrowLeft"]},uge={ltr:["ArrowLeft"],rtl:["ArrowRight"]},av="Menu",[df,dge,fge]=lm(av),[Al,G5]=Zn(av,[fge,Ti,ou]),oS=Ti(),Y5=ou(),[hge,kl]=Al(av),[pge,Zf]=Al(av),gge=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:s=!0}=e,a=oS(t),[l,c]=m.useState(null),u=m.useRef(!1),f=Ln(i),h=_l(o);return m.useEffect(()=>{const g=()=>{u.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>u.current=!1;return document.addEventListener("keydown",g,{capture:!0}),()=>{document.removeEventListener("keydown",g,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),m.createElement(zf,a,m.createElement(hge,{scope:t,open:n,onOpenChange:f,content:l,onContentChange:c},m.createElement(pge,{scope:t,onClose:m.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:u,dir:h,modal:s},r)))},K5=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=oS(n);return m.createElement(Bf,he({},o,r,{ref:t}))}),X5="MenuPortal",[mge,Q5]=Al(X5,{forceMount:void 0}),vge=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,i=kl(X5,t);return m.createElement(mge,{scope:t,forceMount:n},m.createElement(er,{present:n||i.open},m.createElement(A1,{asChild:!0,container:o},r)))},Qo="MenuContent",[bge,iS]=Al(Qo),yge=m.forwardRef((e,t)=>{const n=Q5(Qo,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=kl(Qo,e.__scopeMenu),s=Zf(Qo,e.__scopeMenu);return m.createElement(df.Provider,{scope:e.__scopeMenu},m.createElement(er,{present:r||i.open},m.createElement(df.Slot,{scope:e.__scopeMenu},s.modal?m.createElement(xge,he({},o,{ref:t})):m.createElement(wge,he({},o,{ref:t})))))}),xge=m.forwardRef((e,t)=>{const n=kl(Qo,e.__scopeMenu),r=m.useRef(null),o=_t(t,r);return m.useEffect(()=>{const i=r.current;if(i)return Nm(i)},[]),m.createElement(sS,he({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Me(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))}),wge=m.forwardRef((e,t)=>{const n=kl(Qo,e.__scopeMenu);return m.createElement(sS,he({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))}),sS=m.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:h,onDismiss:g,disableOutsideScroll:v,...b}=e,x=kl(Qo,n),w=Zf(Qo,n),_=oS(n),S=Y5(n),R=dge(n),[C,P]=m.useState(null),A=m.useRef(null),k=_t(t,A,x.onContentChange),D=m.useRef(0),I=m.useRef(""),F=m.useRef(0),B=m.useRef(null),K=m.useRef("right"),Z=m.useRef(0),z=v?t_:m.Fragment,Q=v?{as:U5,allowPinchZoom:!0}:void 0,W=oe=>{var $,H;const J=I.current+oe,N=R().filter(te=>!te.disabled),ce=document.activeElement,le=($=N.find(te=>te.ref.current===ce))===null||$===void 0?void 0:$.textValue,de=N.map(te=>te.textValue),pe=zge(de,J,le),ie=(H=N.find(te=>te.textValue===pe))===null||H===void 0?void 0:H.ref.current;(function te(ae){I.current=ae,window.clearTimeout(D.current),ae!==""&&(D.current=window.setTimeout(()=>te(""),1e3))})(J),ie&&setTimeout(()=>ie.focus())};m.useEffect(()=>()=>window.clearTimeout(D.current),[]),Q1();const Y=m.useCallback(oe=>{var $,H;return K.current===(($=B.current)===null||$===void 0?void 0:$.side)&&Vge(oe,(H=B.current)===null||H===void 0?void 0:H.area)},[]);return m.createElement(bge,{scope:n,searchRef:I,onItemEnter:m.useCallback(oe=>{Y(oe)&&oe.preventDefault()},[Y]),onItemLeave:m.useCallback(oe=>{var $;Y(oe)||(($=A.current)===null||$===void 0||$.focus(),P(null))},[Y]),onTriggerLeave:m.useCallback(oe=>{Y(oe)&&oe.preventDefault()},[Y]),pointerGraceTimerRef:F,onPointerGraceIntentChange:m.useCallback(oe=>{B.current=oe},[])},m.createElement(z,Q,m.createElement(J1,{asChild:!0,trapped:o,onMountAutoFocus:Me(i,oe=>{var $;oe.preventDefault(),($=A.current)===null||$===void 0||$.focus()}),onUnmountAutoFocus:s},m.createElement(Ff,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:h,onDismiss:g},m.createElement(Rw,he({asChild:!0},S,{dir:w.dir,orientation:"vertical",loop:r,currentTabStopId:C,onCurrentTabStopIdChange:P,onEntryFocus:Me(l,oe=>{w.isUsingKeyboardRef.current||oe.preventDefault()})}),m.createElement(Vf,he({role:"menu","aria-orientation":"vertical","data-state":nL(x.open),"data-radix-menu-content":"",dir:w.dir},_,b,{ref:k,style:{outline:"none",...b.style},onKeyDown:Me(b.onKeyDown,oe=>{const H=oe.target.closest("[data-radix-menu-content]")===oe.currentTarget,J=oe.ctrlKey||oe.altKey||oe.metaKey,N=oe.key.length===1;H&&(oe.key==="Tab"&&oe.preventDefault(),!J&&N&&W(oe.key));const ce=A.current;if(oe.target!==ce||!lge.includes(oe.key))return;oe.preventDefault();const de=R().filter(pe=>!pe.disabled).map(pe=>pe.ref.current);q5.includes(oe.key)&&de.reverse(),Fge(de)}),onBlur:Me(e.onBlur,oe=>{oe.currentTarget.contains(oe.target)||(window.clearTimeout(D.current),I.current="")}),onPointerMove:Me(e.onPointerMove,ff(oe=>{const $=oe.target,H=Z.current!==oe.clientX;if(oe.currentTarget.contains($)&&H){const J=oe.clientX>Z.current?"right":"left";K.current=J,Z.current=oe.clientX}}))})))))))}),_ge=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(Qe.div,he({role:"group"},r,{ref:t}))}),Sge=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(Qe.div,he({},r,{ref:t}))}),lw="MenuItem",C2="menu.itemSelect",aS=m.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,i=m.useRef(null),s=Zf(lw,e.__scopeMenu),a=iS(lw,e.__scopeMenu),l=_t(t,i),c=m.useRef(!1),u=()=>{const f=i.current;if(!n&&f){const h=new CustomEvent(C2,{bubbles:!0,cancelable:!0});f.addEventListener(C2,g=>r==null?void 0:r(g),{once:!0}),CD(f,h),h.defaultPrevented?c.current=!1:s.onClose()}};return m.createElement(J5,he({},o,{ref:l,disabled:n,onClick:Me(e.onClick,u),onPointerDown:f=>{var h;(h=e.onPointerDown)===null||h===void 0||h.call(e,f),c.current=!0},onPointerUp:Me(e.onPointerUp,f=>{var h;c.current||(h=f.currentTarget)===null||h===void 0||h.click()}),onKeyDown:Me(e.onKeyDown,f=>{const h=a.searchRef.current!=="";n||h&&f.key===" "||aw.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})}))}),J5=m.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=e,s=iS(lw,n),a=Y5(n),l=m.useRef(null),c=_t(t,l),[u,f]=m.useState(!1),[h,g]=m.useState("");return m.useEffect(()=>{const v=l.current;if(v){var b;g(((b=v.textContent)!==null&&b!==void 0?b:"").trim())}},[i.children]),m.createElement(df.ItemSlot,{scope:n,disabled:r,textValue:o??h},m.createElement(Ow,he({asChild:!0},a,{focusable:!r}),m.createElement(Qe.div,he({role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},i,{ref:c,onPointerMove:Me(e.onPointerMove,ff(v=>{r?s.onItemLeave(v):(s.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus())})),onPointerLeave:Me(e.onPointerLeave,ff(v=>s.onItemLeave(v))),onFocus:Me(e.onFocus,()=>f(!0)),onBlur:Me(e.onBlur,()=>f(!1))}))))}),Cge=m.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return m.createElement(eL,{scope:e.__scopeMenu,checked:n},m.createElement(aS,he({role:"menuitemcheckbox","aria-checked":Xg(n)?"mixed":n},o,{ref:t,"data-state":lS(n),onSelect:Me(o.onSelect,()=>r==null?void 0:r(Xg(n)?!0:!n),{checkForDefaultPrevented:!1})})))}),Ege="MenuRadioGroup",[Rge,Oge]=Al(Ege,{value:void 0,onValueChange:()=>{}}),Pge=m.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,i=Ln(r);return m.createElement(Rge,{scope:e.__scopeMenu,value:n,onValueChange:i},m.createElement(_ge,he({},o,{ref:t})))}),Tge="MenuRadioItem",Dge=m.forwardRef((e,t)=>{const{value:n,...r}=e,o=Oge(Tge,e.__scopeMenu),i=n===o.value;return m.createElement(eL,{scope:e.__scopeMenu,checked:i},m.createElement(aS,he({role:"menuitemradio","aria-checked":i},r,{ref:t,"data-state":lS(i),onSelect:Me(r.onSelect,()=>{var s;return(s=o.onValueChange)===null||s===void 0?void 0:s.call(o,n)},{checkForDefaultPrevented:!1})})))}),Z5="MenuItemIndicator",[eL,$ge]=Al(Z5,{checked:!1}),Age=m.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,i=$ge(Z5,n);return m.createElement(er,{present:r||Xg(i.checked)||i.checked===!0},m.createElement(Qe.span,he({},o,{ref:t,"data-state":lS(i.checked)})))}),kge=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(Qe.div,he({role:"separator","aria-orientation":"horizontal"},r,{ref:t}))}),Mge="MenuSub",[wye,tL]=Al(Mge),Vp="MenuSubTrigger",Ige=m.forwardRef((e,t)=>{const n=kl(Vp,e.__scopeMenu),r=Zf(Vp,e.__scopeMenu),o=tL(Vp,e.__scopeMenu),i=iS(Vp,e.__scopeMenu),s=m.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=i,c={__scopeMenu:e.__scopeMenu},u=m.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return m.useEffect(()=>u,[u]),m.useEffect(()=>{const f=a.current;return()=>{window.clearTimeout(f),l(null)}},[a,l]),m.createElement(K5,he({asChild:!0},c),m.createElement(J5,he({id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":nL(n.open)},e,{ref:cs(t,o.onTriggerChange),onClick:f=>{var h;(h=e.onClick)===null||h===void 0||h.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Me(e.onPointerMove,ff(f=>{i.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(i.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:Me(e.onPointerLeave,ff(f=>{var h;u();const g=(h=n.content)===null||h===void 0?void 0:h.getBoundingClientRect();if(g){var v;const b=(v=n.content)===null||v===void 0?void 0:v.dataset.side,x=b==="right",w=x?-5:5,_=g[x?"left":"right"],S=g[x?"right":"left"];i.onPointerGraceIntentChange({area:[{x:f.clientX+w,y:f.clientY},{x:_,y:g.top},{x:S,y:g.top},{x:S,y:g.bottom},{x:_,y:g.bottom}],side:b}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(f),f.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:Me(e.onKeyDown,f=>{const h=i.searchRef.current!=="";if(!(e.disabled||h&&f.key===" ")&&cge[r.dir].includes(f.key)){var g;n.onOpenChange(!0),(g=n.content)===null||g===void 0||g.focus(),f.preventDefault()}})})))}),Nge="MenuSubContent",Lge=m.forwardRef((e,t)=>{const n=Q5(Qo,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=kl(Qo,e.__scopeMenu),s=Zf(Qo,e.__scopeMenu),a=tL(Nge,e.__scopeMenu),l=m.useRef(null),c=_t(t,l);return m.createElement(df.Provider,{scope:e.__scopeMenu},m.createElement(er,{present:r||i.open},m.createElement(df.Slot,{scope:e.__scopeMenu},m.createElement(sS,he({id:a.contentId,"aria-labelledby":a.triggerId},o,{ref:c,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var f;s.isUsingKeyboardRef.current&&((f=l.current)===null||f===void 0||f.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:Me(e.onFocusOutside,u=>{u.target!==a.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:Me(e.onEscapeKeyDown,u=>{s.onClose(),u.preventDefault()}),onKeyDown:Me(e.onKeyDown,u=>{const f=u.currentTarget.contains(u.target),h=uge[s.dir].includes(u.key);if(f&&h){var g;i.onOpenChange(!1),(g=a.trigger)===null||g===void 0||g.focus(),u.preventDefault()}})})))))});function nL(e){return e?"open":"closed"}function Xg(e){return e==="indeterminate"}function lS(e){return Xg(e)?"indeterminate":e?"checked":"unchecked"}function Fge(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function jge(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function zge(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=jge(e,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function Bge(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const a=t[i].x,l=t[i].y,c=t[s].x,u=t[s].y;l>r!=u>r&&n<(c-a)*(r-l)/(u-l)+a&&(o=!o)}return o}function Vge(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Bge(n,t)}function ff(e){return t=>t.pointerType==="mouse"?e(t):void 0}const Hge=gge,Wge=K5,Uge=vge,qge=yge,Gge=Sge,Yge=aS,Kge=Cge,Xge=Pge,Qge=Dge,Jge=Age,Zge=kge,eme=Ige,tme=Lge,rL="DropdownMenu",[nme,_ye]=Zn(rL,[G5]),ho=G5(),[rme,oL]=nme(rL),ome=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:s,modal:a=!0}=e,l=ho(t),c=m.useRef(null),[u=!1,f]=xr({prop:o,defaultProp:i,onChange:s});return m.createElement(rme,{scope:t,triggerId:Jo(),triggerRef:c,contentId:Jo(),open:u,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(h=>!h),[f]),modal:a},m.createElement(Hge,he({},l,{open:u,onOpenChange:f,dir:r,modal:a}),n))},ime="DropdownMenuTrigger",sme=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,i=oL(ime,n),s=ho(n);return m.createElement(Wge,he({asChild:!0},s),m.createElement(Qe.button,he({type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r},o,{ref:cs(t,i.triggerRef),onPointerDown:Me(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(i.onOpenToggle(),i.open||a.preventDefault())}),onKeyDown:Me(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&i.onOpenToggle(),a.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})))}),ame=e=>{const{__scopeDropdownMenu:t,...n}=e,r=ho(t);return m.createElement(Uge,he({},r,n))},lme="DropdownMenuContent",cme=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=oL(lme,n),i=ho(n),s=m.useRef(!1);return m.createElement(qge,he({id:o.contentId,"aria-labelledby":o.triggerId},i,r,{ref:t,onCloseAutoFocus:Me(e.onCloseAutoFocus,a=>{var l;s.current||(l=o.triggerRef.current)===null||l===void 0||l.focus(),s.current=!1,a.preventDefault()}),onInteractOutside:Me(e.onInteractOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;(!o.modal||u)&&(s.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),ume=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ho(n);return m.createElement(Gge,he({},o,r,{ref:t}))}),dme=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ho(n);return m.createElement(Yge,he({},o,r,{ref:t}))}),fme=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ho(n);return m.createElement(Kge,he({},o,r,{ref:t}))}),hme=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ho(n);return m.createElement(Xge,he({},o,r,{ref:t}))}),pme=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ho(n);return m.createElement(Qge,he({},o,r,{ref:t}))}),gme=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ho(n);return m.createElement(Jge,he({},o,r,{ref:t}))}),mme=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ho(n);return m.createElement(Zge,he({},o,r,{ref:t}))}),vme=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ho(n);return m.createElement(eme,he({},o,r,{ref:t}))}),bme=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ho(n);return m.createElement(tme,he({},o,r,{ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),yme=ome,xme=sme,wme=ame,iL=cme,sL=ume,aL=dme,lL=fme,_me=hme,cL=pme,uL=gme,dL=mme,fL=vme,hL=bme,Sme=yme,Cme=xme,Eme=_me,Rme=V.forwardRef(({className:e,inset:t,children:n,...r},o)=>O.jsxs(fL,{ref:o,className:Ee("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...r,children:[n,O.jsx(_1,{className:"ml-auto h-4 w-4"})]}));Rme.displayName=fL.displayName;const Ome=V.forwardRef(({className:e,...t},n)=>O.jsx(hL,{ref:n,className:Ee("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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),...t}));Ome.displayName=hL.displayName;const pL=V.forwardRef(({className:e,sideOffset:t=4,...n},r)=>O.jsx(wme,{children:O.jsx("div",{id:"semaphor-scope",children:O.jsx(iL,{ref:r,sideOffset:t,className:Ee("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 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",e),...n})})}));pL.displayName=iL.displayName;const Pme=V.forwardRef(({className:e,inset:t,...n},r)=>O.jsx(aL,{ref:r,className:Ee("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));Pme.displayName=aL.displayName;const Tme=V.forwardRef(({className:e,children:t,checked:n,...r},o)=>O.jsxs(lL,{ref:o,className:Ee("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[O.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:O.jsx(uL,{children:O.jsx(Lf,{className:"h-4 w-4"})})}),t]}));Tme.displayName=lL.displayName;const gL=V.forwardRef(({className:e,children:t,...n},r)=>O.jsxs(cL,{ref:r,className:Ee("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[O.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:O.jsx(uL,{children:O.jsx(MA,{className:"h-2 w-2 fill-current"})})}),t]}));gL.displayName=cL.displayName;const mL=V.forwardRef(({className:e,inset:t,...n},r)=>O.jsx(sL,{ref:r,className:Ee("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));mL.displayName=sL.displayName;const vL=V.forwardRef(({className:e,...t},n)=>O.jsx(dL,{ref:n,className:Ee("-mx-1 my-1 h-px bg-muted",e),...t}));vL.displayName=dL.displayName;function Dme(e){var t;return{...e,sheets:(t=e==null?void 0:e.sheets)==null?void 0:t.map(n=>{var r;return{...n,frames:(r=n.frames)==null?void 0:r.map(o=>{var i;return{...o,cards:(i=o.cards)==null?void 0:i.map(s=>bL(s))}})}})}}function bL(e){var t,n,r,o;return{...e,cfg:{...e.cfg,data:{...(t=e.cfg)==null?void 0:t.data,labels:[],datasets:(o=(r=(n=e.cfg)==null?void 0:n.data)==null?void 0:r.datasets)==null?void 0:o.map(i=>({...i,data:[]}))}},customCfg:$me(e.customCfg),data:[]}}function $me(e){var t,n;return e?{...e,data:{...e==null?void 0:e.data,labels:[],datasets:(n=(t=e==null?void 0:e.data)==null?void 0:t.datasets)==null?void 0:n.map(r=>({...r,data:[]}))}}:null}function yL(e){return`semaphor:bookmark:${e}`}const Ame=h5,kme=p5,Mme=g5,xL=V.forwardRef(({className:e,...t},n)=>O.jsx(Z_,{ref:n,className:Ee("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));xL.displayName=Z_.displayName;const wL=V.forwardRef(({className:e,children:t,...n},r)=>O.jsx(Mme,{children:O.jsxs("div",{id:"semaphor-scope",children:[O.jsx(xL,{}),O.jsxs(eS,{ref:r,className:Ee("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,O.jsxs(rS,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[O.jsx(Pm,{className:"h-4 w-4"}),O.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}));wL.displayName=eS.displayName;const _L=({className:e,...t})=>O.jsx("div",{className:Ee("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});_L.displayName="DialogHeader";const SL=({className:e,...t})=>O.jsx("div",{className:Ee("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});SL.displayName="DialogFooter";const CL=V.forwardRef(({className:e,...t},n)=>O.jsx(tS,{ref:n,className:Ee("text-lg font-semibold leading-none tracking-tight",e),...t}));CL.displayName=tS.displayName;const EL=V.forwardRef(({className:e,...t},n)=>O.jsx(nS,{ref:n,className:Ee("text-sm text-muted-foreground",e),...t}));EL.displayName=nS.displayName;const RL="Checkbox",[Ime,Sye]=Zn(RL),[Nme,Lme]=Ime(RL),Fme=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:i,required:s,disabled:a,value:l="on",onCheckedChange:c,...u}=e,[f,h]=m.useState(null),g=_t(t,S=>h(S)),v=m.useRef(!1),b=f?!!f.closest("form"):!0,[x=!1,w]=xr({prop:o,defaultProp:i,onChange:c}),_=m.useRef(x);return m.useEffect(()=>{const S=f==null?void 0:f.form;if(S){const R=()=>w(_.current);return S.addEventListener("reset",R),()=>S.removeEventListener("reset",R)}},[f,w]),m.createElement(Nme,{scope:n,state:x,disabled:a},m.createElement(Qe.button,he({type:"button",role:"checkbox","aria-checked":dl(x)?"mixed":x,"aria-required":s,"data-state":OL(x),"data-disabled":a?"":void 0,disabled:a,value:l},u,{ref:g,onKeyDown:Me(e.onKeyDown,S=>{S.key==="Enter"&&S.preventDefault()}),onClick:Me(e.onClick,S=>{w(R=>dl(R)?!0:!R),b&&(v.current=S.isPropagationStopped(),v.current||S.stopPropagation())})})),b&&m.createElement(Bme,{control:f,bubbles:!v.current,name:r,value:l,checked:x,required:s,disabled:a,style:{transform:"translateX(-100%)"}}))}),jme="CheckboxIndicator",zme=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,i=Lme(jme,n);return m.createElement(er,{present:r||dl(i.state)||i.state===!0},m.createElement(Qe.span,he({"data-state":OL(i.state),"data-disabled":i.disabled?"":void 0},o,{ref:t,style:{pointerEvents:"none",...e.style}})))}),Bme=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=m.useRef(null),s=Im(n),a=$m(t);return m.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&f){const h=new Event("click",{bubbles:r});l.indeterminate=dl(n),f.call(l,dl(n)?!1:n),l.dispatchEvent(h)}},[s,n,r]),m.createElement("input",he({type:"checkbox","aria-hidden":!0,defaultChecked:dl(n)?!1:n},o,{tabIndex:-1,ref:i,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function dl(e){return e==="indeterminate"}function OL(e){return dl(e)?"indeterminate":e?"checked":"unchecked"}const PL=Fme,Vme=zme,TL=V.forwardRef(({className:e,...t},n)=>O.jsx(PL,{ref:n,className:Ee("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:O.jsx(Vme,{className:Ee("flex items-center justify-center text-current"),children:O.jsx(Lf,{className:"h-4 w-4"})})}));TL.displayName=PL.displayName;const DL=m.forwardRef(({className:e,...t},n)=>O.jsx("div",{role:"editor-panel",ref:n,className:Ee("flex grow h-full",e),...t}));DL.displayName="EditorPanel";const $L=m.forwardRef(({className:e,...t},n)=>O.jsx("div",{ref:n,className:Ee(" flex flex-col space-y-2 w-[270px]",e),...t}));$L.displayName="EditorAside";const AL=m.forwardRef(({className:e,...t},n)=>O.jsx("div",{ref:n,className:Ee(" grow",e),...t}));AL.displayName="EditorMain";function Hme(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function E2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function R2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?E2(Object(n),!0).forEach(function(r){Hme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Wme(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function Ume(e,t){if(e==null)return{};var n=Wme(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)r=i[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function qme(e,t){return Gme(e)||Yme(e,t)||Kme(e,t)||Xme()}function Gme(e){if(Array.isArray(e))return e}function Yme(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,o=!1,i=void 0;try{for(var s=e[Symbol.iterator](),a;!(r=(a=s.next()).done)&&(n.push(a.value),!(t&&n.length===t));r=!0);}catch(l){o=!0,i=l}finally{try{!r&&s.return!=null&&s.return()}finally{if(o)throw i}}return n}}function Kme(e,t){if(e){if(typeof e=="string")return O2(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return O2(e,t)}}function O2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Xme(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
426
426
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Qme(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function P2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function T2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?P2(Object(n),!0).forEach(function(r){Qme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Jme(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){return t.reduceRight(function(o,i){return i(o)},r)}}function ld(e){return function t(){for(var n=this,r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return o.length>=e.length?e.apply(this,o):function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];return t.apply(n,[].concat(o,a))}}}function Qg(e){return{}.toString.call(e).includes("Object")}function Zme(e){return!Object.keys(e).length}function hf(e){return typeof e=="function"}function eve(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function tve(e,t){return Qg(t)||ia("changeType"),Object.keys(t).some(function(n){return!eve(e,n)})&&ia("changeField"),t}function nve(e){hf(e)||ia("selectorType")}function rve(e){hf(e)||Qg(e)||ia("handlerType"),Qg(e)&&Object.values(e).some(function(t){return!hf(t)})&&ia("handlersType")}function ove(e){e||ia("initialIsRequired"),Qg(e)||ia("initialType"),Zme(e)&&ia("initialContent")}function ive(e,t){throw new Error(e[t]||e.default)}var sve={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},ia=ld(ive)(sve),Hp={changes:tve,selector:nve,handler:rve,initial:ove};function ave(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Hp.initial(e),Hp.handler(t);var n={current:e},r=ld(uve)(n,t),o=ld(cve)(n),i=ld(Hp.changes)(e),s=ld(lve)(n);function a(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(u){return u};return Hp.selector(c),c(n.current)}function l(c){Jme(r,o,i,s)(c)}return[a,l]}function lve(e,t){return hf(t)?t(e.current):t}function cve(e,t){return e.current=T2(T2({},e.current),t),t}function uve(e,t,n){return hf(t)?t(e.current):Object.keys(n).forEach(function(r){var o;return(o=t[r])===null||o===void 0?void 0:o.call(t,e.current[r])}),n}var dve={create:ave},fve={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs"}};function hve(e){return function t(){for(var n=this,r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return o.length>=e.length?e.apply(this,o):function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];return t.apply(n,[].concat(o,a))}}}function pve(e){return{}.toString.call(e).includes("Object")}function gve(e){return e||D2("configIsRequired"),pve(e)||D2("configType"),e.urls?(mve(),{paths:{vs:e.urls.monacoBase}}):e}function mve(){console.warn(kL.deprecation)}function vve(e,t){throw new Error(e[t]||e.default)}var kL={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
|
|
427
427
|
You are using deprecated way of configuration.
|
|
428
428
|
|