chordia-ui 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,34 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Q=require("./Timeline.cjs.js"),r=require("react/jsx-runtime"),l=require("react"),R=require("lucide-react"),Ge=require("react-dom");require("recharts");var Bt=typeof document<"u"?document.currentScript:null;function Qr({colors:e=[]}){const t=e.reduce((n,o)=>(n[o.category]||(n[o.category]=[]),n[o.category].push(o),n),{});return r.jsx("div",{style:{fontFamily:"system-ui, -apple-system, sans-serif"},children:Object.entries(t).map(([n,o])=>r.jsxs("div",{style:{marginBottom:"24px"},children:[r.jsx("div",{style:{fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",marginBottom:"12px",color:"rgba(30, 33, 37, 0.62)",fontWeight:650},children:n}),r.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(220px, 1fr))",gap:"12px"},children:o.map((i,s)=>r.jsxs("div",{style:{border:"1px solid rgba(52, 58, 64, 0.12)",borderRadius:"12px",overflow:"hidden",background:"rgba(255, 255, 255, 0.72)"},children:[r.jsx("div",{style:{height:"64px",background:i.hex,borderBottom:"1px solid rgba(52, 58, 64, 0.10)"}}),r.jsxs("div",{style:{padding:"10px 12px"},children:[r.jsx("div",{style:{fontSize:"13px",fontWeight:680,color:"rgba(30, 33, 37, 0.92)",marginBottom:"4px"},children:i.name}),r.jsx("div",{style:{fontSize:"11.5px",fontFamily:"ui-monospace, monospace",color:"rgba(30, 33, 37, 0.52)",marginBottom:"6px"},children:i.hex}),r.jsx("div",{style:{fontSize:"11.5px",color:"rgba(30, 33, 37, 0.62)",lineHeight:1.4},children:i.usage})]})]},s))})]},n))})}function qr({tabs:e=[],active:t,onSelect:n,size:o="default"}){const i=o==="compact";return r.jsx("div",{style:{display:"flex",borderBottom:"1px solid var(--border)",background:"var(--paper)",flexShrink:0,overflowX:"auto"},children:e.map(s=>{const c=s.key===t;return r.jsx("button",{onClick:()=>n==null?void 0:n(s.key),style:{padding:i?"8px 12px":"10px 16px",fontSize:i?"var(--text-md)":"var(--text-lg)",fontWeight:"var(--font-medium)",fontFamily:"var(--font-sans)",whiteSpace:"nowrap",cursor:"pointer",background:"none",color:c?"var(--text-ink)":"var(--text-muted)",borderTop:"none",borderLeft:"none",borderRight:"none",borderBottom:c?"2px solid var(--text-ink)":"2px solid transparent",transition:"color 0.15s, border-color 0.15s",letterSpacing:"-0.01em"},onMouseEnter:a=>{c||(a.currentTarget.style.color="var(--text-strong)")},onMouseLeave:a=>{c||(a.currentTarget.style.color="var(--text-muted)")},children:s.label},s.key)})})}function Kr({children:e,color:t,icon:n,...o}){const s={...{fontSize:"var(--text-xs)",padding:"1px 5px",borderRadius:"var(--radius-sm)",display:"inline-flex",alignItems:"center"},color:t,backgroundColor:`color-mix(in srgb, ${t} 15%, transparent)`,...o.style};return r.jsxs("span",{style:s,...o,children:[n&&r.jsx("span",{style:{marginRight:"3px"},children:n}),e]})}function $r({checked:e=!1,onChange:t,label:n,size:o="md",disabled:i=!1,style:s,...c}){const a=o==="sm"?12:16,u=o==="sm"?8:11;return r.jsxs("label",{style:{display:"inline-flex",alignItems:"center",gap:o==="sm"?3:"var(--spacing-2)",fontSize:o==="sm"?"var(--text-xs)":"var(--text-sm)",color:i?"var(--text-faint)":"var(--text-base)",cursor:i?"not-allowed":"pointer",userSelect:"none",...s},onClick:g=>{g.preventDefault(),!i&&t&&t(!e)},...c,children:[r.jsx("span",{style:{width:a,height:a,borderRadius:o==="sm"?2:3,border:`1px solid ${e?"var(--text-ink)":"var(--border)"}`,background:e?"var(--text-ink)":"transparent",display:"inline-flex",alignItems:"center",justifyContent:"center",transition:"var(--transition-fast)",flexShrink:0,opacity:i?.5:1},children:e&&r.jsx(R.Check,{size:u,style:{color:"white"},strokeWidth:3})}),n]})}const Zr={width:"100%",padding:"var(--spacing-2)",fontSize:"var(--text-md)",border:"1px solid var(--border)",borderRadius:"var(--radius)",backgroundColor:"var(--paper)",color:"var(--text-base)",fontFamily:"var(--font-sans)",outline:"none",transition:"border-color 0.15s ease"};function _r({value:e,onChange:t,placeholder:n,disabled:o=!1,mono:i=!1,autoFocus:s=!1,style:c,...a}){return r.jsx("input",{type:"text",value:e,onChange:u=>t==null?void 0:t(u.target.value),placeholder:n,disabled:o,autoFocus:s,style:{...Zr,...i?{fontFamily:"var(--font-mono)"}:{},...o?{opacity:.6,cursor:"not-allowed"}:{},...c},onFocus:u=>{u.currentTarget.style.borderColor="var(--border-hover)"},onBlur:u=>{u.currentTarget.style.borderColor="var(--border)"},...a})}const en={width:"100%",padding:"var(--spacing-2)",fontSize:"var(--text-md)",border:"1px solid var(--border)",borderRadius:"var(--radius)",backgroundColor:"var(--paper)",color:"var(--text-base)",fontFamily:"var(--font-sans)",outline:"none",transition:"border-color 0.15s ease"};function tn({value:e,onChange:t,placeholder:n,disabled:o=!1,mono:i=!1,rows:s=4,resize:c=!0,style:a,...u}){return r.jsx("textarea",{value:e,onChange:g=>t==null?void 0:t(g.target.value),placeholder:n,disabled:o,rows:s,style:{...en,resize:c?"vertical":"none",minHeight:s*20,...i?{fontFamily:"var(--font-mono)"}:{},...o?{opacity:.6,cursor:"not-allowed"}:{},...a},onFocus:g=>{g.currentTarget.style.borderColor="var(--border-hover)"},onBlur:g=>{g.currentTarget.style.borderColor="var(--border)"},...u})}const rn={width:"100%",padding:"var(--spacing-1) var(--spacing-2)",fontSize:"var(--text-md)",border:"1px solid var(--border)",borderRadius:"var(--radius)",backgroundColor:"var(--paper)",color:"var(--text-base)",fontFamily:"var(--font-sans)",cursor:"pointer",outline:"none",transition:"border-color 0.15s ease"};function nn({value:e,onChange:t,options:n=[],disabled:o=!1,placeholder:i,style:s,...c}){return r.jsxs("select",{value:e,onChange:a=>t==null?void 0:t(a.target.value),disabled:o,style:{...rn,...o?{opacity:.6,cursor:"not-allowed"}:{},...s},onFocus:a=>{a.currentTarget.style.borderColor="var(--border-hover)"},onBlur:a=>{a.currentTarget.style.borderColor="var(--border)"},...c,children:[i&&r.jsx("option",{value:"",children:i}),n.map(a=>r.jsx("option",{value:a.value,children:a.label},a.value))]})}function on({children:e,htmlFor:t,style:n}){return r.jsx("label",{htmlFor:t,style:{display:"block",fontSize:"var(--text-base)",color:"var(--text-muted)",marginBottom:"var(--spacing-1)",fontFamily:"var(--font-sans)",...n},children:e})}function sn({children:e,onConfirm:t,prompt:n="Delete?",confirmLabel:o="Yes",cancelLabel:i="No",style:s}){const[c,a]=l.useState(!1);return c?r.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"var(--spacing-1)",...s},children:[r.jsx("span",{style:{fontSize:"var(--text-sm)",color:"var(--text-muted)"},children:n}),r.jsx(Q.SmallButton,{variant:"ghost",size:"sm",onClick:u=>{u.stopPropagation(),t==null||t(),a(!1)},style:{color:"var(--text-ink)",fontWeight:"var(--font-semibold)"},children:o}),r.jsx(Q.SmallButton,{variant:"ghost",size:"sm",onClick:u=>{u.stopPropagation(),a(!1)},children:i})]}):r.jsx("span",{onClick:u=>{u.stopPropagation(),a(!0)},style:{cursor:"pointer",...s},children:e})}function an(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return l.useMemo(()=>o=>{t.forEach(i=>i(o))},t)}const Ct=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Qe(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Gt(e){return"nodeType"in e}function de(e){var t,n;return e?Qe(e)?e:Gt(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Jt(e){const{Document:t}=de(e);return e instanceof t}function at(e){return Qe(e)?!1:e instanceof de(e).HTMLElement}function xr(e){return e instanceof de(e).SVGElement}function qe(e){return e?Qe(e)?e.document:Gt(e)?Jt(e)?e:at(e)||xr(e)?e.ownerDocument:document:document:document}const we=Ct?l.useLayoutEffect:l.useEffect;function kt(e){const t=l.useRef(e);return we(()=>{t.current=e}),l.useCallback(function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return t.current==null?void 0:t.current(...o)},[])}function ln(){const e=l.useRef(null),t=l.useCallback((o,i)=>{e.current=setInterval(o,i)},[]),n=l.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function ot(e,t){t===void 0&&(t=[e]);const n=l.useRef(e);return we(()=>{n.current!==e&&(n.current=e)},t),n}function lt(e,t){const n=l.useRef();return l.useMemo(()=>{const o=e(n.current);return n.current=o,o},[...t])}function vt(e){const t=kt(e),n=l.useRef(null),o=l.useCallback(i=>{i!==n.current&&(t==null||t(i,n.current)),n.current=i},[]);return[n,o]}function mt(e){const t=l.useRef();return l.useEffect(()=>{t.current=e},[e]),t.current}let Lt={};function ct(e,t){return l.useMemo(()=>{if(t)return t;const n=Lt[e]==null?0:Lt[e]+1;return Lt[e]=n,e+"-"+n},[e,t])}function hr(e){return function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return o.reduce((s,c)=>{const a=Object.entries(c);for(const[u,g]of a){const x=s[u];x!=null&&(s[u]=x+e*g)}return s},{...t})}}const Je=hr(1),it=hr(-1);function cn(e){return"clientX"in e&&"clientY"in e}function Rt(e){if(!e)return!1;const{KeyboardEvent:t}=de(e.target);return t&&e instanceof t}function dn(e){if(!e)return!1;const{TouchEvent:t}=de(e.target);return t&&e instanceof t}function yt(e){if(dn(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return cn(e)?{x:e.clientX,y:e.clientY}:null}const Oe=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Oe.Translate.toString(e),Oe.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:o}=e;return t+" "+n+"ms "+o}}}),_t="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function un(e){return e.matches(_t)?e:e.querySelector(_t)}const pn={display:"none"};function gn(e){let{id:t,value:n}=e;return l.createElement("div",{id:t,style:pn},n)}function fn(e){let{id:t,announcement:n,ariaLiveType:o="assertive"}=e;const i={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return l.createElement("div",{id:t,style:i,role:"status","aria-live":o,"aria-atomic":!0},n)}function xn(){const[e,t]=l.useState("");return{announce:l.useCallback(o=>{o!=null&&t(o)},[]),announcement:e}}const br=l.createContext(null);function hn(e){const t=l.useContext(br);l.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function bn(){const[e]=l.useState(()=>new Set),t=l.useCallback(o=>(e.add(o),()=>e.delete(o)),[e]);return[l.useCallback(o=>{let{type:i,event:s}=o;e.forEach(c=>{var a;return(a=c[i])==null?void 0:a.call(c,s)})},[e]),t]}const vn={draggable:`
2
+ To pick up a draggable item, press the space bar.
3
+ While dragging, use the arrow keys to move the item.
4
+ Press space again to drop the item in its new position, or press escape to cancel.
5
+ `},mn={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function yn(e){let{announcements:t=mn,container:n,hiddenTextDescribedById:o,screenReaderInstructions:i=vn}=e;const{announce:s,announcement:c}=xn(),a=ct("DndLiveRegion"),[u,g]=l.useState(!1);if(l.useEffect(()=>{g(!0)},[]),hn(l.useMemo(()=>({onDragStart(d){let{active:p}=d;s(t.onDragStart({active:p}))},onDragMove(d){let{active:p,over:f}=d;t.onDragMove&&s(t.onDragMove({active:p,over:f}))},onDragOver(d){let{active:p,over:f}=d;s(t.onDragOver({active:p,over:f}))},onDragEnd(d){let{active:p,over:f}=d;s(t.onDragEnd({active:p,over:f}))},onDragCancel(d){let{active:p,over:f}=d;s(t.onDragCancel({active:p,over:f}))}}),[s,t])),!u)return null;const x=l.createElement(l.Fragment,null,l.createElement(gn,{id:o,value:i.draggable}),l.createElement(fn,{id:a,announcement:c}));return n?Ge.createPortal(x,n):x}var te;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(te||(te={}));function wt(){}function er(e,t){return l.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function wn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return l.useMemo(()=>[...t].filter(o=>o!=null),[...t])}const Se=Object.freeze({x:0,y:0});function vr(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Sn(e,t){const n=yt(e);if(!n)return"0 0";const o={x:(n.x-t.left)/t.width*100,y:(n.y-t.top)/t.height*100};return o.x+"% "+o.y+"%"}function mr(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return n-o}function jn(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return o-n}function tr(e){let{left:t,top:n,height:o,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+o},{x:t+i,y:n+o}]}function yr(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function rr(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const Cn=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const i=rr(t,t.left,t.top),s=[];for(const c of o){const{id:a}=c,u=n.get(a);if(u){const g=vr(rr(u),i);s.push({id:a,data:{droppableContainer:c,value:g}})}}return s.sort(mr)},kn=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const i=tr(t),s=[];for(const c of o){const{id:a}=c,u=n.get(a);if(u){const g=tr(u),x=i.reduce((p,f,m)=>p+vr(g[m],f),0),d=Number((x/4).toFixed(4));s.push({id:a,data:{droppableContainer:c,value:d}})}}return s.sort(mr)};function Rn(e,t){const n=Math.max(t.top,e.top),o=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),s=Math.min(t.top+t.height,e.top+e.height),c=i-o,a=s-n;if(o<i&&n<s){const u=t.width*t.height,g=e.width*e.height,x=c*a,d=x/(u+g-x);return Number(d.toFixed(4))}return 0}const Dn=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e;const i=[];for(const s of o){const{id:c}=s,a=n.get(c);if(a){const u=Rn(a,t);u>0&&i.push({id:c,data:{droppableContainer:s,value:u}})}}return i.sort(jn)};function Tn(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function wr(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Se}function zn(e){return function(n){for(var o=arguments.length,i=new Array(o>1?o-1:0),s=1;s<o;s++)i[s-1]=arguments[s];return i.reduce((c,a)=>({...c,top:c.top+e*a.y,bottom:c.bottom+e*a.y,left:c.left+e*a.x,right:c.right+e*a.x}),{...n})}}const An=zn(1);function Sr(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function In(e,t,n){const o=Sr(t);if(!o)return e;const{scaleX:i,scaleY:s,x:c,y:a}=o,u=e.left-c-(1-i)*parseFloat(n),g=e.top-a-(1-s)*parseFloat(n.slice(n.indexOf(" ")+1)),x=i?e.width/i:e.width,d=s?e.height/s:e.height;return{width:x,height:d,top:g,right:u+x,bottom:g+d,left:u}}const En={ignoreTransform:!1};function Ke(e,t){t===void 0&&(t=En);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:g,transformOrigin:x}=de(e).getComputedStyle(e);g&&(n=In(n,g,x))}const{top:o,left:i,width:s,height:c,bottom:a,right:u}=n;return{top:o,left:i,width:s,height:c,bottom:a,right:u}}function nr(e){return Ke(e,{ignoreTransform:!0})}function Mn(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function Fn(e,t){return t===void 0&&(t=de(e).getComputedStyle(e)),t.position==="fixed"}function Bn(e,t){t===void 0&&(t=de(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const s=t[i];return typeof s=="string"?n.test(s):!1})}function Dt(e,t){const n=[];function o(i){if(t!=null&&n.length>=t||!i)return n;if(Jt(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!at(i)||xr(i)||n.includes(i))return n;const s=de(e).getComputedStyle(i);return i!==e&&Bn(i,s)&&n.push(i),Fn(i,s)?n:o(i.parentNode)}return e?o(e):n}function jr(e){const[t]=Dt(e,1);return t??null}function Ot(e){return!Ct||!e?null:Qe(e)?e:Gt(e)?Jt(e)||e===qe(e).scrollingElement?window:at(e)?e:null:null}function Cr(e){return Qe(e)?e.scrollX:e.scrollLeft}function kr(e){return Qe(e)?e.scrollY:e.scrollTop}function Ut(e){return{x:Cr(e),y:kr(e)}}var oe;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(oe||(oe={}));function Rr(e){return!Ct||!e?!1:e===document.scrollingElement}function Dr(e){const t={x:0,y:0},n=Rr(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},o={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},i=e.scrollTop<=t.y,s=e.scrollLeft<=t.x,c=e.scrollTop>=o.y,a=e.scrollLeft>=o.x;return{isTop:i,isLeft:s,isBottom:c,isRight:a,maxScroll:o,minScroll:t}}const Ln={x:.2,y:.2};function On(e,t,n,o,i){let{top:s,left:c,right:a,bottom:u}=n;o===void 0&&(o=10),i===void 0&&(i=Ln);const{isTop:g,isBottom:x,isLeft:d,isRight:p}=Dr(e),f={x:0,y:0},m={x:0,y:0},y={height:t.height*i.y,width:t.width*i.x};return!g&&s<=t.top+y.height?(f.y=oe.Backward,m.y=o*Math.abs((t.top+y.height-s)/y.height)):!x&&u>=t.bottom-y.height&&(f.y=oe.Forward,m.y=o*Math.abs((t.bottom-y.height-u)/y.height)),!p&&a>=t.right-y.width?(f.x=oe.Forward,m.x=o*Math.abs((t.right-y.width-a)/y.width)):!d&&c<=t.left+y.width&&(f.x=oe.Backward,m.x=o*Math.abs((t.left+y.width-c)/y.width)),{direction:f,speed:m}}function Nn(e){if(e===document.scrollingElement){const{innerWidth:s,innerHeight:c}=window;return{top:0,left:0,right:s,bottom:c,width:s,height:c}}const{top:t,left:n,right:o,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:o,bottom:i,width:e.clientWidth,height:e.clientHeight}}function Tr(e){return e.reduce((t,n)=>Je(t,Ut(n)),Se)}function Wn(e){return e.reduce((t,n)=>t+Cr(n),0)}function Pn(e){return e.reduce((t,n)=>t+kr(n),0)}function zr(e,t){if(t===void 0&&(t=Ke),!e)return;const{top:n,left:o,bottom:i,right:s}=t(e);jr(e)&&(i<=0||s<=0||n>=window.innerHeight||o>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Hn=[["x",["left","right"],Wn],["y",["top","bottom"],Pn]];class Qt{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const o=Dt(n),i=Tr(o);this.rect={...t},this.width=t.width,this.height=t.height;for(const[s,c,a]of Hn)for(const u of c)Object.defineProperty(this,u,{get:()=>{const g=a(o),x=i[s]-g;return this.rect[u]+x},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class et{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var o;return(o=this.target)==null?void 0:o.removeEventListener(...n)})},this.target=t}add(t,n,o){var i;(i=this.target)==null||i.addEventListener(t,n,o),this.listeners.push([t,n,o])}}function Un(e){const{EventTarget:t}=de(e);return e instanceof t?e:qe(e)}function Nt(e,t){const n=Math.abs(e.x),o=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+o**2)>t:"x"in t&&"y"in t?n>t.x&&o>t.y:"x"in t?n>t.x:"y"in t?o>t.y:!1}var ve;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(ve||(ve={}));function or(e){e.preventDefault()}function Yn(e){e.stopPropagation()}var W;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(W||(W={}));const Ar={start:[W.Space,W.Enter],cancel:[W.Esc],end:[W.Space,W.Enter,W.Tab]},Xn=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case W.Right:return{...n,x:n.x+25};case W.Left:return{...n,x:n.x-25};case W.Down:return{...n,y:n.y+25};case W.Up:return{...n,y:n.y-25}}};class qt{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new et(qe(n)),this.windowListeners=new et(de(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(ve.Resize,this.handleCancel),this.windowListeners.add(ve.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(ve.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,o=t.node.current;o&&zr(o),n(Se)}handleKeyDown(t){if(Rt(t)){const{active:n,context:o,options:i}=this.props,{keyboardCodes:s=Ar,coordinateGetter:c=Xn,scrollBehavior:a="smooth"}=i,{code:u}=t;if(s.end.includes(u)){this.handleEnd(t);return}if(s.cancel.includes(u)){this.handleCancel(t);return}const{collisionRect:g}=o.current,x=g?{x:g.left,y:g.top}:Se;this.referenceCoordinates||(this.referenceCoordinates=x);const d=c(t,{active:n,context:o.current,currentCoordinates:x});if(d){const p=it(d,x),f={x:0,y:0},{scrollableAncestors:m}=o.current;for(const y of m){const v=t.code,{isTop:j,isRight:S,isLeft:z,isBottom:b,maxScroll:A,minScroll:k}=Dr(y),w=Nn(y),I={x:Math.min(v===W.Right?w.right-w.width/2:w.right,Math.max(v===W.Right?w.left:w.left+w.width/2,d.x)),y:Math.min(v===W.Down?w.bottom-w.height/2:w.bottom,Math.max(v===W.Down?w.top:w.top+w.height/2,d.y))},E=v===W.Right&&!S||v===W.Left&&!z,P=v===W.Down&&!b||v===W.Up&&!j;if(E&&I.x!==d.x){const L=y.scrollLeft+p.x,_=v===W.Right&&L<=A.x||v===W.Left&&L>=k.x;if(_&&!p.y){y.scrollTo({left:L,behavior:a});return}_?f.x=y.scrollLeft-L:f.x=v===W.Right?y.scrollLeft-A.x:y.scrollLeft-k.x,f.x&&y.scrollBy({left:-f.x,behavior:a});break}else if(P&&I.y!==d.y){const L=y.scrollTop+p.y,_=v===W.Down&&L<=A.y||v===W.Up&&L>=k.y;if(_&&!p.x){y.scrollTo({top:L,behavior:a});return}_?f.y=y.scrollTop-L:f.y=v===W.Down?y.scrollTop-A.y:y.scrollTop-k.y,f.y&&y.scrollBy({top:-f.y,behavior:a});break}}this.handleMove(t,Je(it(d,this.referenceCoordinates),f))}}}handleMove(t,n){const{onMove:o}=this.props;t.preventDefault(),o(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}qt.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:o=Ar,onActivation:i}=t,{active:s}=n;const{code:c}=e.nativeEvent;if(o.start.includes(c)){const a=s.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),i==null||i({event:e.nativeEvent}),!0)}return!1}}];function ir(e){return!!(e&&"distance"in e)}function sr(e){return!!(e&&"delay"in e)}class Kt{constructor(t,n,o){var i;o===void 0&&(o=Un(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:s}=t,{target:c}=s;this.props=t,this.events=n,this.document=qe(c),this.documentListeners=new et(this.document),this.listeners=new et(o),this.windowListeners=new et(de(c)),this.initialCoordinates=(i=yt(s))!=null?i:Se,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:o}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(ve.Resize,this.handleCancel),this.windowListeners.add(ve.DragStart,or),this.windowListeners.add(ve.VisibilityChange,this.handleCancel),this.windowListeners.add(ve.ContextMenu,or),this.documentListeners.add(ve.Keydown,this.handleKeydown),n){if(o!=null&&o({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(sr(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(ir(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:o,onPending:i}=this.props;i(o,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(ve.Click,Yn,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(ve.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:o,initialCoordinates:i,props:s}=this,{onMove:c,options:{activationConstraint:a}}=s;if(!i)return;const u=(n=yt(t))!=null?n:Se,g=it(i,u);if(!o&&a){if(ir(a)){if(a.tolerance!=null&&Nt(g,a.tolerance))return this.handleCancel();if(Nt(g,a.distance))return this.handleStart()}if(sr(a)&&Nt(g,a.tolerance))return this.handleCancel();this.handlePending(a,g);return}t.cancelable&&t.preventDefault(),c(u)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===W.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Vn={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class $t extends Kt{constructor(t){const{event:n}=t,o=qe(n.target);super(t,Vn,o)}}$t.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;return!n.isPrimary||n.button!==0?!1:(o==null||o({event:n}),!0)}}];const Gn={move:{name:"mousemove"},end:{name:"mouseup"}};var Yt;(function(e){e[e.RightClick=2]="RightClick"})(Yt||(Yt={}));class Jn extends Kt{constructor(t){super(t,Gn,qe(t.event.target))}}Jn.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;return n.button===Yt.RightClick?!1:(o==null||o({event:n}),!0)}}];const Wt={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Qn extends Kt{constructor(t){super(t,Wt)}static setup(){return window.addEventListener(Wt.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Wt.move.name,t)};function t(){}}}Qn.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;const{touches:i}=n;return i.length>1?!1:(o==null||o({event:n}),!0)}}];var tt;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(tt||(tt={}));var St;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(St||(St={}));function qn(e){let{acceleration:t,activator:n=tt.Pointer,canScroll:o,draggingRect:i,enabled:s,interval:c=5,order:a=St.TreeOrder,pointerCoordinates:u,scrollableAncestors:g,scrollableAncestorRects:x,delta:d,threshold:p}=e;const f=$n({delta:d,disabled:!s}),[m,y]=ln(),v=l.useRef({x:0,y:0}),j=l.useRef({x:0,y:0}),S=l.useMemo(()=>{switch(n){case tt.Pointer:return u?{top:u.y,bottom:u.y,left:u.x,right:u.x}:null;case tt.DraggableRect:return i}},[n,i,u]),z=l.useRef(null),b=l.useCallback(()=>{const k=z.current;if(!k)return;const w=v.current.x*j.current.x,I=v.current.y*j.current.y;k.scrollBy(w,I)},[]),A=l.useMemo(()=>a===St.TreeOrder?[...g].reverse():g,[a,g]);l.useEffect(()=>{if(!s||!g.length||!S){y();return}for(const k of A){if((o==null?void 0:o(k))===!1)continue;const w=g.indexOf(k),I=x[w];if(!I)continue;const{direction:E,speed:P}=On(k,I,S,t,p);for(const L of["x","y"])f[L][E[L]]||(P[L]=0,E[L]=0);if(P.x>0||P.y>0){y(),z.current=k,m(b,c),v.current=P,j.current=E;return}}v.current={x:0,y:0},j.current={x:0,y:0},y()},[t,b,o,y,s,c,JSON.stringify(S),JSON.stringify(f),m,g,A,x,JSON.stringify(p)])}const Kn={x:{[oe.Backward]:!1,[oe.Forward]:!1},y:{[oe.Backward]:!1,[oe.Forward]:!1}};function $n(e){let{delta:t,disabled:n}=e;const o=mt(t);return lt(i=>{if(n||!o||!i)return Kn;const s={x:Math.sign(t.x-o.x),y:Math.sign(t.y-o.y)};return{x:{[oe.Backward]:i.x[oe.Backward]||s.x===-1,[oe.Forward]:i.x[oe.Forward]||s.x===1},y:{[oe.Backward]:i.y[oe.Backward]||s.y===-1,[oe.Forward]:i.y[oe.Forward]||s.y===1}}},[n,t,o])}function Zn(e,t){const n=t!=null?e.get(t):void 0,o=n?n.node.current:null;return lt(i=>{var s;return t==null?null:(s=o??i)!=null?s:null},[o,t])}function _n(e,t){return l.useMemo(()=>e.reduce((n,o)=>{const{sensor:i}=o,s=i.activators.map(c=>({eventName:c.eventName,handler:t(c.handler,o)}));return[...n,...s]},[]),[e,t])}var st;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(st||(st={}));var Xt;(function(e){e.Optimized="optimized"})(Xt||(Xt={}));const ar=new Map;function eo(e,t){let{dragging:n,dependencies:o,config:i}=t;const[s,c]=l.useState(null),{frequency:a,measure:u,strategy:g}=i,x=l.useRef(e),d=v(),p=ot(d),f=l.useCallback(function(j){j===void 0&&(j=[]),!p.current&&c(S=>S===null?j:S.concat(j.filter(z=>!S.includes(z))))},[p]),m=l.useRef(null),y=lt(j=>{if(d&&!n)return ar;if(!j||j===ar||x.current!==e||s!=null){const S=new Map;for(let z of e){if(!z)continue;if(s&&s.length>0&&!s.includes(z.id)&&z.rect.current){S.set(z.id,z.rect.current);continue}const b=z.node.current,A=b?new Qt(u(b),b):null;z.rect.current=A,A&&S.set(z.id,A)}return S}return j},[e,s,n,d,u]);return l.useEffect(()=>{x.current=e},[e]),l.useEffect(()=>{d||f()},[n,d]),l.useEffect(()=>{s&&s.length>0&&c(null)},[JSON.stringify(s)]),l.useEffect(()=>{d||typeof a!="number"||m.current!==null||(m.current=setTimeout(()=>{f(),m.current=null},a))},[a,d,f,...o]),{droppableRects:y,measureDroppableContainers:f,measuringScheduled:s!=null};function v(){switch(g){case st.Always:return!1;case st.BeforeDragging:return n;default:return!n}}}function Zt(e,t){return lt(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function to(e,t){return Zt(e,t)}function ro(e){let{callback:t,disabled:n}=e;const o=kt(t),i=l.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:s}=window;return new s(o)},[o,n]);return l.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function Tt(e){let{callback:t,disabled:n}=e;const o=kt(t),i=l.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:s}=window;return new s(o)},[n]);return l.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function no(e){return new Qt(Ke(e),e)}function lr(e,t,n){t===void 0&&(t=no);const[o,i]=l.useState(null);function s(){i(u=>{if(!e)return null;if(e.isConnected===!1){var g;return(g=u??n)!=null?g:null}const x=t(e);return JSON.stringify(u)===JSON.stringify(x)?u:x})}const c=ro({callback(u){if(e)for(const g of u){const{type:x,target:d}=g;if(x==="childList"&&d instanceof HTMLElement&&d.contains(e)){s();break}}}}),a=Tt({callback:s});return we(()=>{s(),e?(a==null||a.observe(e),c==null||c.observe(document.body,{childList:!0,subtree:!0})):(a==null||a.disconnect(),c==null||c.disconnect())},[e]),o}function oo(e){const t=Zt(e);return wr(e,t)}const cr=[];function io(e){const t=l.useRef(e),n=lt(o=>e?o&&o!==cr&&e&&t.current&&e.parentNode===t.current.parentNode?o:Dt(e):cr,[e]);return l.useEffect(()=>{t.current=e},[e]),n}function so(e){const[t,n]=l.useState(null),o=l.useRef(e),i=l.useCallback(s=>{const c=Ot(s.target);c&&n(a=>a?(a.set(c,Ut(c)),new Map(a)):null)},[]);return l.useEffect(()=>{const s=o.current;if(e!==s){c(s);const a=e.map(u=>{const g=Ot(u);return g?(g.addEventListener("scroll",i,{passive:!0}),[g,Ut(g)]):null}).filter(u=>u!=null);n(a.length?new Map(a):null),o.current=e}return()=>{c(e),c(s)};function c(a){a.forEach(u=>{const g=Ot(u);g==null||g.removeEventListener("scroll",i)})}},[i,e]),l.useMemo(()=>e.length?t?Array.from(t.values()).reduce((s,c)=>Je(s,c),Se):Tr(e):Se,[e,t])}function dr(e,t){t===void 0&&(t=[]);const n=l.useRef(null);return l.useEffect(()=>{n.current=null},t),l.useEffect(()=>{const o=e!==Se;o&&!n.current&&(n.current=e),!o&&n.current&&(n.current=null)},[e]),n.current?it(e,n.current):Se}function ao(e){l.useEffect(()=>{if(!Ct)return;const t=e.map(n=>{let{sensor:o}=n;return o.setup==null?void 0:o.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function lo(e,t){return l.useMemo(()=>e.reduce((n,o)=>{let{eventName:i,handler:s}=o;return n[i]=c=>{s(c,t)},n},{}),[e,t])}function Ir(e){return l.useMemo(()=>e?Mn(e):null,[e])}const ur=[];function co(e,t){t===void 0&&(t=Ke);const[n]=e,o=Ir(n?de(n):null),[i,s]=l.useState(ur);function c(){s(()=>e.length?e.map(u=>Rr(u)?o:new Qt(t(u),u)):ur)}const a=Tt({callback:c});return we(()=>{a==null||a.disconnect(),c(),e.forEach(u=>a==null?void 0:a.observe(u))},[e]),i}function Er(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return at(t)?t:e}function uo(e){let{measure:t}=e;const[n,o]=l.useState(null),i=l.useCallback(g=>{for(const{target:x}of g)if(at(x)){o(d=>{const p=t(x);return d?{...d,width:p.width,height:p.height}:p});break}},[t]),s=Tt({callback:i}),c=l.useCallback(g=>{const x=Er(g);s==null||s.disconnect(),x&&(s==null||s.observe(x)),o(x?t(x):null)},[t,s]),[a,u]=vt(c);return l.useMemo(()=>({nodeRef:a,rect:n,setRef:u}),[n,a,u])}const po=[{sensor:$t,options:{}},{sensor:qt,options:{}}],go={current:{}},bt={draggable:{measure:nr},droppable:{measure:nr,strategy:st.WhileDragging,frequency:Xt.Optimized},dragOverlay:{measure:Ke}};class rt extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,o;return(n=(o=this.get(t))==null?void 0:o.node.current)!=null?n:void 0}}const fo={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new rt,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:wt},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:bt,measureDroppableContainers:wt,windowRect:null,measuringScheduled:!1},Mr={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:wt,draggableNodes:new Map,over:null,measureDroppableContainers:wt},dt=l.createContext(Mr),Fr=l.createContext(fo);function xo(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new rt}}}function ho(e,t){switch(t.type){case te.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case te.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case te.DragEnd:case te.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case te.RegisterDroppable:{const{element:n}=t,{id:o}=n,i=new rt(e.droppable.containers);return i.set(o,n),{...e,droppable:{...e.droppable,containers:i}}}case te.SetDroppableDisabled:{const{id:n,key:o,disabled:i}=t,s=e.droppable.containers.get(n);if(!s||o!==s.key)return e;const c=new rt(e.droppable.containers);return c.set(n,{...s,disabled:i}),{...e,droppable:{...e.droppable,containers:c}}}case te.UnregisterDroppable:{const{id:n,key:o}=t,i=e.droppable.containers.get(n);if(!i||o!==i.key)return e;const s=new rt(e.droppable.containers);return s.delete(n),{...e,droppable:{...e.droppable,containers:s}}}default:return e}}function bo(e){let{disabled:t}=e;const{active:n,activatorEvent:o,draggableNodes:i}=l.useContext(dt),s=mt(o),c=mt(n==null?void 0:n.id);return l.useEffect(()=>{if(!t&&!o&&s&&c!=null){if(!Rt(s)||document.activeElement===s.target)return;const a=i.get(c);if(!a)return;const{activatorNode:u,node:g}=a;if(!u.current&&!g.current)return;requestAnimationFrame(()=>{for(const x of[u.current,g.current]){if(!x)continue;const d=un(x);if(d){d.focus();break}}})}},[o,t,i,c,s]),null}function Br(e,t){let{transform:n,...o}=t;return e!=null&&e.length?e.reduce((i,s)=>s({transform:i,...o}),n):n}function vo(e){return l.useMemo(()=>({draggable:{...bt.draggable,...e==null?void 0:e.draggable},droppable:{...bt.droppable,...e==null?void 0:e.droppable},dragOverlay:{...bt.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function mo(e){let{activeNode:t,measure:n,initialRect:o,config:i=!0}=e;const s=l.useRef(!1),{x:c,y:a}=typeof i=="boolean"?{x:i,y:i}:i;we(()=>{if(!c&&!a||!t){s.current=!1;return}if(s.current||!o)return;const g=t==null?void 0:t.node.current;if(!g||g.isConnected===!1)return;const x=n(g),d=wr(x,o);if(c||(d.x=0),a||(d.y=0),s.current=!0,Math.abs(d.x)>0||Math.abs(d.y)>0){const p=jr(g);p&&p.scrollBy({top:d.y,left:d.x})}},[t,c,a,o,n])}const zt=l.createContext({...Se,scaleX:1,scaleY:1});var Le;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Le||(Le={}));const yo=l.memo(function(t){var n,o,i,s;let{id:c,accessibility:a,autoScroll:u=!0,children:g,sensors:x=po,collisionDetection:d=Dn,measuring:p,modifiers:f,...m}=t;const y=l.useReducer(ho,void 0,xo),[v,j]=y,[S,z]=bn(),[b,A]=l.useState(Le.Uninitialized),k=b===Le.Initialized,{draggable:{active:w,nodes:I,translate:E},droppable:{containers:P}}=v,L=w!=null?I.get(w):null,_=l.useRef({initial:null,translated:null}),q=l.useMemo(()=>{var ne;return w!=null?{id:w,data:(ne=L==null?void 0:L.data)!=null?ne:go,rect:_}:null},[w,L]),$=l.useRef(null),[ae,ue]=l.useState(null),[V,Ie]=l.useState(null),ie=ot(m,Object.values(m)),je=ct("DndDescribedBy",c),ke=l.useMemo(()=>P.getEnabled(),[P]),M=vo(p),{droppableRects:U,measureDroppableContainers:G,measuringScheduled:X}=eo(ke,{dragging:k,dependencies:[E.x,E.y],config:M.droppable}),Y=Zn(I,w),H=l.useMemo(()=>V?yt(V):null,[V]),K=Ft(),J=to(Y,M.draggable.measure);mo({activeNode:w!=null?I.get(w):null,config:K.layoutShiftCompensation,initialRect:J,measure:M.draggable.measure});const O=lr(Y,M.draggable.measure,J),Re=lr(Y?Y.parentElement:null),he=l.useRef({activatorEvent:null,active:null,activeNode:Y,collisionRect:null,collisions:null,droppableRects:U,draggableNodes:I,draggingNode:null,draggingNodeRect:null,droppableContainers:P,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Ee=P.getNodeFor((n=he.current.over)==null?void 0:n.id),be=uo({measure:M.dragOverlay.measure}),De=(o=be.nodeRef.current)!=null?o:Y,Te=k?(i=be.rect)!=null?i:O:null,me=!!(be.nodeRef.current&&be.rect),Pe=oo(me?null:O),$e=Ir(De?de(De):null),ge=io(k?Ee??Y:null),ye=co(ge),Me=Br(f,{transform:{x:E.x-Pe.x,y:E.y-Pe.y,scaleX:1,scaleY:1},activatorEvent:V,active:q,activeNodeRect:O,containerNodeRect:Re,draggingNodeRect:Te,over:he.current.over,overlayNodeRect:be.rect,scrollableAncestors:ge,scrollableAncestorRects:ye,windowRect:$e}),ze=H?Je(H,E):null,Ze=so(ge),ut=dr(Ze),At=dr(Ze,[O]),re=Je(Me,ut),Fe=Te?An(Te,Me):null,Ne=q&&Fe?d({active:q,collisionRect:Fe,droppableRects:U,droppableContainers:ke,pointerCoordinates:ze}):null,pt=yr(Ne,"id"),[fe,We]=l.useState(null),He=me?Me:Je(Me,At),It=Tn(He,(s=fe==null?void 0:fe.rect)!=null?s:null,O),Ue=l.useRef(null),gt=l.useCallback((ne,le)=>{let{sensor:Z,options:Ce}=le;if($.current==null)return;const pe=I.get($.current);if(!pe)return;const ce=ne.nativeEvent,xe=new Z({active:$.current,activeNode:pe,event:ce,options:Ce,context:he,onAbort(ee){if(!I.get(ee))return;const{onDragAbort:C}=ie.current,D={id:ee};C==null||C(D),S({type:"onDragAbort",event:D})},onPending(ee,h,C,D){if(!I.get(ee))return;const{onDragPending:F}=ie.current,B={id:ee,constraint:h,initialCoordinates:C,offset:D};F==null||F(B),S({type:"onDragPending",event:B})},onStart(ee){const h=$.current;if(h==null)return;const C=I.get(h);if(!C)return;const{onDragStart:D}=ie.current,T={activatorEvent:ce,active:{id:h,data:C.data,rect:_}};Ge.unstable_batchedUpdates(()=>{D==null||D(T),A(Le.Initializing),j({type:te.DragStart,initialCoordinates:ee,active:h}),S({type:"onDragStart",event:T}),ue(Ue.current),Ie(ce)})},onMove(ee){j({type:te.DragMove,coordinates:ee})},onEnd:Be(te.DragEnd),onCancel:Be(te.DragCancel)});Ue.current=xe;function Be(ee){return async function(){const{active:C,collisions:D,over:T,scrollAdjustedTranslate:F}=he.current;let B=null;if(C&&F){const{cancelDrop:N}=ie.current;B={activatorEvent:ce,active:C,collisions:D,delta:F,over:T},ee===te.DragEnd&&typeof N=="function"&&await Promise.resolve(N(B))&&(ee=te.DragCancel)}$.current=null,Ge.unstable_batchedUpdates(()=>{j({type:ee}),A(Le.Uninitialized),We(null),ue(null),Ie(null),Ue.current=null;const N=ee===te.DragEnd?"onDragEnd":"onDragCancel";if(B){const se=ie.current[N];se==null||se(B),S({type:N,event:B})}})}}},[I]),Ye=l.useCallback((ne,le)=>(Z,Ce)=>{const pe=Z.nativeEvent,ce=I.get(Ce);if($.current!==null||!ce||pe.dndKit||pe.defaultPrevented)return;const xe={active:ce};ne(Z,le.options,xe)===!0&&(pe.dndKit={capturedBy:le.sensor},$.current=Ce,gt(Z,le))},[I,gt]),Xe=_n(x,Ye);ao(x),we(()=>{O&&b===Le.Initializing&&A(Le.Initialized)},[O,b]),l.useEffect(()=>{const{onDragMove:ne}=ie.current,{active:le,activatorEvent:Z,collisions:Ce,over:pe}=he.current;if(!le||!Z)return;const ce={active:le,activatorEvent:Z,collisions:Ce,delta:{x:re.x,y:re.y},over:pe};Ge.unstable_batchedUpdates(()=>{ne==null||ne(ce),S({type:"onDragMove",event:ce})})},[re.x,re.y]),l.useEffect(()=>{const{active:ne,activatorEvent:le,collisions:Z,droppableContainers:Ce,scrollAdjustedTranslate:pe}=he.current;if(!ne||$.current==null||!le||!pe)return;const{onDragOver:ce}=ie.current,xe=Ce.get(pt),Be=xe&&xe.rect.current?{id:xe.id,rect:xe.rect.current,data:xe.data,disabled:xe.disabled}:null,ee={active:ne,activatorEvent:le,collisions:Z,delta:{x:pe.x,y:pe.y},over:Be};Ge.unstable_batchedUpdates(()=>{We(Be),ce==null||ce(ee),S({type:"onDragOver",event:ee})})},[pt]),we(()=>{he.current={activatorEvent:V,active:q,activeNode:Y,collisionRect:Fe,collisions:Ne,droppableRects:U,draggableNodes:I,draggingNode:De,draggingNodeRect:Te,droppableContainers:P,over:fe,scrollableAncestors:ge,scrollAdjustedTranslate:re},_.current={initial:Te,translated:Fe}},[q,Y,Ne,Fe,I,De,Te,U,P,fe,ge,re]),qn({...K,delta:E,draggingRect:Fe,pointerCoordinates:ze,scrollableAncestors:ge,scrollableAncestorRects:ye});const Et=l.useMemo(()=>({active:q,activeNode:Y,activeNodeRect:O,activatorEvent:V,collisions:Ne,containerNodeRect:Re,dragOverlay:be,draggableNodes:I,droppableContainers:P,droppableRects:U,over:fe,measureDroppableContainers:G,scrollableAncestors:ge,scrollableAncestorRects:ye,measuringConfiguration:M,measuringScheduled:X,windowRect:$e}),[q,Y,O,V,Ne,Re,be,I,P,U,fe,G,ge,ye,M,X,$e]),Mt=l.useMemo(()=>({activatorEvent:V,activators:Xe,active:q,activeNodeRect:O,ariaDescribedById:{draggable:je},dispatch:j,draggableNodes:I,over:fe,measureDroppableContainers:G}),[V,Xe,q,O,j,je,I,fe,G]);return l.createElement(br.Provider,{value:z},l.createElement(dt.Provider,{value:Mt},l.createElement(Fr.Provider,{value:Et},l.createElement(zt.Provider,{value:It},g)),l.createElement(bo,{disabled:(a==null?void 0:a.restoreFocus)===!1})),l.createElement(yn,{...a,hiddenTextDescribedById:je}));function Ft(){const ne=(ae==null?void 0:ae.autoScrollEnabled)===!1,le=typeof u=="object"?u.enabled===!1:u===!1,Z=k&&!ne&&!le;return typeof u=="object"?{...u,enabled:Z}:{enabled:Z}}}),wo=l.createContext(null),pr="button",So="Draggable";function jo(e){let{id:t,data:n,disabled:o=!1,attributes:i}=e;const s=ct(So),{activators:c,activatorEvent:a,active:u,activeNodeRect:g,ariaDescribedById:x,draggableNodes:d,over:p}=l.useContext(dt),{role:f=pr,roleDescription:m="draggable",tabIndex:y=0}=i??{},v=(u==null?void 0:u.id)===t,j=l.useContext(v?zt:wo),[S,z]=vt(),[b,A]=vt(),k=lo(c,t),w=ot(n);we(()=>(d.set(t,{id:t,key:s,node:S,activatorNode:b,data:w}),()=>{const E=d.get(t);E&&E.key===s&&d.delete(t)}),[d,t]);const I=l.useMemo(()=>({role:f,tabIndex:y,"aria-disabled":o,"aria-pressed":v&&f===pr?!0:void 0,"aria-roledescription":m,"aria-describedby":x.draggable}),[o,f,y,v,m,x.draggable]);return{active:u,activatorEvent:a,activeNodeRect:g,attributes:I,isDragging:v,listeners:o?void 0:k,node:S,over:p,setNodeRef:z,setActivatorNodeRef:A,transform:j}}function Lr(){return l.useContext(Fr)}const Co="Droppable",ko={timeout:25};function Ro(e){let{data:t,disabled:n=!1,id:o,resizeObserverConfig:i}=e;const s=ct(Co),{active:c,dispatch:a,over:u,measureDroppableContainers:g}=l.useContext(dt),x=l.useRef({disabled:n}),d=l.useRef(!1),p=l.useRef(null),f=l.useRef(null),{disabled:m,updateMeasurementsFor:y,timeout:v}={...ko,...i},j=ot(y??o),S=l.useCallback(()=>{if(!d.current){d.current=!0;return}f.current!=null&&clearTimeout(f.current),f.current=setTimeout(()=>{g(Array.isArray(j.current)?j.current:[j.current]),f.current=null},v)},[v]),z=Tt({callback:S,disabled:m||!c}),b=l.useCallback((I,E)=>{z&&(E&&(z.unobserve(E),d.current=!1),I&&z.observe(I))},[z]),[A,k]=vt(b),w=ot(t);return l.useEffect(()=>{!z||!A.current||(z.disconnect(),d.current=!1,z.observe(A.current))},[A,z]),l.useEffect(()=>(a({type:te.RegisterDroppable,element:{id:o,key:s,disabled:n,node:A,rect:p,data:w}}),()=>a({type:te.UnregisterDroppable,key:s,id:o})),[o]),l.useEffect(()=>{n!==x.current.disabled&&(a({type:te.SetDroppableDisabled,id:o,key:s,disabled:n}),x.current.disabled=n)},[o,s,n,a]),{active:c,rect:p,isOver:(u==null?void 0:u.id)===o,node:A,over:u,setNodeRef:k}}function Do(e){let{animation:t,children:n}=e;const[o,i]=l.useState(null),[s,c]=l.useState(null),a=mt(n);return!n&&!o&&a&&i(a),we(()=>{if(!s)return;const u=o==null?void 0:o.key,g=o==null?void 0:o.props.id;if(u==null||g==null){i(null);return}Promise.resolve(t(g,s)).then(()=>{i(null)})},[t,o,s]),l.createElement(l.Fragment,null,n,o?l.cloneElement(o,{ref:c}):null)}const To={x:0,y:0,scaleX:1,scaleY:1};function zo(e){let{children:t}=e;return l.createElement(dt.Provider,{value:Mr},l.createElement(zt.Provider,{value:To},t))}const Ao={position:"fixed",touchAction:"none"},Io=e=>Rt(e)?"transform 250ms ease":void 0,Eo=l.forwardRef((e,t)=>{let{as:n,activatorEvent:o,adjustScale:i,children:s,className:c,rect:a,style:u,transform:g,transition:x=Io}=e;if(!a)return null;const d=i?g:{...g,scaleX:1,scaleY:1},p={...Ao,width:a.width,height:a.height,top:a.top,left:a.left,transform:Oe.Transform.toString(d),transformOrigin:i&&o?Sn(o,a):void 0,transition:typeof x=="function"?x(o):x,...u};return l.createElement(n,{className:c,style:p,ref:t},s)}),Mo=e=>t=>{let{active:n,dragOverlay:o}=t;const i={},{styles:s,className:c}=e;if(s!=null&&s.active)for(const[a,u]of Object.entries(s.active))u!==void 0&&(i[a]=n.node.style.getPropertyValue(a),n.node.style.setProperty(a,u));if(s!=null&&s.dragOverlay)for(const[a,u]of Object.entries(s.dragOverlay))u!==void 0&&o.node.style.setProperty(a,u);return c!=null&&c.active&&n.node.classList.add(c.active),c!=null&&c.dragOverlay&&o.node.classList.add(c.dragOverlay),function(){for(const[u,g]of Object.entries(i))n.node.style.setProperty(u,g);c!=null&&c.active&&n.node.classList.remove(c.active)}},Fo=e=>{let{transform:{initial:t,final:n}}=e;return[{transform:Oe.Transform.toString(t)},{transform:Oe.Transform.toString(n)}]},Bo={duration:250,easing:"ease",keyframes:Fo,sideEffects:Mo({styles:{active:{opacity:"0"}}})};function Lo(e){let{config:t,draggableNodes:n,droppableContainers:o,measuringConfiguration:i}=e;return kt((s,c)=>{if(t===null)return;const a=n.get(s);if(!a)return;const u=a.node.current;if(!u)return;const g=Er(c);if(!g)return;const{transform:x}=de(c).getComputedStyle(c),d=Sr(x);if(!d)return;const p=typeof t=="function"?t:Oo(t);return zr(u,i.draggable.measure),p({active:{id:s,data:a.data,node:u,rect:i.draggable.measure(u)},draggableNodes:n,dragOverlay:{node:c,rect:i.dragOverlay.measure(g)},droppableContainers:o,measuringConfiguration:i,transform:d})})}function Oo(e){const{duration:t,easing:n,sideEffects:o,keyframes:i}={...Bo,...e};return s=>{let{active:c,dragOverlay:a,transform:u,...g}=s;if(!t)return;const x={x:a.rect.left-c.rect.left,y:a.rect.top-c.rect.top},d={scaleX:u.scaleX!==1?c.rect.width*u.scaleX/a.rect.width:1,scaleY:u.scaleY!==1?c.rect.height*u.scaleY/a.rect.height:1},p={x:u.x-x.x,y:u.y-x.y,...d},f=i({...g,active:c,dragOverlay:a,transform:{initial:u,final:p}}),[m]=f,y=f[f.length-1];if(JSON.stringify(m)===JSON.stringify(y))return;const v=o==null?void 0:o({active:c,dragOverlay:a,...g}),j=a.node.animate(f,{duration:t,easing:n,fill:"forwards"});return new Promise(S=>{j.onfinish=()=>{v==null||v(),S()}})}}let gr=0;function No(e){return l.useMemo(()=>{if(e!=null)return gr++,gr},[e])}const Wo=l.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:o,style:i,transition:s,modifiers:c,wrapperElement:a="div",className:u,zIndex:g=999}=e;const{activatorEvent:x,active:d,activeNodeRect:p,containerNodeRect:f,draggableNodes:m,droppableContainers:y,dragOverlay:v,over:j,measuringConfiguration:S,scrollableAncestors:z,scrollableAncestorRects:b,windowRect:A}=Lr(),k=l.useContext(zt),w=No(d==null?void 0:d.id),I=Br(c,{activatorEvent:x,active:d,activeNodeRect:p,containerNodeRect:f,draggingNodeRect:v.rect,over:j,overlayNodeRect:v.rect,scrollableAncestors:z,scrollableAncestorRects:b,transform:k,windowRect:A}),E=Zt(p),P=Lo({config:o,draggableNodes:m,droppableContainers:y,measuringConfiguration:S}),L=E?v.setRef:void 0;return l.createElement(zo,null,l.createElement(Do,{animation:P},d&&w?l.createElement(Eo,{key:w,id:d.id,ref:L,as:a,activatorEvent:x,adjustScale:t,className:u,transition:s,rect:E,style:{zIndex:g,...i},transform:I},n):null))});function nt(e,t,n){const o=e.slice();return o.splice(n<0?o.length+n:n,0,o.splice(t,1)[0]),o}function Po(e,t){return e.reduce((n,o,i)=>{const s=t.get(o);return s&&(n[i]=s),n},Array(e.length))}function xt(e){return e!==null&&e>=0}function Ho(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Uo(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const ht={scaleX:1,scaleY:1},Yo=e=>{var t;let{rects:n,activeNodeRect:o,activeIndex:i,overIndex:s,index:c}=e;const a=(t=n[i])!=null?t:o;if(!a)return null;const u=Xo(n,c,i);if(c===i){const g=n[s];return g?{x:i<s?g.left+g.width-(a.left+a.width):g.left-a.left,y:0,...ht}:null}return c>i&&c<=s?{x:-a.width-u,y:0,...ht}:c<i&&c>=s?{x:a.width+u,y:0,...ht}:{x:0,y:0,...ht}};function Xo(e,t,n){const o=e[t],i=e[t-1],s=e[t+1];return!o||!i&&!s?0:n<t?i?o.left-(i.left+i.width):s.left-(o.left+o.width):s?s.left-(o.left+o.width):o.left-(i.left+i.width)}const Or=e=>{let{rects:t,activeIndex:n,overIndex:o,index:i}=e;const s=nt(t,o,n),c=t[i],a=s[i];return!a||!c?null:{x:a.left-c.left,y:a.top-c.top,scaleX:a.width/c.width,scaleY:a.height/c.height}},Nr="Sortable",Wr=l.createContext({activeIndex:-1,containerId:Nr,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Or,disabled:{draggable:!1,droppable:!1}});function Vo(e){let{children:t,id:n,items:o,strategy:i=Or,disabled:s=!1}=e;const{active:c,dragOverlay:a,droppableRects:u,over:g,measureDroppableContainers:x}=Lr(),d=ct(Nr,n),p=a.rect!==null,f=l.useMemo(()=>o.map(k=>typeof k=="object"&&"id"in k?k.id:k),[o]),m=c!=null,y=c?f.indexOf(c.id):-1,v=g?f.indexOf(g.id):-1,j=l.useRef(f),S=!Ho(f,j.current),z=v!==-1&&y===-1||S,b=Uo(s);we(()=>{S&&m&&x(f)},[S,f,m,x]),l.useEffect(()=>{j.current=f},[f]);const A=l.useMemo(()=>({activeIndex:y,containerId:d,disabled:b,disableTransforms:z,items:f,overIndex:v,useDragOverlay:p,sortedRects:Po(f,u),strategy:i}),[y,d,b.draggable,b.droppable,z,f,v,u,p,i]);return l.createElement(Wr.Provider,{value:A},t)}const Go=e=>{let{id:t,items:n,activeIndex:o,overIndex:i}=e;return nt(n,o,i).indexOf(t)},Jo=e=>{let{containerId:t,isSorting:n,wasDragging:o,index:i,items:s,newIndex:c,previousItems:a,previousContainerId:u,transition:g}=e;return!g||!o||a!==s&&i===c?!1:n?!0:c!==i&&t===u},Qo={duration:200,easing:"ease"},Pr="transform",qo=Oe.Transition.toString({property:Pr,duration:0,easing:"linear"}),Ko={roleDescription:"sortable"};function $o(e){let{disabled:t,index:n,node:o,rect:i}=e;const[s,c]=l.useState(null),a=l.useRef(n);return we(()=>{if(!t&&n!==a.current&&o.current){const u=i.current;if(u){const g=Ke(o.current,{ignoreTransform:!0}),x={x:u.left-g.left,y:u.top-g.top,scaleX:u.width/g.width,scaleY:u.height/g.height};(x.x||x.y)&&c(x)}}n!==a.current&&(a.current=n)},[t,n,o,i]),l.useEffect(()=>{s&&c(null)},[s]),s}function Zo(e){let{animateLayoutChanges:t=Jo,attributes:n,disabled:o,data:i,getNewIndex:s=Go,id:c,strategy:a,resizeObserverConfig:u,transition:g=Qo}=e;const{items:x,containerId:d,activeIndex:p,disabled:f,disableTransforms:m,sortedRects:y,overIndex:v,useDragOverlay:j,strategy:S}=l.useContext(Wr),z=_o(o,f),b=x.indexOf(c),A=l.useMemo(()=>({sortable:{containerId:d,index:b,items:x},...i}),[d,i,b,x]),k=l.useMemo(()=>x.slice(x.indexOf(c)),[x,c]),{rect:w,node:I,isOver:E,setNodeRef:P}=Ro({id:c,data:A,disabled:z.droppable,resizeObserverConfig:{updateMeasurementsFor:k,...u}}),{active:L,activatorEvent:_,activeNodeRect:q,attributes:$,setNodeRef:ae,listeners:ue,isDragging:V,over:Ie,setActivatorNodeRef:ie,transform:je}=jo({id:c,data:A,attributes:{...Ko,...n},disabled:z.draggable}),ke=an(P,ae),M=!!L,U=M&&!m&&xt(p)&&xt(v),G=!j&&V,X=G&&U?je:null,H=U?X??(a??S)({rects:y,activeNodeRect:q,activeIndex:p,overIndex:v,index:b}):null,K=xt(p)&&xt(v)?s({id:c,items:x,activeIndex:p,overIndex:v}):b,J=L==null?void 0:L.id,O=l.useRef({activeId:J,items:x,newIndex:K,containerId:d}),Re=x!==O.current.items,he=t({active:L,containerId:d,isDragging:V,isSorting:M,id:c,index:b,items:x,newIndex:O.current.newIndex,previousItems:O.current.items,previousContainerId:O.current.containerId,transition:g,wasDragging:O.current.activeId!=null}),Ee=$o({disabled:!he,index:b,node:I,rect:w});return l.useEffect(()=>{M&&O.current.newIndex!==K&&(O.current.newIndex=K),d!==O.current.containerId&&(O.current.containerId=d),x!==O.current.items&&(O.current.items=x)},[M,K,d,x]),l.useEffect(()=>{if(J===O.current.activeId)return;if(J!=null&&O.current.activeId==null){O.current.activeId=J;return}const De=setTimeout(()=>{O.current.activeId=J},50);return()=>clearTimeout(De)},[J]),{active:L,activeIndex:p,attributes:$,data:A,rect:w,index:b,newIndex:K,items:x,isOver:E,isSorting:M,isDragging:V,listeners:ue,node:I,overIndex:v,over:Ie,setNodeRef:ke,setActivatorNodeRef:ie,setDroppableNodeRef:P,setDraggableNodeRef:ae,transform:Ee??H,transition:be()};function be(){if(Ee||Re&&O.current.newIndex===b)return qo;if(!(G&&!Rt(_)||!g)&&(M||he))return Oe.Transition.toString({...g,property:Pr})}}function _o(e,t){var n,o;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(o=e==null?void 0:e.droppable)!=null?o:t.droppable}}function jt(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const ei=[W.Down,W.Right,W.Up,W.Left],ti=(e,t)=>{let{context:{active:n,collisionRect:o,droppableRects:i,droppableContainers:s,over:c,scrollableAncestors:a}}=t;if(ei.includes(e.code)){if(e.preventDefault(),!n||!o)return;const u=[];s.getEnabled().forEach(d=>{if(!d||d!=null&&d.disabled)return;const p=i.get(d.id);if(p)switch(e.code){case W.Down:o.top<p.top&&u.push(d);break;case W.Up:o.top>p.top&&u.push(d);break;case W.Left:o.left>p.left&&u.push(d);break;case W.Right:o.left<p.left&&u.push(d);break}});const g=kn({collisionRect:o,droppableRects:i,droppableContainers:u});let x=yr(g,"id");if(x===(c==null?void 0:c.id)&&g.length>1&&(x=g[1].id),x!=null){const d=s.get(n.id),p=s.get(x),f=p?i.get(p.id):null,m=p==null?void 0:p.node.current;if(m&&f&&d&&p){const v=Dt(m).some((k,w)=>a[w]!==k),j=Hr(d,p),S=ri(d,p),z=v||!j?{x:0,y:0}:{x:S?o.width-f.width:0,y:S?o.height-f.height:0},b={x:f.left,y:f.top};return z.x&&z.y?b:it(b,z)}}}};function Hr(e,t){return!jt(e)||!jt(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function ri(e,t){return!jt(e)||!jt(t)||!Hr(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}function ni(){return null}function Ur({dateRangePicker:e,onWeekToDate:t,exportConfig:n,filterChipsConfig:o,trailingActions:i}){const[s,c]=l.useState(!1),a=l.useRef(null),u=l.useRef(null);l.useEffect(()=>{const f=m=>{u.current&&!u.current.contains(m.target)&&a.current&&!a.current.contains(m.target)&&c(!1)};if(s)return document.addEventListener("mousedown",f),()=>{document.removeEventListener("mousedown",f)}},[s]);const g=()=>{c(f=>!f)},x=f=>{c(!1),n!=null&&n.onExport&&n.onExport(f)},p=(()=>{if(!(o!=null&&o.filters))return!1;const f=o.filters,m=o.customFilters||[],y=Object.entries(f).some(([j,S])=>!!(Array.isArray(S)&&S.length||typeof S=="string"&&S.trim()!==""||S&&typeof S=="object"&&(S.min!=null||S.max!=null))),v=m.some(j=>j.active);return y||v})();return r.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[t&&r.jsxs("button",{onClick:t,className:"inline-flex items-center gap-2 rounded-lg border border-gray-300 bg-white/80 px-4 py-2.5 transition-colors hover:bg-white text-sm font-medium text-gray-900",style:{fontFamily:"var(--font-sans)"},children:[r.jsx(R.CalendarClock,{size:16}),r.jsx("span",{children:"Week to Date"})]}),e&&r.jsx(l.Suspense,{fallback:r.jsxs("div",{className:"inline-flex items-center gap-2 rounded-lg border border-gray-300 bg-white/80 px-4 py-2.5 text-sm font-medium text-gray-400",children:[r.jsx(R.CalendarClock,{size:16}),r.jsx("span",{children:"Loading..."})]}),children:e}),n&&r.jsxs("div",{className:"relative",children:[r.jsxs("button",{ref:a,onClick:g,disabled:n.isExporting,className:"inline-flex items-center justify-between gap-2 rounded-lg border border-gray-300 bg-white/80 px-4 py-2.5 transition-colors hover:bg-white text-sm font-medium text-gray-900 disabled:opacity-50 disabled:cursor-not-allowed min-w-[120px]",style:{fontFamily:"var(--font-sans)"},children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(R.Download,{size:16}),r.jsx("span",{children:n.isExporting?"Exporting...":"Export"})]}),r.jsx(R.ChevronDown,{size:16})]}),s&&r.jsx("div",{ref:u,className:"absolute top-full right-0 mt-2 bg-white rounded-lg shadow-lg border border-gray-200 py-1 z-50 min-w-[120px]",children:(n.types||["csv"]).map(f=>r.jsxs("button",{onClick:()=>x(f),className:"w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-50 transition-colors",style:{fontFamily:"var(--font-sans)"},children:["Export ",f.toUpperCase()]},f))})]}),(p||i)&&r.jsxs(r.Fragment,{children:[p&&r.jsx("div",{className:"h-9 mt-1 w-px bg-gray-300 flex-shrink-0"}),r.jsxs("div",{className:"flex items-center gap-3 justify-end",children:[p&&o&&r.jsx(ni,{filters:o.filters,onChange:o.onChange,onClear:o.onClear,customFilters:o.customFilters||[]}),i&&r.jsx("div",{className:"flex-shrink-0",children:i})]})]})]})}const oi={error:(...e)=>console.warn("toast.error:",...e),dismiss:()=>{}};function ii(){return null}function si({isOpen:e,iconSize:t}){return null}function Pt(){return r.jsx("div",{style:{height:1,background:"rgba(52,58,64,0.08)"}})}const ai=()=>({userData:{email:"anonymous"}}),li=e=>r.jsx("img",{...e});function ci({children:e}){return e}function di({data:e=[],columns:t=[],initialPageSize:n=10,onRowClick:o,totalCount:i=null,page:s=null,pageSize:c=null,onPageChange:a=null,onPageSizeChange:u=null,onFilterChange:g=null,onSort:x=null,sortFields:d=[],tableId:p=null,isLoading:f=!1,filtersConfig:m=null}){var ee;const{userData:y}=ai(),v=y==null?void 0:y.email,j=l.memo(({children:h,content:C,className:D=""})=>{const T=l.useRef(null),[F,B]=l.useState(!1);l.useEffect(()=>{const se=()=>{if(T.current){const _e=T.current.scrollWidth>T.current.clientWidth;B(_e)}};se();const Ve=setTimeout(se,0);return window.addEventListener("resize",se),()=>{clearTimeout(Ve),window.removeEventListener("resize",se)}},[h,C]);const N=r.jsx("span",{className:`truncate block ${D}`,ref:T,children:h});return F&&C?r.jsx(ci,{content:C,styling:"bg-green-2 text-gray-900 px-3 py-2 text-sm rounded-lg shadow-md border border-gray-300 max-w-xs whitespace-normal",indicatorColor:"bg-green-2",direction:"top",children:N}):N});j.displayName="TruncatedCell";const S=i!==null&&a!==null,z=g!==null,b=x!==null,[A,k]=l.useState(1),[w,I]=l.useState(n),E=s!==null?s:A,P=c!==null?c:w,L=h=>{a?a(h):k(h)},_=h=>{u?u(h):I(h)},q=9,$=l.useRef(!1),ae=l.useMemo(()=>p?`dataTable_columns_${p}:${v}`:`dataTable_columns_${t.map(C=>C.id||C.key).sort().join("_")}:${v}`,[p,t,v]),ue=l.useMemo(()=>p?`dataTable_manual_change_${p}:${v}`:null,[p,v]);l.useCallback((h,C)=>{if(typeof window>"u"||!h||!C||C.length===0)return null;try{const D=localStorage.getItem(h);if(D){const F=JSON.parse(D).filter(B=>C.some(N=>(N.id||N.key)===B));if(F.length>0)return F}}catch(D){console.warn("Failed to load saved columns from localStorage:",D)}return null},[]);const[V,Ie]=l.useState({}),[ie,je]=l.useState(null),[ke,M]=l.useState("asc");l.useCallback((h,C)=>h==="csat_score"&&C==="evaluation.csat_score"?C:h,[]);const U=b&&d.length>0?d[0][0]:ie,G=b&&d.length>0?d[0][1]:ke,[X,Y]=l.useState(()=>t.map(h=>h.id||h.key)),[H,K]=l.useState(()=>{if(typeof window<"u"&&p)try{if(localStorage.getItem(`dataTable_manual_change_${p}:${v}`)==="true"){const D=localStorage.getItem(`dataTable_columns_${p}:${v}`);if(D){const T=JSON.parse(D);if(Array.isArray(T)&&T.length>0){$.current=!0;const F=T.filter(B=>t.some(N=>(N.id||N.key)===B));if(F.length>0)return F.slice(0,q)}}}}catch(C){console.warn("Failed to load saved columns from localStorage:",C)}return t.map(C=>C.id||C.key).slice(0,q)}),[J,O]=l.useState(!1),[Re,he]=l.useState({top:0,left:0,width:0}),[Ee,be]=l.useState(new Set),[De,Te]=l.useState(new Set),[me,Pe]=l.useState(null),[$e,ge]=l.useState(null),ye=l.useRef(null),Me=l.useRef(null),ze=l.useRef(null),[Ze,ut]=l.useState(null),At=l.useRef(null),re=h=>h.id||h.key,Fe=wn(er($t),er(qt,{coordinateGetter:ti})),Ne=h=>{const{active:C,over:D}=h;D&&C.id!==D.id&&($.current=!0,K(T=>{const F=T.indexOf(C.id),B=T.indexOf(D.id);if(F!==-1&&B!==-1){const N=nt(T,F,B);return Ye(N),N}return T}),Y(T=>{const F=T.indexOf(C.id),B=T.indexOf(D.id);return nt(T,F,B)})),ut(null)},pt=h=>{ut(h.active.id)},fe=l.useMemo(()=>z?e||[]:!e||e.length===0?[]:e.filter(h=>Object.keys(V).every(C=>{const D=V[C];if(!D||D.trim()==="")return!0;const T=h[C];if(T==null)return!1;const F=String(T).toLowerCase();return D.toLowerCase().trim().split(/\s+/).filter(se=>se.length>0).every(se=>F.includes(se))})),[e,V,z]),We=l.useMemo(()=>b||!U?fe:[...fe].sort((h,C)=>{const D=h[U],T=C[U];if(D==null)return 1;if(T==null)return-1;if(typeof D=="number"&&typeof T=="number")return G==="asc"?D-T:T-D;const F=String(D).toLowerCase(),B=String(T).toLowerCase();return G==="asc"?F.localeCompare(B):B.localeCompare(F)}),[fe,U,G,b]),He=l.useMemo(()=>{if(S)return e||[];{const h=(E-1)*P,C=h+P;return We.slice(h,C)}},[e,We,E,P,S]),It=h=>{b&&x?(x(h),a?a(1):k(1)):(ie===h?M(ke==="asc"?"desc":"asc"):(je(h),M("asc")),L(1))},Ue=(h,C)=>{const D=C&&C.trim()!==""?{...V,[h]:C}:Object.fromEntries(Object.entries(V).filter(([T])=>T!==h));Ie(D),z&&g&&g(D),a?a(1):k(1)},gt=h=>{ze.current||(oi.error(h,{id:"max-columns-toast"}),ze.current=setTimeout(()=>{ze.current=null},3e3))},Ye=l.useCallback(h=>{if(typeof window<"u"&&ae&&h.length>0&&$.current)try{localStorage.setItem(ae,JSON.stringify(h)),ue&&localStorage.setItem(ue,"true")}catch(C){console.warn("Failed to save columns to localStorage:",C)}},[ae,ue]),Xe=h=>{$.current=!0,K(C=>C.includes(h)?(ze.current&&(clearTimeout(ze.current),ze.current=null),C.length===1||(Te(D=>new Set(D).add(h)),setTimeout(()=>{K(D=>{const T=D.filter(F=>F!==h);return Ye(T),T}),Te(D=>{const T=new Set(D);return T.delete(h),T})},200)),C):C.length>=q?(gt("Maximum 9 column selection allowed"),C):(be(D=>new Set(D).add(h)),setTimeout(()=>{K(D=>{const T=D.includes(h)?D:[...D,h];return Ye(T),T}),be(D=>{const T=new Set(D);return T.delete(h),T})},200),C))},Et=(h,C)=>{Pe(C)},Mt=()=>{Pe(null),ge(null)},Ft=(h,C)=>{h.preventDefault(),me!==null&&me!==C&&ge(C)},ne=()=>{ge(null)},le=(h,C)=>{h.preventDefault(),me!==null&&me!==C&&($.current=!0,K(D=>{const T=nt(D,me,C);return Ye(T),T})),Pe(null),ge(null)};l.useEffect(()=>{Y(h=>{const C=H.filter(F=>h.includes(F)),D=H.filter(F=>!h.includes(F)),T=h.filter(F=>!H.includes(F));return[...C,...D,...T]})},[H]),l.useEffect(()=>{if(typeof window<"u"&&ae&&H.length>0&&$.current)try{localStorage.setItem(ae,JSON.stringify(H)),ue&&localStorage.setItem(ue,"true")}catch(h){console.warn("Failed to save columns to localStorage:",h)}},[H,ae,ue]),l.useEffect(()=>{if(t.length>0&&H.length===0){if(typeof window<"u"&&p)try{if(localStorage.getItem(`dataTable_manual_change_${p}:${v}`)==="true"){const D=localStorage.getItem(`dataTable_columns_${p}:${v}`);if(D){const T=JSON.parse(D);if(Array.isArray(T)&&T.length>0){const F=T.filter(B=>t.some(N=>(N.id||N.key)===B));if(F.length>0){$.current=!0,K(F.slice(0,q));return}}}}}catch(C){console.warn("Failed to load saved columns from localStorage:",C)}const h=t.map(C=>C.id||C.key);K(h.slice(0,q))}},[t,p,v]);const Z=l.useMemo(()=>H.map(h=>t.find(C=>re(C)===h)).filter(Boolean),[t,H]),Ce=l.useMemo(()=>Z.some(h=>h.filterable===!0),[Z]);l.useEffect(()=>{if(!J||!ye.current)return;const h=()=>{if(ye.current){const C=ye.current.getBoundingClientRect();he({top:C.bottom,left:C.left,width:Math.max(C.width||220,220)})}};return h(),window.addEventListener("scroll",h,!0),window.addEventListener("resize",h),()=>{window.removeEventListener("scroll",h,!0),window.removeEventListener("resize",h)}},[J]),l.useEffect(()=>{const h=C=>{J&&ye.current&&!ye.current.contains(C.target)&&Me.current&&!Me.current.contains(C.target)&&O(!1)};if(J)return document.addEventListener("mousedown",h),()=>{document.removeEventListener("mousedown",h)}},[J]);const pe=H.length===1?((ee=t.find(h=>(h.id||h.key)===H[0]))==null?void 0:ee.label)||"1 selected":`${H.length} selected`;function ce({column:h,isHeaderRow:C=!0}){const D=re(h),{attributes:T,listeners:F,setNodeRef:B,transform:N,transition:se,isDragging:Ve}=Zo({id:D}),_e={transform:Oe.Transform.toString(N),transition:se,opacity:Ve?.5:1,width:h.width||"auto",minWidth:h.width||"auto"};let ft=!1;if(b&&d.length>0){const Ae=d[0][0];(Ae===D||Ae==="csat_score"&&D==="evaluation.csat_score")&&(ft=!0)}else ft=U===D;const Gr=G==="asc",Jr=h.filterable===!0;return C?r.jsx("th",{ref:B,style:{..._e,padding:"12px 14px",textAlign:"left",fontWeight:650,fontSize:"11px",letterSpacing:"0.14em",textTransform:"uppercase",color:"rgba(30, 33, 37, 0.62)",cursor:h.sortable!==!1?"pointer":"default",width:h.width||"auto",borderRight:"1px solid rgba(52, 58, 64, 0.06)",userSelect:"none",background:"rgba(255, 255, 255, 0.95)",borderBottom:"1px solid rgba(52, 58, 64, 0.12)",position:"sticky",top:0,zIndex:10,fontFamily:"var(--font-sans)"},children:r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[r.jsx("div",{...T,...F,style:{cursor:"grab",color:"rgba(30, 33, 37, 0.32)"},children:r.jsx(R.GripVertical,{size:12})}),r.jsx("span",{onClick:()=>h.sortable!==!1&&It(D),style:{cursor:h.sortable!==!1?"pointer":"default"},children:h.label.toUpperCase()}),h.sortable!==!1&&ft&&r.jsx("span",{children:Gr?r.jsx(R.ChevronUp,{size:12}):r.jsx(R.ChevronDown,{size:12})})]})}):r.jsx("th",{style:{width:h.width||"auto",minWidth:h.width||"auto"},className:"sticky top-[57px] z-10 bg-[var(--paper-elevated)] border-b border-[var(--border-strong)] px-4 py-2 text-left",children:Jr?r.jsxs("div",{className:"relative",children:[r.jsx(R.Filter,{size:12,className:"absolute left-2 top-1/2 -translate-y-1/2 text-[var(--text-faint)] pointer-events-none"}),r.jsx("input",{type:"text",placeholder:"Filter...",value:V[D]||"",onChange:Ae=>{Ae.stopPropagation(),Ue(D,Ae.target.value)},onKeyDown:Ae=>Ae.stopPropagation(),onMouseDown:Ae=>Ae.stopPropagation(),className:"w-full pl-7 pr-2 py-1.5 text-xs border border-[var(--border)] rounded bg-[var(--paper)] text-[var(--text-ink)] placeholder:text-[var(--text-faint)] focus:outline-none focus:border-[var(--border-hover)] focus:ring-1 focus:ring-[var(--focus)] transition-colors",style:{fontFamily:"var(--font-sans)"},autoComplete:"off"})]}):r.jsx("div",{className:"h-[34px]"})})}const xe=Ze?t.find(h=>re(h)===Ze):null,Be=J?r.jsxs("div",{ref:Me,className:"flex flex-col bg-white overflow-auto z-[49] min-w-[220px]",style:{position:"fixed",top:`${Re.top}px`,left:`${Re.left}px`,width:Re.width||220,maxHeight:"400px",fontFamily:"var(--font-sans)",borderRadius:"0 0 8px 8px",boxShadow:"4px 4px 6px 0px #6D70681A, -4px 0px 6px 0px #6D70681A",border:"1px solid rgba(52, 58, 64, 0.12)",borderTop:"none"},children:[H.map((h,C)=>{const D=t.find(N=>re(N)===h);if(!D)return null;const T=H.indexOf(h),F=me===T,B=$e===T;return r.jsxs(l.Fragment,{children:[r.jsxs("div",{draggable:!0,onDragStart:N=>Et(N,T),onDragEnd:Mt,onDragOver:N=>Ft(N,T),onDragLeave:ne,onDrop:N=>le(N,T),className:`flex items-center gap-2 px-3 py-2 rounded cursor-move transition-all ${F?"opacity-50":""} ${B&&me!==null&&me!==T?"ring-2 ring-green-2 ring-offset-1":""}`,children:[r.jsx("svg",{className:"h-4 w-4 text-gray-600 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 8h16M4 12h16M4 16h16"})}),r.jsx("button",{type:"button",onClick:N=>{N.preventDefault(),N.stopPropagation(),Xe(h)},className:`h-4 w-4 rounded-[2px] border flex items-center justify-center transition-colors flex-shrink-0 ${De.has(h)?"bg-white border-gray-300":"bg-green-2 border-green-2"}`,children:!De.has(h)&&r.jsx("svg",{className:"h-3 w-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:3,style:{color:"#1E2125"},children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),r.jsx("span",{className:"text-sm text-gray-900 flex-1",style:{fontFamily:"var(--font-sans)"},children:D.label})]}),C<H.length-1&&r.jsx(Pt,{})]},`selected-${h}-${C}`)}),t.filter(h=>!H.includes(re(h))).map((h,C)=>{const D=re(h),T=Ee.has(D),F=t.filter(B=>!H.includes(re(B))).indexOf(h);return r.jsxs(l.Fragment,{children:[H.length>0&&F===0&&r.jsx(Pt,{}),r.jsxs("label",{className:"flex items-center gap-2 px-3 py-2 hover:bg-gray-50 rounded cursor-pointer transition-colors",onClick:B=>{B.preventDefault(),Xe(D)},children:[r.jsx("button",{type:"button",onClick:B=>{B.preventDefault(),B.stopPropagation(),Xe(D)},className:`h-4 w-4 rounded-[2px] border flex items-center justify-center transition-colors flex-shrink-0 ${T?"bg-green-2 border-green-2":"bg-white border-gray-300"}`,children:T&&r.jsx("svg",{className:"h-3 w-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:3,style:{color:"#1E2125"},children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),r.jsx("span",{className:"text-sm text-gray-900 flex-1",children:h.label})]}),F<t.filter(B=>!H.includes(re(B))).length-1&&r.jsx(Pt,{})]},`unselected-${D}`)})]}):null;return r.jsxs("div",{className:"w-full",style:{top:"130px",position:"sticky",zIndex:35,backgroundColor:"#F4F1E6"},children:[t.length>0&&r.jsx("div",{className:"pt-2 pb-1",style:{position:"sticky",zIndex:35,backgroundColor:"#F4F1E6"},children:r.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[r.jsxs("div",{className:"flex-shrink-0",children:[r.jsx("div",{className:"mb-1 ml-1.5",children:r.jsx("p",{className:"text-xs font-medium text-gray-600",style:{fontFamily:"var(--font-sans)"},children:"Select Columns"})}),r.jsxs("div",{ref:ye,className:"inline-flex items-center justify-between gap-2 px-4 py-2.5 bg-white/80 cursor-pointer hover:bg-white transition-colors text-sm font-medium text-gray-900 border border-gray-300 min-w-[220px]",onClick:()=>O(!J),style:{fontFamily:"var(--font-sans)",borderRadius:J?"8px 8px 0 0":"8px"},children:[r.jsx("span",{children:pe}),r.jsx(si,{isOpen:J,iconSize:16})]}),J&&Ge.createPortal(Be,document.body)]}),m&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"h-9 mt-[1.5rem] w-px bg-gray-300 flex-shrink-0"}),r.jsx("div",{className:"flex-shrink-0 mt-[1.5rem]",children:r.jsx(Ur,{dateRangePicker:m.dateRangePicker,onWeekToDate:m.onWeekToDate,exportConfig:m.exportConfig,filterChipsConfig:m.filterChipsConfig,trailingActions:m.trailingActions})})]})]})}),t.length>0&&Z.length>0?r.jsxs(yo,{sensors:Fe,collisionDetection:Cn,onDragStart:pt,onDragEnd:Ne,children:[r.jsxs("div",{className:"rounded-t-[14px]",style:{border:"1px solid rgba(52, 58, 64, 0.12)",borderBottom:"none",overflow:"hidden",background:"rgba(255, 255, 255, 0.82)",position:"relative",top:"0.5rem"},children:[f&&r.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(255, 255, 255, 0.9)",backdropFilter:"blur(2px)",zIndex:20,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",borderRadius:"14px"},children:r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"12px"},children:[r.jsx("p",{style:{fontSize:"13px",color:"rgba(30, 33, 37, 0.6)",margin:0},children:"Loading..."}),r.jsx(li,{src:"/BrandLoading.gif",alt:"Loading",width:50,height:50,unoptimized:!0,className:"mt-1"})]})}),r.jsx("div",{className:"overflow-x-auto custom-thin-scrollbar-hidden",ref:At,style:{maxHeight:"500px",overflowY:"auto",position:"relative",zIndex:1},children:r.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"13px",fontFamily:"var(--font-sans)"},children:[r.jsxs("thead",{children:[r.jsx("tr",{children:r.jsx(Vo,{items:H,strategy:Yo,children:Z.map(h=>r.jsx(ce,{column:h,isHeaderRow:!0},`header-${re(h)}`))})}),Ce&&r.jsx("tr",{children:Z.map(h=>{const C=re(h),D=h.filterable===!0;return r.jsx("th",{style:{padding:"8px 14px",background:"rgba(244, 241, 230, 0.35)",borderBottom:"1px solid rgba(52, 58, 64, 0.10)",position:"sticky",top:"41px",zIndex:10,width:h.width||"auto",fontFamily:"var(--font-sans)"},children:D?r.jsxs("div",{style:{position:"relative"},children:[r.jsx("input",{type:"text",placeholder:"Filter...",value:V[C]||"",onChange:T=>{T.stopPropagation(),Ue(C,T.target.value)},onKeyDown:T=>T.stopPropagation(),onMouseDown:T=>T.stopPropagation(),style:{width:"100%",padding:"4px 8px 4px 26px",fontSize:"11.5px",border:"1px solid rgba(52, 58, 64, 0.16)",borderRadius:"6px",background:"rgba(255, 255, 255, 0.85)",color:"rgba(30, 33, 37, 0.78)",outline:"none",fontFamily:"var(--font-sans)"},onFocus:T=>{T.target.style.borderColor="rgba(231, 212, 162, 0.65)",T.target.style.background="rgba(255, 255, 255, 1)"},onBlur:T=>{T.target.style.borderColor="rgba(52, 58, 64, 0.16)",T.target.style.background="rgba(255, 255, 255, 0.85)"},autoComplete:"off"}),r.jsx(R.Filter,{size:11,style:{position:"absolute",left:"8px",top:"50%",transform:"translateY(-50%)",color:"rgba(30, 33, 37, 0.42)",pointerEvents:"none"}})]}):r.jsx("div",{className:"h-[34px]"})},`filter-${C}`)})})]}),r.jsx("tbody",{children:!f&&He.length===0?r.jsx("tr",{children:r.jsx("td",{colSpan:Z.length,style:{padding:"32px",textAlign:"center",color:"rgba(30, 33, 37, 0.42)",fontSize:"12px",fontFamily:"var(--font-sans)"},children:"No results found"})}):!f&&He.length>0?He.map((h,C)=>r.jsx("tr",{"data-row-id":h.id||C,style:{borderBottom:"1px solid rgba(52, 58, 64, 0.08)",cursor:o?"pointer":"default",transition:"background 0.15s ease"},onClick:o?D=>{D.stopPropagation(),o(h,C)}:void 0,onMouseEnter:D=>{D.currentTarget.style.background="rgba(231, 212, 162, 0.12)"},onMouseLeave:D=>{D.currentTarget.style.background="transparent"},children:Z.map(D=>{const T=re(D),F=h[T],B=D.render?D.render(F,h):F,N=D.width&&D.width!=="auto",se=typeof B=="string"&&B.trim()!=="",Ve=N&&se,_e=Ve?r.jsx(j,{content:B,children:B}):B;return r.jsx("td",{style:{padding:"10px 14px",color:"rgba(30, 33, 37, 0.78)",fontSize:"13px",borderRight:"1px solid rgba(52, 58, 64, 0.04)",width:D.width||"auto",fontFamily:"var(--font-sans)",...Ve&&{maxWidth:D.width||"200px",overflow:"hidden"}},children:_e},T)})},C)):null})]})})]}),r.jsx(Wo,{children:xe?r.jsx("div",{className:"bg-[var(--paper-high)] border border-[var(--border-strong)] rounded px-4 py-2 shadow-lg",children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(R.GripVertical,{size:14,className:"text-[var(--text-faint)]"}),r.jsx("span",{className:"text-sm font-semibold text-[var(--text-ink)]",children:xe.label})]})}):null})]}):null,(S?i>0:We.length>0)&&r.jsx("div",{className:"border-t border-gray-200 bg-white rounded-b-[14px]",children:r.jsx(ii,{page:E,pageSizeOptions:[5,10,20,50,100],pageSize:P,totalCount:S?i:We.length,currentDataLength:He.length,onPageChange:L,onPageSizeChange:u?h=>{_(h),L(1)}:h=>{_(h),L(1)},showPageSizeSelector:!0})})]})}function ui({title:e="Summary stats",stats:t=[],columns:n=2}){return r.jsxs("div",{style:{fontFamily:"system-ui, -apple-system, sans-serif"},children:[r.jsx("div",{className:"text-[11px] tracking-[0.14em] uppercase mb-[10px]",style:{color:"rgba(30, 33, 37, 0.42)",fontWeight:650},children:e}),r.jsx("div",{style:{display:"grid",gridTemplateColumns:`repeat(${n}, minmax(0, 1fr))`,gap:"10px"},children:t.map((o,i)=>r.jsxs("div",{style:{position:"relative",border:"1px solid rgba(52, 58, 64, 0.12)",borderRadius:"12px",background:"rgba(255, 255, 255, 0.72)",padding:o.accentColor?"10px 10px 10px 14px":"10px",minHeight:"62px",display:"flex",flexDirection:"column",justifyContent:"center",gap:"5px",overflow:"hidden"},children:[o.accentColor&&r.jsx("div",{style:{position:"absolute",left:0,top:0,bottom:0,width:"4px",background:o.accentColor,borderTopLeftRadius:"12px",borderBottomLeftRadius:"12px"}}),r.jsx("div",{className:"text-[10px] tracking-[0.14em] uppercase",style:{color:"rgba(30, 33, 37, 0.42)",fontWeight:650,lineHeight:1.1,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:o.label}),r.jsx("div",{style:{fontSize:"13px",color:o.valueStyle==="muted"?"rgba(30, 33, 37, 0.56)":"rgba(30, 33, 37, 0.78)",fontWeight:700,lineHeight:1.15,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",fontFamily:o.valueStyle==="mono"?"ui-monospace, monospace":"inherit"},children:o.value}),o.subtext&&r.jsx("div",{style:{fontSize:"11px",color:"rgba(30, 33, 37, 0.52)",lineHeight:1.15,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:o.subtext})]},i))})]})}const pi={inbound:"var(--rail-discovery, #5E88B0)",outbound:"var(--rail-purple, #9B7AA8)",internal:"var(--rail-outcome, #6B7C93)",chat:"var(--rail-teal, #7BA89D)"},gi=e=>{if(e==null||e<=0)return null;const t=Math.floor(e/3600),n=Math.floor(e%3600/60),o=Math.round(e%60);return t>0?`${t}:${String(n).padStart(2,"0")}:${String(o).padStart(2,"0")}`:`${n}:${String(o).padStart(2,"0")}`},fi=e=>{if(!e)return null;try{return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return null}};function xi({title:e,agentName:t,customerName:n,date:o,duration:i,direction:s,driver:c,sentiment:a,disposition:u,scores:g,tags:x,railColor:d,isActive:p=!1,onClick:f,children:m}){const y=d||pi[s]||"var(--rail-outcome, #6B7C93)",v=gi(i),j=fi(o),S=[];t&&S.push(t),n&&S.push(n),j&&S.push(j),v&&S.push(v);const z=[];return s&&z.push({label:s}),c&&z.push({label:c}),a&&z.push({label:a}),u&&z.push({label:u}),x&&z.push(...x),r.jsxs("div",{onClick:f,style:{position:"relative",padding:"10px 14px 10px 18px",borderRadius:"var(--radius-md, 8px)",overflow:"hidden",background:p?"var(--hover-warm-subtle, rgba(231,212,162,0.08))":"var(--paper-elevated, rgba(255,255,255,0.82))",border:`1px solid ${p?"var(--border-hover, rgba(52,58,64,0.18))":"var(--border, rgba(52,58,64,0.12))"}`,cursor:f?"pointer":"default",transition:"background 0.15s, border-color 0.15s"},onMouseEnter:b=>{!p&&f&&(b.currentTarget.style.background="var(--hover-warm-subtle, rgba(231,212,162,0.08))",b.currentTarget.style.borderColor="var(--border-hover, rgba(52,58,64,0.18))")},onMouseLeave:b=>{p||(b.currentTarget.style.background="var(--paper-elevated, rgba(255,255,255,0.82))",b.currentTarget.style.borderColor="var(--border, rgba(52,58,64,0.12))")},children:[r.jsx("div",{style:{position:"absolute",left:0,top:0,bottom:0,width:"var(--rail-width-thin, 4px)",backgroundColor:y,borderRadius:"var(--radius-md, 8px) 0 0 var(--radius-md, 8px)"}}),r.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:12},children:[r.jsxs("div",{style:{flex:1,minWidth:0},children:[e?r.jsx("div",{style:{fontSize:"var(--text-md, 13px)",fontWeight:550,color:"var(--text-strong, rgba(30,33,37,0.92))",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",lineHeight:"var(--leading-snug, 1.375)"},children:e}):null,S.length>0?r.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginTop:3,fontSize:"var(--text-sm, 11px)",color:"var(--text-muted, rgba(30,33,37,0.56))",lineHeight:"var(--leading-snug, 1.375)"},children:S.map((b,A)=>r.jsxs(l.Fragment,{children:[A>0?r.jsx("span",{style:{color:"var(--text-xfaint, rgba(30,33,37,0.28))"},children:"·"}):null,r.jsx("span",{children:b})]},A))}):null,z.length>0?r.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:4,marginTop:6},children:z.map((b,A)=>r.jsx("span",{style:{display:"inline-block",fontSize:"var(--text-xs, 10px)",fontWeight:500,padding:"1px 7px",borderRadius:999,background:"var(--paper, rgba(255,255,255,0.78))",border:"1px solid var(--border-subtle, rgba(52,58,64,0.08))",color:b.color||"var(--text-faint, rgba(30,33,37,0.36))",textTransform:"capitalize",letterSpacing:"0.01em",lineHeight:1.5},children:b.label},A))}):null]}),g&&g.length>0?r.jsx("div",{style:{display:"flex",gap:10,flexShrink:0,alignItems:"flex-start",paddingTop:2},children:g.map((b,A)=>r.jsxs("div",{style:{textAlign:"center",minWidth:28},children:[r.jsx("div",{style:{fontSize:"var(--text-lg, 14px)",fontWeight:600,color:"var(--text-strong, rgba(30,33,37,0.92))",fontFamily:"var(--font-mono, monospace)",lineHeight:1.2},children:b.value!=null?Math.round(b.value):"—"}),r.jsx("div",{style:{fontSize:"var(--text-xxs, 9px)",fontWeight:650,textTransform:"uppercase",letterSpacing:"var(--tracking-label, 0.16em)",color:"var(--text-xfaint, rgba(30,33,37,0.28))",marginTop:1},children:b.label})]},A))}):null]}),m]})}const hi=({content:e,onCodeBlockClick:t,onFilePathClick:n})=>{const[o,i]=l.useState(new Set),s=async(x,d)=>{try{await navigator.clipboard.writeText(x),i(p=>new Set([...p,d])),setTimeout(()=>{i(p=>{const f=new Set(p);return f.delete(d),f})},2e3)}catch(p){console.error("Failed to copy text:",p)}},c=(x,d,p)=>{const f=o.has(p);return r.jsxs("div",{style:{position:"relative",marginBottom:"16px",borderRadius:"8px",background:"var(--ink, #1E2125)",border:"1px solid var(--border-subtle, rgba(52,58,64,0.08))",overflow:"hidden"},children:[r.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"8px 12px",background:"rgba(255,255,255,0.05)",borderBottom:"1px solid rgba(255,255,255,0.1)"},children:[r.jsx("span",{style:{fontSize:"11px",color:"rgba(255,255,255,0.7)",fontFamily:"var(--font-mono, monospace)",textTransform:"uppercase",letterSpacing:"0.05em"},children:d||"code"}),r.jsxs("button",{onClick:()=>s(x,p),style:{background:"none",border:"none",color:"rgba(255,255,255,0.7)",cursor:"pointer",padding:"4px",borderRadius:"4px",display:"flex",alignItems:"center",gap:"4px",fontSize:"11px",transition:"all 0.15s ease"},onMouseEnter:m=>{m.target.style.background="rgba(255,255,255,0.1)",m.target.style.color="rgba(255,255,255,0.9)"},onMouseLeave:m=>{m.target.style.background="none",m.target.style.color="rgba(255,255,255,0.7)"},children:[f?r.jsx(R.Check,{size:12}):r.jsx(R.Copy,{size:12}),f?"Copied!":"Copy"]}),t&&r.jsxs("button",{onClick:()=>t({code:x,language:d}),style:{background:"none",border:"none",color:"rgba(255,255,255,0.7)",cursor:"pointer",padding:"4px",borderRadius:"4px",display:"flex",alignItems:"center",gap:"4px",fontSize:"11px",transition:"all 0.15s ease"},onMouseEnter:m=>{m.currentTarget.style.background="rgba(255,255,255,0.1)",m.currentTarget.style.color="rgba(255,255,255,0.9)"},onMouseLeave:m=>{m.currentTarget.style.background="none",m.currentTarget.style.color="rgba(255,255,255,0.7)"},children:[r.jsx(R.PanelRightOpen,{size:12}),"Canvas"]})]}),r.jsx("pre",{style:{margin:0,padding:"12px",fontFamily:"var(--font-mono, monospace)",fontSize:"13px",lineHeight:1.4,color:"rgba(255,255,255,0.95)",overflow:"auto",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:x})]},p)},a=x=>{const d=[],p=x.split(`
6
+ `);let f=0,m=0;for(;f<p.length;){const y=p[f];if(y.trim().startsWith("```")){const v=y.trim().slice(3);let j=[];for(f++;f<p.length&&!p[f].trim().startsWith("```");)j.push(p[f]),f++;f<p.length&&f++,d.push(c(j.join(`
7
+ `),v,`code-${m++}`));continue}if(y.startsWith("#")){const v=y.match(/^#+/)[0].length,j=y.slice(v).trim(),S=v===1?"h2":v===2?"h3":v===3?"h4":"h5";d.push(l.createElement(S,{key:`header-${f}`,style:{fontSize:v===1?"18px":v===2?"16px":"14px",fontWeight:720,color:"var(--text-strong, rgba(30,33,37,0.92))",marginTop:d.length>0?"20px":"0",marginBottom:"8px",lineHeight:1.3}},j)),f++;continue}if(y.trim()==="---"||y.trim()==="***"){d.push(r.jsx("hr",{style:{border:"none",borderTop:"1px solid var(--border-subtle, rgba(52,58,64,0.08))",margin:"16px 0"}},`hr-${f}`)),f++;continue}if(y.match(/^(\s*)([-*+]|\d+\.)\s/)){const v=[],j=/^\s*\d+\./.test(y);for(;f<p.length&&(p[f].match(/^(\s*)([-*+]|\d+\.)\s/)||p[f].trim()==="");){if(p[f].trim()!==""){const z=p[f].match(/^(\s*)([-*+]|\d+\.)\s(.*)$/);z&&v.push(z[3])}f++}const S=j?"ol":"ul";d.push(l.createElement(S,{key:`list-${f}`,style:{margin:"8px 0",paddingLeft:"20px",color:"var(--text-strong, rgba(30,33,37,0.92))"}},v.map((z,b)=>l.createElement("li",{key:`item-${b}`,style:{marginBottom:"4px"}},g(z)))));continue}if(y.trim().startsWith("|")&&y.trim().endsWith("|")){const v=[];for(;f<p.length&&p[f].trim().startsWith("|")&&p[f].trim().endsWith("|");)v.push(p[f]),f++;if(v.length>=2){const j=I=>I.trim().slice(1,-1).split("|").map(E=>E.trim()),S=j(v[0]),z=I=>j(I).every(E=>/^[-:]+$/.test(E)),b=v.length>=2&&z(v[1]),A=b?2:1,k=b?j(v[1]).map(I=>I.startsWith(":")&&I.endsWith(":")?"center":I.endsWith(":")?"right":"left"):S.map(()=>"left"),w={padding:"6px 12px",borderBottom:"1px solid var(--border-subtle, rgba(52,58,64,0.08))",fontSize:"13px",lineHeight:1.5,color:"var(--text-strong, rgba(30,33,37,0.92))"};d.push(r.jsx("div",{style:{overflowX:"auto",margin:"8px 0"},children:r.jsxs("table",{style:{borderCollapse:"collapse",width:"100%",border:"1px solid var(--border-subtle, rgba(52,58,64,0.08))",borderRadius:"6px",overflow:"hidden"},children:[b&&r.jsx("thead",{children:r.jsx("tr",{style:{background:"var(--hover-warm-subtle, rgba(231,212,162,0.08))"},children:S.map((I,E)=>r.jsx("th",{style:{...w,fontWeight:660,textAlign:k[E]||"left",whiteSpace:"nowrap"},children:g(I)},E))})}),r.jsx("tbody",{children:(b?v.slice(A):v).map((I,E)=>r.jsx("tr",{style:{background:E%2===1?"var(--hover-warm-subtle, rgba(231,212,162,0.04))":"transparent"},children:j(I).map((P,L)=>r.jsx("td",{style:{...w,textAlign:k[L]||"left"},children:g(P)},L))},E))})]})},`table-${f}`))}continue}if(y.trim()){const v=[];for(;f<p.length&&p[f].trim()&&!p[f].match(/^(#|```|---|\*\*\*|(\s*)([-*+]|\d+\.)\s)/)&&!(p[f].trim().startsWith("|")&&p[f].trim().endsWith("|"));)v.push(p[f]),f++;v.length>0&&d.push(r.jsx("p",{style:{margin:"8px 0",lineHeight:1.6,color:"var(--text-strong, rgba(30,33,37,0.92))"},children:g(v.join(" "))},`p-${f}`))}else f++}return d},u=x=>{const d=[];let p=x,f=0;for(;p.length>0;){if(n){const z=p.match(/^([^\s`*\[]+(?:\/src\/|\/components\/|\/packages\/)[^\s`*\[]*|[^\s`*\[]*\.(ts|tsx|js|jsx|py|css|scss|sass|json|md|yaml|yml|html|xml|sh|sql|go|rs|php|java|c|cpp|h|hpp)(?:\b|$))/);if(z){const b=z[1];d.push(r.jsx("span",{onClick:()=>n(b),style:{color:"var(--rail-discovery, #5E88B0)",textDecoration:"underline",textDecorationStyle:"dotted",textUnderlineOffset:"2px",cursor:"pointer",fontFamily:"var(--font-mono, monospace)",fontSize:"13px",transition:"all 0.15s ease",":hover":{background:"var(--hover-warm-subtle, rgba(231,212,162,0.08))",textDecoration:"underline",textDecorationStyle:"solid"}},onMouseEnter:A=>{A.target.style.background="var(--hover-warm-subtle, rgba(231,212,162,0.08))",A.target.style.textDecorationStyle="solid"},onMouseLeave:A=>{A.target.style.background="none",A.target.style.textDecorationStyle="dotted"},children:b},`file-path-${f++}`)),p=p.slice(z[0].length);continue}}const m=p.match(/^`([^`]+)`/);if(m){d.push(r.jsx("code",{style:{background:"var(--hover-warm-subtle, rgba(231,212,162,0.08))",border:"1px solid var(--border-subtle, rgba(52,58,64,0.08))",borderRadius:"3px",padding:"2px 4px",fontFamily:"var(--font-mono, monospace)",fontSize:"12px",color:"var(--text-strong, rgba(30,33,37,0.92))"},children:m[1]},`inline-code-${f++}`)),p=p.slice(m[0].length);continue}const y=p.match(/^\*\*([^*]+)\*\*/);if(y){d.push(r.jsx("strong",{style:{fontWeight:720,color:"var(--text-strong, rgba(30,33,37,0.92))"},children:y[1]},`bold-${f++}`)),p=p.slice(y[0].length);continue}const v=p.match(/^\*([^*]+)\*/);if(v){d.push(r.jsx("em",{style:{fontStyle:"italic",color:"var(--text-strong, rgba(30,33,37,0.92))"},children:v[1]},`italic-${f++}`)),p=p.slice(v[0].length);continue}const j=p.match(/^\[([^\]]+)\]\(([^)]+)\)/);if(j){d.push(r.jsx("a",{href:j[2],target:"_blank",rel:"noopener noreferrer",style:{color:"var(--rail-discovery, #5E88B0)",textDecoration:"underline",textUnderlineOffset:"2px"},children:j[1]},`link-${f++}`)),p=p.slice(j[0].length);continue}const S=p.search(/[`*\[]/);if(S===-1){d.push(p);break}else S===0?(d.push(p[0]),p=p.slice(1)):(d.push(p.slice(0,S)),p=p.slice(S))}return d.length===1&&typeof d[0]=="string"?d[0]:d},g=x=>u(x);return r.jsx("div",{children:a(e)})};function Vt({role:e,content:t,html:n,timestamp:o,toolBadges:i,isStreaming:s,onCodeBlockClick:c,onFilePathClick:a}){const u=e==="user";return r.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:u?"flex-end":"flex-start",marginBottom:"16px",maxWidth:"100%"},children:[r.jsxs("div",{style:{fontSize:"var(--text-sm, 11px)",color:"var(--text-faint, rgba(30,33,37,0.36))",marginBottom:"6px",fontWeight:650,letterSpacing:"0.02em"},children:[u?"You":"Chordia",s&&!u&&r.jsx("span",{style:{marginLeft:"6px",color:"var(--rail-purple, #9B7AA8)"},children:"●"})]}),i&&i.length>0&&r.jsx("div",{style:{marginBottom:"8px",display:"flex",flexWrap:"wrap",gap:"4px",maxWidth:"75%"},children:i.map((g,x)=>r.jsxs("span",{style:{display:"inline-block",fontSize:"11px",padding:"2px 8px",borderRadius:"6px",background:"var(--paper-elevated, rgba(255,255,255,0.82))",border:`1px solid ${g.pending?"var(--rail-discovery, #5A8CC0)":g.success!==!1?"var(--state-present, #5CB85C)":"var(--rail-signal-churn, #C98A5A)"}`,color:g.pending?"var(--rail-discovery, #5A8CC0)":g.success!==!1?"var(--state-present, #5CB85C)":"var(--rail-signal-churn, #C98A5A)"},children:[r.jsx(R.Wrench,{size:10,style:{marginRight:3,verticalAlign:"middle"}}),g.name,g.pending?"...":g.success!==!1?" ✓":" ✗"]},g.id||x))}),r.jsx("div",{style:{maxWidth:"75%",padding:"12px 16px",borderRadius:"var(--radius-lg, 12px)",background:u?"var(--card-customer, rgba(94,136,176,0.08))":"var(--paper-elevated, rgba(255,255,255,0.82))",border:u?"1px solid var(--border-subtle, rgba(52,58,64,0.08))":"1px solid var(--border, rgba(52,58,64,0.12))",fontSize:"var(--text-base, 14px)",lineHeight:1.6,color:"var(--text-strong, rgba(30,33,37,0.92))",wordBreak:"break-word"},children:n?r.jsx("div",{dangerouslySetInnerHTML:{__html:n}}):u?r.jsx("div",{style:{whiteSpace:"pre-wrap"},children:t}):r.jsx(hi,{content:t||"",onCodeBlockClick:c,onFilePathClick:a})}),o&&r.jsx("div",{style:{fontSize:"var(--text-xs-plus, 10.5px)",color:"var(--text-faint, rgba(30,33,37,0.36))",marginTop:"4px",fontFamily:"var(--font-mono, monospace)"},children:o})]})}function bi({phase:e="thinking",toolSteps:t=[],label:n,elapsedMs:o,compact:i=!1}){const s=p=>{if(!p||p<1e3)return null;const f=Math.floor(p/1e3);if(f<60)return`${f}s`;const m=Math.floor(f/60),y=f%60;return y>0?`${m}m ${y}s`:`${m}m`},c=()=>{if(n)return n;switch(e){case"thinking":return"Thinking...";case"tool":return null;case"responding":return"Responding...";default:return"Thinking..."}},a=(p,f)=>{const m=()=>{const v={width:i?"4px":"6px",height:i?"4px":"6px",borderRadius:"50%",display:"inline-block",marginRight:i?"6px":"8px"};switch(p.status){case"active":return r.jsx("span",{style:{...v,backgroundColor:"var(--rail-purple, #9B7AA8)",animation:"pulse 1.2s ease-in-out infinite"}});case"done":return r.jsx("span",{style:{...v,backgroundColor:"var(--text-xfaint, rgba(30,33,37,0.28))"}});case"error":return r.jsx("span",{style:{...v,backgroundColor:"var(--rail-compliance, #C98A5A)"}});default:return r.jsx("span",{style:{...v,backgroundColor:"var(--text-xfaint, rgba(30,33,37,0.28))"}})}},y=()=>{switch(p.status){case"done":return r.jsx("span",{style:{color:"var(--text-faint, rgba(30,33,37,0.36))",fontSize:i?"9px":"var(--text-xs-plus, 10.5px)"},children:"✓"});case"error":return r.jsx("span",{style:{color:"var(--rail-compliance, #C98A5A)",fontSize:i?"9px":"var(--text-xs-plus, 10.5px)"},children:"failed"});default:return null}};return r.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:i?"2px":"4px"},children:[r.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[m(),r.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:i?"9px":"var(--text-xs-plus, 10.5px)",color:"var(--text-muted)"},children:p.name})]}),y()]},f)},u=()=>r.jsx("div",{style:{width:"100%",height:i?"2px":"3px",backgroundColor:"var(--border-subtle, rgba(52,58,64,0.08))",borderRadius:i?"2px":"3px",overflow:"hidden",position:"relative"},children:r.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,background:"linear-gradient(90deg, transparent 0%, rgba(155,122,168,0.3) 50%, transparent 100%)",animation:"shimmer 2s linear infinite"}})}),g=()=>r.jsx("span",{style:{width:i?"4px":"6px",height:i?"10px":"14px",backgroundColor:"var(--rail-purple, #9B7AA8)",borderRadius:"1px",display:"inline-block",marginLeft:"2px",animation:"cursorBlink 0.8s ease-in-out infinite"}}),x=c(),d=s(o);return r.jsxs("div",{style:{borderLeft:`${i?"3px":"4px"} solid var(--rail-purple, #9B7AA8)`,backgroundColor:"var(--card-assistant, rgba(155,122,168,0.06))",border:"1px solid var(--border-subtle, rgba(52,58,64,0.08))",borderRadius:i?"8px":"10px",padding:i?"8px 10px 8px 12px":"10px 14px 10px 18px"},children:[r.jsx("style",{children:`
8
+ @keyframes shimmer {
9
+ 0% { transform: translateX(-100%); }
10
+ 100% { transform: translateX(200%); }
11
+ }
12
+
13
+ @keyframes pulse {
14
+ 0%, 100% { opacity: 0.4; }
15
+ 50% { opacity: 1.0; }
16
+ }
17
+
18
+ @keyframes cursorBlink {
19
+ 0%, 100% { opacity: 0; }
20
+ 50% { opacity: 1; }
21
+ }
22
+ `}),!i&&r.jsx("div",{style:{fontSize:"var(--text-xs-plus, 10.5px)",fontWeight:650,textTransform:"uppercase",letterSpacing:"var(--tracking-label, 0.16em)",color:"var(--text-faint, rgba(30,33,37,0.36))",marginBottom:"8px"},children:"AI ASSISTANT"}),e==="thinking"&&r.jsxs("div",{children:[r.jsxs("div",{style:{color:"var(--text-muted)",fontWeight:400,fontSize:i?"11px":"13px",marginBottom:i?"4px":"8px",display:"flex",alignItems:"center",gap:"6px"},children:[x,d&&r.jsx("span",{style:{fontSize:i?"9px":"10px",color:"var(--text-faint, rgba(30,33,37,0.36))",fontFamily:"var(--font-mono, monospace)"},children:d})]}),u()]}),e==="tool"&&r.jsxs("div",{children:[x&&r.jsxs("div",{style:{color:"var(--text-muted)",fontWeight:400,fontSize:i?"11px":"13px",marginBottom:i?"4px":"8px",display:"flex",alignItems:"center",gap:"6px"},children:[x,d&&r.jsx("span",{style:{fontSize:i?"9px":"10px",color:"var(--text-faint, rgba(30,33,37,0.36))",fontFamily:"var(--font-mono, monospace)"},children:d})]}),r.jsx("div",{style:{marginBottom:i?"4px":"8px"},children:t.map((p,f)=>a(p,f))}),u()]}),e==="responding"&&r.jsxs("div",{style:{color:"var(--text-muted)",fontWeight:400,fontSize:i?"11px":"13px",display:"flex",alignItems:"center",gap:"6px"},children:[r.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[x,g()]}),d&&r.jsx("span",{style:{fontSize:i?"9px":"10px",color:"var(--text-faint, rgba(30,33,37,0.36))",fontFamily:"var(--font-mono, monospace)"},children:d})]})]})}const vi={error:(...e)=>console.warn("toast.error:",...e)};function mi({initialMessages:e=[],onSendMessage:t,onStreamMessage:n,onMessagesChange:o,onCodeBlockClick:i,placeholder:s="Ask a question about this interaction...",title:c="Chat with Chordia"}){const[a,u]=l.useState(e||[]),[g,x]=l.useState(""),[d,p]=l.useState(!1),[f,m]=l.useState(!1),[y,v]=l.useState(null),[j,S]=l.useState("thinking"),[z,b]=l.useState(null),[A,k]=l.useState(0),w=l.useRef(null),I=l.useRef(null),E=l.useRef(null),P=l.useRef(null),L=l.useRef(null),[_,q]=l.useState(!1),[$,ae]=l.useState(0);l.useEffect(()=>{var M;(M=w.current)==null||M.scrollIntoView({behavior:"smooth"})},[a,d]),l.useEffect(()=>{I.current&&(I.current.style.height="auto",I.current.style.height=`${Math.min(I.current.scrollHeight,120)}px`)},[g]),l.useEffect(()=>{if(o){const M=[...a];y&&M.push(y),o(M)}},[a,y,o]),l.useEffect(()=>{let M;return d&&z&&(M=setInterval(()=>{if(k(Date.now()-z),L.current){const U=(Date.now()-L.current)/1e3;U>=3?(q(!0),ae(Math.floor(U))):q(!1)}},500)),()=>M&&clearInterval(M)},[d,z]);const ue=()=>{p(!1),m(!1),v(null),P.current=null,S("thinking"),q(!1),ae(0),L.current=null,b(null),k(0),E.current&&(E.current.abort(),E.current=null)},V=M=>{if(M.startsWith("data: ")){const U=M.slice(6);if(U==="[DONE]")return{type:"done"};try{return{type:"data",data:JSON.parse(U)}}catch{return null}}return null},Ie=M=>{var G,X;if(!((X=(G=M.choices)==null?void 0:G[0])!=null&&X.delta))return;L.current=Date.now(),q(!1);const U=M.choices[0].delta;if(U.tool_calls||U.tool_results){S("tool");return}U.content!==void 0&&(S("responding"),v(Y=>{const H=Y||{id:Date.now().toString(),role:"assistant",content:"",timestamp:new Date().toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),isStreaming:!0},K={...H,content:(H.content||"")+(U.content||"")};return P.current=K,K}))},ie=async M=>{const U=M.getReader(),G=new TextDecoder;let X="";try{for(;;){const{done:Y,value:H}=await U.read();if(Y)break;X+=G.decode(H,{stream:!0});const K=X.split(`
23
+ `);X=K.pop()||"";for(const J of K)if(J.trim()){const O=V(J);if(O){if(O.type==="done")return;O.type==="data"&&Ie(O.data)}}}}finally{U.releaseLock()}},je=async()=>{if(!g.trim()||f)return;const M=g.trim(),U={id:Date.now().toString(),role:"user",content:M,timestamp:new Date().toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"})},G=[...a,U];u(G),x(""),p(!0),m(!0),S("thinking"),b(Date.now()),L.current=Date.now(),E.current=new AbortController;try{let X;if(n)X=await n(M,G);else if(t)X=await t(M,G);else{setTimeout(()=>{const Y={id:(Date.now()+1).toString(),role:"assistant",content:"This is a demonstration response. In a real implementation, this would connect to your LLM backend.",timestamp:new Date().toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"})};u(H=>[...H,Y]),ue()},1e3);return}if(X instanceof ReadableStream)await ie(X);else if(X instanceof Response&&X.body)await ie(X.body);else if(X&&typeof X.then=="function"){const Y=await X;Y instanceof ReadableStream?await ie(Y):Y instanceof Response&&Y.body&&await ie(Y.body)}P.current&&u(Y=>[...Y,{...P.current,isStreaming:!1}])}catch(X){X.name!=="AbortError"&&(vi.error("Failed to send message"),console.error("Stream error:",X))}finally{ue()}},ke=M=>{M.key==="Enter"&&!M.shiftKey&&(M.preventDefault(),je())};return r.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%",border:"1px solid var(--border, rgba(52,58,64,0.12))",borderRadius:"var(--radius-lg, 12px)",background:"var(--paper-elevated, rgba(255,255,255,0.82))",overflow:"hidden"},children:[c?r.jsxs("div",{style:{padding:"16px 20px",borderBottom:"1px solid var(--border-subtle, rgba(52,58,64,0.08))",background:"var(--paper-elevated, rgba(255,255,255,0.82))"},children:[r.jsx("div",{style:{fontSize:"var(--text-lg, 16px)",fontWeight:720,letterSpacing:"-0.01em",color:"var(--text-strong, rgba(30,33,37,0.92))"},children:c}),r.jsx("div",{style:{fontSize:"var(--text-sm, 11px)",color:"var(--text-muted, rgba(30,33,37,0.56))",marginTop:"2px"},children:"Ask questions, get insights from analyzed interactions"})]}):null,r.jsx("div",{style:{flex:1,minHeight:0,overflowY:"auto",padding:"20px",display:"flex",flexDirection:"column"},children:a.length===0?r.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--text-faint, rgba(30,33,37,0.36))",fontSize:"var(--text-md, 13px)",textAlign:"center",padding:"40px"},children:"No messages yet. Start a conversation by asking a question below."}):r.jsxs(r.Fragment,{children:[a.map(M=>r.jsx(Vt,{role:M.role,content:M.content,html:M.html,timestamp:M.timestamp,toolBadges:M.toolBadges,isStreaming:M.isStreaming,onCodeBlockClick:i},M.id)),y&&r.jsx(Vt,{role:y.role,content:y.content,timestamp:y.timestamp,isStreaming:!0,onCodeBlockClick:i},y.id),d&&(!y||_)&&r.jsx("div",{style:{marginBottom:"16px"},children:r.jsx(bi,{phase:_?"tool":j,elapsedMs:A,label:_&&$>=30?"Compacting conversation — trimming context to stay sharp...":_&&$>=10?"Running background tasks...":_?"Still working...":void 0})}),r.jsx("div",{ref:w})]})}),r.jsxs("div",{style:{borderTop:"1px solid var(--border-subtle, rgba(52,58,64,0.08))",padding:"16px 20px",background:"var(--paper-elevated, rgba(255,255,255,0.82))"},children:[r.jsxs("div",{style:{display:"flex",gap:"12px",alignItems:"flex-end"},children:[r.jsx("textarea",{ref:I,value:g,onChange:M=>x(M.target.value),onKeyDown:ke,placeholder:s,rows:1,disabled:f,style:{flex:1,padding:"10px 14px",fontSize:"var(--text-base, 14px)",lineHeight:1.5,color:"var(--text-strong, rgba(30,33,37,0.92))",background:"rgba(255, 255, 255, 0.95)",border:"1px solid rgba(52, 58, 64, 0.18)",borderRadius:"var(--radius-md, 8px)",resize:"none",outline:"none",transition:"border-color 0.15s ease",fontFamily:"inherit",minHeight:"42px",maxHeight:"120px",opacity:f?.6:1,cursor:f?"not-allowed":"text"},onFocus:M=>{f||(M.target.style.borderColor="rgba(94, 136, 176, 0.35)")},onBlur:M=>{M.target.style.borderColor="rgba(52, 58, 64, 0.18)"}}),r.jsx("button",{onClick:je,disabled:!g.trim()||f,style:{padding:"10px 16px",background:g.trim()&&!f?"var(--rail-discovery, #5E88B0)":"var(--border-subtle, rgba(52,58,64,0.08))",color:g.trim()&&!f?"rgba(255, 255, 255, 0.95)":"var(--text-faint, rgba(30,33,37,0.36))",border:"none",borderRadius:"var(--radius-md, 8px)",cursor:g.trim()&&!f?"pointer":"not-allowed",display:"flex",alignItems:"center",gap:"6px",fontSize:"var(--text-md, 13px)",fontWeight:650,transition:"all 0.15s ease",height:"42px"},onMouseEnter:M=>{g.trim()&&!f&&(M.currentTarget.style.background="rgba(94, 136, 176, 1)")},onMouseLeave:M=>{g.trim()&&!f&&(M.currentTarget.style.background="var(--rail-discovery, #5E88B0)")},children:f?r.jsxs(r.Fragment,{children:[r.jsx("style",{children:`
24
+ @keyframes buttonSpin {
25
+ from { transform: rotate(0deg); }
26
+ to { transform: rotate(360deg); }
27
+ }
28
+ `}),r.jsx("div",{style:{width:"14px",height:"14px",border:"2px solid rgba(255, 255, 255, 0.3)",borderTopColor:"white",borderRadius:"50%",animation:"buttonSpin 0.6s linear infinite"}}),"Sending..."]}):r.jsxs(r.Fragment,{children:[r.jsx(R.Send,{size:16}),"Send"]})})]}),r.jsx("div",{style:{fontSize:"var(--text-sm, 11px)",color:"var(--text-faint, rgba(30,33,37,0.36))",marginTop:"8px"},children:"Press Enter to send, Shift+Enter for new line"})]})]})}function yi({threads:e=[],activeThreadId:t,onSelectThread:n,onNewChat:o,loading:i=!1}){const[s,c]=l.useState(""),u=[...e.filter(x=>{if(!s)return!0;const d=s.toLowerCase();return(x.title||"").toLowerCase().includes(d)||(x.last_message_preview||"").toLowerCase().includes(d)})].sort((x,d)=>{if(x.pinned&&!d.pinned)return-1;if(!x.pinned&&d.pinned)return 1;const p=new Date(x.updated_at||x.created_at||0).getTime();return new Date(d.updated_at||d.created_at||0).getTime()-p}),g=x=>{if(!x)return"";const d=new Date(x),f=new Date().getTime()-d.getTime(),m=Math.floor(f/864e5);return m===0?d.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}):m===1?"Yesterday":m<7?d.toLocaleDateString("en-US",{weekday:"short"}):d.toLocaleDateString("en-US",{month:"short",day:"numeric"})};return r.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%",background:"var(--paper, rgba(255,255,255,0.95))",borderRight:"1px solid var(--border, rgba(52,58,64,0.12))",overflow:"hidden"},children:[r.jsxs("div",{style:{padding:"12px 14px",borderBottom:"1px solid var(--border-subtle, rgba(52,58,64,0.08))",flexShrink:0},children:[r.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"10px"},children:[r.jsx("div",{style:{fontSize:"13px",fontWeight:650,color:"var(--text-ink, rgba(30,33,37,0.92))"},children:"Threads"}),o&&r.jsx("button",{onClick:o,style:{padding:"4px 10px",fontSize:"11px",fontWeight:600,color:"var(--rail-discovery, #5E88B0)",background:"rgba(94, 136, 176, 0.08)",border:"1px solid var(--border-subtle, rgba(52,58,64,0.08))",borderRadius:"6px",cursor:"pointer",transition:"all 0.15s ease"},onMouseEnter:x=>{x.currentTarget.style.background="rgba(94, 136, 176, 0.14)"},onMouseLeave:x=>{x.currentTarget.style.background="rgba(94, 136, 176, 0.08)"},children:"+ New"})]}),r.jsxs("div",{style:{position:"relative"},children:[r.jsx(R.Search,{size:13,style:{position:"absolute",left:"10px",top:"50%",transform:"translateY(-50%)",color:"var(--text-faint, rgba(30,33,37,0.36))",pointerEvents:"none"}}),r.jsx("input",{type:"text",value:s,onChange:x=>c(x.target.value),placeholder:"Search threads...",style:{width:"100%",padding:"7px 10px 7px 32px",fontSize:"12px",color:"var(--text-ink, rgba(30,33,37,0.92))",background:"var(--paper-elevated, rgba(255,255,255,0.82))",border:"1px solid var(--border, rgba(52,58,64,0.12))",borderRadius:"6px",outline:"none",transition:"border-color 0.15s ease",boxSizing:"border-box"},onFocus:x=>{x.target.style.borderColor="rgba(94, 136, 176, 0.35)"},onBlur:x=>{x.target.style.borderColor="rgba(52, 58, 64, 0.12)"}})]})]}),r.jsx("div",{style:{flex:1,overflowY:"auto",padding:"4px 6px"},children:i?r.jsx("div",{style:{padding:"30px 16px",textAlign:"center",color:"var(--text-faint, rgba(30,33,37,0.36))",fontSize:"12px"},children:"Loading threads..."}):u.length===0?r.jsx("div",{style:{padding:"30px 16px",textAlign:"center",color:"var(--text-faint, rgba(30,33,37,0.36))",fontSize:"12px"},children:s?"No threads found":"No threads yet"}):u.map(x=>{const d=x.id===t;return r.jsxs("div",{onClick:()=>n==null?void 0:n(x.id),style:{padding:"10px 10px",marginBottom:"2px",borderRadius:"6px",background:d?"rgba(94, 136, 176, 0.10)":"transparent",border:d?"1px solid rgba(94, 136, 176, 0.15)":"1px solid transparent",cursor:"pointer",transition:"all 0.12s ease"},onMouseEnter:p=>{d||(p.currentTarget.style.background="rgba(0,0,0,0.03)")},onMouseLeave:p=>{d||(p.currentTarget.style.background="transparent")},children:[r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px",marginBottom:"4px"},children:[r.jsx(R.MessageSquare,{size:12,style:{color:d?"var(--rail-discovery, #5E88B0)":"var(--text-faint, rgba(30,33,37,0.36))",flexShrink:0}}),r.jsx("div",{style:{flex:1,fontSize:"12px",fontWeight:d?650:550,color:d?"var(--text-ink, rgba(30,33,37,0.92))":"var(--text-base, rgba(30,33,37,0.78))",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:x.title||"Untitled thread"}),x.pinned&&r.jsx(R.Pin,{size:10,style:{color:"var(--rail-discovery, #5E88B0)",flexShrink:0}})]}),x.last_message_preview&&r.jsx("div",{style:{fontSize:"11px",color:"var(--text-muted, rgba(30,33,37,0.56))",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",marginLeft:"18px",marginBottom:"4px"},children:x.last_message_preview}),r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px",marginLeft:"18px",fontSize:"10px",color:"var(--text-faint, rgba(30,33,37,0.36))"},children:[r.jsx(R.Clock,{size:9}),r.jsx("span",{children:g(x.updated_at||x.created_at)}),x.message_count!=null&&r.jsxs(r.Fragment,{children:[r.jsx("span",{children:"·"}),r.jsxs("span",{children:[x.message_count," msg",x.message_count!==1?"s":""]})]})]})]},x.id)})})]})}const wi={error:(...e)=>console.warn("toast.error:",...e)},Si=()=>({userData:{name:"User",email:""}});function ji({sessionTitle:e,messages:t,onSendMessage:n,currentUser:o}){var z;const[i,s]=l.useState(""),[c,a]=l.useState(!1),[u,g]=l.useState(t||[]),[x,d]=l.useState(!1),[p,f]=l.useState(!1),{userData:m}=Si(),y=l.useRef(null),v=o||{name:m==null?void 0:m.name,initials:((z=m==null?void 0:m.name)==null?void 0:z.split(" ").map(b=>b[0]).join("").toUpperCase())||"YO",color:"#6B7C93"};l.useEffect(()=>{g(t||[])},[t]),l.useEffect(()=>{y.current&&y.current.scrollIntoView({behavior:"smooth"})},[u]);const j=async()=>{if(!i.trim())return;const b=i.trim();s(""),f(!0);const A={id:`temp-${Date.now()}`,author:{name:v.name,role:(m==null?void 0:m.role)||"",initials:v.initials,color:v.color},content:b,timestamp:"Just now",type:"comment",isOptimistic:!0};if(g(k=>[...k,A]),n){try{await n(b),g(k=>k.map(w=>w.id===A.id?{...w,isOptimistic:!1}:w))}catch{g(w=>w.filter(I=>I.id!==A.id)),wi.error("Failed to send message")}finally{f(!1)}return}setTimeout(()=>{g(k=>k.map(w=>w.id===A.id?{...w,isOptimistic:!1}:w)),f(!1)},500)},S=b=>{b.key==="Enter"&&!b.shiftKey&&(b.preventDefault(),j())};return r.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%",background:"var(--paper-elevated, rgba(255,255,255,0.82))",border:"1px solid var(--border, rgba(52,58,64,0.12))",borderRadius:"var(--radius-lg, 12px)",overflow:"hidden"},children:[e&&r.jsxs("div",{style:{padding:"14px 16px",borderBottom:"1px solid var(--border, rgba(52,58,64,0.12))",background:"var(--paper-elevated, rgba(255,255,255,0.82))"},children:[r.jsx("div",{style:{fontSize:"var(--text-md, 13px)",fontWeight:680,color:"var(--text-strong, rgba(30,33,37,0.92))",marginBottom:"3px"},children:"Session Discussion"}),e&&r.jsx("div",{style:{fontSize:"var(--text-sm, 11px)",color:"var(--text-muted, rgba(30,33,37,0.56))",display:"flex",alignItems:"center",gap:"8px"},children:r.jsx("span",{children:e})})]}),r.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"16px",display:"flex",flexDirection:"column",gap:"16px"},children:[x?r.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"40px",color:"var(--text-faint, rgba(30,33,37,0.36))"},children:"Loading messages..."}):u.length===0?r.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"40px",color:"var(--text-faint, rgba(30,33,37,0.36))"},children:"No messages yet. Start the conversation!"}):u.map(b=>r.jsxs("div",{style:{display:"flex",gap:"12px",opacity:b.type==="system"?.75:1},children:[b.type!=="system"&&r.jsx("div",{style:{width:"32px",height:"32px",borderRadius:"8px",background:b.author.color,color:"white",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"11px",fontWeight:650,flexShrink:0,opacity:.9},children:b.author.initials}),b.type==="system"&&r.jsx("div",{style:{width:"32px",height:"32px",borderRadius:"8px",background:"rgba(30, 33, 37, 0.08)",color:"rgba(30, 33, 37, 0.52)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"11px",fontWeight:650,flexShrink:0},children:r.jsx(R.Clock,{size:14})}),r.jsxs("div",{style:{flex:1,minWidth:0},children:[r.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:"8px",marginBottom:"4px"},children:[r.jsx("span",{style:{fontSize:"var(--text-sm, 11px)",fontWeight:650,color:"var(--text-base, rgba(30,33,37,0.78))"},children:b.author.name}),r.jsx("span",{style:{fontSize:"var(--text-sm, 11px)",color:"var(--text-faint, rgba(30,33,37,0.36))",fontFamily:"var(--font-mono, monospace)"},children:b.timestamp}),b.author.role&&r.jsx("span",{style:{fontSize:"var(--text-xs, 10px)",color:"var(--text-muted, rgba(30,33,37,0.56))",background:"rgba(30, 33, 37, 0.06)",padding:"2px 6px",borderRadius:"4px",textTransform:"uppercase",letterSpacing:"0.04em",fontWeight:600},children:b.author.role}),b.isEdited&&r.jsx("span",{style:{fontSize:"var(--text-xs, 10px)",color:"var(--text-faint, rgba(30,33,37,0.36))",fontStyle:"italic"},children:"(edited)"})]}),r.jsx("div",{style:{fontSize:"var(--text-md, 13px)",color:"var(--text-base, rgba(30,33,37,0.78))",lineHeight:1.5,marginBottom:b.references?"8px":0},children:b.content}),b.references&&b.references.length>0&&r.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px",marginTop:"8px"},children:b.references.map((A,k)=>r.jsxs("button",{type:"button",style:{fontSize:"11px",padding:"4px 8px",borderRadius:"6px",border:"1px solid rgba(52, 58, 64, 0.16)",background:"rgba(255, 255, 255, 0.7)",color:A.type==="condition"?"rgba(94, 136, 176, 0.85)":A.type==="observation"?"rgba(107, 123, 147, 0.85)":A.type==="timestamp"?"rgba(184, 156, 106, 0.85)":"rgba(30, 33, 37, 0.65)",cursor:"pointer",display:"inline-flex",alignItems:"center",gap:"4px",transition:"all 0.15s ease",fontWeight:550},onMouseEnter:w=>{w.currentTarget.style.background="rgba(255, 255, 255, 0.95)",w.currentTarget.style.borderColor="rgba(52, 58, 64, 0.24)"},onMouseLeave:w=>{w.currentTarget.style.background="rgba(255, 255, 255, 0.7)",w.currentTarget.style.borderColor="rgba(52, 58, 64, 0.16)"},children:[A.type==="timestamp"&&r.jsx(R.Clock,{size:12}),(A.type==="condition"||A.type==="observation")&&r.jsx(R.Hash,{size:12}),A.label]},k))})]})]},b.id)),r.jsx("div",{ref:y})]}),r.jsxs("div",{style:{padding:"12px",borderTop:"1px solid var(--border, rgba(52,58,64,0.12))",background:"var(--paper-elevated, rgba(255,255,255,0.82))"},children:[r.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"flex-end"},children:[r.jsx("div",{style:{width:"32px",height:"32px",borderRadius:"var(--radius-md, 8px)",background:v.color,color:"white",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"var(--text-sm, 11px)",fontWeight:650,flexShrink:0,opacity:.9},children:v.initials}),r.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:"8px"},children:[r.jsx("textarea",{value:i,onChange:b=>s(b.target.value),onKeyDown:S,onFocus:()=>a(!0),onBlur:()=>a(!1),placeholder:"Add a comment...",style:{width:"100%",minHeight:"38px",maxHeight:"120px",padding:"8px 12px",fontSize:"var(--text-md, 13px)",color:"var(--text-base, rgba(30,33,37,0.78))",background:"white",border:`1px solid ${c?"rgba(94, 136, 176, 0.35)":"rgba(52, 58, 64, 0.16)"}`,borderRadius:"var(--radius-md, 8px)",resize:"vertical",outline:"none",transition:"border-color 0.15s ease",fontFamily:"inherit",lineHeight:1.5}}),r.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[r.jsxs("div",{style:{display:"flex",gap:"4px"},children:[r.jsx("button",{type:"button",style:{padding:"6px",background:"transparent",border:"none",borderRadius:"6px",color:"rgba(30, 33, 37, 0.52)",cursor:"pointer",display:"flex",alignItems:"center",transition:"all 0.15s ease"},onMouseEnter:b=>{b.currentTarget.style.background="rgba(30, 33, 37, 0.06)",b.currentTarget.style.color="rgba(30, 33, 37, 0.75)"},onMouseLeave:b=>{b.currentTarget.style.background="transparent",b.currentTarget.style.color="rgba(30, 33, 37, 0.52)"},title:"Mention user",children:r.jsx(R.AtSign,{size:16})}),r.jsx("button",{type:"button",style:{padding:"6px",background:"transparent",border:"none",borderRadius:"6px",color:"rgba(30, 33, 37, 0.52)",cursor:"pointer",display:"flex",alignItems:"center",transition:"all 0.15s ease"},onMouseEnter:b=>{b.currentTarget.style.background="rgba(30, 33, 37, 0.06)",b.currentTarget.style.color="rgba(30, 33, 37, 0.75)"},onMouseLeave:b=>{b.currentTarget.style.background="transparent",b.currentTarget.style.color="rgba(30, 33, 37, 0.52)"},title:"Reference condition",children:r.jsx(R.Hash,{size:16})}),r.jsx("button",{type:"button",style:{padding:"6px",background:"transparent",border:"none",borderRadius:"6px",color:"rgba(30, 33, 37, 0.52)",cursor:"pointer",display:"flex",alignItems:"center",transition:"all 0.15s ease"},onMouseEnter:b=>{b.currentTarget.style.background="rgba(30, 33, 37, 0.06)",b.currentTarget.style.color="rgba(30, 33, 37, 0.75)"},onMouseLeave:b=>{b.currentTarget.style.background="transparent",b.currentTarget.style.color="rgba(30, 33, 37, 0.52)"},title:"Attach file",children:r.jsx(R.Paperclip,{size:16})})]}),r.jsx("button",{type:"button",onClick:j,disabled:!i.trim()||p,style:{padding:"6px 12px",background:i.trim()&&!p?"rgba(94, 136, 176, 0.85)":"var(--border-subtle, rgba(52,58,64,0.08))",border:"none",borderRadius:"6px",color:i.trim()&&!p?"white":"var(--text-faint, rgba(30,33,37,0.36))",fontSize:"var(--text-sm, 11px)",fontWeight:600,cursor:i.trim()&&!p?"pointer":"not-allowed",display:"flex",alignItems:"center",gap:"6px",transition:"all 0.15s ease"},onMouseEnter:b=>{i.trim()&&!p&&(b.currentTarget.style.background="rgba(94, 136, 176, 1)")},onMouseLeave:b=>{i.trim()&&!p&&(b.currentTarget.style.background="rgba(94, 136, 176, 0.85)")},children:p?r.jsxs(r.Fragment,{children:[r.jsx("style",{children:`
29
+ @keyframes messageSpin {
30
+ from { transform: rotate(0deg); }
31
+ to { transform: rotate(360deg); }
32
+ }
33
+ `}),r.jsx("div",{style:{width:"14px",height:"14px",border:"2px solid rgba(255, 255, 255, 0.3)",borderTopColor:"white",borderRadius:"50%",animation:"messageSpin 0.6s linear infinite"}}),"Sending..."]}):r.jsxs(r.Fragment,{children:[r.jsx(R.Send,{size:14}),"Send"]})})]})]})]}),r.jsxs("div",{style:{marginTop:"8px",fontSize:"var(--text-sm, 11px)",color:"var(--text-faint, rgba(30,33,37,0.36))",lineHeight:1.4},children:[r.jsx("strong",{children:"Tip:"})," Use"," ",r.jsx("code",{style:{background:"rgba(30, 33, 37, 0.06)",padding:"2px 4px",borderRadius:"3px",fontFamily:"var(--font-mono, monospace)",fontSize:"var(--text-xs, 10px)"},children:"@"})," ","to mention teammates,"," ",r.jsx("code",{style:{background:"rgba(30, 33, 37, 0.06)",padding:"2px 4px",borderRadius:"3px",fontFamily:"var(--font-mono, monospace)",fontSize:"var(--text-xs, 10px)"},children:"#"})," ","to reference conditions"]})]})]})}const Ci={home:R.Home,projects:R.FolderClosed,folder:R.FolderClosed,organization:R.Users,users:R.Users,dashboard:R.LayoutDashboard,history:R.Clock3,sessions:R.Clock3,monitoring:R.Activity,activity:R.Activity,insights:R.Lightbulb,notifications:R.Bell,integrations:R.Plug,settings:R.Settings,usage:R.BarChart3,docs:R.FileText,documentation:R.FileText,agents:R.Headphones,security:R.Shield,configuration:R.Sliders,workflow:R.Workflow};function Yr(e){return e?typeof e=="string"?Ci[e.toLowerCase()]||R.SquareDot:e:R.SquareDot}function ki({menuItems:e=[],activeId:t,onNavigate:n,collapsed:o,onToggleCollapse:i,header:s,footer:c,width:a=240,collapsedWidth:u=56}){const[g,x]=l.useState(!1),d=o!==void 0?o:g,p=i||(()=>x(!g)),[f,m]=l.useState(()=>{const j={};return e.forEach(S=>{var z;if((z=S.children)!=null&&z.length){const b=S.children.some(A=>A.id===t||A.active);j[S.id]=b}}),j}),y=j=>{m(S=>({...S,[j]:!S[j]}))},v=d?u:a;return r.jsxs("nav",{style:{width:v,minWidth:v,height:"100%",display:"flex",flexDirection:"column",background:"var(--paper-elevated)",borderRight:"1px solid var(--border)",fontFamily:"var(--font-sans)",transition:"width 0.2s ease, min-width 0.2s ease",overflow:"hidden",flexShrink:0},children:[s&&!d&&r.jsx("div",{style:{padding:"16px 16px 8px",flexShrink:0},children:s}),r.jsx("div",{style:{display:"flex",justifyContent:d?"center":"flex-end",padding:d?"12px 0":"8px 12px",flexShrink:0},children:r.jsx("button",{onClick:p,title:d?"Expand sidebar":"Collapse sidebar",style:{display:"flex",alignItems:"center",justifyContent:"center",width:28,height:28,borderRadius:"var(--radius-sm)",border:"none",background:"transparent",color:"var(--text-faint)",cursor:"pointer",transition:"background 0.15s ease, color 0.15s ease"},onMouseEnter:j=>{j.currentTarget.style.background="var(--hover-warm)",j.currentTarget.style.color="var(--text-muted)"},onMouseLeave:j=>{j.currentTarget.style.background="transparent",j.currentTarget.style.color="var(--text-faint)"},children:d?r.jsx(R.PanelLeft,{size:16}):r.jsx(R.PanelLeftClose,{size:16})})}),r.jsx("div",{style:{flex:1,overflowY:"auto",overflowX:"hidden",padding:d?"0 8px":"0 10px"},children:e.map((j,S)=>{var z;return r.jsxs(l.Fragment,{children:[j.section&&!d&&r.jsx("div",{style:{fontSize:"var(--text-xs)",fontWeight:650,letterSpacing:"0.08em",textTransform:"uppercase",color:"var(--text-faint)",padding:"16px 8px 6px",lineHeight:1},children:j.section}),(z=j.children)!=null&&z.length?r.jsx(Ri,{item:j,activeId:t,expanded:!!f[j.id],onToggle:()=>y(j.id),onNavigate:n,collapsed:d}):r.jsx(Xr,{item:j,active:j.id===t||j.active,onNavigate:n,collapsed:d})]},j.id||S)})}),c&&!d&&r.jsx("div",{style:{padding:"12px 16px",borderTop:"1px solid var(--border-subtle)",flexShrink:0},children:c})]})}function Xr({item:e,active:t,onNavigate:n,collapsed:o}){const i=Yr(e.icon),s=typeof e.icon!="string"&&typeof e.icon<"u";return r.jsxs("button",{onClick:()=>n==null?void 0:n(e.href||e.id),title:o?e.label:void 0,style:{display:"flex",alignItems:"center",gap:o?0:10,justifyContent:o?"center":"flex-start",width:"100%",padding:o?"10px 0":"8px 10px",borderRadius:"var(--radius-sm)",border:"none",background:t?"var(--hover-warm)":"transparent",color:t?"var(--text-ink)":"var(--text-base)",fontWeight:t?550:400,fontSize:"var(--text-sm)",fontFamily:"var(--font-sans)",cursor:"pointer",textAlign:"left",transition:"background 0.15s ease, color 0.1s ease",marginBottom:2},onMouseEnter:c=>{t||(c.currentTarget.style.background="var(--hover-warm-subtle)")},onMouseLeave:c=>{t||(c.currentTarget.style.background="transparent")},children:[s?r.jsx("span",{style:{flexShrink:0,display:"flex"},children:e.icon}):r.jsx(i,{size:16,style:{flexShrink:0,color:t?"var(--text-strong)":"var(--text-muted)"}}),!o&&r.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.label})]})}function Ri({item:e,activeId:t,expanded:n,onToggle:o,onNavigate:i,collapsed:s}){var u;const c=Yr(e.icon),a=(u=e.children)==null?void 0:u.some(g=>g.id===t||g.active);return s?r.jsx("button",{onClick:o,title:e.label,style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",padding:"10px 0",borderRadius:"var(--radius-sm)",border:"none",background:a?"var(--hover-warm)":"transparent",color:a?"var(--text-ink)":"var(--text-base)",cursor:"pointer",marginBottom:2,transition:"background 0.15s ease"},onMouseEnter:g=>{a||(g.currentTarget.style.background="var(--hover-warm-subtle)")},onMouseLeave:g=>{a||(g.currentTarget.style.background="transparent")},children:r.jsx(c,{size:16,style:{color:a?"var(--text-strong)":"var(--text-muted)"}})}):r.jsxs("div",{style:{marginBottom:2},children:[r.jsxs("button",{onClick:o,style:{display:"flex",alignItems:"center",gap:10,width:"100%",padding:"8px 10px",borderRadius:"var(--radius-sm)",border:"none",background:"transparent",color:a?"var(--text-ink)":"var(--text-base)",fontWeight:a?550:400,fontSize:"var(--text-sm)",fontFamily:"var(--font-sans)",cursor:"pointer",textAlign:"left",transition:"background 0.15s ease"},onMouseEnter:g=>{g.currentTarget.style.background="var(--hover-warm-subtle)"},onMouseLeave:g=>{g.currentTarget.style.background="transparent"},children:[r.jsx(c,{size:16,style:{flexShrink:0,color:a?"var(--text-strong)":"var(--text-muted)"}}),r.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.label}),r.jsx(R.ChevronDown,{size:14,style:{flexShrink:0,color:"var(--text-faint)",transform:n?"rotate(0deg)":"rotate(-90deg)",transition:"transform 0.2s ease"}})]}),n&&r.jsx("div",{style:{paddingLeft:18,marginTop:2},children:e.children.map((g,x)=>r.jsx(Xr,{item:g,active:g.id===t||g.active,onNavigate:i,collapsed:!1},g.id||x))})]})}const Ht=["#5a8a6e","#b07d4f","#7a8fa6","#c47a5a","#6a9a8a","#a0785a","#5a7a9a","#9a7a5a"];function Di(e){if(!e)return Ht[0];let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return Ht[Math.abs(t)%Ht.length]}function Ti({logo:e,title:t,userName:n,userEmail:o,userInitials:i,userRole:s,onSignOut:c,children:a,trailing:u,height:g=48,style:x}){const d=n||o||"",p=i||zi(d);return r.jsxs("header",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 20px",height:g,borderBottom:"1px solid var(--border)",background:"var(--paper-elevated)",flexShrink:0,fontFamily:"var(--font-sans)",...x},children:[r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,flexShrink:0},children:[e!==void 0?e:r.jsx("span",{style:{fontSize:"var(--text-lg)",fontWeight:700,fontFamily:"var(--font-display)",color:"var(--text-ink)",letterSpacing:"-0.01em"},children:"Chordia"}),t&&r.jsxs(r.Fragment,{children:[r.jsx("span",{style:{width:1,height:18,background:"var(--border)",flexShrink:0}}),r.jsx("span",{style:{fontSize:"var(--text-md)",fontWeight:500,color:"var(--text-muted)"},children:t})]})]}),a&&r.jsx("div",{style:{display:"flex",alignItems:"center",gap:8,flex:1,justifyContent:"center",minWidth:0},children:a}),r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,flexShrink:0},children:[u,d&&r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[r.jsx("div",{style:{width:30,height:30,borderRadius:"50%",background:Di(d),display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:r.jsx("span",{style:{fontSize:11,fontWeight:600,color:"#fff",letterSpacing:"0.02em",lineHeight:1},children:p})}),r.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:1},children:[r.jsx("span",{style:{fontSize:"var(--text-sm)",fontWeight:550,color:"var(--text-strong)",lineHeight:1.2},children:d}),s&&r.jsx("span",{style:{fontSize:"var(--text-xs)",color:"var(--text-muted)",lineHeight:1.2},children:s})]}),c&&r.jsx("button",{onClick:c,title:"Sign out",style:{display:"flex",alignItems:"center",justifyContent:"center",width:28,height:28,borderRadius:"var(--radius-sm)",border:"none",background:"transparent",color:"var(--text-faint)",cursor:"pointer",transition:"background 0.15s ease, color 0.15s ease"},onMouseEnter:f=>{f.currentTarget.style.background="var(--hover-warm)",f.currentTarget.style.color="var(--text-muted)"},onMouseLeave:f=>{f.currentTarget.style.background="transparent",f.currentTarget.style.color="var(--text-faint)"},children:r.jsx(R.LogOut,{size:14})})]})]})]})}function zi(e){if(!e)return"?";const t=e.trim().split(/\s+/);return t.length>=2?(t[0][0]+t[t.length-1][0]).toUpperCase():e.slice(0,2).toUpperCase()}function Ai({onUploadCall:e,onConnectSource:t,onUseSample:n,showExamples:o=!1}){const[i,s]=l.useState(null),[c,a]=l.useState(null),[u,g]=l.useState(null),[x,d]=l.useState(null),p=l.useRef(null),f=[{id:"five9",name:"Five9",status:"available",description:"Cloud contact center platform"},{id:"twilio",name:"Twilio Flex",status:"available",description:"Programmable contact center"},{id:"genesys",name:"Genesys Cloud",status:"available",description:"All-in-one cloud contact center"},{id:"zoom",name:"Zoom Phone",status:"coming-soon",description:"Cloud phone system"}],m=[{id:"retail-support",name:"Retail Customer Support",description:"Sample interactions from retail customer service team",interactions:24,dateRange:"Last 30 days"},{id:"healthcare-billing",name:"Healthcare Billing Inquiries",description:"Patient billing and insurance verification calls",interactions:18,dateRange:"Last 2 weeks"},{id:"financial-services",name:"Financial Services Compliance",description:"Banking and financial advisory interactions",interactions:32,dateRange:"Last 45 days"}],y=k=>{var I;const w=(I=k.target.files)==null?void 0:I[0];if(w){const E=w.type.startsWith("audio/"),P=w.type.startsWith("video/");E||P?(a({name:w.name,type:w.type,size:w.size,lastModified:new Date(w.lastModified)}),e?e(w):console.log("File uploaded:",w.name,w.type,`(${(w.size/1024/1024).toFixed(2)} MB)`)):alert("Please select an audio or video file.")}p.current&&(p.current.value="")},v=k=>{const w=f.find(I=>I.id===k);w&&w.status==="available"&&(g(w),t?t(w):console.log("Connected to:",w.name))},j=k=>{const w=m.find(I=>I.id===k);w&&(d(w),n?n(w):console.log("Selected project:",w.name))},S=()=>{p.current&&p.current.click()},z=()=>{o&&!x||n&&n(x||{id:"default",name:"Demo Project"})},b=()=>{o&&!u||t&&t(u||{id:"default",name:"Data Source"})},A=[{id:"upload",icon:R.Upload,title:"Upload an interaction",description:"Drop an audio or video recording to see what Compass surfaces",recommended:!1,onClick:S},{id:"sample",icon:R.Sparkles,title:"Explore a demonstration project",description:"See how Chordia Compass surfaces insights from real interaction data",recommended:!0,onClick:z},{id:"connect",icon:R.Link,title:"Connect a data source",description:"Link your existing system to automatically analyze interactions",recommended:!1,onClick:b}];return r.jsxs("div",{style:{minHeight:"100vh",background:"var(--surface-warm)",display:"flex",alignItems:"center",justifyContent:"center",padding:"32px"},children:[r.jsx("input",{ref:p,type:"file",accept:"audio/*,video/*",onChange:y,style:{display:"none"}}),r.jsxs("div",{style:{maxWidth:"680px",width:"100%"},children:[r.jsxs("div",{style:{textAlign:"center",marginBottom:"48px"},children:[r.jsx("h1",{style:{fontSize:"32px",fontWeight:760,letterSpacing:"-0.02em",color:"rgba(30, 33, 37, 0.92)",marginBottom:"12px",lineHeight:1.2},children:"Experience Compass with one interaction"}),r.jsx("p",{style:{fontSize:"15px",color:"rgba(30, 33, 37, 0.65)",lineHeight:1.5,maxWidth:"520px",margin:"0 auto"},children:"Compass surfaces evidence, signals, and actionable insights from customer interactions. Start by exploring what it reveals."})]}),r.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"16px"},children:A.map(k=>{const w=k.icon,I=i===k.id;return r.jsxs("button",{type:"button",onClick:k.onClick,onMouseEnter:()=>s(k.id),onMouseLeave:()=>s(null),style:{position:"relative",width:"100%",padding:"24px 28px",background:I?"rgba(255, 255, 255, 0.95)":"rgba(255, 255, 255, 0.85)",border:k.recommended?"2px solid rgba(184, 156, 106, 0.35)":I?"1px solid rgba(52, 58, 64, 0.20)":"1px solid rgba(52, 58, 64, 0.12)",borderRadius:"16px",cursor:"pointer",textAlign:"left",transition:"all 0.2s ease",transform:I?"translateY(-2px)":"translateY(0)",boxShadow:I?"0 12px 28px rgba(30, 33, 37, 0.12)":"0 4px 12px rgba(30, 33, 37, 0.06)"},children:[k.recommended&&r.jsx("div",{style:{position:"absolute",top:"16px",right:"20px",fontSize:"10px",fontWeight:650,letterSpacing:"0.06em",textTransform:"uppercase",color:"rgba(184, 156, 106, 0.75)",background:"rgba(184, 156, 106, 0.12)",padding:"4px 8px",borderRadius:"6px",border:"1px solid rgba(184, 156, 106, 0.2)"},children:"Recommended"}),r.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"18px"},children:[r.jsx("div",{style:{width:"48px",height:"48px",borderRadius:"12px",background:k.recommended?"rgba(184, 156, 106, 0.12)":"rgba(231, 212, 162, 0.20)",border:k.recommended?"1px solid rgba(184, 156, 106, 0.25)":"1px solid rgba(231, 212, 162, 0.35)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:r.jsx(w,{size:22,style:{color:k.recommended?"rgba(184, 156, 106, 0.75)":"rgba(30, 33, 37, 0.52)"}})}),r.jsxs("div",{style:{flex:1,paddingTop:"2px"},children:[r.jsx("div",{style:{fontSize:"17px",fontWeight:680,letterSpacing:"-0.01em",color:"rgba(30, 33, 37, 0.92)",marginBottom:"6px",lineHeight:1.3},children:k.title}),r.jsx("div",{style:{fontSize:"13.5px",color:"rgba(30, 33, 37, 0.62)",lineHeight:1.5},children:k.description})]})]})]},k.id)})}),r.jsx("div",{style:{marginTop:"32px",textAlign:"center",fontSize:"12px",color:"rgba(30, 33, 37, 0.52)",lineHeight:1.5},children:"Your workspace has been created automatically. You can configure settings and add teammates later."}),o&&r.jsxs("div",{style:{marginTop:"48px",paddingTop:"32px",borderTop:"1px solid rgba(52, 58, 64, 0.12)"},children:[r.jsx("h2",{style:{fontSize:"20px",fontWeight:680,letterSpacing:"-0.01em",color:"rgba(30, 33, 37, 0.92)",marginBottom:"24px"},children:"Testing Examples"}),c&&r.jsxs("div",{style:{marginBottom:"24px",padding:"16px",background:"rgba(255, 255, 255, 0.85)",border:"1px solid rgba(52, 58, 64, 0.12)",borderRadius:"12px"},children:[r.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"8px"},children:[r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[r.jsx(R.CheckCircle2,{size:18,style:{color:"#1F8F5A"}}),r.jsx("span",{style:{fontSize:"14px",fontWeight:650,color:"rgba(30, 33, 37, 0.92)"},children:"File Uploaded"})]}),r.jsx("button",{onClick:()=>a(null),style:{background:"none",border:"none",cursor:"pointer",padding:"4px",display:"flex",alignItems:"center"},children:r.jsx(R.X,{size:16,style:{color:"rgba(30, 33, 37, 0.42)"}})})]}),r.jsxs("div",{style:{fontSize:"13px",color:"rgba(30, 33, 37, 0.65)",lineHeight:1.5},children:[r.jsxs("div",{children:[r.jsx("strong",{children:"Name:"})," ",c.name]}),r.jsxs("div",{children:[r.jsx("strong",{children:"Type:"})," ",c.type]}),r.jsxs("div",{children:[r.jsx("strong",{children:"Size:"})," ",(c.size/1024/1024).toFixed(2)," MB"]}),r.jsxs("div",{children:[r.jsx("strong",{children:"Uploaded:"})," ",c.lastModified.toLocaleString()]})]})]}),!x&&r.jsxs("div",{style:{marginBottom:"24px"},children:[r.jsx("h3",{style:{fontSize:"15px",fontWeight:650,color:"rgba(30, 33, 37, 0.82)",marginBottom:"12px"},children:"Select a Demonstration Project:"}),r.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:m.map(k=>r.jsxs("button",{onClick:()=>j(k.id),style:{padding:"12px 16px",background:"rgba(255, 255, 255, 0.85)",border:"1px solid rgba(52, 58, 64, 0.12)",borderRadius:"8px",textAlign:"left",cursor:"pointer",transition:"all 0.15s ease"},onMouseEnter:w=>{w.currentTarget.style.background="rgba(255, 255, 255, 0.95)",w.currentTarget.style.borderColor="rgba(52, 58, 64, 0.20)"},onMouseLeave:w=>{w.currentTarget.style.background="rgba(255, 255, 255, 0.85)",w.currentTarget.style.borderColor="rgba(52, 58, 64, 0.12)"},children:[r.jsx("div",{style:{fontSize:"14px",fontWeight:650,color:"rgba(30, 33, 37, 0.92)",marginBottom:"4px"},children:k.name}),r.jsx("div",{style:{fontSize:"12px",color:"rgba(30, 33, 37, 0.62)",marginBottom:"4px"},children:k.description}),r.jsxs("div",{style:{fontSize:"11px",color:"rgba(30, 33, 37, 0.52)"},children:[k.interactions," interactions · ",k.dateRange]})]},k.id))})]}),x&&r.jsxs("div",{style:{marginBottom:"24px",padding:"16px",background:"rgba(255, 255, 255, 0.85)",border:"1px solid rgba(52, 58, 64, 0.12)",borderRadius:"12px"},children:[r.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"8px"},children:[r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[r.jsx(R.CheckCircle2,{size:18,style:{color:"#1F8F5A"}}),r.jsxs("span",{style:{fontSize:"14px",fontWeight:650,color:"rgba(30, 33, 37, 0.92)"},children:["Project Selected: ",x.name]})]}),r.jsx("button",{onClick:()=>d(null),style:{background:"none",border:"none",cursor:"pointer",padding:"4px",display:"flex",alignItems:"center"},children:r.jsx(R.X,{size:16,style:{color:"rgba(30, 33, 37, 0.42)"}})})]}),r.jsxs("div",{style:{fontSize:"13px",color:"rgba(30, 33, 37, 0.65)",lineHeight:1.5},children:[r.jsx("div",{children:x.description}),r.jsxs("div",{style:{marginTop:"4px"},children:[r.jsx("strong",{children:x.interactions})," interactions · ",r.jsx("strong",{children:x.dateRange})]})]})]}),!u&&r.jsxs("div",{style:{marginBottom:"24px"},children:[r.jsx("h3",{style:{fontSize:"15px",fontWeight:650,color:"rgba(30, 33, 37, 0.82)",marginBottom:"12px"},children:"Connect a Data Source:"}),r.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:f.map(k=>r.jsx("button",{onClick:()=>v(k.id),disabled:k.status==="coming-soon",style:{padding:"12px 16px",background:k.status==="coming-soon"?"rgba(255, 255, 255, 0.5)":"rgba(255, 255, 255, 0.85)",border:"1px solid rgba(52, 58, 64, 0.12)",borderRadius:"8px",textAlign:"left",cursor:k.status==="coming-soon"?"not-allowed":"pointer",transition:"all 0.15s ease",opacity:k.status==="coming-soon"?.6:1},onMouseEnter:w=>{k.status!=="coming-soon"&&(w.currentTarget.style.background="rgba(255, 255, 255, 0.95)",w.currentTarget.style.borderColor="rgba(52, 58, 64, 0.20)")},onMouseLeave:w=>{k.status!=="coming-soon"&&(w.currentTarget.style.background="rgba(255, 255, 255, 0.85)",w.currentTarget.style.borderColor="rgba(52, 58, 64, 0.12)")},children:r.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[r.jsxs("div",{children:[r.jsx("div",{style:{fontSize:"14px",fontWeight:650,color:"rgba(30, 33, 37, 0.92)",marginBottom:"4px"},children:k.name}),r.jsx("div",{style:{fontSize:"12px",color:"rgba(30, 33, 37, 0.62)"},children:k.description})]}),k.status==="coming-soon"&&r.jsx("span",{style:{fontSize:"10px",fontWeight:600,color:"rgba(30, 33, 37, 0.42)",background:"rgba(30, 33, 37, 0.08)",padding:"4px 8px",borderRadius:"4px"},children:"Coming Soon"})]})},k.id))})]}),u&&r.jsxs("div",{style:{marginBottom:"24px",padding:"16px",background:"rgba(255, 255, 255, 0.85)",border:"1px solid rgba(52, 58, 64, 0.12)",borderRadius:"12px"},children:[r.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"8px"},children:[r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[r.jsx(R.CheckCircle2,{size:18,style:{color:"#1F8F5A"}}),r.jsxs("span",{style:{fontSize:"14px",fontWeight:650,color:"rgba(30, 33, 37, 0.92)"},children:["Connected: ",u.name]})]}),r.jsx("button",{onClick:()=>g(null),style:{background:"none",border:"none",cursor:"pointer",padding:"4px",display:"flex",alignItems:"center"},children:r.jsx(R.X,{size:16,style:{color:"rgba(30, 33, 37, 0.42)"}})})]}),r.jsx("div",{style:{fontSize:"13px",color:"rgba(30, 33, 37, 0.65)",lineHeight:1.5},children:u.description})]})]})]})]})}function Ii({onDismiss:e,onItemClick:t,completedItems:n=[]}){const[o,i]=l.useState(!1),[s,c]=l.useState(null),a=[{id:"name-project",title:"Name your workspace",description:"Give your default project a meaningful name",icon:R.FolderOpen,completed:n.includes("name-project"),optional:!0},{id:"evaluate-second-interaction",title:"Evaluate another interaction",description:"Upload or connect a second interaction to see patterns",icon:R.Sparkles,completed:n.includes("evaluate-second-interaction")},{id:"connect-source",title:"Connect a data source",description:"Link your system or platform for automatic evaluation",icon:R.Link,completed:n.includes("connect-source")},{id:"invite-team",title:"Add teammates",description:"Invite managers or QA team members to collaborate",icon:R.Users,completed:n.includes("invite-team"),optional:!0},{id:"learn-concepts",title:"Understand Chordia concepts",description:"Learn how conditions, evidence, and confidence work",icon:R.BookOpen,completed:n.includes("learn-concepts"),optional:!0},{id:"configure-scope",title:"Clarify evaluation scope",description:"Customize which signals and conditions matter for your team",icon:R.Settings,completed:n.includes("configure-scope"),optional:!0}],u=a.filter(d=>d.completed).length,g=a.length,x=u/g*100;return o?r.jsx("button",{type:"button",onClick:()=>i(!1),style:{width:"100%",padding:"14px 16px",background:"rgba(255, 255, 255, 0.85)",border:"1px solid rgba(52, 58, 64, 0.12)",borderRadius:"12px",cursor:"pointer",textAlign:"left",transition:"all 0.15s ease",boxShadow:"0 2px 8px rgba(30, 33, 37, 0.04)"},onMouseEnter:d=>{d.currentTarget.style.background="rgba(255, 255, 255, 0.95)",d.currentTarget.style.borderColor="rgba(52, 58, 64, 0.18)"},onMouseLeave:d=>{d.currentTarget.style.background="rgba(255, 255, 255, 0.85)",d.currentTarget.style.borderColor="rgba(52, 58, 64, 0.12)"},children:r.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px"},children:[r.jsxs("div",{style:{fontSize:"13px",fontWeight:600,color:"rgba(30, 33, 37, 0.75)"},children:["Getting started (",u,"/",g,")"]}),r.jsx(R.ChevronRight,{size:16,style:{color:"rgba(30, 33, 37, 0.42)"}})]})}):r.jsxs("div",{style:{background:"rgba(255, 255, 255, 0.85)",border:"1px solid rgba(52, 58, 64, 0.12)",borderRadius:"16px",overflow:"hidden",boxShadow:"0 4px 16px rgba(30, 33, 37, 0.06)"},children:[r.jsxs("div",{style:{padding:"18px 20px 16px",borderBottom:"1px solid rgba(52, 58, 64, 0.08)"},children:[r.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:"12px"},children:[r.jsxs("div",{style:{flex:1},children:[r.jsx("div",{style:{fontSize:"15px",fontWeight:680,letterSpacing:"-0.01em",color:"rgba(30, 33, 37, 0.92)",marginBottom:"6px",lineHeight:1.3},children:"Getting started with Chordia"}),r.jsxs("div",{style:{fontSize:"12px",color:"rgba(30, 33, 37, 0.58)",lineHeight:1.4},children:[u," of ",g," completed"]})]}),r.jsxs("div",{style:{display:"flex",gap:"4px"},children:[r.jsx("button",{type:"button",onClick:()=>i(!0),style:{width:"28px",height:"28px",borderRadius:"6px",background:"transparent",border:"1px solid rgba(52, 58, 64, 0.12)",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.15s ease",color:"rgba(30, 33, 37, 0.52)"},onMouseEnter:d=>{d.currentTarget.style.background="rgba(231, 212, 162, 0.12)",d.currentTarget.style.borderColor="rgba(52, 58, 64, 0.18)"},onMouseLeave:d=>{d.currentTarget.style.background="transparent",d.currentTarget.style.borderColor="rgba(52, 58, 64, 0.12)"},title:"Collapse",children:r.jsx(R.ChevronRight,{size:14})}),e&&r.jsx("button",{type:"button",onClick:e,style:{width:"28px",height:"28px",borderRadius:"6px",background:"transparent",border:"1px solid rgba(52, 58, 64, 0.12)",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.15s ease",color:"rgba(30, 33, 37, 0.52)"},onMouseEnter:d=>{d.currentTarget.style.background="rgba(231, 212, 162, 0.12)",d.currentTarget.style.borderColor="rgba(52, 58, 64, 0.18)"},onMouseLeave:d=>{d.currentTarget.style.background="transparent",d.currentTarget.style.borderColor="rgba(52, 58, 64, 0.12)"},title:"Dismiss checklist",children:r.jsx(R.X,{size:14})})]})]}),r.jsx("div",{style:{marginTop:"14px",height:"6px",background:"rgba(30, 33, 37, 0.08)",borderRadius:"999px",overflow:"hidden"},children:r.jsx("div",{style:{height:"100%",width:`${x}%`,background:"linear-gradient(90deg, rgba(184, 156, 106, 0.75) 0%, rgba(139, 157, 127, 0.75) 100%)",borderRadius:"999px",transition:"width 0.4s ease"}})})]}),r.jsx("div",{style:{padding:"8px"},children:a.map((d,p)=>{const f=d.icon,m=s===d.id;return r.jsx("button",{type:"button",onClick:()=>t==null?void 0:t(d.id),onMouseEnter:()=>c(d.id),onMouseLeave:()=>c(null),disabled:d.completed,style:{width:"100%",padding:"12px 14px",background:d.completed?"rgba(139, 157, 127, 0.06)":m?"rgba(231, 212, 162, 0.12)":"transparent",border:"none",borderRadius:"10px",cursor:d.completed?"default":"pointer",textAlign:"left",transition:"all 0.15s ease",marginBottom:p<a.length-1?"4px":"0",opacity:d.completed?.7:1},children:r.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"12px"},children:[r.jsx("div",{style:{width:"20px",height:"20px",marginTop:"1px",flexShrink:0},children:d.completed?r.jsx(R.CheckCircle2,{size:20,style:{color:"rgba(139, 157, 127, 0.75)"}}):r.jsx(R.Circle,{size:20,style:{color:"rgba(30, 33, 37, 0.24)"}})}),r.jsxs("div",{style:{flex:1,minWidth:0},children:[r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"3px"},children:[r.jsx(f,{size:14,style:{color:"rgba(30, 33, 37, 0.52)",flexShrink:0}}),r.jsx("span",{style:{fontSize:"13px",fontWeight:600,color:d.completed?"rgba(30, 33, 37, 0.52)":"rgba(30, 33, 37, 0.85)",textDecoration:d.completed?"line-through":"none",lineHeight:1.3},children:d.title}),d.optional&&!d.completed&&r.jsx("span",{style:{fontSize:"9px",fontWeight:600,letterSpacing:"0.04em",textTransform:"uppercase",color:"rgba(30, 33, 37, 0.42)",background:"rgba(30, 33, 37, 0.06)",padding:"2px 5px",borderRadius:"4px"},children:"Optional"})]}),r.jsx("div",{style:{fontSize:"11.5px",color:"rgba(30, 33, 37, 0.52)",lineHeight:1.4,paddingLeft:"22px"},children:d.description})]}),!d.completed&&m&&r.jsx(R.ChevronRight,{size:16,style:{color:"rgba(30, 33, 37, 0.32)",marginTop:"2px",flexShrink:0}})]})},d.id)})}),r.jsx("div",{style:{padding:"12px 20px 16px",borderTop:"1px solid rgba(52, 58, 64, 0.08)"},children:r.jsxs("div",{style:{fontSize:"11px",color:"rgba(30, 33, 37, 0.52)",lineHeight:1.5,fontStyle:"italic"},children:["You can dismiss this checklist anytime. These steps help you get the most from Chordia, but ","aren't"," required."]})})]})}function Ei({text:e="Demo Project",accentColor:t="#B89C6A",textColor:n="rgba(255, 255, 255, 0.95)",size:o="medium",position:i="fixed"}){const c={small:{width:140,height:140,fontSize:"11px",letterSpacing:"0.08em",fontWeight:650},medium:{width:180,height:180,fontSize:"12px",letterSpacing:"0.1em",fontWeight:680},large:{width:220,height:220,fontSize:"13px",letterSpacing:"0.12em",fontWeight:700}}[o];return r.jsxs("div",{style:{position:i,top:0,right:0,width:c.width,height:c.height,overflow:"hidden",zIndex:i==="fixed"?9999:1,pointerEvents:"none"},children:[r.jsx("div",{style:{position:"absolute",top:0,right:0,width:0,height:0,borderStyle:"solid",borderWidth:`0 ${c.width}px ${c.height}px 0`,borderColor:`transparent ${t} transparent transparent`,opacity:.92}}),r.jsx("div",{style:{position:"absolute",top:0,right:0,width:0,height:0,borderStyle:"solid",borderWidth:`0 ${c.width}px ${c.height}px 0`,borderColor:"transparent rgba(0, 0, 0, 0.08) transparent transparent"}}),r.jsx("div",{style:{position:"absolute",top:o==="small"?"28px":o==="medium"?"38px":"48px",right:o==="small"?"-32px":o==="medium"?"-42px":"-52px",width:o==="small"?"160px":o==="medium"?"200px":"240px",transform:"rotate(45deg)",transformOrigin:"center",textAlign:"center"},children:r.jsx("div",{style:{fontSize:c.fontSize,fontWeight:c.fontWeight,letterSpacing:c.letterSpacing,textTransform:"uppercase",color:n,textShadow:"0 1px 2px rgba(0, 0, 0, 0.15)",whiteSpace:"nowrap",userSelect:"none"},children:e})}),r.jsx("div",{style:{position:"absolute",top:0,right:0,width:c.width,height:c.height,background:"linear-gradient(135deg, transparent 0%, rgba(0, 0, 0, 0.04) 100%)",pointerEvents:"none"}})]})}function Mi({providerName:e,description:t,status:n="available",railColor:o,logoUrl:i,icon:s,onConfigure:c}){const a={connected:{label:"Connected",color:"#6B7C93",bgColor:"rgba(107, 124, 147, 0.08)",borderColor:"rgba(107, 124, 147, 0.20)",icon:r.jsx(R.CheckCircle2,{size:14,strokeWidth:2.5})},available:{label:"Available",color:"#1E2125",bgColor:"rgba(30, 33, 37, 0.04)",borderColor:"rgba(30, 33, 37, 0.12)",icon:r.jsx(R.Circle,{size:14,strokeWidth:2})},"coming-soon":{label:"Coming Soon",color:"rgba(30, 33, 37, 0.42)",bgColor:"transparent",borderColor:"rgba(30, 33, 37, 0.12)",icon:r.jsx(R.Circle,{size:14,strokeWidth:2,style:{opacity:.4}})}},u=a[n]||a.available;return r.jsxs("div",{style:{background:"#FFFFFF",border:`1px solid ${o}20`,borderRadius:"8px",position:"relative",display:"flex",flexDirection:"column",transition:"all 0.15s ease",cursor:n==="coming-soon"?"default":"pointer",opacity:n==="coming-soon"?.6:1,overflow:"hidden",height:"100%"},className:"hover:shadow-sm",children:[r.jsx("div",{style:{position:"absolute",left:0,top:0,bottom:0,width:"4px",background:o,opacity:n==="coming-soon"?.4:1}}),r.jsxs("div",{style:{padding:"20px",paddingLeft:"24px",display:"flex",flexDirection:"column",gap:"16px",height:"100%"},children:[r.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:"12px"},children:[r.jsx("div",{style:{width:"48px",height:"48px",borderRadius:"6px",background:`${o}08`,border:`1px solid ${o}18`,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:i?r.jsx("img",{src:i,alt:e,style:{width:"32px",height:"32px",objectFit:"contain"}}):r.jsx("div",{style:{color:o,fontSize:"20px",fontWeight:650,opacity:.8},children:s||(e?e.charAt(0):"")})}),r.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"4px 10px",borderRadius:"4px",background:u.bgColor,border:`1px solid ${u.borderColor}`,fontSize:"11px",fontWeight:600,letterSpacing:"0.01em",color:u.color,flexShrink:0},children:[u.icon,u.label]})]}),r.jsxs("div",{style:{flex:1,minHeight:0},children:[r.jsx("h3",{style:{fontSize:"15px",fontWeight:650,color:"rgba(30, 33, 37, 0.92)",marginBottom:"6px",letterSpacing:"-0.01em"},children:e}),r.jsx("p",{style:{fontSize:"13px",lineHeight:1.5,color:"rgba(30, 33, 37, 0.65)"},children:t})]}),n!=="coming-soon"&&r.jsxs("button",{onClick:g=>{g.stopPropagation(),c==null||c()},style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",padding:"8px 14px",border:"1px solid rgba(30, 33, 37, 0.15)",borderRadius:"5px",background:n==="connected"?"transparent":"rgba(30, 33, 37, 0.03)",fontSize:"13px",fontWeight:600,color:"rgba(30, 33, 37, 0.92)",cursor:"pointer",transition:"all 0.15s ease",width:"100%",marginTop:"auto"},className:"hover:bg-[rgba(30,33,37,0.06)] hover:border-[rgba(30,33,37,0.20)]",children:[r.jsx(R.Settings,{size:14,strokeWidth:2.5}),n==="connected"?"Configure":"Connect"]})]})]})}const Fi=new URL("data:image/png;base64,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",typeof document>"u"?require("url").pathToFileURL(__filename).href:Bt&&Bt.tagName.toUpperCase()==="SCRIPT"&&Bt.src||new URL("index.cjs.js",document.baseURI).href).href;function Bi({title:e="Chordia",subtitle:t="Sign in to continue",logo:n,onLogin:o,loading:i=!1,error:s=null,footer:c,showLabels:a=!0,emailPlaceholder:u="you@company.com",passwordPlaceholder:g="Password",onForgotPassword:x,compact:d=!1}){const[p,f]=l.useState(""),[m,y]=l.useState(""),[v,j]=l.useState(!1),[S,z]=l.useState(null),b=E=>{E.preventDefault(),!(!p||!m||i)&&(o==null||o(p,m))},A=p&&m&&!i,k="var(--rail-compliance)",w="201, 138, 90",I=r.jsxs("div",{style:{width:"100%",maxWidth:400,background:"var(--paper-elevated)",border:"1px solid var(--border)",borderRadius:"var(--radius-lg)",padding:"44px 36px 36px",boxShadow:"0 8px 32px rgba(30, 33, 37, 0.06), 0 1px 3px rgba(30, 33, 37, 0.04)",position:"relative",overflow:"hidden"},children:[r.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:3,background:`linear-gradient(90deg, var(--state-unknown), ${k})`,opacity:.6}}),r.jsx("div",{style:{textAlign:"center",marginBottom:32},children:n||r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",padding:"12px 24px",borderRadius:"var(--radius-lg)",background:"rgba(30, 33, 37, 0.92)",marginBottom:16},children:r.jsx("img",{src:Fi,alt:e,style:{height:28,display:"block"}})}),t&&r.jsx("p",{style:{fontSize:"var(--text-sm)",color:"var(--text-muted)",marginTop:4,marginBottom:0},children:t})]})}),r.jsxs("form",{onSubmit:b,children:[r.jsxs("div",{style:{marginBottom:18},children:[a&&r.jsx("label",{style:{display:"block",fontSize:"var(--text-sm)",fontWeight:550,color:"var(--text-strong)",marginBottom:6,fontFamily:"var(--font-sans)"},children:"Email"}),r.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"center"},children:[r.jsx(R.Mail,{size:15,style:{position:"absolute",left:12,color:S==="email"?`rgba(${w}, 0.7)`:"var(--text-faint)",pointerEvents:"none",transition:"color 0.2s ease"}}),r.jsx("input",{type:"email",value:p,onChange:E=>f(E.target.value),placeholder:u,required:!0,autoFocus:!0,autoComplete:"email",style:{width:"100%",padding:"11px 12px 11px 38px",fontSize:"var(--text-md)",border:"1px solid",borderColor:S==="email"?k:"var(--border)",borderRadius:"var(--radius)",backgroundColor:S==="email"?"rgba(255,255,255,0.95)":"var(--paper)",color:"var(--text-ink)",fontFamily:"var(--font-sans)",outline:"none",transition:"border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease",boxShadow:S==="email"?`0 0 0 3px rgba(${w}, 0.1)`:"none"},onFocus:()=>z("email"),onBlur:()=>z(null)})]})]}),r.jsxs("div",{style:{marginBottom:6},children:[a&&r.jsx("label",{style:{display:"block",fontSize:"var(--text-sm)",fontWeight:550,color:"var(--text-strong)",marginBottom:6,fontFamily:"var(--font-sans)"},children:"Password"}),r.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"center"},children:[r.jsx(R.Lock,{size:15,style:{position:"absolute",left:12,color:S==="password"?`rgba(${w}, 0.7)`:"var(--text-faint)",pointerEvents:"none",transition:"color 0.2s ease"}}),r.jsx("input",{type:v?"text":"password",value:m,onChange:E=>y(E.target.value),placeholder:g,required:!0,autoComplete:"current-password",style:{width:"100%",padding:"11px 42px 11px 38px",fontSize:"var(--text-md)",border:"1px solid",borderColor:S==="password"?k:"var(--border)",borderRadius:"var(--radius)",backgroundColor:S==="password"?"rgba(255,255,255,0.95)":"var(--paper)",color:"var(--text-ink)",fontFamily:"var(--font-sans)",outline:"none",transition:"border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease",boxShadow:S==="password"?`0 0 0 3px rgba(${w}, 0.1)`:"none"},onFocus:()=>z("password"),onBlur:()=>z(null)}),r.jsx("button",{type:"button",onClick:()=>j(!v),style:{position:"absolute",right:8,background:"none",border:"none",padding:4,cursor:"pointer",color:"var(--text-faint)",display:"flex",alignItems:"center",transition:"color 0.15s ease",borderRadius:"var(--radius-sm)"},tabIndex:-1,onMouseEnter:E=>{E.currentTarget.style.color="var(--text-muted)"},onMouseLeave:E=>{E.currentTarget.style.color="var(--text-faint)"},children:v?r.jsx(R.EyeOff,{size:16}):r.jsx(R.Eye,{size:16})})]})]}),x&&r.jsx("div",{style:{textAlign:"right",marginBottom:4},children:r.jsx("button",{type:"button",onClick:x,style:{background:"none",border:"none",padding:"2px 0",fontSize:"var(--text-xs)",color:"var(--text-muted)",cursor:"pointer",fontFamily:"var(--font-sans)",transition:"color 0.15s ease"},onMouseEnter:E=>{E.currentTarget.style.color="var(--text-strong)"},onMouseLeave:E=>{E.currentTarget.style.color="var(--text-muted)"},children:"Forgot password?"})}),s&&r.jsx("div",{style:{fontSize:"var(--text-sm)",color:"var(--text-strong)",marginTop:12,padding:"8px 12px",background:"color-mix(in srgb, var(--state-unknown) 10%, transparent)",border:"1px solid color-mix(in srgb, var(--state-unknown) 25%, transparent)",borderRadius:"var(--radius-sm)",textAlign:"center",fontWeight:500},children:s}),r.jsx("button",{type:"submit",disabled:!A,style:{width:"100%",padding:"11px 0",marginTop:20,background:A?"var(--text-ink)":"var(--text-xfaint)",color:"#ffffff",border:"none",borderRadius:"var(--radius)",fontSize:"var(--text-md)",fontWeight:600,fontFamily:"var(--font-sans)",cursor:A?"pointer":"not-allowed",transition:"opacity 0.15s ease, transform 0.1s ease",display:"flex",alignItems:"center",justifyContent:"center",gap:8},onMouseEnter:E=>{A&&(E.currentTarget.style.opacity="0.85",E.currentTarget.style.transform="translateY(-1px)")},onMouseLeave:E=>{E.currentTarget.style.opacity="1",E.currentTarget.style.transform="translateY(0)"},onMouseDown:E=>{A&&(E.currentTarget.style.transform="translateY(0)")},onMouseUp:E=>{A&&(E.currentTarget.style.transform="translateY(-1px)")},children:i?"Signing in…":r.jsxs(r.Fragment,{children:["Sign In",r.jsx(R.ArrowRight,{size:16})]})})]}),c&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,margin:"24px 0 16px"},children:[r.jsx("div",{style:{flex:1,height:1,background:"var(--border)"}}),r.jsx("span",{style:{fontSize:"var(--text-xs)",color:"var(--text-faint)"},children:"or"}),r.jsx("div",{style:{flex:1,height:1,background:"var(--border)"}})]}),r.jsx("div",{style:{textAlign:"center",fontSize:"var(--text-xs)",color:"var(--text-faint)"},children:c})]})]});return d?I:r.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",minHeight:"100vh",background:"var(--bg-chordia)",padding:"var(--spacing-6)"},children:I})}const fr={feature:{railColor:"#7B68A6",icon:r.jsx(R.Sparkles,{size:16,strokeWidth:2.5}),label:"New Feature"},issue:{railColor:"#C98A5A",icon:r.jsx(R.AlertCircle,{size:16,strokeWidth:2.5}),label:"Known Issue"},maintenance:{railColor:"#8B9D6F",icon:r.jsx(R.Wrench,{size:16,strokeWidth:2.5}),label:"Maintenance"},announcement:{railColor:"#6B7C93",icon:r.jsx(R.Info,{size:16,strokeWidth:2.5}),label:"Announcement"}};function Vr({type:e,title:t,message:n,timestamp:o,isRead:i=!1,onDismiss:s,onClick:c}){const a=fr[e]||fr.announcement;return r.jsxs("div",{onClick:c,style:{position:"relative",background:i?"#FFFFFF":"rgba(244, 241, 230, 0.4)",border:"1px solid rgba(30, 33, 37, 0.10)",borderRadius:"6px",padding:"12px 16px",paddingLeft:"20px",display:"flex",flexDirection:"column",gap:"6px",cursor:c?"pointer":"default",transition:"all 0.15s ease",overflow:"hidden"},className:c?"hover:border-[rgba(30,33,37,0.18)]":"",children:[r.jsx("div",{style:{position:"absolute",left:0,top:0,bottom:0,width:"4px",background:a.railColor}}),r.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px"},children:[r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",flex:1,minWidth:0},children:[r.jsx("h4",{style:{fontSize:"13px",fontWeight:650,color:"rgba(30, 33, 37, 0.92)",letterSpacing:"-0.01em",flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:t,"aria-label":t,children:t}),r.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"2px 6px",borderRadius:"3px",background:`${a.railColor}10`,border:`1px solid ${a.railColor}25`,fontSize:"10px",fontWeight:600,letterSpacing:"0.01em",color:a.railColor,flexShrink:0},children:[a.icon,r.jsx("span",{style:{whiteSpace:"nowrap"},children:a.label})]})]}),r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexShrink:0},children:[r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[!i&&r.jsx("div",{style:{width:"5px",height:"5px",borderRadius:"50%",background:a.railColor,flexShrink:0}}),r.jsx("span",{style:{fontSize:"11px",color:"rgba(30, 33, 37, 0.52)",fontWeight:500,whiteSpace:"nowrap"},children:o})]}),s&&r.jsx("button",{onClick:u=>{u.stopPropagation(),s()},style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"4px",border:"none",background:"transparent",cursor:"pointer",color:"rgba(30, 33, 37, 0.35)",transition:"color 0.15s ease",borderRadius:"3px"},className:"hover:bg-[rgba(30,33,37,0.05)] hover:text-[rgba(30,33,37,0.65)]",children:r.jsx(R.X,{size:14,strokeWidth:2.5})})]})]}),r.jsx("p",{style:{fontSize:"12px",lineHeight:1.45,color:"rgba(30, 33, 37, 0.65)",margin:0},children:n})]})}function Li({notifications:e,onDismiss:t,onMarkAllRead:n,onNotificationClick:o}){const i=e.filter(s=>!s.isRead).length;return r.jsxs("div",{style:{background:"#FFFFFF",border:"1px solid rgba(30, 33, 37, 0.12)",borderRadius:"12px",width:"100%",maxWidth:"560px",boxShadow:"0 6px 24px rgba(0, 0, 0, 0.08)",display:"flex",flexDirection:"column",maxHeight:"600px",overflow:"hidden"},children:[r.jsxs("div",{style:{padding:"16px 20px",borderBottom:"1px solid rgba(30, 33, 37, 0.10)",display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:0,background:"#FFFFFF"},children:[r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[r.jsx(R.Bell,{size:18,strokeWidth:2.5,style:{color:"rgba(30, 33, 37, 0.65)"}}),r.jsx("h3",{style:{fontSize:"15px",fontWeight:650,color:"rgba(30, 33, 37, 0.92)",letterSpacing:"-0.01em"},children:"Notifications"}),i>0&&r.jsx("div",{style:{padding:"2px 8px",borderRadius:"12px",background:"rgba(107, 124, 147, 0.12)",fontSize:"11px",fontWeight:650,color:"#6B7C93"},children:i})]}),i>0&&n&&r.jsxs("button",{onClick:n,style:{display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px",border:"1px solid rgba(30, 33, 37, 0.15)",borderRadius:"6px",background:"transparent",fontSize:"13px",fontWeight:600,color:"rgba(30, 33, 37, 0.65)",cursor:"pointer",transition:"all 0.15s ease"},className:"interactive hover:bg-warm hover:border-hover",children:[r.jsx(R.Check,{size:14,strokeWidth:2.5}),"Mark all read"]})]}),r.jsx("div",{style:{padding:"16px",display:"flex",flexDirection:"column",gap:"12px",overflowY:"auto",flex:1},className:"custom-thin-scrollbar",children:e.length===0?r.jsxs("div",{style:{padding:"40px 20px",textAlign:"center",color:"rgba(30, 33, 37, 0.42)"},children:[r.jsx(R.Bell,{size:32,strokeWidth:1.5,style:{margin:"0 auto 12px",opacity:.3}}),r.jsx("p",{style:{fontSize:"13px",fontWeight:500},children:"No notifications"})]}):e.map(s=>r.jsx(Vr,{type:s.type,title:s.title,message:s.message,timestamp:s.timestamp,isRead:s.isRead,onDismiss:t?()=>t(s.id):void 0,onClick:o?()=>o(s.id):void 0},s.id))})]})}exports.Card=Q.Card;exports.ConditionCard=Q.ConditionCard;exports.ConversationTurn=Q.ConversationTurn;exports.DetailCard=Q.DetailCard;exports.DeviationIndicator=Q.DeviationIndicator;exports.ModelScoreCard=Q.ModelScoreCard;exports.ObservationCard=Q.ObservationCard;exports.ScoreDriverCard=Q.ScoreDriverCard;exports.ScoreDriverCardVariant=Q.ScoreDriverCardVariant;exports.SectionLabel=Q.SectionLabel;exports.SignalCard=Q.SignalCard;exports.SmallButton=Q.SmallButton;exports.SmallObservationCard=Q.SmallObservationCard;exports.SummarySection=Q.SummarySection;exports.Tag=Q.Tag;exports.Timeline=Q.Timeline;exports.Tooltip=Q.Tooltip;exports.TooltipContent=Q.TooltipContent;exports.TooltipProvider=Q.TooltipProvider;exports.TooltipTrigger=Q.TooltipTrigger;exports.TranscriptCard=Q.TranscriptCard;exports.Badge=Kr;exports.ChatHistoryPanel=yi;exports.ChatInterface=mi;exports.ChatMessage=Vt;exports.Checkbox=$r;exports.ColorPalette=Qr;exports.DataTable=di;exports.DataTableFilters=Ur;exports.DemoProjectBanner=Ei;exports.FirstCallScreen=Ai;exports.FormLabel=on;exports.InlineConfirm=sn;exports.IntegrationCard=Mi;exports.InteractionSummaryCard=xi;exports.LoginForm=Bi;exports.MessageThread=ji;exports.NavigationBar=Ti;exports.NotificationItem=Vr;exports.NotificationPanel=Li;exports.OnboardingChecklist=Ii;exports.Select=nn;exports.Sidebar=ki;exports.SummaryStatsPanel=ui;exports.Tabs=qr;exports.TextArea=tn;exports.TextInput=_r;
34
+ //# sourceMappingURL=index.cjs.js.map