orbcafe-ui 1.4.5 → 1.4.6

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/index.js CHANGED
@@ -1,4 +1,4 @@
1
- 'use strict';var ogl=require('ogl'),Qt=require('react'),jsxRuntime=require('react/jsx-runtime'),navigation=require('next/navigation'),lucideReact=require('lucide-react'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),reactSlot=require('@radix-ui/react-slot'),classVarianceAuthority=require('class-variance-authority'),Jp=require('@mui/material/Dialog'),em=require('@mui/material/DialogTitle'),tm=require('@mui/material/DialogContent'),ob=require('@mui/material/DialogContentText'),om=require('@mui/material/DialogActions'),Ri=require('@mui/material/Box'),nb=require('@mui/icons-material/CheckCircle'),ib=require('@mui/icons-material/Warning'),lb=require('@mui/icons-material/Error'),sb=require('@mui/icons-material/Info'),material=require('@mui/material'),styles=require('@mui/material/styles'),Cb=require('@mui/icons-material/Clear'),Sb=require('@mui/icons-material/Close'),Bu=require('@mui/icons-material/Search'),F0=require('@mui/material/Paper'),L0=require('@mui/material/Table'),N0=require('@mui/material/TableBody'),vc=require('@mui/material/TableCell'),nm=require('@mui/material/TableContainer'),Yb=require('@mui/material/TableHead'),Qb=require('@mui/material/TableRow'),rm=require('@mui/material/TextField'),Kl=require('@mui/material/Button'),am=require('@mui/material/Alert'),core=require('@dnd-kit/core'),modifiers=require('@dnd-kit/modifiers'),zb=require('@mui/icons-material/ViewColumn'),jp=require('@mui/icons-material/Save'),Vb=require('@mui/icons-material/Download'),Wb=require('@mui/icons-material/AccountTree'),Hb=require('@mui/icons-material/Functions'),$b=require('@mui/icons-material/Insights'),Ju=require('@mui/icons-material/Add'),Ub=require('@mui/icons-material/Edit'),_b=require('@mui/icons-material/Delete'),Kb=require('@mui/icons-material/KeyboardArrowLeft'),ch=require('@mui/icons-material/KeyboardArrowRight'),Jb=require('@mui/material/Checkbox'),ey=require('@mui/material/TableSortLabel'),ty=require('@mui/material/IconButton'),oy=require('@mui/material/Tooltip'),ry=require('@mui/icons-material/UnfoldMore'),ay=require('@mui/icons-material/UnfoldLess'),sortable=require('@dnd-kit/sortable'),gy=require('@mui/icons-material/KeyboardArrowDown'),Ry=require('@mui/icons-material/Check'),Zu=require('@mui/icons-material/ClearAll'),Yu=require('@mui/icons-material/ArrowUpward'),Qu=require('@mui/icons-material/ArrowDownward'),My=require('@mui/icons-material/VisibilityOff'),By=require('@mui/icons-material/DeleteOutline'),fx=require('@mui/icons-material/MicNoneOutlined'),hx=require('@mui/icons-material/SettingsOutlined'),bx=require('@mui/icons-material/SendOutlined'),p0=require('@mui/icons-material/Settings'),m0=require('@mui/icons-material/KeyboardArrowUp'),f0=require('@mui/icons-material/ArrowRightAlt'),Ox=require('@mui/icons-material/Star'),DateCalendar=require('@mui/x-date-pickers/DateCalendar'),PickersDay=require('@mui/x-date-pickers/PickersDay'),LocalizationProvider=require('@mui/x-date-pickers/LocalizationProvider'),AdapterDayjs=require('@mui/x-date-pickers/AdapterDayjs'),Yx=require('@mui/icons-material/CalendarMonth'),Jx=require('@mui/icons-material/ArrowForward'),zr=require('dayjs'),e0=require('dayjs/plugin/isBetween'),t0=require('dayjs/plugin/localizedFormat'),o0=require('dayjs/plugin/customParseFormat');require('dayjs/locale/zh-cn'),require('dayjs/locale/fr'),require('dayjs/locale/de'),require('dayjs/locale/ja'),require('dayjs/locale/ko');var M0=require('@mui/icons-material/StarBorder'),D0=require('@mui/icons-material/ViewQuilt'),Qv=require('@mui/icons-material/CloseOutlined'),Q0=require('@mui/icons-material/ContentCopyOutlined'),J0=require('@mui/icons-material/CheckOutlined'),Rv=require('@mui/icons-material/ExpandMore'),VC=require('@mui/icons-material/AddRounded'),Vm=require('@mui/icons-material/Language'),WC=require('@mui/icons-material/DesktopWindows'),HC=require('@mui/icons-material/DarkMode'),$C=require('@mui/icons-material/LightMode'),UC=require('@mui/icons-material/Logout'),mS=require('@mui/icons-material/DragIndicator'),AS=require('@mui/icons-material/FilterList'),BS=require('@mui/icons-material/TableRows'),yS=require('@mui/icons-material/LayersClear'),Dk=require('@mui/icons-material/CameraAltRounded'),Ak=require('@mui/icons-material/QrCodeScannerRounded'),Lk=require('@mui/icons-material/DragIndicatorRounded'),Vk=require('@mui/icons-material/BackspaceRounded'),Wk=require('@mui/icons-material/CloseRounded'),Hk=require('@mui/icons-material/CheckRounded'),ow=require('@mui/icons-material/SearchRounded'),rw=require('@mui/icons-material/MenuOpenRounded'),aw=require('@mui/icons-material/MenuRounded'),nw=require('@mui/icons-material/ExpandMoreRounded'),iw=require('@mui/icons-material/ChevronRightRounded'),Lw=require('next/dynamic'),framerMotion=require('framer-motion'),q1=require('react-markdown'),j1=require('remark-gfm'),X1=require('remark-math'),Z1=require('rehype-katex'),Y1=require('rehype-raw'),reactSyntaxHighlighter=require('react-syntax-highlighter'),prism=require('react-syntax-highlighter/dist/esm/styles/prism'),nextThemes=require('next-themes'),vf=require('mermaid'),sT=require('@mui/icons-material/MicRounded'),cT=require('@mui/icons-material/MicOffRounded'),iconsMaterial=require('@mui/icons-material'),gT=require('@mui/icons-material/SendRounded'),hT=require('@mui/icons-material/HardwareRounded'),XT=require('@mui/icons-material/LockOutlined'),oh=require('@mui/icons-material/MailOutline'),rh=require('@mui/icons-material/PersonOutline'),ZT=require('@mui/icons-material/VpnKeyOutlined'),mI=require('dayjs/plugin/isoWeek'),AI=require('@mui/icons-material/KeyboardDoubleArrowLeftOutlined'),BI=require('@mui/icons-material/KeyboardDoubleArrowRightOutlined'),EI=require('@mui/icons-material/SplitscreenOutlined'),FI=require('@mui/icons-material/Sort');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var Qt__namespace=/*#__PURE__*/_interopNamespace(Qt);var Jp__default=/*#__PURE__*/_interopDefault(Jp);var em__default=/*#__PURE__*/_interopDefault(em);var tm__default=/*#__PURE__*/_interopDefault(tm);var ob__default=/*#__PURE__*/_interopDefault(ob);var om__default=/*#__PURE__*/_interopDefault(om);var Ri__default=/*#__PURE__*/_interopDefault(Ri);var nb__default=/*#__PURE__*/_interopDefault(nb);var ib__default=/*#__PURE__*/_interopDefault(ib);var lb__default=/*#__PURE__*/_interopDefault(lb);var sb__default=/*#__PURE__*/_interopDefault(sb);var Cb__default=/*#__PURE__*/_interopDefault(Cb);var Sb__default=/*#__PURE__*/_interopDefault(Sb);var Bu__default=/*#__PURE__*/_interopDefault(Bu);var F0__default=/*#__PURE__*/_interopDefault(F0);var L0__default=/*#__PURE__*/_interopDefault(L0);var N0__default=/*#__PURE__*/_interopDefault(N0);var vc__default=/*#__PURE__*/_interopDefault(vc);var nm__default=/*#__PURE__*/_interopDefault(nm);var Yb__default=/*#__PURE__*/_interopDefault(Yb);var Qb__default=/*#__PURE__*/_interopDefault(Qb);var rm__default=/*#__PURE__*/_interopDefault(rm);var Kl__default=/*#__PURE__*/_interopDefault(Kl);var am__default=/*#__PURE__*/_interopDefault(am);var zb__default=/*#__PURE__*/_interopDefault(zb);var jp__default=/*#__PURE__*/_interopDefault(jp);var Vb__default=/*#__PURE__*/_interopDefault(Vb);var Wb__default=/*#__PURE__*/_interopDefault(Wb);var Hb__default=/*#__PURE__*/_interopDefault(Hb);var $b__default=/*#__PURE__*/_interopDefault($b);var Ju__default=/*#__PURE__*/_interopDefault(Ju);var Ub__default=/*#__PURE__*/_interopDefault(Ub);var _b__default=/*#__PURE__*/_interopDefault(_b);var Kb__default=/*#__PURE__*/_interopDefault(Kb);var ch__default=/*#__PURE__*/_interopDefault(ch);var Jb__default=/*#__PURE__*/_interopDefault(Jb);var ey__default=/*#__PURE__*/_interopDefault(ey);var ty__default=/*#__PURE__*/_interopDefault(ty);var oy__default=/*#__PURE__*/_interopDefault(oy);var ry__default=/*#__PURE__*/_interopDefault(ry);var ay__default=/*#__PURE__*/_interopDefault(ay);var gy__default=/*#__PURE__*/_interopDefault(gy);var Ry__default=/*#__PURE__*/_interopDefault(Ry);var Zu__default=/*#__PURE__*/_interopDefault(Zu);var Yu__default=/*#__PURE__*/_interopDefault(Yu);var Qu__default=/*#__PURE__*/_interopDefault(Qu);var My__default=/*#__PURE__*/_interopDefault(My);var By__default=/*#__PURE__*/_interopDefault(By);var fx__default=/*#__PURE__*/_interopDefault(fx);var hx__default=/*#__PURE__*/_interopDefault(hx);var bx__default=/*#__PURE__*/_interopDefault(bx);var p0__default=/*#__PURE__*/_interopDefault(p0);var m0__default=/*#__PURE__*/_interopDefault(m0);var f0__default=/*#__PURE__*/_interopDefault(f0);var Ox__default=/*#__PURE__*/_interopDefault(Ox);var Yx__default=/*#__PURE__*/_interopDefault(Yx);var Jx__default=/*#__PURE__*/_interopDefault(Jx);var zr__default=/*#__PURE__*/_interopDefault(zr);var e0__default=/*#__PURE__*/_interopDefault(e0);var t0__default=/*#__PURE__*/_interopDefault(t0);var o0__default=/*#__PURE__*/_interopDefault(o0);var M0__default=/*#__PURE__*/_interopDefault(M0);var D0__default=/*#__PURE__*/_interopDefault(D0);var Qv__default=/*#__PURE__*/_interopDefault(Qv);var Q0__default=/*#__PURE__*/_interopDefault(Q0);var J0__default=/*#__PURE__*/_interopDefault(J0);var Rv__default=/*#__PURE__*/_interopDefault(Rv);var VC__default=/*#__PURE__*/_interopDefault(VC);var Vm__default=/*#__PURE__*/_interopDefault(Vm);var WC__default=/*#__PURE__*/_interopDefault(WC);var HC__default=/*#__PURE__*/_interopDefault(HC);var $C__default=/*#__PURE__*/_interopDefault($C);var UC__default=/*#__PURE__*/_interopDefault(UC);var mS__default=/*#__PURE__*/_interopDefault(mS);var AS__default=/*#__PURE__*/_interopDefault(AS);var BS__default=/*#__PURE__*/_interopDefault(BS);var yS__default=/*#__PURE__*/_interopDefault(yS);var Dk__default=/*#__PURE__*/_interopDefault(Dk);var Ak__default=/*#__PURE__*/_interopDefault(Ak);var Lk__default=/*#__PURE__*/_interopDefault(Lk);var Vk__default=/*#__PURE__*/_interopDefault(Vk);var Wk__default=/*#__PURE__*/_interopDefault(Wk);var Hk__default=/*#__PURE__*/_interopDefault(Hk);var ow__default=/*#__PURE__*/_interopDefault(ow);var rw__default=/*#__PURE__*/_interopDefault(rw);var aw__default=/*#__PURE__*/_interopDefault(aw);var nw__default=/*#__PURE__*/_interopDefault(nw);var iw__default=/*#__PURE__*/_interopDefault(iw);var Lw__default=/*#__PURE__*/_interopDefault(Lw);var q1__default=/*#__PURE__*/_interopDefault(q1);var j1__default=/*#__PURE__*/_interopDefault(j1);var X1__default=/*#__PURE__*/_interopDefault(X1);var Z1__default=/*#__PURE__*/_interopDefault(Z1);var Y1__default=/*#__PURE__*/_interopDefault(Y1);var vf__default=/*#__PURE__*/_interopDefault(vf);var sT__default=/*#__PURE__*/_interopDefault(sT);var cT__default=/*#__PURE__*/_interopDefault(cT);var gT__default=/*#__PURE__*/_interopDefault(gT);var hT__default=/*#__PURE__*/_interopDefault(hT);var XT__default=/*#__PURE__*/_interopDefault(XT);var oh__default=/*#__PURE__*/_interopDefault(oh);var rh__default=/*#__PURE__*/_interopDefault(rh);var ZT__default=/*#__PURE__*/_interopDefault(ZT);var mI__default=/*#__PURE__*/_interopDefault(mI);var AI__default=/*#__PURE__*/_interopDefault(AI);var BI__default=/*#__PURE__*/_interopDefault(BI);var EI__default=/*#__PURE__*/_interopDefault(EI);var FI__default=/*#__PURE__*/_interopDefault(FI);var mu=Object.defineProperty;var kh=(e,t,o)=>t in e?mu(e,t,{enumerable:true,configurable:true,writable:true,value:o}):e[t]=o;var wh=(e,t)=>()=>(e&&(t=e(e=0)),t);var Th=(e,t)=>{for(var o in t)mu(e,o,{get:t[o],enumerable:true});};var gu=(e,t,o)=>kh(e,t+"",o);var uf={};Th(uf,{COrbCanvas:()=>Bw});function Bw({hue:e=0,hoverIntensity:t=.2,rotateOnHover:o=true,forceHoverState:r=false,backgroundColor:a="transparent"}){let n=Qt.useRef(null),i=`
1
+ 'use strict';var ogl=require('ogl'),Yt=require('react'),jsxRuntime=require('react/jsx-runtime'),navigation=require('next/navigation'),lucideReact=require('lucide-react'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),reactSlot=require('@radix-ui/react-slot'),classVarianceAuthority=require('class-variance-authority'),om=require('@mui/material/Dialog'),rm=require('@mui/material/DialogTitle'),am=require('@mui/material/DialogContent'),sb=require('@mui/material/DialogContentText'),nm=require('@mui/material/DialogActions'),Di=require('@mui/material/Box'),ub=require('@mui/icons-material/CheckCircle'),pb=require('@mui/icons-material/Warning'),mb=require('@mui/icons-material/Error'),gb=require('@mui/icons-material/Info'),material=require('@mui/material'),styles=require('@mui/material/styles'),Pb=require('@mui/icons-material/Clear'),Rb=require('@mui/icons-material/Close'),Lu=require('@mui/icons-material/Search'),W0=require('@mui/material/Paper'),H0=require('@mui/material/Table'),$0=require('@mui/material/TableBody'),wc=require('@mui/material/TableCell'),sm=require('@mui/material/TableContainer'),ry=require('@mui/material/TableHead'),ay=require('@mui/material/TableRow'),im=require('@mui/material/TextField'),Zl=require('@mui/material/Button'),lm=require('@mui/material/Alert'),core=require('@dnd-kit/core'),modifiers=require('@dnd-kit/modifiers'),Gb=require('@mui/icons-material/ViewColumn'),Yp=require('@mui/icons-material/Save'),_b=require('@mui/icons-material/Download'),Kb=require('@mui/icons-material/AccountTree'),qb=require('@mui/icons-material/Functions'),jb=require('@mui/icons-material/Insights'),op=require('@mui/icons-material/Add'),Zb=require('@mui/icons-material/Edit'),Yb=require('@mui/icons-material/Delete'),Qb=require('@mui/icons-material/KeyboardArrowLeft'),ph=require('@mui/icons-material/KeyboardArrowRight'),ny=require('@mui/material/Checkbox'),iy=require('@mui/material/TableSortLabel'),ly=require('@mui/material/IconButton'),sy=require('@mui/material/Tooltip'),cy=require('@mui/icons-material/UnfoldMore'),dy=require('@mui/icons-material/UnfoldLess'),sortable=require('@dnd-kit/sortable'),vy=require('@mui/icons-material/KeyboardArrowDown'),Fy=require('@mui/icons-material/Check'),Ju=require('@mui/icons-material/ClearAll'),ep=require('@mui/icons-material/ArrowUpward'),tp=require('@mui/icons-material/ArrowDownward'),Ly=require('@mui/icons-material/VisibilityOff'),Oy=require('@mui/icons-material/DeleteOutline'),Cx=require('@mui/icons-material/MicNoneOutlined'),Sx=require('@mui/icons-material/SettingsOutlined'),kx=require('@mui/icons-material/SendOutlined'),y0=require('@mui/icons-material/Settings'),x0=require('@mui/icons-material/KeyboardArrowUp'),C0=require('@mui/icons-material/ArrowRightAlt'),Ux=require('@mui/icons-material/Star'),DateCalendar=require('@mui/x-date-pickers/DateCalendar'),PickersDay=require('@mui/x-date-pickers/PickersDay'),LocalizationProvider=require('@mui/x-date-pickers/LocalizationProvider'),AdapterDayjs=require('@mui/x-date-pickers/AdapterDayjs'),r0=require('@mui/icons-material/CalendarMonth'),n0=require('@mui/icons-material/ArrowForward'),zr=require('dayjs'),i0=require('dayjs/plugin/isBetween'),l0=require('dayjs/plugin/localizedFormat'),s0=require('dayjs/plugin/customParseFormat');require('dayjs/locale/zh-cn'),require('dayjs/locale/fr'),require('dayjs/locale/de'),require('dayjs/locale/ja'),require('dayjs/locale/ko');var L0=require('@mui/icons-material/StarBorder'),N0=require('@mui/icons-material/ViewQuilt'),aC=require('@mui/icons-material/CloseOutlined'),av=require('@mui/icons-material/ContentCopyOutlined'),nv=require('@mui/icons-material/CheckOutlined'),Fv=require('@mui/icons-material/ExpandMore'),_C=require('@mui/icons-material/AddRounded'),$m=require('@mui/icons-material/Language'),KC=require('@mui/icons-material/DesktopWindows'),qC=require('@mui/icons-material/DarkMode'),jC=require('@mui/icons-material/LightMode'),ZC=require('@mui/icons-material/Logout'),vS=require('@mui/icons-material/DragIndicator'),OS=require('@mui/icons-material/FilterList'),VS=require('@mui/icons-material/TableRows'),TS=require('@mui/icons-material/LayersClear'),zk=require('@mui/icons-material/CameraAltRounded'),Ok=require('@mui/icons-material/QrCodeScannerRounded'),$k=require('@mui/icons-material/DragIndicatorRounded'),Kk=require('@mui/icons-material/BackspaceRounded'),qk=require('@mui/icons-material/CloseRounded'),jk=require('@mui/icons-material/CheckRounded'),cw=require('@mui/icons-material/SearchRounded'),dw=require('@mui/icons-material/MenuOpenRounded'),uw=require('@mui/icons-material/MenuRounded'),pw=require('@mui/icons-material/ExpandMoreRounded'),mw=require('@mui/icons-material/ChevronRightRounded'),$w=require('next/dynamic'),framerMotion=require('framer-motion'),eT=require('react-markdown'),tT=require('remark-gfm'),oT=require('remark-math'),rT=require('rehype-katex'),aT=require('rehype-raw'),reactSyntaxHighlighter=require('react-syntax-highlighter'),prism=require('react-syntax-highlighter/dist/esm/styles/prism'),nextThemes=require('next-themes'),kf=require('mermaid'),fT=require('@mui/icons-material/MicRounded'),hT=require('@mui/icons-material/MicOffRounded'),iconsMaterial=require('@mui/icons-material'),CT=require('@mui/icons-material/SendRounded'),kT=require('@mui/icons-material/HardwareRounded'),oI=require('@mui/icons-material/LockOutlined'),nh=require('@mui/icons-material/MailOutline'),ih=require('@mui/icons-material/PersonOutline'),rI=require('@mui/icons-material/VpnKeyOutlined'),vI=require('dayjs/plugin/isoWeek'),OI=require('@mui/icons-material/KeyboardDoubleArrowLeftOutlined'),VI=require('@mui/icons-material/KeyboardDoubleArrowRightOutlined'),WI=require('@mui/icons-material/SplitscreenOutlined'),HI=require('@mui/icons-material/Sort');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var Yt__namespace=/*#__PURE__*/_interopNamespace(Yt);var om__default=/*#__PURE__*/_interopDefault(om);var rm__default=/*#__PURE__*/_interopDefault(rm);var am__default=/*#__PURE__*/_interopDefault(am);var sb__default=/*#__PURE__*/_interopDefault(sb);var nm__default=/*#__PURE__*/_interopDefault(nm);var Di__default=/*#__PURE__*/_interopDefault(Di);var ub__default=/*#__PURE__*/_interopDefault(ub);var pb__default=/*#__PURE__*/_interopDefault(pb);var mb__default=/*#__PURE__*/_interopDefault(mb);var gb__default=/*#__PURE__*/_interopDefault(gb);var Pb__default=/*#__PURE__*/_interopDefault(Pb);var Rb__default=/*#__PURE__*/_interopDefault(Rb);var Lu__default=/*#__PURE__*/_interopDefault(Lu);var W0__default=/*#__PURE__*/_interopDefault(W0);var H0__default=/*#__PURE__*/_interopDefault(H0);var $0__default=/*#__PURE__*/_interopDefault($0);var wc__default=/*#__PURE__*/_interopDefault(wc);var sm__default=/*#__PURE__*/_interopDefault(sm);var ry__default=/*#__PURE__*/_interopDefault(ry);var ay__default=/*#__PURE__*/_interopDefault(ay);var im__default=/*#__PURE__*/_interopDefault(im);var Zl__default=/*#__PURE__*/_interopDefault(Zl);var lm__default=/*#__PURE__*/_interopDefault(lm);var Gb__default=/*#__PURE__*/_interopDefault(Gb);var Yp__default=/*#__PURE__*/_interopDefault(Yp);var _b__default=/*#__PURE__*/_interopDefault(_b);var Kb__default=/*#__PURE__*/_interopDefault(Kb);var qb__default=/*#__PURE__*/_interopDefault(qb);var jb__default=/*#__PURE__*/_interopDefault(jb);var op__default=/*#__PURE__*/_interopDefault(op);var Zb__default=/*#__PURE__*/_interopDefault(Zb);var Yb__default=/*#__PURE__*/_interopDefault(Yb);var Qb__default=/*#__PURE__*/_interopDefault(Qb);var ph__default=/*#__PURE__*/_interopDefault(ph);var ny__default=/*#__PURE__*/_interopDefault(ny);var iy__default=/*#__PURE__*/_interopDefault(iy);var ly__default=/*#__PURE__*/_interopDefault(ly);var sy__default=/*#__PURE__*/_interopDefault(sy);var cy__default=/*#__PURE__*/_interopDefault(cy);var dy__default=/*#__PURE__*/_interopDefault(dy);var vy__default=/*#__PURE__*/_interopDefault(vy);var Fy__default=/*#__PURE__*/_interopDefault(Fy);var Ju__default=/*#__PURE__*/_interopDefault(Ju);var ep__default=/*#__PURE__*/_interopDefault(ep);var tp__default=/*#__PURE__*/_interopDefault(tp);var Ly__default=/*#__PURE__*/_interopDefault(Ly);var Oy__default=/*#__PURE__*/_interopDefault(Oy);var Cx__default=/*#__PURE__*/_interopDefault(Cx);var Sx__default=/*#__PURE__*/_interopDefault(Sx);var kx__default=/*#__PURE__*/_interopDefault(kx);var y0__default=/*#__PURE__*/_interopDefault(y0);var x0__default=/*#__PURE__*/_interopDefault(x0);var C0__default=/*#__PURE__*/_interopDefault(C0);var Ux__default=/*#__PURE__*/_interopDefault(Ux);var r0__default=/*#__PURE__*/_interopDefault(r0);var n0__default=/*#__PURE__*/_interopDefault(n0);var zr__default=/*#__PURE__*/_interopDefault(zr);var i0__default=/*#__PURE__*/_interopDefault(i0);var l0__default=/*#__PURE__*/_interopDefault(l0);var s0__default=/*#__PURE__*/_interopDefault(s0);var L0__default=/*#__PURE__*/_interopDefault(L0);var N0__default=/*#__PURE__*/_interopDefault(N0);var aC__default=/*#__PURE__*/_interopDefault(aC);var av__default=/*#__PURE__*/_interopDefault(av);var nv__default=/*#__PURE__*/_interopDefault(nv);var Fv__default=/*#__PURE__*/_interopDefault(Fv);var _C__default=/*#__PURE__*/_interopDefault(_C);var $m__default=/*#__PURE__*/_interopDefault($m);var KC__default=/*#__PURE__*/_interopDefault(KC);var qC__default=/*#__PURE__*/_interopDefault(qC);var jC__default=/*#__PURE__*/_interopDefault(jC);var ZC__default=/*#__PURE__*/_interopDefault(ZC);var vS__default=/*#__PURE__*/_interopDefault(vS);var OS__default=/*#__PURE__*/_interopDefault(OS);var VS__default=/*#__PURE__*/_interopDefault(VS);var TS__default=/*#__PURE__*/_interopDefault(TS);var zk__default=/*#__PURE__*/_interopDefault(zk);var Ok__default=/*#__PURE__*/_interopDefault(Ok);var $k__default=/*#__PURE__*/_interopDefault($k);var Kk__default=/*#__PURE__*/_interopDefault(Kk);var qk__default=/*#__PURE__*/_interopDefault(qk);var jk__default=/*#__PURE__*/_interopDefault(jk);var cw__default=/*#__PURE__*/_interopDefault(cw);var dw__default=/*#__PURE__*/_interopDefault(dw);var uw__default=/*#__PURE__*/_interopDefault(uw);var pw__default=/*#__PURE__*/_interopDefault(pw);var mw__default=/*#__PURE__*/_interopDefault(mw);var $w__default=/*#__PURE__*/_interopDefault($w);var eT__default=/*#__PURE__*/_interopDefault(eT);var tT__default=/*#__PURE__*/_interopDefault(tT);var oT__default=/*#__PURE__*/_interopDefault(oT);var rT__default=/*#__PURE__*/_interopDefault(rT);var aT__default=/*#__PURE__*/_interopDefault(aT);var kf__default=/*#__PURE__*/_interopDefault(kf);var fT__default=/*#__PURE__*/_interopDefault(fT);var hT__default=/*#__PURE__*/_interopDefault(hT);var CT__default=/*#__PURE__*/_interopDefault(CT);var kT__default=/*#__PURE__*/_interopDefault(kT);var oI__default=/*#__PURE__*/_interopDefault(oI);var nh__default=/*#__PURE__*/_interopDefault(nh);var ih__default=/*#__PURE__*/_interopDefault(ih);var rI__default=/*#__PURE__*/_interopDefault(rI);var vI__default=/*#__PURE__*/_interopDefault(vI);var OI__default=/*#__PURE__*/_interopDefault(OI);var VI__default=/*#__PURE__*/_interopDefault(VI);var WI__default=/*#__PURE__*/_interopDefault(WI);var HI__default=/*#__PURE__*/_interopDefault(HI);var bu=Object.defineProperty;var Ih=(e,t,o)=>t in e?bu(e,t,{enumerable:true,configurable:true,writable:true,value:o}):e[t]=o;var Ph=(e,t)=>()=>(e&&(t=e(e=0)),t);var Rh=(e,t)=>{for(var o in t)bu(e,o,{get:t[o],enumerable:true});};var yu=(e,t,o)=>Ih(e,t+"",o);var gf={};Rh(gf,{COrbCanvas:()=>Vw});function Vw({hue:e=0,hoverIntensity:t=.2,rotateOnHover:o=true,forceHoverState:r=false,backgroundColor:a="transparent"}){let n=Yt.useRef(null),i=`
2
2
  precision highp float;
3
3
  attribute vec2 position;
4
4
  attribute vec2 uv;
@@ -180,22 +180,22 @@
180
180
  vec4 col = mainImage(fragCoord);
181
181
  gl_FragColor = vec4(col.rgb * col.a, col.a);
182
182
  }
183
- `;return Qt.useEffect(()=>{let d=n.current;if(!d)return;let l=new ogl.Renderer({alpha:true,premultipliedAlpha:false}),s=l.gl;s.clearColor(0,0,0,0),d.appendChild(s.canvas);let g=new ogl.Triangle(s),f=new ogl.Program(s,{vertex:i,fragment:c,uniforms:{iTime:{value:0},iResolution:{value:new ogl.Vec3(s.canvas.width,s.canvas.height,s.canvas.width/s.canvas.height)},hue:{value:e},hover:{value:0},rot:{value:0},hoverIntensity:{value:t},backgroundColor:{value:df(a)}}}),p=new ogl.Mesh(s,{geometry:g,program:f});function b(){if(!d)return;let R=window.devicePixelRatio||1,T=d.clientWidth,I=d.clientHeight;l.setSize(T*R,I*R),s.canvas.style.width=T+"px",s.canvas.style.height=I+"px",f.uniforms.iResolution.value.set(s.canvas.width,s.canvas.height,s.canvas.width/s.canvas.height);}window.addEventListener("resize",b),b();let y=0,u=0,C=0,m=.3,h=R=>{let T=d.getBoundingClientRect(),I=R.clientX-T.left,k=R.clientY-T.top,S=T.width,D=T.height,P=Math.min(S,D),M=S/2,B=D/2,X=(I-M)/P*2,L=(k-B)/P*2;Math.sqrt(X*X+L*L)<.8?y=1:y=0;},x=()=>{y=0;};d.addEventListener("mousemove",h),d.addEventListener("mouseleave",x);let w,E=R=>{w=requestAnimationFrame(E);let T=(R-u)*.001;u=R,f.uniforms.iTime.value=R*.001,f.uniforms.hue.value=e,f.uniforms.hoverIntensity.value=t,f.uniforms.backgroundColor.value=df(a);let I=r?1:y;f.uniforms.hover.value+=(I-f.uniforms.hover.value)*.1,o&&I>.5&&(C+=T*m),f.uniforms.rot.value=C,l.render({scene:p});};return w=requestAnimationFrame(E),()=>{cancelAnimationFrame(w),window.removeEventListener("resize",b),d.removeEventListener("mousemove",h),d.removeEventListener("mouseleave",x),s.canvas.parentNode===d&&d.removeChild(s.canvas),s.getExtension("WEBGL_lose_context")?.loseContext();}},[e,t,o,r,a]),jsxRuntime.jsx("div",{ref:n,className:"w-full h-full"})}function Ew(e,t,o){let r,a,n;if(t===0)r=a=n=o;else {let i=(l,s,g)=>(g<0&&(g+=1),g>1&&(g-=1),g<.16666666666666666?l+(s-l)*6*g:g<.5?s:g<.6666666666666666?l+(s-l)*(.6666666666666666-g)*6:l),c=o<.5?o*(1+t):o+t-o*t,d=2*o-c;r=i(d,c,e+1/3),a=i(d,c,e),n=i(d,c,e-1/3);}return new ogl.Vec3(r,a,n)}function df(e){if(e==="transparent")return new ogl.Vec3(0,0,0);if(e.startsWith("#")){let r=parseInt(e.slice(1,3),16)/255,a=parseInt(e.slice(3,5),16)/255,n=parseInt(e.slice(5,7),16)/255;return new ogl.Vec3(r,a,n)}let t=e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);if(t)return new ogl.Vec3(parseInt(t[1])/255,parseInt(t[2])/255,parseInt(t[3])/255);let o=e.match(/hsla?\((\d+),\s*(\d+)%,\s*(\d+)%/);if(o){let r=parseInt(o[1])/360,a=parseInt(o[2])/100,n=parseInt(o[3])/100;return Ew(r,a,n)}return new ogl.Vec3(0,0,0)}var pf=wh(()=>{"use client";});function Ho(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var nc={primary:"#000000",primaryHover:"#333333"},sl={primary:"bg-primary text-primary-foreground hover:bg-primary/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",ghost:"hover:bg-accent hover:text-accent-foreground"},ii={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",full:"rounded-full"},fu=()=>"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50";var Dh=classVarianceAuthority.cva(fu(),{variants:{variant:{default:`${sl.primary} shadow-sm`,destructive:"bg-red-500 text-white hover:bg-red-600 active:bg-red-700 dark:bg-red-600 dark:hover:bg-red-500 dark:active:bg-red-700 shadow-sm",outline:`${sl.outline} shadow-sm`,secondary:"bg-gray-200 text-gray-700 hover:bg-gray-300 active:bg-gray-400 dark:bg-gray-700 dark:text-gray-200 dark:hover:bg-gray-600 dark:active:bg-gray-500 shadow-sm",ghost:sl.ghost,link:"text-blue-600 dark:text-blue-400 underline-offset-4 hover:underline hover:text-blue-700 dark:hover:text-blue-300 active:text-blue-800 dark:active:text-blue-200","chat-tool":"bg-[var(--orbai-surface-2)] border border-[var(--orbai-border-soft)] text-[var(--orbai-text-2)] hover:bg-[var(--orbai-surface-3)] hover:border-[var(--orbai-border-strong)] hover:text-[var(--orbai-text-1)] active:scale-95 transition-all duration-200","chat-send":`bg-[${nc.primary}] hover:bg-[${nc.primaryHover}] text-white border border-[var(--orbai-border-strong)] shadow-[var(--orbai-shadow-soft-sm)] hover:shadow-[var(--orbai-shadow-soft-md)] active:scale-95 transition-all duration-200`,"chat-stop":"bg-red-500 hover:bg-red-600 border border-[var(--orbai-border-strong)] shadow-[var(--orbai-shadow-soft-sm)] hover:shadow-[var(--orbai-shadow-soft-md)] active:scale-95 text-white transition-all duration-200","chat-disabled":"cursor-not-allowed opacity-50 bg-[var(--orbai-surface-2)] border border-[var(--orbai-border-soft)] text-[var(--orbai-muted)]"},size:{default:"h-10 px-4 py-2",sm:"h-9 px-3",lg:"h-11 px-8",icon:"h-10 w-10","chat-sm":"h-8 w-8 rounded-full","chat-md":"h-10 w-10 rounded-full","chat-lg":"h-12 w-12 rounded-full"},rounded:{none:ii.none,sm:ii.sm,md:ii.md,full:ii.full}},defaultVariants:{variant:"default",size:"default",rounded:"md"}}),ic=Qt__namespace.forwardRef(({className:e,variant:t,size:o,asChild:r=false,...a},n)=>jsxRuntime.jsx(r?reactSlot.Slot:"button",{className:Ho(Dh({variant:t,size:o,className:e})),ref:n,...a}));ic.displayName="Button";var Bh={"common.cancel":"Cancel","common.save":"Save","common.ok":"OK","common.done":"Done","common.search":"Search","common.none":"None","common.all":"All","common.noData":"No data","common.copy":"Copy","common.delete":"Delete","common.loading":"Loading...","header.searchPlaceholder":"Ask me...","header.searchAddFeature":"Add feature","header.searchSend":"Send","header.searchStartVoice":"Start voice input","header.searchStopVoice":"Stop voice input","header.theme.system":"Theme: System","header.theme.dark":"Theme: Dark","header.theme.light":"Theme: Light","header.menu.setting":"Setting","header.menu.logout":"Logout","navigation.expand":"Expand navigation","navigation.collapse":"Collapse navigation","navigation.searchPlaceholder":"Search menu...","navigation.noMatch":"No matching menu items","navigation.noAccessibleApp":"No accessible applications","navigation.noItems":"No items to display","navigation.expandView":"Expand {title}","navigation.mode.switchToFixed":"Switch to fixed navigation","navigation.mode.switchToFloating":"Switch to floating navigation","table.toolbar.searchPlaceholder":"Search...","table.title.default":"Data Table","table.toolbar.groupBy":"Group By","table.toolbar.summary":"Summary","table.toolbar.columns":"Columns","table.toolbar.export":"Export","table.toolbar.itemsPerPage":"Items per page:","table.toolbar.pageOf":"Page {current} of {total}","table.toolbar.newItem":"New Item","table.toolbar.editItem":"Edit Item","table.toolbar.deleteItem":"Delete Item","table.toolbar.graphicReport":"Graphic Report","table.toolbar.saveLayout":"Save Layout","table.menu.groupBy":"Group By","table.menu.clearAll":"Clear All","table.menu.visibleColumns":"Visible Columns","table.menu.showSummaryRow":"Show Summary Row","table.menu.noNumericColumns":"No numeric columns","table.group.expandAll":"Expand All Groups","table.group.collapseAll":"Collapse All Groups","table.mobile.notImplemented":"Mobile View Not Implemented","table.headerMenu.sortAsc":"Sort Ascending","table.headerMenu.sortDesc":"Sort Descending","table.headerMenu.clearSort":"Clear Sort","table.headerMenu.configureSort":"Configure Sort...","table.headerMenu.group":"Group by this column","table.headerMenu.ungroup":"Remove from grouping","table.headerMenu.addSummary":"Include in Summary","table.headerMenu.removeSummary":"Remove from Summary","table.headerMenu.hideColumn":"Hide Column","table.sortDialog.title":"Sort Settings","table.sortDialog.empty":"No sort rules. Add one to start ordering rows.","table.sortDialog.addRule":"Add Sort Rule","table.sortDialog.clearAll":"Clear All","table.sortDialog.asc":"Ascending","table.sortDialog.desc":"Descending","pivot.title.default":"Pivot Table Builder","pivot.subtitle.default":"Drag fields to configure the pivot table.","pivot.empty":"Drag at least one field into Values to render the pivot result.","pivot.records":"Records","pivot.afterFilter":"After filter","pivot.grandTotal":"Grand Total","pivot.resultLabel":"Result","pivot.valueLabel":"Value","pivot.table.dimensions":"Dimensions","pivot.config.title":"Configuration","pivot.fieldList":"Field List","pivot.availableDimensions":"Available dimensions","pivot.allFieldsInUse":"All fields are in use.","pivot.zone.rows":"Rows","pivot.zone.columns":"Columns","pivot.zone.filters":"Filters","pivot.zone.values":"Values","pivot.hint.rows":"Drag fields here to build row hierarchy","pivot.hint.columns":"Drag fields here to build column hierarchy","pivot.hint.filters":"Drag fields here for report filters","pivot.hint.values":"Drag numeric fields here for aggregation","pivot.clearArea":"Clear area","pivot.filter.na":"N/A","pivot.filter.noValues":"No values","pivot.filter.noneSelected":"None selected","pivot.filter.allValues":"All values","pivot.filter.selectedCount":"{selected} / {total} selected","pivot.filter.selectAll":"Select All","pivot.filter.deselectAll":"Deselect All","pivot.filter.noResults":"No results","pivot.collapse.ariaExpand":"Expand configuration area","pivot.collapse.ariaCollapse":"Collapse configuration area","pivot.agg.sum":"Sum","pivot.agg.count":"Count","pivot.agg.avg":"Average","pivot.agg.min":"Min","pivot.agg.max":"Max","pivot.preset.selectPlaceholder":"Select preset","pivot.preset.save":"Save preset","pivot.preset.delete":"Delete preset","pivot.preset.saveDialogTitle":"Save current preset","pivot.preset.nameLabel":"Preset name","pivot.preset.defaultName":"Preset {index}","pivot.table.sectionTitle":"Pivot Result","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"Expand pivot result","pivot.table.collapse.ariaCollapse":"Collapse pivot result","pivot.chart.title":"Pivot Chart","pivot.chart.subtitle":"Map one dimension and up to two measures into a compact chart.","pivot.chart.subtitleReady":"{dimension} by {measure}","pivot.chart.emptyNoDimension":"Add at least one row or column field to render the chart.","pivot.chart.emptyNoValue":"Add at least one value field to render the chart.","pivot.chart.emptyNoData":"No data available for the current chart selection.","pivot.chart.dimension":"Dimension","pivot.chart.primaryMeasure":"Measure","pivot.chart.secondaryMeasure":"Compare measure","pivot.chart.chartType":"Chart type","pivot.chart.style.barVertical":"Vertical bars","pivot.chart.style.barHorizontal":"Horizontal bars","pivot.chart.style.line":"Line","pivot.chart.style.scatter":"Scatter","pivot.chart.collapse.ariaExpand":"Expand chart area","pivot.chart.collapse.ariaCollapse":"Collapse chart area","smartFilter.adaptFilters":"Adapt Filters","smartFilter.addFilters":"Add Filters","smartFilter.go":"Go","smartFilter.visibleFilters":"Visible Filters","smartFilter.searchPlaceholder":"Search...","smartFilter.noOptionsFound":"No options found","smartFilter.min":"Min","smartFilter.max":"Max","smartFilter.minMaxPlaceholder":"Min - Max","smartFilter.operator.equals":"Equals","smartFilter.operator.contains":"Contains","smartFilter.operator.notContains":"Does Not Contain","smartFilter.operator.wildcard":"Wildcard Search","smartFilter.operator.notEquals":"Not Equals","smartFilter.operator.greaterThan":"Greater Than","smartFilter.operator.lessThan":"Less Than","smartFilter.operator.greaterOrEqual":"Greater Than or Equal","smartFilter.operator.lessOrEqual":"Less Than or Equal","smartFilter.operator.between":"Between","variant.noOptions":"No options","variant.defaultSuffix":"Default","variant.selectVariant":"Select Variant","variant.saveView":"Save View","variant.newVariant":"New Variant","variant.viewName":"View Name","variant.setDefault":"Set as Default","variant.publicAllUsers":"Public (All Users)","variant.toast.fetchFailed":"Failed to load variants","variant.toast.saveFailed":"Failed to save variant","variant.toast.saveSuccess":"Variant saved successfully","variant.toast.deleteFailed":"Failed to delete variant","variant.toast.deleteSuccess":"Variant deleted successfully","variant.toast.defaultFailed":"Failed to update default variant","variant.toast.defaultSuccess":"Default variant updated","layout.saveLayout":"Save Layout","layout.layoutOptions":"Layout Options","layout.selectLayout":"Select Layout","layout.saveCurrentLayout":"Save Current Layout...","layout.noSavedLayouts":"No saved layouts","layout.removeDefault":"Remove Default","layout.setAsDefault":"Set as Default","layout.layoutName":"Layout Name","layout.layoutDescription":"Description","layout.layoutNameHelper":"e.g., 'Compact View'","layout.warningOverwrite":"Warning: Existing layout will be overwritten","layout.useAsDefault":"Use as Default Layout","layout.publicAllUsers":"Public (Visible to all users)","layout.toast.loadFallback":"Failed to load layouts from backend, fallback to local storage","layout.toast.saveSuccess":"Layout saved successfully","layout.toast.saveLocalSuccess":"Layout saved to local storage","layout.toast.backendUnavailableSavedLocal":"Backend unavailable, saved to local storage","layout.toast.deleteSuccess":"Layout deleted successfully","layout.toast.deleteLocalSuccess":"Layout deleted from local storage","layout.toast.backendUnavailableDeletedLocal":"Backend unavailable, deleted from local storage","layout.toast.defaultSuccess":"Default layout set","layout.toast.defaultLocalSuccess":"Default layout set in local storage","layout.toast.backendUnavailableDefaultLocal":"Backend unavailable, default saved to local storage","dateRange.label":"Date Range","dateRange.startDate":"Start Date","dateRange.endDate":"End Date","dateRange.select":"Select...","dateRange.today":"Today","dateRange.thisWeek":"This Week","dateRange.thisMonth":"This Month","graph.records":"{count} records","graph.kpi.totalRecords":"Total Records","graph.kpi.totalReport":"Total Report","graph.kpi.totalBillable":"Total Billable","graph.kpi.efficiency":"Efficiency","graph.kpi.amount":"Amount","graph.kpi.flagged":"Flagged","graph.chart.billable.title":"Billable by Dimension","graph.chart.billable.subtitle":"Top values by billable hours","graph.chart.efficiency.title":"Efficiency by Person","graph.chart.efficiency.subtitle":"Lowest efficiency first","graph.chart.status.title":"Status Distribution","graph.chart.status.subtitle":"Record ratio by status","graph.dataBody":"Data Body","graph.reportTitle":"Graphic Report","graph.unassigned":"Unassigned","graph.column.reportHours":"Report Hours","graph.column.billableHours":"Billable Hours","detail.searchAi.placeholder":"Search fields, or ask AI if no match...","detail.searchAi.matches":"{count} matches found","detail.searchAi.noMatch":"No matching field found.","detail.searchAi.autoAiFallback":"No direct match. Triggering AI analysis...","detail.searchAi.aiResultTitle":"AI Insight","detail.table.title":"Related Records","kanban.empty":"Drop cards here","kanban.bucket.limit":"Limit","kanban.bucket.dropHere":"Release to move into this bucket","kanban.card.progress":"Progress","kanban.card.openDetail":"Open Detail","kanban.priority.critical":"Critical","kanban.priority.high":"High","kanban.priority.medium":"Medium","kanban.priority.low":"Low","quickCreate.newItem":"New Item","quickCreate.createWithTitle":"Create {title}","quickEdit.editWithTitle":"Edit {title}","quickDelete.confirmTitle":"Confirm Delete","quickDelete.confirmMessageSingle":"Are you sure you want to delete the selected record?","quickDelete.confirmMessageMultiple":"Are you sure you want to delete {count} selected records?","messageBox.confirm":"OK","messageBox.cancel":"Cancel"},Eh={"common.cancel":"\u53D6\u6D88","common.save":"\u4FDD\u5B58","common.ok":"\u786E\u5B9A","common.done":"\u5B8C\u6210","common.search":"\u641C\u7D22","common.none":"\u65E0","common.all":"\u5168\u90E8","common.noData":"\u6682\u65E0\u6570\u636E","common.copy":"\u590D\u5236","common.delete":"\u5220\u9664","common.loading":"\u52A0\u8F7D\u4E2D...","header.searchPlaceholder":"\u95EE\u6211\u70B9\u4EC0\u4E48...","header.searchAddFeature":"\u589E\u52A0\u529F\u80FD","header.searchSend":"\u53D1\u9001","header.searchStartVoice":"\u5F00\u59CB\u8BED\u97F3\u8F93\u5165","header.searchStopVoice":"\u505C\u6B62\u8BED\u97F3\u8F93\u5165","header.theme.system":"\u4E3B\u9898\uFF1A\u8DDF\u968F\u7CFB\u7EDF","header.theme.dark":"\u4E3B\u9898\uFF1A\u6DF1\u8272","header.theme.light":"\u4E3B\u9898\uFF1A\u6D45\u8272","header.menu.setting":"\u8BBE\u7F6E","header.menu.logout":"\u6CE8\u9500","navigation.expand":"\u5C55\u5F00\u5BFC\u822A","navigation.collapse":"\u6298\u53E0\u5BFC\u822A","navigation.searchPlaceholder":"\u641C\u7D22\u83DC\u5355...","navigation.noMatch":"\u672A\u627E\u5230\u5339\u914D\u7684\u83DC\u5355\u9879","navigation.noAccessibleApp":"\u6682\u65E0\u53EF\u8BBF\u95EE\u7684\u5E94\u7528","navigation.noItems":"\u6682\u65E0\u53EF\u663E\u793A\u9879","navigation.expandView":"\u5C55\u5F00\u67E5\u770B {title}","navigation.mode.switchToFixed":"\u5207\u6362\u4E3A\u56FA\u5B9A\u5BFC\u822A","navigation.mode.switchToFloating":"\u5207\u6362\u4E3A\u60AC\u6D6E\u5BFC\u822A","table.toolbar.searchPlaceholder":"\u641C\u7D22...","table.title.default":"\u6570\u636E\u8868","table.toolbar.groupBy":"\u5206\u7EC4","table.toolbar.summary":"\u6C47\u603B","table.toolbar.columns":"\u5217","table.toolbar.export":"\u5BFC\u51FA","table.toolbar.itemsPerPage":"\u6BCF\u9875\u6761\u6570\uFF1A","table.toolbar.pageOf":"\u7B2C {current} / {total} \u9875","table.toolbar.newItem":"\u65B0\u5EFA\u6761\u76EE","table.toolbar.editItem":"\u7F16\u8F91\u6761\u76EE","table.toolbar.deleteItem":"\u5220\u9664\u6761\u76EE","table.toolbar.graphicReport":"\u56FE\u8868\u62A5\u8868","table.toolbar.saveLayout":"\u4FDD\u5B58\u5E03\u5C40","table.menu.groupBy":"\u5206\u7EC4","table.menu.clearAll":"\u6E05\u7A7A","table.menu.visibleColumns":"\u53EF\u89C1\u5217","table.menu.showSummaryRow":"\u663E\u793A\u6C47\u603B\u884C","table.menu.noNumericColumns":"\u6CA1\u6709\u6570\u503C\u5217","table.group.expandAll":"\u5C55\u5F00\u5168\u90E8\u5206\u7EC4","table.group.collapseAll":"\u6298\u53E0\u5168\u90E8\u5206\u7EC4","table.mobile.notImplemented":"\u79FB\u52A8\u7AEF\u89C6\u56FE\u6682\u672A\u5B9E\u73B0","table.headerMenu.sortAsc":"\u5347\u5E8F\u6392\u5217","table.headerMenu.sortDesc":"\u964D\u5E8F\u6392\u5217","table.headerMenu.clearSort":"\u6E05\u9664\u6392\u5E8F","table.headerMenu.configureSort":"\u6392\u5E8F\u8BBE\u7F6E...","table.headerMenu.group":"\u6309\u6B64\u5217\u5206\u7EC4","table.headerMenu.ungroup":"\u53D6\u6D88\u5206\u7EC4","table.headerMenu.addSummary":"\u52A0\u5165\u6C47\u603B","table.headerMenu.removeSummary":"\u4ECE\u6C47\u603B\u4E2D\u79FB\u9664","table.headerMenu.hideColumn":"\u9690\u85CF\u8BE5\u5217","table.sortDialog.title":"\u6392\u5E8F\u8BBE\u7F6E","table.sortDialog.empty":"\u6682\u65E0\u6392\u5E8F\u89C4\u5219\uFF0C\u8BF7\u6DFB\u52A0\u89C4\u5219\u8FDB\u884C\u6392\u5E8F\u3002","table.sortDialog.addRule":"\u6DFB\u52A0\u6392\u5E8F\u89C4\u5219","table.sortDialog.clearAll":"\u6E05\u7A7A\u89C4\u5219","table.sortDialog.asc":"\u5347\u5E8F","table.sortDialog.desc":"\u964D\u5E8F","pivot.title.default":"\u6570\u636E\u900F\u89C6\u8868","pivot.subtitle.default":"\u62D6\u62FD\u5B57\u6BB5\u4EE5\u914D\u7F6E\u900F\u89C6\u8868\u3002","pivot.empty":"\u8BF7\u81F3\u5C11\u62D6\u5165\u4E00\u4E2A\u503C\u5B57\u6BB5\u540E\u518D\u67E5\u770B\u900F\u89C6\u7ED3\u679C\u3002","pivot.records":"\u8BB0\u5F55\u6570","pivot.afterFilter":"\u7B5B\u9009\u540E","pivot.grandTotal":"\u603B\u8BA1","pivot.resultLabel":"\u7ED3\u679C","pivot.valueLabel":"\u503C","pivot.table.dimensions":"\u7EF4\u5EA6","pivot.config.title":"\u5E03\u5C40\u914D\u7F6E","pivot.fieldList":"\u5B57\u6BB5\u5217\u8868","pivot.availableDimensions":"\u53EF\u7528\u7EF4\u5EA6","pivot.allFieldsInUse":"\u6240\u6709\u5B57\u6BB5\u90FD\u5DF2\u4F7F\u7528\u3002","pivot.zone.rows":"\u884C","pivot.zone.columns":"\u5217","pivot.zone.filters":"\u7B5B\u9009","pivot.zone.values":"\u503C","pivot.hint.rows":"\u5C06\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u6784\u5EFA\u884C\u5C42\u7EA7","pivot.hint.columns":"\u5C06\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u6784\u5EFA\u5217\u5C42\u7EA7","pivot.hint.filters":"\u5C06\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u4F5C\u4E3A\u62A5\u8868\u7B5B\u9009","pivot.hint.values":"\u5C06\u6570\u503C\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u8FDB\u884C\u805A\u5408","pivot.clearArea":"\u6E05\u7A7A\u533A\u57DF","pivot.filter.na":"\u4E0D\u53EF\u7528","pivot.filter.noValues":"\u65E0\u53EF\u9009\u503C","pivot.filter.noneSelected":"\u672A\u9009\u62E9","pivot.filter.allValues":"\u5168\u90E8\u503C","pivot.filter.selectedCount":"\u5DF2\u9009 {selected} / {total}","pivot.filter.selectAll":"\u5168\u9009","pivot.filter.deselectAll":"\u53D6\u6D88\u5168\u9009","pivot.filter.noResults":"\u65E0\u5339\u914D\u7ED3\u679C","pivot.collapse.ariaExpand":"\u5C55\u5F00\u914D\u7F6E\u533A\u57DF","pivot.collapse.ariaCollapse":"\u6298\u53E0\u914D\u7F6E\u533A\u57DF","pivot.agg.sum":"\u6C42\u548C","pivot.agg.count":"\u8BA1\u6570","pivot.agg.avg":"\u5E73\u5747\u503C","pivot.agg.min":"\u6700\u5C0F\u503C","pivot.agg.max":"\u6700\u5927\u503C","pivot.preset.selectPlaceholder":"\u9009\u62E9\u65B9\u6848","pivot.preset.save":"\u4FDD\u5B58\u65B9\u6848","pivot.preset.delete":"\u5220\u9664\u65B9\u6848","pivot.preset.saveDialogTitle":"\u4FDD\u5B58\u5F53\u524D\u65B9\u6848","pivot.preset.nameLabel":"\u65B9\u6848\u540D\u79F0","pivot.preset.defaultName":"\u65B9\u6848 {index}","pivot.table.sectionTitle":"\u900F\u89C6\u7ED3\u679C","pivot.table.expandRowsAll":"\u884C\u5168\u90E8\u6253\u5F00","pivot.table.collapseRowsAll":"\u884C\u5168\u90E8\u6298\u53E0","pivot.table.expandColumnsAll":"\u5217\u5168\u90E8\u6253\u5F00","pivot.table.collapseColumnsAll":"\u5217\u5168\u90E8\u6298\u53E0","pivot.table.collapse.ariaExpand":"\u5C55\u5F00\u900F\u89C6\u7ED3\u679C","pivot.table.collapse.ariaCollapse":"\u6298\u53E0\u900F\u89C6\u7ED3\u679C","pivot.chart.title":"\u900F\u89C6\u56FE\u8868","pivot.chart.subtitle":"\u5C06\u4E00\u4E2A\u7EF4\u5EA6\u4E0E\u6700\u591A\u4E24\u4E2A\u5EA6\u91CF\u6620\u5C04\u4E3A\u7D27\u51D1\u56FE\u8868\u3002","pivot.chart.subtitleReady":"{dimension} \xB7 {measure}","pivot.chart.emptyNoDimension":"\u8BF7\u81F3\u5C11\u653E\u5165\u4E00\u4E2A\u884C\u6216\u5217\u5B57\u6BB5\u540E\u518D\u67E5\u770B\u56FE\u8868\u3002","pivot.chart.emptyNoValue":"\u8BF7\u81F3\u5C11\u653E\u5165\u4E00\u4E2A\u503C\u5B57\u6BB5\u540E\u518D\u67E5\u770B\u56FE\u8868\u3002","pivot.chart.emptyNoData":"\u5F53\u524D\u56FE\u8868\u9009\u62E9\u4E0B\u6682\u65E0\u53EF\u5C55\u793A\u6570\u636E\u3002","pivot.chart.dimension":"\u56FE\u8868\u7EF4\u5EA6","pivot.chart.primaryMeasure":"\u4E3B\u5EA6\u91CF","pivot.chart.secondaryMeasure":"\u5BF9\u6BD4\u5EA6\u91CF","pivot.chart.chartType":"\u56FE\u8868\u7C7B\u578B","pivot.chart.style.barVertical":"\u7EB5\u5411\u67F1\u72B6\u56FE","pivot.chart.style.barHorizontal":"\u6A2A\u5411\u67F1\u72B6\u56FE","pivot.chart.style.line":"\u6298\u7EBF\u56FE","pivot.chart.style.scatter":"\u6563\u70B9\u56FE","pivot.chart.collapse.ariaExpand":"\u5C55\u5F00\u56FE\u8868\u533A\u57DF","pivot.chart.collapse.ariaCollapse":"\u6298\u53E0\u56FE\u8868\u533A\u57DF","smartFilter.adaptFilters":"\u7B5B\u9009\u8BBE\u7F6E","smartFilter.addFilters":"\u6DFB\u52A0\u7B5B\u9009","smartFilter.go":"\u6267\u884C","smartFilter.visibleFilters":"\u53EF\u89C1\u7B5B\u9009\u9879","smartFilter.searchPlaceholder":"\u641C\u7D22...","smartFilter.noOptionsFound":"\u672A\u627E\u5230\u9009\u9879","smartFilter.min":"\u6700\u5C0F\u503C","smartFilter.max":"\u6700\u5927\u503C","smartFilter.minMaxPlaceholder":"\u6700\u5C0F\u503C - \u6700\u5927\u503C","smartFilter.operator.equals":"\u7B49\u4E8E","smartFilter.operator.contains":"\u5305\u542B","smartFilter.operator.notContains":"\u4E0D\u5305\u542B","smartFilter.operator.wildcard":"\u901A\u914D\u7B26\u641C\u7D22","smartFilter.operator.notEquals":"\u4E0D\u7B49\u4E8E","smartFilter.operator.greaterThan":"\u5927\u4E8E","smartFilter.operator.lessThan":"\u5C0F\u4E8E","smartFilter.operator.greaterOrEqual":"\u5927\u4E8E\u7B49\u4E8E","smartFilter.operator.lessOrEqual":"\u5C0F\u4E8E\u7B49\u4E8E","smartFilter.operator.between":"\u533A\u95F4","variant.noOptions":"\u65E0\u9009\u9879","variant.defaultSuffix":"\u9ED8\u8BA4","variant.selectVariant":"\u9009\u62E9\u89C6\u56FE","variant.saveView":"\u4FDD\u5B58\u89C6\u56FE","variant.newVariant":"\u65B0\u89C6\u56FE","variant.viewName":"\u89C6\u56FE\u540D\u79F0","variant.setDefault":"\u8BBE\u4E3A\u9ED8\u8BA4","variant.publicAllUsers":"\u516C\u5F00\uFF08\u6240\u6709\u7528\u6237\uFF09","variant.toast.fetchFailed":"\u52A0\u8F7D\u89C6\u56FE\u5931\u8D25","variant.toast.saveFailed":"\u4FDD\u5B58\u89C6\u56FE\u5931\u8D25","variant.toast.saveSuccess":"\u89C6\u56FE\u4FDD\u5B58\u6210\u529F","variant.toast.deleteFailed":"\u5220\u9664\u89C6\u56FE\u5931\u8D25","variant.toast.deleteSuccess":"\u89C6\u56FE\u5220\u9664\u6210\u529F","variant.toast.defaultFailed":"\u66F4\u65B0\u9ED8\u8BA4\u89C6\u56FE\u5931\u8D25","variant.toast.defaultSuccess":"\u9ED8\u8BA4\u89C6\u56FE\u5DF2\u66F4\u65B0","layout.saveLayout":"\u4FDD\u5B58\u5E03\u5C40","layout.layoutOptions":"\u5E03\u5C40\u9009\u9879","layout.selectLayout":"\u9009\u62E9\u5E03\u5C40","layout.saveCurrentLayout":"\u4FDD\u5B58\u5F53\u524D\u5E03\u5C40...","layout.noSavedLayouts":"\u6682\u65E0\u5DF2\u4FDD\u5B58\u5E03\u5C40","layout.removeDefault":"\u53D6\u6D88\u9ED8\u8BA4","layout.setAsDefault":"\u8BBE\u4E3A\u9ED8\u8BA4","layout.layoutName":"\u5E03\u5C40\u540D\u79F0","layout.layoutDescription":"\u63CF\u8FF0","layout.layoutNameHelper":"\u4F8B\u5982\uFF1A\u7D27\u51D1\u89C6\u56FE","layout.warningOverwrite":"\u8B66\u544A\uFF1A\u5C06\u8986\u76D6\u540C\u540D\u5E03\u5C40","layout.useAsDefault":"\u7528\u4F5C\u9ED8\u8BA4\u5E03\u5C40","layout.publicAllUsers":"\u516C\u5F00\uFF08\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09","layout.toast.loadFallback":"\u540E\u7AEF\u52A0\u8F7D\u5E03\u5C40\u5931\u8D25\uFF0C\u5DF2\u56DE\u9000\u5230\u672C\u5730\u5B58\u50A8","layout.toast.saveSuccess":"\u5E03\u5C40\u4FDD\u5B58\u6210\u529F","layout.toast.saveLocalSuccess":"\u5E03\u5C40\u5DF2\u4FDD\u5B58\u5230\u672C\u5730\u5B58\u50A8","layout.toast.backendUnavailableSavedLocal":"\u540E\u7AEF\u4E0D\u53EF\u7528\uFF0C\u5DF2\u4FDD\u5B58\u5230\u672C\u5730\u5B58\u50A8","layout.toast.deleteSuccess":"\u5E03\u5C40\u5220\u9664\u6210\u529F","layout.toast.deleteLocalSuccess":"\u5E03\u5C40\u5DF2\u4ECE\u672C\u5730\u5B58\u50A8\u5220\u9664","layout.toast.backendUnavailableDeletedLocal":"\u540E\u7AEF\u4E0D\u53EF\u7528\uFF0C\u5DF2\u4ECE\u672C\u5730\u5B58\u50A8\u5220\u9664","layout.toast.defaultSuccess":"\u9ED8\u8BA4\u5E03\u5C40\u5DF2\u8BBE\u7F6E","layout.toast.defaultLocalSuccess":"\u9ED8\u8BA4\u5E03\u5C40\u5DF2\u5728\u672C\u5730\u5B58\u50A8\u8BBE\u7F6E","layout.toast.backendUnavailableDefaultLocal":"\u540E\u7AEF\u4E0D\u53EF\u7528\uFF0C\u9ED8\u8BA4\u5E03\u5C40\u5DF2\u4FDD\u5B58\u5230\u672C\u5730\u5B58\u50A8","dateRange.label":"\u65E5\u671F\u8303\u56F4","dateRange.startDate":"\u5F00\u59CB\u65E5\u671F","dateRange.endDate":"\u7ED3\u675F\u65E5\u671F","dateRange.select":"\u8BF7\u9009\u62E9...","dateRange.today":"\u4ECA\u5929","dateRange.thisWeek":"\u672C\u5468","dateRange.thisMonth":"\u672C\u6708","graph.records":"{count} \u6761\u8BB0\u5F55","graph.kpi.totalRecords":"\u603B\u8BB0\u5F55\u6570","graph.kpi.totalReport":"\u603B\u7533\u62A5\u5DE5\u65F6","graph.kpi.totalBillable":"\u603B\u53EF\u8BA1\u8D39\u5DE5\u65F6","graph.kpi.efficiency":"\u6548\u7387","graph.kpi.amount":"\u91D1\u989D","graph.kpi.flagged":"\u6807\u8BB0","graph.chart.billable.title":"\u7EF4\u5EA6\u8BA1\u8D39\u5DE5\u65F6","graph.chart.billable.subtitle":"\u6309\u53EF\u8BA1\u8D39\u5DE5\u65F6\u6392\u5E8F\u524D\u5217","graph.chart.efficiency.title":"\u4EBA\u5458\u6548\u7387","graph.chart.efficiency.subtitle":"\u6309\u6700\u4F4E\u6548\u7387\u4F18\u5148","graph.chart.status.title":"\u72B6\u6001\u5206\u5E03","graph.chart.status.subtitle":"\u6309\u72B6\u6001\u8BB0\u5F55\u5360\u6BD4","graph.dataBody":"\u6570\u636E\u660E\u7EC6","graph.reportTitle":"\u56FE\u8868\u62A5\u8868","graph.unassigned":"\u672A\u5206\u914D","graph.column.reportHours":"\u7533\u62A5\u5DE5\u65F6","graph.column.billableHours":"\u53EF\u8BA1\u8D39\u5DE5\u65F6","detail.searchAi.placeholder":"\u641C\u7D22\u5B57\u6BB5\uFF1B\u5982\u65E0\u7ED3\u679C\u5219\u81EA\u52A8\u89E6\u53D1 AI...","detail.searchAi.matches":"{count} \u6761\u5339\u914D\u7ED3\u679C","detail.searchAi.noMatch":"\u672A\u627E\u5230\u5339\u914D\u5B57\u6BB5\u3002","detail.searchAi.autoAiFallback":"\u672A\u547D\u4E2D\u5B57\u6BB5\uFF0C\u6B63\u5728\u89E6\u53D1 AI \u5206\u6790...","detail.searchAi.aiResultTitle":"AI \u5206\u6790\u7ED3\u679C","detail.table.title":"\u5173\u8054\u8BB0\u5F55","kanban.empty":"\u5C06\u5361\u7247\u62D6\u5230\u8FD9\u91CC","kanban.bucket.limit":"\u4E0A\u9650","kanban.bucket.dropHere":"\u91CA\u653E\u540E\u79FB\u52A8\u5230\u8BE5 bucket","kanban.card.progress":"\u8FDB\u5EA6","kanban.card.openDetail":"\u6253\u5F00\u8BE6\u60C5","kanban.priority.critical":"\u7D27\u6025","kanban.priority.high":"\u9AD8","kanban.priority.medium":"\u4E2D","kanban.priority.low":"\u4F4E","quickCreate.newItem":"\u65B0\u5EFA\u6761\u76EE","quickCreate.createWithTitle":"\u521B\u5EFA{title}","quickEdit.editWithTitle":"\u7F16\u8F91{title}","quickDelete.confirmTitle":"\u786E\u8BA4\u5220\u9664","quickDelete.confirmMessageSingle":"\u786E\u8BA4\u5220\u9664\u5F53\u524D\u9009\u4E2D\u8BB0\u5F55\u5417\uFF1F","quickDelete.confirmMessageMultiple":"\u786E\u8BA4\u5220\u9664\u5DF2\u9009\u4E2D\u7684 {count} \u6761\u8BB0\u5F55\u5417\uFF1F","messageBox.confirm":"\u786E\u5B9A","messageBox.cancel":"\u53D6\u6D88"},Fh={"common.cancel":"Annuler","common.save":"Enregistrer","common.ok":"OK","common.done":"Terminer","common.search":"Rechercher","common.none":"Aucun","common.all":"Tout","common.noData":"Aucune donn\xE9e","common.copy":"Copier","common.delete":"Supprimer","common.loading":"Chargement...","header.searchPlaceholder":"Demandez-moi...","header.searchAddFeature":"Ajouter une fonction","header.searchSend":"Envoyer","header.searchStartVoice":"D\xE9marrer la saisie vocale","header.searchStopVoice":"Arr\xEAter la saisie vocale","header.theme.system":"Th\xE8me : Syst\xE8me","header.theme.dark":"Th\xE8me : Sombre","header.theme.light":"Th\xE8me : Clair","header.menu.setting":"Param\xE8tres","header.menu.logout":"Se d\xE9connecter","navigation.expand":"D\xE9velopper la navigation","navigation.collapse":"R\xE9duire la navigation","navigation.searchPlaceholder":"Rechercher dans le menu...","navigation.noMatch":"Aucun \xE9l\xE9ment correspondant","navigation.noAccessibleApp":"Aucune application accessible","navigation.noItems":"Aucun \xE9l\xE9ment \xE0 afficher","navigation.expandView":"D\xE9velopper {title}","navigation.mode.switchToFixed":"Basculer vers la navigation fixe","navigation.mode.switchToFloating":"Basculer vers la navigation flottante","table.toolbar.searchPlaceholder":"Rechercher...","table.title.default":"Tableau de donn\xE9es","table.toolbar.groupBy":"Grouper","table.toolbar.summary":"R\xE9sum\xE9","table.toolbar.columns":"Colonnes","table.toolbar.export":"Exporter","table.toolbar.itemsPerPage":"Lignes par page :","table.toolbar.pageOf":"Page {current} sur {total}","table.toolbar.newItem":"Nouvel \xE9l\xE9ment","table.toolbar.editItem":"Modifier l'\xE9l\xE9ment","table.toolbar.deleteItem":"Supprimer l'\xE9l\xE9ment","table.toolbar.graphicReport":"Rapport graphique","table.toolbar.saveLayout":"Enregistrer la vue","table.menu.groupBy":"Grouper","table.menu.clearAll":"Tout effacer","table.menu.visibleColumns":"Colonnes visibles","table.menu.showSummaryRow":"Afficher la ligne de r\xE9sum\xE9","table.menu.noNumericColumns":"Aucune colonne num\xE9rique","table.group.expandAll":"D\xE9velopper tous les groupes","table.group.collapseAll":"R\xE9duire tous les groupes","table.mobile.notImplemented":"Vue mobile non impl\xE9ment\xE9e","table.headerMenu.sortAsc":"Trier ascendant","table.headerMenu.sortDesc":"Trier descendant","table.headerMenu.clearSort":"Effacer le tri","table.headerMenu.configureSort":"Configurer le tri...","table.headerMenu.group":"Grouper par cette colonne","table.headerMenu.ungroup":"Retirer du groupement","table.headerMenu.addSummary":"Inclure dans le r\xE9sum\xE9","table.headerMenu.removeSummary":"Retirer du r\xE9sum\xE9","table.headerMenu.hideColumn":"Masquer la colonne","table.sortDialog.title":"Param\xE8tres de tri","table.sortDialog.empty":"Aucune r\xE8gle de tri. Ajoutez-en une pour commencer.","table.sortDialog.addRule":"Ajouter une r\xE8gle","table.sortDialog.clearAll":"Tout effacer","table.sortDialog.asc":"Ascendant","table.sortDialog.desc":"Descendant","pivot.title.default":"Tableau crois\xE9 dynamique","pivot.subtitle.default":"Faites glisser les champs pour configurer le tableau crois\xE9.","pivot.empty":"Ajoutez au moins un champ de valeur pour afficher le r\xE9sultat.","pivot.records":"Enregistrements","pivot.afterFilter":"Apr\xE8s filtre","pivot.grandTotal":"Total g\xE9n\xE9ral","pivot.resultLabel":"R\xE9sultat","pivot.valueLabel":"Valeur","pivot.table.dimensions":"Dimensions","pivot.config.title":"Configuration","pivot.fieldList":"Liste des champs","pivot.availableDimensions":"Dimensions disponibles","pivot.allFieldsInUse":"Tous les champs sont d\xE9j\xE0 utilis\xE9s.","pivot.zone.rows":"Lignes","pivot.zone.columns":"Colonnes","pivot.zone.filters":"Filtres","pivot.zone.values":"Valeurs","pivot.hint.rows":"D\xE9posez les champs ici pour construire la hi\xE9rarchie des lignes","pivot.hint.columns":"D\xE9posez les champs ici pour construire la hi\xE9rarchie des colonnes","pivot.hint.filters":"D\xE9posez les champs ici pour les filtres du rapport","pivot.hint.values":"D\xE9posez les champs num\xE9riques ici pour les agr\xE9gations","pivot.clearArea":"Vider la zone","pivot.filter.na":"N/A","pivot.filter.noValues":"Aucune valeur","pivot.filter.noneSelected":"Aucune s\xE9lection","pivot.filter.allValues":"Toutes les valeurs","pivot.filter.selectedCount":"{selected} / {total} s\xE9lectionn\xE9es","pivot.filter.selectAll":"Tout s\xE9lectionner","pivot.filter.deselectAll":"Tout d\xE9s\xE9lectionner","pivot.filter.noResults":"Aucun r\xE9sultat","pivot.collapse.ariaExpand":"D\xE9velopper la zone de configuration","pivot.collapse.ariaCollapse":"R\xE9duire la zone de configuration","pivot.agg.sum":"Somme","pivot.agg.count":"Compte","pivot.agg.avg":"Moyenne","pivot.agg.min":"Min","pivot.agg.max":"Max","pivot.preset.selectPlaceholder":"S\xE9lectionner un preset","pivot.preset.save":"Enregistrer le preset","pivot.preset.delete":"Supprimer le preset","pivot.preset.saveDialogTitle":"Enregistrer le preset actuel","pivot.preset.nameLabel":"Nom du preset","pivot.preset.defaultName":"Preset {index}","pivot.table.sectionTitle":"R\xE9sultat du pivot","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"D\xE9velopper le r\xE9sultat du pivot","pivot.table.collapse.ariaCollapse":"R\xE9duire le r\xE9sultat du pivot","pivot.chart.title":"Graphique pivot","pivot.chart.subtitle":"Associez une dimension et jusqu\u2019\xE0 deux mesures dans un graphique compact.","pivot.chart.subtitleReady":"{dimension} par {measure}","pivot.chart.emptyNoDimension":"Ajoutez au moins un champ de ligne ou de colonne pour afficher le graphique.","pivot.chart.emptyNoValue":"Ajoutez au moins un champ de valeur pour afficher le graphique.","pivot.chart.emptyNoData":"Aucune donn\xE9e disponible pour la s\xE9lection actuelle du graphique.","pivot.chart.dimension":"Dimension","pivot.chart.primaryMeasure":"Mesure","pivot.chart.secondaryMeasure":"Mesure de comparaison","pivot.chart.chartType":"Type de graphique","pivot.chart.style.barVertical":"Barres verticales","pivot.chart.style.barHorizontal":"Barres horizontales","pivot.chart.style.line":"Ligne","pivot.chart.style.scatter":"Nuage de points","pivot.chart.collapse.ariaExpand":"D\xE9velopper la zone du graphique","pivot.chart.collapse.ariaCollapse":"R\xE9duire la zone du graphique","smartFilter.adaptFilters":"Adapter les filtres","smartFilter.addFilters":"Ajouter des filtres","smartFilter.go":"Ex\xE9cuter","smartFilter.visibleFilters":"Filtres visibles","smartFilter.searchPlaceholder":"Rechercher...","smartFilter.noOptionsFound":"Aucune option trouv\xE9e","smartFilter.min":"Min","smartFilter.max":"Max","smartFilter.minMaxPlaceholder":"Min - Max","smartFilter.operator.equals":"\xC9gal \xE0","smartFilter.operator.contains":"Contient","smartFilter.operator.notContains":"Ne contient pas","smartFilter.operator.wildcard":"Recherche g\xE9n\xE9rique","smartFilter.operator.notEquals":"Diff\xE9rent de","smartFilter.operator.greaterThan":"Sup\xE9rieur \xE0","smartFilter.operator.lessThan":"Inf\xE9rieur \xE0","smartFilter.operator.greaterOrEqual":"Sup\xE9rieur ou \xE9gal","smartFilter.operator.lessOrEqual":"Inf\xE9rieur ou \xE9gal","smartFilter.operator.between":"Entre","variant.noOptions":"Aucune option","variant.defaultSuffix":"Par d\xE9faut","variant.selectVariant":"S\xE9lectionner une vue","variant.saveView":"Enregistrer la vue","variant.newVariant":"Nouvelle vue","variant.viewName":"Nom de la vue","variant.setDefault":"D\xE9finir par d\xE9faut","variant.publicAllUsers":"Public (tous les utilisateurs)","variant.toast.fetchFailed":"\xC9chec du chargement des vues","variant.toast.saveFailed":"\xC9chec de l'enregistrement de la vue","variant.toast.saveSuccess":"Vue enregistr\xE9e avec succ\xE8s","variant.toast.deleteFailed":"\xC9chec de la suppression de la vue","variant.toast.deleteSuccess":"Vue supprim\xE9e avec succ\xE8s","variant.toast.defaultFailed":"\xC9chec de la mise \xE0 jour de la vue par d\xE9faut","variant.toast.defaultSuccess":"Vue par d\xE9faut mise \xE0 jour","layout.saveLayout":"Enregistrer la vue","layout.layoutOptions":"Options de vue","layout.selectLayout":"S\xE9lectionner une vue","layout.saveCurrentLayout":"Enregistrer la vue actuelle...","layout.noSavedLayouts":"Aucune vue enregistr\xE9e","layout.removeDefault":"Retirer le d\xE9faut","layout.setAsDefault":"D\xE9finir par d\xE9faut","layout.layoutName":"Nom de la vue","layout.layoutDescription":"Description","layout.layoutNameHelper":"ex. : Vue compacte","layout.warningOverwrite":"Attention : la vue existante sera \xE9cras\xE9e","layout.useAsDefault":"Utiliser comme vue par d\xE9faut","layout.publicAllUsers":"Public (visible par tous les utilisateurs)","layout.toast.loadFallback":"\xC9chec du chargement depuis le backend, bascule vers le stockage local","layout.toast.saveSuccess":"Vue enregistr\xE9e avec succ\xE8s","layout.toast.saveLocalSuccess":"Vue enregistr\xE9e dans le stockage local","layout.toast.backendUnavailableSavedLocal":"Backend indisponible, enregistr\xE9 en local","layout.toast.deleteSuccess":"Vue supprim\xE9e avec succ\xE8s","layout.toast.deleteLocalSuccess":"Vue supprim\xE9e du stockage local","layout.toast.backendUnavailableDeletedLocal":"Backend indisponible, supprim\xE9 en local","layout.toast.defaultSuccess":"Vue par d\xE9faut d\xE9finie","layout.toast.defaultLocalSuccess":"Vue par d\xE9faut d\xE9finie en local","layout.toast.backendUnavailableDefaultLocal":"Backend indisponible, d\xE9faut enregistr\xE9 en local","dateRange.label":"Plage de dates","dateRange.startDate":"Date de d\xE9but","dateRange.endDate":"Date de fin","dateRange.select":"S\xE9lectionner...","dateRange.today":"Aujourd'hui","dateRange.thisWeek":"Cette semaine","dateRange.thisMonth":"Ce mois-ci","graph.records":"{count} enregistrements","graph.kpi.totalRecords":"Total des enregistrements","graph.kpi.totalReport":"Total d\xE9clar\xE9","graph.kpi.totalBillable":"Total facturable","graph.kpi.efficiency":"Efficacit\xE9","graph.kpi.amount":"Montant","graph.kpi.flagged":"Signal\xE9","graph.chart.billable.title":"Facturable par dimension","graph.chart.billable.subtitle":"Top valeurs par heures facturables","graph.chart.efficiency.title":"Efficacit\xE9 par personne","graph.chart.efficiency.subtitle":"Efficacit\xE9 la plus faible en premier","graph.chart.status.title":"R\xE9partition des statuts","graph.chart.status.subtitle":"Ratio des enregistrements par statut","graph.dataBody":"Donn\xE9es","graph.reportTitle":"Rapport graphique","graph.unassigned":"Non attribu\xE9","graph.column.reportHours":"Heures d\xE9clar\xE9es","graph.column.billableHours":"Heures facturables","detail.searchAi.placeholder":"Rechercher des champs, ou interroger l\u2019IA en cas d\u2019absence de r\xE9sultat...","detail.searchAi.matches":"{count} correspondances trouv\xE9es","detail.searchAi.noMatch":"Aucun champ correspondant trouv\xE9.","detail.searchAi.autoAiFallback":"Aucune correspondance directe. Analyse IA en cours...","detail.searchAi.aiResultTitle":"Analyse IA","detail.table.title":"Enregistrements li\xE9s","kanban.empty":"D\xE9posez les cartes ici","kanban.bucket.limit":"Limite","kanban.bucket.dropHere":"Rel\xE2chez pour d\xE9placer dans cette colonne","kanban.card.progress":"Progression","kanban.card.openDetail":"Ouvrir le d\xE9tail","kanban.priority.critical":"Critique","kanban.priority.high":"\xC9lev\xE9e","kanban.priority.medium":"Moyenne","kanban.priority.low":"Faible","quickCreate.newItem":"Nouvel \xE9l\xE9ment","quickCreate.createWithTitle":"Cr\xE9er {title}","quickEdit.editWithTitle":"Modifier {title}","quickDelete.confirmTitle":"Confirmer la suppression","quickDelete.confirmMessageSingle":"Voulez-vous vraiment supprimer l\u2019enregistrement s\xE9lectionn\xE9 ?","quickDelete.confirmMessageMultiple":"Voulez-vous vraiment supprimer les {count} enregistrements s\xE9lectionn\xE9s ?","messageBox.confirm":"OK","messageBox.cancel":"Annuler"},Lh={"common.cancel":"Abbrechen","common.save":"Speichern","common.ok":"OK","common.done":"Fertig","common.search":"Suchen","common.none":"Keine","common.all":"Alle","common.noData":"Keine Daten","common.copy":"Kopieren","common.delete":"L\xF6schen","common.loading":"Wird geladen...","header.searchPlaceholder":"Frag mich...","header.searchAddFeature":"Funktion hinzuf\xFCgen","header.searchSend":"Senden","header.searchStartVoice":"Spracheingabe starten","header.searchStopVoice":"Spracheingabe stoppen","header.theme.system":"Theme: System","header.theme.dark":"Theme: Dunkel","header.theme.light":"Theme: Hell","header.menu.setting":"Einstellungen","header.menu.logout":"Abmelden","navigation.expand":"Navigation erweitern","navigation.collapse":"Navigation einklappen","navigation.searchPlaceholder":"Men\xFC suchen...","navigation.noMatch":"Keine passenden Men\xFCeintr\xE4ge","navigation.noAccessibleApp":"Keine verf\xFCgbaren Anwendungen","navigation.noItems":"Keine Eintr\xE4ge vorhanden","navigation.expandView":"{title} aufklappen","navigation.mode.switchToFixed":"Zu fester Navigation wechseln","navigation.mode.switchToFloating":"Zu schwebender Navigation wechseln","table.toolbar.searchPlaceholder":"Suchen...","table.title.default":"Datentabelle","table.toolbar.groupBy":"Gruppieren","table.toolbar.summary":"Zusammenfassung","table.toolbar.columns":"Spalten","table.toolbar.export":"Export","table.toolbar.itemsPerPage":"Zeilen pro Seite:","table.toolbar.pageOf":"Seite {current} von {total}","table.toolbar.newItem":"Neuer Eintrag","table.toolbar.editItem":"Eintrag bearbeiten","table.toolbar.deleteItem":"Eintrag l\xF6schen","table.toolbar.graphicReport":"Grafikbericht","table.toolbar.saveLayout":"Layout speichern","table.menu.groupBy":"Gruppieren","table.menu.clearAll":"Alles l\xF6schen","table.menu.visibleColumns":"Sichtbare Spalten","table.menu.showSummaryRow":"Summenzeile anzeigen","table.menu.noNumericColumns":"Keine numerischen Spalten","table.group.expandAll":"Alle Gruppen aufklappen","table.group.collapseAll":"Alle Gruppen zuklappen","table.mobile.notImplemented":"Mobile Ansicht nicht implementiert","table.headerMenu.sortAsc":"Aufsteigend sortieren","table.headerMenu.sortDesc":"Absteigend sortieren","table.headerMenu.clearSort":"Sortierung entfernen","table.headerMenu.configureSort":"Sortierung konfigurieren...","table.headerMenu.group":"Nach dieser Spalte gruppieren","table.headerMenu.ungroup":"Aus Gruppierung entfernen","table.headerMenu.addSummary":"In Summe einbeziehen","table.headerMenu.removeSummary":"Aus Summe entfernen","table.headerMenu.hideColumn":"Spalte ausblenden","table.sortDialog.title":"Sortiereinstellungen","table.sortDialog.empty":"Keine Sortierregeln. F\xFCgen Sie eine hinzu, um zu sortieren.","table.sortDialog.addRule":"Regel hinzuf\xFCgen","table.sortDialog.clearAll":"Alle l\xF6schen","table.sortDialog.asc":"Aufsteigend","table.sortDialog.desc":"Absteigend","pivot.title.default":"Pivot-Tabelle","pivot.subtitle.default":"Ziehen Sie Felder, um die Pivot-Tabelle zu konfigurieren.","pivot.empty":"Ziehen Sie mindestens ein Wertefeld, um das Ergebnis anzuzeigen.","pivot.records":"Datens\xE4tze","pivot.afterFilter":"Nach Filter","pivot.grandTotal":"Gesamtsumme","pivot.resultLabel":"Ergebnis","pivot.valueLabel":"Wert","pivot.table.dimensions":"Dimensionen","pivot.config.title":"Konfiguration","pivot.fieldList":"Feldliste","pivot.availableDimensions":"Verf\xFCgbare Dimensionen","pivot.allFieldsInUse":"Alle Felder sind bereits verwendet.","pivot.zone.rows":"Zeilen","pivot.zone.columns":"Spalten","pivot.zone.filters":"Filter","pivot.zone.values":"Werte","pivot.hint.rows":"Felder hierhin ziehen, um die Zeilenhierarchie zu erstellen","pivot.hint.columns":"Felder hierhin ziehen, um die Spaltenhierarchie zu erstellen","pivot.hint.filters":"Felder hierhin ziehen f\xFCr Berichtsfilter","pivot.hint.values":"Numerische Felder hierhin ziehen f\xFCr Aggregation","pivot.clearArea":"Bereich leeren","pivot.filter.na":"N/V","pivot.filter.noValues":"Keine Werte","pivot.filter.noneSelected":"Nichts ausgew\xE4hlt","pivot.filter.allValues":"Alle Werte","pivot.filter.selectedCount":"{selected} / {total} ausgew\xE4hlt","pivot.filter.selectAll":"Alle ausw\xE4hlen","pivot.filter.deselectAll":"Alle abw\xE4hlen","pivot.filter.noResults":"Keine Ergebnisse","pivot.collapse.ariaExpand":"Konfigurationsbereich erweitern","pivot.collapse.ariaCollapse":"Konfigurationsbereich reduzieren","pivot.agg.sum":"Summe","pivot.agg.count":"Anzahl","pivot.agg.avg":"Durchschnitt","pivot.agg.min":"Min","pivot.agg.max":"Max","pivot.preset.selectPlaceholder":"Preset w\xE4hlen","pivot.preset.save":"Preset speichern","pivot.preset.delete":"Preset l\xF6schen","pivot.preset.saveDialogTitle":"Aktuelles Preset speichern","pivot.preset.nameLabel":"Preset-Name","pivot.preset.defaultName":"Preset {index}","pivot.table.sectionTitle":"Pivot-Ergebnis","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"Pivot-Ergebnis erweitern","pivot.table.collapse.ariaCollapse":"Pivot-Ergebnis reduzieren","pivot.chart.title":"Pivot-Diagramm","pivot.chart.subtitle":"Eine Dimension und bis zu zwei Kennzahlen in einem kompakten Diagramm abbilden.","pivot.chart.subtitleReady":"{dimension} nach {measure}","pivot.chart.emptyNoDimension":"F\xFCgen Sie mindestens ein Zeilen- oder Spaltenfeld hinzu, um das Diagramm anzuzeigen.","pivot.chart.emptyNoValue":"F\xFCgen Sie mindestens ein Wertefeld hinzu, um das Diagramm anzuzeigen.","pivot.chart.emptyNoData":"F\xFCr die aktuelle Diagrammauswahl sind keine Daten verf\xFCgbar.","pivot.chart.dimension":"Dimension","pivot.chart.primaryMeasure":"Kennzahl","pivot.chart.secondaryMeasure":"Vergleichskennzahl","pivot.chart.chartType":"Diagrammtyp","pivot.chart.style.barVertical":"Vertikale Balken","pivot.chart.style.barHorizontal":"Horizontale Balken","pivot.chart.style.line":"Linie","pivot.chart.style.scatter":"Streudiagramm","pivot.chart.collapse.ariaExpand":"Diagrammbereich erweitern","pivot.chart.collapse.ariaCollapse":"Diagrammbereich reduzieren","smartFilter.adaptFilters":"Filter anpassen","smartFilter.addFilters":"Filter hinzuf\xFCgen","smartFilter.go":"Los","smartFilter.visibleFilters":"Sichtbare Filter","smartFilter.searchPlaceholder":"Suchen...","smartFilter.noOptionsFound":"Keine Optionen gefunden","smartFilter.min":"Min","smartFilter.max":"Max","smartFilter.minMaxPlaceholder":"Min - Max","smartFilter.operator.equals":"Gleich","smartFilter.operator.contains":"Enth\xE4lt","smartFilter.operator.notContains":"Enth\xE4lt nicht","smartFilter.operator.wildcard":"Wildcard-Suche","smartFilter.operator.notEquals":"Ungleich","smartFilter.operator.greaterThan":"Gr\xF6\xDFer als","smartFilter.operator.lessThan":"Kleiner als","smartFilter.operator.greaterOrEqual":"Gr\xF6\xDFer gleich","smartFilter.operator.lessOrEqual":"Kleiner gleich","smartFilter.operator.between":"Zwischen","variant.noOptions":"Keine Optionen","variant.defaultSuffix":"Standard","variant.selectVariant":"Variante w\xE4hlen","variant.saveView":"Ansicht speichern","variant.newVariant":"Neue Variante","variant.viewName":"Ansichtsname","variant.setDefault":"Als Standard setzen","variant.publicAllUsers":"\xD6ffentlich (alle Benutzer)","variant.toast.fetchFailed":"Varianten konnten nicht geladen werden","variant.toast.saveFailed":"Variante konnte nicht gespeichert werden","variant.toast.saveSuccess":"Variante erfolgreich gespeichert","variant.toast.deleteFailed":"Variante konnte nicht gel\xF6scht werden","variant.toast.deleteSuccess":"Variante erfolgreich gel\xF6scht","variant.toast.defaultFailed":"Standardvariante konnte nicht aktualisiert werden","variant.toast.defaultSuccess":"Standardvariante aktualisiert","layout.saveLayout":"Layout speichern","layout.layoutOptions":"Layout-Optionen","layout.selectLayout":"Layout w\xE4hlen","layout.saveCurrentLayout":"Aktuelles Layout speichern...","layout.noSavedLayouts":"Keine gespeicherten Layouts","layout.removeDefault":"Standard entfernen","layout.setAsDefault":"Als Standard setzen","layout.layoutName":"Layoutname","layout.layoutDescription":"Beschreibung","layout.layoutNameHelper":"z. B. Kompaktansicht","layout.warningOverwrite":"Warnung: Vorhandenes Layout wird \xFCberschrieben","layout.useAsDefault":"Als Standardlayout verwenden","layout.publicAllUsers":"\xD6ffentlich (f\xFCr alle sichtbar)","layout.toast.loadFallback":"Layouts konnten nicht vom Backend geladen werden, Wechsel zu lokalem Speicher","layout.toast.saveSuccess":"Layout erfolgreich gespeichert","layout.toast.saveLocalSuccess":"Layout im lokalen Speicher gespeichert","layout.toast.backendUnavailableSavedLocal":"Backend nicht verf\xFCgbar, lokal gespeichert","layout.toast.deleteSuccess":"Layout erfolgreich gel\xF6scht","layout.toast.deleteLocalSuccess":"Layout aus lokalem Speicher gel\xF6scht","layout.toast.backendUnavailableDeletedLocal":"Backend nicht verf\xFCgbar, lokal gel\xF6scht","layout.toast.defaultSuccess":"Standardlayout gesetzt","layout.toast.defaultLocalSuccess":"Standardlayout lokal gesetzt","layout.toast.backendUnavailableDefaultLocal":"Backend nicht verf\xFCgbar, Standard lokal gespeichert","dateRange.label":"Datumsbereich","dateRange.startDate":"Startdatum","dateRange.endDate":"Enddatum","dateRange.select":"Ausw\xE4hlen...","dateRange.today":"Heute","dateRange.thisWeek":"Diese Woche","dateRange.thisMonth":"Diesen Monat","graph.records":"{count} Datens\xE4tze","graph.kpi.totalRecords":"Gesamt Datens\xE4tze","graph.kpi.totalReport":"Gesamt Report","graph.kpi.totalBillable":"Gesamt abrechenbar","graph.kpi.efficiency":"Effizienz","graph.kpi.amount":"Betrag","graph.kpi.flagged":"Markiert","graph.chart.billable.title":"Abrechenbar nach Dimension","graph.chart.billable.subtitle":"Top-Werte nach abrechenbaren Stunden","graph.chart.efficiency.title":"Effizienz pro Person","graph.chart.efficiency.subtitle":"Niedrigste Effizienz zuerst","graph.chart.status.title":"Statusverteilung","graph.chart.status.subtitle":"Anteil je Status","graph.dataBody":"Datentabelle","graph.reportTitle":"Grafikbericht","graph.unassigned":"Nicht zugewiesen","graph.column.reportHours":"Melde-Stunden","graph.column.billableHours":"Abrechenbare Stunden","detail.searchAi.placeholder":"Felder suchen, oder bei keinem Treffer die KI fragen...","detail.searchAi.matches":"{count} Treffer gefunden","detail.searchAi.noMatch":"Kein passendes Feld gefunden.","detail.searchAi.autoAiFallback":"Keine direkte \xDCbereinstimmung. KI-Analyse wird gestartet...","detail.searchAi.aiResultTitle":"KI-Ergebnis","detail.table.title":"Verkn\xFCpfte Eintr\xE4ge","kanban.empty":"Karten hier ablegen","kanban.bucket.limit":"Limit","kanban.bucket.dropHere":"Loslassen, um in diese Spalte zu verschieben","kanban.card.progress":"Fortschritt","kanban.card.openDetail":"Detail \xF6ffnen","kanban.priority.critical":"Kritisch","kanban.priority.high":"Hoch","kanban.priority.medium":"Mittel","kanban.priority.low":"Niedrig","quickCreate.newItem":"Neuer Eintrag","quickCreate.createWithTitle":"{title} erstellen","quickEdit.editWithTitle":"{title} bearbeiten","quickDelete.confirmTitle":"L\xF6schen best\xE4tigen","quickDelete.confirmMessageSingle":"M\xF6chten Sie den ausgew\xE4hlten Datensatz wirklich l\xF6schen?","quickDelete.confirmMessageMultiple":"M\xF6chten Sie die {count} ausgew\xE4hlten Datens\xE4tze wirklich l\xF6schen?","messageBox.confirm":"OK","messageBox.cancel":"Abbrechen"},Nh={"common.cancel":"\u30AD\u30E3\u30F3\u30BB\u30EB","common.save":"\u4FDD\u5B58","common.ok":"OK","common.done":"\u5B8C\u4E86","common.search":"\u691C\u7D22","common.none":"\u306A\u3057","common.all":"\u3059\u3079\u3066","common.noData":"\u30C7\u30FC\u30BF\u306A\u3057","common.copy":"\u30B3\u30D4\u30FC","common.delete":"\u524A\u9664","common.loading":"\u8AAD\u307F\u8FBC\u307F\u4E2D...","header.searchPlaceholder":"\u4F55\u304B\u805E\u3044\u3066\u304F\u3060\u3055\u3044...","header.searchAddFeature":"\u6A5F\u80FD\u3092\u8FFD\u52A0","header.searchSend":"\u9001\u4FE1","header.searchStartVoice":"\u97F3\u58F0\u5165\u529B\u3092\u958B\u59CB","header.searchStopVoice":"\u97F3\u58F0\u5165\u529B\u3092\u505C\u6B62","header.theme.system":"\u30C6\u30FC\u30DE\uFF1A\u30B7\u30B9\u30C6\u30E0","header.theme.dark":"\u30C6\u30FC\u30DE\uFF1A\u30C0\u30FC\u30AF","header.theme.light":"\u30C6\u30FC\u30DE\uFF1A\u30E9\u30A4\u30C8","header.menu.setting":"\u8A2D\u5B9A","header.menu.logout":"\u30ED\u30B0\u30A2\u30A6\u30C8","navigation.expand":"\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u3092\u5C55\u958B","navigation.collapse":"\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u3092\u6298\u308A\u305F\u305F\u3080","navigation.searchPlaceholder":"\u30E1\u30CB\u30E5\u30FC\u3092\u691C\u7D22...","navigation.noMatch":"\u4E00\u81F4\u3059\u308B\u30E1\u30CB\u30E5\u30FC\u304C\u3042\u308A\u307E\u305B\u3093","navigation.noAccessibleApp":"\u30A2\u30AF\u30BB\u30B9\u53EF\u80FD\u306A\u30A2\u30D7\u30EA\u304C\u3042\u308A\u307E\u305B\u3093","navigation.noItems":"\u8868\u793A\u3067\u304D\u308B\u9805\u76EE\u304C\u3042\u308A\u307E\u305B\u3093","navigation.expandView":"{title} \u3092\u5C55\u958B","navigation.mode.switchToFixed":"\u56FA\u5B9A\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u306B\u5207\u308A\u66FF\u3048","navigation.mode.switchToFloating":"\u30D5\u30ED\u30FC\u30C6\u30A3\u30F3\u30B0\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u306B\u5207\u308A\u66FF\u3048","table.toolbar.searchPlaceholder":"\u691C\u7D22...","table.title.default":"\u30C7\u30FC\u30BF\u30C6\u30FC\u30D6\u30EB","table.toolbar.groupBy":"\u30B0\u30EB\u30FC\u30D7\u5316","table.toolbar.summary":"\u96C6\u8A08","table.toolbar.columns":"\u5217","table.toolbar.export":"\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8","table.toolbar.itemsPerPage":"1\u30DA\u30FC\u30B8\u306E\u4EF6\u6570\uFF1A","table.toolbar.pageOf":"{current} / {total} \u30DA\u30FC\u30B8","table.toolbar.newItem":"\u65B0\u898F\u4F5C\u6210","table.toolbar.editItem":"\u7DE8\u96C6","table.toolbar.deleteItem":"\u524A\u9664","table.toolbar.graphicReport":"\u30B0\u30E9\u30D5\u30A3\u30C3\u30AF\u30EC\u30DD\u30FC\u30C8","table.toolbar.saveLayout":"\u30EC\u30A4\u30A2\u30A6\u30C8\u4FDD\u5B58","table.menu.groupBy":"\u30B0\u30EB\u30FC\u30D7\u5316","table.menu.clearAll":"\u3059\u3079\u3066\u30AF\u30EA\u30A2","table.menu.visibleColumns":"\u8868\u793A\u5217","table.menu.showSummaryRow":"\u96C6\u8A08\u884C\u3092\u8868\u793A","table.menu.noNumericColumns":"\u6570\u5024\u5217\u304C\u3042\u308A\u307E\u305B\u3093","table.group.expandAll":"\u3059\u3079\u3066\u306E\u30B0\u30EB\u30FC\u30D7\u3092\u5C55\u958B","table.group.collapseAll":"\u3059\u3079\u3066\u306E\u30B0\u30EB\u30FC\u30D7\u3092\u6298\u308A\u305F\u305F\u3080","table.mobile.notImplemented":"\u30E2\u30D0\u30A4\u30EB\u8868\u793A\u306F\u672A\u5B9F\u88C5\u3067\u3059","table.headerMenu.sortAsc":"\u6607\u9806\u3067\u4E26\u3079\u66FF\u3048","table.headerMenu.sortDesc":"\u964D\u9806\u3067\u4E26\u3079\u66FF\u3048","table.headerMenu.clearSort":"\u4E26\u3079\u66FF\u3048\u3092\u89E3\u9664","table.headerMenu.configureSort":"\u4E26\u3079\u66FF\u3048\u3092\u8A2D\u5B9A...","table.headerMenu.group":"\u3053\u306E\u5217\u3067\u30B0\u30EB\u30FC\u30D7\u5316","table.headerMenu.ungroup":"\u30B0\u30EB\u30FC\u30D7\u304B\u3089\u5916\u3059","table.headerMenu.addSummary":"\u96C6\u8A08\u306B\u8FFD\u52A0","table.headerMenu.removeSummary":"\u96C6\u8A08\u304B\u3089\u524A\u9664","table.headerMenu.hideColumn":"\u5217\u3092\u975E\u8868\u793A","table.sortDialog.title":"\u4E26\u3079\u66FF\u3048\u8A2D\u5B9A","table.sortDialog.empty":"\u4E26\u3079\u66FF\u3048\u30EB\u30FC\u30EB\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","table.sortDialog.addRule":"\u30EB\u30FC\u30EB\u3092\u8FFD\u52A0","table.sortDialog.clearAll":"\u3059\u3079\u3066\u30AF\u30EA\u30A2","table.sortDialog.asc":"\u6607\u9806","table.sortDialog.desc":"\u964D\u9806","pivot.title.default":"\u30D4\u30DC\u30C3\u30C8\u30C6\u30FC\u30D6\u30EB","pivot.subtitle.default":"\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u30D4\u30DC\u30C3\u30C8\u30C6\u30FC\u30D6\u30EB\u3092\u8A2D\u5B9A\u3057\u307E\u3059\u3002","pivot.empty":"\u7D50\u679C\u3092\u8868\u793A\u3059\u308B\u306B\u306F\u3001\u5024\u30A8\u30EA\u30A2\u306B\u5C11\u306A\u304F\u3068\u30821\u3064\u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","pivot.records":"\u30EC\u30B3\u30FC\u30C9","pivot.afterFilter":"\u30D5\u30A3\u30EB\u30BF\u30FC\u5F8C","pivot.grandTotal":"\u7DCF\u8A08","pivot.resultLabel":"\u7D50\u679C","pivot.valueLabel":"\u5024","pivot.table.dimensions":"\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3","pivot.config.title":"\u8A2D\u5B9A","pivot.fieldList":"\u30D5\u30A3\u30FC\u30EB\u30C9\u4E00\u89A7","pivot.availableDimensions":"\u5229\u7528\u53EF\u80FD\u306A\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3","pivot.allFieldsInUse":"\u3059\u3079\u3066\u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u304C\u4F7F\u7528\u4E2D\u3067\u3059\u3002","pivot.zone.rows":"\u884C","pivot.zone.columns":"\u5217","pivot.zone.filters":"\u30D5\u30A3\u30EB\u30BF\u30FC","pivot.zone.values":"\u5024","pivot.hint.rows":"\u3053\u3053\u306B\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u884C\u968E\u5C64\u3092\u4F5C\u6210","pivot.hint.columns":"\u3053\u3053\u306B\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u5217\u968E\u5C64\u3092\u4F5C\u6210","pivot.hint.filters":"\u3053\u3053\u306B\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u30EC\u30DD\u30FC\u30C8\u30D5\u30A3\u30EB\u30BF\u30FC\u3092\u8A2D\u5B9A","pivot.hint.values":"\u3053\u3053\u306B\u6570\u5024\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u96C6\u8A08","pivot.clearArea":"\u30A8\u30EA\u30A2\u3092\u30AF\u30EA\u30A2","pivot.filter.na":"N/A","pivot.filter.noValues":"\u5024\u304C\u3042\u308A\u307E\u305B\u3093","pivot.filter.noneSelected":"\u672A\u9078\u629E","pivot.filter.allValues":"\u3059\u3079\u3066\u306E\u5024","pivot.filter.selectedCount":"{selected} / {total} \u3092\u9078\u629E","pivot.filter.selectAll":"\u3059\u3079\u3066\u9078\u629E","pivot.filter.deselectAll":"\u3059\u3079\u3066\u89E3\u9664","pivot.filter.noResults":"\u7D50\u679C\u304C\u3042\u308A\u307E\u305B\u3093","pivot.collapse.ariaExpand":"\u8A2D\u5B9A\u30A8\u30EA\u30A2\u3092\u5C55\u958B","pivot.collapse.ariaCollapse":"\u8A2D\u5B9A\u30A8\u30EA\u30A2\u3092\u6298\u308A\u305F\u305F\u3080","pivot.agg.sum":"\u5408\u8A08","pivot.agg.count":"\u4EF6\u6570","pivot.agg.avg":"\u5E73\u5747","pivot.agg.min":"\u6700\u5C0F","pivot.agg.max":"\u6700\u5927","pivot.preset.selectPlaceholder":"\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u9078\u629E","pivot.preset.save":"\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u4FDD\u5B58","pivot.preset.delete":"\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u524A\u9664","pivot.preset.saveDialogTitle":"\u73FE\u5728\u306E\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u4FDD\u5B58","pivot.preset.nameLabel":"\u30D7\u30EA\u30BB\u30C3\u30C8\u540D","pivot.preset.defaultName":"\u30D7\u30EA\u30BB\u30C3\u30C8 {index}","pivot.table.sectionTitle":"\u30D4\u30DC\u30C3\u30C8\u7D50\u679C","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"\u30D4\u30DC\u30C3\u30C8\u7D50\u679C\u3092\u5C55\u958B","pivot.table.collapse.ariaCollapse":"\u30D4\u30DC\u30C3\u30C8\u7D50\u679C\u3092\u6298\u308A\u305F\u305F\u3080","pivot.chart.title":"\u30D4\u30DC\u30C3\u30C8\u30C1\u30E3\u30FC\u30C8","pivot.chart.subtitle":"1\u3064\u306E\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3\u3068\u6700\u59272\u3064\u306E\u6307\u6A19\u3092\u30B3\u30F3\u30D1\u30AF\u30C8\u306A\u30C1\u30E3\u30FC\u30C8\u306B\u307E\u3068\u3081\u307E\u3059\u3002","pivot.chart.subtitleReady":"{dimension} \u3054\u3068\u306E {measure}","pivot.chart.emptyNoDimension":"\u30C1\u30E3\u30FC\u30C8\u3092\u8868\u793A\u3059\u308B\u306B\u306F\u3001\u5C11\u306A\u304F\u3068\u30821\u3064\u306E\u884C\u307E\u305F\u306F\u5217\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","pivot.chart.emptyNoValue":"\u30C1\u30E3\u30FC\u30C8\u3092\u8868\u793A\u3059\u308B\u306B\u306F\u3001\u5C11\u306A\u304F\u3068\u30821\u3064\u306E\u5024\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","pivot.chart.emptyNoData":"\u73FE\u5728\u306E\u30C1\u30E3\u30FC\u30C8\u9078\u629E\u3067\u306F\u8868\u793A\u3067\u304D\u308B\u30C7\u30FC\u30BF\u304C\u3042\u308A\u307E\u305B\u3093\u3002","pivot.chart.dimension":"\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3","pivot.chart.primaryMeasure":"\u6307\u6A19","pivot.chart.secondaryMeasure":"\u6BD4\u8F03\u6307\u6A19","pivot.chart.chartType":"\u30C1\u30E3\u30FC\u30C8\u7A2E\u5225","pivot.chart.style.barVertical":"\u7E26\u68D2\u30B0\u30E9\u30D5","pivot.chart.style.barHorizontal":"\u6A2A\u68D2\u30B0\u30E9\u30D5","pivot.chart.style.line":"\u6298\u308C\u7DDA\u30B0\u30E9\u30D5","pivot.chart.style.scatter":"\u6563\u5E03\u56F3","pivot.chart.collapse.ariaExpand":"\u30C1\u30E3\u30FC\u30C8\u9818\u57DF\u3092\u5C55\u958B","pivot.chart.collapse.ariaCollapse":"\u30C1\u30E3\u30FC\u30C8\u9818\u57DF\u3092\u6298\u308A\u305F\u305F\u3080","smartFilter.adaptFilters":"\u30D5\u30A3\u30EB\u30BF\u30FC\u8ABF\u6574","smartFilter.addFilters":"\u30D5\u30A3\u30EB\u30BF\u30FC\u8FFD\u52A0","smartFilter.go":"\u5B9F\u884C","smartFilter.visibleFilters":"\u8868\u793A\u30D5\u30A3\u30EB\u30BF\u30FC","smartFilter.searchPlaceholder":"\u691C\u7D22...","smartFilter.noOptionsFound":"\u30AA\u30D7\u30B7\u30E7\u30F3\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093","smartFilter.min":"\u6700\u5C0F","smartFilter.max":"\u6700\u5927","smartFilter.minMaxPlaceholder":"\u6700\u5C0F - \u6700\u5927","smartFilter.operator.equals":"\u7B49\u3057\u3044","smartFilter.operator.contains":"\u542B\u3080","smartFilter.operator.notContains":"\u542B\u307E\u306A\u3044","smartFilter.operator.wildcard":"\u30EF\u30A4\u30EB\u30C9\u30AB\u30FC\u30C9\u691C\u7D22","smartFilter.operator.notEquals":"\u7B49\u3057\u304F\u306A\u3044","smartFilter.operator.greaterThan":"\u3088\u308A\u5927\u304D\u3044","smartFilter.operator.lessThan":"\u3088\u308A\u5C0F\u3055\u3044","smartFilter.operator.greaterOrEqual":"\u4EE5\u4E0A","smartFilter.operator.lessOrEqual":"\u4EE5\u4E0B","smartFilter.operator.between":"\u7BC4\u56F2","variant.noOptions":"\u30AA\u30D7\u30B7\u30E7\u30F3\u306A\u3057","variant.defaultSuffix":"\u30C7\u30D5\u30A9\u30EB\u30C8","variant.selectVariant":"\u30D3\u30E5\u30FC\u3092\u9078\u629E","variant.saveView":"\u30D3\u30E5\u30FC\u4FDD\u5B58","variant.newVariant":"\u65B0\u3057\u3044\u30D3\u30E5\u30FC","variant.viewName":"\u30D3\u30E5\u30FC\u540D","variant.setDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u306B\u8A2D\u5B9A","variant.publicAllUsers":"\u516C\u958B\uFF08\u5168\u30E6\u30FC\u30B6\u30FC\uFF09","variant.toast.fetchFailed":"\u30D3\u30E5\u30FC\u306E\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.saveFailed":"\u30D3\u30E5\u30FC\u306E\u4FDD\u5B58\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.saveSuccess":"\u30D3\u30E5\u30FC\u3092\u4FDD\u5B58\u3057\u307E\u3057\u305F","variant.toast.deleteFailed":"\u30D3\u30E5\u30FC\u306E\u524A\u9664\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.deleteSuccess":"\u30D3\u30E5\u30FC\u3092\u524A\u9664\u3057\u307E\u3057\u305F","variant.toast.defaultFailed":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30D3\u30E5\u30FC\u306E\u66F4\u65B0\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.defaultSuccess":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30D3\u30E5\u30FC\u3092\u66F4\u65B0\u3057\u307E\u3057\u305F","layout.saveLayout":"\u30EC\u30A4\u30A2\u30A6\u30C8\u4FDD\u5B58","layout.layoutOptions":"\u30EC\u30A4\u30A2\u30A6\u30C8\u30AA\u30D7\u30B7\u30E7\u30F3","layout.selectLayout":"\u30EC\u30A4\u30A2\u30A6\u30C8\u9078\u629E","layout.saveCurrentLayout":"\u73FE\u5728\u306E\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u4FDD\u5B58...","layout.noSavedLayouts":"\u4FDD\u5B58\u6E08\u307F\u30EC\u30A4\u30A2\u30A6\u30C8\u306A\u3057","layout.removeDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u89E3\u9664","layout.setAsDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u306B\u8A2D\u5B9A","layout.layoutName":"\u30EC\u30A4\u30A2\u30A6\u30C8\u540D","layout.layoutDescription":"\u8AAC\u660E","layout.layoutNameHelper":"\u4F8B\uFF1A\u30B3\u30F3\u30D1\u30AF\u30C8\u8868\u793A","layout.warningOverwrite":"\u8B66\u544A\uFF1A\u65E2\u5B58\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u4E0A\u66F8\u304D\u3057\u307E\u3059","layout.useAsDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30EC\u30A4\u30A2\u30A6\u30C8\u3068\u3057\u3066\u4F7F\u7528","layout.publicAllUsers":"\u516C\u958B\uFF08\u5168\u30E6\u30FC\u30B6\u30FC\u306B\u8868\u793A\uFF09","layout.toast.loadFallback":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u304B\u3089\u306E\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u3001\u30ED\u30FC\u30AB\u30EB\u4FDD\u5B58\u306B\u5207\u308A\u66FF\u3048\u307E\u3057\u305F","layout.toast.saveSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u4FDD\u5B58\u3057\u307E\u3057\u305F","layout.toast.saveLocalSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u4FDD\u5B58\u3057\u307E\u3057\u305F","layout.toast.backendUnavailableSavedLocal":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u672A\u63A5\u7D9A\u306E\u305F\u3081\u30ED\u30FC\u30AB\u30EB\u306B\u4FDD\u5B58\u3057\u307E\u3057\u305F","layout.toast.deleteSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u524A\u9664\u3057\u307E\u3057\u305F","layout.toast.deleteLocalSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u304B\u3089\u524A\u9664\u3057\u307E\u3057\u305F","layout.toast.backendUnavailableDeletedLocal":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u672A\u63A5\u7D9A\u306E\u305F\u3081\u30ED\u30FC\u30AB\u30EB\u304B\u3089\u524A\u9664\u3057\u307E\u3057\u305F","layout.toast.defaultSuccess":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u8A2D\u5B9A\u3057\u307E\u3057\u305F","layout.toast.defaultLocalSuccess":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u306B\u8A2D\u5B9A\u3057\u307E\u3057\u305F","layout.toast.backendUnavailableDefaultLocal":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u672A\u63A5\u7D9A\u306E\u305F\u3081\u30C7\u30D5\u30A9\u30EB\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u4FDD\u5B58\u3057\u307E\u3057\u305F","dateRange.label":"\u65E5\u4ED8\u7BC4\u56F2","dateRange.startDate":"\u958B\u59CB\u65E5","dateRange.endDate":"\u7D42\u4E86\u65E5","dateRange.select":"\u9078\u629E...","dateRange.today":"\u4ECA\u65E5","dateRange.thisWeek":"\u4ECA\u9031","dateRange.thisMonth":"\u4ECA\u6708","graph.records":"{count} \u4EF6","graph.kpi.totalRecords":"\u7DCF\u30EC\u30B3\u30FC\u30C9","graph.kpi.totalReport":"\u7DCF\u5831\u544A\u6642\u9593","graph.kpi.totalBillable":"\u7DCF\u8ACB\u6C42\u53EF\u80FD\u6642\u9593","graph.kpi.efficiency":"\u52B9\u7387","graph.kpi.amount":"\u91D1\u984D","graph.kpi.flagged":"\u8981\u78BA\u8A8D","graph.chart.billable.title":"\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3\u5225\u8ACB\u6C42\u53EF\u80FD\u6642\u9593","graph.chart.billable.subtitle":"\u8ACB\u6C42\u53EF\u80FD\u6642\u9593\u306E\u4E0A\u4F4D","graph.chart.efficiency.title":"\u62C5\u5F53\u8005\u5225\u52B9\u7387","graph.chart.efficiency.subtitle":"\u52B9\u7387\u306E\u4F4E\u3044\u9806","graph.chart.status.title":"\u30B9\u30C6\u30FC\u30BF\u30B9\u5206\u5E03","graph.chart.status.subtitle":"\u30B9\u30C6\u30FC\u30BF\u30B9\u5225\u6BD4\u7387","graph.dataBody":"\u30C7\u30FC\u30BF\u672C\u4F53","graph.reportTitle":"\u30B0\u30E9\u30D5\u30A3\u30C3\u30AF\u30EC\u30DD\u30FC\u30C8","graph.unassigned":"\u672A\u5272\u308A\u5F53\u3066","graph.column.reportHours":"\u5831\u544A\u6642\u9593","graph.column.billableHours":"\u8ACB\u6C42\u53EF\u80FD\u6642\u9593","detail.searchAi.placeholder":"\u9805\u76EE\u3092\u691C\u7D22\u3002\u898B\u3064\u304B\u3089\u306A\u3044\u5834\u5408\u306FAI\u306B\u8CEA\u554F\u3057\u307E\u3059...","detail.searchAi.matches":"{count} \u4EF6\u306E\u4E00\u81F4","detail.searchAi.noMatch":"\u4E00\u81F4\u3059\u308B\u9805\u76EE\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002","detail.searchAi.autoAiFallback":"\u4E00\u81F4\u306A\u3057\u3002AI\u5206\u6790\u3092\u5B9F\u884C\u3057\u307E\u3059...","detail.searchAi.aiResultTitle":"AI\u5206\u6790\u7D50\u679C","detail.table.title":"\u95A2\u9023\u30EC\u30B3\u30FC\u30C9","kanban.empty":"\u3053\u3053\u306B\u30AB\u30FC\u30C9\u3092\u30C9\u30ED\u30C3\u30D7","kanban.bucket.limit":"\u4E0A\u9650","kanban.bucket.dropHere":"\u96E2\u3059\u3068\u3053\u306E bucket \u306B\u79FB\u52D5\u3057\u307E\u3059","kanban.card.progress":"\u9032\u6357","kanban.card.openDetail":"\u8A73\u7D30\u3092\u958B\u304F","kanban.priority.critical":"\u7DCA\u6025","kanban.priority.high":"\u9AD8","kanban.priority.medium":"\u4E2D","kanban.priority.low":"\u4F4E","quickCreate.newItem":"\u65B0\u898F\u4F5C\u6210","quickCreate.createWithTitle":"{title} \u3092\u4F5C\u6210","quickEdit.editWithTitle":"{title} \u3092\u7DE8\u96C6","quickDelete.confirmTitle":"\u524A\u9664\u306E\u78BA\u8A8D","quickDelete.confirmMessageSingle":"\u9078\u629E\u3057\u305F\u30EC\u30B3\u30FC\u30C9\u3092\u524A\u9664\u3057\u3066\u3082\u3088\u308D\u3057\u3044\u3067\u3059\u304B\uFF1F","quickDelete.confirmMessageMultiple":"\u9078\u629E\u3057\u305F {count} \u4EF6\u306E\u30EC\u30B3\u30FC\u30C9\u3092\u524A\u9664\u3057\u3066\u3082\u3088\u308D\u3057\u3044\u3067\u3059\u304B\uFF1F","messageBox.confirm":"OK","messageBox.cancel":"\u30AD\u30E3\u30F3\u30BB\u30EB"},zh={"common.cancel":"\uCDE8\uC18C","common.save":"\uC800\uC7A5","common.ok":"\uD655\uC778","common.done":"\uC644\uB8CC","common.search":"\uAC80\uC0C9","common.none":"\uC5C6\uC74C","common.all":"\uC804\uCCB4","common.noData":"\uB370\uC774\uD130 \uC5C6\uC74C","common.copy":"\uBCF5\uC0AC","common.delete":"\uC0AD\uC81C","common.loading":"\uB85C\uB529 \uC911...","header.searchPlaceholder":"\uBB34\uC5C7\uC774\uB4E0 \uBB3C\uC5B4\uBCF4\uC138\uC694...","header.searchAddFeature":"\uAE30\uB2A5 \uCD94\uAC00","header.searchSend":"\uBCF4\uB0B4\uAE30","header.searchStartVoice":"\uC74C\uC131 \uC785\uB825 \uC2DC\uC791","header.searchStopVoice":"\uC74C\uC131 \uC785\uB825 \uC911\uC9C0","header.theme.system":"\uD14C\uB9C8: \uC2DC\uC2A4\uD15C","header.theme.dark":"\uD14C\uB9C8: \uB2E4\uD06C","header.theme.light":"\uD14C\uB9C8: \uB77C\uC774\uD2B8","header.menu.setting":"\uC124\uC815","header.menu.logout":"\uB85C\uADF8\uC544\uC6C3","navigation.expand":"\uD0D0\uC0C9 \uD3BC\uCE58\uAE30","navigation.collapse":"\uD0D0\uC0C9 \uC811\uAE30","navigation.searchPlaceholder":"\uBA54\uB274 \uAC80\uC0C9...","navigation.noMatch":"\uC77C\uCE58\uD558\uB294 \uBA54\uB274\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4","navigation.noAccessibleApp":"\uC811\uADFC \uAC00\uB2A5\uD55C \uC571\uC774 \uC5C6\uC2B5\uB2C8\uB2E4","navigation.noItems":"\uD45C\uC2DC\uD560 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4","navigation.expandView":"{title} \uD3BC\uCE58\uAE30","navigation.mode.switchToFixed":"\uACE0\uC815 \uD0D0\uC0C9\uC73C\uB85C \uC804\uD658","navigation.mode.switchToFloating":"\uD50C\uB85C\uD305 \uD0D0\uC0C9\uC73C\uB85C \uC804\uD658","table.toolbar.searchPlaceholder":"\uAC80\uC0C9...","table.title.default":"\uB370\uC774\uD130 \uD14C\uC774\uBE14","table.toolbar.groupBy":"\uADF8\uB8F9","table.toolbar.summary":"\uC694\uC57D","table.toolbar.columns":"\uC5F4","table.toolbar.export":"\uB0B4\uBCF4\uB0B4\uAE30","table.toolbar.itemsPerPage":"\uD398\uC774\uC9C0\uB2F9 \uD589 \uC218:","table.toolbar.pageOf":"{current} / {total} \uD398\uC774\uC9C0","table.toolbar.newItem":"\uC2E0\uADDC \uD56D\uBAA9","table.toolbar.editItem":"\uD56D\uBAA9 \uC218\uC815","table.toolbar.deleteItem":"\uD56D\uBAA9 \uC0AD\uC81C","table.toolbar.graphicReport":"\uADF8\uB798\uD504 \uB9AC\uD3EC\uD2B8","table.toolbar.saveLayout":"\uB808\uC774\uC544\uC6C3 \uC800\uC7A5","table.menu.groupBy":"\uADF8\uB8F9","table.menu.clearAll":"\uBAA8\uB450 \uC9C0\uC6B0\uAE30","table.menu.visibleColumns":"\uD45C\uC2DC \uC5F4","table.menu.showSummaryRow":"\uC694\uC57D \uD589 \uD45C\uC2DC","table.menu.noNumericColumns":"\uC22B\uC790 \uC5F4 \uC5C6\uC74C","table.group.expandAll":"\uBAA8\uB4E0 \uADF8\uB8F9 \uD3BC\uCE58\uAE30","table.group.collapseAll":"\uBAA8\uB4E0 \uADF8\uB8F9 \uC811\uAE30","table.mobile.notImplemented":"\uBAA8\uBC14\uC77C \uBDF0\uB294 \uC544\uC9C1 \uAD6C\uD604\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4","table.headerMenu.sortAsc":"\uC624\uB984\uCC28\uC21C \uC815\uB82C","table.headerMenu.sortDesc":"\uB0B4\uB9BC\uCC28\uC21C \uC815\uB82C","table.headerMenu.clearSort":"\uC815\uB82C \uD574\uC81C","table.headerMenu.configureSort":"\uC815\uB82C \uC124\uC815...","table.headerMenu.group":"\uC774 \uC5F4\uB85C \uADF8\uB8F9\uD654","table.headerMenu.ungroup":"\uADF8\uB8F9\uC5D0\uC11C \uC81C\uAC70","table.headerMenu.addSummary":"\uC694\uC57D\uC5D0 \uCD94\uAC00","table.headerMenu.removeSummary":"\uC694\uC57D\uC5D0\uC11C \uC81C\uAC70","table.headerMenu.hideColumn":"\uC5F4 \uC228\uAE30\uAE30","table.sortDialog.title":"\uC815\uB82C \uC124\uC815","table.sortDialog.empty":"\uC815\uB82C \uADDC\uCE59\uC774 \uC5C6\uC2B5\uB2C8\uB2E4. \uCD94\uAC00\uD558\uC138\uC694.","table.sortDialog.addRule":"\uADDC\uCE59 \uCD94\uAC00","table.sortDialog.clearAll":"\uBAA8\uB450 \uC9C0\uC6B0\uAE30","table.sortDialog.asc":"\uC624\uB984\uCC28\uC21C","table.sortDialog.desc":"\uB0B4\uB9BC\uCC28\uC21C","pivot.title.default":"\uD53C\uBC97 \uD14C\uC774\uBE14","pivot.subtitle.default":"\uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uD53C\uBC97 \uD14C\uC774\uBE14\uC744 \uAD6C\uC131\uD558\uC138\uC694.","pivot.empty":"\uACB0\uACFC\uB97C \uBCF4\uB824\uBA74 \uAC12 \uC601\uC5ED\uC5D0 \uCD5C\uC18C \uD55C \uAC1C\uC758 \uD544\uB4DC\uB97C \uCD94\uAC00\uD558\uC138\uC694.","pivot.records":"\uB808\uCF54\uB4DC","pivot.afterFilter":"\uD544\uD130 \uD6C4","pivot.grandTotal":"\uCD1D\uD569","pivot.resultLabel":"\uACB0\uACFC","pivot.valueLabel":"\uAC12","pivot.table.dimensions":"\uCC28\uC6D0","pivot.config.title":"\uAD6C\uC131","pivot.fieldList":"\uD544\uB4DC \uBAA9\uB85D","pivot.availableDimensions":"\uC0AC\uC6A9 \uAC00\uB2A5\uD55C \uCC28\uC6D0","pivot.allFieldsInUse":"\uBAA8\uB4E0 \uD544\uB4DC\uAC00 \uC774\uBBF8 \uC0AC\uC6A9 \uC911\uC785\uB2C8\uB2E4.","pivot.zone.rows":"\uD589","pivot.zone.columns":"\uC5F4","pivot.zone.filters":"\uD544\uD130","pivot.zone.values":"\uAC12","pivot.hint.rows":"\uC5EC\uAE30\uC5D0 \uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uD589 \uACC4\uCE35\uC744 \uAD6C\uC131","pivot.hint.columns":"\uC5EC\uAE30\uC5D0 \uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uC5F4 \uACC4\uCE35\uC744 \uAD6C\uC131","pivot.hint.filters":"\uC5EC\uAE30\uC5D0 \uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uBCF4\uACE0\uC11C \uD544\uD130\uB85C \uC0AC\uC6A9","pivot.hint.values":"\uC22B\uC790 \uD544\uB4DC\uB97C \uC5EC\uAE30\uC5D0 \uB4DC\uB798\uADF8\uD558\uC5EC \uC9D1\uACC4","pivot.clearArea":"\uC601\uC5ED \uBE44\uC6B0\uAE30","pivot.filter.na":"\uD574\uB2F9 \uC5C6\uC74C","pivot.filter.noValues":"\uAC12 \uC5C6\uC74C","pivot.filter.noneSelected":"\uC120\uD0DD \uC5C6\uC74C","pivot.filter.allValues":"\uBAA8\uB4E0 \uAC12","pivot.filter.selectedCount":"{selected} / {total} \uC120\uD0DD\uB428","pivot.filter.selectAll":"\uC804\uCCB4 \uC120\uD0DD","pivot.filter.deselectAll":"\uC804\uCCB4 \uD574\uC81C","pivot.filter.noResults":"\uAC80\uC0C9 \uACB0\uACFC \uC5C6\uC74C","pivot.collapse.ariaExpand":"\uAD6C\uC131 \uC601\uC5ED \uD3BC\uCE58\uAE30","pivot.collapse.ariaCollapse":"\uAD6C\uC131 \uC601\uC5ED \uC811\uAE30","pivot.agg.sum":"\uD569\uACC4","pivot.agg.count":"\uAC1C\uC218","pivot.agg.avg":"\uD3C9\uADE0","pivot.agg.min":"\uCD5C\uC18C","pivot.agg.max":"\uCD5C\uB300","pivot.preset.selectPlaceholder":"\uD504\uB9AC\uC14B \uC120\uD0DD","pivot.preset.save":"\uD504\uB9AC\uC14B \uC800\uC7A5","pivot.preset.delete":"\uD504\uB9AC\uC14B \uC0AD\uC81C","pivot.preset.saveDialogTitle":"\uD604\uC7AC \uD504\uB9AC\uC14B \uC800\uC7A5","pivot.preset.nameLabel":"\uD504\uB9AC\uC14B \uC774\uB984","pivot.preset.defaultName":"\uD504\uB9AC\uC14B {index}","pivot.table.sectionTitle":"\uD53C\uBC97 \uACB0\uACFC","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"\uD53C\uBC97 \uACB0\uACFC \uD3BC\uCE58\uAE30","pivot.table.collapse.ariaCollapse":"\uD53C\uBC97 \uACB0\uACFC \uC811\uAE30","pivot.chart.title":"\uD53C\uBC97 \uCC28\uD2B8","pivot.chart.subtitle":"\uD558\uB098\uC758 \uCC28\uC6D0\uACFC \uCD5C\uB300 \uB450 \uAC1C\uC758 \uCE21\uC815\uAC12\uC744 \uAC04\uACB0\uD55C \uCC28\uD2B8\uB85C \uD45C\uC2DC\uD569\uB2C8\uB2E4.","pivot.chart.subtitleReady":"{dimension}\uBCC4 {measure}","pivot.chart.emptyNoDimension":"\uCC28\uD2B8\uB97C \uBCF4\uB824\uBA74 \uCD5C\uC18C \uD55C \uAC1C\uC758 \uD589 \uB610\uB294 \uC5F4 \uD544\uB4DC\uB97C \uCD94\uAC00\uD558\uC138\uC694.","pivot.chart.emptyNoValue":"\uCC28\uD2B8\uB97C \uBCF4\uB824\uBA74 \uCD5C\uC18C \uD55C \uAC1C\uC758 \uAC12 \uD544\uB4DC\uB97C \uCD94\uAC00\uD558\uC138\uC694.","pivot.chart.emptyNoData":"\uD604\uC7AC \uCC28\uD2B8 \uC120\uD0DD\uC5D0 \uD45C\uC2DC\uD560 \uB370\uC774\uD130\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.","pivot.chart.dimension":"\uCC28\uD2B8 \uCC28\uC6D0","pivot.chart.primaryMeasure":"\uC8FC \uCE21\uC815\uAC12","pivot.chart.secondaryMeasure":"\uBE44\uAD50 \uCE21\uC815\uAC12","pivot.chart.chartType":"\uCC28\uD2B8 \uC720\uD615","pivot.chart.style.barVertical":"\uC138\uB85C \uB9C9\uB300","pivot.chart.style.barHorizontal":"\uAC00\uB85C \uB9C9\uB300","pivot.chart.style.line":"\uC120\uD615 \uCC28\uD2B8","pivot.chart.style.scatter":"\uC0B0\uC810\uB3C4","pivot.chart.collapse.ariaExpand":"\uCC28\uD2B8 \uC601\uC5ED \uD3BC\uCE58\uAE30","pivot.chart.collapse.ariaCollapse":"\uCC28\uD2B8 \uC601\uC5ED \uC811\uAE30","smartFilter.adaptFilters":"\uD544\uD130 \uC870\uC815","smartFilter.addFilters":"\uD544\uD130 \uCD94\uAC00","smartFilter.go":"\uC2E4\uD589","smartFilter.visibleFilters":"\uD45C\uC2DC \uD544\uD130","smartFilter.searchPlaceholder":"\uAC80\uC0C9...","smartFilter.noOptionsFound":"\uC635\uC158\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4","smartFilter.min":"\uCD5C\uC18C","smartFilter.max":"\uCD5C\uB300","smartFilter.minMaxPlaceholder":"\uCD5C\uC18C - \uCD5C\uB300","smartFilter.operator.equals":"\uAC19\uC74C","smartFilter.operator.contains":"\uD3EC\uD568","smartFilter.operator.notContains":"\uBBF8\uD3EC\uD568","smartFilter.operator.wildcard":"\uC640\uC77C\uB4DC\uCE74\uB4DC \uAC80\uC0C9","smartFilter.operator.notEquals":"\uAC19\uC9C0 \uC54A\uC74C","smartFilter.operator.greaterThan":"\uBCF4\uB2E4 \uD07C","smartFilter.operator.lessThan":"\uBCF4\uB2E4 \uC791\uC74C","smartFilter.operator.greaterOrEqual":"\uC774\uC0C1","smartFilter.operator.lessOrEqual":"\uC774\uD558","smartFilter.operator.between":"\uBC94\uC704","variant.noOptions":"\uC635\uC158 \uC5C6\uC74C","variant.defaultSuffix":"\uAE30\uBCF8","variant.selectVariant":"\uBDF0 \uC120\uD0DD","variant.saveView":"\uBDF0 \uC800\uC7A5","variant.newVariant":"\uC0C8 \uBDF0","variant.viewName":"\uBDF0 \uC774\uB984","variant.setDefault":"\uAE30\uBCF8\uC73C\uB85C \uC124\uC815","variant.publicAllUsers":"\uACF5\uAC1C(\uC804\uCCB4 \uC0AC\uC6A9\uC790)","variant.toast.fetchFailed":"\uBDF0\uB97C \uBD88\uB7EC\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.saveFailed":"\uBDF0\uB97C \uC800\uC7A5\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.saveSuccess":"\uBDF0\uAC00 \uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4","variant.toast.deleteFailed":"\uBDF0\uB97C \uC0AD\uC81C\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.deleteSuccess":"\uBDF0\uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4","variant.toast.defaultFailed":"\uAE30\uBCF8 \uBDF0\uB97C \uC5C5\uB370\uC774\uD2B8\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.defaultSuccess":"\uAE30\uBCF8 \uBDF0\uAC00 \uC5C5\uB370\uC774\uD2B8\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.saveLayout":"\uB808\uC774\uC544\uC6C3 \uC800\uC7A5","layout.layoutOptions":"\uB808\uC774\uC544\uC6C3 \uC635\uC158","layout.selectLayout":"\uB808\uC774\uC544\uC6C3 \uC120\uD0DD","layout.saveCurrentLayout":"\uD604\uC7AC \uB808\uC774\uC544\uC6C3 \uC800\uC7A5...","layout.noSavedLayouts":"\uC800\uC7A5\uB41C \uB808\uC774\uC544\uC6C3 \uC5C6\uC74C","layout.removeDefault":"\uAE30\uBCF8 \uD574\uC81C","layout.setAsDefault":"\uAE30\uBCF8\uC73C\uB85C \uC124\uC815","layout.layoutName":"\uB808\uC774\uC544\uC6C3 \uC774\uB984","layout.layoutDescription":"\uC124\uBA85","layout.layoutNameHelper":"\uC608: \uCEF4\uD329\uD2B8 \uBDF0","layout.warningOverwrite":"\uACBD\uACE0: \uAE30\uC874 \uB808\uC774\uC544\uC6C3\uC774 \uB36E\uC5B4\uC4F0\uAE30 \uB429\uB2C8\uB2E4","layout.useAsDefault":"\uAE30\uBCF8 \uB808\uC774\uC544\uC6C3\uC73C\uB85C \uC0AC\uC6A9","layout.publicAllUsers":"\uACF5\uAC1C(\uBAA8\uB4E0 \uC0AC\uC6A9\uC790\uC5D0\uAC8C \uD45C\uC2DC)","layout.toast.loadFallback":"\uBC31\uC5D4\uB4DC\uC5D0\uC11C \uB808\uC774\uC544\uC6C3\uC744 \uBD88\uB7EC\uC624\uC9C0 \uBABB\uD574 \uB85C\uCEEC \uC800\uC7A5\uC18C\uB85C \uC804\uD658\uD588\uC2B5\uB2C8\uB2E4","layout.toast.saveSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.saveLocalSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uB85C\uCEEC \uC800\uC7A5\uC18C\uC5D0 \uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.backendUnavailableSavedLocal":"\uBC31\uC5D4\uB4DC\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC5B4 \uB85C\uCEEC\uC5D0 \uC800\uC7A5\uD588\uC2B5\uB2C8\uB2E4","layout.toast.deleteSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.deleteLocalSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uB85C\uCEEC \uC800\uC7A5\uC18C\uC5D0\uC11C \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.backendUnavailableDeletedLocal":"\uBC31\uC5D4\uB4DC\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC5B4 \uB85C\uCEEC\uC5D0\uC11C \uC0AD\uC81C\uD588\uC2B5\uB2C8\uB2E4","layout.toast.defaultSuccess":"\uAE30\uBCF8 \uB808\uC774\uC544\uC6C3\uC774 \uC124\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.defaultLocalSuccess":"\uAE30\uBCF8 \uB808\uC774\uC544\uC6C3\uC774 \uB85C\uCEEC\uC5D0 \uC124\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.backendUnavailableDefaultLocal":"\uBC31\uC5D4\uB4DC\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC5B4 \uAE30\uBCF8\uAC12\uC744 \uB85C\uCEEC\uC5D0 \uC800\uC7A5\uD588\uC2B5\uB2C8\uB2E4","dateRange.label":"\uB0A0\uC9DC \uBC94\uC704","dateRange.startDate":"\uC2DC\uC791\uC77C","dateRange.endDate":"\uC885\uB8CC\uC77C","dateRange.select":"\uC120\uD0DD...","dateRange.today":"\uC624\uB298","dateRange.thisWeek":"\uC774\uBC88 \uC8FC","dateRange.thisMonth":"\uC774\uBC88 \uB2EC","graph.records":"{count}\uAC74","graph.kpi.totalRecords":"\uCD1D \uB808\uCF54\uB4DC","graph.kpi.totalReport":"\uCD1D \uBCF4\uACE0 \uC2DC\uAC04","graph.kpi.totalBillable":"\uCD1D \uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04","graph.kpi.efficiency":"\uD6A8\uC728","graph.kpi.amount":"\uAE08\uC561","graph.kpi.flagged":"\uD50C\uB798\uADF8","graph.chart.billable.title":"\uCC28\uC6D0\uBCC4 \uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04","graph.chart.billable.subtitle":"\uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04 \uC0C1\uC704 \uAC12","graph.chart.efficiency.title":"\uB2F4\uB2F9\uC790\uBCC4 \uD6A8\uC728","graph.chart.efficiency.subtitle":"\uB0AE\uC740 \uD6A8\uC728 \uC6B0\uC120","graph.chart.status.title":"\uC0C1\uD0DC \uBD84\uD3EC","graph.chart.status.subtitle":"\uC0C1\uD0DC\uBCC4 \uBE44\uC728","graph.dataBody":"\uB370\uC774\uD130 \uBCF8\uBB38","graph.reportTitle":"\uADF8\uB798\uD504 \uB9AC\uD3EC\uD2B8","graph.unassigned":"\uBBF8\uC9C0\uC815","graph.column.reportHours":"\uBCF4\uACE0 \uC2DC\uAC04","graph.column.billableHours":"\uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04","detail.searchAi.placeholder":"\uD544\uB4DC\uB97C \uAC80\uC0C9\uD558\uACE0, \uACB0\uACFC\uAC00 \uC5C6\uC73C\uBA74 AI\uC5D0 \uC9C8\uBB38\uD558\uC138\uC694...","detail.searchAi.matches":"{count}\uAC1C \uC77C\uCE58 \uD56D\uBAA9","detail.searchAi.noMatch":"\uC77C\uCE58\uD558\uB294 \uD544\uB4DC\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.","detail.searchAi.autoAiFallback":"\uC77C\uCE58 \uD56D\uBAA9\uC774 \uC5C6\uC5B4 AI \uBD84\uC11D\uC744 \uC2E4\uD589\uD569\uB2C8\uB2E4...","detail.searchAi.aiResultTitle":"AI \uBD84\uC11D \uACB0\uACFC","detail.table.title":"\uAD00\uB828 \uB808\uCF54\uB4DC","kanban.empty":"\uC5EC\uAE30\uC5D0 \uCE74\uB4DC\uB97C \uB193\uC73C\uC138\uC694","kanban.bucket.limit":"\uD55C\uB3C4","kanban.bucket.dropHere":"\uB193\uC73C\uBA74 \uC774 \uBC84\uD0B7\uC73C\uB85C \uC774\uB3D9\uD569\uB2C8\uB2E4","kanban.card.progress":"\uC9C4\uD589\uB960","kanban.card.openDetail":"\uC0C1\uC138 \uC5F4\uAE30","kanban.priority.critical":"\uAE34\uAE09","kanban.priority.high":"\uB192\uC74C","kanban.priority.medium":"\uBCF4\uD1B5","kanban.priority.low":"\uB0AE\uC74C","quickCreate.newItem":"\uC2E0\uADDC \uD56D\uBAA9","quickCreate.createWithTitle":"{title} \uC0DD\uC131","quickEdit.editWithTitle":"{title} \uC218\uC815","quickDelete.confirmTitle":"\uC0AD\uC81C \uD655\uC778","quickDelete.confirmMessageSingle":"\uC120\uD0DD\uD55C \uD56D\uBAA9\uC744 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?","quickDelete.confirmMessageMultiple":"\uC120\uD0DD\uD55C {count}\uAC1C \uD56D\uBAA9\uC744 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?","messageBox.confirm":"\uD655\uC778","messageBox.cancel":"\uCDE8\uC18C"},li={en:Bh,zh:Eh,fr:Fh,de:Lh,ja:Nh,ko:zh};var bu=(e,t)=>t?e.replace(/\{(\w+)\}/g,(o,r)=>{let a=t[r];return a==null?"":String(a)}):e,Hh={locale:"en",t:(e,t)=>bu(li.en[e]||e,t)},yu=Qt.createContext(Hh),cl=({locale:e="en",messages:t,children:o})=>{let r=Qt.useMemo(()=>{let a=li[e]||li.en,n=t?.[e]||{},i={...li.en,...a,...n};return {locale:e,t:(c,d)=>bu(i[c]||c,d)}},[e,t]);return jsxRuntime.jsx(yu.Provider,{value:r,children:o})},ne=()=>Qt.useContext(yu);function sc({items:e,onItemClick:t,className:o="",level:r=0,expandedIds:a,onToggleExpand:n,colorMode:i="light"}){let{t:c}=ne(),d=i==="dark",l=navigation.usePathname(),[s,g]=Qt.useState(false),[f,p]=Qt.useState(new Set),b=a!==void 0&&n!==void 0,y=b?a:f;Qt.useEffect(()=>{g(true);},[]);let u=m=>{if(b)n(m);else {let h=new Set(f);h.has(m)?h.delete(m):h.add(m),p(h);}},C=m=>{m.children&&m.children.length>0&&u(m.id),t&&t(m);};return !e||!Array.isArray(e)?jsxRuntime.jsx("div",{className:Ho("tree-menu",o),children:jsxRuntime.jsx("div",{className:"text-sm text-gray-500 p-2",children:c("navigation.noItems")})}):jsxRuntime.jsx("div",{className:Ho("tree-menu",o),children:e.map(m=>{let h=y.has(m.id)||m.isExpanded,x=m.children&&m.children.length>0,E=56+Math.max(0,r-1)*8,R=r===0?12:x?E-24:E,T=m.appurl||m.href,I=s&&T?l===T:false;return jsxRuntime.jsxs("div",{className:"tree-menu-item relative",children:[I&&jsxRuntime.jsx("div",{className:Ho("absolute left-0 top-2 bottom-2 w-[3px] rounded-r-full z-10",d?"bg-[#90caf9]":"bg-[#1976d2]")}),jsxRuntime.jsxs(ic,{variant:"ghost",className:Ho("w-full justify-start h-auto py-2 relative overflow-hidden group",r>0?"gap-1":"gap-2",x&&h&&!I?d?"bg-white/5 text-gray-100 hover:bg-white/8":"bg-slate-50/70 text-slate-800 hover:bg-slate-100/80":"",r>=2?"min-h-9 py-1.5 rounded-md":r>0?"min-h-10 rounded-lg":"rounded-lg",I?d?"bg-transparent text-[#90caf9] hover:bg-gray-800/35":"bg-transparent text-[#1976d2] hover:bg-gray-100/60":d?"hover:bg-gray-800/50 text-gray-300":"hover:bg-gray-100/50 text-gray-700"),style:{paddingLeft:`${R}px`,paddingRight:"10px"},onClick:()=>C(m),children:[x&&jsxRuntime.jsx("div",{className:Ho("flex-shrink-0 transition-transform duration-200",h&&"rotate-90",I?d?"text-[#90caf9]":"text-[#1976d2]":d?"text-gray-500 group-hover:text-gray-300":"text-gray-400 group-hover:text-gray-600"),children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"h-4 w-4"})}),m.icon&&jsxRuntime.jsx("div",{className:Ho("flex h-4 w-4 flex-shrink-0 items-center justify-center transition-colors duration-200",I?d?"text-[#90caf9]":"text-[#1976d2]":d?"text-gray-500 group-hover:text-gray-300":"text-gray-400 group-hover:text-gray-600"),children:m.icon}),jsxRuntime.jsxs("div",{className:"flex-1 text-left overflow-hidden z-10",children:[jsxRuntime.jsx("div",{className:Ho("text-sm truncate transition-colors duration-200",I?"font-semibold":"font-medium"),children:m.title||m.label}),m.description&&jsxRuntime.jsx("div",{className:Ho("text-xs truncate transition-colors duration-200",I?d?"text-[#90caf9]/70":"text-[#1976d2]/75":d?"text-gray-400":"text-gray-500"),title:m.description,children:m.description})]})]}),x&&jsxRuntime.jsx("div",{className:Ho("grid transition-[grid-template-rows] duration-300 ease-in-out",h?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:jsxRuntime.jsx("div",{className:Ho("overflow-hidden",h&&"pt-1"),children:jsxRuntime.jsx(sc,{items:m.children,onItemClick:t,level:r+1,expandedIds:a,onToggleExpand:n,colorMode:i})})})]},m.id)})})}var dc=({collapsed:e,onToggle:t,className:o="",maxHeight:r,menuData:a=[],colorMode:n="light",displayMode:i="fixed",onDisplayModeChange:c,showDisplayModeToggle:d=true})=>{let{t:l}=ne(),s=n==="dark",g=i==="floating",f=Qt__namespace.default.useId().replace(/:/g,""),p=`orbcafe-nav-mode-arc-${f}`,b=`orbcafe-nav-mode-glow-${f}`,y=navigation.useRouter(),[u,C]=Qt.useState(""),[m,h]=Qt.useState(new Set);Qt.useEffect(()=>{e&&h(new Set);},[e]);let x=Qt.useCallback(I=>{let k=[],S=D=>{D.forEach(P=>{k.push(P.id),P.children&&S(P.children);});};return S(I),k},[]),w=Qt.useMemo(()=>{if(!u.trim())return a;let I=k=>k.reduce((S,D)=>{let P=D.title?.toLowerCase().includes(u.toLowerCase())||D.description?.toLowerCase().includes(u.toLowerCase()),M=D.children?I(D.children):[];return (P||M.length>0)&&S.push({...D,children:M.length>0?M:D.children}),S},[]);return I(a)},[u,a]),E=Qt.useMemo(()=>u.trim()?new Set(x(a)):m,[u,a,m,x]),R=Qt.useCallback(async I=>{if(console.log("\u{1F5B1}\uFE0F \u5BFC\u822A\u83DC\u5355\u9879\u70B9\u51FB:",I),I.id==="chat"||I.appurl==="/chat"){console.log("\u{1F4AC} \u68C0\u6D4B\u5230chat\u83DC\u5355\u70B9\u51FB\uFF0C\u8DF3\u8F6C\u5230\u65B0\u7684\u804A\u5929\u89C6\u56FE");try{y.push("/chat?new=true");}catch(S){console.error("\u274C \u65E0\u6CD5\u8DF3\u8F6C\u5230\u65B0\u804A\u5929\u89C6\u56FE:",S),y.push("/chat");}return}let k=I.appurl||I.href;k&&(k.startsWith("http://")||k.startsWith("https://")?window.open(k,"_blank"):y.push(k));},[y]),T=Qt.useCallback(()=>{c?.(i==="fixed"?"floating":"fixed");},[i,c]);return jsxRuntime.jsxs("div",{className:`flex flex-col backdrop-blur-xl border ${g?"shadow-[0_28px_80px_rgba(15,23,42,0.34)]":"shadow-[0_4px_8px_0_rgba(31,38,135,0.1)]"} ${e?"w-14 rounded-full":"w-[234px] rounded-2xl"} relative ${o} ${s?g?"border-white/25":"bg-[#111111] border-white/10":g?"border-white/70":"bg-white/70 border-white/30"}`,style:{backdropFilter:g?"blur(34px) saturate(230%) contrast(1.12)":"blur(16px) saturate(180%)",WebkitBackdropFilter:g?"blur(34px) saturate(230%) contrast(1.12)":"blur(16px) saturate(180%)",backgroundColor:g?s?"rgba(8, 12, 18, 0.34)":"rgba(255, 255, 255, 0.24)":void 0,backgroundImage:g?s?"radial-gradient(circle at 28% 8%, rgba(255,255,255,0.14), rgba(255,255,255,0) 44%), linear-gradient(145deg, rgba(255,255,255,0.08), rgba(255,255,255,0.015) 50%, rgba(33,188,255,0.05))":"radial-gradient(circle at 28% 8%, rgba(255,255,255,0.42), rgba(255,255,255,0) 46%), linear-gradient(145deg, rgba(255,255,255,0.22), rgba(255,255,255,0.07) 50%, rgba(33,188,255,0.08))":void 0,boxShadow:g?s?"inset 0 1px 0 rgba(255,255,255,0.20), inset 0 -1px 0 rgba(255,255,255,0.08), 0 26px 90px rgba(0,0,0,0.52), 0 0 0 1px rgba(255,255,255,0.06)":"inset 0 1px 0 rgba(255,255,255,0.88), inset 0 -1px 0 rgba(255,255,255,0.34), 0 26px 90px rgba(15,23,42,0.24), 0 0 0 1px rgba(255,255,255,0.35)":void 0,transition:"width 400ms cubic-bezier(0.4, 0.0, 0.2, 1), border-radius 0ms cubic-bezier(0.4, 0.0, 0.2, 1), box-shadow 400ms ease-out, background-color 220ms ease-out, backdrop-filter 220ms ease-out",maxHeight:r?`${r}px`:void 0},children:[jsxRuntime.jsx("div",{className:`pt-4 pb-2 transition-all duration-500 ease-in-out ${e?"px-1":"px-2"}`,children:e?jsxRuntime.jsx("div",{className:"flex justify-center",children:jsxRuntime.jsx("button",{onClick:t,className:`w-10 h-10 flex items-center justify-center rounded-lg transition-colors duration-200 ${s?"text-gray-300 hover:bg-gray-800":"text-gray-500 hover:bg-gray-50"}`,title:l("navigation.expand"),children:jsxRuntime.jsx(lucideReact.Search,{className:"h-5 w-5"})})}):jsxRuntime.jsxs("div",{className:`relative transition-opacity duration-300 ${e?"opacity-0":"opacity-100 delay-200"}`,children:[jsxRuntime.jsx("input",{type:"text",placeholder:l("navigation.searchPlaceholder"),value:u,onChange:I=>C(I.target.value),className:`w-full pl-10 pr-4 py-2 text-sm border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent ${s?"border-gray-700 bg-[#1A1A1A] text-white placeholder-gray-400":"border-gray-300 bg-white text-gray-900 placeholder-gray-500"}`}),jsxRuntime.jsx("div",{className:"absolute left-3 top-1/2 transform -translate-y-1/2 pointer-events-none",children:jsxRuntime.jsx(lucideReact.Search,{className:`h-4 w-4 ${s?"text-gray-500":"text-gray-400"}`})})]})}),jsxRuntime.jsx("nav",{className:`flex-1 pb-4 transition-all duration-500 ease-in-out overflow-y-auto min-h-0 ${e?"px-1":"px-2"}`,children:w.length===0?jsxRuntime.jsx("div",{className:"flex items-center justify-center py-8 text-gray-500 text-sm",children:e?"\u{1F4C2}":l(u?"navigation.noMatch":"navigation.noAccessibleApp")}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[!e&&jsxRuntime.jsx("div",{className:`transition-opacity duration-300 ${e?"opacity-0":"opacity-100 delay-200"}`,children:jsxRuntime.jsx(sc,{items:w,onItemClick:R,className:"space-y-1",expandedIds:E,colorMode:n,onToggleExpand:I=>{let k=new Set(m);w.some(D=>D.id===I)?k.has(I)?k.delete(I):(w.forEach(D=>{D.id!==I&&k.has(D.id)&&k.delete(D.id);}),k.add(I)):k.has(I)?k.delete(I):k.add(I),h(k);}})}),e&&jsxRuntime.jsx("div",{className:"space-y-2",children:a.map(I=>jsxRuntime.jsx("div",{className:"space-y-1",children:jsxRuntime.jsx("button",{onClick:()=>{t();let k=new Set([I.id]);h(k);},className:`w-full flex items-center justify-center p-2 rounded-lg cursor-pointer transition-colors duration-200 ${s?"text-gray-400 hover:bg-gray-800":"text-gray-600 hover:bg-gray-50"}`,title:l("navigation.expandView",{title:I.title||""}),children:I.icon||jsxRuntime.jsx("div",{className:`w-6 h-6 rounded text-xs flex items-center justify-center font-medium ${s?"bg-[#90caf9] text-[#0b0b0b]":"bg-[#1976d2] text-white"}`,children:I.title?.charAt(0)||"?"})})},I.id))})]})}),!e&&jsxRuntime.jsx("button",{onClick:t,className:`absolute -bottom-1 -right-1 w-6 h-6 bg-transparent rounded-full flex items-center justify-center transition-all duration-300 ease-in-out z-20 ${s?"hover:bg-gray-800/50":"hover:bg-white/20"}`,title:l("navigation.collapse"),children:jsxRuntime.jsx("div",{className:"absolute",style:{bottom:"0px",right:"0px",width:"16px",height:"16px",overflow:"hidden"},children:jsxRuntime.jsx("div",{className:s?"border-yellow-400":"",style:{width:"32px",height:"32px",borderRadius:"16px",border:"3px solid #21BCFF",backgroundColor:"transparent",position:"absolute",top:"-16px",left:"-16px"}})})}),d&&e&&jsxRuntime.jsx("button",{type:"button",onClick:T,className:"absolute -bottom-5 left-1/2 z-30 flex h-11 -translate-x-1/2 items-end justify-center rounded-full bg-transparent px-2 pb-1 transition-opacity duration-200 hover:opacity-95 focus:outline-none focus:ring-2 focus:ring-cyan-400/70",style:{width:"62px",touchAction:"manipulation"},title:l(g?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),"aria-label":l(g?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),children:jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 118 34",preserveAspectRatio:"none",className:"h-[34px] w-full overflow-visible",children:[jsxRuntime.jsxs("defs",{children:[jsxRuntime.jsxs("linearGradient",{id:p,x1:"0",x2:"1",y1:"0",y2:"0",children:[jsxRuntime.jsx("stop",{offset:"0%",stopColor:"#21BCFF"}),jsxRuntime.jsx("stop",{offset:"52%",stopColor:"#7C3AED"}),jsxRuntime.jsx("stop",{offset:"100%",stopColor:"#F59E0B"})]}),jsxRuntime.jsxs("filter",{id:b,x:"-70%",y:"-180%",width:"240%",height:"460%",children:[jsxRuntime.jsx("feGaussianBlur",{stdDeviation:"8.5",result:"coloredBlur"}),jsxRuntime.jsxs("feMerge",{children:[jsxRuntime.jsx("feMergeNode",{in:"coloredBlur"}),jsxRuntime.jsx("feMergeNode",{in:"SourceGraphic"})]})]})]}),jsxRuntime.jsx("path",{d:"M8 4 C27 21 91 21 110 4",fill:"none",stroke:`url(#${p})`,strokeLinecap:"round",strokeWidth:"18",opacity:g?.28:.2,filter:`url(#${b})`}),jsxRuntime.jsx("path",{d:"M8 4 C27 21 91 21 110 4",fill:"none",stroke:`url(#${p})`,strokeLinecap:"round",strokeWidth:"12",opacity:g?.4:.3,filter:`url(#${b})`}),jsxRuntime.jsx("path",{d:"M8 4 C27 21 91 21 110 4",fill:"none",stroke:`url(#${p})`,strokeLinecap:"round",strokeWidth:"6",opacity:g?.34:.25,filter:`url(#${b})`}),jsxRuntime.jsx("path",{d:"M8 4 C27 21 91 21 110 4",fill:"none",stroke:`url(#${p})`,strokeLinecap:"round",strokeWidth:"1",opacity:g?.28:.18})]})})]})};var wu=(e={})=>{let{initialCollapsed:t=false,initialDisplayMode:o="fixed",content:r=[]}=e,[a,n]=Qt.useState(t),[i,c]=Qt.useState(o),[d,l]=Qt.useState(r),s=Qt.useCallback(()=>{n(p=>!p);},[]),g=Qt.useCallback(()=>{c(p=>p==="fixed"?"floating":"fixed");},[]),f=Qt.useMemo(()=>({collapsed:a,onToggle:s,menuData:d,displayMode:i,onDisplayModeChange:c}),[a,s,d,i,c]);return {collapsed:a,setCollapsed:n,toggleCollapsed:s,displayMode:i,setDisplayMode:c,toggleDisplayMode:g,menuData:d,setMenuData:l,navigationIslandProps:f}};var ur=e=>jsxRuntime.jsx(material.Button,{...e,variant:e.variant||"contained",size:e.size||"medium",sx:{textTransform:"none",...e.sx}});var pc=class{constructor(){gu(this,"listener",null);}register(t){this.listener=t;}unregister(){this.listener=null;}show(t,o,r){this.listener&&this.listener({type:t,content:o,options:r});}hide(){this.listener&&this.listener(null);}},Vr=new pc,_P={success:(e,t)=>Vr.show("success",e,t),error:(e,t)=>Vr.show("error",e,t),warning:(e,t)=>Vr.show("warning",e,t),info:(e,t)=>Vr.show("info",e,t),show:(e,t,o)=>Vr.show(e,t,o),hide:()=>Vr.hide()};var cb={success:{icon:jsxRuntime.jsx(nb__default.default,{sx:{fontSize:40}}),color:"#e8f5e9",iconColor:"#66bb6a",borderColor:"#a5d6a7"},warning:{icon:jsxRuntime.jsx(ib__default.default,{sx:{fontSize:40}}),color:"#fff3e0",iconColor:"#ffa726",borderColor:"#ffcc80"},error:{icon:jsxRuntime.jsx(lb__default.default,{sx:{fontSize:40}}),color:"#ffebee",iconColor:"#ef5350",borderColor:"#ef9a9a"},info:{icon:jsxRuntime.jsx(sb__default.default,{sx:{fontSize:40}}),color:"#e3f2fd",iconColor:"#42a5f5",borderColor:"#90caf9"},default:{icon:null,color:"transparent",iconColor:"inherit",borderColor:"transparent"}},si=({open:e,title:t,message:o,onClose:r,onConfirm:a,confirmText:n,cancelText:i,showCancel:c=true,maxWidth:d="xs",type:l="default"})=>{let{t:s}=ne(),g=n||s("messageBox.confirm"),f=i||s("messageBox.cancel"),p=()=>{a?a():r();},b=cb[l],y=l!=="default";return jsxRuntime.jsxs(Jp__default.default,{open:e,onClose:r,maxWidth:d,fullWidth:true,PaperProps:{sx:{borderRadius:3,...y&&{borderTop:`6px solid ${b.iconColor}`}}},children:[y&&jsxRuntime.jsx(Ri__default.default,{sx:{display:"flex",justifyContent:"center",pt:3,color:b.iconColor},children:b.icon}),t&&jsxRuntime.jsx(em__default.default,{sx:{textAlign:y?"center":"left",pt:y?1:2},children:t}),jsxRuntime.jsx(tm__default.default,{sx:{textAlign:y?"center":"left"},children:typeof o=="string"?jsxRuntime.jsx(ob__default.default,{children:o}):o}),jsxRuntime.jsxs(om__default.default,{sx:{justifyContent:y?"center":"flex-end",pb:3,px:3},children:[c&&jsxRuntime.jsx(ur,{onClick:r,variant:"text",color:"inherit",children:f}),jsxRuntime.jsx(ur,{onClick:p,variant:"contained",sx:{bgcolor:y?b.iconColor:void 0,"&:hover":{bgcolor:y?b.iconColor:void 0,filter:"brightness(0.9)"}},autoFocus:true,children:g})]})]})},sR=()=>{let[e,t]=Qt__namespace.default.useState(null),[o,r]=Qt__namespace.default.useState(false);Qt__namespace.default.useEffect(()=>{let i=c=>{c?(t(c),r(true)):(r(false),t(null));};return Vr.register(i),()=>Vr.unregister()},[]);let a=()=>{r(false),e?.options?.onClose&&e.options.onClose(),t(null);},n=()=>{e?.options?.onConfirm&&e.options.onConfirm(),r(false),t(null);};return e?jsxRuntime.jsx(si,{open:o,type:e.type,message:e.content,title:e.options?.title,onClose:a,onConfirm:n,confirmText:e.options?.confirmText,cancelText:e.options?.cancelText,showCancel:e.options?.showCancel,maxWidth:e.options?.maxWidth}):null};var kb=[{field:"value",label:"Value",minWidth:120},{field:"label",label:"Description",minWidth:180}],Eu=e=>Array.isArray(e)?e:e==null||e===""?[]:[e],$o=e=>String(e),Fu=(e,t)=>e[t],Lu=e=>{let t=e.value??e.id??e.key??e.code;return typeof t=="number"||typeof t=="string"?t:""},wb=e=>{let t=e.label??e.description??e.name??e.title;return String(typeof t=="number"||typeof t=="string"?t:Lu(e))},Tb=e=>{let t=e.description??e.subtitle;return typeof t=="number"||typeof t=="string"?String(t):void 0},Nu=({value:e=null,items:t=[],columns:o,mode:r="single",dialogTitle:a="Value Help",searchPlaceholder:n="Search values...",selectLabel:i="Select",clearLabel:c="Clear",cancelLabel:d="Cancel",valueHelpLabel:l="Open value help",noResultsText:s="No matching values",loading:g=false,clearable:f=true,allowManualInput:p=true,validateManualInput:b=true,manualInputErrorText:y="Enter a valid value.",selectedItems:u=[],displayValue:C,getOptionValue:m=Lu,getOptionLabel:h=wb,getOptionDescription:x=Tb,onChange:w,onSearch:E,disabled:R,InputProps:T,onFocus:I,onBlur:k,onKeyDown:S,error:D,helperText:P,...M})=>{let B=r==="multiple",[X,L]=Qt.useState(false),[Z,$]=Qt.useState(false),[q,H]=Qt.useState(""),[re,de]=Qt.useState(null),[Ce,ve]=Qt.useState(false),[le,oe]=Qt.useState(()=>Eu(e)),[Ie,Ze]=Qt.useState(""),[Ge,ce]=Qt.useState(""),Ve=Qt.useMemo(()=>o&&o.length>0?o:kb,[o]),et=re??t,ye=Qt.useMemo(()=>{let N=[...u,...t,...re??[]],J=new Map;return N.forEach(we=>{J.set($o(m(we)),we);}),J},[m,t,re,u]),We=Qt.useMemo(()=>Eu(e),[e]),qe=Qt.useMemo(()=>We.map(String).join(", "),[We]);Qt.useEffect(()=>{X||oe(We);},[X,We]),Qt.useEffect(()=>{!Z&&!Ge&&Ze(qe);},[Z,qe,Ge]);let st=Qt.useMemo(()=>{let N=q.trim().toLowerCase();if(!N||E)return et;let J=Ve.filter(we=>we.searchable!==false);return et.filter(we=>[m(we),h(we),x(we),...J.map(tt=>Fu(we,tt.field))].some(tt=>String(tt??"").toLowerCase().includes(N)))},[et,x,h,m,E,q,Ve]),Pe=Qt.useMemo(()=>{if(C!==void 0)return C;if(We.length===0)return "";let N=J=>{let we=ye.get($o(J));if(!we)return String(J);let Me=h(we);return Me&&Me!==String(J)?`${J} - ${Me}`:String(J)};return B?We.length>2?`${We.length} selected`:We.map(N).join(", "):N(We[0])},[C,h,B,ye,We]),K=Qt.useCallback(async()=>{if(E){ve(true);try{let N=await E(q);Array.isArray(N)&&de(N);}finally{ve(false);}}},[E,q]),Ee=()=>{R||(oe(We),L(true));},ge=()=>{L(false);},ke=()=>{w?.(B?[]:null,B?[]:null),oe([]),Ze(""),ce("");},rt=N=>{let J=m(N);if(B){oe(we=>we.some(tt=>$o(tt)===$o(J))?we.filter(tt=>$o(tt)!==$o(J)):[...we,J]);return}oe([J]);},Ue=()=>{let N=le.map(J=>ye.get($o(J))).filter(J=>!!J);B?w?.(le,N):w?.(le[0]??null,N[0]??null),ce(""),L(false);},ae=N=>{if(N.key==="F4"){N.preventDefault(),Ee();return}if(N.key==="Enter"&&p&&!je(Ie,true)){N.preventDefault();return}S?.(N);},fe=N=>b?N.every(J=>ye.has($o(J))):true,je=(N,J)=>{if(B){let Me=N.split(/[,;\n]/).map(bt=>bt.trim()).filter(Boolean);if(Me.length===0)return ce(""),w?.([],[]),true;if(!fe(Me))return J&&ce(y),false;ce("");let tt=Me.map(bt=>ye.get($o(bt))).filter(bt=>!!bt);return w?.(Me,tt),true}let we=N.trim();return we?fe([we])?(ce(""),w?.(we,ye.get($o(we))??null),true):(J&&ce(y),false):(ce(""),w?.(null,null),true)},It=N=>{if(!p)return;let J=N.target.value;Ze(J),ce(""),je(J,false);},_=g||Ce,ze=We.length>0;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.TextField,{...M,disabled:R,value:p&&(Z||!!Ge)?Ie:Pe,error:!!Ge||D,helperText:Ge||P,onChange:It,onFocus:N=>{$(true),Ze(qe),I?.(N);},onBlur:N=>{p&&je(Ie,true),$(false),k?.(N);},onKeyDown:ae,InputProps:{...T,readOnly:!p,endAdornment:jsxRuntime.jsxs(material.InputAdornment,{position:"end",children:[_?jsxRuntime.jsx(material.CircularProgress,{size:18}):null,f&&ze&&!R?jsxRuntime.jsx(material.Tooltip,{title:c,children:jsxRuntime.jsx(material.IconButton,{size:"small",edge:"end","aria-label":c,onClick:ke,children:jsxRuntime.jsx(Cb__default.default,{fontSize:"small"})})}):null,jsxRuntime.jsx(material.Tooltip,{title:l,children:jsxRuntime.jsx("span",{children:jsxRuntime.jsx(material.IconButton,{size:"small",edge:"end","aria-label":l,onClick:Ee,disabled:R,children:jsxRuntime.jsx(Bu__default.default,{fontSize:"small"})})})})]})}}),jsxRuntime.jsxs(material.Dialog,{open:X,onClose:ge,fullWidth:true,maxWidth:"md",PaperProps:{sx:N=>({borderRadius:2,overflow:"hidden",border:`1px solid ${N.palette.divider}`,boxShadow:N.palette.mode==="dark"?`0 24px 80px ${styles.alpha(N.palette.common.black,.72)}`:`0 24px 80px ${styles.alpha(N.palette.common.black,.18)}`})},children:[jsxRuntime.jsxs(material.DialogTitle,{sx:N=>({display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,px:2.5,py:2,pr:1.5,borderBottom:`1px solid ${N.palette.divider}`,bgcolor:N.palette.background.paper}),children:[jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1.05rem",fontWeight:800,lineHeight:1.25},children:a}),B?jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",sx:{mt:.25},children:`${le.length} selected`}):null]}),jsxRuntime.jsx(material.IconButton,{"aria-label":"Close",onClick:ge,size:"small",children:jsxRuntime.jsx(Sb__default.default,{fontSize:"small"})})]}),jsxRuntime.jsxs(material.DialogContent,{sx:{p:0},children:[jsxRuntime.jsxs(material.Stack,{direction:{xs:"column",sm:"row"},spacing:1,sx:N=>({px:2.5,py:1.5,borderBottom:`1px solid ${N.palette.divider}`,bgcolor:N.palette.mode==="dark"?styles.alpha(N.palette.common.white,.025):styles.alpha(N.palette.primary.main,.035)}),children:[jsxRuntime.jsx(material.TextField,{size:"small",fullWidth:true,value:q,placeholder:n,onChange:N=>H(N.target.value),onKeyDown:N=>{N.key==="Enter"&&(N.preventDefault(),K());},InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(Bu__default.default,{fontSize:"small"})}),sx:N=>({borderRadius:1,bgcolor:N.palette.background.paper,"& fieldset":{borderColor:styles.alpha(N.palette.text.primary,N.palette.mode==="dark"?.2:.16)},"&:hover fieldset":{borderColor:styles.alpha(N.palette.primary.main,.52)},"&.Mui-focused fieldset":{borderColor:N.palette.primary.main}})}}),E?jsxRuntime.jsx(material.Button,{variant:"outlined",onClick:()=>{K();},disabled:_,sx:{minWidth:96,textTransform:"none",fontWeight:700},children:_?jsxRuntime.jsx(material.CircularProgress,{size:18}):"Search"}):null]}),jsxRuntime.jsx(material.TableContainer,{sx:{maxHeight:420},children:jsxRuntime.jsxs(material.Table,{stickyHeader:true,size:"small",children:[jsxRuntime.jsx(material.TableHead,{children:jsxRuntime.jsxs(material.TableRow,{children:[jsxRuntime.jsx(material.TableCell,{padding:"checkbox",sx:N=>({bgcolor:N.palette.mode==="dark"?"#111111":N.palette.background.paper,borderBottom:`1px solid ${N.palette.divider}`})}),Ve.map(N=>jsxRuntime.jsx(material.TableCell,{align:N.align,sx:J=>({minWidth:N.minWidth,width:N.width,fontSize:"0.78rem",fontWeight:800,bgcolor:J.palette.mode==="dark"?"#111111":J.palette.background.paper,borderBottom:`1px solid ${J.palette.divider}`}),children:N.label},String(N.field)))]})}),jsxRuntime.jsxs(material.TableBody,{children:[st.map(N=>{let J=m(N),we=le.some(Me=>$o(Me)===$o(J));return jsxRuntime.jsxs(material.TableRow,{hover:true,selected:we,onClick:()=>rt(N),onDoubleClick:()=>{B||(oe([J]),w?.(J,N),L(false));},sx:Me=>({cursor:"pointer","&.Mui-selected":{bgcolor:styles.alpha(Me.palette.primary.main,Me.palette.mode==="dark"?.22:.12)},"&.Mui-selected:hover":{bgcolor:styles.alpha(Me.palette.primary.main,Me.palette.mode==="dark"?.28:.18)}}),children:[jsxRuntime.jsx(material.TableCell,{padding:"checkbox",children:jsxRuntime.jsx(material.Checkbox,{size:"small",checked:we})}),Ve.map(Me=>{let tt=Fu(N,Me.field);return jsxRuntime.jsx(material.TableCell,{align:Me.align,sx:{fontSize:"0.82rem",py:1},children:Me.render?Me.render(tt,N):String(tt??"")},String(Me.field))})]},$o(J))}),st.length===0?jsxRuntime.jsx(material.TableRow,{children:jsxRuntime.jsx(material.TableCell,{colSpan:Ve.length+1,children:jsxRuntime.jsx(material.Box,{sx:{py:5,textAlign:"center",color:"text.secondary"},children:s})})}):null]})]})})]}),jsxRuntime.jsxs(material.DialogActions,{sx:N=>({px:2.5,py:1.5,borderTop:`1px solid ${N.palette.divider}`,bgcolor:N.palette.background.paper,"& .MuiButton-root":{textTransform:"none",fontWeight:700}}),children:[f&&(ze||le.length>0)?jsxRuntime.jsx(material.Button,{onClick:ke,children:c}):null,jsxRuntime.jsx(material.Box,{sx:{flex:1}}),jsxRuntime.jsx(material.Button,{onClick:ge,children:d}),jsxRuntime.jsx(material.Button,{variant:"contained",onClick:Ue,disabled:!B&&le.length===0,children:i})]})]})]})};var zu=({title:e,hideHeader:t,children:o})=>jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[!t&&jsxRuntime.jsx(material.Box,{sx:{mb:2},children:jsxRuntime.jsx(material.Typography,{variant:"h4",children:e})}),jsxRuntime.jsx(material.Box,{sx:{flex:1,overflow:"hidden"},children:o})]});var Pa={width:56,minWidth:56,maxWidth:56,paddingLeft:"4px !important",paddingRight:"4px !important",paddingTop:"0 !important",paddingBottom:"0 !important",textAlign:"center",verticalAlign:"middle",boxSizing:"border-box"},Tr={width:72,minWidth:72,maxWidth:72,paddingLeft:"4px !important",paddingRight:"4px !important",paddingTop:"0 !important",paddingBottom:"0 !important",textAlign:"center",verticalAlign:"middle",boxSizing:"border-box"},di={width:30,height:30,p:.25,flex:"0 0 auto","& .MuiSvgIcon-root":{fontSize:20}},Ir={width:30,height:30,minWidth:30,minHeight:30,p:.25,flex:"0 0 auto","& .MuiSvgIcon-root":{fontSize:20}},Ou={display:"flex",alignItems:"center",justifyContent:"center",gap:.25,width:"100%",minWidth:0},tr={...Ir,borderRadius:1};var ul=e=>{let{t}=ne(),o="0.85rem",r=Array.isArray(e.actions)?e.actions:e.actions?[e.actions]:[],a=Array.isArray(e.extraTools)?e.extraTools:e.extraTools?[e.extraTools]:[],n=[...r,...a],i=typeof e.rowsPerPage=="number"?e.rowsPerPage:20,c=Array.isArray(e.rowsPerPageOptions)&&e.rowsPerPageOptions.length>0?e.rowsPerPageOptions:[20,50,100,-1],d=typeof e.count=="number"?e.count:0,l=Math.max(0,typeof e.page=="number"?e.page:0),s=i===-1?1:Math.max(1,Math.ceil(d/i)),g=Math.min(l+1,s),f=l>0,p=l<s-1&&i!==-1,b={fontSize:o,fontWeight:600,color:"text.primary",minWidth:64,height:30,display:"flex",alignItems:"center","& .MuiSelect-select":{py:0,pl:.75,pr:"22px !important",minHeight:`${30}px !important`,height:30,display:"flex",alignItems:"center",boxSizing:"border-box"},"& .MuiSelect-icon":{right:0,fontSize:20,color:"text.primary"}};return jsxRuntime.jsxs(material.Toolbar,{sx:{pl:{sm:2},pr:{xs:1,sm:1},alignItems:"center",gap:1},children:[jsxRuntime.jsx(material.TextField,{size:"small",placeholder:t("table.toolbar.searchPlaceholder"),value:e.filterText,onChange:y=>e.setFilterText(y.target.value),InputProps:{sx:{fontSize:o,"& .MuiInputBase-input":{fontSize:o,color:"text.primary"},"& .MuiInputBase-input::placeholder":{fontSize:o,opacity:1}},startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(Bu__default.default,{fontSize:"small"})})},sx:{width:300}}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:1,ml:1},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:o,color:"text.secondary",whiteSpace:"nowrap"},children:t("table.toolbar.itemsPerPage")}),jsxRuntime.jsx(material.Select,{size:"small",variant:"standard",value:i,disableUnderline:true,onChange:y=>e.onRowsPerPageChange?.(Number(y.target.value)),sx:b,children:c.map(y=>jsxRuntime.jsx(material.MenuItem,{value:y,sx:{fontSize:o},children:y===-1?t("common.all"):y},`rows-per-page-${y}`))}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>e.onPageChange?.(Math.max(l-1,0)),disabled:!f,sx:{...tr,color:"text.primary"},children:jsxRuntime.jsx(Kb__default.default,{})}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:o,fontWeight:600,minWidth:88,textAlign:"center",color:"text.primary"},children:t("table.toolbar.pageOf",{current:g,total:s})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>e.onPageChange?.(Math.min(l+1,s-1)),disabled:!p,sx:{...tr,color:"text.primary"},children:jsxRuntime.jsx(ch__default.default,{})})]}),jsxRuntime.jsx(material.Box,{sx:{flex:1}}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",gap:1,alignItems:"center"},children:[n.length>0&&jsxRuntime.jsx(material.Box,{sx:{display:"flex",gap:1,alignItems:"center"},children:n.map((y,u)=>jsxRuntime.jsx(Qt__namespace.default.Fragment,{children:y},`toolbar-custom-${u}`))}),jsxRuntime.jsx(material.Box,{sx:{width:"1px",height:20,bgcolor:"divider",mx:.5}}),!e.disableGrouping&&jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.groupBy"),children:jsxRuntime.jsx(material.IconButton,{sx:{...tr,color:"text.primary"},onClick:y=>e.setGroupAnchorEl(y.currentTarget),children:jsxRuntime.jsx(material.Badge,{badgeContent:e.grouping?.length,color:"primary",children:jsxRuntime.jsx(Wb__default.default,{})})})}),jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.summary"),children:jsxRuntime.jsx(material.IconButton,{sx:{...tr,color:e.showSummary?"primary.main":"text.primary"},onClick:y=>e.setSummaryAnchorEl(y.currentTarget),children:jsxRuntime.jsx(Hb__default.default,{})})}),jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.columns"),children:jsxRuntime.jsx(material.IconButton,{sx:{...tr,color:"text.primary"},onClick:y=>e.setAnchorEl(y.currentTarget),children:jsxRuntime.jsx(zb__default.default,{})})}),jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.export"),children:jsxRuntime.jsx(material.IconButton,{sx:{...tr,color:"text.primary"},onClick:e.handleExport,children:jsxRuntime.jsx(Vb__default.default,{})})}),e.showCreateButton&&jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.newItem"),children:jsxRuntime.jsx(material.IconButton,{onClick:e.onOpenCreateDialog,color:"primary",sx:tr,children:jsxRuntime.jsx(Ju__default.default,{})})}),e.showEditButton&&jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.editItem"),children:jsxRuntime.jsx("span",{children:jsxRuntime.jsx(material.IconButton,{onClick:e.onOpenEditDialog,color:"primary",disabled:!!e.editDisabled,sx:tr,children:jsxRuntime.jsx(Ub__default.default,{})})})}),e.showDeleteButton&&jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.deleteItem"),children:jsxRuntime.jsx("span",{children:jsxRuntime.jsx(material.IconButton,{onClick:e.onOpenDeleteConfirm,color:"error",disabled:!!e.deleteDisabled,sx:tr,children:jsxRuntime.jsx(_b__default.default,{})})})}),e.onOpenGraphReport&&jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.graphicReport"),children:jsxRuntime.jsx(material.IconButton,{sx:{...tr,color:"text.primary"},onClick:e.onOpenGraphReport,children:jsxRuntime.jsx($b__default.default,{})})}),e.onLayoutSave&&!e.layoutManager&&jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.saveLayout"),children:jsxRuntime.jsx(material.IconButton,{sx:{...tr,color:"text.primary"},onClick:y=>e.onLayoutSave(y),children:jsxRuntime.jsx(jp__default.default,{})})}),e.layoutManager]})]})};var pl=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:o}=e;return "translate3d("+(t?Math.round(t):0)+"px, "+(o?Math.round(o):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:o}=e;return "scaleX("+t+") scaleY("+o+")"}},Transform:{toString(e){if(e)return [pl.Translate.toString(e),pl.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:o,easing:r}=e;return t+" "+o+"ms "+r}}});var gl=e=>{let{t}=ne(),{onSelectAllClick:o,order:r,orderBy:a,sortBy:n=[],numSelected:i=0,rowCount:c=0,onRequestSort:d,onContextMenu:l,columns:s,visibleColumns:g,selectionMode:f,grouping:p=[],isAllExpanded:b=false,handleToggleAll:y,onColumnResize:u,columnWidths:C,enableColumnReorder:m=false,disableSorting:h=false}=e,[x,w]=Qt.useState(null),E=Qt.useRef(null),R=$=>q=>{h||x||d($);},T=($,q,H)=>{$.preventDefault(),$.stopPropagation(),w(q),E.current={startX:$.clientX,startWidth:H,colId:q},document.addEventListener("mousemove",I),document.addEventListener("mouseup",k),document.body.style.cursor="col-resize";},I=$=>{if(!E.current)return;let{startX:q,startWidth:H,colId:re}=E.current,de=$.clientX-q,Ce=Math.max(50,H+de);u&&u(re,Ce);},k=()=>{w(null),E.current=null,document.removeEventListener("mousemove",I),document.removeEventListener("mouseup",k),document.body.style.cursor="";};Qt.useEffect(()=>()=>{document.removeEventListener("mousemove",I),document.removeEventListener("mouseup",k);},[]);let S=f==="multiple"||f==="single",D=p.length>0&&!!y,P=t(b?"table.group.collapseAll":"table.group.expandAll"),M=s.filter($=>g.includes($.id)),B=new Map(n.map(($,q)=>[$.field,{...$,priority:q+1}])),X=M.map($=>{let q=C?.[$.id]||$.minWidth||100,H=B.get($.id);return jsxRuntime.jsx(sy,{headCell:$,width:typeof q=="number"?q:100,order:r,orderBy:a,multiSortInfo:h?void 0:H,onRequestSort:R($.id),onContextMenu:l,onResizeMouseDown:re=>T(re,$.id,typeof q=="number"?q:100),enableColumnReorder:m,disableSorting:h},$.id)}),L=M.map($=>$.id),Z=jsxRuntime.jsxs(Qb__default.default,{children:[S&&jsxRuntime.jsx(vc__default.default,{padding:"checkbox",sx:$=>({...Pa,position:"sticky",top:0,zIndex:4,backgroundColor:$.palette.mode==="dark"?"#000000":"#f5f5f5",color:$.palette.mode==="dark"?"#ffffff":$.palette.text.primary}),children:jsxRuntime.jsx(Jb__default.default,{color:"primary",indeterminate:i>0&&i<c,checked:c>0&&i===c,onChange:o,disabled:f==="single",sx:di})}),D&&jsxRuntime.jsx(vc__default.default,{align:"center",padding:"checkbox",sx:$=>({...Tr,position:"sticky",top:0,zIndex:4,backgroundColor:$.palette.mode==="dark"?"#000000":"#f5f5f5",color:$.palette.mode==="dark"?"#ffffff":$.palette.text.primary}),children:jsxRuntime.jsx(oy__default.default,{title:P,children:jsxRuntime.jsx(ty__default.default,{size:"small",onClick:$=>{$.stopPropagation(),y?.(!b);},sx:Ir,children:b?jsxRuntime.jsx(ay__default.default,{}):jsxRuntime.jsx(ry__default.default,{})})})}),m?jsxRuntime.jsx(sortable.SortableContext,{items:L,strategy:sortable.horizontalListSortingStrategy,children:X}):X]});return jsxRuntime.jsx(Yb__default.default,{children:Z})},sy=({headCell:e,width:t,order:o,orderBy:r,multiSortInfo:a,onRequestSort:n,onContextMenu:i,onResizeMouseDown:c,enableColumnReorder:d,disableSorting:l})=>{let{setNodeRef:s,attributes:g,listeners:f,transform:p,transition:b,isDragging:y}=sortable.useSortable({id:e.id,disabled:!d}),u=d?{transform:pl.Transform.toString(p),transition:b,opacity:y?.6:1}:{},C=l?"asc":a?.direction??(r===e.id?o:"asc"),m=!l&&(!!a||r===e.id);return jsxRuntime.jsxs(vc__default.default,{ref:d?s:void 0,align:"left",padding:e.disablePadding?"none":"normal",sortDirection:m?C:false,onContextMenu:i?h=>i(h,e.id):void 0,style:{width:t,minWidth:t,maxWidth:t,...u},sx:h=>({position:"sticky",top:0,zIndex:4,backgroundColor:h.palette.mode==="dark"?"#000000":"#f5f5f5",color:h.palette.mode==="dark"?"#ffffff":h.palette.text.primary,fontWeight:"bold",userSelect:"none",cursor:d?y?"grabbing":"grab":void 0}),...d?g:{},...d?f:{},children:[l?jsxRuntime.jsx(Ri__default.default,{component:"span",sx:h=>({overflow:"visible",textOverflow:"clip",whiteSpace:"normal",lineHeight:1.2,wordBreak:"break-word",pr:1,display:"inline-flex",alignItems:"center",gap:.5,fontWeight:"bold",fontSize:"0.85rem",color:h.palette.mode==="dark"?"#ffffff":h.palette.text.primary}),children:e.label}):jsxRuntime.jsx(ey__default.default,{active:m,direction:C,onClick:n,sx:h=>({"&.MuiTableSortLabel-root":{width:"100%"},"& .MuiTableSortLabel-icon":{color:h.palette.mode==="dark"?"#ffffff":h.palette.text.primary,opacity:m?1:0,transition:"opacity 0.2s"},"&:hover .MuiTableSortLabel-icon":{opacity:.5},"&.Mui-active .MuiTableSortLabel-icon":{opacity:1,color:h.palette.mode==="dark"?"#ffffff":h.palette.text.primary},fontWeight:"bold",fontSize:"0.85rem",color:h.palette.mode==="dark"?"#ffffff":h.palette.text.primary}),children:jsxRuntime.jsxs(Ri__default.default,{component:"span",sx:{overflow:"visible",textOverflow:"clip",whiteSpace:"normal",lineHeight:1.2,wordBreak:"break-word",pr:1,display:"inline-flex",alignItems:"center",gap:.5},children:[e.label,a&&jsxRuntime.jsx(Ri__default.default,{component:"span",sx:h=>({display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:16,height:16,px:.5,borderRadius:999,fontSize:10,fontWeight:700,color:"#fff",backgroundColor:h.palette.primary.main}),children:a.priority})]})}),jsxRuntime.jsx(Ri__default.default,{onMouseDown:c,onPointerDown:h=>h.stopPropagation(),onClick:h=>h.stopPropagation(),sx:h=>({position:"absolute",right:0,top:0,bottom:0,width:5,cursor:"col-resize",backgroundColor:"transparent",transition:"background-color 120ms ease","&:hover":{backgroundColor:h.palette.mode==="dark"?"rgba(148,163,184,0.28)":"rgba(15,23,42,0.12)"},zIndex:1})})]})};var $u=e=>{let{t}=ne(),{visibleRows:o,visibleColumns:r,selected:a=[],handleClick:n,columns:i,toggleGroupExpand:c,expandedGroups:d=new Set,selectionMode:l,grouping:s=[],isGroupFullyExpanded:g,handleExpandGroupRecursively:f,handleCollapseGroupRecursively:p}=e,b=m=>a.indexOf(m)!==-1,y=l==="multiple"||l==="single",u=s.length>0,C=r.length+(y?1:0)+(u?1:0);return jsxRuntime.jsxs(material.TableBody,{children:[o.map((m,h)=>{if(m.type==="group"){let x=d.has(m.id),w=m.childIds||[],E=w.filter(k=>b(k)).length,R=w.length>0&&E===w.length,T=E>0&&E<w.length;return jsxRuntime.jsxs(material.TableRow,{sx:k=>({backgroundColor:k.palette.mode==="dark"?"#111111":"#f5f5f5","& .MuiTableCell-root":{color:k.palette.text.primary,borderBottomColor:k.palette.divider},"& .MuiIconButton-root":{color:k.palette.text.primary},"& .MuiCheckbox-root":{color:k.palette.text.secondary},"& .MuiCheckbox-root.Mui-checked, & .MuiCheckbox-root.MuiCheckbox-indeterminate":{color:k.palette.primary.main}}),children:[y&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",sx:Pa,children:jsxRuntime.jsx(material.Checkbox,{size:"small",checked:R,indeterminate:T,onChange:k=>{if(k.stopPropagation(),!!e.onSelectionChange)if(R){let S=a.filter(D=>!w.includes(D));e.onSelectionChange(S);}else {let S=Array.from(new Set([...a,...w]));e.onSelectionChange(S);}},onClick:k=>k.stopPropagation(),sx:di})}),u&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",sx:Tr,children:jsxRuntime.jsxs(material.Box,{sx:Ou,children:[s.length>1&&m.level<s.length-1&&jsxRuntime.jsx(material.Tooltip,{title:g?.(m.id)?t("table.group.collapseAll"):t("table.group.expandAll"),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>{g?.(m.id)?p?.(m.id):f?.(m.id);},sx:Ir,children:g?.(m.id)?jsxRuntime.jsx(ay__default.default,{}):jsxRuntime.jsx(ry__default.default,{})})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>c&&c(m.id),sx:Ir,children:x?jsxRuntime.jsx(gy__default.default,{}):jsxRuntime.jsx(ch__default.default,{})})]})}),jsxRuntime.jsx(material.TableCell,{colSpan:r.length,sx:{py:1,pl:m.level*3+1},children:jsxRuntime.jsxs(material.Typography,{variant:"body2",fontWeight:"bold",color:"text.primary",sx:{fontSize:"0.85rem"},children:[m.field,": ",m.value," (",m.count,")"]})})]},m.id)}else {let x=m.data||m,w=m.id||x.id||h,E=b(w),R=`enhanced-table-checkbox-${h}`,I=(m.level!==void 0?m.level:0)*4;return jsxRuntime.jsxs(material.TableRow,{hover:true,onClick:k=>n&&n(k,x),role:"checkbox","aria-checked":E,tabIndex:-1,selected:E,sx:{cursor:"pointer"},children:[y&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",sx:Pa,children:jsxRuntime.jsx(material.Checkbox,{color:"primary",checked:E,inputProps:{"aria-labelledby":R},sx:di})}),u&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",sx:Tr}),i.filter(k=>r.includes(k.id)).map((k,S)=>{let P=S===0&&I>0?{pl:I+2}:{};return jsxRuntime.jsx(material.TableCell,{align:"left",sx:P,children:k.render?k.render(x[k.id],x):(function(){let B=x[k.id];if(k.numeric){if(typeof B=="number")return B.toLocaleString();if(typeof B=="string"&&B.trim()!==""&&!isNaN(Number(B)))return Number(B).toLocaleString()}return B})()},k.id)})]},w)}}),o.length===0&&jsxRuntime.jsx(material.TableRow,{children:jsxRuntime.jsx(material.TableCell,{colSpan:C,align:"center",children:t("common.noData")})})]})};var Gu=e=>{let{visibleColumns:t,summaryRow:o,selectionMode:r,grouping:a=[]}=e;if(!e.showSummary)return null;let n=r==="multiple"||r==="single",i=a.length>0;return jsxRuntime.jsx(material.TableFooter,{sx:{position:"sticky",bottom:0,zIndex:e.zIndex,bgcolor:"background.paper"},children:jsxRuntime.jsxs(material.TableRow,{children:[n&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",sx:{...Pa,bgcolor:"background.paper"}}),i&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",sx:{...Tr,bgcolor:"background.paper"}}),t.map(c=>jsxRuntime.jsx(material.TableCell,{sx:{fontWeight:"bold",fontSize:"0.85rem",bgcolor:"background.paper",color:"text.primary"},children:(function(){let l=o[c];return l==null||l===""?"":typeof l=="number"?l.toLocaleString():typeof l=="string"&&l.trim()!==""&&!isNaN(Number(l))?Number(l).toLocaleString():l})()},c))]})})};var _u=e=>{let{t}=ne();return jsxRuntime.jsx(material.Box,{sx:{p:2},children:jsxRuntime.jsx(material.Typography,{children:t("table.mobile.notImplemented")})})};var sn=({groupAnchorEl:e,setGroupAnchorEl:t,grouping:o,setGrouping:r,columns:a,toggleGroupField:n})=>{let{t:i}=ne();return jsxRuntime.jsxs(material.Menu,{anchorEl:e,open:!!e,onClose:()=>t(null),children:[jsxRuntime.jsxs(material.Box,{sx:{p:1,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[jsxRuntime.jsx(material.Typography,{variant:"subtitle2",sx:{px:1},children:i("table.menu.groupBy")}),o.length>0&&jsxRuntime.jsx(material.Button,{size:"small",color:"error",onClick:()=>r([]),startIcon:jsxRuntime.jsx(Zu__default.default,{}),children:i("table.menu.clearAll")})]}),jsxRuntime.jsx(material.Divider,{}),a.map(c=>{let d=o.includes(c.id),l=o.indexOf(c.id)+1;return jsxRuntime.jsx(material.MenuItem,{onClick:()=>n(c.id),children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",width:"100%"},children:[jsxRuntime.jsx(material.Checkbox,{checked:d,size:"small"}),jsxRuntime.jsx(material.ListItemText,{primary:c.label}),d&&jsxRuntime.jsx(material.Badge,{badgeContent:l,color:"primary",sx:{mr:2}})]})},c.id)})]})},cn=({anchorEl:e,setAnchorEl:t,columns:o,visibleColumns:r,toggleColumnVisibility:a})=>{let{t:n}=ne();return jsxRuntime.jsxs(material.Menu,{anchorEl:e,open:!!e,onClose:()=>t(null),children:[jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.ListItemText,{primary:n("table.menu.visibleColumns")})}),jsxRuntime.jsx(material.Divider,{}),o.map(i=>jsxRuntime.jsxs(material.MenuItem,{onClick:()=>a(i.id),children:[jsxRuntime.jsx(material.Checkbox,{checked:r.includes(i.id),size:"small"}),jsxRuntime.jsx(material.ListItemText,{primary:i.label})]},i.id))]})},bl=({anchorEl:e,setAnchorEl:t,showSummary:o,setShowSummary:r,columns:a,summaryColumns:n,toggleSummaryColumn:i})=>{let{t:c}=ne();return jsxRuntime.jsxs(material.Menu,{anchorEl:e,open:!!e,onClose:()=>t(null),children:[jsxRuntime.jsx(material.MenuItem,{children:jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Switch,{checked:o,onChange:d=>r(d.target.checked),size:"small"}),label:c("table.menu.showSummaryRow")})}),jsxRuntime.jsx(material.Divider,{}),a.filter(d=>d.numeric).map(d=>jsxRuntime.jsxs(material.MenuItem,{onClick:()=>i(d.id),disabled:!o,children:[jsxRuntime.jsx(material.Checkbox,{checked:n.includes(d.id),size:"small"}),jsxRuntime.jsx(material.ListItemText,{primary:d.label})]},d.id)),a.filter(d=>d.numeric).length===0&&jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.ListItemText,{primary:c("table.menu.noNumericColumns")})})]})},yl=({contextMenu:e,handleCloseContextMenu:t,columns:o,visibleColumns:r,toggleColumnVisibility:a})=>{let{t:n}=ne();return jsxRuntime.jsxs(material.Menu,{open:e!==null,onClose:t,anchorReference:"anchorPosition",anchorPosition:e!==null?{top:e.mouseY,left:e.mouseX}:void 0,children:[jsxRuntime.jsx(material.MenuItem,{onClick:t,children:n("common.copy")}),jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsx(material.MenuItem,{disabled:true,children:n("table.menu.visibleColumns")}),o.map(i=>jsxRuntime.jsxs(material.MenuItem,{onClick:()=>a(i.id),children:[jsxRuntime.jsx(material.ListItemIcon,{children:r.includes(i.id)&&jsxRuntime.jsx(Ry__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{children:i.label})]},i.id))]})},ep=({contextMenu:e,handleClose:t,columns:o,visibleColumns:r,grouping:a,summaryColumns:n,showSummary:i,sortBy:c,orderBy:d,order:l,onSortAsc:s,onSortDesc:g,onClearSort:f,onHideColumn:p,onToggleGroup:b,onToggleSummary:y,onOpenSortDialog:u})=>{let{t:C}=ne(),m=e?.columnId??"",h=o.find(S=>S.id===m),x=a.includes(m),w=n.includes(m),E=!!h?.numeric,R=c.find(S=>S.field===m),T=R?R.direction==="asc":d===m&&l==="asc",I=R?R.direction==="desc":d===m&&l==="desc",k=T||I;return jsxRuntime.jsxs(material.Menu,{open:e!==null,onClose:t,anchorReference:"anchorPosition",anchorPosition:e!==null?{top:e.mouseY,left:e.mouseX}:void 0,children:[jsxRuntime.jsx(material.MenuItem,{disabled:true,sx:{opacity:"1 !important",fontWeight:700},children:jsxRuntime.jsx(material.ListItemText,{primary:h?.label??m})}),jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsxs(material.MenuItem,{onClick:()=>{s(m),t();},selected:T,children:[jsxRuntime.jsx(material.ListItemIcon,{children:jsxRuntime.jsx(Yu__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{primary:C("table.headerMenu.sortAsc")})]}),jsxRuntime.jsxs(material.MenuItem,{onClick:()=>{g(m),t();},selected:I,children:[jsxRuntime.jsx(material.ListItemIcon,{children:jsxRuntime.jsx(Qu__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{primary:C("table.headerMenu.sortDesc")})]}),k&&jsxRuntime.jsxs(material.MenuItem,{onClick:()=>{f(m),t();},children:[jsxRuntime.jsx(material.ListItemIcon,{children:jsxRuntime.jsx(Zu__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{primary:C("table.headerMenu.clearSort")})]}),jsxRuntime.jsxs(material.MenuItem,{onClick:()=>{u(),t();},children:[jsxRuntime.jsx(material.ListItemIcon,{children:jsxRuntime.jsx(Ju__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{primary:C("table.headerMenu.configureSort")})]}),jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsxs(material.MenuItem,{onClick:()=>{b(m),t();},selected:x,children:[jsxRuntime.jsx(material.ListItemIcon,{children:jsxRuntime.jsx(Wb__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{primary:C(x?"table.headerMenu.ungroup":"table.headerMenu.group")})]}),E&&i&&jsxRuntime.jsxs(material.MenuItem,{onClick:()=>{y(m),t();},selected:w,children:[jsxRuntime.jsx(material.ListItemIcon,{children:jsxRuntime.jsx(Hb__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{primary:C(w?"table.headerMenu.removeSummary":"table.headerMenu.addSummary")})]}),jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsxs(material.MenuItem,{onClick:()=>{p(m),t();},children:[jsxRuntime.jsx(material.ListItemIcon,{children:jsxRuntime.jsx(My__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{primary:C("table.headerMenu.hideColumn")})]})]})},tp=({open:e,onClose:t,columns:o,initialRules:r,onApply:a,onClear:n})=>{let{t:i}=ne(),[c,d]=Qt.useState([]);Qt.useEffect(()=>{e&&d(r.length>0?r.map(y=>({...y})):[]);},[e,r]);let l=Qt.useMemo(()=>new Set(c.map(y=>y.field)),[c]),s=Qt.useMemo(()=>o.filter(y=>!l.has(y.id)),[o,l]),g=()=>{let y=s[0];y&&d(u=>[...u,{field:y.id,direction:"asc"}]);},f=y=>{d(u=>u.filter((C,m)=>m!==y));},p=(y,u)=>{d(C=>C.map((m,h)=>h===y?{...m,...u}:m));},b=(y,u)=>{d(C=>{let m=y+u;if(m<0||m>=C.length)return C;let h=[...C],[x]=h.splice(y,1);return h.splice(m,0,x),h});};return jsxRuntime.jsxs(material.Dialog,{open:e,onClose:t,maxWidth:"sm",fullWidth:true,children:[jsxRuntime.jsx(material.DialogTitle,{children:i("table.sortDialog.title")}),jsxRuntime.jsxs(material.DialogContent,{dividers:true,children:[c.length===0?jsxRuntime.jsx(material.Typography,{variant:"body2",sx:{color:"text.secondary",py:2},children:i("table.sortDialog.empty")}):jsxRuntime.jsx(material.Stack,{spacing:1,children:c.map((y,u)=>{let C=new Set(c.filter((h,x)=>x!==u).map(h=>h.field)),m=o.filter(h=>!C.has(h.id));return jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:"24px 1fr 110px auto auto",alignItems:"center",gap:1},children:[jsxRuntime.jsx(material.Badge,{badgeContent:u+1,color:"primary",sx:{ml:.5}}),jsxRuntime.jsx("select",{value:y.field,onChange:h=>p(u,{field:h.target.value}),style:{padding:6,fontSize:13,borderRadius:4},children:m.map(h=>jsxRuntime.jsx("option",{value:h.id,children:h.label},h.id))}),jsxRuntime.jsxs("select",{value:y.direction,onChange:h=>p(u,{direction:h.target.value}),style:{padding:6,fontSize:13,borderRadius:4},children:[jsxRuntime.jsx("option",{value:"asc",children:i("table.sortDialog.asc")}),jsxRuntime.jsx("option",{value:"desc",children:i("table.sortDialog.desc")})]}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>b(u,-1),disabled:u===0,children:jsxRuntime.jsx(Yu__default.default,{fontSize:"small"})}),jsxRuntime.jsxs(material.Stack,{direction:"row",children:[jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>b(u,1),disabled:u===c.length-1,children:jsxRuntime.jsx(Qu__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>f(u),children:jsxRuntime.jsx(By__default.default,{fontSize:"small"})})]})]},`sort-rule-${u}`)})}),jsxRuntime.jsx(material.Button,{size:"small",onClick:g,disabled:s.length===0,startIcon:jsxRuntime.jsx(Ju__default.default,{}),sx:{mt:2},children:i("table.sortDialog.addRule")})]}),jsxRuntime.jsxs(material.DialogActions,{children:[jsxRuntime.jsx(material.Button,{color:"inherit",onClick:()=>{n(),t();},children:i("table.sortDialog.clearAll")}),jsxRuntime.jsx(material.Box,{sx:{flex:1}}),jsxRuntime.jsx(material.Button,{onClick:t,children:i("common.cancel")}),jsxRuntime.jsx(material.Button,{variant:"contained",onClick:()=>{a(c),t();},children:i("common.ok")})]})]})};var hi=(e,t=2)=>e.toLocaleString(void 0,{maximumFractionDigits:t}),rp=({kpis:e})=>{let{t}=ne(),o=[{label:t("graph.kpi.totalRecords"),value:hi(e.totalRecords,0),color:"text.primary"},{label:t("graph.kpi.totalReport"),value:hi(e.totalReportHours),color:"text.primary"},{label:t("graph.kpi.totalBillable"),value:hi(e.totalBillableHours),color:"success.main"},{label:t("graph.kpi.efficiency"),value:`${e.efficiency.toFixed(2)}%`,color:"warning.main"},{label:t("graph.kpi.amount"),value:hi(e.totalAmount),color:"info.main"},{label:t("graph.kpi.flagged"),value:hi(e.flaggedCount,0),color:"error.main"}];return jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",lg:"repeat(6, minmax(0, 1fr))"},gap:1.5},children:o.map(r=>jsxRuntime.jsxs(material.Paper,{variant:"outlined",sx:{p:1.5,borderRadius:2,minHeight:96,display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",children:r.label}),jsxRuntime.jsx(material.Typography,{variant:"h4",fontWeight:800,sx:{color:r.color},children:r.value})]},r.label))})};var xl=({title:e,subtitle:t,children:o})=>jsxRuntime.jsxs(material.Paper,{variant:"outlined",sx:{p:2,borderRadius:2},children:[jsxRuntime.jsx(material.Typography,{variant:"subtitle1",fontWeight:700,children:e}),t&&jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",sx:{mb:2},children:t}),o]});var yi=({data:e,orientation:t="horizontal",valueSuffix:o="",minHeight:r=210,activeName:a,onItemClick:n})=>{if(e.length===0)return jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:"No data"});let i=Math.max(...e.map(c=>c.value),1);return t==="vertical"?jsxRuntime.jsx(material.Box,{sx:{display:"flex",gap:1,alignItems:"flex-end",minHeight:r},children:e.map(c=>jsxRuntime.jsxs(material.Box,{sx:{flex:1,minWidth:0},children:[jsxRuntime.jsx(material.Box,{onClick:()=>n?.(c),sx:{height:`${Math.max(c.value/i*180,6)}px`,bgcolor:c.name===a?"primary.dark":"primary.main",borderRadius:"8px 8px 0 0",cursor:n?"pointer":"default",opacity:a&&c.name!==a?.45:1}}),jsxRuntime.jsx(material.Typography,{variant:"caption",noWrap:true,title:c.name,sx:{display:"block",mt:.5},children:c.name}),jsxRuntime.jsxs(material.Typography,{variant:"caption",color:"text.secondary",children:[c.value.toFixed(1),o]})]},c.name))}):jsxRuntime.jsx(material.Stack,{spacing:1,children:e.map(c=>jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:"140px 1fr 64px",gap:1},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",noWrap:true,title:c.name,children:c.name}),jsxRuntime.jsx(material.Box,{onClick:()=>n?.(c),sx:{alignSelf:"center",bgcolor:"action.hover",height:10,borderRadius:999,overflow:"hidden",cursor:n?"pointer":"default",opacity:a&&c.name!==a?.45:1},children:jsxRuntime.jsx(material.Box,{sx:{width:`${c.value/i*100}%`,height:"100%",bgcolor:c.name===a?"primary.dark":"primary.main"}})}),jsxRuntime.jsxs(material.Typography,{variant:"caption",sx:{textAlign:"right",fontWeight:600},children:[c.value.toFixed(1),o]})]},c.name))})};var ip=({data:e,color:t="#42A5F5",valueSuffix:o="",height:r=220})=>{if(e.length===0)return jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:"No data"});let a=640,n=28,i=e.map(f=>f.value),c=Math.min(...i,0),l=Math.max(...i,1)-c||1,s=e.map((f,p)=>{let b=n+p*(a-n*2)/Math.max(e.length-1,1),y=r-n-(f.value-c)/l*(r-n*2);return {x:b,y,...f}}),g=s.map(f=>`${f.x},${f.y}`).join(" ");return jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsxs(material.Box,{component:"svg",viewBox:`0 0 ${a} ${r}`,sx:{width:"100%",height:r},children:[jsxRuntime.jsx("line",{x1:n,y1:r-n,x2:a-n,y2:r-n,stroke:"rgba(148,163,184,0.4)"}),jsxRuntime.jsx("polyline",{fill:"none",stroke:t,strokeWidth:3,points:g}),s.map(f=>jsxRuntime.jsx("circle",{cx:f.x,cy:f.y,r:4,fill:t},f.name))]}),jsxRuntime.jsx(material.Box,{sx:{mt:1,display:"grid",gridTemplateColumns:`repeat(${e.length}, minmax(0, 1fr))`,gap:1},children:e.map(f=>jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",noWrap:true,title:f.name,sx:{display:"block"},children:f.name}),jsxRuntime.jsxs(material.Typography,{variant:"caption",color:"text.secondary",children:[f.value.toFixed(1),o]})]},f.name))})]})};var lp=({data:e,barColor:t="#64B5F6",lineColor:o="#FFB74D",height:r=220})=>{if(e.length===0)return jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:"No data"});let a=640,n=28,i=Math.max(...e.map(s=>s.barValue),1),c=Math.max(...e.map(s=>s.lineValue),1),d=e.map((s,g)=>{let f=(a-n*2)/e.length,p=Math.max(f*.5,8),b=n+g*f+(f-p)/2,y=s.barValue/i*(r-n*2),u=r-n-y;return {x:b,y:u,barHeight:y,barWidth:p,item:s}}),l=e.map((s,g)=>{let f=(a-n*2)/e.length,p=n+g*f+f/2,b=r-n-s.lineValue/c*(r-n*2);return {x:p,y:b,item:s}});return jsxRuntime.jsxs(material.Stack,{spacing:1.25,children:[jsxRuntime.jsxs(material.Box,{component:"svg",viewBox:`0 0 ${a} ${r}`,sx:{width:"100%",height:r},children:[jsxRuntime.jsx("line",{x1:n,y1:r-n,x2:a-n,y2:r-n,stroke:"rgba(148,163,184,0.4)"}),d.map(s=>jsxRuntime.jsx("rect",{x:s.x,y:s.y,width:s.barWidth,height:Math.max(s.barHeight,4),rx:6,fill:t},s.item.name)),jsxRuntime.jsx("polyline",{fill:"none",stroke:o,strokeWidth:3,points:l.map(s=>`${s.x},${s.y}`).join(" ")}),l.map(s=>jsxRuntime.jsx("circle",{cx:s.x,cy:s.y,r:3.5,fill:o},`${s.item.name}-line`))]}),jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${e.length}, minmax(0, 1fr))`,gap:1},children:e.map(s=>jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",noWrap:true,title:s.name,sx:{display:"block"},children:s.name}),jsxRuntime.jsxs(material.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:["Bar: ",s.barValue.toFixed(1)]}),jsxRuntime.jsxs(material.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:["Line: ",s.lineValue.toFixed(1)]})]},s.name))})]})};var $y=e=>`rgba(30, 136, 229, ${.2+Math.max(0,Math.min(1,e))*.8})`,cp=({data:e})=>{if(e.length===0)return jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:"No data"});let t=Array.from(new Set(e.map(n=>n.x))),o=Array.from(new Set(e.map(n=>n.y))),r=Math.max(...e.map(n=>n.value),1),a=new Map(e.map(n=>[`${n.y}__${n.x}`,n.value]));return jsxRuntime.jsx(material.Box,{sx:{overflowX:"auto"},children:jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:`120px repeat(${t.length}, minmax(64px, 1fr))`,gap:1,minWidth:120+t.length*64},children:[jsxRuntime.jsx(material.Box,{}),t.map(n=>jsxRuntime.jsx(material.Typography,{variant:"caption",sx:{textAlign:"center",fontWeight:600},children:n},n)),o.map(n=>jsxRuntime.jsxs(material.Box,{sx:{display:"contents"},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",sx:{alignSelf:"center"},children:n}),t.map(i=>{let c=a.get(`${n}__${i}`)||0,d=c/r;return jsxRuntime.jsx(material.Box,{sx:{height:36,borderRadius:1,bgcolor:$y(d),border:"1px solid rgba(148,163,184,0.2)",display:"flex",alignItems:"center",justifyContent:"center"},children:jsxRuntime.jsx(material.Typography,{variant:"caption",fontWeight:700,children:c.toFixed(1)})},`${n}-${i}`)})]},n))]})})};var Gy=["#1E88E5","#1ABC9C","#FBC02D","#EF5350","#7E57C2","#78909C"],Il=({data:e,variant:t="donut",colors:o=Gy,size:r=180,activeName:a,onItemClick:n})=>{if(e.length===0)return jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:"No data"});let i=0,c=e.map((d,l)=>{let s=i;return i+=d.percent,`${o[l%o.length]} ${s}% ${i}%`});return jsxRuntime.jsxs(material.Stack,{direction:{xs:"column",sm:"row"},spacing:2,alignItems:"center",children:[jsxRuntime.jsx(material.Box,{sx:{width:r,height:r,borderRadius:"50%",background:`conic-gradient(${c.join(", ")})`,position:"relative",flexShrink:0},children:t==="donut"&&jsxRuntime.jsx(material.Box,{sx:{position:"absolute",inset:Math.round(r*.18),bgcolor:"background.paper",borderRadius:"50%"}})}),jsxRuntime.jsx(material.Stack,{spacing:1,sx:{minWidth:180},children:e.map((d,l)=>jsxRuntime.jsxs(material.Box,{onClick:()=>n?.(d),sx:{display:"flex",alignItems:"center",gap:1,cursor:n?"pointer":"default",opacity:a&&d.name!==a?.45:1},children:[jsxRuntime.jsx(material.Box,{sx:{width:10,height:10,borderRadius:"50%",bgcolor:o[l%o.length]}}),jsxRuntime.jsx(material.Typography,{variant:"caption",sx:{flex:1},children:d.name}),jsxRuntime.jsxs(material.Typography,{variant:"caption",sx:{fontWeight:700},children:[d.percent.toFixed(0),"%"]})]},d.name))})]})};var up=({effect:e,branches:t})=>{if(t.length===0)return jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:"No data"});let o=t.filter((a,n)=>n%2===0),r=t.filter((a,n)=>n%2===1);return jsxRuntime.jsxs(material.Stack,{spacing:1.5,children:[jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${Math.max(o.length,1)}, minmax(0, 1fr))`,gap:1},children:o.map(a=>jsxRuntime.jsxs(material.Box,{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",fontWeight:700,children:a.title}),a.causes.map(n=>jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:n},n))]},a.title))}),jsxRuntime.jsxs(material.Box,{sx:{position:"relative",height:32},children:[jsxRuntime.jsx(material.Box,{sx:{position:"absolute",inset:"50% 0 auto 0",borderTop:"2px solid",borderColor:"primary.main"}}),jsxRuntime.jsx(material.Box,{sx:{position:"absolute",right:0,top:"calc(50% - 12px)",px:1,py:.25,borderRadius:1,bgcolor:"primary.main",color:"primary.contrastText"},children:jsxRuntime.jsx(material.Typography,{variant:"caption",fontWeight:700,children:e})})]}),jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${Math.max(r.length,1)}, minmax(0, 1fr))`,gap:1},children:r.map(a=>jsxRuntime.jsxs(material.Box,{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",fontWeight:700,children:a.title}),a.causes.map(n=>jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:n},n))]},a.title))})]})};var mp=({data:e,height:t=240})=>{if(e.length===0)return jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:"No data"});let o=0,r=e.map(g=>{let f=g.type==="total"?0:o,p=g.type==="total"?g.value:o+g.value;return g.type!=="total"&&(o=p),{...g,start:f,end:p,delta:p-f}}),a=r.flatMap(g=>[g.start,g.end]),n=Math.min(...a,0),i=Math.max(...a,1),c=680,d=30,l=i-n||1,s=g=>t-d-(g-n)/l*(t-d*2);return jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsxs(material.Box,{component:"svg",viewBox:`0 0 ${c} ${t}`,sx:{width:"100%",height:t},children:[jsxRuntime.jsx("line",{x1:d,y1:s(0),x2:c-d,y2:s(0),stroke:"rgba(148,163,184,0.4)"}),r.map((g,f)=>{let p=(c-d*2)/r.length,b=Math.max(p*.55,8),y=d+f*p+(p-b)/2,u=s(Math.max(g.start,g.end)),C=s(Math.min(g.start,g.end)),m=g.type==="total"?"#42A5F5":g.delta>=0?"#66BB6A":"#EF5350";return jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("rect",{x:y,y:u,width:b,height:Math.max(C-u,4),rx:6,fill:m}),jsxRuntime.jsx("text",{x:y+b/2,y:u-6,textAnchor:"middle",fill:"currentColor",fontSize:"11",children:g.end.toFixed(1)})]},g.name)})]}),jsxRuntime.jsx(material.Box,{sx:{mt:1,display:"grid",gridTemplateColumns:`repeat(${r.length}, minmax(0, 1fr))`,gap:1},children:r.map(g=>jsxRuntime.jsx(material.Typography,{variant:"caption",noWrap:true,title:g.name,children:g.name},g.name))})]})};var Ci=({apiKey:e,query:t,zoom:o=14,mapType:r="roadmap"})=>{let a=encodeURIComponent(t);return `https://www.google.com/maps/embed/v1/place?key=${encodeURIComponent(e)}&q=${a}&zoom=${o}&maptype=${r}`},yD=(e,t=360)=>{let o=Ci(e);return `<iframe width="100%" height="${t}" style="border:0" loading="lazy" allowfullscreen referrerpolicy="no-referrer-when-downgrade" src="${o}"></iframe>`};var hp=({apiKey:e,query:t,embedUrl:o,zoom:r=14,mapType:a="roadmap",height:n=320})=>{let i=o||(e&&t?Ci({apiKey:e,query:t,zoom:r,mapType:a}):"");return i?jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsx(material.Box,{component:"iframe",src:i,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",sx:{width:"100%",height:n,border:0,borderRadius:2}}),jsxRuntime.jsxs(material.Typography,{variant:"caption",color:"text.secondary",sx:{mt:.75,display:"block"},children:["If iframe is blocked, open directly: ",jsxRuntime.jsx(material.Link,{href:i,target:"_blank",rel:"noreferrer",children:"Google Maps"})]})]}):jsxRuntime.jsx(material.Box,{children:jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:"Google Map requires `embedUrl` or (`apiKey` + `query`)."})})};var Ml=({keyword:e,location:t,src:o="orbcafe-ui"})=>{if(t){let r=encodeURIComponent(t.name||e||"Location");return `https://uri.amap.com/marker?position=${t.lng},${t.lat}&name=${r}&src=${encodeURIComponent(o)}&coordinate=gaode&callnative=0`}return e?`https://uri.amap.com/search?keyword=${encodeURIComponent(e)}&src=${encodeURIComponent(o)}&callnative=0`:"https://uri.amap.com/search?keyword=%E5%8C%97%E4%BA%AC&src=orbcafe-ui&callnative=0"};var vp=({keyword:e,location:t,embedUrl:o,height:r=320})=>{let a=o||Ml({keyword:e,location:t?{lng:t.lng,lat:t.lat,name:t.name}:void 0});return jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsx(material.Box,{component:"iframe",src:a,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",sx:{width:"100%",height:r,border:0,borderRadius:2}}),jsxRuntime.jsxs(material.Typography,{variant:"caption",color:"text.secondary",sx:{mt:.75,display:"block"},children:["If iframe is blocked, open directly: ",jsxRuntime.jsx(material.Link,{href:a,target:"_blank",rel:"noreferrer",children:"AMap"})]})]})};var Cp=({billableByPrimary:e,efficiencyBySecondary:t,statusDistribution:o,interaction:r})=>{let{t:a}=ne();return jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",lg:"1.2fr 1.2fr 1fr"}},children:[jsxRuntime.jsx(xl,{title:a("graph.chart.billable.title"),subtitle:a("graph.chart.billable.subtitle"),children:jsxRuntime.jsx(yi,{data:e,orientation:"horizontal",activeName:r?.filters?.primaryDimension,onItemClick:n=>r?.onPrimaryDimensionClick?.(n.name)})}),jsxRuntime.jsx(xl,{title:a("graph.chart.efficiency.title"),subtitle:a("graph.chart.efficiency.subtitle"),children:jsxRuntime.jsx(yi,{data:t,orientation:"vertical",valueSuffix:"%",activeName:r?.filters?.secondaryDimension,onItemClick:n=>r?.onSecondaryDimensionClick?.(n.name)})}),jsxRuntime.jsx(xl,{title:a("graph.chart.status.title"),subtitle:a("graph.chart.status.subtitle"),children:jsxRuntime.jsx(Il,{data:o,variant:"donut",activeName:r?.filters?.status,onItemClick:n=>r?.onStatusClick?.(n.name)})})]})};var Io=e=>jsxRuntime.jsx(material.TextField,{...e,variant:e.variant||"outlined",size:e.size||"small",fullWidth:e.fullWidth!==void 0?e.fullWidth:true});var Fc=e=>jsxRuntime.jsx(material.TextField,{...e,multiline:true,minRows:3,fullWidth:true,variant:"outlined"});var sx=["doubao-lite","gpt-4o-mini","gpt-4.1-mini","claude-3.5-sonnet"],cx=["zh","en","de","fr","ja","ko"],wp=({open:e,onClose:t,value:o,onSaveAll:r,modelOptions:a=sx,promptLangOptions:n=cx,analysisTemplateOptions:i=[],responseTemplateOptions:c=[],defaultAnalysisTemplateId:d,defaultResponseTemplateId:l})=>{let[s,g]=Qt.useState(o),[f,p]=Qt.useState(d||""),[b,y]=Qt.useState(l||""),[u,C]=Qt.useState(false);Qt.useEffect(()=>{e&&(g(o),p(d||""),y(l||""));},[e,o,d,l]);let m=(x,w)=>{g(E=>({...E,[x]:w}));},h=async()=>{if(r)try{C(!0),await r({settings:s,analysisTemplateId:f||void 0,responseTemplateId:b||void 0});}finally{C(false);}};return jsxRuntime.jsxs(material.Dialog,{open:e,onClose:t,fullWidth:true,maxWidth:"lg",children:[jsxRuntime.jsxs(material.DialogTitle,{sx:{pr:7,pb:2.2},children:[jsxRuntime.jsx(material.Typography,{variant:"h5",sx:{fontWeight:800},children:"AI Settings"}),jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",sx:{mt:.5},children:"Configure LLM settings and editable agent prompts by language."}),jsxRuntime.jsx(material.IconButton,{onClick:t,sx:{position:"absolute",right:12,top:12},children:jsxRuntime.jsx(Sb__default.default,{})})]}),jsxRuntime.jsx(material.DialogContent,{sx:{pt:"18px !important"},children:jsxRuntime.jsxs(material.Stack,{spacing:2.2,children:[jsxRuntime.jsxs(material.Box,{sx:{mt:.8,display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",md:"repeat(2, minmax(0, 1fr))"}},children:[jsxRuntime.jsx(material.Box,{children:jsxRuntime.jsx(Io,{size:"small",value:s.baseUrl,onChange:x=>m("baseUrl",x.target.value),fullWidth:true,label:"Base URL"})}),jsxRuntime.jsx(material.Box,{children:jsxRuntime.jsx(Io,{size:"small",type:"password",value:s.apiKey,onChange:x=>m("apiKey",x.target.value),fullWidth:true,label:"API Key"})}),jsxRuntime.jsx(material.Box,{children:jsxRuntime.jsx(Io,{size:"small",value:s.model,onChange:x=>m("model",x.target.value),fullWidth:true,select:true,label:"Model",children:a.map(x=>jsxRuntime.jsx(material.MenuItem,{value:x,children:x},x))})}),jsxRuntime.jsx(material.Box,{children:jsxRuntime.jsx(Io,{size:"small",value:s.promptLang,onChange:x=>m("promptLang",x.target.value),fullWidth:true,select:true,label:"Prompt Lang",children:n.map(x=>jsxRuntime.jsx(material.MenuItem,{value:x,children:x},x))})})]}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[jsxRuntime.jsxs(Io,{size:"small",value:f,onChange:x=>p(x.target.value),fullWidth:true,select:true,label:"Analysis Template",children:[jsxRuntime.jsx(material.MenuItem,{value:"",children:"Default"}),i.map(x=>jsxRuntime.jsx(material.MenuItem,{value:x.id,children:x.label},x.id))]}),jsxRuntime.jsx(Fc,{multiline:true,minRows:8,value:s.analysisPrompt,onChange:x=>m("analysisPrompt",x.target.value),fullWidth:true,label:"Analysis Prompt",sx:{"& .MuiInputBase-root":{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"}}}),jsxRuntime.jsxs(Io,{size:"small",value:b,onChange:x=>y(x.target.value),fullWidth:true,select:true,label:"Response Template",children:[jsxRuntime.jsx(material.MenuItem,{value:"",children:"Default"}),c.map(x=>jsxRuntime.jsx(material.MenuItem,{value:x.id,children:x.label},x.id))]}),jsxRuntime.jsx(Fc,{multiline:true,minRows:8,value:s.responsePrompt,onChange:x=>m("responsePrompt",x.target.value),fullWidth:true,label:"Response Prompt",sx:{"& .MuiInputBase-root":{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"}}})]})]})}),jsxRuntime.jsxs(material.DialogActions,{sx:{px:3,pb:2.5,pt:1.2,gap:1},children:[jsxRuntime.jsx(material.Button,{variant:"outlined",onClick:t,children:"Cancel"}),jsxRuntime.jsx(material.Button,{variant:"contained",onClick:h,disabled:!r||u,children:"Save"})]})]})};var Fl=({open:e,onClose:t,model:o,tableContent:r,extraCharts:a,interaction:n,aiAssistant:i})=>{let{t:c}=ne(),[d,l]=Qt.useState(i?.defaultPrompt||""),[s,g]=Qt.useState(false),[f,p]=Qt.useState(false),b=n?.enabled!==false&&!!n,y=i?.enabled!==false,u=n?.filters||{},C=!!(u.primaryDimension||u.secondaryDimension||u.status),m=i?.placeholder||"Ask AI to analyze data, create charts, or find insights...";Qt.useEffect(()=>{e&&l(i?.defaultPrompt||"");},[e,i?.defaultPrompt]);let h=i?.settings||{baseUrl:"/llm-api",apiKey:"",model:"doubao-lite",promptLang:"zh",analysisPrompt:"",responsePrompt:""},x=async()=>{let w=d.trim();if(!(!w||!i?.onSubmit))try{g(!0),await i.onSubmit(w,{filters:u,model:o});}finally{g(false);}};return jsxRuntime.jsx(material.Dialog,{open:e,onClose:t,fullScreen:true,children:jsxRuntime.jsxs(material.Box,{sx:{height:"100%",display:"flex",flexDirection:"column",bgcolor:"background.default"},children:[jsxRuntime.jsx(material.Box,{sx:{p:2,borderBottom:1,borderColor:"divider"},children:jsxRuntime.jsxs(material.Stack,{direction:{xs:"column",lg:"row"},alignItems:{xs:"stretch",lg:"center"},justifyContent:"space-between",spacing:1.5,children:[jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1.25,alignItems:"center",sx:{flexWrap:"wrap"},children:[jsxRuntime.jsx(material.Typography,{variant:"h5",fontWeight:800,children:o.title}),jsxRuntime.jsx(material.Chip,{size:"small",label:c("graph.records",{count:o.kpis.totalRecords})}),b&&u.primaryDimension&&jsxRuntime.jsx(material.Chip,{size:"small",variant:"outlined",label:`${n?.fieldMapping.primaryDimension}: ${u.primaryDimension}`,onDelete:()=>n?.onClearFilter("primaryDimension")}),b&&u.secondaryDimension&&jsxRuntime.jsx(material.Chip,{size:"small",variant:"outlined",label:`${n?.fieldMapping.secondaryDimension}: ${u.secondaryDimension}`,onDelete:()=>n?.onClearFilter("secondaryDimension")}),b&&u.status&&jsxRuntime.jsx(material.Chip,{size:"small",variant:"outlined",label:`${n?.fieldMapping.status}: ${u.status}`,onDelete:()=>n?.onClearFilter("status")}),b&&C&&jsxRuntime.jsx(material.Button,{size:"small",onClick:()=>n?.onClearAll(),children:"Clear"})]}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1.25,alignItems:"center",sx:{width:{xs:"100%",lg:"auto"}},children:[y&&jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:1,px:1.2,py:.4,borderRadius:999,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",minWidth:{xs:0,lg:520},flex:{xs:1,lg:"0 0 auto"}},children:[jsxRuntime.jsx(material.IconButton,{size:"small",onClick:i?.onVoiceInput,children:jsxRuntime.jsx(fx__default.default,{sx:{fontSize:18,color:"text.secondary"}})}),jsxRuntime.jsx(material.InputBase,{fullWidth:true,value:d,onChange:w=>l(w.target.value),onKeyDown:w=>{w.key==="Enter"&&(w.preventDefault(),x());},placeholder:m,sx:{fontSize:"0.9rem"}}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:x,disabled:s||!d.trim(),children:jsxRuntime.jsx(bx__default.default,{sx:{fontSize:18}})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>p(true),children:jsxRuntime.jsx(hx__default.default,{sx:{fontSize:18}})})]}),jsxRuntime.jsx(material.IconButton,{onClick:t,children:jsxRuntime.jsx(Sb__default.default,{})})]})]})}),jsxRuntime.jsxs(material.Box,{sx:{p:2,display:"flex",flexDirection:"column",gap:1.5,overflow:"auto",minHeight:0},children:[jsxRuntime.jsx(rp,{kpis:o.kpis}),jsxRuntime.jsx(Cp,{billableByPrimary:o.charts.billableByPrimary,efficiencyBySecondary:o.charts.efficiencyBySecondary,statusDistribution:o.charts.statusDistribution,interaction:b?{filters:u,onPrimaryDimensionClick:w=>n?.onPrimaryDimensionClick(w),onSecondaryDimensionClick:w=>n?.onSecondaryDimensionClick(w),onStatusClick:w=>n?.onStatusClick(w)}:void 0}),a,r]}),jsxRuntime.jsx(wp,{open:f,onClose:()=>p(false),value:h,onSaveAll:i?.onSaveAll,modelOptions:i?.modelOptions,promptLangOptions:i?.promptLangOptions,analysisTemplateOptions:i?.analysisTemplateOptions,responseTemplateOptions:i?.responseTemplateOptions,defaultAnalysisTemplateId:i?.defaultAnalysisTemplateId,defaultResponseTemplateId:i?.defaultResponseTemplateId})]})})};var da={primaryDimension:["Client","Customer","Category","Project"],secondaryDimension:["Person","Consultant","Owner","Name"],status:["Status","state"],date:["Date","WorkDate","CreatedAt"],description:["Description","Task","Title","Memo"],reportHours:["Report_Hour","Report Hours","Hours","ReportHours"],billableHours:["Billable_Hour","Billable Hours","BillableHours"],amount:["Amount","Billable_Amount","Total_Amount","Value"]},xx=5,Tp=e=>e.toLowerCase().replace(/[\s_-]/g,""),ua=(e,t,o,r)=>{if(t)return t;if(e.length===0)return r;let a=Object.keys(e[0]),n=new Map(a.map(i=>[Tp(i),i]));for(let i of o){let c=n.get(Tp(i));if(c)return c}return a[0]||r},Go=e=>{if(typeof e=="number")return Number.isFinite(e)?e:0;if(typeof e=="string"){let t=Number(e.replace(/,/g,"").trim());return Number.isFinite(t)?t:0}return 0},vo=(e,t)=>e==null||e===""?t:String(e),vx=(e,t,o,r,a)=>{let n=new Map;return e.forEach(i=>{let c=vo(i[t],a);n.set(c,(n.get(c)||0)+Go(i[o]));}),Array.from(n.entries()).map(([i,c])=>({name:i,value:c})).sort((i,c)=>c.value-i.value).slice(0,r)},Cx=(e,t,o,r,a,n)=>{let i=new Map;return e.forEach(c=>{let d=vo(c[t],n),l=i.get(d)||{report:0,billable:0};l.report+=Go(c[o]),l.billable+=Go(c[r]),i.set(d,l);}),Array.from(i.entries()).map(([c,d])=>({name:c,value:d.report>0?d.billable/d.report*100:0})).sort((c,d)=>c.value-d.value).slice(0,a)},Sx=(e,t,o)=>{let r=e.length;if(r===0)return [];let a=new Map;return e.forEach(n=>{let i=vo(n[t],o);a.set(i,(a.get(i)||0)+1);}),Array.from(a.entries()).map(([n,i])=>({name:n,value:i,percent:i/r*100}))},Ip=(e,t,o)=>{let r=new Map;return e.forEach(a=>{let n=vo(a[t],"N/A");r.set(n,(r.get(n)||0)+Go(a[o]));}),Array.from(r.entries()).sort(([a],[n])=>a.localeCompare(n)).map(([a,n])=>({name:a,value:n}))},kx=(e,t,o,r,a,n)=>{let i=new Map;return e.forEach(c=>{let d=vo(c[t],n),l=i.get(d)||{report:0,billable:0};l.report+=Go(c[o]),l.billable+=Go(c[r]),i.set(d,l);}),Array.from(i.entries()).map(([c,d])=>({name:c,barValue:d.billable,lineValue:d.report>0?d.billable/d.report*100:0})).sort((c,d)=>d.barValue-c.barValue).slice(0,a)},wx=(e,t,o,r,a)=>{let n=new Map;return e.forEach(i=>{let c=vo(i[t],a),d=vo(i[o],a),l=`${c}__${d}`;n.set(l,(n.get(l)||0)+Go(i[r]));}),Array.from(n.entries()).map(([i,c])=>{let[d,l]=i.split("__");return {x:d,y:l,value:c}})},Tx=(e,t,o)=>{let r=Ip(e,t,o),a=r.map(i=>({name:i.name,value:i.value,type:"delta"})),n=r.reduce((i,c)=>i+c.value,0);return [...a,{name:"Total",value:n,type:"total"}]},Ix=(e,t,o,r,a,n)=>{let i=new Map;return e.forEach(c=>{let d=vo(c[t],n),l=`${vo(c[o],n)} / ${vo(c[r],n)}`,s=i.get(d)||new Map;s.set(l,(s.get(l)||0)+1),i.set(d,s);}),Array.from(i.entries()).map(([c,d])=>({title:c,causes:Array.from(d.entries()).sort((l,s)=>s[1]-l[1]).slice(0,a).map(([l,s])=>`${l} (${s})`)})).slice(0,6)},xn=({rows:e,config:t})=>{let{t:o}=ne(),r=o("graph.unassigned"),a=Qt.useMemo(()=>{let s=t?.fieldMapping;return {primaryDimension:ua(e,s?.primaryDimension,da.primaryDimension,"Category"),secondaryDimension:ua(e,s?.secondaryDimension,da.secondaryDimension,"Owner"),status:ua(e,s?.status,da.status,"Status"),date:ua(e,s?.date,da.date,"Date"),description:ua(e,s?.description,da.description,"Description"),reportHours:ua(e,s?.reportHours,da.reportHours,"ReportHours"),billableHours:ua(e,s?.billableHours,da.billableHours,"BillableHours"),amount:ua(e,s?.amount,da.amount,"Amount")}},[e,t?.fieldMapping]),n=Qt.useMemo(()=>e.map((s,g)=>{let f=Go(s[a.reportHours]),p=Go(s[a.billableHours]),b=Go(s[a.amount]),y=f>0?p/f*100:0;return {id:`graph-row-${g}`,Date:vo(s[a.date],""),Primary:vo(s[a.primaryDimension],r),Secondary:vo(s[a.secondaryDimension],r),Description:vo(s[a.description],""),ReportHours:f,BillableHours:p,Amount:b,Efficiency:y,Status:vo(s[a.status],r)}}),[e,a,r]),i=Qt.useMemo(()=>{let s=n.length,g=n.reduce((C,m)=>C+Go(m.ReportHours),0),f=n.reduce((C,m)=>C+Go(m.BillableHours),0),p=n.reduce((C,m)=>C+Go(m.Amount),0),b=g>0?f/g*100:0,y=t?.statusFlagValues||["flag","flagged","warning","risk"],u=n.filter(C=>y.includes(vo(C.Status,"").toLowerCase())).length;return {totalRecords:s,totalReportHours:g,totalBillableHours:f,efficiency:b,totalAmount:p,flaggedCount:u}},[n,t?.statusFlagValues]),c=t?.topN||xx,d=Qt.useMemo(()=>({billableByPrimary:vx(n,"Primary","BillableHours",c,r),efficiencyBySecondary:Cx(n,"Secondary","ReportHours","BillableHours",c,r),statusDistribution:Sx(n,"Status",r),lineByDate:Ip(n,"Date","BillableHours"),comboByPrimary:kx(n,"Primary","ReportHours","BillableHours",c,r),heatmapPrimarySecondary:wx(n,"Primary","Secondary","BillableHours",r),waterfallBillable:Tx(n,"Date","BillableHours"),fishboneStatusCauses:Ix(n,"Status","Primary","Secondary",3,r)}),[n,c,r]),l=Qt.useMemo(()=>({title:t?.title||o("graph.reportTitle"),kpis:i,charts:d,table:{columns:[{id:"Date",label:a.date},{id:"Primary",label:a.primaryDimension},{id:"Secondary",label:a.secondaryDimension},{id:"Description",label:a.description},{id:"ReportHours",label:o("graph.column.reportHours"),align:"right"},{id:"BillableHours",label:o("graph.column.billableHours"),align:"right"},{id:"Amount",label:"Amount",align:"right"},{id:"Efficiency",label:"Efficiency",align:"right"},{id:"Status",label:a.status}],rows:n}}),[d,t?.title,a,i,n,o]);return {fieldMapping:a,model:l}};var vn=e=>String(e??"").trim(),Nl=(e={})=>{let[t,o]=Qt.useState(e),r=Qt.useCallback((d,l)=>{o(s=>{let g=l?.trim();if(!g){let f={...s};return delete f[d],f}if(s[d]===g){let f={...s};return delete f[d],f}return {...s,[d]:g}});},[]),a=Qt.useCallback(d=>{o(l=>{if(!l[d])return l;let s={...l};return delete s[d],s});},[]),n=Qt.useCallback(()=>{o({});},[]),i=Qt.useMemo(()=>!!(t.primaryDimension||t.secondaryDimension||t.status),[t]),c=Qt.useCallback((d,l)=>d.filter(s=>!(t.primaryDimension&&vn(s[l.primaryDimension])!==vn(t.primaryDimension)||t.secondaryDimension&&vn(s[l.secondaryDimension])!==vn(t.secondaryDimension)||t.status&&vn(s[l.status])!==vn(t.status))),[t]);return {filters:t,setFilter:r,clearFilter:a,clearAll:n,hasActiveFilters:i,applyRows:c}};var Ol=({variants:e,currentVariantId:t,onLoad:o,onSave:r,onDelete:a,onSetDefault:n})=>{let{t:i}=ne(),d=material.useTheme().palette.mode==="dark",l="0.85rem",s={xs:"calc((100% - 1 * 16px) / 2)",sm:"calc((100% - 2 * 16px) / 3)",md:"calc((100% - 3 * 16px) / 4)",lg:"calc((100% - 5 * 16px) / 6)"},[g,f]=Qt.useState(false),[p,b]=Qt.useState(""),[y,u]=Qt.useState(false),[C,m]=Qt.useState(false),h=e.find(E=>E.id===t),x=()=>{b(h?.name||i("variant.newVariant")),u(h?.isDefault||false),m(h?.isPublic||false),f(true);},w=()=>{r({name:p,isDefault:y,isPublic:C,description:""}),f(false);};return jsxRuntime.jsxs(material.Box,{sx:{display:"flex",gap:1,alignItems:"center",width:"100%",maxWidth:"100%"},children:[jsxRuntime.jsx(material.Autocomplete,{size:"small",sx:{width:s,"& .MuiInputBase-root":{fontSize:l,bgcolor:d?"rgba(25, 118, 210, 0.2)":"#e7f1ff","& .MuiOutlinedInput-notchedOutline":{borderColor:d?"rgba(144,202,249,0.45)":"rgba(25,118,210,0.45)"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:d?"rgba(144,202,249,0.7)":"rgba(25,118,210,0.65)"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:d?"rgba(144,202,249,0.9)":"rgba(25,118,210,0.85)"}},"& .MuiInputBase-input":{fontSize:l},"& .MuiAutocomplete-noOptions":{fontSize:l}},noOptionsText:jsxRuntime.jsx(material.Typography,{sx:{fontSize:l},children:i("variant.noOptions")}),options:e,getOptionLabel:E=>E.name+(E.isDefault?` (${i("variant.defaultSuffix")})`:""),value:h||null,onChange:(E,R)=>{R&&o(R);},renderInput:E=>jsxRuntime.jsx(material.TextField,{...E,variant:"outlined",size:"small",InputProps:{...E.InputProps,sx:{fontSize:l,color:d?"#E3F2FD":"#0D47A1"}},placeholder:i("variant.selectVariant")}),renderOption:(E,R)=>{let{key:T,...I}=E;return jsxRuntime.jsx("li",{...I,children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",width:"100%"},children:[jsxRuntime.jsx(material.Typography,{sx:{flex:1,fontSize:l},children:R.name}),R.isDefault&&jsxRuntime.jsx(Ox__default.default,{fontSize:"small",color:"action"})]})},T)}}),jsxRuntime.jsx(material.Tooltip,{title:i("variant.saveView"),children:jsxRuntime.jsx(material.IconButton,{onClick:x,size:"small",color:"primary",children:jsxRuntime.jsx(jp__default.default,{fontSize:"small"})})}),jsxRuntime.jsxs(material.Dialog,{open:g,onClose:()=>f(false),children:[jsxRuntime.jsx(material.DialogTitle,{children:i("variant.saveView")}),jsxRuntime.jsxs(material.DialogContent,{children:[jsxRuntime.jsx(material.TextField,{autoFocus:true,margin:"dense",label:i("variant.viewName"),fullWidth:true,variant:"outlined",value:p,onChange:E=>b(E.target.value)}),jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{checked:y,onChange:E=>u(E.target.checked)}),label:i("variant.setDefault")}),jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{checked:C,onChange:E=>m(E.target.checked)}),label:i("variant.publicAllUsers")})]}),jsxRuntime.jsxs(material.DialogActions,{children:[jsxRuntime.jsx(material.Button,{onClick:()=>f(false),children:i("common.cancel")}),jsxRuntime.jsx(material.Button,{onClick:w,variant:"contained",children:i("common.save")})]})]})]})};var Fp=({appId:e,tableKey:t="default",currentFilters:o,currentLayoutId:r,layoutRefs:a,onLoad:n,variantService:i,serviceUrl:c,onError:d,onSuccess:l,currentVariantId:s,onVariantChange:g})=>{let{t:f}=ne(),[p,b]=Qt.useState([]),[y,u]=Qt.useState(""),C=`orbcafe.variants.${e}.${t}`,m=s!==void 0?s:y,h=D=>{s===void 0&&u(D),g&&g(D);},x=Qt.useCallback(()=>{try{let D=localStorage.getItem(C);if(!D)return [];let P=JSON.parse(D);return Array.isArray(P)?P:[]}catch{return []}},[C]),w=Qt.useCallback(D=>{try{localStorage.setItem(C,JSON.stringify(D));}catch{}},[C]),E=Qt.useCallback(D=>{b(D);let P=D.find(M=>M.isDefault);P&&!m&&(h(P.id),n(P));},[m,n,h]),R=Qt.useCallback(async()=>{if(!e)return [];try{let D=[];if(i)D=await i.getVariants(e,t);else if(c){let P=await fetch(`${c}/api/variants?appId=${encodeURIComponent(e)}&tableKey=${encodeURIComponent(t)}`);if(!P.ok)throw new Error(f("variant.toast.fetchFailed"));D=await P.json();}else D=x();return E(D),D}catch(D){console.error("Error fetching variants",D);let P=x();return E(P),d&&d(f("variant.toast.fetchFailed")),P}},[e,t,i,c,x,E,d,f]);return Qt.useEffect(()=>{R();},[e,t]),jsxRuntime.jsx(Ol,{variants:p,currentVariantId:m,onLoad:D=>{h(D.id),n(D);},onSave:async D=>{let P=Date.now().toString(),M;try{let B=D.scope||"Both",X=p.find(q=>q.name===D.name);P=X?X.id:Date.now().toString();let L=[];if(X&&(Array.isArray(X.filters)?L=[...X.filters]:X.filters&&(L=[{scope:"default",filters:X.filters}])),B==="Search"||B==="Both"){let q=(Array.isArray(o),o);if(q)if(Array.isArray(q)&&q.length>0&&q[0].scope)q.forEach(H=>{let re=L.findIndex(de=>de.scope===H.scope);re>=0?L[re]=H:L.push(H);});else {let H={scope:t,filters:q},re=L.findIndex(de=>de.scope===t);re>=0?L[re]=H:L.push(H);}}let Z=X?.layout||{},$=[];if(X&&Array.isArray(X.layoutRefs)&&($=[...X.layoutRefs]),B==="Layout"||B==="Both")if(a&&a.length>0)a.forEach(q=>{let H=$.findIndex(re=>re.tableKey===q.tableKey);H>=0?$[H]=q:$.push(q);});else {let q={tableKey:t,layoutId:r||null},H=$.findIndex(re=>re.tableKey===t);H>=0?$[H]=q:$.push(q);}if(M={appId:e,tableKey:t,...D,scope:B,id:P,createdAt:new Date().toISOString(),filters:L,layout:Z,layoutRefs:$},i)await i.saveVariant(M,e,t);else if(c){if(!(await fetch(`${c}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(M)})).ok)throw new Error(f("variant.toast.saveFailed"))}else {let H=p.some(re=>re.id===P)?p.map(re=>re.id===P?M:re):[...p,M];b(H),w(H);}l&&l(f("variant.toast.saveSuccess")),(i||c)&&await R(),h(P),n(M);}catch(B){console.error("Error saving variant",B);let L=p.some(Z=>Z.id===P)?p.map(Z=>Z.id===P?M:Z):[...p,M];b(L),w(L),h(P),n(M),d&&d(f("variant.toast.saveFailed"));}},onDelete:async D=>{try{if(i)await i.deleteVariant(D);else if(c){if(!(await fetch(`${c}/api/variants/${D}`,{method:"DELETE"})).ok)throw new Error(f("variant.toast.deleteFailed"))}else {let P=p.filter(M=>M.id!==D);b(P),w(P);}m===D&&h(""),(i||c)&&R(),l&&l(f("variant.toast.deleteSuccess"));}catch(P){console.error("Error deleting variant",P);let M=p.filter(B=>B.id!==D);b(M),w(M),m===D&&h(""),d&&d(f("variant.toast.deleteFailed"));}},onSetDefault:async D=>{try{let P=p.find(B=>B.id===D);if(!P)return;let M={appId:e,tableKey:t,...P,isDefault:!0};if(i)await i.setDefaultVariant(D,e,t);else if(c){if(!(await fetch(`${c}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(M)})).ok)throw new Error(f("variant.toast.defaultFailed"))}else {let B=p.map(X=>({...X,isDefault:X.id===D}));b(B),w(B);}(i||c)&&await R(),l&&l(f("variant.toast.defaultSuccess"));}catch(P){console.error("Error setting default variant",P);let M=p.map(B=>({...B,isDefault:B.id===D}));b(M),w(M),d&&d(f("variant.toast.defaultFailed"));}}})};zr__default.default.extend(e0__default.default);zr__default.default.extend(t0__default.default);zr__default.default.extend(o0__default.default);var wi="YYYY-MM-DD",r0=[null,null],Ea="0.85rem",a0={en:"en",zh:"zh-cn",fr:"fr",de:"de",ja:"ja",ko:"ko"},n0=material.styled(PickersDay.PickersDay,{shouldForwardProp:e=>e!=="isInRange"&&e!=="isStart"&&e!=="isEnd"&&e!=="isHovered"})(({theme:e,isInRange:t,isStart:o,isEnd:r,isHovered:a})=>({...t&&{borderRadius:0,backgroundColor:e.palette.primary.light,color:e.palette.primary.contrastText,"&:hover":{backgroundColor:e.palette.primary.main}},...a&&!t&&!o&&!r&&{borderRadius:0,backgroundColor:e.palette.action.hover,border:`1px dashed ${e.palette.primary.main}`},...o&&{borderRadius:"50% 0 0 50%",backgroundColor:e.palette.primary.main,color:e.palette.primary.contrastText,"&:hover":{backgroundColor:e.palette.primary.dark}},...r&&{borderRadius:"0 50% 50% 0",backgroundColor:e.palette.primary.main,color:e.palette.primary.contrastText,"&:hover":{backgroundColor:e.palette.primary.dark}},...o&&r&&{borderRadius:"50%"}})),Op=({label:e,value:t=r0,onChange:o})=>{let{t:r,locale:a}=ne(),n=a0[a]||"en",i=e||r("dateRange.label"),[c,d]=Qt.useState(null),[l,s]=Qt.useState(t),[g,f]=Qt.useState("start"),[p,b]=Qt.useState(null),[y,u]=Qt.useState((t[0]||zr__default.default()).locale(n)),[C,m]=Qt.useState(""),[h,x]=Qt.useState(""),[w,E]=Qt.useState(false),[R,T]=Qt.useState(false),I=Qt__namespace.default.useRef(t);Qt.useEffect(()=>{let[H,re]=t,[de,Ce]=I.current,ve=Ie=>Ie&&typeof Ie.isSame=="function",le=!(H===null&&de===null||ve(H)&&ve(de)&&H.isSame(de,"day")),oe=!(re===null&&Ce===null||ve(re)&&ve(Ce)&&re.isSame(Ce,"day"));(le||oe)&&(s(t),t[0]&&ve(t[0])&&u(t[0].locale(n))),I.current=t;},[t,n]),Qt.useEffect(()=>{m(l[0]?l[0].locale(n).format(wi):""),x(l[1]?l[1].locale(n).format(wi):""),E(false),T(false);},[l,n]);let k=(H,re)=>{let de=re.trim(),Ce=H==="start"?E:T;if(!de){let oe=H==="start"?[null,l[1]]:[l[0],null];Ce(false),s(oe);return}let ve=zr__default.default(de,wi,true).locale(n);if(!ve.isValid()){Ce(true);return}Ce(false);let le=[...l];if(H==="start")le[0]=ve,le[1]&&ve.isAfter(le[1],"day")&&(le[1]=null),f(le[1]?"start":"end");else {let oe=le[0];oe&&ve.isBefore(oe,"day")?(le=[ve,null],f("end")):(le[1]=ve,f("start"));}s(le),u(ve);},S=H=>{d(H.currentTarget);},D=()=>{d(null),f("start"),b(null);},P=!!c,M=H=>{if(!H)return;let re=[...l];if(g==="start")re=[H,null],f("end");else {let de=re[0];de&&H.isBefore(de)?(re=[H,null],f("end")):(re=[de,H],f("start"));}s(re);},B=H=>{let re=zr__default.default().locale(n),de=[null,null];switch(H){case "today":de=[re,re];break;case "week":de=[re.startOf("week"),re.endOf("week")];break;case "month":de=[re.startOf("month"),re.endOf("month")];break}s(de),f("start"),u(re);},X=()=>{s([null,null]),f("start"),u(zr__default.default().locale(n));},L=()=>{o&&o(l),D();},Z=()=>{s(t),f("start"),D();},$=Qt.useCallback(H=>{let{day:re,...de}=H,[Ce,ve]=l,le=Ce?re.isSame(Ce,"day"):false,oe=ve?re.isSame(ve,"day"):false,Ie=Ce&&ve?re.isBetween(Ce,ve,"day","()"):false,Ze=false;return g==="end"&&Ce&&!ve&&p&&re.isAfter(Ce,"day")&&re.isBefore(p.add(1,"day"),"day")&&(Ze=true),jsxRuntime.jsx(n0,{...de,day:re,disableMargin:true,isStart:le,isEnd:oe,isInRange:Ie||Ze,onMouseEnter:()=>b(re)})},[l,g,p]),q=H=>H?H.locale(n).format("YYYY-MM-DD"):"";return jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsx(material.TextField,{label:i,value:l[0]?`${q(l[0])} - ${q(l[1])}`:"",onClick:S,fullWidth:true,size:"small",InputLabelProps:{sx:{fontSize:Ea}},InputProps:{readOnly:true,sx:{fontSize:Ea,"& .MuiOutlinedInput-input":{fontSize:Ea},paddingRight:"4px"},endAdornment:jsxRuntime.jsxs(material.InputAdornment,{position:"end",sx:{ml:0},children:[(l[0]||l[1])&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:H=>{H.stopPropagation(),X();},edge:"end",sx:{mr:.5,padding:"2px"},children:jsxRuntime.jsx(Cb__default.default,{sx:{fontSize:"1rem"}})}),jsxRuntime.jsx(material.IconButton,{size:"small",edge:"end",onClick:S,sx:{padding:"2px"},children:jsxRuntime.jsx(Yx__default.default,{sx:{fontSize:"1rem"},color:"action"})})]})}}),jsxRuntime.jsxs(material.Popover,{open:P,anchorEl:c,onClose:D,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{sx:{display:"flex",flexDirection:"column",p:0,width:320}}},children:[jsxRuntime.jsx(material.Box,{sx:{p:2,bgcolor:"background.default",borderBottom:1,borderColor:"divider"},children:jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:1.5,justifyContent:"space-between",children:[jsxRuntime.jsx(material.TextField,{label:r("dateRange.startDate"),placeholder:wi,value:C,error:w,size:"small",onFocus:()=>f("start"),onChange:H=>{m(H.target.value),w&&E(false);},onBlur:()=>k("start",C),onKeyDown:H=>{H.key==="Enter"&&(H.preventDefault(),k("start",C));},sx:{flex:1,"& .MuiInputBase-input":{fontSize:Ea,py:.75},"& .MuiInputLabel-root":{fontSize:Ea}}}),jsxRuntime.jsx(Jx__default.default,{color:"action",fontSize:"small"}),jsxRuntime.jsx(material.TextField,{label:r("dateRange.endDate"),placeholder:wi,value:h,error:R,size:"small",onFocus:()=>{l[0]&&f("end");},onChange:H=>{x(H.target.value),R&&T(false);},onBlur:()=>k("end",h),onKeyDown:H=>{H.key==="Enter"&&(H.preventDefault(),k("end",h));},sx:{flex:1,"& .MuiInputBase-input":{fontSize:Ea,py:.75},"& .MuiInputLabel-root":{fontSize:Ea}}})]})}),jsxRuntime.jsx(material.Box,{sx:{p:2,pb:0},children:jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,justifyContent:"center",children:[jsxRuntime.jsx(material.Chip,{label:r("dateRange.today"),onClick:()=>B("today"),clickable:true,size:"small",variant:"outlined"}),jsxRuntime.jsx(material.Chip,{label:r("dateRange.thisWeek"),onClick:()=>B("week"),clickable:true,size:"small",variant:"outlined"}),jsxRuntime.jsx(material.Chip,{label:r("dateRange.thisMonth"),onClick:()=>B("month"),clickable:true,size:"small",variant:"outlined"})]})}),jsxRuntime.jsx(LocalizationProvider.LocalizationProvider,{dateAdapter:AdapterDayjs.AdapterDayjs,adapterLocale:n,children:jsxRuntime.jsx(DateCalendar.DateCalendar,{value:null,referenceDate:y,onMonthChange:u,onYearChange:u,onChange:M,slots:{day:$},views:["year","month","day"],openTo:"day",showDaysOutsideCurrentMonth:true,sx:{m:0}})}),jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsxs(material.Stack,{direction:"row",justifyContent:"flex-end",spacing:1,sx:{p:2},children:[jsxRuntime.jsx(material.Button,{size:"small",onClick:Z,color:"inherit",children:r("common.cancel")}),jsxRuntime.jsx(material.Button,{size:"small",variant:"contained",onClick:L,children:r("common.done")})]})]})]})};var Hl={equals:"=",contains:"\u2287",notContains:"\u2285",wildcard:"*","=":"=","!=":"!=",">":">","<":"<",">=":"\u2265","<=":"\u2264",between:"\u2194"},h0={equals:"smartFilter.operator.equals",contains:"smartFilter.operator.contains",notContains:"smartFilter.operator.notContains",wildcard:"smartFilter.operator.wildcard","=":"smartFilter.operator.equals","!=":"smartFilter.operator.notEquals",">":"smartFilter.operator.greaterThan","<":"smartFilter.operator.lessThan",">=":"smartFilter.operator.greaterOrEqual","<=":"smartFilter.operator.lessOrEqual",between:"smartFilter.operator.between"},b0=["equals","contains","notContains","wildcard"],Hp=["=","!=",">","<",">=","<=","between"],_t="0.85rem",y0=({field:e,value:t,onChange:o})=>{let{t:r}=ne(),[a,n]=Qt.useState(null),[i,c]=Qt.useState(null),[d,l]=Qt.useState(""),[s,g]=Qt.useState(""),[f,p]=Qt.useState(false),[b,y]=Qt.useState(""),[u,C]=Qt.useState("");Qt.useEffect(()=>{let S=setTimeout(()=>{C(b);},1e3);return ()=>clearTimeout(S)},[b]);let m=t?.operator||(e.type==="number"?"=":"equals"),h=t?.value,x=S=>{let D=h0[S];return D?r(D):S},w=S=>{n(S.currentTarget);},E=S=>{o({...t,operator:S,value:h}),n(null);},R={size:"small",fullWidth:true,variant:"outlined",InputLabelProps:{sx:{fontSize:_t}},InputProps:{sx:{fontSize:_t}},SelectProps:{MenuProps:{PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:_t,paddingTop:"4px",paddingBottom:"4px",minHeight:"auto"}}}}}},T=e.type||"text";if(T==="date"){let D=(P=>{if(!P)return [null,null];if(Array.isArray(P)&&P.length===2){let M=P[0]?zr__default.default.isDayjs(P[0])?P[0]:zr__default.default(P[0]):null,B=P[1]?zr__default.default.isDayjs(P[1])?P[1]:zr__default.default(P[1]):null;return [M,B]}return zr__default.default.isDayjs(P)||typeof P=="string"?[zr__default.default.isDayjs(P)?P:zr__default.default(P),null]:[null,null]})(h);return jsxRuntime.jsx(Op,{label:e.label,value:D,onChange:P=>o({value:P,operator:"between"})})}if(T==="number"&&m==="between"){let S=()=>{o({value:[d,s],operator:"between"}),c(null);},D=Array.isArray(h)?`${h[0]||""} - ${h[1]||""}`:"";return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.TextField,{...R,label:e.label,value:D,placeholder:r("smartFilter.minMaxPlaceholder"),InputProps:{...R.InputProps,startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(material.Tooltip,{title:x("between"),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:w,sx:{width:24,height:24,fontSize:_t},children:Hl.between})})}),readOnly:true},onClick:P=>c(P.currentTarget)}),jsxRuntime.jsx(material.Menu,{anchorEl:a,open:!!a,onClose:()=>n(null),PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:_t,minHeight:"auto",py:.5}}},children:Hp.map(P=>jsxRuntime.jsxs(material.MenuItem,{selected:P===m,onClick:()=>E(P),children:[jsxRuntime.jsx(material.Box,{sx:{width:24,display:"inline-block",fontWeight:"bold"},children:Hl[P]}),jsxRuntime.jsx(material.ListItemText,{primary:x(P),primaryTypographyProps:{fontSize:_t}})]},P))}),jsxRuntime.jsx(material.Popover,{open:!!i,anchorEl:i,onClose:()=>c(null),anchorOrigin:{vertical:"bottom",horizontal:"left"},children:jsxRuntime.jsxs(material.Box,{sx:{p:2,display:"flex",gap:1,alignItems:"center"},children:[jsxRuntime.jsx(material.TextField,{size:"small",label:r("smartFilter.min"),type:"number",value:d,onChange:P=>l(P.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:_t}},InputProps:{sx:{fontSize:_t}}}),jsxRuntime.jsx(f0__default.default,{color:"action"}),jsxRuntime.jsx(material.TextField,{size:"small",label:r("smartFilter.max"),type:"number",value:s,onChange:P=>g(P.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:_t}},InputProps:{sx:{fontSize:_t}}}),jsxRuntime.jsx(material.Button,{variant:"contained",size:"small",onClick:S,children:r("common.ok")})]})})]})}if(e.isValueHelp||T==="value-help"){let S=e.valueHelp?.mode||"single";return jsxRuntime.jsx(Nu,{...R,...e.valueHelp,label:e.label,placeholder:e.placeholder||e.valueHelp?.placeholder,value:h??(S==="multiple"?[]:null),mode:S,onChange:D=>o({value:D,operator:S==="multiple"?"anyOf":"equals"})})}if(T==="select")return jsxRuntime.jsxs(material.TextField,{...R,select:true,label:e.label,value:h||"",onChange:S=>o({...t,value:S.target.value,operator:"equals"}),children:[jsxRuntime.jsx(material.MenuItem,{value:"",children:jsxRuntime.jsx("em",{children:r("common.none")})}),e.options?.map(S=>jsxRuntime.jsx(material.MenuItem,{value:S.value,children:S.label},S.value))]});if(T==="multi-select"){let S=Array.isArray(h)?h:[],D=e.options?.filter(P=>P.label.toLowerCase().includes(u.toLowerCase()))||[];return jsxRuntime.jsxs(material.TextField,{...R,select:true,label:e.label,value:S,onChange:P=>o({...t,value:P.target.value,operator:"anyOf"}),SelectProps:{...R.SelectProps,multiple:true,onClose:()=>{y(""),C("");},renderValue:P=>{if(!Array.isArray(P)||P.length===0)return jsxRuntime.jsx("em",{children:r("common.none")});let M=X=>e.options?.find(L=>L.value===X)?.label||X,B=P.map(M);return B.length>2?`${B.slice(0,2).join(", ")} +${B.length-2}`:B.join(", ")}},children:[jsxRuntime.jsx(material.ListSubheader,{children:jsxRuntime.jsx(material.TextField,{size:"small",autoFocus:true,placeholder:r("smartFilter.searchPlaceholder"),fullWidth:true,InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(Bu__default.default,{fontSize:"small"})}),sx:{fontSize:_t}},value:b,onChange:P=>y(P.target.value),onKeyDown:P=>{P.key!=="Escape"&&P.stopPropagation();},onClick:P=>P.stopPropagation()})}),D.length>0?D.map(P=>jsxRuntime.jsxs(material.MenuItem,{value:P.value,children:[jsxRuntime.jsx(material.Checkbox,{checked:S.indexOf(P.value)>-1,size:"small"}),jsxRuntime.jsx(material.ListItemText,{primary:P.label,primaryTypographyProps:{fontSize:_t}})]},P.value)):jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.ListItemText,{primary:r("smartFilter.noOptionsFound"),primaryTypographyProps:{fontSize:_t}})})]})}let I=T==="number"?Hp:b0,k=f||h!==void 0&&h!==""&&h!==null||!!a;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.TextField,{...R,label:e.label,sx:{minWidth:"120px"},value:h||"",type:T==="number"?"number":"text",onChange:S=>o({...t,value:S.target.value,operator:m}),onFocus:()=>p(true),onBlur:()=>p(false),InputProps:{...R.InputProps,startAdornment:k?jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(material.Tooltip,{title:x(m),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:w,onMouseDown:S=>S.preventDefault(),sx:{width:24,height:24,fontSize:_t,fontWeight:"bold",color:"primary.main",bgcolor:"action.hover"},children:Hl[m]})})}):null,endAdornment:e.hasSearchIcon?jsxRuntime.jsx(material.InputAdornment,{position:"end",children:jsxRuntime.jsx(Bu__default.default,{color:"action"})}):void 0}}),jsxRuntime.jsx(material.Menu,{anchorEl:a,open:!!a,onClose:()=>n(null),PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:_t,minHeight:"auto",py:.5}}},children:I.map(S=>jsxRuntime.jsxs(material.MenuItem,{selected:S===m,onClick:()=>E(S),children:[jsxRuntime.jsx(material.Box,{sx:{width:24,display:"inline-block",fontWeight:"bold"},children:Hl[S]}),jsxRuntime.jsx(material.ListItemText,{primary:x(S),primaryTypographyProps:{fontSize:_t}})]},S))})]})},$r=({fields:e,filters:t,onFilterChange:o,variants:r=[],currentVariantId:a,onVariantLoad:n,onVariantSave:i,onVariantDelete:c,onVariantSetDefault:d,onSearch:l,loading:s=false,appId:g,tableKey:f,currentLayout:p,currentLayoutId:b,layoutRefs:y,variantService:u,serviceUrl:C})=>{let{t:m}=ne(),[h,x]=Qt.useState(true),[w,E]=Qt.useState(null),[R,T]=Qt.useState(e.filter(D=>!D.hidden).map(D=>D.id)),I=(D,P)=>{o({...t,[D]:P});},k=D=>{R.includes(D)?T(R.filter(P=>P!==D)):T([...R,D]);};return jsxRuntime.jsxs(material.Paper,{sx:{mb:0,display:"flex",flexDirection:"column",overflow:"visible",position:"relative"},children:[jsxRuntime.jsxs(material.Box,{sx:{p:2,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[g?jsxRuntime.jsx(Fp,{appId:g,tableKey:f,currentFilters:{values:t,visibleFields:R},currentLayout:p,currentLayoutId:b,layoutRefs:y,onLoad:D=>{if(!D.filters)return;let P=null;if(Array.isArray(D.filters)){let M=f||"default",B=D.filters.find(X=>X.scope===M);P=B?B.filters:null;}else P=D.filters;P&&(P.values||P.visibleFields?(P.visibleFields&&Array.isArray(P.visibleFields)&&T(P.visibleFields),P.values&&o(P.values)):o(P)),n&&n(D);},variantService:u,serviceUrl:C,currentVariantId:a}):jsxRuntime.jsx(Ol,{variants:r,currentVariantId:a,onLoad:n,onSave:D=>{i&&i({...D,filters:{values:t,visibleFields:R}});},onDelete:c,onSetDefault:d}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[jsxRuntime.jsx(material.Tooltip,{title:m("smartFilter.addFilters"),children:jsxRuntime.jsx(material.Button,{onClick:D=>E(D.currentTarget),size:"small",color:"primary",startIcon:jsxRuntime.jsx(p0__default.default,{fontSize:"small"}),sx:{textTransform:"none",fontSize:_t,whiteSpace:"nowrap",minWidth:"fit-content"},children:m("smartFilter.adaptFilters")})}),jsxRuntime.jsx(material.Button,{variant:"contained",size:"small",onClick:l,disabled:s,sx:{minWidth:"52px",fontWeight:"bold",fontSize:_t},children:m(s?"common.loading":"smartFilter.go")}),jsxRuntime.jsxs(material.Menu,{anchorEl:w,open:!!w,onClose:()=>E(null),slotProps:{paper:{style:{maxHeight:400,width:"25ch"},sx:{"& .MuiMenuItem-root":{fontSize:_t,minHeight:32}}}},children:[jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.ListItemText,{primary:m("smartFilter.visibleFilters"),primaryTypographyProps:{fontSize:_t}})}),jsxRuntime.jsx(material.Divider,{}),e.map(D=>jsxRuntime.jsxs(material.MenuItem,{onClick:()=>k(D.id),children:[jsxRuntime.jsx(material.Checkbox,{checked:R.includes(D.id),size:"small"}),jsxRuntime.jsx(material.ListItemText,{primary:D.label,primaryTypographyProps:{fontSize:_t}})]},D.id))]})]})]}),jsxRuntime.jsx(material.Collapse,{in:h,children:jsxRuntime.jsx(material.Box,{sx:{px:2,pb:2},children:jsxRuntime.jsx(material.Grid,{container:true,spacing:2,columns:{xs:2,sm:3,md:4,lg:6},children:e.filter(D=>R.includes(D.id)).map(D=>jsxRuntime.jsx(material.Grid,{size:1,children:jsxRuntime.jsx(y0,{field:D,value:t[D.id]||{value:"",operator:D.type==="number"?"=":"equals"},onChange:P=>I(D.id,P)})},D.id))})})}),jsxRuntime.jsx(material.Box,{sx:{position:"absolute",bottom:0,left:"50%",transform:"translate(-50%, 50%)",zIndex:10},children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>x(!h),sx:{bgcolor:"background.paper",boxShadow:2,border:"1px solid",borderColor:"divider",width:30,height:30,minWidth:30,minHeight:0,p:0,"&:hover":{bgcolor:"background.paper"}},children:h?jsxRuntime.jsx(m0__default.default,{sx:{fontSize:20},color:"action"}):jsxRuntime.jsx(gy__default.default,{sx:{fontSize:20},color:"action"})})})]})};var Xp=({layouts:e,currentLayoutId:t,onLoad:o,onSave:r,onDelete:a,onSetDefault:n})=>{let{t:i}=ne(),[c,d]=Qt.useState(null),[l,s]=Qt.useState(false),[g,f]=Qt.useState(""),[p,b]=Qt.useState(""),[y,u]=Qt.useState({isDefault:false,isPublic:false}),C=e.find(R=>R.id===t),m=R=>{d(R.currentTarget);},h=()=>{d(null);},x=R=>{o(R),h();},w=()=>{f(""),b(""),u({isDefault:false,isPublic:false}),s(true),h();},E=()=>{g.trim()&&(r({name:g,description:p,...y}),s(false));};return jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[jsxRuntime.jsx(material.Tooltip,{title:i("layout.saveLayout"),children:jsxRuntime.jsx(material.IconButton,{onClick:w,color:"primary",size:"small",children:jsxRuntime.jsx(jp__default.default,{fontSize:"small"})})}),jsxRuntime.jsx(material.Tooltip,{title:i("layout.layoutOptions"),children:jsxRuntime.jsx(material.IconButton,{onClick:m,color:C?"primary":"default",size:"small",children:jsxRuntime.jsx(D0__default.default,{fontSize:"small"})})}),jsxRuntime.jsxs(material.Menu,{anchorEl:c,open:!!c,onClose:h,PaperProps:{sx:{width:320,maxHeight:400}},children:[jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.Typography,{variant:"caption",children:i("layout.selectLayout")})}),jsxRuntime.jsxs(material.MenuItem,{onClick:w,children:[jsxRuntime.jsx(material.ListItemIcon,{children:jsxRuntime.jsx(jp__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{children:i("layout.saveCurrentLayout")})]}),jsxRuntime.jsx(material.Divider,{}),e.length===0&&jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:i("layout.noSavedLayouts")})}),e.map((R,T)=>jsxRuntime.jsx(material.MenuItem,{onClick:()=>x(R),selected:R.id===t,children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",width:"100%",justifyContent:"space-between"},children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",overflow:"hidden",mr:1},children:[jsxRuntime.jsx(material.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:jsxRuntime.jsx(material.Typography,{variant:"body2",fontWeight:R.id===t?"bold":"normal",noWrap:true,children:R.name})}),R.description&&jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",noWrap:true,children:R.description})]}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center"},onClick:I=>I.stopPropagation(),children:[jsxRuntime.jsx(material.Tooltip,{title:R.isDefault?i("layout.removeDefault"):i("layout.setAsDefault"),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:I=>{I.stopPropagation(),n(R.id);},children:R.isDefault?jsxRuntime.jsx(Ox__default.default,{fontSize:"small",color:"warning"}):jsxRuntime.jsx(M0__default.default,{fontSize:"small"})})}),jsxRuntime.jsx(material.Tooltip,{title:i("common.delete"),children:jsxRuntime.jsx(material.IconButton,{size:"small",color:"error",onClick:I=>{I.stopPropagation(),a(R.id);},children:jsxRuntime.jsx(_b__default.default,{fontSize:"small"})})})]})]})},R.id||T))]}),jsxRuntime.jsxs(material.Dialog,{open:l,onClose:()=>s(false),maxWidth:"xs",fullWidth:true,children:[jsxRuntime.jsx(material.DialogTitle,{children:i("layout.saveLayout")}),jsxRuntime.jsx(material.DialogContent,{children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:2,mt:1},children:[jsxRuntime.jsx(material.TextField,{label:i("layout.layoutName"),value:g,onChange:R=>f(R.target.value),fullWidth:true,autoFocus:true,size:"small",helperText:i("layout.layoutNameHelper")}),e.some(R=>R.name===g)&&jsxRuntime.jsx(material.Typography,{variant:"caption",color:"warning.main",sx:{ml:1},children:i("layout.warningOverwrite")}),jsxRuntime.jsx(material.TextField,{label:i("layout.layoutDescription"),value:p,onChange:R=>b(R.target.value),fullWidth:true,size:"small"}),jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{checked:y.isDefault,onChange:R=>u({...y,isDefault:R.target.checked})}),label:i("layout.useAsDefault")}),jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{checked:y.isPublic,onChange:R=>u({...y,isPublic:R.target.checked})}),label:i("layout.publicAllUsers")})]})}),jsxRuntime.jsxs(material.DialogActions,{children:[jsxRuntime.jsx(material.Button,{onClick:()=>s(false),children:i("common.cancel")}),jsxRuntime.jsx(material.Button,{onClick:E,variant:"contained",disabled:!g,children:i("common.save")})]})]})]})};var wn=({appId:e,tableKey:t="default",currentLayoutData:o,onLayoutLoad:r,targetLayoutId:a,activeLayoutId:n,serviceUrl:i,onError:c,onSuccess:d})=>{let{t:l}=ne(),[s,g]=Qt.useState([]),[f,p]=Qt.useState(""),b=`orbcafe.layouts.${e}.${t}`,y=T=>({id:T.layoutId,name:T.name,description:T.description??"",isDefault:!!T.isDefault,isPublic:!!T.isPublic,createdAt:T.createdAt??new Date().toISOString(),layoutData:T.layout??{}}),u=T=>({appId:e,tableKey:t,layoutId:T.id,name:T.name,description:T.description??"",isDefault:!!T.isDefault,isPublic:!!T.isPublic,createdAt:T.createdAt,layout:T.layoutData}),C=Qt.useCallback(()=>{try{let T=localStorage.getItem(b);if(!T)return [];let I=JSON.parse(T);return Array.isArray(I)?I:[]}catch{return []}},[b]),m=Qt.useCallback(T=>{try{localStorage.setItem(b,JSON.stringify(T));}catch{}},[b]);Qt.useEffect(()=>{n!==void 0&&p(n);},[n]),Qt.useEffect(()=>{if(a&&s.length>0){let T=s.find(I=>I.id===a);T&&(p(T.id),r(T));}},[a,s,r]);let h=Qt.useCallback(async()=>{if(e){if(!i){let T=C();g(T);let I=T.find(k=>k.isDefault);I&&!f&&!a&&(p(I.id),r(I));return}try{let T=await fetch(`${i}/api/layouts?appId=${encodeURIComponent(e)}&tableKey=${encodeURIComponent(t)}`);if(!T.ok)throw new Error("LAYOUT_FETCH_FAILED");let k=(await T.json()).map(y);g(k);let S=k.find(D=>D.isDefault);S&&!f&&!a&&(p(S.id),r(S));}catch(T){console.error("Error fetching layouts",T);let I=C();g(I);let k=I.find(S=>S.isDefault);k&&!f&&!a&&(p(k.id),r(k)),c&&c(l("layout.toast.loadFallback"));}}},[e,t,i,c,f,r,a,C,l]);return Qt.useEffect(()=>{h();},[e,t]),jsxRuntime.jsx(Xp,{layouts:s,currentLayoutId:f,onLoad:T=>{p(T.id),r(T);},onSave:async T=>{let I=s.find(D=>D.name===T.name),k=I?I.id:Date.now().toString(),S={id:k,...T,createdAt:new Date().toISOString(),layoutData:o,isDefault:T.isDefault??false,isPublic:T.isPublic??false};if(!i){let P=s.some(M=>M.id===k)?s.map(M=>M.id===k?S:M):[...s,S];g(P),m(P),p(k),r(S),d&&d(l("layout.toast.saveLocalSuccess"));return}try{if(!(await fetch(`${i}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(u(S))})).ok)throw new Error("LAYOUT_SAVE_FAILED");d&&d(l("layout.toast.saveSuccess")),await h(),p(k),r(S);}catch(D){console.error("Error saving layout",D);let M=s.some(B=>B.id===k)?s.map(B=>B.id===k?S:B):[...s,S];g(M),m(M),p(k),r(S),d&&d(l("layout.toast.saveLocalSuccess")),c&&c(l("layout.toast.backendUnavailableSavedLocal"));}},onDelete:async T=>{if(!i){let I=s.filter(k=>k.id!==T);g(I),m(I),f===T&&p(""),d&&d(l("layout.toast.deleteLocalSuccess"));return}try{if(!(await fetch(`${i}/api/layouts/${encodeURIComponent(T)}`,{method:"DELETE"})).ok)throw new Error("LAYOUT_DELETE_FAILED");f===T&&p(""),d&&d(l("layout.toast.deleteSuccess")),await h();}catch(I){console.error("Error deleting layout",I);let k=s.filter(S=>S.id!==T);g(k),m(k),f===T&&p(""),d&&d(l("layout.toast.deleteLocalSuccess")),c&&c(l("layout.toast.backendUnavailableDeletedLocal"));}},onSetDefault:async T=>{if(!i){let I=s.map(k=>({...k,isDefault:k.id===T}));g(I),m(I),d&&d(l("layout.toast.defaultLocalSuccess"));return}try{let I=s.find(S=>S.id===T);if(!I)return;if(!(await fetch(`${i}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(u({...I,isDefault:!0}))})).ok)throw new Error("LAYOUT_DEFAULT_FAILED");d&&d(l("layout.toast.defaultSuccess")),await h();}catch(I){console.error("Error setting default",I);let k=s.map(S=>({...S,isDefault:S.id===T}));g(k),m(k),d&&d(l("layout.toast.defaultLocalSuccess")),c&&c(l("layout.toast.backendUnavailableDefaultLocal"));}}})};var Yp=(e,t)=>{if(!e||!e.filters)return null;if(Array.isArray(e.filters)){let o=e.filters.find(a=>a.scope===t);if(o)return o.filters;let r=e.filters.find(a=>a.scope==="default");return r?r.filters:null}return typeof e.filters=="object"?e.filters:null},_l=(e,t)=>{if(!e)return {layout:null,layoutId:null};let o=null,r=null;if(Array.isArray(e.layoutRefs)){let a=e.layoutRefs.find(n=>n.tableKey===t);a&&(o=a.layoutId);}return !o&&e.layoutId&&(o=e.layoutId),e.layout&&typeof e.layout=="object"&&!Array.isArray(e.layout)&&(r=e.layout),{layoutId:o,layout:r}};function Qp(e,t,o){return t[o]<e[o]?-1:t[o]>e[o]?1:0}function B0(e,t){return e==="desc"?(o,r)=>Qp(o,r,t):(o,r)=>-Qp(o,r,t)}function E0(e,t){let o=e.map((r,a)=>[r,a]);return o.sort((r,a)=>{let n=t(r[0],a[0]);return n!==0?n:r[1]-a[1]}),o.map(r=>r[0])}var Tn=e=>{let t=!!e.disableGrouping,o=!!e.disableSorting,r=Qt.useCallback(O=>{let U=String(O?.label??O?.id??"").length*9+64,me=typeof O?.minWidth=="number"?O.minWidth:0;return Math.max(100,me,U)},[]),a=Qt.useCallback(()=>(e.columns||[]).filter(O=>!!O?.numeric).map(O=>O.id),[e.columns]),[n,i]=Qt.useState(""),[c,d]=Qt.useState(e.order||"asc"),[l,s]=Qt.useState(e.orderBy||""),[g,f]=Qt.useState([]),[p,b]=Qt.useState(e.page||0),[y,u]=Qt.useState(e.rowsPerPage||20),[C,m]=Qt.useState(e.selected||[]),[h,x]=Qt.useState(e.columns?e.columns.map(O=>O.id):[]),[w,E]=Qt.useState(e.columns?e.columns.map(O=>O.id):[]),[R,T]=Qt.useState(e.showSummary||false),[I,k]=Qt.useState(()=>a()),[S,D]=Qt.useState([]),[P,M]=Qt.useState(new Set),[B,X]=Qt.useState(()=>{let O={};return (e.columns||[]).forEach(W=>{O[W.id]=r(W);}),O}),[L,Z]=Qt.useState(null),[$,q]=Qt.useState(null),[H,re]=Qt.useState(null),[de,Ce]=Qt.useState(null),[ve,le]=Qt.useState(false),[oe,Ie]=Qt.useState(""),[Ze,Ge]=Qt.useState(""),ce=t?[]:S,Ve=Qt.useCallback(O=>{if(t){D([]),M(new Set),q(null);return}D(O);},[t]);Qt.useEffect(()=>{t&&(D([]),M(new Set),q(null));},[t]),Qt.useEffect(()=>{o&&(d("asc"),s(""),f([]));},[o]),Qt.useEffect(()=>{e.layout&&Ct(e.layout);},[e.layout]),Qt.useEffect(()=>{if(o){d("asc"),s("");return}e.order!==void 0&&d(e.order),e.orderBy!==void 0&&s(e.orderBy);},[e.order,e.orderBy,o]),Qt.useEffect(()=>{e.selected!==void 0&&m(e.selected);},[e.selected]),Qt.useEffect(()=>{e.page!==void 0&&b(e.page);},[e.page]),Qt.useEffect(()=>{e.rowsPerPage!==void 0&&u(e.rowsPerPage);},[e.rowsPerPage]),Qt.useEffect(()=>{let O=a();k(W=>W.filter(me=>O.includes(me)));},[a]),Qt.useEffect(()=>{X(O=>{let W={...O};return (e.columns||[]).forEach(U=>{W[U.id]===void 0&&(W[U.id]=r(U));}),W});},[e.columns,r]),Qt.useEffect(()=>{E(O=>{let W=(e.columns||[]).map(Ye=>Ye.id),U=new Set(W),me=O.filter(Ye=>U.has(Ye)),pe=new Set(me),Fe=W.filter(Ye=>!pe.has(Ye)),Xe=[...me,...Fe];return Xe.length===O.length&&Xe.every((Ye,ot)=>Ye===O[ot])?O:Xe});},[e.columns]);let et=Qt.useMemo(()=>{let O=e.columns||[];if(w.length===0)return O;let W=new Map(O.map(pe=>[pe.id,pe])),U=[],me=new Set;return w.forEach(pe=>{let Fe=W.get(pe);Fe&&(U.push(Fe),me.add(pe));}),O.forEach(pe=>{me.has(pe.id)||U.push(pe);}),U},[e.columns,w]),ye=Qt.useMemo(()=>{let O=e.rows||[];return n&&(O=O.filter(W=>Object.keys(W).some(U=>String(W[U]).toLowerCase().includes(n.toLowerCase())))),O},[e.rows,n]),We=Qt.useMemo(()=>{if(o||e.onSortChange)return ye;if(g.length>0){let O=[...ye];return O.sort((W,U)=>{for(let me of g){let pe=W?.[me.field],Fe=U?.[me.field];if(!(pe==null&&Fe==null)){if(pe==null)return me.direction==="asc"?-1:1;if(Fe==null)return me.direction==="asc"?1:-1;if(pe<Fe)return me.direction==="asc"?-1:1;if(pe>Fe)return me.direction==="asc"?1:-1}}return 0}),O}return l?E0(ye,B0(c,l)):ye},[ye,c,l,g,e.onSortChange,o]),qe=Qt.useCallback(O=>{if(ce.length===0)return O.map(Fe=>({type:"row",data:Fe,id:Fe[e.rowKey||"id"]}));let W=[...O].sort((Fe,Xe)=>{for(let Ye of ce){if(Fe[Ye]<Xe[Ye])return -1;if(Fe[Ye]>Xe[Ye])return 1}return 0}),U=(Fe,Xe=0)=>{if(Xe>=ce.length)return Fe;let Ye=ce[Xe],ot={},Dt=[];return Fe.forEach(pt=>{let mt=pt[Ye],St=`${Ye}:${mt}`;ot[St]||(ot[St]={key:St,field:Ye,value:mt,children:[],count:0,level:Xe},Dt.push(ot[St])),ot[St].children.push(pt),ot[St].count++;}),Dt.forEach(pt=>{pt.children&&(pt.children=U(pt.children,Xe+1));}),Dt},me=U(W),pe=(Fe,Xe="")=>{let Ye=[];return Fe.forEach(ot=>{if(ot.children){let Dt=Xe?`${Xe}>${ot.key}`:ot.key,pt=P.has(Dt);Ye.push({type:"group",id:Dt,field:ot.field,value:ot.value,level:ot.level,count:ot.count,isExpanded:pt,childIds:(function mt(St){let Wt=[];return St.children.forEach(ct=>{ct.children?Wt=Wt.concat(mt(ct)):Wt.push(ct[e.rowKey||"id"]);}),Wt})(ot)}),pt&&(Ye=Ye.concat(pe(ot.children,Dt)));}else Ye.push({type:"row",data:ot,id:ot[e.rowKey||"id"],level:ce.length});}),Ye};return pe(me)},[ce,P,e.rowKey]),st=Qt.useCallback(O=>{if(ce.length===0)return [];let W=[...O].sort((pe,Fe)=>{for(let Xe of ce){if(pe[Xe]<Fe[Xe])return -1;if(pe[Xe]>Fe[Xe])return 1}return 0}),U=[],me=(pe,Fe,Xe)=>{if(Fe>=ce.length)return;let Ye=ce[Fe],ot=new Map;pe.forEach(Dt=>{let pt=Dt[Ye],mt=ot.get(pt);mt?mt.push(Dt):ot.set(pt,[Dt]);}),ot.forEach((Dt,pt)=>{let mt=`${Ye}:${pt}`,St=Xe?`${Xe}>${mt}`:mt;U.push(St),me(Dt,Fe+1,St);});};return me(W,0,""),U},[ce]),Pe=Qt.useMemo(()=>qe(We),[We,qe]),K=Qt.useMemo(()=>st(We),[We,st]),Ee=Qt.useMemo(()=>{let O=(e.rows||[]).length;return typeof e.count=="number"&&e.count>O},[e.count,e.rows]),ge=Qt.useMemo(()=>Ee?Pe:y>0?Pe.slice(p*y,p*y+y):Pe,[Pe,p,y,Ee]),ke=Qt.useMemo(()=>Ee&&typeof e.count=="number"?e.count:Pe.length,[Pe.length,Ee,e.count]),rt=O=>{M(W=>{let U=new Set(W);return U.has(O)?U.delete(O):U.add(O),U});},Ue=O=>{let W=K.filter(U=>U===O||U.startsWith(`${O}>`));M(U=>{let me=new Set(U);return W.forEach(pe=>me.add(pe)),me});},ae=O=>{M(W=>{let U=new Set(W);return Array.from(U).forEach(me=>{(me===O||me.startsWith(`${O}>`))&&U.delete(me);}),U});},fe=O=>{if(!O){M(new Set);return}M(new Set(K));},je=O=>{let W=K.filter(U=>U.startsWith(`${O}>`));return W.length===0?P.has(O):P.has(O)&&W.every(U=>P.has(U))},It=O=>{if(o)return;g.length>0&&f([]);let W=l===O&&c==="asc",U=l===O&&c==="desc";if(e.onSortChange){W?e.onSortChange(O,"desc"):U?e.onSortChange("","asc"):e.onSortChange(O,"asc");return}W?(d("desc"),s(O)):U?(d("asc"),s("")):(d("asc"),s(O));},_=O=>{if(o){d("asc"),s(""),f([]);return}let W=O.filter(U=>U&&U.field);f(W),W.length>0&&s("");},ze=()=>{f([]);},xe=(O,W)=>{X(U=>({...U,[O]:W}));},Y=O=>{if(O.target.checked){let W=ye.map(U=>U[e.rowKey||"id"]);m(W),e.onSelectionChange&&e.onSelectionChange(W);return}m([]),e.onSelectionChange&&e.onSelectionChange([]);},N=(O,W)=>{let U=W[e.rowKey||"id"],me=C.indexOf(U),pe=[];me===-1?pe=pe.concat(C,U):me===0?pe=pe.concat(C.slice(1)):me===C.length-1?pe=pe.concat(C.slice(0,-1)):me>0&&(pe=pe.concat(C.slice(0,me),C.slice(me+1))),m(pe),e.onSelectionChange&&e.onSelectionChange(pe);},J=O=>{b(O),e.onPageChange&&e.onPageChange(O);},we=O=>{u(O),b(0),e.onPageChange&&e.onPageChange(0),e.onRowsPerPageChange&&e.onRowsPerPageChange(O);},Me=O=>{let W=h.indexOf(O),U=[...h];W===-1?U.push(O):U.splice(W,1),x(U);},tt=O=>{if(t)return;let W=ce.indexOf(O),U=[...ce];W===-1?U.push(O):U.splice(W,1),Ve(U);},bt=O=>{a().includes(O)&&k(U=>U.includes(O)?U.filter(me=>me!==O):[...U,O]);},dt=(O,W)=>{!O||!W||O===W||E(U=>{let me=U.indexOf(O),pe=U.indexOf(W);if(me===-1||pe===-1)return U;let Fe=[...U];return Fe.splice(me,1),Fe.splice(pe,0,O),Fe});},Vt=O=>{let W=O?.active?.id,U=O?.over?.id;typeof W=="string"&&typeof U=="string"&&dt(W,U);},vt=O=>{e.onLayoutSave&&e.onLayoutSave({visibleColumns:h,columnOrder:w,order:o?"asc":c,orderBy:o?"":l,sortBy:o?[]:g,grouping:ce,columnWidths:B,showSummary:R,summaryColumns:I});},ko=O=>{let{layout:W,layoutId:U}=_l(O,e.tableKey||"default");U?(Ge(U),Ie(U)):(Ge(""),Ie("")),W&&(W.visibleColumns&&x(W.visibleColumns),Array.isArray(W.columnOrder)&&E(W.columnOrder),o?(d("asc"),s(""),f([])):(W.order&&d(W.order),W.orderBy&&s(W.orderBy),Array.isArray(W.sortBy)&&f(W.sortBy)),W.grouping&&Ve(W.grouping),W.columnWidths&&X(W.columnWidths),W.showSummary!==void 0&&T(!!W.showSummary),Array.isArray(W.summaryColumns)&&k(W.summaryColumns));},Ct=O=>{let W=O?.layoutData||O?.layout||O||{};W.visibleColumns&&x(W.visibleColumns),Array.isArray(W.columnOrder)&&E(W.columnOrder),o?(d("asc"),s(""),f([])):(W.order&&d(W.order),W.orderBy!==void 0&&s(W.orderBy),Array.isArray(W.sortBy)&&f(W.sortBy)),W.grouping&&Ve(W.grouping),W.columnWidths&&X(W.columnWidths),W.showSummary!==void 0&&T(!!W.showSummary),Array.isArray(W.summaryColumns)&&k(W.summaryColumns),M(new Set),b(0),O?.id&&Ie(O.id),Ge("");};Qt.useEffect(()=>{e.layout&&ko({layout:e.layout});},[e.layout]);let sr=O=>{O.preventDefault(),Ce(de===null?{mouseX:O.clientX+2,mouseY:O.clientY-6}:null);},lo=()=>{Ce(null);},Et=Qt.useMemo(()=>{if(!R)return {};let O={};e.columns.forEach(U=>{if(U.numeric&&I.includes(U.id)){let me=ye.reduce((pe,Fe)=>{let Xe=parseFloat(Fe[U.id]);return pe+(isNaN(Xe)?0:Xe)},0);O[U.id]=me.toFixed(2);}else O[U.id]="";});let W=e.columns.find(U=>h.includes(U.id));return W&&!W.numeric&&(O[W.id]="Total"),O},[ye,e.columns,R,I,h]),Gt=()=>{if(!e.columns||!ye)return;let O=e.columns.map(Fe=>Fe.label).join(","),W=ye.map(Fe=>e.columns.map(Xe=>{let Ye=Fe[Xe.id];return `"${(Ye==null?"":String(Ye)).replace(/"/g,'""')}"`}).join(",")).join(`
184
- `),U=`data:text/csv;charset=utf-8,${O}
185
- ${W}`,me=encodeURI(U),pe=document.createElement("a");pe.setAttribute("href",me),pe.setAttribute("download",`${e.title||"export"}.csv`),document.body.appendChild(pe),pe.click(),document.body.removeChild(pe);},yt=()=>{le(true);},ao=()=>{le(false);};return {isMobile:false,columns:et,order:c,setOrder:d,orderBy:l,setOrderBy:s,sortBy:g,setSortBy:f,applyMultiSort:_,clearMultiSort:ze,columnOrder:w,setColumnOrder:E,filterText:n,setFilterText:i,visibleColumns:h,setVisibleColumns:x,showSummary:R,setShowSummary:T,summaryColumns:I,grouping:ce,setGrouping:Ve,expandedGroups:P,setExpandedGroups:M,groupAnchorEl:$,setGroupAnchorEl:q,summaryAnchorEl:H,setSummaryAnchorEl:re,columnWidths:B,setColumnWidths:X,anchorEl:L,setAnchorEl:Z,contextMenu:de,setContextMenu:Ce,sensors:void 0,sortedAndFilteredRows:We,visibleRows:ge,summaryRow:Et,page:p,setPage:J,rowsPerPage:y,setRowsPerPage:we,totalDisplayCount:ke,selected:C,setSelected:m,isAllExpanded:K.length>0&&K.every(O=>P.has(O)),handleColumnResize:xe,handleRequestSort:It,handleSelectAllClick:Y,handleClick:N,toggleSummaryColumn:bt,handleDragEnd:Vt,handleColumnReorder:dt,handleExport:Gt,handleContextMenu:sr,handleCloseContextMenu:lo,toggleColumnVisibility:Me,toggleGroupExpand:rt,toggleGroupField:tt,handleToggleAll:fe,handleExpandGroupRecursively:Ue,handleCollapseGroupRecursively:ae,isGroupFullyExpanded:je,handleLayoutLoad:Ct,handleVariantLoad:ko,handleLayoutSave:vt,effectiveAppId:e.appId||"",currentLayoutData:{visibleColumns:h,order:o?"asc":c,orderBy:o?"":l,sortBy:o?[]:g,columnOrder:w,grouping:ce,columnWidths:B,showSummary:R,summaryColumns:I},currentLayoutId:oe,layoutIdToLoad:Ze,onPageChange:J,onRowsPerPageChange:we,graphReportOpen:ve,handleOpenGraphReport:yt,handleCloseGraphReport:ao}};var lB=e=>jsxRuntime.jsx(N0__default.default,{...e}),sB=e=>jsxRuntime.jsx(vc__default.default,{...e}),cB=e=>jsxRuntime.jsx(nm__default.default,{...e}),dB=e=>jsxRuntime.jsx(Yb__default.default,{...e}),uB=e=>jsxRuntime.jsx(Qb__default.default,{...e}),Dr=e=>{let{t}=ne(),o="0.85rem",{title:r,showToolbar:a=true,selectionMode:n,selected:i=[],onSelectionChange:c,actions:d,extraTools:l,fitContainer:s=false,fullWidth:g=false,maxHeight:f,loading:p=false,rowsPerPageOptions:b=[20,50,100,-1],onLayoutSave:y,filterConfig:u,rowKey:C,tableKey:m="default",graphReport:h,quickCreate:x,quickEdit:w,quickDelete:E,serviceUrl:R,disableGrouping:T=false,disableSorting:I=false}=e,k=r||t("table.title.default"),{isMobile:S,columns:D,order:P,orderBy:M,filterText:B,setFilterText:X,visibleColumns:L,showSummary:Z,setShowSummary:$,summaryColumns:q,grouping:H,setGrouping:re,expandedGroups:de,groupAnchorEl:Ce,setGroupAnchorEl:ve,summaryAnchorEl:le,setSummaryAnchorEl:oe,columnWidths:Ie,anchorEl:Ze,setAnchorEl:Ge,contextMenu:ce,sensors:Ve,sortedAndFilteredRows:et,summaryRow:ye,visibleRows:We,isAllExpanded:qe,page:st,setPage:Pe,rowsPerPage:K,setRowsPerPage:Ee,totalDisplayCount:ge,setSelected:ke,handleColumnResize:rt,handleRequestSort:Ue,handleSelectAllClick:ae,handleClick:fe,toggleSummaryColumn:je,handleDragEnd:It,handleExport:_,handleContextMenu:ze,handleCloseContextMenu:xe,toggleColumnVisibility:Y,toggleGroupExpand:N,toggleGroupField:J,handleToggleAll:we,handleExpandGroupRecursively:Me,handleCollapseGroupRecursively:tt,isGroupFullyExpanded:bt,handleLayoutLoad:dt,handleVariantLoad:Vt,handleLayoutSave:vt,effectiveAppId:ko,currentLayoutData:Ct,currentLayoutId:sr,layoutIdToLoad:lo,graphReportOpen:Et,handleOpenGraphReport:Gt,handleCloseGraphReport:yt}=Tn(e),ao=h?.enabled??false,O=ao&&(h?.interaction?.enabled??true),W=Nl(),U=!!x?.enabled,me=!!w?.enabled,pe=!!E?.enabled,Fe=x?.fields,Xe=x?.excludeFields||[],Ye=x?.initialValues||{},[ot,Dt]=Qt__namespace.default.useState(false),[pt,mt]=Qt__namespace.default.useState(false),[St,Wt]=Qt__namespace.default.useState({}),[ct,Ao]=Qt__namespace.default.useState(false),[wo,Yo]=Qt__namespace.default.useState(false),[A,j]=Qt__namespace.default.useState({}),[ee,se]=Qt__namespace.default.useState(false),[Le,_e]=Qt__namespace.default.useState(false),gt=p||pt||wo||Le,Re=Qt__namespace.default.useMemo(()=>{let G=[...D];if(Array.isArray(Fe)&&Fe.length>0){let Ne=new Set(Fe);G=G.filter(V=>Ne.has(V.id));}if(Xe.length>0){let Ne=new Set(Xe);G=G.filter(V=>!Ne.has(V.id));}return G.filter(Ne=>!!Ne?.id)},[D,Xe,Fe]),ut=C||"id",nt=Qt__namespace.default.useMemo(()=>{let G=new Set(i);return et.filter(Ne=>G.has(Ne?.[ut]))},[i,et,ut]),Pt=nt.length===1?nt[0]:null,ht=w?.fields,eo=w?.excludeFields||[],so=w?.editableFields||[],To=w?.nonEditableFields||[],Xt=w?.primaryKeys?.length?w.primaryKeys:[ut],xo=Qt__namespace.default.useMemo(()=>{let G=[...D];if(Array.isArray(ht)&&ht.length>0){let Ne=new Set(ht);G=G.filter(V=>Ne.has(V.id));}if(eo.length>0){let Ne=new Set(eo);G=G.filter(V=>!Ne.has(V.id));}return G.filter(Ne=>!!Ne?.id)},[D,eo,ht]),Rt=Qt__namespace.default.useMemo(()=>new Set(Xt),[Xt]),Ut=Qt__namespace.default.useMemo(()=>new Set(so),[so]),cr=Qt__namespace.default.useMemo(()=>new Set(To),[To]),dr=Qt__namespace.default.useCallback(G=>Ut.size>0?Ut.has(G):!(cr.has(G)||Rt.has(G)),[Ut,cr,Rt]);Qt__namespace.default.useEffect(()=>{!Et&&W.hasActiveFilters&&W.clearAll();},[Et,W.hasActiveFilters,W.clearAll]);let rn=()=>{let G={};Re.forEach(Ne=>{G[Ne.id]=Ye[Ne.id]??"";}),Wt(G),Dt(true);},wa=()=>{pt||Dt(false);},an=(G,Ne)=>{Wt(V=>({...V,[G]:Ne}));},Qo=async()=>{if(!x?.onSubmit){Dt(false);return}try{mt(!0),await x.onSubmit(St),Dt(!1);}finally{mt(false);}},nn=()=>{if(!Pt)return;let G={};xo.forEach(V=>{G[V.id]=Pt[V.id]??"";});let Ne=w?.getInitialValues?{...G,...w.getInitialValues(Pt)}:G;j(Ne),Ao(true);},Ta=()=>{wo||Ao(false);},Ia=(G,Ne)=>{j(V=>({...V,[G]:Ne}));},Or=async()=>{if(Pt){if(!w?.onSubmit){Ao(false);return}try{Yo(!0),await w.onSubmit(A,Pt),Ao(!1);}finally{Yo(false);}}},ra=()=>{nt.length!==0&&se(true);},ni=()=>{Le||se(false);},v=async()=>{if(nt.length===0){se(false);return}if(!E?.onConfirm){se(false),ke([]),c?.([]);return}try{_e(!0),await E.onConfirm(nt),se(!1),ke([]),c?.([]);}finally{_e(false);}},F=et,{fieldMapping:z}=xn({rows:F,config:{...h,title:h?.title||`${k} ${t("graph.reportTitle")}`}}),Q=Qt__namespace.default.useMemo(()=>O?W.applyRows(F,z):F,[O,W.applyRows,F,z]),{model:he}=xn({rows:Q,config:{...h,title:h?.title||`${k} ${t("graph.reportTitle")}`,fieldMapping:z}}),Ke=he.table.columns.map(G=>({id:G.id,label:G.label,align:G.align||"left",minWidth:120,numeric:G.align==="right"})),De=ko?jsxRuntime.jsx(wn,{appId:ko,tableKey:m,currentLayoutData:Ct,onLayoutLoad:dt,targetLayoutId:lo,activeLayoutId:sr,serviceUrl:R??u?.serviceUrl}):null,He=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[!T&&jsxRuntime.jsx(sn,{groupAnchorEl:Ce,setGroupAnchorEl:ve,grouping:H,setGrouping:re,columns:D,toggleGroupField:J}),jsxRuntime.jsx(cn,{anchorEl:Ze,setAnchorEl:Ge,columns:D,visibleColumns:L,toggleColumnVisibility:Y}),jsxRuntime.jsx(bl,{anchorEl:le,setAnchorEl:oe,showSummary:Z,setShowSummary:$,columns:D,summaryColumns:q,toggleSummaryColumn:je}),jsxRuntime.jsx(yl,{contextMenu:ce,handleCloseContextMenu:xe,columns:D,visibleColumns:L,toggleColumnVisibility:Y})]});return S?jsxRuntime.jsxs(Ri__default.default,{sx:{display:"flex",flexDirection:"column",gap:2,height:"100%"},children:[u&&jsxRuntime.jsx($r,{fields:u.fields,filters:u.filters,onFilterChange:u.onFilterChange,onSearch:u.onSearch,variants:u.variants||[],currentVariantId:u.currentVariantId,onVariantLoad:u.onVariantLoad,onVariantSave:u.onVariantSave,onVariantDelete:u.onVariantDelete,onVariantSetDefault:u.onVariantSetDefault,appId:u.appId,tableKey:m,currentLayout:[{tableKey:m,layoutData:Ct}],variantService:u.variantService,serviceUrl:R??u.serviceUrl}),jsxRuntime.jsx(_u,{title:k,loading:p,showSummary:Z,setShowSummary:$,setAnchorEl:Ge,setSummaryAnchorEl:oe,filterText:B,setFilterText:X,sortedAndFilteredRows:et,selected:i,columns:D,visibleColumns:L,summaryRow:ye,handleClick:fe,selectionMode:n}),He]}):jsxRuntime.jsxs(Ri__default.default,{sx:{width:g?"100%":"auto",mb:s?0:2,...s?{flex:1,display:"flex",flexDirection:"column",minHeight:0,height:"100%",overflow:"hidden"}:{}},children:[u&&jsxRuntime.jsx(Ri__default.default,{sx:{mb:2},children:jsxRuntime.jsx($r,{fields:u.fields,filters:u.filters,onFilterChange:u.onFilterChange,onSearch:u.onSearch,variants:u.variants||[],currentVariantId:u.currentVariantId,onVariantLoad:G=>{Vt(G),u.onVariantLoad&&u.onVariantLoad(G);},onVariantSave:u.onVariantSave,onVariantDelete:u.onVariantDelete,onVariantSetDefault:u.onVariantSetDefault,loading:p,appId:u.appId,tableKey:m,currentLayout:[{tableKey:m,layoutData:Ct}],currentLayoutId:sr,layoutRefs:[{tableKey:m,layoutId:sr}],variantService:u.variantService,serviceUrl:R??u.serviceUrl})}),jsxRuntime.jsxs(F0__default.default,{sx:{width:g?"100%":"auto",mb:s?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative","&::before":gt?{content:'""',position:"absolute",top:0,left:0,width:"100%",height:"3px",background:"linear-gradient(90deg, rgba(25, 118, 210, 0) 0%, rgba(25, 118, 210, 0.25) 25%, rgba(25, 118, 210, 1) 50%, rgba(25, 118, 210, 0.25) 75%, rgba(25, 118, 210, 0) 100%)",backgroundSize:"220% 100%",animation:"cTableTopMarquee 1.2s linear infinite",zIndex:6,pointerEvents:"none"}:{},"@keyframes cTableTopMarquee":{"0%":{backgroundPosition:"220% 0"},"100%":{backgroundPosition:"-120% 0"}},...f?{height:f}:s?{flex:1,minHeight:0,height:"100%"}:{}},children:[a&&jsxRuntime.jsx(ul,{filterText:B,setFilterText:X,onRowsPerPageChange:Ee,rowsPerPage:K,rowsPerPageOptions:b,page:st,count:ge,onPageChange:Pe,actions:d,extraTools:l,grouping:H,disableGrouping:T,setGroupAnchorEl:ve,showSummary:Z,setShowSummary:$,setAnchorEl:Ge,setSummaryAnchorEl:oe,handleExport:_,showCreateButton:U,onOpenCreateDialog:rn,showEditButton:me,onOpenEditDialog:nn,editDisabled:nt.length!==1,showDeleteButton:pe,onOpenDeleteConfirm:ra,deleteDisabled:nt.length===0,onLayoutSave:y||u?.variantService&&u?.appId?vt:void 0,loading:p,layoutManager:De,onOpenGraphReport:ao?Gt:void 0}),jsxRuntime.jsx(nm__default.default,{sx:{flex:1,...f?{maxHeight:f,height:f}:s?{height:0,maxHeight:"none"}:{maxHeight:"calc(100vh - 320px)"},overflowY:"auto",overflowX:"auto",position:"relative",minHeight:0},children:jsxRuntime.jsx(core.DndContext,{sensors:Ve,collisionDetection:core.closestCenter,onDragEnd:It,modifiers:[modifiers.restrictToHorizontalAxis],children:jsxRuntime.jsxs(L0__default.default,{sx:{minWidth:g?750:"auto",width:g?"100%":"auto",tableLayout:Object.keys(Ie).length>0?"fixed":"auto",borderCollapse:"separate",borderSpacing:0,"& .MuiTableCell-root":{fontSize:o}},"aria-labelledby":"tableTitle",size:"small",stickyHeader:true,children:[jsxRuntime.jsx(gl,{columns:D,visibleColumns:L,order:P,orderBy:M,onRequestSort:Ue,disableSorting:I,onContextMenu:ze,selectionMode:n,grouping:H,isAllExpanded:qe,handleToggleAll:we,rowCount:et.length,numSelected:i.length,onSelectAllClick:ae,columnWidths:Ie,onColumnResize:rt}),jsxRuntime.jsx($u,{visibleRows:We,columns:D,visibleColumns:L,selectionMode:n,selected:i,orderBy:M,loading:p,expandedGroups:de,toggleGroupExpand:N,handleExpandGroupRecursively:Me,handleCollapseGroupRecursively:tt,isGroupFullyExpanded:bt,handleClick:fe,onSelectionChange:c,grouping:H,rowKeyProp:C,page:st,rowsPerPage:K}),Z&&jsxRuntime.jsx(Gu,{showSummary:Z,columns:D,visibleColumns:L,summaryRow:ye,selectionMode:n?.toString(),grouping:H,orderBy:M,zIndex:3})]})})})]}),U&&jsxRuntime.jsxs(Jp__default.default,{open:ot,onClose:wa,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:G=>`1px solid ${G.palette.divider}`,bgcolor:"background.paper"}}},children:[jsxRuntime.jsx(em__default.default,{sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:x?.title||t("quickCreate.createWithTitle",{title:k})}),jsxRuntime.jsx(tm__default.default,{sx:{pt:"8px !important"},children:jsxRuntime.jsxs(Ri__default.default,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Re.map(G=>{let Ne=G.type==="number"||G.numeric?"number":G.type==="date"?"date":"text",V=G.label||G.id;return jsxRuntime.jsx(rm__default.default,{label:V,value:St[G.id]??"",onChange:ue=>an(G.id,ue.target.value),type:Ne,size:"small",fullWidth:true,InputLabelProps:{shrink:Ne==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-create-${G.id}`)}),x?.description&&jsxRuntime.jsx(am__default.default,{severity:"info",sx:{fontSize:"0.85rem","& .MuiAlert-message":{fontSize:"0.85rem"}},children:x.description})]})}),jsxRuntime.jsxs(om__default.default,{sx:{px:3,pb:2},children:[jsxRuntime.jsx(Kl__default.default,{onClick:wa,sx:{fontSize:"0.85rem"},disabled:pt,children:x?.cancelLabel||t("common.cancel")}),jsxRuntime.jsx(Kl__default.default,{onClick:Qo,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:pt,children:x?.submitLabel||t("common.save")})]})]}),me&&jsxRuntime.jsxs(Jp__default.default,{open:ct,onClose:Ta,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:G=>`1px solid ${G.palette.divider}`,bgcolor:"background.paper"}}},children:[jsxRuntime.jsx(em__default.default,{sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:w?.title||t("quickEdit.editWithTitle",{title:k})}),jsxRuntime.jsx(tm__default.default,{sx:{pt:"8px !important"},children:jsxRuntime.jsxs(Ri__default.default,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[xo.map(G=>{let Ne=G.type==="number"||G.numeric?"number":G.type==="date"?"date":"text",V=G.label||G.id,ue=dr(G.id);return jsxRuntime.jsx(rm__default.default,{label:V,value:A[G.id]??"",onChange:te=>Ia(G.id,te.target.value),type:Ne,size:"small",fullWidth:true,disabled:!ue,InputLabelProps:{shrink:Ne==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-edit-${G.id}`)}),w?.description&&jsxRuntime.jsx(am__default.default,{severity:"info",sx:{fontSize:"0.85rem","& .MuiAlert-message":{fontSize:"0.85rem"}},children:w.description})]})}),jsxRuntime.jsxs(om__default.default,{sx:{px:3,pb:2},children:[jsxRuntime.jsx(Kl__default.default,{onClick:Ta,sx:{fontSize:"0.85rem"},disabled:wo,children:w?.cancelLabel||t("common.cancel")}),jsxRuntime.jsx(Kl__default.default,{onClick:Or,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:wo||!Pt,children:w?.submitLabel||t("common.save")})]})]}),pe&&jsxRuntime.jsx(si,{open:ee,type:"warning",title:E?.title||t("quickDelete.confirmTitle"),message:E?.message||(nt.length>1?t("quickDelete.confirmMessageMultiple",{count:nt.length}):t("quickDelete.confirmMessageSingle")),confirmText:E?.confirmText||t("common.delete"),cancelText:E?.cancelText||t("common.cancel"),onClose:ni,onConfirm:v}),He,ao&&jsxRuntime.jsx(Fl,{open:Et,onClose:yt,model:he,aiAssistant:h?.aiAssistant,interaction:O?{enabled:true,filters:W.filters,fieldMapping:z,onPrimaryDimensionClick:G=>W.setFilter("primaryDimension",G),onSecondaryDimensionClick:G=>W.setFilter("secondaryDimension",G),onStatusClick:G=>W.setFilter("status",G),onClearFilter:W.clearFilter,onClearAll:W.clearAll}:void 0,tableContent:jsxRuntime.jsx(Dr,{appId:ko||"graph-report-internal",title:t("graph.dataBody"),columns:Ke,rows:he.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false}})})]})},pB=Dr;var xB=({id:e,title:t,hideHeader:o=true,filterConfig:r,tableProps:a,children:n,spacing:i=1,mode:c="separated"})=>{let d=r?{...r,appId:r.appId||e}:void 0,l={...a,appId:a.appId||e};return jsxRuntime.jsxs(zu,{title:t,hideHeader:o,children:[jsxRuntime.jsxs(material.Stack,{spacing:i,sx:{height:"100%",overflow:"hidden"},children:[c==="separated"&&d&&jsxRuntime.jsx(material.Box,{sx:{flexShrink:0},children:jsxRuntime.jsx($r,{...d})}),jsxRuntime.jsx(material.Box,{sx:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:jsxRuntime.jsx(Dr,{...l,fitContainer:true,filterConfig:c==="integrated"?d:void 0})})]}),n]})};var TB=({metadata:e,fetchData:t,initialRowsPerPage:o=20,rowsPerPageOptions:r=[20,50,100,-1],tableKey:a="default",mode:n="integrated",serviceUrl:i,variantService:c})=>{let{t:d}=ne(),[l,s]=Qt.useState(false),[g,f]=Qt.useState([]),[p,b]=Qt.useState({}),[y,u]=Qt.useState(e.variants||[]),[C,m]=Qt.useState(e.layout||null),[h,x]=Qt.useState(""),[w,E]=Qt.useState(0),[R,T]=Qt.useState(0),[I,k]=Qt.useState(o),[S,D]=Qt.useState([]),[P,M]=Qt.useState("asc"),[B,X]=Qt.useState("");Qt.useEffect(()=>{let le={};e.filters.forEach(oe=>{oe.defaultValue!==void 0&&(le[oe.id]=oe.defaultValue);}),b(le);},[e.filters]);let L=Qt.useCallback(async(le,oe,Ie,Ze,Ge)=>{s(true);try{let ce={...le,page:oe+1,limit:Ie,sort:Ge,order:Ze},Ve;t?Ve=await t(ce):typeof e.api=="function"?Ve=await e.api(ce):e.api&&typeof e.api=="object"?(console.log("Fetching from URL:",e.api.url,ce),Ve={rows:[],total:0}):(console.warn("No API configured for report"),Ve={rows:[],total:0}),Ve&&(f(Ve.rows||[]),E(Ve.total||0));}catch(ce){console.error("Failed to fetch report data",ce);}finally{s(false);}},[e.api,t]);Qt.useEffect(()=>{L(p,R,I,P,B);},[L,R,I,P,B]);let Z=()=>{T(0),L(p,0,I,P,B);},$=le=>{T(0),k(le);},q=(le,oe)=>{M(oe),X(le);},H=le=>{b(le);},re=le=>{x(le?.id||"");let oe=Yp(le,a);if(oe){let Ze=oe.values??oe;b(Ze),L(Ze,0,I,P,B),T(0);}let{layout:Ie}=_l(le,a);Ie&&m(Ie);},de=le=>{let oe={...le,id:Date.now().toString(),createdAt:new Date().toISOString()};u(Ie=>[...Ie,oe]);},Ce=le=>{m(le);};return {pageProps:{id:e.id,title:e.title,mode:n,filterConfig:{appId:e.id,tableKey:a,fields:e.filters,filters:p,onFilterChange:H,onSearch:Z,onVariantLoad:re,onVariantSave:de,onVariantDelete:le=>u(oe=>oe.filter(Ie=>Ie.id!==le)),onVariantSetDefault:le=>{u(oe=>oe.map(Ie=>({...Ie,isDefault:Ie.id===le})));},variants:y,currentVariantId:h,variantService:c,serviceUrl:i},tableProps:{appId:e.id,tableKey:a,columns:e.columns,rows:g,loading:l,rowKey:"id",count:w,page:R,rowsPerPage:I,rowsPerPageOptions:r,onPageChange:T,onRowsPerPageChange:$,selectionMode:"multiple",selected:S,onSelectionChange:D,onLayoutSave:Ce,layout:C,title:e.title,showSummary:true,order:P,orderBy:B,serviceUrl:i,onSortChange:q,graphReport:e.graphReport||{enabled:true,title:`${e.title} ${d("graph.reportTitle")}`}}},filters:p,rows:g,loading:l,refresh:Z}};var K0=e=>[...e].sort((t,o)=>o.value-t.value),RB=({bars:e=[],lines:t=[],combos:o=[],heatmap:r=[],pies:a=[],waterfalls:n=[]})=>{let i=Qt.useMemo(()=>K0(e),[e]),c=Qt.useMemo(()=>[...t],[t]),d=Qt.useMemo(()=>[...o],[o]),l=Qt.useMemo(()=>[...r],[r]),s=Qt.useMemo(()=>{let f=a.reduce((p,b)=>p+b.value,0);return a.map(p=>({...p,percent:f>0?p.value/f*100:p.percent}))},[a]),g=Qt.useMemo(()=>[...n],[n]);return {bars:i,lines:c,combos:d,heatmap:l,pies:s,waterfalls:g}};var EB=({apiKey:e,query:t,zoom:o=14,mapType:r="roadmap"})=>Qt.useMemo(()=>!e||!t?"":Ci({apiKey:e,query:t,zoom:o,mapType:r}),[e,t,o,r]),FB=({keyword:e,location:t})=>Qt.useMemo(()=>Ml({keyword:e,location:t?{lng:t.lng,lat:t.lat,name:t.name}:void 0}),[e,t]);var Mi=({code:e,language:t="text",copyable:o=true,showLineNumbers:r=false,wrapLongLines:a=false,maxHeight:n})=>{let[i,c]=Qt.useState(false),d=Qt.useMemo(()=>e.replace(/\n$/,"").split(`
186
- `),[e]);return jsxRuntime.jsxs(material.Box,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1.5,overflow:"hidden",bgcolor:"background.paper"},children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:1,py:.6,bgcolor:"action.hover",borderBottom:"1px solid",borderColor:"divider"},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",sx:{textTransform:"uppercase",letterSpacing:.5,color:"text.secondary",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:t}),o&&jsxRuntime.jsx(material.Tooltip,{title:i?"Copied":"Copy",children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:async()=>{try{await navigator.clipboard.writeText(e),c(!0),window.setTimeout(()=>c(!1),1400);}catch{c(false);}},children:i?jsxRuntime.jsx(J0__default.default,{fontSize:"inherit"}):jsxRuntime.jsx(Q0__default.default,{fontSize:"inherit"})})})]}),jsxRuntime.jsx(material.Box,{component:"pre",sx:{m:0,p:1.25,fontSize:"0.82rem",lineHeight:1.55,overflow:"auto",maxHeight:n,bgcolor:"background.default",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:r?d.map((s,g)=>jsxRuntime.jsxs(material.Box,{sx:{display:"flex"},children:[jsxRuntime.jsx(material.Box,{component:"span",sx:{width:34,flexShrink:0,textAlign:"right",pr:1,color:"text.disabled",userSelect:"none"},children:g+1}),jsxRuntime.jsx(material.Box,{component:"span",sx:{whiteSpace:a?"pre-wrap":"pre",wordBreak:a?"break-word":"normal"},children:s})]},`${g}-${s}`)):jsxRuntime.jsx(material.Box,{component:"code",sx:{display:"block",whiteSpace:a?"pre-wrap":"pre",wordBreak:a?"break-word":"normal"},children:e})})]})};var av=e=>{let t=e.trim();return t.startsWith("$$")&&t.endsWith("$$")&&t.length>=4&&(t=t.slice(2,-2).trim()),t.startsWith("$")&&t.endsWith("$")&&t.length>=2&&(t=t.slice(1,-1).trim()),t},nv=async e=>new Function("m","return import(m)")(e),Di=({expression:e,inline:t=false,allowKatex:o=false})=>{let r=Qt.useMemo(()=>av(e),[e]),[a,n]=Qt.useState("");return Qt.useEffect(()=>{let i=true;return (async()=>{if(!o||!r){n("");return}try{let d=await nv("katex"),s=(d?.default||d)?.renderToString?.(r,{displayMode:!t,throwOnError:!1,strict:"warn"});i&&typeof s=="string"&&n(s);}catch{i&&n("");}})(),()=>{i=false;}},[o,r,t]),r?a?jsxRuntime.jsx(material.Box,{component:t?"span":"div",sx:{display:t?"inline-flex":"block",my:t?0:.5,overflowX:"auto"},dangerouslySetInnerHTML:{__html:a}}):t?jsxRuntime.jsx(material.Box,{component:"code",sx:{px:.4,py:.05,borderRadius:.8,bgcolor:"action.hover",fontSize:"0.82em",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:r}):jsxRuntime.jsx(material.Box,{sx:{my:1,p:1,borderRadius:1.2,border:"1px dashed",borderColor:"divider",bgcolor:"background.paper"},children:jsxRuntime.jsx(material.Typography,{component:"pre",sx:{m:0,whiteSpace:"pre-wrap",fontSize:"0.9rem",lineHeight:1.5,fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:r})}):null};var pv=async e=>new Function("m","return import(m)")(e),Yc=({code:e,title:t="Mermaid Diagram",height:o=320,enabled:r=true})=>{let[a,n]=Qt.useState(""),[i,c]=Qt.useState(""),[d,l]=Qt.useState(false),s=Qt.useMemo(()=>e.trim(),[e]);return Qt.useEffect(()=>{let g=true;return (async()=>{if(!r||!s){n(""),c("");return}l(true),c(""),n("");try{let p=await pv("mermaid"),b=p?.default||p;if(!b||typeof b.render!="function")throw new Error("Mermaid runtime is not available");b.initialize?.({startOnLoad:!1,securityLevel:"loose",theme:"default"});let y=await b.render(`orbcafe-mermaid-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,s),u=typeof y=="string"?y:y?.svg;g&&typeof u=="string"&&n(u);}catch(p){if(g){let b=p instanceof Error?p.message:"Failed to render Mermaid diagram";c(b);}}finally{g&&l(false);}})(),()=>{g=false;}},[r,s]),jsxRuntime.jsxs(material.Paper,{variant:"outlined",sx:{borderRadius:1.5,overflow:"hidden",my:1},children:[jsxRuntime.jsx(material.Box,{sx:{px:1,py:.6,borderBottom:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",sx:{letterSpacing:.4,textTransform:"uppercase"},children:t})}),jsxRuntime.jsxs(material.Box,{sx:{p:1},children:[d&&jsxRuntime.jsx(material.Box,{sx:{minHeight:120,display:"flex",alignItems:"center",justifyContent:"center"},children:jsxRuntime.jsx(material.CircularProgress,{size:20})}),!d&&a&&jsxRuntime.jsx(material.Box,{sx:{maxHeight:o,overflow:"auto","& svg":{display:"block",mx:"auto",maxWidth:"100%",height:"auto"}},dangerouslySetInnerHTML:{__html:a}}),!d&&!a&&jsxRuntime.jsxs(material.Box,{children:[i&&jsxRuntime.jsx(material.Alert,{severity:"info",sx:{mb:1},children:i}),jsxRuntime.jsx(Mi,{code:s,language:"mermaid",copyable:true,showLineNumbers:true,wrapLongLines:true})]})]})]})};var Qc=e=>e.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(o=>o.trim()),vv=e=>/^:?-{3,}:?$/.test(e.trim()),Cv=e=>{let t=e.trim(),o=t.startsWith(":"),r=t.endsWith(":");return o&&r?"center":r?"right":"left"},Xl=e=>{let t=e.split(`
187
- `).map(i=>i.trim()).filter(Boolean);if(t.length<2)return null;let o=Qc(t[0]),r=Qc(t[1]);if(o.length===0||r.length!==o.length||!r.every(vv))return null;let a=r.map(Cv),n=t.slice(2).filter(i=>i.includes("|")).map(i=>{let c=Qc(i);return c.length<o.length?[...c,...Array.from({length:o.length-c.length},()=>"")]:c.slice(0,o.length)});return {headers:o,aligns:a,rows:n}},Jc=({markdown:e,table:t,maxHeight:o=360})=>{let r=Qt.useMemo(()=>t||(e?Xl(e):null),[t,e]);return !r||r.headers.length===0?jsxRuntime.jsx(material.Paper,{variant:"outlined",sx:{p:1.2,borderRadius:1.5},children:jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:"Invalid table block"})}):jsxRuntime.jsx(material.Paper,{variant:"outlined",sx:{borderRadius:1.5,overflow:"hidden",my:1},children:jsxRuntime.jsx(material.TableContainer,{sx:{maxHeight:o},children:jsxRuntime.jsxs(material.Table,{size:"small",stickyHeader:true,children:[jsxRuntime.jsx(material.TableHead,{children:jsxRuntime.jsx(material.TableRow,{children:r.headers.map((a,n)=>jsxRuntime.jsx(material.TableCell,{align:r.aligns[n],sx:{fontWeight:700,bgcolor:"background.paper"},children:a},`${a}-${n}`))})}),jsxRuntime.jsx(material.TableBody,{children:r.rows.map((a,n)=>jsxRuntime.jsx(material.TableRow,{hover:true,children:a.map((i,c)=>jsxRuntime.jsx(material.TableCell,{align:r.aligns[c],sx:{whiteSpace:"pre-wrap",wordBreak:"break-word"},children:i||jsxRuntime.jsx(material.Box,{component:"span",sx:{color:"text.disabled"},children:"-"})},`cell-${n}-${c}`))},`row-${n}`))})]})})})};var Yl=({content:e,title:t="Thinking",defaultExpanded:o=false,isStreaming:r=false})=>{let[a,n]=Qt.useState(o);return jsxRuntime.jsxs(material.Box,{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1,my:.8},children:[jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:.6,children:[jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>n(i=>!i),sx:{transform:a?"rotate(180deg)":"rotate(0deg)",transition:"transform .15s ease"},children:jsxRuntime.jsx(Rv__default.default,{fontSize:"inherit"})}),jsxRuntime.jsxs(material.Typography,{variant:"caption",color:"text.secondary",sx:{fontStyle:"italic"},children:[t,r?" ...":""]})]}),jsxRuntime.jsx(material.Collapse,{in:a,children:jsxRuntime.jsx(material.Typography,{variant:"body2",sx:{pl:4,pt:.4,whiteSpace:"pre-wrap",color:"text.secondary",fontStyle:"italic",lineHeight:1.55},children:e})})]})};var td=/(\*\*[^*]+\*\*|`[^`]+`|\[[^\]]+\]\([^)]+\)|\*[^*]+\*|\$[^$\n]+\$)/g,Ql=e=>e.trim().startsWith("```"),fm=e=>/^#{1,6}\s+/.test(e.trim()),od=e=>/^[-*+]\s+/.test(e.trim()),rd=e=>/^\d+\.\s+/.test(e.trim()),hm=e=>/^(?:-{3,}|\*{3,}|_{3,})$/.test(e.trim()),ad=e=>e.trim().startsWith(">"),bm=(e,t)=>{if(t+1>=e.length)return false;let o=e[t],r=e[t+1];return !o.includes("|")||!r.includes("|")?false:/^\s*\|?\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)+\|?\s*$/.test(r.trim())},ym=e=>e.trim().startsWith("<think>")||e.trim()===":::think",Ei=(e,t,o)=>{let r=[],a=0,n=0;td.lastIndex=0;let i=td.exec(e);for(;i;){i.index>a&&r.push(e.slice(a,i.index));let c=i[0],d=`${o}-${n}`;if(c.startsWith("**")&&c.endsWith("**"))r.push(jsxRuntime.jsx("strong",{children:c.slice(2,-2)},d));else if(c.startsWith("*")&&c.endsWith("*"))r.push(jsxRuntime.jsx("em",{children:c.slice(1,-1)},d));else if(c.startsWith("`")&&c.endsWith("`"))r.push(jsxRuntime.jsx(material.Box,{component:"code",sx:{px:.45,py:.08,borderRadius:.8,bgcolor:"action.hover",fontSize:"0.82em",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:c.slice(1,-1)},d));else if(c.startsWith("[")&&c.includes("](")&&c.endsWith(")")){let l=c.match(/^\[([^\]]+)\]\(([^)]+)\)$/);l?r.push(jsxRuntime.jsx(material.Link,{href:l[2],target:"_blank",rel:"noreferrer",underline:"hover",children:l[1]},d)):r.push(c);}else c.startsWith("$")&&c.endsWith("$")&&t.enableMath?r.push(jsxRuntime.jsx(Di,{expression:c,inline:true,allowKatex:true},d)):r.push(c);a=i.index+c.length,n+=1,i=td.exec(e);}return a<e.length&&r.push(e.slice(a)),r.length>0?r:[e]},Fi=({markdown:e,content:t,className:o,enableMath:r=true,enableMermaid:a=true,enableThinkBlock:n=true,codeCopyable:i=true,codeLineNumbers:c=false})=>{let d=e??t??"",l=Qt.useMemo(()=>{let s=[],g=d.replace(/\r\n/g,`
183
+ `;return Yt.useEffect(()=>{let d=n.current;if(!d)return;let l=new ogl.Renderer({alpha:true,premultipliedAlpha:false}),s=l.gl;s.clearColor(0,0,0,0),d.appendChild(s.canvas);let m=new ogl.Triangle(s),g=new ogl.Program(s,{vertex:i,fragment:c,uniforms:{iTime:{value:0},iResolution:{value:new ogl.Vec3(s.canvas.width,s.canvas.height,s.canvas.width/s.canvas.height)},hue:{value:e},hover:{value:0},rot:{value:0},hoverIntensity:{value:t},backgroundColor:{value:mf(a)}}}),p=new ogl.Mesh(s,{geometry:m,program:g});function b(){if(!d)return;let P=window.devicePixelRatio||1,w=d.clientWidth,D=d.clientHeight;l.setSize(w*P,D*P),s.canvas.style.width=w+"px",s.canvas.style.height=D+"px",g.uniforms.iResolution.value.set(s.canvas.width,s.canvas.height,s.canvas.width/s.canvas.height);}window.addEventListener("resize",b),b();let y=0,u=0,x=0,f=.3,h=P=>{let w=d.getBoundingClientRect(),D=P.clientX-w.left,I=P.clientY-w.top,k=w.width,A=w.height,T=Math.min(k,A),R=k/2,M=A/2,Z=(D-R)/T*2,L=(I-M)/T*2;Math.sqrt(Z*Z+L*L)<.8?y=1:y=0;},v=()=>{y=0;};d.addEventListener("mousemove",h),d.addEventListener("mouseleave",v);let S,E=P=>{S=requestAnimationFrame(E);let w=(P-u)*.001;u=P,g.uniforms.iTime.value=P*.001,g.uniforms.hue.value=e,g.uniforms.hoverIntensity.value=t,g.uniforms.backgroundColor.value=mf(a);let D=r?1:y;g.uniforms.hover.value+=(D-g.uniforms.hover.value)*.1,o&&D>.5&&(x+=w*f),g.uniforms.rot.value=x,l.render({scene:p});};return S=requestAnimationFrame(E),()=>{cancelAnimationFrame(S),window.removeEventListener("resize",b),d.removeEventListener("mousemove",h),d.removeEventListener("mouseleave",v),s.canvas.parentNode===d&&d.removeChild(s.canvas),s.getExtension("WEBGL_lose_context")?.loseContext();}},[e,t,o,r,a]),jsxRuntime.jsx("div",{ref:n,className:"w-full h-full"})}function Ww(e,t,o){let r,a,n;if(t===0)r=a=n=o;else {let i=(l,s,m)=>(m<0&&(m+=1),m>1&&(m-=1),m<.16666666666666666?l+(s-l)*6*m:m<.5?s:m<.6666666666666666?l+(s-l)*(.6666666666666666-m)*6:l),c=o<.5?o*(1+t):o+t-o*t,d=2*o-c;r=i(d,c,e+1/3),a=i(d,c,e),n=i(d,c,e-1/3);}return new ogl.Vec3(r,a,n)}function mf(e){if(e==="transparent")return new ogl.Vec3(0,0,0);if(e.startsWith("#")){let r=parseInt(e.slice(1,3),16)/255,a=parseInt(e.slice(3,5),16)/255,n=parseInt(e.slice(5,7),16)/255;return new ogl.Vec3(r,a,n)}let t=e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);if(t)return new ogl.Vec3(parseInt(t[1])/255,parseInt(t[2])/255,parseInt(t[3])/255);let o=e.match(/hsla?\((\d+),\s*(\d+)%,\s*(\d+)%/);if(o){let r=parseInt(o[1])/360,a=parseInt(o[2])/100,n=parseInt(o[3])/100;return Ww(r,a,n)}return new ogl.Vec3(0,0,0)}var ff=Ph(()=>{"use client";});function Io(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var cc={primary:"#000000",primaryHover:"#333333"},dl={primary:"bg-primary text-primary-foreground hover:bg-primary/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",ghost:"hover:bg-accent hover:text-accent-foreground"},ii={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",full:"rounded-full"},xu=()=>"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50";var Eh=classVarianceAuthority.cva(xu(),{variants:{variant:{default:`${dl.primary} shadow-sm`,destructive:"bg-red-500 text-white hover:bg-red-600 active:bg-red-700 dark:bg-red-600 dark:hover:bg-red-500 dark:active:bg-red-700 shadow-sm",outline:`${dl.outline} shadow-sm`,secondary:"bg-gray-200 text-gray-700 hover:bg-gray-300 active:bg-gray-400 dark:bg-gray-700 dark:text-gray-200 dark:hover:bg-gray-600 dark:active:bg-gray-500 shadow-sm",ghost:dl.ghost,link:"text-blue-600 dark:text-blue-400 underline-offset-4 hover:underline hover:text-blue-700 dark:hover:text-blue-300 active:text-blue-800 dark:active:text-blue-200","chat-tool":"bg-[var(--orbai-surface-2)] border border-[var(--orbai-border-soft)] text-[var(--orbai-text-2)] hover:bg-[var(--orbai-surface-3)] hover:border-[var(--orbai-border-strong)] hover:text-[var(--orbai-text-1)] active:scale-95 transition-all duration-200","chat-send":`bg-[${cc.primary}] hover:bg-[${cc.primaryHover}] text-white border border-[var(--orbai-border-strong)] shadow-[var(--orbai-shadow-soft-sm)] hover:shadow-[var(--orbai-shadow-soft-md)] active:scale-95 transition-all duration-200`,"chat-stop":"bg-red-500 hover:bg-red-600 border border-[var(--orbai-border-strong)] shadow-[var(--orbai-shadow-soft-sm)] hover:shadow-[var(--orbai-shadow-soft-md)] active:scale-95 text-white transition-all duration-200","chat-disabled":"cursor-not-allowed opacity-50 bg-[var(--orbai-surface-2)] border border-[var(--orbai-border-soft)] text-[var(--orbai-muted)]"},size:{default:"h-10 px-4 py-2",sm:"h-9 px-3",lg:"h-11 px-8",icon:"h-10 w-10","chat-sm":"h-8 w-8 rounded-full","chat-md":"h-10 w-10 rounded-full","chat-lg":"h-12 w-12 rounded-full"},rounded:{none:ii.none,sm:ii.sm,md:ii.md,full:ii.full}},defaultVariants:{variant:"default",size:"default",rounded:"md"}}),dc=Yt__namespace.forwardRef(({className:e,variant:t,size:o,asChild:r=false,...a},n)=>jsxRuntime.jsx(r?reactSlot.Slot:"button",{className:Io(Eh({variant:t,size:o,className:e})),ref:n,...a}));dc.displayName="Button";var Lh={"common.cancel":"Cancel","common.save":"Save","common.ok":"OK","common.done":"Done","common.search":"Search","common.none":"None","common.all":"All","common.noData":"No data","common.copy":"Copy","common.delete":"Delete","common.loading":"Loading...","header.searchPlaceholder":"Ask me...","header.searchAddFeature":"Add feature","header.searchSend":"Send","header.searchStartVoice":"Start voice input","header.searchStopVoice":"Stop voice input","header.theme.system":"Theme: System","header.theme.dark":"Theme: Dark","header.theme.light":"Theme: Light","header.menu.setting":"Setting","header.menu.logout":"Logout","navigation.expand":"Expand navigation","navigation.collapse":"Collapse navigation","navigation.searchPlaceholder":"Search menu...","navigation.noMatch":"No matching menu items","navigation.noAccessibleApp":"No accessible applications","navigation.noItems":"No items to display","navigation.expandView":"Expand {title}","navigation.mode.switchToFixed":"Switch to fixed navigation","navigation.mode.switchToFloating":"Switch to floating navigation","navigation.pinned":"Pinned","navigation.pin.add":"Pin to top","navigation.pin.remove":"Unpin","table.toolbar.searchPlaceholder":"Search...","table.title.default":"Data Table","table.toolbar.groupBy":"Group By","table.toolbar.summary":"Summary","table.toolbar.columns":"Columns","table.toolbar.export":"Export","table.toolbar.itemsPerPage":"Items per page:","table.toolbar.pageOf":"Page {current} of {total}","table.toolbar.newItem":"New Item","table.toolbar.editItem":"Edit Item","table.toolbar.deleteItem":"Delete Item","table.toolbar.graphicReport":"Graphic Report","table.toolbar.saveLayout":"Save Layout","table.menu.groupBy":"Group By","table.menu.clearAll":"Clear All","table.menu.visibleColumns":"Visible Columns","table.menu.showSummaryRow":"Show Summary Row","table.menu.noNumericColumns":"No numeric columns","table.group.expandAll":"Expand All Groups","table.group.collapseAll":"Collapse All Groups","table.mobile.notImplemented":"Mobile View Not Implemented","table.headerMenu.sortAsc":"Sort Ascending","table.headerMenu.sortDesc":"Sort Descending","table.headerMenu.clearSort":"Clear Sort","table.headerMenu.configureSort":"Configure Sort...","table.headerMenu.group":"Group by this column","table.headerMenu.ungroup":"Remove from grouping","table.headerMenu.addSummary":"Include in Summary","table.headerMenu.removeSummary":"Remove from Summary","table.headerMenu.hideColumn":"Hide Column","table.sortDialog.title":"Sort Settings","table.sortDialog.empty":"No sort rules. Add one to start ordering rows.","table.sortDialog.addRule":"Add Sort Rule","table.sortDialog.clearAll":"Clear All","table.sortDialog.asc":"Ascending","table.sortDialog.desc":"Descending","pivot.title.default":"Pivot Table Builder","pivot.subtitle.default":"Drag fields to configure the pivot table.","pivot.empty":"Drag at least one field into Values to render the pivot result.","pivot.records":"Records","pivot.afterFilter":"After filter","pivot.grandTotal":"Grand Total","pivot.resultLabel":"Result","pivot.valueLabel":"Value","pivot.table.dimensions":"Dimensions","pivot.config.title":"Configuration","pivot.fieldList":"Field List","pivot.availableDimensions":"Available dimensions","pivot.allFieldsInUse":"All fields are in use.","pivot.zone.rows":"Rows","pivot.zone.columns":"Columns","pivot.zone.filters":"Filters","pivot.zone.values":"Values","pivot.hint.rows":"Drag fields here to build row hierarchy","pivot.hint.columns":"Drag fields here to build column hierarchy","pivot.hint.filters":"Drag fields here for report filters","pivot.hint.values":"Drag numeric fields here for aggregation","pivot.clearArea":"Clear area","pivot.filter.na":"N/A","pivot.filter.noValues":"No values","pivot.filter.noneSelected":"None selected","pivot.filter.allValues":"All values","pivot.filter.selectedCount":"{selected} / {total} selected","pivot.filter.selectAll":"Select All","pivot.filter.deselectAll":"Deselect All","pivot.filter.noResults":"No results","pivot.collapse.ariaExpand":"Expand configuration area","pivot.collapse.ariaCollapse":"Collapse configuration area","pivot.agg.sum":"Sum","pivot.agg.count":"Count","pivot.agg.avg":"Average","pivot.agg.min":"Min","pivot.agg.max":"Max","pivot.preset.selectPlaceholder":"Select preset","pivot.preset.save":"Save preset","pivot.preset.delete":"Delete preset","pivot.preset.saveDialogTitle":"Save current preset","pivot.preset.nameLabel":"Preset name","pivot.preset.defaultName":"Preset {index}","pivot.table.sectionTitle":"Pivot Result","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"Expand pivot result","pivot.table.collapse.ariaCollapse":"Collapse pivot result","pivot.chart.title":"Pivot Chart","pivot.chart.subtitle":"Map one dimension and up to two measures into a compact chart.","pivot.chart.subtitleReady":"{dimension} by {measure}","pivot.chart.emptyNoDimension":"Add at least one row or column field to render the chart.","pivot.chart.emptyNoValue":"Add at least one value field to render the chart.","pivot.chart.emptyNoData":"No data available for the current chart selection.","pivot.chart.dimension":"Dimension","pivot.chart.primaryMeasure":"Measure","pivot.chart.secondaryMeasure":"Compare measure","pivot.chart.chartType":"Chart type","pivot.chart.style.barVertical":"Vertical bars","pivot.chart.style.barHorizontal":"Horizontal bars","pivot.chart.style.line":"Line","pivot.chart.style.scatter":"Scatter","pivot.chart.collapse.ariaExpand":"Expand chart area","pivot.chart.collapse.ariaCollapse":"Collapse chart area","smartFilter.adaptFilters":"Adapt Filters","smartFilter.addFilters":"Add Filters","smartFilter.go":"Go","smartFilter.visibleFilters":"Visible Filters","smartFilter.searchPlaceholder":"Search...","smartFilter.noOptionsFound":"No options found","smartFilter.min":"Min","smartFilter.max":"Max","smartFilter.minMaxPlaceholder":"Min - Max","smartFilter.operator.equals":"Equals","smartFilter.operator.contains":"Contains","smartFilter.operator.notContains":"Does Not Contain","smartFilter.operator.wildcard":"Wildcard Search","smartFilter.operator.notEquals":"Not Equals","smartFilter.operator.greaterThan":"Greater Than","smartFilter.operator.lessThan":"Less Than","smartFilter.operator.greaterOrEqual":"Greater Than or Equal","smartFilter.operator.lessOrEqual":"Less Than or Equal","smartFilter.operator.between":"Between","variant.noOptions":"No options","variant.defaultSuffix":"Default","variant.selectVariant":"Select Variant","variant.saveView":"Save View","variant.newVariant":"New Variant","variant.viewName":"View Name","variant.setDefault":"Set as Default","variant.publicAllUsers":"Public (All Users)","variant.toast.fetchFailed":"Failed to load variants","variant.toast.saveFailed":"Failed to save variant","variant.toast.saveSuccess":"Variant saved successfully","variant.toast.deleteFailed":"Failed to delete variant","variant.toast.deleteSuccess":"Variant deleted successfully","variant.toast.defaultFailed":"Failed to update default variant","variant.toast.defaultSuccess":"Default variant updated","layout.saveLayout":"Save Layout","layout.layoutOptions":"Layout Options","layout.selectLayout":"Select Layout","layout.saveCurrentLayout":"Save Current Layout...","layout.noSavedLayouts":"No saved layouts","layout.removeDefault":"Remove Default","layout.setAsDefault":"Set as Default","layout.layoutName":"Layout Name","layout.layoutDescription":"Description","layout.layoutNameHelper":"e.g., 'Compact View'","layout.warningOverwrite":"Warning: Existing layout will be overwritten","layout.useAsDefault":"Use as Default Layout","layout.publicAllUsers":"Public (Visible to all users)","layout.toast.loadFallback":"Failed to load layouts from backend, fallback to local storage","layout.toast.saveSuccess":"Layout saved successfully","layout.toast.saveLocalSuccess":"Layout saved to local storage","layout.toast.backendUnavailableSavedLocal":"Backend unavailable, saved to local storage","layout.toast.deleteSuccess":"Layout deleted successfully","layout.toast.deleteLocalSuccess":"Layout deleted from local storage","layout.toast.backendUnavailableDeletedLocal":"Backend unavailable, deleted from local storage","layout.toast.defaultSuccess":"Default layout set","layout.toast.defaultLocalSuccess":"Default layout set in local storage","layout.toast.backendUnavailableDefaultLocal":"Backend unavailable, default saved to local storage","dateRange.label":"Date Range","dateRange.startDate":"Start Date","dateRange.endDate":"End Date","dateRange.select":"Select...","dateRange.today":"Today","dateRange.thisWeek":"This Week","dateRange.thisMonth":"This Month","graph.records":"{count} records","graph.kpi.totalRecords":"Total Records","graph.kpi.totalReport":"Total Report","graph.kpi.totalBillable":"Total Billable","graph.kpi.efficiency":"Efficiency","graph.kpi.amount":"Amount","graph.kpi.flagged":"Flagged","graph.chart.billable.title":"Billable by Dimension","graph.chart.billable.subtitle":"Top values by billable hours","graph.chart.efficiency.title":"Efficiency by Person","graph.chart.efficiency.subtitle":"Lowest efficiency first","graph.chart.status.title":"Status Distribution","graph.chart.status.subtitle":"Record ratio by status","graph.dataBody":"Data Body","graph.reportTitle":"Graphic Report","graph.unassigned":"Unassigned","graph.column.reportHours":"Report Hours","graph.column.billableHours":"Billable Hours","detail.searchAi.placeholder":"Search fields, or ask AI if no match...","detail.searchAi.matches":"{count} matches found","detail.searchAi.noMatch":"No matching field found.","detail.searchAi.autoAiFallback":"No direct match. Triggering AI analysis...","detail.searchAi.aiResultTitle":"AI Insight","detail.table.title":"Related Records","kanban.empty":"Drop cards here","kanban.bucket.limit":"Limit","kanban.bucket.dropHere":"Release to move into this bucket","kanban.card.progress":"Progress","kanban.card.openDetail":"Open Detail","kanban.priority.critical":"Critical","kanban.priority.high":"High","kanban.priority.medium":"Medium","kanban.priority.low":"Low","quickCreate.newItem":"New Item","quickCreate.createWithTitle":"Create {title}","quickEdit.editWithTitle":"Edit {title}","quickDelete.confirmTitle":"Confirm Delete","quickDelete.confirmMessageSingle":"Are you sure you want to delete the selected record?","quickDelete.confirmMessageMultiple":"Are you sure you want to delete {count} selected records?","messageBox.confirm":"OK","messageBox.cancel":"Cancel"},Nh={"common.cancel":"\u53D6\u6D88","common.save":"\u4FDD\u5B58","common.ok":"\u786E\u5B9A","common.done":"\u5B8C\u6210","common.search":"\u641C\u7D22","common.none":"\u65E0","common.all":"\u5168\u90E8","common.noData":"\u6682\u65E0\u6570\u636E","common.copy":"\u590D\u5236","common.delete":"\u5220\u9664","common.loading":"\u52A0\u8F7D\u4E2D...","header.searchPlaceholder":"\u95EE\u6211\u70B9\u4EC0\u4E48...","header.searchAddFeature":"\u589E\u52A0\u529F\u80FD","header.searchSend":"\u53D1\u9001","header.searchStartVoice":"\u5F00\u59CB\u8BED\u97F3\u8F93\u5165","header.searchStopVoice":"\u505C\u6B62\u8BED\u97F3\u8F93\u5165","header.theme.system":"\u4E3B\u9898\uFF1A\u8DDF\u968F\u7CFB\u7EDF","header.theme.dark":"\u4E3B\u9898\uFF1A\u6DF1\u8272","header.theme.light":"\u4E3B\u9898\uFF1A\u6D45\u8272","header.menu.setting":"\u8BBE\u7F6E","header.menu.logout":"\u6CE8\u9500","navigation.expand":"\u5C55\u5F00\u5BFC\u822A","navigation.collapse":"\u6298\u53E0\u5BFC\u822A","navigation.searchPlaceholder":"\u641C\u7D22\u83DC\u5355...","navigation.noMatch":"\u672A\u627E\u5230\u5339\u914D\u7684\u83DC\u5355\u9879","navigation.noAccessibleApp":"\u6682\u65E0\u53EF\u8BBF\u95EE\u7684\u5E94\u7528","navigation.noItems":"\u6682\u65E0\u53EF\u663E\u793A\u9879","navigation.expandView":"\u5C55\u5F00\u67E5\u770B {title}","navigation.mode.switchToFixed":"\u5207\u6362\u4E3A\u56FA\u5B9A\u5BFC\u822A","navigation.mode.switchToFloating":"\u5207\u6362\u4E3A\u60AC\u6D6E\u5BFC\u822A","navigation.pinned":"\u5DF2\u56FA\u5B9A","navigation.pin.add":"\u56FA\u5B9A\u5230\u9876\u90E8","navigation.pin.remove":"\u53D6\u6D88\u56FA\u5B9A","table.toolbar.searchPlaceholder":"\u641C\u7D22...","table.title.default":"\u6570\u636E\u8868","table.toolbar.groupBy":"\u5206\u7EC4","table.toolbar.summary":"\u6C47\u603B","table.toolbar.columns":"\u5217","table.toolbar.export":"\u5BFC\u51FA","table.toolbar.itemsPerPage":"\u6BCF\u9875\u6761\u6570\uFF1A","table.toolbar.pageOf":"\u7B2C {current} / {total} \u9875","table.toolbar.newItem":"\u65B0\u5EFA\u6761\u76EE","table.toolbar.editItem":"\u7F16\u8F91\u6761\u76EE","table.toolbar.deleteItem":"\u5220\u9664\u6761\u76EE","table.toolbar.graphicReport":"\u56FE\u8868\u62A5\u8868","table.toolbar.saveLayout":"\u4FDD\u5B58\u5E03\u5C40","table.menu.groupBy":"\u5206\u7EC4","table.menu.clearAll":"\u6E05\u7A7A","table.menu.visibleColumns":"\u53EF\u89C1\u5217","table.menu.showSummaryRow":"\u663E\u793A\u6C47\u603B\u884C","table.menu.noNumericColumns":"\u6CA1\u6709\u6570\u503C\u5217","table.group.expandAll":"\u5C55\u5F00\u5168\u90E8\u5206\u7EC4","table.group.collapseAll":"\u6298\u53E0\u5168\u90E8\u5206\u7EC4","table.mobile.notImplemented":"\u79FB\u52A8\u7AEF\u89C6\u56FE\u6682\u672A\u5B9E\u73B0","table.headerMenu.sortAsc":"\u5347\u5E8F\u6392\u5217","table.headerMenu.sortDesc":"\u964D\u5E8F\u6392\u5217","table.headerMenu.clearSort":"\u6E05\u9664\u6392\u5E8F","table.headerMenu.configureSort":"\u6392\u5E8F\u8BBE\u7F6E...","table.headerMenu.group":"\u6309\u6B64\u5217\u5206\u7EC4","table.headerMenu.ungroup":"\u53D6\u6D88\u5206\u7EC4","table.headerMenu.addSummary":"\u52A0\u5165\u6C47\u603B","table.headerMenu.removeSummary":"\u4ECE\u6C47\u603B\u4E2D\u79FB\u9664","table.headerMenu.hideColumn":"\u9690\u85CF\u8BE5\u5217","table.sortDialog.title":"\u6392\u5E8F\u8BBE\u7F6E","table.sortDialog.empty":"\u6682\u65E0\u6392\u5E8F\u89C4\u5219\uFF0C\u8BF7\u6DFB\u52A0\u89C4\u5219\u8FDB\u884C\u6392\u5E8F\u3002","table.sortDialog.addRule":"\u6DFB\u52A0\u6392\u5E8F\u89C4\u5219","table.sortDialog.clearAll":"\u6E05\u7A7A\u89C4\u5219","table.sortDialog.asc":"\u5347\u5E8F","table.sortDialog.desc":"\u964D\u5E8F","pivot.title.default":"\u6570\u636E\u900F\u89C6\u8868","pivot.subtitle.default":"\u62D6\u62FD\u5B57\u6BB5\u4EE5\u914D\u7F6E\u900F\u89C6\u8868\u3002","pivot.empty":"\u8BF7\u81F3\u5C11\u62D6\u5165\u4E00\u4E2A\u503C\u5B57\u6BB5\u540E\u518D\u67E5\u770B\u900F\u89C6\u7ED3\u679C\u3002","pivot.records":"\u8BB0\u5F55\u6570","pivot.afterFilter":"\u7B5B\u9009\u540E","pivot.grandTotal":"\u603B\u8BA1","pivot.resultLabel":"\u7ED3\u679C","pivot.valueLabel":"\u503C","pivot.table.dimensions":"\u7EF4\u5EA6","pivot.config.title":"\u5E03\u5C40\u914D\u7F6E","pivot.fieldList":"\u5B57\u6BB5\u5217\u8868","pivot.availableDimensions":"\u53EF\u7528\u7EF4\u5EA6","pivot.allFieldsInUse":"\u6240\u6709\u5B57\u6BB5\u90FD\u5DF2\u4F7F\u7528\u3002","pivot.zone.rows":"\u884C","pivot.zone.columns":"\u5217","pivot.zone.filters":"\u7B5B\u9009","pivot.zone.values":"\u503C","pivot.hint.rows":"\u5C06\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u6784\u5EFA\u884C\u5C42\u7EA7","pivot.hint.columns":"\u5C06\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u6784\u5EFA\u5217\u5C42\u7EA7","pivot.hint.filters":"\u5C06\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u4F5C\u4E3A\u62A5\u8868\u7B5B\u9009","pivot.hint.values":"\u5C06\u6570\u503C\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u8FDB\u884C\u805A\u5408","pivot.clearArea":"\u6E05\u7A7A\u533A\u57DF","pivot.filter.na":"\u4E0D\u53EF\u7528","pivot.filter.noValues":"\u65E0\u53EF\u9009\u503C","pivot.filter.noneSelected":"\u672A\u9009\u62E9","pivot.filter.allValues":"\u5168\u90E8\u503C","pivot.filter.selectedCount":"\u5DF2\u9009 {selected} / {total}","pivot.filter.selectAll":"\u5168\u9009","pivot.filter.deselectAll":"\u53D6\u6D88\u5168\u9009","pivot.filter.noResults":"\u65E0\u5339\u914D\u7ED3\u679C","pivot.collapse.ariaExpand":"\u5C55\u5F00\u914D\u7F6E\u533A\u57DF","pivot.collapse.ariaCollapse":"\u6298\u53E0\u914D\u7F6E\u533A\u57DF","pivot.agg.sum":"\u6C42\u548C","pivot.agg.count":"\u8BA1\u6570","pivot.agg.avg":"\u5E73\u5747\u503C","pivot.agg.min":"\u6700\u5C0F\u503C","pivot.agg.max":"\u6700\u5927\u503C","pivot.preset.selectPlaceholder":"\u9009\u62E9\u65B9\u6848","pivot.preset.save":"\u4FDD\u5B58\u65B9\u6848","pivot.preset.delete":"\u5220\u9664\u65B9\u6848","pivot.preset.saveDialogTitle":"\u4FDD\u5B58\u5F53\u524D\u65B9\u6848","pivot.preset.nameLabel":"\u65B9\u6848\u540D\u79F0","pivot.preset.defaultName":"\u65B9\u6848 {index}","pivot.table.sectionTitle":"\u900F\u89C6\u7ED3\u679C","pivot.table.expandRowsAll":"\u884C\u5168\u90E8\u6253\u5F00","pivot.table.collapseRowsAll":"\u884C\u5168\u90E8\u6298\u53E0","pivot.table.expandColumnsAll":"\u5217\u5168\u90E8\u6253\u5F00","pivot.table.collapseColumnsAll":"\u5217\u5168\u90E8\u6298\u53E0","pivot.table.collapse.ariaExpand":"\u5C55\u5F00\u900F\u89C6\u7ED3\u679C","pivot.table.collapse.ariaCollapse":"\u6298\u53E0\u900F\u89C6\u7ED3\u679C","pivot.chart.title":"\u900F\u89C6\u56FE\u8868","pivot.chart.subtitle":"\u5C06\u4E00\u4E2A\u7EF4\u5EA6\u4E0E\u6700\u591A\u4E24\u4E2A\u5EA6\u91CF\u6620\u5C04\u4E3A\u7D27\u51D1\u56FE\u8868\u3002","pivot.chart.subtitleReady":"{dimension} \xB7 {measure}","pivot.chart.emptyNoDimension":"\u8BF7\u81F3\u5C11\u653E\u5165\u4E00\u4E2A\u884C\u6216\u5217\u5B57\u6BB5\u540E\u518D\u67E5\u770B\u56FE\u8868\u3002","pivot.chart.emptyNoValue":"\u8BF7\u81F3\u5C11\u653E\u5165\u4E00\u4E2A\u503C\u5B57\u6BB5\u540E\u518D\u67E5\u770B\u56FE\u8868\u3002","pivot.chart.emptyNoData":"\u5F53\u524D\u56FE\u8868\u9009\u62E9\u4E0B\u6682\u65E0\u53EF\u5C55\u793A\u6570\u636E\u3002","pivot.chart.dimension":"\u56FE\u8868\u7EF4\u5EA6","pivot.chart.primaryMeasure":"\u4E3B\u5EA6\u91CF","pivot.chart.secondaryMeasure":"\u5BF9\u6BD4\u5EA6\u91CF","pivot.chart.chartType":"\u56FE\u8868\u7C7B\u578B","pivot.chart.style.barVertical":"\u7EB5\u5411\u67F1\u72B6\u56FE","pivot.chart.style.barHorizontal":"\u6A2A\u5411\u67F1\u72B6\u56FE","pivot.chart.style.line":"\u6298\u7EBF\u56FE","pivot.chart.style.scatter":"\u6563\u70B9\u56FE","pivot.chart.collapse.ariaExpand":"\u5C55\u5F00\u56FE\u8868\u533A\u57DF","pivot.chart.collapse.ariaCollapse":"\u6298\u53E0\u56FE\u8868\u533A\u57DF","smartFilter.adaptFilters":"\u7B5B\u9009\u8BBE\u7F6E","smartFilter.addFilters":"\u6DFB\u52A0\u7B5B\u9009","smartFilter.go":"\u6267\u884C","smartFilter.visibleFilters":"\u53EF\u89C1\u7B5B\u9009\u9879","smartFilter.searchPlaceholder":"\u641C\u7D22...","smartFilter.noOptionsFound":"\u672A\u627E\u5230\u9009\u9879","smartFilter.min":"\u6700\u5C0F\u503C","smartFilter.max":"\u6700\u5927\u503C","smartFilter.minMaxPlaceholder":"\u6700\u5C0F\u503C - \u6700\u5927\u503C","smartFilter.operator.equals":"\u7B49\u4E8E","smartFilter.operator.contains":"\u5305\u542B","smartFilter.operator.notContains":"\u4E0D\u5305\u542B","smartFilter.operator.wildcard":"\u901A\u914D\u7B26\u641C\u7D22","smartFilter.operator.notEquals":"\u4E0D\u7B49\u4E8E","smartFilter.operator.greaterThan":"\u5927\u4E8E","smartFilter.operator.lessThan":"\u5C0F\u4E8E","smartFilter.operator.greaterOrEqual":"\u5927\u4E8E\u7B49\u4E8E","smartFilter.operator.lessOrEqual":"\u5C0F\u4E8E\u7B49\u4E8E","smartFilter.operator.between":"\u533A\u95F4","variant.noOptions":"\u65E0\u9009\u9879","variant.defaultSuffix":"\u9ED8\u8BA4","variant.selectVariant":"\u9009\u62E9\u89C6\u56FE","variant.saveView":"\u4FDD\u5B58\u89C6\u56FE","variant.newVariant":"\u65B0\u89C6\u56FE","variant.viewName":"\u89C6\u56FE\u540D\u79F0","variant.setDefault":"\u8BBE\u4E3A\u9ED8\u8BA4","variant.publicAllUsers":"\u516C\u5F00\uFF08\u6240\u6709\u7528\u6237\uFF09","variant.toast.fetchFailed":"\u52A0\u8F7D\u89C6\u56FE\u5931\u8D25","variant.toast.saveFailed":"\u4FDD\u5B58\u89C6\u56FE\u5931\u8D25","variant.toast.saveSuccess":"\u89C6\u56FE\u4FDD\u5B58\u6210\u529F","variant.toast.deleteFailed":"\u5220\u9664\u89C6\u56FE\u5931\u8D25","variant.toast.deleteSuccess":"\u89C6\u56FE\u5220\u9664\u6210\u529F","variant.toast.defaultFailed":"\u66F4\u65B0\u9ED8\u8BA4\u89C6\u56FE\u5931\u8D25","variant.toast.defaultSuccess":"\u9ED8\u8BA4\u89C6\u56FE\u5DF2\u66F4\u65B0","layout.saveLayout":"\u4FDD\u5B58\u5E03\u5C40","layout.layoutOptions":"\u5E03\u5C40\u9009\u9879","layout.selectLayout":"\u9009\u62E9\u5E03\u5C40","layout.saveCurrentLayout":"\u4FDD\u5B58\u5F53\u524D\u5E03\u5C40...","layout.noSavedLayouts":"\u6682\u65E0\u5DF2\u4FDD\u5B58\u5E03\u5C40","layout.removeDefault":"\u53D6\u6D88\u9ED8\u8BA4","layout.setAsDefault":"\u8BBE\u4E3A\u9ED8\u8BA4","layout.layoutName":"\u5E03\u5C40\u540D\u79F0","layout.layoutDescription":"\u63CF\u8FF0","layout.layoutNameHelper":"\u4F8B\u5982\uFF1A\u7D27\u51D1\u89C6\u56FE","layout.warningOverwrite":"\u8B66\u544A\uFF1A\u5C06\u8986\u76D6\u540C\u540D\u5E03\u5C40","layout.useAsDefault":"\u7528\u4F5C\u9ED8\u8BA4\u5E03\u5C40","layout.publicAllUsers":"\u516C\u5F00\uFF08\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09","layout.toast.loadFallback":"\u540E\u7AEF\u52A0\u8F7D\u5E03\u5C40\u5931\u8D25\uFF0C\u5DF2\u56DE\u9000\u5230\u672C\u5730\u5B58\u50A8","layout.toast.saveSuccess":"\u5E03\u5C40\u4FDD\u5B58\u6210\u529F","layout.toast.saveLocalSuccess":"\u5E03\u5C40\u5DF2\u4FDD\u5B58\u5230\u672C\u5730\u5B58\u50A8","layout.toast.backendUnavailableSavedLocal":"\u540E\u7AEF\u4E0D\u53EF\u7528\uFF0C\u5DF2\u4FDD\u5B58\u5230\u672C\u5730\u5B58\u50A8","layout.toast.deleteSuccess":"\u5E03\u5C40\u5220\u9664\u6210\u529F","layout.toast.deleteLocalSuccess":"\u5E03\u5C40\u5DF2\u4ECE\u672C\u5730\u5B58\u50A8\u5220\u9664","layout.toast.backendUnavailableDeletedLocal":"\u540E\u7AEF\u4E0D\u53EF\u7528\uFF0C\u5DF2\u4ECE\u672C\u5730\u5B58\u50A8\u5220\u9664","layout.toast.defaultSuccess":"\u9ED8\u8BA4\u5E03\u5C40\u5DF2\u8BBE\u7F6E","layout.toast.defaultLocalSuccess":"\u9ED8\u8BA4\u5E03\u5C40\u5DF2\u5728\u672C\u5730\u5B58\u50A8\u8BBE\u7F6E","layout.toast.backendUnavailableDefaultLocal":"\u540E\u7AEF\u4E0D\u53EF\u7528\uFF0C\u9ED8\u8BA4\u5E03\u5C40\u5DF2\u4FDD\u5B58\u5230\u672C\u5730\u5B58\u50A8","dateRange.label":"\u65E5\u671F\u8303\u56F4","dateRange.startDate":"\u5F00\u59CB\u65E5\u671F","dateRange.endDate":"\u7ED3\u675F\u65E5\u671F","dateRange.select":"\u8BF7\u9009\u62E9...","dateRange.today":"\u4ECA\u5929","dateRange.thisWeek":"\u672C\u5468","dateRange.thisMonth":"\u672C\u6708","graph.records":"{count} \u6761\u8BB0\u5F55","graph.kpi.totalRecords":"\u603B\u8BB0\u5F55\u6570","graph.kpi.totalReport":"\u603B\u7533\u62A5\u5DE5\u65F6","graph.kpi.totalBillable":"\u603B\u53EF\u8BA1\u8D39\u5DE5\u65F6","graph.kpi.efficiency":"\u6548\u7387","graph.kpi.amount":"\u91D1\u989D","graph.kpi.flagged":"\u6807\u8BB0","graph.chart.billable.title":"\u7EF4\u5EA6\u8BA1\u8D39\u5DE5\u65F6","graph.chart.billable.subtitle":"\u6309\u53EF\u8BA1\u8D39\u5DE5\u65F6\u6392\u5E8F\u524D\u5217","graph.chart.efficiency.title":"\u4EBA\u5458\u6548\u7387","graph.chart.efficiency.subtitle":"\u6309\u6700\u4F4E\u6548\u7387\u4F18\u5148","graph.chart.status.title":"\u72B6\u6001\u5206\u5E03","graph.chart.status.subtitle":"\u6309\u72B6\u6001\u8BB0\u5F55\u5360\u6BD4","graph.dataBody":"\u6570\u636E\u660E\u7EC6","graph.reportTitle":"\u56FE\u8868\u62A5\u8868","graph.unassigned":"\u672A\u5206\u914D","graph.column.reportHours":"\u7533\u62A5\u5DE5\u65F6","graph.column.billableHours":"\u53EF\u8BA1\u8D39\u5DE5\u65F6","detail.searchAi.placeholder":"\u641C\u7D22\u5B57\u6BB5\uFF1B\u5982\u65E0\u7ED3\u679C\u5219\u81EA\u52A8\u89E6\u53D1 AI...","detail.searchAi.matches":"{count} \u6761\u5339\u914D\u7ED3\u679C","detail.searchAi.noMatch":"\u672A\u627E\u5230\u5339\u914D\u5B57\u6BB5\u3002","detail.searchAi.autoAiFallback":"\u672A\u547D\u4E2D\u5B57\u6BB5\uFF0C\u6B63\u5728\u89E6\u53D1 AI \u5206\u6790...","detail.searchAi.aiResultTitle":"AI \u5206\u6790\u7ED3\u679C","detail.table.title":"\u5173\u8054\u8BB0\u5F55","kanban.empty":"\u5C06\u5361\u7247\u62D6\u5230\u8FD9\u91CC","kanban.bucket.limit":"\u4E0A\u9650","kanban.bucket.dropHere":"\u91CA\u653E\u540E\u79FB\u52A8\u5230\u8BE5 bucket","kanban.card.progress":"\u8FDB\u5EA6","kanban.card.openDetail":"\u6253\u5F00\u8BE6\u60C5","kanban.priority.critical":"\u7D27\u6025","kanban.priority.high":"\u9AD8","kanban.priority.medium":"\u4E2D","kanban.priority.low":"\u4F4E","quickCreate.newItem":"\u65B0\u5EFA\u6761\u76EE","quickCreate.createWithTitle":"\u521B\u5EFA{title}","quickEdit.editWithTitle":"\u7F16\u8F91{title}","quickDelete.confirmTitle":"\u786E\u8BA4\u5220\u9664","quickDelete.confirmMessageSingle":"\u786E\u8BA4\u5220\u9664\u5F53\u524D\u9009\u4E2D\u8BB0\u5F55\u5417\uFF1F","quickDelete.confirmMessageMultiple":"\u786E\u8BA4\u5220\u9664\u5DF2\u9009\u4E2D\u7684 {count} \u6761\u8BB0\u5F55\u5417\uFF1F","messageBox.confirm":"\u786E\u5B9A","messageBox.cancel":"\u53D6\u6D88"},zh={"common.cancel":"Annuler","common.save":"Enregistrer","common.ok":"OK","common.done":"Terminer","common.search":"Rechercher","common.none":"Aucun","common.all":"Tout","common.noData":"Aucune donn\xE9e","common.copy":"Copier","common.delete":"Supprimer","common.loading":"Chargement...","header.searchPlaceholder":"Demandez-moi...","header.searchAddFeature":"Ajouter une fonction","header.searchSend":"Envoyer","header.searchStartVoice":"D\xE9marrer la saisie vocale","header.searchStopVoice":"Arr\xEAter la saisie vocale","header.theme.system":"Th\xE8me : Syst\xE8me","header.theme.dark":"Th\xE8me : Sombre","header.theme.light":"Th\xE8me : Clair","header.menu.setting":"Param\xE8tres","header.menu.logout":"Se d\xE9connecter","navigation.expand":"D\xE9velopper la navigation","navigation.collapse":"R\xE9duire la navigation","navigation.searchPlaceholder":"Rechercher dans le menu...","navigation.noMatch":"Aucun \xE9l\xE9ment correspondant","navigation.noAccessibleApp":"Aucune application accessible","navigation.noItems":"Aucun \xE9l\xE9ment \xE0 afficher","navigation.expandView":"D\xE9velopper {title}","navigation.mode.switchToFixed":"Basculer vers la navigation fixe","navigation.mode.switchToFloating":"Basculer vers la navigation flottante","navigation.pinned":"\xC9pingl\xE9s","navigation.pin.add":"\xC9pingler en haut","navigation.pin.remove":"D\xE9s\xE9pingler","table.toolbar.searchPlaceholder":"Rechercher...","table.title.default":"Tableau de donn\xE9es","table.toolbar.groupBy":"Grouper","table.toolbar.summary":"R\xE9sum\xE9","table.toolbar.columns":"Colonnes","table.toolbar.export":"Exporter","table.toolbar.itemsPerPage":"Lignes par page :","table.toolbar.pageOf":"Page {current} sur {total}","table.toolbar.newItem":"Nouvel \xE9l\xE9ment","table.toolbar.editItem":"Modifier l'\xE9l\xE9ment","table.toolbar.deleteItem":"Supprimer l'\xE9l\xE9ment","table.toolbar.graphicReport":"Rapport graphique","table.toolbar.saveLayout":"Enregistrer la vue","table.menu.groupBy":"Grouper","table.menu.clearAll":"Tout effacer","table.menu.visibleColumns":"Colonnes visibles","table.menu.showSummaryRow":"Afficher la ligne de r\xE9sum\xE9","table.menu.noNumericColumns":"Aucune colonne num\xE9rique","table.group.expandAll":"D\xE9velopper tous les groupes","table.group.collapseAll":"R\xE9duire tous les groupes","table.mobile.notImplemented":"Vue mobile non impl\xE9ment\xE9e","table.headerMenu.sortAsc":"Trier ascendant","table.headerMenu.sortDesc":"Trier descendant","table.headerMenu.clearSort":"Effacer le tri","table.headerMenu.configureSort":"Configurer le tri...","table.headerMenu.group":"Grouper par cette colonne","table.headerMenu.ungroup":"Retirer du groupement","table.headerMenu.addSummary":"Inclure dans le r\xE9sum\xE9","table.headerMenu.removeSummary":"Retirer du r\xE9sum\xE9","table.headerMenu.hideColumn":"Masquer la colonne","table.sortDialog.title":"Param\xE8tres de tri","table.sortDialog.empty":"Aucune r\xE8gle de tri. Ajoutez-en une pour commencer.","table.sortDialog.addRule":"Ajouter une r\xE8gle","table.sortDialog.clearAll":"Tout effacer","table.sortDialog.asc":"Ascendant","table.sortDialog.desc":"Descendant","pivot.title.default":"Tableau crois\xE9 dynamique","pivot.subtitle.default":"Faites glisser les champs pour configurer le tableau crois\xE9.","pivot.empty":"Ajoutez au moins un champ de valeur pour afficher le r\xE9sultat.","pivot.records":"Enregistrements","pivot.afterFilter":"Apr\xE8s filtre","pivot.grandTotal":"Total g\xE9n\xE9ral","pivot.resultLabel":"R\xE9sultat","pivot.valueLabel":"Valeur","pivot.table.dimensions":"Dimensions","pivot.config.title":"Configuration","pivot.fieldList":"Liste des champs","pivot.availableDimensions":"Dimensions disponibles","pivot.allFieldsInUse":"Tous les champs sont d\xE9j\xE0 utilis\xE9s.","pivot.zone.rows":"Lignes","pivot.zone.columns":"Colonnes","pivot.zone.filters":"Filtres","pivot.zone.values":"Valeurs","pivot.hint.rows":"D\xE9posez les champs ici pour construire la hi\xE9rarchie des lignes","pivot.hint.columns":"D\xE9posez les champs ici pour construire la hi\xE9rarchie des colonnes","pivot.hint.filters":"D\xE9posez les champs ici pour les filtres du rapport","pivot.hint.values":"D\xE9posez les champs num\xE9riques ici pour les agr\xE9gations","pivot.clearArea":"Vider la zone","pivot.filter.na":"N/A","pivot.filter.noValues":"Aucune valeur","pivot.filter.noneSelected":"Aucune s\xE9lection","pivot.filter.allValues":"Toutes les valeurs","pivot.filter.selectedCount":"{selected} / {total} s\xE9lectionn\xE9es","pivot.filter.selectAll":"Tout s\xE9lectionner","pivot.filter.deselectAll":"Tout d\xE9s\xE9lectionner","pivot.filter.noResults":"Aucun r\xE9sultat","pivot.collapse.ariaExpand":"D\xE9velopper la zone de configuration","pivot.collapse.ariaCollapse":"R\xE9duire la zone de configuration","pivot.agg.sum":"Somme","pivot.agg.count":"Compte","pivot.agg.avg":"Moyenne","pivot.agg.min":"Min","pivot.agg.max":"Max","pivot.preset.selectPlaceholder":"S\xE9lectionner un preset","pivot.preset.save":"Enregistrer le preset","pivot.preset.delete":"Supprimer le preset","pivot.preset.saveDialogTitle":"Enregistrer le preset actuel","pivot.preset.nameLabel":"Nom du preset","pivot.preset.defaultName":"Preset {index}","pivot.table.sectionTitle":"R\xE9sultat du pivot","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"D\xE9velopper le r\xE9sultat du pivot","pivot.table.collapse.ariaCollapse":"R\xE9duire le r\xE9sultat du pivot","pivot.chart.title":"Graphique pivot","pivot.chart.subtitle":"Associez une dimension et jusqu\u2019\xE0 deux mesures dans un graphique compact.","pivot.chart.subtitleReady":"{dimension} par {measure}","pivot.chart.emptyNoDimension":"Ajoutez au moins un champ de ligne ou de colonne pour afficher le graphique.","pivot.chart.emptyNoValue":"Ajoutez au moins un champ de valeur pour afficher le graphique.","pivot.chart.emptyNoData":"Aucune donn\xE9e disponible pour la s\xE9lection actuelle du graphique.","pivot.chart.dimension":"Dimension","pivot.chart.primaryMeasure":"Mesure","pivot.chart.secondaryMeasure":"Mesure de comparaison","pivot.chart.chartType":"Type de graphique","pivot.chart.style.barVertical":"Barres verticales","pivot.chart.style.barHorizontal":"Barres horizontales","pivot.chart.style.line":"Ligne","pivot.chart.style.scatter":"Nuage de points","pivot.chart.collapse.ariaExpand":"D\xE9velopper la zone du graphique","pivot.chart.collapse.ariaCollapse":"R\xE9duire la zone du graphique","smartFilter.adaptFilters":"Adapter les filtres","smartFilter.addFilters":"Ajouter des filtres","smartFilter.go":"Ex\xE9cuter","smartFilter.visibleFilters":"Filtres visibles","smartFilter.searchPlaceholder":"Rechercher...","smartFilter.noOptionsFound":"Aucune option trouv\xE9e","smartFilter.min":"Min","smartFilter.max":"Max","smartFilter.minMaxPlaceholder":"Min - Max","smartFilter.operator.equals":"\xC9gal \xE0","smartFilter.operator.contains":"Contient","smartFilter.operator.notContains":"Ne contient pas","smartFilter.operator.wildcard":"Recherche g\xE9n\xE9rique","smartFilter.operator.notEquals":"Diff\xE9rent de","smartFilter.operator.greaterThan":"Sup\xE9rieur \xE0","smartFilter.operator.lessThan":"Inf\xE9rieur \xE0","smartFilter.operator.greaterOrEqual":"Sup\xE9rieur ou \xE9gal","smartFilter.operator.lessOrEqual":"Inf\xE9rieur ou \xE9gal","smartFilter.operator.between":"Entre","variant.noOptions":"Aucune option","variant.defaultSuffix":"Par d\xE9faut","variant.selectVariant":"S\xE9lectionner une vue","variant.saveView":"Enregistrer la vue","variant.newVariant":"Nouvelle vue","variant.viewName":"Nom de la vue","variant.setDefault":"D\xE9finir par d\xE9faut","variant.publicAllUsers":"Public (tous les utilisateurs)","variant.toast.fetchFailed":"\xC9chec du chargement des vues","variant.toast.saveFailed":"\xC9chec de l'enregistrement de la vue","variant.toast.saveSuccess":"Vue enregistr\xE9e avec succ\xE8s","variant.toast.deleteFailed":"\xC9chec de la suppression de la vue","variant.toast.deleteSuccess":"Vue supprim\xE9e avec succ\xE8s","variant.toast.defaultFailed":"\xC9chec de la mise \xE0 jour de la vue par d\xE9faut","variant.toast.defaultSuccess":"Vue par d\xE9faut mise \xE0 jour","layout.saveLayout":"Enregistrer la vue","layout.layoutOptions":"Options de vue","layout.selectLayout":"S\xE9lectionner une vue","layout.saveCurrentLayout":"Enregistrer la vue actuelle...","layout.noSavedLayouts":"Aucune vue enregistr\xE9e","layout.removeDefault":"Retirer le d\xE9faut","layout.setAsDefault":"D\xE9finir par d\xE9faut","layout.layoutName":"Nom de la vue","layout.layoutDescription":"Description","layout.layoutNameHelper":"ex. : Vue compacte","layout.warningOverwrite":"Attention : la vue existante sera \xE9cras\xE9e","layout.useAsDefault":"Utiliser comme vue par d\xE9faut","layout.publicAllUsers":"Public (visible par tous les utilisateurs)","layout.toast.loadFallback":"\xC9chec du chargement depuis le backend, bascule vers le stockage local","layout.toast.saveSuccess":"Vue enregistr\xE9e avec succ\xE8s","layout.toast.saveLocalSuccess":"Vue enregistr\xE9e dans le stockage local","layout.toast.backendUnavailableSavedLocal":"Backend indisponible, enregistr\xE9 en local","layout.toast.deleteSuccess":"Vue supprim\xE9e avec succ\xE8s","layout.toast.deleteLocalSuccess":"Vue supprim\xE9e du stockage local","layout.toast.backendUnavailableDeletedLocal":"Backend indisponible, supprim\xE9 en local","layout.toast.defaultSuccess":"Vue par d\xE9faut d\xE9finie","layout.toast.defaultLocalSuccess":"Vue par d\xE9faut d\xE9finie en local","layout.toast.backendUnavailableDefaultLocal":"Backend indisponible, d\xE9faut enregistr\xE9 en local","dateRange.label":"Plage de dates","dateRange.startDate":"Date de d\xE9but","dateRange.endDate":"Date de fin","dateRange.select":"S\xE9lectionner...","dateRange.today":"Aujourd'hui","dateRange.thisWeek":"Cette semaine","dateRange.thisMonth":"Ce mois-ci","graph.records":"{count} enregistrements","graph.kpi.totalRecords":"Total des enregistrements","graph.kpi.totalReport":"Total d\xE9clar\xE9","graph.kpi.totalBillable":"Total facturable","graph.kpi.efficiency":"Efficacit\xE9","graph.kpi.amount":"Montant","graph.kpi.flagged":"Signal\xE9","graph.chart.billable.title":"Facturable par dimension","graph.chart.billable.subtitle":"Top valeurs par heures facturables","graph.chart.efficiency.title":"Efficacit\xE9 par personne","graph.chart.efficiency.subtitle":"Efficacit\xE9 la plus faible en premier","graph.chart.status.title":"R\xE9partition des statuts","graph.chart.status.subtitle":"Ratio des enregistrements par statut","graph.dataBody":"Donn\xE9es","graph.reportTitle":"Rapport graphique","graph.unassigned":"Non attribu\xE9","graph.column.reportHours":"Heures d\xE9clar\xE9es","graph.column.billableHours":"Heures facturables","detail.searchAi.placeholder":"Rechercher des champs, ou interroger l\u2019IA en cas d\u2019absence de r\xE9sultat...","detail.searchAi.matches":"{count} correspondances trouv\xE9es","detail.searchAi.noMatch":"Aucun champ correspondant trouv\xE9.","detail.searchAi.autoAiFallback":"Aucune correspondance directe. Analyse IA en cours...","detail.searchAi.aiResultTitle":"Analyse IA","detail.table.title":"Enregistrements li\xE9s","kanban.empty":"D\xE9posez les cartes ici","kanban.bucket.limit":"Limite","kanban.bucket.dropHere":"Rel\xE2chez pour d\xE9placer dans cette colonne","kanban.card.progress":"Progression","kanban.card.openDetail":"Ouvrir le d\xE9tail","kanban.priority.critical":"Critique","kanban.priority.high":"\xC9lev\xE9e","kanban.priority.medium":"Moyenne","kanban.priority.low":"Faible","quickCreate.newItem":"Nouvel \xE9l\xE9ment","quickCreate.createWithTitle":"Cr\xE9er {title}","quickEdit.editWithTitle":"Modifier {title}","quickDelete.confirmTitle":"Confirmer la suppression","quickDelete.confirmMessageSingle":"Voulez-vous vraiment supprimer l\u2019enregistrement s\xE9lectionn\xE9 ?","quickDelete.confirmMessageMultiple":"Voulez-vous vraiment supprimer les {count} enregistrements s\xE9lectionn\xE9s ?","messageBox.confirm":"OK","messageBox.cancel":"Annuler"},Oh={"common.cancel":"Abbrechen","common.save":"Speichern","common.ok":"OK","common.done":"Fertig","common.search":"Suchen","common.none":"Keine","common.all":"Alle","common.noData":"Keine Daten","common.copy":"Kopieren","common.delete":"L\xF6schen","common.loading":"Wird geladen...","header.searchPlaceholder":"Frag mich...","header.searchAddFeature":"Funktion hinzuf\xFCgen","header.searchSend":"Senden","header.searchStartVoice":"Spracheingabe starten","header.searchStopVoice":"Spracheingabe stoppen","header.theme.system":"Theme: System","header.theme.dark":"Theme: Dunkel","header.theme.light":"Theme: Hell","header.menu.setting":"Einstellungen","header.menu.logout":"Abmelden","navigation.expand":"Navigation erweitern","navigation.collapse":"Navigation einklappen","navigation.searchPlaceholder":"Men\xFC suchen...","navigation.noMatch":"Keine passenden Men\xFCeintr\xE4ge","navigation.noAccessibleApp":"Keine verf\xFCgbaren Anwendungen","navigation.noItems":"Keine Eintr\xE4ge vorhanden","navigation.expandView":"{title} aufklappen","navigation.mode.switchToFixed":"Zu fester Navigation wechseln","navigation.mode.switchToFloating":"Zu schwebender Navigation wechseln","navigation.pinned":"Angeheftet","navigation.pin.add":"Oben anheften","navigation.pin.remove":"L\xF6sen","table.toolbar.searchPlaceholder":"Suchen...","table.title.default":"Datentabelle","table.toolbar.groupBy":"Gruppieren","table.toolbar.summary":"Zusammenfassung","table.toolbar.columns":"Spalten","table.toolbar.export":"Export","table.toolbar.itemsPerPage":"Zeilen pro Seite:","table.toolbar.pageOf":"Seite {current} von {total}","table.toolbar.newItem":"Neuer Eintrag","table.toolbar.editItem":"Eintrag bearbeiten","table.toolbar.deleteItem":"Eintrag l\xF6schen","table.toolbar.graphicReport":"Grafikbericht","table.toolbar.saveLayout":"Layout speichern","table.menu.groupBy":"Gruppieren","table.menu.clearAll":"Alles l\xF6schen","table.menu.visibleColumns":"Sichtbare Spalten","table.menu.showSummaryRow":"Summenzeile anzeigen","table.menu.noNumericColumns":"Keine numerischen Spalten","table.group.expandAll":"Alle Gruppen aufklappen","table.group.collapseAll":"Alle Gruppen zuklappen","table.mobile.notImplemented":"Mobile Ansicht nicht implementiert","table.headerMenu.sortAsc":"Aufsteigend sortieren","table.headerMenu.sortDesc":"Absteigend sortieren","table.headerMenu.clearSort":"Sortierung entfernen","table.headerMenu.configureSort":"Sortierung konfigurieren...","table.headerMenu.group":"Nach dieser Spalte gruppieren","table.headerMenu.ungroup":"Aus Gruppierung entfernen","table.headerMenu.addSummary":"In Summe einbeziehen","table.headerMenu.removeSummary":"Aus Summe entfernen","table.headerMenu.hideColumn":"Spalte ausblenden","table.sortDialog.title":"Sortiereinstellungen","table.sortDialog.empty":"Keine Sortierregeln. F\xFCgen Sie eine hinzu, um zu sortieren.","table.sortDialog.addRule":"Regel hinzuf\xFCgen","table.sortDialog.clearAll":"Alle l\xF6schen","table.sortDialog.asc":"Aufsteigend","table.sortDialog.desc":"Absteigend","pivot.title.default":"Pivot-Tabelle","pivot.subtitle.default":"Ziehen Sie Felder, um die Pivot-Tabelle zu konfigurieren.","pivot.empty":"Ziehen Sie mindestens ein Wertefeld, um das Ergebnis anzuzeigen.","pivot.records":"Datens\xE4tze","pivot.afterFilter":"Nach Filter","pivot.grandTotal":"Gesamtsumme","pivot.resultLabel":"Ergebnis","pivot.valueLabel":"Wert","pivot.table.dimensions":"Dimensionen","pivot.config.title":"Konfiguration","pivot.fieldList":"Feldliste","pivot.availableDimensions":"Verf\xFCgbare Dimensionen","pivot.allFieldsInUse":"Alle Felder sind bereits verwendet.","pivot.zone.rows":"Zeilen","pivot.zone.columns":"Spalten","pivot.zone.filters":"Filter","pivot.zone.values":"Werte","pivot.hint.rows":"Felder hierhin ziehen, um die Zeilenhierarchie zu erstellen","pivot.hint.columns":"Felder hierhin ziehen, um die Spaltenhierarchie zu erstellen","pivot.hint.filters":"Felder hierhin ziehen f\xFCr Berichtsfilter","pivot.hint.values":"Numerische Felder hierhin ziehen f\xFCr Aggregation","pivot.clearArea":"Bereich leeren","pivot.filter.na":"N/V","pivot.filter.noValues":"Keine Werte","pivot.filter.noneSelected":"Nichts ausgew\xE4hlt","pivot.filter.allValues":"Alle Werte","pivot.filter.selectedCount":"{selected} / {total} ausgew\xE4hlt","pivot.filter.selectAll":"Alle ausw\xE4hlen","pivot.filter.deselectAll":"Alle abw\xE4hlen","pivot.filter.noResults":"Keine Ergebnisse","pivot.collapse.ariaExpand":"Konfigurationsbereich erweitern","pivot.collapse.ariaCollapse":"Konfigurationsbereich reduzieren","pivot.agg.sum":"Summe","pivot.agg.count":"Anzahl","pivot.agg.avg":"Durchschnitt","pivot.agg.min":"Min","pivot.agg.max":"Max","pivot.preset.selectPlaceholder":"Preset w\xE4hlen","pivot.preset.save":"Preset speichern","pivot.preset.delete":"Preset l\xF6schen","pivot.preset.saveDialogTitle":"Aktuelles Preset speichern","pivot.preset.nameLabel":"Preset-Name","pivot.preset.defaultName":"Preset {index}","pivot.table.sectionTitle":"Pivot-Ergebnis","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"Pivot-Ergebnis erweitern","pivot.table.collapse.ariaCollapse":"Pivot-Ergebnis reduzieren","pivot.chart.title":"Pivot-Diagramm","pivot.chart.subtitle":"Eine Dimension und bis zu zwei Kennzahlen in einem kompakten Diagramm abbilden.","pivot.chart.subtitleReady":"{dimension} nach {measure}","pivot.chart.emptyNoDimension":"F\xFCgen Sie mindestens ein Zeilen- oder Spaltenfeld hinzu, um das Diagramm anzuzeigen.","pivot.chart.emptyNoValue":"F\xFCgen Sie mindestens ein Wertefeld hinzu, um das Diagramm anzuzeigen.","pivot.chart.emptyNoData":"F\xFCr die aktuelle Diagrammauswahl sind keine Daten verf\xFCgbar.","pivot.chart.dimension":"Dimension","pivot.chart.primaryMeasure":"Kennzahl","pivot.chart.secondaryMeasure":"Vergleichskennzahl","pivot.chart.chartType":"Diagrammtyp","pivot.chart.style.barVertical":"Vertikale Balken","pivot.chart.style.barHorizontal":"Horizontale Balken","pivot.chart.style.line":"Linie","pivot.chart.style.scatter":"Streudiagramm","pivot.chart.collapse.ariaExpand":"Diagrammbereich erweitern","pivot.chart.collapse.ariaCollapse":"Diagrammbereich reduzieren","smartFilter.adaptFilters":"Filter anpassen","smartFilter.addFilters":"Filter hinzuf\xFCgen","smartFilter.go":"Los","smartFilter.visibleFilters":"Sichtbare Filter","smartFilter.searchPlaceholder":"Suchen...","smartFilter.noOptionsFound":"Keine Optionen gefunden","smartFilter.min":"Min","smartFilter.max":"Max","smartFilter.minMaxPlaceholder":"Min - Max","smartFilter.operator.equals":"Gleich","smartFilter.operator.contains":"Enth\xE4lt","smartFilter.operator.notContains":"Enth\xE4lt nicht","smartFilter.operator.wildcard":"Wildcard-Suche","smartFilter.operator.notEquals":"Ungleich","smartFilter.operator.greaterThan":"Gr\xF6\xDFer als","smartFilter.operator.lessThan":"Kleiner als","smartFilter.operator.greaterOrEqual":"Gr\xF6\xDFer gleich","smartFilter.operator.lessOrEqual":"Kleiner gleich","smartFilter.operator.between":"Zwischen","variant.noOptions":"Keine Optionen","variant.defaultSuffix":"Standard","variant.selectVariant":"Variante w\xE4hlen","variant.saveView":"Ansicht speichern","variant.newVariant":"Neue Variante","variant.viewName":"Ansichtsname","variant.setDefault":"Als Standard setzen","variant.publicAllUsers":"\xD6ffentlich (alle Benutzer)","variant.toast.fetchFailed":"Varianten konnten nicht geladen werden","variant.toast.saveFailed":"Variante konnte nicht gespeichert werden","variant.toast.saveSuccess":"Variante erfolgreich gespeichert","variant.toast.deleteFailed":"Variante konnte nicht gel\xF6scht werden","variant.toast.deleteSuccess":"Variante erfolgreich gel\xF6scht","variant.toast.defaultFailed":"Standardvariante konnte nicht aktualisiert werden","variant.toast.defaultSuccess":"Standardvariante aktualisiert","layout.saveLayout":"Layout speichern","layout.layoutOptions":"Layout-Optionen","layout.selectLayout":"Layout w\xE4hlen","layout.saveCurrentLayout":"Aktuelles Layout speichern...","layout.noSavedLayouts":"Keine gespeicherten Layouts","layout.removeDefault":"Standard entfernen","layout.setAsDefault":"Als Standard setzen","layout.layoutName":"Layoutname","layout.layoutDescription":"Beschreibung","layout.layoutNameHelper":"z. B. Kompaktansicht","layout.warningOverwrite":"Warnung: Vorhandenes Layout wird \xFCberschrieben","layout.useAsDefault":"Als Standardlayout verwenden","layout.publicAllUsers":"\xD6ffentlich (f\xFCr alle sichtbar)","layout.toast.loadFallback":"Layouts konnten nicht vom Backend geladen werden, Wechsel zu lokalem Speicher","layout.toast.saveSuccess":"Layout erfolgreich gespeichert","layout.toast.saveLocalSuccess":"Layout im lokalen Speicher gespeichert","layout.toast.backendUnavailableSavedLocal":"Backend nicht verf\xFCgbar, lokal gespeichert","layout.toast.deleteSuccess":"Layout erfolgreich gel\xF6scht","layout.toast.deleteLocalSuccess":"Layout aus lokalem Speicher gel\xF6scht","layout.toast.backendUnavailableDeletedLocal":"Backend nicht verf\xFCgbar, lokal gel\xF6scht","layout.toast.defaultSuccess":"Standardlayout gesetzt","layout.toast.defaultLocalSuccess":"Standardlayout lokal gesetzt","layout.toast.backendUnavailableDefaultLocal":"Backend nicht verf\xFCgbar, Standard lokal gespeichert","dateRange.label":"Datumsbereich","dateRange.startDate":"Startdatum","dateRange.endDate":"Enddatum","dateRange.select":"Ausw\xE4hlen...","dateRange.today":"Heute","dateRange.thisWeek":"Diese Woche","dateRange.thisMonth":"Diesen Monat","graph.records":"{count} Datens\xE4tze","graph.kpi.totalRecords":"Gesamt Datens\xE4tze","graph.kpi.totalReport":"Gesamt Report","graph.kpi.totalBillable":"Gesamt abrechenbar","graph.kpi.efficiency":"Effizienz","graph.kpi.amount":"Betrag","graph.kpi.flagged":"Markiert","graph.chart.billable.title":"Abrechenbar nach Dimension","graph.chart.billable.subtitle":"Top-Werte nach abrechenbaren Stunden","graph.chart.efficiency.title":"Effizienz pro Person","graph.chart.efficiency.subtitle":"Niedrigste Effizienz zuerst","graph.chart.status.title":"Statusverteilung","graph.chart.status.subtitle":"Anteil je Status","graph.dataBody":"Datentabelle","graph.reportTitle":"Grafikbericht","graph.unassigned":"Nicht zugewiesen","graph.column.reportHours":"Melde-Stunden","graph.column.billableHours":"Abrechenbare Stunden","detail.searchAi.placeholder":"Felder suchen, oder bei keinem Treffer die KI fragen...","detail.searchAi.matches":"{count} Treffer gefunden","detail.searchAi.noMatch":"Kein passendes Feld gefunden.","detail.searchAi.autoAiFallback":"Keine direkte \xDCbereinstimmung. KI-Analyse wird gestartet...","detail.searchAi.aiResultTitle":"KI-Ergebnis","detail.table.title":"Verkn\xFCpfte Eintr\xE4ge","kanban.empty":"Karten hier ablegen","kanban.bucket.limit":"Limit","kanban.bucket.dropHere":"Loslassen, um in diese Spalte zu verschieben","kanban.card.progress":"Fortschritt","kanban.card.openDetail":"Detail \xF6ffnen","kanban.priority.critical":"Kritisch","kanban.priority.high":"Hoch","kanban.priority.medium":"Mittel","kanban.priority.low":"Niedrig","quickCreate.newItem":"Neuer Eintrag","quickCreate.createWithTitle":"{title} erstellen","quickEdit.editWithTitle":"{title} bearbeiten","quickDelete.confirmTitle":"L\xF6schen best\xE4tigen","quickDelete.confirmMessageSingle":"M\xF6chten Sie den ausgew\xE4hlten Datensatz wirklich l\xF6schen?","quickDelete.confirmMessageMultiple":"M\xF6chten Sie die {count} ausgew\xE4hlten Datens\xE4tze wirklich l\xF6schen?","messageBox.confirm":"OK","messageBox.cancel":"Abbrechen"},Vh={"common.cancel":"\u30AD\u30E3\u30F3\u30BB\u30EB","common.save":"\u4FDD\u5B58","common.ok":"OK","common.done":"\u5B8C\u4E86","common.search":"\u691C\u7D22","common.none":"\u306A\u3057","common.all":"\u3059\u3079\u3066","common.noData":"\u30C7\u30FC\u30BF\u306A\u3057","common.copy":"\u30B3\u30D4\u30FC","common.delete":"\u524A\u9664","common.loading":"\u8AAD\u307F\u8FBC\u307F\u4E2D...","header.searchPlaceholder":"\u4F55\u304B\u805E\u3044\u3066\u304F\u3060\u3055\u3044...","header.searchAddFeature":"\u6A5F\u80FD\u3092\u8FFD\u52A0","header.searchSend":"\u9001\u4FE1","header.searchStartVoice":"\u97F3\u58F0\u5165\u529B\u3092\u958B\u59CB","header.searchStopVoice":"\u97F3\u58F0\u5165\u529B\u3092\u505C\u6B62","header.theme.system":"\u30C6\u30FC\u30DE\uFF1A\u30B7\u30B9\u30C6\u30E0","header.theme.dark":"\u30C6\u30FC\u30DE\uFF1A\u30C0\u30FC\u30AF","header.theme.light":"\u30C6\u30FC\u30DE\uFF1A\u30E9\u30A4\u30C8","header.menu.setting":"\u8A2D\u5B9A","header.menu.logout":"\u30ED\u30B0\u30A2\u30A6\u30C8","navigation.expand":"\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u3092\u5C55\u958B","navigation.collapse":"\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u3092\u6298\u308A\u305F\u305F\u3080","navigation.searchPlaceholder":"\u30E1\u30CB\u30E5\u30FC\u3092\u691C\u7D22...","navigation.noMatch":"\u4E00\u81F4\u3059\u308B\u30E1\u30CB\u30E5\u30FC\u304C\u3042\u308A\u307E\u305B\u3093","navigation.noAccessibleApp":"\u30A2\u30AF\u30BB\u30B9\u53EF\u80FD\u306A\u30A2\u30D7\u30EA\u304C\u3042\u308A\u307E\u305B\u3093","navigation.noItems":"\u8868\u793A\u3067\u304D\u308B\u9805\u76EE\u304C\u3042\u308A\u307E\u305B\u3093","navigation.expandView":"{title} \u3092\u5C55\u958B","navigation.mode.switchToFixed":"\u56FA\u5B9A\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u306B\u5207\u308A\u66FF\u3048","navigation.mode.switchToFloating":"\u30D5\u30ED\u30FC\u30C6\u30A3\u30F3\u30B0\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u306B\u5207\u308A\u66FF\u3048","navigation.pinned":"\u30D4\u30F3\u7559\u3081","navigation.pin.add":"\u4E0A\u90E8\u306B\u30D4\u30F3\u7559\u3081","navigation.pin.remove":"\u30D4\u30F3\u7559\u3081\u3092\u89E3\u9664","table.toolbar.searchPlaceholder":"\u691C\u7D22...","table.title.default":"\u30C7\u30FC\u30BF\u30C6\u30FC\u30D6\u30EB","table.toolbar.groupBy":"\u30B0\u30EB\u30FC\u30D7\u5316","table.toolbar.summary":"\u96C6\u8A08","table.toolbar.columns":"\u5217","table.toolbar.export":"\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8","table.toolbar.itemsPerPage":"1\u30DA\u30FC\u30B8\u306E\u4EF6\u6570\uFF1A","table.toolbar.pageOf":"{current} / {total} \u30DA\u30FC\u30B8","table.toolbar.newItem":"\u65B0\u898F\u4F5C\u6210","table.toolbar.editItem":"\u7DE8\u96C6","table.toolbar.deleteItem":"\u524A\u9664","table.toolbar.graphicReport":"\u30B0\u30E9\u30D5\u30A3\u30C3\u30AF\u30EC\u30DD\u30FC\u30C8","table.toolbar.saveLayout":"\u30EC\u30A4\u30A2\u30A6\u30C8\u4FDD\u5B58","table.menu.groupBy":"\u30B0\u30EB\u30FC\u30D7\u5316","table.menu.clearAll":"\u3059\u3079\u3066\u30AF\u30EA\u30A2","table.menu.visibleColumns":"\u8868\u793A\u5217","table.menu.showSummaryRow":"\u96C6\u8A08\u884C\u3092\u8868\u793A","table.menu.noNumericColumns":"\u6570\u5024\u5217\u304C\u3042\u308A\u307E\u305B\u3093","table.group.expandAll":"\u3059\u3079\u3066\u306E\u30B0\u30EB\u30FC\u30D7\u3092\u5C55\u958B","table.group.collapseAll":"\u3059\u3079\u3066\u306E\u30B0\u30EB\u30FC\u30D7\u3092\u6298\u308A\u305F\u305F\u3080","table.mobile.notImplemented":"\u30E2\u30D0\u30A4\u30EB\u8868\u793A\u306F\u672A\u5B9F\u88C5\u3067\u3059","table.headerMenu.sortAsc":"\u6607\u9806\u3067\u4E26\u3079\u66FF\u3048","table.headerMenu.sortDesc":"\u964D\u9806\u3067\u4E26\u3079\u66FF\u3048","table.headerMenu.clearSort":"\u4E26\u3079\u66FF\u3048\u3092\u89E3\u9664","table.headerMenu.configureSort":"\u4E26\u3079\u66FF\u3048\u3092\u8A2D\u5B9A...","table.headerMenu.group":"\u3053\u306E\u5217\u3067\u30B0\u30EB\u30FC\u30D7\u5316","table.headerMenu.ungroup":"\u30B0\u30EB\u30FC\u30D7\u304B\u3089\u5916\u3059","table.headerMenu.addSummary":"\u96C6\u8A08\u306B\u8FFD\u52A0","table.headerMenu.removeSummary":"\u96C6\u8A08\u304B\u3089\u524A\u9664","table.headerMenu.hideColumn":"\u5217\u3092\u975E\u8868\u793A","table.sortDialog.title":"\u4E26\u3079\u66FF\u3048\u8A2D\u5B9A","table.sortDialog.empty":"\u4E26\u3079\u66FF\u3048\u30EB\u30FC\u30EB\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","table.sortDialog.addRule":"\u30EB\u30FC\u30EB\u3092\u8FFD\u52A0","table.sortDialog.clearAll":"\u3059\u3079\u3066\u30AF\u30EA\u30A2","table.sortDialog.asc":"\u6607\u9806","table.sortDialog.desc":"\u964D\u9806","pivot.title.default":"\u30D4\u30DC\u30C3\u30C8\u30C6\u30FC\u30D6\u30EB","pivot.subtitle.default":"\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u30D4\u30DC\u30C3\u30C8\u30C6\u30FC\u30D6\u30EB\u3092\u8A2D\u5B9A\u3057\u307E\u3059\u3002","pivot.empty":"\u7D50\u679C\u3092\u8868\u793A\u3059\u308B\u306B\u306F\u3001\u5024\u30A8\u30EA\u30A2\u306B\u5C11\u306A\u304F\u3068\u30821\u3064\u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","pivot.records":"\u30EC\u30B3\u30FC\u30C9","pivot.afterFilter":"\u30D5\u30A3\u30EB\u30BF\u30FC\u5F8C","pivot.grandTotal":"\u7DCF\u8A08","pivot.resultLabel":"\u7D50\u679C","pivot.valueLabel":"\u5024","pivot.table.dimensions":"\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3","pivot.config.title":"\u8A2D\u5B9A","pivot.fieldList":"\u30D5\u30A3\u30FC\u30EB\u30C9\u4E00\u89A7","pivot.availableDimensions":"\u5229\u7528\u53EF\u80FD\u306A\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3","pivot.allFieldsInUse":"\u3059\u3079\u3066\u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u304C\u4F7F\u7528\u4E2D\u3067\u3059\u3002","pivot.zone.rows":"\u884C","pivot.zone.columns":"\u5217","pivot.zone.filters":"\u30D5\u30A3\u30EB\u30BF\u30FC","pivot.zone.values":"\u5024","pivot.hint.rows":"\u3053\u3053\u306B\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u884C\u968E\u5C64\u3092\u4F5C\u6210","pivot.hint.columns":"\u3053\u3053\u306B\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u5217\u968E\u5C64\u3092\u4F5C\u6210","pivot.hint.filters":"\u3053\u3053\u306B\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u30EC\u30DD\u30FC\u30C8\u30D5\u30A3\u30EB\u30BF\u30FC\u3092\u8A2D\u5B9A","pivot.hint.values":"\u3053\u3053\u306B\u6570\u5024\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u96C6\u8A08","pivot.clearArea":"\u30A8\u30EA\u30A2\u3092\u30AF\u30EA\u30A2","pivot.filter.na":"N/A","pivot.filter.noValues":"\u5024\u304C\u3042\u308A\u307E\u305B\u3093","pivot.filter.noneSelected":"\u672A\u9078\u629E","pivot.filter.allValues":"\u3059\u3079\u3066\u306E\u5024","pivot.filter.selectedCount":"{selected} / {total} \u3092\u9078\u629E","pivot.filter.selectAll":"\u3059\u3079\u3066\u9078\u629E","pivot.filter.deselectAll":"\u3059\u3079\u3066\u89E3\u9664","pivot.filter.noResults":"\u7D50\u679C\u304C\u3042\u308A\u307E\u305B\u3093","pivot.collapse.ariaExpand":"\u8A2D\u5B9A\u30A8\u30EA\u30A2\u3092\u5C55\u958B","pivot.collapse.ariaCollapse":"\u8A2D\u5B9A\u30A8\u30EA\u30A2\u3092\u6298\u308A\u305F\u305F\u3080","pivot.agg.sum":"\u5408\u8A08","pivot.agg.count":"\u4EF6\u6570","pivot.agg.avg":"\u5E73\u5747","pivot.agg.min":"\u6700\u5C0F","pivot.agg.max":"\u6700\u5927","pivot.preset.selectPlaceholder":"\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u9078\u629E","pivot.preset.save":"\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u4FDD\u5B58","pivot.preset.delete":"\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u524A\u9664","pivot.preset.saveDialogTitle":"\u73FE\u5728\u306E\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u4FDD\u5B58","pivot.preset.nameLabel":"\u30D7\u30EA\u30BB\u30C3\u30C8\u540D","pivot.preset.defaultName":"\u30D7\u30EA\u30BB\u30C3\u30C8 {index}","pivot.table.sectionTitle":"\u30D4\u30DC\u30C3\u30C8\u7D50\u679C","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"\u30D4\u30DC\u30C3\u30C8\u7D50\u679C\u3092\u5C55\u958B","pivot.table.collapse.ariaCollapse":"\u30D4\u30DC\u30C3\u30C8\u7D50\u679C\u3092\u6298\u308A\u305F\u305F\u3080","pivot.chart.title":"\u30D4\u30DC\u30C3\u30C8\u30C1\u30E3\u30FC\u30C8","pivot.chart.subtitle":"1\u3064\u306E\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3\u3068\u6700\u59272\u3064\u306E\u6307\u6A19\u3092\u30B3\u30F3\u30D1\u30AF\u30C8\u306A\u30C1\u30E3\u30FC\u30C8\u306B\u307E\u3068\u3081\u307E\u3059\u3002","pivot.chart.subtitleReady":"{dimension} \u3054\u3068\u306E {measure}","pivot.chart.emptyNoDimension":"\u30C1\u30E3\u30FC\u30C8\u3092\u8868\u793A\u3059\u308B\u306B\u306F\u3001\u5C11\u306A\u304F\u3068\u30821\u3064\u306E\u884C\u307E\u305F\u306F\u5217\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","pivot.chart.emptyNoValue":"\u30C1\u30E3\u30FC\u30C8\u3092\u8868\u793A\u3059\u308B\u306B\u306F\u3001\u5C11\u306A\u304F\u3068\u30821\u3064\u306E\u5024\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","pivot.chart.emptyNoData":"\u73FE\u5728\u306E\u30C1\u30E3\u30FC\u30C8\u9078\u629E\u3067\u306F\u8868\u793A\u3067\u304D\u308B\u30C7\u30FC\u30BF\u304C\u3042\u308A\u307E\u305B\u3093\u3002","pivot.chart.dimension":"\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3","pivot.chart.primaryMeasure":"\u6307\u6A19","pivot.chart.secondaryMeasure":"\u6BD4\u8F03\u6307\u6A19","pivot.chart.chartType":"\u30C1\u30E3\u30FC\u30C8\u7A2E\u5225","pivot.chart.style.barVertical":"\u7E26\u68D2\u30B0\u30E9\u30D5","pivot.chart.style.barHorizontal":"\u6A2A\u68D2\u30B0\u30E9\u30D5","pivot.chart.style.line":"\u6298\u308C\u7DDA\u30B0\u30E9\u30D5","pivot.chart.style.scatter":"\u6563\u5E03\u56F3","pivot.chart.collapse.ariaExpand":"\u30C1\u30E3\u30FC\u30C8\u9818\u57DF\u3092\u5C55\u958B","pivot.chart.collapse.ariaCollapse":"\u30C1\u30E3\u30FC\u30C8\u9818\u57DF\u3092\u6298\u308A\u305F\u305F\u3080","smartFilter.adaptFilters":"\u30D5\u30A3\u30EB\u30BF\u30FC\u8ABF\u6574","smartFilter.addFilters":"\u30D5\u30A3\u30EB\u30BF\u30FC\u8FFD\u52A0","smartFilter.go":"\u5B9F\u884C","smartFilter.visibleFilters":"\u8868\u793A\u30D5\u30A3\u30EB\u30BF\u30FC","smartFilter.searchPlaceholder":"\u691C\u7D22...","smartFilter.noOptionsFound":"\u30AA\u30D7\u30B7\u30E7\u30F3\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093","smartFilter.min":"\u6700\u5C0F","smartFilter.max":"\u6700\u5927","smartFilter.minMaxPlaceholder":"\u6700\u5C0F - \u6700\u5927","smartFilter.operator.equals":"\u7B49\u3057\u3044","smartFilter.operator.contains":"\u542B\u3080","smartFilter.operator.notContains":"\u542B\u307E\u306A\u3044","smartFilter.operator.wildcard":"\u30EF\u30A4\u30EB\u30C9\u30AB\u30FC\u30C9\u691C\u7D22","smartFilter.operator.notEquals":"\u7B49\u3057\u304F\u306A\u3044","smartFilter.operator.greaterThan":"\u3088\u308A\u5927\u304D\u3044","smartFilter.operator.lessThan":"\u3088\u308A\u5C0F\u3055\u3044","smartFilter.operator.greaterOrEqual":"\u4EE5\u4E0A","smartFilter.operator.lessOrEqual":"\u4EE5\u4E0B","smartFilter.operator.between":"\u7BC4\u56F2","variant.noOptions":"\u30AA\u30D7\u30B7\u30E7\u30F3\u306A\u3057","variant.defaultSuffix":"\u30C7\u30D5\u30A9\u30EB\u30C8","variant.selectVariant":"\u30D3\u30E5\u30FC\u3092\u9078\u629E","variant.saveView":"\u30D3\u30E5\u30FC\u4FDD\u5B58","variant.newVariant":"\u65B0\u3057\u3044\u30D3\u30E5\u30FC","variant.viewName":"\u30D3\u30E5\u30FC\u540D","variant.setDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u306B\u8A2D\u5B9A","variant.publicAllUsers":"\u516C\u958B\uFF08\u5168\u30E6\u30FC\u30B6\u30FC\uFF09","variant.toast.fetchFailed":"\u30D3\u30E5\u30FC\u306E\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.saveFailed":"\u30D3\u30E5\u30FC\u306E\u4FDD\u5B58\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.saveSuccess":"\u30D3\u30E5\u30FC\u3092\u4FDD\u5B58\u3057\u307E\u3057\u305F","variant.toast.deleteFailed":"\u30D3\u30E5\u30FC\u306E\u524A\u9664\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.deleteSuccess":"\u30D3\u30E5\u30FC\u3092\u524A\u9664\u3057\u307E\u3057\u305F","variant.toast.defaultFailed":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30D3\u30E5\u30FC\u306E\u66F4\u65B0\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.defaultSuccess":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30D3\u30E5\u30FC\u3092\u66F4\u65B0\u3057\u307E\u3057\u305F","layout.saveLayout":"\u30EC\u30A4\u30A2\u30A6\u30C8\u4FDD\u5B58","layout.layoutOptions":"\u30EC\u30A4\u30A2\u30A6\u30C8\u30AA\u30D7\u30B7\u30E7\u30F3","layout.selectLayout":"\u30EC\u30A4\u30A2\u30A6\u30C8\u9078\u629E","layout.saveCurrentLayout":"\u73FE\u5728\u306E\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u4FDD\u5B58...","layout.noSavedLayouts":"\u4FDD\u5B58\u6E08\u307F\u30EC\u30A4\u30A2\u30A6\u30C8\u306A\u3057","layout.removeDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u89E3\u9664","layout.setAsDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u306B\u8A2D\u5B9A","layout.layoutName":"\u30EC\u30A4\u30A2\u30A6\u30C8\u540D","layout.layoutDescription":"\u8AAC\u660E","layout.layoutNameHelper":"\u4F8B\uFF1A\u30B3\u30F3\u30D1\u30AF\u30C8\u8868\u793A","layout.warningOverwrite":"\u8B66\u544A\uFF1A\u65E2\u5B58\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u4E0A\u66F8\u304D\u3057\u307E\u3059","layout.useAsDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30EC\u30A4\u30A2\u30A6\u30C8\u3068\u3057\u3066\u4F7F\u7528","layout.publicAllUsers":"\u516C\u958B\uFF08\u5168\u30E6\u30FC\u30B6\u30FC\u306B\u8868\u793A\uFF09","layout.toast.loadFallback":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u304B\u3089\u306E\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u3001\u30ED\u30FC\u30AB\u30EB\u4FDD\u5B58\u306B\u5207\u308A\u66FF\u3048\u307E\u3057\u305F","layout.toast.saveSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u4FDD\u5B58\u3057\u307E\u3057\u305F","layout.toast.saveLocalSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u4FDD\u5B58\u3057\u307E\u3057\u305F","layout.toast.backendUnavailableSavedLocal":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u672A\u63A5\u7D9A\u306E\u305F\u3081\u30ED\u30FC\u30AB\u30EB\u306B\u4FDD\u5B58\u3057\u307E\u3057\u305F","layout.toast.deleteSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u524A\u9664\u3057\u307E\u3057\u305F","layout.toast.deleteLocalSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u304B\u3089\u524A\u9664\u3057\u307E\u3057\u305F","layout.toast.backendUnavailableDeletedLocal":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u672A\u63A5\u7D9A\u306E\u305F\u3081\u30ED\u30FC\u30AB\u30EB\u304B\u3089\u524A\u9664\u3057\u307E\u3057\u305F","layout.toast.defaultSuccess":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u8A2D\u5B9A\u3057\u307E\u3057\u305F","layout.toast.defaultLocalSuccess":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u306B\u8A2D\u5B9A\u3057\u307E\u3057\u305F","layout.toast.backendUnavailableDefaultLocal":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u672A\u63A5\u7D9A\u306E\u305F\u3081\u30C7\u30D5\u30A9\u30EB\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u4FDD\u5B58\u3057\u307E\u3057\u305F","dateRange.label":"\u65E5\u4ED8\u7BC4\u56F2","dateRange.startDate":"\u958B\u59CB\u65E5","dateRange.endDate":"\u7D42\u4E86\u65E5","dateRange.select":"\u9078\u629E...","dateRange.today":"\u4ECA\u65E5","dateRange.thisWeek":"\u4ECA\u9031","dateRange.thisMonth":"\u4ECA\u6708","graph.records":"{count} \u4EF6","graph.kpi.totalRecords":"\u7DCF\u30EC\u30B3\u30FC\u30C9","graph.kpi.totalReport":"\u7DCF\u5831\u544A\u6642\u9593","graph.kpi.totalBillable":"\u7DCF\u8ACB\u6C42\u53EF\u80FD\u6642\u9593","graph.kpi.efficiency":"\u52B9\u7387","graph.kpi.amount":"\u91D1\u984D","graph.kpi.flagged":"\u8981\u78BA\u8A8D","graph.chart.billable.title":"\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3\u5225\u8ACB\u6C42\u53EF\u80FD\u6642\u9593","graph.chart.billable.subtitle":"\u8ACB\u6C42\u53EF\u80FD\u6642\u9593\u306E\u4E0A\u4F4D","graph.chart.efficiency.title":"\u62C5\u5F53\u8005\u5225\u52B9\u7387","graph.chart.efficiency.subtitle":"\u52B9\u7387\u306E\u4F4E\u3044\u9806","graph.chart.status.title":"\u30B9\u30C6\u30FC\u30BF\u30B9\u5206\u5E03","graph.chart.status.subtitle":"\u30B9\u30C6\u30FC\u30BF\u30B9\u5225\u6BD4\u7387","graph.dataBody":"\u30C7\u30FC\u30BF\u672C\u4F53","graph.reportTitle":"\u30B0\u30E9\u30D5\u30A3\u30C3\u30AF\u30EC\u30DD\u30FC\u30C8","graph.unassigned":"\u672A\u5272\u308A\u5F53\u3066","graph.column.reportHours":"\u5831\u544A\u6642\u9593","graph.column.billableHours":"\u8ACB\u6C42\u53EF\u80FD\u6642\u9593","detail.searchAi.placeholder":"\u9805\u76EE\u3092\u691C\u7D22\u3002\u898B\u3064\u304B\u3089\u306A\u3044\u5834\u5408\u306FAI\u306B\u8CEA\u554F\u3057\u307E\u3059...","detail.searchAi.matches":"{count} \u4EF6\u306E\u4E00\u81F4","detail.searchAi.noMatch":"\u4E00\u81F4\u3059\u308B\u9805\u76EE\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002","detail.searchAi.autoAiFallback":"\u4E00\u81F4\u306A\u3057\u3002AI\u5206\u6790\u3092\u5B9F\u884C\u3057\u307E\u3059...","detail.searchAi.aiResultTitle":"AI\u5206\u6790\u7D50\u679C","detail.table.title":"\u95A2\u9023\u30EC\u30B3\u30FC\u30C9","kanban.empty":"\u3053\u3053\u306B\u30AB\u30FC\u30C9\u3092\u30C9\u30ED\u30C3\u30D7","kanban.bucket.limit":"\u4E0A\u9650","kanban.bucket.dropHere":"\u96E2\u3059\u3068\u3053\u306E bucket \u306B\u79FB\u52D5\u3057\u307E\u3059","kanban.card.progress":"\u9032\u6357","kanban.card.openDetail":"\u8A73\u7D30\u3092\u958B\u304F","kanban.priority.critical":"\u7DCA\u6025","kanban.priority.high":"\u9AD8","kanban.priority.medium":"\u4E2D","kanban.priority.low":"\u4F4E","quickCreate.newItem":"\u65B0\u898F\u4F5C\u6210","quickCreate.createWithTitle":"{title} \u3092\u4F5C\u6210","quickEdit.editWithTitle":"{title} \u3092\u7DE8\u96C6","quickDelete.confirmTitle":"\u524A\u9664\u306E\u78BA\u8A8D","quickDelete.confirmMessageSingle":"\u9078\u629E\u3057\u305F\u30EC\u30B3\u30FC\u30C9\u3092\u524A\u9664\u3057\u3066\u3082\u3088\u308D\u3057\u3044\u3067\u3059\u304B\uFF1F","quickDelete.confirmMessageMultiple":"\u9078\u629E\u3057\u305F {count} \u4EF6\u306E\u30EC\u30B3\u30FC\u30C9\u3092\u524A\u9664\u3057\u3066\u3082\u3088\u308D\u3057\u3044\u3067\u3059\u304B\uFF1F","messageBox.confirm":"OK","messageBox.cancel":"\u30AD\u30E3\u30F3\u30BB\u30EB"},Wh={"common.cancel":"\uCDE8\uC18C","common.save":"\uC800\uC7A5","common.ok":"\uD655\uC778","common.done":"\uC644\uB8CC","common.search":"\uAC80\uC0C9","common.none":"\uC5C6\uC74C","common.all":"\uC804\uCCB4","common.noData":"\uB370\uC774\uD130 \uC5C6\uC74C","common.copy":"\uBCF5\uC0AC","common.delete":"\uC0AD\uC81C","common.loading":"\uB85C\uB529 \uC911...","header.searchPlaceholder":"\uBB34\uC5C7\uC774\uB4E0 \uBB3C\uC5B4\uBCF4\uC138\uC694...","header.searchAddFeature":"\uAE30\uB2A5 \uCD94\uAC00","header.searchSend":"\uBCF4\uB0B4\uAE30","header.searchStartVoice":"\uC74C\uC131 \uC785\uB825 \uC2DC\uC791","header.searchStopVoice":"\uC74C\uC131 \uC785\uB825 \uC911\uC9C0","header.theme.system":"\uD14C\uB9C8: \uC2DC\uC2A4\uD15C","header.theme.dark":"\uD14C\uB9C8: \uB2E4\uD06C","header.theme.light":"\uD14C\uB9C8: \uB77C\uC774\uD2B8","header.menu.setting":"\uC124\uC815","header.menu.logout":"\uB85C\uADF8\uC544\uC6C3","navigation.expand":"\uD0D0\uC0C9 \uD3BC\uCE58\uAE30","navigation.collapse":"\uD0D0\uC0C9 \uC811\uAE30","navigation.searchPlaceholder":"\uBA54\uB274 \uAC80\uC0C9...","navigation.noMatch":"\uC77C\uCE58\uD558\uB294 \uBA54\uB274\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4","navigation.noAccessibleApp":"\uC811\uADFC \uAC00\uB2A5\uD55C \uC571\uC774 \uC5C6\uC2B5\uB2C8\uB2E4","navigation.noItems":"\uD45C\uC2DC\uD560 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4","navigation.expandView":"{title} \uD3BC\uCE58\uAE30","navigation.mode.switchToFixed":"\uACE0\uC815 \uD0D0\uC0C9\uC73C\uB85C \uC804\uD658","navigation.mode.switchToFloating":"\uD50C\uB85C\uD305 \uD0D0\uC0C9\uC73C\uB85C \uC804\uD658","navigation.pinned":"\uACE0\uC815\uB428","navigation.pin.add":"\uC0C1\uB2E8\uC5D0 \uACE0\uC815","navigation.pin.remove":"\uACE0\uC815 \uD574\uC81C","table.toolbar.searchPlaceholder":"\uAC80\uC0C9...","table.title.default":"\uB370\uC774\uD130 \uD14C\uC774\uBE14","table.toolbar.groupBy":"\uADF8\uB8F9","table.toolbar.summary":"\uC694\uC57D","table.toolbar.columns":"\uC5F4","table.toolbar.export":"\uB0B4\uBCF4\uB0B4\uAE30","table.toolbar.itemsPerPage":"\uD398\uC774\uC9C0\uB2F9 \uD589 \uC218:","table.toolbar.pageOf":"{current} / {total} \uD398\uC774\uC9C0","table.toolbar.newItem":"\uC2E0\uADDC \uD56D\uBAA9","table.toolbar.editItem":"\uD56D\uBAA9 \uC218\uC815","table.toolbar.deleteItem":"\uD56D\uBAA9 \uC0AD\uC81C","table.toolbar.graphicReport":"\uADF8\uB798\uD504 \uB9AC\uD3EC\uD2B8","table.toolbar.saveLayout":"\uB808\uC774\uC544\uC6C3 \uC800\uC7A5","table.menu.groupBy":"\uADF8\uB8F9","table.menu.clearAll":"\uBAA8\uB450 \uC9C0\uC6B0\uAE30","table.menu.visibleColumns":"\uD45C\uC2DC \uC5F4","table.menu.showSummaryRow":"\uC694\uC57D \uD589 \uD45C\uC2DC","table.menu.noNumericColumns":"\uC22B\uC790 \uC5F4 \uC5C6\uC74C","table.group.expandAll":"\uBAA8\uB4E0 \uADF8\uB8F9 \uD3BC\uCE58\uAE30","table.group.collapseAll":"\uBAA8\uB4E0 \uADF8\uB8F9 \uC811\uAE30","table.mobile.notImplemented":"\uBAA8\uBC14\uC77C \uBDF0\uB294 \uC544\uC9C1 \uAD6C\uD604\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4","table.headerMenu.sortAsc":"\uC624\uB984\uCC28\uC21C \uC815\uB82C","table.headerMenu.sortDesc":"\uB0B4\uB9BC\uCC28\uC21C \uC815\uB82C","table.headerMenu.clearSort":"\uC815\uB82C \uD574\uC81C","table.headerMenu.configureSort":"\uC815\uB82C \uC124\uC815...","table.headerMenu.group":"\uC774 \uC5F4\uB85C \uADF8\uB8F9\uD654","table.headerMenu.ungroup":"\uADF8\uB8F9\uC5D0\uC11C \uC81C\uAC70","table.headerMenu.addSummary":"\uC694\uC57D\uC5D0 \uCD94\uAC00","table.headerMenu.removeSummary":"\uC694\uC57D\uC5D0\uC11C \uC81C\uAC70","table.headerMenu.hideColumn":"\uC5F4 \uC228\uAE30\uAE30","table.sortDialog.title":"\uC815\uB82C \uC124\uC815","table.sortDialog.empty":"\uC815\uB82C \uADDC\uCE59\uC774 \uC5C6\uC2B5\uB2C8\uB2E4. \uCD94\uAC00\uD558\uC138\uC694.","table.sortDialog.addRule":"\uADDC\uCE59 \uCD94\uAC00","table.sortDialog.clearAll":"\uBAA8\uB450 \uC9C0\uC6B0\uAE30","table.sortDialog.asc":"\uC624\uB984\uCC28\uC21C","table.sortDialog.desc":"\uB0B4\uB9BC\uCC28\uC21C","pivot.title.default":"\uD53C\uBC97 \uD14C\uC774\uBE14","pivot.subtitle.default":"\uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uD53C\uBC97 \uD14C\uC774\uBE14\uC744 \uAD6C\uC131\uD558\uC138\uC694.","pivot.empty":"\uACB0\uACFC\uB97C \uBCF4\uB824\uBA74 \uAC12 \uC601\uC5ED\uC5D0 \uCD5C\uC18C \uD55C \uAC1C\uC758 \uD544\uB4DC\uB97C \uCD94\uAC00\uD558\uC138\uC694.","pivot.records":"\uB808\uCF54\uB4DC","pivot.afterFilter":"\uD544\uD130 \uD6C4","pivot.grandTotal":"\uCD1D\uD569","pivot.resultLabel":"\uACB0\uACFC","pivot.valueLabel":"\uAC12","pivot.table.dimensions":"\uCC28\uC6D0","pivot.config.title":"\uAD6C\uC131","pivot.fieldList":"\uD544\uB4DC \uBAA9\uB85D","pivot.availableDimensions":"\uC0AC\uC6A9 \uAC00\uB2A5\uD55C \uCC28\uC6D0","pivot.allFieldsInUse":"\uBAA8\uB4E0 \uD544\uB4DC\uAC00 \uC774\uBBF8 \uC0AC\uC6A9 \uC911\uC785\uB2C8\uB2E4.","pivot.zone.rows":"\uD589","pivot.zone.columns":"\uC5F4","pivot.zone.filters":"\uD544\uD130","pivot.zone.values":"\uAC12","pivot.hint.rows":"\uC5EC\uAE30\uC5D0 \uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uD589 \uACC4\uCE35\uC744 \uAD6C\uC131","pivot.hint.columns":"\uC5EC\uAE30\uC5D0 \uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uC5F4 \uACC4\uCE35\uC744 \uAD6C\uC131","pivot.hint.filters":"\uC5EC\uAE30\uC5D0 \uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uBCF4\uACE0\uC11C \uD544\uD130\uB85C \uC0AC\uC6A9","pivot.hint.values":"\uC22B\uC790 \uD544\uB4DC\uB97C \uC5EC\uAE30\uC5D0 \uB4DC\uB798\uADF8\uD558\uC5EC \uC9D1\uACC4","pivot.clearArea":"\uC601\uC5ED \uBE44\uC6B0\uAE30","pivot.filter.na":"\uD574\uB2F9 \uC5C6\uC74C","pivot.filter.noValues":"\uAC12 \uC5C6\uC74C","pivot.filter.noneSelected":"\uC120\uD0DD \uC5C6\uC74C","pivot.filter.allValues":"\uBAA8\uB4E0 \uAC12","pivot.filter.selectedCount":"{selected} / {total} \uC120\uD0DD\uB428","pivot.filter.selectAll":"\uC804\uCCB4 \uC120\uD0DD","pivot.filter.deselectAll":"\uC804\uCCB4 \uD574\uC81C","pivot.filter.noResults":"\uAC80\uC0C9 \uACB0\uACFC \uC5C6\uC74C","pivot.collapse.ariaExpand":"\uAD6C\uC131 \uC601\uC5ED \uD3BC\uCE58\uAE30","pivot.collapse.ariaCollapse":"\uAD6C\uC131 \uC601\uC5ED \uC811\uAE30","pivot.agg.sum":"\uD569\uACC4","pivot.agg.count":"\uAC1C\uC218","pivot.agg.avg":"\uD3C9\uADE0","pivot.agg.min":"\uCD5C\uC18C","pivot.agg.max":"\uCD5C\uB300","pivot.preset.selectPlaceholder":"\uD504\uB9AC\uC14B \uC120\uD0DD","pivot.preset.save":"\uD504\uB9AC\uC14B \uC800\uC7A5","pivot.preset.delete":"\uD504\uB9AC\uC14B \uC0AD\uC81C","pivot.preset.saveDialogTitle":"\uD604\uC7AC \uD504\uB9AC\uC14B \uC800\uC7A5","pivot.preset.nameLabel":"\uD504\uB9AC\uC14B \uC774\uB984","pivot.preset.defaultName":"\uD504\uB9AC\uC14B {index}","pivot.table.sectionTitle":"\uD53C\uBC97 \uACB0\uACFC","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"\uD53C\uBC97 \uACB0\uACFC \uD3BC\uCE58\uAE30","pivot.table.collapse.ariaCollapse":"\uD53C\uBC97 \uACB0\uACFC \uC811\uAE30","pivot.chart.title":"\uD53C\uBC97 \uCC28\uD2B8","pivot.chart.subtitle":"\uD558\uB098\uC758 \uCC28\uC6D0\uACFC \uCD5C\uB300 \uB450 \uAC1C\uC758 \uCE21\uC815\uAC12\uC744 \uAC04\uACB0\uD55C \uCC28\uD2B8\uB85C \uD45C\uC2DC\uD569\uB2C8\uB2E4.","pivot.chart.subtitleReady":"{dimension}\uBCC4 {measure}","pivot.chart.emptyNoDimension":"\uCC28\uD2B8\uB97C \uBCF4\uB824\uBA74 \uCD5C\uC18C \uD55C \uAC1C\uC758 \uD589 \uB610\uB294 \uC5F4 \uD544\uB4DC\uB97C \uCD94\uAC00\uD558\uC138\uC694.","pivot.chart.emptyNoValue":"\uCC28\uD2B8\uB97C \uBCF4\uB824\uBA74 \uCD5C\uC18C \uD55C \uAC1C\uC758 \uAC12 \uD544\uB4DC\uB97C \uCD94\uAC00\uD558\uC138\uC694.","pivot.chart.emptyNoData":"\uD604\uC7AC \uCC28\uD2B8 \uC120\uD0DD\uC5D0 \uD45C\uC2DC\uD560 \uB370\uC774\uD130\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.","pivot.chart.dimension":"\uCC28\uD2B8 \uCC28\uC6D0","pivot.chart.primaryMeasure":"\uC8FC \uCE21\uC815\uAC12","pivot.chart.secondaryMeasure":"\uBE44\uAD50 \uCE21\uC815\uAC12","pivot.chart.chartType":"\uCC28\uD2B8 \uC720\uD615","pivot.chart.style.barVertical":"\uC138\uB85C \uB9C9\uB300","pivot.chart.style.barHorizontal":"\uAC00\uB85C \uB9C9\uB300","pivot.chart.style.line":"\uC120\uD615 \uCC28\uD2B8","pivot.chart.style.scatter":"\uC0B0\uC810\uB3C4","pivot.chart.collapse.ariaExpand":"\uCC28\uD2B8 \uC601\uC5ED \uD3BC\uCE58\uAE30","pivot.chart.collapse.ariaCollapse":"\uCC28\uD2B8 \uC601\uC5ED \uC811\uAE30","smartFilter.adaptFilters":"\uD544\uD130 \uC870\uC815","smartFilter.addFilters":"\uD544\uD130 \uCD94\uAC00","smartFilter.go":"\uC2E4\uD589","smartFilter.visibleFilters":"\uD45C\uC2DC \uD544\uD130","smartFilter.searchPlaceholder":"\uAC80\uC0C9...","smartFilter.noOptionsFound":"\uC635\uC158\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4","smartFilter.min":"\uCD5C\uC18C","smartFilter.max":"\uCD5C\uB300","smartFilter.minMaxPlaceholder":"\uCD5C\uC18C - \uCD5C\uB300","smartFilter.operator.equals":"\uAC19\uC74C","smartFilter.operator.contains":"\uD3EC\uD568","smartFilter.operator.notContains":"\uBBF8\uD3EC\uD568","smartFilter.operator.wildcard":"\uC640\uC77C\uB4DC\uCE74\uB4DC \uAC80\uC0C9","smartFilter.operator.notEquals":"\uAC19\uC9C0 \uC54A\uC74C","smartFilter.operator.greaterThan":"\uBCF4\uB2E4 \uD07C","smartFilter.operator.lessThan":"\uBCF4\uB2E4 \uC791\uC74C","smartFilter.operator.greaterOrEqual":"\uC774\uC0C1","smartFilter.operator.lessOrEqual":"\uC774\uD558","smartFilter.operator.between":"\uBC94\uC704","variant.noOptions":"\uC635\uC158 \uC5C6\uC74C","variant.defaultSuffix":"\uAE30\uBCF8","variant.selectVariant":"\uBDF0 \uC120\uD0DD","variant.saveView":"\uBDF0 \uC800\uC7A5","variant.newVariant":"\uC0C8 \uBDF0","variant.viewName":"\uBDF0 \uC774\uB984","variant.setDefault":"\uAE30\uBCF8\uC73C\uB85C \uC124\uC815","variant.publicAllUsers":"\uACF5\uAC1C(\uC804\uCCB4 \uC0AC\uC6A9\uC790)","variant.toast.fetchFailed":"\uBDF0\uB97C \uBD88\uB7EC\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.saveFailed":"\uBDF0\uB97C \uC800\uC7A5\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.saveSuccess":"\uBDF0\uAC00 \uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4","variant.toast.deleteFailed":"\uBDF0\uB97C \uC0AD\uC81C\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.deleteSuccess":"\uBDF0\uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4","variant.toast.defaultFailed":"\uAE30\uBCF8 \uBDF0\uB97C \uC5C5\uB370\uC774\uD2B8\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.defaultSuccess":"\uAE30\uBCF8 \uBDF0\uAC00 \uC5C5\uB370\uC774\uD2B8\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.saveLayout":"\uB808\uC774\uC544\uC6C3 \uC800\uC7A5","layout.layoutOptions":"\uB808\uC774\uC544\uC6C3 \uC635\uC158","layout.selectLayout":"\uB808\uC774\uC544\uC6C3 \uC120\uD0DD","layout.saveCurrentLayout":"\uD604\uC7AC \uB808\uC774\uC544\uC6C3 \uC800\uC7A5...","layout.noSavedLayouts":"\uC800\uC7A5\uB41C \uB808\uC774\uC544\uC6C3 \uC5C6\uC74C","layout.removeDefault":"\uAE30\uBCF8 \uD574\uC81C","layout.setAsDefault":"\uAE30\uBCF8\uC73C\uB85C \uC124\uC815","layout.layoutName":"\uB808\uC774\uC544\uC6C3 \uC774\uB984","layout.layoutDescription":"\uC124\uBA85","layout.layoutNameHelper":"\uC608: \uCEF4\uD329\uD2B8 \uBDF0","layout.warningOverwrite":"\uACBD\uACE0: \uAE30\uC874 \uB808\uC774\uC544\uC6C3\uC774 \uB36E\uC5B4\uC4F0\uAE30 \uB429\uB2C8\uB2E4","layout.useAsDefault":"\uAE30\uBCF8 \uB808\uC774\uC544\uC6C3\uC73C\uB85C \uC0AC\uC6A9","layout.publicAllUsers":"\uACF5\uAC1C(\uBAA8\uB4E0 \uC0AC\uC6A9\uC790\uC5D0\uAC8C \uD45C\uC2DC)","layout.toast.loadFallback":"\uBC31\uC5D4\uB4DC\uC5D0\uC11C \uB808\uC774\uC544\uC6C3\uC744 \uBD88\uB7EC\uC624\uC9C0 \uBABB\uD574 \uB85C\uCEEC \uC800\uC7A5\uC18C\uB85C \uC804\uD658\uD588\uC2B5\uB2C8\uB2E4","layout.toast.saveSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.saveLocalSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uB85C\uCEEC \uC800\uC7A5\uC18C\uC5D0 \uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.backendUnavailableSavedLocal":"\uBC31\uC5D4\uB4DC\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC5B4 \uB85C\uCEEC\uC5D0 \uC800\uC7A5\uD588\uC2B5\uB2C8\uB2E4","layout.toast.deleteSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.deleteLocalSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uB85C\uCEEC \uC800\uC7A5\uC18C\uC5D0\uC11C \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.backendUnavailableDeletedLocal":"\uBC31\uC5D4\uB4DC\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC5B4 \uB85C\uCEEC\uC5D0\uC11C \uC0AD\uC81C\uD588\uC2B5\uB2C8\uB2E4","layout.toast.defaultSuccess":"\uAE30\uBCF8 \uB808\uC774\uC544\uC6C3\uC774 \uC124\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.defaultLocalSuccess":"\uAE30\uBCF8 \uB808\uC774\uC544\uC6C3\uC774 \uB85C\uCEEC\uC5D0 \uC124\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.backendUnavailableDefaultLocal":"\uBC31\uC5D4\uB4DC\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC5B4 \uAE30\uBCF8\uAC12\uC744 \uB85C\uCEEC\uC5D0 \uC800\uC7A5\uD588\uC2B5\uB2C8\uB2E4","dateRange.label":"\uB0A0\uC9DC \uBC94\uC704","dateRange.startDate":"\uC2DC\uC791\uC77C","dateRange.endDate":"\uC885\uB8CC\uC77C","dateRange.select":"\uC120\uD0DD...","dateRange.today":"\uC624\uB298","dateRange.thisWeek":"\uC774\uBC88 \uC8FC","dateRange.thisMonth":"\uC774\uBC88 \uB2EC","graph.records":"{count}\uAC74","graph.kpi.totalRecords":"\uCD1D \uB808\uCF54\uB4DC","graph.kpi.totalReport":"\uCD1D \uBCF4\uACE0 \uC2DC\uAC04","graph.kpi.totalBillable":"\uCD1D \uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04","graph.kpi.efficiency":"\uD6A8\uC728","graph.kpi.amount":"\uAE08\uC561","graph.kpi.flagged":"\uD50C\uB798\uADF8","graph.chart.billable.title":"\uCC28\uC6D0\uBCC4 \uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04","graph.chart.billable.subtitle":"\uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04 \uC0C1\uC704 \uAC12","graph.chart.efficiency.title":"\uB2F4\uB2F9\uC790\uBCC4 \uD6A8\uC728","graph.chart.efficiency.subtitle":"\uB0AE\uC740 \uD6A8\uC728 \uC6B0\uC120","graph.chart.status.title":"\uC0C1\uD0DC \uBD84\uD3EC","graph.chart.status.subtitle":"\uC0C1\uD0DC\uBCC4 \uBE44\uC728","graph.dataBody":"\uB370\uC774\uD130 \uBCF8\uBB38","graph.reportTitle":"\uADF8\uB798\uD504 \uB9AC\uD3EC\uD2B8","graph.unassigned":"\uBBF8\uC9C0\uC815","graph.column.reportHours":"\uBCF4\uACE0 \uC2DC\uAC04","graph.column.billableHours":"\uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04","detail.searchAi.placeholder":"\uD544\uB4DC\uB97C \uAC80\uC0C9\uD558\uACE0, \uACB0\uACFC\uAC00 \uC5C6\uC73C\uBA74 AI\uC5D0 \uC9C8\uBB38\uD558\uC138\uC694...","detail.searchAi.matches":"{count}\uAC1C \uC77C\uCE58 \uD56D\uBAA9","detail.searchAi.noMatch":"\uC77C\uCE58\uD558\uB294 \uD544\uB4DC\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.","detail.searchAi.autoAiFallback":"\uC77C\uCE58 \uD56D\uBAA9\uC774 \uC5C6\uC5B4 AI \uBD84\uC11D\uC744 \uC2E4\uD589\uD569\uB2C8\uB2E4...","detail.searchAi.aiResultTitle":"AI \uBD84\uC11D \uACB0\uACFC","detail.table.title":"\uAD00\uB828 \uB808\uCF54\uB4DC","kanban.empty":"\uC5EC\uAE30\uC5D0 \uCE74\uB4DC\uB97C \uB193\uC73C\uC138\uC694","kanban.bucket.limit":"\uD55C\uB3C4","kanban.bucket.dropHere":"\uB193\uC73C\uBA74 \uC774 \uBC84\uD0B7\uC73C\uB85C \uC774\uB3D9\uD569\uB2C8\uB2E4","kanban.card.progress":"\uC9C4\uD589\uB960","kanban.card.openDetail":"\uC0C1\uC138 \uC5F4\uAE30","kanban.priority.critical":"\uAE34\uAE09","kanban.priority.high":"\uB192\uC74C","kanban.priority.medium":"\uBCF4\uD1B5","kanban.priority.low":"\uB0AE\uC74C","quickCreate.newItem":"\uC2E0\uADDC \uD56D\uBAA9","quickCreate.createWithTitle":"{title} \uC0DD\uC131","quickEdit.editWithTitle":"{title} \uC218\uC815","quickDelete.confirmTitle":"\uC0AD\uC81C \uD655\uC778","quickDelete.confirmMessageSingle":"\uC120\uD0DD\uD55C \uD56D\uBAA9\uC744 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?","quickDelete.confirmMessageMultiple":"\uC120\uD0DD\uD55C {count}\uAC1C \uD56D\uBAA9\uC744 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?","messageBox.confirm":"\uD655\uC778","messageBox.cancel":"\uCDE8\uC18C"},li={en:Lh,zh:Nh,fr:zh,de:Oh,ja:Vh,ko:Wh};var Cu=(e,t)=>t?e.replace(/\{(\w+)\}/g,(o,r)=>{let a=t[r];return a==null?"":String(a)}):e,Uh={locale:"en",t:(e,t)=>Cu(li.en[e]||e,t)},Su=Yt.createContext(Uh),ul=({locale:e="en",messages:t,children:o})=>{let r=Yt.useMemo(()=>{let a=li[e]||li.en,n=t?.[e]||{},i={...li.en,...a,...n};return {locale:e,t:(c,d)=>Cu(i[c]||c,d)}},[e,t]);return jsxRuntime.jsx(Su.Provider,{value:r,children:o})},le=()=>Yt.useContext(Su);function pc({items:e,onItemClick:t,className:o="",level:r=0,expandedIds:a,onToggleExpand:n,colorMode:i="light",enablePinning:c=false,pinnedIds:d,onTogglePin:l}){let{t:s}=le(),m=i==="dark",g=navigation.usePathname(),[p,b]=Yt.useState(false),[y,u]=Yt.useState(new Set),x=a!==void 0&&n!==void 0,f=x?a:y;Yt.useEffect(()=>{b(true);},[]);let h=S=>{if(x)n(S);else {let E=new Set(y);E.has(S)?E.delete(S):E.add(S),u(E);}},v=S=>{S.children&&S.children.length>0&&h(S.id),t&&t(S);};return !e||!Array.isArray(e)?jsxRuntime.jsx("div",{className:Io("tree-menu",o),children:jsxRuntime.jsx("div",{className:"text-sm text-gray-500 p-2",children:s("navigation.noItems")})}):jsxRuntime.jsx("div",{className:Io("tree-menu",o),children:e.map(S=>{let E=f.has(S.id)||S.isExpanded,P=S.children&&S.children.length>0,D=56+Math.max(0,r-1)*8,I=r===0?12:P?D-24:D,k=S.appurl||S.href,A=p&&k?g===k:false,T=d?.has(S.id)??false,R=c&&S.pinnable!==false&&!!k&&!P;return jsxRuntime.jsxs("div",{className:"tree-menu-item relative",children:[A&&jsxRuntime.jsx("div",{className:Io("absolute left-0 top-2 bottom-2 w-[3px] rounded-r-full z-10",m?"bg-[#90caf9]":"bg-[#1976d2]")}),jsxRuntime.jsxs(dc,{variant:"ghost",className:Io("w-full justify-start h-auto py-2 relative overflow-hidden group",r>0?"gap-1":"gap-2",P&&E&&!A?m?"bg-white/5 text-gray-100 hover:bg-white/8":"bg-slate-50/70 text-slate-800 hover:bg-slate-100/80":"",r>=2?"min-h-9 py-1.5 rounded-md":r>0?"min-h-10 rounded-lg":"rounded-lg",A?m?"bg-transparent text-[#90caf9] hover:bg-gray-800/35":"bg-transparent text-[#1976d2] hover:bg-gray-100/60":m?"hover:bg-gray-800/50 text-gray-300":"hover:bg-gray-100/50 text-gray-700"),style:{paddingLeft:`${I}px`,paddingRight:R?"34px":"10px"},onClick:()=>v(S),children:[P&&jsxRuntime.jsx("div",{className:Io("flex-shrink-0 transition-transform duration-200",E&&"rotate-90",A?m?"text-[#90caf9]":"text-[#1976d2]":m?"text-gray-500 group-hover:text-gray-300":"text-gray-400 group-hover:text-gray-600"),children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"h-4 w-4"})}),S.icon&&jsxRuntime.jsx("div",{className:Io("flex h-4 w-4 flex-shrink-0 items-center justify-center transition-colors duration-200",A?m?"text-[#90caf9]":"text-[#1976d2]":m?"text-gray-500 group-hover:text-gray-300":"text-gray-400 group-hover:text-gray-600"),children:S.icon}),jsxRuntime.jsxs("div",{className:"flex-1 text-left overflow-hidden z-10",children:[jsxRuntime.jsx("div",{className:Io("text-sm truncate transition-colors duration-200",A?"font-semibold":"font-medium"),children:S.title||S.label}),S.description&&jsxRuntime.jsx("div",{className:Io("text-xs truncate transition-colors duration-200",A?m?"text-[#90caf9]/70":"text-[#1976d2]/75":m?"text-gray-400":"text-gray-500"),title:S.description,children:S.description})]})]}),R&&l&&jsxRuntime.jsx("button",{type:"button","aria-label":s(T?"navigation.pin.remove":"navigation.pin.add"),"aria-pressed":T,title:s(T?"navigation.pin.remove":"navigation.pin.add"),onClick:M=>{M.preventDefault(),M.stopPropagation(),l(S);},className:Io("absolute right-1 top-1/2 z-20 flex h-7 w-7 -translate-y-1/2 items-center justify-center rounded-md transition-colors duration-150",T?m?"bg-[#90caf9]/14 text-[#90caf9] hover:bg-[#90caf9]/22":"bg-[#1976d2]/10 text-[#1976d2] hover:bg-[#1976d2]/16":m?"text-gray-500 hover:bg-gray-800/70 hover:text-gray-200":"text-gray-400 hover:bg-gray-100 hover:text-gray-700"),children:jsxRuntime.jsx(lucideReact.Pin,{className:Io("h-3.5 w-3.5",T&&"fill-current")})}),P&&jsxRuntime.jsx("div",{className:Io("grid transition-[grid-template-rows] duration-300 ease-in-out",E?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:jsxRuntime.jsx("div",{className:Io("overflow-hidden",E&&"pt-1"),children:jsxRuntime.jsx(pc,{items:S.children,onItemClick:t,level:r+1,expandedIds:a,onToggleExpand:n,colorMode:i,enablePinning:c,pinnedIds:d,onTogglePin:l})})})]},S.id)})})}var Jh="orbcafe:navigation-island:pinned-items",mc="orbcafe-navigation-pinned",eb=e=>e.appurl||e.href,Tu=e=>{let t=[];return e.forEach(o=>{let r=!!o.children?.length;o.pinnable!==false&&eb(o)&&!r&&t.push({...o,children:void 0}),o.children?.length&&t.push(...Tu(o.children));}),t},gc=({collapsed:e,onToggle:t,className:o="",maxHeight:r,menuData:a=[],colorMode:n="light",displayMode:i="fixed",onDisplayModeChange:c,showDisplayModeToggle:d=true,enablePinning:l=true,pinStorageKey:s=Jh,pinnedItemIds:m,defaultPinnedItemIds:g=[],onPinnedItemIdsChange:p,pinnedSectionTitle:b})=>{let{t:y}=le(),u=n==="dark",x=i==="floating",f=Yt__namespace.default.useId().replace(/:/g,""),h=`orbcafe-nav-mode-arc-${f}`,v=`orbcafe-nav-mode-glow-${f}`,S=navigation.useRouter(),[E,P]=Yt.useState(""),[w,D]=Yt.useState(new Set),[I,k]=Yt.useState(g),[A,T]=Yt.useState(false),R=m!==void 0,M=Yt.useMemo(()=>m??I,[m,I]),Z=Yt.useMemo(()=>new Set(M),[M]);Yt.useEffect(()=>{e&&D(new Set);},[e]),Yt.useEffect(()=>{if(!l||R){T(true);return}try{let te=window.localStorage.getItem(s);if(te){let j=JSON.parse(te);Array.isArray(j)&&k(j.filter(Y=>typeof Y=="string"));}}catch{}finally{T(true);}},[l,R,s]),Yt.useEffect(()=>{if(!(!l||R||!A))try{window.localStorage.setItem(s,JSON.stringify(M));}catch{}},[M,l,R,s,A]),Yt.useEffect(()=>{!l||e||M.length===0||D(te=>{if(te.has(mc))return te;let j=new Set(te);return j.add(mc),j});},[e,M.length,l]);let L=Yt.useCallback(te=>{let j=Array.from(new Set(te));R||k(j),p?.(j);},[R,p]),ee=Yt.useCallback(te=>{let j=te.id,Y=Z.has(j)?M.filter(de=>de!==j):[...M,j];L(Y);},[M,Z,L]),H=Yt.useMemo(()=>{if(!l||M.length===0)return a;let te=new Map(Tu(a).map(Y=>[Y.id,Y])),j=M.map(Y=>te.get(Y)).filter(Y=>!!Y);return j.length===0?a:[{id:mc,title:b||y("navigation.pinned"),icon:jsxRuntime.jsx(lucideReact.Pin,{className:"w-4 h-4"}),children:j,pinnable:false},...a]},[M,l,a,b,y]),q=Yt.useCallback(te=>{let j=[],Y=de=>{de.forEach(We=>{j.push(We.id),We.children&&Y(We.children);});};return Y(te),j},[]),$=Yt.useMemo(()=>{if(!E.trim())return H;let te=j=>j.reduce((Y,de)=>{let We=de.title?.toLowerCase().includes(E.toLowerCase())||de.description?.toLowerCase().includes(E.toLowerCase()),$e=de.children?te(de.children):[];return (We||$e.length>0)&&Y.push({...de,children:$e.length>0?$e:de.children}),Y},[]);return te(H)},[E,H]),ie=Yt.useMemo(()=>E.trim()?new Set(q(H)):w,[E,H,w,q]),ue=Yt.useCallback(async te=>{if(console.log("\u{1F5B1}\uFE0F \u5BFC\u822A\u83DC\u5355\u9879\u70B9\u51FB:",te),te.id==="chat"||te.appurl==="/chat"){console.log("\u{1F4AC} \u68C0\u6D4B\u5230chat\u83DC\u5355\u70B9\u51FB\uFF0C\u8DF3\u8F6C\u5230\u65B0\u7684\u804A\u5929\u89C6\u56FE");try{S.push("/chat?new=true");}catch(Y){console.error("\u274C \u65E0\u6CD5\u8DF3\u8F6C\u5230\u65B0\u804A\u5929\u89C6\u56FE:",Y),S.push("/chat");}return}let j=te.appurl||te.href;j&&(j.startsWith("http://")||j.startsWith("https://")?window.open(j,"_blank"):S.push(j));},[S]),Ce=Yt.useCallback(()=>{c?.(i==="fixed"?"floating":"fixed");},[i,c]);return jsxRuntime.jsxs("div",{className:`flex flex-col backdrop-blur-xl border ${x?"shadow-[0_28px_80px_rgba(15,23,42,0.34)]":"shadow-[0_4px_8px_0_rgba(31,38,135,0.1)]"} ${e?"w-14 rounded-full":"w-[234px] rounded-2xl"} relative ${o} ${u?x?"border-white/25":"bg-[#111111] border-white/10":x?"border-white/70":"bg-white/70 border-white/30"}`,style:{backdropFilter:x?"blur(34px) saturate(230%) contrast(1.12)":"blur(16px) saturate(180%)",WebkitBackdropFilter:x?"blur(34px) saturate(230%) contrast(1.12)":"blur(16px) saturate(180%)",backgroundColor:x?u?"rgba(8, 12, 18, 0.34)":"rgba(255, 255, 255, 0.24)":void 0,backgroundImage:x?u?"radial-gradient(circle at 28% 8%, rgba(255,255,255,0.14), rgba(255,255,255,0) 44%), linear-gradient(145deg, rgba(255,255,255,0.08), rgba(255,255,255,0.015) 50%, rgba(33,188,255,0.05))":"radial-gradient(circle at 28% 8%, rgba(255,255,255,0.42), rgba(255,255,255,0) 46%), linear-gradient(145deg, rgba(255,255,255,0.22), rgba(255,255,255,0.07) 50%, rgba(33,188,255,0.08))":void 0,boxShadow:x?u?"inset 0 1px 0 rgba(255,255,255,0.20), inset 0 -1px 0 rgba(255,255,255,0.08), 0 26px 90px rgba(0,0,0,0.52), 0 0 0 1px rgba(255,255,255,0.06)":"inset 0 1px 0 rgba(255,255,255,0.88), inset 0 -1px 0 rgba(255,255,255,0.34), 0 26px 90px rgba(15,23,42,0.24), 0 0 0 1px rgba(255,255,255,0.35)":void 0,transition:"width 400ms cubic-bezier(0.4, 0.0, 0.2, 1), border-radius 0ms cubic-bezier(0.4, 0.0, 0.2, 1), box-shadow 400ms ease-out, background-color 220ms ease-out, backdrop-filter 220ms ease-out",maxHeight:r?`${r}px`:void 0},children:[jsxRuntime.jsx("div",{className:`pt-4 pb-2 transition-all duration-500 ease-in-out ${e?"px-1":"px-2"}`,children:e?jsxRuntime.jsx("div",{className:"flex justify-center",children:jsxRuntime.jsx("button",{onClick:t,className:`w-10 h-10 flex items-center justify-center rounded-lg transition-colors duration-200 ${u?"text-gray-300 hover:bg-gray-800":"text-gray-500 hover:bg-gray-50"}`,title:y("navigation.expand"),children:jsxRuntime.jsx(lucideReact.Search,{className:"h-5 w-5"})})}):jsxRuntime.jsxs("div",{className:`relative transition-opacity duration-300 ${e?"opacity-0":"opacity-100 delay-200"}`,children:[jsxRuntime.jsx("input",{type:"text",placeholder:y("navigation.searchPlaceholder"),value:E,onChange:te=>P(te.target.value),className:`w-full pl-10 pr-4 py-2 text-sm border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent ${u?"border-gray-700 bg-[#1A1A1A] text-white placeholder-gray-400":"border-gray-300 bg-white text-gray-900 placeholder-gray-500"}`}),jsxRuntime.jsx("div",{className:"absolute left-3 top-1/2 transform -translate-y-1/2 pointer-events-none",children:jsxRuntime.jsx(lucideReact.Search,{className:`h-4 w-4 ${u?"text-gray-500":"text-gray-400"}`})})]})}),jsxRuntime.jsx("nav",{className:`flex-1 pb-4 transition-all duration-500 ease-in-out overflow-y-auto min-h-0 ${e?"px-1":"px-2"}`,children:$.length===0?jsxRuntime.jsx("div",{className:"flex items-center justify-center py-8 text-gray-500 text-sm",children:e?"\u{1F4C2}":y(E?"navigation.noMatch":"navigation.noAccessibleApp")}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[!e&&jsxRuntime.jsx("div",{className:`transition-opacity duration-300 ${e?"opacity-0":"opacity-100 delay-200"}`,children:jsxRuntime.jsx(pc,{items:$,onItemClick:ue,className:"space-y-1",expandedIds:ie,colorMode:n,enablePinning:l,pinnedIds:Z,onTogglePin:ee,onToggleExpand:te=>{let j=new Set(w);$.some(de=>de.id===te)?j.has(te)?j.delete(te):($.forEach(de=>{de.id!==te&&j.has(de.id)&&j.delete(de.id);}),j.add(te)):j.has(te)?j.delete(te):j.add(te),D(j);}})}),e&&jsxRuntime.jsx("div",{className:"space-y-2",children:H.map(te=>jsxRuntime.jsx("div",{className:"space-y-1",children:jsxRuntime.jsx("button",{onClick:()=>{t();let j=new Set([te.id]);D(j);},className:`w-full flex items-center justify-center p-2 rounded-lg cursor-pointer transition-colors duration-200 ${u?"text-gray-400 hover:bg-gray-800":"text-gray-600 hover:bg-gray-50"}`,title:y("navigation.expandView",{title:te.title||""}),children:te.icon||jsxRuntime.jsx("div",{className:`w-6 h-6 rounded text-xs flex items-center justify-center font-medium ${u?"bg-[#90caf9] text-[#0b0b0b]":"bg-[#1976d2] text-white"}`,children:te.title?.charAt(0)||"?"})})},te.id))})]})}),!e&&jsxRuntime.jsx("button",{onClick:t,className:`absolute -bottom-1 -right-1 w-6 h-6 bg-transparent rounded-full flex items-center justify-center transition-all duration-300 ease-in-out z-20 ${u?"hover:bg-gray-800/50":"hover:bg-white/20"}`,title:y("navigation.collapse"),children:jsxRuntime.jsx("div",{className:"absolute",style:{bottom:"0px",right:"0px",width:"16px",height:"16px",overflow:"hidden"},children:jsxRuntime.jsx("div",{className:u?"border-yellow-400":"",style:{width:"32px",height:"32px",borderRadius:"16px",border:"3px solid #21BCFF",backgroundColor:"transparent",position:"absolute",top:"-16px",left:"-16px"}})})}),d&&e&&jsxRuntime.jsx("button",{type:"button",onClick:Ce,className:"absolute -bottom-5 left-1/2 z-30 flex h-11 -translate-x-1/2 items-end justify-center rounded-full bg-transparent px-2 pb-1 transition-opacity duration-200 hover:opacity-95 focus:outline-none focus:ring-2 focus:ring-cyan-400/70",style:{width:"62px",touchAction:"manipulation"},title:y(x?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),"aria-label":y(x?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),children:jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 118 34",preserveAspectRatio:"none",className:"h-[34px] w-full overflow-visible",children:[jsxRuntime.jsxs("defs",{children:[jsxRuntime.jsxs("linearGradient",{id:h,x1:"0",x2:"1",y1:"0",y2:"0",children:[jsxRuntime.jsx("stop",{offset:"0%",stopColor:"#21BCFF"}),jsxRuntime.jsx("stop",{offset:"52%",stopColor:"#7C3AED"}),jsxRuntime.jsx("stop",{offset:"100%",stopColor:"#F59E0B"})]}),jsxRuntime.jsxs("filter",{id:v,x:"-70%",y:"-180%",width:"240%",height:"460%",children:[jsxRuntime.jsx("feGaussianBlur",{stdDeviation:"8.5",result:"coloredBlur"}),jsxRuntime.jsxs("feMerge",{children:[jsxRuntime.jsx("feMergeNode",{in:"coloredBlur"}),jsxRuntime.jsx("feMergeNode",{in:"SourceGraphic"})]})]})]}),jsxRuntime.jsx("path",{d:"M8 4 C27 21 91 21 110 4",fill:"none",stroke:`url(#${h})`,strokeLinecap:"round",strokeWidth:"18",opacity:x?.28:.2,filter:`url(#${v})`}),jsxRuntime.jsx("path",{d:"M8 4 C27 21 91 21 110 4",fill:"none",stroke:`url(#${h})`,strokeLinecap:"round",strokeWidth:"12",opacity:x?.4:.3,filter:`url(#${v})`}),jsxRuntime.jsx("path",{d:"M8 4 C27 21 91 21 110 4",fill:"none",stroke:`url(#${h})`,strokeLinecap:"round",strokeWidth:"6",opacity:x?.34:.25,filter:`url(#${v})`}),jsxRuntime.jsx("path",{d:"M8 4 C27 21 91 21 110 4",fill:"none",stroke:`url(#${h})`,strokeLinecap:"round",strokeWidth:"1",opacity:x?.28:.18})]})})]})};var Pu=(e={})=>{let{initialCollapsed:t=false,initialDisplayMode:o="fixed",content:r=[],enablePinning:a,pinStorageKey:n,pinnedItemIds:i,defaultPinnedItemIds:c,onPinnedItemIdsChange:d,pinnedSectionTitle:l}=e,[s,m]=Yt.useState(t),[g,p]=Yt.useState(o),[b,y]=Yt.useState(r),u=Yt.useCallback(()=>{m(h=>!h);},[]),x=Yt.useCallback(()=>{p(h=>h==="fixed"?"floating":"fixed");},[]),f=Yt.useMemo(()=>({collapsed:s,onToggle:u,menuData:b,displayMode:g,onDisplayModeChange:p,enablePinning:a,pinStorageKey:n,pinnedItemIds:i,defaultPinnedItemIds:c,onPinnedItemIdsChange:d,pinnedSectionTitle:l}),[s,u,b,g,p,a,n,i,c,d,l]);return {collapsed:s,setCollapsed:m,toggleCollapsed:u,displayMode:g,setDisplayMode:p,toggleDisplayMode:x,menuData:b,setMenuData:y,navigationIslandProps:f}};var ur=e=>jsxRuntime.jsx(material.Button,{...e,variant:e.variant||"contained",size:e.size||"medium",sx:{textTransform:"none",...e.sx}});var hc=class{constructor(){yu(this,"listener",null);}register(t){this.listener=t;}unregister(){this.listener=null;}show(t,o,r){this.listener&&this.listener({type:t,content:o,options:r});}hide(){this.listener&&this.listener(null);}},Vr=new hc,QP={success:(e,t)=>Vr.show("success",e,t),error:(e,t)=>Vr.show("error",e,t),warning:(e,t)=>Vr.show("warning",e,t),info:(e,t)=>Vr.show("info",e,t),show:(e,t,o)=>Vr.show(e,t,o),hide:()=>Vr.hide()};var fb={success:{icon:jsxRuntime.jsx(ub__default.default,{sx:{fontSize:40}}),color:"#e8f5e9",iconColor:"#66bb6a",borderColor:"#a5d6a7"},warning:{icon:jsxRuntime.jsx(pb__default.default,{sx:{fontSize:40}}),color:"#fff3e0",iconColor:"#ffa726",borderColor:"#ffcc80"},error:{icon:jsxRuntime.jsx(mb__default.default,{sx:{fontSize:40}}),color:"#ffebee",iconColor:"#ef5350",borderColor:"#ef9a9a"},info:{icon:jsxRuntime.jsx(gb__default.default,{sx:{fontSize:40}}),color:"#e3f2fd",iconColor:"#42a5f5",borderColor:"#90caf9"},default:{icon:null,color:"transparent",iconColor:"inherit",borderColor:"transparent"}},di=({open:e,title:t,message:o,onClose:r,onConfirm:a,confirmText:n,cancelText:i,showCancel:c=true,maxWidth:d="xs",type:l="default"})=>{let{t:s}=le(),m=n||s("messageBox.confirm"),g=i||s("messageBox.cancel"),p=()=>{a?a():r();},b=fb[l],y=l!=="default";return jsxRuntime.jsxs(om__default.default,{open:e,onClose:r,maxWidth:d,fullWidth:true,PaperProps:{sx:{borderRadius:3,...y&&{borderTop:`6px solid ${b.iconColor}`}}},children:[y&&jsxRuntime.jsx(Di__default.default,{sx:{display:"flex",justifyContent:"center",pt:3,color:b.iconColor},children:b.icon}),t&&jsxRuntime.jsx(rm__default.default,{sx:{textAlign:y?"center":"left",pt:y?1:2},children:t}),jsxRuntime.jsx(am__default.default,{sx:{textAlign:y?"center":"left"},children:typeof o=="string"?jsxRuntime.jsx(sb__default.default,{children:o}):o}),jsxRuntime.jsxs(nm__default.default,{sx:{justifyContent:y?"center":"flex-end",pb:3,px:3},children:[c&&jsxRuntime.jsx(ur,{onClick:r,variant:"text",color:"inherit",children:g}),jsxRuntime.jsx(ur,{onClick:p,variant:"contained",sx:{bgcolor:y?b.iconColor:void 0,"&:hover":{bgcolor:y?b.iconColor:void 0,filter:"brightness(0.9)"}},autoFocus:true,children:m})]})]})},fR=()=>{let[e,t]=Yt__namespace.default.useState(null),[o,r]=Yt__namespace.default.useState(false);Yt__namespace.default.useEffect(()=>{let i=c=>{c?(t(c),r(true)):(r(false),t(null));};return Vr.register(i),()=>Vr.unregister()},[]);let a=()=>{r(false),e?.options?.onClose&&e.options.onClose(),t(null);},n=()=>{e?.options?.onConfirm&&e.options.onConfirm(),r(false),t(null);};return e?jsxRuntime.jsx(di,{open:o,type:e.type,message:e.content,title:e.options?.title,onClose:a,onConfirm:n,confirmText:e.options?.confirmText,cancelText:e.options?.cancelText,showCancel:e.options?.showCancel,maxWidth:e.options?.maxWidth}):null};var Mb=[{field:"value",label:"Value",minWidth:120},{field:"label",label:"Description",minWidth:180}],Nu=e=>Array.isArray(e)?e:e==null||e===""?[]:[e],Uo=e=>String(e),zu=(e,t)=>e[t],Ou=e=>{let t=e.value??e.id??e.key??e.code;return typeof t=="number"||typeof t=="string"?t:""},Db=e=>{let t=e.label??e.description??e.name??e.title;return String(typeof t=="number"||typeof t=="string"?t:Ou(e))},Ab=e=>{let t=e.description??e.subtitle;return typeof t=="number"||typeof t=="string"?String(t):void 0},Vu=({value:e=null,items:t=[],columns:o,mode:r="single",dialogTitle:a="Value Help",searchPlaceholder:n="Search values...",selectLabel:i="Select",clearLabel:c="Clear",cancelLabel:d="Cancel",valueHelpLabel:l="Open value help",noResultsText:s="No matching values",loading:m=false,clearable:g=true,allowManualInput:p=true,validateManualInput:b=true,manualInputErrorText:y="Enter a valid value.",selectedItems:u=[],displayValue:x,getOptionValue:f=Ou,getOptionLabel:h=Db,getOptionDescription:v=Ab,onChange:S,onSearch:E,disabled:P,InputProps:w,onFocus:D,onBlur:I,onKeyDown:k,error:A,helperText:T,...R})=>{let M=r==="multiple",[Z,L]=Yt.useState(false),[ee,H]=Yt.useState(false),[q,$]=Yt.useState(""),[ie,ue]=Yt.useState(null),[Ce,te]=Yt.useState(false),[j,Y]=Yt.useState(()=>Nu(e)),[de,We]=Yt.useState(""),[$e,me]=Yt.useState(""),Ne=Yt.useMemo(()=>o&&o.length>0?o:Mb,[o]),rt=ie??t,he=Yt.useMemo(()=>{let F=[...u,...t,...ie??[]],re=new Map;return F.forEach(ve=>{re.set(Uo(f(ve)),ve);}),re},[f,t,ie,u]),Le=Yt.useMemo(()=>Nu(e),[e]),He=Yt.useMemo(()=>Le.map(String).join(", "),[Le]);Yt.useEffect(()=>{Z||Y(Le);},[Z,Le]),Yt.useEffect(()=>{!ee&&!$e&&We(He);},[ee,He,$e]);let Xe=Yt.useMemo(()=>{let F=q.trim().toLowerCase();if(!F||E)return rt;let re=Ne.filter(ve=>ve.searchable!==false);return rt.filter(ve=>[f(ve),h(ve),v(ve),...re.map(Ke=>zu(ve,Ke.field))].some(Ke=>String(Ke??"").toLowerCase().includes(F)))},[rt,v,h,f,E,q,Ne]),qe=Yt.useMemo(()=>{if(x!==void 0)return x;if(Le.length===0)return "";let F=re=>{let ve=he.get(Uo(re));if(!ve)return String(re);let Se=h(ve);return Se&&Se!==String(re)?`${re} - ${Se}`:String(re)};return M?Le.length>2?`${Le.length} selected`:Le.map(F).join(", "):F(Le[0])},[x,h,M,he,Le]),K=Yt.useCallback(async()=>{if(E){te(true);try{let F=await E(q);Array.isArray(F)&&ue(F);}finally{te(false);}}},[E,q]),Fe=()=>{P||(Y(Le),L(true));},be=()=>{L(false);},ke=()=>{S?.(M?[]:null,M?[]:null),Y([]),We(""),me("");},et=F=>{let re=f(F);if(M){Y(ve=>ve.some(Ke=>Uo(Ke)===Uo(re))?ve.filter(Ke=>Uo(Ke)!==Uo(re)):[...ve,re]);return}Y([re]);},Te=()=>{let F=j.map(re=>he.get(Uo(re))).filter(re=>!!re);M?S?.(j,F):S?.(j[0]??null,F[0]??null),me(""),L(false);},lt=F=>{if(F.key==="F4"){F.preventDefault(),Fe();return}if(F.key==="Enter"&&p&&!Mt(de,true)){F.preventDefault();return}k?.(F);},Ct=F=>b?F.every(re=>he.has(Uo(re))):true,Mt=(F,re)=>{if(M){let Se=F.split(/[,;\n]/).map(st=>st.trim()).filter(Boolean);if(Se.length===0)return me(""),S?.([],[]),true;if(!Ct(Se))return re&&me(y),false;me("");let Ke=Se.map(st=>he.get(Uo(st))).filter(st=>!!st);return S?.(Se,Ke),true}let ve=F.trim();return ve?Ct([ve])?(me(""),S?.(ve,he.get(Uo(ve))??null),true):(re&&me(y),false):(me(""),S?.(null,null),true)},Jt=F=>{if(!p)return;let re=F.target.value;We(re),me(""),Mt(re,false);},X=m||Ce,_e=Le.length>0;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.TextField,{...R,disabled:P,value:p&&(ee||!!$e)?de:qe,error:!!$e||A,helperText:$e||T,onChange:Jt,onFocus:F=>{H(true),We(He),D?.(F);},onBlur:F=>{p&&Mt(de,true),H(false),I?.(F);},onKeyDown:lt,InputProps:{...w,readOnly:!p,endAdornment:jsxRuntime.jsxs(material.InputAdornment,{position:"end",children:[X?jsxRuntime.jsx(material.CircularProgress,{size:18}):null,g&&_e&&!P?jsxRuntime.jsx(material.Tooltip,{title:c,children:jsxRuntime.jsx(material.IconButton,{size:"small",edge:"end","aria-label":c,onClick:ke,children:jsxRuntime.jsx(Pb__default.default,{fontSize:"small"})})}):null,jsxRuntime.jsx(material.Tooltip,{title:l,children:jsxRuntime.jsx("span",{children:jsxRuntime.jsx(material.IconButton,{size:"small",edge:"end","aria-label":l,onClick:Fe,disabled:P,children:jsxRuntime.jsx(Lu__default.default,{fontSize:"small"})})})})]})}}),jsxRuntime.jsxs(material.Dialog,{open:Z,onClose:be,fullWidth:true,maxWidth:"md",PaperProps:{sx:F=>({borderRadius:2,overflow:"hidden",border:`1px solid ${F.palette.divider}`,boxShadow:F.palette.mode==="dark"?`0 24px 80px ${styles.alpha(F.palette.common.black,.72)}`:`0 24px 80px ${styles.alpha(F.palette.common.black,.18)}`})},children:[jsxRuntime.jsxs(material.DialogTitle,{sx:F=>({display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,px:2.5,py:2,pr:1.5,borderBottom:`1px solid ${F.palette.divider}`,bgcolor:F.palette.background.paper}),children:[jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1.05rem",fontWeight:800,lineHeight:1.25},children:a}),M?jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",sx:{mt:.25},children:`${j.length} selected`}):null]}),jsxRuntime.jsx(material.IconButton,{"aria-label":"Close",onClick:be,size:"small",children:jsxRuntime.jsx(Rb__default.default,{fontSize:"small"})})]}),jsxRuntime.jsxs(material.DialogContent,{sx:{p:0},children:[jsxRuntime.jsxs(material.Stack,{direction:{xs:"column",sm:"row"},spacing:1,sx:F=>({px:2.5,py:1.5,borderBottom:`1px solid ${F.palette.divider}`,bgcolor:F.palette.mode==="dark"?styles.alpha(F.palette.common.white,.025):styles.alpha(F.palette.primary.main,.035)}),children:[jsxRuntime.jsx(material.TextField,{size:"small",fullWidth:true,value:q,placeholder:n,onChange:F=>$(F.target.value),onKeyDown:F=>{F.key==="Enter"&&(F.preventDefault(),K());},InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(Lu__default.default,{fontSize:"small"})}),sx:F=>({borderRadius:1,bgcolor:F.palette.background.paper,"& fieldset":{borderColor:styles.alpha(F.palette.text.primary,F.palette.mode==="dark"?.2:.16)},"&:hover fieldset":{borderColor:styles.alpha(F.palette.primary.main,.52)},"&.Mui-focused fieldset":{borderColor:F.palette.primary.main}})}}),E?jsxRuntime.jsx(material.Button,{variant:"outlined",onClick:()=>{K();},disabled:X,sx:{minWidth:96,textTransform:"none",fontWeight:700},children:X?jsxRuntime.jsx(material.CircularProgress,{size:18}):"Search"}):null]}),jsxRuntime.jsx(material.TableContainer,{sx:{maxHeight:420},children:jsxRuntime.jsxs(material.Table,{stickyHeader:true,size:"small",children:[jsxRuntime.jsx(material.TableHead,{children:jsxRuntime.jsxs(material.TableRow,{children:[jsxRuntime.jsx(material.TableCell,{padding:"checkbox",sx:F=>({bgcolor:F.palette.mode==="dark"?"#111111":F.palette.background.paper,borderBottom:`1px solid ${F.palette.divider}`})}),Ne.map(F=>jsxRuntime.jsx(material.TableCell,{align:F.align,sx:re=>({minWidth:F.minWidth,width:F.width,fontSize:"0.78rem",fontWeight:800,bgcolor:re.palette.mode==="dark"?"#111111":re.palette.background.paper,borderBottom:`1px solid ${re.palette.divider}`}),children:F.label},String(F.field)))]})}),jsxRuntime.jsxs(material.TableBody,{children:[Xe.map(F=>{let re=f(F),ve=j.some(Se=>Uo(Se)===Uo(re));return jsxRuntime.jsxs(material.TableRow,{hover:true,selected:ve,onClick:()=>et(F),onDoubleClick:()=>{M||(Y([re]),S?.(re,F),L(false));},sx:Se=>({cursor:"pointer","&.Mui-selected":{bgcolor:styles.alpha(Se.palette.primary.main,Se.palette.mode==="dark"?.22:.12)},"&.Mui-selected:hover":{bgcolor:styles.alpha(Se.palette.primary.main,Se.palette.mode==="dark"?.28:.18)}}),children:[jsxRuntime.jsx(material.TableCell,{padding:"checkbox",children:jsxRuntime.jsx(material.Checkbox,{size:"small",checked:ve})}),Ne.map(Se=>{let Ke=zu(F,Se.field);return jsxRuntime.jsx(material.TableCell,{align:Se.align,sx:{fontSize:"0.82rem",py:1},children:Se.render?Se.render(Ke,F):String(Ke??"")},String(Se.field))})]},Uo(re))}),Xe.length===0?jsxRuntime.jsx(material.TableRow,{children:jsxRuntime.jsx(material.TableCell,{colSpan:Ne.length+1,children:jsxRuntime.jsx(material.Box,{sx:{py:5,textAlign:"center",color:"text.secondary"},children:s})})}):null]})]})})]}),jsxRuntime.jsxs(material.DialogActions,{sx:F=>({px:2.5,py:1.5,borderTop:`1px solid ${F.palette.divider}`,bgcolor:F.palette.background.paper,"& .MuiButton-root":{textTransform:"none",fontWeight:700}}),children:[g&&(_e||j.length>0)?jsxRuntime.jsx(material.Button,{onClick:ke,children:c}):null,jsxRuntime.jsx(material.Box,{sx:{flex:1}}),jsxRuntime.jsx(material.Button,{onClick:be,children:d}),jsxRuntime.jsx(material.Button,{variant:"contained",onClick:Te,disabled:!M&&j.length===0,children:i})]})]})]})};var Wu=({title:e,hideHeader:t,children:o})=>jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[!t&&jsxRuntime.jsx(material.Box,{sx:{mb:2},children:jsxRuntime.jsx(material.Typography,{variant:"h4",children:e})}),jsxRuntime.jsx(material.Box,{sx:{flex:1,overflow:"hidden"},children:o})]});var Pa={width:56,minWidth:56,maxWidth:56,paddingLeft:"4px !important",paddingRight:"4px !important",paddingTop:"0 !important",paddingBottom:"0 !important",textAlign:"center",verticalAlign:"middle",boxSizing:"border-box"},Tr={width:72,minWidth:72,maxWidth:72,paddingLeft:"4px !important",paddingRight:"4px !important",paddingTop:"0 !important",paddingBottom:"0 !important",textAlign:"center",verticalAlign:"middle",boxSizing:"border-box"},pi={width:30,height:30,p:.25,flex:"0 0 auto","& .MuiSvgIcon-root":{fontSize:20}},Ir={width:30,height:30,minWidth:30,minHeight:30,p:.25,flex:"0 0 auto","& .MuiSvgIcon-root":{fontSize:20}},Hu={display:"flex",alignItems:"center",justifyContent:"center",gap:.25,width:"100%",minWidth:0},or={...Ir,borderRadius:1};var fl=e=>{let{t}=le(),o="0.85rem",r=Array.isArray(e.actions)?e.actions:e.actions?[e.actions]:[],a=Array.isArray(e.extraTools)?e.extraTools:e.extraTools?[e.extraTools]:[],n=[...r,...a],i=typeof e.rowsPerPage=="number"?e.rowsPerPage:20,c=Array.isArray(e.rowsPerPageOptions)&&e.rowsPerPageOptions.length>0?e.rowsPerPageOptions:[20,50,100,-1],d=typeof e.count=="number"?e.count:0,l=Math.max(0,typeof e.page=="number"?e.page:0),s=i===-1?1:Math.max(1,Math.ceil(d/i)),m=Math.min(l+1,s),g=l>0,p=l<s-1&&i!==-1,b={fontSize:o,fontWeight:600,color:"text.primary",minWidth:64,height:30,display:"flex",alignItems:"center","& .MuiSelect-select":{py:0,pl:.75,pr:"22px !important",minHeight:`${30}px !important`,height:30,display:"flex",alignItems:"center",boxSizing:"border-box"},"& .MuiSelect-icon":{right:0,fontSize:20,color:"text.primary"}};return jsxRuntime.jsxs(material.Toolbar,{sx:{pl:{sm:2},pr:{xs:1,sm:1},alignItems:"center",gap:1},children:[jsxRuntime.jsx(material.TextField,{size:"small",placeholder:t("table.toolbar.searchPlaceholder"),value:e.filterText,onChange:y=>e.setFilterText(y.target.value),InputProps:{sx:{fontSize:o,"& .MuiInputBase-input":{fontSize:o,color:"text.primary"},"& .MuiInputBase-input::placeholder":{fontSize:o,opacity:1}},startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(Lu__default.default,{fontSize:"small"})})},sx:{width:300}}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:1,ml:1},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:o,color:"text.secondary",whiteSpace:"nowrap"},children:t("table.toolbar.itemsPerPage")}),jsxRuntime.jsx(material.Select,{size:"small",variant:"standard",value:i,disableUnderline:true,onChange:y=>e.onRowsPerPageChange?.(Number(y.target.value)),sx:b,children:c.map(y=>jsxRuntime.jsx(material.MenuItem,{value:y,sx:{fontSize:o},children:y===-1?t("common.all"):y},`rows-per-page-${y}`))}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>e.onPageChange?.(Math.max(l-1,0)),disabled:!g,sx:{...or,color:"text.primary"},children:jsxRuntime.jsx(Qb__default.default,{})}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:o,fontWeight:600,minWidth:88,textAlign:"center",color:"text.primary"},children:t("table.toolbar.pageOf",{current:m,total:s})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>e.onPageChange?.(Math.min(l+1,s-1)),disabled:!p,sx:{...or,color:"text.primary"},children:jsxRuntime.jsx(ph__default.default,{})})]}),jsxRuntime.jsx(material.Box,{sx:{flex:1}}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",gap:1,alignItems:"center"},children:[n.length>0&&jsxRuntime.jsx(material.Box,{sx:{display:"flex",gap:1,alignItems:"center"},children:n.map((y,u)=>jsxRuntime.jsx(Yt__namespace.default.Fragment,{children:y},`toolbar-custom-${u}`))}),jsxRuntime.jsx(material.Box,{sx:{width:"1px",height:20,bgcolor:"divider",mx:.5}}),!e.disableGrouping&&jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.groupBy"),children:jsxRuntime.jsx(material.IconButton,{sx:{...or,color:"text.primary"},onClick:y=>e.setGroupAnchorEl(y.currentTarget),children:jsxRuntime.jsx(material.Badge,{badgeContent:e.grouping?.length,color:"primary",children:jsxRuntime.jsx(Kb__default.default,{})})})}),jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.summary"),children:jsxRuntime.jsx(material.IconButton,{sx:{...or,color:e.showSummary?"primary.main":"text.primary"},onClick:y=>e.setSummaryAnchorEl(y.currentTarget),children:jsxRuntime.jsx(qb__default.default,{})})}),jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.columns"),children:jsxRuntime.jsx(material.IconButton,{sx:{...or,color:"text.primary"},onClick:y=>e.setAnchorEl(y.currentTarget),children:jsxRuntime.jsx(Gb__default.default,{})})}),jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.export"),children:jsxRuntime.jsx(material.IconButton,{sx:{...or,color:"text.primary"},onClick:e.handleExport,children:jsxRuntime.jsx(_b__default.default,{})})}),e.showCreateButton&&jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.newItem"),children:jsxRuntime.jsx(material.IconButton,{onClick:e.onOpenCreateDialog,color:"primary",sx:or,children:jsxRuntime.jsx(op__default.default,{})})}),e.showEditButton&&jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.editItem"),children:jsxRuntime.jsx("span",{children:jsxRuntime.jsx(material.IconButton,{onClick:e.onOpenEditDialog,color:"primary",disabled:!!e.editDisabled,sx:or,children:jsxRuntime.jsx(Zb__default.default,{})})})}),e.showDeleteButton&&jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.deleteItem"),children:jsxRuntime.jsx("span",{children:jsxRuntime.jsx(material.IconButton,{onClick:e.onOpenDeleteConfirm,color:"error",disabled:!!e.deleteDisabled,sx:or,children:jsxRuntime.jsx(Yb__default.default,{})})})}),e.onOpenGraphReport&&jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.graphicReport"),children:jsxRuntime.jsx(material.IconButton,{sx:{...or,color:"text.primary"},onClick:e.onOpenGraphReport,children:jsxRuntime.jsx(jb__default.default,{})})}),e.onLayoutSave&&!e.layoutManager&&jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.saveLayout"),children:jsxRuntime.jsx(material.IconButton,{sx:{...or,color:"text.primary"},onClick:y=>e.onLayoutSave(y),children:jsxRuntime.jsx(Yp__default.default,{})})}),e.layoutManager]})]})};var hl=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:o}=e;return "translate3d("+(t?Math.round(t):0)+"px, "+(o?Math.round(o):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:o}=e;return "scaleX("+t+") scaleY("+o+")"}},Transform:{toString(e){if(e)return [hl.Translate.toString(e),hl.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:o,easing:r}=e;return t+" "+o+"ms "+r}}});var yl=e=>{let{t}=le(),{onSelectAllClick:o,order:r,orderBy:a,sortBy:n=[],numSelected:i=0,rowCount:c=0,onRequestSort:d,onContextMenu:l,columns:s,visibleColumns:m,selectionMode:g,grouping:p=[],isAllExpanded:b=false,handleToggleAll:y,onColumnResize:u,columnWidths:x,enableColumnReorder:f=false,disableSorting:h=false}=e,[v,S]=Yt.useState(null),E=Yt.useRef(null),P=H=>q=>{h||v||d(H);},w=(H,q,$)=>{H.preventDefault(),H.stopPropagation(),S(q),E.current={startX:H.clientX,startWidth:$,colId:q},document.addEventListener("mousemove",D),document.addEventListener("mouseup",I),document.body.style.cursor="col-resize";},D=H=>{if(!E.current)return;let{startX:q,startWidth:$,colId:ie}=E.current,ue=H.clientX-q,Ce=Math.max(50,$+ue);u&&u(ie,Ce);},I=()=>{S(null),E.current=null,document.removeEventListener("mousemove",D),document.removeEventListener("mouseup",I),document.body.style.cursor="";};Yt.useEffect(()=>()=>{document.removeEventListener("mousemove",D),document.removeEventListener("mouseup",I);},[]);let k=g==="multiple"||g==="single",A=p.length>0&&!!y,T=t(b?"table.group.collapseAll":"table.group.expandAll"),R=s.filter(H=>m.includes(H.id)),M=new Map(n.map((H,q)=>[H.field,{...H,priority:q+1}])),Z=R.map(H=>{let q=x?.[H.id]||H.minWidth||100,$=M.get(H.id);return jsxRuntime.jsx(gy,{headCell:H,width:typeof q=="number"?q:100,order:r,orderBy:a,multiSortInfo:h?void 0:$,onRequestSort:P(H.id),onContextMenu:l,onResizeMouseDown:ie=>w(ie,H.id,typeof q=="number"?q:100),enableColumnReorder:f,disableSorting:h},H.id)}),L=R.map(H=>H.id),ee=jsxRuntime.jsxs(ay__default.default,{children:[k&&jsxRuntime.jsx(wc__default.default,{padding:"checkbox",sx:H=>({...Pa,position:"sticky",top:0,zIndex:4,backgroundColor:H.palette.mode==="dark"?"#000000":"#f5f5f5",color:H.palette.mode==="dark"?"#ffffff":H.palette.text.primary}),children:jsxRuntime.jsx(ny__default.default,{color:"primary",indeterminate:i>0&&i<c,checked:c>0&&i===c,onChange:o,disabled:g==="single",sx:pi})}),A&&jsxRuntime.jsx(wc__default.default,{align:"center",padding:"checkbox",sx:H=>({...Tr,position:"sticky",top:0,zIndex:4,backgroundColor:H.palette.mode==="dark"?"#000000":"#f5f5f5",color:H.palette.mode==="dark"?"#ffffff":H.palette.text.primary}),children:jsxRuntime.jsx(sy__default.default,{title:T,children:jsxRuntime.jsx(ly__default.default,{size:"small",onClick:H=>{H.stopPropagation(),y?.(!b);},sx:Ir,children:b?jsxRuntime.jsx(dy__default.default,{}):jsxRuntime.jsx(cy__default.default,{})})})}),f?jsxRuntime.jsx(sortable.SortableContext,{items:L,strategy:sortable.horizontalListSortingStrategy,children:Z}):Z]});return jsxRuntime.jsx(ry__default.default,{children:ee})},gy=({headCell:e,width:t,order:o,orderBy:r,multiSortInfo:a,onRequestSort:n,onContextMenu:i,onResizeMouseDown:c,enableColumnReorder:d,disableSorting:l})=>{let{setNodeRef:s,attributes:m,listeners:g,transform:p,transition:b,isDragging:y}=sortable.useSortable({id:e.id,disabled:!d}),u=d?{transform:hl.Transform.toString(p),transition:b,opacity:y?.6:1}:{},x=l?"asc":a?.direction??(r===e.id?o:"asc"),f=!l&&(!!a||r===e.id);return jsxRuntime.jsxs(wc__default.default,{ref:d?s:void 0,align:"left",padding:e.disablePadding?"none":"normal",sortDirection:f?x:false,onContextMenu:i?h=>i(h,e.id):void 0,style:{width:t,minWidth:t,maxWidth:t,...u},sx:h=>({position:"sticky",top:0,zIndex:4,backgroundColor:h.palette.mode==="dark"?"#000000":"#f5f5f5",color:h.palette.mode==="dark"?"#ffffff":h.palette.text.primary,fontWeight:"bold",userSelect:"none",cursor:d?y?"grabbing":"grab":void 0}),...d?m:{},...d?g:{},children:[l?jsxRuntime.jsx(Di__default.default,{component:"span",sx:h=>({overflow:"visible",textOverflow:"clip",whiteSpace:"normal",lineHeight:1.2,wordBreak:"break-word",pr:1,display:"inline-flex",alignItems:"center",gap:.5,fontWeight:"bold",fontSize:"0.85rem",color:h.palette.mode==="dark"?"#ffffff":h.palette.text.primary}),children:e.label}):jsxRuntime.jsx(iy__default.default,{active:f,direction:x,onClick:n,sx:h=>({"&.MuiTableSortLabel-root":{width:"100%"},"& .MuiTableSortLabel-icon":{color:h.palette.mode==="dark"?"#ffffff":h.palette.text.primary,opacity:f?1:0,transition:"opacity 0.2s"},"&:hover .MuiTableSortLabel-icon":{opacity:.5},"&.Mui-active .MuiTableSortLabel-icon":{opacity:1,color:h.palette.mode==="dark"?"#ffffff":h.palette.text.primary},fontWeight:"bold",fontSize:"0.85rem",color:h.palette.mode==="dark"?"#ffffff":h.palette.text.primary}),children:jsxRuntime.jsxs(Di__default.default,{component:"span",sx:{overflow:"visible",textOverflow:"clip",whiteSpace:"normal",lineHeight:1.2,wordBreak:"break-word",pr:1,display:"inline-flex",alignItems:"center",gap:.5},children:[e.label,a&&jsxRuntime.jsx(Di__default.default,{component:"span",sx:h=>({display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:16,height:16,px:.5,borderRadius:999,fontSize:10,fontWeight:700,color:"#fff",backgroundColor:h.palette.primary.main}),children:a.priority})]})}),jsxRuntime.jsx(Di__default.default,{onMouseDown:c,onPointerDown:h=>h.stopPropagation(),onClick:h=>h.stopPropagation(),sx:h=>({position:"absolute",right:0,top:0,bottom:0,width:5,cursor:"col-resize",backgroundColor:"transparent",transition:"background-color 120ms ease","&:hover":{backgroundColor:h.palette.mode==="dark"?"rgba(148,163,184,0.28)":"rgba(15,23,42,0.12)"},zIndex:1})})]})};var _u=e=>{let{t}=le(),{visibleRows:o,visibleColumns:r,selected:a=[],handleClick:n,columns:i,toggleGroupExpand:c,expandedGroups:d=new Set,selectionMode:l,grouping:s=[],isGroupFullyExpanded:m,handleExpandGroupRecursively:g,handleCollapseGroupRecursively:p}=e,b=f=>a.indexOf(f)!==-1,y=l==="multiple"||l==="single",u=s.length>0,x=r.length+(y?1:0)+(u?1:0);return jsxRuntime.jsxs(material.TableBody,{children:[o.map((f,h)=>{if(f.type==="group"){let v=d.has(f.id),S=f.childIds||[],E=S.filter(I=>b(I)).length,P=S.length>0&&E===S.length,w=E>0&&E<S.length;return jsxRuntime.jsxs(material.TableRow,{sx:I=>({backgroundColor:I.palette.mode==="dark"?"#111111":"#f5f5f5","& .MuiTableCell-root":{color:I.palette.text.primary,borderBottomColor:I.palette.divider},"& .MuiIconButton-root":{color:I.palette.text.primary},"& .MuiCheckbox-root":{color:I.palette.text.secondary},"& .MuiCheckbox-root.Mui-checked, & .MuiCheckbox-root.MuiCheckbox-indeterminate":{color:I.palette.primary.main}}),children:[y&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",sx:Pa,children:jsxRuntime.jsx(material.Checkbox,{size:"small",checked:P,indeterminate:w,onChange:I=>{if(I.stopPropagation(),!!e.onSelectionChange)if(P){let k=a.filter(A=>!S.includes(A));e.onSelectionChange(k);}else {let k=Array.from(new Set([...a,...S]));e.onSelectionChange(k);}},onClick:I=>I.stopPropagation(),sx:pi})}),u&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",sx:Tr,children:jsxRuntime.jsxs(material.Box,{sx:Hu,children:[s.length>1&&f.level<s.length-1&&jsxRuntime.jsx(material.Tooltip,{title:m?.(f.id)?t("table.group.collapseAll"):t("table.group.expandAll"),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>{m?.(f.id)?p?.(f.id):g?.(f.id);},sx:Ir,children:m?.(f.id)?jsxRuntime.jsx(dy__default.default,{}):jsxRuntime.jsx(cy__default.default,{})})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>c&&c(f.id),sx:Ir,children:v?jsxRuntime.jsx(vy__default.default,{}):jsxRuntime.jsx(ph__default.default,{})})]})}),jsxRuntime.jsx(material.TableCell,{colSpan:r.length,sx:{py:1,pl:f.level*3+1},children:jsxRuntime.jsxs(material.Typography,{variant:"body2",fontWeight:"bold",color:"text.primary",sx:{fontSize:"0.85rem"},children:[f.field,": ",f.value," (",f.count,")"]})})]},f.id)}else {let v=f.data||f,S=f.id||v.id||h,E=b(S),P=`enhanced-table-checkbox-${h}`,D=(f.level!==void 0?f.level:0)*4;return jsxRuntime.jsxs(material.TableRow,{hover:true,onClick:I=>n&&n(I,v),role:"checkbox","aria-checked":E,tabIndex:-1,selected:E,sx:{cursor:"pointer"},children:[y&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",sx:Pa,children:jsxRuntime.jsx(material.Checkbox,{color:"primary",checked:E,inputProps:{"aria-labelledby":P},sx:pi})}),u&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",sx:Tr}),i.filter(I=>r.includes(I.id)).map((I,k)=>{let T=k===0&&D>0?{pl:D+2}:{};return jsxRuntime.jsx(material.TableCell,{align:"left",sx:T,children:I.render?I.render(v[I.id],v):(function(){let M=v[I.id];if(I.numeric){if(typeof M=="number")return M.toLocaleString();if(typeof M=="string"&&M.trim()!==""&&!isNaN(Number(M)))return Number(M).toLocaleString()}return M})()},I.id)})]},S)}}),o.length===0&&jsxRuntime.jsx(material.TableRow,{children:jsxRuntime.jsx(material.TableCell,{colSpan:x,align:"center",children:t("common.noData")})})]})};var Ku=e=>{let{visibleColumns:t,summaryRow:o,selectionMode:r,grouping:a=[]}=e;if(!e.showSummary)return null;let n=r==="multiple"||r==="single",i=a.length>0;return jsxRuntime.jsx(material.TableFooter,{sx:{position:"sticky",bottom:0,zIndex:e.zIndex,bgcolor:"background.paper"},children:jsxRuntime.jsxs(material.TableRow,{children:[n&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",sx:{...Pa,bgcolor:"background.paper"}}),i&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",sx:{...Tr,bgcolor:"background.paper"}}),t.map(c=>jsxRuntime.jsx(material.TableCell,{sx:{fontWeight:"bold",fontSize:"0.85rem",bgcolor:"background.paper",color:"text.primary"},children:(function(){let l=o[c];return l==null||l===""?"":typeof l=="number"?l.toLocaleString():typeof l=="string"&&l.trim()!==""&&!isNaN(Number(l))?Number(l).toLocaleString():l})()},c))]})})};var ju=e=>{let{t}=le();return jsxRuntime.jsx(material.Box,{sx:{p:2},children:jsxRuntime.jsx(material.Typography,{children:t("table.mobile.notImplemented")})})};var sn=({groupAnchorEl:e,setGroupAnchorEl:t,grouping:o,setGrouping:r,columns:a,toggleGroupField:n})=>{let{t:i}=le();return jsxRuntime.jsxs(material.Menu,{anchorEl:e,open:!!e,onClose:()=>t(null),children:[jsxRuntime.jsxs(material.Box,{sx:{p:1,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[jsxRuntime.jsx(material.Typography,{variant:"subtitle2",sx:{px:1},children:i("table.menu.groupBy")}),o.length>0&&jsxRuntime.jsx(material.Button,{size:"small",color:"error",onClick:()=>r([]),startIcon:jsxRuntime.jsx(Ju__default.default,{}),children:i("table.menu.clearAll")})]}),jsxRuntime.jsx(material.Divider,{}),a.map(c=>{let d=o.includes(c.id),l=o.indexOf(c.id)+1;return jsxRuntime.jsx(material.MenuItem,{onClick:()=>n(c.id),children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",width:"100%"},children:[jsxRuntime.jsx(material.Checkbox,{checked:d,size:"small"}),jsxRuntime.jsx(material.ListItemText,{primary:c.label}),d&&jsxRuntime.jsx(material.Badge,{badgeContent:l,color:"primary",sx:{mr:2}})]})},c.id)})]})},cn=({anchorEl:e,setAnchorEl:t,columns:o,visibleColumns:r,toggleColumnVisibility:a})=>{let{t:n}=le();return jsxRuntime.jsxs(material.Menu,{anchorEl:e,open:!!e,onClose:()=>t(null),children:[jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.ListItemText,{primary:n("table.menu.visibleColumns")})}),jsxRuntime.jsx(material.Divider,{}),o.map(i=>jsxRuntime.jsxs(material.MenuItem,{onClick:()=>a(i.id),children:[jsxRuntime.jsx(material.Checkbox,{checked:r.includes(i.id),size:"small"}),jsxRuntime.jsx(material.ListItemText,{primary:i.label})]},i.id))]})},Cl=({anchorEl:e,setAnchorEl:t,showSummary:o,setShowSummary:r,columns:a,summaryColumns:n,toggleSummaryColumn:i})=>{let{t:c}=le();return jsxRuntime.jsxs(material.Menu,{anchorEl:e,open:!!e,onClose:()=>t(null),children:[jsxRuntime.jsx(material.MenuItem,{children:jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Switch,{checked:o,onChange:d=>r(d.target.checked),size:"small"}),label:c("table.menu.showSummaryRow")})}),jsxRuntime.jsx(material.Divider,{}),a.filter(d=>d.numeric).map(d=>jsxRuntime.jsxs(material.MenuItem,{onClick:()=>i(d.id),disabled:!o,children:[jsxRuntime.jsx(material.Checkbox,{checked:n.includes(d.id),size:"small"}),jsxRuntime.jsx(material.ListItemText,{primary:d.label})]},d.id)),a.filter(d=>d.numeric).length===0&&jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.ListItemText,{primary:c("table.menu.noNumericColumns")})})]})},Sl=({contextMenu:e,handleCloseContextMenu:t,columns:o,visibleColumns:r,toggleColumnVisibility:a})=>{let{t:n}=le();return jsxRuntime.jsxs(material.Menu,{open:e!==null,onClose:t,anchorReference:"anchorPosition",anchorPosition:e!==null?{top:e.mouseY,left:e.mouseX}:void 0,children:[jsxRuntime.jsx(material.MenuItem,{onClick:t,children:n("common.copy")}),jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsx(material.MenuItem,{disabled:true,children:n("table.menu.visibleColumns")}),o.map(i=>jsxRuntime.jsxs(material.MenuItem,{onClick:()=>a(i.id),children:[jsxRuntime.jsx(material.ListItemIcon,{children:r.includes(i.id)&&jsxRuntime.jsx(Fy__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{children:i.label})]},i.id))]})},rp=({contextMenu:e,handleClose:t,columns:o,visibleColumns:r,grouping:a,summaryColumns:n,showSummary:i,sortBy:c,orderBy:d,order:l,onSortAsc:s,onSortDesc:m,onClearSort:g,onHideColumn:p,onToggleGroup:b,onToggleSummary:y,onOpenSortDialog:u})=>{let{t:x}=le(),f=e?.columnId??"",h=o.find(k=>k.id===f),v=a.includes(f),S=n.includes(f),E=!!h?.numeric,P=c.find(k=>k.field===f),w=P?P.direction==="asc":d===f&&l==="asc",D=P?P.direction==="desc":d===f&&l==="desc",I=w||D;return jsxRuntime.jsxs(material.Menu,{open:e!==null,onClose:t,anchorReference:"anchorPosition",anchorPosition:e!==null?{top:e.mouseY,left:e.mouseX}:void 0,children:[jsxRuntime.jsx(material.MenuItem,{disabled:true,sx:{opacity:"1 !important",fontWeight:700},children:jsxRuntime.jsx(material.ListItemText,{primary:h?.label??f})}),jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsxs(material.MenuItem,{onClick:()=>{s(f),t();},selected:w,children:[jsxRuntime.jsx(material.ListItemIcon,{children:jsxRuntime.jsx(ep__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{primary:x("table.headerMenu.sortAsc")})]}),jsxRuntime.jsxs(material.MenuItem,{onClick:()=>{m(f),t();},selected:D,children:[jsxRuntime.jsx(material.ListItemIcon,{children:jsxRuntime.jsx(tp__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{primary:x("table.headerMenu.sortDesc")})]}),I&&jsxRuntime.jsxs(material.MenuItem,{onClick:()=>{g(f),t();},children:[jsxRuntime.jsx(material.ListItemIcon,{children:jsxRuntime.jsx(Ju__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{primary:x("table.headerMenu.clearSort")})]}),jsxRuntime.jsxs(material.MenuItem,{onClick:()=>{u(),t();},children:[jsxRuntime.jsx(material.ListItemIcon,{children:jsxRuntime.jsx(op__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{primary:x("table.headerMenu.configureSort")})]}),jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsxs(material.MenuItem,{onClick:()=>{b(f),t();},selected:v,children:[jsxRuntime.jsx(material.ListItemIcon,{children:jsxRuntime.jsx(Kb__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{primary:x(v?"table.headerMenu.ungroup":"table.headerMenu.group")})]}),E&&i&&jsxRuntime.jsxs(material.MenuItem,{onClick:()=>{y(f),t();},selected:S,children:[jsxRuntime.jsx(material.ListItemIcon,{children:jsxRuntime.jsx(qb__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{primary:x(S?"table.headerMenu.removeSummary":"table.headerMenu.addSummary")})]}),jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsxs(material.MenuItem,{onClick:()=>{p(f),t();},children:[jsxRuntime.jsx(material.ListItemIcon,{children:jsxRuntime.jsx(Ly__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{primary:x("table.headerMenu.hideColumn")})]})]})},ap=({open:e,onClose:t,columns:o,initialRules:r,onApply:a,onClear:n})=>{let{t:i}=le(),[c,d]=Yt.useState([]);Yt.useEffect(()=>{e&&d(r.length>0?r.map(y=>({...y})):[]);},[e,r]);let l=Yt.useMemo(()=>new Set(c.map(y=>y.field)),[c]),s=Yt.useMemo(()=>o.filter(y=>!l.has(y.id)),[o,l]),m=()=>{let y=s[0];y&&d(u=>[...u,{field:y.id,direction:"asc"}]);},g=y=>{d(u=>u.filter((x,f)=>f!==y));},p=(y,u)=>{d(x=>x.map((f,h)=>h===y?{...f,...u}:f));},b=(y,u)=>{d(x=>{let f=y+u;if(f<0||f>=x.length)return x;let h=[...x],[v]=h.splice(y,1);return h.splice(f,0,v),h});};return jsxRuntime.jsxs(material.Dialog,{open:e,onClose:t,maxWidth:"sm",fullWidth:true,children:[jsxRuntime.jsx(material.DialogTitle,{children:i("table.sortDialog.title")}),jsxRuntime.jsxs(material.DialogContent,{dividers:true,children:[c.length===0?jsxRuntime.jsx(material.Typography,{variant:"body2",sx:{color:"text.secondary",py:2},children:i("table.sortDialog.empty")}):jsxRuntime.jsx(material.Stack,{spacing:1,children:c.map((y,u)=>{let x=new Set(c.filter((h,v)=>v!==u).map(h=>h.field)),f=o.filter(h=>!x.has(h.id));return jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:"24px 1fr 110px auto auto",alignItems:"center",gap:1},children:[jsxRuntime.jsx(material.Badge,{badgeContent:u+1,color:"primary",sx:{ml:.5}}),jsxRuntime.jsx("select",{value:y.field,onChange:h=>p(u,{field:h.target.value}),style:{padding:6,fontSize:13,borderRadius:4},children:f.map(h=>jsxRuntime.jsx("option",{value:h.id,children:h.label},h.id))}),jsxRuntime.jsxs("select",{value:y.direction,onChange:h=>p(u,{direction:h.target.value}),style:{padding:6,fontSize:13,borderRadius:4},children:[jsxRuntime.jsx("option",{value:"asc",children:i("table.sortDialog.asc")}),jsxRuntime.jsx("option",{value:"desc",children:i("table.sortDialog.desc")})]}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>b(u,-1),disabled:u===0,children:jsxRuntime.jsx(ep__default.default,{fontSize:"small"})}),jsxRuntime.jsxs(material.Stack,{direction:"row",children:[jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>b(u,1),disabled:u===c.length-1,children:jsxRuntime.jsx(tp__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>g(u),children:jsxRuntime.jsx(Oy__default.default,{fontSize:"small"})})]})]},`sort-rule-${u}`)})}),jsxRuntime.jsx(material.Button,{size:"small",onClick:m,disabled:s.length===0,startIcon:jsxRuntime.jsx(op__default.default,{}),sx:{mt:2},children:i("table.sortDialog.addRule")})]}),jsxRuntime.jsxs(material.DialogActions,{children:[jsxRuntime.jsx(material.Button,{color:"inherit",onClick:()=>{n(),t();},children:i("table.sortDialog.clearAll")}),jsxRuntime.jsx(material.Box,{sx:{flex:1}}),jsxRuntime.jsx(material.Button,{onClick:t,children:i("common.cancel")}),jsxRuntime.jsx(material.Button,{variant:"contained",onClick:()=>{a(c),t();},children:i("common.ok")})]})]})};var yi=(e,t=2)=>e.toLocaleString(void 0,{maximumFractionDigits:t}),ip=({kpis:e})=>{let{t}=le(),o=[{label:t("graph.kpi.totalRecords"),value:yi(e.totalRecords,0),color:"text.primary"},{label:t("graph.kpi.totalReport"),value:yi(e.totalReportHours),color:"text.primary"},{label:t("graph.kpi.totalBillable"),value:yi(e.totalBillableHours),color:"success.main"},{label:t("graph.kpi.efficiency"),value:`${e.efficiency.toFixed(2)}%`,color:"warning.main"},{label:t("graph.kpi.amount"),value:yi(e.totalAmount),color:"info.main"},{label:t("graph.kpi.flagged"),value:yi(e.flaggedCount,0),color:"error.main"}];return jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",lg:"repeat(6, minmax(0, 1fr))"},gap:1.5},children:o.map(r=>jsxRuntime.jsxs(material.Paper,{variant:"outlined",sx:{p:1.5,borderRadius:2,minHeight:96,display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",children:r.label}),jsxRuntime.jsx(material.Typography,{variant:"h4",fontWeight:800,sx:{color:r.color},children:r.value})]},r.label))})};var kl=({title:e,subtitle:t,children:o})=>jsxRuntime.jsxs(material.Paper,{variant:"outlined",sx:{p:2,borderRadius:2},children:[jsxRuntime.jsx(material.Typography,{variant:"subtitle1",fontWeight:700,children:e}),t&&jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",sx:{mb:2},children:t}),o]});var vi=({data:e,orientation:t="horizontal",valueSuffix:o="",minHeight:r=210,activeName:a,onItemClick:n})=>{if(e.length===0)return jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:"No data"});let i=Math.max(...e.map(c=>c.value),1);return t==="vertical"?jsxRuntime.jsx(material.Box,{sx:{display:"flex",gap:1,alignItems:"flex-end",minHeight:r},children:e.map(c=>jsxRuntime.jsxs(material.Box,{sx:{flex:1,minWidth:0},children:[jsxRuntime.jsx(material.Box,{onClick:()=>n?.(c),sx:{height:`${Math.max(c.value/i*180,6)}px`,bgcolor:c.name===a?"primary.dark":"primary.main",borderRadius:"8px 8px 0 0",cursor:n?"pointer":"default",opacity:a&&c.name!==a?.45:1}}),jsxRuntime.jsx(material.Typography,{variant:"caption",noWrap:true,title:c.name,sx:{display:"block",mt:.5},children:c.name}),jsxRuntime.jsxs(material.Typography,{variant:"caption",color:"text.secondary",children:[c.value.toFixed(1),o]})]},c.name))}):jsxRuntime.jsx(material.Stack,{spacing:1,children:e.map(c=>jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:"140px 1fr 64px",gap:1},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",noWrap:true,title:c.name,children:c.name}),jsxRuntime.jsx(material.Box,{onClick:()=>n?.(c),sx:{alignSelf:"center",bgcolor:"action.hover",height:10,borderRadius:999,overflow:"hidden",cursor:n?"pointer":"default",opacity:a&&c.name!==a?.45:1},children:jsxRuntime.jsx(material.Box,{sx:{width:`${c.value/i*100}%`,height:"100%",bgcolor:c.name===a?"primary.dark":"primary.main"}})}),jsxRuntime.jsxs(material.Typography,{variant:"caption",sx:{textAlign:"right",fontWeight:600},children:[c.value.toFixed(1),o]})]},c.name))})};var cp=({data:e,color:t="#42A5F5",valueSuffix:o="",height:r=220})=>{if(e.length===0)return jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:"No data"});let a=640,n=28,i=e.map(g=>g.value),c=Math.min(...i,0),l=Math.max(...i,1)-c||1,s=e.map((g,p)=>{let b=n+p*(a-n*2)/Math.max(e.length-1,1),y=r-n-(g.value-c)/l*(r-n*2);return {x:b,y,...g}}),m=s.map(g=>`${g.x},${g.y}`).join(" ");return jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsxs(material.Box,{component:"svg",viewBox:`0 0 ${a} ${r}`,sx:{width:"100%",height:r},children:[jsxRuntime.jsx("line",{x1:n,y1:r-n,x2:a-n,y2:r-n,stroke:"rgba(148,163,184,0.4)"}),jsxRuntime.jsx("polyline",{fill:"none",stroke:t,strokeWidth:3,points:m}),s.map(g=>jsxRuntime.jsx("circle",{cx:g.x,cy:g.y,r:4,fill:t},g.name))]}),jsxRuntime.jsx(material.Box,{sx:{mt:1,display:"grid",gridTemplateColumns:`repeat(${e.length}, minmax(0, 1fr))`,gap:1},children:e.map(g=>jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",noWrap:true,title:g.name,sx:{display:"block"},children:g.name}),jsxRuntime.jsxs(material.Typography,{variant:"caption",color:"text.secondary",children:[g.value.toFixed(1),o]})]},g.name))})]})};var dp=({data:e,barColor:t="#64B5F6",lineColor:o="#FFB74D",height:r=220})=>{if(e.length===0)return jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:"No data"});let a=640,n=28,i=Math.max(...e.map(s=>s.barValue),1),c=Math.max(...e.map(s=>s.lineValue),1),d=e.map((s,m)=>{let g=(a-n*2)/e.length,p=Math.max(g*.5,8),b=n+m*g+(g-p)/2,y=s.barValue/i*(r-n*2),u=r-n-y;return {x:b,y:u,barHeight:y,barWidth:p,item:s}}),l=e.map((s,m)=>{let g=(a-n*2)/e.length,p=n+m*g+g/2,b=r-n-s.lineValue/c*(r-n*2);return {x:p,y:b,item:s}});return jsxRuntime.jsxs(material.Stack,{spacing:1.25,children:[jsxRuntime.jsxs(material.Box,{component:"svg",viewBox:`0 0 ${a} ${r}`,sx:{width:"100%",height:r},children:[jsxRuntime.jsx("line",{x1:n,y1:r-n,x2:a-n,y2:r-n,stroke:"rgba(148,163,184,0.4)"}),d.map(s=>jsxRuntime.jsx("rect",{x:s.x,y:s.y,width:s.barWidth,height:Math.max(s.barHeight,4),rx:6,fill:t},s.item.name)),jsxRuntime.jsx("polyline",{fill:"none",stroke:o,strokeWidth:3,points:l.map(s=>`${s.x},${s.y}`).join(" ")}),l.map(s=>jsxRuntime.jsx("circle",{cx:s.x,cy:s.y,r:3.5,fill:o},`${s.item.name}-line`))]}),jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${e.length}, minmax(0, 1fr))`,gap:1},children:e.map(s=>jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",noWrap:true,title:s.name,sx:{display:"block"},children:s.name}),jsxRuntime.jsxs(material.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:["Bar: ",s.barValue.toFixed(1)]}),jsxRuntime.jsxs(material.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:["Line: ",s.lineValue.toFixed(1)]})]},s.name))})]})};var jy=e=>`rgba(30, 136, 229, ${.2+Math.max(0,Math.min(1,e))*.8})`,pp=({data:e})=>{if(e.length===0)return jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:"No data"});let t=Array.from(new Set(e.map(n=>n.x))),o=Array.from(new Set(e.map(n=>n.y))),r=Math.max(...e.map(n=>n.value),1),a=new Map(e.map(n=>[`${n.y}__${n.x}`,n.value]));return jsxRuntime.jsx(material.Box,{sx:{overflowX:"auto"},children:jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:`120px repeat(${t.length}, minmax(64px, 1fr))`,gap:1,minWidth:120+t.length*64},children:[jsxRuntime.jsx(material.Box,{}),t.map(n=>jsxRuntime.jsx(material.Typography,{variant:"caption",sx:{textAlign:"center",fontWeight:600},children:n},n)),o.map(n=>jsxRuntime.jsxs(material.Box,{sx:{display:"contents"},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",sx:{alignSelf:"center"},children:n}),t.map(i=>{let c=a.get(`${n}__${i}`)||0,d=c/r;return jsxRuntime.jsx(material.Box,{sx:{height:36,borderRadius:1,bgcolor:jy(d),border:"1px solid rgba(148,163,184,0.2)",display:"flex",alignItems:"center",justifyContent:"center"},children:jsxRuntime.jsx(material.Typography,{variant:"caption",fontWeight:700,children:c.toFixed(1)})},`${n}-${i}`)})]},n))]})})};var Xy=["#1E88E5","#1ABC9C","#FBC02D","#EF5350","#7E57C2","#78909C"],Dl=({data:e,variant:t="donut",colors:o=Xy,size:r=180,activeName:a,onItemClick:n})=>{if(e.length===0)return jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:"No data"});let i=0,c=e.map((d,l)=>{let s=i;return i+=d.percent,`${o[l%o.length]} ${s}% ${i}%`});return jsxRuntime.jsxs(material.Stack,{direction:{xs:"column",sm:"row"},spacing:2,alignItems:"center",children:[jsxRuntime.jsx(material.Box,{sx:{width:r,height:r,borderRadius:"50%",background:`conic-gradient(${c.join(", ")})`,position:"relative",flexShrink:0},children:t==="donut"&&jsxRuntime.jsx(material.Box,{sx:{position:"absolute",inset:Math.round(r*.18),bgcolor:"background.paper",borderRadius:"50%"}})}),jsxRuntime.jsx(material.Stack,{spacing:1,sx:{minWidth:180},children:e.map((d,l)=>jsxRuntime.jsxs(material.Box,{onClick:()=>n?.(d),sx:{display:"flex",alignItems:"center",gap:1,cursor:n?"pointer":"default",opacity:a&&d.name!==a?.45:1},children:[jsxRuntime.jsx(material.Box,{sx:{width:10,height:10,borderRadius:"50%",bgcolor:o[l%o.length]}}),jsxRuntime.jsx(material.Typography,{variant:"caption",sx:{flex:1},children:d.name}),jsxRuntime.jsxs(material.Typography,{variant:"caption",sx:{fontWeight:700},children:[d.percent.toFixed(0),"%"]})]},d.name))})]})};var gp=({effect:e,branches:t})=>{if(t.length===0)return jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:"No data"});let o=t.filter((a,n)=>n%2===0),r=t.filter((a,n)=>n%2===1);return jsxRuntime.jsxs(material.Stack,{spacing:1.5,children:[jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${Math.max(o.length,1)}, minmax(0, 1fr))`,gap:1},children:o.map(a=>jsxRuntime.jsxs(material.Box,{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",fontWeight:700,children:a.title}),a.causes.map(n=>jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:n},n))]},a.title))}),jsxRuntime.jsxs(material.Box,{sx:{position:"relative",height:32},children:[jsxRuntime.jsx(material.Box,{sx:{position:"absolute",inset:"50% 0 auto 0",borderTop:"2px solid",borderColor:"primary.main"}}),jsxRuntime.jsx(material.Box,{sx:{position:"absolute",right:0,top:"calc(50% - 12px)",px:1,py:.25,borderRadius:1,bgcolor:"primary.main",color:"primary.contrastText"},children:jsxRuntime.jsx(material.Typography,{variant:"caption",fontWeight:700,children:e})})]}),jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${Math.max(r.length,1)}, minmax(0, 1fr))`,gap:1},children:r.map(a=>jsxRuntime.jsxs(material.Box,{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",fontWeight:700,children:a.title}),a.causes.map(n=>jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:n},n))]},a.title))})]})};var hp=({data:e,height:t=240})=>{if(e.length===0)return jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:"No data"});let o=0,r=e.map(m=>{let g=m.type==="total"?0:o,p=m.type==="total"?m.value:o+m.value;return m.type!=="total"&&(o=p),{...m,start:g,end:p,delta:p-g}}),a=r.flatMap(m=>[m.start,m.end]),n=Math.min(...a,0),i=Math.max(...a,1),c=680,d=30,l=i-n||1,s=m=>t-d-(m-n)/l*(t-d*2);return jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsxs(material.Box,{component:"svg",viewBox:`0 0 ${c} ${t}`,sx:{width:"100%",height:t},children:[jsxRuntime.jsx("line",{x1:d,y1:s(0),x2:c-d,y2:s(0),stroke:"rgba(148,163,184,0.4)"}),r.map((m,g)=>{let p=(c-d*2)/r.length,b=Math.max(p*.55,8),y=d+g*p+(p-b)/2,u=s(Math.max(m.start,m.end)),x=s(Math.min(m.start,m.end)),f=m.type==="total"?"#42A5F5":m.delta>=0?"#66BB6A":"#EF5350";return jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("rect",{x:y,y:u,width:b,height:Math.max(x-u,4),rx:6,fill:f}),jsxRuntime.jsx("text",{x:y+b/2,y:u-6,textAnchor:"middle",fill:"currentColor",fontSize:"11",children:m.end.toFixed(1)})]},m.name)})]}),jsxRuntime.jsx(material.Box,{sx:{mt:1,display:"grid",gridTemplateColumns:`repeat(${r.length}, minmax(0, 1fr))`,gap:1},children:r.map(m=>jsxRuntime.jsx(material.Typography,{variant:"caption",noWrap:true,title:m.name,children:m.name},m.name))})]})};var ki=({apiKey:e,query:t,zoom:o=14,mapType:r="roadmap"})=>{let a=encodeURIComponent(t);return `https://www.google.com/maps/embed/v1/place?key=${encodeURIComponent(e)}&q=${a}&zoom=${o}&maptype=${r}`},TD=(e,t=360)=>{let o=ki(e);return `<iframe width="100%" height="${t}" style="border:0" loading="lazy" allowfullscreen referrerpolicy="no-referrer-when-downgrade" src="${o}"></iframe>`};var xp=({apiKey:e,query:t,embedUrl:o,zoom:r=14,mapType:a="roadmap",height:n=320})=>{let i=o||(e&&t?ki({apiKey:e,query:t,zoom:r,mapType:a}):"");return i?jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsx(material.Box,{component:"iframe",src:i,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",sx:{width:"100%",height:n,border:0,borderRadius:2}}),jsxRuntime.jsxs(material.Typography,{variant:"caption",color:"text.secondary",sx:{mt:.75,display:"block"},children:["If iframe is blocked, open directly: ",jsxRuntime.jsx(material.Link,{href:i,target:"_blank",rel:"noreferrer",children:"Google Maps"})]})]}):jsxRuntime.jsx(material.Box,{children:jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:"Google Map requires `embedUrl` or (`apiKey` + `query`)."})})};var El=({keyword:e,location:t,src:o="orbcafe-ui"})=>{if(t){let r=encodeURIComponent(t.name||e||"Location");return `https://uri.amap.com/marker?position=${t.lng},${t.lat}&name=${r}&src=${encodeURIComponent(o)}&coordinate=gaode&callnative=0`}return e?`https://uri.amap.com/search?keyword=${encodeURIComponent(e)}&src=${encodeURIComponent(o)}&callnative=0`:"https://uri.amap.com/search?keyword=%E5%8C%97%E4%BA%AC&src=orbcafe-ui&callnative=0"};var kp=({keyword:e,location:t,embedUrl:o,height:r=320})=>{let a=o||El({keyword:e,location:t?{lng:t.lng,lat:t.lat,name:t.name}:void 0});return jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsx(material.Box,{component:"iframe",src:a,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",sx:{width:"100%",height:r,border:0,borderRadius:2}}),jsxRuntime.jsxs(material.Typography,{variant:"caption",color:"text.secondary",sx:{mt:.75,display:"block"},children:["If iframe is blocked, open directly: ",jsxRuntime.jsx(material.Link,{href:a,target:"_blank",rel:"noreferrer",children:"AMap"})]})]})};var wp=({billableByPrimary:e,efficiencyBySecondary:t,statusDistribution:o,interaction:r})=>{let{t:a}=le();return jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",lg:"1.2fr 1.2fr 1fr"}},children:[jsxRuntime.jsx(kl,{title:a("graph.chart.billable.title"),subtitle:a("graph.chart.billable.subtitle"),children:jsxRuntime.jsx(vi,{data:e,orientation:"horizontal",activeName:r?.filters?.primaryDimension,onItemClick:n=>r?.onPrimaryDimensionClick?.(n.name)})}),jsxRuntime.jsx(kl,{title:a("graph.chart.efficiency.title"),subtitle:a("graph.chart.efficiency.subtitle"),children:jsxRuntime.jsx(vi,{data:t,orientation:"vertical",valueSuffix:"%",activeName:r?.filters?.secondaryDimension,onItemClick:n=>r?.onSecondaryDimensionClick?.(n.name)})}),jsxRuntime.jsx(kl,{title:a("graph.chart.status.title"),subtitle:a("graph.chart.status.subtitle"),children:jsxRuntime.jsx(Dl,{data:o,variant:"donut",activeName:r?.filters?.status,onItemClick:n=>r?.onStatusClick?.(n.name)})})]})};var Po=e=>jsxRuntime.jsx(material.TextField,{...e,variant:e.variant||"outlined",size:e.size||"small",fullWidth:e.fullWidth!==void 0?e.fullWidth:true});var Oc=e=>jsxRuntime.jsx(material.TextField,{...e,multiline:true,minRows:3,fullWidth:true,variant:"outlined"});var gx=["doubao-lite","gpt-4o-mini","gpt-4.1-mini","claude-3.5-sonnet"],fx=["zh","en","de","fr","ja","ko"],Pp=({open:e,onClose:t,value:o,onSaveAll:r,modelOptions:a=gx,promptLangOptions:n=fx,analysisTemplateOptions:i=[],responseTemplateOptions:c=[],defaultAnalysisTemplateId:d,defaultResponseTemplateId:l})=>{let[s,m]=Yt.useState(o),[g,p]=Yt.useState(d||""),[b,y]=Yt.useState(l||""),[u,x]=Yt.useState(false);Yt.useEffect(()=>{e&&(m(o),p(d||""),y(l||""));},[e,o,d,l]);let f=(v,S)=>{m(E=>({...E,[v]:S}));},h=async()=>{if(r)try{x(!0),await r({settings:s,analysisTemplateId:g||void 0,responseTemplateId:b||void 0});}finally{x(false);}};return jsxRuntime.jsxs(material.Dialog,{open:e,onClose:t,fullWidth:true,maxWidth:"lg",children:[jsxRuntime.jsxs(material.DialogTitle,{sx:{pr:7,pb:2.2},children:[jsxRuntime.jsx(material.Typography,{variant:"h5",sx:{fontWeight:800},children:"AI Settings"}),jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",sx:{mt:.5},children:"Configure LLM settings and editable agent prompts by language."}),jsxRuntime.jsx(material.IconButton,{onClick:t,sx:{position:"absolute",right:12,top:12},children:jsxRuntime.jsx(Rb__default.default,{})})]}),jsxRuntime.jsx(material.DialogContent,{sx:{pt:"18px !important"},children:jsxRuntime.jsxs(material.Stack,{spacing:2.2,children:[jsxRuntime.jsxs(material.Box,{sx:{mt:.8,display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",md:"repeat(2, minmax(0, 1fr))"}},children:[jsxRuntime.jsx(material.Box,{children:jsxRuntime.jsx(Po,{size:"small",value:s.baseUrl,onChange:v=>f("baseUrl",v.target.value),fullWidth:true,label:"Base URL"})}),jsxRuntime.jsx(material.Box,{children:jsxRuntime.jsx(Po,{size:"small",type:"password",value:s.apiKey,onChange:v=>f("apiKey",v.target.value),fullWidth:true,label:"API Key"})}),jsxRuntime.jsx(material.Box,{children:jsxRuntime.jsx(Po,{size:"small",value:s.model,onChange:v=>f("model",v.target.value),fullWidth:true,select:true,label:"Model",children:a.map(v=>jsxRuntime.jsx(material.MenuItem,{value:v,children:v},v))})}),jsxRuntime.jsx(material.Box,{children:jsxRuntime.jsx(Po,{size:"small",value:s.promptLang,onChange:v=>f("promptLang",v.target.value),fullWidth:true,select:true,label:"Prompt Lang",children:n.map(v=>jsxRuntime.jsx(material.MenuItem,{value:v,children:v},v))})})]}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[jsxRuntime.jsxs(Po,{size:"small",value:g,onChange:v=>p(v.target.value),fullWidth:true,select:true,label:"Analysis Template",children:[jsxRuntime.jsx(material.MenuItem,{value:"",children:"Default"}),i.map(v=>jsxRuntime.jsx(material.MenuItem,{value:v.id,children:v.label},v.id))]}),jsxRuntime.jsx(Oc,{multiline:true,minRows:8,value:s.analysisPrompt,onChange:v=>f("analysisPrompt",v.target.value),fullWidth:true,label:"Analysis Prompt",sx:{"& .MuiInputBase-root":{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"}}}),jsxRuntime.jsxs(Po,{size:"small",value:b,onChange:v=>y(v.target.value),fullWidth:true,select:true,label:"Response Template",children:[jsxRuntime.jsx(material.MenuItem,{value:"",children:"Default"}),c.map(v=>jsxRuntime.jsx(material.MenuItem,{value:v.id,children:v.label},v.id))]}),jsxRuntime.jsx(Oc,{multiline:true,minRows:8,value:s.responsePrompt,onChange:v=>f("responsePrompt",v.target.value),fullWidth:true,label:"Response Prompt",sx:{"& .MuiInputBase-root":{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"}}})]})]})}),jsxRuntime.jsxs(material.DialogActions,{sx:{px:3,pb:2.5,pt:1.2,gap:1},children:[jsxRuntime.jsx(material.Button,{variant:"outlined",onClick:t,children:"Cancel"}),jsxRuntime.jsx(material.Button,{variant:"contained",onClick:h,disabled:!r||u,children:"Save"})]})]})};var Ol=({open:e,onClose:t,model:o,tableContent:r,extraCharts:a,interaction:n,aiAssistant:i})=>{let{t:c}=le(),[d,l]=Yt.useState(i?.defaultPrompt||""),[s,m]=Yt.useState(false),[g,p]=Yt.useState(false),b=n?.enabled!==false&&!!n,y=i?.enabled!==false,u=n?.filters||{},x=!!(u.primaryDimension||u.secondaryDimension||u.status),f=i?.placeholder||"Ask AI to analyze data, create charts, or find insights...";Yt.useEffect(()=>{e&&l(i?.defaultPrompt||"");},[e,i?.defaultPrompt]);let h=i?.settings||{baseUrl:"/llm-api",apiKey:"",model:"doubao-lite",promptLang:"zh",analysisPrompt:"",responsePrompt:""},v=async()=>{let S=d.trim();if(!(!S||!i?.onSubmit))try{m(!0),await i.onSubmit(S,{filters:u,model:o});}finally{m(false);}};return jsxRuntime.jsx(material.Dialog,{open:e,onClose:t,fullScreen:true,children:jsxRuntime.jsxs(material.Box,{sx:{height:"100%",display:"flex",flexDirection:"column",bgcolor:"background.default"},children:[jsxRuntime.jsx(material.Box,{sx:{p:2,borderBottom:1,borderColor:"divider"},children:jsxRuntime.jsxs(material.Stack,{direction:{xs:"column",lg:"row"},alignItems:{xs:"stretch",lg:"center"},justifyContent:"space-between",spacing:1.5,children:[jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1.25,alignItems:"center",sx:{flexWrap:"wrap"},children:[jsxRuntime.jsx(material.Typography,{variant:"h5",fontWeight:800,children:o.title}),jsxRuntime.jsx(material.Chip,{size:"small",label:c("graph.records",{count:o.kpis.totalRecords})}),b&&u.primaryDimension&&jsxRuntime.jsx(material.Chip,{size:"small",variant:"outlined",label:`${n?.fieldMapping.primaryDimension}: ${u.primaryDimension}`,onDelete:()=>n?.onClearFilter("primaryDimension")}),b&&u.secondaryDimension&&jsxRuntime.jsx(material.Chip,{size:"small",variant:"outlined",label:`${n?.fieldMapping.secondaryDimension}: ${u.secondaryDimension}`,onDelete:()=>n?.onClearFilter("secondaryDimension")}),b&&u.status&&jsxRuntime.jsx(material.Chip,{size:"small",variant:"outlined",label:`${n?.fieldMapping.status}: ${u.status}`,onDelete:()=>n?.onClearFilter("status")}),b&&x&&jsxRuntime.jsx(material.Button,{size:"small",onClick:()=>n?.onClearAll(),children:"Clear"})]}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1.25,alignItems:"center",sx:{width:{xs:"100%",lg:"auto"}},children:[y&&jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:1,px:1.2,py:.4,borderRadius:999,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",minWidth:{xs:0,lg:520},flex:{xs:1,lg:"0 0 auto"}},children:[jsxRuntime.jsx(material.IconButton,{size:"small",onClick:i?.onVoiceInput,children:jsxRuntime.jsx(Cx__default.default,{sx:{fontSize:18,color:"text.secondary"}})}),jsxRuntime.jsx(material.InputBase,{fullWidth:true,value:d,onChange:S=>l(S.target.value),onKeyDown:S=>{S.key==="Enter"&&(S.preventDefault(),v());},placeholder:f,sx:{fontSize:"0.9rem"}}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:v,disabled:s||!d.trim(),children:jsxRuntime.jsx(kx__default.default,{sx:{fontSize:18}})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>p(true),children:jsxRuntime.jsx(Sx__default.default,{sx:{fontSize:18}})})]}),jsxRuntime.jsx(material.IconButton,{onClick:t,children:jsxRuntime.jsx(Rb__default.default,{})})]})]})}),jsxRuntime.jsxs(material.Box,{sx:{p:2,display:"flex",flexDirection:"column",gap:1.5,overflow:"auto",minHeight:0},children:[jsxRuntime.jsx(ip,{kpis:o.kpis}),jsxRuntime.jsx(wp,{billableByPrimary:o.charts.billableByPrimary,efficiencyBySecondary:o.charts.efficiencyBySecondary,statusDistribution:o.charts.statusDistribution,interaction:b?{filters:u,onPrimaryDimensionClick:S=>n?.onPrimaryDimensionClick(S),onSecondaryDimensionClick:S=>n?.onSecondaryDimensionClick(S),onStatusClick:S=>n?.onStatusClick(S)}:void 0}),a,r]}),jsxRuntime.jsx(Pp,{open:g,onClose:()=>p(false),value:h,onSaveAll:i?.onSaveAll,modelOptions:i?.modelOptions,promptLangOptions:i?.promptLangOptions,analysisTemplateOptions:i?.analysisTemplateOptions,responseTemplateOptions:i?.responseTemplateOptions,defaultAnalysisTemplateId:i?.defaultAnalysisTemplateId,defaultResponseTemplateId:i?.defaultResponseTemplateId})]})})};var da={primaryDimension:["Client","Customer","Category","Project"],secondaryDimension:["Person","Consultant","Owner","Name"],status:["Status","state"],date:["Date","WorkDate","CreatedAt"],description:["Description","Task","Title","Memo"],reportHours:["Report_Hour","Report Hours","Hours","ReportHours"],billableHours:["Billable_Hour","Billable Hours","BillableHours"],amount:["Amount","Billable_Amount","Total_Amount","Value"]},Tx=5,Rp=e=>e.toLowerCase().replace(/[\s_-]/g,""),ua=(e,t,o,r)=>{if(t)return t;if(e.length===0)return r;let a=Object.keys(e[0]),n=new Map(a.map(i=>[Rp(i),i]));for(let i of o){let c=n.get(Rp(i));if(c)return c}return a[0]||r},_o=e=>{if(typeof e=="number")return Number.isFinite(e)?e:0;if(typeof e=="string"){let t=Number(e.replace(/,/g,"").trim());return Number.isFinite(t)?t:0}return 0},Co=(e,t)=>e==null||e===""?t:String(e),Ix=(e,t,o,r,a)=>{let n=new Map;return e.forEach(i=>{let c=Co(i[t],a);n.set(c,(n.get(c)||0)+_o(i[o]));}),Array.from(n.entries()).map(([i,c])=>({name:i,value:c})).sort((i,c)=>c.value-i.value).slice(0,r)},Px=(e,t,o,r,a,n)=>{let i=new Map;return e.forEach(c=>{let d=Co(c[t],n),l=i.get(d)||{report:0,billable:0};l.report+=_o(c[o]),l.billable+=_o(c[r]),i.set(d,l);}),Array.from(i.entries()).map(([c,d])=>({name:c,value:d.report>0?d.billable/d.report*100:0})).sort((c,d)=>c.value-d.value).slice(0,a)},Rx=(e,t,o)=>{let r=e.length;if(r===0)return [];let a=new Map;return e.forEach(n=>{let i=Co(n[t],o);a.set(i,(a.get(i)||0)+1);}),Array.from(a.entries()).map(([n,i])=>({name:n,value:i,percent:i/r*100}))},Mp=(e,t,o)=>{let r=new Map;return e.forEach(a=>{let n=Co(a[t],"N/A");r.set(n,(r.get(n)||0)+_o(a[o]));}),Array.from(r.entries()).sort(([a],[n])=>a.localeCompare(n)).map(([a,n])=>({name:a,value:n}))},Mx=(e,t,o,r,a,n)=>{let i=new Map;return e.forEach(c=>{let d=Co(c[t],n),l=i.get(d)||{report:0,billable:0};l.report+=_o(c[o]),l.billable+=_o(c[r]),i.set(d,l);}),Array.from(i.entries()).map(([c,d])=>({name:c,barValue:d.billable,lineValue:d.report>0?d.billable/d.report*100:0})).sort((c,d)=>d.barValue-c.barValue).slice(0,a)},Dx=(e,t,o,r,a)=>{let n=new Map;return e.forEach(i=>{let c=Co(i[t],a),d=Co(i[o],a),l=`${c}__${d}`;n.set(l,(n.get(l)||0)+_o(i[r]));}),Array.from(n.entries()).map(([i,c])=>{let[d,l]=i.split("__");return {x:d,y:l,value:c}})},Ax=(e,t,o)=>{let r=Mp(e,t,o),a=r.map(i=>({name:i.name,value:i.value,type:"delta"})),n=r.reduce((i,c)=>i+c.value,0);return [...a,{name:"Total",value:n,type:"total"}]},Bx=(e,t,o,r,a,n)=>{let i=new Map;return e.forEach(c=>{let d=Co(c[t],n),l=`${Co(c[o],n)} / ${Co(c[r],n)}`,s=i.get(d)||new Map;s.set(l,(s.get(l)||0)+1),i.set(d,s);}),Array.from(i.entries()).map(([c,d])=>({title:c,causes:Array.from(d.entries()).sort((l,s)=>s[1]-l[1]).slice(0,a).map(([l,s])=>`${l} (${s})`)})).slice(0,6)},xn=({rows:e,config:t})=>{let{t:o}=le(),r=o("graph.unassigned"),a=Yt.useMemo(()=>{let s=t?.fieldMapping;return {primaryDimension:ua(e,s?.primaryDimension,da.primaryDimension,"Category"),secondaryDimension:ua(e,s?.secondaryDimension,da.secondaryDimension,"Owner"),status:ua(e,s?.status,da.status,"Status"),date:ua(e,s?.date,da.date,"Date"),description:ua(e,s?.description,da.description,"Description"),reportHours:ua(e,s?.reportHours,da.reportHours,"ReportHours"),billableHours:ua(e,s?.billableHours,da.billableHours,"BillableHours"),amount:ua(e,s?.amount,da.amount,"Amount")}},[e,t?.fieldMapping]),n=Yt.useMemo(()=>e.map((s,m)=>{let g=_o(s[a.reportHours]),p=_o(s[a.billableHours]),b=_o(s[a.amount]),y=g>0?p/g*100:0;return {id:`graph-row-${m}`,Date:Co(s[a.date],""),Primary:Co(s[a.primaryDimension],r),Secondary:Co(s[a.secondaryDimension],r),Description:Co(s[a.description],""),ReportHours:g,BillableHours:p,Amount:b,Efficiency:y,Status:Co(s[a.status],r)}}),[e,a,r]),i=Yt.useMemo(()=>{let s=n.length,m=n.reduce((x,f)=>x+_o(f.ReportHours),0),g=n.reduce((x,f)=>x+_o(f.BillableHours),0),p=n.reduce((x,f)=>x+_o(f.Amount),0),b=m>0?g/m*100:0,y=t?.statusFlagValues||["flag","flagged","warning","risk"],u=n.filter(x=>y.includes(Co(x.Status,"").toLowerCase())).length;return {totalRecords:s,totalReportHours:m,totalBillableHours:g,efficiency:b,totalAmount:p,flaggedCount:u}},[n,t?.statusFlagValues]),c=t?.topN||Tx,d=Yt.useMemo(()=>({billableByPrimary:Ix(n,"Primary","BillableHours",c,r),efficiencyBySecondary:Px(n,"Secondary","ReportHours","BillableHours",c,r),statusDistribution:Rx(n,"Status",r),lineByDate:Mp(n,"Date","BillableHours"),comboByPrimary:Mx(n,"Primary","ReportHours","BillableHours",c,r),heatmapPrimarySecondary:Dx(n,"Primary","Secondary","BillableHours",r),waterfallBillable:Ax(n,"Date","BillableHours"),fishboneStatusCauses:Bx(n,"Status","Primary","Secondary",3,r)}),[n,c,r]),l=Yt.useMemo(()=>({title:t?.title||o("graph.reportTitle"),kpis:i,charts:d,table:{columns:[{id:"Date",label:a.date},{id:"Primary",label:a.primaryDimension},{id:"Secondary",label:a.secondaryDimension},{id:"Description",label:a.description},{id:"ReportHours",label:o("graph.column.reportHours"),align:"right"},{id:"BillableHours",label:o("graph.column.billableHours"),align:"right"},{id:"Amount",label:"Amount",align:"right"},{id:"Efficiency",label:"Efficiency",align:"right"},{id:"Status",label:a.status}],rows:n}}),[d,t?.title,a,i,n,o]);return {fieldMapping:a,model:l}};var vn=e=>String(e??"").trim(),Wl=(e={})=>{let[t,o]=Yt.useState(e),r=Yt.useCallback((d,l)=>{o(s=>{let m=l?.trim();if(!m){let g={...s};return delete g[d],g}if(s[d]===m){let g={...s};return delete g[d],g}return {...s,[d]:m}});},[]),a=Yt.useCallback(d=>{o(l=>{if(!l[d])return l;let s={...l};return delete s[d],s});},[]),n=Yt.useCallback(()=>{o({});},[]),i=Yt.useMemo(()=>!!(t.primaryDimension||t.secondaryDimension||t.status),[t]),c=Yt.useCallback((d,l)=>d.filter(s=>!(t.primaryDimension&&vn(s[l.primaryDimension])!==vn(t.primaryDimension)||t.secondaryDimension&&vn(s[l.secondaryDimension])!==vn(t.secondaryDimension)||t.status&&vn(s[l.status])!==vn(t.status))),[t]);return {filters:t,setFilter:r,clearFilter:a,clearAll:n,hasActiveFilters:i,applyRows:c}};var $l=({variants:e,currentVariantId:t,onLoad:o,onSave:r,onDelete:a,onSetDefault:n})=>{let{t:i}=le(),d=material.useTheme().palette.mode==="dark",l="0.85rem",s={xs:"calc((100% - 1 * 16px) / 2)",sm:"calc((100% - 2 * 16px) / 3)",md:"calc((100% - 3 * 16px) / 4)",lg:"calc((100% - 5 * 16px) / 6)"},[m,g]=Yt.useState(false),[p,b]=Yt.useState(""),[y,u]=Yt.useState(false),[x,f]=Yt.useState(false),h=e.find(E=>E.id===t),v=()=>{b(h?.name||i("variant.newVariant")),u(h?.isDefault||false),f(h?.isPublic||false),g(true);},S=()=>{r({name:p,isDefault:y,isPublic:x,description:""}),g(false);};return jsxRuntime.jsxs(material.Box,{sx:{display:"flex",gap:1,alignItems:"center",width:"100%",maxWidth:"100%"},children:[jsxRuntime.jsx(material.Autocomplete,{size:"small",sx:{width:s,"& .MuiInputBase-root":{fontSize:l,bgcolor:d?"rgba(25, 118, 210, 0.2)":"#e7f1ff","& .MuiOutlinedInput-notchedOutline":{borderColor:d?"rgba(144,202,249,0.45)":"rgba(25,118,210,0.45)"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:d?"rgba(144,202,249,0.7)":"rgba(25,118,210,0.65)"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:d?"rgba(144,202,249,0.9)":"rgba(25,118,210,0.85)"}},"& .MuiInputBase-input":{fontSize:l},"& .MuiAutocomplete-noOptions":{fontSize:l}},noOptionsText:jsxRuntime.jsx(material.Typography,{sx:{fontSize:l},children:i("variant.noOptions")}),options:e,getOptionLabel:E=>E.name+(E.isDefault?` (${i("variant.defaultSuffix")})`:""),value:h||null,onChange:(E,P)=>{P&&o(P);},renderInput:E=>jsxRuntime.jsx(material.TextField,{...E,variant:"outlined",size:"small",InputProps:{...E.InputProps,sx:{fontSize:l,color:d?"#E3F2FD":"#0D47A1"}},placeholder:i("variant.selectVariant")}),renderOption:(E,P)=>{let{key:w,...D}=E;return jsxRuntime.jsx("li",{...D,children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",width:"100%"},children:[jsxRuntime.jsx(material.Typography,{sx:{flex:1,fontSize:l},children:P.name}),P.isDefault&&jsxRuntime.jsx(Ux__default.default,{fontSize:"small",color:"action"})]})},w)}}),jsxRuntime.jsx(material.Tooltip,{title:i("variant.saveView"),children:jsxRuntime.jsx(material.IconButton,{onClick:v,size:"small",color:"primary",children:jsxRuntime.jsx(Yp__default.default,{fontSize:"small"})})}),jsxRuntime.jsxs(material.Dialog,{open:m,onClose:()=>g(false),children:[jsxRuntime.jsx(material.DialogTitle,{children:i("variant.saveView")}),jsxRuntime.jsxs(material.DialogContent,{children:[jsxRuntime.jsx(material.TextField,{autoFocus:true,margin:"dense",label:i("variant.viewName"),fullWidth:true,variant:"outlined",value:p,onChange:E=>b(E.target.value)}),jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{checked:y,onChange:E=>u(E.target.checked)}),label:i("variant.setDefault")}),jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{checked:x,onChange:E=>f(E.target.checked)}),label:i("variant.publicAllUsers")})]}),jsxRuntime.jsxs(material.DialogActions,{children:[jsxRuntime.jsx(material.Button,{onClick:()=>g(false),children:i("common.cancel")}),jsxRuntime.jsx(material.Button,{onClick:S,variant:"contained",children:i("common.save")})]})]})]})};var zp=({appId:e,tableKey:t="default",currentFilters:o,currentLayoutId:r,layoutRefs:a,onLoad:n,variantService:i,serviceUrl:c,onError:d,onSuccess:l,currentVariantId:s,onVariantChange:m})=>{let{t:g}=le(),[p,b]=Yt.useState([]),[y,u]=Yt.useState(""),x=`orbcafe.variants.${e}.${t}`,f=s!==void 0?s:y,h=A=>{s===void 0&&u(A),m&&m(A);},v=Yt.useCallback(()=>{try{let A=localStorage.getItem(x);if(!A)return [];let T=JSON.parse(A);return Array.isArray(T)?T:[]}catch{return []}},[x]),S=Yt.useCallback(A=>{try{localStorage.setItem(x,JSON.stringify(A));}catch{}},[x]),E=Yt.useCallback(A=>{b(A);let T=A.find(R=>R.isDefault);T&&!f&&(h(T.id),n(T));},[f,n,h]),P=Yt.useCallback(async()=>{if(!e)return [];try{let A=[];if(i)A=await i.getVariants(e,t);else if(c){let T=await fetch(`${c}/api/variants?appId=${encodeURIComponent(e)}&tableKey=${encodeURIComponent(t)}`);if(!T.ok)throw new Error(g("variant.toast.fetchFailed"));A=await T.json();}else A=v();return E(A),A}catch(A){console.error("Error fetching variants",A);let T=v();return E(T),d&&d(g("variant.toast.fetchFailed")),T}},[e,t,i,c,v,E,d,g]);return Yt.useEffect(()=>{P();},[e,t]),jsxRuntime.jsx($l,{variants:p,currentVariantId:f,onLoad:A=>{h(A.id),n(A);},onSave:async A=>{let T=Date.now().toString(),R;try{let M=A.scope||"Both",Z=p.find(q=>q.name===A.name);T=Z?Z.id:Date.now().toString();let L=[];if(Z&&(Array.isArray(Z.filters)?L=[...Z.filters]:Z.filters&&(L=[{scope:"default",filters:Z.filters}])),M==="Search"||M==="Both"){let q=(Array.isArray(o),o);if(q)if(Array.isArray(q)&&q.length>0&&q[0].scope)q.forEach($=>{let ie=L.findIndex(ue=>ue.scope===$.scope);ie>=0?L[ie]=$:L.push($);});else {let $={scope:t,filters:q},ie=L.findIndex(ue=>ue.scope===t);ie>=0?L[ie]=$:L.push($);}}let ee=Z?.layout||{},H=[];if(Z&&Array.isArray(Z.layoutRefs)&&(H=[...Z.layoutRefs]),M==="Layout"||M==="Both")if(a&&a.length>0)a.forEach(q=>{let $=H.findIndex(ie=>ie.tableKey===q.tableKey);$>=0?H[$]=q:H.push(q);});else {let q={tableKey:t,layoutId:r||null},$=H.findIndex(ie=>ie.tableKey===t);$>=0?H[$]=q:H.push(q);}if(R={appId:e,tableKey:t,...A,scope:M,id:T,createdAt:new Date().toISOString(),filters:L,layout:ee,layoutRefs:H},i)await i.saveVariant(R,e,t);else if(c){if(!(await fetch(`${c}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(R)})).ok)throw new Error(g("variant.toast.saveFailed"))}else {let $=p.some(ie=>ie.id===T)?p.map(ie=>ie.id===T?R:ie):[...p,R];b($),S($);}l&&l(g("variant.toast.saveSuccess")),(i||c)&&await P(),h(T),n(R);}catch(M){console.error("Error saving variant",M);let L=p.some(ee=>ee.id===T)?p.map(ee=>ee.id===T?R:ee):[...p,R];b(L),S(L),h(T),n(R),d&&d(g("variant.toast.saveFailed"));}},onDelete:async A=>{try{if(i)await i.deleteVariant(A);else if(c){if(!(await fetch(`${c}/api/variants/${A}`,{method:"DELETE"})).ok)throw new Error(g("variant.toast.deleteFailed"))}else {let T=p.filter(R=>R.id!==A);b(T),S(T);}f===A&&h(""),(i||c)&&P(),l&&l(g("variant.toast.deleteSuccess"));}catch(T){console.error("Error deleting variant",T);let R=p.filter(M=>M.id!==A);b(R),S(R),f===A&&h(""),d&&d(g("variant.toast.deleteFailed"));}},onSetDefault:async A=>{try{let T=p.find(M=>M.id===A);if(!T)return;let R={appId:e,tableKey:t,...T,isDefault:!0};if(i)await i.setDefaultVariant(A,e,t);else if(c){if(!(await fetch(`${c}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(R)})).ok)throw new Error(g("variant.toast.defaultFailed"))}else {let M=p.map(Z=>({...Z,isDefault:Z.id===A}));b(M),S(M);}(i||c)&&await P(),l&&l(g("variant.toast.defaultSuccess"));}catch(T){console.error("Error setting default variant",T);let R=p.map(M=>({...M,isDefault:M.id===A}));b(R),S(R),d&&d(g("variant.toast.defaultFailed"));}}})};zr__default.default.extend(i0__default.default);zr__default.default.extend(l0__default.default);zr__default.default.extend(s0__default.default);var Ii="YYYY-MM-DD",c0=[null,null],Ea="0.85rem",d0={en:"en",zh:"zh-cn",fr:"fr",de:"de",ja:"ja",ko:"ko"},u0=material.styled(PickersDay.PickersDay,{shouldForwardProp:e=>e!=="isInRange"&&e!=="isStart"&&e!=="isEnd"&&e!=="isHovered"})(({theme:e,isInRange:t,isStart:o,isEnd:r,isHovered:a})=>({...t&&{borderRadius:0,backgroundColor:e.palette.primary.light,color:e.palette.primary.contrastText,"&:hover":{backgroundColor:e.palette.primary.main}},...a&&!t&&!o&&!r&&{borderRadius:0,backgroundColor:e.palette.action.hover,border:`1px dashed ${e.palette.primary.main}`},...o&&{borderRadius:"50% 0 0 50%",backgroundColor:e.palette.primary.main,color:e.palette.primary.contrastText,"&:hover":{backgroundColor:e.palette.primary.dark}},...r&&{borderRadius:"0 50% 50% 0",backgroundColor:e.palette.primary.main,color:e.palette.primary.contrastText,"&:hover":{backgroundColor:e.palette.primary.dark}},...o&&r&&{borderRadius:"50%"}})),Hp=({label:e,value:t=c0,onChange:o})=>{let{t:r,locale:a}=le(),n=d0[a]||"en",i=e||r("dateRange.label"),[c,d]=Yt.useState(null),[l,s]=Yt.useState(t),[m,g]=Yt.useState("start"),[p,b]=Yt.useState(null),[y,u]=Yt.useState((t[0]||zr__default.default()).locale(n)),[x,f]=Yt.useState(""),[h,v]=Yt.useState(""),[S,E]=Yt.useState(false),[P,w]=Yt.useState(false),D=Yt__namespace.default.useRef(t);Yt.useEffect(()=>{let[$,ie]=t,[ue,Ce]=D.current,te=de=>de&&typeof de.isSame=="function",j=!($===null&&ue===null||te($)&&te(ue)&&$.isSame(ue,"day")),Y=!(ie===null&&Ce===null||te(ie)&&te(Ce)&&ie.isSame(Ce,"day"));(j||Y)&&(s(t),t[0]&&te(t[0])&&u(t[0].locale(n))),D.current=t;},[t,n]),Yt.useEffect(()=>{f(l[0]?l[0].locale(n).format(Ii):""),v(l[1]?l[1].locale(n).format(Ii):""),E(false),w(false);},[l,n]);let I=($,ie)=>{let ue=ie.trim(),Ce=$==="start"?E:w;if(!ue){let Y=$==="start"?[null,l[1]]:[l[0],null];Ce(false),s(Y);return}let te=zr__default.default(ue,Ii,true).locale(n);if(!te.isValid()){Ce(true);return}Ce(false);let j=[...l];if($==="start")j[0]=te,j[1]&&te.isAfter(j[1],"day")&&(j[1]=null),g(j[1]?"start":"end");else {let Y=j[0];Y&&te.isBefore(Y,"day")?(j=[te,null],g("end")):(j[1]=te,g("start"));}s(j),u(te);},k=$=>{d($.currentTarget);},A=()=>{d(null),g("start"),b(null);},T=!!c,R=$=>{if(!$)return;let ie=[...l];if(m==="start")ie=[$,null],g("end");else {let ue=ie[0];ue&&$.isBefore(ue)?(ie=[$,null],g("end")):(ie=[ue,$],g("start"));}s(ie);},M=$=>{let ie=zr__default.default().locale(n),ue=[null,null];switch($){case "today":ue=[ie,ie];break;case "week":ue=[ie.startOf("week"),ie.endOf("week")];break;case "month":ue=[ie.startOf("month"),ie.endOf("month")];break}s(ue),g("start"),u(ie);},Z=()=>{s([null,null]),g("start"),u(zr__default.default().locale(n));},L=()=>{o&&o(l),A();},ee=()=>{s(t),g("start"),A();},H=Yt.useCallback($=>{let{day:ie,...ue}=$,[Ce,te]=l,j=Ce?ie.isSame(Ce,"day"):false,Y=te?ie.isSame(te,"day"):false,de=Ce&&te?ie.isBetween(Ce,te,"day","()"):false,We=false;return m==="end"&&Ce&&!te&&p&&ie.isAfter(Ce,"day")&&ie.isBefore(p.add(1,"day"),"day")&&(We=true),jsxRuntime.jsx(u0,{...ue,day:ie,disableMargin:true,isStart:j,isEnd:Y,isInRange:de||We,onMouseEnter:()=>b(ie)})},[l,m,p]),q=$=>$?$.locale(n).format("YYYY-MM-DD"):"";return jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsx(material.TextField,{label:i,value:l[0]?`${q(l[0])} - ${q(l[1])}`:"",onClick:k,fullWidth:true,size:"small",InputLabelProps:{sx:{fontSize:Ea}},InputProps:{readOnly:true,sx:{fontSize:Ea,"& .MuiOutlinedInput-input":{fontSize:Ea},paddingRight:"4px"},endAdornment:jsxRuntime.jsxs(material.InputAdornment,{position:"end",sx:{ml:0},children:[(l[0]||l[1])&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:$=>{$.stopPropagation(),Z();},edge:"end",sx:{mr:.5,padding:"2px"},children:jsxRuntime.jsx(Pb__default.default,{sx:{fontSize:"1rem"}})}),jsxRuntime.jsx(material.IconButton,{size:"small",edge:"end",onClick:k,sx:{padding:"2px"},children:jsxRuntime.jsx(r0__default.default,{sx:{fontSize:"1rem"},color:"action"})})]})}}),jsxRuntime.jsxs(material.Popover,{open:T,anchorEl:c,onClose:A,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{sx:{display:"flex",flexDirection:"column",p:0,width:320}}},children:[jsxRuntime.jsx(material.Box,{sx:{p:2,bgcolor:"background.default",borderBottom:1,borderColor:"divider"},children:jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:1.5,justifyContent:"space-between",children:[jsxRuntime.jsx(material.TextField,{label:r("dateRange.startDate"),placeholder:Ii,value:x,error:S,size:"small",onFocus:()=>g("start"),onChange:$=>{f($.target.value),S&&E(false);},onBlur:()=>I("start",x),onKeyDown:$=>{$.key==="Enter"&&($.preventDefault(),I("start",x));},sx:{flex:1,"& .MuiInputBase-input":{fontSize:Ea,py:.75},"& .MuiInputLabel-root":{fontSize:Ea}}}),jsxRuntime.jsx(n0__default.default,{color:"action",fontSize:"small"}),jsxRuntime.jsx(material.TextField,{label:r("dateRange.endDate"),placeholder:Ii,value:h,error:P,size:"small",onFocus:()=>{l[0]&&g("end");},onChange:$=>{v($.target.value),P&&w(false);},onBlur:()=>I("end",h),onKeyDown:$=>{$.key==="Enter"&&($.preventDefault(),I("end",h));},sx:{flex:1,"& .MuiInputBase-input":{fontSize:Ea,py:.75},"& .MuiInputLabel-root":{fontSize:Ea}}})]})}),jsxRuntime.jsx(material.Box,{sx:{p:2,pb:0},children:jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,justifyContent:"center",children:[jsxRuntime.jsx(material.Chip,{label:r("dateRange.today"),onClick:()=>M("today"),clickable:true,size:"small",variant:"outlined"}),jsxRuntime.jsx(material.Chip,{label:r("dateRange.thisWeek"),onClick:()=>M("week"),clickable:true,size:"small",variant:"outlined"}),jsxRuntime.jsx(material.Chip,{label:r("dateRange.thisMonth"),onClick:()=>M("month"),clickable:true,size:"small",variant:"outlined"})]})}),jsxRuntime.jsx(LocalizationProvider.LocalizationProvider,{dateAdapter:AdapterDayjs.AdapterDayjs,adapterLocale:n,children:jsxRuntime.jsx(DateCalendar.DateCalendar,{value:null,referenceDate:y,onMonthChange:u,onYearChange:u,onChange:R,slots:{day:H},views:["year","month","day"],openTo:"day",showDaysOutsideCurrentMonth:true,sx:{m:0}})}),jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsxs(material.Stack,{direction:"row",justifyContent:"flex-end",spacing:1,sx:{p:2},children:[jsxRuntime.jsx(material.Button,{size:"small",onClick:ee,color:"inherit",children:r("common.cancel")}),jsxRuntime.jsx(material.Button,{size:"small",variant:"contained",onClick:L,children:r("common.done")})]})]})]})};var _l={equals:"=",contains:"\u2287",notContains:"\u2285",wildcard:"*","=":"=","!=":"!=",">":">","<":"<",">=":"\u2265","<=":"\u2264",between:"\u2194"},S0={equals:"smartFilter.operator.equals",contains:"smartFilter.operator.contains",notContains:"smartFilter.operator.notContains",wildcard:"smartFilter.operator.wildcard","=":"smartFilter.operator.equals","!=":"smartFilter.operator.notEquals",">":"smartFilter.operator.greaterThan","<":"smartFilter.operator.lessThan",">=":"smartFilter.operator.greaterOrEqual","<=":"smartFilter.operator.lessOrEqual",between:"smartFilter.operator.between"},k0=["equals","contains","notContains","wildcard"],Up=["=","!=",">","<",">=","<=","between"],Ut="0.85rem",w0=({field:e,value:t,onChange:o})=>{let{t:r}=le(),[a,n]=Yt.useState(null),[i,c]=Yt.useState(null),[d,l]=Yt.useState(""),[s,m]=Yt.useState(""),[g,p]=Yt.useState(false),[b,y]=Yt.useState(""),[u,x]=Yt.useState("");Yt.useEffect(()=>{let k=setTimeout(()=>{x(b);},1e3);return ()=>clearTimeout(k)},[b]);let f=t?.operator||(e.type==="number"?"=":"equals"),h=t?.value,v=k=>{let A=S0[k];return A?r(A):k},S=k=>{n(k.currentTarget);},E=k=>{o({...t,operator:k,value:h}),n(null);},P={size:"small",fullWidth:true,variant:"outlined",InputLabelProps:{sx:{fontSize:Ut}},InputProps:{sx:{fontSize:Ut}},SelectProps:{MenuProps:{PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:Ut,paddingTop:"4px",paddingBottom:"4px",minHeight:"auto"}}}}}},w=e.type||"text";if(w==="date"){let A=(T=>{if(!T)return [null,null];if(Array.isArray(T)&&T.length===2){let R=T[0]?zr__default.default.isDayjs(T[0])?T[0]:zr__default.default(T[0]):null,M=T[1]?zr__default.default.isDayjs(T[1])?T[1]:zr__default.default(T[1]):null;return [R,M]}return zr__default.default.isDayjs(T)||typeof T=="string"?[zr__default.default.isDayjs(T)?T:zr__default.default(T),null]:[null,null]})(h);return jsxRuntime.jsx(Hp,{label:e.label,value:A,onChange:T=>o({value:T,operator:"between"})})}if(w==="number"&&f==="between"){let k=()=>{o({value:[d,s],operator:"between"}),c(null);},A=Array.isArray(h)?`${h[0]||""} - ${h[1]||""}`:"";return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.TextField,{...P,label:e.label,value:A,placeholder:r("smartFilter.minMaxPlaceholder"),InputProps:{...P.InputProps,startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(material.Tooltip,{title:v("between"),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:S,sx:{width:24,height:24,fontSize:Ut},children:_l.between})})}),readOnly:true},onClick:T=>c(T.currentTarget)}),jsxRuntime.jsx(material.Menu,{anchorEl:a,open:!!a,onClose:()=>n(null),PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:Ut,minHeight:"auto",py:.5}}},children:Up.map(T=>jsxRuntime.jsxs(material.MenuItem,{selected:T===f,onClick:()=>E(T),children:[jsxRuntime.jsx(material.Box,{sx:{width:24,display:"inline-block",fontWeight:"bold"},children:_l[T]}),jsxRuntime.jsx(material.ListItemText,{primary:v(T),primaryTypographyProps:{fontSize:Ut}})]},T))}),jsxRuntime.jsx(material.Popover,{open:!!i,anchorEl:i,onClose:()=>c(null),anchorOrigin:{vertical:"bottom",horizontal:"left"},children:jsxRuntime.jsxs(material.Box,{sx:{p:2,display:"flex",gap:1,alignItems:"center"},children:[jsxRuntime.jsx(material.TextField,{size:"small",label:r("smartFilter.min"),type:"number",value:d,onChange:T=>l(T.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:Ut}},InputProps:{sx:{fontSize:Ut}}}),jsxRuntime.jsx(C0__default.default,{color:"action"}),jsxRuntime.jsx(material.TextField,{size:"small",label:r("smartFilter.max"),type:"number",value:s,onChange:T=>m(T.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:Ut}},InputProps:{sx:{fontSize:Ut}}}),jsxRuntime.jsx(material.Button,{variant:"contained",size:"small",onClick:k,children:r("common.ok")})]})})]})}if(e.isValueHelp||w==="value-help"){let k=e.valueHelp?.mode||"single";return jsxRuntime.jsx(Vu,{...P,...e.valueHelp,label:e.label,placeholder:e.placeholder||e.valueHelp?.placeholder,value:h??(k==="multiple"?[]:null),mode:k,onChange:A=>o({value:A,operator:k==="multiple"?"anyOf":"equals"})})}if(w==="select")return jsxRuntime.jsxs(material.TextField,{...P,select:true,label:e.label,value:h||"",onChange:k=>o({...t,value:k.target.value,operator:"equals"}),children:[jsxRuntime.jsx(material.MenuItem,{value:"",children:jsxRuntime.jsx("em",{children:r("common.none")})}),e.options?.map(k=>jsxRuntime.jsx(material.MenuItem,{value:k.value,children:k.label},k.value))]});if(w==="multi-select"){let k=Array.isArray(h)?h:[],A=e.options?.filter(T=>T.label.toLowerCase().includes(u.toLowerCase()))||[];return jsxRuntime.jsxs(material.TextField,{...P,select:true,label:e.label,value:k,onChange:T=>o({...t,value:T.target.value,operator:"anyOf"}),SelectProps:{...P.SelectProps,multiple:true,onClose:()=>{y(""),x("");},renderValue:T=>{if(!Array.isArray(T)||T.length===0)return jsxRuntime.jsx("em",{children:r("common.none")});let R=Z=>e.options?.find(L=>L.value===Z)?.label||Z,M=T.map(R);return M.length>2?`${M.slice(0,2).join(", ")} +${M.length-2}`:M.join(", ")}},children:[jsxRuntime.jsx(material.ListSubheader,{children:jsxRuntime.jsx(material.TextField,{size:"small",autoFocus:true,placeholder:r("smartFilter.searchPlaceholder"),fullWidth:true,InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(Lu__default.default,{fontSize:"small"})}),sx:{fontSize:Ut}},value:b,onChange:T=>y(T.target.value),onKeyDown:T=>{T.key!=="Escape"&&T.stopPropagation();},onClick:T=>T.stopPropagation()})}),A.length>0?A.map(T=>jsxRuntime.jsxs(material.MenuItem,{value:T.value,children:[jsxRuntime.jsx(material.Checkbox,{checked:k.indexOf(T.value)>-1,size:"small"}),jsxRuntime.jsx(material.ListItemText,{primary:T.label,primaryTypographyProps:{fontSize:Ut}})]},T.value)):jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.ListItemText,{primary:r("smartFilter.noOptionsFound"),primaryTypographyProps:{fontSize:Ut}})})]})}let D=w==="number"?Up:k0,I=g||h!==void 0&&h!==""&&h!==null||!!a;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.TextField,{...P,label:e.label,sx:{minWidth:"120px"},value:h||"",type:w==="number"?"number":"text",onChange:k=>o({...t,value:k.target.value,operator:f}),onFocus:()=>p(true),onBlur:()=>p(false),InputProps:{...P.InputProps,startAdornment:I?jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(material.Tooltip,{title:v(f),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:S,onMouseDown:k=>k.preventDefault(),sx:{width:24,height:24,fontSize:Ut,fontWeight:"bold",color:"primary.main",bgcolor:"action.hover"},children:_l[f]})})}):null,endAdornment:e.hasSearchIcon?jsxRuntime.jsx(material.InputAdornment,{position:"end",children:jsxRuntime.jsx(Lu__default.default,{color:"action"})}):void 0}}),jsxRuntime.jsx(material.Menu,{anchorEl:a,open:!!a,onClose:()=>n(null),PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:Ut,minHeight:"auto",py:.5}}},children:D.map(k=>jsxRuntime.jsxs(material.MenuItem,{selected:k===f,onClick:()=>E(k),children:[jsxRuntime.jsx(material.Box,{sx:{width:24,display:"inline-block",fontWeight:"bold"},children:_l[k]}),jsxRuntime.jsx(material.ListItemText,{primary:v(k),primaryTypographyProps:{fontSize:Ut}})]},k))})]})},$r=({fields:e,filters:t,onFilterChange:o,variants:r=[],currentVariantId:a,onVariantLoad:n,onVariantSave:i,onVariantDelete:c,onVariantSetDefault:d,onSearch:l,loading:s=false,appId:m,tableKey:g,currentLayout:p,currentLayoutId:b,layoutRefs:y,variantService:u,serviceUrl:x})=>{let{t:f}=le(),[h,v]=Yt.useState(true),[S,E]=Yt.useState(null),[P,w]=Yt.useState(e.filter(A=>!A.hidden).map(A=>A.id)),D=(A,T)=>{o({...t,[A]:T});},I=A=>{P.includes(A)?w(P.filter(T=>T!==A)):w([...P,A]);};return jsxRuntime.jsxs(material.Paper,{sx:{mb:0,display:"flex",flexDirection:"column",overflow:"visible",position:"relative"},children:[jsxRuntime.jsxs(material.Box,{sx:{p:2,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[m?jsxRuntime.jsx(zp,{appId:m,tableKey:g,currentFilters:{values:t,visibleFields:P},currentLayout:p,currentLayoutId:b,layoutRefs:y,onLoad:A=>{if(!A.filters)return;let T=null;if(Array.isArray(A.filters)){let R=g||"default",M=A.filters.find(Z=>Z.scope===R);T=M?M.filters:null;}else T=A.filters;T&&(T.values||T.visibleFields?(T.visibleFields&&Array.isArray(T.visibleFields)&&w(T.visibleFields),T.values&&o(T.values)):o(T)),n&&n(A);},variantService:u,serviceUrl:x,currentVariantId:a}):jsxRuntime.jsx($l,{variants:r,currentVariantId:a,onLoad:n,onSave:A=>{i&&i({...A,filters:{values:t,visibleFields:P}});},onDelete:c,onSetDefault:d}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[jsxRuntime.jsx(material.Tooltip,{title:f("smartFilter.addFilters"),children:jsxRuntime.jsx(material.Button,{onClick:A=>E(A.currentTarget),size:"small",color:"primary",startIcon:jsxRuntime.jsx(y0__default.default,{fontSize:"small"}),sx:{textTransform:"none",fontSize:Ut,whiteSpace:"nowrap",minWidth:"fit-content"},children:f("smartFilter.adaptFilters")})}),jsxRuntime.jsx(material.Button,{variant:"contained",size:"small",onClick:l,disabled:s,sx:{minWidth:"52px",fontWeight:"bold",fontSize:Ut},children:f(s?"common.loading":"smartFilter.go")}),jsxRuntime.jsxs(material.Menu,{anchorEl:S,open:!!S,onClose:()=>E(null),slotProps:{paper:{style:{maxHeight:400,width:"25ch"},sx:{"& .MuiMenuItem-root":{fontSize:Ut,minHeight:32}}}},children:[jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.ListItemText,{primary:f("smartFilter.visibleFilters"),primaryTypographyProps:{fontSize:Ut}})}),jsxRuntime.jsx(material.Divider,{}),e.map(A=>jsxRuntime.jsxs(material.MenuItem,{onClick:()=>I(A.id),children:[jsxRuntime.jsx(material.Checkbox,{checked:P.includes(A.id),size:"small"}),jsxRuntime.jsx(material.ListItemText,{primary:A.label,primaryTypographyProps:{fontSize:Ut}})]},A.id))]})]})]}),jsxRuntime.jsx(material.Collapse,{in:h,children:jsxRuntime.jsx(material.Box,{sx:{px:2,pb:2},children:jsxRuntime.jsx(material.Grid,{container:true,spacing:2,columns:{xs:2,sm:3,md:4,lg:6},children:e.filter(A=>P.includes(A.id)).map(A=>jsxRuntime.jsx(material.Grid,{size:1,children:jsxRuntime.jsx(w0,{field:A,value:t[A.id]||{value:"",operator:A.type==="number"?"=":"equals"},onChange:T=>D(A.id,T)})},A.id))})})}),jsxRuntime.jsx(material.Box,{sx:{position:"absolute",bottom:0,left:"50%",transform:"translate(-50%, 50%)",zIndex:10},children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>v(!h),sx:{bgcolor:"background.paper",boxShadow:2,border:"1px solid",borderColor:"divider",width:30,height:30,minWidth:30,minHeight:0,p:0,"&:hover":{bgcolor:"background.paper"}},children:h?jsxRuntime.jsx(x0__default.default,{sx:{fontSize:20},color:"action"}):jsxRuntime.jsx(vy__default.default,{sx:{fontSize:20},color:"action"})})})]})};var Qp=({layouts:e,currentLayoutId:t,onLoad:o,onSave:r,onDelete:a,onSetDefault:n})=>{let{t:i}=le(),[c,d]=Yt.useState(null),[l,s]=Yt.useState(false),[m,g]=Yt.useState(""),[p,b]=Yt.useState(""),[y,u]=Yt.useState({isDefault:false,isPublic:false}),x=e.find(P=>P.id===t),f=P=>{d(P.currentTarget);},h=()=>{d(null);},v=P=>{o(P),h();},S=()=>{g(""),b(""),u({isDefault:false,isPublic:false}),s(true),h();},E=()=>{m.trim()&&(r({name:m,description:p,...y}),s(false));};return jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[jsxRuntime.jsx(material.Tooltip,{title:i("layout.saveLayout"),children:jsxRuntime.jsx(material.IconButton,{onClick:S,color:"primary",size:"small",children:jsxRuntime.jsx(Yp__default.default,{fontSize:"small"})})}),jsxRuntime.jsx(material.Tooltip,{title:i("layout.layoutOptions"),children:jsxRuntime.jsx(material.IconButton,{onClick:f,color:x?"primary":"default",size:"small",children:jsxRuntime.jsx(N0__default.default,{fontSize:"small"})})}),jsxRuntime.jsxs(material.Menu,{anchorEl:c,open:!!c,onClose:h,PaperProps:{sx:{width:320,maxHeight:400}},children:[jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.Typography,{variant:"caption",children:i("layout.selectLayout")})}),jsxRuntime.jsxs(material.MenuItem,{onClick:S,children:[jsxRuntime.jsx(material.ListItemIcon,{children:jsxRuntime.jsx(Yp__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{children:i("layout.saveCurrentLayout")})]}),jsxRuntime.jsx(material.Divider,{}),e.length===0&&jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:i("layout.noSavedLayouts")})}),e.map((P,w)=>jsxRuntime.jsx(material.MenuItem,{onClick:()=>v(P),selected:P.id===t,children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",width:"100%",justifyContent:"space-between"},children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",overflow:"hidden",mr:1},children:[jsxRuntime.jsx(material.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:jsxRuntime.jsx(material.Typography,{variant:"body2",fontWeight:P.id===t?"bold":"normal",noWrap:true,children:P.name})}),P.description&&jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",noWrap:true,children:P.description})]}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center"},onClick:D=>D.stopPropagation(),children:[jsxRuntime.jsx(material.Tooltip,{title:P.isDefault?i("layout.removeDefault"):i("layout.setAsDefault"),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:D=>{D.stopPropagation(),n(P.id);},children:P.isDefault?jsxRuntime.jsx(Ux__default.default,{fontSize:"small",color:"warning"}):jsxRuntime.jsx(L0__default.default,{fontSize:"small"})})}),jsxRuntime.jsx(material.Tooltip,{title:i("common.delete"),children:jsxRuntime.jsx(material.IconButton,{size:"small",color:"error",onClick:D=>{D.stopPropagation(),a(P.id);},children:jsxRuntime.jsx(Yb__default.default,{fontSize:"small"})})})]})]})},P.id||w))]}),jsxRuntime.jsxs(material.Dialog,{open:l,onClose:()=>s(false),maxWidth:"xs",fullWidth:true,children:[jsxRuntime.jsx(material.DialogTitle,{children:i("layout.saveLayout")}),jsxRuntime.jsx(material.DialogContent,{children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:2,mt:1},children:[jsxRuntime.jsx(material.TextField,{label:i("layout.layoutName"),value:m,onChange:P=>g(P.target.value),fullWidth:true,autoFocus:true,size:"small",helperText:i("layout.layoutNameHelper")}),e.some(P=>P.name===m)&&jsxRuntime.jsx(material.Typography,{variant:"caption",color:"warning.main",sx:{ml:1},children:i("layout.warningOverwrite")}),jsxRuntime.jsx(material.TextField,{label:i("layout.layoutDescription"),value:p,onChange:P=>b(P.target.value),fullWidth:true,size:"small"}),jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{checked:y.isDefault,onChange:P=>u({...y,isDefault:P.target.checked})}),label:i("layout.useAsDefault")}),jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{checked:y.isPublic,onChange:P=>u({...y,isPublic:P.target.checked})}),label:i("layout.publicAllUsers")})]})}),jsxRuntime.jsxs(material.DialogActions,{children:[jsxRuntime.jsx(material.Button,{onClick:()=>s(false),children:i("common.cancel")}),jsxRuntime.jsx(material.Button,{onClick:E,variant:"contained",disabled:!m,children:i("common.save")})]})]})]})};var wn=({appId:e,tableKey:t="default",currentLayoutData:o,onLayoutLoad:r,targetLayoutId:a,activeLayoutId:n,serviceUrl:i,onError:c,onSuccess:d})=>{let{t:l}=le(),[s,m]=Yt.useState([]),[g,p]=Yt.useState(""),b=`orbcafe.layouts.${e}.${t}`,y=w=>({id:w.layoutId,name:w.name,description:w.description??"",isDefault:!!w.isDefault,isPublic:!!w.isPublic,createdAt:w.createdAt??new Date().toISOString(),layoutData:w.layout??{}}),u=w=>({appId:e,tableKey:t,layoutId:w.id,name:w.name,description:w.description??"",isDefault:!!w.isDefault,isPublic:!!w.isPublic,createdAt:w.createdAt,layout:w.layoutData}),x=Yt.useCallback(()=>{try{let w=localStorage.getItem(b);if(!w)return [];let D=JSON.parse(w);return Array.isArray(D)?D:[]}catch{return []}},[b]),f=Yt.useCallback(w=>{try{localStorage.setItem(b,JSON.stringify(w));}catch{}},[b]);Yt.useEffect(()=>{n!==void 0&&p(n);},[n]),Yt.useEffect(()=>{if(a&&s.length>0){let w=s.find(D=>D.id===a);w&&(p(w.id),r(w));}},[a,s,r]);let h=Yt.useCallback(async()=>{if(e){if(!i){let w=x();m(w);let D=w.find(I=>I.isDefault);D&&!g&&!a&&(p(D.id),r(D));return}try{let w=await fetch(`${i}/api/layouts?appId=${encodeURIComponent(e)}&tableKey=${encodeURIComponent(t)}`);if(!w.ok)throw new Error("LAYOUT_FETCH_FAILED");let I=(await w.json()).map(y);m(I);let k=I.find(A=>A.isDefault);k&&!g&&!a&&(p(k.id),r(k));}catch(w){console.error("Error fetching layouts",w);let D=x();m(D);let I=D.find(k=>k.isDefault);I&&!g&&!a&&(p(I.id),r(I)),c&&c(l("layout.toast.loadFallback"));}}},[e,t,i,c,g,r,a,x,l]);return Yt.useEffect(()=>{h();},[e,t]),jsxRuntime.jsx(Qp,{layouts:s,currentLayoutId:g,onLoad:w=>{p(w.id),r(w);},onSave:async w=>{let D=s.find(A=>A.name===w.name),I=D?D.id:Date.now().toString(),k={id:I,...w,createdAt:new Date().toISOString(),layoutData:o,isDefault:w.isDefault??false,isPublic:w.isPublic??false};if(!i){let T=s.some(R=>R.id===I)?s.map(R=>R.id===I?k:R):[...s,k];m(T),f(T),p(I),r(k),d&&d(l("layout.toast.saveLocalSuccess"));return}try{if(!(await fetch(`${i}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(u(k))})).ok)throw new Error("LAYOUT_SAVE_FAILED");d&&d(l("layout.toast.saveSuccess")),await h(),p(I),r(k);}catch(A){console.error("Error saving layout",A);let R=s.some(M=>M.id===I)?s.map(M=>M.id===I?k:M):[...s,k];m(R),f(R),p(I),r(k),d&&d(l("layout.toast.saveLocalSuccess")),c&&c(l("layout.toast.backendUnavailableSavedLocal"));}},onDelete:async w=>{if(!i){let D=s.filter(I=>I.id!==w);m(D),f(D),g===w&&p(""),d&&d(l("layout.toast.deleteLocalSuccess"));return}try{if(!(await fetch(`${i}/api/layouts/${encodeURIComponent(w)}`,{method:"DELETE"})).ok)throw new Error("LAYOUT_DELETE_FAILED");g===w&&p(""),d&&d(l("layout.toast.deleteSuccess")),await h();}catch(D){console.error("Error deleting layout",D);let I=s.filter(k=>k.id!==w);m(I),f(I),g===w&&p(""),d&&d(l("layout.toast.deleteLocalSuccess")),c&&c(l("layout.toast.backendUnavailableDeletedLocal"));}},onSetDefault:async w=>{if(!i){let D=s.map(I=>({...I,isDefault:I.id===w}));m(D),f(D),d&&d(l("layout.toast.defaultLocalSuccess"));return}try{let D=s.find(k=>k.id===w);if(!D)return;if(!(await fetch(`${i}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(u({...D,isDefault:!0}))})).ok)throw new Error("LAYOUT_DEFAULT_FAILED");d&&d(l("layout.toast.defaultSuccess")),await h();}catch(D){console.error("Error setting default",D);let I=s.map(k=>({...k,isDefault:k.id===w}));m(I),f(I),d&&d(l("layout.toast.defaultLocalSuccess")),c&&c(l("layout.toast.backendUnavailableDefaultLocal"));}}})};var em=(e,t)=>{if(!e||!e.filters)return null;if(Array.isArray(e.filters)){let o=e.filters.find(a=>a.scope===t);if(o)return o.filters;let r=e.filters.find(a=>a.scope==="default");return r?r.filters:null}return typeof e.filters=="object"?e.filters:null},Xl=(e,t)=>{if(!e)return {layout:null,layoutId:null};let o=null,r=null;if(Array.isArray(e.layoutRefs)){let a=e.layoutRefs.find(n=>n.tableKey===t);a&&(o=a.layoutId);}return !o&&e.layoutId&&(o=e.layoutId),e.layout&&typeof e.layout=="object"&&!Array.isArray(e.layout)&&(r=e.layout),{layoutId:o,layout:r}};function tm(e,t,o){return t[o]<e[o]?-1:t[o]>e[o]?1:0}function O0(e,t){return e==="desc"?(o,r)=>tm(o,r,t):(o,r)=>-tm(o,r,t)}function V0(e,t){let o=e.map((r,a)=>[r,a]);return o.sort((r,a)=>{let n=t(r[0],a[0]);return n!==0?n:r[1]-a[1]}),o.map(r=>r[0])}var Tn=e=>{let t=!!e.disableGrouping,o=!!e.disableSorting,r=Yt.useCallback(O=>{let _=String(O?.label??O?.id??"").length*9+64,fe=typeof O?.minWidth=="number"?O.minWidth:0;return Math.max(100,fe,_)},[]),a=Yt.useCallback(()=>(e.columns||[]).filter(O=>!!O?.numeric).map(O=>O.id),[e.columns]),[n,i]=Yt.useState(""),[c,d]=Yt.useState(e.order||"asc"),[l,s]=Yt.useState(e.orderBy||""),[m,g]=Yt.useState([]),[p,b]=Yt.useState(e.page||0),[y,u]=Yt.useState(e.rowsPerPage||20),[x,f]=Yt.useState(e.selected||[]),[h,v]=Yt.useState(e.columns?e.columns.map(O=>O.id):[]),[S,E]=Yt.useState(e.columns?e.columns.map(O=>O.id):[]),[P,w]=Yt.useState(e.showSummary||false),[D,I]=Yt.useState(()=>a()),[k,A]=Yt.useState([]),[T,R]=Yt.useState(new Set),[M,Z]=Yt.useState(()=>{let O={};return (e.columns||[]).forEach(W=>{O[W.id]=r(W);}),O}),[L,ee]=Yt.useState(null),[H,q]=Yt.useState(null),[$,ie]=Yt.useState(null),[ue,Ce]=Yt.useState(null),[te,j]=Yt.useState(false),[Y,de]=Yt.useState(""),[We,$e]=Yt.useState(""),me=t?[]:k,Ne=Yt.useCallback(O=>{if(t){A([]),R(new Set),q(null);return}A(O);},[t]);Yt.useEffect(()=>{t&&(A([]),R(new Set),q(null));},[t]),Yt.useEffect(()=>{o&&(d("asc"),s(""),g([]));},[o]),Yt.useEffect(()=>{e.layout&&ht(e.layout);},[e.layout]),Yt.useEffect(()=>{if(o){d("asc"),s("");return}e.order!==void 0&&d(e.order),e.orderBy!==void 0&&s(e.orderBy);},[e.order,e.orderBy,o]),Yt.useEffect(()=>{e.selected!==void 0&&f(e.selected);},[e.selected]),Yt.useEffect(()=>{e.page!==void 0&&b(e.page);},[e.page]),Yt.useEffect(()=>{e.rowsPerPage!==void 0&&u(e.rowsPerPage);},[e.rowsPerPage]),Yt.useEffect(()=>{let O=a();I(W=>W.filter(fe=>O.includes(fe)));},[a]),Yt.useEffect(()=>{Z(O=>{let W={...O};return (e.columns||[]).forEach(_=>{W[_.id]===void 0&&(W[_.id]=r(_));}),W});},[e.columns,r]),Yt.useEffect(()=>{E(O=>{let W=(e.columns||[]).map(Ze=>Ze.id),_=new Set(W),fe=O.filter(Ze=>_.has(Ze)),ge=new Set(fe),Ae=W.filter(Ze=>!ge.has(Ze)),je=[...fe,...Ae];return je.length===O.length&&je.every((Ze,tt)=>Ze===O[tt])?O:je});},[e.columns]);let rt=Yt.useMemo(()=>{let O=e.columns||[];if(S.length===0)return O;let W=new Map(O.map(ge=>[ge.id,ge])),_=[],fe=new Set;return S.forEach(ge=>{let Ae=W.get(ge);Ae&&(_.push(Ae),fe.add(ge));}),O.forEach(ge=>{fe.has(ge.id)||_.push(ge);}),_},[e.columns,S]),he=Yt.useMemo(()=>{let O=e.rows||[];return n&&(O=O.filter(W=>Object.keys(W).some(_=>String(W[_]).toLowerCase().includes(n.toLowerCase())))),O},[e.rows,n]),Le=Yt.useMemo(()=>{if(o||e.onSortChange)return he;if(m.length>0){let O=[...he];return O.sort((W,_)=>{for(let fe of m){let ge=W?.[fe.field],Ae=_?.[fe.field];if(!(ge==null&&Ae==null)){if(ge==null)return fe.direction==="asc"?-1:1;if(Ae==null)return fe.direction==="asc"?1:-1;if(ge<Ae)return fe.direction==="asc"?-1:1;if(ge>Ae)return fe.direction==="asc"?1:-1}}return 0}),O}return l?V0(he,O0(c,l)):he},[he,c,l,m,e.onSortChange,o]),He=Yt.useCallback(O=>{if(me.length===0)return O.map(Ae=>({type:"row",data:Ae,id:Ae[e.rowKey||"id"]}));let W=[...O].sort((Ae,je)=>{for(let Ze of me){if(Ae[Ze]<je[Ze])return -1;if(Ae[Ze]>je[Ze])return 1}return 0}),_=(Ae,je=0)=>{if(je>=me.length)return Ae;let Ze=me[je],tt={},Dt=[];return Ae.forEach(ut=>{let pt=ut[Ze],St=`${Ze}:${pt}`;tt[St]||(tt[St]={key:St,field:Ze,value:pt,children:[],count:0,level:je},Dt.push(tt[St])),tt[St].children.push(ut),tt[St].count++;}),Dt.forEach(ut=>{ut.children&&(ut.children=_(ut.children,je+1));}),Dt},fe=_(W),ge=(Ae,je="")=>{let Ze=[];return Ae.forEach(tt=>{if(tt.children){let Dt=je?`${je}>${tt.key}`:tt.key,ut=T.has(Dt);Ze.push({type:"group",id:Dt,field:tt.field,value:tt.value,level:tt.level,count:tt.count,isExpanded:ut,childIds:(function pt(St){let Vt=[];return St.children.forEach(ct=>{ct.children?Vt=Vt.concat(pt(ct)):Vt.push(ct[e.rowKey||"id"]);}),Vt})(tt)}),ut&&(Ze=Ze.concat(ge(tt.children,Dt)));}else Ze.push({type:"row",data:tt,id:tt[e.rowKey||"id"],level:me.length});}),Ze};return ge(fe)},[me,T,e.rowKey]),Xe=Yt.useCallback(O=>{if(me.length===0)return [];let W=[...O].sort((ge,Ae)=>{for(let je of me){if(ge[je]<Ae[je])return -1;if(ge[je]>Ae[je])return 1}return 0}),_=[],fe=(ge,Ae,je)=>{if(Ae>=me.length)return;let Ze=me[Ae],tt=new Map;ge.forEach(Dt=>{let ut=Dt[Ze],pt=tt.get(ut);pt?pt.push(Dt):tt.set(ut,[Dt]);}),tt.forEach((Dt,ut)=>{let pt=`${Ze}:${ut}`,St=je?`${je}>${pt}`:pt;_.push(St),fe(Dt,Ae+1,St);});};return fe(W,0,""),_},[me]),qe=Yt.useMemo(()=>He(Le),[Le,He]),K=Yt.useMemo(()=>Xe(Le),[Le,Xe]),Fe=Yt.useMemo(()=>{let O=(e.rows||[]).length;return typeof e.count=="number"&&e.count>O},[e.count,e.rows]),be=Yt.useMemo(()=>Fe?qe:y>0?qe.slice(p*y,p*y+y):qe,[qe,p,y,Fe]),ke=Yt.useMemo(()=>Fe&&typeof e.count=="number"?e.count:qe.length,[qe.length,Fe,e.count]),et=O=>{R(W=>{let _=new Set(W);return _.has(O)?_.delete(O):_.add(O),_});},Te=O=>{let W=K.filter(_=>_===O||_.startsWith(`${O}>`));R(_=>{let fe=new Set(_);return W.forEach(ge=>fe.add(ge)),fe});},lt=O=>{R(W=>{let _=new Set(W);return Array.from(_).forEach(fe=>{(fe===O||fe.startsWith(`${O}>`))&&_.delete(fe);}),_});},Ct=O=>{if(!O){R(new Set);return}R(new Set(K));},Mt=O=>{let W=K.filter(_=>_.startsWith(`${O}>`));return W.length===0?T.has(O):T.has(O)&&W.every(_=>T.has(_))},Jt=O=>{if(o)return;m.length>0&&g([]);let W=l===O&&c==="asc",_=l===O&&c==="desc";if(e.onSortChange){W?e.onSortChange(O,"desc"):_?e.onSortChange("","asc"):e.onSortChange(O,"asc");return}W?(d("desc"),s(O)):_?(d("asc"),s("")):(d("asc"),s(O));},X=O=>{if(o){d("asc"),s(""),g([]);return}let W=O.filter(_=>_&&_.field);g(W),W.length>0&&s("");},_e=()=>{g([]);},J=(O,W)=>{Z(_=>({..._,[O]:W}));},G=O=>{if(O.target.checked){let W=he.map(_=>_[e.rowKey||"id"]);f(W),e.onSelectionChange&&e.onSelectionChange(W);return}f([]),e.onSelectionChange&&e.onSelectionChange([]);},F=(O,W)=>{let _=W[e.rowKey||"id"],fe=x.indexOf(_),ge=[];fe===-1?ge=ge.concat(x,_):fe===0?ge=ge.concat(x.slice(1)):fe===x.length-1?ge=ge.concat(x.slice(0,-1)):fe>0&&(ge=ge.concat(x.slice(0,fe),x.slice(fe+1))),f(ge),e.onSelectionChange&&e.onSelectionChange(ge);},re=O=>{b(O),e.onPageChange&&e.onPageChange(O);},ve=O=>{u(O),b(0),e.onPageChange&&e.onPageChange(0),e.onRowsPerPageChange&&e.onRowsPerPageChange(O);},Se=O=>{let W=h.indexOf(O),_=[...h];W===-1?_.push(O):_.splice(W,1),v(_);},Ke=O=>{if(t)return;let W=me.indexOf(O),_=[...me];W===-1?_.push(O):_.splice(W,1),Ne(_);},st=O=>{a().includes(O)&&I(_=>_.includes(O)?_.filter(fe=>fe!==O):[..._,O]);},Ye=(O,W)=>{!O||!W||O===W||E(_=>{let fe=_.indexOf(O),ge=_.indexOf(W);if(fe===-1||ge===-1)return _;let Ae=[..._];return Ae.splice(fe,1),Ae.splice(ge,0,O),Ae});},ft=O=>{let W=O?.active?.id,_=O?.over?.id;typeof W=="string"&&typeof _=="string"&&Ye(W,_);},xt=O=>{e.onLayoutSave&&e.onLayoutSave({visibleColumns:h,columnOrder:S,order:o?"asc":c,orderBy:o?"":l,sortBy:o?[]:m,grouping:me,columnWidths:M,showSummary:P,summaryColumns:D});},ao=O=>{let{layout:W,layoutId:_}=Xl(O,e.tableKey||"default");_?($e(_),de(_)):($e(""),de("")),W&&(W.visibleColumns&&v(W.visibleColumns),Array.isArray(W.columnOrder)&&E(W.columnOrder),o?(d("asc"),s(""),g([])):(W.order&&d(W.order),W.orderBy&&s(W.orderBy),Array.isArray(W.sortBy)&&g(W.sortBy)),W.grouping&&Ne(W.grouping),W.columnWidths&&Z(W.columnWidths),W.showSummary!==void 0&&w(!!W.showSummary),Array.isArray(W.summaryColumns)&&I(W.summaryColumns));},ht=O=>{let W=O?.layoutData||O?.layout||O||{};W.visibleColumns&&v(W.visibleColumns),Array.isArray(W.columnOrder)&&E(W.columnOrder),o?(d("asc"),s(""),g([])):(W.order&&d(W.order),W.orderBy!==void 0&&s(W.orderBy),Array.isArray(W.sortBy)&&g(W.sortBy)),W.grouping&&Ne(W.grouping),W.columnWidths&&Z(W.columnWidths),W.showSummary!==void 0&&w(!!W.showSummary),Array.isArray(W.summaryColumns)&&I(W.summaryColumns),R(new Set),b(0),O?.id&&de(O.id),$e("");};Yt.useEffect(()=>{e.layout&&ao({layout:e.layout});},[e.layout]);let Bo=O=>{O.preventDefault(),Ce(ue===null?{mouseX:O.clientX+2,mouseY:O.clientY-6}:null);},so=()=>{Ce(null);},Et=Yt.useMemo(()=>{if(!P)return {};let O={};e.columns.forEach(_=>{if(_.numeric&&D.includes(_.id)){let fe=he.reduce((ge,Ae)=>{let je=parseFloat(Ae[_.id]);return ge+(isNaN(je)?0:je)},0);O[_.id]=fe.toFixed(2);}else O[_.id]="";});let W=e.columns.find(_=>h.includes(_.id));return W&&!W.numeric&&(O[W.id]="Total"),O},[he,e.columns,P,D,h]),$t=()=>{if(!e.columns||!he)return;let O=e.columns.map(Ae=>Ae.label).join(","),W=he.map(Ae=>e.columns.map(je=>{let Ze=Ae[je.id];return `"${(Ze==null?"":String(Ze)).replace(/"/g,'""')}"`}).join(",")).join(`
184
+ `),_=`data:text/csv;charset=utf-8,${O}
185
+ ${W}`,fe=encodeURI(_),ge=document.createElement("a");ge.setAttribute("href",fe),ge.setAttribute("download",`${e.title||"export"}.csv`),document.body.appendChild(ge),ge.click(),document.body.removeChild(ge);},vt=()=>{j(true);},no=()=>{j(false);};return {isMobile:false,columns:rt,order:c,setOrder:d,orderBy:l,setOrderBy:s,sortBy:m,setSortBy:g,applyMultiSort:X,clearMultiSort:_e,columnOrder:S,setColumnOrder:E,filterText:n,setFilterText:i,visibleColumns:h,setVisibleColumns:v,showSummary:P,setShowSummary:w,summaryColumns:D,grouping:me,setGrouping:Ne,expandedGroups:T,setExpandedGroups:R,groupAnchorEl:H,setGroupAnchorEl:q,summaryAnchorEl:$,setSummaryAnchorEl:ie,columnWidths:M,setColumnWidths:Z,anchorEl:L,setAnchorEl:ee,contextMenu:ue,setContextMenu:Ce,sensors:void 0,sortedAndFilteredRows:Le,visibleRows:be,summaryRow:Et,page:p,setPage:re,rowsPerPage:y,setRowsPerPage:ve,totalDisplayCount:ke,selected:x,setSelected:f,isAllExpanded:K.length>0&&K.every(O=>T.has(O)),handleColumnResize:J,handleRequestSort:Jt,handleSelectAllClick:G,handleClick:F,toggleSummaryColumn:st,handleDragEnd:ft,handleColumnReorder:Ye,handleExport:$t,handleContextMenu:Bo,handleCloseContextMenu:so,toggleColumnVisibility:Se,toggleGroupExpand:et,toggleGroupField:Ke,handleToggleAll:Ct,handleExpandGroupRecursively:Te,handleCollapseGroupRecursively:lt,isGroupFullyExpanded:Mt,handleLayoutLoad:ht,handleVariantLoad:ao,handleLayoutSave:xt,effectiveAppId:e.appId||"",currentLayoutData:{visibleColumns:h,order:o?"asc":c,orderBy:o?"":l,sortBy:o?[]:m,columnOrder:S,grouping:me,columnWidths:M,showSummary:P,summaryColumns:D},currentLayoutId:Y,layoutIdToLoad:We,onPageChange:re,onRowsPerPageChange:ve,graphReportOpen:te,handleOpenGraphReport:vt,handleCloseGraphReport:no}};var gB=e=>jsxRuntime.jsx($0__default.default,{...e}),fB=e=>jsxRuntime.jsx(wc__default.default,{...e}),hB=e=>jsxRuntime.jsx(sm__default.default,{...e}),bB=e=>jsxRuntime.jsx(ry__default.default,{...e}),yB=e=>jsxRuntime.jsx(ay__default.default,{...e}),Dr=e=>{let{t}=le(),o="0.85rem",{title:r,showToolbar:a=true,selectionMode:n,selected:i=[],onSelectionChange:c,actions:d,extraTools:l,fitContainer:s=false,fullWidth:m=false,maxHeight:g,loading:p=false,rowsPerPageOptions:b=[20,50,100,-1],onLayoutSave:y,filterConfig:u,rowKey:x,tableKey:f="default",graphReport:h,quickCreate:v,quickEdit:S,quickDelete:E,serviceUrl:P,disableGrouping:w=false,disableSorting:D=false}=e,I=r||t("table.title.default"),{isMobile:k,columns:A,order:T,orderBy:R,filterText:M,setFilterText:Z,visibleColumns:L,showSummary:ee,setShowSummary:H,summaryColumns:q,grouping:$,setGrouping:ie,expandedGroups:ue,groupAnchorEl:Ce,setGroupAnchorEl:te,summaryAnchorEl:j,setSummaryAnchorEl:Y,columnWidths:de,anchorEl:We,setAnchorEl:$e,contextMenu:me,sensors:Ne,sortedAndFilteredRows:rt,summaryRow:he,visibleRows:Le,isAllExpanded:He,page:Xe,setPage:qe,rowsPerPage:K,setRowsPerPage:Fe,totalDisplayCount:be,setSelected:ke,handleColumnResize:et,handleRequestSort:Te,handleSelectAllClick:lt,handleClick:Ct,toggleSummaryColumn:Mt,handleDragEnd:Jt,handleExport:X,handleContextMenu:_e,handleCloseContextMenu:J,toggleColumnVisibility:G,toggleGroupExpand:F,toggleGroupField:re,handleToggleAll:ve,handleExpandGroupRecursively:Se,handleCollapseGroupRecursively:Ke,isGroupFullyExpanded:st,handleLayoutLoad:Ye,handleVariantLoad:ft,handleLayoutSave:xt,effectiveAppId:ao,currentLayoutData:ht,currentLayoutId:Bo,layoutIdToLoad:so,graphReportOpen:Et,handleOpenGraphReport:$t,handleCloseGraphReport:vt}=Tn(e),no=h?.enabled??false,O=no&&(h?.interaction?.enabled??true),W=Wl(),_=!!v?.enabled,fe=!!S?.enabled,ge=!!E?.enabled,Ae=v?.fields,je=v?.excludeFields||[],Ze=v?.initialValues||{},[tt,Dt]=Yt__namespace.default.useState(false),[ut,pt]=Yt__namespace.default.useState(false),[St,Vt]=Yt__namespace.default.useState({}),[ct,Eo]=Yt__namespace.default.useState(false),[wo,Jo]=Yt__namespace.default.useState(false),[B,Q]=Yt__namespace.default.useState({}),[ae,ce]=Yt__namespace.default.useState(false),[Be,Ge]=Yt__namespace.default.useState(false),mt=p||ut||wo||Be,Pe=Yt__namespace.default.useMemo(()=>{let U=[...A];if(Array.isArray(Ae)&&Ae.length>0){let Ee=new Set(Ae);U=U.filter(V=>Ee.has(V.id));}if(je.length>0){let Ee=new Set(je);U=U.filter(V=>!Ee.has(V.id));}return U.filter(Ee=>!!Ee?.id)},[A,je,Ae]),dt=x||"id",at=Yt__namespace.default.useMemo(()=>{let U=new Set(i);return rt.filter(Ee=>U.has(Ee?.[dt]))},[i,rt,dt]),It=at.length===1?at[0]:null,bt=S?.fields,eo=S?.excludeFields||[],co=S?.editableFields||[],To=S?.nonEditableFields||[],jt=S?.primaryKeys?.length?S.primaryKeys:[dt],vo=Yt__namespace.default.useMemo(()=>{let U=[...A];if(Array.isArray(bt)&&bt.length>0){let Ee=new Set(bt);U=U.filter(V=>Ee.has(V.id));}if(eo.length>0){let Ee=new Set(eo);U=U.filter(V=>!Ee.has(V.id));}return U.filter(Ee=>!!Ee?.id)},[A,eo,bt]),Pt=Yt__namespace.default.useMemo(()=>new Set(jt),[jt]),Gt=Yt__namespace.default.useMemo(()=>new Set(co),[co]),cr=Yt__namespace.default.useMemo(()=>new Set(To),[To]),dr=Yt__namespace.default.useCallback(U=>Gt.size>0?Gt.has(U):!(cr.has(U)||Pt.has(U)),[Gt,cr,Pt]);Yt__namespace.default.useEffect(()=>{!Et&&W.hasActiveFilters&&W.clearAll();},[Et,W.hasActiveFilters,W.clearAll]);let rn=()=>{let U={};Pe.forEach(Ee=>{U[Ee.id]=Ze[Ee.id]??"";}),Vt(U),Dt(true);},wa=()=>{ut||Dt(false);},an=(U,Ee)=>{Vt(V=>({...V,[U]:Ee}));},er=async()=>{if(!v?.onSubmit){Dt(false);return}try{pt(!0),await v.onSubmit(St),Dt(!1);}finally{pt(false);}},nn=()=>{if(!It)return;let U={};vo.forEach(V=>{U[V.id]=It[V.id]??"";});let Ee=S?.getInitialValues?{...U,...S.getInitialValues(It)}:U;Q(Ee),Eo(true);},Ta=()=>{wo||Eo(false);},Ia=(U,Ee)=>{Q(V=>({...V,[U]:Ee}));},Or=async()=>{if(It){if(!S?.onSubmit){Eo(false);return}try{Jo(!0),await S.onSubmit(B,It),Eo(!1);}finally{Jo(false);}}},ra=()=>{at.length!==0&&ce(true);},ni=()=>{Be||ce(false);},C=async()=>{if(at.length===0){ce(false);return}if(!E?.onConfirm){ce(false),ke([]),c?.([]);return}try{Ge(!0),await E.onConfirm(at),ce(!1),ke([]),c?.([]);}finally{Ge(false);}},N=rt,{fieldMapping:z}=xn({rows:N,config:{...h,title:h?.title||`${I} ${t("graph.reportTitle")}`}}),oe=Yt__namespace.default.useMemo(()=>O?W.applyRows(N,z):N,[O,W.applyRows,N,z]),{model:ye}=xn({rows:oe,config:{...h,title:h?.title||`${I} ${t("graph.reportTitle")}`,fieldMapping:z}}),Ue=ye.table.columns.map(U=>({id:U.id,label:U.label,align:U.align||"left",minWidth:120,numeric:U.align==="right"})),Re=ao?jsxRuntime.jsx(wn,{appId:ao,tableKey:f,currentLayoutData:ht,onLayoutLoad:Ye,targetLayoutId:so,activeLayoutId:Bo,serviceUrl:P??u?.serviceUrl}):null,Oe=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[!w&&jsxRuntime.jsx(sn,{groupAnchorEl:Ce,setGroupAnchorEl:te,grouping:$,setGrouping:ie,columns:A,toggleGroupField:re}),jsxRuntime.jsx(cn,{anchorEl:We,setAnchorEl:$e,columns:A,visibleColumns:L,toggleColumnVisibility:G}),jsxRuntime.jsx(Cl,{anchorEl:j,setAnchorEl:Y,showSummary:ee,setShowSummary:H,columns:A,summaryColumns:q,toggleSummaryColumn:Mt}),jsxRuntime.jsx(Sl,{contextMenu:me,handleCloseContextMenu:J,columns:A,visibleColumns:L,toggleColumnVisibility:G})]});return k?jsxRuntime.jsxs(Di__default.default,{sx:{display:"flex",flexDirection:"column",gap:2,height:"100%"},children:[u&&jsxRuntime.jsx($r,{fields:u.fields,filters:u.filters,onFilterChange:u.onFilterChange,onSearch:u.onSearch,variants:u.variants||[],currentVariantId:u.currentVariantId,onVariantLoad:u.onVariantLoad,onVariantSave:u.onVariantSave,onVariantDelete:u.onVariantDelete,onVariantSetDefault:u.onVariantSetDefault,appId:u.appId,tableKey:f,currentLayout:[{tableKey:f,layoutData:ht}],variantService:u.variantService,serviceUrl:P??u.serviceUrl}),jsxRuntime.jsx(ju,{title:I,loading:p,showSummary:ee,setShowSummary:H,setAnchorEl:$e,setSummaryAnchorEl:Y,filterText:M,setFilterText:Z,sortedAndFilteredRows:rt,selected:i,columns:A,visibleColumns:L,summaryRow:he,handleClick:Ct,selectionMode:n}),Oe]}):jsxRuntime.jsxs(Di__default.default,{sx:{width:m?"100%":"auto",mb:s?0:2,...s?{flex:1,display:"flex",flexDirection:"column",minHeight:0,height:"100%",overflow:"hidden"}:{}},children:[u&&jsxRuntime.jsx(Di__default.default,{sx:{mb:2},children:jsxRuntime.jsx($r,{fields:u.fields,filters:u.filters,onFilterChange:u.onFilterChange,onSearch:u.onSearch,variants:u.variants||[],currentVariantId:u.currentVariantId,onVariantLoad:U=>{ft(U),u.onVariantLoad&&u.onVariantLoad(U);},onVariantSave:u.onVariantSave,onVariantDelete:u.onVariantDelete,onVariantSetDefault:u.onVariantSetDefault,loading:p,appId:u.appId,tableKey:f,currentLayout:[{tableKey:f,layoutData:ht}],currentLayoutId:Bo,layoutRefs:[{tableKey:f,layoutId:Bo}],variantService:u.variantService,serviceUrl:P??u.serviceUrl})}),jsxRuntime.jsxs(W0__default.default,{sx:{width:m?"100%":"auto",mb:s?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative","&::before":mt?{content:'""',position:"absolute",top:0,left:0,width:"100%",height:"3px",background:"linear-gradient(90deg, rgba(25, 118, 210, 0) 0%, rgba(25, 118, 210, 0.25) 25%, rgba(25, 118, 210, 1) 50%, rgba(25, 118, 210, 0.25) 75%, rgba(25, 118, 210, 0) 100%)",backgroundSize:"220% 100%",animation:"cTableTopMarquee 1.2s linear infinite",zIndex:6,pointerEvents:"none"}:{},"@keyframes cTableTopMarquee":{"0%":{backgroundPosition:"220% 0"},"100%":{backgroundPosition:"-120% 0"}},...g?{height:g}:s?{flex:1,minHeight:0,height:"100%"}:{}},children:[a&&jsxRuntime.jsx(fl,{filterText:M,setFilterText:Z,onRowsPerPageChange:Fe,rowsPerPage:K,rowsPerPageOptions:b,page:Xe,count:be,onPageChange:qe,actions:d,extraTools:l,grouping:$,disableGrouping:w,setGroupAnchorEl:te,showSummary:ee,setShowSummary:H,setAnchorEl:$e,setSummaryAnchorEl:Y,handleExport:X,showCreateButton:_,onOpenCreateDialog:rn,showEditButton:fe,onOpenEditDialog:nn,editDisabled:at.length!==1,showDeleteButton:ge,onOpenDeleteConfirm:ra,deleteDisabled:at.length===0,onLayoutSave:y||u?.variantService&&u?.appId?xt:void 0,loading:p,layoutManager:Re,onOpenGraphReport:no?$t:void 0}),jsxRuntime.jsx(sm__default.default,{sx:{flex:1,...g?{maxHeight:g,height:g}:s?{height:0,maxHeight:"none"}:{maxHeight:"calc(100vh - 320px)"},overflowY:"auto",overflowX:"auto",position:"relative",minHeight:0},children:jsxRuntime.jsx(core.DndContext,{sensors:Ne,collisionDetection:core.closestCenter,onDragEnd:Jt,modifiers:[modifiers.restrictToHorizontalAxis],children:jsxRuntime.jsxs(H0__default.default,{sx:{minWidth:m?750:"auto",width:m?"100%":"auto",tableLayout:Object.keys(de).length>0?"fixed":"auto",borderCollapse:"separate",borderSpacing:0,"& .MuiTableCell-root":{fontSize:o}},"aria-labelledby":"tableTitle",size:"small",stickyHeader:true,children:[jsxRuntime.jsx(yl,{columns:A,visibleColumns:L,order:T,orderBy:R,onRequestSort:Te,disableSorting:D,onContextMenu:_e,selectionMode:n,grouping:$,isAllExpanded:He,handleToggleAll:ve,rowCount:rt.length,numSelected:i.length,onSelectAllClick:lt,columnWidths:de,onColumnResize:et}),jsxRuntime.jsx(_u,{visibleRows:Le,columns:A,visibleColumns:L,selectionMode:n,selected:i,orderBy:R,loading:p,expandedGroups:ue,toggleGroupExpand:F,handleExpandGroupRecursively:Se,handleCollapseGroupRecursively:Ke,isGroupFullyExpanded:st,handleClick:Ct,onSelectionChange:c,grouping:$,rowKeyProp:x,page:Xe,rowsPerPage:K}),ee&&jsxRuntime.jsx(Ku,{showSummary:ee,columns:A,visibleColumns:L,summaryRow:he,selectionMode:n?.toString(),grouping:$,orderBy:R,zIndex:3})]})})})]}),_&&jsxRuntime.jsxs(om__default.default,{open:tt,onClose:wa,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:U=>`1px solid ${U.palette.divider}`,bgcolor:"background.paper"}}},children:[jsxRuntime.jsx(rm__default.default,{sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:v?.title||t("quickCreate.createWithTitle",{title:I})}),jsxRuntime.jsx(am__default.default,{sx:{pt:"8px !important"},children:jsxRuntime.jsxs(Di__default.default,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Pe.map(U=>{let Ee=U.type==="number"||U.numeric?"number":U.type==="date"?"date":"text",V=U.label||U.id;return jsxRuntime.jsx(im__default.default,{label:V,value:St[U.id]??"",onChange:pe=>an(U.id,pe.target.value),type:Ee,size:"small",fullWidth:true,InputLabelProps:{shrink:Ee==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-create-${U.id}`)}),v?.description&&jsxRuntime.jsx(lm__default.default,{severity:"info",sx:{fontSize:"0.85rem","& .MuiAlert-message":{fontSize:"0.85rem"}},children:v.description})]})}),jsxRuntime.jsxs(nm__default.default,{sx:{px:3,pb:2},children:[jsxRuntime.jsx(Zl__default.default,{onClick:wa,sx:{fontSize:"0.85rem"},disabled:ut,children:v?.cancelLabel||t("common.cancel")}),jsxRuntime.jsx(Zl__default.default,{onClick:er,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:ut,children:v?.submitLabel||t("common.save")})]})]}),fe&&jsxRuntime.jsxs(om__default.default,{open:ct,onClose:Ta,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:U=>`1px solid ${U.palette.divider}`,bgcolor:"background.paper"}}},children:[jsxRuntime.jsx(rm__default.default,{sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:S?.title||t("quickEdit.editWithTitle",{title:I})}),jsxRuntime.jsx(am__default.default,{sx:{pt:"8px !important"},children:jsxRuntime.jsxs(Di__default.default,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[vo.map(U=>{let Ee=U.type==="number"||U.numeric?"number":U.type==="date"?"date":"text",V=U.label||U.id,pe=dr(U.id);return jsxRuntime.jsx(im__default.default,{label:V,value:B[U.id]??"",onChange:ne=>Ia(U.id,ne.target.value),type:Ee,size:"small",fullWidth:true,disabled:!pe,InputLabelProps:{shrink:Ee==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-edit-${U.id}`)}),S?.description&&jsxRuntime.jsx(lm__default.default,{severity:"info",sx:{fontSize:"0.85rem","& .MuiAlert-message":{fontSize:"0.85rem"}},children:S.description})]})}),jsxRuntime.jsxs(nm__default.default,{sx:{px:3,pb:2},children:[jsxRuntime.jsx(Zl__default.default,{onClick:Ta,sx:{fontSize:"0.85rem"},disabled:wo,children:S?.cancelLabel||t("common.cancel")}),jsxRuntime.jsx(Zl__default.default,{onClick:Or,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:wo||!It,children:S?.submitLabel||t("common.save")})]})]}),ge&&jsxRuntime.jsx(di,{open:ae,type:"warning",title:E?.title||t("quickDelete.confirmTitle"),message:E?.message||(at.length>1?t("quickDelete.confirmMessageMultiple",{count:at.length}):t("quickDelete.confirmMessageSingle")),confirmText:E?.confirmText||t("common.delete"),cancelText:E?.cancelText||t("common.cancel"),onClose:ni,onConfirm:C}),Oe,no&&jsxRuntime.jsx(Ol,{open:Et,onClose:vt,model:ye,aiAssistant:h?.aiAssistant,interaction:O?{enabled:true,filters:W.filters,fieldMapping:z,onPrimaryDimensionClick:U=>W.setFilter("primaryDimension",U),onSecondaryDimensionClick:U=>W.setFilter("secondaryDimension",U),onStatusClick:U=>W.setFilter("status",U),onClearFilter:W.clearFilter,onClearAll:W.clearAll}:void 0,tableContent:jsxRuntime.jsx(Dr,{appId:ao||"graph-report-internal",title:t("graph.dataBody"),columns:Ue,rows:ye.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false}})})]})},xB=Dr;var IB=({id:e,title:t,hideHeader:o=true,filterConfig:r,tableProps:a,children:n,spacing:i=1,mode:c="separated"})=>{let d=r?{...r,appId:r.appId||e}:void 0,l={...a,appId:a.appId||e};return jsxRuntime.jsxs(Wu,{title:t,hideHeader:o,children:[jsxRuntime.jsxs(material.Stack,{spacing:i,sx:{height:"100%",overflow:"hidden"},children:[c==="separated"&&d&&jsxRuntime.jsx(material.Box,{sx:{flexShrink:0},children:jsxRuntime.jsx($r,{...d})}),jsxRuntime.jsx(material.Box,{sx:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:jsxRuntime.jsx(Dr,{...l,fitContainer:true,filterConfig:c==="integrated"?d:void 0})})]}),n]})};var BB=({metadata:e,fetchData:t,initialRowsPerPage:o=20,rowsPerPageOptions:r=[20,50,100,-1],tableKey:a="default",mode:n="integrated",serviceUrl:i,variantService:c})=>{let{t:d}=le(),[l,s]=Yt.useState(false),[m,g]=Yt.useState([]),[p,b]=Yt.useState({}),[y,u]=Yt.useState(e.variants||[]),[x,f]=Yt.useState(e.layout||null),[h,v]=Yt.useState(""),[S,E]=Yt.useState(0),[P,w]=Yt.useState(0),[D,I]=Yt.useState(o),[k,A]=Yt.useState([]),[T,R]=Yt.useState("asc"),[M,Z]=Yt.useState("");Yt.useEffect(()=>{let j={};e.filters.forEach(Y=>{Y.defaultValue!==void 0&&(j[Y.id]=Y.defaultValue);}),b(j);},[e.filters]);let L=Yt.useCallback(async(j,Y,de,We,$e)=>{s(true);try{let me={...j,page:Y+1,limit:de,sort:$e,order:We},Ne;t?Ne=await t(me):typeof e.api=="function"?Ne=await e.api(me):e.api&&typeof e.api=="object"?(console.log("Fetching from URL:",e.api.url,me),Ne={rows:[],total:0}):(console.warn("No API configured for report"),Ne={rows:[],total:0}),Ne&&(g(Ne.rows||[]),E(Ne.total||0));}catch(me){console.error("Failed to fetch report data",me);}finally{s(false);}},[e.api,t]);Yt.useEffect(()=>{L(p,P,D,T,M);},[L,P,D,T,M]);let ee=()=>{w(0),L(p,0,D,T,M);},H=j=>{w(0),I(j);},q=(j,Y)=>{R(Y),Z(j);},$=j=>{b(j);},ie=j=>{v(j?.id||"");let Y=em(j,a);if(Y){let We=Y.values??Y;b(We),L(We,0,D,T,M),w(0);}let{layout:de}=Xl(j,a);de&&f(de);},ue=j=>{let Y={...j,id:Date.now().toString(),createdAt:new Date().toISOString()};u(de=>[...de,Y]);},Ce=j=>{f(j);};return {pageProps:{id:e.id,title:e.title,mode:n,filterConfig:{appId:e.id,tableKey:a,fields:e.filters,filters:p,onFilterChange:$,onSearch:ee,onVariantLoad:ie,onVariantSave:ue,onVariantDelete:j=>u(Y=>Y.filter(de=>de.id!==j)),onVariantSetDefault:j=>{u(Y=>Y.map(de=>({...de,isDefault:de.id===j})));},variants:y,currentVariantId:h,variantService:c,serviceUrl:i},tableProps:{appId:e.id,tableKey:a,columns:e.columns,rows:m,loading:l,rowKey:"id",count:S,page:P,rowsPerPage:D,rowsPerPageOptions:r,onPageChange:w,onRowsPerPageChange:H,selectionMode:"multiple",selected:k,onSelectionChange:A,onLayoutSave:Ce,layout:x,title:e.title,showSummary:true,order:T,orderBy:M,serviceUrl:i,onSortChange:q,graphReport:e.graphReport||{enabled:true,title:`${e.title} ${d("graph.reportTitle")}`}}},filters:p,rows:m,loading:l,refresh:ee}};var Q0=e=>[...e].sort((t,o)=>o.value-t.value),LB=({bars:e=[],lines:t=[],combos:o=[],heatmap:r=[],pies:a=[],waterfalls:n=[]})=>{let i=Yt.useMemo(()=>Q0(e),[e]),c=Yt.useMemo(()=>[...t],[t]),d=Yt.useMemo(()=>[...o],[o]),l=Yt.useMemo(()=>[...r],[r]),s=Yt.useMemo(()=>{let g=a.reduce((p,b)=>p+b.value,0);return a.map(p=>({...p,percent:g>0?p.value/g*100:p.percent}))},[a]),m=Yt.useMemo(()=>[...n],[n]);return {bars:i,lines:c,combos:d,heatmap:l,pies:s,waterfalls:m}};var WB=({apiKey:e,query:t,zoom:o=14,mapType:r="roadmap"})=>Yt.useMemo(()=>!e||!t?"":ki({apiKey:e,query:t,zoom:o,mapType:r}),[e,t,o,r]),HB=({keyword:e,location:t})=>Yt.useMemo(()=>El({keyword:e,location:t?{lng:t.lng,lat:t.lat,name:t.name}:void 0}),[e,t]);var Ai=({code:e,language:t="text",copyable:o=true,showLineNumbers:r=false,wrapLongLines:a=false,maxHeight:n})=>{let[i,c]=Yt.useState(false),d=Yt.useMemo(()=>e.replace(/\n$/,"").split(`
186
+ `),[e]);return jsxRuntime.jsxs(material.Box,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1.5,overflow:"hidden",bgcolor:"background.paper"},children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:1,py:.6,bgcolor:"action.hover",borderBottom:"1px solid",borderColor:"divider"},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",sx:{textTransform:"uppercase",letterSpacing:.5,color:"text.secondary",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:t}),o&&jsxRuntime.jsx(material.Tooltip,{title:i?"Copied":"Copy",children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:async()=>{try{await navigator.clipboard.writeText(e),c(!0),window.setTimeout(()=>c(!1),1400);}catch{c(false);}},children:i?jsxRuntime.jsx(nv__default.default,{fontSize:"inherit"}):jsxRuntime.jsx(av__default.default,{fontSize:"inherit"})})})]}),jsxRuntime.jsx(material.Box,{component:"pre",sx:{m:0,p:1.25,fontSize:"0.82rem",lineHeight:1.55,overflow:"auto",maxHeight:n,bgcolor:"background.default",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:r?d.map((s,m)=>jsxRuntime.jsxs(material.Box,{sx:{display:"flex"},children:[jsxRuntime.jsx(material.Box,{component:"span",sx:{width:34,flexShrink:0,textAlign:"right",pr:1,color:"text.disabled",userSelect:"none"},children:m+1}),jsxRuntime.jsx(material.Box,{component:"span",sx:{whiteSpace:a?"pre-wrap":"pre",wordBreak:a?"break-word":"normal"},children:s})]},`${m}-${s}`)):jsxRuntime.jsx(material.Box,{component:"code",sx:{display:"block",whiteSpace:a?"pre-wrap":"pre",wordBreak:a?"break-word":"normal"},children:e})})]})};var dv=e=>{let t=e.trim();return t.startsWith("$$")&&t.endsWith("$$")&&t.length>=4&&(t=t.slice(2,-2).trim()),t.startsWith("$")&&t.endsWith("$")&&t.length>=2&&(t=t.slice(1,-1).trim()),t},uv=async e=>new Function("m","return import(m)")(e),Bi=({expression:e,inline:t=false,allowKatex:o=false})=>{let r=Yt.useMemo(()=>dv(e),[e]),[a,n]=Yt.useState("");return Yt.useEffect(()=>{let i=true;return (async()=>{if(!o||!r){n("");return}try{let d=await uv("katex"),s=(d?.default||d)?.renderToString?.(r,{displayMode:!t,throwOnError:!1,strict:"warn"});i&&typeof s=="string"&&n(s);}catch{i&&n("");}})(),()=>{i=false;}},[o,r,t]),r?a?jsxRuntime.jsx(material.Box,{component:t?"span":"div",sx:{display:t?"inline-flex":"block",my:t?0:.5,overflowX:"auto"},dangerouslySetInnerHTML:{__html:a}}):t?jsxRuntime.jsx(material.Box,{component:"code",sx:{px:.4,py:.05,borderRadius:.8,bgcolor:"action.hover",fontSize:"0.82em",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:r}):jsxRuntime.jsx(material.Box,{sx:{my:1,p:1,borderRadius:1.2,border:"1px dashed",borderColor:"divider",bgcolor:"background.paper"},children:jsxRuntime.jsx(material.Typography,{component:"pre",sx:{m:0,whiteSpace:"pre-wrap",fontSize:"0.9rem",lineHeight:1.5,fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:r})}):null};var yv=async e=>new Function("m","return import(m)")(e),td=({code:e,title:t="Mermaid Diagram",height:o=320,enabled:r=true})=>{let[a,n]=Yt.useState(""),[i,c]=Yt.useState(""),[d,l]=Yt.useState(false),s=Yt.useMemo(()=>e.trim(),[e]);return Yt.useEffect(()=>{let m=true;return (async()=>{if(!r||!s){n(""),c("");return}l(true),c(""),n("");try{let p=await yv("mermaid"),b=p?.default||p;if(!b||typeof b.render!="function")throw new Error("Mermaid runtime is not available");b.initialize?.({startOnLoad:!1,securityLevel:"loose",theme:"default"});let y=await b.render(`orbcafe-mermaid-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,s),u=typeof y=="string"?y:y?.svg;m&&typeof u=="string"&&n(u);}catch(p){if(m){let b=p instanceof Error?p.message:"Failed to render Mermaid diagram";c(b);}}finally{m&&l(false);}})(),()=>{m=false;}},[r,s]),jsxRuntime.jsxs(material.Paper,{variant:"outlined",sx:{borderRadius:1.5,overflow:"hidden",my:1},children:[jsxRuntime.jsx(material.Box,{sx:{px:1,py:.6,borderBottom:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",sx:{letterSpacing:.4,textTransform:"uppercase"},children:t})}),jsxRuntime.jsxs(material.Box,{sx:{p:1},children:[d&&jsxRuntime.jsx(material.Box,{sx:{minHeight:120,display:"flex",alignItems:"center",justifyContent:"center"},children:jsxRuntime.jsx(material.CircularProgress,{size:20})}),!d&&a&&jsxRuntime.jsx(material.Box,{sx:{maxHeight:o,overflow:"auto","& svg":{display:"block",mx:"auto",maxWidth:"100%",height:"auto"}},dangerouslySetInnerHTML:{__html:a}}),!d&&!a&&jsxRuntime.jsxs(material.Box,{children:[i&&jsxRuntime.jsx(material.Alert,{severity:"info",sx:{mb:1},children:i}),jsxRuntime.jsx(Ai,{code:s,language:"mermaid",copyable:true,showLineNumbers:true,wrapLongLines:true})]})]})]})};var od=e=>e.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(o=>o.trim()),Iv=e=>/^:?-{3,}:?$/.test(e.trim()),Pv=e=>{let t=e.trim(),o=t.startsWith(":"),r=t.endsWith(":");return o&&r?"center":r?"right":"left"},Jl=e=>{let t=e.split(`
187
+ `).map(i=>i.trim()).filter(Boolean);if(t.length<2)return null;let o=od(t[0]),r=od(t[1]);if(o.length===0||r.length!==o.length||!r.every(Iv))return null;let a=r.map(Pv),n=t.slice(2).filter(i=>i.includes("|")).map(i=>{let c=od(i);return c.length<o.length?[...c,...Array.from({length:o.length-c.length},()=>"")]:c.slice(0,o.length)});return {headers:o,aligns:a,rows:n}},rd=({markdown:e,table:t,maxHeight:o=360})=>{let r=Yt.useMemo(()=>t||(e?Jl(e):null),[t,e]);return !r||r.headers.length===0?jsxRuntime.jsx(material.Paper,{variant:"outlined",sx:{p:1.2,borderRadius:1.5},children:jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:"Invalid table block"})}):jsxRuntime.jsx(material.Paper,{variant:"outlined",sx:{borderRadius:1.5,overflow:"hidden",my:1},children:jsxRuntime.jsx(material.TableContainer,{sx:{maxHeight:o},children:jsxRuntime.jsxs(material.Table,{size:"small",stickyHeader:true,children:[jsxRuntime.jsx(material.TableHead,{children:jsxRuntime.jsx(material.TableRow,{children:r.headers.map((a,n)=>jsxRuntime.jsx(material.TableCell,{align:r.aligns[n],sx:{fontWeight:700,bgcolor:"background.paper"},children:a},`${a}-${n}`))})}),jsxRuntime.jsx(material.TableBody,{children:r.rows.map((a,n)=>jsxRuntime.jsx(material.TableRow,{hover:true,children:a.map((i,c)=>jsxRuntime.jsx(material.TableCell,{align:r.aligns[c],sx:{whiteSpace:"pre-wrap",wordBreak:"break-word"},children:i||jsxRuntime.jsx(material.Box,{component:"span",sx:{color:"text.disabled"},children:"-"})},`cell-${n}-${c}`))},`row-${n}`))})]})})})};var ts=({content:e,title:t="Thinking",defaultExpanded:o=false,isStreaming:r=false})=>{let[a,n]=Yt.useState(o);return jsxRuntime.jsxs(material.Box,{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1,my:.8},children:[jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:.6,children:[jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>n(i=>!i),sx:{transform:a?"rotate(180deg)":"rotate(0deg)",transition:"transform .15s ease"},children:jsxRuntime.jsx(Fv__default.default,{fontSize:"inherit"})}),jsxRuntime.jsxs(material.Typography,{variant:"caption",color:"text.secondary",sx:{fontStyle:"italic"},children:[t,r?" ...":""]})]}),jsxRuntime.jsx(material.Collapse,{in:a,children:jsxRuntime.jsx(material.Typography,{variant:"body2",sx:{pl:4,pt:.4,whiteSpace:"pre-wrap",color:"text.secondary",fontStyle:"italic",lineHeight:1.55},children:e})})]})};var nd=/(\*\*[^*]+\*\*|`[^`]+`|\[[^\]]+\]\([^)]+\)|\*[^*]+\*|\$[^$\n]+\$)/g,os=e=>e.trim().startsWith("```"),ym=e=>/^#{1,6}\s+/.test(e.trim()),id=e=>/^[-*+]\s+/.test(e.trim()),ld=e=>/^\d+\.\s+/.test(e.trim()),xm=e=>/^(?:-{3,}|\*{3,}|_{3,})$/.test(e.trim()),sd=e=>e.trim().startsWith(">"),vm=(e,t)=>{if(t+1>=e.length)return false;let o=e[t],r=e[t+1];return !o.includes("|")||!r.includes("|")?false:/^\s*\|?\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)+\|?\s*$/.test(r.trim())},Cm=e=>e.trim().startsWith("<think>")||e.trim()===":::think",Li=(e,t,o)=>{let r=[],a=0,n=0;nd.lastIndex=0;let i=nd.exec(e);for(;i;){i.index>a&&r.push(e.slice(a,i.index));let c=i[0],d=`${o}-${n}`;if(c.startsWith("**")&&c.endsWith("**"))r.push(jsxRuntime.jsx("strong",{children:c.slice(2,-2)},d));else if(c.startsWith("*")&&c.endsWith("*"))r.push(jsxRuntime.jsx("em",{children:c.slice(1,-1)},d));else if(c.startsWith("`")&&c.endsWith("`"))r.push(jsxRuntime.jsx(material.Box,{component:"code",sx:{px:.45,py:.08,borderRadius:.8,bgcolor:"action.hover",fontSize:"0.82em",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:c.slice(1,-1)},d));else if(c.startsWith("[")&&c.includes("](")&&c.endsWith(")")){let l=c.match(/^\[([^\]]+)\]\(([^)]+)\)$/);l?r.push(jsxRuntime.jsx(material.Link,{href:l[2],target:"_blank",rel:"noreferrer",underline:"hover",children:l[1]},d)):r.push(c);}else c.startsWith("$")&&c.endsWith("$")&&t.enableMath?r.push(jsxRuntime.jsx(Bi,{expression:c,inline:true,allowKatex:true},d)):r.push(c);a=i.index+c.length,n+=1,i=nd.exec(e);}return a<e.length&&r.push(e.slice(a)),r.length>0?r:[e]},Ni=({markdown:e,content:t,className:o,enableMath:r=true,enableMermaid:a=true,enableThinkBlock:n=true,codeCopyable:i=true,codeLineNumbers:c=false})=>{let d=e??t??"",l=Yt.useMemo(()=>{let s=[],m=d.replace(/\r\n/g,`
188
188
  `).split(`
189
- `),f={enableMath:r},p=0;for(;p<g.length;){let b=g[p],y=b.trim();if(!y){p+=1;continue}if(n&&ym(b)){if(y.startsWith("<think>")){let m=[],h=b;for(;;){let x=h.indexOf("<think>"),w=x>=0?h.slice(x+7):h,E=w.indexOf("</think>");if(E>=0){m.push(w.slice(0,E)),p+=1;break}if(m.push(w),p+=1,p>=g.length)break;h=g[p];}s.push(jsxRuntime.jsx(Yl,{content:m.join(`
190
- `).trim()},`think-tag-${p}`));continue}p+=1;let C=[];for(;p<g.length&&g[p].trim()!==":::";)C.push(g[p]),p+=1;p<g.length&&g[p].trim()===":::"&&(p+=1),s.push(jsxRuntime.jsx(Yl,{content:C.join(`
191
- `).trim()},`think-fence-${p}`));continue}if(Ql(b)){let C=y.slice(3).trim().toLowerCase(),m=[];for(p+=1;p<g.length&&!Ql(g[p]);)m.push(g[p]),p+=1;p<g.length&&Ql(g[p])&&(p+=1);let h=m.join(`
192
- `);if(a&&C==="mermaid"){s.push(jsxRuntime.jsx(Yc,{code:h},`mermaid-${p}`));continue}if(r&&["math","latex","katex"].includes(C)){s.push(jsxRuntime.jsx(Di,{expression:h,allowKatex:true},`math-fence-${p}`));continue}s.push(jsxRuntime.jsx(Mi,{code:h,language:C||"text",copyable:i,showLineNumbers:c,wrapLongLines:true},`code-${p}`));continue}if(r&&y.startsWith("$$")){let C=[];if(y.endsWith("$$")&&y!=="$$")C.push(y.slice(2,-2)),p+=1;else {let h=b.slice(b.indexOf("$$")+2);for(h.trim()&&C.push(h),p+=1;p<g.length;){let x=g[p],w=x.indexOf("$$");if(w>=0){C.push(x.slice(0,w)),p+=1;break}C.push(x),p+=1;}}s.push(jsxRuntime.jsx(Di,{expression:C.join(`
193
- `).trim(),allowKatex:true},`math-${p}`));continue}if(fm(b)){let C=Math.min(6,b.match(/^#{1,6}/)?.[0]?.length||1),m=b.replace(/^#{1,6}\s+/,""),h=C===1?"h5":C===2?"h6":"subtitle1";s.push(jsxRuntime.jsx(material.Typography,{variant:h,sx:{mt:C===1?1.2:.8,mb:.5,fontWeight:700},children:Ei(m,f,`h-${p}`)},`heading-${p}`)),p+=1;continue}if(hm(b)){s.push(jsxRuntime.jsx(material.Divider,{sx:{my:1.2}},`hr-${p}`)),p+=1;continue}if(bm(g,p)){let C=p+2;for(;C<g.length&&g[C].trim()&&g[C].includes("|");)C+=1;let m=g.slice(p,C).join(`
194
- `),h=Xl(m);if(h){s.push(jsxRuntime.jsx(Jc,{table:h},`table-${p}`)),p=C;continue}}if(ad(b)){let C=[];for(;p<g.length&&ad(g[p]);)C.push(g[p].replace(/^\s*>\s?/,"")),p+=1;s.push(jsxRuntime.jsx(material.Paper,{variant:"outlined",sx:{px:1,py:.8,my:.9,borderLeftWidth:3,borderLeftStyle:"solid",borderLeftColor:"primary.main",bgcolor:"action.hover"},children:jsxRuntime.jsx(material.Typography,{variant:"body2",sx:{whiteSpace:"pre-wrap"},children:C.map((m,h)=>jsxRuntime.jsxs(Qt.Fragment,{children:[h>0&&jsxRuntime.jsx("br",{}),Ei(m,f,`q-${p}-${h}`)]},`quote-line-${h}`))})},`quote-${p}`));continue}if(od(b)){let C=[];for(;p<g.length&&od(g[p]);)C.push(g[p].trim().replace(/^[-*+]\s+/,"")),p+=1;s.push(jsxRuntime.jsx(material.Box,{component:"ul",sx:{my:.8,pl:2.5},children:C.map((m,h)=>jsxRuntime.jsx(material.Box,{component:"li",sx:{mb:.45},children:jsxRuntime.jsx(material.Typography,{variant:"body2",children:Ei(m,f,`ul-${p}-${h}`)})},`ul-item-${h}`))},`ul-${p}`));continue}if(rd(b)){let C=[];for(;p<g.length&&rd(g[p]);)C.push(g[p].trim().replace(/^\d+\.\s+/,"")),p+=1;s.push(jsxRuntime.jsx(material.Box,{component:"ol",sx:{my:.8,pl:2.7},children:C.map((m,h)=>jsxRuntime.jsx(material.Box,{component:"li",sx:{mb:.45},children:jsxRuntime.jsx(material.Typography,{variant:"body2",children:Ei(m,f,`ol-${p}-${h}`)})},`ol-item-${h}`))},`ol-${p}`));continue}let u=[];for(;p<g.length;){let C=g[p],m=C.trim();if(!m||Ql(C)||fm(C)||hm(C)||od(C)||rd(C)||ad(C)||bm(g,p)||n&&ym(C)||r&&m.startsWith("$$"))break;u.push(C),p+=1;}u.length>0?s.push(jsxRuntime.jsx(material.Typography,{variant:"body2",sx:{my:.65,lineHeight:1.65},children:u.map((C,m)=>jsxRuntime.jsxs(Qt.Fragment,{children:[m>0&&jsxRuntime.jsx("br",{}),Ei(C,f,`p-${p}-${m}`)]},`p-line-${m}`))},`p-${p}`)):p+=1;}return s},[d,r,a,n,i,c]);return jsxRuntime.jsx(material.Box,{className:o,sx:{"& strong":{fontWeight:700},"& em":{fontStyle:"italic"},"& a":{wordBreak:"break-all"}},children:l})};var h5=(e,t)=>jsxRuntime.jsx(Fi,{markdown:e,...t});var Cm=({value:e,onChange:t,onSubmit:o,onVoiceInput:r,onClear:a,placeholder:n,statusText:i,loading:c=false,compact:d=false,showStatusText:l=true})=>jsxRuntime.jsxs(material.Stack,{spacing:.75,children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:1,px:1.2,py:d?.25:.4,borderRadius:999,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",minHeight:d?38:44},children:[jsxRuntime.jsx(Bu__default.default,{sx:{fontSize:d?16:18,color:"text.secondary"}}),jsxRuntime.jsx(material.InputBase,{fullWidth:true,value:e,onChange:s=>t(s.target.value),onKeyDown:s=>{s.key==="Enter"&&(s.preventDefault(),o());},placeholder:n,sx:{fontSize:d?"0.84rem":"0.9rem"}}),e&&a&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:a,children:jsxRuntime.jsx(Sb__default.default,{sx:{fontSize:d?16:18}})}),r&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:r,children:jsxRuntime.jsx(fx__default.default,{sx:{fontSize:d?16:18}})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:o,disabled:c||!e.trim(),children:jsxRuntime.jsx(bx__default.default,{sx:{fontSize:d?16:18}})})]}),l&&i&&jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",children:i})]});var Sm=(e,t)=>{let o=t.trim();if(!o)return e;let r=e.toLowerCase(),a=o.toLowerCase(),n=r.indexOf(a);return n<0?e:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e.slice(0,n),jsxRuntime.jsx(material.Box,{component:"mark",sx:{bgcolor:"warning.light",color:"warning.contrastText",px:.15,borderRadius:.4},children:e.slice(n,n+o.length)}),e.slice(n+o.length)]})},Jl=({section:e,highlightQuery:t=""})=>{let o=e.columns||2;return jsxRuntime.jsxs(material.Paper,{variant:"outlined",sx:{p:1.8,borderRadius:2},children:[jsxRuntime.jsx(material.Typography,{variant:"subtitle1",sx:{fontWeight:700,mb:1.4},children:e.title}),jsxRuntime.jsx(material.Box,{sx:{display:"grid",gap:1.15,gridTemplateColumns:{xs:"1fr",md:o===3?"repeat(3, minmax(0, 1fr))":o===1?"1fr":"repeat(2, minmax(0, 1fr))"}},children:e.fields.map(r=>{let a=typeof r.value=="string"||typeof r.value=="number"?String(r.value):null;return jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:Sm(r.label,t)}),jsxRuntime.jsx(material.Typography,{component:"div",variant:"body2",sx:{mt:.2,fontWeight:500,wordBreak:"break-word"},children:a?Sm(a,t):r.value})]},r.id)})})]})};var cd=e=>e==null?"":typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):"",ts=e=>e.trim().toLowerCase(),Kv=(e,t)=>{let o=[];return e.forEach(r=>{r.fields.forEach(a=>{let n=a.searchableText||cd(a.value),i={source:"section",sourceId:r.id,sourceSectionId:r.id,sourceTitle:r.title,fieldId:a.id,fieldLabel:a.label,fieldValue:n};o.push({hit:i,text:ts(`${r.title} ${a.label} ${n}`)});});}),t.forEach(r=>{(r.fields||[]).forEach(a=>{let n=a.searchableText||cd(a.value),i={source:"tab",sourceId:r.id,sourceTitle:r.label,fieldId:a.id,fieldLabel:a.label,fieldValue:n};o.push({hit:i,text:ts(`${r.label} ${a.label} ${n}`)});}),(r.sections||[]).forEach(a=>{a.fields.forEach(n=>{let i=n.searchableText||cd(n.value),c={source:"tab",sourceId:r.id,sourceSectionId:a.id,sourceTitle:`${r.label} / ${a.title}`,fieldId:n.id,fieldLabel:n.label,fieldValue:i};o.push({hit:c,text:ts(`${r.label} ${a.title} ${n.label} ${i}`)});});});}),o},km=({sections:e,tabs:t=[],defaultTabId:o,ai:r})=>{let{t:a}=ne(),[n,i]=Qt.useState(""),[c,d]=Qt.useState(o||t[0]?.id),[l,s]=Qt.useState("idle"),[g,f]=Qt.useState([]),[p,b]=Qt.useState(""),[y,u]=Qt.useState(""),[C,m]=Qt.useState(false),h=Qt.useMemo(()=>Kv(e,t),[e,t]);Qt.useEffect(()=>{if(t.length===0){d(void 0);return}t.some(I=>I.id===c)||d(o||t[0]?.id);},[t,c,o]);let x=Qt.useCallback(()=>{s("idle"),f([]),b(""),u("");},[]),w=Qt.useCallback(T=>{i(T),T.trim()||(s("idle"),f([]),b(""),u(""));},[]),E=Qt.useCallback(T=>{let I=ts(T);return I?h.filter(k=>k.text.includes(I)).map(k=>k.hit):[]},[h]),R=Qt.useCallback(async()=>{let T=n.trim();if(!T)return;m(true);let I=E(T);if(f(I),I.length>0){s("search"),u(""),b(a("detail.searchAi.matches",{count:I.length})),m(false);return}if(r?.enabled!==false&&r?.onSubmit){s("ai"),b(a("detail.searchAi.autoAiFallback"));try{let S=await r.onSubmit(T,{query:T,hits:I,activeTabId:c,sections:e,tabs:t});u(typeof S=="string"?S:"");}finally{m(false);}return}s("search"),u(""),b(a("detail.searchAi.noMatch")),m(false);},[n,E,a,r,c,e,t]);return {query:n,setQuery:w,activeTabId:c,setActiveTabId:d,searchMode:l,hits:g,statusText:p,aiResponse:y,searching:C,handleSubmit:R,clearResult:x}};var q5=({title:e,subtitle:t,sections:o,tabs:r=[],defaultTabId:a,table:n,ai:i,rightHeaderSlot:c,searchBarWidth:d=460,onClose:l,closeLabel:s="Close"})=>{let{t:g}=ne(),{query:f,setQuery:p,activeTabId:b,setActiveTabId:y,searchMode:u,hits:C,statusText:m,aiResponse:h,searching:x,handleSubmit:w,clearResult:E}=km({sections:o,tabs:r,defaultTabId:a,ai:i}),R=Qt.useMemo(()=>r.find(k=>k.id===b)||r[0],[r,b]),T=Qt.useCallback(k=>{let S=D=>{let P=document.getElementById(k);if(P){P.scrollIntoView({behavior:"smooth",block:"center"});return}D<4&&setTimeout(()=>S(D+1),60);};requestAnimationFrame(()=>S(0));},[]),I=Qt.useCallback((k,S)=>{if(r.some(D=>D.id===k)){y(k),T(S?`detail-tab-${k}-section-${S}`:`detail-tab-${k}`);return}T(`detail-section-${k}`);},[r,y,T]);return jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:1.5,minHeight:"100%"},children:[jsxRuntime.jsxs(material.Stack,{direction:{xs:"column",md:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",md:"center"},spacing:1,children:[jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsx(material.Typography,{variant:"h5",sx:{fontWeight:800,color:"text.primary"},children:e}),t&&jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",sx:{mt:.35},children:t})]}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:.6,alignItems:"center",sx:{width:{xs:"100%",md:"auto"},ml:{xs:0,md:"auto"}},children:[jsxRuntime.jsx(material.Box,{sx:{width:{xs:"100%",md:d},maxWidth:"100%",minWidth:{md:320}},children:jsxRuntime.jsx(Cm,{value:f,onChange:p,onSubmit:w,onVoiceInput:i?.onVoiceInput,onClear:()=>{p(""),E();},placeholder:i?.placeholder||g("detail.searchAi.placeholder"),statusText:m,loading:x,compact:true,showStatusText:false})}),l&&jsxRuntime.jsx(material.Tooltip,{title:s,children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:l,children:jsxRuntime.jsx(Qv__default.default,{fontSize:"small"})})}),c]})]}),m&&jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",sx:{mt:-0.7},children:m}),u==="search"&&C.length>0&&jsxRuntime.jsxs(material.Paper,{variant:"outlined",sx:{p:1.5,borderRadius:2},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.6},children:g("detail.searchAi.matches",{count:C.length})}),jsxRuntime.jsx(material.Stack,{spacing:.35,children:C.slice(0,8).map(k=>jsxRuntime.jsx(material.Box,{component:"button",type:"button",onClick:()=>I(k.sourceId,k.sourceSectionId),sx:{textAlign:"left",border:0,bgcolor:"transparent",p:.2,cursor:"pointer",color:"text.primary",borderRadius:1,"&:hover":{bgcolor:"action.hover"}},children:jsxRuntime.jsxs(material.Typography,{variant:"body2",sx:{fontSize:"0.84rem"},children:[jsxRuntime.jsx(material.Box,{component:"span",sx:{color:"text.secondary"},children:k.sourceTitle})," \xB7 ",jsxRuntime.jsx(material.Box,{component:"span",sx:{fontWeight:700},children:k.fieldLabel})," = ",jsxRuntime.jsx(material.Box,{component:"span",children:k.fieldValue||"-"})]})},`${k.source}|${k.sourceId}|${k.fieldId}`))})]}),u==="ai"&&h&&jsxRuntime.jsxs(material.Paper,{variant:"outlined",sx:{p:1.5,borderRadius:2},children:[jsxRuntime.jsx(material.Typography,{variant:"subtitle2",sx:{fontWeight:700,mb:.7},children:g("detail.searchAi.aiResultTitle")}),jsxRuntime.jsx(material.Box,{sx:{fontSize:"0.9rem",lineHeight:1.6,"& p":{m:0,mb:.8},"& h1, & h2, & h3, & h4":{mt:1.2,mb:.6,lineHeight:1.3},"& ul, & ol":{mt:.4,mb:.8,pl:2.6},"& code":{px:.5,py:.1,borderRadius:.8,bgcolor:"action.hover",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},"& pre":{m:0,mt:.8,mb:.8,p:1.1,borderRadius:1.2,bgcolor:"action.hover",overflowX:"auto"},"& pre code":{p:0,bgcolor:"transparent"}},children:jsxRuntime.jsx(Fi,{markdown:h})})]}),jsxRuntime.jsx(material.Box,{sx:{display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",lg:"repeat(2, minmax(0, 1fr))"}},children:o.map(k=>jsxRuntime.jsx(material.Box,{id:`detail-section-${k.id}`,children:jsxRuntime.jsx(Jl,{section:k,highlightQuery:f})},k.id))}),r.length>0&&jsxRuntime.jsxs(material.Paper,{variant:"outlined",sx:{borderRadius:2,overflow:"hidden"},children:[jsxRuntime.jsx(material.Tabs,{value:R?.id||false,onChange:(k,S)=>y(S),variant:"scrollable",scrollButtons:"auto",sx:{borderBottom:"1px solid",borderColor:"divider"},children:r.map(k=>jsxRuntime.jsx(material.Tab,{value:k.id,label:k.label,sx:{textTransform:"none"}},k.id))}),jsxRuntime.jsxs(material.Box,{sx:{p:1.5},children:[jsxRuntime.jsx(material.Box,{id:`detail-tab-${R?.id||""}`}),R?.description&&jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",sx:{mb:1.2},children:R.description}),R?.content?R.content:jsxRuntime.jsxs(material.Stack,{spacing:1.5,children:[(R?.sections||[]).map(k=>jsxRuntime.jsx(material.Box,{id:`detail-tab-${R?.id}-section-${k.id}`,children:jsxRuntime.jsx(Jl,{section:k,highlightQuery:f})},k.id)),R?.fields&&R.fields.length>0&&jsxRuntime.jsx(Jl,{section:{id:`${R.id}-fields`,title:R.label,fields:R.fields,columns:2},highlightQuery:f})]})]})]}),n&&jsxRuntime.jsx(Dr,{title:n.title||g("detail.table.title"),...n.tableProps,filterConfig:void 0,fitContainer:false})]})};var Pm=({bucket:e,cardCount:t,highlighted:o=false,children:r,emptyLabel:a,maxHeight:n,sx:i})=>{let{t:c}=ne();return jsxRuntime.jsx(material.Paper,{sx:[d=>{let l=e.accentColor??d.palette.primary.main;return {position:"relative",minWidth:0,borderRadius:4,overflow:"hidden",border:`1px solid ${styles.alpha(l,o?.58:d.palette.mode==="dark"?.28:.18)}`,bgcolor:styles.alpha(d.palette.background.paper,d.palette.mode==="dark"?.92:.97),boxShadow:o?`0 18px 40px ${styles.alpha(l,.22)}`:`0 10px 28px ${styles.alpha(d.palette.common.black,d.palette.mode==="dark"?.18:.08)}`,transition:"border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease","&::before":{content:'""',display:"block",height:4,bgcolor:l}}},...Array.isArray(i)?i:i?[i]:[]],children:jsxRuntime.jsxs(material.Stack,{spacing:1.2,sx:{p:1.5},children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:1},children:[jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:.8},children:[e.icon,jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.96rem",fontWeight:800},children:e.title})]}),e.description&&jsxRuntime.jsx(material.Typography,{sx:{mt:.45,fontSize:"0.76rem",color:"text.secondary",lineHeight:1.45},children:e.description})]}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:.8,sx:{flexShrink:0},children:[jsxRuntime.jsx(material.Chip,{size:"small",label:t,sx:{fontWeight:700}}),typeof e.limit=="number"&&jsxRuntime.jsx(material.Chip,{size:"small",label:`${c("kanban.bucket.limit")} ${e.limit}`,color:t>e.limit?"warning":"default",variant:"outlined"})]})]}),o&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",color:"primary.main",fontWeight:700},children:c("kanban.bucket.dropHere")}),jsxRuntime.jsx(material.Box,{sx:{minHeight:220,maxHeight:n,overflowY:n?"auto":"visible",pr:n?.4:0},children:t>0?r:jsxRuntime.jsx(material.Box,{sx:d=>({minHeight:160,borderRadius:3,border:`1px dashed ${styles.alpha(d.palette.divider,.9)}`,bgcolor:d.palette.mode==="dark"?styles.alpha(d.palette.common.white,.02):styles.alpha(d.palette.primary.main,.03),display:"grid",placeItems:"center",px:2,textAlign:"center"}),children:jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.78rem",color:"text.secondary"},children:a??e.emptyLabel??c("kanban.empty")})})})]})})};var rC={success:"success",warning:"warning",info:"info",error:"error"},aC={critical:"error",high:"warning",medium:"info",low:"success"},nC=(e,t)=>{switch(e){case "critical":return t("kanban.priority.critical");case "high":return t("kanban.priority.high");case "medium":return t("kanban.priority.medium");case "low":return t("kanban.priority.low");default:return e}},iC=e=>e?e.split(/\s+/).map(t=>t.charAt(0).toUpperCase()).slice(0,2).join(""):"NA",ud=({card:e,bucket:t,dragging:o=false,overlay:r=false,onClick:a,sx:n})=>{let{t:i}=ne(),c=!!(a&&t),d=e.tone??(e.priority?aC[e.priority]:"default"),l=d==="default"?"primary":rC[d],s=t?{card:e,bucket:t}:void 0;return jsxRuntime.jsx(material.Paper,{onClick:c?()=>s&&a?.(s):void 0,onKeyDown:c?g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),s&&a?.(s));}:void 0,role:c?"button":void 0,tabIndex:c?0:void 0,sx:[g=>{let f=d==="default"?g.palette.primary.main:g.palette[l].main;return {position:"relative",overflow:"hidden",p:1.4,borderRadius:3,border:`1px solid ${styles.alpha(f,g.palette.mode==="dark"?.42:.2)}`,bgcolor:styles.alpha(g.palette.background.paper,g.palette.mode==="dark"?.96:.98),boxShadow:r?`0 20px 45px ${styles.alpha(g.palette.common.black,.24)}`:o?"none":`0 8px 24px ${styles.alpha(g.palette.common.black,g.palette.mode==="dark"?.18:.08)}`,transform:r?"rotate(1deg) scale(1.01)":"none",transition:"transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease",cursor:c?"pointer":"default",opacity:o?.5:1,"&::before":{content:'""',position:"absolute",inset:"0 auto 0 0",width:4,bgcolor:f},"&:hover":c?{transform:"translateY(-1px)",boxShadow:`0 14px 32px ${styles.alpha(g.palette.common.black,g.palette.mode==="dark"?.28:.12)}`}:void 0}},...Array.isArray(n)?n:n?[n]:[]],children:jsxRuntime.jsxs(material.Stack,{spacing:1.1,children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:1},children:[jsxRuntime.jsxs(material.Box,{sx:{minWidth:0,flex:1},children:[(e.kicker||t?.title)&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",fontWeight:700,letterSpacing:.4,color:"text.secondary",textTransform:"uppercase"},children:e.kicker??t?.title}),jsxRuntime.jsx(material.Typography,{sx:{mt:.2,fontSize:"0.98rem",fontWeight:800,lineHeight:1.3},children:e.title})]}),e.priority&&jsxRuntime.jsx(material.Chip,{size:"small",color:l,label:nC(e.priority,i),variant:d==="default"?"outlined":"filled",sx:{height:22,fontWeight:700}})]}),e.summary&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.82rem",color:"text.secondary",lineHeight:1.5},children:e.summary}),e.metrics&&e.metrics.length>0&&jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${Math.min(e.metrics.length,3)}, minmax(0, 1fr))`,gap:.9},children:e.metrics.slice(0,3).map(g=>jsxRuntime.jsxs(material.Box,{sx:f=>({borderRadius:2,px:1,py:.8,bgcolor:f.palette.mode==="dark"?styles.alpha(f.palette.common.white,.05):styles.alpha(f.palette.primary.main,.05)}),children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.68rem",color:"text.secondary",textTransform:"uppercase",letterSpacing:.35},children:g.label}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.86rem",fontWeight:700},children:g.value})]},g.id))}),typeof e.progress=="number"&&jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:.5},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:i("kanban.card.progress")}),jsxRuntime.jsxs(material.Typography,{sx:{fontSize:"0.72rem",fontWeight:700},children:[Math.round(e.progress),"%"]})]}),jsxRuntime.jsx(material.LinearProgress,{variant:"determinate",value:Math.max(0,Math.min(100,e.progress)),color:l,sx:{height:8,borderRadius:999}})]}),(e.tags?.length||e.assignee||e.dueDate||e.footer||c)&&jsxRuntime.jsxs(material.Stack,{spacing:.9,children:[e.tags&&e.tags.length>0&&jsxRuntime.jsx(material.Box,{sx:{display:"flex",flexWrap:"wrap",gap:.75},children:e.tags.map(g=>jsxRuntime.jsx(material.Chip,{size:"small",label:g.label,color:g.color??"default",variant:"outlined"},g.id))}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1},children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:.8,minWidth:0},children:[e.assignee&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.Avatar,{src:e.assignee.avatarSrc,sx:{width:28,height:28,fontSize:"0.75rem"},children:e.assignee.initials??iC(e.assignee.name)}),jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.78rem",fontWeight:700,lineHeight:1.2},noWrap:true,children:e.assignee.name}),e.dueDate&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.7rem",color:"text.secondary",lineHeight:1.2},noWrap:true,children:e.dueDate})]})]}),!e.assignee&&e.dueDate&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.76rem",color:"text.secondary"},children:e.dueDate})]}),c&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",color:"primary.main",fontWeight:700,whiteSpace:"nowrap"},children:i("kanban.card.openDetail")})]}),e.footer]})]})})};var sC=(e,t)=>Number.isNaN(e)||e<0?0:e>t?t:e,Dm=({buckets:e,cards:t})=>{let o=new Map;return t.forEach((r,a)=>{let n=o.get(r.bucketId)??[];n.push({card:r,sourceIndex:a}),o.set(r.bucketId,n);}),{buckets:e.map(r=>{let a=[...o.get(r.id)??[]].sort((n,i)=>n.card.position===void 0&&i.card.position===void 0?n.sourceIndex-i.sourceIndex:n.card.position===void 0?1:i.card.position===void 0?-1:n.card.position-i.card.position||n.sourceIndex-i.sourceIndex).map(({card:n},i)=>({...n,bucketId:r.id,position:i}));return {...r,cards:a}})}},yr=(e,t)=>{for(let o=0;o<e.buckets.length;o+=1){let r=e.buckets[o],a=r.cards.findIndex(n=>n.id===t);if(a>=0)return {card:r.cards[a],bucket:r,bucketIndex:o,cardIndex:a}}},as=(e,t)=>{let o=yr(e,t.cardId);if(!o)return e;let r=e.buckets.findIndex(l=>l.id===t.toBucketId);if(r<0)return e;let a=e.buckets.map(l=>({...l,cards:l.cards.map(s=>({...s}))})),n=a[o.bucketIndex],[i]=n.cards.splice(o.cardIndex,1);if(!i)return e;let c=a[r],d=sC(t.targetIndex??c.cards.length,c.cards.length);return c.cards.splice(d,0,{...i,bucketId:t.toBucketId}),{buckets:a.map(l=>({...l,cards:l.cards.map((s,g)=>({...s,bucketId:l.id,position:g}))}))}};var pd="kanban-card|",md="kanban-bucket|",Fm=e=>`${pd}${e}`,CC=e=>`${md}${e}`,ns=e=>e?.startsWith(pd)?e.slice(pd.length):void 0,Em=e=>e?.startsWith(md)?e.slice(md.length):void 0,SC=({card:e,bucket:t,onCardClick:o})=>{let{setNodeRef:r,attributes:a,listeners:n,transform:i,transition:c,isDragging:d}=sortable.useSortable({id:Fm(e.id)}),l={transform:i?`translate3d(${i.x}px, ${i.y}px, 0)`:void 0,transition:c,zIndex:d?2:1,touchAction:"none",cursor:d?"grabbing":"grab"};return jsxRuntime.jsx(material.Box,{ref:r,style:l,...a,...n,children:jsxRuntime.jsx(ud,{card:e,bucket:t,dragging:d,onClick:o})})},kC=({bucket:e,highlighted:t,bucketMaxHeight:o,emptyBucketLabel:r,onCardClick:a})=>{let{isOver:n,setNodeRef:i}=core.useDroppable({id:CC(e.id)});return jsxRuntime.jsx(material.Box,{ref:i,sx:{minWidth:0},children:jsxRuntime.jsx(Pm,{bucket:e,cardCount:e.cards.length,highlighted:t||n,emptyLabel:r,maxHeight:o,children:jsxRuntime.jsx(sortable.SortableContext,{items:e.cards.map(c=>Fm(c.id)),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:1,children:e.cards.map(c=>jsxRuntime.jsx(SC,{card:c,bucket:e,onCardClick:a},c.id))})})})})},gE=({model:e,onCardMove:t,onCardClick:o,minBucketWidth:r=320,bucketMaxHeight:a,emptyBucketLabel:n,sx:i})=>{let[c,d]=Qt.useState(null),[l,s]=Qt.useState(),g=core.useSensors(core.useSensor(core.PointerSensor,{activationConstraint:{distance:6}}),core.useSensor(core.TouchSensor,{activationConstraint:{delay:120,tolerance:8}})),f=Qt.useMemo(()=>c?yr(e,c):void 0,[c,e]),p=Qt.useCallback(()=>{d(null),s(void 0);},[]),b=Qt.useCallback(m=>{if(!m)return;let h=ns(m);return h?yr(e,h)?.bucket.id:Em(m)},[e]),y=Qt.useCallback(m=>{d(ns(String(m.active.id))??null);},[]),u=Qt.useCallback(m=>{s(b(m.over?String(m.over.id):void 0));},[b]),C=Qt.useCallback(m=>{let h=ns(String(m.active.id)),x=m.over?String(m.over.id):void 0;if(!h||!x){p();return}let w=yr(e,h);if(!w){p();return}let E=w.bucket.id,R=w.cardIndex,T=ns(x);if(T){let S=yr(e,T);if(!S){p();return}E=S.bucket.id,R=S.cardIndex;}else {let S=Em(x),D=e.buckets.find(P=>P.id===S);if(!S||!D){p();return}E=S,R=D.cards.length;}if(w.bucket.id===E&&w.cardIndex===R){p();return}let I=as(e,{cardId:h,fromBucketId:w.bucket.id,toBucketId:E,targetIndex:R}),k=yr(I,h);k&&!(k.bucket.id===w.bucket.id&&k.cardIndex===w.cardIndex)&&t?.({cardId:h,fromBucketId:w.bucket.id,toBucketId:k.bucket.id,targetIndex:k.cardIndex,card:k.card,model:I}),p();},[e,t,p]);return jsxRuntime.jsxs(core.DndContext,{sensors:g,collisionDetection:core.closestCorners,onDragStart:y,onDragOver:u,onDragEnd:C,onDragCancel:p,children:[jsxRuntime.jsx(material.Box,{sx:[{display:"grid",gridAutoFlow:"column",gridAutoColumns:`minmax(${r}px, 1fr)`,gap:2,alignItems:"start",overflowX:"auto",pb:.5},...Array.isArray(i)?i:i?[i]:[]],children:e.buckets.map(m=>jsxRuntime.jsx(kC,{bucket:m,highlighted:m.id===l,bucketMaxHeight:a,emptyBucketLabel:n,onCardClick:o},m.id))}),jsxRuntime.jsx(core.DragOverlay,{children:f?jsxRuntime.jsx(material.Box,{sx:{width:Math.max(r-24,260)},children:jsxRuntime.jsx(ud,{card:f.card,bucket:f.bucket,overlay:true})}):null})]})};var PC=({initialModel:e,initialBuckets:t,initialCards:o})=>e||Dm({buckets:t??[],cards:o??[]}),xE=e=>{let{onCardMove:t,onCardClick:o}=e,[r,a]=Qt.useState(()=>PC(e)),n=Qt.useCallback(s=>{a(g=>typeof s=="function"?s(g):s);},[]),i=Qt.useCallback(s=>yr(r,s),[r]),c=Qt.useCallback((s,g,f)=>{let p=yr(r,s);if(!p)return;let b=as(r,{cardId:s,fromBucketId:p.bucket.id,toBucketId:g,targetIndex:f}),y=yr(b,s);if(!y||y.bucket.id===p.bucket.id&&y.cardIndex===p.cardIndex)return;a(b);let u={cardId:s,fromBucketId:p.bucket.id,toBucketId:y.bucket.id,targetIndex:y.cardIndex,card:y.card,model:b};return t?.(u),u},[r,t]),d=Qt.useCallback((s,g)=>{a(f=>({buckets:f.buckets.map(p=>({...p,cards:p.cards.map(b=>b.id!==s?b:typeof g=="function"?g(b):{...b,...g})}))}));},[]),l=Qt.useMemo(()=>({model:r,onCardMove:s=>{c(s.cardId,s.toBucketId,s.targetIndex);},onCardClick:o}),[r,c,o]);return {model:r,actions:{replaceModel:n,moveCard:c,updateCard:d,getCard:i},boardProps:l}};function Rn({onTextUpdate:e,onComplete:t,onError:o,wsUrl:r="ws://localhost:8765",silenceThresholdMs:a=2e3,minVolumeRms:n=.015}){let[i,c]=Qt.useState(false),d=Qt.useRef(null),l=Qt.useRef(null),s=Qt.useRef(null),g=Qt.useRef(null),f=Qt.useRef(null),p=Qt.useRef(0),b=Qt.useRef(false),y=Qt.useRef(false),u=Qt.useCallback(()=>{d.current&&(d.current.close(),d.current=null),g.current&&(g.current.disconnect(),g.current=null),f.current&&(f.current.disconnect(),f.current=null),l.current&&(l.current.getTracks().forEach(h=>h.stop()),l.current=null),s.current&&(s.current.close(),s.current=null),y.current=false,c(false);},[]),C=Qt.useCallback(()=>{b.current||(b.current=true,d.current?.readyState===WebSocket.OPEN&&d.current.send(JSON.stringify({type:"stop"})),setTimeout(u,500));},[u]),m=Qt.useCallback(async()=>{if(!(i||y.current)){y.current=true,b.current=false,p.current=Date.now();try{let h=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,sampleRate:16e3,echoCancellation:!0,noiseSuppression:!0}});l.current=h;let x=new WebSocket(r);d.current=x,x.onopen=()=>{c(!0),y.current=!1;},x.onmessage=I=>{try{let k=JSON.parse(I.data);if(k.type==="recognition")k.is_final?t(k.text):e?.(k.text);else if(k.type==="error"){let S=k.message||"Voice recognition error";o?.(S),C();}}catch{o?.("Failed to parse voice message");}},x.onerror=()=>{o?.("Voice service connection failed"),u();},x.onclose=()=>{u();};let w=window.AudioContext||window.webkitAudioContext;if(!w)throw new Error("AudioContext is not supported in this browser");let E=new w({sampleRate:16e3});s.current=E;let R=E.createMediaStreamSource(h);f.current=R;let T=E.createScriptProcessor(4096,1,1);g.current=T,T.onaudioprocess=I=>{if(d.current?.readyState!==WebSocket.OPEN)return;let k=I.inputBuffer.getChannelData(0),S=0;for(let M=0;M<k.length;M+=1)S+=k[M]*k[M];if(Math.sqrt(S/k.length)>n)p.current=Date.now();else if(Date.now()-p.current>a&&!b.current){C();return}let P=new Int16Array(k.length);for(let M=0;M<k.length;M+=1){let B=Math.max(-1,Math.min(1,k[M]));P[M]=B<0?B*32768:B*32767;}d.current.send(P.buffer);},R.connect(T),T.connect(E.destination);}catch{o?.("Cannot access microphone"),u();}}},[u,i,n,t,o,e,a,C,r]);return Qt.useEffect(()=>u,[u]),{isRecording:i,startRecording:m,stopRecording:C}}var Wm=64,_C="#E9EDF2",KC="linear-gradient(90deg, #F5F7FA 0%, #E9EDF2 50%, #F5F7FA 100%)",qC=["en","zh","fr","de","ja","ko"],Hm={en:"EN",zh:"\u4E2D\u6587",fr:"FR",de:"DE",ja:"\u65E5\u672C\u8A9E",ko:"\uD55C\uAD6D\uC5B4"},hd=({searchPlaceholder:e,onSearch:t,onSearchAdd:o,maxWidth:r=540,sx:a})=>{let{t:n}=ne(),i=material.useTheme(),c=i.palette.mode==="dark",[d,l]=Qt.useState(""),s=Qt.useCallback((h=d)=>{let x=h.trim();x&&(l(""),t?.(x));},[t,d]),g=h=>{h.preventDefault(),s();},{isRecording:f,startRecording:p,stopRecording:b}=Rn({onTextUpdate:l,onComplete:h=>{l(h),s(h);},onError:h=>{console.error("Header voice input error:",h);}}),y=Qt.useCallback(async()=>{if(f){b();return}await p();},[f,p,b]),u=e||n("header.searchPlaceholder"),C=d.trim().length>0,m={width:28,height:28,p:0,color:c?"rgba(255,255,255,0.72)":"rgba(15,23,42,0.56)","&:hover":{bgcolor:c?"rgba(255,255,255,0.1)":"rgba(15,23,42,0.06)"},"&.Mui-disabled":{color:c?"rgba(255,255,255,0.28)":"rgba(15,23,42,0.24)"}};return jsxRuntime.jsx(material.Box,{component:"form",onSubmit:g,sx:[{width:"100%",maxWidth:r},...Array.isArray(a)?a:a?[a]:[]],children:jsxRuntime.jsx(material.TextField,{size:"small",fullWidth:true,value:d,onChange:h=>l(h.target.value),placeholder:u,InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",sx:{ml:.25,mr:.5},children:jsxRuntime.jsx(material.IconButton,{size:"small",type:"button",onClick:o,"aria-label":n("header.searchAddFeature"),title:n("header.searchAddFeature"),sx:m,children:jsxRuntime.jsx(VC__default.default,{sx:{fontSize:20}})})}),endAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"end",sx:{ml:.5,mr:.25},children:jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:.15,children:[jsxRuntime.jsx(material.IconButton,{size:"small",type:"button",onClick:()=>{y();},"aria-label":n(f?"header.searchStopVoice":"header.searchStartVoice"),title:n(f?"header.searchStopVoice":"header.searchStartVoice"),sx:{...m,color:f?i.palette.error.main:m.color,bgcolor:f?c?"rgba(239,68,68,0.18)":"rgba(239,68,68,0.1)":"transparent"},children:f?jsxRuntime.jsx(lucideReact.MicOff,{size:17,strokeWidth:2.35}):jsxRuntime.jsx(lucideReact.Mic,{size:17,strokeWidth:2.35})}),jsxRuntime.jsx(material.IconButton,{size:"small",type:"submit",disabled:!C,"aria-label":n("header.searchSend"),title:n("header.searchSend"),sx:{...m,color:C?i.palette.primary.main:m.color},children:jsxRuntime.jsx(lucideReact.SendHorizontal,{size:17,strokeWidth:2.35})})]})}),sx:{color:c?"common.white":"rgba(17,24,39,0.9)",bgcolor:c?"rgba(255,255,255,0.08)":"#ffffff",borderRadius:999,pr:.5,"& .MuiInputBase-input":{py:1.1},"& .MuiOutlinedInput-notchedOutline":{borderColor:c?"rgba(255,255,255,0.15)":"rgba(15,23,42,0.2)"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:c?"rgba(255,255,255,0.35)":"rgba(15,23,42,0.35)"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:c?"rgba(255,255,255,0.5)":"rgba(15,23,42,0.55)"}}},inputProps:{style:{color:c?"white":"#111827"}}})})},cs=({appTitle:e,logo:t,mode:o="dark",onToggleMode:r,locale:a,localeLabel:n,localeOptions:i,onLocaleChange:c,searchPlaceholder:d,showSearch:l=false,onSearch:s,onSearchAdd:g,user:f,onUserSetting:p,onUserLogout:b,userMenuItems:y,leftSlot:u,rightSlot:C})=>{let{t:m,locale:h}=ne(),w=material.useTheme().palette.mode==="dark",[E,R]=Qt.useState(null),[T,I]=Qt.useState(null),k=o==="system"?jsxRuntime.jsx(WC__default.default,{fontSize:"small"}):o==="dark"?jsxRuntime.jsx(HC__default.default,{fontSize:"small"}):jsxRuntime.jsx($C__default.default,{fontSize:"small"}),S=m(o==="system"?"header.theme.system":o==="dark"?"header.theme.dark":"header.theme.light"),D=a||h,P=i&&i.length>0?i:qC,M=n||Hm[D]||D.toUpperCase(),B=!!E,X=!!T,L=[{key:"setting",label:m("header.menu.setting"),icon:jsxRuntime.jsx(p0__default.default,{sx:{fontSize:18}}),onClick:p},{key:"logout",label:m("header.menu.logout"),icon:jsxRuntime.jsx(UC__default.default,{sx:{fontSize:18}}),onClick:b}],Z=y&&y.length>0?y:L,$=q=>{I(null),q?.();};return jsxRuntime.jsxs(material.AppBar,{position:"sticky",elevation:0,sx:q=>({top:0,zIndex:q.zIndex.drawer+10,height:Wm,backgroundColor:q.palette.mode==="dark"?"#0D0D0D":_C,backgroundImage:q.palette.mode==="dark"?["radial-gradient(circle at 18% 22%, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0) 45%)","radial-gradient(circle at 78% 32%, rgba(144,202,249,0.14) 0%, rgba(144,202,249,0) 42%)","linear-gradient(90deg, #0A0A0A 0%, #151515 50%, #0A0A0A 100%)","linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px)","linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px)"].join(","):["radial-gradient(circle at 22% 22%, rgba(255,255,255,0.7) 0%, rgba(255,255,255,0) 48%)","radial-gradient(circle at 76% 24%, rgba(203,213,225,0.45) 0%, rgba(203,213,225,0) 42%)",KC,"linear-gradient(rgba(15,23,42,0.05) 1px, transparent 1px)","linear-gradient(90deg, rgba(15,23,42,0.04) 1px, transparent 1px)"].join(","),backgroundSize:"auto, auto, auto, 24px 24px, 24px 24px",borderBottom:"1px solid",borderColor:q.palette.mode==="dark"?"rgba(255,255,255,0.12)":"rgba(15,23,42,0.12)"}),children:[jsxRuntime.jsxs(material.Toolbar,{sx:{minHeight:`${Wm}px !important`,px:2,gap:2},children:[jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:1.5,sx:{minWidth:220},children:[u,t===null?null:t||jsxRuntime.jsx(material.Box,{component:"img",src:"/orbcafe.png",alt:"ORBCAFE Logo",sx:{width:44,height:44,display:"block",objectFit:"contain",flexShrink:0}}),e&&jsxRuntime.jsx(material.Typography,{variant:"h6",sx:{fontWeight:700,color:w?"common.white":"#111827"},children:e})]}),jsxRuntime.jsx(material.Box,{sx:{flex:1,display:"flex",justifyContent:"center",minWidth:0},children:l&&jsxRuntime.jsx(hd,{searchPlaceholder:d,onSearch:s,onSearchAdd:g})}),jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:1.5,children:[c?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.IconButton,{size:"small",onClick:q=>R(q.currentTarget),sx:{color:w?"common.white":"#111827",borderRadius:1,px:.5},children:jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:.45,children:[jsxRuntime.jsx(Vm__default.default,{sx:{fontSize:18}}),jsxRuntime.jsx(material.Typography,{variant:"caption",sx:{fontWeight:500},children:M})]})}),jsxRuntime.jsx(material.Menu,{anchorEl:E,open:B,onClose:()=>R(null),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:P.map(q=>jsxRuntime.jsx(material.MenuItem,{selected:q===D,onClick:()=>{c(q),R(null);},sx:{fontSize:"0.82rem"},children:Hm[q]},q))})]}):jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:.5,children:[jsxRuntime.jsx(Vm__default.default,{sx:{color:w?"common.white":"#111827",fontSize:18}}),jsxRuntime.jsx(material.Typography,{variant:"caption",sx:{color:w?"common.white":"#111827",fontWeight:500},children:M})]}),jsxRuntime.jsx(material.IconButton,{size:"small",sx:{color:w?"common.white":"#111827"},onClick:r,title:S,children:k}),f&&jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:1,children:[jsxRuntime.jsxs(material.Box,{sx:{textAlign:"right",minWidth:0},children:[jsxRuntime.jsx(material.Typography,{variant:"body2",sx:{color:w?"common.white":"#111827",fontWeight:700,lineHeight:1.15},children:f.name}),f.subtitle&&jsxRuntime.jsx(material.Typography,{variant:"caption",sx:{display:"block",mt:.25,color:w?"rgba(255,255,255,0.72)":"rgba(17,24,39,0.62)",fontSize:"0.72rem",lineHeight:1.1,letterSpacing:"0.01em",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:220},title:f.subtitle,children:f.subtitle})]}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:q=>I(q.currentTarget),sx:{p:0},children:jsxRuntime.jsx(material.Avatar,{src:f.avatarSrc,imgProps:{style:{objectFit:"cover"}},sx:{width:34,height:34,bgcolor:"grey.100",color:"grey.700",fontSize:"0.85rem"},children:f.avatarText||f.name.slice(0,1).toUpperCase()})})]}),C]})]}),f&&jsxRuntime.jsx(material.Menu,{anchorEl:T,open:X,onClose:()=>I(null),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},slotProps:{paper:{sx:{minWidth:160,"& .MuiMenuItem-root":{minHeight:34,py:.5,px:1.25}}}},children:Z.map(q=>jsxRuntime.jsxs(material.MenuItem,{disabled:q.disabled,onClick:()=>$(q.onClick),children:[q.icon&&jsxRuntime.jsx(material.ListItemIcon,{children:q.icon}),jsxRuntime.jsx(material.ListItemText,{primary:q.label,slotProps:{primary:{sx:{fontSize:"0.86rem",fontWeight:500}}}})]},q.key))})]})};var Gm=({menuData:e=[],initialNavigationCollapsed:t=false,initialNavigationMode:o="fixed"}={})=>{let{navigationIslandProps:r}=wu({initialCollapsed:t,initialDisplayMode:o,content:e}),[a,n]=Qt.useState(900);Qt.useEffect(()=>{let c=()=>n(window.innerHeight);return c(),window.addEventListener("resize",c),()=>window.removeEventListener("resize",c)},[]);let i=Qt.useMemo(()=>Math.max(280,a-100),[a]);return {navigationIslandProps:r,navigationMaxHeight:i}};var nr=12,Km=56,qm=234,ds=(e,t,o)=>Math.min(Math.max(e,t),Math.max(t,o)),eS=e=>e instanceof HTMLElement?!!e.closest('button,input,a,textarea,select,[role="button"],[contenteditable="true"]'):false,qE=({appTitle:e,menuData:t=[],children:o,showNavigation:r=true,locale:a="en",localeLabel:n,localeOptions:i,onLocaleChange:c,user:d,onUserSetting:l,onUserLogout:s,userMenuItems:g,logo:f,searchPlaceholder:p,searchPlacement:b="hidden",floatingSearchSx:y,onSearch:u,onSearchAdd:C,rightHeaderSlot:m,leftHeaderSlot:h,contentSx:x,navigationMode:w,defaultNavigationMode:E="fixed",onNavigationModeChange:R,showNavigationModeToggle:T=true})=>{let I="orbcafe:page-layout-mode",k="orbcafe:page-layout-navigation-mode",[S,D]=Qt.useState("system"),[P,M]=Qt.useState("light"),[B,X]=Qt.useState(false),[L,Z]=Qt.useState(false),[$,q]=Qt.useState(E),[H,re]=Qt.useState({x:nr,y:nr}),[de,Ce]=Qt.useState("left"),[ve,le]=Qt.useState(false),oe=Qt.useRef(null),Ie=Qt.useRef(null),Ze=w!==void 0,Ge=w??$,ce=Ge==="floating",Ve=b==="header",et=S==="system"?B?P:"light":S;Qt.useEffect(()=>{try{let je=window.localStorage.getItem(I);(je==="light"||je==="dark"||je==="system")&&D(je);}catch{}X(true);let ae=window.matchMedia("(prefers-color-scheme: dark)"),fe=()=>{M(ae.matches?"dark":"light");};return fe(),ae.addEventListener("change",fe),()=>ae.removeEventListener("change",fe)},[]),Qt.useEffect(()=>{if(B)try{window.localStorage.setItem(I,S);}catch{}},[B,S]),Qt.useEffect(()=>{if(Ze){Z(true);return}try{let ae=window.localStorage.getItem(k);(ae==="fixed"||ae==="floating")&&q(ae);}catch{}finally{Z(true);}},[Ze]),Qt.useEffect(()=>{if(L)try{window.localStorage.setItem(k,Ge);}catch{}},[Ge,L]),Qt.useEffect(()=>{et==="dark"?(document.documentElement.classList.add("dark"),document.documentElement.style.colorScheme="dark"):(document.documentElement.classList.remove("dark"),document.documentElement.style.colorScheme="light");},[et]);let ye=Qt.useMemo(()=>material.createTheme({palette:{mode:et}}),[et]),We=Qt.useCallback(ae=>{Ze||q(ae),R?.(ae);},[Ze,R]),{navigationIslandProps:qe,navigationMaxHeight:st}=Gm({menuData:t,initialNavigationCollapsed:false,initialNavigationMode:Ge}),Pe=qe.collapsed,K=Qt.useCallback(ae=>{let fe=oe.current,je=fe?.parentElement;if(!fe||!je)return ae;let It=je.getBoundingClientRect(),_=fe.getBoundingClientRect(),ze=nr,xe=nr,Y=Math.max(ze,It.width-_.width-nr),N=Math.max(xe,It.height-_.height-nr);return {x:ds(ae.x,ze,Y),y:ds(ae.y,xe,N)}},[]),Ee=Qt.useCallback(ae=>{let fe=oe.current,je=fe?.parentElement;if(!fe||!je)return ae;let It=je.getBoundingClientRect(),_=fe.getBoundingClientRect(),ze=nr,xe=nr,Y=Math.max(ze,It.width-_.width-nr),N=Math.max(xe,It.height-_.height-nr),J={x:ds(ae.x,ze,Y),y:ds(ae.y,xe,N)},Me=[{distance:Math.abs(J.x-ze),position:{x:ze,y:J.y}},{distance:Math.abs(J.x-Y),position:{x:Y,y:J.y}},{distance:Math.abs(J.y-xe),position:{x:J.x,y:xe}},{distance:Math.abs(J.y-N),position:{x:J.x,y:N}}].reduce((tt,bt)=>bt.distance<tt.distance?bt:tt).position;return Ce(Me.x>=(ze+Y)/2?"right":"left"),Me},[]),ge=Qt.useMemo(()=>{if(!ce||ve)return H.x;if(de==="right"){let je=oe.current?.parentElement?.getBoundingClientRect().width,It=Pe?Km:qm;return je?Math.max(nr,je-It-nr):Pe?H.x:H.x-(qm-Km)}return H.x},[de,H.x,ve,ce,Pe]),ke=Qt.useCallback(ae=>{if(!ce||!Pe||eS(ae.target))return;ae.preventDefault(),ae.currentTarget.setPointerCapture(ae.pointerId);let fe=K({x:ge,y:H.y});Ce("left"),re(fe),Ie.current={pointerId:ae.pointerId,startClientX:ae.clientX,startClientY:ae.clientY,startX:fe.x,startY:fe.y,currentX:fe.x,currentY:fe.y},le(true);},[K,ge,H.y,ce,Pe]),rt=Qt.useCallback(ae=>{let fe=Ie.current;if(!fe||fe.pointerId!==ae.pointerId)return;let je=K({x:fe.startX+ae.clientX-fe.startClientX,y:fe.startY+ae.clientY-fe.startClientY});fe.currentX=je.x,fe.currentY=je.y,re(je);},[K]),Ue=Qt.useCallback(ae=>{let fe=Ie.current;if(!(!fe||fe.pointerId!==ae.pointerId)){try{ae.currentTarget.releasePointerCapture(ae.pointerId);}catch{}Ie.current=null,re(Ee({x:fe.currentX,y:fe.currentY})),le(false);}},[Ee]);return Qt.useEffect(()=>{if(!ce)return;let ae=()=>{re(It=>K(It));},fe=window.requestAnimationFrame(ae),je=window.setTimeout(ae,430);return ()=>{window.cancelAnimationFrame(fe),window.clearTimeout(je);}},[K,ce,Pe,st]),jsxRuntime.jsx(material.ThemeProvider,{theme:ye,children:jsxRuntime.jsx(cl,{locale:a,children:jsxRuntime.jsxs(material.Box,{sx:ae=>({minHeight:"100vh",width:"100%",display:"flex",flexDirection:"column",overflowX:"hidden",background:ae.palette.mode==="dark"?"linear-gradient(180deg, #0A0A0A 0%, #141414 55%, #1A1A1A 100%)":ae.palette.background.default}),children:[jsxRuntime.jsx(cs,{appTitle:e,logo:f,mode:S,onToggleMode:()=>D(ae=>ae==="system"?"dark":ae==="dark"?"light":"system"),locale:a,localeLabel:n,localeOptions:i,onLocaleChange:c,user:d,onUserSetting:l,onUserLogout:s,userMenuItems:g,searchPlaceholder:p,showSearch:Ve,onSearch:u,onSearchAdd:C,leftSlot:h,rightSlot:m}),b==="floating"&&jsxRuntime.jsx(material.Box,{sx:[ae=>({position:"fixed",left:{xs:12,sm:"auto"},right:{xs:12,md:24},bottom:{xs:12,md:24},width:{xs:"auto",sm:540},maxWidth:"calc(100vw - 24px)",zIndex:ae.zIndex.modal+30,pointerEvents:"auto",filter:ae.palette.mode==="dark"?"drop-shadow(0 18px 42px rgba(0,0,0,0.58))":"drop-shadow(0 18px 36px rgba(15,23,42,0.18))"}),...Array.isArray(y)?y:y?[y]:[]],children:jsxRuntime.jsx(hd,{searchPlaceholder:p,onSearch:u,onSearchAdd:C,maxWidth:"100%"})}),jsxRuntime.jsxs(material.Box,{sx:{flex:1,minHeight:0,minWidth:0,display:"flex",overflowX:"hidden",position:"relative"},children:[r&&!ce&&jsxRuntime.jsx(material.Box,{sx:{pt:1.5,pb:1.5,pl:1.5,pr:Pe?.5:1.5,display:"flex",alignItems:"flex-start",flexShrink:0},children:jsxRuntime.jsx(dc,{...qe,maxHeight:st,colorMode:et,displayMode:Ge,onDisplayModeChange:We,showDisplayModeToggle:T&&Pe})}),r&&ce&&jsxRuntime.jsx(material.Box,{ref:oe,onPointerDown:ke,onPointerMove:rt,onPointerUp:Ue,onPointerCancel:Ue,sx:ae=>({position:"absolute",top:H.y,left:ge,zIndex:ae.zIndex.drawer+5,display:"flex",alignItems:"flex-start",cursor:Pe?ve?"grabbing":"grab":"default",touchAction:Pe?"none":"auto",userSelect:ve?"none":void 0,transition:ve?"none":"left 180ms ease-out, top 180ms ease-out"}),children:jsxRuntime.jsx(dc,{...qe,maxHeight:st,colorMode:et,displayMode:Ge,onDisplayModeChange:We,showDisplayModeToggle:T&&Pe})}),jsxRuntime.jsx(material.Box,{sx:{flex:1,minWidth:0,minHeight:0,overflow:"auto",pt:1.5,pb:1.5,pr:1.5,pl:r&&!ce&&Pe?.5:1.5,...x},children:o})]})]})})})};var us="(blank)",Xm="Result",Zm="Grand Total",Ym={sum:"Sum",count:"Count",avg:"Average",min:"Min",max:"Max"},Qm=["sum","count","avg","min","max"];var Jm=["palette","rows","columns","filters","values"];var eg=e=>Jm.includes(e),tg=e=>e==="rows"||e==="columns"||e==="filters",ps=e=>{let t=e.split("|");return t.length===2&&t[0]==="container"&&eg(t[1])?{kind:"container",zone:t[1]}:t.length===3&&t[0]==="item"&&eg(t[1])&&t[2]?{kind:"item",zone:t[1],key:t[2]}:null},jr=e=>e==null||e===""?us:e instanceof Date?e.toISOString().slice(0,10):String(e),Ua=e=>JSON.stringify(e),og=(e,t)=>{let o=e.join(""),r=t.join("");return o.localeCompare(r,void 0,{sensitivity:"base"})},tS=e=>{if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"&&e.trim()!==""){let t=Number(e);return Number.isFinite(t)?t:null}return null},Fn=(e,t,o)=>{if(o==="count")return e.length;let r=e.map(a=>tS(a[t])).filter(a=>a!==null);return r.length===0?0:o==="sum"?r.reduce((a,n)=>a+n,0):o==="avg"?r.reduce((a,n)=>a+n,0)/r.length:o==="min"?Math.min(...r):Math.max(...r)},no=(e,t)=>{if(!e||e.length===0)return [];let o=new Set,r=[];return e.forEach(a=>{!t.has(a)||o.has(a)||(o.add(a),r.push(a));}),r},Xr=(e,t)=>e.length!==t.length?false:e.every((o,r)=>o===t[r]),rg=(e,t)=>{let o=Object.keys(e),r=Object.keys(t);return o.length!==r.length?false:o.every(a=>{let n=e[a]??[],i=t[a]??[];return Xr(n,i)})},ms=(e,t)=>e.length!==t.length?false:e.every((o,r)=>{let a=t[r];return o.tokenId===a.tokenId&&o.fieldId===a.fieldId&&o.aggregation===a.aggregation}),bd=e=>!e?.aggregations||e.aggregations.length===0?Qm:e.aggregations,Po=(e,t)=>{let o=bd(t);return e&&o.includes(e)?e:t?.type==="number"&&o.includes("sum")?"sum":o.includes("count")?"count":o[0]},Wi=(e,t,o)=>{let r=o.get(t.fieldId);return r?.formatValue?r.formatValue(e):t.aggregation==="count"?Math.round(e).toLocaleString():e.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:2})};var ig=({options:e,selectedValues:t,onChange:o,minWidth:r=96})=>{let{t:a}=ne(),[n,i]=Qt.useState(""),c=Qt.useMemo(()=>{let l=n.trim().toLowerCase();return l?e.filter(s=>s.toLowerCase().includes(l)):e},[e,n]),d=e.length>0&&t.length===e.length;return jsxRuntime.jsx(material.FormControl,{size:"small",sx:{minWidth:r},children:jsxRuntime.jsxs(material.Select,{multiple:true,value:t,onChange:l=>{let s=l.target.value,g=typeof s=="string"?s.split(","):s;o(g);},onClick:l=>l.stopPropagation(),onMouseDown:l=>l.stopPropagation(),renderValue:l=>{let s=l;return e.length===0?a("pivot.filter.na"):s.length===0?a("common.none"):s.length===e.length?a("common.all"):`${s.length}/${e.length}`},MenuProps:{PaperProps:{sx:{maxHeight:320,bgcolor:"background.paper"}}},sx:{fontSize:"0.72rem",height:26,"& .MuiSelect-select":{py:.35}},children:[jsxRuntime.jsx(material.ListSubheader,{disableSticky:true,sx:l=>({bgcolor:"background.paper",py:.8,lineHeight:"normal",borderBottom:`1px solid ${l.palette.divider}`}),children:jsxRuntime.jsx(material.TextField,{size:"small",placeholder:`${a("common.search")}...`,fullWidth:true,value:n,onChange:l=>i(l.target.value),onKeyDown:l=>l.stopPropagation(),onClick:l=>l.stopPropagation(),sx:{m:0,"& .MuiInputBase-input":{fontSize:"0.75rem",py:.7}}})}),jsxRuntime.jsx(material.Box,{sx:l=>({px:1.5,py:.5,borderBottom:`1px solid ${l.palette.divider}`,bgcolor:"background.paper"}),onMouseDown:l=>{l.preventDefault(),l.stopPropagation();},onClick:l=>{l.preventDefault(),l.stopPropagation();},children:jsxRuntime.jsx(material.Button,{variant:"text",size:"small",onClick:l=>{l.preventDefault(),l.stopPropagation(),o(d?[]:e);},sx:{minWidth:"auto",px:0,py:.2,fontSize:"0.76rem",fontWeight:700,textTransform:"none"},children:a(d?"pivot.filter.deselectAll":"pivot.filter.selectAll")})}),c.length===0&&jsxRuntime.jsx(material.MenuItem,{disabled:true,sx:{fontSize:"0.75rem"},children:a("pivot.filter.noResults")}),c.map(l=>{let s=t.includes(l);return jsxRuntime.jsxs(material.MenuItem,{value:l,sx:{fontSize:"0.75rem",py:.25},children:[jsxRuntime.jsx(material.Checkbox,{size:"small",checked:s,sx:{p:.5,mr:.5}}),jsxRuntime.jsx(material.ListItemText,{primary:l,primaryTypographyProps:{sx:{fontSize:"0.75rem",lineHeight:1.2}}})]},l)})]})})};var xd=({label:e,subtitle:t,isDragging:o,dragRef:r,listeners:a,attributes:n,style:i})=>jsxRuntime.jsx(material.Paper,{ref:r,...a,...n,sx:c=>({p:1,borderRadius:2,border:"1px solid",borderColor:"divider",bgcolor:c.palette.mode==="dark"?"#111111":"background.paper",touchAction:"none"}),style:{...i,opacity:o?.3:1,cursor:o?"grabbing":"grab"},children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:.8},children:[jsxRuntime.jsx(material.Box,{sx:c=>({display:"inline-flex",alignItems:"center",justifyContent:"center",p:.3,borderRadius:1,bgcolor:c.palette.mode==="dark"?"rgba(255,255,255,0.12)":"rgba(17, 24, 39, 0.08)"}),children:jsxRuntime.jsx(mS__default.default,{sx:{fontSize:16,color:"text.secondary"}})}),jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.82rem",fontWeight:700,lineHeight:1.2},children:e}),t&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary",lineHeight:1.2},children:t})]})]})}),cg=({id:e,label:t,subtitle:o})=>{let{setNodeRef:r,listeners:a,attributes:n,isDragging:i}=core.useDraggable({id:e});return jsxRuntime.jsx(xd,{label:t,subtitle:o,isDragging:i,dragRef:r,listeners:a,attributes:n})};var zn=({zone:e,title:t,hint:o,icon:r,children:a,itemCount:n,onClear:i})=>{let c=`container|${e}`,{isOver:d,setNodeRef:l}=core.useDroppable({id:c}),{t:s}=ne();return jsxRuntime.jsxs(material.Paper,{ref:l,sx:g=>({p:1.1,borderRadius:3,border:"1px dashed",borderColor:d?"primary.main":g.palette.divider,bgcolor:d?g.palette.mode==="dark"?"rgba(25, 118, 210, 0.16)":"rgba(47, 91, 255, 0.06)":g.palette.mode==="dark"?"rgba(255,255,255,0.02)":"rgba(245, 248, 255, 0.86)",transition:"all 120ms ease",minHeight:120,display:"flex",flexDirection:"column"}),children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1},children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:.8},children:[r,jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.79rem",fontWeight:800,letterSpacing:.2},children:t}),jsxRuntime.jsxs(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:["(",n,")"]})]}),n>0&&i&&jsxRuntime.jsx(material.Tooltip,{title:s("pivot.clearArea"),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:i,sx:{p:.25},children:jsxRuntime.jsx(yS__default.default,{sx:{fontSize:16}})})})]}),jsxRuntime.jsx(material.Typography,{sx:{mt:.5,mb:.9,fontSize:"0.7rem",color:"text.secondary"},children:o}),jsxRuntime.jsx(material.Box,{sx:{flex:1},children:a})]})};var ug={xs:1.2,md:1.6},Vn=({title:e,subtitle:t,collapsed:o,onToggleCollapse:r,expandAriaLabel:a,collapseAriaLabel:n,children:i,bodySx:c,unmountOnExit:d=false,headerActions:l})=>jsxRuntime.jsxs(material.Paper,{sx:s=>({borderRadius:3,border:`1px solid ${s.palette.divider}`,overflow:"hidden",bgcolor:styles.alpha(s.palette.background.paper,.95)}),children:[jsxRuntime.jsxs(material.Box,{sx:s=>({px:ug,py:1,display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,borderBottom:o?"none":`1px solid ${s.palette.divider}`}),children:[jsxRuntime.jsxs(material.Box,{sx:{minWidth:0,flex:1},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.9rem",fontWeight:800},children:e}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.74rem",color:"text.secondary",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t})]}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:.75,flexShrink:0},children:[l,jsxRuntime.jsx(material.IconButton,{size:"small","aria-label":o?a:n,onClick:r,sx:s=>({border:`1px solid ${s.palette.divider}`,bgcolor:styles.alpha(s.palette.background.paper,.88),width:28,height:28,borderRadius:999,flexShrink:0,"&:hover":{bgcolor:s.palette.mode==="dark"?styles.alpha(s.palette.primary.main,.18):styles.alpha(s.palette.primary.main,.08)}}),children:jsxRuntime.jsx(m0__default.default,{sx:{fontSize:16,transition:"transform 220ms cubic-bezier(0.2, 0, 0, 1)",transform:o?"rotate(180deg)":"rotate(0deg)"}})})]})]}),jsxRuntime.jsx(material.Collapse,{in:!o,timeout:260,easing:"cubic-bezier(0.2, 0, 0, 1)",unmountOnExit:d,children:jsxRuntime.jsx(material.Box,{sx:[{px:ug,py:{xs:1.2,md:1.6}},...Array.isArray(c)?c:c?[c]:[]],children:i})})]});var ys=({label:e,caption:t,onRemove:o,trailing:r,isDragging:a,dragRef:n,listeners:i,attributes:c,style:d})=>jsxRuntime.jsx(material.Paper,{ref:n,style:d,sx:l=>({p:1,borderRadius:2,border:"1px solid",borderColor:"divider",bgcolor:l.palette.mode==="dark"?"#111111":"background.paper",touchAction:"none",opacity:a?0:1}),children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:.8},children:[jsxRuntime.jsx(material.Box,{...c,...i,sx:l=>({display:"inline-flex",alignItems:"center",justifyContent:"center",p:.25,borderRadius:1,bgcolor:l.palette.mode==="dark"?"rgba(255,255,255,0.12)":"rgba(17, 24, 39, 0.08)",cursor:"grab"}),children:jsxRuntime.jsx(mS__default.default,{sx:{fontSize:15,color:"text.secondary"}})}),jsxRuntime.jsxs(material.Box,{sx:{minWidth:0,flex:1},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.8rem",fontWeight:700,lineHeight:1.2},children:e}),t&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.7rem",color:"text.secondary",lineHeight:1.2},children:t})]}),r,o&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:l=>{l.stopPropagation(),o();},sx:{p:.2},children:jsxRuntime.jsx(Sb__default.default,{sx:{fontSize:16}})})]})}),Hi=({id:e,label:t,caption:o,onRemove:r,trailing:a})=>{let{setNodeRef:n,attributes:i,listeners:c,transform:d,transition:l,isDragging:s}=sortable.useSortable({id:e}),g={transform:d?`translate3d(${d.x}px, ${d.y}px, 0)`:void 0,transition:l,zIndex:s?999:"auto"};return jsxRuntime.jsx(ys,{label:t,caption:o,onRemove:r,trailing:a,isDragging:s,dragRef:n,listeners:c,attributes:i,style:g})};var Cs={rows:jsxRuntime.jsx(BS__default.default,{fontSize:"small"}),columns:jsxRuntime.jsx(zb__default.default,{fontSize:"small"}),filters:jsxRuntime.jsx(AS__default.default,{fontSize:"small"}),values:jsxRuntime.jsx(Hb__default.default,{fontSize:"small"})},gg=({isConfiguratorCollapsed:e,onToggleCollapse:t,availableFields:o,fieldMap:r,filterFields:a,columnFields:n,rowFields:i,valueFields:c,clearZone:d,removeFieldFromZone:l,getFilterSelectionSummary:s,renderDimensionFilterSelect:g,renderAggregationSelect:f,getAggregationLabel:p})=>{let{t:b}=ne(),y=[`${b("pivot.zone.rows")} ${i.length}`,`${b("pivot.zone.columns")} ${n.length}`,`${b("pivot.zone.filters")} ${a.length}`,`${b("pivot.zone.values")} ${c.length}`].join(" \xB7 ");return jsxRuntime.jsx(Vn,{title:b("pivot.config.title"),subtitle:y,collapsed:e,onToggleCollapse:t,expandAriaLabel:b("pivot.collapse.ariaExpand"),collapseAriaLabel:b("pivot.collapse.ariaCollapse"),unmountOnExit:true,children:jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",lg:"260px 1fr"},gap:2},children:[jsxRuntime.jsx(zn,{zone:"palette",title:b("pivot.fieldList"),hint:b("pivot.availableDimensions"),itemCount:o.length,icon:jsxRuntime.jsx(mS__default.default,{sx:{fontSize:16,color:"text.secondary"}}),children:jsxRuntime.jsxs(material.Stack,{spacing:.8,sx:{maxHeight:400,overflowY:"auto",pr:.5},children:[o.length===0&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.74rem",color:"text.secondary",py:1},children:b("pivot.allFieldsInUse")}),o.map(u=>jsxRuntime.jsx(cg,{id:`item|palette|${u.id}`,label:u.label,subtitle:u.type??"string"},u.id))]})}),jsxRuntime.jsxs(material.Stack,{spacing:2,children:[jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[jsxRuntime.jsx(zn,{zone:"filters",title:b("pivot.zone.filters"),hint:b("pivot.hint.filters"),icon:Cs.filters,itemCount:a.length,onClear:()=>d("filters"),children:jsxRuntime.jsx(sortable.SortableContext,{items:a.map(u=>`item|filters|${u}`),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:.7,children:a.map(u=>jsxRuntime.jsx(Hi,{id:`item|filters|${u}`,label:r.get(u)?.label??u,caption:s(u),trailing:g(u),onRemove:()=>l("filters",u)},u))})})}),jsxRuntime.jsx(zn,{zone:"columns",title:b("pivot.zone.columns"),hint:b("pivot.hint.columns"),icon:Cs.columns,itemCount:n.length,onClear:()=>d("columns"),children:jsxRuntime.jsx(sortable.SortableContext,{items:n.map(u=>`item|columns|${u}`),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:.7,children:n.map(u=>jsxRuntime.jsx(Hi,{id:`item|columns|${u}`,label:r.get(u)?.label??u,caption:`${r.get(u)?.type??"dimension"} \u2022 ${s(u)}`,trailing:g(u),onRemove:()=>l("columns",u)},u))})})})]}),jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[jsxRuntime.jsx(zn,{zone:"rows",title:b("pivot.zone.rows"),hint:b("pivot.hint.rows"),icon:Cs.rows,itemCount:i.length,onClear:()=>d("rows"),children:jsxRuntime.jsx(sortable.SortableContext,{items:i.map(u=>`item|rows|${u}`),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:.7,children:i.map(u=>jsxRuntime.jsx(Hi,{id:`item|rows|${u}`,label:r.get(u)?.label??u,caption:`${r.get(u)?.type??"dimension"} \u2022 ${s(u)}`,trailing:g(u),onRemove:()=>l("rows",u)},u))})})}),jsxRuntime.jsx(zn,{zone:"values",title:b("pivot.zone.values"),hint:b("pivot.hint.values"),icon:Cs.values,itemCount:c.length,onClear:()=>d("values"),children:jsxRuntime.jsx(sortable.SortableContext,{items:c.map(u=>`item|values|${u.tokenId}`),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:.7,children:c.map(u=>{let C=r.get(u.fieldId)?.label??u.fieldId,m=`${p(u.aggregation)}(${C})`;return jsxRuntime.jsx(Hi,{id:`item|values|${u.tokenId}`,label:C,caption:m,trailing:f(u),onRemove:()=>l("values",u.tokenId)},u.tokenId)})})})})]})]})]})})};var fg=e=>e.toLocaleString(void 0,{maximumFractionDigits:1}),hg=({data:e,primaryLabel:t,secondaryLabel:o,formatPrimaryValue:r,formatSecondaryValue:a})=>{let n=styles.useTheme();if(e.length===0)return null;let i=720,c=250,d={top:20,right:24,bottom:40,left:52},l=o?e.map(u=>u.primaryValue):e.map((u,C)=>C+1),s=o?e.map(u=>u.secondaryValue??0):e.map(u=>u.primaryValue),g=Math.max(...l,1),f=Math.max(...s,1),p=i-d.left-d.right,b=c-d.top-d.bottom,y=e.map((u,C)=>{let m=o?u.primaryValue:C+1,h=o?u.secondaryValue??0:u.primaryValue,x=d.left+m/g*p,w=c-d.bottom-h/f*b;return {...u,x,y:w,rawX:m,rawY:h}});return jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[jsxRuntime.jsx(material.Box,{sx:{overflowX:"auto"},children:jsxRuntime.jsxs(material.Box,{component:"svg",viewBox:`0 0 ${i} ${c}`,sx:{width:"100%",minWidth:i,height:c},children:[jsxRuntime.jsx("line",{x1:d.left,y1:c-d.bottom,x2:i-d.right,y2:c-d.bottom,stroke:styles.alpha(n.palette.text.secondary,.35)}),jsxRuntime.jsx("line",{x1:d.left,y1:d.top,x2:d.left,y2:c-d.bottom,stroke:styles.alpha(n.palette.text.secondary,.35)}),y.map(u=>jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("circle",{cx:u.x,cy:u.y,r:7,fill:styles.alpha(n.palette.primary.main,.18)}),jsxRuntime.jsx("circle",{cx:u.x,cy:u.y,r:4.5,fill:n.palette.primary.main,children:jsxRuntime.jsxs("title",{children:[u.name,`
189
+ `),g={enableMath:r},p=0;for(;p<m.length;){let b=m[p],y=b.trim();if(!y){p+=1;continue}if(n&&Cm(b)){if(y.startsWith("<think>")){let f=[],h=b;for(;;){let v=h.indexOf("<think>"),S=v>=0?h.slice(v+7):h,E=S.indexOf("</think>");if(E>=0){f.push(S.slice(0,E)),p+=1;break}if(f.push(S),p+=1,p>=m.length)break;h=m[p];}s.push(jsxRuntime.jsx(ts,{content:f.join(`
190
+ `).trim()},`think-tag-${p}`));continue}p+=1;let x=[];for(;p<m.length&&m[p].trim()!==":::";)x.push(m[p]),p+=1;p<m.length&&m[p].trim()===":::"&&(p+=1),s.push(jsxRuntime.jsx(ts,{content:x.join(`
191
+ `).trim()},`think-fence-${p}`));continue}if(os(b)){let x=y.slice(3).trim().toLowerCase(),f=[];for(p+=1;p<m.length&&!os(m[p]);)f.push(m[p]),p+=1;p<m.length&&os(m[p])&&(p+=1);let h=f.join(`
192
+ `);if(a&&x==="mermaid"){s.push(jsxRuntime.jsx(td,{code:h},`mermaid-${p}`));continue}if(r&&["math","latex","katex"].includes(x)){s.push(jsxRuntime.jsx(Bi,{expression:h,allowKatex:true},`math-fence-${p}`));continue}s.push(jsxRuntime.jsx(Ai,{code:h,language:x||"text",copyable:i,showLineNumbers:c,wrapLongLines:true},`code-${p}`));continue}if(r&&y.startsWith("$$")){let x=[];if(y.endsWith("$$")&&y!=="$$")x.push(y.slice(2,-2)),p+=1;else {let h=b.slice(b.indexOf("$$")+2);for(h.trim()&&x.push(h),p+=1;p<m.length;){let v=m[p],S=v.indexOf("$$");if(S>=0){x.push(v.slice(0,S)),p+=1;break}x.push(v),p+=1;}}s.push(jsxRuntime.jsx(Bi,{expression:x.join(`
193
+ `).trim(),allowKatex:true},`math-${p}`));continue}if(ym(b)){let x=Math.min(6,b.match(/^#{1,6}/)?.[0]?.length||1),f=b.replace(/^#{1,6}\s+/,""),h=x===1?"h5":x===2?"h6":"subtitle1";s.push(jsxRuntime.jsx(material.Typography,{variant:h,sx:{mt:x===1?1.2:.8,mb:.5,fontWeight:700},children:Li(f,g,`h-${p}`)},`heading-${p}`)),p+=1;continue}if(xm(b)){s.push(jsxRuntime.jsx(material.Divider,{sx:{my:1.2}},`hr-${p}`)),p+=1;continue}if(vm(m,p)){let x=p+2;for(;x<m.length&&m[x].trim()&&m[x].includes("|");)x+=1;let f=m.slice(p,x).join(`
194
+ `),h=Jl(f);if(h){s.push(jsxRuntime.jsx(rd,{table:h},`table-${p}`)),p=x;continue}}if(sd(b)){let x=[];for(;p<m.length&&sd(m[p]);)x.push(m[p].replace(/^\s*>\s?/,"")),p+=1;s.push(jsxRuntime.jsx(material.Paper,{variant:"outlined",sx:{px:1,py:.8,my:.9,borderLeftWidth:3,borderLeftStyle:"solid",borderLeftColor:"primary.main",bgcolor:"action.hover"},children:jsxRuntime.jsx(material.Typography,{variant:"body2",sx:{whiteSpace:"pre-wrap"},children:x.map((f,h)=>jsxRuntime.jsxs(Yt.Fragment,{children:[h>0&&jsxRuntime.jsx("br",{}),Li(f,g,`q-${p}-${h}`)]},`quote-line-${h}`))})},`quote-${p}`));continue}if(id(b)){let x=[];for(;p<m.length&&id(m[p]);)x.push(m[p].trim().replace(/^[-*+]\s+/,"")),p+=1;s.push(jsxRuntime.jsx(material.Box,{component:"ul",sx:{my:.8,pl:2.5},children:x.map((f,h)=>jsxRuntime.jsx(material.Box,{component:"li",sx:{mb:.45},children:jsxRuntime.jsx(material.Typography,{variant:"body2",children:Li(f,g,`ul-${p}-${h}`)})},`ul-item-${h}`))},`ul-${p}`));continue}if(ld(b)){let x=[];for(;p<m.length&&ld(m[p]);)x.push(m[p].trim().replace(/^\d+\.\s+/,"")),p+=1;s.push(jsxRuntime.jsx(material.Box,{component:"ol",sx:{my:.8,pl:2.7},children:x.map((f,h)=>jsxRuntime.jsx(material.Box,{component:"li",sx:{mb:.45},children:jsxRuntime.jsx(material.Typography,{variant:"body2",children:Li(f,g,`ol-${p}-${h}`)})},`ol-item-${h}`))},`ol-${p}`));continue}let u=[];for(;p<m.length;){let x=m[p],f=x.trim();if(!f||os(x)||ym(x)||xm(x)||id(x)||ld(x)||sd(x)||vm(m,p)||n&&Cm(x)||r&&f.startsWith("$$"))break;u.push(x),p+=1;}u.length>0?s.push(jsxRuntime.jsx(material.Typography,{variant:"body2",sx:{my:.65,lineHeight:1.65},children:u.map((x,f)=>jsxRuntime.jsxs(Yt.Fragment,{children:[f>0&&jsxRuntime.jsx("br",{}),Li(x,g,`p-${p}-${f}`)]},`p-line-${f}`))},`p-${p}`)):p+=1;}return s},[d,r,a,n,i,c]);return jsxRuntime.jsx(material.Box,{className:o,sx:{"& strong":{fontWeight:700},"& em":{fontStyle:"italic"},"& a":{wordBreak:"break-all"}},children:l})};var k5=(e,t)=>jsxRuntime.jsx(Ni,{markdown:e,...t});var wm=({value:e,onChange:t,onSubmit:o,onVoiceInput:r,onClear:a,placeholder:n,statusText:i,loading:c=false,compact:d=false,showStatusText:l=true})=>jsxRuntime.jsxs(material.Stack,{spacing:.75,children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:1,px:1.2,py:d?.25:.4,borderRadius:999,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",minHeight:d?38:44},children:[jsxRuntime.jsx(Lu__default.default,{sx:{fontSize:d?16:18,color:"text.secondary"}}),jsxRuntime.jsx(material.InputBase,{fullWidth:true,value:e,onChange:s=>t(s.target.value),onKeyDown:s=>{s.key==="Enter"&&(s.preventDefault(),o());},placeholder:n,sx:{fontSize:d?"0.84rem":"0.9rem"}}),e&&a&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:a,children:jsxRuntime.jsx(Rb__default.default,{sx:{fontSize:d?16:18}})}),r&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:r,children:jsxRuntime.jsx(Cx__default.default,{sx:{fontSize:d?16:18}})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:o,disabled:c||!e.trim(),children:jsxRuntime.jsx(kx__default.default,{sx:{fontSize:d?16:18}})})]}),l&&i&&jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",children:i})]});var Tm=(e,t)=>{let o=t.trim();if(!o)return e;let r=e.toLowerCase(),a=o.toLowerCase(),n=r.indexOf(a);return n<0?e:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e.slice(0,n),jsxRuntime.jsx(material.Box,{component:"mark",sx:{bgcolor:"warning.light",color:"warning.contrastText",px:.15,borderRadius:.4},children:e.slice(n,n+o.length)}),e.slice(n+o.length)]})},rs=({section:e,highlightQuery:t=""})=>{let o=e.columns||2;return jsxRuntime.jsxs(material.Paper,{variant:"outlined",sx:{p:1.8,borderRadius:2},children:[jsxRuntime.jsx(material.Typography,{variant:"subtitle1",sx:{fontWeight:700,mb:1.4},children:e.title}),jsxRuntime.jsx(material.Box,{sx:{display:"grid",gap:1.15,gridTemplateColumns:{xs:"1fr",md:o===3?"repeat(3, minmax(0, 1fr))":o===1?"1fr":"repeat(2, minmax(0, 1fr))"}},children:e.fields.map(r=>{let a=typeof r.value=="string"||typeof r.value=="number"?String(r.value):null;return jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:Tm(r.label,t)}),jsxRuntime.jsx(material.Typography,{component:"div",variant:"body2",sx:{mt:.2,fontWeight:500,wordBreak:"break-word"},children:a?Tm(a,t):r.value})]},r.id)})})]})};var md=e=>e==null?"":typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):"",ns=e=>e.trim().toLowerCase(),Qv=(e,t)=>{let o=[];return e.forEach(r=>{r.fields.forEach(a=>{let n=a.searchableText||md(a.value),i={source:"section",sourceId:r.id,sourceSectionId:r.id,sourceTitle:r.title,fieldId:a.id,fieldLabel:a.label,fieldValue:n};o.push({hit:i,text:ns(`${r.title} ${a.label} ${n}`)});});}),t.forEach(r=>{(r.fields||[]).forEach(a=>{let n=a.searchableText||md(a.value),i={source:"tab",sourceId:r.id,sourceTitle:r.label,fieldId:a.id,fieldLabel:a.label,fieldValue:n};o.push({hit:i,text:ns(`${r.label} ${a.label} ${n}`)});}),(r.sections||[]).forEach(a=>{a.fields.forEach(n=>{let i=n.searchableText||md(n.value),c={source:"tab",sourceId:r.id,sourceSectionId:a.id,sourceTitle:`${r.label} / ${a.title}`,fieldId:n.id,fieldLabel:n.label,fieldValue:i};o.push({hit:c,text:ns(`${r.label} ${a.title} ${n.label} ${i}`)});});});}),o},Im=({sections:e,tabs:t=[],defaultTabId:o,ai:r})=>{let{t:a}=le(),[n,i]=Yt.useState(""),[c,d]=Yt.useState(o||t[0]?.id),[l,s]=Yt.useState("idle"),[m,g]=Yt.useState([]),[p,b]=Yt.useState(""),[y,u]=Yt.useState(""),[x,f]=Yt.useState(false),h=Yt.useMemo(()=>Qv(e,t),[e,t]);Yt.useEffect(()=>{if(t.length===0){d(void 0);return}t.some(D=>D.id===c)||d(o||t[0]?.id);},[t,c,o]);let v=Yt.useCallback(()=>{s("idle"),g([]),b(""),u("");},[]),S=Yt.useCallback(w=>{i(w),w.trim()||(s("idle"),g([]),b(""),u(""));},[]),E=Yt.useCallback(w=>{let D=ns(w);return D?h.filter(I=>I.text.includes(D)).map(I=>I.hit):[]},[h]),P=Yt.useCallback(async()=>{let w=n.trim();if(!w)return;f(true);let D=E(w);if(g(D),D.length>0){s("search"),u(""),b(a("detail.searchAi.matches",{count:D.length})),f(false);return}if(r?.enabled!==false&&r?.onSubmit){s("ai"),b(a("detail.searchAi.autoAiFallback"));try{let k=await r.onSubmit(w,{query:w,hits:D,activeTabId:c,sections:e,tabs:t});u(typeof k=="string"?k:"");}finally{f(false);}return}s("search"),u(""),b(a("detail.searchAi.noMatch")),f(false);},[n,E,a,r,c,e,t]);return {query:n,setQuery:S,activeTabId:c,setActiveTabId:d,searchMode:l,hits:m,statusText:p,aiResponse:y,searching:x,handleSubmit:P,clearResult:v}};var eE=({title:e,subtitle:t,sections:o,tabs:r=[],defaultTabId:a,table:n,ai:i,rightHeaderSlot:c,searchBarWidth:d=460,onClose:l,closeLabel:s="Close"})=>{let{t:m}=le(),{query:g,setQuery:p,activeTabId:b,setActiveTabId:y,searchMode:u,hits:x,statusText:f,aiResponse:h,searching:v,handleSubmit:S,clearResult:E}=Im({sections:o,tabs:r,defaultTabId:a,ai:i}),P=Yt.useMemo(()=>r.find(I=>I.id===b)||r[0],[r,b]),w=Yt.useCallback(I=>{let k=A=>{let T=document.getElementById(I);if(T){T.scrollIntoView({behavior:"smooth",block:"center"});return}A<4&&setTimeout(()=>k(A+1),60);};requestAnimationFrame(()=>k(0));},[]),D=Yt.useCallback((I,k)=>{if(r.some(A=>A.id===I)){y(I),w(k?`detail-tab-${I}-section-${k}`:`detail-tab-${I}`);return}w(`detail-section-${I}`);},[r,y,w]);return jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:1.5,minHeight:"100%"},children:[jsxRuntime.jsxs(material.Stack,{direction:{xs:"column",md:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",md:"center"},spacing:1,children:[jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsx(material.Typography,{variant:"h5",sx:{fontWeight:800,color:"text.primary"},children:e}),t&&jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",sx:{mt:.35},children:t})]}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:.6,alignItems:"center",sx:{width:{xs:"100%",md:"auto"},ml:{xs:0,md:"auto"}},children:[jsxRuntime.jsx(material.Box,{sx:{width:{xs:"100%",md:d},maxWidth:"100%",minWidth:{md:320}},children:jsxRuntime.jsx(wm,{value:g,onChange:p,onSubmit:S,onVoiceInput:i?.onVoiceInput,onClear:()=>{p(""),E();},placeholder:i?.placeholder||m("detail.searchAi.placeholder"),statusText:f,loading:v,compact:true,showStatusText:false})}),l&&jsxRuntime.jsx(material.Tooltip,{title:s,children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:l,children:jsxRuntime.jsx(aC__default.default,{fontSize:"small"})})}),c]})]}),f&&jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",sx:{mt:-0.7},children:f}),u==="search"&&x.length>0&&jsxRuntime.jsxs(material.Paper,{variant:"outlined",sx:{p:1.5,borderRadius:2},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.6},children:m("detail.searchAi.matches",{count:x.length})}),jsxRuntime.jsx(material.Stack,{spacing:.35,children:x.slice(0,8).map(I=>jsxRuntime.jsx(material.Box,{component:"button",type:"button",onClick:()=>D(I.sourceId,I.sourceSectionId),sx:{textAlign:"left",border:0,bgcolor:"transparent",p:.2,cursor:"pointer",color:"text.primary",borderRadius:1,"&:hover":{bgcolor:"action.hover"}},children:jsxRuntime.jsxs(material.Typography,{variant:"body2",sx:{fontSize:"0.84rem"},children:[jsxRuntime.jsx(material.Box,{component:"span",sx:{color:"text.secondary"},children:I.sourceTitle})," \xB7 ",jsxRuntime.jsx(material.Box,{component:"span",sx:{fontWeight:700},children:I.fieldLabel})," = ",jsxRuntime.jsx(material.Box,{component:"span",children:I.fieldValue||"-"})]})},`${I.source}|${I.sourceId}|${I.fieldId}`))})]}),u==="ai"&&h&&jsxRuntime.jsxs(material.Paper,{variant:"outlined",sx:{p:1.5,borderRadius:2},children:[jsxRuntime.jsx(material.Typography,{variant:"subtitle2",sx:{fontWeight:700,mb:.7},children:m("detail.searchAi.aiResultTitle")}),jsxRuntime.jsx(material.Box,{sx:{fontSize:"0.9rem",lineHeight:1.6,"& p":{m:0,mb:.8},"& h1, & h2, & h3, & h4":{mt:1.2,mb:.6,lineHeight:1.3},"& ul, & ol":{mt:.4,mb:.8,pl:2.6},"& code":{px:.5,py:.1,borderRadius:.8,bgcolor:"action.hover",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},"& pre":{m:0,mt:.8,mb:.8,p:1.1,borderRadius:1.2,bgcolor:"action.hover",overflowX:"auto"},"& pre code":{p:0,bgcolor:"transparent"}},children:jsxRuntime.jsx(Ni,{markdown:h})})]}),jsxRuntime.jsx(material.Box,{sx:{display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",lg:"repeat(2, minmax(0, 1fr))"}},children:o.map(I=>jsxRuntime.jsx(material.Box,{id:`detail-section-${I.id}`,children:jsxRuntime.jsx(rs,{section:I,highlightQuery:g})},I.id))}),r.length>0&&jsxRuntime.jsxs(material.Paper,{variant:"outlined",sx:{borderRadius:2,overflow:"hidden"},children:[jsxRuntime.jsx(material.Tabs,{value:P?.id||false,onChange:(I,k)=>y(k),variant:"scrollable",scrollButtons:"auto",sx:{borderBottom:"1px solid",borderColor:"divider"},children:r.map(I=>jsxRuntime.jsx(material.Tab,{value:I.id,label:I.label,sx:{textTransform:"none"}},I.id))}),jsxRuntime.jsxs(material.Box,{sx:{p:1.5},children:[jsxRuntime.jsx(material.Box,{id:`detail-tab-${P?.id||""}`}),P?.description&&jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",sx:{mb:1.2},children:P.description}),P?.content?P.content:jsxRuntime.jsxs(material.Stack,{spacing:1.5,children:[(P?.sections||[]).map(I=>jsxRuntime.jsx(material.Box,{id:`detail-tab-${P?.id}-section-${I.id}`,children:jsxRuntime.jsx(rs,{section:I,highlightQuery:g})},I.id)),P?.fields&&P.fields.length>0&&jsxRuntime.jsx(rs,{section:{id:`${P.id}-fields`,title:P.label,fields:P.fields,columns:2},highlightQuery:g})]})]})]}),n&&jsxRuntime.jsx(Dr,{title:n.title||m("detail.table.title"),...n.tableProps,filterConfig:void 0,fitContainer:false})]})};var Dm=({bucket:e,cardCount:t,highlighted:o=false,children:r,emptyLabel:a,maxHeight:n,sx:i})=>{let{t:c}=le();return jsxRuntime.jsx(material.Paper,{sx:[d=>{let l=e.accentColor??d.palette.primary.main;return {position:"relative",minWidth:0,borderRadius:4,overflow:"hidden",border:`1px solid ${styles.alpha(l,o?.58:d.palette.mode==="dark"?.28:.18)}`,bgcolor:styles.alpha(d.palette.background.paper,d.palette.mode==="dark"?.92:.97),boxShadow:o?`0 18px 40px ${styles.alpha(l,.22)}`:`0 10px 28px ${styles.alpha(d.palette.common.black,d.palette.mode==="dark"?.18:.08)}`,transition:"border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease","&::before":{content:'""',display:"block",height:4,bgcolor:l}}},...Array.isArray(i)?i:i?[i]:[]],children:jsxRuntime.jsxs(material.Stack,{spacing:1.2,sx:{p:1.5},children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:1},children:[jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:.8},children:[e.icon,jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.96rem",fontWeight:800},children:e.title})]}),e.description&&jsxRuntime.jsx(material.Typography,{sx:{mt:.45,fontSize:"0.76rem",color:"text.secondary",lineHeight:1.45},children:e.description})]}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:.8,sx:{flexShrink:0},children:[jsxRuntime.jsx(material.Chip,{size:"small",label:t,sx:{fontWeight:700}}),typeof e.limit=="number"&&jsxRuntime.jsx(material.Chip,{size:"small",label:`${c("kanban.bucket.limit")} ${e.limit}`,color:t>e.limit?"warning":"default",variant:"outlined"})]})]}),o&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",color:"primary.main",fontWeight:700},children:c("kanban.bucket.dropHere")}),jsxRuntime.jsx(material.Box,{sx:{minHeight:220,maxHeight:n,overflowY:n?"auto":"visible",pr:n?.4:0},children:t>0?r:jsxRuntime.jsx(material.Box,{sx:d=>({minHeight:160,borderRadius:3,border:`1px dashed ${styles.alpha(d.palette.divider,.9)}`,bgcolor:d.palette.mode==="dark"?styles.alpha(d.palette.common.white,.02):styles.alpha(d.palette.primary.main,.03),display:"grid",placeItems:"center",px:2,textAlign:"center"}),children:jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.78rem",color:"text.secondary"},children:a??e.emptyLabel??c("kanban.empty")})})})]})})};var cC={success:"success",warning:"warning",info:"info",error:"error"},dC={critical:"error",high:"warning",medium:"info",low:"success"},uC=(e,t)=>{switch(e){case "critical":return t("kanban.priority.critical");case "high":return t("kanban.priority.high");case "medium":return t("kanban.priority.medium");case "low":return t("kanban.priority.low");default:return e}},pC=e=>e?e.split(/\s+/).map(t=>t.charAt(0).toUpperCase()).slice(0,2).join(""):"NA",fd=({card:e,bucket:t,dragging:o=false,overlay:r=false,onClick:a,sx:n})=>{let{t:i}=le(),c=!!(a&&t),d=e.tone??(e.priority?dC[e.priority]:"default"),l=d==="default"?"primary":cC[d],s=t?{card:e,bucket:t}:void 0;return jsxRuntime.jsx(material.Paper,{onClick:c?()=>s&&a?.(s):void 0,onKeyDown:c?m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),s&&a?.(s));}:void 0,role:c?"button":void 0,tabIndex:c?0:void 0,sx:[m=>{let g=d==="default"?m.palette.primary.main:m.palette[l].main;return {position:"relative",overflow:"hidden",p:1.4,borderRadius:3,border:`1px solid ${styles.alpha(g,m.palette.mode==="dark"?.42:.2)}`,bgcolor:styles.alpha(m.palette.background.paper,m.palette.mode==="dark"?.96:.98),boxShadow:r?`0 20px 45px ${styles.alpha(m.palette.common.black,.24)}`:o?"none":`0 8px 24px ${styles.alpha(m.palette.common.black,m.palette.mode==="dark"?.18:.08)}`,transform:r?"rotate(1deg) scale(1.01)":"none",transition:"transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease",cursor:c?"pointer":"default",opacity:o?.5:1,"&::before":{content:'""',position:"absolute",inset:"0 auto 0 0",width:4,bgcolor:g},"&:hover":c?{transform:"translateY(-1px)",boxShadow:`0 14px 32px ${styles.alpha(m.palette.common.black,m.palette.mode==="dark"?.28:.12)}`}:void 0}},...Array.isArray(n)?n:n?[n]:[]],children:jsxRuntime.jsxs(material.Stack,{spacing:1.1,children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:1},children:[jsxRuntime.jsxs(material.Box,{sx:{minWidth:0,flex:1},children:[(e.kicker||t?.title)&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",fontWeight:700,letterSpacing:.4,color:"text.secondary",textTransform:"uppercase"},children:e.kicker??t?.title}),jsxRuntime.jsx(material.Typography,{sx:{mt:.2,fontSize:"0.98rem",fontWeight:800,lineHeight:1.3},children:e.title})]}),e.priority&&jsxRuntime.jsx(material.Chip,{size:"small",color:l,label:uC(e.priority,i),variant:d==="default"?"outlined":"filled",sx:{height:22,fontWeight:700}})]}),e.summary&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.82rem",color:"text.secondary",lineHeight:1.5},children:e.summary}),e.metrics&&e.metrics.length>0&&jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${Math.min(e.metrics.length,3)}, minmax(0, 1fr))`,gap:.9},children:e.metrics.slice(0,3).map(m=>jsxRuntime.jsxs(material.Box,{sx:g=>({borderRadius:2,px:1,py:.8,bgcolor:g.palette.mode==="dark"?styles.alpha(g.palette.common.white,.05):styles.alpha(g.palette.primary.main,.05)}),children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.68rem",color:"text.secondary",textTransform:"uppercase",letterSpacing:.35},children:m.label}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.86rem",fontWeight:700},children:m.value})]},m.id))}),typeof e.progress=="number"&&jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:.5},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:i("kanban.card.progress")}),jsxRuntime.jsxs(material.Typography,{sx:{fontSize:"0.72rem",fontWeight:700},children:[Math.round(e.progress),"%"]})]}),jsxRuntime.jsx(material.LinearProgress,{variant:"determinate",value:Math.max(0,Math.min(100,e.progress)),color:l,sx:{height:8,borderRadius:999}})]}),(e.tags?.length||e.assignee||e.dueDate||e.footer||c)&&jsxRuntime.jsxs(material.Stack,{spacing:.9,children:[e.tags&&e.tags.length>0&&jsxRuntime.jsx(material.Box,{sx:{display:"flex",flexWrap:"wrap",gap:.75},children:e.tags.map(m=>jsxRuntime.jsx(material.Chip,{size:"small",label:m.label,color:m.color??"default",variant:"outlined"},m.id))}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1},children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:.8,minWidth:0},children:[e.assignee&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.Avatar,{src:e.assignee.avatarSrc,sx:{width:28,height:28,fontSize:"0.75rem"},children:e.assignee.initials??pC(e.assignee.name)}),jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.78rem",fontWeight:700,lineHeight:1.2},noWrap:true,children:e.assignee.name}),e.dueDate&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.7rem",color:"text.secondary",lineHeight:1.2},noWrap:true,children:e.dueDate})]})]}),!e.assignee&&e.dueDate&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.76rem",color:"text.secondary"},children:e.dueDate})]}),c&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",color:"primary.main",fontWeight:700,whiteSpace:"nowrap"},children:i("kanban.card.openDetail")})]}),e.footer]})]})})};var gC=(e,t)=>Number.isNaN(e)||e<0?0:e>t?t:e,Em=({buckets:e,cards:t})=>{let o=new Map;return t.forEach((r,a)=>{let n=o.get(r.bucketId)??[];n.push({card:r,sourceIndex:a}),o.set(r.bucketId,n);}),{buckets:e.map(r=>{let a=[...o.get(r.id)??[]].sort((n,i)=>n.card.position===void 0&&i.card.position===void 0?n.sourceIndex-i.sourceIndex:n.card.position===void 0?1:i.card.position===void 0?-1:n.card.position-i.card.position||n.sourceIndex-i.sourceIndex).map(({card:n},i)=>({...n,bucketId:r.id,position:i}));return {...r,cards:a}})}},yr=(e,t)=>{for(let o=0;o<e.buckets.length;o+=1){let r=e.buckets[o],a=r.cards.findIndex(n=>n.id===t);if(a>=0)return {card:r.cards[a],bucket:r,bucketIndex:o,cardIndex:a}}},ss=(e,t)=>{let o=yr(e,t.cardId);if(!o)return e;let r=e.buckets.findIndex(l=>l.id===t.toBucketId);if(r<0)return e;let a=e.buckets.map(l=>({...l,cards:l.cards.map(s=>({...s}))})),n=a[o.bucketIndex],[i]=n.cards.splice(o.cardIndex,1);if(!i)return e;let c=a[r],d=gC(t.targetIndex??c.cards.length,c.cards.length);return c.cards.splice(d,0,{...i,bucketId:t.toBucketId}),{buckets:a.map(l=>({...l,cards:l.cards.map((s,m)=>({...s,bucketId:l.id,position:m}))}))}};var hd="kanban-card|",bd="kanban-bucket|",zm=e=>`${hd}${e}`,PC=e=>`${bd}${e}`,cs=e=>e?.startsWith(hd)?e.slice(hd.length):void 0,Nm=e=>e?.startsWith(bd)?e.slice(bd.length):void 0,RC=({card:e,bucket:t,onCardClick:o})=>{let{setNodeRef:r,attributes:a,listeners:n,transform:i,transition:c,isDragging:d}=sortable.useSortable({id:zm(e.id)}),l={transform:i?`translate3d(${i.x}px, ${i.y}px, 0)`:void 0,transition:c,zIndex:d?2:1,touchAction:"none",cursor:d?"grabbing":"grab"};return jsxRuntime.jsx(material.Box,{ref:r,style:l,...a,...n,children:jsxRuntime.jsx(fd,{card:e,bucket:t,dragging:d,onClick:o})})},MC=({bucket:e,highlighted:t,bucketMaxHeight:o,emptyBucketLabel:r,onCardClick:a})=>{let{isOver:n,setNodeRef:i}=core.useDroppable({id:PC(e.id)});return jsxRuntime.jsx(material.Box,{ref:i,sx:{minWidth:0},children:jsxRuntime.jsx(Dm,{bucket:e,cardCount:e.cards.length,highlighted:t||n,emptyLabel:r,maxHeight:o,children:jsxRuntime.jsx(sortable.SortableContext,{items:e.cards.map(c=>zm(c.id)),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:1,children:e.cards.map(c=>jsxRuntime.jsx(RC,{card:c,bucket:e,onCardClick:a},c.id))})})})})},CE=({model:e,onCardMove:t,onCardClick:o,minBucketWidth:r=320,bucketMaxHeight:a,emptyBucketLabel:n,sx:i})=>{let[c,d]=Yt.useState(null),[l,s]=Yt.useState(),m=core.useSensors(core.useSensor(core.PointerSensor,{activationConstraint:{distance:6}}),core.useSensor(core.TouchSensor,{activationConstraint:{delay:120,tolerance:8}})),g=Yt.useMemo(()=>c?yr(e,c):void 0,[c,e]),p=Yt.useCallback(()=>{d(null),s(void 0);},[]),b=Yt.useCallback(f=>{if(!f)return;let h=cs(f);return h?yr(e,h)?.bucket.id:Nm(f)},[e]),y=Yt.useCallback(f=>{d(cs(String(f.active.id))??null);},[]),u=Yt.useCallback(f=>{s(b(f.over?String(f.over.id):void 0));},[b]),x=Yt.useCallback(f=>{let h=cs(String(f.active.id)),v=f.over?String(f.over.id):void 0;if(!h||!v){p();return}let S=yr(e,h);if(!S){p();return}let E=S.bucket.id,P=S.cardIndex,w=cs(v);if(w){let k=yr(e,w);if(!k){p();return}E=k.bucket.id,P=k.cardIndex;}else {let k=Nm(v),A=e.buckets.find(T=>T.id===k);if(!k||!A){p();return}E=k,P=A.cards.length;}if(S.bucket.id===E&&S.cardIndex===P){p();return}let D=ss(e,{cardId:h,fromBucketId:S.bucket.id,toBucketId:E,targetIndex:P}),I=yr(D,h);I&&!(I.bucket.id===S.bucket.id&&I.cardIndex===S.cardIndex)&&t?.({cardId:h,fromBucketId:S.bucket.id,toBucketId:I.bucket.id,targetIndex:I.cardIndex,card:I.card,model:D}),p();},[e,t,p]);return jsxRuntime.jsxs(core.DndContext,{sensors:m,collisionDetection:core.closestCorners,onDragStart:y,onDragOver:u,onDragEnd:x,onDragCancel:p,children:[jsxRuntime.jsx(material.Box,{sx:[{display:"grid",gridAutoFlow:"column",gridAutoColumns:`minmax(${r}px, 1fr)`,gap:2,alignItems:"start",overflowX:"auto",pb:.5},...Array.isArray(i)?i:i?[i]:[]],children:e.buckets.map(f=>jsxRuntime.jsx(MC,{bucket:f,highlighted:f.id===l,bucketMaxHeight:a,emptyBucketLabel:n,onCardClick:o},f.id))}),jsxRuntime.jsx(core.DragOverlay,{children:g?jsxRuntime.jsx(material.Box,{sx:{width:Math.max(r-24,260)},children:jsxRuntime.jsx(fd,{card:g.card,bucket:g.bucket,overlay:true})}):null})]})};var EC=({initialModel:e,initialBuckets:t,initialCards:o})=>e||Em({buckets:t??[],cards:o??[]}),IE=e=>{let{onCardMove:t,onCardClick:o}=e,[r,a]=Yt.useState(()=>EC(e)),n=Yt.useCallback(s=>{a(m=>typeof s=="function"?s(m):s);},[]),i=Yt.useCallback(s=>yr(r,s),[r]),c=Yt.useCallback((s,m,g)=>{let p=yr(r,s);if(!p)return;let b=ss(r,{cardId:s,fromBucketId:p.bucket.id,toBucketId:m,targetIndex:g}),y=yr(b,s);if(!y||y.bucket.id===p.bucket.id&&y.cardIndex===p.cardIndex)return;a(b);let u={cardId:s,fromBucketId:p.bucket.id,toBucketId:y.bucket.id,targetIndex:y.cardIndex,card:y.card,model:b};return t?.(u),u},[r,t]),d=Yt.useCallback((s,m)=>{a(g=>({buckets:g.buckets.map(p=>({...p,cards:p.cards.map(b=>b.id!==s?b:typeof m=="function"?m(b):{...b,...m})}))}));},[]),l=Yt.useMemo(()=>({model:r,onCardMove:s=>{c(s.cardId,s.toBucketId,s.targetIndex);},onCardClick:o}),[r,c,o]);return {model:r,actions:{replaceModel:n,moveCard:c,updateCard:d,getCard:i},boardProps:l}};function Rn({onTextUpdate:e,onComplete:t,onError:o,wsUrl:r="ws://localhost:8765",silenceThresholdMs:a=2e3,minVolumeRms:n=.015}){let[i,c]=Yt.useState(false),d=Yt.useRef(null),l=Yt.useRef(null),s=Yt.useRef(null),m=Yt.useRef(null),g=Yt.useRef(null),p=Yt.useRef(0),b=Yt.useRef(false),y=Yt.useRef(false),u=Yt.useCallback(()=>{d.current&&(d.current.close(),d.current=null),m.current&&(m.current.disconnect(),m.current=null),g.current&&(g.current.disconnect(),g.current=null),l.current&&(l.current.getTracks().forEach(h=>h.stop()),l.current=null),s.current&&(s.current.close(),s.current=null),y.current=false,c(false);},[]),x=Yt.useCallback(()=>{b.current||(b.current=true,d.current?.readyState===WebSocket.OPEN&&d.current.send(JSON.stringify({type:"stop"})),setTimeout(u,500));},[u]),f=Yt.useCallback(async()=>{if(!(i||y.current)){y.current=true,b.current=false,p.current=Date.now();try{let h=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,sampleRate:16e3,echoCancellation:!0,noiseSuppression:!0}});l.current=h;let v=new WebSocket(r);d.current=v,v.onopen=()=>{c(!0),y.current=!1;},v.onmessage=D=>{try{let I=JSON.parse(D.data);if(I.type==="recognition")I.is_final?t(I.text):e?.(I.text);else if(I.type==="error"){let k=I.message||"Voice recognition error";o?.(k),x();}}catch{o?.("Failed to parse voice message");}},v.onerror=()=>{o?.("Voice service connection failed"),u();},v.onclose=()=>{u();};let S=window.AudioContext||window.webkitAudioContext;if(!S)throw new Error("AudioContext is not supported in this browser");let E=new S({sampleRate:16e3});s.current=E;let P=E.createMediaStreamSource(h);g.current=P;let w=E.createScriptProcessor(4096,1,1);m.current=w,w.onaudioprocess=D=>{if(d.current?.readyState!==WebSocket.OPEN)return;let I=D.inputBuffer.getChannelData(0),k=0;for(let R=0;R<I.length;R+=1)k+=I[R]*I[R];if(Math.sqrt(k/I.length)>n)p.current=Date.now();else if(Date.now()-p.current>a&&!b.current){x();return}let T=new Int16Array(I.length);for(let R=0;R<I.length;R+=1){let M=Math.max(-1,Math.min(1,I[R]));T[R]=M<0?M*32768:M*32767;}d.current.send(T.buffer);},P.connect(w),w.connect(E.destination);}catch{o?.("Cannot access microphone"),u();}}},[u,i,n,t,o,e,a,x,r]);return Yt.useEffect(()=>u,[u]),{isRecording:i,startRecording:f,stopRecording:x}}var Gm=64,YC="#E9EDF2",QC="linear-gradient(90deg, #F5F7FA 0%, #E9EDF2 50%, #F5F7FA 100%)",JC=["en","zh","fr","de","ja","ko"],Um={en:"EN",zh:"\u4E2D\u6587",fr:"FR",de:"DE",ja:"\u65E5\u672C\u8A9E",ko:"\uD55C\uAD6D\uC5B4"},vd=({searchPlaceholder:e,onSearch:t,onSearchAdd:o,maxWidth:r=540,sx:a})=>{let{t:n}=le(),i=material.useTheme(),c=i.palette.mode==="dark",[d,l]=Yt.useState(""),s=Yt.useCallback((h=d)=>{let v=h.trim();v&&(l(""),t?.(v));},[t,d]),m=h=>{h.preventDefault(),s();},{isRecording:g,startRecording:p,stopRecording:b}=Rn({onTextUpdate:l,onComplete:h=>{l(h),s(h);},onError:h=>{console.error("Header voice input error:",h);}}),y=Yt.useCallback(async()=>{if(g){b();return}await p();},[g,p,b]),u=e||n("header.searchPlaceholder"),x=d.trim().length>0,f={width:28,height:28,p:0,color:c?"rgba(255,255,255,0.72)":"rgba(15,23,42,0.56)","&:hover":{bgcolor:c?"rgba(255,255,255,0.1)":"rgba(15,23,42,0.06)"},"&.Mui-disabled":{color:c?"rgba(255,255,255,0.28)":"rgba(15,23,42,0.24)"}};return jsxRuntime.jsx(material.Box,{component:"form",onSubmit:m,sx:[{width:"100%",maxWidth:r},...Array.isArray(a)?a:a?[a]:[]],children:jsxRuntime.jsx(material.TextField,{size:"small",fullWidth:true,value:d,onChange:h=>l(h.target.value),placeholder:u,InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",sx:{ml:.25,mr:.5},children:jsxRuntime.jsx(material.IconButton,{size:"small",type:"button",onClick:o,"aria-label":n("header.searchAddFeature"),title:n("header.searchAddFeature"),sx:f,children:jsxRuntime.jsx(_C__default.default,{sx:{fontSize:20}})})}),endAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"end",sx:{ml:.5,mr:.25},children:jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:.15,children:[jsxRuntime.jsx(material.IconButton,{size:"small",type:"button",onClick:()=>{y();},"aria-label":n(g?"header.searchStopVoice":"header.searchStartVoice"),title:n(g?"header.searchStopVoice":"header.searchStartVoice"),sx:{...f,color:g?i.palette.error.main:f.color,bgcolor:g?c?"rgba(239,68,68,0.18)":"rgba(239,68,68,0.1)":"transparent"},children:g?jsxRuntime.jsx(lucideReact.MicOff,{size:17,strokeWidth:2.35}):jsxRuntime.jsx(lucideReact.Mic,{size:17,strokeWidth:2.35})}),jsxRuntime.jsx(material.IconButton,{size:"small",type:"submit",disabled:!x,"aria-label":n("header.searchSend"),title:n("header.searchSend"),sx:{...f,color:x?i.palette.primary.main:f.color},children:jsxRuntime.jsx(lucideReact.SendHorizontal,{size:17,strokeWidth:2.35})})]})}),sx:{color:c?"common.white":"rgba(17,24,39,0.9)",bgcolor:c?"rgba(255,255,255,0.08)":"#ffffff",borderRadius:999,pr:.5,"& .MuiInputBase-input":{py:1.1},"& .MuiOutlinedInput-notchedOutline":{borderColor:c?"rgba(255,255,255,0.15)":"rgba(15,23,42,0.2)"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:c?"rgba(255,255,255,0.35)":"rgba(15,23,42,0.35)"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:c?"rgba(255,255,255,0.5)":"rgba(15,23,42,0.55)"}}},inputProps:{style:{color:c?"white":"#111827"}}})})},ms=({appTitle:e,logo:t,mode:o="dark",onToggleMode:r,locale:a,localeLabel:n,localeOptions:i,onLocaleChange:c,searchPlaceholder:d,showSearch:l=false,onSearch:s,onSearchAdd:m,user:g,onUserSetting:p,onUserLogout:b,userMenuItems:y,leftSlot:u,rightSlot:x})=>{let{t:f,locale:h}=le(),S=material.useTheme().palette.mode==="dark",[E,P]=Yt.useState(null),[w,D]=Yt.useState(null),I=o==="system"?jsxRuntime.jsx(KC__default.default,{fontSize:"small"}):o==="dark"?jsxRuntime.jsx(qC__default.default,{fontSize:"small"}):jsxRuntime.jsx(jC__default.default,{fontSize:"small"}),k=f(o==="system"?"header.theme.system":o==="dark"?"header.theme.dark":"header.theme.light"),A=a||h,T=i&&i.length>0?i:JC,R=n||Um[A]||A.toUpperCase(),M=!!E,Z=!!w,L=[{key:"setting",label:f("header.menu.setting"),icon:jsxRuntime.jsx(y0__default.default,{sx:{fontSize:18}}),onClick:p},{key:"logout",label:f("header.menu.logout"),icon:jsxRuntime.jsx(ZC__default.default,{sx:{fontSize:18}}),onClick:b}],ee=y&&y.length>0?y:L,H=q=>{D(null),q?.();};return jsxRuntime.jsxs(material.AppBar,{position:"sticky",elevation:0,sx:q=>({top:0,zIndex:q.zIndex.drawer+10,height:Gm,backgroundColor:q.palette.mode==="dark"?"#0D0D0D":YC,backgroundImage:q.palette.mode==="dark"?["radial-gradient(circle at 18% 22%, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0) 45%)","radial-gradient(circle at 78% 32%, rgba(144,202,249,0.14) 0%, rgba(144,202,249,0) 42%)","linear-gradient(90deg, #0A0A0A 0%, #151515 50%, #0A0A0A 100%)","linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px)","linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px)"].join(","):["radial-gradient(circle at 22% 22%, rgba(255,255,255,0.7) 0%, rgba(255,255,255,0) 48%)","radial-gradient(circle at 76% 24%, rgba(203,213,225,0.45) 0%, rgba(203,213,225,0) 42%)",QC,"linear-gradient(rgba(15,23,42,0.05) 1px, transparent 1px)","linear-gradient(90deg, rgba(15,23,42,0.04) 1px, transparent 1px)"].join(","),backgroundSize:"auto, auto, auto, 24px 24px, 24px 24px",borderBottom:"1px solid",borderColor:q.palette.mode==="dark"?"rgba(255,255,255,0.12)":"rgba(15,23,42,0.12)"}),children:[jsxRuntime.jsxs(material.Toolbar,{sx:{minHeight:`${Gm}px !important`,px:2,gap:2},children:[jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:1.5,sx:{minWidth:220},children:[u,t===null?null:t||jsxRuntime.jsx(material.Box,{component:"img",src:"/orbcafe.png",alt:"ORBCAFE Logo",sx:{width:44,height:44,display:"block",objectFit:"contain",flexShrink:0}}),e&&jsxRuntime.jsx(material.Typography,{variant:"h6",sx:{fontWeight:700,color:S?"common.white":"#111827"},children:e})]}),jsxRuntime.jsx(material.Box,{sx:{flex:1,display:"flex",justifyContent:"center",minWidth:0},children:l&&jsxRuntime.jsx(vd,{searchPlaceholder:d,onSearch:s,onSearchAdd:m})}),jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:1.5,children:[c?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.IconButton,{size:"small",onClick:q=>P(q.currentTarget),sx:{color:S?"common.white":"#111827",borderRadius:1,px:.5},children:jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:.45,children:[jsxRuntime.jsx($m__default.default,{sx:{fontSize:18}}),jsxRuntime.jsx(material.Typography,{variant:"caption",sx:{fontWeight:500},children:R})]})}),jsxRuntime.jsx(material.Menu,{anchorEl:E,open:M,onClose:()=>P(null),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:T.map(q=>jsxRuntime.jsx(material.MenuItem,{selected:q===A,onClick:()=>{c(q),P(null);},sx:{fontSize:"0.82rem"},children:Um[q]},q))})]}):jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:.5,children:[jsxRuntime.jsx($m__default.default,{sx:{color:S?"common.white":"#111827",fontSize:18}}),jsxRuntime.jsx(material.Typography,{variant:"caption",sx:{color:S?"common.white":"#111827",fontWeight:500},children:R})]}),jsxRuntime.jsx(material.IconButton,{size:"small",sx:{color:S?"common.white":"#111827"},onClick:r,title:k,children:I}),g&&jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:1,children:[jsxRuntime.jsxs(material.Box,{sx:{textAlign:"right",minWidth:0},children:[jsxRuntime.jsx(material.Typography,{variant:"body2",sx:{color:S?"common.white":"#111827",fontWeight:700,lineHeight:1.15},children:g.name}),g.subtitle&&jsxRuntime.jsx(material.Typography,{variant:"caption",sx:{display:"block",mt:.25,color:S?"rgba(255,255,255,0.72)":"rgba(17,24,39,0.62)",fontSize:"0.72rem",lineHeight:1.1,letterSpacing:"0.01em",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:220},title:g.subtitle,children:g.subtitle})]}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:q=>D(q.currentTarget),sx:{p:0},children:jsxRuntime.jsx(material.Avatar,{src:g.avatarSrc,imgProps:{style:{objectFit:"cover"}},sx:{width:34,height:34,bgcolor:"grey.100",color:"grey.700",fontSize:"0.85rem"},children:g.avatarText||g.name.slice(0,1).toUpperCase()})})]}),x]})]}),g&&jsxRuntime.jsx(material.Menu,{anchorEl:w,open:Z,onClose:()=>D(null),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},slotProps:{paper:{sx:{minWidth:160,"& .MuiMenuItem-root":{minHeight:34,py:.5,px:1.25}}}},children:ee.map(q=>jsxRuntime.jsxs(material.MenuItem,{disabled:q.disabled,onClick:()=>H(q.onClick),children:[q.icon&&jsxRuntime.jsx(material.ListItemIcon,{children:q.icon}),jsxRuntime.jsx(material.ListItemText,{primary:q.label,slotProps:{primary:{sx:{fontSize:"0.86rem",fontWeight:500}}}})]},q.key))})]})};var Km=({menuData:e=[],initialNavigationCollapsed:t=false,initialNavigationMode:o="fixed",enableNavigationPinning:r,navigationPinStorageKey:a,pinnedNavigationItemIds:n,defaultPinnedNavigationItemIds:i,onPinnedNavigationItemIdsChange:c,pinnedNavigationSectionTitle:d}={})=>{let{navigationIslandProps:l}=Pu({initialCollapsed:t,initialDisplayMode:o,content:e,enablePinning:r,pinStorageKey:a,pinnedItemIds:n,defaultPinnedItemIds:i,onPinnedItemIdsChange:c,pinnedSectionTitle:d}),[s,m]=Yt.useState(900);Yt.useEffect(()=>{let p=()=>m(window.innerHeight);return p(),window.addEventListener("resize",p),()=>window.removeEventListener("resize",p)},[]);let g=Yt.useMemo(()=>Math.max(280,s-100),[s]);return {navigationIslandProps:l,navigationMaxHeight:g}};var ir=12,Xm=56,Zm=234,iS=e=>`orbcafe:page-layout:${e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-")||"app"}:pinned-navigation-items`,gs=(e,t,o)=>Math.min(Math.max(e,t),Math.max(t,o)),lS=e=>e instanceof HTMLElement?!!e.closest('button,input,a,textarea,select,[role="button"],[contenteditable="true"]'):false,eF=({appTitle:e,menuData:t=[],children:o,showNavigation:r=true,locale:a="en",localeLabel:n,localeOptions:i,onLocaleChange:c,user:d,onUserSetting:l,onUserLogout:s,userMenuItems:m,logo:g,searchPlaceholder:p,searchPlacement:b="hidden",floatingSearchSx:y,onSearch:u,onSearchAdd:x,rightHeaderSlot:f,leftHeaderSlot:h,contentSx:v,navigationMode:S,defaultNavigationMode:E="fixed",onNavigationModeChange:P,showNavigationModeToggle:w=true,enableNavigationPinning:D=true,navigationPinStorageKey:I,pinnedNavigationItemIds:k,defaultPinnedNavigationItemIds:A,onPinnedNavigationItemIdsChange:T,pinnedNavigationSectionTitle:R})=>{let M="orbcafe:page-layout-mode",Z="orbcafe:page-layout-navigation-mode",[L,ee]=Yt.useState("system"),[H,q]=Yt.useState("light"),[$,ie]=Yt.useState(false),[ue,Ce]=Yt.useState(false),[te,j]=Yt.useState(E),[Y,de]=Yt.useState({x:ir,y:ir}),[We,$e]=Yt.useState("left"),[me,Ne]=Yt.useState(false),rt=Yt.useRef(null),he=Yt.useRef(null),Le=S!==void 0,He=S??te,Xe=He==="floating",qe=b==="header",K=L==="system"?$?H:"light":L;Yt.useEffect(()=>{try{let F=window.localStorage.getItem(M);(F==="light"||F==="dark"||F==="system")&&ee(F);}catch{}ie(true);let J=window.matchMedia("(prefers-color-scheme: dark)"),G=()=>{q(J.matches?"dark":"light");};return G(),J.addEventListener("change",G),()=>J.removeEventListener("change",G)},[]),Yt.useEffect(()=>{if($)try{window.localStorage.setItem(M,L);}catch{}},[$,L]),Yt.useEffect(()=>{if(Le){Ce(true);return}try{let J=window.localStorage.getItem(Z);(J==="fixed"||J==="floating")&&j(J);}catch{}finally{Ce(true);}},[Le]),Yt.useEffect(()=>{if(ue)try{window.localStorage.setItem(Z,He);}catch{}},[He,ue]),Yt.useEffect(()=>{K==="dark"?(document.documentElement.classList.add("dark"),document.documentElement.style.colorScheme="dark"):(document.documentElement.classList.remove("dark"),document.documentElement.style.colorScheme="light");},[K]);let Fe=Yt.useMemo(()=>material.createTheme({palette:{mode:K}}),[K]),be=Yt.useCallback(J=>{Le||j(J),P?.(J);},[Le,P]),{navigationIslandProps:ke,navigationMaxHeight:et}=Km({menuData:t,initialNavigationCollapsed:false,initialNavigationMode:He,enableNavigationPinning:D,navigationPinStorageKey:I??iS(e),pinnedNavigationItemIds:k,defaultPinnedNavigationItemIds:A,onPinnedNavigationItemIdsChange:T,pinnedNavigationSectionTitle:R}),Te=ke.collapsed,lt=Yt.useCallback(J=>{let G=rt.current,F=G?.parentElement;if(!G||!F)return J;let re=F.getBoundingClientRect(),ve=G.getBoundingClientRect(),Se=ir,Ke=ir,st=Math.max(Se,re.width-ve.width-ir),Ye=Math.max(Ke,re.height-ve.height-ir);return {x:gs(J.x,Se,st),y:gs(J.y,Ke,Ye)}},[]),Ct=Yt.useCallback(J=>{let G=rt.current,F=G?.parentElement;if(!G||!F)return J;let re=F.getBoundingClientRect(),ve=G.getBoundingClientRect(),Se=ir,Ke=ir,st=Math.max(Se,re.width-ve.width-ir),Ye=Math.max(Ke,re.height-ve.height-ir),ft={x:gs(J.x,Se,st),y:gs(J.y,Ke,Ye)},ao=[{distance:Math.abs(ft.x-Se),position:{x:Se,y:ft.y}},{distance:Math.abs(ft.x-st),position:{x:st,y:ft.y}},{distance:Math.abs(ft.y-Ke),position:{x:ft.x,y:Ke}},{distance:Math.abs(ft.y-Ye),position:{x:ft.x,y:Ye}}].reduce((ht,Bo)=>Bo.distance<ht.distance?Bo:ht).position;return $e(ao.x>=(Se+st)/2?"right":"left"),ao},[]),Mt=Yt.useMemo(()=>{if(!Xe||me)return Y.x;if(We==="right"){let F=rt.current?.parentElement?.getBoundingClientRect().width,re=Te?Xm:Zm;return F?Math.max(ir,F-re-ir):Te?Y.x:Y.x-(Zm-Xm)}return Y.x},[We,Y.x,me,Xe,Te]),Jt=Yt.useCallback(J=>{if(!Xe||!Te||lS(J.target))return;J.preventDefault(),J.currentTarget.setPointerCapture(J.pointerId);let G=lt({x:Mt,y:Y.y});$e("left"),de(G),he.current={pointerId:J.pointerId,startClientX:J.clientX,startClientY:J.clientY,startX:G.x,startY:G.y,currentX:G.x,currentY:G.y},Ne(true);},[lt,Mt,Y.y,Xe,Te]),X=Yt.useCallback(J=>{let G=he.current;if(!G||G.pointerId!==J.pointerId)return;let F=lt({x:G.startX+J.clientX-G.startClientX,y:G.startY+J.clientY-G.startClientY});G.currentX=F.x,G.currentY=F.y,de(F);},[lt]),_e=Yt.useCallback(J=>{let G=he.current;if(!(!G||G.pointerId!==J.pointerId)){try{J.currentTarget.releasePointerCapture(J.pointerId);}catch{}he.current=null,de(Ct({x:G.currentX,y:G.currentY})),Ne(false);}},[Ct]);return Yt.useEffect(()=>{if(!Xe)return;let J=()=>{de(re=>lt(re));},G=window.requestAnimationFrame(J),F=window.setTimeout(J,430);return ()=>{window.cancelAnimationFrame(G),window.clearTimeout(F);}},[lt,Xe,Te,et]),jsxRuntime.jsx(material.ThemeProvider,{theme:Fe,children:jsxRuntime.jsx(ul,{locale:a,children:jsxRuntime.jsxs(material.Box,{sx:J=>({minHeight:"100vh",width:"100%",display:"flex",flexDirection:"column",overflowX:"hidden",background:J.palette.mode==="dark"?"linear-gradient(180deg, #0A0A0A 0%, #141414 55%, #1A1A1A 100%)":J.palette.background.default}),children:[jsxRuntime.jsx(ms,{appTitle:e,logo:g,mode:L,onToggleMode:()=>ee(J=>J==="system"?"dark":J==="dark"?"light":"system"),locale:a,localeLabel:n,localeOptions:i,onLocaleChange:c,user:d,onUserSetting:l,onUserLogout:s,userMenuItems:m,searchPlaceholder:p,showSearch:qe,onSearch:u,onSearchAdd:x,leftSlot:h,rightSlot:f}),b==="floating"&&jsxRuntime.jsx(material.Box,{sx:[J=>({position:"fixed",left:{xs:12,sm:"auto"},right:{xs:12,md:24},bottom:{xs:12,md:24},width:{xs:"auto",sm:540},maxWidth:"calc(100vw - 24px)",zIndex:J.zIndex.modal+30,pointerEvents:"auto",filter:J.palette.mode==="dark"?"drop-shadow(0 18px 42px rgba(0,0,0,0.58))":"drop-shadow(0 18px 36px rgba(15,23,42,0.18))"}),...Array.isArray(y)?y:y?[y]:[]],children:jsxRuntime.jsx(vd,{searchPlaceholder:p,onSearch:u,onSearchAdd:x,maxWidth:"100%"})}),jsxRuntime.jsxs(material.Box,{sx:{flex:1,minHeight:0,minWidth:0,display:"flex",overflowX:"hidden",position:"relative"},children:[r&&!Xe&&jsxRuntime.jsx(material.Box,{sx:{pt:1.5,pb:1.5,pl:1.5,pr:Te?.5:1.5,display:"flex",alignItems:"flex-start",flexShrink:0},children:jsxRuntime.jsx(gc,{...ke,maxHeight:et,colorMode:K,displayMode:He,onDisplayModeChange:be,showDisplayModeToggle:w&&Te})}),r&&Xe&&jsxRuntime.jsx(material.Box,{ref:rt,onPointerDown:Jt,onPointerMove:X,onPointerUp:_e,onPointerCancel:_e,sx:J=>({position:"absolute",top:Y.y,left:Mt,zIndex:J.zIndex.drawer+5,display:"flex",alignItems:"flex-start",cursor:Te?me?"grabbing":"grab":"default",touchAction:Te?"none":"auto",userSelect:me?"none":void 0,transition:me?"none":"left 180ms ease-out, top 180ms ease-out"}),children:jsxRuntime.jsx(gc,{...ke,maxHeight:et,colorMode:K,displayMode:He,onDisplayModeChange:be,showDisplayModeToggle:w&&Te})}),jsxRuntime.jsx(material.Box,{sx:{flex:1,minWidth:0,minHeight:0,overflow:"auto",pt:1.5,pb:1.5,pr:1.5,pl:r&&!Xe&&Te?.5:1.5,...v},children:o})]})]})})})};var fs="(blank)",Qm="Result",Jm="Grand Total",eg={sum:"Sum",count:"Count",avg:"Average",min:"Min",max:"Max"},tg=["sum","count","avg","min","max"];var og=["palette","rows","columns","filters","values"];var rg=e=>og.includes(e),ag=e=>e==="rows"||e==="columns"||e==="filters",hs=e=>{let t=e.split("|");return t.length===2&&t[0]==="container"&&rg(t[1])?{kind:"container",zone:t[1]}:t.length===3&&t[0]==="item"&&rg(t[1])&&t[2]?{kind:"item",zone:t[1],key:t[2]}:null},jr=e=>e==null||e===""?fs:e instanceof Date?e.toISOString().slice(0,10):String(e),Ua=e=>JSON.stringify(e),ng=(e,t)=>{let o=e.join(""),r=t.join("");return o.localeCompare(r,void 0,{sensitivity:"base"})},sS=e=>{if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"&&e.trim()!==""){let t=Number(e);return Number.isFinite(t)?t:null}return null},Fn=(e,t,o)=>{if(o==="count")return e.length;let r=e.map(a=>sS(a[t])).filter(a=>a!==null);return r.length===0?0:o==="sum"?r.reduce((a,n)=>a+n,0):o==="avg"?r.reduce((a,n)=>a+n,0)/r.length:o==="min"?Math.min(...r):Math.max(...r)},io=(e,t)=>{if(!e||e.length===0)return [];let o=new Set,r=[];return e.forEach(a=>{!t.has(a)||o.has(a)||(o.add(a),r.push(a));}),r},Xr=(e,t)=>e.length!==t.length?false:e.every((o,r)=>o===t[r]),ig=(e,t)=>{let o=Object.keys(e),r=Object.keys(t);return o.length!==r.length?false:o.every(a=>{let n=e[a]??[],i=t[a]??[];return Xr(n,i)})},bs=(e,t)=>e.length!==t.length?false:e.every((o,r)=>{let a=t[r];return o.tokenId===a.tokenId&&o.fieldId===a.fieldId&&o.aggregation===a.aggregation}),Cd=e=>!e?.aggregations||e.aggregations.length===0?tg:e.aggregations,Ro=(e,t)=>{let o=Cd(t);return e&&o.includes(e)?e:t?.type==="number"&&o.includes("sum")?"sum":o.includes("count")?"count":o[0]},$i=(e,t,o)=>{let r=o.get(t.fieldId);return r?.formatValue?r.formatValue(e):t.aggregation==="count"?Math.round(e).toLocaleString():e.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:2})};var cg=({options:e,selectedValues:t,onChange:o,minWidth:r=96})=>{let{t:a}=le(),[n,i]=Yt.useState(""),c=Yt.useMemo(()=>{let l=n.trim().toLowerCase();return l?e.filter(s=>s.toLowerCase().includes(l)):e},[e,n]),d=e.length>0&&t.length===e.length;return jsxRuntime.jsx(material.FormControl,{size:"small",sx:{minWidth:r},children:jsxRuntime.jsxs(material.Select,{multiple:true,value:t,onChange:l=>{let s=l.target.value,m=typeof s=="string"?s.split(","):s;o(m);},onClick:l=>l.stopPropagation(),onMouseDown:l=>l.stopPropagation(),renderValue:l=>{let s=l;return e.length===0?a("pivot.filter.na"):s.length===0?a("common.none"):s.length===e.length?a("common.all"):`${s.length}/${e.length}`},MenuProps:{PaperProps:{sx:{maxHeight:320,bgcolor:"background.paper"}}},sx:{fontSize:"0.72rem",height:26,"& .MuiSelect-select":{py:.35}},children:[jsxRuntime.jsx(material.ListSubheader,{disableSticky:true,sx:l=>({bgcolor:"background.paper",py:.8,lineHeight:"normal",borderBottom:`1px solid ${l.palette.divider}`}),children:jsxRuntime.jsx(material.TextField,{size:"small",placeholder:`${a("common.search")}...`,fullWidth:true,value:n,onChange:l=>i(l.target.value),onKeyDown:l=>l.stopPropagation(),onClick:l=>l.stopPropagation(),sx:{m:0,"& .MuiInputBase-input":{fontSize:"0.75rem",py:.7}}})}),jsxRuntime.jsx(material.Box,{sx:l=>({px:1.5,py:.5,borderBottom:`1px solid ${l.palette.divider}`,bgcolor:"background.paper"}),onMouseDown:l=>{l.preventDefault(),l.stopPropagation();},onClick:l=>{l.preventDefault(),l.stopPropagation();},children:jsxRuntime.jsx(material.Button,{variant:"text",size:"small",onClick:l=>{l.preventDefault(),l.stopPropagation(),o(d?[]:e);},sx:{minWidth:"auto",px:0,py:.2,fontSize:"0.76rem",fontWeight:700,textTransform:"none"},children:a(d?"pivot.filter.deselectAll":"pivot.filter.selectAll")})}),c.length===0&&jsxRuntime.jsx(material.MenuItem,{disabled:true,sx:{fontSize:"0.75rem"},children:a("pivot.filter.noResults")}),c.map(l=>{let s=t.includes(l);return jsxRuntime.jsxs(material.MenuItem,{value:l,sx:{fontSize:"0.75rem",py:.25},children:[jsxRuntime.jsx(material.Checkbox,{size:"small",checked:s,sx:{p:.5,mr:.5}}),jsxRuntime.jsx(material.ListItemText,{primary:l,primaryTypographyProps:{sx:{fontSize:"0.75rem",lineHeight:1.2}}})]},l)})]})})};var kd=({label:e,subtitle:t,isDragging:o,dragRef:r,listeners:a,attributes:n,style:i})=>jsxRuntime.jsx(material.Paper,{ref:r,...a,...n,sx:c=>({p:1,borderRadius:2,border:"1px solid",borderColor:"divider",bgcolor:c.palette.mode==="dark"?"#111111":"background.paper",touchAction:"none"}),style:{...i,opacity:o?.3:1,cursor:o?"grabbing":"grab"},children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:.8},children:[jsxRuntime.jsx(material.Box,{sx:c=>({display:"inline-flex",alignItems:"center",justifyContent:"center",p:.3,borderRadius:1,bgcolor:c.palette.mode==="dark"?"rgba(255,255,255,0.12)":"rgba(17, 24, 39, 0.08)"}),children:jsxRuntime.jsx(vS__default.default,{sx:{fontSize:16,color:"text.secondary"}})}),jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.82rem",fontWeight:700,lineHeight:1.2},children:e}),t&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary",lineHeight:1.2},children:t})]})]})}),pg=({id:e,label:t,subtitle:o})=>{let{setNodeRef:r,listeners:a,attributes:n,isDragging:i}=core.useDraggable({id:e});return jsxRuntime.jsx(kd,{label:t,subtitle:o,isDragging:i,dragRef:r,listeners:a,attributes:n})};var zn=({zone:e,title:t,hint:o,icon:r,children:a,itemCount:n,onClear:i})=>{let c=`container|${e}`,{isOver:d,setNodeRef:l}=core.useDroppable({id:c}),{t:s}=le();return jsxRuntime.jsxs(material.Paper,{ref:l,sx:m=>({p:1.1,borderRadius:3,border:"1px dashed",borderColor:d?"primary.main":m.palette.divider,bgcolor:d?m.palette.mode==="dark"?"rgba(25, 118, 210, 0.16)":"rgba(47, 91, 255, 0.06)":m.palette.mode==="dark"?"rgba(255,255,255,0.02)":"rgba(245, 248, 255, 0.86)",transition:"all 120ms ease",minHeight:120,display:"flex",flexDirection:"column"}),children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1},children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:.8},children:[r,jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.79rem",fontWeight:800,letterSpacing:.2},children:t}),jsxRuntime.jsxs(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:["(",n,")"]})]}),n>0&&i&&jsxRuntime.jsx(material.Tooltip,{title:s("pivot.clearArea"),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:i,sx:{p:.25},children:jsxRuntime.jsx(TS__default.default,{sx:{fontSize:16}})})})]}),jsxRuntime.jsx(material.Typography,{sx:{mt:.5,mb:.9,fontSize:"0.7rem",color:"text.secondary"},children:o}),jsxRuntime.jsx(material.Box,{sx:{flex:1},children:a})]})};var gg={xs:1.2,md:1.6},Vn=({title:e,subtitle:t,collapsed:o,onToggleCollapse:r,expandAriaLabel:a,collapseAriaLabel:n,children:i,bodySx:c,unmountOnExit:d=false,headerActions:l})=>jsxRuntime.jsxs(material.Paper,{sx:s=>({borderRadius:3,border:`1px solid ${s.palette.divider}`,overflow:"hidden",bgcolor:styles.alpha(s.palette.background.paper,.95)}),children:[jsxRuntime.jsxs(material.Box,{sx:s=>({px:gg,py:1,display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,borderBottom:o?"none":`1px solid ${s.palette.divider}`}),children:[jsxRuntime.jsxs(material.Box,{sx:{minWidth:0,flex:1},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.9rem",fontWeight:800},children:e}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.74rem",color:"text.secondary",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t})]}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:.75,flexShrink:0},children:[l,jsxRuntime.jsx(material.IconButton,{size:"small","aria-label":o?a:n,onClick:r,sx:s=>({border:`1px solid ${s.palette.divider}`,bgcolor:styles.alpha(s.palette.background.paper,.88),width:28,height:28,borderRadius:999,flexShrink:0,"&:hover":{bgcolor:s.palette.mode==="dark"?styles.alpha(s.palette.primary.main,.18):styles.alpha(s.palette.primary.main,.08)}}),children:jsxRuntime.jsx(x0__default.default,{sx:{fontSize:16,transition:"transform 220ms cubic-bezier(0.2, 0, 0, 1)",transform:o?"rotate(180deg)":"rotate(0deg)"}})})]})]}),jsxRuntime.jsx(material.Collapse,{in:!o,timeout:260,easing:"cubic-bezier(0.2, 0, 0, 1)",unmountOnExit:d,children:jsxRuntime.jsx(material.Box,{sx:[{px:gg,py:{xs:1.2,md:1.6}},...Array.isArray(c)?c:c?[c]:[]],children:i})})]});var Ss=({label:e,caption:t,onRemove:o,trailing:r,isDragging:a,dragRef:n,listeners:i,attributes:c,style:d})=>jsxRuntime.jsx(material.Paper,{ref:n,style:d,sx:l=>({p:1,borderRadius:2,border:"1px solid",borderColor:"divider",bgcolor:l.palette.mode==="dark"?"#111111":"background.paper",touchAction:"none",opacity:a?0:1}),children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:.8},children:[jsxRuntime.jsx(material.Box,{...c,...i,sx:l=>({display:"inline-flex",alignItems:"center",justifyContent:"center",p:.25,borderRadius:1,bgcolor:l.palette.mode==="dark"?"rgba(255,255,255,0.12)":"rgba(17, 24, 39, 0.08)",cursor:"grab"}),children:jsxRuntime.jsx(vS__default.default,{sx:{fontSize:15,color:"text.secondary"}})}),jsxRuntime.jsxs(material.Box,{sx:{minWidth:0,flex:1},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.8rem",fontWeight:700,lineHeight:1.2},children:e}),t&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.7rem",color:"text.secondary",lineHeight:1.2},children:t})]}),r,o&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:l=>{l.stopPropagation(),o();},sx:{p:.2},children:jsxRuntime.jsx(Rb__default.default,{sx:{fontSize:16}})})]})}),Gi=({id:e,label:t,caption:o,onRemove:r,trailing:a})=>{let{setNodeRef:n,attributes:i,listeners:c,transform:d,transition:l,isDragging:s}=sortable.useSortable({id:e}),m={transform:d?`translate3d(${d.x}px, ${d.y}px, 0)`:void 0,transition:l,zIndex:s?999:"auto"};return jsxRuntime.jsx(Ss,{label:t,caption:o,onRemove:r,trailing:a,isDragging:s,dragRef:n,listeners:c,attributes:i,style:m})};var Ts={rows:jsxRuntime.jsx(VS__default.default,{fontSize:"small"}),columns:jsxRuntime.jsx(Gb__default.default,{fontSize:"small"}),filters:jsxRuntime.jsx(OS__default.default,{fontSize:"small"}),values:jsxRuntime.jsx(qb__default.default,{fontSize:"small"})},bg=({isConfiguratorCollapsed:e,onToggleCollapse:t,availableFields:o,fieldMap:r,filterFields:a,columnFields:n,rowFields:i,valueFields:c,clearZone:d,removeFieldFromZone:l,getFilterSelectionSummary:s,renderDimensionFilterSelect:m,renderAggregationSelect:g,getAggregationLabel:p})=>{let{t:b}=le(),y=[`${b("pivot.zone.rows")} ${i.length}`,`${b("pivot.zone.columns")} ${n.length}`,`${b("pivot.zone.filters")} ${a.length}`,`${b("pivot.zone.values")} ${c.length}`].join(" \xB7 ");return jsxRuntime.jsx(Vn,{title:b("pivot.config.title"),subtitle:y,collapsed:e,onToggleCollapse:t,expandAriaLabel:b("pivot.collapse.ariaExpand"),collapseAriaLabel:b("pivot.collapse.ariaCollapse"),unmountOnExit:true,children:jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",lg:"260px 1fr"},gap:2},children:[jsxRuntime.jsx(zn,{zone:"palette",title:b("pivot.fieldList"),hint:b("pivot.availableDimensions"),itemCount:o.length,icon:jsxRuntime.jsx(vS__default.default,{sx:{fontSize:16,color:"text.secondary"}}),children:jsxRuntime.jsxs(material.Stack,{spacing:.8,sx:{maxHeight:400,overflowY:"auto",pr:.5},children:[o.length===0&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.74rem",color:"text.secondary",py:1},children:b("pivot.allFieldsInUse")}),o.map(u=>jsxRuntime.jsx(pg,{id:`item|palette|${u.id}`,label:u.label,subtitle:u.type??"string"},u.id))]})}),jsxRuntime.jsxs(material.Stack,{spacing:2,children:[jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[jsxRuntime.jsx(zn,{zone:"filters",title:b("pivot.zone.filters"),hint:b("pivot.hint.filters"),icon:Ts.filters,itemCount:a.length,onClear:()=>d("filters"),children:jsxRuntime.jsx(sortable.SortableContext,{items:a.map(u=>`item|filters|${u}`),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:.7,children:a.map(u=>jsxRuntime.jsx(Gi,{id:`item|filters|${u}`,label:r.get(u)?.label??u,caption:s(u),trailing:m(u),onRemove:()=>l("filters",u)},u))})})}),jsxRuntime.jsx(zn,{zone:"columns",title:b("pivot.zone.columns"),hint:b("pivot.hint.columns"),icon:Ts.columns,itemCount:n.length,onClear:()=>d("columns"),children:jsxRuntime.jsx(sortable.SortableContext,{items:n.map(u=>`item|columns|${u}`),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:.7,children:n.map(u=>jsxRuntime.jsx(Gi,{id:`item|columns|${u}`,label:r.get(u)?.label??u,caption:`${r.get(u)?.type??"dimension"} \u2022 ${s(u)}`,trailing:m(u),onRemove:()=>l("columns",u)},u))})})})]}),jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[jsxRuntime.jsx(zn,{zone:"rows",title:b("pivot.zone.rows"),hint:b("pivot.hint.rows"),icon:Ts.rows,itemCount:i.length,onClear:()=>d("rows"),children:jsxRuntime.jsx(sortable.SortableContext,{items:i.map(u=>`item|rows|${u}`),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:.7,children:i.map(u=>jsxRuntime.jsx(Gi,{id:`item|rows|${u}`,label:r.get(u)?.label??u,caption:`${r.get(u)?.type??"dimension"} \u2022 ${s(u)}`,trailing:m(u),onRemove:()=>l("rows",u)},u))})})}),jsxRuntime.jsx(zn,{zone:"values",title:b("pivot.zone.values"),hint:b("pivot.hint.values"),icon:Ts.values,itemCount:c.length,onClear:()=>d("values"),children:jsxRuntime.jsx(sortable.SortableContext,{items:c.map(u=>`item|values|${u.tokenId}`),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:.7,children:c.map(u=>{let x=r.get(u.fieldId)?.label??u.fieldId,f=`${p(u.aggregation)}(${x})`;return jsxRuntime.jsx(Gi,{id:`item|values|${u.tokenId}`,label:x,caption:f,trailing:g(u),onRemove:()=>l("values",u.tokenId)},u.tokenId)})})})})]})]})]})})};var yg=e=>e.toLocaleString(void 0,{maximumFractionDigits:1}),xg=({data:e,primaryLabel:t,secondaryLabel:o,formatPrimaryValue:r,formatSecondaryValue:a})=>{let n=styles.useTheme();if(e.length===0)return null;let i=720,c=250,d={top:20,right:24,bottom:40,left:52},l=o?e.map(u=>u.primaryValue):e.map((u,x)=>x+1),s=o?e.map(u=>u.secondaryValue??0):e.map(u=>u.primaryValue),m=Math.max(...l,1),g=Math.max(...s,1),p=i-d.left-d.right,b=c-d.top-d.bottom,y=e.map((u,x)=>{let f=o?u.primaryValue:x+1,h=o?u.secondaryValue??0:u.primaryValue,v=d.left+f/m*p,S=c-d.bottom-h/g*b;return {...u,x:v,y:S,rawX:f,rawY:h}});return jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[jsxRuntime.jsx(material.Box,{sx:{overflowX:"auto"},children:jsxRuntime.jsxs(material.Box,{component:"svg",viewBox:`0 0 ${i} ${c}`,sx:{width:"100%",minWidth:i,height:c},children:[jsxRuntime.jsx("line",{x1:d.left,y1:c-d.bottom,x2:i-d.right,y2:c-d.bottom,stroke:styles.alpha(n.palette.text.secondary,.35)}),jsxRuntime.jsx("line",{x1:d.left,y1:d.top,x2:d.left,y2:c-d.bottom,stroke:styles.alpha(n.palette.text.secondary,.35)}),y.map(u=>jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("circle",{cx:u.x,cy:u.y,r:7,fill:styles.alpha(n.palette.primary.main,.18)}),jsxRuntime.jsx("circle",{cx:u.x,cy:u.y,r:4.5,fill:n.palette.primary.main,children:jsxRuntime.jsxs("title",{children:[u.name,`
195
195
  `,o?`${t}: ${r(u.primaryValue)}`:`${t}: ${r(u.primaryValue)}`,o?`
196
- ${o}: ${(a??r)(u.secondaryValue??0)}`:""]})}),jsxRuntime.jsx("text",{x:u.x,y:Math.max(u.y-12,d.top+8),textAnchor:"middle",fontSize:"10",fill:n.palette.text.secondary,children:u.name})]},u.name)),jsxRuntime.jsx("text",{x:i/2,y:c-10,textAnchor:"middle",fontSize:"11",fill:n.palette.text.secondary,children:o?t:"Index"}),jsxRuntime.jsx("text",{x:16,y:c/2,textAnchor:"middle",transform:`rotate(-90 16 ${c/2})`,fontSize:"11",fill:n.palette.text.secondary,children:o??t}),jsxRuntime.jsx("text",{x:d.left,y:d.top-4,fontSize:"10",fill:n.palette.text.secondary,children:fg(f)}),jsxRuntime.jsx("text",{x:i-d.right,y:c-d.bottom+16,textAnchor:"end",fontSize:"10",fill:n.palette.text.secondary,children:fg(g)})]})}),jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",lg:"repeat(3, minmax(0, 1fr))"},gap:1},children:e.map(u=>jsxRuntime.jsxs(material.Box,{sx:C=>({borderRadius:2,px:1.25,py:1,border:`1px solid ${styles.alpha(C.palette.divider,.7)}`,bgcolor:styles.alpha(C.palette.background.default,.35)}),children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.78rem",fontWeight:700},noWrap:true,title:u.name,children:u.name}),jsxRuntime.jsxs(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:[t,": ",r(u.primaryValue)]}),o&&jsxRuntime.jsxs(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:[o,": ",(a??r)(u.secondaryValue??0)]})]},u.name))})]})};var Td=e=>Math.max(...e,1),yg=({data:e,chartType:t,primaryLabel:o,secondaryLabel:r,formatPrimaryValue:a,formatSecondaryValue:n})=>{let i=styles.useTheme(),c=i.palette.primary.main,d=i.palette.warning.main;if(e.length===0)return null;if(t==="bar-horizontal"){let m=Td(e.flatMap(h=>[h.primaryValue,h.secondaryValue??0]));return jsxRuntime.jsx(material.Stack,{spacing:1.1,children:e.map(h=>jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",md:"160px 1fr 128px"},gap:1.25,alignItems:"center"},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.78rem",fontWeight:700},noWrap:true,title:h.name,children:h.name}),jsxRuntime.jsxs(material.Stack,{spacing:.65,children:[jsxRuntime.jsx(material.Box,{sx:{height:10,borderRadius:999,overflow:"hidden",bgcolor:styles.alpha(i.palette.action.active,.08)},children:jsxRuntime.jsx(material.Box,{sx:{width:`${h.primaryValue/m*100}%`,height:"100%",bgcolor:c}})}),r&&jsxRuntime.jsx(material.Box,{sx:{height:8,borderRadius:999,overflow:"hidden",bgcolor:styles.alpha(i.palette.action.active,.08)},children:jsxRuntime.jsx(material.Box,{sx:{width:`${(h.secondaryValue??0)/m*100}%`,height:"100%",bgcolor:d}})})]}),jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",textAlign:{xs:"left",md:"right"},fontWeight:700},children:a(h.primaryValue)}),r&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",textAlign:{xs:"left",md:"right"},color:"text.secondary"},children:(n??a)(h.secondaryValue??0)})]})]},h.name))})}if(t==="bar-vertical"){let m=Td(e.flatMap(x=>[x.primaryValue,x.secondaryValue??0])),h=r?92:76;return jsxRuntime.jsx(material.Box,{sx:{overflowX:"auto",pb:.5},children:jsxRuntime.jsx(material.Box,{sx:{minWidth:Math.max(620,e.length*h),display:"grid",gridTemplateColumns:`repeat(${e.length}, minmax(56px, 1fr))`,gap:1,alignItems:"end"},children:e.map(x=>jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsxs(material.Box,{sx:{height:210,display:"flex",alignItems:"flex-end",justifyContent:"center",gap:.8},children:[jsxRuntime.jsx(material.Box,{sx:{width:r?16:26,minHeight:8,height:`${Math.max(x.primaryValue/m*188,8)}px`,borderRadius:"10px 10px 2px 2px",bgcolor:c},title:`${o}: ${a(x.primaryValue)}`}),r&&jsxRuntime.jsx(material.Box,{sx:{width:16,minHeight:8,height:`${Math.max((x.secondaryValue??0)/m*188,8)}px`,borderRadius:"10px 10px 2px 2px",bgcolor:d},title:`${r}: ${(n??a)(x.secondaryValue??0)}`})]}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.76rem",fontWeight:700},noWrap:true,title:x.name,children:x.name}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.7rem",color:"text.secondary"},noWrap:true,title:a(x.primaryValue),children:a(x.primaryValue)}),r&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.7rem",color:"text.secondary"},noWrap:true,title:(n??a)(x.secondaryValue??0),children:(n??a)(x.secondaryValue??0)})]},x.name))})})}let l=Math.max(680,e.length*74),s=240,g={top:20,right:18,bottom:36,left:18},f=Td(e.flatMap(m=>[m.primaryValue,m.secondaryValue??0])),p=l-g.left-g.right,b=s-g.top-g.bottom,y=m=>e.map((h,x)=>{let w=g.left+x*p/Math.max(e.length-1,1),E=s-g.bottom-m(h)/f*b;return {x:w,y:E,item:h}}),u=y(m=>m.primaryValue),C=r?y(m=>m.secondaryValue??0):[];return jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:1.1},children:[jsxRuntime.jsx(material.Box,{sx:{overflowX:"auto"},children:jsxRuntime.jsxs(material.Box,{component:"svg",viewBox:`0 0 ${l} ${s}`,sx:{width:"100%",minWidth:l,height:s},children:[jsxRuntime.jsx("line",{x1:g.left,y1:s-g.bottom,x2:l-g.right,y2:s-g.bottom,stroke:styles.alpha(i.palette.text.secondary,.35)}),jsxRuntime.jsx("polyline",{fill:"none",stroke:c,strokeWidth:3,points:u.map(m=>`${m.x},${m.y}`).join(" ")}),u.map(m=>jsxRuntime.jsx("circle",{cx:m.x,cy:m.y,r:4,fill:c,children:jsxRuntime.jsxs("title",{children:[m.item.name,`
197
- `,o,": ",a(m.item.primaryValue)]})},`primary-${m.item.name}`)),r&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("polyline",{fill:"none",stroke:d,strokeWidth:2.5,strokeDasharray:"5 5",points:C.map(m=>`${m.x},${m.y}`).join(" ")}),C.map(m=>jsxRuntime.jsx("circle",{cx:m.x,cy:m.y,r:3.5,fill:d,children:jsxRuntime.jsxs("title",{children:[m.item.name,`
198
- `,r,": ",(n??a)(m.item.secondaryValue??0)]})},`secondary-${m.item.name}`))]})]})}),jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",xl:"repeat(4, minmax(0, 1fr))"},gap:1},children:e.map(m=>jsxRuntime.jsxs(material.Box,{sx:h=>({borderRadius:2,px:1.1,py:.9,border:`1px solid ${styles.alpha(h.palette.divider,.7)}`,bgcolor:styles.alpha(h.palette.background.default,.35)}),children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.76rem",fontWeight:700},noWrap:true,title:m.name,children:m.name}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.71rem",color:"text.secondary"},children:a(m.primaryValue)}),r&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.71rem",color:"text.secondary"},children:(n??a)(m.secondaryValue??0)})]},m.name))})]})};var xg=(e,t,o)=>{let r=new Set,a=[];return e.forEach(n=>{r.has(n)||(r.add(n),a.push({fieldId:n,label:o.get(n)?.label??n,zone:"rows"}));}),t.forEach(n=>{r.has(n)||(r.add(n),a.push({fieldId:n,label:o.get(n)?.label??n,zone:"columns"}));}),a},vg=(e,t,o)=>e.map(r=>{let a=t.get(r.fieldId),n=a?.label??r.fieldId;return {fieldId:r.fieldId,label:`${o(r.aggregation)} \xB7 ${n}`,item:r,field:a}}),Cg=({rows:e,dimensionFieldId:t,primaryValue:o,secondaryValue:r})=>{if(!t)return [];let a=new Map;return e.forEach(n=>{let i=jr(n[t]),c=a.get(i);if(c){c.push(n);return}a.set(i,[n]);}),Array.from(a.entries()).sort((n,i)=>n[0].localeCompare(i[0],void 0,{sensitivity:"base"})).map(([n,i])=>({name:n,primaryValue:Fn(i,o.fieldId,o.aggregation),secondaryValue:r?Fn(i,r.fieldId,r.aggregation):void 0}))};var Sg=({rows:e,fieldMap:t,rowFields:o,columnFields:r,valueFields:a,chartDimensionFieldId:n,chartPrimaryValueFieldId:i,chartSecondaryValueFieldId:c,chartType:d,isCollapsed:l,onChartDimensionFieldIdChange:s,onChartPrimaryValueFieldIdChange:g,onChartSecondaryValueFieldIdChange:f,onChartTypeChange:p,onToggleCollapse:b,getAggregationLabel:y})=>{let{t:u}=ne(),C=Qt.useMemo(()=>xg(o,r,t),[r,t,o]),m=Qt.useMemo(()=>vg(a,t,y),[t,y,a]),h=m.find(S=>S.fieldId===i)??m[0],x=m.find(S=>S.fieldId===c&&S.fieldId!==h?.fieldId)??null,w=C.find(S=>S.fieldId===n)??C[0],E=w&&h?u("pivot.chart.subtitleReady",{dimension:w.label,measure:x?`${h.label} / ${x.label}`:h.label}):u("pivot.chart.subtitle"),R=Qt.useMemo(()=>!w||!h?[]:Cg({rows:e,dimensionFieldId:w.fieldId,primaryValue:h.item,secondaryValue:x?.item}),[h,e,x,w]),T=S=>h?Wi(S,h.item,t):S.toLocaleString(),I=S=>x?Wi(S,x.item,t):S.toLocaleString(),k=C.length>1||m.length>1;return jsxRuntime.jsxs(Vn,{title:u("pivot.chart.title"),subtitle:E,collapsed:l,onToggleCollapse:b,expandAriaLabel:u("pivot.chart.collapse.ariaExpand"),collapseAriaLabel:u("pivot.chart.collapse.ariaCollapse"),bodySx:{display:"flex",flexDirection:"column",gap:1.1},children:[k&&jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",xl:"repeat(4, minmax(0, 1fr))"},gap:1,alignItems:"start"},children:[jsxRuntime.jsxs(material.FormControl,{size:"small",sx:{minWidth:0,width:"100%"},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.68rem",color:"text.secondary",mb:.45},children:u("pivot.chart.dimension")}),jsxRuntime.jsx(material.Select,{value:w?.fieldId??"",onChange:S=>s(String(S.target.value)),sx:{fontSize:"0.75rem",height:32},children:C.map(S=>jsxRuntime.jsx(material.MenuItem,{value:S.fieldId,sx:{fontSize:"0.75rem"},children:S.label},S.fieldId))})]}),jsxRuntime.jsxs(material.FormControl,{size:"small",sx:{minWidth:0,width:"100%"},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.68rem",color:"text.secondary",mb:.45},children:u("pivot.chart.primaryMeasure")}),jsxRuntime.jsx(material.Select,{value:h?.fieldId??"",onChange:S=>g(String(S.target.value)),sx:{fontSize:"0.75rem",height:32},children:m.map(S=>jsxRuntime.jsx(material.MenuItem,{value:S.fieldId,sx:{fontSize:"0.75rem"},children:S.label},S.fieldId))})]}),jsxRuntime.jsxs(material.FormControl,{size:"small",sx:{minWidth:0,width:"100%"},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.68rem",color:"text.secondary",mb:.45},children:u("pivot.chart.secondaryMeasure")}),jsxRuntime.jsxs(material.Select,{value:x?.fieldId??"",onChange:S=>f(String(S.target.value)),sx:{fontSize:"0.75rem",height:32},children:[jsxRuntime.jsx(material.MenuItem,{value:"",sx:{fontSize:"0.75rem",color:"text.secondary"},children:u("common.none")}),m.filter(S=>S.fieldId!==h?.fieldId).map(S=>jsxRuntime.jsx(material.MenuItem,{value:S.fieldId,sx:{fontSize:"0.75rem"},children:S.label},S.fieldId))]})]}),jsxRuntime.jsxs(material.FormControl,{size:"small",sx:{minWidth:0,width:"100%"},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.68rem",color:"text.secondary",mb:.45},children:u("pivot.chart.chartType")}),jsxRuntime.jsxs(material.Select,{value:d,onChange:S=>p(S.target.value),sx:{fontSize:"0.75rem",height:32},children:[jsxRuntime.jsx(material.MenuItem,{value:"bar-vertical",sx:{fontSize:"0.75rem"},children:u("pivot.chart.style.barVertical")}),jsxRuntime.jsx(material.MenuItem,{value:"bar-horizontal",sx:{fontSize:"0.75rem"},children:u("pivot.chart.style.barHorizontal")}),jsxRuntime.jsx(material.MenuItem,{value:"line",sx:{fontSize:"0.75rem"},children:u("pivot.chart.style.line")}),jsxRuntime.jsx(material.MenuItem,{value:"scatter",sx:{fontSize:"0.75rem"},children:u("pivot.chart.style.scatter")})]})]})]}),jsxRuntime.jsx(material.Box,{children:w?h?R.length===0?jsxRuntime.jsx(material.Box,{sx:{py:5,textAlign:"center"},children:jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.86rem",color:"text.secondary"},children:u("pivot.chart.emptyNoData")})}):d==="scatter"?jsxRuntime.jsx(hg,{data:R,primaryLabel:h.label,secondaryLabel:x?.label,formatPrimaryValue:T,formatSecondaryValue:I}):jsxRuntime.jsx(yg,{data:R,chartType:d,primaryLabel:h.label,secondaryLabel:x?.label,formatPrimaryValue:T,formatSecondaryValue:I}):jsxRuntime.jsx(material.Box,{sx:{py:5,textAlign:"center"},children:jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.86rem",color:"text.secondary"},children:u("pivot.chart.emptyNoValue")})}):jsxRuntime.jsx(material.Box,{sx:{py:5,textAlign:"center"},children:jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.86rem",color:"text.secondary"},children:u("pivot.chart.emptyNoDimension")})})})]})};var ws=({node:e,dataColumns:t,fieldMap:o,level:r,expandedKeys:a,onToggle:n,getValue:i})=>{let c=a.has(e.key),d=e.children.length>0,l=e.isGrandTotal;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(material.TableRow,{sx:s=>({bgcolor:l?s.palette.mode==="dark"?"rgba(25, 118, 210, 0.22)":"rgba(47, 91, 255, 0.08)":s.palette.mode==="dark"?"#111111":"background.paper","&:hover":{bgcolor:l?s.palette.mode==="dark"?"rgba(25, 118, 210, 0.28)":"rgba(47, 91, 255, 0.12)":s.palette.mode==="dark"?"#181818":"rgba(0, 0, 0, 0.02)"}}),children:[jsxRuntime.jsxs(material.TableCell,{sx:s=>({fontSize:"0.76rem",fontWeight:l?800:600,borderBottom:`1px solid ${s.palette.divider}`,whiteSpace:"nowrap",pl:r*2+1,display:"flex",alignItems:"center",height:40}),children:[d&&!l&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>n(e.key),sx:{p:.2,mr:.5,ml:-1},children:c?jsxRuntime.jsx(gy__default.default,{sx:{fontSize:16}}):jsxRuntime.jsx(ch__default.default,{sx:{fontSize:16}})}),!d&&!l&&r>0&&jsxRuntime.jsx(material.Box,{sx:{width:20}}),e.value]}),t.map(s=>jsxRuntime.jsx(material.TableCell,{align:"right",sx:{fontSize:"0.76rem",fontWeight:l?800:500,borderBottom:g=>`1px solid ${g.palette.divider}`,whiteSpace:"nowrap"},children:Wi(i?i(e,s.id):e.aggregatedValues[s.id]??0,s.valueItem,o)},`${e.key}-${s.id}`))]}),c&&e.children.map(s=>jsxRuntime.jsx(ws,{node:s,dataColumns:t,fieldMap:o,level:r+1,expandedKeys:a,onToggle:n,getValue:i},s.key))]})};var Dd=(e,t,o)=>{let r=[...e,...t];return o&&r.includes(o)?o:r[0]??""},Ps=(e,t)=>t&&e.some(o=>o.fieldId===t)?t:e[0]?.fieldId??"",Ad=(e,t,o)=>o===""?"":o&&o!==t&&e.some(r=>r.fieldId===o)?o:e.find(r=>r.fieldId!==t)?.fieldId??"",Mg=e=>{let t=new Set,o=r=>{r.forEach(a=>{a.children.length>0&&(t.add(a.key),o(a.children));});};return o(e),t},Ag=(e,t,o=0)=>e.length===0?o:e.reduce((r,a)=>a.children.length===0||!t.has(a.key)?Math.max(r,o+1):Math.max(r,Ag(a.children,t,o+1)),o),gk=(e,t)=>{let o=[],r=a=>{a.forEach(n=>{if(n.children.length>0&&t.has(n.key)){r(n.children);return}o.push(n);});};return r(e),o},LL=({title:e,rows:t,fields:o,initialLayout:r,initialChart:a,emptyText:n,maxPreviewHeight:i=520,initialChartCollapsed:c=false,initialTableCollapsed:d=false,model:l,enablePresetManagement:s=false,presets:g,defaultPresets:f,onPresetsChange:p,initialPresetId:b,onPresetApplied:y})=>{let{t:u}=ne(),C=core.useSensors(core.useSensor(core.PointerSensor,{activationConstraint:{distance:8}})),m=Qt.useRef(0),h=Qt.useRef(false),x=e??u("pivot.title.default"),w=n??u("pivot.empty"),E=Qt.useMemo(()=>({sum:u("pivot.agg.sum"),count:u("pivot.agg.count"),avg:u("pivot.agg.avg"),min:u("pivot.agg.min"),max:u("pivot.agg.max")}),[u]),R=Qt.useCallback(v=>E[v]??Ym[v],[E]),T=Qt.useMemo(()=>new Set(o.map(v=>v.id)),[o]),I=Qt.useMemo(()=>new Map(o.map(v=>[v.id,v])),[o]),[k,S]=Qt.useState(()=>no(r?.rows,T)),[D,P]=Qt.useState(()=>no(r?.columns,T)),[M,B]=Qt.useState(()=>no(r?.filters,T)),[X,L]=Qt.useState(()=>{let v=r?.values??[],F=new Set,z=[];return v.forEach(Q=>{if(!T.has(Q.fieldId)||F.has(Q.fieldId))return;F.add(Q.fieldId),m.current+=1;let he=I.get(Q.fieldId);z.push({tokenId:`v${m.current}`,fieldId:Q.fieldId,aggregation:Po(Q.aggregation,he)});}),z}),[Z,$]=Qt.useState({}),[q,H]=Qt.useState(true),[re,de]=Qt.useState(false),[Ce,ve]=Qt.useState(()=>Dd(no(r?.rows,T),no(r?.columns,T),a?.dimensionFieldId)),[le,oe]=Qt.useState(()=>{let v=(r?.values??[]).filter((F,z,Q)=>T.has(F.fieldId)&&Q.findIndex(he=>he.fieldId===F.fieldId)===z).map(F=>({tokenId:F.fieldId,fieldId:F.fieldId,aggregation:Po(F.aggregation,I.get(F.fieldId))}));return Ps(v,a?.primaryValueFieldId)}),[Ie,Ze]=Qt.useState(()=>{let v=(r?.values??[]).filter((z,Q,he)=>T.has(z.fieldId)&&he.findIndex(Ke=>Ke.fieldId===z.fieldId)===Q).map(z=>({tokenId:z.fieldId,fieldId:z.fieldId,aggregation:Po(z.aggregation,I.get(z.fieldId))})),F=Ps(v,a?.primaryValueFieldId);return Ad(v,F,a?.secondaryValueFieldId)}),[Ge,ce]=Qt.useState(a?.chartType??"bar-vertical"),[Ve,et]=Qt.useState(c),[ye,We]=Qt.useState(d),[qe,st]=Qt.useState(()=>f??[]),[Pe,K]=Qt.useState(""),[Ee,ge]=Qt.useState(false),[ke,rt]=Qt.useState(""),[Ue,ae]=Qt.useState(null),[fe,je]=Qt.useState(new Set(["__grand_total__"])),[It,_]=Qt.useState(new Set),ze=l?.rowFields??k,xe=l?.columnFields??D,Y=l?.filterFields??M,N=l?.valueFields??X,J=l?.filterSelections??Z,we=l?.showGrandTotal??q,Me=l?.isConfiguratorCollapsed??re,tt=l?.chartDimensionFieldId??Ce,bt=l?.chartPrimaryValueFieldId??le,dt=l?.chartSecondaryValueFieldId??Ie,Vt=l?.chartType??Ge,vt=l?.isChartCollapsed??Ve,ko=l?.isTableCollapsed??ye,Ct=g??qe,sr=s||Ct.length>0||!!p,lo=Qt.useCallback(v=>{if(l?.setRowFields){l.setRowFields(v);return}S(v);},[l]),Et=Qt.useCallback(v=>{if(l?.setColumnFields){l.setColumnFields(v);return}P(v);},[l]),Gt=Qt.useCallback(v=>{if(l?.setFilterFields){l.setFilterFields(v);return}B(v);},[l]),yt=Qt.useCallback(v=>{if(l?.setValueFields){l.setValueFields(v);return}L(v);},[l]),ao=Qt.useCallback(v=>{if(l?.setFilterSelections){l.setFilterSelections(v);return}$(v);},[l]),O=Qt.useCallback(v=>{if(l?.setShowGrandTotal){l.setShowGrandTotal(v);return}H(v);},[l]),W=Qt.useCallback(v=>{if(l?.setIsConfiguratorCollapsed){l.setIsConfiguratorCollapsed(v);return}de(v);},[l]),U=Qt.useCallback(v=>{if(l?.setChartDimensionFieldId){l.setChartDimensionFieldId(v);return}ve(v);},[l]),me=Qt.useCallback(v=>{if(l?.setChartPrimaryValueFieldId){l.setChartPrimaryValueFieldId(v);return}oe(v);},[l]),pe=Qt.useCallback(v=>{if(l?.setChartSecondaryValueFieldId){l.setChartSecondaryValueFieldId(v);return}Ze(v);},[l]),Fe=Qt.useCallback(v=>{if(l?.setChartType){l.setChartType(v);return}ce(v);},[l]),Xe=Qt.useCallback(v=>{if(l?.setIsChartCollapsed){l.setIsChartCollapsed(v);return}et(v);},[l]),Ye=Qt.useCallback(v=>{if(l?.setIsTableCollapsed){l.setIsTableCollapsed(v);return}We(v);},[l]),ot=Qt.useCallback(v=>{let F=typeof v=="function"?v(Ct):v;g||st(F),p?.(F);},[p,Ct,g]),Dt=Qt.useMemo(()=>new Set([...ze,...xe,...Y]),[ze,xe,Y]),pt=Qt.useMemo(()=>o.filter(v=>!Dt.has(v.id)),[o,Dt]),mt=Qt.useMemo(()=>{let v=[...ze,...xe,...Y],F=new Set,z=[];return v.forEach(Q=>{F.has(Q)||(F.add(Q),z.push(Q));}),z},[xe,Y,ze]);Qt.useEffect(()=>{lo(v=>{let F=v.filter(z=>T.has(z));return Xr(v,F)?v:F}),Et(v=>{let F=v.filter(z=>T.has(z));return Xr(v,F)?v:F}),Gt(v=>{let F=v.filter(z=>T.has(z));return Xr(v,F)?v:F}),yt(v=>{let F=v.filter(z=>T.has(z.fieldId)).map(z=>({...z,aggregation:Po(z.aggregation,I.get(z.fieldId))}));return ms(v,F)?v:F});},[I,T]);let St=Qt.useMemo(()=>{let v={};return mt.forEach(F=>{let z=new Set;t.forEach(Q=>{z.add(jr(Q[F]));}),v[F]=Array.from(z).sort((Q,he)=>Q.localeCompare(he));}),v},[mt,t]);Qt.useEffect(()=>{ao(v=>{let F={};return mt.forEach(z=>{let Q=St[z]??[],Ke=(v[z]??[]).filter(He=>Q.includes(He)),De=Object.prototype.hasOwnProperty.call(v,z);F[z]=De?Ke:Q;}),rg(v,F)?v:F});},[mt,St]),Qt.useEffect(()=>{U(v=>Dd(ze,xe,v));},[xe,ze,U]),Qt.useEffect(()=>{me(v=>Ps(N,v));},[me,N]),Qt.useEffect(()=>{pe(v=>Ad(N,bt,v));},[bt,pe,N]);let Wt=Qt.useMemo(()=>t.filter(v=>mt.every(F=>{let z=J[F]??[],Q=St[F]??[];if(z.length===Q.length)return true;if(z.length===0)return false;let he=jr(v[F]);return z.includes(he)})),[mt,St,J,t]),ct=Qt.useMemo(()=>{if(N.length===0)return null;let v=new Map;if(Wt.forEach(De=>{let He=xe.length>0?xe.map(Ne=>jr(De[Ne])):[u("pivot.valueLabel")],G=Ua(He);v.set(G,He);}),v.size===0){let De=xe.length>0?xe.map(()=>us):[u("pivot.valueLabel")];v.set(Ua(De),De);}let F=Array.from(v.entries()).sort((De,He)=>og(De[1],He[1])),z=F.flatMap(([De,He])=>N.map(G=>{let Ne=I.get(G.fieldId),V=`${R(G.aggregation)} ${Ne?.label??G.fieldId}`,ue=xe.length===0||N.length>1?`${He.join(" / ")} \u2022 ${V}`:He.join(" / ");return {id:`${De}::${G.tokenId}`,colKey:De,valueItem:G,label:ue}})),Q=[];xe.length>0&&F.forEach(([De,He])=>{let G=z.filter(ue=>ue.colKey===De),Ne=Q,V=[];He.forEach((ue,te)=>{V.push(`d${te}:${ue}`);let Ae=`col::${Ua(V)}`,kt=Ne.find(wr=>wr.key===Ae);kt||(kt={key:Ae,label:ue,children:[],leafColumnIds:[],path:He.slice(0,te+1),depth:te},Ne.push(kt)),G.forEach(wr=>{kt.leafColumnIds.includes(wr.id)||kt.leafColumnIds.push(wr.id);}),Ne=kt.children;});});let he=De=>{let He={};return z.forEach(G=>{let Ne=De.filter(V=>{let ue=xe.length>0?xe.map(te=>jr(V[te])):[u("pivot.valueLabel")];return Ua(ue)===G.colKey});He[G.id]=Fn(Ne,G.valueItem.fieldId,G.valueItem.aggregation);}),He},Ke=[];if(ze.length===0)Ke.push({key:"root",value:u("pivot.resultLabel")||Xm,children:[],isLeaf:true,aggregatedValues:he(Wt),path:[],depth:0});else {let De=(He,G,Ne)=>{if(G>=ze.length)return [];let V=ze[G],ue=new Map;return He.forEach(te=>{let Ae=jr(te[V]);ue.has(Ae)||ue.set(Ae,[]),ue.get(Ae).push(te);}),Array.from(ue.keys()).sort().map(te=>{let Ae=ue.get(te),kt=[...Ne,te];return {key:Ua(kt),value:te,fieldId:V,aggregatedValues:he(Ae),children:De(Ae,G+1,kt),isLeaf:G===ze.length-1,path:kt,depth:G}})};Ke.push(...De(Wt,0,[]));}return {dataColumns:z,columnTree:Q,rowTree:Ke}},[xe,I,Wt,R,ze,u,N]),Ao=Qt.useCallback((v,F)=>(m.current+=1,{tokenId:`v${m.current}`,fieldId:v,aggregation:Po(F,I.get(v))}),[I]),wo=Qt.useCallback(v=>{if(v==="rows")return lo([]);if(v==="columns")return Et([]);if(v==="filters")return Gt([]);yt([]);},[]),Yo=Qt.useCallback((v,F)=>{if(v==="rows")return lo(z=>z.filter(Q=>Q!==F));if(v==="columns")return Et(z=>z.filter(Q=>Q!==F));if(v==="filters")return Gt(z=>z.filter(Q=>Q!==F));yt(z=>z.filter(Q=>Q.tokenId!==F));},[]),A=Qt.useCallback((v,F)=>{yt(z=>z.map(Q=>Q.tokenId===v?{...Q,aggregation:Po(F,I.get(Q.fieldId))}:Q));},[I]),j=Qt.useCallback(v=>{ae(String(v.active.id));},[]),ee=Qt.useCallback(v=>{if(ae(null),!v.over)return;let F=ps(String(v.active.id)),z=ps(String(v.over.id));if(!F||!z||F.kind!=="item"||!F.key)return;if(F.zone===z.zone&&z.kind==="item"){if(F.zone==="rows"){let te=ze.indexOf(F.key),Ae=ze.indexOf(z.key??"");te!==-1&&Ae!==-1&&te!==Ae&&lo(kt=>sortable.arrayMove(kt,te,Ae));return}if(F.zone==="columns"){let te=xe.indexOf(F.key),Ae=xe.indexOf(z.key??"");te!==-1&&Ae!==-1&&te!==Ae&&Et(kt=>sortable.arrayMove(kt,te,Ae));return}if(F.zone==="filters"){let te=Y.indexOf(F.key),Ae=Y.indexOf(z.key??"");te!==-1&&Ae!==-1&&te!==Ae&&Gt(kt=>sortable.arrayMove(kt,te,Ae));return}if(F.zone==="values"){let te=N.findIndex(kt=>kt.tokenId===F.key),Ae=N.findIndex(kt=>kt.tokenId===(z.key??""));te!==-1&&Ae!==-1&&te!==Ae&&yt(kt=>sortable.arrayMove(kt,te,Ae));}return}let Q=z.zone,he=[...ze],Ke=[...xe],De=[...Y],He=[...N],G="",Ne=null;if(F.zone==="palette")G=F.key;else if(F.zone==="values"){let te=He.find(Ae=>Ae.tokenId===F.key);if(!te)return;G=te.fieldId,Ne=te,He=He.filter(Ae=>Ae.tokenId!==F.key);}else F.zone==="rows"?(G=F.key,he=he.filter(te=>te!==G)):F.zone==="columns"?(G=F.key,Ke=Ke.filter(te=>te!==G)):F.zone==="filters"&&(G=F.key,De=De.filter(te=>te!==G));if(!G)return;let V=()=>{he=he.filter(te=>te!==G),Ke=Ke.filter(te=>te!==G),De=De.filter(te=>te!==G);},ue=te=>{if(z.kind!=="item"||!z.key)return te==="rows"?he.length:te==="columns"?Ke.length:te==="filters"?De.length:te==="values"?He.length:0;if(te==="rows"){let Ae=he.indexOf(z.key);return Ae>=0?Ae:he.length}if(te==="columns"){let Ae=Ke.indexOf(z.key);return Ae>=0?Ae:Ke.length}if(te==="filters"){let Ae=De.indexOf(z.key);return Ae>=0?Ae:De.length}if(te==="values"){let Ae=He.findIndex(kt=>kt.tokenId===z.key);return Ae>=0?Ae:He.length}return 0};if(Q==="palette"){lo(he),Et(Ke),Gt(De),yt(He);return}if(Q==="values"){let te=ue("values"),Ae=Ne??Ao(G);He.splice(te,0,Ae),lo(he),Et(Ke),Gt(De),yt(He);return}if(tg(Q)){V();let te=ue(Q);Q==="rows"?he.splice(te,0,G):Q==="columns"?Ke.splice(te,0,G):De.splice(te,0,G),lo(he),Et(Ke),Gt(De),yt(He);}},[xe,Ao,Y,ze,N]),se=Qt.useCallback((v,F)=>{ao(z=>({...z,[v]:F}));},[]),Le=Qt.useCallback(v=>{je(F=>{let z=new Set(F);return z.has(v)?z.delete(v):z.add(v),z});},[]),_e=Qt.useCallback(v=>{_(F=>{let z=new Set(F);return z.has(v)?z.delete(v):z.add(v),z});},[]),gt=Qt.useCallback(v=>{let F=I.get(v.fieldId),z=bd(F);return jsxRuntime.jsx(material.FormControl,{size:"small",sx:{minWidth:98},children:jsxRuntime.jsx(material.Select,{value:v.aggregation,onChange:Q=>A(v.tokenId,Q.target.value),onClick:Q=>Q.stopPropagation(),onMouseDown:Q=>Q.stopPropagation(),sx:{fontSize:"0.72rem",height:26,"& .MuiSelect-select":{py:.35}},children:z.map(Q=>jsxRuntime.jsx(material.MenuItem,{value:Q,sx:{fontSize:"0.75rem"},children:R(Q)},Q))})})},[I,R,A]),Re=Qt.useCallback(v=>{let F=St[v]??[],z=J[v]??F;return F.length===0?u("pivot.filter.noValues"):z.length===0?u("pivot.filter.noneSelected"):z.length===F.length?u("pivot.filter.allValues"):u("pivot.filter.selectedCount",{selected:z.length,total:F.length})},[St,J,u]),ut=Qt.useCallback(v=>{let F=St[v]??[],z=J[v]??F;return jsxRuntime.jsx(ig,{options:F,selectedValues:z,onChange:Q=>se(v,Q)})},[St,J,se]),nt=Qt.useCallback(()=>`pivot-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,[]),Pt=Qt.useCallback(()=>{let v={};return new Set([...mt,...Object.keys(J)]).forEach(z=>{if(!T.has(z))return;let Q=J[z]??[];v[z]=[...Q];}),{layout:{rows:[...ze],columns:[...xe],filters:[...Y],values:N.map(z=>({fieldId:z.fieldId,aggregation:z.aggregation}))},filterSelections:v,showGrandTotal:we,chart:{dimensionFieldId:tt,primaryValueFieldId:bt,secondaryValueFieldId:dt,chartType:Vt}}},[mt,tt,bt,dt,Vt,xe,Y,J,ze,we,T,N]),ht=Qt.useCallback(v=>{let F=no(v.layout.rows,T),z=no(v.layout.columns,T),Q=no(v.layout.filters,T),he=new Set,Ke=(v.layout.values??[]).filter(G=>!T.has(G.fieldId)||he.has(G.fieldId)?false:(he.add(G.fieldId),true)).map(G=>Ao(G.fieldId,G.aggregation)),De={};Object.entries(v.filterSelections??{}).forEach(([G,Ne])=>{!T.has(G)||!Array.isArray(Ne)||(De[G]=Array.from(new Set(Ne.map(V=>String(V)))));}),lo(F),Et(z),Gt(Q),yt(Ke),ao(De),typeof v.showGrandTotal=="boolean"&&O(v.showGrandTotal),U(Dd(F,z,v.chart?.dimensionFieldId));let He=Ps(Ke,v.chart?.primaryValueFieldId);me(He),pe(Ad(Ke,He,v.chart?.secondaryValueFieldId)),Fe(v.chart?.chartType??"bar-vertical"),K(v.id),y?.(v);},[Ao,y,U,me,pe,Fe,Et,Gt,ao,lo,O,yt,T]),eo=Qt.useCallback(v=>{if(!v){K("");return}let F=Ct.find(z=>z.id===v);if(!F){K("");return}ht(F);},[ht,Ct]),so=Qt.useCallback(()=>{let v=u("pivot.preset.defaultName",{index:Ct.length+1});rt(v),ge(true);},[Ct.length,u]),To=Qt.useCallback(()=>{let v=ke.trim();if(!v)return;let F={id:nt(),name:v,...Pt()};ot(z=>[...z,F]),K(F.id),ge(false);},[Pt,nt,ke,ot]),Xt=Qt.useCallback(()=>{Pe&&(ot(v=>v.filter(F=>F.id!==Pe)),K(""));},[Pe,ot]);Qt.useEffect(()=>{if(!b||h.current)return;let v=Ct.find(F=>F.id===b);v&&(h.current=true,ht(v));},[ht,b,Ct]),Qt.useEffect(()=>{Pe&&(Ct.some(v=>v.id===Pe)||K(""));},[Pe,Ct]);let xo=Qt.useMemo(()=>{if(!we||!ct||!ze.length)return null;let v={};return ct.dataColumns.forEach(F=>{let z=Wt.filter(Q=>{let he=xe.length>0?xe.map(Ke=>jr(Q[Ke])):[u("pivot.valueLabel")];return Ua(he)===F.colKey});v[F.id]=Fn(z,F.valueItem.fieldId,F.valueItem.aggregation);}),{key:"__grand_total__",value:u("pivot.grandTotal")||Zm,children:[],isLeaf:false,isGrandTotal:true,aggregatedValues:v,path:[],depth:-1}},[we,ct,Wt,xe,ze.length,u]),Rt=Qt.useMemo(()=>Mg(ct?.rowTree??[]),[ct]),Ut=Qt.useMemo(()=>Mg(ct?.columnTree??[]),[ct]);Qt.useEffect(()=>{je(v=>{let F=new Set;return v.has("__grand_total__")&&F.add("__grand_total__"),Rt.forEach(z=>{v.has(z)&&F.add(z);}),F});},[Rt]),Qt.useEffect(()=>{_(v=>{let F=new Set;return Ut.forEach(z=>{v.has(z)&&F.add(z);}),F});},[Ut]);let cr=Qt.useCallback(()=>{je(v=>{let F=new Set(v);return Rt.forEach(z=>F.add(z)),F});},[Rt]),dr=Qt.useCallback(()=>{je(v=>{let F=new Set;return v.has("__grand_total__")&&F.add("__grand_total__"),F});},[]),rn=Qt.useCallback(()=>{_(new Set(Ut));},[Ut]),wa=Qt.useCallback(()=>{_(new Set);},[]),an=Qt.useMemo(()=>!ct||xe.length===0?[]:gk(ct.columnTree,It),[xe.length,It,ct]),Qo=Qt.useMemo(()=>{if(!ct)return [];if(xe.length===0)return ct.dataColumns.map(F=>({id:F.id,label:F.label,leafColumnIds:[F.id],valueItem:F.valueItem}));let v=new Map(ct.dataColumns.map(F=>[F.id,F]));return an.flatMap(F=>{let z=new Map;return F.leafColumnIds.forEach(Q=>{let he=v.get(Q);if(!he)return;let Ke=he.valueItem.tokenId,De=`${R(he.valueItem.aggregation)} ${I.get(he.valueItem.fieldId)?.label??he.valueItem.fieldId}`,He=z.get(Ke);if(He){He.leafColumnIds.push(Q);return}z.set(Ke,{id:`${F.key}::${Ke}`,label:N.length>1?De:F.label,leafColumnIds:[Q],valueItem:he.valueItem});}),Array.from(z.values())})},[xe.length,I,R,ct,N.length,an]),nn=Qt.useMemo(()=>new Map(Qo.map(v=>[v.id,v])),[Qo]),Ta=Qt.useMemo(()=>Qo.map(v=>({id:v.id,colKey:v.id,valueItem:v.valueItem,label:v.label})),[Qo]),Ia=Qt.useMemo(()=>{if(!ct||xe.length===0)return [];let v=[],F=Ag(ct.columnTree,It),z=F+(N.length>1?1:0),Q=(he,Ke)=>{v[Ke]??(v[Ke]=[]),he.forEach(De=>{let He=De.children.length>0&&It.has(De.key),G=Qo.filter(V=>De.leafColumnIds.some(ue=>V.leafColumnIds.includes(ue))).length,Ne=He||N.length>1?1:z-Ke;v[Ke].push({key:De.key,label:De.label,colSpan:G,rowSpan:Ne,expandable:De.children.length>0,expanded:He}),He&&Q(De.children,Ke+1);});};return Q(ct.columnTree,0),N.length>1&&(v[F]=Qo.map(he=>({key:he.id,label:he.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))),v},[xe.length,It,ct,N.length,Qo]),Or=Qt.useCallback((v,F)=>F.leafColumnIds.reduce((z,Q)=>z+(v.aggregatedValues[Q]??0),0),[]),ra=Qt.useMemo(()=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.Button,{size:"small",variant:"text",onClick:cr,disabled:Rt.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:u("pivot.table.expandRowsAll")}),jsxRuntime.jsx(material.Button,{size:"small",variant:"text",onClick:dr,disabled:Rt.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:u("pivot.table.collapseRowsAll")}),jsxRuntime.jsx(material.Divider,{orientation:"vertical",flexItem:true}),jsxRuntime.jsx(material.Button,{size:"small",variant:"text",onClick:rn,disabled:Ut.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:u("pivot.table.expandColumnsAll")}),jsxRuntime.jsx(material.Button,{size:"small",variant:"text",onClick:wa,disabled:xe.length===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:u("pivot.table.collapseColumnsAll")})]}),[xe.length,Ut.size,Rt.size,wa,dr,rn,cr,u]),ni=()=>{if(!Ue)return null;let v=ps(Ue);if(!v||v.kind!=="item"||!v.key)return null;if(v.zone==="palette"){let he=I.get(v.key);return he?jsxRuntime.jsx(xd,{label:he.label,subtitle:he.type}):null}if(v.zone==="values"){let he=N.find(G=>G.tokenId===v.key);if(!he)return null;let De=I.get(he.fieldId)?.label??he.fieldId,He=`${R(he.aggregation)}(${De})`;return jsxRuntime.jsx(ys,{label:De,caption:He})}let z=I.get(v.key)?.label??v.key,Q=Re(v.key);return jsxRuntime.jsx(ys,{label:z,caption:Q})};return jsxRuntime.jsxs(material.Paper,{sx:v=>({p:{xs:1.2,md:2},borderRadius:4,border:`1px solid ${v.palette.divider}`,bgcolor:"background.paper",boxShadow:v.palette.mode==="dark"?"none":"0 12px 28px rgba(15, 23, 42, 0.08)",display:"flex",flexDirection:"column",gap:2}),children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1.5,flexWrap:"wrap"},children:[jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1.05rem",fontWeight:800},children:x}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.78rem",color:"text.secondary"},children:u("pivot.subtitle.default")})]}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1.5,alignItems:"center",children:[sr&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.FormControl,{size:"small",sx:{minWidth:200},children:jsxRuntime.jsxs(material.Select,{value:Pe,displayEmpty:true,onChange:v=>eo(String(v.target.value)),sx:{fontSize:"0.75rem",height:32},children:[jsxRuntime.jsx(material.MenuItem,{value:"",sx:{fontSize:"0.75rem",color:"text.secondary"},children:u("pivot.preset.selectPlaceholder")}),Ct.map(v=>jsxRuntime.jsx(material.MenuItem,{value:v.id,sx:{fontSize:"0.75rem"},children:v.name},v.id))]})}),jsxRuntime.jsx(material.Tooltip,{title:u("pivot.preset.save"),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:so,"aria-label":u("pivot.preset.save"),children:jsxRuntime.jsx(jp__default.default,{sx:{fontSize:18}})})}),jsxRuntime.jsx(material.Tooltip,{title:u("pivot.preset.delete"),children:jsxRuntime.jsx("span",{children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:Xt,disabled:!Pe,"aria-label":u("pivot.preset.delete"),children:jsxRuntime.jsx(By__default.default,{sx:{fontSize:18}})})})}),jsxRuntime.jsx(material.Divider,{flexItem:true,orientation:"vertical"})]}),jsxRuntime.jsxs(material.Typography,{sx:{fontSize:"0.74rem",color:"text.secondary"},children:[u("pivot.records"),": ",jsxRuntime.jsx("strong",{children:t.length.toLocaleString()})," / ",u("pivot.afterFilter"),":"," ",jsxRuntime.jsx("strong",{children:Wt.length.toLocaleString()})]}),jsxRuntime.jsx(material.Divider,{flexItem:true,orientation:"vertical"}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:.6},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.74rem"},children:u("pivot.grandTotal")}),jsxRuntime.jsx(material.Switch,{size:"small",checked:we,onChange:v=>O(v.target.checked)})]})]})]}),jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsxs(core.DndContext,{sensors:C,collisionDetection:core.closestCenter,onDragStart:j,onDragEnd:ee,children:[jsxRuntime.jsx(gg,{isConfiguratorCollapsed:Me,onToggleCollapse:()=>W(v=>!v),availableFields:pt,fieldMap:I,filterFields:Y,columnFields:xe,rowFields:ze,valueFields:N,clearZone:wo,removeFieldFromZone:Yo,getFilterSelectionSummary:Re,renderDimensionFilterSelect:ut,renderAggregationSelect:gt,getAggregationLabel:R}),jsxRuntime.jsx(material.Portal,{children:jsxRuntime.jsx(core.DragOverlay,{dropAnimation:{duration:250,easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)"},children:ni()})})]}),jsxRuntime.jsx(Sg,{rows:Wt,fieldMap:I,rowFields:ze,columnFields:xe,valueFields:N,chartDimensionFieldId:tt,chartPrimaryValueFieldId:bt,chartSecondaryValueFieldId:dt,chartType:Vt,isCollapsed:vt,onChartDimensionFieldIdChange:v=>U(v),onChartPrimaryValueFieldIdChange:v=>me(v),onChartSecondaryValueFieldIdChange:v=>pe(v),onChartTypeChange:v=>Fe(v),onToggleCollapse:()=>Xe(v=>!v),getAggregationLabel:R}),jsxRuntime.jsx(Vn,{title:u("pivot.table.sectionTitle"),subtitle:ze.length>0?ze.map(v=>I.get(v)?.label??v).join(" > "):u("pivot.table.dimensions"),collapsed:ko,onToggleCollapse:()=>Ye(v=>!v),expandAriaLabel:u("pivot.table.collapse.ariaExpand"),collapseAriaLabel:u("pivot.table.collapse.ariaCollapse"),bodySx:{p:0},headerActions:ra,children:ct===null?jsxRuntime.jsx(material.Box,{sx:{py:5,px:{xs:1.2,md:1.6},textAlign:"center"},children:jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.86rem",color:"text.secondary"},children:w})}):jsxRuntime.jsx(material.TableContainer,{sx:{maxHeight:i},children:jsxRuntime.jsxs(material.Table,{size:"small",stickyHeader:true,children:[jsxRuntime.jsx(material.TableHead,{children:(Ia.length>0?Ia:[[]]).map((v,F)=>jsxRuntime.jsxs(material.TableRow,{children:[F===0&&jsxRuntime.jsx(material.TableCell,{rowSpan:Math.max(Ia.length,1),sx:z=>({fontWeight:800,fontSize:"0.76rem",color:"text.primary",bgcolor:z.palette.mode==="dark"?"#000000":"#f5f5f5",borderBottom:`1px solid ${z.palette.divider}`,pl:2,minWidth:220,verticalAlign:"middle"}),children:ze.length>0?ze.map(z=>I.get(z)?.label).join(" > "):u("pivot.table.dimensions")}),(v.length>0?v:Qo.map(z=>({key:z.id,label:z.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))).map(z=>jsxRuntime.jsx(material.TableCell,{align:"center",colSpan:z.colSpan,rowSpan:z.rowSpan,sx:Q=>({fontWeight:800,fontSize:"0.75rem",color:"text.primary",bgcolor:Q.palette.mode==="dark"?"#000000":"#f5f5f5",borderBottom:`1px solid ${Q.palette.divider}`,minWidth:148,verticalAlign:"middle"}),children:jsxRuntime.jsxs(material.Box,{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:.4},children:[z.expandable&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>_e(z.key),sx:{p:.1,ml:-0.3},children:z.expanded?jsxRuntime.jsx(gy__default.default,{sx:{fontSize:16}}):jsxRuntime.jsx(ch__default.default,{sx:{fontSize:16}})}),jsxRuntime.jsx(material.Box,{component:"span",children:z.label})]})},z.key))]},`pivot-header-row-${F}`))}),jsxRuntime.jsxs(material.TableBody,{children:[ct.rowTree.map(v=>jsxRuntime.jsx(ws,{node:v,dataColumns:Ta,fieldMap:I,level:0,expandedKeys:fe,onToggle:Le,getValue:(F,z)=>{let Q=nn.get(z);return Q?Or(F,Q):0}},v.key)),xo&&jsxRuntime.jsx(ws,{node:xo,dataColumns:Ta,fieldMap:I,level:0,expandedKeys:fe,onToggle:Le,getValue:(v,F)=>{let z=nn.get(F);return z?Or(v,z):0}})]})]})})}),jsxRuntime.jsxs(material.Dialog,{open:Ee,onClose:()=>ge(false),maxWidth:"xs",fullWidth:true,children:[jsxRuntime.jsx(material.DialogTitle,{children:u("pivot.preset.saveDialogTitle")}),jsxRuntime.jsx(material.DialogContent,{children:jsxRuntime.jsx(material.TextField,{autoFocus:true,fullWidth:true,margin:"dense",label:u("pivot.preset.nameLabel"),value:ke,onChange:v=>rt(v.target.value),onKeyDown:v=>{v.key==="Enter"&&(v.preventDefault(),To());}})}),jsxRuntime.jsxs(material.DialogActions,{children:[jsxRuntime.jsx(material.Button,{onClick:()=>ge(false),children:u("common.cancel")}),jsxRuntime.jsx(material.Button,{variant:"contained",onClick:To,disabled:!ke.trim(),children:u("common.save")})]})]})]})};var Bg=(e,t,o)=>{let r=[...e,...t];return o&&r.includes(o)?o:r[0]??""},Ed=(e,t)=>t&&e.some(o=>o.fieldId===t)?t:e[0]?.fieldId??"",Eg=(e,t,o)=>o===""?"":o&&o!==t&&e.some(r=>r.fieldId===o)?o:e.find(r=>r.fieldId!==t)?.fieldId??"",WL=({fields:e,initialLayout:t,initialFilterSelections:o={},initialShowGrandTotal:r=true,initialConfiguratorCollapsed:a=false,initialChart:n,initialChartCollapsed:i=false,initialTableCollapsed:c=false})=>{let d=Qt.useRef(0),l=Qt.useMemo(()=>new Set(e.map(K=>K.id)),[e]),s=Qt.useMemo(()=>new Map(e.map(K=>[K.id,K])),[e]),[g,f]=Qt.useState(()=>no(t?.rows,l)),[p,b]=Qt.useState(()=>no(t?.columns,l)),[y,u]=Qt.useState(()=>no(t?.filters,l)),[C,m]=Qt.useState(()=>{let K=t?.values??[],Ee=new Set,ge=[];return K.forEach(ke=>{!l.has(ke.fieldId)||Ee.has(ke.fieldId)||(Ee.add(ke.fieldId),d.current+=1,ge.push({tokenId:`v${d.current}`,fieldId:ke.fieldId,aggregation:Po(ke.aggregation,s.get(ke.fieldId))}));}),ge}),[h,x]=Qt.useState(o),[w,E]=Qt.useState(r),[R,T]=Qt.useState(a),[I,k]=Qt.useState(()=>Bg(no(t?.rows,l),no(t?.columns,l),n?.dimensionFieldId)),[S,D]=Qt.useState(()=>{let K=(()=>{let Ee=t?.values??[],ge=new Set,ke=[];return Ee.forEach(rt=>{!l.has(rt.fieldId)||ge.has(rt.fieldId)||(ge.add(rt.fieldId),ke.push({tokenId:rt.fieldId,fieldId:rt.fieldId,aggregation:Po(rt.aggregation,s.get(rt.fieldId))}));}),ke})();return Ed(K,n?.primaryValueFieldId)}),[P,M]=Qt.useState(()=>{let K=(()=>{let ge=t?.values??[],ke=new Set,rt=[];return ge.forEach(Ue=>{!l.has(Ue.fieldId)||ke.has(Ue.fieldId)||(ke.add(Ue.fieldId),rt.push({tokenId:Ue.fieldId,fieldId:Ue.fieldId,aggregation:Po(Ue.aggregation,s.get(Ue.fieldId))}));}),rt})(),Ee=Ed(K,n?.primaryValueFieldId);return Eg(K,Ee,n?.secondaryValueFieldId)}),[B,X]=Qt.useState(n?.chartType??"bar-vertical"),[L,Z]=Qt.useState(i),[$,q]=Qt.useState(c);Qt.useEffect(()=>{f(K=>{let Ee=K.filter(ge=>l.has(ge));return Xr(K,Ee)?K:Ee}),b(K=>{let Ee=K.filter(ge=>l.has(ge));return Xr(K,Ee)?K:Ee}),u(K=>{let Ee=K.filter(ge=>l.has(ge));return Xr(K,Ee)?K:Ee}),m(K=>{let Ee=K.filter(ge=>l.has(ge.fieldId)).map(ge=>({...ge,aggregation:Po(ge.aggregation,s.get(ge.fieldId))}));return ms(K,Ee)?K:Ee});},[s,l]),Qt.useEffect(()=>{k(K=>Bg(g,p,K));},[p,g]),Qt.useEffect(()=>{D(K=>Ed(C,K));},[C]),Qt.useEffect(()=>{M(K=>Eg(C,S,K));},[S,C]);let H=Qt.useCallback(K=>{f(no(K,l));},[l]),re=Qt.useCallback(K=>{b(no(K,l));},[l]),de=Qt.useCallback(K=>{u(no(K,l));},[l]),Ce=Qt.useCallback(K=>{m(Ee=>{let ge=K??[],ke=new Set,rt=[];return ge.forEach(Ue=>{if(!l.has(Ue.fieldId)||ke.has(Ue.fieldId))return;ke.add(Ue.fieldId);let ae=Ee.find(fe=>fe.fieldId===Ue.fieldId);if(ae){rt.push({...ae,aggregation:Po(Ue.aggregation??ae.aggregation,s.get(Ue.fieldId))});return}d.current+=1,rt.push({tokenId:`v${d.current}`,fieldId:Ue.fieldId,aggregation:Po(Ue.aggregation,s.get(Ue.fieldId))});}),rt});},[s,l]),ve=Qt.useCallback(K=>{H(K.rows??[]),re(K.columns??[]),de(K.filters??[]),Ce(K.values??[]);},[re,de,H,Ce]),le=Qt.useCallback(K=>{if(K==="rows")return f([]);if(K==="columns")return b([]);if(K==="filters")return u([]);m([]);},[]),oe=Qt.useCallback((K,Ee)=>{if(K==="rows")return f(ge=>ge.filter(ke=>ke!==Ee));if(K==="columns")return b(ge=>ge.filter(ke=>ke!==Ee));if(K==="filters")return u(ge=>ge.filter(ke=>ke!==Ee));m(ge=>ge.filter(ke=>ke.tokenId!==Ee));},[]),Ie=Qt.useCallback((K,Ee)=>{m(ge=>ge.map(ke=>ke.tokenId===K?{...ke,aggregation:Po(Ee,s.get(ke.fieldId))}:ke));},[s]),Ze=Qt.useCallback((K,Ee)=>{x(ge=>({...ge,[K]:Ee}));},[]),Ge=Qt.useCallback(()=>{x({});},[]),ce=Qt.useCallback(()=>{E(K=>!K);},[]),Ve=Qt.useCallback(()=>{T(K=>!K);},[]),et=Qt.useCallback(K=>{k(K);},[]),ye=Qt.useCallback(K=>{D(K);},[]),We=Qt.useCallback(K=>{M(K);},[]),qe=Qt.useCallback(()=>{Z(K=>!K);},[]),st=Qt.useCallback(()=>{q(K=>!K);},[]);return {model:Qt.useMemo(()=>({rowFields:g,setRowFields:f,columnFields:p,setColumnFields:b,filterFields:y,setFilterFields:u,valueFields:C,setValueFields:m,filterSelections:h,setFilterSelections:x,showGrandTotal:w,setShowGrandTotal:E,isConfiguratorCollapsed:R,setIsConfiguratorCollapsed:T,chartDimensionFieldId:I,setChartDimensionFieldId:k,chartPrimaryValueFieldId:S,setChartPrimaryValueFieldId:D,chartSecondaryValueFieldId:P,setChartSecondaryValueFieldId:M,chartType:B,setChartType:X,isChartCollapsed:L,setIsChartCollapsed:Z,isTableCollapsed:$,setIsTableCollapsed:q}),[I,S,P,B,p,y,h,L,R,$,g,w,C]),actions:{setRows:H,setColumns:re,setFilters:de,setValues:Ce,setLayout:ve,clearZone:le,removeFieldFromZone:oe,setAggregationForValue:Ie,setFilterSelection:Ze,resetFilterSelections:Ge,toggleGrandTotal:ce,toggleConfigurator:Ve,setChartDimension:et,setChartPrimaryValue:ye,setChartSecondaryValue:We,setChartType:X,toggleChart:qe,toggleTable:st}}};var _L=({orientation:e="auto",defaultNavigationOpen:t,onNavOpenChange:o}={})=>{let r=styles.useTheme(),a=material.useMediaQuery("(orientation: portrait)",{noSsr:true}),n=material.useMediaQuery(r.breakpoints.down("md"),{noSsr:true}),i=Qt.useMemo(()=>e==="auto"?a||n?"portrait":"landscape":e,[n,a,e]),[c,d]=Qt.useState(t??i==="landscape");Qt.useEffect(()=>{d(t??i==="landscape");},[t,i]);let l=g=>{d(g),o?.(g);};return {resolvedOrientation:i,isPortraitViewport:a,isCompactViewport:n,navigationOpen:c,setNavigationOpen:l,toggleNavigationOpen:()=>l(!c)}};var Ck=e=>{let t=Number(e||0);return Number.isFinite(t)?t:0},jL=({rows:e,rowKey:t="id",numericField:o,defaultSelectedId:r})=>{let n=e[0]?.[t],[i,c]=Qt.useState(r??n),d=Qt.useMemo(()=>e.find(p=>p[t]===i)||e[0],[t,e,i]),[l,s]=Qt.useState(()=>{let p=d?.[o];return p==null?"0":String(p)});return {selectedId:i,selectedRecord:d,editorValue:l,setEditorValue:s,selectRecord:p=>{let b=p[t];c(b);let y=p[o];s(y==null?"0":String(y));},applyEditorValue:p=>{if(i===void 0)return;let b=Ck(l),y=e.map(u=>u[t]===i?{...u,[o]:b}:u);p(y);}}};var Bk=["code_128","ean_13","ean_8","qr_code","upc_a","upc_e"],Vg=(e,t,o,r)=>{t?.(e),r&&o?.();},eN=({open:e,onClose:t,title:o="Scan barcode",subtitle:r="Use the rear camera on the device. If scanning is unavailable, enter the code manually.",formats:a=Bk,facingMode:n="environment",manualEntry:i=true,autoCloseOnDetect:c=true,scanIntervalMs:d=600,confirmLabel:l="Use code",cancelLabel:s="Close",manualPlaceholder:g="Enter barcode manually",onDetected:f,onError:p,sx:b})=>{let y=Qt__namespace.default.useRef(null),u=Qt__namespace.default.useRef(null),C=Qt__namespace.default.useRef(null),m=Qt__namespace.default.useRef(null),[h,x]=Qt__namespace.default.useState("idle"),[w,E]=Qt__namespace.default.useState(""),[R,T]=Qt__namespace.default.useState(null),[I,k]=Qt__namespace.default.useState(null),S=Qt__namespace.default.useCallback(()=>{C.current!==null&&(window.clearInterval(C.current),C.current=null),u.current&&(u.current.getTracks().forEach(M=>M.stop()),u.current=null),y.current&&(y.current.srcObject=null);},[]),D=Qt__namespace.default.useCallback(M=>{k(M),x("error"),p?.(M);},[p]);Qt__namespace.default.useEffect(()=>{if(!e){S(),x("idle"),k(null),E("");return}let M=false;return (async()=>{if(!(typeof window>"u"||typeof navigator>"u")){if(!navigator.mediaDevices?.getUserMedia){x("unsupported"),k("Camera access is not supported in this browser.");return}x("starting"),k(null);try{let X=await navigator.mediaDevices.getUserMedia({audio:!1,video:{facingMode:{ideal:n}}});if(M){X.getTracks().forEach(L=>L.stop());return}if(u.current=X,y.current&&(y.current.srcObject=X,await y.current.play()),!window.BarcodeDetector){x("unsupported"),k("BarcodeDetector is not available. Camera preview is ready and manual entry is enabled.");return}m.current=new window.BarcodeDetector({formats:a}),x("ready"),C.current=window.setInterval(async()=>{if(!(!y.current||!m.current)&&!(y.current.readyState<HTMLMediaElement.HAVE_CURRENT_DATA))try{let Z=(await m.current.detect(y.current)).find(q=>q.rawValue);if(!Z?.rawValue)return;let $={rawValue:Z.rawValue,format:Z.format};T($),S(),Vg($,f,t,c);}catch(L){D(L instanceof Error?L.message:"Failed to detect barcode.");}},d);}catch(X){D(X instanceof Error?X.message:"Unable to start camera.");}}})(),()=>{M=true,S();}},[c,n,a,t,f,e,D,d,S]);let P=()=>{let M=w.trim();if(!M)return;let B={rawValue:M,format:"manual"};T(B),Vg(B,f,t,c);};return jsxRuntime.jsxs(material.Dialog,{open:e,onClose:t,fullWidth:true,maxWidth:"sm",children:[jsxRuntime.jsx(material.DialogTitle,{sx:{fontSize:"1rem",fontWeight:900},children:o}),jsxRuntime.jsx(material.DialogContent,{sx:{pt:"8px !important"},children:jsxRuntime.jsxs(material.Stack,{spacing:2,sx:b,children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.88rem",color:"text.secondary",lineHeight:1.55},children:r}),jsxRuntime.jsxs(material.Paper,{elevation:0,sx:M=>({position:"relative",overflow:"hidden",borderRadius:4,border:"1px solid",borderColor:"divider",minHeight:280,background:M.palette.mode==="dark"?"linear-gradient(180deg, rgba(15,23,42,0.92), rgba(2,6,23,0.96))":"linear-gradient(180deg, rgba(241,245,249,1), rgba(226,232,240,0.92))"}),children:[jsxRuntime.jsx("video",{ref:y,muted:true,playsInline:true,autoPlay:true,style:{width:"100%",height:280,objectFit:"cover",display:"block"}}),jsxRuntime.jsx(material.Box,{sx:{pointerEvents:"none",position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center"},children:jsxRuntime.jsx(material.Box,{sx:{width:"72%",maxWidth:320,aspectRatio:"1.7 / 1",borderRadius:3,border:"2px solid rgba(255,255,255,0.95)",boxShadow:"0 0 0 999px rgba(15,23,42,0.24)",position:"relative"},children:jsxRuntime.jsx(material.Box,{sx:{position:"absolute",top:"50%",left:0,right:0,height:2,bgcolor:"#38bdf8",boxShadow:"0 0 18px rgba(56,189,248,0.85)"}})})}),jsxRuntime.jsxs(material.Box,{sx:{position:"absolute",top:12,left:12,display:"flex",gap:1,flexWrap:"wrap"},children:[jsxRuntime.jsx(material.Chip,{icon:jsxRuntime.jsx(Dk__default.default,{}),label:h==="ready"?"Camera ready":h==="starting"?"Starting camera":h==="unsupported"?"Preview only":h==="error"?"Scanner error":"Idle",size:"small",color:h==="error"?"error":"primary",variant:"filled"}),R?jsxRuntime.jsx(material.Chip,{icon:jsxRuntime.jsx(Ak__default.default,{}),label:`${R.format||"barcode"}: ${R.rawValue}`,size:"small",color:"success",variant:"filled"}):null]})]}),I?jsxRuntime.jsx(material.Alert,{severity:h==="unsupported"?"info":"warning",children:I}):null,i?jsxRuntime.jsxs(material.Stack,{direction:{xs:"column",sm:"row"},spacing:1.25,children:[jsxRuntime.jsx(material.TextField,{fullWidth:true,label:"Barcode",placeholder:g,value:w,onChange:M=>E(M.target.value)}),jsxRuntime.jsx(material.Button,{variant:"contained",onClick:P,sx:{minHeight:56,px:2.5},children:l})]}):null]})}),jsxRuntime.jsx(material.DialogActions,{sx:{px:3,pb:2},children:jsxRuntime.jsx(material.Button,{onClick:t,children:s})})]})};var Nk={default:"#475569",primary:"#1d4ed8",success:"#047857",warning:"#b45309",error:"#b91c1c",info:"#0369a1"},iN=({title:e,description:t,kicker:o,icon:r,badges:a=[],metrics:n=[],footer:i,children:c,selected:d=false,draggable:l=false,isDragging:s=false,swipeThreshold:g=88,startAction:f,endAction:p,dragHandleProps:b,onClick:y,onSwipe:u,sx:C})=>{let[m,h]=Qt.useState(0),[x,w]=Qt.useState(false),E=Qt.useRef(null),R=Qt.useRef(0),T=Qt.useRef(0),I=!!(f||p),k=132,S=()=>{h(0),w(false),E.current=null,R.current=0,T.current=0;},D=L=>{(L==="start"?f:p)?.onTrigger?.(),u?.(L),S();},P=L=>{!I||L.target.closest('button, a, input, textarea, [data-no-swipe="true"]')||(E.current=L.pointerId,R.current=L.clientX,T.current=L.clientX,w(true),L.currentTarget.setPointerCapture(L.pointerId));},M=L=>{if(!x||E.current!==L.pointerId)return;T.current=L.clientX;let Z=T.current-R.current,$=Math.max(-k,Math.min(k,Z));h($);},B=L=>{if(!x||E.current!==L.pointerId)return;let Z=T.current-R.current;if(Z>=g&&f){D("start");return}if(Z<=-g&&p){D("end");return}Math.abs(Z)<12&&y?.(),S();},X=(L,Z)=>{if(!L)return null;let $=L.backgroundColor||Nk[L.tone||"default"];return jsxRuntime.jsx(material.Box,{sx:{position:"absolute",top:0,bottom:0,[Z]:0,width:k,px:2,display:"flex",alignItems:"center",justifyContent:Z==="left"?"flex-start":"flex-end",color:"#fff",background:`linear-gradient(135deg, ${$}, rgba(15,23,42,0.92))`},children:jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,alignItems:"center",children:[L.icon,jsxRuntime.jsx(material.Typography,{sx:{fontWeight:700,fontSize:"0.95rem"},children:L.label})]})})};return jsxRuntime.jsxs(material.Box,{sx:{position:"relative",overflow:"hidden",borderRadius:4,...C},children:[X(f,"left"),X(p,"right"),jsxRuntime.jsx(material.Paper,{elevation:0,onPointerDown:P,onPointerMove:M,onPointerUp:B,onPointerCancel:S,sx:L=>({position:"relative",zIndex:1,p:2,borderRadius:4,border:"1px solid",borderColor:d?"primary.main":"divider",background:L.palette.mode==="dark"?"linear-gradient(180deg, rgba(30,41,59,0.96), rgba(15,23,42,0.92))":"linear-gradient(180deg, #ffffff, #f8fafc)",color:"text.primary",boxShadow:d?"0 18px 42px rgba(37, 99, 235, 0.18)":"0 12px 28px rgba(15, 23, 42, 0.08)",transform:`translate3d(${m}px, 0, 0) scale(${s?.985:1})`,transition:x?"none":"transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease",touchAction:"pan-y",cursor:y?"pointer":"default",opacity:s?.9:1}),children:jsxRuntime.jsxs(material.Stack,{spacing:1.5,children:[jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1.5,alignItems:"flex-start",children:[r?jsxRuntime.jsx(material.Box,{sx:{mt:.25},children:r}):null,jsxRuntime.jsxs(material.Box,{sx:{flex:1,minWidth:0},children:[o?jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",fontWeight:700,letterSpacing:"0.08em",color:"text.secondary"},children:o}):null,jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1.05rem",fontWeight:800,lineHeight:1.25},children:e}),t?jsxRuntime.jsx(material.Typography,{sx:{mt:.5,fontSize:"0.9rem",color:"text.secondary",lineHeight:1.45},children:t}):null]}),l?jsxRuntime.jsx(material.Box,{"data-no-swipe":"true",...b,sx:{alignSelf:"center",display:"inline-flex",touchAction:"none"},children:jsxRuntime.jsx(material.IconButton,{size:"small",children:jsxRuntime.jsx(Lk__default.default,{})})}):null]}),a.length>0?jsxRuntime.jsx(material.Stack,{direction:"row",spacing:1,useFlexGap:true,flexWrap:"wrap",children:a.map((L,Z)=>jsxRuntime.jsx(material.Chip,{label:L,size:"small",sx:{borderRadius:999,fontWeight:700,bgcolor:"action.hover",color:"text.primary"}},Z))}):null,n.length>0?jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(110px, 1fr))",gap:1},children:n.map(L=>jsxRuntime.jsxs(material.Paper,{elevation:0,sx:{p:1.25,borderRadius:3,bgcolor:"action.hover",border:"1px solid",borderColor:"divider",color:"text.primary"},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:L.label}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1rem",fontWeight:800,lineHeight:1.2},children:L.value})]},L.id))}):null,c,i]})})]})};var Zi=({label:e,onPress:t,emphasis:o="default"})=>jsxRuntime.jsx(material.Box,{component:"button",type:"button",onClick:t,sx:r=>({minHeight:72,borderRadius:3,border:"1px solid",borderColor:o==="primary"?"primary.main":"divider",background:o==="primary"?r.palette.primary.main:o==="danger"?r.palette.mode==="dark"?"rgba(239,68,68,0.18)":"rgba(239,68,68,0.10)":r.palette.mode==="dark"?"rgba(255,255,255,0.04)":"#fff",color:o==="primary"?"#fff":"text.primary",fontSize:"1.25rem",fontWeight:800,transition:"transform 120ms ease, box-shadow 160ms ease, background-color 160ms ease",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent","&:active":{transform:"scale(0.98)"}}),children:e}),fN=({value:e,defaultValue:t="",title:o,subtitle:r,placeholder:a="0",allowDecimal:n=false,allowNegative:i=false,maxLength:c,confirmLabel:d,clearLabel:l,backspaceLabel:s,onChange:g,onSubmit:f,onClose:p,sx:b})=>{let{t:y}=ne(),[u,C]=Qt.useState(t),m=e??u,h=S=>{e===void 0&&C(S),g?.(S);},x=S=>{c&&m.length>=c||h(`${m}${S}`);},w=S=>{if(S==="00"){if(!m){h("0");return}x("00");return}x(S);},E=()=>{!n||m.includes(".")||h(m?`${m}.`:"0.");},R=()=>{if(i){if(m.startsWith("-")){h(m.slice(1));return}h(m?`-${m}`:"-");}},T=()=>{h(m.slice(0,-1));},I=()=>{h("");},k=()=>{f?.(m);};return jsxRuntime.jsx(material.Paper,{elevation:0,sx:{p:2,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",...b},children:jsxRuntime.jsxs(material.Stack,{spacing:2,children:[jsxRuntime.jsxs(material.Stack,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[o?jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1rem",fontWeight:800},children:o}):null,r?jsxRuntime.jsx(material.Typography,{sx:{mt:.5,fontSize:"0.86rem",color:"text.secondary"},children:r}):null]}),p?jsxRuntime.jsx(material.IconButton,{onClick:p,size:"small",children:jsxRuntime.jsx(Wk__default.default,{})}):null]}),jsxRuntime.jsx(material.Paper,{elevation:0,sx:{p:2,borderRadius:3,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:jsxRuntime.jsx(material.Typography,{sx:{minHeight:38,fontSize:m?"1.9rem":"1.25rem",fontWeight:900,letterSpacing:"0.06em",color:m?"text.primary":"text.disabled"},children:m||a})}),jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:"repeat(3, minmax(0, 1fr))",gap:1.25},children:[["1","2","3","4","5","6","7","8","9"].map(S=>jsxRuntime.jsx(Zi,{label:S,onPress:()=>w(S)},S)),jsxRuntime.jsx(Zi,{label:i?"+/-":"00",onPress:i?R:()=>w("00")}),jsxRuntime.jsx(Zi,{label:"0",onPress:()=>w("0")}),jsxRuntime.jsx(Zi,{label:n?".":s?String(s):"DEL",onPress:n?E:T})]}),jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:"repeat(3, minmax(0, 1fr))",gap:1.25},children:[jsxRuntime.jsx(material.Box,{component:"button",type:"button",onClick:T,sx:{minHeight:64,borderRadius:3,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent"},children:jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,justifyContent:"center",alignItems:"center",children:[jsxRuntime.jsx(Vk__default.default,{}),jsxRuntime.jsx(material.Typography,{sx:{fontWeight:700},children:s||"DEL"})]})}),jsxRuntime.jsx(Zi,{label:String(l||"CLR"),onPress:I,emphasis:"danger"}),jsxRuntime.jsx(material.Box,{component:"button",type:"button",onClick:k,sx:S=>({minHeight:64,borderRadius:3,border:"1px solid",borderColor:"primary.main",background:S.palette.primary.main,color:"#fff",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent"}),children:jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,justifyContent:"center",alignItems:"center",children:[jsxRuntime.jsx(Hk__default.default,{}),jsxRuntime.jsx(material.Typography,{sx:{fontWeight:800},children:d||y("common.ok")})]})})]})]})})};var Ug=({touchMode:e="comfortable",sx:t,...o})=>{let r=e==="expanded";return jsxRuntime.jsx(material.Box,{sx:{"& .MuiPaper-root":{borderRadius:4},"& .MuiAutocomplete-root":{minWidth:{xs:"100%",md:260}},"& .MuiAutocomplete-root .MuiInputBase-root":{backgroundColor:"transparent !important"},"& .MuiInputBase-root":{minHeight:r?56:50,borderRadius:3,fontSize:r?"0.98rem":"0.92rem"},"& .MuiInputBase-input":{py:r?1.6:1.25,fontSize:r?"0.98rem":"0.92rem"},"& .MuiInputLabel-root":{fontSize:r?"0.95rem":"0.88rem"},"& .MuiButton-root":{minHeight:r?48:44,px:r?2.25:1.75,borderRadius:3,fontSize:r?"0.95rem":"0.88rem",fontWeight:700},"& .MuiIconButton-root":{width:r?40:36,height:r?40:36},"& .MuiMenuItem-root":{minHeight:r?44:38,fontSize:r?"0.95rem":"0.88rem"},"& .MuiListSubheader-root":{py:1},"& .MuiCheckbox-root":{p:r?1:.75},"& .MuiFormControlLabel-label":{fontSize:r?"0.95rem":"0.88rem"},"& .MuiDialog-paper":{borderRadius:4},"& .MuiDialogTitle-root":{fontSize:r?"1.05rem":"0.98rem",fontWeight:800},"& .MuiDialogContent-root .MuiInputBase-root":{minHeight:52},'& .MuiGrid-root > .MuiGrid-item, & .MuiGrid-root > .MuiGrid-sizeXs-1, & .MuiGrid-root > [class*="MuiGrid-grid-"]':{minWidth:0},...t},children:jsxRuntime.jsx($r,{...o})})};var jk=(e,t,o)=>{if(o?.(t),!!t.href){if(t.href.startsWith("http://")||t.href.startsWith("https://")){window.open(t.href,"_blank");return}e.push(t.href);}},qg=({items:e,selectedId:t,orientation:o="auto",onItemSelect:r,sx:a})=>{let n=styles.useTheme(),[i,c]=Qt.useState(false);Qt.useEffect(()=>{c(true);},[]);let d=material.useMediaQuery("(orientation: portrait)",{noSsr:true}),l=material.useMediaQuery(n.breakpoints.down("md"),{noSsr:true}),s=o==="auto"?d||l?"portrait":"landscape":o,g=navigation.useRouter();return jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:!i||s==="portrait"?"repeat(2, minmax(0, 1fr))":"repeat(auto-fit, minmax(180px, 1fr))",gap:1.5,...a},children:e.map(f=>{let p=f.id===t,b=f.color||(p?n.palette.primary.main:n.palette.divider);return jsxRuntime.jsx(material.Paper,{elevation:0,sx:{overflow:"hidden",borderRadius:4,border:"1px solid",borderColor:p?"primary.main":"divider",boxShadow:p?"0 18px 40px rgba(37, 99, 235, 0.16)":"none",bgcolor:n.palette.mode==="dark"?"rgba(30,41,59,0.6)":"background.paper"},children:jsxRuntime.jsx(material.Box,{component:"button",type:"button",disabled:f.disabled,onClick:()=>jk(g,f,r),sx:{width:"100%",p:2,minHeight:s==="portrait"?156:148,display:"block",border:0,background:"transparent",textAlign:"left",cursor:f.disabled?"not-allowed":"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent",color:"text.primary"},children:jsxRuntime.jsxs(material.Stack,{spacing:1.5,sx:{height:"100%"},children:[jsxRuntime.jsxs(material.Stack,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[jsxRuntime.jsx(material.Box,{sx:{width:44,height:44,borderRadius:3,display:"grid",placeItems:"center",color:p?"#fff":"text.primary",background:p?b:"action.hover"},children:f.icon||jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1rem",fontWeight:900},children:f.title.slice(0,1).toUpperCase()})}),f.badge!==void 0?jsxRuntime.jsx(material.Box,{sx:{minWidth:34,px:1,py:.4,borderRadius:999,bgcolor:p?"primary.main":"action.hover",color:p?"#fff":"text.secondary",textAlign:"center",fontWeight:800,fontSize:"0.8rem"},children:f.badge}):null]}),jsxRuntime.jsxs(material.Box,{sx:{flex:1,minWidth:0},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1rem",fontWeight:800,lineHeight:1.25},children:f.title}),f.caption?jsxRuntime.jsx(material.Typography,{sx:{mt:.5,fontSize:"0.74rem",fontWeight:700,color:"text.secondary"},children:f.caption}):null,f.description?jsxRuntime.jsx(material.Typography,{sx:{mt:.75,fontSize:"0.84rem",lineHeight:1.45,color:"text.secondary"},children:f.description}):null]})]})})},f.id)})})};var Yg=(e,t)=>t.trim()?e.reduce((o,r)=>{let a=r.title?.toLowerCase().includes(t.toLowerCase())||r.label?.toLowerCase().includes(t.toLowerCase())||r.description?.toLowerCase().includes(t.toLowerCase()),n=r.children?Yg(r.children,t):[];return (a||n.length>0)&&o.push({...r,children:n.length>0?n:r.children}),o},[]):e,lw=e=>{let t=new Set,o=r=>{r.forEach(a=>{a.children?.length&&(t.add(a.id),o(a.children));});};return o(e),t},Qg=({collapsed:e=false,onToggle:t,className:o="",maxHeight:r,menuData:a=[],colorMode:n="light",orientation:i="auto",headerSlot:c,footerSlot:d,activeHref:l,onItemSelect:s})=>{let{t:g}=ne(),f=styles.useTheme(),p=material.useMediaQuery("(orientation: portrait)"),b=material.useMediaQuery(f.breakpoints.down("md")),y=i==="auto"?p||b?"portrait":"landscape":i,u=n==="dark",C=navigation.useRouter(),m=navigation.usePathname(),[h,x]=Qt.useState(""),[w,E]=Qt.useState(new Set),R=Qt.useMemo(()=>Yg(a,h),[a,h]),T=Qt.useMemo(()=>h.trim()?lw(R):w,[w,R,h]);Qt.useEffect(()=>{e&&E(new Set);},[e]);let I=M=>M.appurl||M.href||"",k=M=>{s?.(M);let B=I(M);if(B){if(B.startsWith("http://")||B.startsWith("https://")){window.open(B,"_blank");return}C.push(B);}},S=M=>{let B=!!M.children?.length;if(e&&B){t?.();return}if(B){E(X=>{let L=new Set(X);return L.has(M.id)?L.delete(M.id):L.add(M.id),L});return}k(M);},D=M=>{let B=l||m,X=I(M);return !!(X&&B===X)},P=(M,B=0)=>{let X=!!M.children?.length,L=T.has(M.id),Z=D(M);return jsxRuntime.jsx(material.Box,{sx:{pl:B===0?0:1.5},children:jsxRuntime.jsxs(material.Paper,{elevation:0,sx:{mb:1,overflow:"hidden",borderRadius:3,border:"1px solid",borderColor:Z?"primary.main":"divider",bgcolor:Z?"action.selected":"background.paper"},children:[jsxRuntime.jsxs(material.Box,{component:"button",type:"button",onClick:()=>S(M),sx:{width:"100%",px:1.5,py:1.4,display:"flex",alignItems:"center",gap:1.25,border:0,background:"transparent",textAlign:"left",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent"},children:[jsxRuntime.jsx(material.Avatar,{variant:"rounded",sx:{width:40,height:40,bgcolor:Z?"primary.main":"action.hover",color:Z?"#fff":"text.primary"},children:M.icon||(M.title||M.label||"?").slice(0,1).toUpperCase()}),jsxRuntime.jsxs(material.Box,{sx:{flex:1,minWidth:0},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.95rem",fontWeight:800,lineHeight:1.2},children:M.title||M.label}),M.description?jsxRuntime.jsx(material.Typography,{sx:{mt:.4,fontSize:"0.78rem",color:"text.secondary",lineHeight:1.35},children:M.description}):null]}),X?jsxRuntime.jsx(nw__default.default,{sx:{transform:L?"rotate(180deg)":"rotate(0deg)",transition:"transform 180ms ease"}}):jsxRuntime.jsx(iw__default.default,{color:"action"})]}),X?jsxRuntime.jsx(material.Collapse,{in:L,children:jsxRuntime.jsx(material.Box,{sx:{px:1.25,pb:1.25},children:M.children?.map($=>P($,B+1))})}):null]})},M.id)};return e?jsxRuntime.jsx(material.Paper,{elevation:0,className:o,sx:{width:y==="portrait"?"100%":88,p:1,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:u?"#101828":"rgba(255,255,255,0.88)",maxHeight:r?`${r}px`:void 0,overflowY:"auto"},children:jsxRuntime.jsxs(material.Stack,{spacing:1,children:[jsxRuntime.jsx(material.IconButton,{onClick:t,sx:{width:48,height:48,alignSelf:"center",bgcolor:"action.hover"},title:g("navigation.expand"),children:jsxRuntime.jsx(aw__default.default,{})}),a.map(M=>jsxRuntime.jsx(material.IconButton,{onClick:()=>S(M),sx:{width:56,height:56,alignSelf:"center",borderRadius:3,bgcolor:D(M)?"primary.main":"action.hover",color:D(M)?"#fff":"text.primary"},children:M.icon||(M.title||M.label||"?").slice(0,1).toUpperCase()},M.id))]})}):jsxRuntime.jsx(material.Paper,{elevation:0,className:o,sx:{width:y==="portrait"?"100%":320,p:1.25,borderRadius:5,border:"1px solid",borderColor:"divider",bgcolor:u?"#101828":"rgba(255,255,255,0.88)",maxHeight:r?`${r}px`:void 0,overflow:"hidden",display:"flex",flexDirection:"column"},children:jsxRuntime.jsxs(material.Stack,{spacing:1.25,sx:{flex:1,minHeight:0},children:[jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,alignItems:"center",children:[jsxRuntime.jsx(material.TextField,{value:h,onChange:M=>x(M.target.value),placeholder:g("navigation.searchPlaceholder"),size:"small",fullWidth:true,InputProps:{startAdornment:jsxRuntime.jsx(ow__default.default,{fontSize:"small",color:"action"})}}),y==="landscape"&&!e?jsxRuntime.jsx(material.IconButton,{onClick:t,sx:{bgcolor:"action.hover"},children:jsxRuntime.jsx(rw__default.default,{})}):null]}),c,jsxRuntime.jsx(material.Box,{sx:{flex:1,minHeight:0,overflowY:"auto",pr:.25},children:R.length>0?R.map(M=>P(M)):jsxRuntime.jsx(material.Typography,{sx:{p:2,fontSize:"0.88rem",color:"text.secondary",textAlign:"center"},children:g("navigation.noMatch")})}),d]})})};var lf=(e,t)=>{let o=t[e.id];if(e.render)return e.render(o,t);if(o==null||o==="")return "--";if(e.numeric){if(typeof o=="number")return o.toLocaleString();if(typeof o=="string"&&o.trim()!==""&&!Number.isNaN(Number(o)))return Number(o).toLocaleString()}return String(o)},mw=e=>Qt__namespace.default.isValidElement(e)?jsxRuntime.jsx(material.Box,{sx:{display:"inline-flex",alignItems:"center"},children:e}):jsxRuntime.jsx(material.Typography,{sx:{mt:.2,fontSize:"0.88rem",fontWeight:800},children:e}),gw=(e,t)=>{let o=t[e.id];if(o==null||o==="")return "--";if(e.numeric){if(typeof o=="number")return o.toLocaleString();if(typeof o=="string"&&o.trim()!==""&&!Number.isNaN(Number(o)))return Number(o).toLocaleString()}return String(o)},fw=({summaryRow:e,visibleColumns:t,columns:o})=>{let r=o.filter(a=>t.includes(a.id)&&e[a.id]!=="");return r.length===0?null:jsxRuntime.jsx(material.Paper,{elevation:0,sx:{p:1.5,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:jsxRuntime.jsxs(material.Stack,{spacing:1,children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.82rem",fontWeight:800,color:"text.secondary"},children:"Summary"}),jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(132px, 1fr))",gap:1},children:r.map(a=>jsxRuntime.jsxs(material.Paper,{elevation:0,sx:{p:1.1,borderRadius:3,border:"1px solid",borderColor:"divider"},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:a.label}),jsxRuntime.jsx(material.Typography,{sx:{mt:.25,fontSize:"0.96rem",fontWeight:800},children:e[a.id]})]},`summary-${a.id}`))})]})})},hw=e=>{let{t}=ne(),o=styles.useTheme(),{title:r,showToolbar:a=true,selectionMode:n,selected:i=[],onSelectionChange:c,actions:d,extraTools:l,fitContainer:s=false,fullWidth:g=false,maxHeight:f,loading:p=false,rowsPerPageOptions:b=[20,50,100,-1],onLayoutSave:y,filterConfig:u,rowKey:C,tableKey:m="default",graphReport:h,quickCreate:x,quickEdit:w,quickDelete:E,serviceUrl:R,orientation:T="auto",cardTitleField:I,cardSubtitleFields:k,toolbarSlot:S,emptyState:D,rowHeight:P="comfortable",cardActionSlot:M,renderCardFooter:B,onRowClick:X}=e,L=r||t("table.title.default"),Z=material.useMediaQuery("(orientation: portrait)"),$=material.useMediaQuery(o.breakpoints.down("md")),q=T==="auto"?Z||$?"portrait":"landscape":T,{columns:H,filterText:re,setFilterText:de,visibleColumns:Ce,showSummary:ve,setShowSummary:le,summaryColumns:oe,grouping:Ie,setGrouping:Ze,expandedGroups:Ge,groupAnchorEl:ce,setGroupAnchorEl:Ve,summaryAnchorEl:et,setSummaryAnchorEl:ye,anchorEl:We,setAnchorEl:qe,contextMenu:st,sortedAndFilteredRows:Pe,summaryRow:K,visibleRows:Ee,page:ge,setPage:ke,rowsPerPage:rt,setRowsPerPage:Ue,totalDisplayCount:ae,setSelected:fe,handleClick:je,toggleSummaryColumn:It,handleExport:_,handleCloseContextMenu:ze,toggleColumnVisibility:xe,toggleGroupExpand:Y,toggleGroupField:N,handleExpandGroupRecursively:J,handleCollapseGroupRecursively:we,handleLayoutLoad:Me,handleVariantLoad:tt,handleLayoutSave:bt,effectiveAppId:dt,currentLayoutData:Vt,currentLayoutId:vt,layoutIdToLoad:ko,graphReportOpen:Ct,handleOpenGraphReport:sr,handleCloseGraphReport:lo}=Tn(e),Et=h?.enabled??false,Gt=Et&&(h?.interaction?.enabled??true),yt=Nl(),ao=C||"id",O=Qt__namespace.default.useMemo(()=>({borderRadius:999,fontWeight:700,borderColor:styles.alpha(o.palette.divider,o.palette.mode==="dark"?.55:.3),bgcolor:o.palette.mode==="dark"?styles.alpha(o.palette.common.white,.06):styles.alpha(o.palette.background.paper,.92),color:o.palette.text.primary,"& .MuiChip-label":{px:1.05}}),[o]),W=Qt__namespace.default.useMemo(()=>({...O,borderColor:styles.alpha(o.palette.primary.main,o.palette.mode==="dark"?.42:.24),bgcolor:o.palette.mode==="dark"?styles.alpha(o.palette.primary.main,.16):styles.alpha(o.palette.primary.main,.08)}),[O,o]),U=Qt__namespace.default.useMemo(()=>{let V=new Set(i);return Pe.filter(ue=>V.has(ue?.[ao]))},[ao,i,Pe]),me=U.length===1?U[0]:null,pe=!!x?.enabled,Fe=!!w?.enabled,Xe=!!E?.enabled,Ye=x?.fields,ot=x?.excludeFields||[],Dt=x?.initialValues||{},pt=w?.fields,mt=w?.excludeFields||[],St=w?.editableFields||[],Wt=w?.nonEditableFields||[],ct=w?.primaryKeys?.length?w.primaryKeys:[ao],[Ao,wo]=Qt__namespace.default.useState(false),[Yo,A]=Qt__namespace.default.useState(false),[j,ee]=Qt__namespace.default.useState({}),[se,Le]=Qt__namespace.default.useState(false),[_e,gt]=Qt__namespace.default.useState(false),[Re,ut]=Qt__namespace.default.useState({}),[nt,Pt]=Qt__namespace.default.useState(false),[ht,eo]=Qt__namespace.default.useState(false),so=p||Yo||_e||ht,To=Qt__namespace.default.useMemo(()=>{let V=[...H];if(Array.isArray(Ye)&&Ye.length>0){let ue=new Set(Ye);V=V.filter(te=>ue.has(te.id));}if(ot.length>0){let ue=new Set(ot);V=V.filter(te=>!ue.has(te.id));}return V.filter(ue=>!!ue?.id)},[H,ot,Ye]),Xt=Qt__namespace.default.useMemo(()=>{let V=[...H];if(Array.isArray(pt)&&pt.length>0){let ue=new Set(pt);V=V.filter(te=>ue.has(te.id));}if(mt.length>0){let ue=new Set(mt);V=V.filter(te=>!ue.has(te.id));}return V.filter(ue=>!!ue?.id)},[H,mt,pt]),xo=Qt__namespace.default.useMemo(()=>new Set(ct),[ct]),Rt=Qt__namespace.default.useMemo(()=>new Set(St),[St]),Ut=Qt__namespace.default.useMemo(()=>new Set(Wt),[Wt]),cr=Qt__namespace.default.useCallback(V=>Rt.size>0?Rt.has(V):!(Ut.has(V)||xo.has(V)),[Rt,Ut,xo]);Qt__namespace.default.useEffect(()=>{!Ct&&yt.hasActiveFilters&&yt.clearAll();},[yt,Ct]);let dr=()=>{let V={};To.forEach(ue=>{V[ue.id]=Dt[ue.id]??"";}),ee(V),wo(true);},rn=(V,ue)=>{ee(te=>({...te,[V]:ue}));},wa=async()=>{if(!x?.onSubmit){wo(false);return}try{A(!0),await x.onSubmit(j),wo(!1);}finally{A(false);}},an=()=>{if(!me)return;let V={};Xt.forEach(te=>{V[te.id]=me[te.id]??"";});let ue=w?.getInitialValues?{...V,...w.getInitialValues(me)}:V;ut(ue),Le(true);},Qo=(V,ue)=>{ut(te=>({...te,[V]:ue}));},nn=async()=>{if(me){if(!w?.onSubmit){Le(false);return}try{gt(!0),await w.onSubmit(Re,me),Le(!1);}finally{gt(false);}}},Ta=()=>{U.length!==0&&Pt(true);},Ia=async()=>{if(U.length===0){Pt(false);return}if(!E?.onConfirm){Pt(false),fe([]),c?.([]);return}try{eo(!0),await E.onConfirm(U),Pt(!1),fe([]),c?.([]);}finally{eo(false);}},Or=Pe,{fieldMapping:ra}=xn({rows:Or,config:{...h,title:h?.title||`${L} ${t("graph.reportTitle")}`}}),ni=Qt__namespace.default.useMemo(()=>Gt?yt.applyRows(Or,ra):Or,[ra,yt,Gt,Or]),{model:v}=xn({rows:ni,config:{...h,title:h?.title||`${L} ${t("graph.reportTitle")}`,fieldMapping:ra}}),F=v.table.columns.map(V=>({id:V.id,label:V.label,align:V.align||"left",minWidth:120,numeric:V.align==="right"})),z=dt?jsxRuntime.jsx(wn,{appId:dt,tableKey:m,currentLayoutData:Vt,onLayoutLoad:Me,targetLayoutId:ko,activeLayoutId:vt,serviceUrl:R??u?.serviceUrl}):null,Q=H.filter(V=>Ce.includes(V.id)),he=Q.find(V=>V.id===I)||Q[0],Ke=k?.map(V=>Q.find(ue=>ue.id===V)).filter(Boolean)||Q.filter(V=>V.id!==he?.id).slice(0,q==="portrait"?2:3),De=Q.filter(V=>V.id!==he?.id&&!Ke.some(ue=>ue.id===V.id)),He=[S,l].filter(Boolean),G=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(sn,{groupAnchorEl:ce,setGroupAnchorEl:Ve,grouping:Ie,setGrouping:Ze,columns:H,toggleGroupField:N}),jsxRuntime.jsx(cn,{anchorEl:We,setAnchorEl:qe,columns:H,visibleColumns:Ce,toggleColumnVisibility:xe}),jsxRuntime.jsx(bl,{anchorEl:et,setAnchorEl:ye,showSummary:ve,setShowSummary:le,columns:H,summaryColumns:oe,toggleSummaryColumn:It}),jsxRuntime.jsx(yl,{contextMenu:st,handleCloseContextMenu:ze,columns:H,visibleColumns:Ce,toggleColumnVisibility:xe})]}),Ne=(V,ue,te)=>{let Ae=i.includes(ue),kt=q==="portrait"?"repeat(2, minmax(0, 1fr))":"repeat(auto-fit, minmax(140px, 1fr))",wr=te%2===0?styles.alpha(o.palette.primary.main,o.palette.mode==="dark"?.09:.04):styles.alpha(o.palette.primary.main,o.palette.mode==="dark"?.05:.022),Sh=styles.alpha(o.palette.divider,.22);return jsxRuntime.jsx(material.Paper,{elevation:0,onClick:()=>{je({},V),X?.(V);},sx:{p:P==="compact"?1.25:1.5,borderRadius:4,border:"0.5px solid",borderColor:Ae?styles.alpha(o.palette.primary.main,.38):Sh,background:Ae?`linear-gradient(135deg, ${styles.alpha(o.palette.primary.main,.13)}, ${styles.alpha(o.palette.primary.main,.06)})`:`linear-gradient(135deg, ${wr}, ${styles.alpha(o.palette.primary.main,.015)})`,boxShadow:Ae?`0 12px 30px ${styles.alpha(o.palette.primary.main,.2)}`:`0 3px 10px ${styles.alpha(o.palette.common.black,.045)}`,cursor:"pointer",position:"relative",overflow:"hidden",transition:"border-color 160ms ease, box-shadow 160ms ease, transform 120ms ease, background 160ms ease","&::before":{content:'""',position:"absolute",left:0,top:0,bottom:0,width:4,background:Ae?o.palette.primary.main:te%2===0?styles.alpha(o.palette.primary.main,.26):styles.alpha(o.palette.text.primary,.16)},"&:hover":{boxShadow:`0 10px 20px ${styles.alpha(o.palette.primary.main,.12)}`,transform:"translateY(-1px)"},"&:active":{transform:"scale(0.995)"}},children:jsxRuntime.jsxs(material.Stack,{spacing:1.25,children:[jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1.25,alignItems:"flex-start",children:[n?jsxRuntime.jsx(material.Checkbox,{checked:Ae,onClick:Wo=>Wo.stopPropagation(),onChange:()=>je({},V),sx:{mt:-0.6,ml:-0.6}}):null,jsxRuntime.jsxs(material.Box,{sx:{flex:1,minWidth:0},children:[he?jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1rem",fontWeight:900,lineHeight:1.25},children:lf(he,V)}):null,Ke.length>0?jsxRuntime.jsx(material.Stack,{direction:"row",spacing:.75,useFlexGap:true,flexWrap:"wrap",sx:{mt:.75},children:Ke.map(Wo=>jsxRuntime.jsx(material.Chip,{label:`${Wo.label}: ${gw(Wo,V)}`,size:"small",variant:"outlined",sx:O},`${ue}-${Wo.id}`))}):null]}),M?jsxRuntime.jsx(material.Box,{onClick:Wo=>Wo.stopPropagation(),children:M(V)}):null]}),De.length>0?jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:kt,gap:1},children:De.map(Wo=>jsxRuntime.jsxs(material.Paper,{elevation:0,sx:{p:1,borderRadius:3,bgcolor:o.palette.mode==="dark"?styles.alpha(o.palette.background.default,.7):styles.alpha(o.palette.background.paper,.92),border:"0.1px solid",borderColor:styles.alpha(o.palette.divider,.24)},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:Wo.label}),mw(lf(Wo,V))]},`${ue}-${Wo.id}-detail`))}):null,B?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsx(material.Box,{onClick:Wo=>Wo.stopPropagation(),children:B(V)})]}):null]})},ue)};return jsxRuntime.jsxs(material.Box,{sx:{width:g?"100%":"auto",mb:s?0:2,...s?{flex:1,display:"flex",flexDirection:"column",minHeight:0,height:"100%",overflow:"hidden"}:{}},children:[u?jsxRuntime.jsx(material.Box,{sx:{mb:2},children:jsxRuntime.jsx(Ug,{...u,onVariantLoad:V=>{tt(V),u.onVariantLoad?.(V);},appId:u.appId,tableKey:m,currentLayout:[{tableKey:m,layoutData:Vt}],currentLayoutId:vt,layoutRefs:[{tableKey:m,layoutId:vt}],variantService:u.variantService,serviceUrl:R??u.serviceUrl,touchMode:q==="portrait"?"expanded":"comfortable"})}):null,jsxRuntime.jsxs(material.Paper,{sx:{width:g?"100%":"auto",mb:s?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative",bgcolor:"transparent",backgroundImage:"none",boxShadow:"none","&::before":so?{content:'""',position:"absolute",top:0,left:0,width:"100%",height:"3px",background:"linear-gradient(90deg, rgba(25, 118, 210, 0) 0%, rgba(25, 118, 210, 0.25) 25%, rgba(25, 118, 210, 1) 50%, rgba(25, 118, 210, 0.25) 75%, rgba(25, 118, 210, 0) 100%)",backgroundSize:"220% 100%",animation:"cTableTopMarquee 1.2s linear infinite",zIndex:6,pointerEvents:"none"}:{},"@keyframes cTableTopMarquee":{"0%":{backgroundPosition:"220% 0"},"100%":{backgroundPosition:"-120% 0"}},...f?{height:f}:s?{flex:1,minHeight:0,height:"100%"}:{}},children:[a?jsxRuntime.jsx(material.Box,{sx:{"& .MuiToolbar-root":{minHeight:60,alignItems:{xs:"flex-start",md:"center"},flexWrap:"wrap",rowGap:1,columnGap:1},"& .MuiToolbar-root > :nth-of-type(1)":{width:{xs:"100%",md:"auto"},"& .MuiTextField-root":{width:{xs:"100%",md:300}}},"& .MuiToolbar-root > :nth-of-type(2)":{flexShrink:0},"& .MuiToolbar-root > :nth-of-type(3)":{display:{xs:"none",md:"block"}},"& .MuiToolbar-root > :nth-of-type(4)":{ml:"auto",justifyContent:"flex-end",flexWrap:"wrap"},"& .MuiInputBase-root":{minHeight:46},"& .MuiIconButton-root":{width:40,height:40},"& .MuiTypography-root":{fontSize:"0.9rem"},"& .MuiButtonBase-root":{borderRadius:2.5}},children:jsxRuntime.jsx(ul,{filterText:re,setFilterText:de,onRowsPerPageChange:Ue,rowsPerPage:rt,rowsPerPageOptions:b,page:ge,count:ae,onPageChange:ke,actions:d,extraTools:He,grouping:Ie,setGroupAnchorEl:Ve,showSummary:ve,setShowSummary:le,setAnchorEl:qe,setSummaryAnchorEl:ye,handleExport:_,showCreateButton:pe,onOpenCreateDialog:dr,showEditButton:Fe,onOpenEditDialog:an,editDisabled:U.length!==1,showDeleteButton:Xe,onOpenDeleteConfirm:Ta,deleteDisabled:U.length===0,onLayoutSave:y||u?.variantService&&u?.appId?bt:void 0,loading:p,layoutManager:z,onOpenGraphReport:Et?sr:void 0})}):null,jsxRuntime.jsx(material.Box,{sx:{flex:1,minHeight:0,overflow:"auto",p:1.5},children:jsxRuntime.jsxs(material.Stack,{spacing:1.25,children:[Ee.length===0&&!p?D||jsxRuntime.jsx(material.Paper,{elevation:0,sx:{p:4,borderRadius:4,border:"1px dashed",borderColor:"divider",textAlign:"center"},children:jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.92rem",color:"text.secondary"},children:t("common.noData")})}):null,Ee.map((V,ue)=>{if(V.type==="group"){let kt=Ge.has(V.id);return jsxRuntime.jsx(material.Paper,{elevation:0,sx:{borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:jsxRuntime.jsxs(material.Box,{component:"button",type:"button",onClick:()=>Y(V.id),sx:{width:"100%",px:1.5,py:1.3,border:0,background:"transparent",display:"flex",alignItems:"center",gap:1,textAlign:"left",cursor:"pointer",appearance:"none",WebkitAppearance:"none",color:"text.primary"},children:[kt?jsxRuntime.jsx(nw__default.default,{}):jsxRuntime.jsx(iw__default.default,{}),jsxRuntime.jsxs(material.Box,{sx:{flex:1,minWidth:0},children:[jsxRuntime.jsxs(material.Typography,{sx:{fontSize:"0.94rem",fontWeight:800},children:[V.field,": ",V.value]}),jsxRuntime.jsxs(material.Typography,{sx:{mt:.2,fontSize:"0.76rem",color:"text.secondary"},children:[V.count," records"]})]}),Ie.length>1&&V.level<Ie.length-1?jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:.5,children:[jsxRuntime.jsx(material.Chip,{size:"small",label:t("table.group.expandAll"),onClick:wr=>{wr.stopPropagation(),J(V.id);},sx:W}),jsxRuntime.jsx(material.Chip,{size:"small",label:t("table.group.collapseAll"),onClick:wr=>{wr.stopPropagation(),we(V.id);},sx:W})]}):null]})},V.id)}let te=V.data||V,Ae=V.id||te[ao]||ue;return Ne(te,Ae,ue)}),ve?jsxRuntime.jsx(fw,{summaryRow:K,visibleColumns:Ce,columns:H}):null,p?jsxRuntime.jsx(material.Typography,{sx:{py:1,fontSize:"0.84rem",color:"text.secondary",textAlign:"center"},children:t("common.loading")}):null]})})]}),pe?jsxRuntime.jsxs(material.Dialog,{open:Ao,onClose:()=>!Yo&&wo(false),fullWidth:true,maxWidth:"sm",children:[jsxRuntime.jsx(material.DialogTitle,{sx:{fontSize:"1rem",fontWeight:800},children:x?.title||t("quickCreate.createWithTitle",{title:L})}),jsxRuntime.jsx(material.DialogContent,{sx:{pt:"8px !important"},children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[To.map(V=>{let ue=V.type==="number"||V.numeric?"number":V.type==="date"?"date":"text";return jsxRuntime.jsx(material.TextField,{label:V.label||V.id,value:j[V.id]??"",onChange:te=>rn(V.id,te.target.value),type:ue,fullWidth:true,InputLabelProps:{shrink:ue==="date"?true:void 0}},`quick-create-${V.id}`)}),x?.description?jsxRuntime.jsx(material.Alert,{severity:"info",children:x.description}):null]})}),jsxRuntime.jsxs(material.DialogActions,{sx:{px:3,pb:2},children:[jsxRuntime.jsx(material.Button,{onClick:()=>wo(false),disabled:Yo,children:x?.cancelLabel||t("common.cancel")}),jsxRuntime.jsx(material.Button,{onClick:wa,variant:"contained",disabled:Yo,children:x?.submitLabel||t("common.save")})]})]}):null,Fe?jsxRuntime.jsxs(material.Dialog,{open:se,onClose:()=>!_e&&Le(false),fullWidth:true,maxWidth:"sm",children:[jsxRuntime.jsx(material.DialogTitle,{sx:{fontSize:"1rem",fontWeight:800},children:w?.title||t("quickEdit.editWithTitle",{title:L})}),jsxRuntime.jsx(material.DialogContent,{sx:{pt:"8px !important"},children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Xt.map(V=>{let ue=V.type==="number"||V.numeric?"number":V.type==="date"?"date":"text";return jsxRuntime.jsx(material.TextField,{label:V.label||V.id,value:Re[V.id]??"",onChange:te=>Qo(V.id,te.target.value),type:ue,disabled:!cr(V.id),fullWidth:true,InputLabelProps:{shrink:ue==="date"?true:void 0}},`quick-edit-${V.id}`)}),w?.description?jsxRuntime.jsx(material.Alert,{severity:"info",children:w.description}):null]})}),jsxRuntime.jsxs(material.DialogActions,{sx:{px:3,pb:2},children:[jsxRuntime.jsx(material.Button,{onClick:()=>Le(false),disabled:_e,children:w?.cancelLabel||t("common.cancel")}),jsxRuntime.jsx(material.Button,{onClick:nn,variant:"contained",disabled:_e||!me,children:w?.submitLabel||t("common.save")})]})]}):null,Xe?jsxRuntime.jsx(si,{open:nt,type:"warning",title:E?.title||t("quickDelete.confirmTitle"),message:E?.message||(U.length>1?t("quickDelete.confirmMessageMultiple",{count:U.length}):t("quickDelete.confirmMessageSingle")),confirmText:E?.confirmText||t("common.delete"),cancelText:E?.cancelText||t("common.cancel"),onClose:()=>!ht&&Pt(false),onConfirm:Ia}):null,G,Et?jsxRuntime.jsx(Fl,{open:Ct,onClose:lo,model:v,aiAssistant:h?.aiAssistant,interaction:Gt?{enabled:true,filters:yt.filters,fieldMapping:ra,onPrimaryDimensionClick:V=>yt.setFilter("primaryDimension",V),onSecondaryDimensionClick:V=>yt.setFilter("secondaryDimension",V),onStatusClick:V=>yt.setFilter("status",V),onClearFilter:yt.clearFilter,onClearAll:yt.clearAll}:void 0,tableContent:jsxRuntime.jsx(hw,{appId:dt||"graph-report-internal",title:t("graph.dataBody"),columns:F,rows:v.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false},showSummary:false})}):null]})};var uz=({appTitle:e,children:t,menuData:o=[],workloadItems:r=[],workloadSelectedId:a,showNavigation:n=true,showWorkloadNav:i=true,orientation:c="auto",logo:d,headerSlot:l,actionSlot:s,portraitBottomSlot:g,contentSx:f,containerSx:p,user:b,onSearch:y,onSearchAdd:u,defaultNavigationOpen:C,navOpen:m,onNavOpenChange:h,onWorkloadSelect:x,locale:w="en",localeLabel:E,localeOptions:R,onLocaleChange:T,onUserSetting:I,onUserLogout:k,userMenuItems:S,leftHeaderSlot:D,rightHeaderSlot:P})=>{let M="orbcafe:page-layout-mode",[B,X]=Qt.useState("system"),[L,Z]=Qt.useState("light"),[$,q]=Qt.useState(false),[H,re]=Qt.useState(false),de=B==="system"?H?L:"light":B;Qt.useEffect(()=>{q(true);},[]),Qt.useEffect(()=>{try{let Pe=window.localStorage.getItem(M);(Pe==="light"||Pe==="dark"||Pe==="system")&&X(Pe);}catch{}re(true);let qe=window.matchMedia("(prefers-color-scheme: dark)"),st=()=>{Z(qe.matches?"dark":"light");};return st(),qe.addEventListener("change",st),()=>qe.removeEventListener("change",st)},[]),Qt.useEffect(()=>{if(H)try{window.localStorage.setItem(M,B);}catch{}},[H,B]),Qt.useEffect(()=>{de==="dark"?(document.documentElement.classList.add("dark"),document.documentElement.style.colorScheme="dark"):(document.documentElement.classList.remove("dark"),document.documentElement.style.colorScheme="light");},[de]);let Ce=Qt.useMemo(()=>styles.createTheme({palette:de==="dark"?{mode:"dark",primary:{main:"#93c5fd"},background:{default:"#060913",paper:"#101826"},text:{primary:"#f8fafc",secondary:"rgba(226,232,240,0.74)"},divider:"rgba(148,163,184,0.18)",action:{hover:"rgba(148,163,184,0.10)",selected:"rgba(59,130,246,0.18)"}}:{mode:"light",background:{default:"#eef3f8",paper:"#ffffff"}},components:{MuiCssBaseline:{styleOverrides:{body:{backgroundColor:de==="dark"?"#060913":"#eef3f8"}}},MuiPaper:{styleOverrides:{root:{backgroundImage:"none"}}}}}),[de]),ve=material.useMediaQuery("(orientation: portrait)"),le=material.useMediaQuery(Ce.breakpoints.down("md")),oe=c==="auto"?!$||ve||le?"portrait":"landscape":c,[Ie,Ze]=Qt.useState({landscape:C??true,portrait:false}),Ge=Ie[oe],ce=m??Ge,Ve=qe=>{m===void 0&&Ze(st=>({...st,[oe]:qe})),h?.(qe);},et=jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,alignItems:"center",children:[!$||n&&oe==="portrait"?jsxRuntime.jsx(material.IconButton,{onClick:()=>Ve(!ce),sx:{bgcolor:"action.hover"},children:jsxRuntime.jsx(aw__default.default,{})}):null,D]}),ye=jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,alignItems:"center",children:[s,P]}),We=jsxRuntime.jsx(Qg,{collapsed:oe==="landscape"?!ce:false,onToggle:()=>Ve(!ce),menuData:o,orientation:oe,colorMode:de,maxHeight:oe==="landscape"?900:void 0});return jsxRuntime.jsx(styles.ThemeProvider,{theme:Ce,children:jsxRuntime.jsx(cl,{locale:w,children:jsxRuntime.jsxs(material.Box,{sx:[qe=>({minHeight:"100vh",display:"flex",flexDirection:"column",background:qe.palette.mode==="dark"?"linear-gradient(180deg, #0A0A0A 0%, #141414 55%, #1A1A1A 100%)":qe.palette.background.default}),...Array.isArray(p)?p:[p]],children:[jsxRuntime.jsx(cs,{appTitle:e,logo:d===void 0?null:d,mode:B,onToggleMode:()=>X(qe=>qe==="system"?"dark":qe==="dark"?"light":"system"),locale:w,localeLabel:E,localeOptions:R,onLocaleChange:T,user:b,onUserSetting:I,onUserLogout:k,userMenuItems:S,onSearch:y,onSearchAdd:u,leftSlot:et,rightSlot:ye}),l?jsxRuntime.jsx(material.Box,{sx:{px:{xs:2,md:3},py:1.5,borderBottom:"1px solid",borderColor:"divider"},children:l}):null,jsxRuntime.jsxs(material.Box,{sx:{flex:1,minHeight:0,display:"flex",position:"relative"},children:[$&&n&&oe==="landscape"?jsxRuntime.jsx(material.Box,{sx:{p:1.5,pr:0,flexShrink:0},children:We}):null,!$||n&&oe==="portrait"?jsxRuntime.jsx(material.Drawer,{open:ce,onClose:()=>Ve(false),PaperProps:{sx:{width:"min(88vw, 360px)",p:1.25,bgcolor:"transparent",boxShadow:"none"}},children:We}):null,jsxRuntime.jsx(material.Box,{sx:{flex:1,minWidth:0,minHeight:0,overflow:"auto",p:1.5,...f},children:jsxRuntime.jsxs(material.Stack,{spacing:1.5,children:[i&&r.length>0?jsxRuntime.jsx(qg,{items:r,selectedId:a,orientation:oe,onItemSelect:x}):null,jsxRuntime.jsx(material.Paper,{elevation:0,sx:{flex:1,minHeight:oe==="portrait"?420:560,p:{xs:1.25,md:1.5},borderRadius:5,border:"1px solid",borderColor:"divider",bgcolor:Ce.palette.mode==="dark"?"rgba(15,23,42,0.72)":"rgba(255,255,255,0.72)",backdropFilter:"blur(12px)",color:"text.primary"},children:t})]})})]}),oe==="portrait"&&g?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsx(material.Box,{sx:{p:1.5},children:g})]}):null]})})})};var mf=Lw__default.default(()=>Promise.resolve().then(()=>(pf(),uf)).then(e=>e.COrbCanvas),{ssr:false,loading:()=>jsxRuntime.jsx("div",{className:"h-full w-full bg-transparent"})});function $d({isRecording:e}){return jsxRuntime.jsx(framerMotion.AnimatePresence,{children:e&&jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.5},className:"pointer-events-none absolute inset-0 z-0 overflow-hidden",children:jsxRuntime.jsxs("div",{className:"relative flex h-full w-full items-center justify-center",children:[jsxRuntime.jsx("div",{className:"absolute inset-0",children:jsxRuntime.jsx(mf,{hue:0,hoverIntensity:.5,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})}),jsxRuntime.jsx("div",{className:"relative z-10 h-full w-1/3 mix-blend-overlay opacity-80",children:jsxRuntime.jsx(mf,{hue:10,hoverIntensity:.8,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})})]})})})}var xz=$d;var ff=Qt.createContext(null);function Gw(e){if(!e||!(e instanceof HTMLElement))return false;let t=e.tagName;return !!(t==="INPUT"||t==="TEXTAREA"||t==="SELECT"||e.isContentEditable||e.closest('[data-voice-hotkey-ignore="true"]'))}function Uw({children:e,onVoiceSubmit:t,onVoicePartial:o,onVoiceError:r,longPressMs:a=200,disableSpaceTrigger:n=false,ignoreWhenFocusedInput:i=true,renderOverlay:c=true,wsUrl:d,silenceThresholdMs:l,minVolumeRms:s}){let[g,f]=Qt.useState(false),[p,b]=Qt.useState(false),y=Qt.useRef(null),u=Qt.useRef(false),C=Qt.useRef(false),m=Qt.useCallback(()=>{C.current=false,f(false);},[]),{isRecording:h,startRecording:x,stopRecording:w}=Rn({wsUrl:d,silenceThresholdMs:l,minVolumeRms:s,onTextUpdate:I=>{o?.(I);},onComplete:async I=>{try{I.trim()&&(b(!0),await t(I.trim()));}catch(k){let S=k instanceof Error?k.message:"Failed to process voice command";r?.(S);}finally{b(!1),m();}},onError:I=>{r?.(I),b(!1),u.current||m();}}),E=Qt.useCallback(async()=>{C.current=false,await x();},[x]),R=Qt.useCallback(()=>{w();},[w]);Qt.useEffect(()=>{if(n)return;let I=S=>{S.isComposing||(S.code==="Space"||S.key===" ")&&(u.current||S.repeat||i&&Gw(document.activeElement)||(u.current=true,S.preventDefault(),y.current=setTimeout(()=>{C.current=true,f(true),x();},a)));},k=S=>{(S.code==="Space"||S.key===" ")&&(y.current&&(clearTimeout(y.current),y.current=null),u.current=false,C.current&&(S.preventDefault(),f(false),w()));};return window.addEventListener("keydown",I),window.addEventListener("keyup",k),()=>{window.removeEventListener("keydown",I),window.removeEventListener("keyup",k),y.current&&(clearTimeout(y.current),y.current=null);}},[n,i,a,x,w]);let T=Qt.useMemo(()=>({isRecording:h,isHotkeyRecording:g,isSubmitting:p,startRecording:E,stopRecording:R}),[g,h,p,E,R]);return jsxRuntime.jsxs(ff.Provider,{value:T,children:[c?jsxRuntime.jsx($d,{isRecording:g}):null,e]})}function _w(){let e=Qt.useContext(ff);if(!e)throw new Error("useAINav must be used within CAINavProvider");return e}var Tz=Uw,Iz=_w;function Je(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var Qw=({content:e,theme:t="light",size:o="base",defaultExpanded:r=false})=>{let[a,n]=Qt.useState(r),i=Qt.useMemo(()=>`${(o==="sm"?14:o==="lg"?18:16)-2}px`,[o]);return jsxRuntime.jsxs("div",{className:`my-6 rounded-lg overflow-hidden transition-all duration-200 ${t==="dark"?"bg-gray-800":"bg-white"}`,style:{border:`0.5px solid ${t==="dark"?"#4b5563":"#d1d5db"}`},children:[jsxRuntime.jsxs("div",{className:`px-4 py-3 cursor-pointer flex items-center justify-between transition-colors duration-200 ${t==="dark"?"bg-gray-700 hover:bg-gray-650":"bg-gray-50 hover:bg-gray-100"}`,style:{borderBottom:`0.5px solid ${t==="dark"?"#4b5563":"#e5e7eb"}`},onClick:()=>n(!a),children:[jsxRuntime.jsxs("span",{className:"flex items-center",children:[jsxRuntime.jsx("span",{className:"mr-2",children:"\u{1F914}"}),jsxRuntime.jsx("span",{className:`font-medium ${t==="dark"?"text-gray-300":"text-gray-700"}`,style:{fontSize:o==="sm"?"14px":o==="lg"?"18px":"16px"},children:"\u601D\u8003\u8FC7\u7A0B"})]}),jsxRuntime.jsx("svg",{className:`w-4 h-4 transition-transform duration-200 ${a?"rotate-180":""} ${t==="dark"?"text-gray-400":"text-gray-500"}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),a&&jsxRuntime.jsx("div",{className:`p-4 whitespace-pre-wrap italic font-light ${t==="dark"?"text-gray-400":"text-gray-600"}`,style:{fontSize:i,lineHeight:"1.3 !important"},children:e})]})},hf=Qw;var i1=({content:e,language:t="text",isStreaming:o=false,className:r=""})=>{let{theme:a}=nextThemes.useTheme(),[n,i]=Qt.useState(false),c=async()=>{try{await navigator.clipboard.writeText(e),i(!0),setTimeout(()=>i(!1),2e3);}catch(l){console.error("\u590D\u5236\u5931\u8D25:",l);}},d=a==="dark"?prism.oneDark:prism.oneLight;return jsxRuntime.jsxs("div",{className:Je("rounded-lg overflow-hidden border border-gray-200 dark:border-gray-700 my-4",r),children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-4 py-2 bg-gray-50 dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700",children:[jsxRuntime.jsx("span",{className:"text-xs font-medium text-gray-600 dark:text-gray-300 uppercase",children:t}),jsxRuntime.jsx("button",{onClick:c,className:"p-1 hover:bg-gray-200 dark:hover:bg-gray-700 rounded transition-colors",disabled:o,title:n?"Copied":"Copy code",children:n?jsxRuntime.jsx(lucideReact.Check,{size:14,className:"text-green-500"}):jsxRuntime.jsx(lucideReact.Clipboard,{size:14,className:"text-gray-500 dark:text-gray-400"})})]}),jsxRuntime.jsx("div",{className:"text-sm",children:jsxRuntime.jsx(reactSyntaxHighlighter.Prism,{language:t,style:d,customStyle:{margin:0,padding:"16px",fontSize:"14px",lineHeight:"1.5",backgroundColor:a==="dark"?"#1f2937":"#ffffff"},wrapLongLines:true,children:e})})]})},yf=i1;var d1=({content:e,isLoading:t,className:o="",style:r})=>{let a=Qt.useRef(null),[n,i]=Qt.useState(false),[c,d]=Qt.useState(null),{theme:l}=nextThemes.useTheme();return Qt.useEffect(()=>{let s=async()=>{if(!(!e.trim()||!a.current)){i(true),d(null);try{vf__default.default.initialize({startOnLoad:!1,theme:l==="dark"?"dark":"default",securityLevel:"loose",fontFamily:"inherit"});let f=`mermaid-${Math.random().toString(36).substr(2,9)}`,p=e.replace(/```mermaid\n?|\n?```/g,"").trim(),{svg:b}=await vf__default.default.render(f,p);a.current&&(a.current.innerHTML=b);}catch(f){console.error("Mermaid render failed:",f),d(f instanceof Error?f.message:"Render failed"),a.current&&(a.current.innerText=e);}finally{i(false);}}},g=setTimeout(()=>{s();},100);return ()=>clearTimeout(g)},[e,l]),t||n?jsxRuntime.jsx("div",{className:`mermaid-block loading ${o}`,style:r,children:jsxRuntime.jsxs("div",{className:"flex items-center justify-center p-4 bg-gray-50 dark:bg-gray-800 rounded border border-gray-200 dark:border-gray-700",children:[jsxRuntime.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-blue-500 mr-2"}),jsxRuntime.jsx("span",{className:"text-sm text-gray-500",children:"Generating Diagram..."})]})}):c?jsxRuntime.jsxs("div",{className:"p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded text-red-600 dark:text-red-400 text-sm overflow-auto",children:[jsxRuntime.jsx("p",{className:"font-semibold mb-2",children:"Mermaid Error:"}),jsxRuntime.jsx("pre",{children:c}),jsxRuntime.jsx("pre",{className:"mt-4 text-xs text-gray-500",children:e})]}):jsxRuntime.jsx("div",{className:`mermaid-block overflow-x-auto ${o}`,style:r,ref:a})},Sf=d1;var h1=({title:e="\u53D1\u751F\u9519\u8BEF",content:t,errorCode:o,stack:r,icon:a,closable:n=true,onClose:i,onRetry:c,className:d="",...l})=>{let[s,g]=Qt.useState(false),[f,p]=Qt.useState(false),b=async()=>{if(c){p(true);try{await c();}catch(y){console.error("\u91CD\u8BD5\u5931\u8D25:",y);}finally{p(false);}}};return jsxRuntime.jsxs("div",{className:`relative w-full overflow-hidden rounded-lg border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 shadow-sm transition-all hover:shadow-md ${d}`,...l,children:[jsxRuntime.jsxs("div",{className:"flex p-4 border-l-4 border-l-red-500 bg-red-50 dark:bg-red-900/10",children:[jsxRuntime.jsx("div",{className:"flex-shrink-0 mr-3 text-red-500 mt-0.5",children:a||jsxRuntime.jsx(lucideReact.AlertCircle,{className:"w-5 h-5"})}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-2 mb-1",children:[jsxRuntime.jsx("h4",{className:"text-base font-semibold text-gray-900 dark:text-gray-100",children:e}),o&&jsxRuntime.jsx("span",{className:"text-xs font-mono px-1.5 py-0.5 rounded bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-300",children:o})]}),t&&jsxRuntime.jsx("div",{className:"text-sm text-gray-600 dark:text-gray-300 mb-3 leading-relaxed",children:typeof t=="string"?jsxRuntime.jsx("p",{className:"whitespace-pre-wrap",children:t}):t}),(c||r)&&jsxRuntime.jsxs("div",{className:"flex items-center space-x-4 mt-2",children:[c&&jsxRuntime.jsxs("button",{onClick:b,disabled:f,className:"flex items-center text-xs font-medium text-red-600 dark:text-red-400 hover:text-red-700 dark:hover:text-red-300 transition-colors disabled:opacity-50",children:[jsxRuntime.jsx(lucideReact.RotateCw,{className:`w-3.5 h-3.5 mr-1.5 ${f?"animate-spin":""}`}),f?"\u91CD\u8BD5\u4E2D...":"\u91CD\u8BD5"]}),r&&jsxRuntime.jsxs("button",{onClick:()=>g(!s),className:"flex items-center text-xs font-medium text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300 transition-colors",children:[s?jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3.5 h-3.5 mr-1"}):jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-3.5 h-3.5 mr-1"}),s?"\u9690\u85CF\u8BE6\u60C5":"\u67E5\u770B\u8BE6\u60C5"]})]})]}),n&&i&&jsxRuntime.jsx("button",{onClick:i,className:"flex-shrink-0 ml-3 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors self-start",children:jsxRuntime.jsx(lucideReact.X,{className:"w-4 h-4"})})]}),r&&s&&jsxRuntime.jsx("div",{className:"bg-gray-50 dark:bg-gray-950 p-3 border-t border-gray-100 dark:border-gray-800",children:jsxRuntime.jsx("pre",{className:"text-xs font-mono text-gray-600 dark:text-gray-400 overflow-x-auto whitespace-pre-wrap p-2 bg-white dark:bg-gray-900 rounded border border-gray-200 dark:border-gray-800",children:r})})]})},Ls=h1;var S1=({title:e="\u8B66\u544A",content:t,warningType:o,severity:r="warning",warnings:a=[],icon:n,closable:i=true,onClose:c,onConfirm:d,actionText:l,className:s="",...g})=>{let f=()=>{switch(r){case "info":return {borderLeftColor:"border-l-blue-500",iconColor:"text-blue-500",bgColor:"bg-blue-50 dark:bg-blue-900/10"};case "error":return {borderLeftColor:"border-l-red-500",iconColor:"text-red-500",bgColor:"bg-red-50 dark:bg-red-900/10"};case "success":return {borderLeftColor:"border-l-green-500",iconColor:"text-green-500",bgColor:"bg-green-50 dark:bg-green-900/10"};default:return {borderLeftColor:"border-l-yellow-500",iconColor:"text-yellow-500",bgColor:"bg-yellow-50 dark:bg-yellow-900/10"}}},p=()=>{switch(r){case "info":return jsxRuntime.jsx(lucideReact.Info,{className:"w-5 h-5"});case "error":return jsxRuntime.jsx(lucideReact.XCircle,{className:"w-5 h-5"});case "success":return jsxRuntime.jsx(lucideReact.CheckCircle,{className:"w-5 h-5"});default:return jsxRuntime.jsx(lucideReact.AlertTriangle,{className:"w-5 h-5"})}},b=f();return jsxRuntime.jsxs("div",{className:`relative w-full overflow-hidden rounded-lg border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 shadow-sm transition-all hover:shadow-md ${s}`,...g,children:[jsxRuntime.jsxs("div",{className:`flex p-4 border-l-4 ${b.borderLeftColor} ${b.bgColor}`,children:[jsxRuntime.jsx("div",{className:`flex-shrink-0 mr-3 ${b.iconColor}`,children:n||p()}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-1",children:[jsxRuntime.jsx("h4",{className:"text-base font-semibold text-gray-900 dark:text-gray-100",children:e}),o&&jsxRuntime.jsx("span",{className:"text-xs font-medium px-2 py-0.5 rounded-full bg-gray-100 dark:bg-gray-800 text-gray-600 dark:text-gray-400",children:o})]}),t&&jsxRuntime.jsx("div",{className:"text-sm text-gray-600 dark:text-gray-300 mb-2",children:t}),a&&a.length>0&&jsxRuntime.jsx("ul",{className:"mt-2 space-y-1",children:a.map((y,u)=>jsxRuntime.jsxs("li",{className:"flex items-start text-sm text-gray-600 dark:text-gray-300",children:[jsxRuntime.jsx("span",{className:"mr-2 mt-1.5 w-1 h-1 rounded-full bg-gray-400 dark:bg-gray-500 flex-shrink-0"}),jsxRuntime.jsx("span",{children:y})]},u))})]}),i&&c&&jsxRuntime.jsx("button",{onClick:c,className:"flex-shrink-0 ml-3 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors",children:jsxRuntime.jsx(lucideReact.X,{className:"w-4 h-4"})})]}),d&&jsxRuntime.jsx("div",{className:"bg-gray-50 dark:bg-gray-800/50 px-4 py-3 flex justify-end border-t border-gray-100 dark:border-gray-800",children:jsxRuntime.jsx("button",{onClick:d,className:"px-4 py-1.5 text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:focus:ring-offset-gray-900",children:l||"\u786E\u8BA4"})})]})},Ns=S1;var I1=({title:e="\u76F8\u5173\u63A8\u8350",content:t,suggestions:o,onSuggestionClick:r,maxDisplay:a=5,icon:n,closable:i=false,onClose:c,className:d="",...l})=>{let[s,g]=Qt.useState(false),[f,p]=Qt.useState(""),[b,y]=Qt.useState(false),u=Qt.useMemo(()=>f.trim()?o.filter(h=>h.toLowerCase().includes(f.toLowerCase())):o,[o,f]),C=Qt.useMemo(()=>s?u:u.slice(0,a),[u,s,a]),m=h=>{r?.(h);};return !o||o.length===0?null:jsxRuntime.jsxs("div",{className:`w-full overflow-hidden rounded-lg border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 shadow-sm transition-all hover:shadow-md ${d}`,...l,children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-100 dark:border-gray-800 bg-blue-50/30 dark:bg-blue-900/10",children:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-2.5",children:[jsxRuntime.jsx("div",{className:"text-blue-500 flex-shrink-0",children:n||jsxRuntime.jsx(lucideReact.Lightbulb,{className:"w-5 h-5"})}),jsxRuntime.jsxs("div",{className:"flex flex-col",children:[jsxRuntime.jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100 leading-tight",children:e}),t&&jsxRuntime.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5",children:t})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-1",children:[o.length>3&&jsxRuntime.jsx("button",{onClick:()=>y(!b),className:`p-1.5 rounded-md transition-colors ${b?"bg-blue-100 dark:bg-blue-900/30 text-blue-600 dark:text-blue-400":"text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800"}`,title:b?"\u5173\u95ED\u641C\u7D22":"\u641C\u7D22\u95EE\u9898",children:jsxRuntime.jsx(lucideReact.Search,{className:"w-4 h-4"})}),i&&c&&jsxRuntime.jsx("button",{onClick:c,className:"text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 p-1.5 rounded-md hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors",title:"\u5173\u95ED",children:jsxRuntime.jsx(lucideReact.X,{className:"w-4 h-4"})})]})]}),b&&jsxRuntime.jsx("div",{className:"px-4 py-2 border-b border-gray-100 dark:border-gray-800 bg-gray-50 dark:bg-gray-900/50",children:jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("input",{type:"text",placeholder:"\u641C\u7D22\u76F8\u5173\u95EE\u9898...",value:f,onChange:h=>p(h.target.value),className:"w-full text-sm px-3 py-1.5 pl-8 rounded border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 focus:ring-1 focus:ring-blue-500 focus:border-blue-500 outline-none transition-shadow",autoFocus:true}),jsxRuntime.jsx(lucideReact.Search,{className:"absolute left-2.5 top-2 w-3.5 h-3.5 text-gray-400"})]})}),jsxRuntime.jsxs("div",{className:"p-2",children:[jsxRuntime.jsx("ul",{className:"space-y-1",children:C.map((h,x)=>jsxRuntime.jsx("li",{children:jsxRuntime.jsxs("button",{onClick:()=>m(h),className:"w-full text-left px-3 py-2 rounded-md text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 hover:text-blue-600 dark:hover:text-blue-400 transition-colors group flex items-start justify-between",children:[jsxRuntime.jsx("span",{children:h}),jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-4 h-4 text-gray-300 group-hover:text-blue-400 opacity-0 group-hover:opacity-100 transition-all transform group-hover:translate-x-0.5"})]})},x))}),u.length>a&&jsxRuntime.jsx("button",{onClick:()=>g(!s),className:"w-full text-center py-2 text-xs font-medium text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 transition-colors border-t border-gray-50 dark:border-gray-800/50 mt-1",children:s?"\u6536\u8D77":`\u67E5\u770B\u5168\u90E8 (${u.length})`}),u.length===0&&f&&jsxRuntime.jsx("div",{className:"text-center py-4 text-sm text-gray-500 dark:text-gray-400",children:"\u6CA1\u6709\u627E\u5230\u5339\u914D\u7684\u5EFA\u8BAE"})]})]})},zs=I1;var E1=({title:e,content:t,toolName:o,parameters:r,result:a,status:n,duration:i,icon:c,closable:d=false,onClose:l,onAction:s,actionText:g,className:f="",...p})=>{let[b,y]=Qt.useState(false),[u,C]=Qt.useState(true),m=()=>{switch(n){case "pending":return {iconColor:"text-blue-500",badgeBg:"bg-blue-50 dark:bg-blue-900/30",badgeText:"text-blue-600 dark:text-blue-400",label:"\u6267\u884C\u4E2D"};case "error":return {iconColor:"text-red-500",badgeBg:"bg-red-50 dark:bg-red-900/30",badgeText:"text-red-600 dark:text-red-400",label:"\u5931\u8D25"};default:return {iconColor:"text-green-500",badgeBg:"bg-green-50 dark:bg-green-900/30",badgeText:"text-green-600 dark:text-green-400",label:"\u6210\u529F"}}},h=()=>{switch(n){case "pending":return jsxRuntime.jsx(lucideReact.Loader2,{className:"w-5 h-5 animate-spin"});case "error":return jsxRuntime.jsx(lucideReact.XCircle,{className:"w-5 h-5"});default:return jsxRuntime.jsx(lucideReact.CheckCircle,{className:"w-5 h-5"})}},x=R=>R?R<1e3?`${R}ms`:`${(R/1e3).toFixed(2)}s`:"",w=m(),E=e||o||"\u5DE5\u5177\u8C03\u7528";return jsxRuntime.jsxs("div",{className:`w-full overflow-hidden rounded-lg border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 shadow-sm transition-all hover:shadow-md ${f}`,...p,children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-100 dark:border-gray-800 bg-gray-50/50 dark:bg-gray-800/50",children:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-3",children:[jsxRuntime.jsx("div",{className:`flex-shrink-0 ${w.iconColor}`,children:c||h()}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100",children:E}),jsxRuntime.jsx("span",{className:`text-[10px] font-medium px-1.5 py-0.5 rounded ${w.badgeBg} ${w.badgeText}`,children:w.label})]}),o&&e&&jsxRuntime.jsxs("div",{className:"text-xs text-gray-500 dark:text-gray-400 flex items-center mt-0.5",children:[jsxRuntime.jsx(lucideReact.Terminal,{className:"w-3 h-3 mr-1"}),o]})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2 text-xs text-gray-500 dark:text-gray-400",children:[i&&jsxRuntime.jsxs("div",{className:"flex items-center bg-gray-100 dark:bg-gray-800 px-2 py-1 rounded",children:[jsxRuntime.jsx(lucideReact.Clock,{className:"w-3 h-3 mr-1"}),x(i)]}),d&&l&&jsxRuntime.jsx("button",{onClick:l,className:"text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors p-1 rounded",children:jsxRuntime.jsx(lucideReact.X,{className:"w-4 h-4"})})]})]}),jsxRuntime.jsxs("div",{className:"p-4",children:[t&&jsxRuntime.jsx("div",{className:"text-sm text-gray-600 dark:text-gray-300 mb-4 leading-relaxed",children:t}),r&&jsxRuntime.jsxs("div",{className:"mb-3",children:[jsxRuntime.jsxs("button",{onClick:()=>y(!b),className:"flex items-center text-xs font-medium text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300 mb-2",children:[b?jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3.5 h-3.5 mr-1"}):jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-3.5 h-3.5 mr-1"}),jsxRuntime.jsx(lucideReact.Box,{className:"w-3.5 h-3.5 mr-1.5"}),"\u8F93\u5165\u53C2\u6570"]}),b&&jsxRuntime.jsx("div",{className:"bg-gray-50 dark:bg-gray-950 rounded border border-gray-100 dark:border-gray-800 overflow-hidden",children:jsxRuntime.jsx("pre",{className:"p-3 text-xs font-mono text-gray-600 dark:text-gray-400 overflow-x-auto",children:JSON.stringify(r,null,2)})})]}),a&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("button",{onClick:()=>C(!u),className:"flex items-center text-xs font-medium text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300 mb-2",children:[u?jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3.5 h-3.5 mr-1"}):jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-3.5 h-3.5 mr-1"}),jsxRuntime.jsx(lucideReact.Terminal,{className:"w-3.5 h-3.5 mr-1.5"}),"\u6267\u884C\u7ED3\u679C"]}),u&&jsxRuntime.jsx("div",{className:"bg-gray-50 dark:bg-gray-950 rounded border border-gray-100 dark:border-gray-800 overflow-hidden",children:jsxRuntime.jsx("pre",{className:"p-3 text-xs font-mono text-gray-600 dark:text-gray-400 overflow-x-auto",children:typeof a=="string"?a:JSON.stringify(a,null,2)})})]}),s&&jsxRuntime.jsx("div",{className:"mt-3 pt-3 border-t border-gray-100 dark:border-gray-800 flex justify-end",children:jsxRuntime.jsx("button",{onClick:s,className:"px-4 py-1.5 text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:focus:ring-offset-gray-900",children:g||"\u6267\u884C\u64CD\u4F5C"})})]})]})},Os=E1;var L1=({data:e})=>{if(!e)return null;let t=Qt.useMemo(()=>{let o=[],r=[],a="\u6570\u636E\u8868\u683C";return Array.isArray(e)?(o=e,o.length>0&&(r=Object.keys(o[0]).map(n=>({id:n,label:n.charAt(0).toUpperCase()+n.slice(1),numeric:typeof o[0][n]=="number"})))):typeof e=="object"&&(a=e.title||a,o=Array.isArray(e.rows)?e.rows:Array.isArray(e.data)?e.data:[],Array.isArray(e.columns)?r=e.columns.map(i=>({id:i.key||i.id,label:i.title||i.label,numeric:i.dataType==="number"||i.numeric})):o.length>0&&(r=Object.keys(o[0]).map(i=>({id:i,label:i,numeric:typeof o[0][i]=="number"})))),o=o.map((n,i)=>({...n,id:n.id||`row_${i}`})),{title:a,columns:r,rows:o}},[e]);return t.rows.length===0?jsxRuntime.jsx("div",{className:"w-full my-4 p-4 border border-dashed border-gray-300 rounded text-center text-gray-500",children:"\u6682\u65E0\u8868\u683C\u6570\u636E"}):jsxRuntime.jsx("div",{className:"w-full my-4",children:jsxRuntime.jsx(Dr,{appId:"agent-ui-table-card",title:t.title,columns:t.columns,rows:t.rows,count:t.rows.length,rowKey:"id",fitContainer:false,maxHeight:"500px",rowsPerPage:10,rowsPerPageOptions:[5,10,20,50]})})},Vs=L1;var U1=({title:e,subtitle:t,data:o,type:r,config:a={}})=>{let n=()=>{switch(r){case "bar-chart-card":return jsxRuntime.jsx(lucideReact.BarChart,{className:"w-4 h-4 text-blue-500"});case "line-chart-card":return jsxRuntime.jsx(lucideReact.LineChart,{className:"w-4 h-4 text-green-500"});case "pie-chart-card":return jsxRuntime.jsx(lucideReact.PieChart,{className:"w-4 h-4 text-purple-500"});case "combo-chart-card":return jsxRuntime.jsx(lucideReact.Activity,{className:"w-4 h-4 text-orange-500"});case "heatmap-chart-card":return jsxRuntime.jsx(lucideReact.Grid,{className:"w-4 h-4 text-red-500"});case "fishbone-chart-card":return jsxRuntime.jsx(lucideReact.GitBranch,{className:"w-4 h-4 text-indigo-500"});case "waterfall-chart-card":return jsxRuntime.jsx(lucideReact.TrendingDown,{className:"w-4 h-4 text-teal-500"});case "google-map-card":return jsxRuntime.jsx(lucideReact.Globe,{className:"w-4 h-4 text-blue-600"});case "amap-card":return jsxRuntime.jsx(lucideReact.MapPin,{className:"w-4 h-4 text-blue-600"});default:return jsxRuntime.jsx(lucideReact.BarChart,{className:"w-4 h-4"})}},i=()=>{if(!o&&r!=="google-map-card"&&r!=="amap-card")return jsxRuntime.jsx("div",{className:"text-gray-500 text-sm p-4 text-center",children:"No data available"});try{switch(r){case "bar-chart-card":return jsxRuntime.jsx(yi,{data:o,orientation:a.orientation||"horizontal",valueSuffix:a.valueSuffix||"",minHeight:a.minHeight});case "line-chart-card":return jsxRuntime.jsx(ip,{data:o,color:a.color,valueSuffix:a.valueSuffix||"",height:a.height});case "pie-chart-card":let c=o.reduce((l,s)=>l+(Number(s.value)||0),0),d=o.map(l=>({name:l.name,value:Number(l.value)||0,percent:typeof l.percent=="number"?l.percent:c>0?(Number(l.value)||0)/c*100:0}));return jsxRuntime.jsx(Il,{data:d,variant:a.variant||"donut",size:a.size,colors:a.colors});case "combo-chart-card":return jsxRuntime.jsx(lp,{data:o,barColor:a.barColor,lineColor:a.lineColor});case "heatmap-chart-card":return jsxRuntime.jsx(cp,{data:o});case "fishbone-chart-card":return jsxRuntime.jsx(up,{branches:o,effect:a.effect||e||"Problem"});case "waterfall-chart-card":return jsxRuntime.jsx(mp,{data:o,height:a.height});case "google-map-card":return jsxRuntime.jsx(hp,{embedUrl:a.embedUrl||o&&o[0]?.embedUrl,apiKey:a.apiKey,query:a.query||o&&o[0]?.query||e,height:a.height});case "amap-card":return jsxRuntime.jsx(vp,{embedUrl:a.embedUrl||o&&o[0]?.embedUrl,keyword:a.keyword||o&&o[0]?.keyword||e,height:a.height});default:return jsxRuntime.jsxs("div",{className:"text-gray-500 text-sm p-4 text-center",children:["Unsupported chart type: ",r]})}}catch(c){return console.error("Error rendering chart:",c),jsxRuntime.jsx("div",{className:"text-red-500 text-sm p-4 text-center",children:"Error rendering chart"})}};return jsxRuntime.jsxs("div",{className:"w-full overflow-hidden rounded-lg border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 shadow-sm transition-all hover:shadow-md",children:[jsxRuntime.jsxs("div",{className:"flex items-center px-4 py-3 border-b border-gray-100 dark:border-gray-800 bg-gray-50/50 dark:bg-gray-800/50",children:[jsxRuntime.jsx("div",{className:"mr-2 flex-shrink-0",children:n()}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100 truncate",children:e}),t&&jsxRuntime.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5 truncate",children:t})]})]}),jsxRuntime.jsxs("div",{className:"p-4",children:[jsxRuntime.jsx("div",{className:"overflow-x-auto",children:i()}),jsxRuntime.jsx("div",{className:"mt-3",children:jsxRuntime.jsxs("details",{className:"text-xs text-gray-500 dark:text-gray-400",children:[jsxRuntime.jsx("summary",{className:"cursor-pointer hover:text-gray-700 dark:hover:text-gray-300 transition-colors select-none font-medium opacity-60 hover:opacity-100",children:"View Raw Data"}),jsxRuntime.jsx("pre",{className:"mt-2 p-2 bg-gray-50 dark:bg-gray-950 rounded border border-gray-100 dark:border-gray-800 overflow-x-auto max-h-40",children:JSON.stringify(o,null,2)})]})})]})]})},Ws=U1;var K1=({type:e,manifest:t})=>jsxRuntime.jsxs("div",{className:"w-full overflow-hidden rounded-lg border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 shadow-sm transition-all hover:shadow-md",children:[jsxRuntime.jsxs("div",{className:"flex items-center px-4 py-3 border-b border-gray-100 dark:border-gray-800 bg-blue-50/50 dark:bg-blue-900/10",children:[jsxRuntime.jsx(lucideReact.Box,{className:"w-4 h-4 mr-2 text-blue-600 dark:text-blue-400"}),jsxRuntime.jsxs("h3",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100",children:["SAP Card: ",e]})]}),jsxRuntime.jsx("div",{className:"p-4",children:jsxRuntime.jsx("div",{className:"bg-gray-50 dark:bg-gray-950 p-3 rounded border border-gray-100 dark:border-gray-800 overflow-x-auto",children:jsxRuntime.jsx("pre",{className:"text-xs font-mono text-gray-600 dark:text-gray-400 whitespace-pre-wrap",children:JSON.stringify(t,null,2)})})})]}),$s=K1;var Gs=e=>{let t;try{t=JSON.parse(e);}catch{return null}return t&&typeof t=="object"&&((t.type==="bar-chart-card"||t.type==="line-chart-card"||t.type==="pie-chart-card"||t.type==="combo-chart-card"||t.type==="heatmap-chart-card"||t.type==="fishbone-chart-card"||t.type==="waterfall-chart-card"||t.type==="google-map-card"||t.type==="amap-card")&&t.title||(t.type==="sap-analytical-card"||t.type==="sap-list-card"||t.type==="sap-object-card"||t.type==="sap-component-card")&&t.manifest||t.type==="error-card"||t.type==="warning-card"||t.type==="suggestions-card"||t.type==="tool-result-card"||t.type==="table"&&t.data)?t:null};var Q1=({content:e,theme:t,size:o="base",className:r,enableCodeHighlight:a=true,enableMermaid:n=true,messageId:i,cardHooks:c})=>{let d=Qt.useMemo(()=>e?e.replace(/<think>([\s\S]*?)<\/think>/g,(f,p)=>`<div data-component="thinkbox" data-think-content="${encodeURIComponent(p.trim())}"></div>`):"",[e]),l=(f,p,b,y,u)=>{c?.onCardEvent?.({messageId:i,cardType:f,action:p,title:b,payload:y,rawData:u});},s=(f,p,b,y,u,C)=>{if(!(!u&&!c?.onCardEvent))return (...m)=>{let h=u?.(...m),x=C?C(...m):void 0;return l(f,p,b,x,y),h}},g=Qt.useMemo(()=>({div(f){let{"data-component":p,"data-think-content":b,...y}=f;return p==="thinkbox"&&b?jsxRuntime.jsx(hf,{content:decodeURIComponent(b),theme:t,size:o,defaultExpanded:false}):jsxRuntime.jsx("div",{...y})},table({children:f}){return jsxRuntime.jsx("div",{className:"my-4 w-full overflow-x-auto rounded-lg border border-gray-200 dark:border-gray-800",children:jsxRuntime.jsx("table",{className:"w-full min-w-[520px] border-collapse text-sm",children:f})})},thead({children:f}){return jsxRuntime.jsx("thead",{className:"bg-gray-50 dark:bg-gray-900/60",children:f})},tbody({children:f}){return jsxRuntime.jsx("tbody",{className:"bg-white dark:bg-gray-950",children:f})},tr({children:f}){return jsxRuntime.jsx("tr",{className:"border-b border-gray-200 dark:border-gray-800 last:border-b-0",children:f})},th({children:f,align:p}){return jsxRuntime.jsx("th",{className:`px-3 py-2 font-semibold text-gray-800 dark:text-gray-100 ${p==="center"?"text-center":p==="right"?"text-right":"text-left"}`,children:f})},td({children:f,align:p}){return jsxRuntime.jsx("td",{className:`px-3 py-2 text-gray-700 dark:text-gray-200 align-top ${p==="center"?"text-center":p==="right"?"text-right":"text-left"}`,children:f})},code({inline:f,className:p,children:b,...y}){let u=/language-([\w-]+)/.exec(p||""),C=u?u[1]:"";if(f)return jsxRuntime.jsx("code",{className:"font-mono text-sm bg-gray-100 dark:bg-gray-800 px-1 py-0.5 rounded text-red-600 dark:text-red-400",...y,children:b});let m=String(b).replace(/\n$/,"");if(n&&C==="mermaid")return jsxRuntime.jsx(Sf,{content:m});if(C==="json"){let h=Gs(m);if(h)switch(h.type){case "table":return jsxRuntime.jsx(Vs,{data:h.data});case "bar-chart-card":case "line-chart-card":case "pie-chart-card":case "combo-chart-card":case "heatmap-chart-card":case "fishbone-chart-card":case "waterfall-chart-card":case "google-map-card":case "amap-card":return jsxRuntime.jsx(Ws,{...h});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return jsxRuntime.jsx($s,{...h});case "error-card":{let x=h;return jsxRuntime.jsx(Ls,{...x,onClose:s("error-card","close",x.title,x,x.onClose),onRetry:s("error-card","retry",x.title,x,x.onRetry)})}case "warning-card":{let x=h,w=x.onConfirm?s("warning-card","confirm",x.title,x,x.onConfirm):x.actionText&&c?.onCardEvent?s("warning-card","confirm",x.title,x):void 0;return jsxRuntime.jsx(Ns,{...x,onClose:s("warning-card","close",x.title,x,x.onClose),onConfirm:w})}case "suggestions-card":{let x=h;return jsxRuntime.jsx(zs,{...x,onClose:s("suggestions-card","close",x.title,x,x.onClose),onSuggestionClick:s("suggestions-card","suggestion-click",x.title,x,x.onSuggestionClick,w=>({suggestion:w}))})}case "tool-result-card":{let x=h;return jsxRuntime.jsx(Os,{...x,onClose:s("tool-result-card","close",x.title,x,x.onClose),onAction:s("tool-result-card","action",x.title,x,x.onAction)})}}}return a?jsxRuntime.jsx(yf,{content:m,language:C,className:"not-prose"}):jsxRuntime.jsx("code",{className:p,...y,children:b})}}),[t,o,n,a,c,i]);return jsxRuntime.jsx("div",{className:Je("markdown-body prose dark:prose-invert max-w-none",r),children:jsxRuntime.jsx(q1__default.default,{remarkPlugins:[j1__default.default,X1__default.default],rehypePlugins:[Z1__default.default,Y1__default.default],components:g,children:d})})},Us=Q1;var J1=({content:e,messageId:t,cardHooks:o})=>{let r=(i,c,d,l,s)=>{o?.onCardEvent?.({messageId:t,cardType:i,action:c,title:d,payload:l,rawData:s});},a=(i,c,d,l,s,g)=>{if(!(!s&&!o?.onCardEvent))return (...f)=>{let p=s?.(...f),b=g?g(...f):void 0;return r(i,c,d,b,l),p}},n=Gs(e);if(n)switch(n.type){case "table":return jsxRuntime.jsx(Vs,{data:n.data});case "bar-chart-card":case "line-chart-card":case "pie-chart-card":case "combo-chart-card":case "heatmap-chart-card":case "fishbone-chart-card":case "waterfall-chart-card":case "google-map-card":case "amap-card":return jsxRuntime.jsx(Ws,{...n});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return jsxRuntime.jsx($s,{...n});case "error-card":{let i=n;return jsxRuntime.jsx(Ls,{...i,onClose:a("error-card","close",i.title,i,i.onClose),onRetry:a("error-card","retry",i.title,i,i.onRetry)})}case "warning-card":{let i=n,c=i.onConfirm?a("warning-card","confirm",i.title,i,i.onConfirm):i.actionText&&o?.onCardEvent?a("warning-card","confirm",i.title,i):void 0;return jsxRuntime.jsx(Ns,{...i,onClose:a("warning-card","close",i.title,i,i.onClose),onConfirm:c})}case "suggestions-card":{let i=n;return jsxRuntime.jsx(zs,{...i,onClose:a("suggestions-card","close",i.title,i,i.onClose),onSuggestionClick:a("suggestions-card","suggestion-click",i.title,i,i.onSuggestionClick,c=>({suggestion:c}))})}case "tool-result-card":{let i=n;return jsxRuntime.jsx(Os,{...i,onClose:a("tool-result-card","close",i.title,i,i.onClose),onAction:a("tool-result-card","action",i.title,i,i.onAction)})}}return jsxRuntime.jsx("div",{className:"dynamic-card-fallback",children:jsxRuntime.jsx(Us,{content:e,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:t,cardHooks:o})})},Bf=J1;var Zd=class{static analyze(t){if(!t.trim())return {blocks:[],hasComplexContent:false,overallType:"simple"};let r=/```json\s*\{\s*"type":\s*"[^"]+"/g.test(t),a=/<[^>]+>[\s\S]*?<\/[^>]+>/.test(t),n=t.includes("NQ#")||t.includes("data-component");return r||a||n?{blocks:[{type:"mixed",content:t,startIndex:0,endIndex:t.length}],hasComplexContent:true,overallType:"complex"}:{blocks:[{type:"markdown",content:t,startIndex:0,endIndex:t.length}],hasComplexContent:false,overallType:"simple"}}},tT=({content:e,className:t="",messageId:o,cardHooks:r})=>{let a=Qt__namespace.default.useMemo(()=>Zd.analyze(e),[e]);return jsxRuntime.jsx("div",{className:`universal-content-renderer ${t}`,children:a.blocks.map((n,i)=>n.type==="mixed"||n.type==="json-card"?jsxRuntime.jsx(Bf,{content:n.content,messageId:o,cardHooks:r},`block-${i}`):jsxRuntime.jsx(Us,{content:n.content,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:o,cardHooks:r},`block-${i}`))})},Ef=tT;var oT=({content:e,isStreaming:t=true,onComplete:o,className:r="",streamIntervalMs:a=24,streamChunkSize:n=3,messageId:i,cardHooks:c})=>{let[d,l]=Qt.useState(t?0:e.length),[s,g]=Qt.useState(!t);Qt.useEffect(()=>{if(t){l(0),g(false);return}l(e.length),g(true);},[e,t]),Qt.useEffect(()=>{if(!t||s)return;if(d>=e.length){g(true),o?.();return}let u=window.setTimeout(()=>{l(C=>Math.min(C+n,e.length));},a);return ()=>{window.clearTimeout(u);}},[e.length,s,t,o,n,a,d]);let f=()=>{t&&!s&&(l(e.length),g(true),o?.());},p=t?e.slice(0,d):e,b=t&&!s,y=t&&!s;return jsxRuntime.jsxs("div",{className:`streaming-markdown ${r}`,onClick:f,style:{cursor:t?"pointer":"default"},children:[jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx(Ef,{content:p,messageId:i,cardHooks:c}),b&&jsxRuntime.jsx("span",{className:"inline-block w-0.5 h-5 bg-blue-500 ml-1 animate-pulse",style:{verticalAlign:"text-bottom"}})]}),y&&jsxRuntime.jsx("div",{className:"streaming-hint",style:{fontSize:"9px",color:"#999",marginTop:"8px",fontStyle:"italic",opacity:.7},children:"\u70B9\u51FB\u6B64\u5904\u663E\u793A\u5B8C\u6574\u5185\u5BB9"})]})},zf=oT;var Of=({buttons:e,className:t})=>{let o=r=>{switch(r){case "copy":return jsxRuntime.jsx(lucideReact.Copy,{size:14});case "refresh":return jsxRuntime.jsx(lucideReact.RefreshCw,{size:14});case "volume":return jsxRuntime.jsx(lucideReact.Volume2,{size:14});case "like":return jsxRuntime.jsx(lucideReact.ThumbsUp,{size:14});case "dislike":return jsxRuntime.jsx(lucideReact.ThumbsDown,{size:14});default:return null}};return jsxRuntime.jsx("div",{className:Je("flex items-center gap-1",t),children:e.map((r,a)=>jsxRuntime.jsx("button",{onClick:r.onClick,disabled:r.disabled,"aria-busy":r.loading||void 0,className:Je("p-1.5 rounded-md transition-colors","text-gray-500 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-100","hover:bg-gray-100 dark:hover:bg-gray-800","disabled:opacity-50 disabled:cursor-not-allowed",r.active&&"text-blue-600 bg-blue-50 dark:text-blue-400 dark:bg-blue-900/20",r.type==="refresh"&&r.loading&&"animate-spin"),title:r.type,type:"button",children:o(r.type)},`${r.type}-${a}`))})};var _s=({message:e,onStreamingComplete:t,assistantActions:o,streamIntervalMs:r,streamChunkSize:a,cardHooks:n})=>{if(e.type==="assistant"){let i=!!(o?.isResponding||e.isStreaming);return jsxRuntime.jsx("div",{className:"flex justify-start mb-4",children:jsxRuntime.jsxs("div",{className:"w-full bg-transparent text-black dark:text-gray-100 rounded-2xl px-4 py-3 mr-auto",style:{lineHeight:"1.5",fontSize:"16px",fontWeight:"280",fontFamily:'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'},children:[jsxRuntime.jsx(zf,{content:e.content,isStreaming:e.isStreaming??false,onComplete:t,streamIntervalMs:r,streamChunkSize:a,messageId:e.id,cardHooks:n}),e.content&&o?.isLatestAssistant&&jsxRuntime.jsx("div",{className:"flex flex-row justify-start gap-2 mt-3 pt-2 border-t border-gray-100 dark:border-gray-700",children:jsxRuntime.jsx(Of,{buttons:[{type:"refresh",onClick:()=>{o?.onRegenerate?.();},disabled:i||!o?.onRegenerate,loading:i},{type:"copy",onClick:()=>navigator.clipboard.writeText(e.content),disabled:false},{type:"volume",onClick:()=>console.log("\u8BED\u97F3\u64AD\u653E"),disabled:false},{type:"like",onClick:()=>console.log("\u70B9\u8D5E"),disabled:false},{type:"dislike",onClick:()=>console.log("\u70B9\u8E29"),disabled:false}],size:"sm",variant:"default"})}),jsxRuntime.jsx("div",{className:"text-xs mt-2 text-gray-500 dark:text-gray-400",children:e.timestamp.toLocaleTimeString()})]})})}return jsxRuntime.jsx("div",{className:"flex justify-end",children:jsxRuntime.jsxs("div",{className:"max-w-[80%] bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-100 rounded-2xl px-4 py-3 ml-auto",style:{lineHeight:"1.5",fontSize:"16px",fontWeight:"280",fontFamily:'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'},children:[jsxRuntime.jsx("div",{className:"whitespace-pre-wrap",style:{lineHeight:"1.5",fontSize:"16px",fontWeight:"280",fontFamily:'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'},children:e.content}),jsxRuntime.jsx("div",{className:"text-xs mt-2 text-gray-500 dark:text-gray-400",children:e.timestamp.toLocaleTimeString()})]})})};var Wf=({onTextUpdate:e,onComplete:t,onCancel:o,disabled:r,className:a})=>{let{isRecording:n,startRecording:i,stopRecording:c}=Rn({onTextUpdate:e,onComplete:l=>{t?.(l);},onError:l=>{console.error("Voice input error:",l),o?.();}});return jsxRuntime.jsx("button",{onClick:async()=>{n?c():await i();},disabled:r,className:Je("transition-all duration-200 flex items-center justify-center rounded-full",n?"bg-red-100 text-red-600 hover:bg-red-200 animate-pulse":"bg-transparent hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-500 dark:text-gray-400 active:scale-95",r&&"opacity-50 cursor-not-allowed",a),title:n?"Stop recording":"Start recording",type:"button",children:n?jsxRuntime.jsx(cT__default.default,{sx:{fontSize:24}}):jsxRuntime.jsx(sT__default.default,{sx:{fontSize:24}})})};var Jt={container:"w-full max-w-4xl mx-auto",inputContainer:Je("w-full border backdrop-blur-xl transition-all duration-300 shadow-2xl flex flex-col","bg-white/80 dark:bg-gray-900/80","border-gray-200/60 dark:border-gray-600/40","shadow-gray-900/5","hover:border-blue-300/80 hover:shadow-blue-500/10 hover:shadow-2xl","focus-within:border-blue-400/90 focus-within:shadow-blue-500/20 focus-within:shadow-3xl focus-within:scale-[1.005] transform-gpu"),dragActive:"border-blue-500 bg-blue-50/50 dark:bg-blue-900/20",textareaWrapper:"flex-1 relative flex items-center",textarea:Je("w-full outline-none appearance-none resize-none bg-transparent border-none text-sm font-normal py-3 px-2","placeholder:text-gray-400/70 dark:placeholder:text-gray-500/60 placeholder:font-normal","text-gray-800 dark:text-gray-100 selection:bg-blue-200/50 dark:selection:bg-blue-500/30","focus:ring-0 focus:outline-none focus:border-none focus:shadow-none","min-h-[44px] max-h-[12em] overflow-y-auto scrollbar-thin scrollbar-thumb-gray-300 dark:scrollbar-thumb-gray-600"),filePreviewArea:"px-6 pt-3 pb-1 flex flex-wrap gap-2",fileTag:Je("flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs font-medium","bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300","border border-gray-200 dark:border-gray-700","transition-all hover:bg-gray-200 dark:hover:bg-gray-700"),buttonBase:"flex items-center justify-center transition-all duration-200 rounded-full",buttonSmall:"w-10 h-10",buttonNormal:Je("bg-transparent hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-500 dark:text-gray-400","cursor-pointer active:scale-95"),sendButton:Je("cursor-pointer bg-transparent hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-500 dark:text-gray-400 shadow-none active:scale-95"),sendButtonDisabled:Je("cursor-not-allowed opacity-40 bg-transparent text-gray-400"),stopButton:Je("cursor-pointer bg-red-500 hover:bg-red-600 text-white shadow-sm active:scale-95")},bT={padding:0,lineHeight:"1.5",border:"none !important",boxShadow:"none !important",backgroundColor:"transparent",height:"auto",fontFeatureSettings:'"liga" 1, "kern" 1',WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},yT=({enabled:e,onClick:t})=>jsxRuntime.jsx("button",{className:Je(Jt.buttonBase,Jt.buttonSmall,Jt.buttonNormal),onClick:t,disabled:!e,"aria-label":"Upload file",type:"button",children:jsxRuntime.jsx(VC__default.default,{sx:{fontSize:24}})}),xT=()=>jsxRuntime.jsxs("button",{className:Je(Jt.buttonBase,"h-10 px-3 py-2 gap-1.5 rounded-full",Jt.buttonNormal),"aria-label":"Tools",type:"button",children:[jsxRuntime.jsx(hT__default.default,{sx:{fontSize:20}}),jsxRuntime.jsx("span",{className:"text-sm font-medium",children:"Tools"})]}),vT=({canSend:e,isResponding:t,onSend:o,onStop:r})=>t?jsxRuntime.jsx("button",{className:Je(Jt.buttonBase,Jt.buttonSmall,Jt.stopButton),onClick:r,"aria-label":"Stop generating",type:"button",children:jsxRuntime.jsx(iconsMaterial.Stop,{sx:{fontSize:20}})}):jsxRuntime.jsx("button",{className:Je(Jt.buttonBase,Jt.buttonSmall,e?Jt.sendButton:Jt.sendButtonDisabled),onClick:o,disabled:!e,"aria-label":"Send message",type:"button",children:jsxRuntime.jsx(gT__default.default,{sx:{fontSize:24},className:e?"text-gray-500 dark:text-gray-400":"text-gray-300 dark:text-gray-600"})}),Hf=({onSend:e,onStop:t,isResponding:o=false,placeholder:r,getText:a})=>{let[n,i]=Qt.useState(""),[c,d]=Qt.useState([]),[l,s]=Qt.useState(false),[g,f]=Qt.useState(false),p=Qt.useRef(null),b=r||(a?a("00019","Type a message..."):"Type a message..."),y=(n.trim().length>0||c.length>0)&&!o,u={enabled:true},C=Qt.useCallback(B=>{i(B.target.value),B.target.style.height="auto",B.target.style.height=`${Math.min(B.target.scrollHeight,200)}px`;},[]),m=Qt.useCallback(B=>{if(B.target.files&&B.target.files.length>0){let X=Array.from(B.target.files);d(L=>{let Z=X.filter(q=>L.some(H=>H.name===q.name&&H.size===q.size));Z.length>0&&console.warn("Duplicate files ignored:",Z.map(q=>q.name));let $=X.filter(q=>!L.some(H=>H.name===q.name&&H.size===q.size));return [...L,...$]}),p.current&&(p.current.value="");}},[]),h=Qt.useCallback(B=>{d(X=>X.filter((L,Z)=>Z!==B));},[]),x=Qt.useCallback(()=>{p.current?.click();},[]),w=Qt.useCallback(async()=>{if(!y)return;let B=n,X=[...c];i(""),d([]),p.current&&(p.current.value="");try{await e(B,X);}catch(L){console.error("Failed to send message:",L),i(B),d(X);}},[n,y,e,c]),E=Qt.useCallback(B=>{B.key==="Enter"&&!B.shiftKey&&!l&&(B.preventDefault(),w());},[w,l]),R=Qt.useCallback(()=>{s(true);},[]),T=Qt.useCallback(()=>{s(false);},[]),I=Qt.useCallback(B=>{i(B);},[]),k=Qt.useCallback(B=>{i(B);},[]),S=Qt.useCallback(()=>{},[]),D=Qt.useCallback(B=>{B.preventDefault(),f(true);},[]),P=Qt.useCallback(B=>{B.preventDefault(),f(false);},[]),M=Qt.useCallback(B=>{if(B.preventDefault(),f(false),B.dataTransfer.files&&B.dataTransfer.files.length>0){let X=Array.from(B.dataTransfer.files);d(L=>[...L,...X]);}},[]);return jsxRuntime.jsx("div",{className:Jt.container,children:jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("input",{type:"file",multiple:true,className:"hidden",ref:p,onChange:m}),jsxRuntime.jsxs("div",{className:Je(Jt.inputContainer,g&&Jt.dragActive),style:{borderRadius:"32px"},onDragOver:D,onDragLeave:P,onDrop:M,children:[c.length>0&&jsxRuntime.jsx("div",{className:Jt.filePreviewArea,children:c.map((B,X)=>jsxRuntime.jsxs("div",{className:Jt.fileTag,children:[jsxRuntime.jsx(iconsMaterial.InsertDriveFile,{sx:{fontSize:16},className:"text-blue-500"}),jsxRuntime.jsx("span",{className:"truncate max-w-[150px]",children:B.name}),jsxRuntime.jsx("button",{onClick:()=>h(X),className:"ml-1 hover:text-red-500 focus:outline-none",type:"button",children:jsxRuntime.jsx(iconsMaterial.Close,{sx:{fontSize:16}})})]},`${B.name}-${X}`))}),jsxRuntime.jsxs("div",{className:"flex flex-col w-full p-2",children:[jsxRuntime.jsx("div",{className:Je(Jt.textareaWrapper,"px-3 pt-2 pb-3 min-h-[60px]"),children:jsxRuntime.jsx("textarea",{className:Je(Jt.textarea,"min-h-[24px] py-0 px-0"),placeholder:b,value:n,onChange:C,onKeyDown:E,onCompositionStart:R,onCompositionEnd:T,style:bT,"aria-label":"Message input",spellCheck:false,rows:1})}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-1 pb-1",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-1",role:"toolbar","aria-label":"Input tools",children:[jsxRuntime.jsx(yT,{enabled:u.enabled,onClick:x}),jsxRuntime.jsx(xT,{})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Wf,{onTextUpdate:I,onComplete:k,onCancel:S,disabled:o,className:Jt.buttonSmall}),jsxRuntime.jsx(vT,{canSend:y,isResponding:o,onSend:w,onStop:t})]})]})]})]})]})})};var Uf=({messages:e,onSend:t,onStop:o,onRegenerate:r,isResponding:a=false,className:n,placeholder:i,streamIntervalMs:c,streamChunkSize:d,onMessageStreamingComplete:l,cardHooks:s,showInput:g=true})=>{let f=Qt.useRef(null),p=Qt.useRef(e.length);return Qt.useEffect(()=>{e.length>p.current&&f.current?.scrollIntoView({behavior:"smooth"}),p.current=e.length;},[e]),jsxRuntime.jsxs("div",{className:Je("flex flex-col h-full w-full relative",n),children:[jsxRuntime.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-4 space-y-6 scrollbar-thin scrollbar-thumb-gray-300 dark:scrollbar-thumb-gray-600",children:[e.map((b,y)=>{let u=b.type==="assistant"&&y===e.length-1,C=b.type==="assistant"?{isLatestAssistant:u,isResponding:a,onRegenerate:r?()=>r(b.id):void 0}:void 0;return jsxRuntime.jsx(_s,{message:b,assistantActions:C,onStreamingComplete:()=>l?.(b.id),streamIntervalMs:c,streamChunkSize:d,cardHooks:s},b.id)}),jsxRuntime.jsx("div",{ref:f})]}),g&&jsxRuntime.jsx("div",{className:"p-4 bg-gradient-to-t from-white via-white to-transparent dark:from-gray-900 dark:via-gray-900 pb-8 z-10",children:jsxRuntime.jsx(Hf,{onSend:t||(async()=>{}),onStop:o||(()=>{}),isResponding:a,placeholder:i})})]})};var Xo={};var kT={idle:"Idle",running:"Running",success:"Success",error:"Error",pending:"Pending"},_f=({title:e="AI Agent",description:t,headerActions:o,className:r,agentStatus:a,onHeaderPointerDown:n,showInput:i=false,...c})=>{let d=a??(c.isResponding?"running":"idle");return jsxRuntime.jsxs("div",{className:Je("relative flex h-full w-full",Xo.agentPanel,r),"data-status":d,children:[jsxRuntime.jsx("div",{className:Xo.colorHalo,"data-status":d,"aria-hidden":"true"}),jsxRuntime.jsxs("div",{className:Xo.marqueeBorder,"data-status":d,"aria-hidden":"true",children:[jsxRuntime.jsx("span",{className:Je(Xo.edge,Xo.top)}),jsxRuntime.jsx("span",{className:Je(Xo.edge,Xo.right)}),jsxRuntime.jsx("span",{className:Je(Xo.edge,Xo.bottom)}),jsxRuntime.jsx("span",{className:Je(Xo.edge,Xo.left)})]}),jsxRuntime.jsxs("div",{className:"relative z-10 flex h-full w-full flex-col rounded-xl border border-slate-200/70 bg-white shadow-sm overflow-hidden dark:border-slate-800 dark:bg-gray-950",children:[jsxRuntime.jsxs("div",{className:Je("flex items-center justify-between px-6 py-4 border-b border-gray-100 dark:border-gray-800 bg-white/50 dark:bg-gray-900/50 backdrop-blur-sm z-20",n&&"cursor-grab active:cursor-grabbing"),onPointerDown:n,children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100",children:e}),t&&jsxRuntime.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5",children:t})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsxs("div",{className:"inline-flex items-center gap-1.5 px-2 py-1 rounded-full bg-gray-100/80 dark:bg-gray-800/70",children:[jsxRuntime.jsx("span",{className:Xo.statusDot,"data-status":d}),jsxRuntime.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-gray-600 dark:text-gray-300",children:kT[d]})]}),o]})]}),jsxRuntime.jsx("div",{className:"flex-1 min-h-0 relative z-10",children:jsxRuntime.jsx(Uf,{...c,showInput:i})})]})]})};var jf=520,IT=88,PT=88,RT=24,js=640,Xf=(e,t,o)=>Math.min(Math.max(e,t),Math.max(t,o)),Jd=e=>typeof e=="number"?`${e}px`:e,MT=e=>e instanceof HTMLElement?!!e.closest('button,input,a,textarea,select,[role="button"],[contenteditable="true"]'):false,r8=({anchor:e,defaultAnchor:t="right",onAnchorChange:o,width:r=jf,top:a=IT,bottom:n=PT,inset:i=RT,zIndex:c=1300,shellClassName:d,shellStyle:l,className:s,onHeaderPointerDown:g,...f})=>{let p=Qt.useRef(null),b=Qt.useRef(null),[y,u]=Qt.useState(t),[C,m]=Qt.useState(0),[h,x]=Qt.useState(typeof r=="number"?r:jf),[w,E]=Qt.useState(0),[R,T]=Qt.useState(false),I=e??y;Qt.useEffect(()=>{let L=()=>m(window.innerWidth);return L(),window.addEventListener("resize",L),()=>window.removeEventListener("resize",L)},[]),Qt.useLayoutEffect(()=>{let L=()=>{let $=p.current?.getBoundingClientRect();$?.width?x($.width):typeof r=="number"&&x(r);};if(L(),!p.current||typeof ResizeObserver>"u")return;let Z=new ResizeObserver(L);return Z.observe(p.current),()=>Z.disconnect()},[r]);let k=Qt.useCallback(L=>{if(!C)return i;let Z=C<js?12:i,$=Math.max(Z,C-h-Z);return C<js||L==="left"?Z:L==="center"?Xf((C-h)/2,Z,$):$},[i,h,C]),S=Qt.useCallback(L=>["left","center","right"].reduce(($,q)=>{let H=Math.abs(L-k($));return Math.abs(L-k(q))<H?q:$},"right"),[k]),D=Qt.useCallback(L=>{e===void 0&&u(L),o?.(L);},[e,o]);Qt.useEffect(()=>{R||E(k(I));},[k,R,I]);let P=Qt.useCallback(L=>{g?.(L),!(L.defaultPrevented||MT(L.target))&&(L.preventDefault(),L.currentTarget.setPointerCapture(L.pointerId),b.current={pointerId:L.pointerId,startClientX:L.clientX,startX:w,currentX:w,captureElement:L.currentTarget},T(true));},[g,w]),M=Qt.useCallback(L=>{let Z=b.current;if(!Z||Z.pointerId!==L.pointerId)return;let $=C<js?12:i,q=Math.max($,C-h-$),H=Xf(Z.startX+L.clientX-Z.startClientX,$,q);Z.currentX=H,E(H);},[i,h,C]),B=Qt.useCallback(L=>{let Z=b.current;if(!Z||Z.pointerId!==L.pointerId)return;try{Z.captureElement.releasePointerCapture(L.pointerId);}catch{}let $=S(Z.currentX);b.current=null,T(false),D($),E(k($));},[k,D,S]),X=Qt.useMemo(()=>({position:"fixed",top:Jd(a),bottom:Jd(n),left:w,width:Jd(r),maxWidth:`calc(100vw - ${C<js?24:i*2}px)`,zIndex:c,pointerEvents:"auto",transition:R?"none":"left 180ms ease-out",touchAction:"none",...l}),[n,i,R,w,l,a,C,r,c]);return jsxRuntime.jsx("div",{ref:p,className:Je("orbcafe-floating-agent-panel min-w-0",d),"data-anchor":I,"data-dragging":R?"true":"false",style:X,onPointerMove:M,onPointerUp:B,onPointerCancel:B,children:jsxRuntime.jsx(_f,{...f,className:s,onHeaderPointerDown:P})})};var FT={"top-left":"bottom-right","top-right":"bottom-left","bottom-left":"top-right","bottom-right":"top-left"},u8=({messages:e,onSend:t,onRegenerate:o,isResponding:r=false,className:a,placeholder:n,title:i="Copilot",corner:c="bottom-right",onCollapse:d,onHeaderPointerDown:l,onPlusClick:s,onMicClick:g,streamIntervalMs:f,streamChunkSize:p,onMessageStreamingComplete:b,cardHooks:y})=>{let[u,C]=Qt.useState(""),[m,h]=Qt.useState(false),x=Qt.useRef(null),w=FT[c];Qt.useEffect(()=>{x.current?.scrollIntoView({behavior:"smooth"});},[e,r]);let E=Qt.useCallback(async()=>{let T=u.trim();!T||r||(C(""),await t(T));},[r,t,u]),R=Qt.useCallback(async T=>{T.key==="Enter"&&!m&&(T.preventDefault(),await E());},[E,m]);return jsxRuntime.jsxs("div",{className:Je("relative flex h-full w-full min-h-[460px] min-w-[340px] flex-col overflow-hidden rounded-3xl border border-gray-200 bg-white shadow-none dark:border-gray-800 dark:bg-gray-900",a),children:[d&&jsxRuntime.jsx("button",{onClick:d,className:Je("absolute z-20 flex h-10 w-10 items-center justify-center rounded-full transition-colors hover:bg-transparent dark:hover:bg-transparent",w==="top-left"&&"-left-2 -top-2",w==="top-right"&&"-right-2 -top-2",w==="bottom-left"&&"-bottom-2 -left-2",w==="bottom-right"&&"-bottom-2 -right-2"),type:"button","aria-label":"Collapse Copilot",children:jsxRuntime.jsx("span",{className:Je("block h-4 w-4 border-[#21BCFF]",w==="top-left"&&"rounded-tl-full border-l-[3px] border-t-[3px]",w==="top-right"&&"rounded-tr-full border-r-[3px] border-t-[3px]",w==="bottom-left"&&"rounded-bl-full border-b-[3px] border-l-[3px]",w==="bottom-right"&&"rounded-br-full border-b-[3px] border-r-[3px]")})}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between border-b border-gray-100 px-4 py-3 dark:border-gray-800",onPointerDown:l,children:[jsxRuntime.jsx("div",{className:"flex items-center",children:jsxRuntime.jsx("h3",{className:"text-base font-semibold tracking-tight text-gray-900 dark:text-gray-100",children:i})}),jsxRuntime.jsx("div",{})]}),jsxRuntime.jsxs("div",{className:"flex-1 overflow-y-auto px-3 py-3 space-y-5 scrollbar-thin scrollbar-thumb-gray-300 dark:scrollbar-thumb-gray-600",children:[e.map((T,I)=>{let k=T.type==="assistant"&&I===e.length-1,S=T.type==="assistant"?{isLatestAssistant:k,isResponding:r,onRegenerate:o?()=>o(T.id):void 0}:void 0;return jsxRuntime.jsx(_s,{message:T,assistantActions:S,onStreamingComplete:()=>b?.(T.id),streamIntervalMs:f,streamChunkSize:p,cardHooks:y},T.id)}),jsxRuntime.jsx("div",{ref:x})]}),jsxRuntime.jsx("div",{className:"border-t border-gray-100 px-3 py-3 dark:border-gray-800",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-2 rounded-xl border border-blue-300/80 bg-white px-2 py-1.5 dark:bg-gray-900",children:[jsxRuntime.jsx("button",{className:"flex h-8 w-8 items-center justify-center rounded-full text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-700 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-gray-200",onClick:s,type:"button","aria-label":"Add",children:jsxRuntime.jsx(lucideReact.Plus,{className:"h-4 w-4"})}),jsxRuntime.jsx("input",{className:"h-7 flex-1 border-none bg-transparent text-sm text-gray-800 outline-none placeholder:text-gray-400 dark:text-gray-100 dark:placeholder:text-gray-500",placeholder:n||"Ask Copilot...",value:u,onChange:T=>C(T.target.value),onCompositionStart:()=>h(true),onCompositionEnd:()=>h(false),onKeyDown:R,"aria-label":"Copilot input",spellCheck:false}),jsxRuntime.jsx("button",{className:"flex h-8 w-8 items-center justify-center rounded-full text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-700 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-gray-200",onClick:g,type:"button","aria-label":"Microphone",children:jsxRuntime.jsx(lucideReact.Mic,{className:"h-4 w-4"})})]})})]})};var LT=["#ff3860","#24e070","#3090ff"],NT=`
196
+ ${o}: ${(a??r)(u.secondaryValue??0)}`:""]})}),jsxRuntime.jsx("text",{x:u.x,y:Math.max(u.y-12,d.top+8),textAnchor:"middle",fontSize:"10",fill:n.palette.text.secondary,children:u.name})]},u.name)),jsxRuntime.jsx("text",{x:i/2,y:c-10,textAnchor:"middle",fontSize:"11",fill:n.palette.text.secondary,children:o?t:"Index"}),jsxRuntime.jsx("text",{x:16,y:c/2,textAnchor:"middle",transform:`rotate(-90 16 ${c/2})`,fontSize:"11",fill:n.palette.text.secondary,children:o??t}),jsxRuntime.jsx("text",{x:d.left,y:d.top-4,fontSize:"10",fill:n.palette.text.secondary,children:yg(g)}),jsxRuntime.jsx("text",{x:i-d.right,y:c-d.bottom+16,textAnchor:"end",fontSize:"10",fill:n.palette.text.secondary,children:yg(m)})]})}),jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",lg:"repeat(3, minmax(0, 1fr))"},gap:1},children:e.map(u=>jsxRuntime.jsxs(material.Box,{sx:x=>({borderRadius:2,px:1.25,py:1,border:`1px solid ${styles.alpha(x.palette.divider,.7)}`,bgcolor:styles.alpha(x.palette.background.default,.35)}),children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.78rem",fontWeight:700},noWrap:true,title:u.name,children:u.name}),jsxRuntime.jsxs(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:[t,": ",r(u.primaryValue)]}),o&&jsxRuntime.jsxs(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:[o,": ",(a??r)(u.secondaryValue??0)]})]},u.name))})]})};var Md=e=>Math.max(...e,1),Cg=({data:e,chartType:t,primaryLabel:o,secondaryLabel:r,formatPrimaryValue:a,formatSecondaryValue:n})=>{let i=styles.useTheme(),c=i.palette.primary.main,d=i.palette.warning.main;if(e.length===0)return null;if(t==="bar-horizontal"){let f=Md(e.flatMap(h=>[h.primaryValue,h.secondaryValue??0]));return jsxRuntime.jsx(material.Stack,{spacing:1.1,children:e.map(h=>jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",md:"160px 1fr 128px"},gap:1.25,alignItems:"center"},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.78rem",fontWeight:700},noWrap:true,title:h.name,children:h.name}),jsxRuntime.jsxs(material.Stack,{spacing:.65,children:[jsxRuntime.jsx(material.Box,{sx:{height:10,borderRadius:999,overflow:"hidden",bgcolor:styles.alpha(i.palette.action.active,.08)},children:jsxRuntime.jsx(material.Box,{sx:{width:`${h.primaryValue/f*100}%`,height:"100%",bgcolor:c}})}),r&&jsxRuntime.jsx(material.Box,{sx:{height:8,borderRadius:999,overflow:"hidden",bgcolor:styles.alpha(i.palette.action.active,.08)},children:jsxRuntime.jsx(material.Box,{sx:{width:`${(h.secondaryValue??0)/f*100}%`,height:"100%",bgcolor:d}})})]}),jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",textAlign:{xs:"left",md:"right"},fontWeight:700},children:a(h.primaryValue)}),r&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",textAlign:{xs:"left",md:"right"},color:"text.secondary"},children:(n??a)(h.secondaryValue??0)})]})]},h.name))})}if(t==="bar-vertical"){let f=Md(e.flatMap(v=>[v.primaryValue,v.secondaryValue??0])),h=r?92:76;return jsxRuntime.jsx(material.Box,{sx:{overflowX:"auto",pb:.5},children:jsxRuntime.jsx(material.Box,{sx:{minWidth:Math.max(620,e.length*h),display:"grid",gridTemplateColumns:`repeat(${e.length}, minmax(56px, 1fr))`,gap:1,alignItems:"end"},children:e.map(v=>jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsxs(material.Box,{sx:{height:210,display:"flex",alignItems:"flex-end",justifyContent:"center",gap:.8},children:[jsxRuntime.jsx(material.Box,{sx:{width:r?16:26,minHeight:8,height:`${Math.max(v.primaryValue/f*188,8)}px`,borderRadius:"10px 10px 2px 2px",bgcolor:c},title:`${o}: ${a(v.primaryValue)}`}),r&&jsxRuntime.jsx(material.Box,{sx:{width:16,minHeight:8,height:`${Math.max((v.secondaryValue??0)/f*188,8)}px`,borderRadius:"10px 10px 2px 2px",bgcolor:d},title:`${r}: ${(n??a)(v.secondaryValue??0)}`})]}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.76rem",fontWeight:700},noWrap:true,title:v.name,children:v.name}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.7rem",color:"text.secondary"},noWrap:true,title:a(v.primaryValue),children:a(v.primaryValue)}),r&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.7rem",color:"text.secondary"},noWrap:true,title:(n??a)(v.secondaryValue??0),children:(n??a)(v.secondaryValue??0)})]},v.name))})})}let l=Math.max(680,e.length*74),s=240,m={top:20,right:18,bottom:36,left:18},g=Md(e.flatMap(f=>[f.primaryValue,f.secondaryValue??0])),p=l-m.left-m.right,b=s-m.top-m.bottom,y=f=>e.map((h,v)=>{let S=m.left+v*p/Math.max(e.length-1,1),E=s-m.bottom-f(h)/g*b;return {x:S,y:E,item:h}}),u=y(f=>f.primaryValue),x=r?y(f=>f.secondaryValue??0):[];return jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:1.1},children:[jsxRuntime.jsx(material.Box,{sx:{overflowX:"auto"},children:jsxRuntime.jsxs(material.Box,{component:"svg",viewBox:`0 0 ${l} ${s}`,sx:{width:"100%",minWidth:l,height:s},children:[jsxRuntime.jsx("line",{x1:m.left,y1:s-m.bottom,x2:l-m.right,y2:s-m.bottom,stroke:styles.alpha(i.palette.text.secondary,.35)}),jsxRuntime.jsx("polyline",{fill:"none",stroke:c,strokeWidth:3,points:u.map(f=>`${f.x},${f.y}`).join(" ")}),u.map(f=>jsxRuntime.jsx("circle",{cx:f.x,cy:f.y,r:4,fill:c,children:jsxRuntime.jsxs("title",{children:[f.item.name,`
197
+ `,o,": ",a(f.item.primaryValue)]})},`primary-${f.item.name}`)),r&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("polyline",{fill:"none",stroke:d,strokeWidth:2.5,strokeDasharray:"5 5",points:x.map(f=>`${f.x},${f.y}`).join(" ")}),x.map(f=>jsxRuntime.jsx("circle",{cx:f.x,cy:f.y,r:3.5,fill:d,children:jsxRuntime.jsxs("title",{children:[f.item.name,`
198
+ `,r,": ",(n??a)(f.item.secondaryValue??0)]})},`secondary-${f.item.name}`))]})]})}),jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",xl:"repeat(4, minmax(0, 1fr))"},gap:1},children:e.map(f=>jsxRuntime.jsxs(material.Box,{sx:h=>({borderRadius:2,px:1.1,py:.9,border:`1px solid ${styles.alpha(h.palette.divider,.7)}`,bgcolor:styles.alpha(h.palette.background.default,.35)}),children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.76rem",fontWeight:700},noWrap:true,title:f.name,children:f.name}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.71rem",color:"text.secondary"},children:a(f.primaryValue)}),r&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.71rem",color:"text.secondary"},children:(n??a)(f.secondaryValue??0)})]},f.name))})]})};var Sg=(e,t,o)=>{let r=new Set,a=[];return e.forEach(n=>{r.has(n)||(r.add(n),a.push({fieldId:n,label:o.get(n)?.label??n,zone:"rows"}));}),t.forEach(n=>{r.has(n)||(r.add(n),a.push({fieldId:n,label:o.get(n)?.label??n,zone:"columns"}));}),a},kg=(e,t,o)=>e.map(r=>{let a=t.get(r.fieldId),n=a?.label??r.fieldId;return {fieldId:r.fieldId,label:`${o(r.aggregation)} \xB7 ${n}`,item:r,field:a}}),wg=({rows:e,dimensionFieldId:t,primaryValue:o,secondaryValue:r})=>{if(!t)return [];let a=new Map;return e.forEach(n=>{let i=jr(n[t]),c=a.get(i);if(c){c.push(n);return}a.set(i,[n]);}),Array.from(a.entries()).sort((n,i)=>n[0].localeCompare(i[0],void 0,{sensitivity:"base"})).map(([n,i])=>({name:n,primaryValue:Fn(i,o.fieldId,o.aggregation),secondaryValue:r?Fn(i,r.fieldId,r.aggregation):void 0}))};var Tg=({rows:e,fieldMap:t,rowFields:o,columnFields:r,valueFields:a,chartDimensionFieldId:n,chartPrimaryValueFieldId:i,chartSecondaryValueFieldId:c,chartType:d,isCollapsed:l,onChartDimensionFieldIdChange:s,onChartPrimaryValueFieldIdChange:m,onChartSecondaryValueFieldIdChange:g,onChartTypeChange:p,onToggleCollapse:b,getAggregationLabel:y})=>{let{t:u}=le(),x=Yt.useMemo(()=>Sg(o,r,t),[r,t,o]),f=Yt.useMemo(()=>kg(a,t,y),[t,y,a]),h=f.find(k=>k.fieldId===i)??f[0],v=f.find(k=>k.fieldId===c&&k.fieldId!==h?.fieldId)??null,S=x.find(k=>k.fieldId===n)??x[0],E=S&&h?u("pivot.chart.subtitleReady",{dimension:S.label,measure:v?`${h.label} / ${v.label}`:h.label}):u("pivot.chart.subtitle"),P=Yt.useMemo(()=>!S||!h?[]:wg({rows:e,dimensionFieldId:S.fieldId,primaryValue:h.item,secondaryValue:v?.item}),[h,e,v,S]),w=k=>h?$i(k,h.item,t):k.toLocaleString(),D=k=>v?$i(k,v.item,t):k.toLocaleString(),I=x.length>1||f.length>1;return jsxRuntime.jsxs(Vn,{title:u("pivot.chart.title"),subtitle:E,collapsed:l,onToggleCollapse:b,expandAriaLabel:u("pivot.chart.collapse.ariaExpand"),collapseAriaLabel:u("pivot.chart.collapse.ariaCollapse"),bodySx:{display:"flex",flexDirection:"column",gap:1.1},children:[I&&jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",xl:"repeat(4, minmax(0, 1fr))"},gap:1,alignItems:"start"},children:[jsxRuntime.jsxs(material.FormControl,{size:"small",sx:{minWidth:0,width:"100%"},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.68rem",color:"text.secondary",mb:.45},children:u("pivot.chart.dimension")}),jsxRuntime.jsx(material.Select,{value:S?.fieldId??"",onChange:k=>s(String(k.target.value)),sx:{fontSize:"0.75rem",height:32},children:x.map(k=>jsxRuntime.jsx(material.MenuItem,{value:k.fieldId,sx:{fontSize:"0.75rem"},children:k.label},k.fieldId))})]}),jsxRuntime.jsxs(material.FormControl,{size:"small",sx:{minWidth:0,width:"100%"},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.68rem",color:"text.secondary",mb:.45},children:u("pivot.chart.primaryMeasure")}),jsxRuntime.jsx(material.Select,{value:h?.fieldId??"",onChange:k=>m(String(k.target.value)),sx:{fontSize:"0.75rem",height:32},children:f.map(k=>jsxRuntime.jsx(material.MenuItem,{value:k.fieldId,sx:{fontSize:"0.75rem"},children:k.label},k.fieldId))})]}),jsxRuntime.jsxs(material.FormControl,{size:"small",sx:{minWidth:0,width:"100%"},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.68rem",color:"text.secondary",mb:.45},children:u("pivot.chart.secondaryMeasure")}),jsxRuntime.jsxs(material.Select,{value:v?.fieldId??"",onChange:k=>g(String(k.target.value)),sx:{fontSize:"0.75rem",height:32},children:[jsxRuntime.jsx(material.MenuItem,{value:"",sx:{fontSize:"0.75rem",color:"text.secondary"},children:u("common.none")}),f.filter(k=>k.fieldId!==h?.fieldId).map(k=>jsxRuntime.jsx(material.MenuItem,{value:k.fieldId,sx:{fontSize:"0.75rem"},children:k.label},k.fieldId))]})]}),jsxRuntime.jsxs(material.FormControl,{size:"small",sx:{minWidth:0,width:"100%"},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.68rem",color:"text.secondary",mb:.45},children:u("pivot.chart.chartType")}),jsxRuntime.jsxs(material.Select,{value:d,onChange:k=>p(k.target.value),sx:{fontSize:"0.75rem",height:32},children:[jsxRuntime.jsx(material.MenuItem,{value:"bar-vertical",sx:{fontSize:"0.75rem"},children:u("pivot.chart.style.barVertical")}),jsxRuntime.jsx(material.MenuItem,{value:"bar-horizontal",sx:{fontSize:"0.75rem"},children:u("pivot.chart.style.barHorizontal")}),jsxRuntime.jsx(material.MenuItem,{value:"line",sx:{fontSize:"0.75rem"},children:u("pivot.chart.style.line")}),jsxRuntime.jsx(material.MenuItem,{value:"scatter",sx:{fontSize:"0.75rem"},children:u("pivot.chart.style.scatter")})]})]})]}),jsxRuntime.jsx(material.Box,{children:S?h?P.length===0?jsxRuntime.jsx(material.Box,{sx:{py:5,textAlign:"center"},children:jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.86rem",color:"text.secondary"},children:u("pivot.chart.emptyNoData")})}):d==="scatter"?jsxRuntime.jsx(xg,{data:P,primaryLabel:h.label,secondaryLabel:v?.label,formatPrimaryValue:w,formatSecondaryValue:D}):jsxRuntime.jsx(Cg,{data:P,chartType:d,primaryLabel:h.label,secondaryLabel:v?.label,formatPrimaryValue:w,formatSecondaryValue:D}):jsxRuntime.jsx(material.Box,{sx:{py:5,textAlign:"center"},children:jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.86rem",color:"text.secondary"},children:u("pivot.chart.emptyNoValue")})}):jsxRuntime.jsx(material.Box,{sx:{py:5,textAlign:"center"},children:jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.86rem",color:"text.secondary"},children:u("pivot.chart.emptyNoDimension")})})})]})};var Rs=({node:e,dataColumns:t,fieldMap:o,level:r,expandedKeys:a,onToggle:n,getValue:i})=>{let c=a.has(e.key),d=e.children.length>0,l=e.isGrandTotal;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(material.TableRow,{sx:s=>({bgcolor:l?s.palette.mode==="dark"?"rgba(25, 118, 210, 0.22)":"rgba(47, 91, 255, 0.08)":s.palette.mode==="dark"?"#111111":"background.paper","&:hover":{bgcolor:l?s.palette.mode==="dark"?"rgba(25, 118, 210, 0.28)":"rgba(47, 91, 255, 0.12)":s.palette.mode==="dark"?"#181818":"rgba(0, 0, 0, 0.02)"}}),children:[jsxRuntime.jsxs(material.TableCell,{sx:s=>({fontSize:"0.76rem",fontWeight:l?800:600,borderBottom:`1px solid ${s.palette.divider}`,whiteSpace:"nowrap",pl:r*2+1,display:"flex",alignItems:"center",height:40}),children:[d&&!l&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>n(e.key),sx:{p:.2,mr:.5,ml:-1},children:c?jsxRuntime.jsx(vy__default.default,{sx:{fontSize:16}}):jsxRuntime.jsx(ph__default.default,{sx:{fontSize:16}})}),!d&&!l&&r>0&&jsxRuntime.jsx(material.Box,{sx:{width:20}}),e.value]}),t.map(s=>jsxRuntime.jsx(material.TableCell,{align:"right",sx:{fontSize:"0.76rem",fontWeight:l?800:500,borderBottom:m=>`1px solid ${m.palette.divider}`,whiteSpace:"nowrap"},children:$i(i?i(e,s.id):e.aggregatedValues[s.id]??0,s.valueItem,o)},`${e.key}-${s.id}`))]}),c&&e.children.map(s=>jsxRuntime.jsx(Rs,{node:s,dataColumns:t,fieldMap:o,level:r+1,expandedKeys:a,onToggle:n,getValue:i},s.key))]})};var Fd=(e,t,o)=>{let r=[...e,...t];return o&&r.includes(o)?o:r[0]??""},As=(e,t)=>t&&e.some(o=>o.fieldId===t)?t:e[0]?.fieldId??"",Ld=(e,t,o)=>o===""?"":o&&o!==t&&e.some(r=>r.fieldId===o)?o:e.find(r=>r.fieldId!==t)?.fieldId??"",Bg=e=>{let t=new Set,o=r=>{r.forEach(a=>{a.children.length>0&&(t.add(a.key),o(a.children));});};return o(e),t},Fg=(e,t,o=0)=>e.length===0?o:e.reduce((r,a)=>a.children.length===0||!t.has(a.key)?Math.max(r,o+1):Math.max(r,Fg(a.children,t,o+1)),o),Ck=(e,t)=>{let o=[],r=a=>{a.forEach(n=>{if(n.children.length>0&&t.has(n.key)){r(n.children);return}o.push(n);});};return r(e),o},$L=({title:e,rows:t,fields:o,initialLayout:r,initialChart:a,emptyText:n,maxPreviewHeight:i=520,initialChartCollapsed:c=false,initialTableCollapsed:d=false,model:l,enablePresetManagement:s=false,presets:m,defaultPresets:g,onPresetsChange:p,initialPresetId:b,onPresetApplied:y})=>{let{t:u}=le(),x=core.useSensors(core.useSensor(core.PointerSensor,{activationConstraint:{distance:8}})),f=Yt.useRef(0),h=Yt.useRef(false),v=e??u("pivot.title.default"),S=n??u("pivot.empty"),E=Yt.useMemo(()=>({sum:u("pivot.agg.sum"),count:u("pivot.agg.count"),avg:u("pivot.agg.avg"),min:u("pivot.agg.min"),max:u("pivot.agg.max")}),[u]),P=Yt.useCallback(C=>E[C]??eg[C],[E]),w=Yt.useMemo(()=>new Set(o.map(C=>C.id)),[o]),D=Yt.useMemo(()=>new Map(o.map(C=>[C.id,C])),[o]),[I,k]=Yt.useState(()=>io(r?.rows,w)),[A,T]=Yt.useState(()=>io(r?.columns,w)),[R,M]=Yt.useState(()=>io(r?.filters,w)),[Z,L]=Yt.useState(()=>{let C=r?.values??[],N=new Set,z=[];return C.forEach(oe=>{if(!w.has(oe.fieldId)||N.has(oe.fieldId))return;N.add(oe.fieldId),f.current+=1;let ye=D.get(oe.fieldId);z.push({tokenId:`v${f.current}`,fieldId:oe.fieldId,aggregation:Ro(oe.aggregation,ye)});}),z}),[ee,H]=Yt.useState({}),[q,$]=Yt.useState(true),[ie,ue]=Yt.useState(false),[Ce,te]=Yt.useState(()=>Fd(io(r?.rows,w),io(r?.columns,w),a?.dimensionFieldId)),[j,Y]=Yt.useState(()=>{let C=(r?.values??[]).filter((N,z,oe)=>w.has(N.fieldId)&&oe.findIndex(ye=>ye.fieldId===N.fieldId)===z).map(N=>({tokenId:N.fieldId,fieldId:N.fieldId,aggregation:Ro(N.aggregation,D.get(N.fieldId))}));return As(C,a?.primaryValueFieldId)}),[de,We]=Yt.useState(()=>{let C=(r?.values??[]).filter((z,oe,ye)=>w.has(z.fieldId)&&ye.findIndex(Ue=>Ue.fieldId===z.fieldId)===oe).map(z=>({tokenId:z.fieldId,fieldId:z.fieldId,aggregation:Ro(z.aggregation,D.get(z.fieldId))})),N=As(C,a?.primaryValueFieldId);return Ld(C,N,a?.secondaryValueFieldId)}),[$e,me]=Yt.useState(a?.chartType??"bar-vertical"),[Ne,rt]=Yt.useState(c),[he,Le]=Yt.useState(d),[He,Xe]=Yt.useState(()=>g??[]),[qe,K]=Yt.useState(""),[Fe,be]=Yt.useState(false),[ke,et]=Yt.useState(""),[Te,lt]=Yt.useState(null),[Ct,Mt]=Yt.useState(new Set(["__grand_total__"])),[Jt,X]=Yt.useState(new Set),_e=l?.rowFields??I,J=l?.columnFields??A,G=l?.filterFields??R,F=l?.valueFields??Z,re=l?.filterSelections??ee,ve=l?.showGrandTotal??q,Se=l?.isConfiguratorCollapsed??ie,Ke=l?.chartDimensionFieldId??Ce,st=l?.chartPrimaryValueFieldId??j,Ye=l?.chartSecondaryValueFieldId??de,ft=l?.chartType??$e,xt=l?.isChartCollapsed??Ne,ao=l?.isTableCollapsed??he,ht=m??He,Bo=s||ht.length>0||!!p,so=Yt.useCallback(C=>{if(l?.setRowFields){l.setRowFields(C);return}k(C);},[l]),Et=Yt.useCallback(C=>{if(l?.setColumnFields){l.setColumnFields(C);return}T(C);},[l]),$t=Yt.useCallback(C=>{if(l?.setFilterFields){l.setFilterFields(C);return}M(C);},[l]),vt=Yt.useCallback(C=>{if(l?.setValueFields){l.setValueFields(C);return}L(C);},[l]),no=Yt.useCallback(C=>{if(l?.setFilterSelections){l.setFilterSelections(C);return}H(C);},[l]),O=Yt.useCallback(C=>{if(l?.setShowGrandTotal){l.setShowGrandTotal(C);return}$(C);},[l]),W=Yt.useCallback(C=>{if(l?.setIsConfiguratorCollapsed){l.setIsConfiguratorCollapsed(C);return}ue(C);},[l]),_=Yt.useCallback(C=>{if(l?.setChartDimensionFieldId){l.setChartDimensionFieldId(C);return}te(C);},[l]),fe=Yt.useCallback(C=>{if(l?.setChartPrimaryValueFieldId){l.setChartPrimaryValueFieldId(C);return}Y(C);},[l]),ge=Yt.useCallback(C=>{if(l?.setChartSecondaryValueFieldId){l.setChartSecondaryValueFieldId(C);return}We(C);},[l]),Ae=Yt.useCallback(C=>{if(l?.setChartType){l.setChartType(C);return}me(C);},[l]),je=Yt.useCallback(C=>{if(l?.setIsChartCollapsed){l.setIsChartCollapsed(C);return}rt(C);},[l]),Ze=Yt.useCallback(C=>{if(l?.setIsTableCollapsed){l.setIsTableCollapsed(C);return}Le(C);},[l]),tt=Yt.useCallback(C=>{let N=typeof C=="function"?C(ht):C;m||Xe(N),p?.(N);},[p,ht,m]),Dt=Yt.useMemo(()=>new Set([..._e,...J,...G]),[_e,J,G]),ut=Yt.useMemo(()=>o.filter(C=>!Dt.has(C.id)),[o,Dt]),pt=Yt.useMemo(()=>{let C=[..._e,...J,...G],N=new Set,z=[];return C.forEach(oe=>{N.has(oe)||(N.add(oe),z.push(oe));}),z},[J,G,_e]);Yt.useEffect(()=>{so(C=>{let N=C.filter(z=>w.has(z));return Xr(C,N)?C:N}),Et(C=>{let N=C.filter(z=>w.has(z));return Xr(C,N)?C:N}),$t(C=>{let N=C.filter(z=>w.has(z));return Xr(C,N)?C:N}),vt(C=>{let N=C.filter(z=>w.has(z.fieldId)).map(z=>({...z,aggregation:Ro(z.aggregation,D.get(z.fieldId))}));return bs(C,N)?C:N});},[D,w]);let St=Yt.useMemo(()=>{let C={};return pt.forEach(N=>{let z=new Set;t.forEach(oe=>{z.add(jr(oe[N]));}),C[N]=Array.from(z).sort((oe,ye)=>oe.localeCompare(ye));}),C},[pt,t]);Yt.useEffect(()=>{no(C=>{let N={};return pt.forEach(z=>{let oe=St[z]??[],Ue=(C[z]??[]).filter(Oe=>oe.includes(Oe)),Re=Object.prototype.hasOwnProperty.call(C,z);N[z]=Re?Ue:oe;}),ig(C,N)?C:N});},[pt,St]),Yt.useEffect(()=>{_(C=>Fd(_e,J,C));},[J,_e,_]),Yt.useEffect(()=>{fe(C=>As(F,C));},[fe,F]),Yt.useEffect(()=>{ge(C=>Ld(F,st,C));},[st,ge,F]);let Vt=Yt.useMemo(()=>t.filter(C=>pt.every(N=>{let z=re[N]??[],oe=St[N]??[];if(z.length===oe.length)return true;if(z.length===0)return false;let ye=jr(C[N]);return z.includes(ye)})),[pt,St,re,t]),ct=Yt.useMemo(()=>{if(F.length===0)return null;let C=new Map;if(Vt.forEach(Re=>{let Oe=J.length>0?J.map(Ee=>jr(Re[Ee])):[u("pivot.valueLabel")],U=Ua(Oe);C.set(U,Oe);}),C.size===0){let Re=J.length>0?J.map(()=>fs):[u("pivot.valueLabel")];C.set(Ua(Re),Re);}let N=Array.from(C.entries()).sort((Re,Oe)=>ng(Re[1],Oe[1])),z=N.flatMap(([Re,Oe])=>F.map(U=>{let Ee=D.get(U.fieldId),V=`${P(U.aggregation)} ${Ee?.label??U.fieldId}`,pe=J.length===0||F.length>1?`${Oe.join(" / ")} \u2022 ${V}`:Oe.join(" / ");return {id:`${Re}::${U.tokenId}`,colKey:Re,valueItem:U,label:pe}})),oe=[];J.length>0&&N.forEach(([Re,Oe])=>{let U=z.filter(pe=>pe.colKey===Re),Ee=oe,V=[];Oe.forEach((pe,ne)=>{V.push(`d${ne}:${pe}`);let Me=`col::${Ua(V)}`,kt=Ee.find(wr=>wr.key===Me);kt||(kt={key:Me,label:pe,children:[],leafColumnIds:[],path:Oe.slice(0,ne+1),depth:ne},Ee.push(kt)),U.forEach(wr=>{kt.leafColumnIds.includes(wr.id)||kt.leafColumnIds.push(wr.id);}),Ee=kt.children;});});let ye=Re=>{let Oe={};return z.forEach(U=>{let Ee=Re.filter(V=>{let pe=J.length>0?J.map(ne=>jr(V[ne])):[u("pivot.valueLabel")];return Ua(pe)===U.colKey});Oe[U.id]=Fn(Ee,U.valueItem.fieldId,U.valueItem.aggregation);}),Oe},Ue=[];if(_e.length===0)Ue.push({key:"root",value:u("pivot.resultLabel")||Qm,children:[],isLeaf:true,aggregatedValues:ye(Vt),path:[],depth:0});else {let Re=(Oe,U,Ee)=>{if(U>=_e.length)return [];let V=_e[U],pe=new Map;return Oe.forEach(ne=>{let Me=jr(ne[V]);pe.has(Me)||pe.set(Me,[]),pe.get(Me).push(ne);}),Array.from(pe.keys()).sort().map(ne=>{let Me=pe.get(ne),kt=[...Ee,ne];return {key:Ua(kt),value:ne,fieldId:V,aggregatedValues:ye(Me),children:Re(Me,U+1,kt),isLeaf:U===_e.length-1,path:kt,depth:U}})};Ue.push(...Re(Vt,0,[]));}return {dataColumns:z,columnTree:oe,rowTree:Ue}},[J,D,Vt,P,_e,u,F]),Eo=Yt.useCallback((C,N)=>(f.current+=1,{tokenId:`v${f.current}`,fieldId:C,aggregation:Ro(N,D.get(C))}),[D]),wo=Yt.useCallback(C=>{if(C==="rows")return so([]);if(C==="columns")return Et([]);if(C==="filters")return $t([]);vt([]);},[]),Jo=Yt.useCallback((C,N)=>{if(C==="rows")return so(z=>z.filter(oe=>oe!==N));if(C==="columns")return Et(z=>z.filter(oe=>oe!==N));if(C==="filters")return $t(z=>z.filter(oe=>oe!==N));vt(z=>z.filter(oe=>oe.tokenId!==N));},[]),B=Yt.useCallback((C,N)=>{vt(z=>z.map(oe=>oe.tokenId===C?{...oe,aggregation:Ro(N,D.get(oe.fieldId))}:oe));},[D]),Q=Yt.useCallback(C=>{lt(String(C.active.id));},[]),ae=Yt.useCallback(C=>{if(lt(null),!C.over)return;let N=hs(String(C.active.id)),z=hs(String(C.over.id));if(!N||!z||N.kind!=="item"||!N.key)return;if(N.zone===z.zone&&z.kind==="item"){if(N.zone==="rows"){let ne=_e.indexOf(N.key),Me=_e.indexOf(z.key??"");ne!==-1&&Me!==-1&&ne!==Me&&so(kt=>sortable.arrayMove(kt,ne,Me));return}if(N.zone==="columns"){let ne=J.indexOf(N.key),Me=J.indexOf(z.key??"");ne!==-1&&Me!==-1&&ne!==Me&&Et(kt=>sortable.arrayMove(kt,ne,Me));return}if(N.zone==="filters"){let ne=G.indexOf(N.key),Me=G.indexOf(z.key??"");ne!==-1&&Me!==-1&&ne!==Me&&$t(kt=>sortable.arrayMove(kt,ne,Me));return}if(N.zone==="values"){let ne=F.findIndex(kt=>kt.tokenId===N.key),Me=F.findIndex(kt=>kt.tokenId===(z.key??""));ne!==-1&&Me!==-1&&ne!==Me&&vt(kt=>sortable.arrayMove(kt,ne,Me));}return}let oe=z.zone,ye=[..._e],Ue=[...J],Re=[...G],Oe=[...F],U="",Ee=null;if(N.zone==="palette")U=N.key;else if(N.zone==="values"){let ne=Oe.find(Me=>Me.tokenId===N.key);if(!ne)return;U=ne.fieldId,Ee=ne,Oe=Oe.filter(Me=>Me.tokenId!==N.key);}else N.zone==="rows"?(U=N.key,ye=ye.filter(ne=>ne!==U)):N.zone==="columns"?(U=N.key,Ue=Ue.filter(ne=>ne!==U)):N.zone==="filters"&&(U=N.key,Re=Re.filter(ne=>ne!==U));if(!U)return;let V=()=>{ye=ye.filter(ne=>ne!==U),Ue=Ue.filter(ne=>ne!==U),Re=Re.filter(ne=>ne!==U);},pe=ne=>{if(z.kind!=="item"||!z.key)return ne==="rows"?ye.length:ne==="columns"?Ue.length:ne==="filters"?Re.length:ne==="values"?Oe.length:0;if(ne==="rows"){let Me=ye.indexOf(z.key);return Me>=0?Me:ye.length}if(ne==="columns"){let Me=Ue.indexOf(z.key);return Me>=0?Me:Ue.length}if(ne==="filters"){let Me=Re.indexOf(z.key);return Me>=0?Me:Re.length}if(ne==="values"){let Me=Oe.findIndex(kt=>kt.tokenId===z.key);return Me>=0?Me:Oe.length}return 0};if(oe==="palette"){so(ye),Et(Ue),$t(Re),vt(Oe);return}if(oe==="values"){let ne=pe("values"),Me=Ee??Eo(U);Oe.splice(ne,0,Me),so(ye),Et(Ue),$t(Re),vt(Oe);return}if(ag(oe)){V();let ne=pe(oe);oe==="rows"?ye.splice(ne,0,U):oe==="columns"?Ue.splice(ne,0,U):Re.splice(ne,0,U),so(ye),Et(Ue),$t(Re),vt(Oe);}},[J,Eo,G,_e,F]),ce=Yt.useCallback((C,N)=>{no(z=>({...z,[C]:N}));},[]),Be=Yt.useCallback(C=>{Mt(N=>{let z=new Set(N);return z.has(C)?z.delete(C):z.add(C),z});},[]),Ge=Yt.useCallback(C=>{X(N=>{let z=new Set(N);return z.has(C)?z.delete(C):z.add(C),z});},[]),mt=Yt.useCallback(C=>{let N=D.get(C.fieldId),z=Cd(N);return jsxRuntime.jsx(material.FormControl,{size:"small",sx:{minWidth:98},children:jsxRuntime.jsx(material.Select,{value:C.aggregation,onChange:oe=>B(C.tokenId,oe.target.value),onClick:oe=>oe.stopPropagation(),onMouseDown:oe=>oe.stopPropagation(),sx:{fontSize:"0.72rem",height:26,"& .MuiSelect-select":{py:.35}},children:z.map(oe=>jsxRuntime.jsx(material.MenuItem,{value:oe,sx:{fontSize:"0.75rem"},children:P(oe)},oe))})})},[D,P,B]),Pe=Yt.useCallback(C=>{let N=St[C]??[],z=re[C]??N;return N.length===0?u("pivot.filter.noValues"):z.length===0?u("pivot.filter.noneSelected"):z.length===N.length?u("pivot.filter.allValues"):u("pivot.filter.selectedCount",{selected:z.length,total:N.length})},[St,re,u]),dt=Yt.useCallback(C=>{let N=St[C]??[],z=re[C]??N;return jsxRuntime.jsx(cg,{options:N,selectedValues:z,onChange:oe=>ce(C,oe)})},[St,re,ce]),at=Yt.useCallback(()=>`pivot-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,[]),It=Yt.useCallback(()=>{let C={};return new Set([...pt,...Object.keys(re)]).forEach(z=>{if(!w.has(z))return;let oe=re[z]??[];C[z]=[...oe];}),{layout:{rows:[..._e],columns:[...J],filters:[...G],values:F.map(z=>({fieldId:z.fieldId,aggregation:z.aggregation}))},filterSelections:C,showGrandTotal:ve,chart:{dimensionFieldId:Ke,primaryValueFieldId:st,secondaryValueFieldId:Ye,chartType:ft}}},[pt,Ke,st,Ye,ft,J,G,re,_e,ve,w,F]),bt=Yt.useCallback(C=>{let N=io(C.layout.rows,w),z=io(C.layout.columns,w),oe=io(C.layout.filters,w),ye=new Set,Ue=(C.layout.values??[]).filter(U=>!w.has(U.fieldId)||ye.has(U.fieldId)?false:(ye.add(U.fieldId),true)).map(U=>Eo(U.fieldId,U.aggregation)),Re={};Object.entries(C.filterSelections??{}).forEach(([U,Ee])=>{!w.has(U)||!Array.isArray(Ee)||(Re[U]=Array.from(new Set(Ee.map(V=>String(V)))));}),so(N),Et(z),$t(oe),vt(Ue),no(Re),typeof C.showGrandTotal=="boolean"&&O(C.showGrandTotal),_(Fd(N,z,C.chart?.dimensionFieldId));let Oe=As(Ue,C.chart?.primaryValueFieldId);fe(Oe),ge(Ld(Ue,Oe,C.chart?.secondaryValueFieldId)),Ae(C.chart?.chartType??"bar-vertical"),K(C.id),y?.(C);},[Eo,y,_,fe,ge,Ae,Et,$t,no,so,O,vt,w]),eo=Yt.useCallback(C=>{if(!C){K("");return}let N=ht.find(z=>z.id===C);if(!N){K("");return}bt(N);},[bt,ht]),co=Yt.useCallback(()=>{let C=u("pivot.preset.defaultName",{index:ht.length+1});et(C),be(true);},[ht.length,u]),To=Yt.useCallback(()=>{let C=ke.trim();if(!C)return;let N={id:at(),name:C,...It()};tt(z=>[...z,N]),K(N.id),be(false);},[It,at,ke,tt]),jt=Yt.useCallback(()=>{qe&&(tt(C=>C.filter(N=>N.id!==qe)),K(""));},[qe,tt]);Yt.useEffect(()=>{if(!b||h.current)return;let C=ht.find(N=>N.id===b);C&&(h.current=true,bt(C));},[bt,b,ht]),Yt.useEffect(()=>{qe&&(ht.some(C=>C.id===qe)||K(""));},[qe,ht]);let vo=Yt.useMemo(()=>{if(!ve||!ct||!_e.length)return null;let C={};return ct.dataColumns.forEach(N=>{let z=Vt.filter(oe=>{let ye=J.length>0?J.map(Ue=>jr(oe[Ue])):[u("pivot.valueLabel")];return Ua(ye)===N.colKey});C[N.id]=Fn(z,N.valueItem.fieldId,N.valueItem.aggregation);}),{key:"__grand_total__",value:u("pivot.grandTotal")||Jm,children:[],isLeaf:false,isGrandTotal:true,aggregatedValues:C,path:[],depth:-1}},[ve,ct,Vt,J,_e.length,u]),Pt=Yt.useMemo(()=>Bg(ct?.rowTree??[]),[ct]),Gt=Yt.useMemo(()=>Bg(ct?.columnTree??[]),[ct]);Yt.useEffect(()=>{Mt(C=>{let N=new Set;return C.has("__grand_total__")&&N.add("__grand_total__"),Pt.forEach(z=>{C.has(z)&&N.add(z);}),N});},[Pt]),Yt.useEffect(()=>{X(C=>{let N=new Set;return Gt.forEach(z=>{C.has(z)&&N.add(z);}),N});},[Gt]);let cr=Yt.useCallback(()=>{Mt(C=>{let N=new Set(C);return Pt.forEach(z=>N.add(z)),N});},[Pt]),dr=Yt.useCallback(()=>{Mt(C=>{let N=new Set;return C.has("__grand_total__")&&N.add("__grand_total__"),N});},[]),rn=Yt.useCallback(()=>{X(new Set(Gt));},[Gt]),wa=Yt.useCallback(()=>{X(new Set);},[]),an=Yt.useMemo(()=>!ct||J.length===0?[]:Ck(ct.columnTree,Jt),[J.length,Jt,ct]),er=Yt.useMemo(()=>{if(!ct)return [];if(J.length===0)return ct.dataColumns.map(N=>({id:N.id,label:N.label,leafColumnIds:[N.id],valueItem:N.valueItem}));let C=new Map(ct.dataColumns.map(N=>[N.id,N]));return an.flatMap(N=>{let z=new Map;return N.leafColumnIds.forEach(oe=>{let ye=C.get(oe);if(!ye)return;let Ue=ye.valueItem.tokenId,Re=`${P(ye.valueItem.aggregation)} ${D.get(ye.valueItem.fieldId)?.label??ye.valueItem.fieldId}`,Oe=z.get(Ue);if(Oe){Oe.leafColumnIds.push(oe);return}z.set(Ue,{id:`${N.key}::${Ue}`,label:F.length>1?Re:N.label,leafColumnIds:[oe],valueItem:ye.valueItem});}),Array.from(z.values())})},[J.length,D,P,ct,F.length,an]),nn=Yt.useMemo(()=>new Map(er.map(C=>[C.id,C])),[er]),Ta=Yt.useMemo(()=>er.map(C=>({id:C.id,colKey:C.id,valueItem:C.valueItem,label:C.label})),[er]),Ia=Yt.useMemo(()=>{if(!ct||J.length===0)return [];let C=[],N=Fg(ct.columnTree,Jt),z=N+(F.length>1?1:0),oe=(ye,Ue)=>{C[Ue]??(C[Ue]=[]),ye.forEach(Re=>{let Oe=Re.children.length>0&&Jt.has(Re.key),U=er.filter(V=>Re.leafColumnIds.some(pe=>V.leafColumnIds.includes(pe))).length,Ee=Oe||F.length>1?1:z-Ue;C[Ue].push({key:Re.key,label:Re.label,colSpan:U,rowSpan:Ee,expandable:Re.children.length>0,expanded:Oe}),Oe&&oe(Re.children,Ue+1);});};return oe(ct.columnTree,0),F.length>1&&(C[N]=er.map(ye=>({key:ye.id,label:ye.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))),C},[J.length,Jt,ct,F.length,er]),Or=Yt.useCallback((C,N)=>N.leafColumnIds.reduce((z,oe)=>z+(C.aggregatedValues[oe]??0),0),[]),ra=Yt.useMemo(()=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.Button,{size:"small",variant:"text",onClick:cr,disabled:Pt.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:u("pivot.table.expandRowsAll")}),jsxRuntime.jsx(material.Button,{size:"small",variant:"text",onClick:dr,disabled:Pt.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:u("pivot.table.collapseRowsAll")}),jsxRuntime.jsx(material.Divider,{orientation:"vertical",flexItem:true}),jsxRuntime.jsx(material.Button,{size:"small",variant:"text",onClick:rn,disabled:Gt.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:u("pivot.table.expandColumnsAll")}),jsxRuntime.jsx(material.Button,{size:"small",variant:"text",onClick:wa,disabled:J.length===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:u("pivot.table.collapseColumnsAll")})]}),[J.length,Gt.size,Pt.size,wa,dr,rn,cr,u]),ni=()=>{if(!Te)return null;let C=hs(Te);if(!C||C.kind!=="item"||!C.key)return null;if(C.zone==="palette"){let ye=D.get(C.key);return ye?jsxRuntime.jsx(kd,{label:ye.label,subtitle:ye.type}):null}if(C.zone==="values"){let ye=F.find(U=>U.tokenId===C.key);if(!ye)return null;let Re=D.get(ye.fieldId)?.label??ye.fieldId,Oe=`${P(ye.aggregation)}(${Re})`;return jsxRuntime.jsx(Ss,{label:Re,caption:Oe})}let z=D.get(C.key)?.label??C.key,oe=Pe(C.key);return jsxRuntime.jsx(Ss,{label:z,caption:oe})};return jsxRuntime.jsxs(material.Paper,{sx:C=>({p:{xs:1.2,md:2},borderRadius:4,border:`1px solid ${C.palette.divider}`,bgcolor:"background.paper",boxShadow:C.palette.mode==="dark"?"none":"0 12px 28px rgba(15, 23, 42, 0.08)",display:"flex",flexDirection:"column",gap:2}),children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1.5,flexWrap:"wrap"},children:[jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1.05rem",fontWeight:800},children:v}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.78rem",color:"text.secondary"},children:u("pivot.subtitle.default")})]}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1.5,alignItems:"center",children:[Bo&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.FormControl,{size:"small",sx:{minWidth:200},children:jsxRuntime.jsxs(material.Select,{value:qe,displayEmpty:true,onChange:C=>eo(String(C.target.value)),sx:{fontSize:"0.75rem",height:32},children:[jsxRuntime.jsx(material.MenuItem,{value:"",sx:{fontSize:"0.75rem",color:"text.secondary"},children:u("pivot.preset.selectPlaceholder")}),ht.map(C=>jsxRuntime.jsx(material.MenuItem,{value:C.id,sx:{fontSize:"0.75rem"},children:C.name},C.id))]})}),jsxRuntime.jsx(material.Tooltip,{title:u("pivot.preset.save"),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:co,"aria-label":u("pivot.preset.save"),children:jsxRuntime.jsx(Yp__default.default,{sx:{fontSize:18}})})}),jsxRuntime.jsx(material.Tooltip,{title:u("pivot.preset.delete"),children:jsxRuntime.jsx("span",{children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:jt,disabled:!qe,"aria-label":u("pivot.preset.delete"),children:jsxRuntime.jsx(Oy__default.default,{sx:{fontSize:18}})})})}),jsxRuntime.jsx(material.Divider,{flexItem:true,orientation:"vertical"})]}),jsxRuntime.jsxs(material.Typography,{sx:{fontSize:"0.74rem",color:"text.secondary"},children:[u("pivot.records"),": ",jsxRuntime.jsx("strong",{children:t.length.toLocaleString()})," / ",u("pivot.afterFilter"),":"," ",jsxRuntime.jsx("strong",{children:Vt.length.toLocaleString()})]}),jsxRuntime.jsx(material.Divider,{flexItem:true,orientation:"vertical"}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:.6},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.74rem"},children:u("pivot.grandTotal")}),jsxRuntime.jsx(material.Switch,{size:"small",checked:ve,onChange:C=>O(C.target.checked)})]})]})]}),jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsxs(core.DndContext,{sensors:x,collisionDetection:core.closestCenter,onDragStart:Q,onDragEnd:ae,children:[jsxRuntime.jsx(bg,{isConfiguratorCollapsed:Se,onToggleCollapse:()=>W(C=>!C),availableFields:ut,fieldMap:D,filterFields:G,columnFields:J,rowFields:_e,valueFields:F,clearZone:wo,removeFieldFromZone:Jo,getFilterSelectionSummary:Pe,renderDimensionFilterSelect:dt,renderAggregationSelect:mt,getAggregationLabel:P}),jsxRuntime.jsx(material.Portal,{children:jsxRuntime.jsx(core.DragOverlay,{dropAnimation:{duration:250,easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)"},children:ni()})})]}),jsxRuntime.jsx(Tg,{rows:Vt,fieldMap:D,rowFields:_e,columnFields:J,valueFields:F,chartDimensionFieldId:Ke,chartPrimaryValueFieldId:st,chartSecondaryValueFieldId:Ye,chartType:ft,isCollapsed:xt,onChartDimensionFieldIdChange:C=>_(C),onChartPrimaryValueFieldIdChange:C=>fe(C),onChartSecondaryValueFieldIdChange:C=>ge(C),onChartTypeChange:C=>Ae(C),onToggleCollapse:()=>je(C=>!C),getAggregationLabel:P}),jsxRuntime.jsx(Vn,{title:u("pivot.table.sectionTitle"),subtitle:_e.length>0?_e.map(C=>D.get(C)?.label??C).join(" > "):u("pivot.table.dimensions"),collapsed:ao,onToggleCollapse:()=>Ze(C=>!C),expandAriaLabel:u("pivot.table.collapse.ariaExpand"),collapseAriaLabel:u("pivot.table.collapse.ariaCollapse"),bodySx:{p:0},headerActions:ra,children:ct===null?jsxRuntime.jsx(material.Box,{sx:{py:5,px:{xs:1.2,md:1.6},textAlign:"center"},children:jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.86rem",color:"text.secondary"},children:S})}):jsxRuntime.jsx(material.TableContainer,{sx:{maxHeight:i},children:jsxRuntime.jsxs(material.Table,{size:"small",stickyHeader:true,children:[jsxRuntime.jsx(material.TableHead,{children:(Ia.length>0?Ia:[[]]).map((C,N)=>jsxRuntime.jsxs(material.TableRow,{children:[N===0&&jsxRuntime.jsx(material.TableCell,{rowSpan:Math.max(Ia.length,1),sx:z=>({fontWeight:800,fontSize:"0.76rem",color:"text.primary",bgcolor:z.palette.mode==="dark"?"#000000":"#f5f5f5",borderBottom:`1px solid ${z.palette.divider}`,pl:2,minWidth:220,verticalAlign:"middle"}),children:_e.length>0?_e.map(z=>D.get(z)?.label).join(" > "):u("pivot.table.dimensions")}),(C.length>0?C:er.map(z=>({key:z.id,label:z.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))).map(z=>jsxRuntime.jsx(material.TableCell,{align:"center",colSpan:z.colSpan,rowSpan:z.rowSpan,sx:oe=>({fontWeight:800,fontSize:"0.75rem",color:"text.primary",bgcolor:oe.palette.mode==="dark"?"#000000":"#f5f5f5",borderBottom:`1px solid ${oe.palette.divider}`,minWidth:148,verticalAlign:"middle"}),children:jsxRuntime.jsxs(material.Box,{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:.4},children:[z.expandable&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>Ge(z.key),sx:{p:.1,ml:-0.3},children:z.expanded?jsxRuntime.jsx(vy__default.default,{sx:{fontSize:16}}):jsxRuntime.jsx(ph__default.default,{sx:{fontSize:16}})}),jsxRuntime.jsx(material.Box,{component:"span",children:z.label})]})},z.key))]},`pivot-header-row-${N}`))}),jsxRuntime.jsxs(material.TableBody,{children:[ct.rowTree.map(C=>jsxRuntime.jsx(Rs,{node:C,dataColumns:Ta,fieldMap:D,level:0,expandedKeys:Ct,onToggle:Be,getValue:(N,z)=>{let oe=nn.get(z);return oe?Or(N,oe):0}},C.key)),vo&&jsxRuntime.jsx(Rs,{node:vo,dataColumns:Ta,fieldMap:D,level:0,expandedKeys:Ct,onToggle:Be,getValue:(C,N)=>{let z=nn.get(N);return z?Or(C,z):0}})]})]})})}),jsxRuntime.jsxs(material.Dialog,{open:Fe,onClose:()=>be(false),maxWidth:"xs",fullWidth:true,children:[jsxRuntime.jsx(material.DialogTitle,{children:u("pivot.preset.saveDialogTitle")}),jsxRuntime.jsx(material.DialogContent,{children:jsxRuntime.jsx(material.TextField,{autoFocus:true,fullWidth:true,margin:"dense",label:u("pivot.preset.nameLabel"),value:ke,onChange:C=>et(C.target.value),onKeyDown:C=>{C.key==="Enter"&&(C.preventDefault(),To());}})}),jsxRuntime.jsxs(material.DialogActions,{children:[jsxRuntime.jsx(material.Button,{onClick:()=>be(false),children:u("common.cancel")}),jsxRuntime.jsx(material.Button,{variant:"contained",onClick:To,disabled:!ke.trim(),children:u("common.save")})]})]})]})};var Lg=(e,t,o)=>{let r=[...e,...t];return o&&r.includes(o)?o:r[0]??""},zd=(e,t)=>t&&e.some(o=>o.fieldId===t)?t:e[0]?.fieldId??"",Ng=(e,t,o)=>o===""?"":o&&o!==t&&e.some(r=>r.fieldId===o)?o:e.find(r=>r.fieldId!==t)?.fieldId??"",qL=({fields:e,initialLayout:t,initialFilterSelections:o={},initialShowGrandTotal:r=true,initialConfiguratorCollapsed:a=false,initialChart:n,initialChartCollapsed:i=false,initialTableCollapsed:c=false})=>{let d=Yt.useRef(0),l=Yt.useMemo(()=>new Set(e.map(K=>K.id)),[e]),s=Yt.useMemo(()=>new Map(e.map(K=>[K.id,K])),[e]),[m,g]=Yt.useState(()=>io(t?.rows,l)),[p,b]=Yt.useState(()=>io(t?.columns,l)),[y,u]=Yt.useState(()=>io(t?.filters,l)),[x,f]=Yt.useState(()=>{let K=t?.values??[],Fe=new Set,be=[];return K.forEach(ke=>{!l.has(ke.fieldId)||Fe.has(ke.fieldId)||(Fe.add(ke.fieldId),d.current+=1,be.push({tokenId:`v${d.current}`,fieldId:ke.fieldId,aggregation:Ro(ke.aggregation,s.get(ke.fieldId))}));}),be}),[h,v]=Yt.useState(o),[S,E]=Yt.useState(r),[P,w]=Yt.useState(a),[D,I]=Yt.useState(()=>Lg(io(t?.rows,l),io(t?.columns,l),n?.dimensionFieldId)),[k,A]=Yt.useState(()=>{let K=(()=>{let Fe=t?.values??[],be=new Set,ke=[];return Fe.forEach(et=>{!l.has(et.fieldId)||be.has(et.fieldId)||(be.add(et.fieldId),ke.push({tokenId:et.fieldId,fieldId:et.fieldId,aggregation:Ro(et.aggregation,s.get(et.fieldId))}));}),ke})();return zd(K,n?.primaryValueFieldId)}),[T,R]=Yt.useState(()=>{let K=(()=>{let be=t?.values??[],ke=new Set,et=[];return be.forEach(Te=>{!l.has(Te.fieldId)||ke.has(Te.fieldId)||(ke.add(Te.fieldId),et.push({tokenId:Te.fieldId,fieldId:Te.fieldId,aggregation:Ro(Te.aggregation,s.get(Te.fieldId))}));}),et})(),Fe=zd(K,n?.primaryValueFieldId);return Ng(K,Fe,n?.secondaryValueFieldId)}),[M,Z]=Yt.useState(n?.chartType??"bar-vertical"),[L,ee]=Yt.useState(i),[H,q]=Yt.useState(c);Yt.useEffect(()=>{g(K=>{let Fe=K.filter(be=>l.has(be));return Xr(K,Fe)?K:Fe}),b(K=>{let Fe=K.filter(be=>l.has(be));return Xr(K,Fe)?K:Fe}),u(K=>{let Fe=K.filter(be=>l.has(be));return Xr(K,Fe)?K:Fe}),f(K=>{let Fe=K.filter(be=>l.has(be.fieldId)).map(be=>({...be,aggregation:Ro(be.aggregation,s.get(be.fieldId))}));return bs(K,Fe)?K:Fe});},[s,l]),Yt.useEffect(()=>{I(K=>Lg(m,p,K));},[p,m]),Yt.useEffect(()=>{A(K=>zd(x,K));},[x]),Yt.useEffect(()=>{R(K=>Ng(x,k,K));},[k,x]);let $=Yt.useCallback(K=>{g(io(K,l));},[l]),ie=Yt.useCallback(K=>{b(io(K,l));},[l]),ue=Yt.useCallback(K=>{u(io(K,l));},[l]),Ce=Yt.useCallback(K=>{f(Fe=>{let be=K??[],ke=new Set,et=[];return be.forEach(Te=>{if(!l.has(Te.fieldId)||ke.has(Te.fieldId))return;ke.add(Te.fieldId);let lt=Fe.find(Ct=>Ct.fieldId===Te.fieldId);if(lt){et.push({...lt,aggregation:Ro(Te.aggregation??lt.aggregation,s.get(Te.fieldId))});return}d.current+=1,et.push({tokenId:`v${d.current}`,fieldId:Te.fieldId,aggregation:Ro(Te.aggregation,s.get(Te.fieldId))});}),et});},[s,l]),te=Yt.useCallback(K=>{$(K.rows??[]),ie(K.columns??[]),ue(K.filters??[]),Ce(K.values??[]);},[ie,ue,$,Ce]),j=Yt.useCallback(K=>{if(K==="rows")return g([]);if(K==="columns")return b([]);if(K==="filters")return u([]);f([]);},[]),Y=Yt.useCallback((K,Fe)=>{if(K==="rows")return g(be=>be.filter(ke=>ke!==Fe));if(K==="columns")return b(be=>be.filter(ke=>ke!==Fe));if(K==="filters")return u(be=>be.filter(ke=>ke!==Fe));f(be=>be.filter(ke=>ke.tokenId!==Fe));},[]),de=Yt.useCallback((K,Fe)=>{f(be=>be.map(ke=>ke.tokenId===K?{...ke,aggregation:Ro(Fe,s.get(ke.fieldId))}:ke));},[s]),We=Yt.useCallback((K,Fe)=>{v(be=>({...be,[K]:Fe}));},[]),$e=Yt.useCallback(()=>{v({});},[]),me=Yt.useCallback(()=>{E(K=>!K);},[]),Ne=Yt.useCallback(()=>{w(K=>!K);},[]),rt=Yt.useCallback(K=>{I(K);},[]),he=Yt.useCallback(K=>{A(K);},[]),Le=Yt.useCallback(K=>{R(K);},[]),He=Yt.useCallback(()=>{ee(K=>!K);},[]),Xe=Yt.useCallback(()=>{q(K=>!K);},[]);return {model:Yt.useMemo(()=>({rowFields:m,setRowFields:g,columnFields:p,setColumnFields:b,filterFields:y,setFilterFields:u,valueFields:x,setValueFields:f,filterSelections:h,setFilterSelections:v,showGrandTotal:S,setShowGrandTotal:E,isConfiguratorCollapsed:P,setIsConfiguratorCollapsed:w,chartDimensionFieldId:D,setChartDimensionFieldId:I,chartPrimaryValueFieldId:k,setChartPrimaryValueFieldId:A,chartSecondaryValueFieldId:T,setChartSecondaryValueFieldId:R,chartType:M,setChartType:Z,isChartCollapsed:L,setIsChartCollapsed:ee,isTableCollapsed:H,setIsTableCollapsed:q}),[D,k,T,M,p,y,h,L,P,H,m,S,x]),actions:{setRows:$,setColumns:ie,setFilters:ue,setValues:Ce,setLayout:te,clearZone:j,removeFieldFromZone:Y,setAggregationForValue:de,setFilterSelection:We,resetFilterSelections:$e,toggleGrandTotal:me,toggleConfigurator:Ne,setChartDimension:rt,setChartPrimaryValue:he,setChartSecondaryValue:Le,setChartType:Z,toggleChart:He,toggleTable:Xe}}};var QL=({orientation:e="auto",defaultNavigationOpen:t,onNavOpenChange:o}={})=>{let r=styles.useTheme(),a=material.useMediaQuery("(orientation: portrait)",{noSsr:true}),n=material.useMediaQuery(r.breakpoints.down("md"),{noSsr:true}),i=Yt.useMemo(()=>e==="auto"?a||n?"portrait":"landscape":e,[n,a,e]),[c,d]=Yt.useState(t??i==="landscape");Yt.useEffect(()=>{d(t??i==="landscape");},[t,i]);let l=m=>{d(m),o?.(m);};return {resolvedOrientation:i,isPortraitViewport:a,isCompactViewport:n,navigationOpen:c,setNavigationOpen:l,toggleNavigationOpen:()=>l(!c)}};var Rk=e=>{let t=Number(e||0);return Number.isFinite(t)?t:0},tN=({rows:e,rowKey:t="id",numericField:o,defaultSelectedId:r})=>{let n=e[0]?.[t],[i,c]=Yt.useState(r??n),d=Yt.useMemo(()=>e.find(p=>p[t]===i)||e[0],[t,e,i]),[l,s]=Yt.useState(()=>{let p=d?.[o];return p==null?"0":String(p)});return {selectedId:i,selectedRecord:d,editorValue:l,setEditorValue:s,selectRecord:p=>{let b=p[t];c(b);let y=p[o];s(y==null?"0":String(y));},applyEditorValue:p=>{if(i===void 0)return;let b=Rk(l),y=e.map(u=>u[t]===i?{...u,[o]:b}:u);p(y);}}};var Vk=["code_128","ean_13","ean_8","qr_code","upc_a","upc_e"],$g=(e,t,o,r)=>{t?.(e),r&&o?.();},lN=({open:e,onClose:t,title:o="Scan barcode",subtitle:r="Use the rear camera on the device. If scanning is unavailable, enter the code manually.",formats:a=Vk,facingMode:n="environment",manualEntry:i=true,autoCloseOnDetect:c=true,scanIntervalMs:d=600,confirmLabel:l="Use code",cancelLabel:s="Close",manualPlaceholder:m="Enter barcode manually",onDetected:g,onError:p,sx:b})=>{let y=Yt__namespace.default.useRef(null),u=Yt__namespace.default.useRef(null),x=Yt__namespace.default.useRef(null),f=Yt__namespace.default.useRef(null),[h,v]=Yt__namespace.default.useState("idle"),[S,E]=Yt__namespace.default.useState(""),[P,w]=Yt__namespace.default.useState(null),[D,I]=Yt__namespace.default.useState(null),k=Yt__namespace.default.useCallback(()=>{x.current!==null&&(window.clearInterval(x.current),x.current=null),u.current&&(u.current.getTracks().forEach(R=>R.stop()),u.current=null),y.current&&(y.current.srcObject=null);},[]),A=Yt__namespace.default.useCallback(R=>{I(R),v("error"),p?.(R);},[p]);Yt__namespace.default.useEffect(()=>{if(!e){k(),v("idle"),I(null),E("");return}let R=false;return (async()=>{if(!(typeof window>"u"||typeof navigator>"u")){if(!navigator.mediaDevices?.getUserMedia){v("unsupported"),I("Camera access is not supported in this browser.");return}v("starting"),I(null);try{let Z=await navigator.mediaDevices.getUserMedia({audio:!1,video:{facingMode:{ideal:n}}});if(R){Z.getTracks().forEach(L=>L.stop());return}if(u.current=Z,y.current&&(y.current.srcObject=Z,await y.current.play()),!window.BarcodeDetector){v("unsupported"),I("BarcodeDetector is not available. Camera preview is ready and manual entry is enabled.");return}f.current=new window.BarcodeDetector({formats:a}),v("ready"),x.current=window.setInterval(async()=>{if(!(!y.current||!f.current)&&!(y.current.readyState<HTMLMediaElement.HAVE_CURRENT_DATA))try{let ee=(await f.current.detect(y.current)).find(q=>q.rawValue);if(!ee?.rawValue)return;let H={rawValue:ee.rawValue,format:ee.format};w(H),k(),$g(H,g,t,c);}catch(L){A(L instanceof Error?L.message:"Failed to detect barcode.");}},d);}catch(Z){A(Z instanceof Error?Z.message:"Unable to start camera.");}}})(),()=>{R=true,k();}},[c,n,a,t,g,e,A,d,k]);let T=()=>{let R=S.trim();if(!R)return;let M={rawValue:R,format:"manual"};w(M),$g(M,g,t,c);};return jsxRuntime.jsxs(material.Dialog,{open:e,onClose:t,fullWidth:true,maxWidth:"sm",children:[jsxRuntime.jsx(material.DialogTitle,{sx:{fontSize:"1rem",fontWeight:900},children:o}),jsxRuntime.jsx(material.DialogContent,{sx:{pt:"8px !important"},children:jsxRuntime.jsxs(material.Stack,{spacing:2,sx:b,children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.88rem",color:"text.secondary",lineHeight:1.55},children:r}),jsxRuntime.jsxs(material.Paper,{elevation:0,sx:R=>({position:"relative",overflow:"hidden",borderRadius:4,border:"1px solid",borderColor:"divider",minHeight:280,background:R.palette.mode==="dark"?"linear-gradient(180deg, rgba(15,23,42,0.92), rgba(2,6,23,0.96))":"linear-gradient(180deg, rgba(241,245,249,1), rgba(226,232,240,0.92))"}),children:[jsxRuntime.jsx("video",{ref:y,muted:true,playsInline:true,autoPlay:true,style:{width:"100%",height:280,objectFit:"cover",display:"block"}}),jsxRuntime.jsx(material.Box,{sx:{pointerEvents:"none",position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center"},children:jsxRuntime.jsx(material.Box,{sx:{width:"72%",maxWidth:320,aspectRatio:"1.7 / 1",borderRadius:3,border:"2px solid rgba(255,255,255,0.95)",boxShadow:"0 0 0 999px rgba(15,23,42,0.24)",position:"relative"},children:jsxRuntime.jsx(material.Box,{sx:{position:"absolute",top:"50%",left:0,right:0,height:2,bgcolor:"#38bdf8",boxShadow:"0 0 18px rgba(56,189,248,0.85)"}})})}),jsxRuntime.jsxs(material.Box,{sx:{position:"absolute",top:12,left:12,display:"flex",gap:1,flexWrap:"wrap"},children:[jsxRuntime.jsx(material.Chip,{icon:jsxRuntime.jsx(zk__default.default,{}),label:h==="ready"?"Camera ready":h==="starting"?"Starting camera":h==="unsupported"?"Preview only":h==="error"?"Scanner error":"Idle",size:"small",color:h==="error"?"error":"primary",variant:"filled"}),P?jsxRuntime.jsx(material.Chip,{icon:jsxRuntime.jsx(Ok__default.default,{}),label:`${P.format||"barcode"}: ${P.rawValue}`,size:"small",color:"success",variant:"filled"}):null]})]}),D?jsxRuntime.jsx(material.Alert,{severity:h==="unsupported"?"info":"warning",children:D}):null,i?jsxRuntime.jsxs(material.Stack,{direction:{xs:"column",sm:"row"},spacing:1.25,children:[jsxRuntime.jsx(material.TextField,{fullWidth:true,label:"Barcode",placeholder:m,value:S,onChange:R=>E(R.target.value)}),jsxRuntime.jsx(material.Button,{variant:"contained",onClick:T,sx:{minHeight:56,px:2.5},children:l})]}):null]})}),jsxRuntime.jsx(material.DialogActions,{sx:{px:3,pb:2},children:jsxRuntime.jsx(material.Button,{onClick:t,children:s})})]})};var Gk={default:"#475569",primary:"#1d4ed8",success:"#047857",warning:"#b45309",error:"#b91c1c",info:"#0369a1"},mN=({title:e,description:t,kicker:o,icon:r,badges:a=[],metrics:n=[],footer:i,children:c,selected:d=false,draggable:l=false,isDragging:s=false,swipeThreshold:m=88,startAction:g,endAction:p,dragHandleProps:b,onClick:y,onSwipe:u,sx:x})=>{let[f,h]=Yt.useState(0),[v,S]=Yt.useState(false),E=Yt.useRef(null),P=Yt.useRef(0),w=Yt.useRef(0),D=!!(g||p),I=132,k=()=>{h(0),S(false),E.current=null,P.current=0,w.current=0;},A=L=>{(L==="start"?g:p)?.onTrigger?.(),u?.(L),k();},T=L=>{!D||L.target.closest('button, a, input, textarea, [data-no-swipe="true"]')||(E.current=L.pointerId,P.current=L.clientX,w.current=L.clientX,S(true),L.currentTarget.setPointerCapture(L.pointerId));},R=L=>{if(!v||E.current!==L.pointerId)return;w.current=L.clientX;let ee=w.current-P.current,H=Math.max(-I,Math.min(I,ee));h(H);},M=L=>{if(!v||E.current!==L.pointerId)return;let ee=w.current-P.current;if(ee>=m&&g){A("start");return}if(ee<=-m&&p){A("end");return}Math.abs(ee)<12&&y?.(),k();},Z=(L,ee)=>{if(!L)return null;let H=L.backgroundColor||Gk[L.tone||"default"];return jsxRuntime.jsx(material.Box,{sx:{position:"absolute",top:0,bottom:0,[ee]:0,width:I,px:2,display:"flex",alignItems:"center",justifyContent:ee==="left"?"flex-start":"flex-end",color:"#fff",background:`linear-gradient(135deg, ${H}, rgba(15,23,42,0.92))`},children:jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,alignItems:"center",children:[L.icon,jsxRuntime.jsx(material.Typography,{sx:{fontWeight:700,fontSize:"0.95rem"},children:L.label})]})})};return jsxRuntime.jsxs(material.Box,{sx:{position:"relative",overflow:"hidden",borderRadius:4,...x},children:[Z(g,"left"),Z(p,"right"),jsxRuntime.jsx(material.Paper,{elevation:0,onPointerDown:T,onPointerMove:R,onPointerUp:M,onPointerCancel:k,sx:L=>({position:"relative",zIndex:1,p:2,borderRadius:4,border:"1px solid",borderColor:d?"primary.main":"divider",background:L.palette.mode==="dark"?"linear-gradient(180deg, rgba(30,41,59,0.96), rgba(15,23,42,0.92))":"linear-gradient(180deg, #ffffff, #f8fafc)",color:"text.primary",boxShadow:d?"0 18px 42px rgba(37, 99, 235, 0.18)":"0 12px 28px rgba(15, 23, 42, 0.08)",transform:`translate3d(${f}px, 0, 0) scale(${s?.985:1})`,transition:v?"none":"transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease",touchAction:"pan-y",cursor:y?"pointer":"default",opacity:s?.9:1}),children:jsxRuntime.jsxs(material.Stack,{spacing:1.5,children:[jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1.5,alignItems:"flex-start",children:[r?jsxRuntime.jsx(material.Box,{sx:{mt:.25},children:r}):null,jsxRuntime.jsxs(material.Box,{sx:{flex:1,minWidth:0},children:[o?jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",fontWeight:700,letterSpacing:"0.08em",color:"text.secondary"},children:o}):null,jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1.05rem",fontWeight:800,lineHeight:1.25},children:e}),t?jsxRuntime.jsx(material.Typography,{sx:{mt:.5,fontSize:"0.9rem",color:"text.secondary",lineHeight:1.45},children:t}):null]}),l?jsxRuntime.jsx(material.Box,{"data-no-swipe":"true",...b,sx:{alignSelf:"center",display:"inline-flex",touchAction:"none"},children:jsxRuntime.jsx(material.IconButton,{size:"small",children:jsxRuntime.jsx($k__default.default,{})})}):null]}),a.length>0?jsxRuntime.jsx(material.Stack,{direction:"row",spacing:1,useFlexGap:true,flexWrap:"wrap",children:a.map((L,ee)=>jsxRuntime.jsx(material.Chip,{label:L,size:"small",sx:{borderRadius:999,fontWeight:700,bgcolor:"action.hover",color:"text.primary"}},ee))}):null,n.length>0?jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(110px, 1fr))",gap:1},children:n.map(L=>jsxRuntime.jsxs(material.Paper,{elevation:0,sx:{p:1.25,borderRadius:3,bgcolor:"action.hover",border:"1px solid",borderColor:"divider",color:"text.primary"},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:L.label}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1rem",fontWeight:800,lineHeight:1.2},children:L.value})]},L.id))}):null,c,i]})})]})};var Qi=({label:e,onPress:t,emphasis:o="default"})=>jsxRuntime.jsx(material.Box,{component:"button",type:"button",onClick:t,sx:r=>({minHeight:72,borderRadius:3,border:"1px solid",borderColor:o==="primary"?"primary.main":"divider",background:o==="primary"?r.palette.primary.main:o==="danger"?r.palette.mode==="dark"?"rgba(239,68,68,0.18)":"rgba(239,68,68,0.10)":r.palette.mode==="dark"?"rgba(255,255,255,0.04)":"#fff",color:o==="primary"?"#fff":"text.primary",fontSize:"1.25rem",fontWeight:800,transition:"transform 120ms ease, box-shadow 160ms ease, background-color 160ms ease",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent","&:active":{transform:"scale(0.98)"}}),children:e}),SN=({value:e,defaultValue:t="",title:o,subtitle:r,placeholder:a="0",allowDecimal:n=false,allowNegative:i=false,maxLength:c,confirmLabel:d,clearLabel:l,backspaceLabel:s,onChange:m,onSubmit:g,onClose:p,sx:b})=>{let{t:y}=le(),[u,x]=Yt.useState(t),f=e??u,h=k=>{e===void 0&&x(k),m?.(k);},v=k=>{c&&f.length>=c||h(`${f}${k}`);},S=k=>{if(k==="00"){if(!f){h("0");return}v("00");return}v(k);},E=()=>{!n||f.includes(".")||h(f?`${f}.`:"0.");},P=()=>{if(i){if(f.startsWith("-")){h(f.slice(1));return}h(f?`-${f}`:"-");}},w=()=>{h(f.slice(0,-1));},D=()=>{h("");},I=()=>{g?.(f);};return jsxRuntime.jsx(material.Paper,{elevation:0,sx:{p:2,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",...b},children:jsxRuntime.jsxs(material.Stack,{spacing:2,children:[jsxRuntime.jsxs(material.Stack,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[o?jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1rem",fontWeight:800},children:o}):null,r?jsxRuntime.jsx(material.Typography,{sx:{mt:.5,fontSize:"0.86rem",color:"text.secondary"},children:r}):null]}),p?jsxRuntime.jsx(material.IconButton,{onClick:p,size:"small",children:jsxRuntime.jsx(qk__default.default,{})}):null]}),jsxRuntime.jsx(material.Paper,{elevation:0,sx:{p:2,borderRadius:3,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:jsxRuntime.jsx(material.Typography,{sx:{minHeight:38,fontSize:f?"1.9rem":"1.25rem",fontWeight:900,letterSpacing:"0.06em",color:f?"text.primary":"text.disabled"},children:f||a})}),jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:"repeat(3, minmax(0, 1fr))",gap:1.25},children:[["1","2","3","4","5","6","7","8","9"].map(k=>jsxRuntime.jsx(Qi,{label:k,onPress:()=>S(k)},k)),jsxRuntime.jsx(Qi,{label:i?"+/-":"00",onPress:i?P:()=>S("00")}),jsxRuntime.jsx(Qi,{label:"0",onPress:()=>S("0")}),jsxRuntime.jsx(Qi,{label:n?".":s?String(s):"DEL",onPress:n?E:w})]}),jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:"repeat(3, minmax(0, 1fr))",gap:1.25},children:[jsxRuntime.jsx(material.Box,{component:"button",type:"button",onClick:w,sx:{minHeight:64,borderRadius:3,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent"},children:jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,justifyContent:"center",alignItems:"center",children:[jsxRuntime.jsx(Kk__default.default,{}),jsxRuntime.jsx(material.Typography,{sx:{fontWeight:700},children:s||"DEL"})]})}),jsxRuntime.jsx(Qi,{label:String(l||"CLR"),onPress:D,emphasis:"danger"}),jsxRuntime.jsx(material.Box,{component:"button",type:"button",onClick:I,sx:k=>({minHeight:64,borderRadius:3,border:"1px solid",borderColor:"primary.main",background:k.palette.primary.main,color:"#fff",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent"}),children:jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,justifyContent:"center",alignItems:"center",children:[jsxRuntime.jsx(jk__default.default,{}),jsxRuntime.jsx(material.Typography,{sx:{fontWeight:800},children:d||y("common.ok")})]})})]})]})})};var qg=({touchMode:e="comfortable",sx:t,...o})=>{let r=e==="expanded";return jsxRuntime.jsx(material.Box,{sx:{"& .MuiPaper-root":{borderRadius:4},"& .MuiAutocomplete-root":{minWidth:{xs:"100%",md:260}},"& .MuiAutocomplete-root .MuiInputBase-root":{backgroundColor:"transparent !important"},"& .MuiInputBase-root":{minHeight:r?56:50,borderRadius:3,fontSize:r?"0.98rem":"0.92rem"},"& .MuiInputBase-input":{py:r?1.6:1.25,fontSize:r?"0.98rem":"0.92rem"},"& .MuiInputLabel-root":{fontSize:r?"0.95rem":"0.88rem"},"& .MuiButton-root":{minHeight:r?48:44,px:r?2.25:1.75,borderRadius:3,fontSize:r?"0.95rem":"0.88rem",fontWeight:700},"& .MuiIconButton-root":{width:r?40:36,height:r?40:36},"& .MuiMenuItem-root":{minHeight:r?44:38,fontSize:r?"0.95rem":"0.88rem"},"& .MuiListSubheader-root":{py:1},"& .MuiCheckbox-root":{p:r?1:.75},"& .MuiFormControlLabel-label":{fontSize:r?"0.95rem":"0.88rem"},"& .MuiDialog-paper":{borderRadius:4},"& .MuiDialogTitle-root":{fontSize:r?"1.05rem":"0.98rem",fontWeight:800},"& .MuiDialogContent-root .MuiInputBase-root":{minHeight:52},'& .MuiGrid-root > .MuiGrid-item, & .MuiGrid-root > .MuiGrid-sizeXs-1, & .MuiGrid-root > [class*="MuiGrid-grid-"]':{minWidth:0},...t},children:jsxRuntime.jsx($r,{...o})})};var tw=(e,t,o)=>{if(o?.(t),!!t.href){if(t.href.startsWith("http://")||t.href.startsWith("https://")){window.open(t.href,"_blank");return}e.push(t.href);}},Zg=({items:e,selectedId:t,orientation:o="auto",onItemSelect:r,sx:a})=>{let n=styles.useTheme(),[i,c]=Yt.useState(false);Yt.useEffect(()=>{c(true);},[]);let d=material.useMediaQuery("(orientation: portrait)",{noSsr:true}),l=material.useMediaQuery(n.breakpoints.down("md"),{noSsr:true}),s=o==="auto"?d||l?"portrait":"landscape":o,m=navigation.useRouter();return jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:!i||s==="portrait"?"repeat(2, minmax(0, 1fr))":"repeat(auto-fit, minmax(180px, 1fr))",gap:1.5,...a},children:e.map(g=>{let p=g.id===t,b=g.color||(p?n.palette.primary.main:n.palette.divider);return jsxRuntime.jsx(material.Paper,{elevation:0,sx:{overflow:"hidden",borderRadius:4,border:"1px solid",borderColor:p?"primary.main":"divider",boxShadow:p?"0 18px 40px rgba(37, 99, 235, 0.16)":"none",bgcolor:n.palette.mode==="dark"?"rgba(30,41,59,0.6)":"background.paper"},children:jsxRuntime.jsx(material.Box,{component:"button",type:"button",disabled:g.disabled,onClick:()=>tw(m,g,r),sx:{width:"100%",p:2,minHeight:s==="portrait"?156:148,display:"block",border:0,background:"transparent",textAlign:"left",cursor:g.disabled?"not-allowed":"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent",color:"text.primary"},children:jsxRuntime.jsxs(material.Stack,{spacing:1.5,sx:{height:"100%"},children:[jsxRuntime.jsxs(material.Stack,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[jsxRuntime.jsx(material.Box,{sx:{width:44,height:44,borderRadius:3,display:"grid",placeItems:"center",color:p?"#fff":"text.primary",background:p?b:"action.hover"},children:g.icon||jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1rem",fontWeight:900},children:g.title.slice(0,1).toUpperCase()})}),g.badge!==void 0?jsxRuntime.jsx(material.Box,{sx:{minWidth:34,px:1,py:.4,borderRadius:999,bgcolor:p?"primary.main":"action.hover",color:p?"#fff":"text.secondary",textAlign:"center",fontWeight:800,fontSize:"0.8rem"},children:g.badge}):null]}),jsxRuntime.jsxs(material.Box,{sx:{flex:1,minWidth:0},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1rem",fontWeight:800,lineHeight:1.25},children:g.title}),g.caption?jsxRuntime.jsx(material.Typography,{sx:{mt:.5,fontSize:"0.74rem",fontWeight:700,color:"text.secondary"},children:g.caption}):null,g.description?jsxRuntime.jsx(material.Typography,{sx:{mt:.75,fontSize:"0.84rem",lineHeight:1.45,color:"text.secondary"},children:g.description}):null]})]})})},g.id)})})};var ef=(e,t)=>t.trim()?e.reduce((o,r)=>{let a=r.title?.toLowerCase().includes(t.toLowerCase())||r.label?.toLowerCase().includes(t.toLowerCase())||r.description?.toLowerCase().includes(t.toLowerCase()),n=r.children?ef(r.children,t):[];return (a||n.length>0)&&o.push({...r,children:n.length>0?n:r.children}),o},[]):e,gw=e=>{let t=new Set,o=r=>{r.forEach(a=>{a.children?.length&&(t.add(a.id),o(a.children));});};return o(e),t},tf=({collapsed:e=false,onToggle:t,className:o="",maxHeight:r,menuData:a=[],colorMode:n="light",orientation:i="auto",headerSlot:c,footerSlot:d,activeHref:l,onItemSelect:s})=>{let{t:m}=le(),g=styles.useTheme(),p=material.useMediaQuery("(orientation: portrait)"),b=material.useMediaQuery(g.breakpoints.down("md")),y=i==="auto"?p||b?"portrait":"landscape":i,u=n==="dark",x=navigation.useRouter(),f=navigation.usePathname(),[h,v]=Yt.useState(""),[S,E]=Yt.useState(new Set),P=Yt.useMemo(()=>ef(a,h),[a,h]),w=Yt.useMemo(()=>h.trim()?gw(P):S,[S,P,h]);Yt.useEffect(()=>{e&&E(new Set);},[e]);let D=R=>R.appurl||R.href||"",I=R=>{s?.(R);let M=D(R);if(M){if(M.startsWith("http://")||M.startsWith("https://")){window.open(M,"_blank");return}x.push(M);}},k=R=>{let M=!!R.children?.length;if(e&&M){t?.();return}if(M){E(Z=>{let L=new Set(Z);return L.has(R.id)?L.delete(R.id):L.add(R.id),L});return}I(R);},A=R=>{let M=l||f,Z=D(R);return !!(Z&&M===Z)},T=(R,M=0)=>{let Z=!!R.children?.length,L=w.has(R.id),ee=A(R);return jsxRuntime.jsx(material.Box,{sx:{pl:M===0?0:1.5},children:jsxRuntime.jsxs(material.Paper,{elevation:0,sx:{mb:1,overflow:"hidden",borderRadius:3,border:"1px solid",borderColor:ee?"primary.main":"divider",bgcolor:ee?"action.selected":"background.paper"},children:[jsxRuntime.jsxs(material.Box,{component:"button",type:"button",onClick:()=>k(R),sx:{width:"100%",px:1.5,py:1.4,display:"flex",alignItems:"center",gap:1.25,border:0,background:"transparent",textAlign:"left",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent"},children:[jsxRuntime.jsx(material.Avatar,{variant:"rounded",sx:{width:40,height:40,bgcolor:ee?"primary.main":"action.hover",color:ee?"#fff":"text.primary"},children:R.icon||(R.title||R.label||"?").slice(0,1).toUpperCase()}),jsxRuntime.jsxs(material.Box,{sx:{flex:1,minWidth:0},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.95rem",fontWeight:800,lineHeight:1.2},children:R.title||R.label}),R.description?jsxRuntime.jsx(material.Typography,{sx:{mt:.4,fontSize:"0.78rem",color:"text.secondary",lineHeight:1.35},children:R.description}):null]}),Z?jsxRuntime.jsx(pw__default.default,{sx:{transform:L?"rotate(180deg)":"rotate(0deg)",transition:"transform 180ms ease"}}):jsxRuntime.jsx(mw__default.default,{color:"action"})]}),Z?jsxRuntime.jsx(material.Collapse,{in:L,children:jsxRuntime.jsx(material.Box,{sx:{px:1.25,pb:1.25},children:R.children?.map(H=>T(H,M+1))})}):null]})},R.id)};return e?jsxRuntime.jsx(material.Paper,{elevation:0,className:o,sx:{width:y==="portrait"?"100%":88,p:1,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:u?"#101828":"rgba(255,255,255,0.88)",maxHeight:r?`${r}px`:void 0,overflowY:"auto"},children:jsxRuntime.jsxs(material.Stack,{spacing:1,children:[jsxRuntime.jsx(material.IconButton,{onClick:t,sx:{width:48,height:48,alignSelf:"center",bgcolor:"action.hover"},title:m("navigation.expand"),children:jsxRuntime.jsx(uw__default.default,{})}),a.map(R=>jsxRuntime.jsx(material.IconButton,{onClick:()=>k(R),sx:{width:56,height:56,alignSelf:"center",borderRadius:3,bgcolor:A(R)?"primary.main":"action.hover",color:A(R)?"#fff":"text.primary"},children:R.icon||(R.title||R.label||"?").slice(0,1).toUpperCase()},R.id))]})}):jsxRuntime.jsx(material.Paper,{elevation:0,className:o,sx:{width:y==="portrait"?"100%":320,p:1.25,borderRadius:5,border:"1px solid",borderColor:"divider",bgcolor:u?"#101828":"rgba(255,255,255,0.88)",maxHeight:r?`${r}px`:void 0,overflow:"hidden",display:"flex",flexDirection:"column"},children:jsxRuntime.jsxs(material.Stack,{spacing:1.25,sx:{flex:1,minHeight:0},children:[jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,alignItems:"center",children:[jsxRuntime.jsx(material.TextField,{value:h,onChange:R=>v(R.target.value),placeholder:m("navigation.searchPlaceholder"),size:"small",fullWidth:true,InputProps:{startAdornment:jsxRuntime.jsx(cw__default.default,{fontSize:"small",color:"action"})}}),y==="landscape"&&!e?jsxRuntime.jsx(material.IconButton,{onClick:t,sx:{bgcolor:"action.hover"},children:jsxRuntime.jsx(dw__default.default,{})}):null]}),c,jsxRuntime.jsx(material.Box,{sx:{flex:1,minHeight:0,overflowY:"auto",pr:.25},children:P.length>0?P.map(R=>T(R)):jsxRuntime.jsx(material.Typography,{sx:{p:2,fontSize:"0.88rem",color:"text.secondary",textAlign:"center"},children:m("navigation.noMatch")})}),d]})})};var df=(e,t)=>{let o=t[e.id];if(e.render)return e.render(o,t);if(o==null||o==="")return "--";if(e.numeric){if(typeof o=="number")return o.toLocaleString();if(typeof o=="string"&&o.trim()!==""&&!Number.isNaN(Number(o)))return Number(o).toLocaleString()}return String(o)},vw=e=>Yt__namespace.default.isValidElement(e)?jsxRuntime.jsx(material.Box,{sx:{display:"inline-flex",alignItems:"center"},children:e}):jsxRuntime.jsx(material.Typography,{sx:{mt:.2,fontSize:"0.88rem",fontWeight:800},children:e}),Cw=(e,t)=>{let o=t[e.id];if(o==null||o==="")return "--";if(e.numeric){if(typeof o=="number")return o.toLocaleString();if(typeof o=="string"&&o.trim()!==""&&!Number.isNaN(Number(o)))return Number(o).toLocaleString()}return String(o)},Sw=({summaryRow:e,visibleColumns:t,columns:o})=>{let r=o.filter(a=>t.includes(a.id)&&e[a.id]!=="");return r.length===0?null:jsxRuntime.jsx(material.Paper,{elevation:0,sx:{p:1.5,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:jsxRuntime.jsxs(material.Stack,{spacing:1,children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.82rem",fontWeight:800,color:"text.secondary"},children:"Summary"}),jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(132px, 1fr))",gap:1},children:r.map(a=>jsxRuntime.jsxs(material.Paper,{elevation:0,sx:{p:1.1,borderRadius:3,border:"1px solid",borderColor:"divider"},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:a.label}),jsxRuntime.jsx(material.Typography,{sx:{mt:.25,fontSize:"0.96rem",fontWeight:800},children:e[a.id]})]},`summary-${a.id}`))})]})})},kw=e=>{let{t}=le(),o=styles.useTheme(),{title:r,showToolbar:a=true,selectionMode:n,selected:i=[],onSelectionChange:c,actions:d,extraTools:l,fitContainer:s=false,fullWidth:m=false,maxHeight:g,loading:p=false,rowsPerPageOptions:b=[20,50,100,-1],onLayoutSave:y,filterConfig:u,rowKey:x,tableKey:f="default",graphReport:h,quickCreate:v,quickEdit:S,quickDelete:E,serviceUrl:P,orientation:w="auto",cardTitleField:D,cardSubtitleFields:I,toolbarSlot:k,emptyState:A,rowHeight:T="comfortable",cardActionSlot:R,renderCardFooter:M,onRowClick:Z}=e,L=r||t("table.title.default"),ee=material.useMediaQuery("(orientation: portrait)"),H=material.useMediaQuery(o.breakpoints.down("md")),q=w==="auto"?ee||H?"portrait":"landscape":w,{columns:$,filterText:ie,setFilterText:ue,visibleColumns:Ce,showSummary:te,setShowSummary:j,summaryColumns:Y,grouping:de,setGrouping:We,expandedGroups:$e,groupAnchorEl:me,setGroupAnchorEl:Ne,summaryAnchorEl:rt,setSummaryAnchorEl:he,anchorEl:Le,setAnchorEl:He,contextMenu:Xe,sortedAndFilteredRows:qe,summaryRow:K,visibleRows:Fe,page:be,setPage:ke,rowsPerPage:et,setRowsPerPage:Te,totalDisplayCount:lt,setSelected:Ct,handleClick:Mt,toggleSummaryColumn:Jt,handleExport:X,handleCloseContextMenu:_e,toggleColumnVisibility:J,toggleGroupExpand:G,toggleGroupField:F,handleExpandGroupRecursively:re,handleCollapseGroupRecursively:ve,handleLayoutLoad:Se,handleVariantLoad:Ke,handleLayoutSave:st,effectiveAppId:Ye,currentLayoutData:ft,currentLayoutId:xt,layoutIdToLoad:ao,graphReportOpen:ht,handleOpenGraphReport:Bo,handleCloseGraphReport:so}=Tn(e),Et=h?.enabled??false,$t=Et&&(h?.interaction?.enabled??true),vt=Wl(),no=x||"id",O=Yt__namespace.default.useMemo(()=>({borderRadius:999,fontWeight:700,borderColor:styles.alpha(o.palette.divider,o.palette.mode==="dark"?.55:.3),bgcolor:o.palette.mode==="dark"?styles.alpha(o.palette.common.white,.06):styles.alpha(o.palette.background.paper,.92),color:o.palette.text.primary,"& .MuiChip-label":{px:1.05}}),[o]),W=Yt__namespace.default.useMemo(()=>({...O,borderColor:styles.alpha(o.palette.primary.main,o.palette.mode==="dark"?.42:.24),bgcolor:o.palette.mode==="dark"?styles.alpha(o.palette.primary.main,.16):styles.alpha(o.palette.primary.main,.08)}),[O,o]),_=Yt__namespace.default.useMemo(()=>{let V=new Set(i);return qe.filter(pe=>V.has(pe?.[no]))},[no,i,qe]),fe=_.length===1?_[0]:null,ge=!!v?.enabled,Ae=!!S?.enabled,je=!!E?.enabled,Ze=v?.fields,tt=v?.excludeFields||[],Dt=v?.initialValues||{},ut=S?.fields,pt=S?.excludeFields||[],St=S?.editableFields||[],Vt=S?.nonEditableFields||[],ct=S?.primaryKeys?.length?S.primaryKeys:[no],[Eo,wo]=Yt__namespace.default.useState(false),[Jo,B]=Yt__namespace.default.useState(false),[Q,ae]=Yt__namespace.default.useState({}),[ce,Be]=Yt__namespace.default.useState(false),[Ge,mt]=Yt__namespace.default.useState(false),[Pe,dt]=Yt__namespace.default.useState({}),[at,It]=Yt__namespace.default.useState(false),[bt,eo]=Yt__namespace.default.useState(false),co=p||Jo||Ge||bt,To=Yt__namespace.default.useMemo(()=>{let V=[...$];if(Array.isArray(Ze)&&Ze.length>0){let pe=new Set(Ze);V=V.filter(ne=>pe.has(ne.id));}if(tt.length>0){let pe=new Set(tt);V=V.filter(ne=>!pe.has(ne.id));}return V.filter(pe=>!!pe?.id)},[$,tt,Ze]),jt=Yt__namespace.default.useMemo(()=>{let V=[...$];if(Array.isArray(ut)&&ut.length>0){let pe=new Set(ut);V=V.filter(ne=>pe.has(ne.id));}if(pt.length>0){let pe=new Set(pt);V=V.filter(ne=>!pe.has(ne.id));}return V.filter(pe=>!!pe?.id)},[$,pt,ut]),vo=Yt__namespace.default.useMemo(()=>new Set(ct),[ct]),Pt=Yt__namespace.default.useMemo(()=>new Set(St),[St]),Gt=Yt__namespace.default.useMemo(()=>new Set(Vt),[Vt]),cr=Yt__namespace.default.useCallback(V=>Pt.size>0?Pt.has(V):!(Gt.has(V)||vo.has(V)),[Pt,Gt,vo]);Yt__namespace.default.useEffect(()=>{!ht&&vt.hasActiveFilters&&vt.clearAll();},[vt,ht]);let dr=()=>{let V={};To.forEach(pe=>{V[pe.id]=Dt[pe.id]??"";}),ae(V),wo(true);},rn=(V,pe)=>{ae(ne=>({...ne,[V]:pe}));},wa=async()=>{if(!v?.onSubmit){wo(false);return}try{B(!0),await v.onSubmit(Q),wo(!1);}finally{B(false);}},an=()=>{if(!fe)return;let V={};jt.forEach(ne=>{V[ne.id]=fe[ne.id]??"";});let pe=S?.getInitialValues?{...V,...S.getInitialValues(fe)}:V;dt(pe),Be(true);},er=(V,pe)=>{dt(ne=>({...ne,[V]:pe}));},nn=async()=>{if(fe){if(!S?.onSubmit){Be(false);return}try{mt(!0),await S.onSubmit(Pe,fe),Be(!1);}finally{mt(false);}}},Ta=()=>{_.length!==0&&It(true);},Ia=async()=>{if(_.length===0){It(false);return}if(!E?.onConfirm){It(false),Ct([]),c?.([]);return}try{eo(!0),await E.onConfirm(_),It(!1),Ct([]),c?.([]);}finally{eo(false);}},Or=qe,{fieldMapping:ra}=xn({rows:Or,config:{...h,title:h?.title||`${L} ${t("graph.reportTitle")}`}}),ni=Yt__namespace.default.useMemo(()=>$t?vt.applyRows(Or,ra):Or,[ra,vt,$t,Or]),{model:C}=xn({rows:ni,config:{...h,title:h?.title||`${L} ${t("graph.reportTitle")}`,fieldMapping:ra}}),N=C.table.columns.map(V=>({id:V.id,label:V.label,align:V.align||"left",minWidth:120,numeric:V.align==="right"})),z=Ye?jsxRuntime.jsx(wn,{appId:Ye,tableKey:f,currentLayoutData:ft,onLayoutLoad:Se,targetLayoutId:ao,activeLayoutId:xt,serviceUrl:P??u?.serviceUrl}):null,oe=$.filter(V=>Ce.includes(V.id)),ye=oe.find(V=>V.id===D)||oe[0],Ue=I?.map(V=>oe.find(pe=>pe.id===V)).filter(Boolean)||oe.filter(V=>V.id!==ye?.id).slice(0,q==="portrait"?2:3),Re=oe.filter(V=>V.id!==ye?.id&&!Ue.some(pe=>pe.id===V.id)),Oe=[k,l].filter(Boolean),U=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(sn,{groupAnchorEl:me,setGroupAnchorEl:Ne,grouping:de,setGrouping:We,columns:$,toggleGroupField:F}),jsxRuntime.jsx(cn,{anchorEl:Le,setAnchorEl:He,columns:$,visibleColumns:Ce,toggleColumnVisibility:J}),jsxRuntime.jsx(Cl,{anchorEl:rt,setAnchorEl:he,showSummary:te,setShowSummary:j,columns:$,summaryColumns:Y,toggleSummaryColumn:Jt}),jsxRuntime.jsx(Sl,{contextMenu:Xe,handleCloseContextMenu:_e,columns:$,visibleColumns:Ce,toggleColumnVisibility:J})]}),Ee=(V,pe,ne)=>{let Me=i.includes(pe),kt=q==="portrait"?"repeat(2, minmax(0, 1fr))":"repeat(auto-fit, minmax(140px, 1fr))",wr=ne%2===0?styles.alpha(o.palette.primary.main,o.palette.mode==="dark"?.09:.04):styles.alpha(o.palette.primary.main,o.palette.mode==="dark"?.05:.022),Th=styles.alpha(o.palette.divider,.22);return jsxRuntime.jsx(material.Paper,{elevation:0,onClick:()=>{Mt({},V),Z?.(V);},sx:{p:T==="compact"?1.25:1.5,borderRadius:4,border:"0.5px solid",borderColor:Me?styles.alpha(o.palette.primary.main,.38):Th,background:Me?`linear-gradient(135deg, ${styles.alpha(o.palette.primary.main,.13)}, ${styles.alpha(o.palette.primary.main,.06)})`:`linear-gradient(135deg, ${wr}, ${styles.alpha(o.palette.primary.main,.015)})`,boxShadow:Me?`0 12px 30px ${styles.alpha(o.palette.primary.main,.2)}`:`0 3px 10px ${styles.alpha(o.palette.common.black,.045)}`,cursor:"pointer",position:"relative",overflow:"hidden",transition:"border-color 160ms ease, box-shadow 160ms ease, transform 120ms ease, background 160ms ease","&::before":{content:'""',position:"absolute",left:0,top:0,bottom:0,width:4,background:Me?o.palette.primary.main:ne%2===0?styles.alpha(o.palette.primary.main,.26):styles.alpha(o.palette.text.primary,.16)},"&:hover":{boxShadow:`0 10px 20px ${styles.alpha(o.palette.primary.main,.12)}`,transform:"translateY(-1px)"},"&:active":{transform:"scale(0.995)"}},children:jsxRuntime.jsxs(material.Stack,{spacing:1.25,children:[jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1.25,alignItems:"flex-start",children:[n?jsxRuntime.jsx(material.Checkbox,{checked:Me,onClick:Go=>Go.stopPropagation(),onChange:()=>Mt({},V),sx:{mt:-0.6,ml:-0.6}}):null,jsxRuntime.jsxs(material.Box,{sx:{flex:1,minWidth:0},children:[ye?jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1rem",fontWeight:900,lineHeight:1.25},children:df(ye,V)}):null,Ue.length>0?jsxRuntime.jsx(material.Stack,{direction:"row",spacing:.75,useFlexGap:true,flexWrap:"wrap",sx:{mt:.75},children:Ue.map(Go=>jsxRuntime.jsx(material.Chip,{label:`${Go.label}: ${Cw(Go,V)}`,size:"small",variant:"outlined",sx:O},`${pe}-${Go.id}`))}):null]}),R?jsxRuntime.jsx(material.Box,{onClick:Go=>Go.stopPropagation(),children:R(V)}):null]}),Re.length>0?jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:kt,gap:1},children:Re.map(Go=>jsxRuntime.jsxs(material.Paper,{elevation:0,sx:{p:1,borderRadius:3,bgcolor:o.palette.mode==="dark"?styles.alpha(o.palette.background.default,.7):styles.alpha(o.palette.background.paper,.92),border:"0.1px solid",borderColor:styles.alpha(o.palette.divider,.24)},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:Go.label}),vw(df(Go,V))]},`${pe}-${Go.id}-detail`))}):null,M?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsx(material.Box,{onClick:Go=>Go.stopPropagation(),children:M(V)})]}):null]})},pe)};return jsxRuntime.jsxs(material.Box,{sx:{width:m?"100%":"auto",mb:s?0:2,...s?{flex:1,display:"flex",flexDirection:"column",minHeight:0,height:"100%",overflow:"hidden"}:{}},children:[u?jsxRuntime.jsx(material.Box,{sx:{mb:2},children:jsxRuntime.jsx(qg,{...u,onVariantLoad:V=>{Ke(V),u.onVariantLoad?.(V);},appId:u.appId,tableKey:f,currentLayout:[{tableKey:f,layoutData:ft}],currentLayoutId:xt,layoutRefs:[{tableKey:f,layoutId:xt}],variantService:u.variantService,serviceUrl:P??u.serviceUrl,touchMode:q==="portrait"?"expanded":"comfortable"})}):null,jsxRuntime.jsxs(material.Paper,{sx:{width:m?"100%":"auto",mb:s?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative",bgcolor:"transparent",backgroundImage:"none",boxShadow:"none","&::before":co?{content:'""',position:"absolute",top:0,left:0,width:"100%",height:"3px",background:"linear-gradient(90deg, rgba(25, 118, 210, 0) 0%, rgba(25, 118, 210, 0.25) 25%, rgba(25, 118, 210, 1) 50%, rgba(25, 118, 210, 0.25) 75%, rgba(25, 118, 210, 0) 100%)",backgroundSize:"220% 100%",animation:"cTableTopMarquee 1.2s linear infinite",zIndex:6,pointerEvents:"none"}:{},"@keyframes cTableTopMarquee":{"0%":{backgroundPosition:"220% 0"},"100%":{backgroundPosition:"-120% 0"}},...g?{height:g}:s?{flex:1,minHeight:0,height:"100%"}:{}},children:[a?jsxRuntime.jsx(material.Box,{sx:{"& .MuiToolbar-root":{minHeight:60,alignItems:{xs:"flex-start",md:"center"},flexWrap:"wrap",rowGap:1,columnGap:1},"& .MuiToolbar-root > :nth-of-type(1)":{width:{xs:"100%",md:"auto"},"& .MuiTextField-root":{width:{xs:"100%",md:300}}},"& .MuiToolbar-root > :nth-of-type(2)":{flexShrink:0},"& .MuiToolbar-root > :nth-of-type(3)":{display:{xs:"none",md:"block"}},"& .MuiToolbar-root > :nth-of-type(4)":{ml:"auto",justifyContent:"flex-end",flexWrap:"wrap"},"& .MuiInputBase-root":{minHeight:46},"& .MuiIconButton-root":{width:40,height:40},"& .MuiTypography-root":{fontSize:"0.9rem"},"& .MuiButtonBase-root":{borderRadius:2.5}},children:jsxRuntime.jsx(fl,{filterText:ie,setFilterText:ue,onRowsPerPageChange:Te,rowsPerPage:et,rowsPerPageOptions:b,page:be,count:lt,onPageChange:ke,actions:d,extraTools:Oe,grouping:de,setGroupAnchorEl:Ne,showSummary:te,setShowSummary:j,setAnchorEl:He,setSummaryAnchorEl:he,handleExport:X,showCreateButton:ge,onOpenCreateDialog:dr,showEditButton:Ae,onOpenEditDialog:an,editDisabled:_.length!==1,showDeleteButton:je,onOpenDeleteConfirm:Ta,deleteDisabled:_.length===0,onLayoutSave:y||u?.variantService&&u?.appId?st:void 0,loading:p,layoutManager:z,onOpenGraphReport:Et?Bo:void 0})}):null,jsxRuntime.jsx(material.Box,{sx:{flex:1,minHeight:0,overflow:"auto",p:1.5},children:jsxRuntime.jsxs(material.Stack,{spacing:1.25,children:[Fe.length===0&&!p?A||jsxRuntime.jsx(material.Paper,{elevation:0,sx:{p:4,borderRadius:4,border:"1px dashed",borderColor:"divider",textAlign:"center"},children:jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.92rem",color:"text.secondary"},children:t("common.noData")})}):null,Fe.map((V,pe)=>{if(V.type==="group"){let kt=$e.has(V.id);return jsxRuntime.jsx(material.Paper,{elevation:0,sx:{borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:jsxRuntime.jsxs(material.Box,{component:"button",type:"button",onClick:()=>G(V.id),sx:{width:"100%",px:1.5,py:1.3,border:0,background:"transparent",display:"flex",alignItems:"center",gap:1,textAlign:"left",cursor:"pointer",appearance:"none",WebkitAppearance:"none",color:"text.primary"},children:[kt?jsxRuntime.jsx(pw__default.default,{}):jsxRuntime.jsx(mw__default.default,{}),jsxRuntime.jsxs(material.Box,{sx:{flex:1,minWidth:0},children:[jsxRuntime.jsxs(material.Typography,{sx:{fontSize:"0.94rem",fontWeight:800},children:[V.field,": ",V.value]}),jsxRuntime.jsxs(material.Typography,{sx:{mt:.2,fontSize:"0.76rem",color:"text.secondary"},children:[V.count," records"]})]}),de.length>1&&V.level<de.length-1?jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:.5,children:[jsxRuntime.jsx(material.Chip,{size:"small",label:t("table.group.expandAll"),onClick:wr=>{wr.stopPropagation(),re(V.id);},sx:W}),jsxRuntime.jsx(material.Chip,{size:"small",label:t("table.group.collapseAll"),onClick:wr=>{wr.stopPropagation(),ve(V.id);},sx:W})]}):null]})},V.id)}let ne=V.data||V,Me=V.id||ne[no]||pe;return Ee(ne,Me,pe)}),te?jsxRuntime.jsx(Sw,{summaryRow:K,visibleColumns:Ce,columns:$}):null,p?jsxRuntime.jsx(material.Typography,{sx:{py:1,fontSize:"0.84rem",color:"text.secondary",textAlign:"center"},children:t("common.loading")}):null]})})]}),ge?jsxRuntime.jsxs(material.Dialog,{open:Eo,onClose:()=>!Jo&&wo(false),fullWidth:true,maxWidth:"sm",children:[jsxRuntime.jsx(material.DialogTitle,{sx:{fontSize:"1rem",fontWeight:800},children:v?.title||t("quickCreate.createWithTitle",{title:L})}),jsxRuntime.jsx(material.DialogContent,{sx:{pt:"8px !important"},children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[To.map(V=>{let pe=V.type==="number"||V.numeric?"number":V.type==="date"?"date":"text";return jsxRuntime.jsx(material.TextField,{label:V.label||V.id,value:Q[V.id]??"",onChange:ne=>rn(V.id,ne.target.value),type:pe,fullWidth:true,InputLabelProps:{shrink:pe==="date"?true:void 0}},`quick-create-${V.id}`)}),v?.description?jsxRuntime.jsx(material.Alert,{severity:"info",children:v.description}):null]})}),jsxRuntime.jsxs(material.DialogActions,{sx:{px:3,pb:2},children:[jsxRuntime.jsx(material.Button,{onClick:()=>wo(false),disabled:Jo,children:v?.cancelLabel||t("common.cancel")}),jsxRuntime.jsx(material.Button,{onClick:wa,variant:"contained",disabled:Jo,children:v?.submitLabel||t("common.save")})]})]}):null,Ae?jsxRuntime.jsxs(material.Dialog,{open:ce,onClose:()=>!Ge&&Be(false),fullWidth:true,maxWidth:"sm",children:[jsxRuntime.jsx(material.DialogTitle,{sx:{fontSize:"1rem",fontWeight:800},children:S?.title||t("quickEdit.editWithTitle",{title:L})}),jsxRuntime.jsx(material.DialogContent,{sx:{pt:"8px !important"},children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[jt.map(V=>{let pe=V.type==="number"||V.numeric?"number":V.type==="date"?"date":"text";return jsxRuntime.jsx(material.TextField,{label:V.label||V.id,value:Pe[V.id]??"",onChange:ne=>er(V.id,ne.target.value),type:pe,disabled:!cr(V.id),fullWidth:true,InputLabelProps:{shrink:pe==="date"?true:void 0}},`quick-edit-${V.id}`)}),S?.description?jsxRuntime.jsx(material.Alert,{severity:"info",children:S.description}):null]})}),jsxRuntime.jsxs(material.DialogActions,{sx:{px:3,pb:2},children:[jsxRuntime.jsx(material.Button,{onClick:()=>Be(false),disabled:Ge,children:S?.cancelLabel||t("common.cancel")}),jsxRuntime.jsx(material.Button,{onClick:nn,variant:"contained",disabled:Ge||!fe,children:S?.submitLabel||t("common.save")})]})]}):null,je?jsxRuntime.jsx(di,{open:at,type:"warning",title:E?.title||t("quickDelete.confirmTitle"),message:E?.message||(_.length>1?t("quickDelete.confirmMessageMultiple",{count:_.length}):t("quickDelete.confirmMessageSingle")),confirmText:E?.confirmText||t("common.delete"),cancelText:E?.cancelText||t("common.cancel"),onClose:()=>!bt&&It(false),onConfirm:Ia}):null,U,Et?jsxRuntime.jsx(Ol,{open:ht,onClose:so,model:C,aiAssistant:h?.aiAssistant,interaction:$t?{enabled:true,filters:vt.filters,fieldMapping:ra,onPrimaryDimensionClick:V=>vt.setFilter("primaryDimension",V),onSecondaryDimensionClick:V=>vt.setFilter("secondaryDimension",V),onStatusClick:V=>vt.setFilter("status",V),onClearFilter:vt.clearFilter,onClearAll:vt.clearAll}:void 0,tableContent:jsxRuntime.jsx(kw,{appId:Ye||"graph-report-internal",title:t("graph.dataBody"),columns:N,rows:C.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false},showSummary:false})}):null]})};var yz=({appTitle:e,children:t,menuData:o=[],workloadItems:r=[],workloadSelectedId:a,showNavigation:n=true,showWorkloadNav:i=true,orientation:c="auto",logo:d,headerSlot:l,actionSlot:s,portraitBottomSlot:m,contentSx:g,containerSx:p,user:b,onSearch:y,onSearchAdd:u,defaultNavigationOpen:x,navOpen:f,onNavOpenChange:h,onWorkloadSelect:v,locale:S="en",localeLabel:E,localeOptions:P,onLocaleChange:w,onUserSetting:D,onUserLogout:I,userMenuItems:k,leftHeaderSlot:A,rightHeaderSlot:T})=>{let R="orbcafe:page-layout-mode",[M,Z]=Yt.useState("system"),[L,ee]=Yt.useState("light"),[H,q]=Yt.useState(false),[$,ie]=Yt.useState(false),ue=M==="system"?$?L:"light":M;Yt.useEffect(()=>{q(true);},[]),Yt.useEffect(()=>{try{let qe=window.localStorage.getItem(R);(qe==="light"||qe==="dark"||qe==="system")&&Z(qe);}catch{}ie(true);let He=window.matchMedia("(prefers-color-scheme: dark)"),Xe=()=>{ee(He.matches?"dark":"light");};return Xe(),He.addEventListener("change",Xe),()=>He.removeEventListener("change",Xe)},[]),Yt.useEffect(()=>{if($)try{window.localStorage.setItem(R,M);}catch{}},[$,M]),Yt.useEffect(()=>{ue==="dark"?(document.documentElement.classList.add("dark"),document.documentElement.style.colorScheme="dark"):(document.documentElement.classList.remove("dark"),document.documentElement.style.colorScheme="light");},[ue]);let Ce=Yt.useMemo(()=>styles.createTheme({palette:ue==="dark"?{mode:"dark",primary:{main:"#93c5fd"},background:{default:"#060913",paper:"#101826"},text:{primary:"#f8fafc",secondary:"rgba(226,232,240,0.74)"},divider:"rgba(148,163,184,0.18)",action:{hover:"rgba(148,163,184,0.10)",selected:"rgba(59,130,246,0.18)"}}:{mode:"light",background:{default:"#eef3f8",paper:"#ffffff"}},components:{MuiCssBaseline:{styleOverrides:{body:{backgroundColor:ue==="dark"?"#060913":"#eef3f8"}}},MuiPaper:{styleOverrides:{root:{backgroundImage:"none"}}}}}),[ue]),te=material.useMediaQuery("(orientation: portrait)"),j=material.useMediaQuery(Ce.breakpoints.down("md")),Y=c==="auto"?!H||te||j?"portrait":"landscape":c,[de,We]=Yt.useState({landscape:x??true,portrait:false}),$e=de[Y],me=f??$e,Ne=He=>{f===void 0&&We(Xe=>({...Xe,[Y]:He})),h?.(He);},rt=jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,alignItems:"center",children:[!H||n&&Y==="portrait"?jsxRuntime.jsx(material.IconButton,{onClick:()=>Ne(!me),sx:{bgcolor:"action.hover"},children:jsxRuntime.jsx(uw__default.default,{})}):null,A]}),he=jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,alignItems:"center",children:[s,T]}),Le=jsxRuntime.jsx(tf,{collapsed:Y==="landscape"?!me:false,onToggle:()=>Ne(!me),menuData:o,orientation:Y,colorMode:ue,maxHeight:Y==="landscape"?900:void 0});return jsxRuntime.jsx(styles.ThemeProvider,{theme:Ce,children:jsxRuntime.jsx(ul,{locale:S,children:jsxRuntime.jsxs(material.Box,{sx:[He=>({minHeight:"100vh",display:"flex",flexDirection:"column",background:He.palette.mode==="dark"?"linear-gradient(180deg, #0A0A0A 0%, #141414 55%, #1A1A1A 100%)":He.palette.background.default}),...Array.isArray(p)?p:[p]],children:[jsxRuntime.jsx(ms,{appTitle:e,logo:d===void 0?null:d,mode:M,onToggleMode:()=>Z(He=>He==="system"?"dark":He==="dark"?"light":"system"),locale:S,localeLabel:E,localeOptions:P,onLocaleChange:w,user:b,onUserSetting:D,onUserLogout:I,userMenuItems:k,onSearch:y,onSearchAdd:u,leftSlot:rt,rightSlot:he}),l?jsxRuntime.jsx(material.Box,{sx:{px:{xs:2,md:3},py:1.5,borderBottom:"1px solid",borderColor:"divider"},children:l}):null,jsxRuntime.jsxs(material.Box,{sx:{flex:1,minHeight:0,display:"flex",position:"relative"},children:[H&&n&&Y==="landscape"?jsxRuntime.jsx(material.Box,{sx:{p:1.5,pr:0,flexShrink:0},children:Le}):null,!H||n&&Y==="portrait"?jsxRuntime.jsx(material.Drawer,{open:me,onClose:()=>Ne(false),PaperProps:{sx:{width:"min(88vw, 360px)",p:1.25,bgcolor:"transparent",boxShadow:"none"}},children:Le}):null,jsxRuntime.jsx(material.Box,{sx:{flex:1,minWidth:0,minHeight:0,overflow:"auto",p:1.5,...g},children:jsxRuntime.jsxs(material.Stack,{spacing:1.5,children:[i&&r.length>0?jsxRuntime.jsx(Zg,{items:r,selectedId:a,orientation:Y,onItemSelect:v}):null,jsxRuntime.jsx(material.Paper,{elevation:0,sx:{flex:1,minHeight:Y==="portrait"?420:560,p:{xs:1.25,md:1.5},borderRadius:5,border:"1px solid",borderColor:"divider",bgcolor:Ce.palette.mode==="dark"?"rgba(15,23,42,0.72)":"rgba(255,255,255,0.72)",backdropFilter:"blur(12px)",color:"text.primary"},children:t})]})})]}),Y==="portrait"&&m?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsx(material.Box,{sx:{p:1.5},children:m})]}):null]})})})};var hf=$w__default.default(()=>Promise.resolve().then(()=>(ff(),gf)).then(e=>e.COrbCanvas),{ssr:false,loading:()=>jsxRuntime.jsx("div",{className:"h-full w-full bg-transparent"})});function Kd({isRecording:e}){return jsxRuntime.jsx(framerMotion.AnimatePresence,{children:e&&jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.5},className:"pointer-events-none absolute inset-0 z-0 overflow-hidden",children:jsxRuntime.jsxs("div",{className:"relative flex h-full w-full items-center justify-center",children:[jsxRuntime.jsx("div",{className:"absolute inset-0",children:jsxRuntime.jsx(hf,{hue:0,hoverIntensity:.5,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})}),jsxRuntime.jsx("div",{className:"relative z-10 h-full w-1/3 mix-blend-overlay opacity-80",children:jsxRuntime.jsx(hf,{hue:10,hoverIntensity:.8,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})})]})})})}var Iz=Kd;var yf=Yt.createContext(null);function Zw(e){if(!e||!(e instanceof HTMLElement))return false;let t=e.tagName;return !!(t==="INPUT"||t==="TEXTAREA"||t==="SELECT"||e.isContentEditable||e.closest('[data-voice-hotkey-ignore="true"]'))}function Yw({children:e,onVoiceSubmit:t,onVoicePartial:o,onVoiceError:r,longPressMs:a=200,disableSpaceTrigger:n=false,ignoreWhenFocusedInput:i=true,renderOverlay:c=true,wsUrl:d,silenceThresholdMs:l,minVolumeRms:s}){let[m,g]=Yt.useState(false),[p,b]=Yt.useState(false),y=Yt.useRef(null),u=Yt.useRef(false),x=Yt.useRef(false),f=Yt.useCallback(()=>{x.current=false,g(false);},[]),{isRecording:h,startRecording:v,stopRecording:S}=Rn({wsUrl:d,silenceThresholdMs:l,minVolumeRms:s,onTextUpdate:D=>{o?.(D);},onComplete:async D=>{try{D.trim()&&(b(!0),await t(D.trim()));}catch(I){let k=I instanceof Error?I.message:"Failed to process voice command";r?.(k);}finally{b(!1),f();}},onError:D=>{r?.(D),b(!1),u.current||f();}}),E=Yt.useCallback(async()=>{x.current=false,await v();},[v]),P=Yt.useCallback(()=>{S();},[S]);Yt.useEffect(()=>{if(n)return;let D=k=>{k.isComposing||(k.code==="Space"||k.key===" ")&&(u.current||k.repeat||i&&Zw(document.activeElement)||(u.current=true,k.preventDefault(),y.current=setTimeout(()=>{x.current=true,g(true),v();},a)));},I=k=>{(k.code==="Space"||k.key===" ")&&(y.current&&(clearTimeout(y.current),y.current=null),u.current=false,x.current&&(k.preventDefault(),g(false),S()));};return window.addEventListener("keydown",D),window.addEventListener("keyup",I),()=>{window.removeEventListener("keydown",D),window.removeEventListener("keyup",I),y.current&&(clearTimeout(y.current),y.current=null);}},[n,i,a,v,S]);let w=Yt.useMemo(()=>({isRecording:h,isHotkeyRecording:m,isSubmitting:p,startRecording:E,stopRecording:P}),[m,h,p,E,P]);return jsxRuntime.jsxs(yf.Provider,{value:w,children:[c?jsxRuntime.jsx(Kd,{isRecording:m}):null,e]})}function Qw(){let e=Yt.useContext(yf);if(!e)throw new Error("useAINav must be used within CAINavProvider");return e}var Bz=Yw,Ez=Qw;function Je(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var n1=({content:e,theme:t="light",size:o="base",defaultExpanded:r=false})=>{let[a,n]=Yt.useState(r),i=Yt.useMemo(()=>`${(o==="sm"?14:o==="lg"?18:16)-2}px`,[o]);return jsxRuntime.jsxs("div",{className:`my-6 rounded-lg overflow-hidden transition-all duration-200 ${t==="dark"?"bg-gray-800":"bg-white"}`,style:{border:`0.5px solid ${t==="dark"?"#4b5563":"#d1d5db"}`},children:[jsxRuntime.jsxs("div",{className:`px-4 py-3 cursor-pointer flex items-center justify-between transition-colors duration-200 ${t==="dark"?"bg-gray-700 hover:bg-gray-650":"bg-gray-50 hover:bg-gray-100"}`,style:{borderBottom:`0.5px solid ${t==="dark"?"#4b5563":"#e5e7eb"}`},onClick:()=>n(!a),children:[jsxRuntime.jsxs("span",{className:"flex items-center",children:[jsxRuntime.jsx("span",{className:"mr-2",children:"\u{1F914}"}),jsxRuntime.jsx("span",{className:`font-medium ${t==="dark"?"text-gray-300":"text-gray-700"}`,style:{fontSize:o==="sm"?"14px":o==="lg"?"18px":"16px"},children:"\u601D\u8003\u8FC7\u7A0B"})]}),jsxRuntime.jsx("svg",{className:`w-4 h-4 transition-transform duration-200 ${a?"rotate-180":""} ${t==="dark"?"text-gray-400":"text-gray-500"}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),a&&jsxRuntime.jsx("div",{className:`p-4 whitespace-pre-wrap italic font-light ${t==="dark"?"text-gray-400":"text-gray-600"}`,style:{fontSize:i,lineHeight:"1.3 !important"},children:e})]})},xf=n1;var m1=({content:e,language:t="text",isStreaming:o=false,className:r=""})=>{let{theme:a}=nextThemes.useTheme(),[n,i]=Yt.useState(false),c=async()=>{try{await navigator.clipboard.writeText(e),i(!0),setTimeout(()=>i(!1),2e3);}catch(l){console.error("\u590D\u5236\u5931\u8D25:",l);}},d=a==="dark"?prism.oneDark:prism.oneLight;return jsxRuntime.jsxs("div",{className:Je("rounded-lg overflow-hidden border border-gray-200 dark:border-gray-700 my-4",r),children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-4 py-2 bg-gray-50 dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700",children:[jsxRuntime.jsx("span",{className:"text-xs font-medium text-gray-600 dark:text-gray-300 uppercase",children:t}),jsxRuntime.jsx("button",{onClick:c,className:"p-1 hover:bg-gray-200 dark:hover:bg-gray-700 rounded transition-colors",disabled:o,title:n?"Copied":"Copy code",children:n?jsxRuntime.jsx(lucideReact.Check,{size:14,className:"text-green-500"}):jsxRuntime.jsx(lucideReact.Clipboard,{size:14,className:"text-gray-500 dark:text-gray-400"})})]}),jsxRuntime.jsx("div",{className:"text-sm",children:jsxRuntime.jsx(reactSyntaxHighlighter.Prism,{language:t,style:d,customStyle:{margin:0,padding:"16px",fontSize:"14px",lineHeight:"1.5",backgroundColor:a==="dark"?"#1f2937":"#ffffff"},wrapLongLines:true,children:e})})]})},Cf=m1;var b1=({content:e,isLoading:t,className:o="",style:r})=>{let a=Yt.useRef(null),[n,i]=Yt.useState(false),[c,d]=Yt.useState(null),{theme:l}=nextThemes.useTheme();return Yt.useEffect(()=>{let s=async()=>{if(!(!e.trim()||!a.current)){i(true),d(null);try{kf__default.default.initialize({startOnLoad:!1,theme:l==="dark"?"dark":"default",securityLevel:"loose",fontFamily:"inherit"});let g=`mermaid-${Math.random().toString(36).substr(2,9)}`,p=e.replace(/```mermaid\n?|\n?```/g,"").trim(),{svg:b}=await kf__default.default.render(g,p);a.current&&(a.current.innerHTML=b);}catch(g){console.error("Mermaid render failed:",g),d(g instanceof Error?g.message:"Render failed"),a.current&&(a.current.innerText=e);}finally{i(false);}}},m=setTimeout(()=>{s();},100);return ()=>clearTimeout(m)},[e,l]),t||n?jsxRuntime.jsx("div",{className:`mermaid-block loading ${o}`,style:r,children:jsxRuntime.jsxs("div",{className:"flex items-center justify-center p-4 bg-gray-50 dark:bg-gray-800 rounded border border-gray-200 dark:border-gray-700",children:[jsxRuntime.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-blue-500 mr-2"}),jsxRuntime.jsx("span",{className:"text-sm text-gray-500",children:"Generating Diagram..."})]})}):c?jsxRuntime.jsxs("div",{className:"p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded text-red-600 dark:text-red-400 text-sm overflow-auto",children:[jsxRuntime.jsx("p",{className:"font-semibold mb-2",children:"Mermaid Error:"}),jsxRuntime.jsx("pre",{children:c}),jsxRuntime.jsx("pre",{className:"mt-4 text-xs text-gray-500",children:e})]}):jsxRuntime.jsx("div",{className:`mermaid-block overflow-x-auto ${o}`,style:r,ref:a})},Tf=b1;var k1=({title:e="\u53D1\u751F\u9519\u8BEF",content:t,errorCode:o,stack:r,icon:a,closable:n=true,onClose:i,onRetry:c,className:d="",...l})=>{let[s,m]=Yt.useState(false),[g,p]=Yt.useState(false),b=async()=>{if(c){p(true);try{await c();}catch(y){console.error("\u91CD\u8BD5\u5931\u8D25:",y);}finally{p(false);}}};return jsxRuntime.jsxs("div",{className:`relative w-full overflow-hidden rounded-lg border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 shadow-sm transition-all hover:shadow-md ${d}`,...l,children:[jsxRuntime.jsxs("div",{className:"flex p-4 border-l-4 border-l-red-500 bg-red-50 dark:bg-red-900/10",children:[jsxRuntime.jsx("div",{className:"flex-shrink-0 mr-3 text-red-500 mt-0.5",children:a||jsxRuntime.jsx(lucideReact.AlertCircle,{className:"w-5 h-5"})}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-2 mb-1",children:[jsxRuntime.jsx("h4",{className:"text-base font-semibold text-gray-900 dark:text-gray-100",children:e}),o&&jsxRuntime.jsx("span",{className:"text-xs font-mono px-1.5 py-0.5 rounded bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-300",children:o})]}),t&&jsxRuntime.jsx("div",{className:"text-sm text-gray-600 dark:text-gray-300 mb-3 leading-relaxed",children:typeof t=="string"?jsxRuntime.jsx("p",{className:"whitespace-pre-wrap",children:t}):t}),(c||r)&&jsxRuntime.jsxs("div",{className:"flex items-center space-x-4 mt-2",children:[c&&jsxRuntime.jsxs("button",{onClick:b,disabled:g,className:"flex items-center text-xs font-medium text-red-600 dark:text-red-400 hover:text-red-700 dark:hover:text-red-300 transition-colors disabled:opacity-50",children:[jsxRuntime.jsx(lucideReact.RotateCw,{className:`w-3.5 h-3.5 mr-1.5 ${g?"animate-spin":""}`}),g?"\u91CD\u8BD5\u4E2D...":"\u91CD\u8BD5"]}),r&&jsxRuntime.jsxs("button",{onClick:()=>m(!s),className:"flex items-center text-xs font-medium text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300 transition-colors",children:[s?jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3.5 h-3.5 mr-1"}):jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-3.5 h-3.5 mr-1"}),s?"\u9690\u85CF\u8BE6\u60C5":"\u67E5\u770B\u8BE6\u60C5"]})]})]}),n&&i&&jsxRuntime.jsx("button",{onClick:i,className:"flex-shrink-0 ml-3 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors self-start",children:jsxRuntime.jsx(lucideReact.X,{className:"w-4 h-4"})})]}),r&&s&&jsxRuntime.jsx("div",{className:"bg-gray-50 dark:bg-gray-950 p-3 border-t border-gray-100 dark:border-gray-800",children:jsxRuntime.jsx("pre",{className:"text-xs font-mono text-gray-600 dark:text-gray-400 overflow-x-auto whitespace-pre-wrap p-2 bg-white dark:bg-gray-900 rounded border border-gray-200 dark:border-gray-800",children:r})})]})},Vs=k1;var M1=({title:e="\u8B66\u544A",content:t,warningType:o,severity:r="warning",warnings:a=[],icon:n,closable:i=true,onClose:c,onConfirm:d,actionText:l,className:s="",...m})=>{let g=()=>{switch(r){case "info":return {borderLeftColor:"border-l-blue-500",iconColor:"text-blue-500",bgColor:"bg-blue-50 dark:bg-blue-900/10"};case "error":return {borderLeftColor:"border-l-red-500",iconColor:"text-red-500",bgColor:"bg-red-50 dark:bg-red-900/10"};case "success":return {borderLeftColor:"border-l-green-500",iconColor:"text-green-500",bgColor:"bg-green-50 dark:bg-green-900/10"};default:return {borderLeftColor:"border-l-yellow-500",iconColor:"text-yellow-500",bgColor:"bg-yellow-50 dark:bg-yellow-900/10"}}},p=()=>{switch(r){case "info":return jsxRuntime.jsx(lucideReact.Info,{className:"w-5 h-5"});case "error":return jsxRuntime.jsx(lucideReact.XCircle,{className:"w-5 h-5"});case "success":return jsxRuntime.jsx(lucideReact.CheckCircle,{className:"w-5 h-5"});default:return jsxRuntime.jsx(lucideReact.AlertTriangle,{className:"w-5 h-5"})}},b=g();return jsxRuntime.jsxs("div",{className:`relative w-full overflow-hidden rounded-lg border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 shadow-sm transition-all hover:shadow-md ${s}`,...m,children:[jsxRuntime.jsxs("div",{className:`flex p-4 border-l-4 ${b.borderLeftColor} ${b.bgColor}`,children:[jsxRuntime.jsx("div",{className:`flex-shrink-0 mr-3 ${b.iconColor}`,children:n||p()}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-1",children:[jsxRuntime.jsx("h4",{className:"text-base font-semibold text-gray-900 dark:text-gray-100",children:e}),o&&jsxRuntime.jsx("span",{className:"text-xs font-medium px-2 py-0.5 rounded-full bg-gray-100 dark:bg-gray-800 text-gray-600 dark:text-gray-400",children:o})]}),t&&jsxRuntime.jsx("div",{className:"text-sm text-gray-600 dark:text-gray-300 mb-2",children:t}),a&&a.length>0&&jsxRuntime.jsx("ul",{className:"mt-2 space-y-1",children:a.map((y,u)=>jsxRuntime.jsxs("li",{className:"flex items-start text-sm text-gray-600 dark:text-gray-300",children:[jsxRuntime.jsx("span",{className:"mr-2 mt-1.5 w-1 h-1 rounded-full bg-gray-400 dark:bg-gray-500 flex-shrink-0"}),jsxRuntime.jsx("span",{children:y})]},u))})]}),i&&c&&jsxRuntime.jsx("button",{onClick:c,className:"flex-shrink-0 ml-3 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors",children:jsxRuntime.jsx(lucideReact.X,{className:"w-4 h-4"})})]}),d&&jsxRuntime.jsx("div",{className:"bg-gray-50 dark:bg-gray-800/50 px-4 py-3 flex justify-end border-t border-gray-100 dark:border-gray-800",children:jsxRuntime.jsx("button",{onClick:d,className:"px-4 py-1.5 text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:focus:ring-offset-gray-900",children:l||"\u786E\u8BA4"})})]})},Ws=M1;var E1=({title:e="\u76F8\u5173\u63A8\u8350",content:t,suggestions:o,onSuggestionClick:r,maxDisplay:a=5,icon:n,closable:i=false,onClose:c,className:d="",...l})=>{let[s,m]=Yt.useState(false),[g,p]=Yt.useState(""),[b,y]=Yt.useState(false),u=Yt.useMemo(()=>g.trim()?o.filter(h=>h.toLowerCase().includes(g.toLowerCase())):o,[o,g]),x=Yt.useMemo(()=>s?u:u.slice(0,a),[u,s,a]),f=h=>{r?.(h);};return !o||o.length===0?null:jsxRuntime.jsxs("div",{className:`w-full overflow-hidden rounded-lg border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 shadow-sm transition-all hover:shadow-md ${d}`,...l,children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-100 dark:border-gray-800 bg-blue-50/30 dark:bg-blue-900/10",children:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-2.5",children:[jsxRuntime.jsx("div",{className:"text-blue-500 flex-shrink-0",children:n||jsxRuntime.jsx(lucideReact.Lightbulb,{className:"w-5 h-5"})}),jsxRuntime.jsxs("div",{className:"flex flex-col",children:[jsxRuntime.jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100 leading-tight",children:e}),t&&jsxRuntime.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5",children:t})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-1",children:[o.length>3&&jsxRuntime.jsx("button",{onClick:()=>y(!b),className:`p-1.5 rounded-md transition-colors ${b?"bg-blue-100 dark:bg-blue-900/30 text-blue-600 dark:text-blue-400":"text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800"}`,title:b?"\u5173\u95ED\u641C\u7D22":"\u641C\u7D22\u95EE\u9898",children:jsxRuntime.jsx(lucideReact.Search,{className:"w-4 h-4"})}),i&&c&&jsxRuntime.jsx("button",{onClick:c,className:"text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 p-1.5 rounded-md hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors",title:"\u5173\u95ED",children:jsxRuntime.jsx(lucideReact.X,{className:"w-4 h-4"})})]})]}),b&&jsxRuntime.jsx("div",{className:"px-4 py-2 border-b border-gray-100 dark:border-gray-800 bg-gray-50 dark:bg-gray-900/50",children:jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("input",{type:"text",placeholder:"\u641C\u7D22\u76F8\u5173\u95EE\u9898...",value:g,onChange:h=>p(h.target.value),className:"w-full text-sm px-3 py-1.5 pl-8 rounded border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 focus:ring-1 focus:ring-blue-500 focus:border-blue-500 outline-none transition-shadow",autoFocus:true}),jsxRuntime.jsx(lucideReact.Search,{className:"absolute left-2.5 top-2 w-3.5 h-3.5 text-gray-400"})]})}),jsxRuntime.jsxs("div",{className:"p-2",children:[jsxRuntime.jsx("ul",{className:"space-y-1",children:x.map((h,v)=>jsxRuntime.jsx("li",{children:jsxRuntime.jsxs("button",{onClick:()=>f(h),className:"w-full text-left px-3 py-2 rounded-md text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 hover:text-blue-600 dark:hover:text-blue-400 transition-colors group flex items-start justify-between",children:[jsxRuntime.jsx("span",{children:h}),jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-4 h-4 text-gray-300 group-hover:text-blue-400 opacity-0 group-hover:opacity-100 transition-all transform group-hover:translate-x-0.5"})]})},v))}),u.length>a&&jsxRuntime.jsx("button",{onClick:()=>m(!s),className:"w-full text-center py-2 text-xs font-medium text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 transition-colors border-t border-gray-50 dark:border-gray-800/50 mt-1",children:s?"\u6536\u8D77":`\u67E5\u770B\u5168\u90E8 (${u.length})`}),u.length===0&&g&&jsxRuntime.jsx("div",{className:"text-center py-4 text-sm text-gray-500 dark:text-gray-400",children:"\u6CA1\u6709\u627E\u5230\u5339\u914D\u7684\u5EFA\u8BAE"})]})]})},Hs=E1;var W1=({title:e,content:t,toolName:o,parameters:r,result:a,status:n,duration:i,icon:c,closable:d=false,onClose:l,onAction:s,actionText:m,className:g="",...p})=>{let[b,y]=Yt.useState(false),[u,x]=Yt.useState(true),f=()=>{switch(n){case "pending":return {iconColor:"text-blue-500",badgeBg:"bg-blue-50 dark:bg-blue-900/30",badgeText:"text-blue-600 dark:text-blue-400",label:"\u6267\u884C\u4E2D"};case "error":return {iconColor:"text-red-500",badgeBg:"bg-red-50 dark:bg-red-900/30",badgeText:"text-red-600 dark:text-red-400",label:"\u5931\u8D25"};default:return {iconColor:"text-green-500",badgeBg:"bg-green-50 dark:bg-green-900/30",badgeText:"text-green-600 dark:text-green-400",label:"\u6210\u529F"}}},h=()=>{switch(n){case "pending":return jsxRuntime.jsx(lucideReact.Loader2,{className:"w-5 h-5 animate-spin"});case "error":return jsxRuntime.jsx(lucideReact.XCircle,{className:"w-5 h-5"});default:return jsxRuntime.jsx(lucideReact.CheckCircle,{className:"w-5 h-5"})}},v=P=>P?P<1e3?`${P}ms`:`${(P/1e3).toFixed(2)}s`:"",S=f(),E=e||o||"\u5DE5\u5177\u8C03\u7528";return jsxRuntime.jsxs("div",{className:`w-full overflow-hidden rounded-lg border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 shadow-sm transition-all hover:shadow-md ${g}`,...p,children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-100 dark:border-gray-800 bg-gray-50/50 dark:bg-gray-800/50",children:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-3",children:[jsxRuntime.jsx("div",{className:`flex-shrink-0 ${S.iconColor}`,children:c||h()}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100",children:E}),jsxRuntime.jsx("span",{className:`text-[10px] font-medium px-1.5 py-0.5 rounded ${S.badgeBg} ${S.badgeText}`,children:S.label})]}),o&&e&&jsxRuntime.jsxs("div",{className:"text-xs text-gray-500 dark:text-gray-400 flex items-center mt-0.5",children:[jsxRuntime.jsx(lucideReact.Terminal,{className:"w-3 h-3 mr-1"}),o]})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2 text-xs text-gray-500 dark:text-gray-400",children:[i&&jsxRuntime.jsxs("div",{className:"flex items-center bg-gray-100 dark:bg-gray-800 px-2 py-1 rounded",children:[jsxRuntime.jsx(lucideReact.Clock,{className:"w-3 h-3 mr-1"}),v(i)]}),d&&l&&jsxRuntime.jsx("button",{onClick:l,className:"text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors p-1 rounded",children:jsxRuntime.jsx(lucideReact.X,{className:"w-4 h-4"})})]})]}),jsxRuntime.jsxs("div",{className:"p-4",children:[t&&jsxRuntime.jsx("div",{className:"text-sm text-gray-600 dark:text-gray-300 mb-4 leading-relaxed",children:t}),r&&jsxRuntime.jsxs("div",{className:"mb-3",children:[jsxRuntime.jsxs("button",{onClick:()=>y(!b),className:"flex items-center text-xs font-medium text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300 mb-2",children:[b?jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3.5 h-3.5 mr-1"}):jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-3.5 h-3.5 mr-1"}),jsxRuntime.jsx(lucideReact.Box,{className:"w-3.5 h-3.5 mr-1.5"}),"\u8F93\u5165\u53C2\u6570"]}),b&&jsxRuntime.jsx("div",{className:"bg-gray-50 dark:bg-gray-950 rounded border border-gray-100 dark:border-gray-800 overflow-hidden",children:jsxRuntime.jsx("pre",{className:"p-3 text-xs font-mono text-gray-600 dark:text-gray-400 overflow-x-auto",children:JSON.stringify(r,null,2)})})]}),a&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("button",{onClick:()=>x(!u),className:"flex items-center text-xs font-medium text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300 mb-2",children:[u?jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3.5 h-3.5 mr-1"}):jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-3.5 h-3.5 mr-1"}),jsxRuntime.jsx(lucideReact.Terminal,{className:"w-3.5 h-3.5 mr-1.5"}),"\u6267\u884C\u7ED3\u679C"]}),u&&jsxRuntime.jsx("div",{className:"bg-gray-50 dark:bg-gray-950 rounded border border-gray-100 dark:border-gray-800 overflow-hidden",children:jsxRuntime.jsx("pre",{className:"p-3 text-xs font-mono text-gray-600 dark:text-gray-400 overflow-x-auto",children:typeof a=="string"?a:JSON.stringify(a,null,2)})})]}),s&&jsxRuntime.jsx("div",{className:"mt-3 pt-3 border-t border-gray-100 dark:border-gray-800 flex justify-end",children:jsxRuntime.jsx("button",{onClick:s,className:"px-4 py-1.5 text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:focus:ring-offset-gray-900",children:m||"\u6267\u884C\u64CD\u4F5C"})})]})]})},$s=W1;var $1=({data:e})=>{if(!e)return null;let t=Yt.useMemo(()=>{let o=[],r=[],a="\u6570\u636E\u8868\u683C";return Array.isArray(e)?(o=e,o.length>0&&(r=Object.keys(o[0]).map(n=>({id:n,label:n.charAt(0).toUpperCase()+n.slice(1),numeric:typeof o[0][n]=="number"})))):typeof e=="object"&&(a=e.title||a,o=Array.isArray(e.rows)?e.rows:Array.isArray(e.data)?e.data:[],Array.isArray(e.columns)?r=e.columns.map(i=>({id:i.key||i.id,label:i.title||i.label,numeric:i.dataType==="number"||i.numeric})):o.length>0&&(r=Object.keys(o[0]).map(i=>({id:i,label:i,numeric:typeof o[0][i]=="number"})))),o=o.map((n,i)=>({...n,id:n.id||`row_${i}`})),{title:a,columns:r,rows:o}},[e]);return t.rows.length===0?jsxRuntime.jsx("div",{className:"w-full my-4 p-4 border border-dashed border-gray-300 rounded text-center text-gray-500",children:"\u6682\u65E0\u8868\u683C\u6570\u636E"}):jsxRuntime.jsx("div",{className:"w-full my-4",children:jsxRuntime.jsx(Dr,{appId:"agent-ui-table-card",title:t.title,columns:t.columns,rows:t.rows,count:t.rows.length,rowKey:"id",fitContainer:false,maxHeight:"500px",rowsPerPage:10,rowsPerPageOptions:[5,10,20,50]})})},Gs=$1;var Y1=({title:e,subtitle:t,data:o,type:r,config:a={}})=>{let n=()=>{switch(r){case "bar-chart-card":return jsxRuntime.jsx(lucideReact.BarChart,{className:"w-4 h-4 text-blue-500"});case "line-chart-card":return jsxRuntime.jsx(lucideReact.LineChart,{className:"w-4 h-4 text-green-500"});case "pie-chart-card":return jsxRuntime.jsx(lucideReact.PieChart,{className:"w-4 h-4 text-purple-500"});case "combo-chart-card":return jsxRuntime.jsx(lucideReact.Activity,{className:"w-4 h-4 text-orange-500"});case "heatmap-chart-card":return jsxRuntime.jsx(lucideReact.Grid,{className:"w-4 h-4 text-red-500"});case "fishbone-chart-card":return jsxRuntime.jsx(lucideReact.GitBranch,{className:"w-4 h-4 text-indigo-500"});case "waterfall-chart-card":return jsxRuntime.jsx(lucideReact.TrendingDown,{className:"w-4 h-4 text-teal-500"});case "google-map-card":return jsxRuntime.jsx(lucideReact.Globe,{className:"w-4 h-4 text-blue-600"});case "amap-card":return jsxRuntime.jsx(lucideReact.MapPin,{className:"w-4 h-4 text-blue-600"});default:return jsxRuntime.jsx(lucideReact.BarChart,{className:"w-4 h-4"})}},i=()=>{if(!o&&r!=="google-map-card"&&r!=="amap-card")return jsxRuntime.jsx("div",{className:"text-gray-500 text-sm p-4 text-center",children:"No data available"});try{switch(r){case "bar-chart-card":return jsxRuntime.jsx(vi,{data:o,orientation:a.orientation||"horizontal",valueSuffix:a.valueSuffix||"",minHeight:a.minHeight});case "line-chart-card":return jsxRuntime.jsx(cp,{data:o,color:a.color,valueSuffix:a.valueSuffix||"",height:a.height});case "pie-chart-card":let c=o.reduce((l,s)=>l+(Number(s.value)||0),0),d=o.map(l=>({name:l.name,value:Number(l.value)||0,percent:typeof l.percent=="number"?l.percent:c>0?(Number(l.value)||0)/c*100:0}));return jsxRuntime.jsx(Dl,{data:d,variant:a.variant||"donut",size:a.size,colors:a.colors});case "combo-chart-card":return jsxRuntime.jsx(dp,{data:o,barColor:a.barColor,lineColor:a.lineColor});case "heatmap-chart-card":return jsxRuntime.jsx(pp,{data:o});case "fishbone-chart-card":return jsxRuntime.jsx(gp,{branches:o,effect:a.effect||e||"Problem"});case "waterfall-chart-card":return jsxRuntime.jsx(hp,{data:o,height:a.height});case "google-map-card":return jsxRuntime.jsx(xp,{embedUrl:a.embedUrl||o&&o[0]?.embedUrl,apiKey:a.apiKey,query:a.query||o&&o[0]?.query||e,height:a.height});case "amap-card":return jsxRuntime.jsx(kp,{embedUrl:a.embedUrl||o&&o[0]?.embedUrl,keyword:a.keyword||o&&o[0]?.keyword||e,height:a.height});default:return jsxRuntime.jsxs("div",{className:"text-gray-500 text-sm p-4 text-center",children:["Unsupported chart type: ",r]})}}catch(c){return console.error("Error rendering chart:",c),jsxRuntime.jsx("div",{className:"text-red-500 text-sm p-4 text-center",children:"Error rendering chart"})}};return jsxRuntime.jsxs("div",{className:"w-full overflow-hidden rounded-lg border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 shadow-sm transition-all hover:shadow-md",children:[jsxRuntime.jsxs("div",{className:"flex items-center px-4 py-3 border-b border-gray-100 dark:border-gray-800 bg-gray-50/50 dark:bg-gray-800/50",children:[jsxRuntime.jsx("div",{className:"mr-2 flex-shrink-0",children:n()}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100 truncate",children:e}),t&&jsxRuntime.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5 truncate",children:t})]})]}),jsxRuntime.jsxs("div",{className:"p-4",children:[jsxRuntime.jsx("div",{className:"overflow-x-auto",children:i()}),jsxRuntime.jsx("div",{className:"mt-3",children:jsxRuntime.jsxs("details",{className:"text-xs text-gray-500 dark:text-gray-400",children:[jsxRuntime.jsx("summary",{className:"cursor-pointer hover:text-gray-700 dark:hover:text-gray-300 transition-colors select-none font-medium opacity-60 hover:opacity-100",children:"View Raw Data"}),jsxRuntime.jsx("pre",{className:"mt-2 p-2 bg-gray-50 dark:bg-gray-950 rounded border border-gray-100 dark:border-gray-800 overflow-x-auto max-h-40",children:JSON.stringify(o,null,2)})]})})]})]})},Us=Y1;var J1=({type:e,manifest:t})=>jsxRuntime.jsxs("div",{className:"w-full overflow-hidden rounded-lg border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 shadow-sm transition-all hover:shadow-md",children:[jsxRuntime.jsxs("div",{className:"flex items-center px-4 py-3 border-b border-gray-100 dark:border-gray-800 bg-blue-50/50 dark:bg-blue-900/10",children:[jsxRuntime.jsx(lucideReact.Box,{className:"w-4 h-4 mr-2 text-blue-600 dark:text-blue-400"}),jsxRuntime.jsxs("h3",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100",children:["SAP Card: ",e]})]}),jsxRuntime.jsx("div",{className:"p-4",children:jsxRuntime.jsx("div",{className:"bg-gray-50 dark:bg-gray-950 p-3 rounded border border-gray-100 dark:border-gray-800 overflow-x-auto",children:jsxRuntime.jsx("pre",{className:"text-xs font-mono text-gray-600 dark:text-gray-400 whitespace-pre-wrap",children:JSON.stringify(t,null,2)})})})]}),Ks=J1;var qs=e=>{let t;try{t=JSON.parse(e);}catch{return null}return t&&typeof t=="object"&&((t.type==="bar-chart-card"||t.type==="line-chart-card"||t.type==="pie-chart-card"||t.type==="combo-chart-card"||t.type==="heatmap-chart-card"||t.type==="fishbone-chart-card"||t.type==="waterfall-chart-card"||t.type==="google-map-card"||t.type==="amap-card")&&t.title||(t.type==="sap-analytical-card"||t.type==="sap-list-card"||t.type==="sap-object-card"||t.type==="sap-component-card")&&t.manifest||t.type==="error-card"||t.type==="warning-card"||t.type==="suggestions-card"||t.type==="tool-result-card"||t.type==="table"&&t.data)?t:null};var nT=({content:e,theme:t,size:o="base",className:r,enableCodeHighlight:a=true,enableMermaid:n=true,messageId:i,cardHooks:c})=>{let d=Yt.useMemo(()=>e?e.replace(/<think>([\s\S]*?)<\/think>/g,(g,p)=>`<div data-component="thinkbox" data-think-content="${encodeURIComponent(p.trim())}"></div>`):"",[e]),l=(g,p,b,y,u)=>{c?.onCardEvent?.({messageId:i,cardType:g,action:p,title:b,payload:y,rawData:u});},s=(g,p,b,y,u,x)=>{if(!(!u&&!c?.onCardEvent))return (...f)=>{let h=u?.(...f),v=x?x(...f):void 0;return l(g,p,b,v,y),h}},m=Yt.useMemo(()=>({div(g){let{"data-component":p,"data-think-content":b,...y}=g;return p==="thinkbox"&&b?jsxRuntime.jsx(xf,{content:decodeURIComponent(b),theme:t,size:o,defaultExpanded:false}):jsxRuntime.jsx("div",{...y})},table({children:g}){return jsxRuntime.jsx("div",{className:"my-4 w-full overflow-x-auto rounded-lg border border-gray-200 dark:border-gray-800",children:jsxRuntime.jsx("table",{className:"w-full min-w-[520px] border-collapse text-sm",children:g})})},thead({children:g}){return jsxRuntime.jsx("thead",{className:"bg-gray-50 dark:bg-gray-900/60",children:g})},tbody({children:g}){return jsxRuntime.jsx("tbody",{className:"bg-white dark:bg-gray-950",children:g})},tr({children:g}){return jsxRuntime.jsx("tr",{className:"border-b border-gray-200 dark:border-gray-800 last:border-b-0",children:g})},th({children:g,align:p}){return jsxRuntime.jsx("th",{className:`px-3 py-2 font-semibold text-gray-800 dark:text-gray-100 ${p==="center"?"text-center":p==="right"?"text-right":"text-left"}`,children:g})},td({children:g,align:p}){return jsxRuntime.jsx("td",{className:`px-3 py-2 text-gray-700 dark:text-gray-200 align-top ${p==="center"?"text-center":p==="right"?"text-right":"text-left"}`,children:g})},code({inline:g,className:p,children:b,...y}){let u=/language-([\w-]+)/.exec(p||""),x=u?u[1]:"";if(g)return jsxRuntime.jsx("code",{className:"font-mono text-sm bg-gray-100 dark:bg-gray-800 px-1 py-0.5 rounded text-red-600 dark:text-red-400",...y,children:b});let f=String(b).replace(/\n$/,"");if(n&&x==="mermaid")return jsxRuntime.jsx(Tf,{content:f});if(x==="json"){let h=qs(f);if(h)switch(h.type){case "table":return jsxRuntime.jsx(Gs,{data:h.data});case "bar-chart-card":case "line-chart-card":case "pie-chart-card":case "combo-chart-card":case "heatmap-chart-card":case "fishbone-chart-card":case "waterfall-chart-card":case "google-map-card":case "amap-card":return jsxRuntime.jsx(Us,{...h});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return jsxRuntime.jsx(Ks,{...h});case "error-card":{let v=h;return jsxRuntime.jsx(Vs,{...v,onClose:s("error-card","close",v.title,v,v.onClose),onRetry:s("error-card","retry",v.title,v,v.onRetry)})}case "warning-card":{let v=h,S=v.onConfirm?s("warning-card","confirm",v.title,v,v.onConfirm):v.actionText&&c?.onCardEvent?s("warning-card","confirm",v.title,v):void 0;return jsxRuntime.jsx(Ws,{...v,onClose:s("warning-card","close",v.title,v,v.onClose),onConfirm:S})}case "suggestions-card":{let v=h;return jsxRuntime.jsx(Hs,{...v,onClose:s("suggestions-card","close",v.title,v,v.onClose),onSuggestionClick:s("suggestions-card","suggestion-click",v.title,v,v.onSuggestionClick,S=>({suggestion:S}))})}case "tool-result-card":{let v=h;return jsxRuntime.jsx($s,{...v,onClose:s("tool-result-card","close",v.title,v,v.onClose),onAction:s("tool-result-card","action",v.title,v,v.onAction)})}}}return a?jsxRuntime.jsx(Cf,{content:f,language:x,className:"not-prose"}):jsxRuntime.jsx("code",{className:p,...y,children:b})}}),[t,o,n,a,c,i]);return jsxRuntime.jsx("div",{className:Je("markdown-body prose dark:prose-invert max-w-none",r),children:jsxRuntime.jsx(eT__default.default,{remarkPlugins:[tT__default.default,oT__default.default],rehypePlugins:[rT__default.default,aT__default.default],components:m,children:d})})},js=nT;var iT=({content:e,messageId:t,cardHooks:o})=>{let r=(i,c,d,l,s)=>{o?.onCardEvent?.({messageId:t,cardType:i,action:c,title:d,payload:l,rawData:s});},a=(i,c,d,l,s,m)=>{if(!(!s&&!o?.onCardEvent))return (...g)=>{let p=s?.(...g),b=m?m(...g):void 0;return r(i,c,d,b,l),p}},n=qs(e);if(n)switch(n.type){case "table":return jsxRuntime.jsx(Gs,{data:n.data});case "bar-chart-card":case "line-chart-card":case "pie-chart-card":case "combo-chart-card":case "heatmap-chart-card":case "fishbone-chart-card":case "waterfall-chart-card":case "google-map-card":case "amap-card":return jsxRuntime.jsx(Us,{...n});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return jsxRuntime.jsx(Ks,{...n});case "error-card":{let i=n;return jsxRuntime.jsx(Vs,{...i,onClose:a("error-card","close",i.title,i,i.onClose),onRetry:a("error-card","retry",i.title,i,i.onRetry)})}case "warning-card":{let i=n,c=i.onConfirm?a("warning-card","confirm",i.title,i,i.onConfirm):i.actionText&&o?.onCardEvent?a("warning-card","confirm",i.title,i):void 0;return jsxRuntime.jsx(Ws,{...i,onClose:a("warning-card","close",i.title,i,i.onClose),onConfirm:c})}case "suggestions-card":{let i=n;return jsxRuntime.jsx(Hs,{...i,onClose:a("suggestions-card","close",i.title,i,i.onClose),onSuggestionClick:a("suggestions-card","suggestion-click",i.title,i,i.onSuggestionClick,c=>({suggestion:c}))})}case "tool-result-card":{let i=n;return jsxRuntime.jsx($s,{...i,onClose:a("tool-result-card","close",i.title,i,i.onClose),onAction:a("tool-result-card","action",i.title,i,i.onAction)})}}return jsxRuntime.jsx("div",{className:"dynamic-card-fallback",children:jsxRuntime.jsx(js,{content:e,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:t,cardHooks:o})})},Lf=iT;var eu=class{static analyze(t){if(!t.trim())return {blocks:[],hasComplexContent:false,overallType:"simple"};let r=/```json\s*\{\s*"type":\s*"[^"]+"/g.test(t),a=/<[^>]+>[\s\S]*?<\/[^>]+>/.test(t),n=t.includes("NQ#")||t.includes("data-component");return r||a||n?{blocks:[{type:"mixed",content:t,startIndex:0,endIndex:t.length}],hasComplexContent:true,overallType:"complex"}:{blocks:[{type:"markdown",content:t,startIndex:0,endIndex:t.length}],hasComplexContent:false,overallType:"simple"}}},sT=({content:e,className:t="",messageId:o,cardHooks:r})=>{let a=Yt__namespace.default.useMemo(()=>eu.analyze(e),[e]);return jsxRuntime.jsx("div",{className:`universal-content-renderer ${t}`,children:a.blocks.map((n,i)=>n.type==="mixed"||n.type==="json-card"?jsxRuntime.jsx(Lf,{content:n.content,messageId:o,cardHooks:r},`block-${i}`):jsxRuntime.jsx(js,{content:n.content,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:o,cardHooks:r},`block-${i}`))})},Nf=sT;var cT=({content:e,isStreaming:t=true,onComplete:o,className:r="",streamIntervalMs:a=24,streamChunkSize:n=3,messageId:i,cardHooks:c})=>{let[d,l]=Yt.useState(t?0:e.length),[s,m]=Yt.useState(!t);Yt.useEffect(()=>{if(t){l(0),m(false);return}l(e.length),m(true);},[e,t]),Yt.useEffect(()=>{if(!t||s)return;if(d>=e.length){m(true),o?.();return}let u=window.setTimeout(()=>{l(x=>Math.min(x+n,e.length));},a);return ()=>{window.clearTimeout(u);}},[e.length,s,t,o,n,a,d]);let g=()=>{t&&!s&&(l(e.length),m(true),o?.());},p=t?e.slice(0,d):e,b=t&&!s,y=t&&!s;return jsxRuntime.jsxs("div",{className:`streaming-markdown ${r}`,onClick:g,style:{cursor:t?"pointer":"default"},children:[jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx(Nf,{content:p,messageId:i,cardHooks:c}),b&&jsxRuntime.jsx("span",{className:"inline-block w-0.5 h-5 bg-blue-500 ml-1 animate-pulse",style:{verticalAlign:"text-bottom"}})]}),y&&jsxRuntime.jsx("div",{className:"streaming-hint",style:{fontSize:"9px",color:"#999",marginTop:"8px",fontStyle:"italic",opacity:.7},children:"\u70B9\u51FB\u6B64\u5904\u663E\u793A\u5B8C\u6574\u5185\u5BB9"})]})},Wf=cT;var Hf=({buttons:e,className:t})=>{let o=r=>{switch(r){case "copy":return jsxRuntime.jsx(lucideReact.Copy,{size:14});case "refresh":return jsxRuntime.jsx(lucideReact.RefreshCw,{size:14});case "volume":return jsxRuntime.jsx(lucideReact.Volume2,{size:14});case "like":return jsxRuntime.jsx(lucideReact.ThumbsUp,{size:14});case "dislike":return jsxRuntime.jsx(lucideReact.ThumbsDown,{size:14});default:return null}};return jsxRuntime.jsx("div",{className:Je("flex items-center gap-1",t),children:e.map((r,a)=>jsxRuntime.jsx("button",{onClick:r.onClick,disabled:r.disabled,"aria-busy":r.loading||void 0,className:Je("p-1.5 rounded-md transition-colors","text-gray-500 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-100","hover:bg-gray-100 dark:hover:bg-gray-800","disabled:opacity-50 disabled:cursor-not-allowed",r.active&&"text-blue-600 bg-blue-50 dark:text-blue-400 dark:bg-blue-900/20",r.type==="refresh"&&r.loading&&"animate-spin"),title:r.type,type:"button",children:o(r.type)},`${r.type}-${a}`))})};var Xs=({message:e,onStreamingComplete:t,assistantActions:o,streamIntervalMs:r,streamChunkSize:a,cardHooks:n})=>{if(e.type==="assistant"){let i=!!(o?.isResponding||e.isStreaming);return jsxRuntime.jsx("div",{className:"flex justify-start mb-4",children:jsxRuntime.jsxs("div",{className:"w-full bg-transparent text-black dark:text-gray-100 rounded-2xl px-4 py-3 mr-auto",style:{lineHeight:"1.5",fontSize:"16px",fontWeight:"280",fontFamily:'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'},children:[jsxRuntime.jsx(Wf,{content:e.content,isStreaming:e.isStreaming??false,onComplete:t,streamIntervalMs:r,streamChunkSize:a,messageId:e.id,cardHooks:n}),e.content&&o?.isLatestAssistant&&jsxRuntime.jsx("div",{className:"flex flex-row justify-start gap-2 mt-3 pt-2 border-t border-gray-100 dark:border-gray-700",children:jsxRuntime.jsx(Hf,{buttons:[{type:"refresh",onClick:()=>{o?.onRegenerate?.();},disabled:i||!o?.onRegenerate,loading:i},{type:"copy",onClick:()=>navigator.clipboard.writeText(e.content),disabled:false},{type:"volume",onClick:()=>console.log("\u8BED\u97F3\u64AD\u653E"),disabled:false},{type:"like",onClick:()=>console.log("\u70B9\u8D5E"),disabled:false},{type:"dislike",onClick:()=>console.log("\u70B9\u8E29"),disabled:false}],size:"sm",variant:"default"})}),jsxRuntime.jsx("div",{className:"text-xs mt-2 text-gray-500 dark:text-gray-400",children:e.timestamp.toLocaleTimeString()})]})})}return jsxRuntime.jsx("div",{className:"flex justify-end",children:jsxRuntime.jsxs("div",{className:"max-w-[80%] bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-100 rounded-2xl px-4 py-3 ml-auto",style:{lineHeight:"1.5",fontSize:"16px",fontWeight:"280",fontFamily:'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'},children:[jsxRuntime.jsx("div",{className:"whitespace-pre-wrap",style:{lineHeight:"1.5",fontSize:"16px",fontWeight:"280",fontFamily:'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'},children:e.content}),jsxRuntime.jsx("div",{className:"text-xs mt-2 text-gray-500 dark:text-gray-400",children:e.timestamp.toLocaleTimeString()})]})})};var Gf=({onTextUpdate:e,onComplete:t,onCancel:o,disabled:r,className:a})=>{let{isRecording:n,startRecording:i,stopRecording:c}=Rn({onTextUpdate:e,onComplete:l=>{t?.(l);},onError:l=>{console.error("Voice input error:",l),o?.();}});return jsxRuntime.jsx("button",{onClick:async()=>{n?c():await i();},disabled:r,className:Je("transition-all duration-200 flex items-center justify-center rounded-full",n?"bg-red-100 text-red-600 hover:bg-red-200 animate-pulse":"bg-transparent hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-500 dark:text-gray-400 active:scale-95",r&&"opacity-50 cursor-not-allowed",a),title:n?"Stop recording":"Start recording",type:"button",children:n?jsxRuntime.jsx(hT__default.default,{sx:{fontSize:24}}):jsxRuntime.jsx(fT__default.default,{sx:{fontSize:24}})})};var Qt={container:"w-full max-w-4xl mx-auto",inputContainer:Je("w-full border backdrop-blur-xl transition-all duration-300 shadow-2xl flex flex-col","bg-white/80 dark:bg-gray-900/80","border-gray-200/60 dark:border-gray-600/40","shadow-gray-900/5","hover:border-blue-300/80 hover:shadow-blue-500/10 hover:shadow-2xl","focus-within:border-blue-400/90 focus-within:shadow-blue-500/20 focus-within:shadow-3xl focus-within:scale-[1.005] transform-gpu"),dragActive:"border-blue-500 bg-blue-50/50 dark:bg-blue-900/20",textareaWrapper:"flex-1 relative flex items-center",textarea:Je("w-full outline-none appearance-none resize-none bg-transparent border-none text-sm font-normal py-3 px-2","placeholder:text-gray-400/70 dark:placeholder:text-gray-500/60 placeholder:font-normal","text-gray-800 dark:text-gray-100 selection:bg-blue-200/50 dark:selection:bg-blue-500/30","focus:ring-0 focus:outline-none focus:border-none focus:shadow-none","min-h-[44px] max-h-[12em] overflow-y-auto scrollbar-thin scrollbar-thumb-gray-300 dark:scrollbar-thumb-gray-600"),filePreviewArea:"px-6 pt-3 pb-1 flex flex-wrap gap-2",fileTag:Je("flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs font-medium","bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300","border border-gray-200 dark:border-gray-700","transition-all hover:bg-gray-200 dark:hover:bg-gray-700"),buttonBase:"flex items-center justify-center transition-all duration-200 rounded-full",buttonSmall:"w-10 h-10",buttonNormal:Je("bg-transparent hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-500 dark:text-gray-400","cursor-pointer active:scale-95"),sendButton:Je("cursor-pointer bg-transparent hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-500 dark:text-gray-400 shadow-none active:scale-95"),sendButtonDisabled:Je("cursor-not-allowed opacity-40 bg-transparent text-gray-400"),stopButton:Je("cursor-pointer bg-red-500 hover:bg-red-600 text-white shadow-sm active:scale-95")},wT={padding:0,lineHeight:"1.5",border:"none !important",boxShadow:"none !important",backgroundColor:"transparent",height:"auto",fontFeatureSettings:'"liga" 1, "kern" 1',WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},TT=({enabled:e,onClick:t})=>jsxRuntime.jsx("button",{className:Je(Qt.buttonBase,Qt.buttonSmall,Qt.buttonNormal),onClick:t,disabled:!e,"aria-label":"Upload file",type:"button",children:jsxRuntime.jsx(_C__default.default,{sx:{fontSize:24}})}),IT=()=>jsxRuntime.jsxs("button",{className:Je(Qt.buttonBase,"h-10 px-3 py-2 gap-1.5 rounded-full",Qt.buttonNormal),"aria-label":"Tools",type:"button",children:[jsxRuntime.jsx(kT__default.default,{sx:{fontSize:20}}),jsxRuntime.jsx("span",{className:"text-sm font-medium",children:"Tools"})]}),PT=({canSend:e,isResponding:t,onSend:o,onStop:r})=>t?jsxRuntime.jsx("button",{className:Je(Qt.buttonBase,Qt.buttonSmall,Qt.stopButton),onClick:r,"aria-label":"Stop generating",type:"button",children:jsxRuntime.jsx(iconsMaterial.Stop,{sx:{fontSize:20}})}):jsxRuntime.jsx("button",{className:Je(Qt.buttonBase,Qt.buttonSmall,e?Qt.sendButton:Qt.sendButtonDisabled),onClick:o,disabled:!e,"aria-label":"Send message",type:"button",children:jsxRuntime.jsx(CT__default.default,{sx:{fontSize:24},className:e?"text-gray-500 dark:text-gray-400":"text-gray-300 dark:text-gray-600"})}),Uf=({onSend:e,onStop:t,isResponding:o=false,placeholder:r,getText:a})=>{let[n,i]=Yt.useState(""),[c,d]=Yt.useState([]),[l,s]=Yt.useState(false),[m,g]=Yt.useState(false),p=Yt.useRef(null),b=r||(a?a("00019","Type a message..."):"Type a message..."),y=(n.trim().length>0||c.length>0)&&!o,u={enabled:true},x=Yt.useCallback(M=>{i(M.target.value),M.target.style.height="auto",M.target.style.height=`${Math.min(M.target.scrollHeight,200)}px`;},[]),f=Yt.useCallback(M=>{if(M.target.files&&M.target.files.length>0){let Z=Array.from(M.target.files);d(L=>{let ee=Z.filter(q=>L.some($=>$.name===q.name&&$.size===q.size));ee.length>0&&console.warn("Duplicate files ignored:",ee.map(q=>q.name));let H=Z.filter(q=>!L.some($=>$.name===q.name&&$.size===q.size));return [...L,...H]}),p.current&&(p.current.value="");}},[]),h=Yt.useCallback(M=>{d(Z=>Z.filter((L,ee)=>ee!==M));},[]),v=Yt.useCallback(()=>{p.current?.click();},[]),S=Yt.useCallback(async()=>{if(!y)return;let M=n,Z=[...c];i(""),d([]),p.current&&(p.current.value="");try{await e(M,Z);}catch(L){console.error("Failed to send message:",L),i(M),d(Z);}},[n,y,e,c]),E=Yt.useCallback(M=>{M.key==="Enter"&&!M.shiftKey&&!l&&(M.preventDefault(),S());},[S,l]),P=Yt.useCallback(()=>{s(true);},[]),w=Yt.useCallback(()=>{s(false);},[]),D=Yt.useCallback(M=>{i(M);},[]),I=Yt.useCallback(M=>{i(M);},[]),k=Yt.useCallback(()=>{},[]),A=Yt.useCallback(M=>{M.preventDefault(),g(true);},[]),T=Yt.useCallback(M=>{M.preventDefault(),g(false);},[]),R=Yt.useCallback(M=>{if(M.preventDefault(),g(false),M.dataTransfer.files&&M.dataTransfer.files.length>0){let Z=Array.from(M.dataTransfer.files);d(L=>[...L,...Z]);}},[]);return jsxRuntime.jsx("div",{className:Qt.container,children:jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("input",{type:"file",multiple:true,className:"hidden",ref:p,onChange:f}),jsxRuntime.jsxs("div",{className:Je(Qt.inputContainer,m&&Qt.dragActive),style:{borderRadius:"32px"},onDragOver:A,onDragLeave:T,onDrop:R,children:[c.length>0&&jsxRuntime.jsx("div",{className:Qt.filePreviewArea,children:c.map((M,Z)=>jsxRuntime.jsxs("div",{className:Qt.fileTag,children:[jsxRuntime.jsx(iconsMaterial.InsertDriveFile,{sx:{fontSize:16},className:"text-blue-500"}),jsxRuntime.jsx("span",{className:"truncate max-w-[150px]",children:M.name}),jsxRuntime.jsx("button",{onClick:()=>h(Z),className:"ml-1 hover:text-red-500 focus:outline-none",type:"button",children:jsxRuntime.jsx(iconsMaterial.Close,{sx:{fontSize:16}})})]},`${M.name}-${Z}`))}),jsxRuntime.jsxs("div",{className:"flex flex-col w-full p-2",children:[jsxRuntime.jsx("div",{className:Je(Qt.textareaWrapper,"px-3 pt-2 pb-3 min-h-[60px]"),children:jsxRuntime.jsx("textarea",{className:Je(Qt.textarea,"min-h-[24px] py-0 px-0"),placeholder:b,value:n,onChange:x,onKeyDown:E,onCompositionStart:P,onCompositionEnd:w,style:wT,"aria-label":"Message input",spellCheck:false,rows:1})}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-1 pb-1",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-1",role:"toolbar","aria-label":"Input tools",children:[jsxRuntime.jsx(TT,{enabled:u.enabled,onClick:v}),jsxRuntime.jsx(IT,{})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Gf,{onTextUpdate:D,onComplete:I,onCancel:k,disabled:o,className:Qt.buttonSmall}),jsxRuntime.jsx(PT,{canSend:y,isResponding:o,onSend:S,onStop:t})]})]})]})]})]})})};var qf=({messages:e,onSend:t,onStop:o,onRegenerate:r,isResponding:a=false,className:n,placeholder:i,streamIntervalMs:c,streamChunkSize:d,onMessageStreamingComplete:l,cardHooks:s,showInput:m=true})=>{let g=Yt.useRef(null),p=Yt.useRef(e.length);return Yt.useEffect(()=>{e.length>p.current&&g.current?.scrollIntoView({behavior:"smooth"}),p.current=e.length;},[e]),jsxRuntime.jsxs("div",{className:Je("flex flex-col h-full w-full relative",n),children:[jsxRuntime.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-4 space-y-6 scrollbar-thin scrollbar-thumb-gray-300 dark:scrollbar-thumb-gray-600",children:[e.map((b,y)=>{let u=b.type==="assistant"&&y===e.length-1,x=b.type==="assistant"?{isLatestAssistant:u,isResponding:a,onRegenerate:r?()=>r(b.id):void 0}:void 0;return jsxRuntime.jsx(Xs,{message:b,assistantActions:x,onStreamingComplete:()=>l?.(b.id),streamIntervalMs:c,streamChunkSize:d,cardHooks:s},b.id)}),jsxRuntime.jsx("div",{ref:g})]}),m&&jsxRuntime.jsx("div",{className:"p-4 bg-gradient-to-t from-white via-white to-transparent dark:from-gray-900 dark:via-gray-900 pb-8 z-10",children:jsxRuntime.jsx(Uf,{onSend:t||(async()=>{}),onStop:o||(()=>{}),isResponding:a,placeholder:i})})]})};var Yo={};var DT={idle:"Idle",running:"Running",success:"Success",error:"Error",pending:"Pending"},jf=({title:e="AI Agent",description:t,headerActions:o,className:r,agentStatus:a,onHeaderPointerDown:n,showInput:i=false,...c})=>{let d=a??(c.isResponding?"running":"idle");return jsxRuntime.jsxs("div",{className:Je("relative flex h-full w-full",Yo.agentPanel,r),"data-status":d,children:[jsxRuntime.jsx("div",{className:Yo.colorHalo,"data-status":d,"aria-hidden":"true"}),jsxRuntime.jsxs("div",{className:Yo.marqueeBorder,"data-status":d,"aria-hidden":"true",children:[jsxRuntime.jsx("span",{className:Je(Yo.edge,Yo.top)}),jsxRuntime.jsx("span",{className:Je(Yo.edge,Yo.right)}),jsxRuntime.jsx("span",{className:Je(Yo.edge,Yo.bottom)}),jsxRuntime.jsx("span",{className:Je(Yo.edge,Yo.left)})]}),jsxRuntime.jsxs("div",{className:"relative z-10 flex h-full w-full flex-col rounded-xl border border-slate-200/70 bg-white shadow-sm overflow-hidden dark:border-slate-800 dark:bg-gray-950",children:[jsxRuntime.jsxs("div",{className:Je("flex items-center justify-between px-6 py-4 border-b border-gray-100 dark:border-gray-800 bg-white/50 dark:bg-gray-900/50 backdrop-blur-sm z-20",n&&"cursor-grab active:cursor-grabbing"),onPointerDown:n,children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100",children:e}),t&&jsxRuntime.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5",children:t})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsxs("div",{className:"inline-flex items-center gap-1.5 px-2 py-1 rounded-full bg-gray-100/80 dark:bg-gray-800/70",children:[jsxRuntime.jsx("span",{className:Yo.statusDot,"data-status":d}),jsxRuntime.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-gray-600 dark:text-gray-300",children:DT[d]})]}),o]})]}),jsxRuntime.jsx("div",{className:"flex-1 min-h-0 relative z-10",children:jsxRuntime.jsx(qf,{...c,showInput:i})})]})]})};var Yf=520,ET=88,FT=88,LT=24,Qs=640,Qf=(e,t,o)=>Math.min(Math.max(e,t),Math.max(t,o)),ru=e=>typeof e=="number"?`${e}px`:e,NT=e=>e instanceof HTMLElement?!!e.closest('button,input,a,textarea,select,[role="button"],[contenteditable="true"]'):false,d8=({anchor:e,defaultAnchor:t="right",onAnchorChange:o,width:r=Yf,top:a=ET,bottom:n=FT,inset:i=LT,zIndex:c=1300,shellClassName:d,shellStyle:l,className:s,onHeaderPointerDown:m,...g})=>{let p=Yt.useRef(null),b=Yt.useRef(null),[y,u]=Yt.useState(t),[x,f]=Yt.useState(0),[h,v]=Yt.useState(typeof r=="number"?r:Yf),[S,E]=Yt.useState(0),[P,w]=Yt.useState(false),D=e??y;Yt.useEffect(()=>{let L=()=>f(window.innerWidth);return L(),window.addEventListener("resize",L),()=>window.removeEventListener("resize",L)},[]),Yt.useLayoutEffect(()=>{let L=()=>{let H=p.current?.getBoundingClientRect();H?.width?v(H.width):typeof r=="number"&&v(r);};if(L(),!p.current||typeof ResizeObserver>"u")return;let ee=new ResizeObserver(L);return ee.observe(p.current),()=>ee.disconnect()},[r]);let I=Yt.useCallback(L=>{if(!x)return i;let ee=x<Qs?12:i,H=Math.max(ee,x-h-ee);return x<Qs||L==="left"?ee:L==="center"?Qf((x-h)/2,ee,H):H},[i,h,x]),k=Yt.useCallback(L=>["left","center","right"].reduce((H,q)=>{let $=Math.abs(L-I(H));return Math.abs(L-I(q))<$?q:H},"right"),[I]),A=Yt.useCallback(L=>{e===void 0&&u(L),o?.(L);},[e,o]);Yt.useEffect(()=>{P||E(I(D));},[I,P,D]);let T=Yt.useCallback(L=>{m?.(L),!(L.defaultPrevented||NT(L.target))&&(L.preventDefault(),L.currentTarget.setPointerCapture(L.pointerId),b.current={pointerId:L.pointerId,startClientX:L.clientX,startX:S,currentX:S,captureElement:L.currentTarget},w(true));},[m,S]),R=Yt.useCallback(L=>{let ee=b.current;if(!ee||ee.pointerId!==L.pointerId)return;let H=x<Qs?12:i,q=Math.max(H,x-h-H),$=Qf(ee.startX+L.clientX-ee.startClientX,H,q);ee.currentX=$,E($);},[i,h,x]),M=Yt.useCallback(L=>{let ee=b.current;if(!ee||ee.pointerId!==L.pointerId)return;try{ee.captureElement.releasePointerCapture(L.pointerId);}catch{}let H=k(ee.currentX);b.current=null,w(false),A(H),E(I(H));},[I,A,k]),Z=Yt.useMemo(()=>({position:"fixed",top:ru(a),bottom:ru(n),left:S,width:ru(r),maxWidth:`calc(100vw - ${x<Qs?24:i*2}px)`,zIndex:c,pointerEvents:"auto",transition:P?"none":"left 180ms ease-out",touchAction:"none",...l}),[n,i,P,S,l,a,x,r,c]);return jsxRuntime.jsx("div",{ref:p,className:Je("orbcafe-floating-agent-panel min-w-0",d),"data-anchor":D,"data-dragging":P?"true":"false",style:Z,onPointerMove:R,onPointerUp:M,onPointerCancel:M,children:jsxRuntime.jsx(jf,{...g,className:s,onHeaderPointerDown:T})})};var HT={"top-left":"bottom-right","top-right":"bottom-left","bottom-left":"top-right","bottom-right":"top-left"},y8=({messages:e,onSend:t,onRegenerate:o,isResponding:r=false,className:a,placeholder:n,title:i="Copilot",corner:c="bottom-right",onCollapse:d,onHeaderPointerDown:l,onPlusClick:s,onMicClick:m,streamIntervalMs:g,streamChunkSize:p,onMessageStreamingComplete:b,cardHooks:y})=>{let[u,x]=Yt.useState(""),[f,h]=Yt.useState(false),v=Yt.useRef(null),S=HT[c];Yt.useEffect(()=>{v.current?.scrollIntoView({behavior:"smooth"});},[e,r]);let E=Yt.useCallback(async()=>{let w=u.trim();!w||r||(x(""),await t(w));},[r,t,u]),P=Yt.useCallback(async w=>{w.key==="Enter"&&!f&&(w.preventDefault(),await E());},[E,f]);return jsxRuntime.jsxs("div",{className:Je("relative flex h-full w-full min-h-[460px] min-w-[340px] flex-col overflow-hidden rounded-3xl border border-gray-200 bg-white shadow-none dark:border-gray-800 dark:bg-gray-900",a),children:[d&&jsxRuntime.jsx("button",{onClick:d,className:Je("absolute z-20 flex h-10 w-10 items-center justify-center rounded-full transition-colors hover:bg-transparent dark:hover:bg-transparent",S==="top-left"&&"-left-2 -top-2",S==="top-right"&&"-right-2 -top-2",S==="bottom-left"&&"-bottom-2 -left-2",S==="bottom-right"&&"-bottom-2 -right-2"),type:"button","aria-label":"Collapse Copilot",children:jsxRuntime.jsx("span",{className:Je("block h-4 w-4 border-[#21BCFF]",S==="top-left"&&"rounded-tl-full border-l-[3px] border-t-[3px]",S==="top-right"&&"rounded-tr-full border-r-[3px] border-t-[3px]",S==="bottom-left"&&"rounded-bl-full border-b-[3px] border-l-[3px]",S==="bottom-right"&&"rounded-br-full border-b-[3px] border-r-[3px]")})}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between border-b border-gray-100 px-4 py-3 dark:border-gray-800",onPointerDown:l,children:[jsxRuntime.jsx("div",{className:"flex items-center",children:jsxRuntime.jsx("h3",{className:"text-base font-semibold tracking-tight text-gray-900 dark:text-gray-100",children:i})}),jsxRuntime.jsx("div",{})]}),jsxRuntime.jsxs("div",{className:"flex-1 overflow-y-auto px-3 py-3 space-y-5 scrollbar-thin scrollbar-thumb-gray-300 dark:scrollbar-thumb-gray-600",children:[e.map((w,D)=>{let I=w.type==="assistant"&&D===e.length-1,k=w.type==="assistant"?{isLatestAssistant:I,isResponding:r,onRegenerate:o?()=>o(w.id):void 0}:void 0;return jsxRuntime.jsx(Xs,{message:w,assistantActions:k,onStreamingComplete:()=>b?.(w.id),streamIntervalMs:g,streamChunkSize:p,cardHooks:y},w.id)}),jsxRuntime.jsx("div",{ref:v})]}),jsxRuntime.jsx("div",{className:"border-t border-gray-100 px-3 py-3 dark:border-gray-800",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-2 rounded-xl border border-blue-300/80 bg-white px-2 py-1.5 dark:bg-gray-900",children:[jsxRuntime.jsx("button",{className:"flex h-8 w-8 items-center justify-center rounded-full text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-700 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-gray-200",onClick:s,type:"button","aria-label":"Add",children:jsxRuntime.jsx(lucideReact.Plus,{className:"h-4 w-4"})}),jsxRuntime.jsx("input",{className:"h-7 flex-1 border-none bg-transparent text-sm text-gray-800 outline-none placeholder:text-gray-400 dark:text-gray-100 dark:placeholder:text-gray-500",placeholder:n||"Ask Copilot...",value:u,onChange:w=>x(w.target.value),onCompositionStart:()=>h(true),onCompositionEnd:()=>h(false),onKeyDown:P,"aria-label":"Copilot input",spellCheck:false}),jsxRuntime.jsx("button",{className:"flex h-8 w-8 items-center justify-center rounded-full text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-700 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-gray-200",onClick:m,type:"button","aria-label":"Microphone",children:jsxRuntime.jsx(lucideReact.Mic,{className:"h-4 w-4"})})]})})]})};var $T=["#ff3860","#24e070","#3090ff"],GT=`
199
199
  .orbcafe-ai-browser-glow {
200
200
  position: fixed;
201
201
  inset: 0;
@@ -249,4 +249,4 @@ ${o}: ${(a??r)(u.secondaryValue??0)}`:""]})}),jsxRuntime.jsx("text",{x:u.x,y:Mat
249
249
  0%, 100% { opacity: 0.68; }
250
250
  50% { opacity: 0.98; }
251
251
  }
252
- `,g8=({active:e=false,colors:t=LT,zIndex:o=2147483e3})=>{let r={"--orbcafe-ai-glow-a":t[0],"--orbcafe-ai-glow-b":t[1],"--orbcafe-ai-glow-c":t[2],"--orbcafe-ai-glow-z-index":o};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("style",{children:NT}),jsxRuntime.jsx("div",{className:"orbcafe-ai-browser-glow","data-active":e?"true":"false",style:r,"aria-hidden":"true"})]})};var y8=({defaultMode:e="login",onLogin:t,onRegister:o,onForgotPassword:r}={})=>{let[a,n]=Qt.useState(e),[i,c]=Qt.useState(false),d=Qt.useCallback(async p=>{c(true);try{await p?.();}finally{c(false);}},[]),l=Qt.useCallback(p=>d(()=>t?.(p)),[t,d]),s=Qt.useCallback(p=>d(()=>o?.(p)),[o,d]),g=Qt.useCallback(p=>d(()=>r?.(p)),[r,d]),f=Qt.useMemo(()=>({mode:a,loading:i,onModeChange:n,onLogin:l,onRegister:s,onForgotPassword:g}),[g,l,s,i,a]);return {mode:a,loading:i,setMode:n,authPageProps:f}};var eu=({label:e,...t})=>jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{...t}),label:e});var rl=Qt.forwardRef((e,t)=>jsxRuntime.jsx(material.Paper,{ref:t,...e,elevation:e.elevation||1,sx:{p:2,mb:2,...e.sx}}));rl.displayName="CPaper";var YT={productName:"ORBCAFE",headline:"Operational workbench",subheadline:"A focused entry point for reports, planning, agent workflows, and enterprise operations.",loginTitle:"Sign in",loginSubtitle:"Use your workspace account to continue.",registerTitle:"Create account",registerSubtitle:"Request a demo workspace user for evaluation.",forgotTitle:"Reset password",forgotSubtitle:"Send a password reset request to your email address."},O8=({mode:e,defaultMode:t="login",onModeChange:o,onLogin:r,onRegister:a,onForgotPassword:n,loading:i=false,logo:c,copy:d,sx:l})=>{let s=material.useTheme(),g=e!==void 0,[f,p]=Qt.useState(t),b=e??f,y=Qt.useMemo(()=>({...YT,...d}),[d]),[u,C]=Qt.useState({username:"demo@orbcafe.local",password:"orbcafe-demo",remember:true}),[m,h]=Qt.useState({name:"",email:"",password:"",confirmPassword:"",acceptedTerms:false}),[x,w]=Qt.useState({email:""}),[E,R]=Qt.useState(""),T=M=>{g||p(M),R(""),o?.(M);},I=async M=>{M.preventDefault(),await r?.(u),R("Demo login accepted. No real authentication request was sent.");},k=async M=>{M.preventDefault(),await a?.(m),R("Demo registration saved locally for this screen.");},S=async M=>{M.preventDefault(),await n?.(x),R("Demo reset link request created. No email was sent.");},D=b==="login"?y.loginTitle:b==="register"?y.registerTitle:y.forgotTitle,P=b==="login"?y.loginSubtitle:b==="register"?y.registerSubtitle:y.forgotSubtitle;return jsxRuntime.jsxs(material.Box,{sx:{minHeight:"100vh",display:"grid",gridTemplateColumns:{xs:"1fr",md:"minmax(320px, 0.9fr) minmax(420px, 1.1fr)"},background:s.palette.mode==="dark"?"linear-gradient(135deg, #071018 0%, #151515 48%, #101827 100%)":"linear-gradient(135deg, #eef3f8 0%, #ffffff 52%, #e8f2f0 100%)",...l},children:[jsxRuntime.jsxs(material.Box,{sx:{display:{xs:"none",md:"flex"},flexDirection:"column",justifyContent:"space-between",p:{md:6,lg:8},borderRight:`1px solid ${s.palette.divider}`},children:[jsxRuntime.jsxs(material.Stack,{spacing:4,children:[jsxRuntime.jsx(material.Box,{children:c}),jsxRuntime.jsxs(material.Stack,{spacing:2,children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:14,fontWeight:700,color:"primary.main",textTransform:"uppercase"},children:y.productName}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:{md:34,lg:42},lineHeight:1.06,fontWeight:800},children:y.headline}),jsxRuntime.jsx(material.Typography,{sx:{maxWidth:460,color:"text.secondary",fontSize:16,lineHeight:1.7},children:y.subheadline})]})]}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:2,sx:{color:"text.secondary",fontSize:13},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",children:"Reports"}),jsxRuntime.jsx(material.Typography,{variant:"caption",children:"Planning"}),jsxRuntime.jsx(material.Typography,{variant:"caption",children:"Agent UI"})]})]}),jsxRuntime.jsx(material.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"center",p:{xs:2,sm:4,md:6}},children:jsxRuntime.jsx(rl,{elevation:0,sx:{width:"100%",maxWidth:460,m:0,p:{xs:2.5,sm:4},borderRadius:3,border:`1px solid ${s.palette.divider}`,backgroundColor:s.palette.mode==="dark"?"rgba(15, 23, 42, 0.86)":"rgba(255, 255, 255, 0.88)",backdropFilter:"blur(18px)",boxShadow:s.palette.mode==="dark"?"0 24px 80px rgba(0,0,0,0.34)":"0 24px 80px rgba(15,23,42,0.10)"},children:jsxRuntime.jsxs(material.Stack,{spacing:3,children:[jsxRuntime.jsxs(material.Stack,{spacing:1,children:[jsxRuntime.jsx(material.Box,{sx:{display:{xs:"block",md:"none"},mb:1},children:c}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:28,fontWeight:800},children:D}),jsxRuntime.jsx(material.Typography,{sx:{color:"text.secondary"},children:P})]}),E&&jsxRuntime.jsx(material.Alert,{severity:"success",children:E}),b==="login"&&jsxRuntime.jsx(material.Box,{component:"form",onSubmit:I,children:jsxRuntime.jsxs(material.Stack,{spacing:2,children:[jsxRuntime.jsx(Io,{label:"Email or user ID",value:u.username,onChange:M=>C(B=>({...B,username:M.target.value})),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(rh__default.default,{fontSize:"small"})})}}),jsxRuntime.jsx(Io,{label:"Password",type:"password",value:u.password,onChange:M=>C(B=>({...B,password:M.target.value})),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(XT__default.default,{fontSize:"small"})})}}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:2},children:[jsxRuntime.jsx(eu,{label:"Remember me",checked:u.remember,onChange:M=>C(B=>({...B,remember:M.target.checked}))}),jsxRuntime.jsx(ur,{type:"button",variant:"text",size:"small",onClick:()=>T("forgot"),children:"Forgot?"})]}),jsxRuntime.jsx(ur,{type:"submit",size:"large",disabled:i,children:"Sign in"}),jsxRuntime.jsxs(material.Typography,{variant:"body2",sx:{color:"text.secondary",textAlign:"center"},children:["New user?"," ",jsxRuntime.jsx(ur,{type:"button",variant:"text",size:"small",onClick:()=>T("register"),sx:{minWidth:0,p:0},children:"Register"})]})]})}),b==="register"&&jsxRuntime.jsx(material.Box,{component:"form",onSubmit:k,children:jsxRuntime.jsxs(material.Stack,{spacing:2,children:[jsxRuntime.jsx(Io,{label:"Full name",value:m.name,onChange:M=>h(B=>({...B,name:M.target.value})),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(rh__default.default,{fontSize:"small"})})}}),jsxRuntime.jsx(Io,{label:"Work email",type:"email",value:m.email,onChange:M=>h(B=>({...B,email:M.target.value})),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(oh__default.default,{fontSize:"small"})})}}),jsxRuntime.jsx(Io,{label:"Password",type:"password",value:m.password,onChange:M=>h(B=>({...B,password:M.target.value})),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(ZT__default.default,{fontSize:"small"})})}}),jsxRuntime.jsx(Io,{label:"Confirm password",type:"password",value:m.confirmPassword,onChange:M=>h(B=>({...B,confirmPassword:M.target.value}))}),jsxRuntime.jsx(eu,{label:"I accept the demo workspace terms",checked:m.acceptedTerms,onChange:M=>h(B=>({...B,acceptedTerms:M.target.checked}))}),jsxRuntime.jsx(ur,{type:"submit",size:"large",disabled:i,children:"Create demo account"}),jsxRuntime.jsxs(material.Typography,{variant:"body2",sx:{color:"text.secondary",textAlign:"center"},children:["Already have an account?"," ",jsxRuntime.jsx(ur,{type:"button",variant:"text",size:"small",onClick:()=>T("login"),sx:{minWidth:0,p:0},children:"Sign in"})]})]})}),b==="forgot"&&jsxRuntime.jsx(material.Box,{component:"form",onSubmit:S,children:jsxRuntime.jsxs(material.Stack,{spacing:2,children:[jsxRuntime.jsx(Io,{label:"Work email",type:"email",value:x.email,onChange:M=>w({email:M.target.value}),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(oh__default.default,{fontSize:"small"})})}}),jsxRuntime.jsx(ur,{type:"submit",size:"large",disabled:i,children:"Send reset request"}),jsxRuntime.jsxs(material.Typography,{variant:"body2",sx:{color:"text.secondary",textAlign:"center"},children:["Remember your password?"," ",jsxRuntime.jsx(ur,{type:"button",variant:"text",size:"small",onClick:()=>T("login"),sx:{minWidth:0,p:0},children:"Back to sign in"})]})]})}),jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsx(material.Typography,{variant:"caption",sx:{color:"text.secondary"},children:"Demo credentials: demo@orbcafe.local / orbcafe-demo"})]})})})]})};var JT={keyword:{value:"",operator:"contains"},status:{value:"",operator:"equals"},owner:{value:"",operator:"contains"},workCenter:{value:"",operator:"contains"}},eI=[{id:"keyword",label:"Keyword",type:"text",placeholder:"Task/ID/Project",hasSearchIcon:true},{id:"status",label:"Status",type:"select",options:[{label:"In progress",value:"in-progress"},{label:"Blocked",value:"blocked"},{label:"Planned",value:"planned"},{label:"Not started",value:"not-started"}]},{id:"owner",label:"Owner",type:"text",placeholder:"Owner name"},{id:"workCenter",label:"Work Center",type:"text",placeholder:"CNC-02 / WH-A / ..."},{id:"dateRange",label:"Date Range",type:"date"}],ah=({tasks:e,appId:t,tableKey:o,defaultScale:r="week",defaultSelectedTaskId:a,initialFilters:n,filterFields:i,filterAppId:c,filterTableKey:d,serviceUrl:l,variantService:s,layout:g,columns:f,page:p,rowsPerPage:b,rowsPerPageOptions:y,count:u,onPageChange:C,onRowsPerPageChange:m,onFilterSearch:h,onFilterVariantLoad:x,enableRowReorder:w,onTaskReorder:E,onLayoutIdChange:R,onLayoutSave:T})=>{let I=t??c??"planning-gantt",k=o??d??"planning",[S,D]=Qt.useState(r),[P,M]=Qt.useState(a??e[0]?.id??""),[B,X]=Qt.useState(""),[L,Z]=Qt.useState(null),[$,q]=Qt.useState({...JT,...n}),H=Qt.useMemo(()=>{let oe=String($.keyword?.value??"").trim().toLowerCase(),Ie=String($.status?.value??"").trim(),Ze=String($.owner?.value??"").trim().toLowerCase(),Ge=String($.workCenter?.value??"").trim().toLowerCase(),ce=$.dateRange?.value,Ve=ce?.[0]?zr__default.default(ce[0]):null,et=ce?.[1]?zr__default.default(ce[1]):null;return e.filter(ye=>{if(oe&&![ye.id,ye.code,ye.title,ye.project,ye.workCenter,ye.owner?.name].join(" ").toLowerCase().includes(oe)||Ie&&ye.status!==Ie||Ze&&!String(ye.owner?.name??"").toLowerCase().includes(Ze)||Ge&&!String(ye.workCenter??"").toLowerCase().includes(Ge))return false;if(Ve||et){let We=zr__default.default(ye.startDate),qe=zr__default.default(ye.endDate),st=Ve?qe.isAfter(Ve)||qe.isSame(Ve,"day"):true,Pe=et?We.isBefore(et)||We.isSame(et,"day"):true;if(!st||!Pe)return false}return true})},[$,e]);Qt.useEffect(()=>{H.length!==0&&(H.some(oe=>oe.id===P)||M(H[0].id));},[H,P]);let re=Qt.useCallback(oe=>{M(oe.id);},[]),de=Qt.useCallback(oe=>{X(oe),R?.(oe);},[R]),Ce=Qt.useCallback(oe=>{Z(Ie=>({key:(Ie?.key??0)+1,variant:oe})),x?.(oe);},[x]),ve=Qt.useMemo(()=>({appId:I,tableKey:k,fields:i??eI,filters:$,onFilterChange:q,onVariantLoad:Ce,onSearch:h??(()=>{}),currentLayoutId:B,layoutRefs:[{tableKey:k,layoutId:B||null}],variantService:s,serviceUrl:l}),[B,i,$,Ce,h,I,k,l,s]),le=Qt.useMemo(()=>({appId:I,tableKey:k,serviceUrl:l,tasks:H,columns:f,scale:S,onScaleChange:D,page:p,rowsPerPage:b,rowsPerPageOptions:y,count:u,onPageChange:C,onRowsPerPageChange:m,selectedTaskId:P,onTaskSelect:re,enableRowReorder:w,onTaskReorder:E,layout:g,layoutVariant:L?.variant,layoutVariantLoadKey:L?.key,onLayoutIdChange:de,onLayoutSave:T}),[f,u,w,H,de,g,L?.key,L?.variant,C,m,T,E,re,p,I,k,b,y,S,l,P]);return {scale:S,setScale:D,selectedTaskId:P,setSelectedTaskId:M,filters:$,setFilters:q,filteredTasks:H,smartFilterProps:ve,planningGanttProps:le}};var K8=e=>{let t=ah(e),o=Qt.useMemo(()=>({filterProps:t.smartFilterProps,ganttProps:t.planningGanttProps}),[t.planningGanttProps,t.smartFilterProps]);return {...t,layoutProps:o}};var nh=e=>jsxRuntime.jsx(material.Chip,{...e,size:e.size||"small",variant:e.variant||"outlined"});var Oo=Qt.forwardRef(({tooltip:e,...t},o)=>{let r=jsxRuntime.jsx(material.IconButton,{ref:o,...t,size:t.size||"small"});return e?jsxRuntime.jsx(material.Tooltip,{title:e,children:r}):r});Oo.displayName="CIconButton";var lh=({label:e,options:t,minWidth:o=120,...r})=>jsxRuntime.jsxs(material.FormControl,{fullWidth:true,size:"small",sx:{minWidth:o},children:[e&&jsxRuntime.jsx(material.InputLabel,{children:e}),jsxRuntime.jsx(material.Select,{label:e,...r,children:t.map(a=>jsxRuntime.jsx(material.MenuItem,{value:a.value,children:a.label},a.value))})]});zr__default.default.extend(mI__default.default);var iu=[{value:"hour",label:"Hour",width:56},{value:"day",label:"Day",width:46},{value:"week",label:"Week",width:78},{value:"month",label:"Month",width:104}],lu=56,en=58,il=8,su=260,NI=320,ec="0.85rem",tn="220ms cubic-bezier(0.2, 0, 0, 1)",dh={"not-started":{label:"Not started",color:"default"},planned:{label:"Planned",color:"info"},"in-progress":{label:"In progress",color:"primary"},blocked:{label:"Blocked",color:"error"},done:{label:"Done",color:"success"}},zI=e=>e?dh[e]?.label??e:"Planned",OI=e=>e?dh[e]?.color??"default":"info",uh=e=>Math.min(100,Math.max(0,e??0)),ph=(e,t=0)=>e.flatMap(o=>[{...o,level:t},...ph(o.children??[],t+1)]),VI=e=>({id:e.id,code:e.code??e.id,title:e.title,titleSub:e.project??e.workCenter??"General",project:e.project??"",workCenter:e.workCenter??"",owner:e.owner?.name??"Unassigned",status:zI(e.status),statusTone:e.status??"planned",progress:uh(e.progress),startDate:e.startDate,endDate:e.endDate,color:e.color,reorderable:e.reorderable!==false}),mh=(e,t)=>t==="month"?e.startOf("month"):t==="week"?e.startOf("week"):t==="day"?e.startOf("day"):e.startOf("hour"),gh=(e,t)=>t==="month"?e.endOf("month"):t==="week"?e.endOf("week"):t==="day"?e.endOf("day"):e.endOf("hour"),WI=(e,t,o)=>{let r=[],a=mh(e,o),n=gh(t,o);for(;a.isBefore(n)||a.isSame(n);){let i=o==="month"?a.add(1,"month"):o==="week"?a.add(1,"week"):o==="day"?a.add(1,"day"):a.add(1,"hour");r.push({key:`${o}-${a.valueOf()}`,label:o==="month"?a.format("MMM YYYY"):o==="week"?a.format("MMM D"):o==="day"?a.format("D"):a.format("HH:mm"),contextLabel:o==="hour"?a.format("MMM D"):o==="day"?a.format("MMM"):o==="week"?`W${a.isoWeek()}`:void 0,title:o==="hour"?a.format("MMM D, YYYY HH:mm"):o==="day"?a.format("MMM D, YYYY"):o==="week"?`${a.format("MMM D, YYYY")} - Week ${a.isoWeek()}`:void 0,start:a,end:i}),a=i;}return r},cu=(e,t,o)=>{let r=0;for(let a of t){if(e.isBefore(a.start))return r;if(e.isBefore(a.end)){let n=Math.max(1,a.end.valueOf()-a.start.valueOf()),i=Math.max(0,e.valueOf()-a.start.valueOf());return r+i/n*o}r+=o;}return r},fh=({appId:e="planning-gantt",tableKey:t="planning",serviceUrl:o,title:r="Project Plan",extraTools:a,bodyHeight:n=560,tasks:i,columns:c,scale:d="week",onScaleChange:l,page:s,rowsPerPage:g=20,rowsPerPageOptions:f=[20,50,100,-1],count:p,onPageChange:b,onRowsPerPageChange:y,timelineStart:u,timelineEnd:C,selectedTaskId:m,onTaskSelect:h,enableRowReorder:x=true,onTaskReorder:w,layout:E,layoutVariant:R,layoutVariantLoadKey:T,onLayoutIdChange:I,onLayoutSave:k,emptyLabel:S="No planning tasks available.",sx:D})=>{let P=material.useTheme(),{t:M}=ne(),B=Qt.useRef(null),X=Qt.useRef(null),L=Qt.useRef(null),Z=Qt.useRef(false),[$,q]=Qt.useState(null),[H,re]=Qt.useState("content"),[de,Ce]=Qt.useState(null),[ve,le]=Qt.useState(0),[oe,Ie]=Qt.useState({}),[Ze,Ge]=Qt.useState(lu),[ce,Ve]=Qt.useState([]),et=Qt.useRef(void 0),[ye,We]=Qt.useState({activeId:null,overId:null}),[qe,st]=Qt.useState(null),[Pe,K]=Qt.useState(false),Ee=core.useSensors(core.useSensor(core.PointerSensor,{activationConstraint:{distance:4}})),ge=Qt.useRef(null),ke=Qt.useMemo(()=>ph(i),[i]),rt=Qt.useMemo(()=>{if(ce.length===0)return ke;let A=new Map(ke.map(se=>[se.id,se])),j=ce.map(se=>A.get(se)).filter(se=>!!se),ee=new Set(j.map(se=>se.id));return [...j,...ke.filter(se=>!ee.has(se.id))]},[ke,ce]),Ue=Qt.useMemo(()=>new Map(rt.map(A=>[A.id,A])),[rt]),ae=Qt.useMemo(()=>rt.map(A=>VI(A)),[rt]),fe=Qt.useMemo(()=>new Map(ae.map(A=>[A.id,A])),[ae]),je=Qt.useMemo(()=>[{id:"code",label:"ID",minWidth:90},{id:"title",label:"Task",minWidth:260,render:(A,j)=>jsxRuntime.jsxs(material.Stack,{spacing:.2,children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:15,fontWeight:700,lineHeight:1.2},children:j.title}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:13,color:"text.secondary"},children:j.titleSub})]})},{id:"owner",label:"Owner",minWidth:170},{id:"status",label:"Status",minWidth:130,render:(A,j)=>jsxRuntime.jsx(nh,{label:j.status,color:OI(j.statusTone),size:"small"})},{id:"progress",label:"Progress",minWidth:140,numeric:true,render:A=>jsxRuntime.jsxs(material.Stack,{spacing:.6,children:[jsxRuntime.jsxs(material.Typography,{variant:"caption",sx:{color:"text.secondary"},children:[A,"%"]}),jsxRuntime.jsx(material.LinearProgress,{variant:"determinate",value:A,sx:{height:6,borderRadius:999}})]})},{id:"startDate",label:"Start",minWidth:120},{id:"endDate",label:"End",minWidth:120}],[]),It=Qt.useMemo(()=>{if(!c||c.length===0)return je;let A=new Map(je.map(j=>[j.id,j]));return c.map(j=>{let ee=A.get(j.id),se=j.width??ee?.minWidth??120,Le={id:j.id,label:j.label,minWidth:se};if(ee?.numeric&&(Le.numeric=true),j.render){let _e=j.render;return Le.render=(gt,Re)=>{let ut=Ue.get(Re.id);return _e(ut||Re)},Le}return ee?.render?(Le.render=ee.render,Le):(Le.render=(_e,gt)=>{let Re=gt[j.id];if(Re!=null&&String(Re).length>0)return String(Re);let nt=Ue.get(gt.id)?.[j.id];return nt!=null&&String(nt).length>0?String(nt):"-"},Le)})},[c,je,Ue]),_=Tn({appId:e,tableKey:t,title:r,columns:It,rows:ae,rowKey:"id",page:s,rowsPerPage:g,rowsPerPageOptions:f,count:p??ae.length,onPageChange:b,onRowsPerPageChange:y,showSummary:false,layout:E,onLayoutSave:k}),ze=e?jsxRuntime.jsx(wn,{appId:e,tableKey:t,currentLayoutData:_.currentLayoutData,onLayoutLoad:_.handleLayoutLoad,targetLayoutId:_.layoutIdToLoad,activeLayoutId:_.currentLayoutId,serviceUrl:o}):null,xe=_.visibleRows,Y=_.rowsPerPage===-1?1:Math.max(1,Math.ceil(_.totalDisplayCount/_.rowsPerPage)),N=Math.max(0,Math.min(_.page,Y-1)),J=Math.min(N+1,Y),we=N>0,Me=N<Y-1&&_.rowsPerPage!==-1;Qt.useEffect(()=>{let A=ke.map(j=>j.id);Ve(j=>{let ee=new Set(A),se=j.filter(Re=>ee.has(Re)),Le=new Set(se),_e=A.filter(Re=>!Le.has(Re)),gt=[...se,..._e];return gt.length===j.length&&gt.every((Re,ut)=>Re===j[ut])?j:gt});},[ke]),Qt.useEffect(()=>{T===void 0||!R||et.current!==T&&(et.current=T,_.handleVariantLoad(R));},[_,R,T]),Qt.useEffect(()=>{I?.(_.currentLayoutId);},[_.currentLayoutId,I]);let tt=A=>A.type==="group"?`group-${A.id}`:`row-${(A.data||A)?.id}`,bt=Qt.useMemo(()=>{let A=ae.map(ut=>zr__default.default(ut.startDate)),j=ae.map(ut=>zr__default.default(ut.endDate)),ee=u?zr__default.default(u):A.reduce((ut,nt)=>nt.isBefore(ut)?nt:ut,A[0]??zr__default.default()),se=C?zr__default.default(C):j.reduce((ut,nt)=>nt.isAfter(ut)?nt:ut,j[0]??zr__default.default().add(30,"day")),Le=d==="month"?"month":d==="week"?"week":d==="day"?"day":"hour",_e=d==="month"?"month":d==="week"?"week":d==="day"?"day":"hour",gt=d==="hour"?12:1,Re=d==="hour"?12:1;return {start:mh(ee.subtract(gt,Le),d),end:gh(se.add(Re,_e),d)}},[ae,d,C,u]),dt=iu.find(A=>A.value===d)??iu[1],Vt=Array.isArray(a)?a:a?[a]:[],vt=Qt.useMemo(()=>WI(bt.start,bt.end,d),[bt.end,bt.start,d]),ko=vt.length*dt.width,Ct=vt.length>0?100/vt.length:100,sr=vt.length>0?`repeat(${vt.length}, minmax(${dt.width}px, 1fr))`:"1fr",lo=vt.length>0?`calc(100% / ${vt.length}) 100%`:"100% 100%",Et=(_.columns||[]).filter(A=>_.visibleColumns.includes(A.id)).reduce((A,j)=>A+(_.columnWidths?.[j.id]||j.minWidth||100),0)+(_.grouping.length>0?72:0),Gt=H==="manual"&&$!==null?$:Et,yt=de==="table",ao=de==="timeline",O=de==="timeline",W=de==="table",U=!O&&!W,me=()=>{let A=ve||B.current?.clientWidth||0;return A>0?Math.max(su,A-il-NI):Math.max(su,Et)},pe=A=>Math.min(Math.max(A,su),me()),Xe=(()=>{if(ve<=0)return null;let A=U?il:0;if(yt)return {tableWidth:ve,splitterWidth:A,timelineWidth:0};if(ao)return {tableWidth:0,splitterWidth:A,timelineWidth:ve};if(H==="even"){let ee=Math.max(0,(ve-A)/2);return {tableWidth:ee,splitterWidth:A,timelineWidth:Math.max(0,ve-A-ee)}}let j=pe(Gt);return {tableWidth:j,splitterWidth:A,timelineWidth:Math.max(0,ve-A-j)}})(),Ye=Xe?`${Xe.tableWidth}px ${Xe.splitterWidth}px ${Xe.timelineWidth}px`:yt?"minmax(0, 1fr) 0px 0px":ao?"0px 0px minmax(0, 1fr)":H==="even"?`minmax(0, 1fr) ${il}px minmax(0, 1fr)`:`${Gt}px ${il}px minmax(0, 1fr)`;Qt.useEffect(()=>{H==="manual"&&q(A=>A===null?null:pe(A));},[H,Et,ve]);let ot=A=>{A.preventDefault(),A.currentTarget.setPointerCapture(A.pointerId),Ce(null),re("manual"),ge.current={startX:A.clientX,startWidth:X.current?.getBoundingClientRect().width??Gt};let j=se=>{let Le=ge.current;if(!Le)return;let _e=pe(Le.startWidth+se.clientX-Le.startX);q(_e);},ee=()=>{ge.current=null,window.removeEventListener("pointermove",j),window.removeEventListener("pointerup",ee),document.body.style.cursor="",document.body.style.userSelect="";};document.body.style.cursor="col-resize",document.body.style.userSelect="none",window.addEventListener("pointermove",j),window.addEventListener("pointerup",ee);},Dt=()=>{Ce(null),re("even"),q(null);},pt=A=>!x||!A?false:fe.get(A)?.reorderable!==false,mt=(A,j)=>{if(!A||!j||A===j||!pt(A)||!pt(j))return false;if(_.grouping.length===0)return true;let ee=fe.get(A),se=fe.get(j);return !ee||!se?false:_.grouping.every(Le=>ee[Le]===se[Le])},St=(A,j)=>{if(!mt(A,j))return;let ee=xe.filter(ht=>ht.type!=="group").map(ht=>String((ht.data||ht)?.id)),se=ee.indexOf(A),Le=ee.indexOf(j);if(se<0||Le<0)return;let _e=[...ee];[_e[se],_e[Le]]=[_e[Le],_e[se]];let gt=new Set(ee),Re=rt.map(ht=>ht.id),ut=[..._e,...Re.filter(ht=>!gt.has(ht))],nt=Ue.get(A),Pt=Ue.get(j);if(_.setOrder("asc"),_.setOrderBy(""),Ve(ut),nt&&Pt){let{level:ht,...eo}=nt,{level:so,...To}=Pt,Xt=ut.reduce((xo,Rt)=>{let Ut=Ue.get(Rt);if(Ut){let{level:cr,...dr}=Ut;xo.push(dr);}return xo},[]);w?.(Xt,{activeTask:eo,targetTask:To});}},Wt=(A,j)=>{if(!pt(j.id)){A.preventDefault();return}A.stopPropagation(),A.dataTransfer.effectAllowed="move",A.dataTransfer.setData("text/plain",j.id),We({activeId:j.id,overId:null}),h?.(Ue.get(j.id)||j);},ct=(A,j)=>{if(!mt(ye.activeId,j)){We(ee=>ee.overId===null?ee:{...ee,overId:null});return}A.preventDefault(),A.stopPropagation(),A.dataTransfer.dropEffect="move",We(ee=>ee.overId===j?ee:{...ee,overId:j});},Ao=(A,j)=>{let ee=ye.activeId||A.dataTransfer.getData("text/plain");if(!mt(ee,j)){We({activeId:null,overId:null});return}A.preventDefault(),A.stopPropagation(),St(ee,j),We({activeId:null,overId:null});},wo=()=>{We({activeId:null,overId:null});},Yo=A=>{if(Z.current)return;let j=A==="table"?X.current:L.current,ee=A==="table"?L.current:X.current;!j||!ee||(Z.current=true,ee.scrollTop=j.scrollTop,window.requestAnimationFrame(()=>{Z.current=false;}));};return Qt.useLayoutEffect(()=>{let A=B.current;if(!A){le(0);return}let j=0,ee=()=>{window.cancelAnimationFrame(j),j=window.requestAnimationFrame(()=>{let Le=A.clientWidth;le(_e=>Math.abs(_e-Le)<.5?_e:Le);});};if(ee(),typeof ResizeObserver>"u")return window.addEventListener("resize",ee),()=>{window.cancelAnimationFrame(j),window.removeEventListener("resize",ee);};let se=new ResizeObserver(ee);return se.observe(A),window.addEventListener("resize",ee),()=>{window.cancelAnimationFrame(j),se.disconnect(),window.removeEventListener("resize",ee);}},[ae.length]),Qt.useLayoutEffect(()=>{if(!m||W)return;let A=L.current,j=X.current;if(!A)return;let ee=`row-${m}`,se=Array.from(A.querySelectorAll("[data-planning-timeline-row-key]")).find(gt=>gt.dataset.planningTimelineRowKey===ee),Le=fe.get(m);if(!se||!Le)return;let _e=window.requestAnimationFrame(()=>{let gt=A.getBoundingClientRect(),Re=se.getBoundingClientRect(),ut=Math.max(1,A.clientHeight-Ze),nt=A.scrollTop+Re.top-gt.top-Ze-(ut-Re.height)/2;Z.current=true,A.scrollTop=Math.max(0,nt),j&&!O&&(j.scrollTop=A.scrollTop);let Pt=Math.max(1,A.scrollWidth),ht=vt.length>0?Pt/vt.length:dt.width,eo=cu(zr__default.default(Le.startDate),vt,ht),so=Math.max(0,eo-ht);A.scrollLeft=Math.min(so,Math.max(0,Pt-A.clientWidth)),window.requestAnimationFrame(()=>{Z.current=false;});});return ()=>window.cancelAnimationFrame(_e)},[dt.width,Ze,m,O,fe,W,xe,vt]),Qt.useLayoutEffect(()=>{let A=X.current;if(!A)return;let j=0,ee=0,se=false,Le=()=>{if(se)return;let so=A.querySelector("thead"),To=Array.from(A.querySelectorAll("tbody tr[data-planning-row-key]"));if(To.length===0)return;let Xt=so?.getBoundingClientRect().height||lu,xo={};To.forEach(Rt=>{let Ut=Rt.dataset.planningRowKey;Ut&&(xo[Ut]=Rt.getBoundingClientRect().height);}),Ge(Rt=>Math.abs(Rt-Xt)<.01?Rt:Xt),Ie(Rt=>{let Ut=Object.keys(Rt),cr=Object.keys(xo);return Ut.length===cr.length&&cr.every(dr=>Math.abs((Rt[dr]??0)-xo[dr])<.01)?Rt:xo});},_e=()=>{window.cancelAnimationFrame(j),j=window.requestAnimationFrame(Le);};if(Le(),window.cancelAnimationFrame(ee),ee=window.requestAnimationFrame(()=>{ee=window.requestAnimationFrame(Le);}),typeof document<"u"&&document.fonts?.ready&&document.fonts.ready.then(()=>{se||_e();}).catch(()=>{}),typeof ResizeObserver>"u")return window.addEventListener("resize",_e),()=>{se=true,window.cancelAnimationFrame(j),window.cancelAnimationFrame(ee),window.removeEventListener("resize",_e);};let gt=new ResizeObserver(_e),Re=A.querySelector("table"),ut=A.querySelector("tbody"),nt=A.querySelector("thead");Re&&gt.observe(Re),nt&&gt.observe(nt);let Pt=new WeakSet,ht=()=>{A.querySelectorAll("tbody tr[data-planning-row-key]").forEach(so=>{Pt.has(so)||(gt.observe(so),Pt.add(so));});};ht();let eo=null;return ut&&typeof MutationObserver<"u"&&(eo=new MutationObserver(()=>{ht(),_e();}),eo.observe(ut,{childList:true,subtree:true,characterData:true})),window.addEventListener("resize",_e),()=>{se=true,window.cancelAnimationFrame(j),window.cancelAnimationFrame(ee),gt.disconnect(),eo?.disconnect(),window.removeEventListener("resize",_e);}},[xe,_.visibleColumns,_.grouping,_.columnWidths]),jsxRuntime.jsxs(rl,{elevation:0,sx:{m:0,p:0,display:"flex",flexDirection:"column",minHeight:0,overflow:"hidden",borderRadius:3,border:`1px solid ${P.palette.divider}`,backgroundColor:P.palette.background.paper,...D},children:[jsxRuntime.jsxs(material.Stack,{direction:{xs:"column",md:"row"},justifyContent:"space-between",alignItems:{xs:"stretch",md:"center"},spacing:2,sx:{px:2,py:1.75,borderBottom:`1px solid ${P.palette.divider}`},children:[jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:.75,alignItems:"center",sx:{p:.5,borderRadius:2,backgroundColor:"action.hover",minHeight:38},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:ec,color:"text.secondary",whiteSpace:"nowrap"},children:M("table.toolbar.itemsPerPage")}),jsxRuntime.jsx(material.Select,{size:"small",variant:"standard",value:_.rowsPerPage,disableUnderline:true,onChange:A=>_.setRowsPerPage(Number(A.target.value)),sx:{fontSize:ec,fontWeight:600,color:"text.primary",minWidth:64,height:30,display:"flex",alignItems:"center","& .MuiSelect-select":{py:0,pl:.75,pr:"22px !important",minHeight:`${30}px !important`,height:30,display:"flex",alignItems:"center",boxSizing:"border-box"},"& .MuiSelect-icon":{right:0,fontSize:20,color:"text.primary"}},children:f.map(A=>jsxRuntime.jsx(material.MenuItem,{value:A,sx:{fontSize:ec},children:A===-1?M("common.all"):A},`planning-rows-per-page-${A}`))}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>_.setPage(Math.max(N-1,0)),disabled:!we,sx:{...Ir,color:"text.primary"},children:jsxRuntime.jsx(Kb__default.default,{})}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:ec,fontWeight:600,minWidth:88,textAlign:"center",color:"text.primary"},children:M("table.toolbar.pageOf",{current:J,total:Y})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>_.setPage(Math.min(N+1,Y-1)),disabled:!Me,sx:{...Ir,color:"text.primary"},children:jsxRuntime.jsx(ch__default.default,{})})]}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,alignItems:"center",sx:{flexWrap:"wrap"},children:[Vt.length>0&&jsxRuntime.jsx(material.Stack,{direction:"row",spacing:.75,alignItems:"center",children:Vt.map((A,j)=>jsxRuntime.jsx(material.Box,{sx:{display:"flex",alignItems:"center"},children:A},`planning-extra-tool-${j}`))}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:.25,sx:{p:.5,borderRadius:2,backgroundColor:"action.hover"},children:[jsxRuntime.jsx(Oo,{tooltip:"Column visibility",onClick:A=>_.setAnchorEl(A.currentTarget),color:"default",children:jsxRuntime.jsx(zb__default.default,{fontSize:"small"})}),jsxRuntime.jsx(Oo,{tooltip:"Group by",onClick:A=>_.setGroupAnchorEl(A.currentTarget),color:"default",children:jsxRuntime.jsx(Wb__default.default,{fontSize:"small"})}),jsxRuntime.jsx(Oo,{tooltip:"Sort by...",onClick:()=>K(true),color:_.sortBy.length>0||_.orderBy?"primary":"default",children:jsxRuntime.jsx(FI__default.default,{fontSize:"small"})})]}),ze&&jsxRuntime.jsx(material.Stack,{direction:"row",spacing:.25,sx:{p:.5,borderRadius:2,backgroundColor:"action.hover"},children:ze}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:.25,sx:{p:.5,borderRadius:2,backgroundColor:"action.hover"},children:[jsxRuntime.jsx(Oo,{tooltip:"Expand task table",onClick:()=>Ce("table"),color:de==="table"?"primary":"default",children:jsxRuntime.jsx(BI__default.default,{fontSize:"small"})}),jsxRuntime.jsx(Oo,{tooltip:"Split evenly",onClick:Dt,color:de===null&&H==="even"?"primary":"default",children:jsxRuntime.jsx(EI__default.default,{fontSize:"small"})}),jsxRuntime.jsx(Oo,{tooltip:"Expand timeline",onClick:()=>Ce("timeline"),color:de==="timeline"?"primary":"default",children:jsxRuntime.jsx(AI__default.default,{fontSize:"small"})})]}),jsxRuntime.jsx(material.Box,{sx:{minWidth:120},children:jsxRuntime.jsx(lh,{label:"",value:d,options:iu.map(A=>({value:A.value,label:A.label})),onChange:A=>l?.(A.target.value),sx:{"& .MuiSelect-select":{fontSize:"0.92rem",py:.65},"& .MuiSvgIcon-root":{fontSize:20}}})})]})]}),ae.length===0?jsxRuntime.jsx(material.Box,{sx:{minHeight:240,display:"grid",placeItems:"center",color:"text.secondary"},children:S}):jsxRuntime.jsx(material.Box,{sx:{overflow:"hidden",flex:1,minHeight:0},children:jsxRuntime.jsxs(material.Box,{ref:B,sx:{height:"100%",display:"grid",gridTemplateColumns:Ye,minWidth:0,transition:`grid-template-columns ${tn}`},children:[jsxRuntime.jsx(material.TableContainer,{"data-planning-scroll-pane":"table",ref:X,onScroll:()=>Yo("table"),sx:{width:"100%",minWidth:0,maxWidth:"100%",height:n,overflowX:"auto",overflowY:"auto",opacity:O?0:1,transform:O?"translateX(-10px)":"translateX(0)",pointerEvents:O?"none":"auto",transition:`opacity ${tn}, transform ${tn}`},children:jsxRuntime.jsx(core.DndContext,{sensors:Ee,collisionDetection:core.closestCenter,modifiers:[modifiers.restrictToHorizontalAxis],onDragEnd:A=>{let j=A?.active?.id,ee=A?.over?.id;typeof j=="string"&&typeof ee=="string"&&_.handleColumnReorder(j,ee);},children:jsxRuntime.jsxs(material.Table,{size:"small",stickyHeader:true,sx:{tableLayout:"fixed",width:Et,"& thead .MuiTableCell-root":{height:lu,py:0,lineHeight:1.15,boxSizing:"border-box"}},children:[jsxRuntime.jsx(gl,{columns:_.columns,visibleColumns:_.visibleColumns,order:_.order,orderBy:_.orderBy,sortBy:_.sortBy,onRequestSort:_.handleRequestSort,onContextMenu:(A,j)=>{A.preventDefault(),A.stopPropagation(),st({mouseX:A.clientX+2,mouseY:A.clientY-6,columnId:j});},grouping:_.grouping,isAllExpanded:_.isAllExpanded,handleToggleAll:_.handleToggleAll,columnWidths:_.columnWidths,onColumnResize:_.handleColumnResize,enableColumnReorder:true}),jsxRuntime.jsx(material.TableBody,{children:xe.map(A=>{let j=tt(A);if(A.type==="group")return jsxRuntime.jsxs(material.TableRow,{"data-planning-row-key":j,sx:{height:en,backgroundColor:P.palette.action.hover},children:[_.grouping.length>0&&jsxRuntime.jsx(material.TableCell,{sx:{...Tr,height:en,borderBottom:`1px solid ${P.palette.divider}`},children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>_.toggleGroupExpand(A.id),sx:Ir,children:A.isExpanded?jsxRuntime.jsx(gy__default.default,{}):jsxRuntime.jsx(ch__default.default,{})})}),jsxRuntime.jsx(material.TableCell,{colSpan:_.visibleColumns.length,sx:{height:en,py:0,borderBottom:`1px solid ${P.palette.divider}`},children:jsxRuntime.jsxs(material.Typography,{sx:{fontSize:13,fontWeight:700},children:[A.field,": ",A.value," (",A.count,")"]})})]},A.id);let ee=A.data||A,se=ee.id===m,Le=pt(ee.id),_e=ye.activeId===ee.id,gt=ye.overId===ee.id&&mt(ye.activeId,ee.id);return jsxRuntime.jsxs(material.TableRow,{"data-planning-row-key":j,draggable:Le,hover:true,selected:se,onDragStart:Re=>Wt(Re,ee),onDragOver:Re=>ct(Re,ee.id),onDragEnter:Re=>ct(Re,ee.id),onDrop:Re=>Ao(Re,ee.id),onDragEnd:wo,onClick:()=>h?.(Ue.get(ee.id)||ee),sx:{cursor:_e?"grabbing":Le?"grab":h?"pointer":"default",height:en,opacity:_e?.56:1,"& .MuiTableCell-root":gt?{borderTop:`2px solid ${P.palette.primary.main}`}:void 0,transition:"background-color 120ms ease, opacity 120ms ease"},children:[_.grouping.length>0&&jsxRuntime.jsx(material.TableCell,{sx:{...Tr,height:en,borderBottom:`1px solid ${P.palette.divider}`}}),(_.columns||[]).filter(Re=>_.visibleColumns.includes(Re.id)).map(Re=>jsxRuntime.jsx(material.TableCell,{sx:{width:_.columnWidths?.[Re.id]||Re.minWidth||100,height:en,py:0,overflow:"hidden",borderBottom:`1px solid ${P.palette.divider}`},children:Re.render?Re.render(ee[Re.id],ee):String(ee[Re.id]??"-")},`${ee.id}-${Re.id}`))]},ee.id)})})]})})}),jsxRuntime.jsx(material.Box,{onPointerDown:U?ot:void 0,role:"separator","aria-orientation":"vertical",sx:{width:U?il:0,cursor:U?"col-resize":"default",opacity:U?1:0,pointerEvents:U?"auto":"none",borderLeft:U?`1px solid ${P.palette.divider}`:"0 solid transparent",borderRight:U?`1px solid ${P.palette.divider}`:"0 solid transparent",backgroundColor:P.palette.mode==="dark"?"rgba(148,163,184,0.10)":"rgba(15,23,42,0.04)",transition:`width ${tn}, opacity ${tn}, background-color 120ms ease`,position:"relative","&:hover":{backgroundColor:P.palette.action.selected},"&::before":{content:'""',position:"absolute",top:0,bottom:0,left:-6,right:-6,cursor:U?"col-resize":"default"}}}),jsxRuntime.jsx(material.Box,{sx:{minWidth:0,overflow:"hidden",opacity:W?0:1,transform:W?"translateX(10px)":"translateX(0)",pointerEvents:W?"none":"auto",transition:`opacity ${tn}, transform ${tn}`},children:jsxRuntime.jsx(material.Box,{"data-planning-scroll-pane":"timeline",ref:L,onScroll:()=>Yo("timeline"),sx:{width:"100%",height:n,overflowX:"auto",overflowY:"auto"},children:jsxRuntime.jsxs(material.Box,{sx:{width:"100%",minWidth:ko||"100%"},children:[jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:sr,height:Ze,boxSizing:"border-box",borderBottom:`1px solid ${P.palette.divider}`,position:"sticky",top:0,zIndex:2,backgroundColor:P.palette.background.paper},children:vt.map(A=>jsxRuntime.jsxs(material.Box,{title:A.title,sx:{px:.75,display:"flex",flexDirection:A.contextLabel?"column":"row",alignItems:"center",justifyContent:"center",gap:A.contextLabel?.15:0,borderRight:`1px solid ${P.palette.divider}`,color:A.contextLabel?"text.primary":"text.secondary",overflow:"hidden"},children:[A.contextLabel&&jsxRuntime.jsx(material.Typography,{component:"span",sx:{maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"text.secondary",fontSize:11,fontWeight:700,lineHeight:1.1},children:A.contextLabel}),jsxRuntime.jsx(material.Typography,{component:"span",sx:{maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:12,fontWeight:700,lineHeight:1.15},children:A.label})]},A.key))}),jsxRuntime.jsx(material.Stack,{sx:{position:"relative"},children:xe.map(A=>{let j=tt(A),ee=oe[j]??en;if(A.type==="group")return jsxRuntime.jsx(material.Box,{"data-planning-timeline-row-key":j,sx:{position:"relative",height:ee,boxSizing:"border-box",borderBottom:`1px solid ${P.palette.divider}`,backgroundColor:P.palette.action.hover}},A.id);let se=A.data||A,Le=zr__default.default(se.startDate),_e=zr__default.default(se.endDate),gt=cu(Le,vt,Ct),Re=cu(_e,vt,Ct),ut=Math.max(0,Re-gt),nt=uh(se.progress),Pt=se.id===m,ht=pt(se.id),eo=ye.activeId===se.id,so=ye.overId===se.id&&mt(ye.activeId,se.id),To=se.color??(se.statusTone==="blocked"?P.palette.error.main:P.palette.primary.main);return jsxRuntime.jsx(material.Box,{"data-planning-timeline-row-key":j,draggable:ht,onDragStart:Xt=>Wt(Xt,se),onDragOver:Xt=>ct(Xt,se.id),onDragEnter:Xt=>ct(Xt,se.id),onDrop:Xt=>Ao(Xt,se.id),onDragEnd:wo,onClick:()=>h?.(Ue.get(se.id)||se),sx:{position:"relative",height:ee,boxSizing:"border-box",borderBottom:`1px solid ${P.palette.divider}`,opacity:eo?.56:1,"&::before":{content:'""',position:"absolute",top:0,left:0,right:0,height:2,backgroundColor:P.palette.primary.main,opacity:so?1:0,transition:"opacity 120ms ease",pointerEvents:"none",zIndex:3},backgroundImage:P.palette.mode==="dark"?"linear-gradient(90deg, rgba(148,163,184,0.08) 1px, transparent 1px)":"linear-gradient(90deg, rgba(15,23,42,0.06) 1px, transparent 1px)",backgroundSize:lo,cursor:eo?"grabbing":ht?"grab":h?"pointer":"default",transition:"opacity 120ms ease"},children:jsxRuntime.jsx(material.Tooltip,{title:`${se.title}: ${Le.format("MMM D HH:mm")} - ${_e.format("MMM D HH:mm")}`,children:jsxRuntime.jsxs(material.Box,{sx:{position:"absolute",left:`${gt}%`,top:Math.max(8,(ee-24)/2),width:`max(18px, ${ut}%)`,height:24,borderRadius:999,overflow:"hidden",backgroundColor:P.palette.mode==="dark"?"rgba(148,163,184,0.18)":"rgba(15,23,42,0.10)",outline:Pt?`2px solid ${P.palette.warning.main}`:"none",outlineOffset:2},children:[jsxRuntime.jsx(material.Box,{sx:{height:"100%",width:`${nt}%`,backgroundColor:To}}),jsxRuntime.jsx(material.Typography,{sx:{position:"absolute",inset:0,px:1,display:"flex",alignItems:"center",color:"#fff",fontSize:11,fontWeight:800,textShadow:"0 1px 4px rgba(0,0,0,0.45)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:se.code})]})})},se.id)})})]})})})]})}),jsxRuntime.jsx(sn,{groupAnchorEl:_.groupAnchorEl,setGroupAnchorEl:_.setGroupAnchorEl,grouping:_.grouping,setGrouping:_.setGrouping,columns:_.columns,toggleGroupField:_.toggleGroupField}),jsxRuntime.jsx(cn,{anchorEl:_.anchorEl,setAnchorEl:_.setAnchorEl,columns:_.columns,visibleColumns:_.visibleColumns,toggleColumnVisibility:_.toggleColumnVisibility}),jsxRuntime.jsx(ep,{contextMenu:qe,handleClose:()=>st(null),columns:_.columns,visibleColumns:_.visibleColumns,grouping:_.grouping,summaryColumns:_.summaryColumns,showSummary:_.showSummary,sortBy:_.sortBy,orderBy:_.orderBy,order:_.order,onSortAsc:A=>{_.applyMultiSort([{field:A,direction:"asc"}]);},onSortDesc:A=>{_.applyMultiSort([{field:A,direction:"desc"}]);},onClearSort:A=>{let j=_.sortBy.filter(ee=>ee.field!==A);j.length>0?_.applyMultiSort(j):(_.clearMultiSort(),_.orderBy===A&&_.setOrderBy(""));},onHideColumn:A=>{_.visibleColumns.includes(A)&&_.toggleColumnVisibility(A);},onToggleGroup:A=>_.toggleGroupField(A),onToggleSummary:A=>_.toggleSummaryColumn(A),onOpenSortDialog:()=>K(true)}),jsxRuntime.jsx(tp,{open:Pe,onClose:()=>K(false),columns:_.columns,initialRules:_.sortBy.length>0?_.sortBy:_.orderBy?[{field:_.orderBy,direction:_.order}]:[],onApply:A=>_.applyMultiSort(A),onClear:()=>{_.clearMultiSort(),_.setOrderBy("");}})]})};var L4=({filterProps:e,ganttProps:t,spacing:o=2,sx:r,children:a})=>{let n=r?[{height:"100%",overflow:"hidden"},r]:{height:"100%",overflow:"hidden"},i=t.sx?[{height:"100%"},t.sx]:{height:"100%"};return jsxRuntime.jsxs(material.Stack,{spacing:o,sx:n,children:[jsxRuntime.jsx(material.Box,{sx:{flexShrink:0},children:jsxRuntime.jsx($r,{...e})}),jsxRuntime.jsx(material.Box,{sx:{flex:1,minHeight:0,overflow:"hidden"},children:jsxRuntime.jsx(fh,{...t,bodyHeight:t.bodyHeight??"100%",sx:i})}),a]})};var bh=640,YI=360,QI=360,ac=8,ai="220ms cubic-bezier(0.2, 0, 0, 1)",pu=(e,t,o=0,r=[])=>e.flatMap(a=>{let n=a.children??[],i=[{node:a,level:o,hasChildren:n.length>0,parentIds:r}];return t.has(a.id)?[...i,...pu(n,t,o+1,[...r,a.id])]:i}),xh=e=>e.flatMap(t=>[t,...xh(t.children??[])]),vh=(e,t=0,o=[])=>e.flatMap(r=>{let a=r.children??[];return [{node:r,level:t,hasChildren:a.length>0,parentIds:o},...vh(a,t+1,[...o,r.id])]}),Ch=e=>e.flatMap(t=>{let o=t.children??[];return o.length===0?[]:[t.id,...Ch(o)]}),yh=e=>Object.entries(e).filter(([t])=>t!=="children").map(([,t])=>t==null?"":typeof t=="string"||typeof t=="number"||typeof t=="boolean"?String(t):"").join(" ").toLowerCase(),j4=({title:e,subtitle:t,nodes:o,columns:r,detail:a,selectedNodeId:n,defaultSelectedNodeId:i,onNodeSelect:c,expandedNodeIds:d,defaultExpandedNodeIds:l,onExpandedNodeIdsChange:s,defaultPaneMode:g="split",minTreePaneWidth:f=YI,minDetailPaneWidth:p=QI,tableAppId:b="ctree-comp",tableKey:y="default",tableTitle:u,filterConfig:C,searchQuery:m,searchToken:h,defaultRowsPerPage:x=-1,rowsPerPageOptions:w=[20,50,100,-1],serviceUrl:E,emptyLabel:R="No tree items available.",headerAction:T,sx:I,className:k})=>{let S=material.useTheme(),D=Qt.useRef(null),P=Qt.useRef(null),M=Qt.useRef(null),[B,X]=Qt.useState(i??o[0]?.id??null),[L,Z]=Qt.useState(l??Ch(o).slice(0,3)),[$,q]=Qt.useState(g),[H,re]=Qt.useState(bh),[de,Ce]=Qt.useState(0),[ve,le]=Qt.useState(0),[oe,Ie]=Qt.useState(x),Ze=Qt.useMemo(()=>r&&r.length>0?r:[{id:"label",label:"Name",render:Y=>jsxRuntime.jsxs(material.Stack,{spacing:.3,children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:15,fontWeight:700,lineHeight:1.15},children:Y.label}),Y.subtitle&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:13,color:"text.secondary",lineHeight:1.2},children:Y.subtitle})]})}],[r]),Ge=Qt.useMemo(()=>new Set(d??L),[d,L]),ce=Qt.useMemo(()=>pu(o,Ge),[o,Ge]),Ve=Qt.useMemo(()=>xh(o),[o]),et=Qt.useMemo(()=>vh(o),[o]),ye=n===void 0?B:n,We=Qt.useMemo(()=>Ve.find(Y=>Y.id===ye)??null,[ye,Ve]),qe=Y=>{let N=P.current?.clientWidth??0,J=N>0?Math.max(f,N-ac-p):Math.max(f,Y);return Math.min(Math.max(Y,f),J)},st=$==="detail",Pe=$==="tree"||!a,K=$==="split"&&!!a,ge=(()=>{if(de<=0)return null;if($==="tree"||!a)return {treeWidth:de,splitterWidth:0,detailWidth:0};if($==="detail")return {treeWidth:0,splitterWidth:0,detailWidth:de};let Y=K?ac:0,N=qe(H);return {treeWidth:N,splitterWidth:Y,detailWidth:Math.max(0,de-Y-N)}})(),ke=ge?`${ge.treeWidth}px ${ge.splitterWidth}px ${ge.detailWidth}px`:$==="tree"||!a?"minmax(0, 1fr) 0px 0px":$==="detail"?"0px 0px minmax(0, 1fr)":`minmax(${f}px, ${H}px) ${ac}px minmax(${p}px, 1fr)`;Qt.useEffect(()=>{let Y=P.current;if(!Y){Ce(0);return}let N=0,J=()=>{window.cancelAnimationFrame(N),N=window.requestAnimationFrame(()=>{let Me=Y.clientWidth;Ce(tt=>Math.abs(tt-Me)<.5?tt:Me);});};if(J(),typeof ResizeObserver>"u")return window.addEventListener("resize",J),()=>{window.cancelAnimationFrame(N),window.removeEventListener("resize",J);};let we=new ResizeObserver(J);return we.observe(Y),window.addEventListener("resize",J),()=>{window.cancelAnimationFrame(N),we.disconnect(),window.removeEventListener("resize",J);}},[]);let rt=Y=>{d===void 0&&Z(Y),s?.(Y);},Ue=Y=>{let N=new Set(Ge);N.has(Y)?N.delete(Y):N.add(Y),rt(Array.from(N));},ae=Y=>{n===void 0&&X(Y.id),c?.(Y);};Qt.useEffect(()=>{le(0);},[o]),Qt.useEffect(()=>{let Y=m?.trim().toLowerCase();if(!Y)return;let N=et.find(({node:dt})=>yh(dt).includes(Y));if(!N)return;let J=new Set(Ge);N.parentIds.forEach(dt=>J.add(dt)),rt(Array.from(J)),ae(N.node);let Me=pu(o,J).findIndex(({node:dt})=>dt.id===N.node.id);Me>=0&&oe>0&&le(Math.floor(Me/oe));let tt=0,bt=0;return tt=window.requestAnimationFrame(()=>{bt=window.requestAnimationFrame(()=>{let dt=D.current?.querySelector(".MuiTableRow-root.Mui-selected"),Vt=dt?.closest(".MuiTableContainer-root");if(dt&&Vt){let vt=Vt.getBoundingClientRect(),ko=dt.getBoundingClientRect(),Ct=ko.top-vt.top+Vt.scrollTop;Vt.scrollTo({top:Ct-Vt.clientHeight/2+ko.height/2,behavior:"smooth"});return}dt?.scrollIntoView({block:"center",behavior:"smooth"});});}),()=>{window.cancelAnimationFrame(tt),window.cancelAnimationFrame(bt);}},[m,h,et,o,oe]);let fe=Qt.useMemo(()=>ce.map(({node:Y,level:N,hasChildren:J})=>({...Y,id:Y.id,__node:Y,__level:N,__hasChildren:J,__expanded:Ge.has(Y.id),__searchText:yh(Y)})),[Ge,ce]),je=Qt.useMemo(()=>Ze.map((Y,N)=>({id:Y.id,label:Y.label,minWidth:typeof Y.width=="number"?Y.width:Y.minWidth??(N===0?320:120),numeric:Y.numeric??Y.align==="right",render:(J,we)=>{let Me=we.__node,tt=Y.render?Y.render(Me):Me[Y.id];if(N!==0)return jsxRuntime.jsx(material.Box,{sx:{minWidth:0,color:Y.align==="right"?"text.primary":"text.secondary",fontWeight:Y.align==="right"?750:500,textAlign:Y.align??"left"},children:tt});let bt=Number(we.__level??0),dt=!!we.__hasChildren,Vt=!!we.__expanded;return jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:1,sx:{minWidth:0,pl:`${bt*24}px`},children:[jsxRuntime.jsx(Oo,{tooltip:dt?Vt?"Collapse":"Expand":"",onClick:vt=>{vt.stopPropagation(),dt&&Ue(Me.id);},disabled:!dt,sx:{width:24,height:24,visibility:dt?"visible":"hidden",transform:Vt?"rotate(0deg)":"rotate(-90deg)",transition:"transform 160ms ease"},children:jsxRuntime.jsx(gy__default.default,{sx:{fontSize:20}})}),jsxRuntime.jsx(material.Box,{sx:{width:10,height:10,borderRadius:"50%",flexShrink:0,backgroundColor:Me.markerColor??S.palette.primary.main}}),jsxRuntime.jsx(material.Box,{sx:{minWidth:0},children:tt})]})}})),[Ze,Ge,S.palette.primary.main]),It=Y=>{if(!K)return;Y.preventDefault(),Y.currentTarget.setPointerCapture(Y.pointerId),M.current={startX:Y.clientX,startWidth:H};let N=we=>{let Me=M.current;Me&&re(qe(Me.startWidth+we.clientX-Me.startX));},J=()=>{M.current=null,window.removeEventListener("pointermove",N),window.removeEventListener("pointerup",J),document.body.style.cursor="",document.body.style.userSelect="";};document.body.style.cursor="col-resize",document.body.style.userSelect="none",window.addEventListener("pointermove",N),window.addEventListener("pointerup",J);},_=()=>{let Y=P.current?.clientWidth??0,N=Y>0?Math.max(f,(Y-ac)/2):bh;q("split"),re(qe(N));},ze=()=>a?typeof a=="function"?a(We):a:null,xe=a?jsxRuntime.jsxs(material.Box,{sx:{position:"absolute",top:13,right:56,zIndex:3,display:"flex",gap:.25,p:.5,borderRadius:2,backgroundColor:material.alpha(S.palette.background.paper,.9),border:`1px solid ${S.palette.divider}`,boxShadow:`0 8px 22px ${material.alpha(S.palette.common.black,S.palette.mode==="dark"?.28:.1)}`,backdropFilter:"blur(10px)"},children:[jsxRuntime.jsx(Oo,{tooltip:"Expand tree",onClick:()=>q("tree"),color:$==="tree"?"primary":"default",children:jsxRuntime.jsx(BI__default.default,{fontSize:"small"})}),jsxRuntime.jsx(Oo,{tooltip:"Split evenly",onClick:_,color:$==="split"?"primary":"default",children:jsxRuntime.jsx(EI__default.default,{fontSize:"small"})}),jsxRuntime.jsx(Oo,{tooltip:"Expand detail",onClick:()=>q("detail"),color:$==="detail"?"primary":"default",children:jsxRuntime.jsx(AI__default.default,{fontSize:"small"})})]}):null;return jsxRuntime.jsxs(material.Box,{ref:D,className:["ctree_comp",k].filter(Boolean).join(" "),sx:{position:"relative",height:"100%",minHeight:0,border:`1px solid ${S.palette.divider}`,borderRadius:2,overflow:"hidden",backgroundColor:"background.paper",boxShadow:`0 18px 42px ${material.alpha(S.palette.common.black,S.palette.mode==="dark"?.24:.08)}`,...I},children:[xe,jsxRuntime.jsxs(material.Box,{ref:P,sx:{height:"100%",display:"grid",gridTemplateColumns:ke,transition:`grid-template-columns ${ai}`,minWidth:0},children:[jsxRuntime.jsxs(material.Box,{"aria-hidden":st?true:void 0,sx:{minWidth:0,overflow:"hidden",display:"flex",flexDirection:"column",opacity:st?0:1,transform:st?"translateX(-12px)":"translateX(0)",pointerEvents:st?"none":"auto",transition:`opacity ${ai}, transform ${ai}`,willChange:"opacity, transform"},children:[jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:2,sx:{px:2,py:1.5,minHeight:74,borderBottom:`1px solid ${S.palette.divider}`},children:[jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:1.4,sx:{minWidth:0},children:[jsxRuntime.jsx(Wb__default.default,{sx:{color:"primary.main",fontSize:28}}),jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:20,fontWeight:750,lineHeight:1.12},noWrap:true,children:e}),t&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:14,color:"text.secondary",mt:.3},noWrap:true,children:t})]})]}),T!==void 0?T:jsxRuntime.jsx(Oo,{tooltip:"Add node",color:"default",children:jsxRuntime.jsx(Ju__default.default,{fontSize:"small"})})]}),jsxRuntime.jsxs(material.Box,{sx:{flex:1,minHeight:0,overflow:"hidden"},children:[jsxRuntime.jsx(Dr,{appId:b,tableKey:y,title:u??(typeof e=="string"?e:"Tree"),columns:je,rows:fe,rowKey:"id",fitContainer:true,fullWidth:true,showSummary:false,selectionMode:"single",selected:ye?[ye]:[],onSelectionChange:Y=>{let N=Y[Y.length-1],J=Ve.find(we=>we.id===N);J&&ae(J);},page:ve,rowsPerPage:oe,rowsPerPageOptions:w,count:fe.length,onPageChange:le,onRowsPerPageChange:Y=>{le(0),Ie(Y);},filterConfig:C,serviceUrl:E,graphReport:{enabled:false},disableGrouping:true,disableSorting:true,maxHeight:"100%"}),fe.length===0&&jsxRuntime.jsx(material.Box,{sx:{minHeight:220,display:"grid",placeItems:"center",color:"text.secondary"},children:R})]})]}),jsxRuntime.jsx(material.Box,{"data-ctree-splitter":"true",role:"separator","aria-orientation":"vertical",onPointerDown:K?It:void 0,sx:{width:"100%",cursor:K?"col-resize":"default",backgroundColor:K?material.alpha(S.palette.text.primary,S.palette.mode==="dark"?.16:.08):"transparent",opacity:K?1:0,pointerEvents:K?"auto":"none",position:"relative",transition:`opacity ${ai}, background-color 120ms ease`,"&:hover":{backgroundColor:K?material.alpha(S.palette.primary.main,S.palette.mode==="dark"?.35:.18):"transparent"}}}),jsxRuntime.jsxs(material.Box,{"aria-hidden":Pe?true:void 0,sx:{minWidth:0,overflow:"hidden",display:"flex",flexDirection:"column",opacity:Pe?0:1,transform:Pe?"translateX(12px)":"translateX(0)",pointerEvents:Pe?"none":"auto",transition:`opacity ${ai}, transform ${ai}`,willChange:"opacity, transform"},children:[jsxRuntime.jsx(material.Box,{sx:{p:2,pb:1.25,minHeight:74,display:"flex",alignItems:"flex-end"},children:jsxRuntime.jsx(material.Divider,{sx:{width:"100%"}})}),jsxRuntime.jsx(material.Box,{sx:{flex:1,minHeight:0,overflow:"auto",px:2,pb:2},children:ze()})]})]})]})};var aP={none:{from:{},to:{}},fade:{from:{opacity:0},to:{opacity:1}},"slide-up":{from:{opacity:0,transform:"translate3d(0, 12px, 0)"},to:{opacity:1,transform:"translate3d(0, 0, 0)"}},"slide-left":{from:{opacity:0,transform:"translate3d(12px, 0, 0)"},to:{opacity:1,transform:"translate3d(0, 0, 0)"}},scale:{from:{opacity:0,transform:"scale(0.985)"},to:{opacity:1,transform:"scale(1)"}}},J4=({children:e,transitionKey:t,variant:o="fade",durationMs:r=220,delayMs:a=0,easing:n="cubic-bezier(0.22, 1, 0.36, 1)",disabled:i=false,sx:c})=>{let d=material.useMediaQuery("(prefers-reduced-motion: reduce)"),[l,s]=Qt.useState("to"),g=!i&&!d&&o!=="none";Qt.useEffect(()=>{if(!g){s("to");return}s("from");let b=requestAnimationFrame(()=>{b=requestAnimationFrame(()=>{s("to");});});return ()=>cancelAnimationFrame(b)},[t,g]);let f=aP[o],p=Qt.useMemo(()=>g?l==="from"?f.from:f.to:{opacity:1,transform:"none"},[g,l,f.from,f.to]);return jsxRuntime.jsx(material.Box,{sx:{willChange:g?"opacity, transform":"auto",transition:g?`opacity ${r}ms ${n} ${a}ms, transform ${r}ms ${n} ${a}ms`:"none",backfaceVisibility:"hidden",...p,...c},children:e})},eW={subtle:{variant:"fade",durationMs:180},smooth:{variant:"slide-up",durationMs:220},snappy:{variant:"scale",durationMs:160}};exports.AIBrowserGlow=g8;exports.AgentPanel=_f;exports.Button=ic;exports.CAINavProvider=Uw;exports.CAmapChart=vp;exports.CAppHeader=cs;exports.CAppHeaderSearch=hd;exports.CAppPageLayout=qE;exports.CAuthPage=O8;exports.CBarChart=yi;exports.CChartCard=xl;exports.CComboChart=lp;exports.CCustomizeAgent=wp;exports.CDetailInfoPage=q5;exports.CDetailSearchAiBar=Cm;exports.CDetailSectionCard=Jl;exports.CFishboneChart=up;exports.CGoogleMapChart=hp;exports.CGraphCharts=Cp;exports.CGraphKpiCards=rp;exports.CGraphReport=Fl;exports.CHeatmapChart=cp;exports.CKanbanBoard=gE;exports.CKanbanBucket=Pm;exports.CKanbanCard=ud;exports.CLayoutManagement=Xp;exports.CLayoutManager=wn;exports.CLineChart=ip;exports.CMessageBox=si;exports.COrbCanvas=Bw;exports.CPageLayout=zu;exports.CPageTransition=J4;exports.CPieChart=Il;exports.CPivotTable=LL;exports.CPlanningGantt=fh;exports.CPlanningLayout=L4;exports.CSmartFilter=$r;exports.CSmartTable=pB;exports.CStandardPage=xB;exports.CTable=Dr;exports.CTableBody=lB;exports.CTableCell=sB;exports.CTableContainer=cB;exports.CTableHead=dB;exports.CTableRow=uB;exports.CTreeComp=j4;exports.CValueHelp=Nu;exports.CVariantManagement=Ol;exports.CVariantManager=Fp;exports.CVoiceWaveOverlay=$d;exports.CWaterfallChart=mp;exports.CodeBlock=Mi;exports.CopilotChat=u8;exports.FloatingAgentPanel=r8;exports.GlobalMessage=sR;exports.MarkdownRenderer=Fi;exports.MathBlock=Di;exports.MermaidBlock=Yc;exports.NavigationIsland=dc;exports.ORBCAFE_I18N_MESSAGES=li;exports.OrbcafeI18nProvider=cl;exports.PAGE_TRANSITION_PRESETS=eW;exports.PAppPageLayout=uz;exports.PBarcodeScanner=eN;exports.PNavIsland=Qg;exports.PNumericKeypad=fN;exports.PSmartFilter=Ug;exports.PTable=hw;exports.PTouchCard=iN;exports.PWorkloadNav=qg;exports.PivotChartPanel=Sg;exports.StdChat=Uf;exports.TableBlock=Jc;exports.ThinkBlock=Yl;exports.TreeMenu=sc;exports.VoiceNavigatorProvider=Tz;exports.VoiceWaveOverlay=xz;exports.buildAmapEmbedUrl=Ml;exports.buildGoogleMapEmbedUrl=Ci;exports.buildGoogleMapIframe=yD;exports.buttonVariants=Dh;exports.createKanbanBoardModel=Dm;exports.findKanbanCard=yr;exports.message=_P;exports.messageManager=Vr;exports.moveKanbanCard=as;exports.parseMarkdownTable=Xl;exports.renderMarkdown=h5;exports.resolveVariantFilters=Yp;exports.resolveVariantLayout=_l;exports.useAINav=_w;exports.useAmapEmbedUrl=FB;exports.useAuthPage=y8;exports.useDetailInfo=km;exports.useGoogleMapEmbedUrl=EB;exports.useGraphChartData=RB;exports.useGraphInteraction=Nl;exports.useGraphReport=xn;exports.useKanbanBoard=xE;exports.useNavigationIsland=wu;exports.useOrbcafeI18n=ne;exports.usePadLayout=_L;exports.usePadRecordEditor=jL;exports.usePageLayout=Gm;exports.usePivotTable=WL;exports.usePlanningGantt=ah;exports.usePlanningLayout=K8;exports.useStandardReport=TB;exports.useVoiceInput=Rn;exports.useVoiceNavigator=Iz;
252
+ `,C8=({active:e=false,colors:t=$T,zIndex:o=2147483e3})=>{let r={"--orbcafe-ai-glow-a":t[0],"--orbcafe-ai-glow-b":t[1],"--orbcafe-ai-glow-c":t[2],"--orbcafe-ai-glow-z-index":o};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("style",{children:GT}),jsxRuntime.jsx("div",{className:"orbcafe-ai-browser-glow","data-active":e?"true":"false",style:r,"aria-hidden":"true"})]})};var T8=({defaultMode:e="login",onLogin:t,onRegister:o,onForgotPassword:r}={})=>{let[a,n]=Yt.useState(e),[i,c]=Yt.useState(false),d=Yt.useCallback(async p=>{c(true);try{await p?.();}finally{c(false);}},[]),l=Yt.useCallback(p=>d(()=>t?.(p)),[t,d]),s=Yt.useCallback(p=>d(()=>o?.(p)),[o,d]),m=Yt.useCallback(p=>d(()=>r?.(p)),[r,d]),g=Yt.useMemo(()=>({mode:a,loading:i,onModeChange:n,onLogin:l,onRegister:s,onForgotPassword:m}),[m,l,s,i,a]);return {mode:a,loading:i,setMode:n,authPageProps:g}};var au=({label:e,...t})=>jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{...t}),label:e});var nl=Yt.forwardRef((e,t)=>jsxRuntime.jsx(material.Paper,{ref:t,...e,elevation:e.elevation||1,sx:{p:2,mb:2,...e.sx}}));nl.displayName="CPaper";var aI={productName:"ORBCAFE",headline:"Operational workbench",subheadline:"A focused entry point for reports, planning, agent workflows, and enterprise operations.",loginTitle:"Sign in",loginSubtitle:"Use your workspace account to continue.",registerTitle:"Create account",registerSubtitle:"Request a demo workspace user for evaluation.",forgotTitle:"Reset password",forgotSubtitle:"Send a password reset request to your email address."},_8=({mode:e,defaultMode:t="login",onModeChange:o,onLogin:r,onRegister:a,onForgotPassword:n,loading:i=false,logo:c,copy:d,sx:l})=>{let s=material.useTheme(),m=e!==void 0,[g,p]=Yt.useState(t),b=e??g,y=Yt.useMemo(()=>({...aI,...d}),[d]),[u,x]=Yt.useState({username:"demo@orbcafe.local",password:"orbcafe-demo",remember:true}),[f,h]=Yt.useState({name:"",email:"",password:"",confirmPassword:"",acceptedTerms:false}),[v,S]=Yt.useState({email:""}),[E,P]=Yt.useState(""),w=R=>{m||p(R),P(""),o?.(R);},D=async R=>{R.preventDefault(),await r?.(u),P("Demo login accepted. No real authentication request was sent.");},I=async R=>{R.preventDefault(),await a?.(f),P("Demo registration saved locally for this screen.");},k=async R=>{R.preventDefault(),await n?.(v),P("Demo reset link request created. No email was sent.");},A=b==="login"?y.loginTitle:b==="register"?y.registerTitle:y.forgotTitle,T=b==="login"?y.loginSubtitle:b==="register"?y.registerSubtitle:y.forgotSubtitle;return jsxRuntime.jsxs(material.Box,{sx:{minHeight:"100vh",display:"grid",gridTemplateColumns:{xs:"1fr",md:"minmax(320px, 0.9fr) minmax(420px, 1.1fr)"},background:s.palette.mode==="dark"?"linear-gradient(135deg, #071018 0%, #151515 48%, #101827 100%)":"linear-gradient(135deg, #eef3f8 0%, #ffffff 52%, #e8f2f0 100%)",...l},children:[jsxRuntime.jsxs(material.Box,{sx:{display:{xs:"none",md:"flex"},flexDirection:"column",justifyContent:"space-between",p:{md:6,lg:8},borderRight:`1px solid ${s.palette.divider}`},children:[jsxRuntime.jsxs(material.Stack,{spacing:4,children:[jsxRuntime.jsx(material.Box,{children:c}),jsxRuntime.jsxs(material.Stack,{spacing:2,children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:14,fontWeight:700,color:"primary.main",textTransform:"uppercase"},children:y.productName}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:{md:34,lg:42},lineHeight:1.06,fontWeight:800},children:y.headline}),jsxRuntime.jsx(material.Typography,{sx:{maxWidth:460,color:"text.secondary",fontSize:16,lineHeight:1.7},children:y.subheadline})]})]}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:2,sx:{color:"text.secondary",fontSize:13},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",children:"Reports"}),jsxRuntime.jsx(material.Typography,{variant:"caption",children:"Planning"}),jsxRuntime.jsx(material.Typography,{variant:"caption",children:"Agent UI"})]})]}),jsxRuntime.jsx(material.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"center",p:{xs:2,sm:4,md:6}},children:jsxRuntime.jsx(nl,{elevation:0,sx:{width:"100%",maxWidth:460,m:0,p:{xs:2.5,sm:4},borderRadius:3,border:`1px solid ${s.palette.divider}`,backgroundColor:s.palette.mode==="dark"?"rgba(15, 23, 42, 0.86)":"rgba(255, 255, 255, 0.88)",backdropFilter:"blur(18px)",boxShadow:s.palette.mode==="dark"?"0 24px 80px rgba(0,0,0,0.34)":"0 24px 80px rgba(15,23,42,0.10)"},children:jsxRuntime.jsxs(material.Stack,{spacing:3,children:[jsxRuntime.jsxs(material.Stack,{spacing:1,children:[jsxRuntime.jsx(material.Box,{sx:{display:{xs:"block",md:"none"},mb:1},children:c}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:28,fontWeight:800},children:A}),jsxRuntime.jsx(material.Typography,{sx:{color:"text.secondary"},children:T})]}),E&&jsxRuntime.jsx(material.Alert,{severity:"success",children:E}),b==="login"&&jsxRuntime.jsx(material.Box,{component:"form",onSubmit:D,children:jsxRuntime.jsxs(material.Stack,{spacing:2,children:[jsxRuntime.jsx(Po,{label:"Email or user ID",value:u.username,onChange:R=>x(M=>({...M,username:R.target.value})),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(ih__default.default,{fontSize:"small"})})}}),jsxRuntime.jsx(Po,{label:"Password",type:"password",value:u.password,onChange:R=>x(M=>({...M,password:R.target.value})),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(oI__default.default,{fontSize:"small"})})}}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:2},children:[jsxRuntime.jsx(au,{label:"Remember me",checked:u.remember,onChange:R=>x(M=>({...M,remember:R.target.checked}))}),jsxRuntime.jsx(ur,{type:"button",variant:"text",size:"small",onClick:()=>w("forgot"),children:"Forgot?"})]}),jsxRuntime.jsx(ur,{type:"submit",size:"large",disabled:i,children:"Sign in"}),jsxRuntime.jsxs(material.Typography,{variant:"body2",sx:{color:"text.secondary",textAlign:"center"},children:["New user?"," ",jsxRuntime.jsx(ur,{type:"button",variant:"text",size:"small",onClick:()=>w("register"),sx:{minWidth:0,p:0},children:"Register"})]})]})}),b==="register"&&jsxRuntime.jsx(material.Box,{component:"form",onSubmit:I,children:jsxRuntime.jsxs(material.Stack,{spacing:2,children:[jsxRuntime.jsx(Po,{label:"Full name",value:f.name,onChange:R=>h(M=>({...M,name:R.target.value})),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(ih__default.default,{fontSize:"small"})})}}),jsxRuntime.jsx(Po,{label:"Work email",type:"email",value:f.email,onChange:R=>h(M=>({...M,email:R.target.value})),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(nh__default.default,{fontSize:"small"})})}}),jsxRuntime.jsx(Po,{label:"Password",type:"password",value:f.password,onChange:R=>h(M=>({...M,password:R.target.value})),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(rI__default.default,{fontSize:"small"})})}}),jsxRuntime.jsx(Po,{label:"Confirm password",type:"password",value:f.confirmPassword,onChange:R=>h(M=>({...M,confirmPassword:R.target.value}))}),jsxRuntime.jsx(au,{label:"I accept the demo workspace terms",checked:f.acceptedTerms,onChange:R=>h(M=>({...M,acceptedTerms:R.target.checked}))}),jsxRuntime.jsx(ur,{type:"submit",size:"large",disabled:i,children:"Create demo account"}),jsxRuntime.jsxs(material.Typography,{variant:"body2",sx:{color:"text.secondary",textAlign:"center"},children:["Already have an account?"," ",jsxRuntime.jsx(ur,{type:"button",variant:"text",size:"small",onClick:()=>w("login"),sx:{minWidth:0,p:0},children:"Sign in"})]})]})}),b==="forgot"&&jsxRuntime.jsx(material.Box,{component:"form",onSubmit:k,children:jsxRuntime.jsxs(material.Stack,{spacing:2,children:[jsxRuntime.jsx(Po,{label:"Work email",type:"email",value:v.email,onChange:R=>S({email:R.target.value}),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(nh__default.default,{fontSize:"small"})})}}),jsxRuntime.jsx(ur,{type:"submit",size:"large",disabled:i,children:"Send reset request"}),jsxRuntime.jsxs(material.Typography,{variant:"body2",sx:{color:"text.secondary",textAlign:"center"},children:["Remember your password?"," ",jsxRuntime.jsx(ur,{type:"button",variant:"text",size:"small",onClick:()=>w("login"),sx:{minWidth:0,p:0},children:"Back to sign in"})]})]})}),jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsx(material.Typography,{variant:"caption",sx:{color:"text.secondary"},children:"Demo credentials: demo@orbcafe.local / orbcafe-demo"})]})})})]})};var iI={keyword:{value:"",operator:"contains"},status:{value:"",operator:"equals"},owner:{value:"",operator:"contains"},workCenter:{value:"",operator:"contains"}},lI=[{id:"keyword",label:"Keyword",type:"text",placeholder:"Task/ID/Project",hasSearchIcon:true},{id:"status",label:"Status",type:"select",options:[{label:"In progress",value:"in-progress"},{label:"Blocked",value:"blocked"},{label:"Planned",value:"planned"},{label:"Not started",value:"not-started"}]},{id:"owner",label:"Owner",type:"text",placeholder:"Owner name"},{id:"workCenter",label:"Work Center",type:"text",placeholder:"CNC-02 / WH-A / ..."},{id:"dateRange",label:"Date Range",type:"date"}],lh=({tasks:e,appId:t,tableKey:o,defaultScale:r="week",defaultSelectedTaskId:a,initialFilters:n,filterFields:i,filterAppId:c,filterTableKey:d,serviceUrl:l,variantService:s,layout:m,columns:g,page:p,rowsPerPage:b,rowsPerPageOptions:y,count:u,onPageChange:x,onRowsPerPageChange:f,onFilterSearch:h,onFilterVariantLoad:v,enableRowReorder:S,onTaskReorder:E,onLayoutIdChange:P,onLayoutSave:w})=>{let D=t??c??"planning-gantt",I=o??d??"planning",[k,A]=Yt.useState(r),[T,R]=Yt.useState(a??e[0]?.id??""),[M,Z]=Yt.useState(""),[L,ee]=Yt.useState(null),[H,q]=Yt.useState({...iI,...n}),$=Yt.useMemo(()=>{let Y=String(H.keyword?.value??"").trim().toLowerCase(),de=String(H.status?.value??"").trim(),We=String(H.owner?.value??"").trim().toLowerCase(),$e=String(H.workCenter?.value??"").trim().toLowerCase(),me=H.dateRange?.value,Ne=me?.[0]?zr__default.default(me[0]):null,rt=me?.[1]?zr__default.default(me[1]):null;return e.filter(he=>{if(Y&&![he.id,he.code,he.title,he.project,he.workCenter,he.owner?.name].join(" ").toLowerCase().includes(Y)||de&&he.status!==de||We&&!String(he.owner?.name??"").toLowerCase().includes(We)||$e&&!String(he.workCenter??"").toLowerCase().includes($e))return false;if(Ne||rt){let Le=zr__default.default(he.startDate),He=zr__default.default(he.endDate),Xe=Ne?He.isAfter(Ne)||He.isSame(Ne,"day"):true,qe=rt?Le.isBefore(rt)||Le.isSame(rt,"day"):true;if(!Xe||!qe)return false}return true})},[H,e]);Yt.useEffect(()=>{$.length!==0&&($.some(Y=>Y.id===T)||R($[0].id));},[$,T]);let ie=Yt.useCallback(Y=>{R(Y.id);},[]),ue=Yt.useCallback(Y=>{Z(Y),P?.(Y);},[P]),Ce=Yt.useCallback(Y=>{ee(de=>({key:(de?.key??0)+1,variant:Y})),v?.(Y);},[v]),te=Yt.useMemo(()=>({appId:D,tableKey:I,fields:i??lI,filters:H,onFilterChange:q,onVariantLoad:Ce,onSearch:h??(()=>{}),currentLayoutId:M,layoutRefs:[{tableKey:I,layoutId:M||null}],variantService:s,serviceUrl:l}),[M,i,H,Ce,h,D,I,l,s]),j=Yt.useMemo(()=>({appId:D,tableKey:I,serviceUrl:l,tasks:$,columns:g,scale:k,onScaleChange:A,page:p,rowsPerPage:b,rowsPerPageOptions:y,count:u,onPageChange:x,onRowsPerPageChange:f,selectedTaskId:T,onTaskSelect:ie,enableRowReorder:S,onTaskReorder:E,layout:m,layoutVariant:L?.variant,layoutVariantLoadKey:L?.key,onLayoutIdChange:ue,onLayoutSave:w}),[g,u,S,$,ue,m,L?.key,L?.variant,x,f,w,E,ie,p,D,I,b,y,k,l,T]);return {scale:k,setScale:A,selectedTaskId:T,setSelectedTaskId:R,filters:H,setFilters:q,filteredTasks:$,smartFilterProps:te,planningGanttProps:j}};var J8=e=>{let t=lh(e),o=Yt.useMemo(()=>({filterProps:t.smartFilterProps,ganttProps:t.planningGanttProps}),[t.planningGanttProps,t.smartFilterProps]);return {...t,layoutProps:o}};var sh=e=>jsxRuntime.jsx(material.Chip,{...e,size:e.size||"small",variant:e.variant||"outlined"});var Ho=Yt.forwardRef(({tooltip:e,...t},o)=>{let r=jsxRuntime.jsx(material.IconButton,{ref:o,...t,size:t.size||"small"});return e?jsxRuntime.jsx(material.Tooltip,{title:e,children:r}):r});Ho.displayName="CIconButton";var dh=({label:e,options:t,minWidth:o=120,...r})=>jsxRuntime.jsxs(material.FormControl,{fullWidth:true,size:"small",sx:{minWidth:o},children:[e&&jsxRuntime.jsx(material.InputLabel,{children:e}),jsxRuntime.jsx(material.Select,{label:e,...r,children:t.map(a=>jsxRuntime.jsx(material.MenuItem,{value:a.value,children:a.label},a.value))})]});zr__default.default.extend(vI__default.default);var du=[{value:"hour",label:"Hour",width:56},{value:"day",label:"Day",width:46},{value:"week",label:"Week",width:78},{value:"month",label:"Month",width:104}],uu=56,en=58,sl=8,pu=260,GI=320,ac="0.85rem",tn="220ms cubic-bezier(0.2, 0, 0, 1)",mh={"not-started":{label:"Not started",color:"default"},planned:{label:"Planned",color:"info"},"in-progress":{label:"In progress",color:"primary"},blocked:{label:"Blocked",color:"error"},done:{label:"Done",color:"success"}},UI=e=>e?mh[e]?.label??e:"Planned",_I=e=>e?mh[e]?.color??"default":"info",gh=e=>Math.min(100,Math.max(0,e??0)),fh=(e,t=0)=>e.flatMap(o=>[{...o,level:t},...fh(o.children??[],t+1)]),KI=e=>({id:e.id,code:e.code??e.id,title:e.title,titleSub:e.project??e.workCenter??"General",project:e.project??"",workCenter:e.workCenter??"",owner:e.owner?.name??"Unassigned",status:UI(e.status),statusTone:e.status??"planned",progress:gh(e.progress),startDate:e.startDate,endDate:e.endDate,color:e.color,reorderable:e.reorderable!==false}),hh=(e,t)=>t==="month"?e.startOf("month"):t==="week"?e.startOf("week"):t==="day"?e.startOf("day"):e.startOf("hour"),bh=(e,t)=>t==="month"?e.endOf("month"):t==="week"?e.endOf("week"):t==="day"?e.endOf("day"):e.endOf("hour"),qI=(e,t,o)=>{let r=[],a=hh(e,o),n=bh(t,o);for(;a.isBefore(n)||a.isSame(n);){let i=o==="month"?a.add(1,"month"):o==="week"?a.add(1,"week"):o==="day"?a.add(1,"day"):a.add(1,"hour");r.push({key:`${o}-${a.valueOf()}`,label:o==="month"?a.format("MMM YYYY"):o==="week"?a.format("MMM D"):o==="day"?a.format("D"):a.format("HH:mm"),contextLabel:o==="hour"?a.format("MMM D"):o==="day"?a.format("MMM"):o==="week"?`W${a.isoWeek()}`:void 0,title:o==="hour"?a.format("MMM D, YYYY HH:mm"):o==="day"?a.format("MMM D, YYYY"):o==="week"?`${a.format("MMM D, YYYY")} - Week ${a.isoWeek()}`:void 0,start:a,end:i}),a=i;}return r},mu=(e,t,o)=>{let r=0;for(let a of t){if(e.isBefore(a.start))return r;if(e.isBefore(a.end)){let n=Math.max(1,a.end.valueOf()-a.start.valueOf()),i=Math.max(0,e.valueOf()-a.start.valueOf());return r+i/n*o}r+=o;}return r},yh=({appId:e="planning-gantt",tableKey:t="planning",serviceUrl:o,title:r="Project Plan",extraTools:a,bodyHeight:n=560,tasks:i,columns:c,scale:d="week",onScaleChange:l,page:s,rowsPerPage:m=20,rowsPerPageOptions:g=[20,50,100,-1],count:p,onPageChange:b,onRowsPerPageChange:y,timelineStart:u,timelineEnd:x,selectedTaskId:f,onTaskSelect:h,enableRowReorder:v=true,onTaskReorder:S,layout:E,layoutVariant:P,layoutVariantLoadKey:w,onLayoutIdChange:D,onLayoutSave:I,emptyLabel:k="No planning tasks available.",sx:A})=>{let T=material.useTheme(),{t:R}=le(),M=Yt.useRef(null),Z=Yt.useRef(null),L=Yt.useRef(null),ee=Yt.useRef(false),[H,q]=Yt.useState(null),[$,ie]=Yt.useState("content"),[ue,Ce]=Yt.useState(null),[te,j]=Yt.useState(0),[Y,de]=Yt.useState({}),[We,$e]=Yt.useState(uu),[me,Ne]=Yt.useState([]),rt=Yt.useRef(void 0),[he,Le]=Yt.useState({activeId:null,overId:null}),[He,Xe]=Yt.useState(null),[qe,K]=Yt.useState(false),Fe=core.useSensors(core.useSensor(core.PointerSensor,{activationConstraint:{distance:4}})),be=Yt.useRef(null),ke=Yt.useMemo(()=>fh(i),[i]),et=Yt.useMemo(()=>{if(me.length===0)return ke;let B=new Map(ke.map(ce=>[ce.id,ce])),Q=me.map(ce=>B.get(ce)).filter(ce=>!!ce),ae=new Set(Q.map(ce=>ce.id));return [...Q,...ke.filter(ce=>!ae.has(ce.id))]},[ke,me]),Te=Yt.useMemo(()=>new Map(et.map(B=>[B.id,B])),[et]),lt=Yt.useMemo(()=>et.map(B=>KI(B)),[et]),Ct=Yt.useMemo(()=>new Map(lt.map(B=>[B.id,B])),[lt]),Mt=Yt.useMemo(()=>[{id:"code",label:"ID",minWidth:90},{id:"title",label:"Task",minWidth:260,render:(B,Q)=>jsxRuntime.jsxs(material.Stack,{spacing:.2,children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:15,fontWeight:700,lineHeight:1.2},children:Q.title}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:13,color:"text.secondary"},children:Q.titleSub})]})},{id:"owner",label:"Owner",minWidth:170},{id:"status",label:"Status",minWidth:130,render:(B,Q)=>jsxRuntime.jsx(sh,{label:Q.status,color:_I(Q.statusTone),size:"small"})},{id:"progress",label:"Progress",minWidth:140,numeric:true,render:B=>jsxRuntime.jsxs(material.Stack,{spacing:.6,children:[jsxRuntime.jsxs(material.Typography,{variant:"caption",sx:{color:"text.secondary"},children:[B,"%"]}),jsxRuntime.jsx(material.LinearProgress,{variant:"determinate",value:B,sx:{height:6,borderRadius:999}})]})},{id:"startDate",label:"Start",minWidth:120},{id:"endDate",label:"End",minWidth:120}],[]),Jt=Yt.useMemo(()=>{if(!c||c.length===0)return Mt;let B=new Map(Mt.map(Q=>[Q.id,Q]));return c.map(Q=>{let ae=B.get(Q.id),ce=Q.width??ae?.minWidth??120,Be={id:Q.id,label:Q.label,minWidth:ce};if(ae?.numeric&&(Be.numeric=true),Q.render){let Ge=Q.render;return Be.render=(mt,Pe)=>{let dt=Te.get(Pe.id);return Ge(dt||Pe)},Be}return ae?.render?(Be.render=ae.render,Be):(Be.render=(Ge,mt)=>{let Pe=mt[Q.id];if(Pe!=null&&String(Pe).length>0)return String(Pe);let at=Te.get(mt.id)?.[Q.id];return at!=null&&String(at).length>0?String(at):"-"},Be)})},[c,Mt,Te]),X=Tn({appId:e,tableKey:t,title:r,columns:Jt,rows:lt,rowKey:"id",page:s,rowsPerPage:m,rowsPerPageOptions:g,count:p??lt.length,onPageChange:b,onRowsPerPageChange:y,showSummary:false,layout:E,onLayoutSave:I}),_e=e?jsxRuntime.jsx(wn,{appId:e,tableKey:t,currentLayoutData:X.currentLayoutData,onLayoutLoad:X.handleLayoutLoad,targetLayoutId:X.layoutIdToLoad,activeLayoutId:X.currentLayoutId,serviceUrl:o}):null,J=X.visibleRows,G=X.rowsPerPage===-1?1:Math.max(1,Math.ceil(X.totalDisplayCount/X.rowsPerPage)),F=Math.max(0,Math.min(X.page,G-1)),re=Math.min(F+1,G),ve=F>0,Se=F<G-1&&X.rowsPerPage!==-1;Yt.useEffect(()=>{let B=ke.map(Q=>Q.id);Ne(Q=>{let ae=new Set(B),ce=Q.filter(Pe=>ae.has(Pe)),Be=new Set(ce),Ge=B.filter(Pe=>!Be.has(Pe)),mt=[...ce,...Ge];return mt.length===Q.length&&mt.every((Pe,dt)=>Pe===Q[dt])?Q:mt});},[ke]),Yt.useEffect(()=>{w===void 0||!P||rt.current!==w&&(rt.current=w,X.handleVariantLoad(P));},[X,P,w]),Yt.useEffect(()=>{D?.(X.currentLayoutId);},[X.currentLayoutId,D]);let Ke=B=>B.type==="group"?`group-${B.id}`:`row-${(B.data||B)?.id}`,st=Yt.useMemo(()=>{let B=lt.map(dt=>zr__default.default(dt.startDate)),Q=lt.map(dt=>zr__default.default(dt.endDate)),ae=u?zr__default.default(u):B.reduce((dt,at)=>at.isBefore(dt)?at:dt,B[0]??zr__default.default()),ce=x?zr__default.default(x):Q.reduce((dt,at)=>at.isAfter(dt)?at:dt,Q[0]??zr__default.default().add(30,"day")),Be=d==="month"?"month":d==="week"?"week":d==="day"?"day":"hour",Ge=d==="month"?"month":d==="week"?"week":d==="day"?"day":"hour",mt=d==="hour"?12:1,Pe=d==="hour"?12:1;return {start:hh(ae.subtract(mt,Be),d),end:bh(ce.add(Pe,Ge),d)}},[lt,d,x,u]),Ye=du.find(B=>B.value===d)??du[1],ft=Array.isArray(a)?a:a?[a]:[],xt=Yt.useMemo(()=>qI(st.start,st.end,d),[st.end,st.start,d]),ao=xt.length*Ye.width,ht=xt.length>0?100/xt.length:100,Bo=xt.length>0?`repeat(${xt.length}, minmax(${Ye.width}px, 1fr))`:"1fr",so=xt.length>0?`calc(100% / ${xt.length}) 100%`:"100% 100%",Et=(X.columns||[]).filter(B=>X.visibleColumns.includes(B.id)).reduce((B,Q)=>B+(X.columnWidths?.[Q.id]||Q.minWidth||100),0)+(X.grouping.length>0?72:0),$t=$==="manual"&&H!==null?H:Et,vt=ue==="table",no=ue==="timeline",O=ue==="timeline",W=ue==="table",_=!O&&!W,fe=()=>{let B=te||M.current?.clientWidth||0;return B>0?Math.max(pu,B-sl-GI):Math.max(pu,Et)},ge=B=>Math.min(Math.max(B,pu),fe()),je=(()=>{if(te<=0)return null;let B=_?sl:0;if(vt)return {tableWidth:te,splitterWidth:B,timelineWidth:0};if(no)return {tableWidth:0,splitterWidth:B,timelineWidth:te};if($==="even"){let ae=Math.max(0,(te-B)/2);return {tableWidth:ae,splitterWidth:B,timelineWidth:Math.max(0,te-B-ae)}}let Q=ge($t);return {tableWidth:Q,splitterWidth:B,timelineWidth:Math.max(0,te-B-Q)}})(),Ze=je?`${je.tableWidth}px ${je.splitterWidth}px ${je.timelineWidth}px`:vt?"minmax(0, 1fr) 0px 0px":no?"0px 0px minmax(0, 1fr)":$==="even"?`minmax(0, 1fr) ${sl}px minmax(0, 1fr)`:`${$t}px ${sl}px minmax(0, 1fr)`;Yt.useEffect(()=>{$==="manual"&&q(B=>B===null?null:ge(B));},[$,Et,te]);let tt=B=>{B.preventDefault(),B.currentTarget.setPointerCapture(B.pointerId),Ce(null),ie("manual"),be.current={startX:B.clientX,startWidth:Z.current?.getBoundingClientRect().width??$t};let Q=ce=>{let Be=be.current;if(!Be)return;let Ge=ge(Be.startWidth+ce.clientX-Be.startX);q(Ge);},ae=()=>{be.current=null,window.removeEventListener("pointermove",Q),window.removeEventListener("pointerup",ae),document.body.style.cursor="",document.body.style.userSelect="";};document.body.style.cursor="col-resize",document.body.style.userSelect="none",window.addEventListener("pointermove",Q),window.addEventListener("pointerup",ae);},Dt=()=>{Ce(null),ie("even"),q(null);},ut=B=>!v||!B?false:Ct.get(B)?.reorderable!==false,pt=(B,Q)=>{if(!B||!Q||B===Q||!ut(B)||!ut(Q))return false;if(X.grouping.length===0)return true;let ae=Ct.get(B),ce=Ct.get(Q);return !ae||!ce?false:X.grouping.every(Be=>ae[Be]===ce[Be])},St=(B,Q)=>{if(!pt(B,Q))return;let ae=J.filter(bt=>bt.type!=="group").map(bt=>String((bt.data||bt)?.id)),ce=ae.indexOf(B),Be=ae.indexOf(Q);if(ce<0||Be<0)return;let Ge=[...ae];[Ge[ce],Ge[Be]]=[Ge[Be],Ge[ce]];let mt=new Set(ae),Pe=et.map(bt=>bt.id),dt=[...Ge,...Pe.filter(bt=>!mt.has(bt))],at=Te.get(B),It=Te.get(Q);if(X.setOrder("asc"),X.setOrderBy(""),Ne(dt),at&&It){let{level:bt,...eo}=at,{level:co,...To}=It,jt=dt.reduce((vo,Pt)=>{let Gt=Te.get(Pt);if(Gt){let{level:cr,...dr}=Gt;vo.push(dr);}return vo},[]);S?.(jt,{activeTask:eo,targetTask:To});}},Vt=(B,Q)=>{if(!ut(Q.id)){B.preventDefault();return}B.stopPropagation(),B.dataTransfer.effectAllowed="move",B.dataTransfer.setData("text/plain",Q.id),Le({activeId:Q.id,overId:null}),h?.(Te.get(Q.id)||Q);},ct=(B,Q)=>{if(!pt(he.activeId,Q)){Le(ae=>ae.overId===null?ae:{...ae,overId:null});return}B.preventDefault(),B.stopPropagation(),B.dataTransfer.dropEffect="move",Le(ae=>ae.overId===Q?ae:{...ae,overId:Q});},Eo=(B,Q)=>{let ae=he.activeId||B.dataTransfer.getData("text/plain");if(!pt(ae,Q)){Le({activeId:null,overId:null});return}B.preventDefault(),B.stopPropagation(),St(ae,Q),Le({activeId:null,overId:null});},wo=()=>{Le({activeId:null,overId:null});},Jo=B=>{if(ee.current)return;let Q=B==="table"?Z.current:L.current,ae=B==="table"?L.current:Z.current;!Q||!ae||(ee.current=true,ae.scrollTop=Q.scrollTop,window.requestAnimationFrame(()=>{ee.current=false;}));};return Yt.useLayoutEffect(()=>{let B=M.current;if(!B){j(0);return}let Q=0,ae=()=>{window.cancelAnimationFrame(Q),Q=window.requestAnimationFrame(()=>{let Be=B.clientWidth;j(Ge=>Math.abs(Ge-Be)<.5?Ge:Be);});};if(ae(),typeof ResizeObserver>"u")return window.addEventListener("resize",ae),()=>{window.cancelAnimationFrame(Q),window.removeEventListener("resize",ae);};let ce=new ResizeObserver(ae);return ce.observe(B),window.addEventListener("resize",ae),()=>{window.cancelAnimationFrame(Q),ce.disconnect(),window.removeEventListener("resize",ae);}},[lt.length]),Yt.useLayoutEffect(()=>{if(!f||W)return;let B=L.current,Q=Z.current;if(!B)return;let ae=`row-${f}`,ce=Array.from(B.querySelectorAll("[data-planning-timeline-row-key]")).find(mt=>mt.dataset.planningTimelineRowKey===ae),Be=Ct.get(f);if(!ce||!Be)return;let Ge=window.requestAnimationFrame(()=>{let mt=B.getBoundingClientRect(),Pe=ce.getBoundingClientRect(),dt=Math.max(1,B.clientHeight-We),at=B.scrollTop+Pe.top-mt.top-We-(dt-Pe.height)/2;ee.current=true,B.scrollTop=Math.max(0,at),Q&&!O&&(Q.scrollTop=B.scrollTop);let It=Math.max(1,B.scrollWidth),bt=xt.length>0?It/xt.length:Ye.width,eo=mu(zr__default.default(Be.startDate),xt,bt),co=Math.max(0,eo-bt);B.scrollLeft=Math.min(co,Math.max(0,It-B.clientWidth)),window.requestAnimationFrame(()=>{ee.current=false;});});return ()=>window.cancelAnimationFrame(Ge)},[Ye.width,We,f,O,Ct,W,J,xt]),Yt.useLayoutEffect(()=>{let B=Z.current;if(!B)return;let Q=0,ae=0,ce=false,Be=()=>{if(ce)return;let co=B.querySelector("thead"),To=Array.from(B.querySelectorAll("tbody tr[data-planning-row-key]"));if(To.length===0)return;let jt=co?.getBoundingClientRect().height||uu,vo={};To.forEach(Pt=>{let Gt=Pt.dataset.planningRowKey;Gt&&(vo[Gt]=Pt.getBoundingClientRect().height);}),$e(Pt=>Math.abs(Pt-jt)<.01?Pt:jt),de(Pt=>{let Gt=Object.keys(Pt),cr=Object.keys(vo);return Gt.length===cr.length&&cr.every(dr=>Math.abs((Pt[dr]??0)-vo[dr])<.01)?Pt:vo});},Ge=()=>{window.cancelAnimationFrame(Q),Q=window.requestAnimationFrame(Be);};if(Be(),window.cancelAnimationFrame(ae),ae=window.requestAnimationFrame(()=>{ae=window.requestAnimationFrame(Be);}),typeof document<"u"&&document.fonts?.ready&&document.fonts.ready.then(()=>{ce||Ge();}).catch(()=>{}),typeof ResizeObserver>"u")return window.addEventListener("resize",Ge),()=>{ce=true,window.cancelAnimationFrame(Q),window.cancelAnimationFrame(ae),window.removeEventListener("resize",Ge);};let mt=new ResizeObserver(Ge),Pe=B.querySelector("table"),dt=B.querySelector("tbody"),at=B.querySelector("thead");Pe&&mt.observe(Pe),at&&mt.observe(at);let It=new WeakSet,bt=()=>{B.querySelectorAll("tbody tr[data-planning-row-key]").forEach(co=>{It.has(co)||(mt.observe(co),It.add(co));});};bt();let eo=null;return dt&&typeof MutationObserver<"u"&&(eo=new MutationObserver(()=>{bt(),Ge();}),eo.observe(dt,{childList:true,subtree:true,characterData:true})),window.addEventListener("resize",Ge),()=>{ce=true,window.cancelAnimationFrame(Q),window.cancelAnimationFrame(ae),mt.disconnect(),eo?.disconnect(),window.removeEventListener("resize",Ge);}},[J,X.visibleColumns,X.grouping,X.columnWidths]),jsxRuntime.jsxs(nl,{elevation:0,sx:{m:0,p:0,display:"flex",flexDirection:"column",minHeight:0,overflow:"hidden",borderRadius:3,border:`1px solid ${T.palette.divider}`,backgroundColor:T.palette.background.paper,...A},children:[jsxRuntime.jsxs(material.Stack,{direction:{xs:"column",md:"row"},justifyContent:"space-between",alignItems:{xs:"stretch",md:"center"},spacing:2,sx:{px:2,py:1.75,borderBottom:`1px solid ${T.palette.divider}`},children:[jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:.75,alignItems:"center",sx:{p:.5,borderRadius:2,backgroundColor:"action.hover",minHeight:38},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:ac,color:"text.secondary",whiteSpace:"nowrap"},children:R("table.toolbar.itemsPerPage")}),jsxRuntime.jsx(material.Select,{size:"small",variant:"standard",value:X.rowsPerPage,disableUnderline:true,onChange:B=>X.setRowsPerPage(Number(B.target.value)),sx:{fontSize:ac,fontWeight:600,color:"text.primary",minWidth:64,height:30,display:"flex",alignItems:"center","& .MuiSelect-select":{py:0,pl:.75,pr:"22px !important",minHeight:`${30}px !important`,height:30,display:"flex",alignItems:"center",boxSizing:"border-box"},"& .MuiSelect-icon":{right:0,fontSize:20,color:"text.primary"}},children:g.map(B=>jsxRuntime.jsx(material.MenuItem,{value:B,sx:{fontSize:ac},children:B===-1?R("common.all"):B},`planning-rows-per-page-${B}`))}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>X.setPage(Math.max(F-1,0)),disabled:!ve,sx:{...Ir,color:"text.primary"},children:jsxRuntime.jsx(Qb__default.default,{})}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:ac,fontWeight:600,minWidth:88,textAlign:"center",color:"text.primary"},children:R("table.toolbar.pageOf",{current:re,total:G})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>X.setPage(Math.min(F+1,G-1)),disabled:!Se,sx:{...Ir,color:"text.primary"},children:jsxRuntime.jsx(ph__default.default,{})})]}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,alignItems:"center",sx:{flexWrap:"wrap"},children:[ft.length>0&&jsxRuntime.jsx(material.Stack,{direction:"row",spacing:.75,alignItems:"center",children:ft.map((B,Q)=>jsxRuntime.jsx(material.Box,{sx:{display:"flex",alignItems:"center"},children:B},`planning-extra-tool-${Q}`))}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:.25,sx:{p:.5,borderRadius:2,backgroundColor:"action.hover"},children:[jsxRuntime.jsx(Ho,{tooltip:"Column visibility",onClick:B=>X.setAnchorEl(B.currentTarget),color:"default",children:jsxRuntime.jsx(Gb__default.default,{fontSize:"small"})}),jsxRuntime.jsx(Ho,{tooltip:"Group by",onClick:B=>X.setGroupAnchorEl(B.currentTarget),color:"default",children:jsxRuntime.jsx(Kb__default.default,{fontSize:"small"})}),jsxRuntime.jsx(Ho,{tooltip:"Sort by...",onClick:()=>K(true),color:X.sortBy.length>0||X.orderBy?"primary":"default",children:jsxRuntime.jsx(HI__default.default,{fontSize:"small"})})]}),_e&&jsxRuntime.jsx(material.Stack,{direction:"row",spacing:.25,sx:{p:.5,borderRadius:2,backgroundColor:"action.hover"},children:_e}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:.25,sx:{p:.5,borderRadius:2,backgroundColor:"action.hover"},children:[jsxRuntime.jsx(Ho,{tooltip:"Expand task table",onClick:()=>Ce("table"),color:ue==="table"?"primary":"default",children:jsxRuntime.jsx(VI__default.default,{fontSize:"small"})}),jsxRuntime.jsx(Ho,{tooltip:"Split evenly",onClick:Dt,color:ue===null&&$==="even"?"primary":"default",children:jsxRuntime.jsx(WI__default.default,{fontSize:"small"})}),jsxRuntime.jsx(Ho,{tooltip:"Expand timeline",onClick:()=>Ce("timeline"),color:ue==="timeline"?"primary":"default",children:jsxRuntime.jsx(OI__default.default,{fontSize:"small"})})]}),jsxRuntime.jsx(material.Box,{sx:{minWidth:120},children:jsxRuntime.jsx(dh,{label:"",value:d,options:du.map(B=>({value:B.value,label:B.label})),onChange:B=>l?.(B.target.value),sx:{"& .MuiSelect-select":{fontSize:"0.92rem",py:.65},"& .MuiSvgIcon-root":{fontSize:20}}})})]})]}),lt.length===0?jsxRuntime.jsx(material.Box,{sx:{minHeight:240,display:"grid",placeItems:"center",color:"text.secondary"},children:k}):jsxRuntime.jsx(material.Box,{sx:{overflow:"hidden",flex:1,minHeight:0},children:jsxRuntime.jsxs(material.Box,{ref:M,sx:{height:"100%",display:"grid",gridTemplateColumns:Ze,minWidth:0,transition:`grid-template-columns ${tn}`},children:[jsxRuntime.jsx(material.TableContainer,{"data-planning-scroll-pane":"table",ref:Z,onScroll:()=>Jo("table"),sx:{width:"100%",minWidth:0,maxWidth:"100%",height:n,overflowX:"auto",overflowY:"auto",opacity:O?0:1,transform:O?"translateX(-10px)":"translateX(0)",pointerEvents:O?"none":"auto",transition:`opacity ${tn}, transform ${tn}`},children:jsxRuntime.jsx(core.DndContext,{sensors:Fe,collisionDetection:core.closestCenter,modifiers:[modifiers.restrictToHorizontalAxis],onDragEnd:B=>{let Q=B?.active?.id,ae=B?.over?.id;typeof Q=="string"&&typeof ae=="string"&&X.handleColumnReorder(Q,ae);},children:jsxRuntime.jsxs(material.Table,{size:"small",stickyHeader:true,sx:{tableLayout:"fixed",width:Et,"& thead .MuiTableCell-root":{height:uu,py:0,lineHeight:1.15,boxSizing:"border-box"}},children:[jsxRuntime.jsx(yl,{columns:X.columns,visibleColumns:X.visibleColumns,order:X.order,orderBy:X.orderBy,sortBy:X.sortBy,onRequestSort:X.handleRequestSort,onContextMenu:(B,Q)=>{B.preventDefault(),B.stopPropagation(),Xe({mouseX:B.clientX+2,mouseY:B.clientY-6,columnId:Q});},grouping:X.grouping,isAllExpanded:X.isAllExpanded,handleToggleAll:X.handleToggleAll,columnWidths:X.columnWidths,onColumnResize:X.handleColumnResize,enableColumnReorder:true}),jsxRuntime.jsx(material.TableBody,{children:J.map(B=>{let Q=Ke(B);if(B.type==="group")return jsxRuntime.jsxs(material.TableRow,{"data-planning-row-key":Q,sx:{height:en,backgroundColor:T.palette.action.hover},children:[X.grouping.length>0&&jsxRuntime.jsx(material.TableCell,{sx:{...Tr,height:en,borderBottom:`1px solid ${T.palette.divider}`},children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>X.toggleGroupExpand(B.id),sx:Ir,children:B.isExpanded?jsxRuntime.jsx(vy__default.default,{}):jsxRuntime.jsx(ph__default.default,{})})}),jsxRuntime.jsx(material.TableCell,{colSpan:X.visibleColumns.length,sx:{height:en,py:0,borderBottom:`1px solid ${T.palette.divider}`},children:jsxRuntime.jsxs(material.Typography,{sx:{fontSize:13,fontWeight:700},children:[B.field,": ",B.value," (",B.count,")"]})})]},B.id);let ae=B.data||B,ce=ae.id===f,Be=ut(ae.id),Ge=he.activeId===ae.id,mt=he.overId===ae.id&&pt(he.activeId,ae.id);return jsxRuntime.jsxs(material.TableRow,{"data-planning-row-key":Q,draggable:Be,hover:true,selected:ce,onDragStart:Pe=>Vt(Pe,ae),onDragOver:Pe=>ct(Pe,ae.id),onDragEnter:Pe=>ct(Pe,ae.id),onDrop:Pe=>Eo(Pe,ae.id),onDragEnd:wo,onClick:()=>h?.(Te.get(ae.id)||ae),sx:{cursor:Ge?"grabbing":Be?"grab":h?"pointer":"default",height:en,opacity:Ge?.56:1,"& .MuiTableCell-root":mt?{borderTop:`2px solid ${T.palette.primary.main}`}:void 0,transition:"background-color 120ms ease, opacity 120ms ease"},children:[X.grouping.length>0&&jsxRuntime.jsx(material.TableCell,{sx:{...Tr,height:en,borderBottom:`1px solid ${T.palette.divider}`}}),(X.columns||[]).filter(Pe=>X.visibleColumns.includes(Pe.id)).map(Pe=>jsxRuntime.jsx(material.TableCell,{sx:{width:X.columnWidths?.[Pe.id]||Pe.minWidth||100,height:en,py:0,overflow:"hidden",borderBottom:`1px solid ${T.palette.divider}`},children:Pe.render?Pe.render(ae[Pe.id],ae):String(ae[Pe.id]??"-")},`${ae.id}-${Pe.id}`))]},ae.id)})})]})})}),jsxRuntime.jsx(material.Box,{onPointerDown:_?tt:void 0,role:"separator","aria-orientation":"vertical",sx:{width:_?sl:0,cursor:_?"col-resize":"default",opacity:_?1:0,pointerEvents:_?"auto":"none",borderLeft:_?`1px solid ${T.palette.divider}`:"0 solid transparent",borderRight:_?`1px solid ${T.palette.divider}`:"0 solid transparent",backgroundColor:T.palette.mode==="dark"?"rgba(148,163,184,0.10)":"rgba(15,23,42,0.04)",transition:`width ${tn}, opacity ${tn}, background-color 120ms ease`,position:"relative","&:hover":{backgroundColor:T.palette.action.selected},"&::before":{content:'""',position:"absolute",top:0,bottom:0,left:-6,right:-6,cursor:_?"col-resize":"default"}}}),jsxRuntime.jsx(material.Box,{sx:{minWidth:0,overflow:"hidden",opacity:W?0:1,transform:W?"translateX(10px)":"translateX(0)",pointerEvents:W?"none":"auto",transition:`opacity ${tn}, transform ${tn}`},children:jsxRuntime.jsx(material.Box,{"data-planning-scroll-pane":"timeline",ref:L,onScroll:()=>Jo("timeline"),sx:{width:"100%",height:n,overflowX:"auto",overflowY:"auto"},children:jsxRuntime.jsxs(material.Box,{sx:{width:"100%",minWidth:ao||"100%"},children:[jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:Bo,height:We,boxSizing:"border-box",borderBottom:`1px solid ${T.palette.divider}`,position:"sticky",top:0,zIndex:2,backgroundColor:T.palette.background.paper},children:xt.map(B=>jsxRuntime.jsxs(material.Box,{title:B.title,sx:{px:.75,display:"flex",flexDirection:B.contextLabel?"column":"row",alignItems:"center",justifyContent:"center",gap:B.contextLabel?.15:0,borderRight:`1px solid ${T.palette.divider}`,color:B.contextLabel?"text.primary":"text.secondary",overflow:"hidden"},children:[B.contextLabel&&jsxRuntime.jsx(material.Typography,{component:"span",sx:{maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"text.secondary",fontSize:11,fontWeight:700,lineHeight:1.1},children:B.contextLabel}),jsxRuntime.jsx(material.Typography,{component:"span",sx:{maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:12,fontWeight:700,lineHeight:1.15},children:B.label})]},B.key))}),jsxRuntime.jsx(material.Stack,{sx:{position:"relative"},children:J.map(B=>{let Q=Ke(B),ae=Y[Q]??en;if(B.type==="group")return jsxRuntime.jsx(material.Box,{"data-planning-timeline-row-key":Q,sx:{position:"relative",height:ae,boxSizing:"border-box",borderBottom:`1px solid ${T.palette.divider}`,backgroundColor:T.palette.action.hover}},B.id);let ce=B.data||B,Be=zr__default.default(ce.startDate),Ge=zr__default.default(ce.endDate),mt=mu(Be,xt,ht),Pe=mu(Ge,xt,ht),dt=Math.max(0,Pe-mt),at=gh(ce.progress),It=ce.id===f,bt=ut(ce.id),eo=he.activeId===ce.id,co=he.overId===ce.id&&pt(he.activeId,ce.id),To=ce.color??(ce.statusTone==="blocked"?T.palette.error.main:T.palette.primary.main);return jsxRuntime.jsx(material.Box,{"data-planning-timeline-row-key":Q,draggable:bt,onDragStart:jt=>Vt(jt,ce),onDragOver:jt=>ct(jt,ce.id),onDragEnter:jt=>ct(jt,ce.id),onDrop:jt=>Eo(jt,ce.id),onDragEnd:wo,onClick:()=>h?.(Te.get(ce.id)||ce),sx:{position:"relative",height:ae,boxSizing:"border-box",borderBottom:`1px solid ${T.palette.divider}`,opacity:eo?.56:1,"&::before":{content:'""',position:"absolute",top:0,left:0,right:0,height:2,backgroundColor:T.palette.primary.main,opacity:co?1:0,transition:"opacity 120ms ease",pointerEvents:"none",zIndex:3},backgroundImage:T.palette.mode==="dark"?"linear-gradient(90deg, rgba(148,163,184,0.08) 1px, transparent 1px)":"linear-gradient(90deg, rgba(15,23,42,0.06) 1px, transparent 1px)",backgroundSize:so,cursor:eo?"grabbing":bt?"grab":h?"pointer":"default",transition:"opacity 120ms ease"},children:jsxRuntime.jsx(material.Tooltip,{title:`${ce.title}: ${Be.format("MMM D HH:mm")} - ${Ge.format("MMM D HH:mm")}`,children:jsxRuntime.jsxs(material.Box,{sx:{position:"absolute",left:`${mt}%`,top:Math.max(8,(ae-24)/2),width:`max(18px, ${dt}%)`,height:24,borderRadius:999,overflow:"hidden",backgroundColor:T.palette.mode==="dark"?"rgba(148,163,184,0.18)":"rgba(15,23,42,0.10)",outline:It?`2px solid ${T.palette.warning.main}`:"none",outlineOffset:2},children:[jsxRuntime.jsx(material.Box,{sx:{height:"100%",width:`${at}%`,backgroundColor:To}}),jsxRuntime.jsx(material.Typography,{sx:{position:"absolute",inset:0,px:1,display:"flex",alignItems:"center",color:"#fff",fontSize:11,fontWeight:800,textShadow:"0 1px 4px rgba(0,0,0,0.45)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:ce.code})]})})},ce.id)})})]})})})]})}),jsxRuntime.jsx(sn,{groupAnchorEl:X.groupAnchorEl,setGroupAnchorEl:X.setGroupAnchorEl,grouping:X.grouping,setGrouping:X.setGrouping,columns:X.columns,toggleGroupField:X.toggleGroupField}),jsxRuntime.jsx(cn,{anchorEl:X.anchorEl,setAnchorEl:X.setAnchorEl,columns:X.columns,visibleColumns:X.visibleColumns,toggleColumnVisibility:X.toggleColumnVisibility}),jsxRuntime.jsx(rp,{contextMenu:He,handleClose:()=>Xe(null),columns:X.columns,visibleColumns:X.visibleColumns,grouping:X.grouping,summaryColumns:X.summaryColumns,showSummary:X.showSummary,sortBy:X.sortBy,orderBy:X.orderBy,order:X.order,onSortAsc:B=>{X.applyMultiSort([{field:B,direction:"asc"}]);},onSortDesc:B=>{X.applyMultiSort([{field:B,direction:"desc"}]);},onClearSort:B=>{let Q=X.sortBy.filter(ae=>ae.field!==B);Q.length>0?X.applyMultiSort(Q):(X.clearMultiSort(),X.orderBy===B&&X.setOrderBy(""));},onHideColumn:B=>{X.visibleColumns.includes(B)&&X.toggleColumnVisibility(B);},onToggleGroup:B=>X.toggleGroupField(B),onToggleSummary:B=>X.toggleSummaryColumn(B),onOpenSortDialog:()=>K(true)}),jsxRuntime.jsx(ap,{open:qe,onClose:()=>K(false),columns:X.columns,initialRules:X.sortBy.length>0?X.sortBy:X.orderBy?[{field:X.orderBy,direction:X.order}]:[],onApply:B=>X.applyMultiSort(B),onClear:()=>{X.clearMultiSort(),X.setOrderBy("");}})]})};var $4=({filterProps:e,ganttProps:t,spacing:o=2,sx:r,children:a})=>{let n=r?[{height:"100%",overflow:"hidden"},r]:{height:"100%",overflow:"hidden"},i=t.sx?[{height:"100%"},t.sx]:{height:"100%"};return jsxRuntime.jsxs(material.Stack,{spacing:o,sx:n,children:[jsxRuntime.jsx(material.Box,{sx:{flexShrink:0},children:jsxRuntime.jsx($r,{...e})}),jsxRuntime.jsx(material.Box,{sx:{flex:1,minHeight:0,overflow:"hidden"},children:jsxRuntime.jsx(yh,{...t,bodyHeight:t.bodyHeight??"100%",sx:i})}),a]})};var vh=640,aP=360,nP=360,sc=8,ai="220ms cubic-bezier(0.2, 0, 0, 1)",hu=(e,t,o=0,r=[])=>e.flatMap(a=>{let n=a.children??[],i=[{node:a,level:o,hasChildren:n.length>0,parentIds:r}];return t.has(a.id)?[...i,...hu(n,t,o+1,[...r,a.id])]:i}),Sh=e=>e.flatMap(t=>[t,...Sh(t.children??[])]),kh=(e,t=0,o=[])=>e.flatMap(r=>{let a=r.children??[];return [{node:r,level:t,hasChildren:a.length>0,parentIds:o},...kh(a,t+1,[...o,r.id])]}),wh=e=>e.flatMap(t=>{let o=t.children??[];return o.length===0?[]:[t.id,...wh(o)]}),Ch=e=>Object.entries(e).filter(([t])=>t!=="children").map(([,t])=>t==null?"":typeof t=="string"||typeof t=="number"||typeof t=="boolean"?String(t):"").join(" ").toLowerCase(),tW=({title:e,subtitle:t,nodes:o,columns:r,detail:a,selectedNodeId:n,defaultSelectedNodeId:i,onNodeSelect:c,expandedNodeIds:d,defaultExpandedNodeIds:l,onExpandedNodeIdsChange:s,defaultPaneMode:m="split",minTreePaneWidth:g=aP,minDetailPaneWidth:p=nP,tableAppId:b="ctree-comp",tableKey:y="default",tableTitle:u,filterConfig:x,searchQuery:f,searchToken:h,defaultRowsPerPage:v=-1,rowsPerPageOptions:S=[20,50,100,-1],serviceUrl:E,emptyLabel:P="No tree items available.",headerAction:w,sx:D,className:I})=>{let k=material.useTheme(),A=Yt.useRef(null),T=Yt.useRef(null),R=Yt.useRef(null),[M,Z]=Yt.useState(i??o[0]?.id??null),[L,ee]=Yt.useState(l??wh(o).slice(0,3)),[H,q]=Yt.useState(m),[$,ie]=Yt.useState(vh),[ue,Ce]=Yt.useState(0),[te,j]=Yt.useState(0),[Y,de]=Yt.useState(v),We=Yt.useMemo(()=>r&&r.length>0?r:[{id:"label",label:"Name",render:G=>jsxRuntime.jsxs(material.Stack,{spacing:.3,children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:15,fontWeight:700,lineHeight:1.15},children:G.label}),G.subtitle&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:13,color:"text.secondary",lineHeight:1.2},children:G.subtitle})]})}],[r]),$e=Yt.useMemo(()=>new Set(d??L),[d,L]),me=Yt.useMemo(()=>hu(o,$e),[o,$e]),Ne=Yt.useMemo(()=>Sh(o),[o]),rt=Yt.useMemo(()=>kh(o),[o]),he=n===void 0?M:n,Le=Yt.useMemo(()=>Ne.find(G=>G.id===he)??null,[he,Ne]),He=G=>{let F=T.current?.clientWidth??0,re=F>0?Math.max(g,F-sc-p):Math.max(g,G);return Math.min(Math.max(G,g),re)},Xe=H==="detail",qe=H==="tree"||!a,K=H==="split"&&!!a,be=(()=>{if(ue<=0)return null;if(H==="tree"||!a)return {treeWidth:ue,splitterWidth:0,detailWidth:0};if(H==="detail")return {treeWidth:0,splitterWidth:0,detailWidth:ue};let G=K?sc:0,F=He($);return {treeWidth:F,splitterWidth:G,detailWidth:Math.max(0,ue-G-F)}})(),ke=be?`${be.treeWidth}px ${be.splitterWidth}px ${be.detailWidth}px`:H==="tree"||!a?"minmax(0, 1fr) 0px 0px":H==="detail"?"0px 0px minmax(0, 1fr)":`minmax(${g}px, ${$}px) ${sc}px minmax(${p}px, 1fr)`;Yt.useEffect(()=>{let G=T.current;if(!G){Ce(0);return}let F=0,re=()=>{window.cancelAnimationFrame(F),F=window.requestAnimationFrame(()=>{let Se=G.clientWidth;Ce(Ke=>Math.abs(Ke-Se)<.5?Ke:Se);});};if(re(),typeof ResizeObserver>"u")return window.addEventListener("resize",re),()=>{window.cancelAnimationFrame(F),window.removeEventListener("resize",re);};let ve=new ResizeObserver(re);return ve.observe(G),window.addEventListener("resize",re),()=>{window.cancelAnimationFrame(F),ve.disconnect(),window.removeEventListener("resize",re);}},[]);let et=G=>{d===void 0&&ee(G),s?.(G);},Te=G=>{let F=new Set($e);F.has(G)?F.delete(G):F.add(G),et(Array.from(F));},lt=G=>{n===void 0&&Z(G.id),c?.(G);};Yt.useEffect(()=>{j(0);},[o]),Yt.useEffect(()=>{let G=f?.trim().toLowerCase();if(!G)return;let F=rt.find(({node:Ye})=>Ch(Ye).includes(G));if(!F)return;let re=new Set($e);F.parentIds.forEach(Ye=>re.add(Ye)),et(Array.from(re)),lt(F.node);let Se=hu(o,re).findIndex(({node:Ye})=>Ye.id===F.node.id);Se>=0&&Y>0&&j(Math.floor(Se/Y));let Ke=0,st=0;return Ke=window.requestAnimationFrame(()=>{st=window.requestAnimationFrame(()=>{let Ye=A.current?.querySelector(".MuiTableRow-root.Mui-selected"),ft=Ye?.closest(".MuiTableContainer-root");if(Ye&&ft){let xt=ft.getBoundingClientRect(),ao=Ye.getBoundingClientRect(),ht=ao.top-xt.top+ft.scrollTop;ft.scrollTo({top:ht-ft.clientHeight/2+ao.height/2,behavior:"smooth"});return}Ye?.scrollIntoView({block:"center",behavior:"smooth"});});}),()=>{window.cancelAnimationFrame(Ke),window.cancelAnimationFrame(st);}},[f,h,rt,o,Y]);let Ct=Yt.useMemo(()=>me.map(({node:G,level:F,hasChildren:re})=>({...G,id:G.id,__node:G,__level:F,__hasChildren:re,__expanded:$e.has(G.id),__searchText:Ch(G)})),[$e,me]),Mt=Yt.useMemo(()=>We.map((G,F)=>({id:G.id,label:G.label,minWidth:typeof G.width=="number"?G.width:G.minWidth??(F===0?320:120),numeric:G.numeric??G.align==="right",render:(re,ve)=>{let Se=ve.__node,Ke=G.render?G.render(Se):Se[G.id];if(F!==0)return jsxRuntime.jsx(material.Box,{sx:{minWidth:0,color:G.align==="right"?"text.primary":"text.secondary",fontWeight:G.align==="right"?750:500,textAlign:G.align??"left"},children:Ke});let st=Number(ve.__level??0),Ye=!!ve.__hasChildren,ft=!!ve.__expanded;return jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:1,sx:{minWidth:0,pl:`${st*24}px`},children:[jsxRuntime.jsx(Ho,{tooltip:Ye?ft?"Collapse":"Expand":"",onClick:xt=>{xt.stopPropagation(),Ye&&Te(Se.id);},disabled:!Ye,sx:{width:24,height:24,visibility:Ye?"visible":"hidden",transform:ft?"rotate(0deg)":"rotate(-90deg)",transition:"transform 160ms ease"},children:jsxRuntime.jsx(vy__default.default,{sx:{fontSize:20}})}),jsxRuntime.jsx(material.Box,{sx:{width:10,height:10,borderRadius:"50%",flexShrink:0,backgroundColor:Se.markerColor??k.palette.primary.main}}),jsxRuntime.jsx(material.Box,{sx:{minWidth:0},children:Ke})]})}})),[We,$e,k.palette.primary.main]),Jt=G=>{if(!K)return;G.preventDefault(),G.currentTarget.setPointerCapture(G.pointerId),R.current={startX:G.clientX,startWidth:$};let F=ve=>{let Se=R.current;Se&&ie(He(Se.startWidth+ve.clientX-Se.startX));},re=()=>{R.current=null,window.removeEventListener("pointermove",F),window.removeEventListener("pointerup",re),document.body.style.cursor="",document.body.style.userSelect="";};document.body.style.cursor="col-resize",document.body.style.userSelect="none",window.addEventListener("pointermove",F),window.addEventListener("pointerup",re);},X=()=>{let G=T.current?.clientWidth??0,F=G>0?Math.max(g,(G-sc)/2):vh;q("split"),ie(He(F));},_e=()=>a?typeof a=="function"?a(Le):a:null,J=a?jsxRuntime.jsxs(material.Box,{sx:{position:"absolute",top:13,right:56,zIndex:3,display:"flex",gap:.25,p:.5,borderRadius:2,backgroundColor:material.alpha(k.palette.background.paper,.9),border:`1px solid ${k.palette.divider}`,boxShadow:`0 8px 22px ${material.alpha(k.palette.common.black,k.palette.mode==="dark"?.28:.1)}`,backdropFilter:"blur(10px)"},children:[jsxRuntime.jsx(Ho,{tooltip:"Expand tree",onClick:()=>q("tree"),color:H==="tree"?"primary":"default",children:jsxRuntime.jsx(VI__default.default,{fontSize:"small"})}),jsxRuntime.jsx(Ho,{tooltip:"Split evenly",onClick:X,color:H==="split"?"primary":"default",children:jsxRuntime.jsx(WI__default.default,{fontSize:"small"})}),jsxRuntime.jsx(Ho,{tooltip:"Expand detail",onClick:()=>q("detail"),color:H==="detail"?"primary":"default",children:jsxRuntime.jsx(OI__default.default,{fontSize:"small"})})]}):null;return jsxRuntime.jsxs(material.Box,{ref:A,className:["ctree_comp",I].filter(Boolean).join(" "),sx:{position:"relative",height:"100%",minHeight:0,border:`1px solid ${k.palette.divider}`,borderRadius:2,overflow:"hidden",backgroundColor:"background.paper",boxShadow:`0 18px 42px ${material.alpha(k.palette.common.black,k.palette.mode==="dark"?.24:.08)}`,...D},children:[J,jsxRuntime.jsxs(material.Box,{ref:T,sx:{height:"100%",display:"grid",gridTemplateColumns:ke,transition:`grid-template-columns ${ai}`,minWidth:0},children:[jsxRuntime.jsxs(material.Box,{"aria-hidden":Xe?true:void 0,sx:{minWidth:0,overflow:"hidden",display:"flex",flexDirection:"column",opacity:Xe?0:1,transform:Xe?"translateX(-12px)":"translateX(0)",pointerEvents:Xe?"none":"auto",transition:`opacity ${ai}, transform ${ai}`,willChange:"opacity, transform"},children:[jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:2,sx:{px:2,py:1.5,minHeight:74,borderBottom:`1px solid ${k.palette.divider}`},children:[jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:1.4,sx:{minWidth:0},children:[jsxRuntime.jsx(Kb__default.default,{sx:{color:"primary.main",fontSize:28}}),jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:20,fontWeight:750,lineHeight:1.12},noWrap:true,children:e}),t&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:14,color:"text.secondary",mt:.3},noWrap:true,children:t})]})]}),w!==void 0?w:jsxRuntime.jsx(Ho,{tooltip:"Add node",color:"default",children:jsxRuntime.jsx(op__default.default,{fontSize:"small"})})]}),jsxRuntime.jsxs(material.Box,{sx:{flex:1,minHeight:0,overflow:"hidden"},children:[jsxRuntime.jsx(Dr,{appId:b,tableKey:y,title:u??(typeof e=="string"?e:"Tree"),columns:Mt,rows:Ct,rowKey:"id",fitContainer:true,fullWidth:true,showSummary:false,selectionMode:"single",selected:he?[he]:[],onSelectionChange:G=>{let F=G[G.length-1],re=Ne.find(ve=>ve.id===F);re&&lt(re);},page:te,rowsPerPage:Y,rowsPerPageOptions:S,count:Ct.length,onPageChange:j,onRowsPerPageChange:G=>{j(0),de(G);},filterConfig:x,serviceUrl:E,graphReport:{enabled:false},disableGrouping:true,disableSorting:true,maxHeight:"100%"}),Ct.length===0&&jsxRuntime.jsx(material.Box,{sx:{minHeight:220,display:"grid",placeItems:"center",color:"text.secondary"},children:P})]})]}),jsxRuntime.jsx(material.Box,{"data-ctree-splitter":"true",role:"separator","aria-orientation":"vertical",onPointerDown:K?Jt:void 0,sx:{width:"100%",cursor:K?"col-resize":"default",backgroundColor:K?material.alpha(k.palette.text.primary,k.palette.mode==="dark"?.16:.08):"transparent",opacity:K?1:0,pointerEvents:K?"auto":"none",position:"relative",transition:`opacity ${ai}, background-color 120ms ease`,"&:hover":{backgroundColor:K?material.alpha(k.palette.primary.main,k.palette.mode==="dark"?.35:.18):"transparent"}}}),jsxRuntime.jsxs(material.Box,{"aria-hidden":qe?true:void 0,sx:{minWidth:0,overflow:"hidden",display:"flex",flexDirection:"column",opacity:qe?0:1,transform:qe?"translateX(12px)":"translateX(0)",pointerEvents:qe?"none":"auto",transition:`opacity ${ai}, transform ${ai}`,willChange:"opacity, transform"},children:[jsxRuntime.jsx(material.Box,{sx:{p:2,pb:1.25,minHeight:74,display:"flex",alignItems:"flex-end"},children:jsxRuntime.jsx(material.Divider,{sx:{width:"100%"}})}),jsxRuntime.jsx(material.Box,{sx:{flex:1,minHeight:0,overflow:"auto",px:2,pb:2},children:_e()})]})]})]})};var uP={none:{from:{},to:{}},fade:{from:{opacity:0},to:{opacity:1}},"slide-up":{from:{opacity:0,transform:"translate3d(0, 12px, 0)"},to:{opacity:1,transform:"translate3d(0, 0, 0)"}},"slide-left":{from:{opacity:0,transform:"translate3d(12px, 0, 0)"},to:{opacity:1,transform:"translate3d(0, 0, 0)"}},scale:{from:{opacity:0,transform:"scale(0.985)"},to:{opacity:1,transform:"scale(1)"}}},iW=({children:e,transitionKey:t,variant:o="fade",durationMs:r=220,delayMs:a=0,easing:n="cubic-bezier(0.22, 1, 0.36, 1)",disabled:i=false,sx:c})=>{let d=material.useMediaQuery("(prefers-reduced-motion: reduce)"),[l,s]=Yt.useState("to"),m=!i&&!d&&o!=="none";Yt.useEffect(()=>{if(!m){s("to");return}s("from");let b=requestAnimationFrame(()=>{b=requestAnimationFrame(()=>{s("to");});});return ()=>cancelAnimationFrame(b)},[t,m]);let g=uP[o],p=Yt.useMemo(()=>m?l==="from"?g.from:g.to:{opacity:1,transform:"none"},[m,l,g.from,g.to]);return jsxRuntime.jsx(material.Box,{sx:{willChange:m?"opacity, transform":"auto",transition:m?`opacity ${r}ms ${n} ${a}ms, transform ${r}ms ${n} ${a}ms`:"none",backfaceVisibility:"hidden",...p,...c},children:e})},lW={subtle:{variant:"fade",durationMs:180},smooth:{variant:"slide-up",durationMs:220},snappy:{variant:"scale",durationMs:160}};exports.AIBrowserGlow=C8;exports.AgentPanel=jf;exports.Button=dc;exports.CAINavProvider=Yw;exports.CAmapChart=kp;exports.CAppHeader=ms;exports.CAppHeaderSearch=vd;exports.CAppPageLayout=eF;exports.CAuthPage=_8;exports.CBarChart=vi;exports.CChartCard=kl;exports.CComboChart=dp;exports.CCustomizeAgent=Pp;exports.CDetailInfoPage=eE;exports.CDetailSearchAiBar=wm;exports.CDetailSectionCard=rs;exports.CFishboneChart=gp;exports.CGoogleMapChart=xp;exports.CGraphCharts=wp;exports.CGraphKpiCards=ip;exports.CGraphReport=Ol;exports.CHeatmapChart=pp;exports.CKanbanBoard=CE;exports.CKanbanBucket=Dm;exports.CKanbanCard=fd;exports.CLayoutManagement=Qp;exports.CLayoutManager=wn;exports.CLineChart=cp;exports.CMessageBox=di;exports.COrbCanvas=Vw;exports.CPageLayout=Wu;exports.CPageTransition=iW;exports.CPieChart=Dl;exports.CPivotTable=$L;exports.CPlanningGantt=yh;exports.CPlanningLayout=$4;exports.CSmartFilter=$r;exports.CSmartTable=xB;exports.CStandardPage=IB;exports.CTable=Dr;exports.CTableBody=gB;exports.CTableCell=fB;exports.CTableContainer=hB;exports.CTableHead=bB;exports.CTableRow=yB;exports.CTreeComp=tW;exports.CValueHelp=Vu;exports.CVariantManagement=$l;exports.CVariantManager=zp;exports.CVoiceWaveOverlay=Kd;exports.CWaterfallChart=hp;exports.CodeBlock=Ai;exports.CopilotChat=y8;exports.FloatingAgentPanel=d8;exports.GlobalMessage=fR;exports.MarkdownRenderer=Ni;exports.MathBlock=Bi;exports.MermaidBlock=td;exports.NavigationIsland=gc;exports.ORBCAFE_I18N_MESSAGES=li;exports.OrbcafeI18nProvider=ul;exports.PAGE_TRANSITION_PRESETS=lW;exports.PAppPageLayout=yz;exports.PBarcodeScanner=lN;exports.PNavIsland=tf;exports.PNumericKeypad=SN;exports.PSmartFilter=qg;exports.PTable=kw;exports.PTouchCard=mN;exports.PWorkloadNav=Zg;exports.PivotChartPanel=Tg;exports.StdChat=qf;exports.TableBlock=rd;exports.ThinkBlock=ts;exports.TreeMenu=pc;exports.VoiceNavigatorProvider=Bz;exports.VoiceWaveOverlay=Iz;exports.buildAmapEmbedUrl=El;exports.buildGoogleMapEmbedUrl=ki;exports.buildGoogleMapIframe=TD;exports.buttonVariants=Eh;exports.createKanbanBoardModel=Em;exports.findKanbanCard=yr;exports.message=QP;exports.messageManager=Vr;exports.moveKanbanCard=ss;exports.parseMarkdownTable=Jl;exports.renderMarkdown=k5;exports.resolveVariantFilters=em;exports.resolveVariantLayout=Xl;exports.useAINav=Qw;exports.useAmapEmbedUrl=HB;exports.useAuthPage=T8;exports.useDetailInfo=Im;exports.useGoogleMapEmbedUrl=WB;exports.useGraphChartData=LB;exports.useGraphInteraction=Wl;exports.useGraphReport=xn;exports.useKanbanBoard=IE;exports.useNavigationIsland=Pu;exports.useOrbcafeI18n=le;exports.usePadLayout=QL;exports.usePadRecordEditor=tN;exports.usePageLayout=Km;exports.usePivotTable=qL;exports.usePlanningGantt=lh;exports.usePlanningLayout=J8;exports.useStandardReport=BB;exports.useVoiceInput=Rn;exports.useVoiceNavigator=Ez;