chordia-ui 3.9.8 → 3.9.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/DataTable2.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const t=require("react/jsx-runtime"),i=require("react"),T=require("./sortable.esm.cjs.js"),I=require("lucide-react"),et=require("react-dom"),Ft=require("./CustomFilterChips.cjs.js");require("motion/react");require("recharts");require("./AgentLiftAnalysisCard.cjs.js");require("./TourGuideTooltip.cjs.js");function jt({dateRangePicker:r,onWeekToDate:l,exportConfig:d,filterChipsConfig:f,trailingActions:v}){const[y,c]=i.useState(!1),g=i.useRef(null),R=i.useRef(null);i.useEffect(()=>{const S=j=>{R.current&&!R.current.contains(j.target)&&g.current&&!g.current.contains(j.target)&&c(!1)};if(y)return document.addEventListener("mousedown",S),()=>{document.removeEventListener("mousedown",S)}},[y]);const w=()=>{c(S=>!S)},F=S=>{c(!1),d!=null&&d.onExport&&d.onExport(S)},M=(()=>{if(!(f!=null&&f.filters))return!1;const S=f.filters,j=f.customFilters||[],q=Object.entries(S).some(([C,$])=>!!(Array.isArray($)&&$.length||typeof $=="string"&&$.trim()!==""||$&&typeof $=="object"&&($.min!=null||$.max!=null))),z=j.some(C=>C.active);return q||z})();return t.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[l&&t.jsxs("button",{onClick:l,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:[t.jsx(I.CalendarClock,{size:16}),t.jsx("span",{children:"Week to Date"})]}),r&&t.jsx(i.Suspense,{fallback:t.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:[t.jsx(I.CalendarClock,{size:16}),t.jsx("span",{children:"Loading..."})]}),children:r}),d&&t.jsxs("div",{className:"relative",children:[t.jsxs("button",{ref:g,onClick:w,disabled:d.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:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(I.Download,{size:16}),t.jsx("span",{children:d.isExporting?"Exporting...":"Export"})]}),t.jsx(I.ChevronDown,{size:16})]}),y&&t.jsx("div",{ref:R,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:(d.types||["csv"]).map(S=>t.jsxs("button",{onClick:()=>F(S),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 ",S.toUpperCase()]},S))})]}),(M||v)&&t.jsxs(t.Fragment,{children:[M&&t.jsx("div",{className:"h-9 mt-1 w-px bg-gray-300 flex-shrink-0"}),t.jsxs("div",{className:"flex items-center gap-3 justify-end",children:[M&&f&&t.jsx(Ft.CustomFilterChips,{filters:f.filters,onChange:f.onChange,onClear:f.onClear,customFilters:f.customFilters||[],fieldOptions:f.fieldOptions||{}}),v&&t.jsx("div",{className:"flex-shrink-0",children:v})]})]})]})}function tt(r){if(r==null)return NaN;const l=String(r).replace(/[,$%]|pp/gi,"").trim(),d=parseFloat(l);return Number.isFinite(d)?d:NaN}function Yt(r){if(r==null)return NaN;const l=String(r).trim(),d=l.match(/^(\d+):(\d+)(?::(\d+))?$/);if(d){const w=+d[1],F=+d[2],A=d[3]!=null?+d[3]:null;return A!=null?w*3600+F*60+A:w*60+F}let f=0,v=!1;const y=l.match(/(\d+)\s*d\b/i),c=l.match(/(\d+)\s*h\b/i),g=l.match(/(\d+)\s*m(?!s)\b/i),R=l.match(/(\d+)\s*s\b/i);return y&&(f+=+y[1]*86400,v=!0),c&&(f+=+c[1]*3600,v=!0),g&&(f+=+g[1]*60,v=!0),R&&(f+=+R[1],v=!0),v?f:NaN}function Qt(r){if(!r)return null;const l=String(r).trim(),d=l.match(/^(\d{1,2})\/(\d{1,2})\/(\d{2,4})$/);if(d){const v=d[3].length===2?2e3+ +d[3]:+d[3],y=new Date(v,+d[1]-1,+d[2]);return isNaN(y.getTime())?null:y}const f=new Date(l);return isNaN(f.getTime())?null:f}function Zt(r){if(!r||r.length===0)return"text";const l=r.slice(0,25),d=f=>l.every(f);return d(f=>/^\d{1,2}\/\d{1,2}\/\d{2,4}$/.test(f)||/^\d{4}-\d{2}-\d{2}/.test(f))?"date":d(f=>/^\d+\s*[dhms]\b/i.test(f)||/^\d+:\d+(:\d+)?$/.test(f))?"duration":d(f=>/^-?[\d,.]+(%|pp)?$/i.test(f))?"number":"text"}function De(r){return r?Array.isArray(r)?r.length>0:r.type==="range"?r.min!==""&&r.min!==void 0&&r.min!==null||r.max!==""&&r.max!==void 0&&r.max!==null:r.type==="durationRange"?r.minSec!==""&&r.minSec!=null||r.maxSec!==""&&r.maxSec!=null:r.type==="scoreRange"?Array.isArray(r.values)&&r.values.length>0||r.min!==""&&r.min!=null||r.max!==""&&r.max!=null:r.type==="dateRange"?!!(r.from||r.to):!1:!1}function St(r){if(r==null||r===""||isNaN(r))return"";const l=Number(r),d=Math.floor(l/3600),f=Math.floor(l%3600/60),v=Math.floor(l%60);return d>0?`${d}h ${f}m`:f>0?`${f}m ${v}s`:`${v}s`}function Vt(r){if(!r)return"";if(Array.isArray(r))return r.length===0?"":String(r[0]);if(r.type==="range"){const l=r.min!==""&&r.min!=null?r.min:null,d=r.max!==""&&r.max!=null?r.max:null;return l!=null&&d!=null?`${l} – ${d}`:l!=null?`≥ ${l}`:d!=null?`≤ ${d}`:""}if(r.type==="durationRange"){const l=r.minSec!==""&&r.minSec!=null?St(r.minSec):null,d=r.maxSec!==""&&r.maxSec!=null?St(r.maxSec):null;return l&&d?`${l} – ${d}`:l?`≥ ${l}`:d?`≤ ${d}`:""}if(r.type==="scoreRange"){if(Array.isArray(r.values)&&r.values.length>0)return r.values.slice().sort((f,v)=>f-v).join(", ");const l=r.min!==""&&r.min!=null?r.min:null,d=r.max!==""&&r.max!=null?r.max:null;return l!=null&&d!=null?`${l} – ${d}`:l!=null?`≥ ${l}`:d!=null?`≤ ${d}`:""}return r.type==="dateRange"?r.from&&r.to?`${r.from} – ${r.to}`:r.from?`from ${r.from}`:r.to?`to ${r.to}`:"":""}function en(r){return Array.isArray(r)?Math.max(0,r.length-1):0}function tn(r){return Array.isArray(r)?r.slice(1).map(String).join(", "):""}function nn({count:r,values:l}){const[d,f]=i.useState(!1);return t.jsxs("span",{onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),style:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",height:22,minWidth:22,padding:"0 6px",background:"#D8D8D8",color:"#0B0B0B",borderRadius:14,fontSize:12,fontWeight:500,lineHeight:1,cursor:"pointer"},children:["+",r,d&&t.jsx("span",{role:"tooltip",style:{position:"absolute",bottom:"calc(100% + 6px)",left:"50%",transform:"translateX(-50%)",background:"#1E2125",color:"#FFFFFF",fontFamily:"var(--font-sans)",fontSize:12,fontWeight:400,lineHeight:"20px",padding:"6px 10px",borderRadius:8,whiteSpace:"nowrap",pointerEvents:"none",zIndex:100,boxShadow:"0 6px 16px rgba(11, 11, 11, 0.18)"},children:l})]})}function rn({leftLabel:r,rightLabel:l,leftValue:d,rightValue:f,onLeftChange:v,onRightChange:y,type:c="number",placeholderLeft:g="Min",placeholderRight:R="Max"}){const w={width:"100%",height:32,borderRadius:8,border:"1px solid #D9D9D9",background:"#FFFFFF",padding:"0 10px",fontFamily:"var(--font-sans)",fontSize:14,color:"#0B0B0B",outline:"none",boxSizing:"border-box"},F={fontSize:12,color:"#676767",marginBottom:4,fontFamily:"var(--font-sans)"};return t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:10},children:[t.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[t.jsx("span",{style:F,children:r}),t.jsx("input",{type:c,value:d,onChange:A=>v(A.target.value),placeholder:g,style:w})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[t.jsx("span",{style:F,children:l}),t.jsx("input",{type:c,value:f,onChange:A=>y(A.target.value),placeholder:R,style:w})]})]})}const vt=[{id:"0-60",label:"0 to 60 Sec",minSec:0,maxSec:60},{id:"60-120",label:"1m to 2 m",minSec:60,maxSec:120},{id:"120-180",label:"2m to 3 m",minSec:120,maxSec:180},{id:"180-240",label:"3m to 4m",minSec:180,maxSec:240},{id:"240-300",label:"4m to 5m",minSec:240,maxSec:300},{id:"300+",label:"5 mins and above",minSec:300,maxSec:null}];function wt(r){if(r==null||r==="")return null;const l=String(r).trim().match(/^(\d{1,3}):(\d{2})$/);if(l)return Number(l[1])*60+Number(l[2]);const d=Number(r);return Number.isFinite(d)?d:null}function Ze({children:r}){return t.jsx("div",{style:{fontSize:14,fontWeight:600,color:"#0B0B0B",lineHeight:"20px",padding:"4px 0 2px",fontFamily:"var(--font-sans)"},children:r})}function Ve({minValue:r,maxValue:l,onMinChange:d,onMaxChange:f,inputType:v="number",inputMode:y="decimal",step:c,placeholder:g="0.0",unit:R}){const w={width:"100%",height:30,border:"1px solid #ACADAD",borderRadius:4,padding:"6px 10px",fontSize:13,color:"#0B0B0B",fontFamily:"var(--font-sans)",outline:"none",boxSizing:"border-box"};return t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[t.jsxs("div",{style:{display:"flex",alignItems:"flex-end",gap:8},children:[t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6,flex:1,minWidth:0},children:[t.jsx("span",{style:{fontSize:12,color:"#2E3236",fontFamily:"var(--font-sans)"},children:"Min From"}),t.jsx("input",{type:v,inputMode:y,step:c,placeholder:g,value:r,onChange:F=>d(F.target.value),style:w})]}),t.jsx("span",{style:{fontSize:12,fontWeight:600,color:"#323232",paddingBottom:8,fontFamily:"var(--font-sans)"},children:"to"}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6,flex:1,minWidth:0},children:[t.jsx("span",{style:{fontSize:12,color:"#2E3236",fontFamily:"var(--font-sans)"},children:"Max"}),t.jsx("input",{type:v,inputMode:y,step:c,placeholder:g,value:l,onChange:F=>f(F.target.value),style:w})]})]}),R&&t.jsxs("span",{style:{fontSize:11,color:"#676767",fontFamily:"var(--font-sans)"},children:["Enter durations in ",R==="sec"?"seconds":R]})]})}function sn({column:r,columnId:l,filterType:d="text",position:f,popoverRef:v,distinctValues:y,initialValue:c,onApply:g,onCancel:R}){const w=d==="text",F=d==="number",A=d==="date",M=d==="duration",S=d==="score",j=/duration/i.test(String((r==null?void 0:r.label)||l||"")),q=i.useMemo(()=>{if(!S||!Array.isArray(y)||y.length===0)return!1;let m=1/0,h=-1/0;for(const x of y){const E=tt(x);Number.isFinite(E)&&(E<m&&(m=E),E>h&&(h=E))}return Number.isFinite(m)&&Number.isFinite(h)&&m>=0&&h<=5},[S,y]),[z,C]=i.useState(()=>w?new Set(Array.isArray(c)?c:[]):new Set),[$,ce]=i.useState(""),[ie,K]=i.useState(()=>F&&(c==null?void 0:c.type)==="range"&&c.min!=null?c.min:""),[B,ee]=i.useState(()=>F&&(c==null?void 0:c.type)==="range"&&c.max!=null?c.max:""),[U,P]=i.useState(new Set),[X,de]=i.useState(()=>M&&(c==null?void 0:c.type)==="durationRange"&&c.minSec!=null&&c.minSec!==""?String(c.minSec):""),[J,Y]=i.useState(()=>M&&(c==null?void 0:c.type)==="durationRange"&&c.maxSec!=null&&c.maxSec!==""?String(c.maxSec):""),[ue,Q]=i.useState(()=>S&&(c==null?void 0:c.type)==="scoreRange"&&Array.isArray(c.values)?new Set(c.values):new Set),[te,me]=i.useState(()=>S&&(c==null?void 0:c.type)==="scoreRange"&&c.min!=null&&c.min!==""?String(c.min):""),[Se,G]=i.useState(()=>S&&(c==null?void 0:c.type)==="scoreRange"&&c.max!=null&&c.max!==""?String(c.max):""),[N,ne]=i.useState(()=>A&&(c==null?void 0:c.type)==="dateRange"&&c.from||""),[Z,ae]=i.useState(()=>A&&(c==null?void 0:c.type)==="dateRange"&&c.to||"");i.useEffect(()=>{w&&C(new Set(Array.isArray(c)?c:[]))},[l,w]);const _=i.useMemo(()=>{const m=$.trim().toLowerCase();return[...m?y.filter(x=>String(x).toLowerCase().includes(m)):y].sort((x,E)=>{const V=z.has(x),pe=z.has(E);return V!==pe?V?-1:1:String(x).localeCompare(String(E))})},[y,$,z]),he=m=>{C(h=>{const x=new Set(h);return x.has(m)?x.delete(m):x.add(m),x})},ve=()=>{w&&C(new Set),F&&(K(""),ee("")),M&&(P(new Set),de(""),Y("")),S&&(Q(new Set),me(""),G("")),A&&(ne(""),ae("")),ce("")},Re=m=>{P(h=>{const x=new Set(h);return x.has(m)?x.delete(m):x.add(m),x})},D=m=>{Q(h=>{const x=new Set(h);return x.has(m)?x.delete(m):x.add(m),x})},fe=()=>{if(w)return g(Array.from(z));if(F)return g({type:"range",min:ie===""?"":Number(ie),max:B===""?"":Number(B)});if(M){const m=wt(X),h=wt(J),x=m!=null||h!=null;let E="",V="";if(x)E=m??"",V=h??"";else if(U.size>0){const pe=vt.filter(re=>U.has(re.id));E=Math.min(...pe.map(re=>re.minSec)),V=pe.some(re=>re.maxSec==null)?"":Math.max(...pe.map(re=>re.maxSec))}return g({type:"durationRange",minSec:E,maxSec:V})}if(S){const m=te===""?null:Number(te),h=Se===""?null:Number(Se);return m!=null||h!=null?g({type:"scoreRange",values:[],min:m!=null&&Number.isFinite(m)?m:"",max:h!=null&&Number.isFinite(h)?h:""}):g({type:"scoreRange",values:Array.from(ue).sort((E,V)=>E-V),min:"",max:""})}if(A)return g({type:"dateRange",from:N,to:Z})};return t.jsxs("div",{ref:v,role:"dialog","aria-label":`Filter ${r.label||l}`,style:{position:"fixed",top:f.top,left:f.left,zIndex:50,width:w?240:220,background:"#FFFFFF",border:"1px solid #E6E6E6",borderRadius:10,padding:12,display:"flex",flexDirection:"column",gap:10,boxShadow:"0 8px 24px rgba(11, 11, 11, 0.10)",fontFamily:"var(--font-sans)"},children:[w&&t.jsxs(t.Fragment,{children:[t.jsx("div",{style:{background:"#D8D8D8",height:32,borderRadius:10,padding:1,display:"flex",alignItems:"center"},children:t.jsxs("div",{style:{background:"#FFFFFF",flex:1,height:30,borderRadius:10,display:"flex",alignItems:"center",gap:8,padding:"0 8px"},children:[t.jsx(I.Search,{size:16,color:"#989898",strokeWidth:2}),t.jsx("input",{autoFocus:!0,type:"text",value:$,onChange:m=>ce(m.target.value),placeholder:"Search",style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:14,color:"#0B0B0B",minWidth:0,fontFamily:"var(--font-sans)"}})]})}),t.jsx("div",{style:{maxHeight:220,overflowY:"auto",display:"flex",flexDirection:"column",gap:4},children:_.length===0?t.jsx("div",{style:{fontSize:13,color:"#676767",padding:"8px 4px",textAlign:"center"},children:"No values"}):_.map(m=>{const h=z.has(m);return t.jsxs("label",{style:{display:"flex",alignItems:"center",gap:12,padding:"6px 4px",cursor:"pointer",borderRadius:6},children:[t.jsx("span",{style:{width:20,height:20,borderRadius:4,display:"inline-flex",alignItems:"center",justifyContent:"center",background:h?"#0B0B0B":"#FFFFFF",border:`1px solid ${h?"#0B0B0B":"#676767"}`,flexShrink:0},children:h&&t.jsx(I.Check,{size:14,color:"#FFFFFF",strokeWidth:3})}),t.jsx("input",{type:"checkbox",checked:h,onChange:()=>he(m),style:{position:"absolute",opacity:0,pointerEvents:"none"},tabIndex:-1}),t.jsx("span",{onClick:x=>{x.preventDefault(),he(m)},style:{fontSize:14,lineHeight:"20px",color:"#0B0B0B",flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:m})]},m)})})]}),F&&t.jsxs(t.Fragment,{children:[t.jsx(Ze,{children:r.label||"Filter"}),t.jsx(Ve,{minValue:ie,maxValue:B,onMinChange:K,onMaxChange:ee,placeholder:j?"00":"0.0",unit:j?"sec":void 0})]}),M&&t.jsxs(t.Fragment,{children:[t.jsx(Ze,{children:r.label||"Duration"}),r.filterShowPresets===!0&&t.jsxs(t.Fragment,{children:[t.jsx("div",{style:{display:"flex",flexDirection:"column",gap:12},children:vt.map(m=>{const h=U.has(m.id);return t.jsxs("div",{role:"checkbox","aria-checked":h,tabIndex:0,onClick:()=>Re(m.id),onKeyDown:x=>{(x.key===" "||x.key==="Enter")&&(x.preventDefault(),Re(m.id))},style:{display:"flex",alignItems:"center",gap:12,cursor:"pointer",userSelect:"none"},children:[t.jsx("span",{style:{width:20,height:20,borderRadius:4,display:"inline-flex",alignItems:"center",justifyContent:"center",background:h?"#0B0B0B":"#FFFFFF",border:`1px solid ${h?"#0B0B0B":"#676767"}`,flexShrink:0},children:h&&t.jsx(I.Check,{size:14,color:"#FFFFFF",strokeWidth:3})}),t.jsx("span",{style:{fontSize:14,lineHeight:"20px",color:"#0B0B0B",fontFamily:"var(--font-sans)"},children:m.label})]},m.id)})}),t.jsx("div",{style:{height:1,background:"#D9D9D9",margin:"0 -12px"}}),t.jsx("div",{style:{fontSize:14,fontWeight:500,color:"#0B0B0B",lineHeight:"20px",padding:"4px 0",fontFamily:"var(--font-sans)"},children:"Custom Range"})]}),t.jsx(Ve,{minValue:X,maxValue:J,onMinChange:de,onMaxChange:Y,inputType:"number",inputMode:"numeric",placeholder:"00",unit:"sec"})]}),S&&t.jsxs(t.Fragment,{children:[t.jsx(Ze,{children:r.label||"Score"}),q&&r.filterShowPresets===!0&&t.jsxs(t.Fragment,{children:[t.jsx("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[1,2,3,4,5].map(m=>{const h=ue.has(m);return t.jsxs("div",{role:"checkbox","aria-checked":h,tabIndex:0,onClick:()=>D(m),onKeyDown:x=>{(x.key===" "||x.key==="Enter")&&(x.preventDefault(),D(m))},style:{display:"flex",alignItems:"center",gap:12,cursor:"pointer",userSelect:"none"},children:[t.jsx("span",{style:{width:20,height:20,borderRadius:4,display:"inline-flex",alignItems:"center",justifyContent:"center",background:h?"#0B0B0B":"#FFFFFF",border:`1px solid ${h?"#0B0B0B":"#676767"}`,flexShrink:0},children:h&&t.jsx(I.Check,{size:14,color:"#FFFFFF",strokeWidth:3})}),t.jsx("span",{style:{fontSize:14,lineHeight:"20px",color:"#0B0B0B",fontFamily:"var(--font-sans)"},children:m})]},m)})}),t.jsx("div",{style:{height:1,background:"#D9D9D9",margin:"0 -12px"}})]}),q&&r.filterShowPresets===!0&&t.jsx("div",{style:{fontSize:14,fontWeight:500,color:"#0B0B0B",lineHeight:"20px",padding:"4px 0",fontFamily:"var(--font-sans)"},children:"Custom Range"}),t.jsx(Ve,{minValue:te,maxValue:Se,onMinChange:me,onMaxChange:G,step:"0.1"})]}),A&&t.jsx(rn,{leftLabel:"From",rightLabel:"To",leftValue:N,rightValue:Z,onLeftChange:ne,onRightChange:ae,type:"date",placeholderLeft:"",placeholderRight:""}),t.jsx("div",{style:{height:1,background:"#D9D9D9",margin:"0 -12px"}}),t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[t.jsx("button",{type:"button",onClick:ve,style:{background:"transparent",border:"none",padding:0,cursor:"pointer",fontSize:14,fontWeight:500,color:"#323232",fontFamily:"var(--font-sans)"},children:M&&r.filterShowPresets===!0||S&&q&&r.filterShowPresets===!0?"View All":"Reset"}),t.jsx("button",{type:"button",onClick:fe,style:{background:"#0B0B0B",color:"#FFFFFF",border:"none",borderRadius:10,height:28,padding:"0 14px",fontSize:14,fontWeight:500,cursor:"pointer",fontFamily:"var(--font-sans)"},children:"Apply"})]})]})}const on=()=>({userData:{email:"anonymous"}}),an=r=>t.jsx("img",{...r});function ln({children:r,content:l,direction:d="top",align:f="center",styling:v,indicatorColor:y}){const c=typeof l=="string"?l:l!=null?String(l):"",g=typeof y=="string"&&(y.startsWith("#")||y.startsWith("rgb")||y.startsWith("hsl")||y.startsWith("var("))?y:"var(--Grey-Strong, #2E3236)",[R,w]=i.useState(!1),[F,A]=i.useState(!1),[M,S]=i.useState({top:0,left:0,arrowLeft:0,placement:"top"}),j=i.useRef(null),q=i.useRef(null);if(!c)return r;i.useEffect(()=>{A(!0)},[]);const z=i.useCallback(()=>{if(!j.current||!q.current||typeof window>"u")return;const C=j.current.getBoundingClientRect(),$=q.current.getBoundingClientRect(),ce=window.innerWidth,ie=window.innerHeight,K=8,B=10,ee=$.width,U=$.height,P=C.top,X=ie-C.bottom,de=d==="bottom"?"bottom":"top";let J=de;de==="top"&&P<U+B+K&&X>P?J="bottom":de==="bottom"&&X<U+B+K&&P>X&&(J="top");let Y=C.left+C.width/2;f==="start"&&(Y=C.left),f==="end"&&(Y=C.right);let ue=J==="top"?C.top-U-B:C.bottom+B,Q=f==="start"?Y:f==="end"?Y-ee:Y-ee/2;ue=Math.max(K,Math.min(ue,ie-U-K)),Q=Math.max(K,Math.min(Q,ce-ee-K));const te=Math.max(10,Math.min(Y-Q,ee-10));S({top:ue,left:Q,arrowLeft:te,placement:J})},[f,d]);return i.useEffect(()=>{if(!R||!F)return;z();const C=()=>z();return window.addEventListener("resize",C),window.addEventListener("scroll",C,!0),()=>{window.removeEventListener("resize",C),window.removeEventListener("scroll",C,!0)}},[R,F,z]),t.jsxs("span",{ref:j,style:{display:"block",width:"100%"},onMouseEnter:()=>w(!0),onMouseLeave:()=>w(!1),children:[r,R&&F&&et.createPortal(t.jsxs("span",{ref:q,style:{position:"fixed",top:`${M.top}px`,left:`${M.left}px`,background:"var(--Grey-Strong, #2E3236)",color:"var(--Grey-White, #FFF)",fontSize:"12px",lineHeight:1.3,fontWeight:500,padding:"8px 10px",borderRadius:"6px",whiteSpace:"normal",maxWidth:"320px",width:"max-content",boxShadow:"0 6px 18px rgba(0, 0, 0, 0.2)",zIndex:99999,pointerEvents:"none",...typeof v=="object"?v:{}},children:[c,t.jsx("span",{style:{position:"absolute",left:`${M.arrowLeft}px`,transform:"translateX(-50%)",width:0,height:0,borderLeft:"6px solid transparent",borderRight:"6px solid transparent",...M.placement==="top"?{top:"100%",borderTop:`7px solid ${g}`}:{bottom:"100%",borderBottom:`7px solid ${g}`}}})]}),document.body)]})}function cn({data:r=[],columns:l=[],initialPageSize:d=10,onRowClick:f,totalCount:v=null,page:y=null,pageSize:c=null,onPageChange:g=null,onPageSizeChange:R=null,onFilterChange:w=null,columnFilters:F=null,onMaxColumnsError:A=null,onSort:M=null,sortFields:S=[],tableId:j=null,isLoading:q=!1,filtersConfig:z=null,columnResizeMinWidth:C=120,columnResizeMaxWidth:$=280,onVisibleColumnsChange:ce=null,hideColumnPicker:ie=!1}){var bt;const{userData:K}=on(),B=(K==null?void 0:K.email)||"anonymous",ee=i.memo(({children:e,content:n,className:s=""})=>{const a=i.useRef(null),[o,p]=i.useState(!1);i.useEffect(()=>{const b=()=>{if(a.current){const L=a.current.scrollWidth>a.current.clientWidth;p(L)}};b();const O=setTimeout(b,0);return window.addEventListener("resize",b),()=>{clearTimeout(O),window.removeEventListener("resize",b)}},[e,n]);const u=t.jsx("span",{className:`truncate block ${s}`,ref:a,children:e});return o&&n?t.jsx(ln,{content:n,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:u}):u});ee.displayName="TruncatedCell";const U=v!==null&&g!==null,P=w!==null,X=M!==null,[de,J]=i.useState(1),[Y,ue]=i.useState(d),Q=y!==null?y:de,te=c!==null?c:Y,me=e=>{g?g(e):J(e)},Se=e=>{R?R(e):ue(e)},G=50,N="action",ne=i.useRef(!1),Z=i.useMemo(()=>j?`dataTable_columns_${j}:${B}`:`dataTable_columns_${l.map(n=>n.id||n.key).sort().join("_")}:${B}`,[j,l,B]),ae=i.useMemo(()=>j?`dataTable_manual_change_${j}:${B}`:null,[j,B]);i.useCallback((e,n)=>{if(typeof window>"u"||!e||!n||n.length===0)return null;try{const s=localStorage.getItem(e);if(s){const o=JSON.parse(s).filter(p=>n.some(u=>(u.id||u.key)===p));if(o.length>0)return o}}catch(s){console.warn("Failed to load saved columns from localStorage:",s)}return null},[]);const[_,he]=i.useState({}),[ve,Re]=i.useState(""),[D,fe]=i.useState(null),[m,h]=i.useState({top:0,left:0}),x=i.useRef(null),E=i.useRef({}),[V,pe]=i.useState(null),[Te,re]=i.useState("asc"),_e=i.useCallback((e,n)=>{const s=De(n);he(a=>{const o={...a};return s?o[e]=n:delete o[e],o}),g?g(1):J(1),P&&w&&w(s?{..._,[e]:n}:Object.fromEntries(Object.entries(_).filter(([a])=>a!==e)))},[_,w,P,g]),kt=i.useCallback(()=>{he({}),Re(""),g?g(1):J(1),P&&w&&w({})},[w,P,g]),He=i.useCallback(e=>{if(!r||r.length===0)return[];const n=new Set,s=[];for(const a of r){const o=a[e];if(o==null)continue;const p=typeof o=="object"?JSON.stringify(o):String(o);n.has(p)||(n.add(p),s.push(p))}return s.sort((a,o)=>a.localeCompare(o))},[r]),Ct=i.useCallback(e=>{const n=l.find(s=>H(s)===e);return n&&n.filterType?n.filterType:Zt(He(e))},[l,He]),Ee=i.useCallback(e=>{const a=typeof window<"u"?window.innerWidth:1/0;let o=e.left;return o+280>a-8&&(o=Math.max(8,e.right-280)),{top:e.bottom+6,left:o}},[]),Dt=i.useCallback((e,n)=>{if(!n){fe(e);return}const s=n.getBoundingClientRect();h(Ee(s)),fe(a=>a===e?null:e)},[Ee]);i.useEffect(()=>{if(!D)return;const e=n=>{if(x.current&&x.current.contains(n.target))return;const s=E.current[D];s&&s.contains(n.target)||Object.values(E.current).some(o=>o&&o.contains(n.target))||fe(null)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[D]),i.useEffect(()=>{if(!D)return;const e=()=>{const n=E.current[D];if(!n)return;const s=n.getBoundingClientRect();h(Ee(s))};return window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[D,Ee]),i.useLayoutEffect(()=>{if(!D)return;const e=x.current,n=E.current[D];if(!e||!n)return;const s=e.offsetWidth,a=n.getBoundingClientRect(),o=8,p=typeof window<"u"?window.innerWidth:1/0;if(!(a.left+s>p-o))return;const b=Math.max(o,a.right-s);h(O=>O.left===b?O:{...O,left:b})},[D,m.top]);const nt=i.useCallback(e=>!e||typeof e!="object"?{}:Object.fromEntries(Object.entries(e).filter(([,n])=>n==null?!1:typeof n=="string"?n.trim()!=="":!0)),[]),rt=i.useCallback((e,n)=>{const s=Object.keys(e||{}),a=Object.keys(n||{});return s.length!==a.length?!1:s.every(o=>e[o]===n[o])},[]);i.useEffect(()=>{if(!P||F===null)return;const e=nt(F);he(n=>rt(n,e)?n:e)},[P,F,nt,rt]),i.useCallback((e,n)=>e==="csat_score"&&n==="evaluation.csat_score"?n:e,[]);const we=X&&S.length>0?S[0][0]:V,Me=X&&S.length>0?S[0][1]:Te,[dn,st]=i.useState(()=>l.map(e=>e.id||e.key)),se=i.useCallback(e=>{if(!e||e.length===0)return e;let n=Array.from(new Set(e));n.length>G&&(n=n.slice(0,G));const a=l.map(u=>u.id||u.key).includes(N);return!n.includes(N)&&a&&(n.length>=G?n=[...n.slice(0,G-1),N]:n=[...n,N]),[...n.filter(u=>u!==N),N]},[l]),[W,Fe]=i.useState(()=>{if(typeof window<"u"&&j)try{if(localStorage.getItem(`dataTable_manual_change_${j}:${B}`)==="true"){const a=localStorage.getItem(`dataTable_columns_${j}:${B}`);if(a){const o=JSON.parse(a);if(Array.isArray(o)&&o.length>0){ne.current=!0;const p=o.filter(u=>l.some(b=>(b.id||b.key)===u));if(p.length>0)return p.slice(0,G)}}}}catch(s){console.warn("Failed to load saved columns from localStorage:",s)}const n=l.map(s=>s.id||s.key).slice(0,G);return se(n)}),[oe,qe]=i.useState(!1),[xe,ze]=i.useState([]),[ot,Rt]=i.useState({top:0,left:0,width:0}),[it,at]=i.useState(new Set),[lt,ct]=i.useState(new Set),Be=i.useRef(null);Be.current===null&&(Be.current=[...W]);const[le,Ke]=i.useState(null),[Et,Ne]=i.useState(null),ge=i.useRef(null),Xe=i.useRef(null),Ge=i.useRef(null),[dt,Ue]=i.useState(null),[Je,Mt]=i.useState({}),zt=i.useRef(null),We=i.useRef(null),H=e=>e.id||e.key,Ae=i.useCallback(e=>{if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"){const n=e.trim();if(n.endsWith("px")){const a=parseFloat(n);return Number.isFinite(a)?a:null}const s=parseFloat(n);return Number.isFinite(s)&&`${s}`===n?s:null}return null},[]),ut=i.useCallback((e,n)=>Je[e]!=null?`${Je[e]}px`:typeof n=="number"?`${n}px`:n||"auto",[Je]),$e=i.useCallback(e=>{if(!We.current)return;const{columnId:n,startX:s,startWidth:a,minWidth:o,maxWidth:p}=We.current,u=e.clientX-s,b=Math.round(a+u),O=Math.min(p,Math.max(o,b));Mt(L=>({...L,[n]:O}))},[]),je=i.useCallback(()=>{We.current=null,document.body.style.cursor="",document.body.style.userSelect="",document.removeEventListener("mousemove",$e),document.removeEventListener("mouseup",je)},[$e]),Bt=i.useCallback((e,n,s)=>{var Le;e.preventDefault(),e.stopPropagation();const a=n.id||n.key,o=Ae(n.minWidth)??C,p=Ae(n.maxWidth)??$,u=Math.min(o,p),b=Math.max(o,p),O=((Le=e.currentTarget.closest("th"))==null?void 0:Le.getBoundingClientRect().width)||0,L=Ae(s),Ce=L??Math.max(u,Math.round(O)||u),Ye=Math.min(b,Math.max(u,Ce));We.current={columnId:a,startX:e.clientX,startWidth:Ye,minWidth:u,maxWidth:b},document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",$e),document.addEventListener("mouseup",je)},[$,C,$e,je,Ae]);i.useEffect(()=>()=>je(),[je]);const Nt=T.useSensors(T.useSensor(T.PointerSensor),T.useSensor(T.KeyboardSensor,{coordinateGetter:T.sortableKeyboardCoordinates})),Wt=e=>{const{active:n,over:s}=e;if(s&&n.id!==s.id){if(n.id===N||s.id===N){pt("Cannot drop columns on the Action column"),Ue(null);return}ne.current=!0,Fe(a=>{const o=a.indexOf(n.id),p=a.indexOf(s.id);if(o!==-1&&p!==-1){const u=T.arrayMove(a,o,p),b=se(u);return mt(b),b}return a}),st(a=>{const o=a.indexOf(n.id),p=a.indexOf(s.id);return T.arrayMove(a,o,p)})}Ue(null)},At=e=>{Ue(e.active.id)},Ie=i.useMemo(()=>{if(P)return r||[];if(!r||r.length===0)return[];const e=ve.trim().toLowerCase(),n=Object.entries(_).filter(([,s])=>De(s));return r.filter(s=>{for(const[a,o]of n){const p=s[a];if(p==null)return!1;if(Array.isArray(o)){const u=String(p);if(!o.some(b=>String(b)===u))return!1;continue}if(o.type==="range"){const u=tt(p);if(isNaN(u)||o.min!==""&&o.min!=null&&u<Number(o.min)||o.max!==""&&o.max!=null&&u>Number(o.max))return!1;continue}if(o.type==="durationRange"){const u=Yt(p);if(isNaN(u)||o.minSec!==""&&o.minSec!=null&&u<Number(o.minSec)||o.maxSec!==""&&o.maxSec!=null&&u>Number(o.maxSec))return!1;continue}if(o.type==="scoreRange"){const u=tt(p);if(isNaN(u))return!1;if(Array.isArray(o.values)&&o.values.length>0){const b=Math.floor(u);if(!o.values.includes(b))return!1;continue}if(o.min!==""&&o.min!=null&&u<Number(o.min)||o.max!==""&&o.max!=null&&u>Number(o.max))return!1;continue}if(o.type==="dateRange"){const u=Qt(p);if(!u)return!1;if(o.from){const b=new Date(o.from+"T00:00:00");if(u<b)return!1}if(o.to){const b=new Date(o.to+"T23:59:59");if(u>b)return!1}continue}}return!(e&&!Object.values(s).some(o=>o==null?!1:String(o).toLowerCase().includes(e)))})},[r,_,ve,P]),ke=i.useMemo(()=>X||!we?Ie:[...Ie].sort((e,n)=>{const s=e[we],a=n[we];if(s==null)return 1;if(a==null)return-1;if(typeof s=="number"&&typeof a=="number")return Me==="asc"?s-a:a-s;const o=String(s).toLowerCase(),p=String(a).toLowerCase();return Me==="asc"?o.localeCompare(p):p.localeCompare(o)}),[Ie,we,Me,X]),Oe=i.useMemo(()=>{if(U)return ke;{const e=(Q-1)*te,n=e+te;return ke.slice(e,n)}},[ke,Q,te,U]),ft=e=>{X&&M?(M(e),g?g(1):J(1)):(V===e?re(Te==="asc"?"desc":"asc"):(pe(e),re("asc")),me(1))},$t=(e,n)=>{const s=(n||"").split(/\s+/).map(a=>a.trim()).filter(Boolean);_e(e,s)},pt=e=>{Ge.current||(typeof A=="function"&&A(e),Ge.current=setTimeout(()=>{Ge.current=null},3e3))},mt=i.useCallback(e=>{if(typeof window<"u"&&Z&&e.length>0&&ne.current)try{localStorage.setItem(Z,JSON.stringify(e)),ae&&localStorage.setItem(ae,"true")}catch(n){console.warn("Failed to save columns to localStorage:",n)}},[Z,ae]),It=e=>{e!==N&&ze(n=>n.includes(e)?n.length===1?n:n.filter(s=>s!==e):n.length>=G?(pt("Maximum 9 column selection allowed"),n):se([...n,e]))},Ot=(e,n)=>{xe[n]!==N&&Ke(n)},Lt=()=>{Ke(null),Ne(null)},Pt=(e,n)=>{e.preventDefault(),le!==null&&le!==n&&Ne(n)},Tt=()=>{Ne(null)},_t=(e,n)=>{e.preventDefault(),le!==null&&le!==n&&xe[n]!==N&&xe[le]!==N&&ze(s=>{const a=T.arrayMove(s,le,n);return se(a)}),Ke(null),Ne(null)};i.useEffect(()=>{st(e=>{const n=W.filter(o=>e.includes(o)),s=W.filter(o=>!e.includes(o)),a=e.filter(o=>!W.includes(o));return[...n,...s,...a]})},[W]),i.useEffect(()=>{if(typeof window<"u"&&Z&&W.length>0&&ne.current)try{const e=se(W);localStorage.setItem(Z,JSON.stringify(e)),ae&&localStorage.setItem(ae,"true")}catch(e){console.warn("Failed to save columns to localStorage:",e)}},[W,Z,ae]),i.useEffect(()=>{ce&&ce(W.filter(e=>e!==N))},[W,ce]),i.useEffect(()=>{if(l.length>0&&W.length===0){if(typeof window<"u"&&j)try{if(localStorage.getItem(`dataTable_manual_change_${j}:${B}`)==="true"){const s=localStorage.getItem(`dataTable_columns_${j}:${B}`);if(s){const a=JSON.parse(s);if(Array.isArray(a)&&a.length>0){const o=a.filter(p=>l.some(u=>(u.id||u.key)===p));if(o.length>0){ne.current=!0,Fe(o.slice(0,G));return}}}}}catch(n){console.warn("Failed to load saved columns from localStorage:",n)}const e=l.map(n=>n.id||n.key);Fe(se(e.slice(0,G)))}},[l,j,B,se]);const ye=i.useMemo(()=>{const e=W.map(n=>l.find(s=>H(s)===n)).filter(Boolean);return se(e.map(H)).map(n=>l.find(s=>H(s)===n)).filter(Boolean)},[l,W]);i.useMemo(()=>ye.some(e=>e.filterable===!0),[ye]),i.useEffect(()=>{if(!oe||!ge.current)return;const e=()=>{if(ge.current){const n=ge.current.getBoundingClientRect(),s=217,a=Math.max(8,n.right-s);Rt({top:n.bottom,left:a,width:Math.max(n.width||220,220)})}};return e(),window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[oe]),i.useEffect(()=>{const e=n=>{oe&&ge.current&&!ge.current.contains(n.target)&&Xe.current&&!Xe.current.contains(n.target)&&qe(!1)};if(oe)return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[oe]),i.useEffect(()=>{oe&&(ze(W),at(new Set),ct(new Set))},[oe,W]),W.length===1?(bt=l.find(e=>(e.id||e.key)===W[0]))!=null&&bt.label:`${W.length}`;function Ht({column:e,isHeaderRow:n=!0}){const s=H(e),a=s===N,o=ut(s,e.width),[p,u]=i.useState(!1),{attributes:b,listeners:O,setNodeRef:L,transform:Ce,transition:Ye,isDragging:Le}=T.useSortable({id:s}),Kt={transform:T.CSS.Transform.toString(Ce),transition:Ye,opacity:Le?.5:1,width:o,minWidth:o};let be=!1;if(X&&S.length>0){const k=S[0][0];(k===s||k==="csat_score"&&s==="evaluation.csat_score")&&(be=!0)}else be=we===s;const Xt=Me==="asc",Gt=e.filterable===!0;if(!n)return t.jsx("th",{style:{width:o,minWidth:o,backgroundColor:"var(--primary-foreground)",borderRight:"1px solid #e6e6e6",borderBottom:"1px solid #e6e6e6",boxSizing:"border-box"},className:"sticky top-[57px] z-10 border-b border-[var(--border-strong)] px-4 py-2 text-left",children:Gt?t.jsxs("div",{className:"relative",children:[t.jsx(Filter,{size:12,className:"absolute left-2 top-1/2 -translate-y-1/2 text-[var(--text-faint)] pointer-events-none"}),t.jsx("input",{type:"text",placeholder:"Filter...",value:_[s]||"",onChange:k=>{k.stopPropagation(),$t(s,k.target.value)},onKeyDown:k=>k.stopPropagation(),onMouseDown:k=>k.stopPropagation(),className:"w-full pl-7 pr-2 py-1.5 text-xs border border-[var(--border)] rounded 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)",backgroundColor:"var(--primary-foreground)"},autoComplete:"off"})]}):t.jsx("div",{className:"h-[34px]"})});const Qe=D===s,Pe=De(_[s]),Ut=e.sortable!==!1&&(p||be),Jt=e.filterable!==!1&&!a&&(p||Qe||Pe);return t.jsxs("th",{ref:L,onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),style:{...Kt,padding:"0 12px",height:36,textAlign:a?"center":"left",fontWeight:500,fontSize:"14px",letterSpacing:"normal",textTransform:"none",color:"#0b0b0b",cursor:e.sortable!==!1?"pointer":"default",width:o,...typeof o=="string"&&o.endsWith("px")?{maxWidth:o}:{},borderRight:"1px solid #e6e6e6",boxSizing:"border-box",userSelect:"none",whiteSpace:"nowrap",wordBreak:"normal",overflowWrap:"normal",verticalAlign:"middle",background:p||Qe?"#e6e6e6":"#f2f2f0",borderBottom:"1px solid #e6e6e6",position:"sticky",top:0,zIndex:10,fontFamily:"var(--font-sans)",transition:"background 100ms ease"},children:[!a&&t.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,top:"50%",transform:"translateY(-50%)",width:1,height:16,background:"#e6e6e6",pointerEvents:"none",zIndex:1}}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px",justifyContent:a?"center":"flex-start",position:"relative",minHeight:20,minWidth:0,width:"100%",overflow:"hidden"},children:[!a&&t.jsx("div",{...b,...O,style:{cursor:"grab",color:"rgba(11, 11, 11, 0.36)",display:"inline-flex",alignItems:"center",visibility:p?"visible":"hidden",flexShrink:0},children:t.jsx(I.GripVertical,{size:14})}),t.jsx("span",{onClick:()=>e.sortable!==!1&&ft(s),title:typeof e.label=="string"?e.label:void 0,style:{cursor:e.sortable!==!1?"pointer":"default",flex:a?"none":1,minWidth:0,lineHeight:"20px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.label}),Ut&&t.jsx("button",{type:"button",onClick:k=>{k.stopPropagation(),ft(s)},title:"Sort",style:{background:"transparent",border:"none",padding:4,borderRadius:4,cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",color:be?"#0b0b0b":"rgba(11, 11, 11, 0.55)",flexShrink:0},children:be?Xt?t.jsx(I.ArrowUp,{size:14,strokeWidth:1.75}):t.jsx(I.ArrowDown,{size:14,strokeWidth:1.75}):t.jsx(I.ArrowUpDown,{size:14,strokeWidth:1.75})}),Jt&&t.jsxs("button",{type:"button",ref:k=>{E.current[s]=k},onClick:k=>{k.stopPropagation(),Dt(s,k.currentTarget)},title:"Filter",style:{position:"relative",background:Qe||Pe?"#D8D8D8":"transparent",border:"none",padding:4,borderRadius:4,cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",color:Pe?"#0b0b0b":"rgba(11, 11, 11, 0.7)",flexShrink:0},children:[t.jsx(I.ListFilter,{size:14,strokeWidth:1.75}),Pe&&t.jsx("span",{"aria-hidden":"true",style:{position:"absolute",top:0,right:0,width:6,height:6,borderRadius:"50%",background:"#0B0B0B"}})]})]}),!a&&t.jsx("span",{"aria-hidden":"true",style:{position:"absolute",right:0,top:"50%",transform:"translateY(-50%)",width:1,height:16,background:"#e6e6e6",pointerEvents:"none",zIndex:1}}),!a&&t.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":`Resize ${e.label||s} column`,title:"Drag to resize column",onMouseDown:k=>Bt(k,e,o),onClick:k=>k.stopPropagation(),onMouseEnter:k=>{k.currentTarget.style.background="rgba(30, 33, 37, 0.18)"},onMouseLeave:k=>{k.currentTarget.style.background="transparent"},style:{position:"absolute",top:0,right:-2,width:4,height:"100%",cursor:"col-resize",zIndex:4,background:"transparent"}})]})}const ht=dt?l.find(e=>H(e)===dt):null,xt=({col:e,columnId:n,isSelected:s,draggable:a,isAction:o,actualIndex:p})=>{const u=a&&le===p,b=a&&Et===p&&le!==null&&le!==p;s?lt.has(n):it.has(n);const O=s?!lt.has(n):it.has(n);return t.jsxs("div",{draggable:a,onDragStart:a?L=>Ot(L,p):void 0,onDragEnd:a?Lt:void 0,onDragOver:a?L=>Pt(L,p):void 0,onDragLeave:a?Tt:void 0,onDrop:a?L=>_t(L,p):void 0,onClick:()=>{o||It(n)},style:{display:"flex",alignItems:"center",gap:4,padding:"2px 0",cursor:o?"default":a?"grab":"pointer",opacity:u?.5:1,background:b?"#F2F2F0":"transparent",borderRadius:6},children:[t.jsx("span",{style:{width:16,height:16,display:"inline-flex",alignItems:"center",justifyContent:"center",color:"#989898",visibility:a?"visible":"hidden",flexShrink:0},children:t.jsx(I.GripVertical,{size:14,strokeWidth:1.75})}),t.jsx("span",{style:{width:20,height:20,borderRadius:4,display:"inline-flex",alignItems:"center",justifyContent:"center",background:O?"#0B0B0B":"#FFFFFF",border:`1px solid ${O?"#0B0B0B":"#676767"}`,flexShrink:0,marginLeft:8},children:O&&t.jsx(I.Check,{size:14,color:"#FFFFFF",strokeWidth:3})}),t.jsx("span",{style:{flex:1,fontFamily:"var(--font-sans)",fontSize:14,lineHeight:"20px",color:"#0B0B0B",marginLeft:8},children:e.label})]})},qt=oe?t.jsxs("div",{ref:Xe,style:{position:"fixed",top:`${ot.top}px`,left:`${ot.left}px`,width:217,maxHeight:320,zIndex:49,background:"#FFFFFF",border:"1px solid #E6E6E6",borderRadius:10,overflow:"hidden",display:"flex",flexDirection:"column",fontFamily:"var(--font-sans)",boxShadow:"0 8px 24px rgba(11, 11, 11, 0.08)"},children:[t.jsxs("div",{style:{flex:1,minHeight:0,overflowY:"auto",padding:12,display:"flex",flexDirection:"column",gap:12},children:[xe.map((e,n)=>{if(e===N)return null;const s=l.find(a=>H(a)===e);return s?t.jsx(i.Fragment,{children:xt({col:s,columnId:e,isSelected:!0,draggable:!0,isAction:!1,actualIndex:n})},`selected-${e}-${n}`):null}),l.filter(e=>{const n=H(e);return n!==N&&!xe.includes(n)}).map(e=>{const n=H(e);return t.jsx(i.Fragment,{children:xt({col:e,columnId:n,isSelected:!1,draggable:!1,isAction:!1,actualIndex:-1})},`unselected-${n}`)})]}),t.jsxs("div",{style:{flexShrink:0,borderTop:"1px solid #D9D9D9",padding:"8px 12px",background:"#FFFFFF",display:"flex",alignItems:"center",justifyContent:"space-between",height:46,boxSizing:"border-box"},children:[t.jsx("button",{type:"button",onClick:e=>{e.preventDefault(),e.stopPropagation();const n=Be.current?[...Be.current]:l.map(H).slice(0,G),s=se(n);if(ne.current=!1,ze(s),Fe(s),at(new Set),ct(new Set),typeof window<"u"&&Z)try{localStorage.removeItem(Z)}catch{}},style:{background:"transparent",border:"none",padding:0,cursor:"pointer",fontFamily:"var(--font-sans)",fontSize:14,fontWeight:500,color:"#323232"},children:"Reset"}),t.jsx("button",{type:"button",onClick:e=>{e.preventDefault(),e.stopPropagation();const n=se(xe);ne.current=!0,Fe(n),mt(n),qe(!1)},style:{background:"#2E3236",color:"#FFFFFF",border:"none",borderRadius:10,height:28,padding:"0 14px",fontFamily:"var(--font-sans)",fontSize:14,fontWeight:600,cursor:"pointer"},children:"Apply"})]})]}):null,gt=D?l.find(e=>H(e)===D):null,yt=gt?t.jsx(sn,{column:gt,columnId:D,filterType:Ct(D),position:m,popoverRef:x,distinctValues:He(D),initialValue:_[D],onApply:e=>{_e(D,e),fe(null)},onCancel:()=>fe(null)},D):null;return t.jsxs("div",{className:"w-full",children:[yt&&et.createPortal(yt,document.body),l.length>0&&(z||!ie)&&t.jsx("div",{className:"pt-2 pb-1",style:{position:"sticky",zIndex:35,backgroundColor:"var(--primary-foreground)"},children:t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:16,flexWrap:"wrap"},children:[z&&t.jsx("div",{style:{marginRight:"auto"},children:t.jsx(jt,{dateRangePicker:z.dateRangePicker,onWeekToDate:z.onWeekToDate,exportConfig:z.exportConfig,filterChipsConfig:z.filterChipsConfig,trailingActions:z.trailingActions})}),!ie&&t.jsxs("div",{style:{position:"relative"},children:[t.jsxs("button",{ref:ge,type:"button",onClick:()=>qe(!oe),style:{display:"inline-flex",alignItems:"center",gap:10,height:32,padding:"0 16px",background:"#FFFFFF",border:"1px solid #D9D9D9",borderRadius:10,cursor:"pointer",fontFamily:"var(--font-sans)",fontSize:14,fontWeight:600,color:"#2E3236",whiteSpace:"nowrap"},children:[t.jsx(I.Settings2,{size:20,strokeWidth:1.75}),"Columns"]}),oe&&et.createPortal(qt,document.body)]})]})}),Object.keys(_).length>0&&t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap",padding:"8px 0"},children:[Object.entries(_).map(([e,n])=>{const s=l.find(u=>H(u)===e);if(!s||!De(n))return null;const a=Vt(n),o=en(n),p=tn(n);return t.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:8,height:28,padding:"0 12px",borderRadius:20,border:"1px solid #B2B2B0",background:"#F2F2F0",fontFamily:"var(--font-sans)",fontSize:14,lineHeight:"20px",color:"#0B0B0B",whiteSpace:"nowrap"},children:[t.jsxs("span",{children:[t.jsxs("span",{style:{color:"#676767"},children:[s.label,": "]}),t.jsx("span",{children:a})]}),o>0&&t.jsx(nn,{count:o,values:p}),t.jsx("button",{type:"button",onClick:()=>_e(e,[]),"aria-label":`Remove ${s.label} filter`,style:{background:"transparent",border:"none",padding:0,cursor:"pointer",display:"inline-flex",color:"#676767"},children:t.jsx(I.X,{size:14,strokeWidth:2})})]},`chip-${e}`)}),t.jsx("button",{type:"button",onClick:kt,style:{marginLeft:"auto",background:"transparent",border:"none",padding:"0 4px",cursor:"pointer",fontFamily:"var(--font-sans)",fontSize:14,fontWeight:500,color:"#323232"},children:"Reset"})]}),l.length>0&&ye.length>0?t.jsxs(T.DndContext,{sensors:Nt,collisionDetection:T.closestCenter,onDragStart:At,onDragEnd:Wt,children:[t.jsxs("div",{style:{borderRadius:8,border:"1px solid #E6E6E6",overflow:"hidden",background:"var(--primary-foreground)",position:"relative",top:"0.5rem"},children:[q&&t.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:t.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"12px"},children:[t.jsx("p",{style:{fontSize:"13px",color:"rgba(30, 33, 37, 0.6)",margin:0},children:"Loading..."}),t.jsx(an,{src:"/BrandLoading.gif",alt:"Loading",width:50,height:50,unoptimized:!0,className:"mt-1"})]})}),t.jsx("div",{className:"overflow-x-auto custom-thin-scrollbar-hidden",ref:zt,style:{maxHeight:"500px",overflowY:"auto",position:"relative",zIndex:1},children:t.jsxs("table",{style:{width:"auto",minWidth:"100%",tableLayout:"fixed",borderCollapse:"collapse",fontSize:"13px",fontFamily:"var(--font-sans)",border:"1px solid #e6e6e6",boxSizing:"border-box"},children:[t.jsx("thead",{children:t.jsx("tr",{children:t.jsx(T.SortableContext,{items:W,strategy:T.horizontalListSortingStrategy,children:ye.map(e=>t.jsx(Ht,{column:e,isHeaderRow:!0},`header-${H(e)}`))})})}),t.jsx("tbody",{children:!q&&Oe.length===0?t.jsx("tr",{children:t.jsx("td",{colSpan:ye.length,style:{padding:"32px",textAlign:"center",color:"rgba(30, 33, 37, 0.42)",fontSize:"12px",fontFamily:"var(--font-sans)"},children:"No results found"})}):!q&&Oe.length>0?Oe.map((e,n)=>t.jsx("tr",{"data-row-id":e.id||n,style:{borderBottom:"1px solid #e6e6e6",cursor:f?"pointer":"default",transition:"background 0.15s ease"},onClick:f?s=>{s.stopPropagation(),f(e,n)}:void 0,onMouseEnter:s=>{s.currentTarget.style.background="#E6E6E6"},onMouseLeave:s=>{s.currentTarget.style.background="transparent"},children:ye.map(s=>{const a=H(s),o=ut(a,s.width),p=e[a],u=s.render?s.render(p,e):p,b=o&&o!=="auto",O=typeof u=="string"&&u.trim()!=="",L=b&&O,Ce=L?t.jsx(ee,{content:u,children:u}):u;return t.jsx("td",{style:{padding:"10px 14px",color:"rgba(30, 33, 37, 0.78)",fontSize:"13px",borderRight:"1px solid #e6e6e6",boxSizing:"border-box",width:o,fontFamily:"var(--font-sans)",...L&&{maxWidth:o||"200px"}},children:Ce},a)})},n)):null})]})})]}),t.jsx(T.DragOverlay,{children:ht?t.jsx("div",{className:"bg-[var(--paper-high)] border border-[var(--border-strong)] rounded px-4 py-2 shadow-lg",children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(I.GripVertical,{size:14,className:"text-[var(--text-faint)]"}),t.jsx("span",{className:"text-sm font-semibold text-[var(--text-ink)]",children:ht.label})]})}):null})]}):null,(()=>{const e=!P&&(ve.trim()!==""||Object.values(_).some(s=>De(s))),n=U?e?ke.length:v:ke.length;return n<=0?null:t.jsx(Ft.Pagination,{page:Q,pageSizeOptions:[5,10,20,50,100],pageSize:te,totalCount:n,currentDataLength:Oe.length,onPageChange:me,onPageSizeChange:s=>{Se(s),me(1)},showPageSizeSelector:!0})})()]})}exports.DataTable2=cn;exports.DataTableFilters=jt;
|
|
1
|
+
"use strict";const t=require("react/jsx-runtime"),i=require("react"),_=require("./sortable.esm.cjs.js"),I=require("lucide-react"),it=require("react-dom"),Ct=require("./CustomFilterChips.cjs.js");require("motion/react");require("recharts");require("./AgentLiftAnalysisCard.cjs.js");require("./TourGuideTooltip.cjs.js");function Dt({dateRangePicker:r,onWeekToDate:l,exportConfig:u,filterChipsConfig:p,trailingActions:S}){const[b,c]=i.useState(!1),y=i.useRef(null),M=i.useRef(null);i.useEffect(()=>{const j=v=>{M.current&&!M.current.contains(v.target)&&y.current&&!y.current.contains(v.target)&&c(!1)};if(b)return document.addEventListener("mousedown",j),()=>{document.removeEventListener("mousedown",j)}},[b]);const F=()=>{c(j=>!j)},k=j=>{c(!1),u!=null&&u.onExport&&u.onExport(j)},O=(()=>{if(!(p!=null&&p.filters))return!1;const j=p.filters,v=p.customFilters||[],z=Object.entries(j).some(([R,E])=>!!(Array.isArray(E)&&E.length||typeof E=="string"&&E.trim()!==""||E&&typeof E=="object"&&(E.min!=null||E.max!=null))),P=v.some(R=>R.active);return z||P})();return t.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[l&&t.jsxs("button",{onClick:l,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:[t.jsx(I.CalendarClock,{size:16}),t.jsx("span",{children:"Week to Date"})]}),r&&t.jsx(i.Suspense,{fallback:t.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:[t.jsx(I.CalendarClock,{size:16}),t.jsx("span",{children:"Loading..."})]}),children:r}),u&&t.jsxs("div",{className:"relative",children:[t.jsxs("button",{ref:y,onClick:F,disabled:u.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:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(I.Download,{size:16}),t.jsx("span",{children:u.isExporting?"Exporting...":"Export"})]}),t.jsx(I.ChevronDown,{size:16})]}),b&&t.jsx("div",{ref:M,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:(u.types||["csv"]).map(j=>t.jsxs("button",{onClick:()=>k(j),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 ",j.toUpperCase()]},j))})]}),(O||S)&&t.jsxs(t.Fragment,{children:[O&&t.jsx("div",{className:"h-9 mt-1 w-px bg-gray-300 flex-shrink-0"}),t.jsxs("div",{className:"flex items-center gap-3 justify-end",children:[O&&p&&t.jsx(Ct.CustomFilterChips,{filters:p.filters,onChange:p.onChange,onClear:p.onClear,customFilters:p.customFilters||[],fieldOptions:p.fieldOptions||{}}),S&&t.jsx("div",{className:"flex-shrink-0",children:S})]})]})]})}function at(r){if(r==null)return NaN;const l=String(r).replace(/[,$%]|pp/gi,"").trim(),u=parseFloat(l);return Number.isFinite(u)?u:NaN}function Qt(r){if(r==null)return NaN;const l=String(r).trim(),u=l.match(/^(\d+):(\d+)(?::(\d+))?$/);if(u){const F=+u[1],k=+u[2],D=u[3]!=null?+u[3]:null;return D!=null?F*3600+k*60+D:F*60+k}let p=0,S=!1;const b=l.match(/(\d+)\s*d\b/i),c=l.match(/(\d+)\s*h\b/i),y=l.match(/(\d+)\s*m(?!s)\b/i),M=l.match(/(\d+)\s*s\b/i);return b&&(p+=+b[1]*86400,S=!0),c&&(p+=+c[1]*3600,S=!0),y&&(p+=+y[1]*60,S=!0),M&&(p+=+M[1],S=!0),S?p:NaN}function Yt(r){if(!r)return null;const l=String(r).trim(),u=l.match(/^(\d{1,2})\/(\d{1,2})\/(\d{2,4})$/);if(u){const S=u[3].length===2?2e3+ +u[3]:+u[3],b=new Date(S,+u[1]-1,+u[2]);return isNaN(b.getTime())?null:b}const p=new Date(l);return isNaN(p.getTime())?null:p}function Zt(r){if(!r||r.length===0)return"text";const l=r.slice(0,25),u=p=>l.every(p);return u(p=>/^\d{1,2}\/\d{1,2}\/\d{2,4}$/.test(p)||/^\d{4}-\d{2}-\d{2}/.test(p))?"date":u(p=>/^\d+\s*[dhms]\b/i.test(p)||/^\d+:\d+(:\d+)?$/.test(p))?"duration":u(p=>/^-?[\d,.]+(%|pp)?$/i.test(p))?"number":"text"}function Oe(r){return r?Array.isArray(r)?r.length>0:r.type==="range"?r.min!==""&&r.min!==void 0&&r.min!==null||r.max!==""&&r.max!==void 0&&r.max!==null:r.type==="durationRange"?r.minSec!==""&&r.minSec!=null||r.maxSec!==""&&r.maxSec!=null:r.type==="scoreRange"?Array.isArray(r.values)&&r.values.length>0||r.min!==""&&r.min!=null||r.max!==""&&r.max!=null:r.type==="dateRange"?!!(r.from||r.to):!1:!1}function Ft(r){if(r==null||r===""||isNaN(r))return"";const l=Number(r),u=Math.floor(l/3600),p=Math.floor(l%3600/60),S=Math.floor(l%60);return u>0?`${u}h ${p}m`:p>0?`${p}m ${S}s`:`${S}s`}function Vt(r){if(!r)return"";if(Array.isArray(r))return r.length===0?"":String(r[0]);if(r.type==="range"){const l=r.min!==""&&r.min!=null?r.min:null,u=r.max!==""&&r.max!=null?r.max:null;return l!=null&&u!=null?`${l} – ${u}`:l!=null?`≥ ${l}`:u!=null?`≤ ${u}`:""}if(r.type==="durationRange"){const l=r.minSec!==""&&r.minSec!=null?Ft(r.minSec):null,u=r.maxSec!==""&&r.maxSec!=null?Ft(r.maxSec):null;return l&&u?`${l} – ${u}`:l?`≥ ${l}`:u?`≤ ${u}`:""}if(r.type==="scoreRange"){if(Array.isArray(r.values)&&r.values.length>0)return r.values.slice().sort((p,S)=>p-S).join(", ");const l=r.min!==""&&r.min!=null?r.min:null,u=r.max!==""&&r.max!=null?r.max:null;return l!=null&&u!=null?`${l} – ${u}`:l!=null?`≥ ${l}`:u!=null?`≤ ${u}`:""}return r.type==="dateRange"?r.from&&r.to?`${r.from} – ${r.to}`:r.from?`from ${r.from}`:r.to?`to ${r.to}`:"":""}function en(r){return Array.isArray(r)?Math.max(0,r.length-1):0}function tn(r){return Array.isArray(r)?r.slice(1).map(String).join(", "):""}function nn({count:r,values:l}){const[u,p]=i.useState(!1);return t.jsxs("span",{onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),style:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",height:22,minWidth:22,padding:"0 6px",background:"#D8D8D8",color:"#0B0B0B",borderRadius:14,fontSize:12,fontWeight:500,lineHeight:1,cursor:"pointer"},children:["+",r,u&&t.jsx("span",{role:"tooltip",style:{position:"absolute",bottom:"calc(100% + 6px)",left:"50%",transform:"translateX(-50%)",background:"#1E2125",color:"#FFFFFF",fontFamily:"var(--font-sans)",fontSize:12,fontWeight:400,lineHeight:"20px",padding:"6px 10px",borderRadius:8,whiteSpace:"nowrap",pointerEvents:"none",zIndex:100,boxShadow:"0 6px 16px rgba(11, 11, 11, 0.18)"},children:l})]})}function rn({leftLabel:r,rightLabel:l,leftValue:u,rightValue:p,onLeftChange:S,onRightChange:b,type:c="number",placeholderLeft:y="Min",placeholderRight:M="Max"}){const F={width:"100%",height:32,borderRadius:8,border:"1px solid #D9D9D9",background:"#FFFFFF",padding:"0 10px",fontFamily:"var(--font-sans)",fontSize:14,color:"#0B0B0B",outline:"none",boxSizing:"border-box"},k={fontSize:12,color:"#676767",marginBottom:4,fontFamily:"var(--font-sans)"};return t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:10},children:[t.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[t.jsx("span",{style:k,children:r}),t.jsx("input",{type:c,value:u,onChange:D=>S(D.target.value),placeholder:y,style:F})]}),t.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[t.jsx("span",{style:k,children:l}),t.jsx("input",{type:c,value:p,onChange:D=>b(D.target.value),placeholder:M,style:F})]})]})}const jt=[{id:"0-60",label:"0 to 60 Sec",minSec:0,maxSec:60},{id:"60-120",label:"1m to 2 m",minSec:60,maxSec:120},{id:"120-180",label:"2m to 3 m",minSec:120,maxSec:180},{id:"180-240",label:"3m to 4m",minSec:180,maxSec:240},{id:"240-300",label:"4m to 5m",minSec:240,maxSec:300},{id:"300+",label:"5 mins and above",minSec:300,maxSec:null}];function kt(r){if(r==null||r==="")return null;const l=String(r).trim().match(/^(\d{1,3}):(\d{2})$/);if(l)return Number(l[1])*60+Number(l[2]);const u=Number(r);return Number.isFinite(u)?u:null}function st({children:r}){return t.jsx("div",{style:{fontSize:14,fontWeight:600,color:"#0B0B0B",lineHeight:"20px",padding:"4px 0 2px",fontFamily:"var(--font-sans)"},children:r})}function ot({minValue:r,maxValue:l,onMinChange:u,onMaxChange:p,inputType:S="number",inputMode:b="decimal",step:c,placeholder:y="0.0",unit:M}){const F={width:"100%",height:30,border:"1px solid #ACADAD",borderRadius:4,padding:"6px 10px",fontSize:13,color:"#0B0B0B",fontFamily:"var(--font-sans)",outline:"none",boxSizing:"border-box"};return t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[t.jsxs("div",{style:{display:"flex",alignItems:"flex-end",gap:8},children:[t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6,flex:1,minWidth:0},children:[t.jsx("span",{style:{fontSize:12,color:"#2E3236",fontFamily:"var(--font-sans)"},children:"Min From"}),t.jsx("input",{type:S,inputMode:b,step:c,placeholder:y,value:r,onChange:k=>u(k.target.value),style:F})]}),t.jsx("span",{style:{fontSize:12,fontWeight:600,color:"#323232",paddingBottom:8,fontFamily:"var(--font-sans)"},children:"to"}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6,flex:1,minWidth:0},children:[t.jsx("span",{style:{fontSize:12,color:"#2E3236",fontFamily:"var(--font-sans)"},children:"Max"}),t.jsx("input",{type:S,inputMode:b,step:c,placeholder:y,value:l,onChange:k=>p(k.target.value),style:F})]})]}),M&&t.jsxs("span",{style:{fontSize:11,color:"#676767",fontFamily:"var(--font-sans)"},children:["Enter durations in ",M==="sec"?"seconds":M]})]})}function sn({column:r,columnId:l,filterType:u="text",position:p,popoverRef:S,distinctValues:b,initialValue:c,onApply:y,onCancel:M,onSearch:F=null,searchMinChars:k=3}){const D=u==="text",O=u==="number",j=u==="date",v=u==="duration",z=u==="score",P=/duration/i.test(String((r==null?void 0:r.label)||l||"")),R=i.useMemo(()=>{if(!z||!Array.isArray(b)||b.length===0)return!1;let m=1/0,h=-1/0;for(const x of b){const w=at(x);Number.isFinite(w)&&(w<m&&(m=w),w>h&&(h=w))}return Number.isFinite(m)&&Number.isFinite(h)&&m>=0&&h<=5},[z,b]),[E,ie]=i.useState(()=>D?new Set(Array.isArray(c)?c:[]):new Set),[fe,G]=i.useState(""),[W,ne]=i.useState(()=>O&&(c==null?void 0:c.type)==="range"&&c.min!=null?c.min:""),[Q,H]=i.useState(()=>O&&(c==null?void 0:c.type)==="range"&&c.max!=null?c.max:""),[q,pe]=i.useState(new Set),[Y,V]=i.useState(()=>v&&(c==null?void 0:c.type)==="durationRange"&&c.minSec!=null&&c.minSec!==""?String(c.minSec):""),[me,ee]=i.useState(()=>v&&(c==null?void 0:c.type)==="durationRange"&&c.maxSec!=null&&c.maxSec!==""?String(c.maxSec):""),[ae,ye]=i.useState(()=>z&&(c==null?void 0:c.type)==="scoreRange"&&Array.isArray(c.values)?new Set(c.values):new Set),[ke,U]=i.useState(()=>z&&(c==null?void 0:c.type)==="scoreRange"&&c.min!=null&&c.min!==""?String(c.min):""),[B,re]=i.useState(()=>z&&(c==null?void 0:c.type)==="scoreRange"&&c.max!=null&&c.max!==""?String(c.max):""),[te,le]=i.useState(()=>j&&(c==null?void 0:c.type)==="dateRange"&&c.from||""),[K,be]=i.useState(()=>j&&(c==null?void 0:c.type)==="dateRange"&&c.to||"");i.useEffect(()=>{D&&ie(new Set(Array.isArray(c)?c:[]))},[l,D]);const[Se,Ce]=i.useState(null),[N,ce]=i.useState(!1),xe=i.useRef(0),Z=fe.trim(),ge=D&&typeof F=="function"&&Z.length>=k;i.useEffect(()=>{if(!D||typeof F!="function")return;if(Z.length<k){Ce(null),ce(!1);return}const m=++xe.current;ce(!0);const h=setTimeout(async()=>{try{const x=await F(Z);if(m!==xe.current)return;const w=Array.isArray(x)?x.map(A=>A&&typeof A=="object"?A.label??A.value:A).filter(A=>A!=null&&A!=="").map(String):[];Ce(w)}catch{m===xe.current&&Ce([])}finally{m===xe.current&&ce(!1)}},300);return()=>clearTimeout(h)},[D,F,Z,k]);const he=i.useMemo(()=>{const m=Z.toLowerCase(),h=ge?Se||[]:m?b.filter(w=>String(w).toLowerCase().includes(m)):b,x=new Map;for(const w of h)x.set(String(w),w);for(const w of E)x.set(String(w),w);return Array.from(x.values()).sort((w,A)=>{const de=E.has(w),ze=E.has(A);return de!==ze?de?-1:1:String(w).localeCompare(String(A))})},[b,Z,E,ge,Se]),De=m=>{ie(h=>{const x=new Set(h);return x.has(m)?x.delete(m):x.add(m),x})},Je=()=>{D&&ie(new Set),O&&(ne(""),H("")),v&&(pe(new Set),V(""),ee("")),z&&(ye(new Set),U(""),re("")),j&&(le(""),be("")),G("")},Re=m=>{pe(h=>{const x=new Set(h);return x.has(m)?x.delete(m):x.add(m),x})},Ee=m=>{ye(h=>{const x=new Set(h);return x.has(m)?x.delete(m):x.add(m),x})},Me=()=>{if(D)return y(Array.from(E));if(O)return y({type:"range",min:W===""?"":Number(W),max:Q===""?"":Number(Q)});if(v){const m=kt(Y),h=kt(me),x=m!=null||h!=null;let w="",A="";if(x)w=m??"",A=h??"";else if(q.size>0){const de=jt.filter(J=>q.has(J.id));w=Math.min(...de.map(J=>J.minSec)),A=de.some(J=>J.maxSec==null)?"":Math.max(...de.map(J=>J.maxSec))}return y({type:"durationRange",minSec:w,maxSec:A})}if(z){const m=ke===""?null:Number(ke),h=B===""?null:Number(B);return m!=null||h!=null?y({type:"scoreRange",values:[],min:m!=null&&Number.isFinite(m)?m:"",max:h!=null&&Number.isFinite(h)?h:""}):y({type:"scoreRange",values:Array.from(ae).sort((w,A)=>w-A),min:"",max:""})}if(j)return y({type:"dateRange",from:te,to:K})};return t.jsxs("div",{ref:S,role:"dialog","aria-label":`Filter ${r.label||l}`,style:{position:"fixed",top:p.top,left:p.left,zIndex:50,width:D?240:220,background:"#FFFFFF",border:"1px solid #E6E6E6",borderRadius:10,padding:12,display:"flex",flexDirection:"column",gap:10,boxShadow:"0 8px 24px rgba(11, 11, 11, 0.10)",fontFamily:"var(--font-sans)"},children:[D&&t.jsxs(t.Fragment,{children:[t.jsx("div",{style:{background:"#D8D8D8",height:32,borderRadius:10,padding:1,display:"flex",alignItems:"center"},children:t.jsxs("div",{style:{background:"#FFFFFF",flex:1,height:30,borderRadius:10,display:"flex",alignItems:"center",gap:8,padding:"0 8px"},children:[t.jsx(I.Search,{size:16,color:"#989898",strokeWidth:2}),t.jsx("input",{autoFocus:!0,type:"text",value:fe,onChange:m=>G(m.target.value),placeholder:"Search",style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:14,color:"#0B0B0B",minWidth:0,fontFamily:"var(--font-sans)"}})]})}),t.jsx("div",{style:{maxHeight:220,overflowY:"auto",display:"flex",flexDirection:"column",gap:4},children:typeof F=="function"&&Z.length>0&&Z.length<k?t.jsx("div",{style:{fontSize:13,color:"#676767",padding:"8px 4px",textAlign:"center"},children:`Type at least ${k} characters to search`}):N?t.jsx("div",{style:{fontSize:13,color:"#676767",padding:"8px 4px",textAlign:"center"},children:"Searching…"}):he.length===0?t.jsx("div",{style:{fontSize:13,color:"#676767",padding:"8px 4px",textAlign:"center"},children:"No values"}):he.map(m=>{const h=E.has(m);return t.jsxs("label",{style:{display:"flex",alignItems:"center",gap:12,padding:"6px 4px",cursor:"pointer",borderRadius:6},children:[t.jsx("span",{style:{width:20,height:20,borderRadius:4,display:"inline-flex",alignItems:"center",justifyContent:"center",background:h?"#0B0B0B":"#FFFFFF",border:`1px solid ${h?"#0B0B0B":"#676767"}`,flexShrink:0},children:h&&t.jsx(I.Check,{size:14,color:"#FFFFFF",strokeWidth:3})}),t.jsx("input",{type:"checkbox",checked:h,onChange:()=>De(m),style:{position:"absolute",opacity:0,pointerEvents:"none"},tabIndex:-1}),t.jsx("span",{onClick:x=>{x.preventDefault(),De(m)},style:{fontSize:14,lineHeight:"20px",color:"#0B0B0B",flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:m})]},m)})})]}),O&&t.jsxs(t.Fragment,{children:[t.jsx(st,{children:r.label||"Filter"}),t.jsx(ot,{minValue:W,maxValue:Q,onMinChange:ne,onMaxChange:H,placeholder:P?"00":"0.0",unit:P?"sec":void 0})]}),v&&t.jsxs(t.Fragment,{children:[t.jsx(st,{children:r.label||"Duration"}),r.filterShowPresets===!0&&t.jsxs(t.Fragment,{children:[t.jsx("div",{style:{display:"flex",flexDirection:"column",gap:12},children:jt.map(m=>{const h=q.has(m.id);return t.jsxs("div",{role:"checkbox","aria-checked":h,tabIndex:0,onClick:()=>Re(m.id),onKeyDown:x=>{(x.key===" "||x.key==="Enter")&&(x.preventDefault(),Re(m.id))},style:{display:"flex",alignItems:"center",gap:12,cursor:"pointer",userSelect:"none"},children:[t.jsx("span",{style:{width:20,height:20,borderRadius:4,display:"inline-flex",alignItems:"center",justifyContent:"center",background:h?"#0B0B0B":"#FFFFFF",border:`1px solid ${h?"#0B0B0B":"#676767"}`,flexShrink:0},children:h&&t.jsx(I.Check,{size:14,color:"#FFFFFF",strokeWidth:3})}),t.jsx("span",{style:{fontSize:14,lineHeight:"20px",color:"#0B0B0B",fontFamily:"var(--font-sans)"},children:m.label})]},m.id)})}),t.jsx("div",{style:{height:1,background:"#D9D9D9",margin:"0 -12px"}}),t.jsx("div",{style:{fontSize:14,fontWeight:500,color:"#0B0B0B",lineHeight:"20px",padding:"4px 0",fontFamily:"var(--font-sans)"},children:"Custom Range"})]}),t.jsx(ot,{minValue:Y,maxValue:me,onMinChange:V,onMaxChange:ee,inputType:"number",inputMode:"numeric",placeholder:"00",unit:"sec"})]}),z&&t.jsxs(t.Fragment,{children:[t.jsx(st,{children:r.label||"Score"}),R&&r.filterShowPresets===!0&&t.jsxs(t.Fragment,{children:[t.jsx("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[1,2,3,4,5].map(m=>{const h=ae.has(m);return t.jsxs("div",{role:"checkbox","aria-checked":h,tabIndex:0,onClick:()=>Ee(m),onKeyDown:x=>{(x.key===" "||x.key==="Enter")&&(x.preventDefault(),Ee(m))},style:{display:"flex",alignItems:"center",gap:12,cursor:"pointer",userSelect:"none"},children:[t.jsx("span",{style:{width:20,height:20,borderRadius:4,display:"inline-flex",alignItems:"center",justifyContent:"center",background:h?"#0B0B0B":"#FFFFFF",border:`1px solid ${h?"#0B0B0B":"#676767"}`,flexShrink:0},children:h&&t.jsx(I.Check,{size:14,color:"#FFFFFF",strokeWidth:3})}),t.jsx("span",{style:{fontSize:14,lineHeight:"20px",color:"#0B0B0B",fontFamily:"var(--font-sans)"},children:m})]},m)})}),t.jsx("div",{style:{height:1,background:"#D9D9D9",margin:"0 -12px"}})]}),R&&r.filterShowPresets===!0&&t.jsx("div",{style:{fontSize:14,fontWeight:500,color:"#0B0B0B",lineHeight:"20px",padding:"4px 0",fontFamily:"var(--font-sans)"},children:"Custom Range"}),t.jsx(ot,{minValue:ke,maxValue:B,onMinChange:U,onMaxChange:re,step:"0.1"})]}),j&&t.jsx(rn,{leftLabel:"From",rightLabel:"To",leftValue:te,rightValue:K,onLeftChange:le,onRightChange:be,type:"date",placeholderLeft:"",placeholderRight:""}),t.jsx("div",{style:{height:1,background:"#D9D9D9",margin:"0 -12px"}}),t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[t.jsx("button",{type:"button",onClick:Je,style:{background:"transparent",border:"none",padding:0,cursor:"pointer",fontSize:14,fontWeight:500,color:"#323232",fontFamily:"var(--font-sans)"},children:v&&r.filterShowPresets===!0||z&&R&&r.filterShowPresets===!0?"View All":"Reset"}),t.jsx("button",{type:"button",onClick:Me,style:{background:"#0B0B0B",color:"#FFFFFF",border:"none",borderRadius:10,height:28,padding:"0 14px",fontSize:14,fontWeight:500,cursor:"pointer",fontFamily:"var(--font-sans)"},children:"Apply"})]})]})}const on=()=>({userData:{email:"anonymous"}}),an=r=>t.jsx("img",{...r});function ln({children:r,content:l,direction:u="top",align:p="center",styling:S,indicatorColor:b}){const c=typeof l=="string"?l:l!=null?String(l):"",y=typeof b=="string"&&(b.startsWith("#")||b.startsWith("rgb")||b.startsWith("hsl")||b.startsWith("var("))?b:"var(--Grey-Strong, #2E3236)",[M,F]=i.useState(!1),[k,D]=i.useState(!1),[O,j]=i.useState({top:0,left:0,arrowLeft:0,placement:"top"}),v=i.useRef(null),z=i.useRef(null);if(!c)return r;i.useEffect(()=>{D(!0)},[]);const P=i.useCallback(()=>{if(!v.current||!z.current||typeof window>"u")return;const R=v.current.getBoundingClientRect(),E=z.current.getBoundingClientRect(),ie=window.innerWidth,fe=window.innerHeight,G=8,W=10,ne=E.width,Q=E.height,H=R.top,q=fe-R.bottom,pe=u==="bottom"?"bottom":"top";let Y=pe;pe==="top"&&H<Q+W+G&&q>H?Y="bottom":pe==="bottom"&&q<Q+W+G&&H>q&&(Y="top");let V=R.left+R.width/2;p==="start"&&(V=R.left),p==="end"&&(V=R.right);let me=Y==="top"?R.top-Q-W:R.bottom+W,ee=p==="start"?V:p==="end"?V-ne:V-ne/2;me=Math.max(G,Math.min(me,fe-Q-G)),ee=Math.max(G,Math.min(ee,ie-ne-G));const ae=Math.max(10,Math.min(V-ee,ne-10));j({top:me,left:ee,arrowLeft:ae,placement:Y})},[p,u]);return i.useEffect(()=>{if(!M||!k)return;P();const R=()=>P();return window.addEventListener("resize",R),window.addEventListener("scroll",R,!0),()=>{window.removeEventListener("resize",R),window.removeEventListener("scroll",R,!0)}},[M,k,P]),t.jsxs("span",{ref:v,style:{display:"block",width:"100%"},onMouseEnter:()=>F(!0),onMouseLeave:()=>F(!1),children:[r,M&&k&&it.createPortal(t.jsxs("span",{ref:z,style:{position:"fixed",top:`${O.top}px`,left:`${O.left}px`,background:"var(--Grey-Strong, #2E3236)",color:"var(--Grey-White, #FFF)",fontSize:"12px",lineHeight:1.3,fontWeight:500,padding:"8px 10px",borderRadius:"6px",whiteSpace:"normal",maxWidth:"320px",width:"max-content",boxShadow:"0 6px 18px rgba(0, 0, 0, 0.2)",zIndex:99999,pointerEvents:"none",...typeof S=="object"?S:{}},children:[c,t.jsx("span",{style:{position:"absolute",left:`${O.arrowLeft}px`,transform:"translateX(-50%)",width:0,height:0,borderLeft:"6px solid transparent",borderRight:"6px solid transparent",...O.placement==="top"?{top:"100%",borderTop:`7px solid ${y}`}:{bottom:"100%",borderBottom:`7px solid ${y}`}}})]}),document.body)]})}function cn({data:r=[],columns:l=[],initialPageSize:u=10,onRowClick:p,totalCount:S=null,page:b=null,pageSize:c=null,onPageChange:y=null,onPageSizeChange:M=null,onFilterChange:F=null,columnFilters:k=null,onMaxColumnsError:D=null,onSort:O=null,sortFields:j=[],tableId:v=null,isLoading:z=!1,filtersConfig:P=null,columnResizeMinWidth:R=120,columnResizeMaxWidth:E=280,onVisibleColumnsChange:ie=null,hideColumnPicker:fe=!1}){var wt;const{userData:G}=on(),W=(G==null?void 0:G.email)||"anonymous",ne=i.memo(({children:e,content:n,className:s=""})=>{const a=i.useRef(null),[o,f]=i.useState(!1);i.useEffect(()=>{const g=()=>{if(a.current){const T=a.current.scrollWidth>a.current.clientWidth;f(T)}};g();const L=setTimeout(g,0);return window.addEventListener("resize",g),()=>{clearTimeout(L),window.removeEventListener("resize",g)}},[e,n]);const d=t.jsx("span",{className:`truncate block ${s}`,ref:a,children:e});return o&&n?t.jsx(ln,{content:n,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:d}):d});ne.displayName="TruncatedCell";const Q=S!==null&&y!==null,H=F!==null,q=O!==null,[pe,Y]=i.useState(1),[V,me]=i.useState(u),ee=b!==null?b:pe,ae=c!==null?c:V,ye=e=>{y?y(e):Y(e)},ke=e=>{M?M(e):me(e)},U=50,B="action",re=i.useRef(!1),te=i.useMemo(()=>v?`dataTable_columns_${v}:${W}`:`dataTable_columns_${l.map(n=>n.id||n.key).sort().join("_")}:${W}`,[v,l,W]),le=i.useMemo(()=>v?`dataTable_manual_change_${v}:${W}`:null,[v,W]);i.useCallback((e,n)=>{if(typeof window>"u"||!e||!n||n.length===0)return null;try{const s=localStorage.getItem(e);if(s){const o=JSON.parse(s).filter(f=>n.some(d=>(d.id||d.key)===f));if(o.length>0)return o}}catch(s){console.warn("Failed to load saved columns from localStorage:",s)}return null},[]);const[K,be]=i.useState({}),[Se,Ce]=i.useState(""),[N,ce]=i.useState(null),[xe,Z]=i.useState({top:0,left:0}),ge=i.useRef(null),he=i.useRef({}),[De,Je]=i.useState(null),[Re,Ee]=i.useState("asc"),Me=i.useCallback((e,n)=>{const s=Oe(n);be(a=>{const o={...a};return s?o[e]=n:delete o[e],o}),y?y(1):Y(1),H&&F&&F(s?{...K,[e]:n}:Object.fromEntries(Object.entries(K).filter(([a])=>a!==e)))},[K,F,H,y]),m=i.useCallback(()=>{be({}),Ce(""),y?y(1):Y(1),H&&F&&F({})},[F,H,y]),h=i.useCallback(e=>{const n=l.find(o=>(o.id||o.key)===e);if(n&&Array.isArray(n.filterOptions)){const o=new Set,f=[];for(const d of n.filterOptions){if(d==null||d==="")continue;const g=typeof d=="object"?JSON.stringify(d):String(d);o.has(g)||(o.add(g),f.push(g))}return f.sort((d,g)=>d.localeCompare(g))}if(!r||r.length===0)return[];const s=new Set,a=[];for(const o of r){const f=o[e];if(f==null)continue;const d=typeof f=="object"?JSON.stringify(f):String(f);s.has(d)||(s.add(d),a.push(d))}return a.sort((o,f)=>o.localeCompare(f))},[r,l]),x=i.useCallback(e=>{const n=l.find(s=>X(s)===e);return n&&n.filterType?n.filterType:Zt(h(e))},[l,h]),w=i.useCallback(e=>{const a=typeof window<"u"?window.innerWidth:1/0;let o=e.left;return o+280>a-8&&(o=Math.max(8,e.right-280)),{top:e.bottom+6,left:o}},[]),A=i.useCallback((e,n)=>{if(!n){ce(e);return}const s=n.getBoundingClientRect();Z(w(s)),ce(a=>a===e?null:e)},[w]);i.useEffect(()=>{if(!N)return;const e=n=>{if(ge.current&&ge.current.contains(n.target))return;const s=he.current[N];s&&s.contains(n.target)||Object.values(he.current).some(o=>o&&o.contains(n.target))||ce(null)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[N]),i.useEffect(()=>{if(!N)return;const e=()=>{const n=he.current[N];if(!n)return;const s=n.getBoundingClientRect();Z(w(s))};return window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[N,w]),i.useLayoutEffect(()=>{if(!N)return;const e=ge.current,n=he.current[N];if(!e||!n)return;const s=e.offsetWidth,a=n.getBoundingClientRect(),o=8,f=typeof window<"u"?window.innerWidth:1/0;if(!(a.left+s>f-o))return;const g=Math.max(o,a.right-s);Z(L=>L.left===g?L:{...L,left:g})},[N,xe.top]);const de=i.useCallback(e=>!e||typeof e!="object"?{}:Object.fromEntries(Object.entries(e).filter(([,n])=>n==null?!1:typeof n=="string"?n.trim()!=="":!0)),[]),ze=i.useCallback((e,n)=>{const s=Object.keys(e||{}),a=Object.keys(n||{});return s.length!==a.length?!1:s.every(o=>e[o]===n[o])},[]);i.useEffect(()=>{if(!H||k===null)return;const e=de(k);be(n=>ze(n,e)?n:e)},[H,k,de,ze]),i.useCallback((e,n)=>e==="csat_score"&&n==="evaluation.csat_score"?n:e,[]);const J=q&&j.length>0?j[0][0]:De,Ie=q&&j.length>0?j[0][1]:Re,[dn,lt]=i.useState(()=>l.map(e=>e.id||e.key)),se=i.useCallback(e=>{if(!e||e.length===0)return e;let n=Array.from(new Set(e));n.length>U&&(n=n.slice(0,U));const a=l.map(d=>d.id||d.key).includes(B);return!n.includes(B)&&a&&(n.length>=U?n=[...n.slice(0,U-1),B]:n=[...n,B]),[...n.filter(d=>d!==B),B]},[l]),[$,Be]=i.useState(()=>{if(typeof window<"u"&&v)try{if(localStorage.getItem(`dataTable_manual_change_${v}:${W}`)==="true"){const a=localStorage.getItem(`dataTable_columns_${v}:${W}`);if(a){const o=JSON.parse(a);if(Array.isArray(o)&&o.length>0){re.current=!0;const f=o.filter(d=>l.some(g=>(g.id||g.key)===d));if(f.length>0)return f.slice(0,U)}}}}catch(s){console.warn("Failed to load saved columns from localStorage:",s)}const n=l.map(s=>s.id||s.key).slice(0,U);return se(n)}),[oe,Qe]=i.useState(!1),[ve,Le]=i.useState([]),[ct,Rt]=i.useState({top:0,left:0,width:0}),[dt,ut]=i.useState(new Set),[ft,pt]=i.useState(new Set),Te=i.useRef(null);Te.current===null&&(Te.current=[...$]);const[ue,Ye]=i.useState(null),[Et,Pe]=i.useState(null),we=i.useRef(null),Ze=i.useRef(null),Ve=i.useRef(null),[mt,et]=i.useState(null),[tt,Mt]=i.useState({}),zt=i.useRef(null),He=i.useRef(null),X=e=>e.id||e.key,_e=i.useCallback(e=>{if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"){const n=e.trim();if(n.endsWith("px")){const a=parseFloat(n);return Number.isFinite(a)?a:null}const s=parseFloat(n);return Number.isFinite(s)&&`${s}`===n?s:null}return null},[]),ht=i.useCallback((e,n)=>tt[e]!=null?`${tt[e]}px`:typeof n=="number"?`${n}px`:n||"auto",[tt]),qe=i.useCallback(e=>{if(!He.current)return;const{columnId:n,startX:s,startWidth:a,minWidth:o,maxWidth:f}=He.current,d=e.clientX-s,g=Math.round(a+d),L=Math.min(f,Math.max(o,g));Mt(T=>({...T,[n]:L}))},[]),Ne=i.useCallback(()=>{He.current=null,document.body.style.cursor="",document.body.style.userSelect="",document.removeEventListener("mousemove",qe),document.removeEventListener("mouseup",Ne)},[qe]),Bt=i.useCallback((e,n,s)=>{var Ge;e.preventDefault(),e.stopPropagation();const a=n.id||n.key,o=_e(n.minWidth)??R,f=_e(n.maxWidth)??E,d=Math.min(o,f),g=Math.max(o,f),L=((Ge=e.currentTarget.closest("th"))==null?void 0:Ge.getBoundingClientRect().width)||0,T=_e(s),$e=T??Math.max(d,Math.round(L)||d),nt=Math.min(g,Math.max(d,$e));He.current={columnId:a,startX:e.clientX,startWidth:nt,minWidth:d,maxWidth:g},document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",qe),document.addEventListener("mouseup",Ne)},[E,R,qe,Ne,_e]);i.useEffect(()=>()=>Ne(),[Ne]);const Nt=_.useSensors(_.useSensor(_.PointerSensor),_.useSensor(_.KeyboardSensor,{coordinateGetter:_.sortableKeyboardCoordinates})),Wt=e=>{const{active:n,over:s}=e;if(s&&n.id!==s.id){if(n.id===B||s.id===B){gt("Cannot drop columns on the Action column"),et(null);return}re.current=!0,Be(a=>{const o=a.indexOf(n.id),f=a.indexOf(s.id);if(o!==-1&&f!==-1){const d=_.arrayMove(a,o,f),g=se(d);return yt(g),g}return a}),lt(a=>{const o=a.indexOf(n.id),f=a.indexOf(s.id);return _.arrayMove(a,o,f)})}et(null)},At=e=>{et(e.active.id)},Ke=i.useMemo(()=>{if(H)return r||[];if(!r||r.length===0)return[];const e=Se.trim().toLowerCase(),n=Object.entries(K).filter(([,s])=>Oe(s));return r.filter(s=>{for(const[a,o]of n){const f=s[a];if(f==null)return!1;if(Array.isArray(o)){const d=String(f);if(!o.some(g=>String(g)===d))return!1;continue}if(o.type==="range"){const d=at(f);if(isNaN(d)||o.min!==""&&o.min!=null&&d<Number(o.min)||o.max!==""&&o.max!=null&&d>Number(o.max))return!1;continue}if(o.type==="durationRange"){const d=Qt(f);if(isNaN(d)||o.minSec!==""&&o.minSec!=null&&d<Number(o.minSec)||o.maxSec!==""&&o.maxSec!=null&&d>Number(o.maxSec))return!1;continue}if(o.type==="scoreRange"){const d=at(f);if(isNaN(d))return!1;if(Array.isArray(o.values)&&o.values.length>0){const g=Math.floor(d);if(!o.values.includes(g))return!1;continue}if(o.min!==""&&o.min!=null&&d<Number(o.min)||o.max!==""&&o.max!=null&&d>Number(o.max))return!1;continue}if(o.type==="dateRange"){const d=Yt(f);if(!d)return!1;if(o.from){const g=new Date(o.from+"T00:00:00");if(d<g)return!1}if(o.to){const g=new Date(o.to+"T23:59:59");if(d>g)return!1}continue}}return!(e&&!Object.values(s).some(o=>o==null?!1:String(o).toLowerCase().includes(e)))})},[r,K,Se,H]),We=i.useMemo(()=>q||!J?Ke:[...Ke].sort((e,n)=>{const s=e[J],a=n[J];if(s==null)return 1;if(a==null)return-1;if(typeof s=="number"&&typeof a=="number")return Ie==="asc"?s-a:a-s;const o=String(s).toLowerCase(),f=String(a).toLowerCase();return Ie==="asc"?o.localeCompare(f):f.localeCompare(o)}),[Ke,J,Ie,q]),Xe=i.useMemo(()=>{if(Q)return We;{const e=(ee-1)*ae,n=e+ae;return We.slice(e,n)}},[We,ee,ae,Q]),xt=e=>{q&&O?(O(e),y?y(1):Y(1)):(De===e?Ee(Re==="asc"?"desc":"asc"):(Je(e),Ee("asc")),ye(1))},$t=(e,n)=>{const s=(n||"").split(/\s+/).map(a=>a.trim()).filter(Boolean);Me(e,s)},gt=e=>{Ve.current||(typeof D=="function"&&D(e),Ve.current=setTimeout(()=>{Ve.current=null},3e3))},yt=i.useCallback(e=>{if(typeof window<"u"&&te&&e.length>0&&re.current)try{localStorage.setItem(te,JSON.stringify(e)),le&&localStorage.setItem(le,"true")}catch(n){console.warn("Failed to save columns to localStorage:",n)}},[te,le]),Ot=e=>{e!==B&&Le(n=>n.includes(e)?n.length===1?n:n.filter(s=>s!==e):n.length>=U?(gt("Maximum 9 column selection allowed"),n):se([...n,e]))},It=(e,n)=>{ve[n]!==B&&Ye(n)},Lt=()=>{Ye(null),Pe(null)},Tt=(e,n)=>{e.preventDefault(),ue!==null&&ue!==n&&Pe(n)},Pt=()=>{Pe(null)},Ht=(e,n)=>{e.preventDefault(),ue!==null&&ue!==n&&ve[n]!==B&&ve[ue]!==B&&Le(s=>{const a=_.arrayMove(s,ue,n);return se(a)}),Ye(null),Pe(null)};i.useEffect(()=>{lt(e=>{const n=$.filter(o=>e.includes(o)),s=$.filter(o=>!e.includes(o)),a=e.filter(o=>!$.includes(o));return[...n,...s,...a]})},[$]),i.useEffect(()=>{if(typeof window<"u"&&te&&$.length>0&&re.current)try{const e=se($);localStorage.setItem(te,JSON.stringify(e)),le&&localStorage.setItem(le,"true")}catch(e){console.warn("Failed to save columns to localStorage:",e)}},[$,te,le]),i.useEffect(()=>{ie&&ie($.filter(e=>e!==B))},[$,ie]),i.useEffect(()=>{if(l.length>0&&$.length===0){if(typeof window<"u"&&v)try{if(localStorage.getItem(`dataTable_manual_change_${v}:${W}`)==="true"){const s=localStorage.getItem(`dataTable_columns_${v}:${W}`);if(s){const a=JSON.parse(s);if(Array.isArray(a)&&a.length>0){const o=a.filter(f=>l.some(d=>(d.id||d.key)===f));if(o.length>0){re.current=!0,Be(o.slice(0,U));return}}}}}catch(n){console.warn("Failed to load saved columns from localStorage:",n)}const e=l.map(n=>n.id||n.key);Be(se(e.slice(0,U)))}},[l,v,W,se]);const Fe=i.useMemo(()=>{const e=$.map(n=>l.find(s=>X(s)===n)).filter(Boolean);return se(e.map(X)).map(n=>l.find(s=>X(s)===n)).filter(Boolean)},[l,$]);i.useMemo(()=>Fe.some(e=>e.filterable===!0),[Fe]),i.useEffect(()=>{if(!oe||!we.current)return;const e=()=>{if(we.current){const n=we.current.getBoundingClientRect(),s=217,a=Math.max(8,n.right-s);Rt({top:n.bottom,left:a,width:Math.max(n.width||220,220)})}};return e(),window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[oe]),i.useEffect(()=>{const e=n=>{oe&&we.current&&!we.current.contains(n.target)&&Ze.current&&!Ze.current.contains(n.target)&&Qe(!1)};if(oe)return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[oe]),i.useEffect(()=>{oe&&(Le($),ut(new Set),pt(new Set))},[oe,$]),$.length===1?(wt=l.find(e=>(e.id||e.key)===$[0]))!=null&&wt.label:`${$.length}`;function _t({column:e,isHeaderRow:n=!0}){const s=X(e),a=s===B,o=ht(s,e.width),[f,d]=i.useState(!1),{attributes:g,listeners:L,setNodeRef:T,transform:$e,transition:nt,isDragging:Ge}=_.useSortable({id:s}),Kt={transform:_.CSS.Transform.toString($e),transition:nt,opacity:Ge?.5:1,width:o,minWidth:o};let je=!1;if(q&&j.length>0){const C=j[0][0];(C===s||C==="csat_score"&&s==="evaluation.csat_score")&&(je=!0)}else je=J===s;const Xt=Ie==="asc",Gt=e.filterable===!0;if(!n)return t.jsx("th",{style:{width:o,minWidth:o,backgroundColor:"var(--primary-foreground)",borderRight:"1px solid #e6e6e6",borderBottom:"1px solid #e6e6e6",boxSizing:"border-box"},className:"sticky top-[57px] z-10 border-b border-[var(--border-strong)] px-4 py-2 text-left",children:Gt?t.jsxs("div",{className:"relative",children:[t.jsx(Filter,{size:12,className:"absolute left-2 top-1/2 -translate-y-1/2 text-[var(--text-faint)] pointer-events-none"}),t.jsx("input",{type:"text",placeholder:"Filter...",value:K[s]||"",onChange:C=>{C.stopPropagation(),$t(s,C.target.value)},onKeyDown:C=>C.stopPropagation(),onMouseDown:C=>C.stopPropagation(),className:"w-full pl-7 pr-2 py-1.5 text-xs border border-[var(--border)] rounded 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)",backgroundColor:"var(--primary-foreground)"},autoComplete:"off"})]}):t.jsx("div",{className:"h-[34px]"})});const rt=N===s,Ue=Oe(K[s]),Ut=e.sortable!==!1&&(f||je),Jt=e.filterable!==!1&&!a&&(f||rt||Ue);return t.jsxs("th",{ref:T,onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),style:{...Kt,padding:"0 12px",height:36,textAlign:a?"center":"left",fontWeight:500,fontSize:"14px",letterSpacing:"normal",textTransform:"none",color:"#0b0b0b",cursor:e.sortable!==!1?"pointer":"default",width:o,...typeof o=="string"&&o.endsWith("px")?{maxWidth:o}:{},borderRight:"1px solid #e6e6e6",boxSizing:"border-box",userSelect:"none",whiteSpace:"nowrap",wordBreak:"normal",overflowWrap:"normal",verticalAlign:"middle",background:f||rt?"#e6e6e6":"#f2f2f0",borderBottom:"1px solid #e6e6e6",position:"sticky",top:0,zIndex:10,fontFamily:"var(--font-sans)",transition:"background 100ms ease"},children:[!a&&t.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,top:"50%",transform:"translateY(-50%)",width:1,height:16,background:"#e6e6e6",pointerEvents:"none",zIndex:1}}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px",justifyContent:a?"center":"flex-start",position:"relative",minHeight:20,minWidth:0,width:"100%",overflow:"hidden"},children:[!a&&t.jsx("div",{...g,...L,style:{cursor:"grab",color:"rgba(11, 11, 11, 0.36)",display:"inline-flex",alignItems:"center",visibility:f?"visible":"hidden",flexShrink:0},children:t.jsx(I.GripVertical,{size:14})}),t.jsx("span",{onClick:()=>e.sortable!==!1&&xt(s),title:typeof e.label=="string"?e.label:void 0,style:{cursor:e.sortable!==!1?"pointer":"default",flex:a?"none":1,minWidth:0,lineHeight:"20px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.label}),Ut&&t.jsx("button",{type:"button",onClick:C=>{C.stopPropagation(),xt(s)},title:"Sort",style:{background:"transparent",border:"none",padding:4,borderRadius:4,cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",color:je?"#0b0b0b":"rgba(11, 11, 11, 0.55)",flexShrink:0},children:je?Xt?t.jsx(I.ArrowUp,{size:14,strokeWidth:1.75}):t.jsx(I.ArrowDown,{size:14,strokeWidth:1.75}):t.jsx(I.ArrowUpDown,{size:14,strokeWidth:1.75})}),Jt&&t.jsxs("button",{type:"button",ref:C=>{he.current[s]=C},onClick:C=>{C.stopPropagation(),A(s,C.currentTarget)},title:"Filter",style:{position:"relative",background:rt||Ue?"#D8D8D8":"transparent",border:"none",padding:4,borderRadius:4,cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",color:Ue?"#0b0b0b":"rgba(11, 11, 11, 0.7)",flexShrink:0},children:[t.jsx(I.ListFilter,{size:14,strokeWidth:1.75}),Ue&&t.jsx("span",{"aria-hidden":"true",style:{position:"absolute",top:0,right:0,width:6,height:6,borderRadius:"50%",background:"#0B0B0B"}})]})]}),!a&&t.jsx("span",{"aria-hidden":"true",style:{position:"absolute",right:0,top:"50%",transform:"translateY(-50%)",width:1,height:16,background:"#e6e6e6",pointerEvents:"none",zIndex:1}}),!a&&t.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":`Resize ${e.label||s} column`,title:"Drag to resize column",onMouseDown:C=>Bt(C,e,o),onClick:C=>C.stopPropagation(),onMouseEnter:C=>{C.currentTarget.style.background="rgba(30, 33, 37, 0.18)"},onMouseLeave:C=>{C.currentTarget.style.background="transparent"},style:{position:"absolute",top:0,right:-2,width:4,height:"100%",cursor:"col-resize",zIndex:4,background:"transparent"}})]})}const bt=mt?l.find(e=>X(e)===mt):null,St=({col:e,columnId:n,isSelected:s,draggable:a,isAction:o,actualIndex:f})=>{const d=a&&ue===f,g=a&&Et===f&&ue!==null&&ue!==f;s?ft.has(n):dt.has(n);const L=s?!ft.has(n):dt.has(n);return t.jsxs("div",{draggable:a,onDragStart:a?T=>It(T,f):void 0,onDragEnd:a?Lt:void 0,onDragOver:a?T=>Tt(T,f):void 0,onDragLeave:a?Pt:void 0,onDrop:a?T=>Ht(T,f):void 0,onClick:()=>{o||Ot(n)},style:{display:"flex",alignItems:"center",gap:4,padding:"2px 0",cursor:o?"default":a?"grab":"pointer",opacity:d?.5:1,background:g?"#F2F2F0":"transparent",borderRadius:6},children:[t.jsx("span",{style:{width:16,height:16,display:"inline-flex",alignItems:"center",justifyContent:"center",color:"#989898",visibility:a?"visible":"hidden",flexShrink:0},children:t.jsx(I.GripVertical,{size:14,strokeWidth:1.75})}),t.jsx("span",{style:{width:20,height:20,borderRadius:4,display:"inline-flex",alignItems:"center",justifyContent:"center",background:L?"#0B0B0B":"#FFFFFF",border:`1px solid ${L?"#0B0B0B":"#676767"}`,flexShrink:0,marginLeft:8},children:L&&t.jsx(I.Check,{size:14,color:"#FFFFFF",strokeWidth:3})}),t.jsx("span",{style:{flex:1,fontFamily:"var(--font-sans)",fontSize:14,lineHeight:"20px",color:"#0B0B0B",marginLeft:8},children:e.label})]})},qt=oe?t.jsxs("div",{ref:Ze,style:{position:"fixed",top:`${ct.top}px`,left:`${ct.left}px`,width:217,maxHeight:320,zIndex:49,background:"#FFFFFF",border:"1px solid #E6E6E6",borderRadius:10,overflow:"hidden",display:"flex",flexDirection:"column",fontFamily:"var(--font-sans)",boxShadow:"0 8px 24px rgba(11, 11, 11, 0.08)"},children:[t.jsxs("div",{style:{flex:1,minHeight:0,overflowY:"auto",padding:12,display:"flex",flexDirection:"column",gap:12},children:[ve.map((e,n)=>{if(e===B)return null;const s=l.find(a=>X(a)===e);return s?t.jsx(i.Fragment,{children:St({col:s,columnId:e,isSelected:!0,draggable:!0,isAction:!1,actualIndex:n})},`selected-${e}-${n}`):null}),l.filter(e=>{const n=X(e);return n!==B&&!ve.includes(n)}).map(e=>{const n=X(e);return t.jsx(i.Fragment,{children:St({col:e,columnId:n,isSelected:!1,draggable:!1,isAction:!1,actualIndex:-1})},`unselected-${n}`)})]}),t.jsxs("div",{style:{flexShrink:0,borderTop:"1px solid #D9D9D9",padding:"8px 12px",background:"#FFFFFF",display:"flex",alignItems:"center",justifyContent:"space-between",height:46,boxSizing:"border-box"},children:[t.jsx("button",{type:"button",onClick:e=>{e.preventDefault(),e.stopPropagation();const n=Te.current?[...Te.current]:l.map(X).slice(0,U),s=se(n);if(re.current=!1,Le(s),Be(s),ut(new Set),pt(new Set),typeof window<"u"&&te)try{localStorage.removeItem(te)}catch{}},style:{background:"transparent",border:"none",padding:0,cursor:"pointer",fontFamily:"var(--font-sans)",fontSize:14,fontWeight:500,color:"#323232"},children:"Reset"}),t.jsx("button",{type:"button",onClick:e=>{e.preventDefault(),e.stopPropagation();const n=se(ve);re.current=!0,Be(n),yt(n),Qe(!1)},style:{background:"#2E3236",color:"#FFFFFF",border:"none",borderRadius:10,height:28,padding:"0 14px",fontFamily:"var(--font-sans)",fontSize:14,fontWeight:600,cursor:"pointer"},children:"Apply"})]})]}):null,Ae=N?l.find(e=>X(e)===N):null,vt=Ae?t.jsx(sn,{column:Ae,columnId:N,filterType:x(N),position:xe,popoverRef:ge,distinctValues:h(N),initialValue:K[N],onSearch:typeof Ae.onFilterSearch=="function"?Ae.onFilterSearch:null,searchMinChars:Ae.filterSearchMinChars??3,onApply:e=>{Me(N,e),ce(null)},onCancel:()=>ce(null)},N):null;return t.jsxs("div",{className:"w-full",children:[vt&&it.createPortal(vt,document.body),l.length>0&&(P||!fe)&&t.jsx("div",{className:"pt-2 pb-1",style:{position:"sticky",zIndex:35,backgroundColor:"var(--primary-foreground)"},children:t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:16,flexWrap:"wrap"},children:[P&&t.jsx("div",{style:{marginRight:"auto"},children:t.jsx(Dt,{dateRangePicker:P.dateRangePicker,onWeekToDate:P.onWeekToDate,exportConfig:P.exportConfig,filterChipsConfig:P.filterChipsConfig,trailingActions:P.trailingActions})}),!fe&&t.jsxs("div",{style:{position:"relative"},children:[t.jsxs("button",{ref:we,type:"button",onClick:()=>Qe(!oe),style:{display:"inline-flex",alignItems:"center",gap:10,height:32,padding:"0 16px",background:"#FFFFFF",border:"1px solid #D9D9D9",borderRadius:10,cursor:"pointer",fontFamily:"var(--font-sans)",fontSize:14,fontWeight:600,color:"#2E3236",whiteSpace:"nowrap"},children:[t.jsx(I.Settings2,{size:20,strokeWidth:1.75}),"Columns"]}),oe&&it.createPortal(qt,document.body)]})]})}),Object.keys(K).length>0&&t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap",padding:"8px 0"},children:[Object.entries(K).map(([e,n])=>{const s=l.find(d=>X(d)===e);if(!s||!Oe(n))return null;const a=Vt(n),o=en(n),f=tn(n);return t.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:8,height:28,padding:"0 12px",borderRadius:20,border:"1px solid #B2B2B0",background:"#F2F2F0",fontFamily:"var(--font-sans)",fontSize:14,lineHeight:"20px",color:"#0B0B0B",whiteSpace:"nowrap"},children:[t.jsxs("span",{children:[t.jsxs("span",{style:{color:"#676767"},children:[s.label,": "]}),t.jsx("span",{children:a})]}),o>0&&t.jsx(nn,{count:o,values:f}),t.jsx("button",{type:"button",onClick:()=>Me(e,[]),"aria-label":`Remove ${s.label} filter`,style:{background:"transparent",border:"none",padding:0,cursor:"pointer",display:"inline-flex",color:"#676767"},children:t.jsx(I.X,{size:14,strokeWidth:2})})]},`chip-${e}`)}),t.jsx("button",{type:"button",onClick:m,style:{marginLeft:"auto",background:"transparent",border:"none",padding:"0 4px",cursor:"pointer",fontFamily:"var(--font-sans)",fontSize:14,fontWeight:500,color:"#323232"},children:"Reset"})]}),l.length>0&&Fe.length>0?t.jsxs(_.DndContext,{sensors:Nt,collisionDetection:_.closestCenter,onDragStart:At,onDragEnd:Wt,children:[t.jsxs("div",{style:{borderRadius:8,border:"1px solid #E6E6E6",overflow:"hidden",background:"var(--primary-foreground)",position:"relative",top:"0.5rem",...z?{minHeight:320}:{}},children:[z&&t.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:t.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"12px"},children:[t.jsx("p",{style:{fontSize:"13px",color:"rgba(30, 33, 37, 0.6)",margin:0},children:"Loading..."}),t.jsx(an,{src:"/BrandLoading.gif",alt:"Loading",width:50,height:50,unoptimized:!0,className:"mt-1"})]})}),t.jsx("div",{className:"overflow-x-auto custom-thin-scrollbar-hidden",ref:zt,style:{maxHeight:"500px",overflowY:"auto",position:"relative",zIndex:1},children:t.jsxs("table",{style:{width:"auto",minWidth:"100%",tableLayout:"fixed",borderCollapse:"collapse",fontSize:"13px",fontFamily:"var(--font-sans)",border:"1px solid #e6e6e6",boxSizing:"border-box"},children:[t.jsx("thead",{children:t.jsx("tr",{children:t.jsx(_.SortableContext,{items:$,strategy:_.horizontalListSortingStrategy,children:Fe.map(e=>t.jsx(_t,{column:e,isHeaderRow:!0},`header-${X(e)}`))})})}),t.jsx("tbody",{children:!z&&Xe.length===0?t.jsx("tr",{children:t.jsx("td",{colSpan:Fe.length,style:{padding:"32px",textAlign:"center",color:"rgba(30, 33, 37, 0.42)",fontSize:"12px",fontFamily:"var(--font-sans)"},children:"No results found"})}):!z&&Xe.length>0?Xe.map((e,n)=>t.jsx("tr",{"data-row-id":e.id||n,style:{borderBottom:"1px solid #e6e6e6",cursor:p?"pointer":"default",transition:"background 0.15s ease"},onClick:p?s=>{s.stopPropagation(),p(e,n)}:void 0,onMouseEnter:s=>{s.currentTarget.style.background="#E6E6E6"},onMouseLeave:s=>{s.currentTarget.style.background="transparent"},children:Fe.map(s=>{const a=X(s),o=ht(a,s.width),f=e[a],d=s.render?s.render(f,e):f,g=o&&o!=="auto",L=typeof d=="string"&&d.trim()!=="",T=g&&L,$e=T?t.jsx(ne,{content:d,children:d}):d;return t.jsx("td",{style:{padding:"10px 14px",color:"rgba(30, 33, 37, 0.78)",fontSize:"13px",borderRight:"1px solid #e6e6e6",boxSizing:"border-box",width:o,fontFamily:"var(--font-sans)",...T&&{maxWidth:o||"200px"}},children:$e},a)})},n)):null})]})})]}),t.jsx(_.DragOverlay,{children:bt?t.jsx("div",{className:"bg-[var(--paper-high)] border border-[var(--border-strong)] rounded px-4 py-2 shadow-lg",children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(I.GripVertical,{size:14,className:"text-[var(--text-faint)]"}),t.jsx("span",{className:"text-sm font-semibold text-[var(--text-ink)]",children:bt.label})]})}):null})]}):null,(()=>{const e=!H&&(Se.trim()!==""||Object.values(K).some(s=>Oe(s))),n=Q?e?We.length:S:We.length;return n<=0?null:t.jsx(Ct.Pagination,{page:ee,pageSizeOptions:[5,10,20,50,100],pageSize:ae,totalCount:n,currentDataLength:Xe.length,onPageChange:ye,onPageSizeChange:s=>{ke(s),ye(1)},showPageSizeSelector:!0})})()]})}exports.DataTable2=cn;exports.DataTableFilters=Dt;
|
|
2
2
|
//# sourceMappingURL=DataTable2.cjs.js.map
|