orbcafe-ui 1.3.3 → 1.3.4

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'),vt=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'),tu=require('@mui/material/Dialog'),ou=require('@mui/material/DialogTitle'),au=require('@mui/material/DialogContent'),Hf=require('@mui/material/DialogContentText'),ru=require('@mui/material/DialogActions'),Yn=require('@mui/material/Box'),Gf=require('@mui/icons-material/CheckCircle'),Uf=require('@mui/icons-material/Warning'),Kf=require('@mui/icons-material/Error'),qf=require('@mui/icons-material/Info'),material=require('@mui/material'),styles=require('@mui/material/styles'),ih=require('@mui/icons-material/Clear'),lh=require('@mui/icons-material/Close'),Gd=require('@mui/icons-material/Search'),px=require('@mui/material/Paper'),ux=require('@mui/material/Table'),mx=require('@mui/material/TableBody'),zs=require('@mui/material/TableCell'),lu=require('@mui/material/TableContainer'),zh=require('@mui/material/TableHead'),Nh=require('@mui/material/TableRow'),nu=require('@mui/material/TextField'),fl=require('@mui/material/Button'),iu=require('@mui/material/Alert'),core=require('@dnd-kit/core'),modifiers=require('@dnd-kit/modifiers'),kh=require('@mui/icons-material/ViewColumn'),Xp=require('@mui/icons-material/Save'),wh=require('@mui/icons-material/Download'),Th=require('@mui/icons-material/AccountTree'),Ih=require('@mui/icons-material/Functions'),Ph=require('@mui/icons-material/Insights'),Rh=require('@mui/icons-material/Add'),Dh=require('@mui/icons-material/Edit'),Mh=require('@mui/icons-material/Delete'),Ah=require('@mui/icons-material/KeyboardArrowLeft'),Bh=require('@mui/icons-material/KeyboardArrowRight'),Vh=require('@mui/material/Checkbox'),Oh=require('@mui/material/TableSortLabel'),Hh=require('@mui/material/IconButton'),Wh=require('@mui/material/Tooltip'),$h=require('@mui/icons-material/UnfoldMore'),Gh=require('@mui/icons-material/UnfoldLess'),Zh=require('@mui/icons-material/KeyboardArrowDown'),cy=require('@mui/icons-material/Check'),dy=require('@mui/icons-material/ClearAll'),Ky=require('@mui/icons-material/MicNoneOutlined'),qy=require('@mui/icons-material/SettingsOutlined'),_y=require('@mui/icons-material/SendOutlined'),Gb=require('@mui/icons-material/Settings'),Ub=require('@mui/icons-material/KeyboardArrowUp'),qb=require('@mui/icons-material/ArrowRightAlt'),gb=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'),Db=require('@mui/icons-material/CalendarMonth'),Ab=require('@mui/icons-material/ArrowForward'),ta=require('dayjs'),Bb=require('dayjs/plugin/isBetween'),Eb=require('dayjs/plugin/localizedFormat');require('dayjs/locale/zh-cn'),require('dayjs/locale/fr'),require('dayjs/locale/de'),require('dayjs/locale/ja'),require('dayjs/locale/ko');var ix=require('@mui/icons-material/StarBorder'),lx=require('@mui/icons-material/ViewQuilt'),D0=require('@mui/icons-material/CloseOutlined'),Dx=require('@mui/icons-material/ContentCopyOutlined'),Mx=require('@mui/icons-material/CheckOutlined'),n0=require('@mui/icons-material/ExpandMore'),sortable=require('@dnd-kit/sortable'),Ou=require('@mui/icons-material/Language'),gv=require('@mui/icons-material/DesktopWindows'),fv=require('@mui/icons-material/DarkMode'),hv=require('@mui/icons-material/LightMode'),bv=require('@mui/icons-material/Logout'),EC=require('@mui/icons-material/DeleteOutline'),Wv=require('@mui/icons-material/DragIndicator'),nC=require('@mui/icons-material/FilterList'),iC=require('@mui/icons-material/TableRows'),qv=require('@mui/icons-material/LayersClear'),rk=require('@mui/icons-material/CameraAltRounded'),nk=require('@mui/icons-material/QrCodeScannerRounded'),ck=require('@mui/icons-material/DragIndicatorRounded'),mk=require('@mui/icons-material/BackspaceRounded'),gk=require('@mui/icons-material/CloseRounded'),fk=require('@mui/icons-material/CheckRounded'),Mk=require('@mui/icons-material/SearchRounded'),Ak=require('@mui/icons-material/MenuOpenRounded'),Bk=require('@mui/icons-material/MenuRounded'),Ek=require('@mui/icons-material/ExpandMoreRounded'),Fk=require('@mui/icons-material/ChevronRightRounded'),cS=require('next/dynamic'),framerMotion=require('framer-motion'),Sw=require('react-markdown'),ww=require('remark-gfm'),Tw=require('remark-math'),Iw=require('rehype-katex'),Pw=require('rehype-raw'),reactSyntaxHighlighter=require('react-syntax-highlighter'),prism=require('react-syntax-highlighter/dist/esm/styles/prism'),nextThemes=require('next-themes'),gg=require('mermaid'),Vw=require('@mui/icons-material/MicRounded'),Ow=require('@mui/icons-material/MicOffRounded'),iconsMaterial=require('@mui/icons-material'),Uw=require('@mui/icons-material/SendRounded'),Kw=require('@mui/icons-material/AddRounded'),qw=require('@mui/icons-material/HardwareRounded'),f1=require('@mui/icons-material/LockOutlined'),Gg=require('@mui/icons-material/MailOutline'),Ug=require('@mui/icons-material/PersonOutline'),h1=require('@mui/icons-material/VpnKeyOutlined'),E1=require('dayjs/plugin/isoWeek'),W1=require('@mui/icons-material/CalendarMonthOutlined'),K1=require('@mui/icons-material/KeyboardDoubleArrowLeftOutlined'),q1=require('@mui/icons-material/KeyboardDoubleArrowRightOutlined'),_1=require('@mui/icons-material/SplitscreenOutlined'),j1=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 vt__namespace=/*#__PURE__*/_interopNamespace(vt);var tu__default=/*#__PURE__*/_interopDefault(tu);var ou__default=/*#__PURE__*/_interopDefault(ou);var au__default=/*#__PURE__*/_interopDefault(au);var Hf__default=/*#__PURE__*/_interopDefault(Hf);var ru__default=/*#__PURE__*/_interopDefault(ru);var Yn__default=/*#__PURE__*/_interopDefault(Yn);var Gf__default=/*#__PURE__*/_interopDefault(Gf);var Uf__default=/*#__PURE__*/_interopDefault(Uf);var Kf__default=/*#__PURE__*/_interopDefault(Kf);var qf__default=/*#__PURE__*/_interopDefault(qf);var ih__default=/*#__PURE__*/_interopDefault(ih);var lh__default=/*#__PURE__*/_interopDefault(lh);var Gd__default=/*#__PURE__*/_interopDefault(Gd);var px__default=/*#__PURE__*/_interopDefault(px);var ux__default=/*#__PURE__*/_interopDefault(ux);var mx__default=/*#__PURE__*/_interopDefault(mx);var zs__default=/*#__PURE__*/_interopDefault(zs);var lu__default=/*#__PURE__*/_interopDefault(lu);var zh__default=/*#__PURE__*/_interopDefault(zh);var Nh__default=/*#__PURE__*/_interopDefault(Nh);var nu__default=/*#__PURE__*/_interopDefault(nu);var fl__default=/*#__PURE__*/_interopDefault(fl);var iu__default=/*#__PURE__*/_interopDefault(iu);var kh__default=/*#__PURE__*/_interopDefault(kh);var Xp__default=/*#__PURE__*/_interopDefault(Xp);var wh__default=/*#__PURE__*/_interopDefault(wh);var Th__default=/*#__PURE__*/_interopDefault(Th);var Ih__default=/*#__PURE__*/_interopDefault(Ih);var Ph__default=/*#__PURE__*/_interopDefault(Ph);var Rh__default=/*#__PURE__*/_interopDefault(Rh);var Dh__default=/*#__PURE__*/_interopDefault(Dh);var Mh__default=/*#__PURE__*/_interopDefault(Mh);var Ah__default=/*#__PURE__*/_interopDefault(Ah);var Bh__default=/*#__PURE__*/_interopDefault(Bh);var Vh__default=/*#__PURE__*/_interopDefault(Vh);var Oh__default=/*#__PURE__*/_interopDefault(Oh);var Hh__default=/*#__PURE__*/_interopDefault(Hh);var Wh__default=/*#__PURE__*/_interopDefault(Wh);var $h__default=/*#__PURE__*/_interopDefault($h);var Gh__default=/*#__PURE__*/_interopDefault(Gh);var Zh__default=/*#__PURE__*/_interopDefault(Zh);var cy__default=/*#__PURE__*/_interopDefault(cy);var dy__default=/*#__PURE__*/_interopDefault(dy);var Ky__default=/*#__PURE__*/_interopDefault(Ky);var qy__default=/*#__PURE__*/_interopDefault(qy);var _y__default=/*#__PURE__*/_interopDefault(_y);var Gb__default=/*#__PURE__*/_interopDefault(Gb);var Ub__default=/*#__PURE__*/_interopDefault(Ub);var qb__default=/*#__PURE__*/_interopDefault(qb);var gb__default=/*#__PURE__*/_interopDefault(gb);var Db__default=/*#__PURE__*/_interopDefault(Db);var Ab__default=/*#__PURE__*/_interopDefault(Ab);var ta__default=/*#__PURE__*/_interopDefault(ta);var Bb__default=/*#__PURE__*/_interopDefault(Bb);var Eb__default=/*#__PURE__*/_interopDefault(Eb);var ix__default=/*#__PURE__*/_interopDefault(ix);var lx__default=/*#__PURE__*/_interopDefault(lx);var D0__default=/*#__PURE__*/_interopDefault(D0);var Dx__default=/*#__PURE__*/_interopDefault(Dx);var Mx__default=/*#__PURE__*/_interopDefault(Mx);var n0__default=/*#__PURE__*/_interopDefault(n0);var Ou__default=/*#__PURE__*/_interopDefault(Ou);var gv__default=/*#__PURE__*/_interopDefault(gv);var fv__default=/*#__PURE__*/_interopDefault(fv);var hv__default=/*#__PURE__*/_interopDefault(hv);var bv__default=/*#__PURE__*/_interopDefault(bv);var EC__default=/*#__PURE__*/_interopDefault(EC);var Wv__default=/*#__PURE__*/_interopDefault(Wv);var nC__default=/*#__PURE__*/_interopDefault(nC);var iC__default=/*#__PURE__*/_interopDefault(iC);var qv__default=/*#__PURE__*/_interopDefault(qv);var rk__default=/*#__PURE__*/_interopDefault(rk);var nk__default=/*#__PURE__*/_interopDefault(nk);var ck__default=/*#__PURE__*/_interopDefault(ck);var mk__default=/*#__PURE__*/_interopDefault(mk);var gk__default=/*#__PURE__*/_interopDefault(gk);var fk__default=/*#__PURE__*/_interopDefault(fk);var Mk__default=/*#__PURE__*/_interopDefault(Mk);var Ak__default=/*#__PURE__*/_interopDefault(Ak);var Bk__default=/*#__PURE__*/_interopDefault(Bk);var Ek__default=/*#__PURE__*/_interopDefault(Ek);var Fk__default=/*#__PURE__*/_interopDefault(Fk);var cS__default=/*#__PURE__*/_interopDefault(cS);var Sw__default=/*#__PURE__*/_interopDefault(Sw);var ww__default=/*#__PURE__*/_interopDefault(ww);var Tw__default=/*#__PURE__*/_interopDefault(Tw);var Iw__default=/*#__PURE__*/_interopDefault(Iw);var Pw__default=/*#__PURE__*/_interopDefault(Pw);var gg__default=/*#__PURE__*/_interopDefault(gg);var Vw__default=/*#__PURE__*/_interopDefault(Vw);var Ow__default=/*#__PURE__*/_interopDefault(Ow);var Uw__default=/*#__PURE__*/_interopDefault(Uw);var Kw__default=/*#__PURE__*/_interopDefault(Kw);var qw__default=/*#__PURE__*/_interopDefault(qw);var f1__default=/*#__PURE__*/_interopDefault(f1);var Gg__default=/*#__PURE__*/_interopDefault(Gg);var Ug__default=/*#__PURE__*/_interopDefault(Ug);var h1__default=/*#__PURE__*/_interopDefault(h1);var E1__default=/*#__PURE__*/_interopDefault(E1);var W1__default=/*#__PURE__*/_interopDefault(W1);var K1__default=/*#__PURE__*/_interopDefault(K1);var q1__default=/*#__PURE__*/_interopDefault(q1);var _1__default=/*#__PURE__*/_interopDefault(_1);var j1__default=/*#__PURE__*/_interopDefault(j1);var Sd=Object.defineProperty;var lf=(e,t,o)=>t in e?Sd(e,t,{enumerable:true,configurable:true,writable:true,value:o}):e[t]=o;var sf=(e,t)=>()=>(e&&(t=e(e=0)),t);var cf=(e,t)=>{for(var o in t)Sd(e,o,{get:t[o],enumerable:true});};var wd=(e,t,o)=>lf(e,t+"",o);var ng={};cf(ng,{COrbCanvas:()=>iS});function iS({hue:e=0,hoverIntensity:t=.2,rotateOnHover:o=true,forceHoverState:a=false,backgroundColor:r="transparent"}){let n=vt.useRef(null),i=`
1
+ 'use strict';var ogl=require('ogl'),St=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'),au=require('@mui/material/Dialog'),ru=require('@mui/material/DialogTitle'),nu=require('@mui/material/DialogContent'),Gf=require('@mui/material/DialogContentText'),iu=require('@mui/material/DialogActions'),Yn=require('@mui/material/Box'),qf=require('@mui/icons-material/CheckCircle'),_f=require('@mui/icons-material/Warning'),jf=require('@mui/icons-material/Error'),Zf=require('@mui/icons-material/Info'),material=require('@mui/material'),styles=require('@mui/material/styles'),ch=require('@mui/icons-material/Clear'),dh=require('@mui/icons-material/Close'),Kd=require('@mui/icons-material/Search'),gx=require('@mui/material/Paper'),fx=require('@mui/material/Table'),hx=require('@mui/material/TableBody'),Vs=require('@mui/material/TableCell'),cu=require('@mui/material/TableContainer'),Oh=require('@mui/material/TableHead'),Hh=require('@mui/material/TableRow'),lu=require('@mui/material/TextField'),fl=require('@mui/material/Button'),su=require('@mui/material/Alert'),core=require('@dnd-kit/core'),modifiers=require('@dnd-kit/modifiers'),Th=require('@mui/icons-material/ViewColumn'),Qp=require('@mui/icons-material/Save'),Ph=require('@mui/icons-material/Download'),Rh=require('@mui/icons-material/AccountTree'),Dh=require('@mui/icons-material/Functions'),Mh=require('@mui/icons-material/Insights'),Ah=require('@mui/icons-material/Add'),Bh=require('@mui/icons-material/Edit'),Eh=require('@mui/icons-material/Delete'),Fh=require('@mui/icons-material/KeyboardArrowLeft'),ef=require('@mui/icons-material/KeyboardArrowRight'),Wh=require('@mui/material/Checkbox'),$h=require('@mui/material/TableSortLabel'),Gh=require('@mui/material/IconButton'),Uh=require('@mui/material/Tooltip'),Kh=require('@mui/icons-material/UnfoldMore'),qh=require('@mui/icons-material/UnfoldLess'),Qh=require('@mui/icons-material/KeyboardArrowDown'),uy=require('@mui/icons-material/Check'),my=require('@mui/icons-material/ClearAll'),jy=require('@mui/icons-material/MicNoneOutlined'),Zy=require('@mui/icons-material/SettingsOutlined'),Xy=require('@mui/icons-material/SendOutlined'),qb=require('@mui/icons-material/Settings'),_b=require('@mui/icons-material/KeyboardArrowUp'),Zb=require('@mui/icons-material/ArrowRightAlt'),yb=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'),Bb=require('@mui/icons-material/CalendarMonth'),Fb=require('@mui/icons-material/ArrowForward'),na=require('dayjs'),Lb=require('dayjs/plugin/isBetween'),zb=require('dayjs/plugin/localizedFormat');require('dayjs/locale/zh-cn'),require('dayjs/locale/fr'),require('dayjs/locale/de'),require('dayjs/locale/ja'),require('dayjs/locale/ko');var cx=require('@mui/icons-material/StarBorder'),dx=require('@mui/icons-material/ViewQuilt'),B0=require('@mui/icons-material/CloseOutlined'),Bx=require('@mui/icons-material/ContentCopyOutlined'),Ex=require('@mui/icons-material/CheckOutlined'),s0=require('@mui/icons-material/ExpandMore'),sortable=require('@dnd-kit/sortable'),Wu=require('@mui/icons-material/Language'),yv=require('@mui/icons-material/DesktopWindows'),bv=require('@mui/icons-material/DarkMode'),xv=require('@mui/icons-material/LightMode'),Cv=require('@mui/icons-material/Logout'),zC=require('@mui/icons-material/DeleteOutline'),Uv=require('@mui/icons-material/DragIndicator'),sC=require('@mui/icons-material/FilterList'),cC=require('@mui/icons-material/TableRows'),Zv=require('@mui/icons-material/LayersClear'),lk=require('@mui/icons-material/CameraAltRounded'),sk=require('@mui/icons-material/QrCodeScannerRounded'),uk=require('@mui/icons-material/DragIndicatorRounded'),hk=require('@mui/icons-material/BackspaceRounded'),yk=require('@mui/icons-material/CloseRounded'),bk=require('@mui/icons-material/CheckRounded'),Ek=require('@mui/icons-material/SearchRounded'),Fk=require('@mui/icons-material/MenuOpenRounded'),Lk=require('@mui/icons-material/MenuRounded'),zk=require('@mui/icons-material/ExpandMoreRounded'),Nk=require('@mui/icons-material/ChevronRightRounded'),uS=require('next/dynamic'),framerMotion=require('framer-motion'),Iw=require('react-markdown'),Pw=require('remark-gfm'),Rw=require('remark-math'),Dw=require('rehype-katex'),Mw=require('rehype-raw'),reactSyntaxHighlighter=require('react-syntax-highlighter'),prism=require('react-syntax-highlighter/dist/esm/styles/prism'),nextThemes=require('next-themes'),hg=require('mermaid'),Ww=require('@mui/icons-material/MicRounded'),$w=require('@mui/icons-material/MicOffRounded'),iconsMaterial=require('@mui/icons-material'),_w=require('@mui/icons-material/SendRounded'),jw=require('@mui/icons-material/AddRounded'),Zw=require('@mui/icons-material/HardwareRounded'),b1=require('@mui/icons-material/LockOutlined'),Kg=require('@mui/icons-material/MailOutline'),qg=require('@mui/icons-material/PersonOutline'),x1=require('@mui/icons-material/VpnKeyOutlined'),z1=require('dayjs/plugin/isoWeek'),j1=require('@mui/icons-material/KeyboardDoubleArrowLeftOutlined'),Z1=require('@mui/icons-material/KeyboardDoubleArrowRightOutlined'),X1=require('@mui/icons-material/SplitscreenOutlined'),Y1=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 St__namespace=/*#__PURE__*/_interopNamespace(St);var au__default=/*#__PURE__*/_interopDefault(au);var ru__default=/*#__PURE__*/_interopDefault(ru);var nu__default=/*#__PURE__*/_interopDefault(nu);var Gf__default=/*#__PURE__*/_interopDefault(Gf);var iu__default=/*#__PURE__*/_interopDefault(iu);var Yn__default=/*#__PURE__*/_interopDefault(Yn);var qf__default=/*#__PURE__*/_interopDefault(qf);var _f__default=/*#__PURE__*/_interopDefault(_f);var jf__default=/*#__PURE__*/_interopDefault(jf);var Zf__default=/*#__PURE__*/_interopDefault(Zf);var ch__default=/*#__PURE__*/_interopDefault(ch);var dh__default=/*#__PURE__*/_interopDefault(dh);var Kd__default=/*#__PURE__*/_interopDefault(Kd);var gx__default=/*#__PURE__*/_interopDefault(gx);var fx__default=/*#__PURE__*/_interopDefault(fx);var hx__default=/*#__PURE__*/_interopDefault(hx);var Vs__default=/*#__PURE__*/_interopDefault(Vs);var cu__default=/*#__PURE__*/_interopDefault(cu);var Oh__default=/*#__PURE__*/_interopDefault(Oh);var Hh__default=/*#__PURE__*/_interopDefault(Hh);var lu__default=/*#__PURE__*/_interopDefault(lu);var fl__default=/*#__PURE__*/_interopDefault(fl);var su__default=/*#__PURE__*/_interopDefault(su);var Th__default=/*#__PURE__*/_interopDefault(Th);var Qp__default=/*#__PURE__*/_interopDefault(Qp);var Ph__default=/*#__PURE__*/_interopDefault(Ph);var Rh__default=/*#__PURE__*/_interopDefault(Rh);var Dh__default=/*#__PURE__*/_interopDefault(Dh);var Mh__default=/*#__PURE__*/_interopDefault(Mh);var Ah__default=/*#__PURE__*/_interopDefault(Ah);var Bh__default=/*#__PURE__*/_interopDefault(Bh);var Eh__default=/*#__PURE__*/_interopDefault(Eh);var Fh__default=/*#__PURE__*/_interopDefault(Fh);var ef__default=/*#__PURE__*/_interopDefault(ef);var Wh__default=/*#__PURE__*/_interopDefault(Wh);var $h__default=/*#__PURE__*/_interopDefault($h);var Gh__default=/*#__PURE__*/_interopDefault(Gh);var Uh__default=/*#__PURE__*/_interopDefault(Uh);var Kh__default=/*#__PURE__*/_interopDefault(Kh);var qh__default=/*#__PURE__*/_interopDefault(qh);var Qh__default=/*#__PURE__*/_interopDefault(Qh);var uy__default=/*#__PURE__*/_interopDefault(uy);var my__default=/*#__PURE__*/_interopDefault(my);var jy__default=/*#__PURE__*/_interopDefault(jy);var Zy__default=/*#__PURE__*/_interopDefault(Zy);var Xy__default=/*#__PURE__*/_interopDefault(Xy);var qb__default=/*#__PURE__*/_interopDefault(qb);var _b__default=/*#__PURE__*/_interopDefault(_b);var Zb__default=/*#__PURE__*/_interopDefault(Zb);var yb__default=/*#__PURE__*/_interopDefault(yb);var Bb__default=/*#__PURE__*/_interopDefault(Bb);var Fb__default=/*#__PURE__*/_interopDefault(Fb);var na__default=/*#__PURE__*/_interopDefault(na);var Lb__default=/*#__PURE__*/_interopDefault(Lb);var zb__default=/*#__PURE__*/_interopDefault(zb);var cx__default=/*#__PURE__*/_interopDefault(cx);var dx__default=/*#__PURE__*/_interopDefault(dx);var B0__default=/*#__PURE__*/_interopDefault(B0);var Bx__default=/*#__PURE__*/_interopDefault(Bx);var Ex__default=/*#__PURE__*/_interopDefault(Ex);var s0__default=/*#__PURE__*/_interopDefault(s0);var Wu__default=/*#__PURE__*/_interopDefault(Wu);var yv__default=/*#__PURE__*/_interopDefault(yv);var bv__default=/*#__PURE__*/_interopDefault(bv);var xv__default=/*#__PURE__*/_interopDefault(xv);var Cv__default=/*#__PURE__*/_interopDefault(Cv);var zC__default=/*#__PURE__*/_interopDefault(zC);var Uv__default=/*#__PURE__*/_interopDefault(Uv);var sC__default=/*#__PURE__*/_interopDefault(sC);var cC__default=/*#__PURE__*/_interopDefault(cC);var Zv__default=/*#__PURE__*/_interopDefault(Zv);var lk__default=/*#__PURE__*/_interopDefault(lk);var sk__default=/*#__PURE__*/_interopDefault(sk);var uk__default=/*#__PURE__*/_interopDefault(uk);var hk__default=/*#__PURE__*/_interopDefault(hk);var yk__default=/*#__PURE__*/_interopDefault(yk);var bk__default=/*#__PURE__*/_interopDefault(bk);var Ek__default=/*#__PURE__*/_interopDefault(Ek);var Fk__default=/*#__PURE__*/_interopDefault(Fk);var Lk__default=/*#__PURE__*/_interopDefault(Lk);var zk__default=/*#__PURE__*/_interopDefault(zk);var Nk__default=/*#__PURE__*/_interopDefault(Nk);var uS__default=/*#__PURE__*/_interopDefault(uS);var Iw__default=/*#__PURE__*/_interopDefault(Iw);var Pw__default=/*#__PURE__*/_interopDefault(Pw);var Rw__default=/*#__PURE__*/_interopDefault(Rw);var Dw__default=/*#__PURE__*/_interopDefault(Dw);var Mw__default=/*#__PURE__*/_interopDefault(Mw);var hg__default=/*#__PURE__*/_interopDefault(hg);var Ww__default=/*#__PURE__*/_interopDefault(Ww);var $w__default=/*#__PURE__*/_interopDefault($w);var _w__default=/*#__PURE__*/_interopDefault(_w);var jw__default=/*#__PURE__*/_interopDefault(jw);var Zw__default=/*#__PURE__*/_interopDefault(Zw);var b1__default=/*#__PURE__*/_interopDefault(b1);var Kg__default=/*#__PURE__*/_interopDefault(Kg);var qg__default=/*#__PURE__*/_interopDefault(qg);var x1__default=/*#__PURE__*/_interopDefault(x1);var z1__default=/*#__PURE__*/_interopDefault(z1);var j1__default=/*#__PURE__*/_interopDefault(j1);var Z1__default=/*#__PURE__*/_interopDefault(Z1);var X1__default=/*#__PURE__*/_interopDefault(X1);var Y1__default=/*#__PURE__*/_interopDefault(Y1);var Td=Object.defineProperty;var df=(e,t,o)=>t in e?Td(e,t,{enumerable:true,configurable:true,writable:true,value:o}):e[t]=o;var pf=(e,t)=>()=>(e&&(t=e(e=0)),t);var uf=(e,t)=>{for(var o in t)Td(e,o,{get:t[o],enumerable:true});};var Id=(e,t,o)=>df(e,t+"",o);var lg={};uf(lg,{COrbCanvas:()=>cS});function cS({hue:e=0,hoverIntensity:t=.2,rotateOnHover:o=true,forceHoverState:a=false,backgroundColor:r="transparent"}){let n=St.useRef(null),i=`
2
2
  precision highp float;
3
3
  attribute vec2 position;
4
4
  attribute vec2 uv;
@@ -180,20 +180,20 @@
180
180
  vec4 col = mainImage(fragCoord);
181
181
  gl_FragColor = vec4(col.rgb * col.a, col.a);
182
182
  }
183
- `;return vt.useEffect(()=>{let d=n.current;if(!d)return;let s=new ogl.Renderer({alpha:true,premultipliedAlpha:false}),l=s.gl;l.clearColor(0,0,0,0),d.appendChild(l.canvas);let g=new ogl.Triangle(l),f=new ogl.Program(l,{vertex:i,fragment:c,uniforms:{iTime:{value:0},iResolution:{value:new ogl.Vec3(l.canvas.width,l.canvas.height,l.canvas.width/l.canvas.height)},hue:{value:e},hover:{value:0},rot:{value:0},hoverIntensity:{value:t},backgroundColor:{value:rg(r)}}}),u=new ogl.Mesh(l,{geometry:g,program:f});function h(){if(!d)return;let R=window.devicePixelRatio||1,k=d.clientWidth,A=d.clientHeight;s.setSize(k*R,A*R),l.canvas.style.width=k+"px",l.canvas.style.height=A+"px",f.uniforms.iResolution.value.set(l.canvas.width,l.canvas.height,l.canvas.width/l.canvas.height);}window.addEventListener("resize",h),h();let w=0,p=0,C=0,m=.3,y=R=>{let k=d.getBoundingClientRect(),A=R.clientX-k.left,P=R.clientY-k.top,v=k.width,M=k.height,S=Math.min(v,M),I=v/2,D=M/2,G=(A-I)/S*2,V=(P-D)/S*2;Math.sqrt(G*G+V*V)<.8?w=1:w=0;},b=()=>{w=0;};d.addEventListener("mousemove",y),d.addEventListener("mouseleave",b);let T,B=R=>{T=requestAnimationFrame(B);let k=(R-p)*.001;p=R,f.uniforms.iTime.value=R*.001,f.uniforms.hue.value=e,f.uniforms.hoverIntensity.value=t,f.uniforms.backgroundColor.value=rg(r);let A=a?1:w;f.uniforms.hover.value+=(A-f.uniforms.hover.value)*.1,o&&A>.5&&(C+=k*m),f.uniforms.rot.value=C,s.render({scene:u});};return T=requestAnimationFrame(B),()=>{cancelAnimationFrame(T),window.removeEventListener("resize",h),d.removeEventListener("mousemove",y),d.removeEventListener("mouseleave",b),l.canvas.parentNode===d&&d.removeChild(l.canvas),l.getExtension("WEBGL_lose_context")?.loseContext();}},[e,t,o,a,r]),jsxRuntime.jsx("div",{ref:n,className:"w-full h-full"})}function lS(e,t,o){let a,r,n;if(t===0)a=r=n=o;else {let i=(s,l,g)=>(g<0&&(g+=1),g>1&&(g-=1),g<.16666666666666666?s+(l-s)*6*g:g<.5?l:g<.6666666666666666?s+(l-s)*(.6666666666666666-g)*6:s),c=o<.5?o*(1+t):o+t-o*t,d=2*o-c;a=i(d,c,e+1/3),r=i(d,c,e),n=i(d,c,e-1/3);}return new ogl.Vec3(a,r,n)}function rg(e){if(e==="transparent")return new ogl.Vec3(0,0,0);if(e.startsWith("#")){let a=parseInt(e.slice(1,3),16)/255,r=parseInt(e.slice(3,5),16)/255,n=parseInt(e.slice(5,7),16)/255;return new ogl.Vec3(a,r,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 a=parseInt(o[1])/360,r=parseInt(o[2])/100,n=parseInt(o[3])/100;return lS(a,r,n)}return new ogl.Vec3(0,0,0)}var ig=sf(()=>{"use client";});function ko(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var Ss={primary:"#000000",primaryHover:"#333333"},Di={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"},Mn={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",full:"rounded-full"},Td=()=>"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 gf=classVarianceAuthority.cva(Td(),{variants:{variant:{default:`${Di.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:`${Di.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:Di.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-[${Ss.primary}] hover:bg-[${Ss.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:Mn.none,sm:Mn.sm,md:Mn.md,full:Mn.full}},defaultVariants:{variant:"default",size:"default",rounded:"md"}}),ws=vt__namespace.forwardRef(({className:e,variant:t,size:o,asChild:a=false,...r},n)=>jsxRuntime.jsx(a?reactSlot.Slot:"button",{className:ko(gf({variant:t,size:o,className:e})),ref:n,...r}));ws.displayName="Button";var hf={"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.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}","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","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"},yf={"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.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}","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","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"},bf={"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.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}","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","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"},xf={"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.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","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","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"},vf={"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.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","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","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"},Cf={"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.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","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","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"},An={en:hf,zh:yf,fr:bf,de:xf,ja:vf,ko:Cf};var Pd=(e,t)=>t?e.replace(/\{(\w+)\}/g,(o,a)=>{let r=t[a];return r==null?"":String(r)}):e,Tf={locale:"en",t:(e,t)=>Pd(An.en[e]||e,t)},Rd=vt.createContext(Tf),Mi=({locale:e="en",messages:t,children:o})=>{let a=vt.useMemo(()=>{let r=An[e]||An.en,n=t?.[e]||{},i={...An.en,...r,...n};return {locale:e,t:(c,d)=>Pd(i[c]||c,d)}},[e,t]);return jsxRuntime.jsx(Rd.Provider,{value:a,children:o})},ee=()=>vt.useContext(Rd);function Is({items:e,onItemClick:t,className:o="",level:a=0,expandedIds:r,onToggleExpand:n,colorMode:i="light"}){let{t:c}=ee(),d=i==="dark",s=navigation.usePathname(),[l,g]=vt.useState(false),[f,u]=vt.useState(new Set),h=r!==void 0&&n!==void 0,w=h?r:f;vt.useEffect(()=>{g(true);},[]);let p=m=>{if(h)n(m);else {let y=new Set(f);y.has(m)?y.delete(m):y.add(m),u(y);}},C=m=>{m.children&&m.children.length>0&&p(m.id),t&&t(m);};return !e||!Array.isArray(e)?jsxRuntime.jsx("div",{className:ko("tree-menu",o),children:jsxRuntime.jsx("div",{className:"text-sm text-gray-500 p-2",children:c("navigation.noItems")})}):jsxRuntime.jsx("div",{className:ko("tree-menu",o),children:e.map(m=>{let y=w.has(m.id)||m.isExpanded,b=m.children&&m.children.length>0,T=m.appurl||m.href,B=l&&T?s===T:false;return jsxRuntime.jsxs("div",{className:"tree-menu-item relative",children:[B&&jsxRuntime.jsx("div",{className:ko("absolute left-0 top-2 bottom-2 w-[3px] rounded-r-full z-10",d?"bg-[#90caf9]":"bg-[#1976d2]")}),jsxRuntime.jsxs(ws,{variant:"ghost",className:ko("w-full justify-start gap-2 h-auto py-2 relative overflow-hidden group",`ml-${a*4}`,B?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"),onClick:()=>C(m),children:[b&&jsxRuntime.jsx("div",{className:ko("flex-shrink-0 transition-transform duration-200",y&&"rotate-90",B?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"})}),!b&&jsxRuntime.jsx("div",{className:"w-4 h-4 flex-shrink-0"}),m.icon&&jsxRuntime.jsx("div",{className:ko("flex-shrink-0 transition-colors duration-200",B?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:ko("text-sm truncate transition-colors duration-200",B?"font-semibold":"font-medium"),children:m.title||m.label}),m.description&&jsxRuntime.jsx("div",{className:ko("text-xs truncate transition-colors duration-200",B?d?"text-[#90caf9]/70":"text-[#1976d2]/75":d?"text-gray-400":"text-gray-500"),title:m.description,children:m.description})]})]}),b&&jsxRuntime.jsx("div",{className:ko("grid transition-[grid-template-rows] duration-300 ease-in-out",y?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:jsxRuntime.jsx("div",{className:"overflow-hidden",children:jsxRuntime.jsx(Is,{items:m.children,onItemClick:t,level:a+1,expandedIds:r,onToggleExpand:n,colorMode:i})})})]},m.id)})})}var Fd=({collapsed:e,onToggle:t,className:o="",maxHeight:a,menuData:r=[],colorMode:n="light"})=>{let{t:i}=ee(),c=n==="dark",d=navigation.useRouter(),[s,l]=vt.useState(""),[g,f]=vt.useState(new Set);vt.useEffect(()=>{e&&f(new Set);},[e]);let u=vt.useCallback(C=>{let m=[],y=b=>{b.forEach(T=>{m.push(T.id),T.children&&y(T.children);});};return y(C),m},[]),h=vt.useMemo(()=>{if(!s.trim())return r;let C=m=>m.reduce((y,b)=>{let T=b.title?.toLowerCase().includes(s.toLowerCase())||b.description?.toLowerCase().includes(s.toLowerCase()),B=b.children?C(b.children):[];return (T||B.length>0)&&y.push({...b,children:B.length>0?B:b.children}),y},[]);return C(r)},[s,r]),w=vt.useMemo(()=>s.trim()?new Set(u(r)):g,[s,r,g,u]),p=vt.useCallback(async C=>{if(console.log("\u{1F5B1}\uFE0F \u5BFC\u822A\u83DC\u5355\u9879\u70B9\u51FB:",C),C.id==="chat"||C.appurl==="/chat"){console.log("\u{1F4AC} \u68C0\u6D4B\u5230chat\u83DC\u5355\u70B9\u51FB\uFF0C\u8DF3\u8F6C\u5230\u65B0\u7684\u804A\u5929\u89C6\u56FE");try{d.push("/chat?new=true");}catch(y){console.error("\u274C \u65E0\u6CD5\u8DF3\u8F6C\u5230\u65B0\u804A\u5929\u89C6\u56FE:",y),d.push("/chat");}return}let m=C.appurl||C.href;m&&(m.startsWith("http://")||m.startsWith("https://")?window.open(m,"_blank"):d.push(m));},[d]);return jsxRuntime.jsxs("div",{className:`flex flex-col backdrop-blur-xl border shadow-[0_4px_8px_0_rgba(31,38,135,0.1)] ${e?"w-14 rounded-full":"w-[234px] rounded-2xl"} relative ${o} ${c?"bg-[#111111] border-white/10":"bg-white/70 border-white/30"}`,style:{backdropFilter:"blur(16px) saturate(180%)",WebkitBackdropFilter:"blur(16px) saturate(180%)",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",maxHeight:a?`${a}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 ${c?"text-gray-300 hover:bg-gray-800":"text-gray-500 hover:bg-gray-50"}`,title:i("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:i("navigation.searchPlaceholder"),value:s,onChange:C=>l(C.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 ${c?"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 ${c?"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:h.length===0?jsxRuntime.jsx("div",{className:"flex items-center justify-center py-8 text-gray-500 text-sm",children:e?"\u{1F4C2}":i(s?"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(Is,{items:h,onItemClick:p,className:"space-y-1",expandedIds:w,colorMode:n,onToggleExpand:C=>{let m=new Set(g);h.some(b=>b.id===C)?m.has(C)?m.delete(C):(h.forEach(b=>{b.id!==C&&m.has(b.id)&&m.delete(b.id);}),m.add(C)):m.has(C)?m.delete(C):m.add(C),f(m);}})}),e&&jsxRuntime.jsx("div",{className:"space-y-2",children:r.map(C=>jsxRuntime.jsx("div",{className:"space-y-1",children:jsxRuntime.jsx("button",{onClick:()=>{t();let m=new Set([C.id]);f(m);},className:`w-full flex items-center justify-center p-2 rounded-lg cursor-pointer transition-colors duration-200 ${c?"text-gray-400 hover:bg-gray-800":"text-gray-600 hover:bg-gray-50"}`,title:i("navigation.expandView",{title:C.title||""}),children:C.icon||jsxRuntime.jsx("div",{className:`w-6 h-6 rounded text-xs flex items-center justify-center font-medium ${c?"bg-[#90caf9] text-[#0b0b0b]":"bg-[#1976d2] text-white"}`,children:C.title?.charAt(0)||"?"})})},C.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 ${c?"hover:bg-gray-800/50":"hover:bg-white/20"}`,title:i("navigation.collapse"),children:jsxRuntime.jsx("div",{className:"absolute",style:{bottom:"0px",right:"0px",width:"16px",height:"16px",overflow:"hidden"},children:jsxRuntime.jsx("div",{className:c?"border-yellow-400":"",style:{width:"32px",height:"32px",borderRadius:"16px",border:"3px solid #21BCFF",backgroundColor:"transparent",position:"absolute",top:"-16px",left:"-16px"}})})})]})};var zd=(e={})=>{let{initialCollapsed:t=false,content:o=[]}=e,[a,r]=vt.useState(t),[n,i]=vt.useState(o),c=vt.useCallback(()=>{r(s=>!s);},[]),d=vt.useMemo(()=>({collapsed:a,onToggle:c,menuData:n}),[a,c,n]);return {collapsed:a,setCollapsed:r,toggleCollapsed:c,menuData:n,setMenuData:i,navigationIslandProps:d}};var Bo=e=>jsxRuntime.jsx(material.Button,{...e,variant:e.variant||"contained",size:e.size||"medium",sx:{textTransform:"none",...e.sx}});var Rs=class{constructor(){wd(this,"listener",null);}register(t){this.listener=t;}unregister(){this.listener=null;}show(t,o,a){this.listener&&this.listener({type:t,content:o,options:a});}hide(){this.listener&&this.listener(null);}},ca=new Rs,XT={success:(e,t)=>ca.show("success",e,t),error:(e,t)=>ca.show("error",e,t),warning:(e,t)=>ca.show("warning",e,t),info:(e,t)=>ca.show("info",e,t),show:(e,t,o)=>ca.show(e,t,o),hide:()=>ca.hide()};var _f={success:{icon:jsxRuntime.jsx(Gf__default.default,{sx:{fontSize:40}}),color:"#e8f5e9",iconColor:"#66bb6a",borderColor:"#a5d6a7"},warning:{icon:jsxRuntime.jsx(Uf__default.default,{sx:{fontSize:40}}),color:"#fff3e0",iconColor:"#ffa726",borderColor:"#ffcc80"},error:{icon:jsxRuntime.jsx(Kf__default.default,{sx:{fontSize:40}}),color:"#ffebee",iconColor:"#ef5350",borderColor:"#ef9a9a"},info:{icon:jsxRuntime.jsx(qf__default.default,{sx:{fontSize:40}}),color:"#e3f2fd",iconColor:"#42a5f5",borderColor:"#90caf9"},default:{icon:null,color:"transparent",iconColor:"inherit",borderColor:"transparent"}},Bn=({open:e,title:t,message:o,onClose:a,onConfirm:r,confirmText:n,cancelText:i,showCancel:c=true,maxWidth:d="xs",type:s="default"})=>{let{t:l}=ee(),g=n||l("messageBox.confirm"),f=i||l("messageBox.cancel"),u=()=>{r?r():a();},h=_f[s],w=s!=="default";return jsxRuntime.jsxs(tu__default.default,{open:e,onClose:a,maxWidth:d,fullWidth:true,PaperProps:{sx:{borderRadius:3,...w&&{borderTop:`6px solid ${h.iconColor}`}}},children:[w&&jsxRuntime.jsx(Yn__default.default,{sx:{display:"flex",justifyContent:"center",pt:3,color:h.iconColor},children:h.icon}),t&&jsxRuntime.jsx(ou__default.default,{sx:{textAlign:w?"center":"left",pt:w?1:2},children:t}),jsxRuntime.jsx(au__default.default,{sx:{textAlign:w?"center":"left"},children:typeof o=="string"?jsxRuntime.jsx(Hf__default.default,{children:o}):o}),jsxRuntime.jsxs(ru__default.default,{sx:{justifyContent:w?"center":"flex-end",pb:3,px:3},children:[c&&jsxRuntime.jsx(Bo,{onClick:a,variant:"text",color:"inherit",children:f}),jsxRuntime.jsx(Bo,{onClick:u,variant:"contained",sx:{bgcolor:w?h.iconColor:void 0,"&:hover":{bgcolor:w?h.iconColor:void 0,filter:"brightness(0.9)"}},autoFocus:true,children:g})]})]})},mI=()=>{let[e,t]=vt__namespace.default.useState(null),[o,a]=vt__namespace.default.useState(false);vt__namespace.default.useEffect(()=>{let i=c=>{c?(t(c),a(true)):(a(false),t(null));};return ca.register(i),()=>ca.unregister()},[]);let r=()=>{a(false),e?.options?.onClose&&e.options.onClose(),t(null);},n=()=>{e?.options?.onConfirm&&e.options.onConfirm(),a(false),t(null);};return e?jsxRuntime.jsx(Bn,{open:o,type:e.type,message:e.content,title:e.options?.title,onClose:r,onConfirm:n,confirmText:e.options?.confirmText,cancelText:e.options?.cancelText,showCancel:e.options?.showCancel,maxWidth:e.options?.maxWidth}):null};var sh=[{field:"value",label:"Value",minWidth:120},{field:"label",label:"Description",minWidth:180}],Ud=e=>Array.isArray(e)?e:e==null||e===""?[]:[e],jo=e=>String(e),Kd=(e,t)=>e[t],qd=e=>{let t=e.value??e.id??e.key??e.code;return typeof t=="number"||typeof t=="string"?t:""},ch=e=>{let t=e.label??e.description??e.name??e.title;return String(typeof t=="number"||typeof t=="string"?t:qd(e))},dh=e=>{let t=e.description??e.subtitle;return typeof t=="number"||typeof t=="string"?String(t):void 0},_d=({value:e=null,items:t=[],columns:o,mode:a="single",dialogTitle:r="Value Help",searchPlaceholder:n="Search values...",selectLabel:i="Select",clearLabel:c="Clear",cancelLabel:d="Cancel",valueHelpLabel:s="Open value help",noResultsText:l="No matching values",loading:g=false,clearable:f=true,selectedItems:u=[],displayValue:h,getOptionValue:w=qd,getOptionLabel:p=ch,getOptionDescription:C=dh,onChange:m,onSearch:y,disabled:b,InputProps:T,onKeyDown:B,...R})=>{let k=a==="multiple",[A,P]=vt.useState(false),[v,M]=vt.useState(""),[S,I]=vt.useState(null),[D,G]=vt.useState(false),[V,X]=vt.useState(()=>Ud(e)),de=vt.useMemo(()=>o&&o.length>0?o:sh,[o]),oe=S??t,re=vt.useMemo(()=>{let j=[...u,...t,...S??[]],pe=new Map;return j.forEach(De=>{pe.set(jo(w(De)),De);}),pe},[w,t,S,u]),_=vt.useMemo(()=>Ud(e),[e]);vt.useEffect(()=>{A||X(_);},[A,_]);let qe=vt.useMemo(()=>{let j=v.trim().toLowerCase();if(!j||y)return oe;let pe=de.filter(De=>De.searchable!==false);return oe.filter(De=>[w(De),p(De),C(De),...pe.map(We=>Kd(De,We.field))].some(We=>String(We??"").toLowerCase().includes(j)))},[oe,C,p,w,y,v,de]),it=vt.useMemo(()=>{if(h!==void 0)return h;if(_.length===0)return "";let j=pe=>{let De=re.get(jo(pe));if(!De)return String(pe);let Le=p(De);return Le&&Le!==String(pe)?`${pe} - ${Le}`:String(pe)};return k?_.length>2?`${_.length} selected`:_.map(j).join(", "):j(_[0])},[h,p,k,re,_]),Y=vt.useCallback(async()=>{if(y){G(true);try{let j=await y(v);Array.isArray(j)&&I(j);}finally{G(false);}}},[y,v]),le=()=>{b||(X(_),P(true));},Be=()=>{P(false);},Ee=()=>{m?.(k?[]:null,k?[]:null),X([]);},Ue=j=>{let pe=w(j);if(k){X(De=>De.some(We=>jo(We)===jo(pe))?De.filter(We=>jo(We)!==jo(pe)):[...De,pe]);return}X([pe]);},ot=()=>{let j=V.map(pe=>re.get(jo(pe))).filter(pe=>!!pe);k?m?.(V,j):m?.(V[0]??null,j[0]??null),P(false);},Fe=j=>{if(j.key==="F4"){j.preventDefault(),le();return}B?.(j);},_e=g||D,ht=_.length>0;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.TextField,{...R,disabled:b,value:it,onKeyDown:Fe,InputProps:{...T,readOnly:true,endAdornment:jsxRuntime.jsxs(material.InputAdornment,{position:"end",children:[_e?jsxRuntime.jsx(material.CircularProgress,{size:18}):null,f&&ht&&!b?jsxRuntime.jsx(material.Tooltip,{title:c,children:jsxRuntime.jsx(material.IconButton,{size:"small",edge:"end","aria-label":c,onClick:Ee,children:jsxRuntime.jsx(ih__default.default,{fontSize:"small"})})}):null,jsxRuntime.jsx(material.Tooltip,{title:s,children:jsxRuntime.jsx("span",{children:jsxRuntime.jsx(material.IconButton,{size:"small",edge:"end","aria-label":s,onClick:le,disabled:b,children:jsxRuntime.jsx(Gd__default.default,{fontSize:"small"})})})})]})}}),jsxRuntime.jsxs(material.Dialog,{open:A,onClose:Be,fullWidth:true,maxWidth:"md",PaperProps:{sx:j=>({borderRadius:2,overflow:"hidden",border:`1px solid ${j.palette.divider}`,boxShadow:j.palette.mode==="dark"?`0 24px 80px ${styles.alpha(j.palette.common.black,.72)}`:`0 24px 80px ${styles.alpha(j.palette.common.black,.18)}`})},children:[jsxRuntime.jsxs(material.DialogTitle,{sx:j=>({display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,px:2.5,py:2,pr:1.5,borderBottom:`1px solid ${j.palette.divider}`,bgcolor:j.palette.background.paper}),children:[jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1.05rem",fontWeight:800,lineHeight:1.25},children:r}),k?jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",sx:{mt:.25},children:`${V.length} selected`}):null]}),jsxRuntime.jsx(material.IconButton,{"aria-label":"Close",onClick:Be,size:"small",children:jsxRuntime.jsx(lh__default.default,{fontSize:"small"})})]}),jsxRuntime.jsxs(material.DialogContent,{sx:{p:0},children:[jsxRuntime.jsxs(material.Stack,{direction:{xs:"column",sm:"row"},spacing:1,sx:j=>({px:2.5,py:1.5,borderBottom:`1px solid ${j.palette.divider}`,bgcolor:j.palette.mode==="dark"?styles.alpha(j.palette.common.white,.025):styles.alpha(j.palette.primary.main,.035)}),children:[jsxRuntime.jsx(material.TextField,{size:"small",fullWidth:true,value:v,placeholder:n,onChange:j=>M(j.target.value),onKeyDown:j=>{j.key==="Enter"&&(j.preventDefault(),Y());},InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(Gd__default.default,{fontSize:"small"})}),sx:j=>({borderRadius:1,bgcolor:j.palette.background.paper,"& fieldset":{borderColor:styles.alpha(j.palette.text.primary,j.palette.mode==="dark"?.2:.16)},"&:hover fieldset":{borderColor:styles.alpha(j.palette.primary.main,.52)},"&.Mui-focused fieldset":{borderColor:j.palette.primary.main}})}}),y?jsxRuntime.jsx(material.Button,{variant:"outlined",onClick:()=>{Y();},disabled:_e,sx:{minWidth:96,textTransform:"none",fontWeight:700},children:_e?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:j=>({bgcolor:j.palette.mode==="dark"?"#111111":j.palette.background.paper,borderBottom:`1px solid ${j.palette.divider}`})}),de.map(j=>jsxRuntime.jsx(material.TableCell,{align:j.align,sx:pe=>({minWidth:j.minWidth,width:j.width,fontSize:"0.78rem",fontWeight:800,bgcolor:pe.palette.mode==="dark"?"#111111":pe.palette.background.paper,borderBottom:`1px solid ${pe.palette.divider}`}),children:j.label},String(j.field)))]})}),jsxRuntime.jsxs(material.TableBody,{children:[qe.map(j=>{let pe=w(j),De=V.some(Le=>jo(Le)===jo(pe));return jsxRuntime.jsxs(material.TableRow,{hover:true,selected:De,onClick:()=>Ue(j),onDoubleClick:()=>{k||(X([pe]),m?.(pe,j),P(false));},sx:Le=>({cursor:"pointer","&.Mui-selected":{bgcolor:styles.alpha(Le.palette.primary.main,Le.palette.mode==="dark"?.22:.12)},"&.Mui-selected:hover":{bgcolor:styles.alpha(Le.palette.primary.main,Le.palette.mode==="dark"?.28:.18)}}),children:[jsxRuntime.jsx(material.TableCell,{padding:"checkbox",children:jsxRuntime.jsx(material.Checkbox,{size:"small",checked:De})}),de.map(Le=>{let We=Kd(j,Le.field);return jsxRuntime.jsx(material.TableCell,{align:Le.align,sx:{fontSize:"0.82rem",py:1},children:Le.render?Le.render(We,j):String(We??"")},String(Le.field))})]},jo(pe))}),qe.length===0?jsxRuntime.jsx(material.TableRow,{children:jsxRuntime.jsx(material.TableCell,{colSpan:de.length+1,children:jsxRuntime.jsx(material.Box,{sx:{py:5,textAlign:"center",color:"text.secondary"},children:l})})}):null]})]})})]}),jsxRuntime.jsxs(material.DialogActions,{sx:j=>({px:2.5,py:1.5,borderTop:`1px solid ${j.palette.divider}`,bgcolor:j.palette.background.paper,"& .MuiButton-root":{textTransform:"none",fontWeight:700}}),children:[f&&(ht||V.length>0)?jsxRuntime.jsx(material.Button,{onClick:Ee,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:ot,disabled:!k&&V.length===0,children:i})]})]})]})};var jd=({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 Bi=e=>{let{t}=ee(),o="0.85rem",a=Array.isArray(e.actions)?e.actions:e.actions?[e.actions]:[],r=Array.isArray(e.extraTools)?e.extraTools:e.extraTools?[e.extraTools]:[],n=[...a,...r],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,s=Math.max(0,typeof e.page=="number"?e.page:0),l=i===-1?1:Math.max(1,Math.ceil(d/i)),g=Math.min(s+1,l),f=s>0,u=s<l-1&&i!==-1;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:h=>e.setFilterText(h.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(Gd__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:h=>e.onRowsPerPageChange?.(Number(h.target.value)),sx:{fontSize:o,fontWeight:600,color:"text.primary",minWidth:64,"& .MuiSelect-select":{py:.25,pr:"16px !important"},"& .MuiSvgIcon-root":{color:"text.primary"}},children:c.map(h=>jsxRuntime.jsx(material.MenuItem,{value:h,sx:{fontSize:o},children:h===-1?t("common.all"):h},`rows-per-page-${h}`))}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>e.onPageChange?.(Math.max(s-1,0)),disabled:!f,sx:{p:.35,color:"text.primary"},children:jsxRuntime.jsx(Ah__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:o,fontWeight:600,minWidth:88,textAlign:"center",color:"text.primary"},children:t("table.toolbar.pageOf",{current:g,total:l})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>e.onPageChange?.(Math.min(s+1,l-1)),disabled:!u,sx:{p:.35,color:"text.primary"},children:jsxRuntime.jsx(Bh__default.default,{fontSize:"small"})})]}),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((h,w)=>jsxRuntime.jsx(vt__namespace.default.Fragment,{children:h},`toolbar-custom-${w}`))}),jsxRuntime.jsx(material.Box,{sx:{width:"1px",height:20,bgcolor:"divider",mx:.5}}),jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.groupBy"),children:jsxRuntime.jsx(material.IconButton,{sx:{color:"text.primary"},onClick:h=>e.setGroupAnchorEl(h.currentTarget),children:jsxRuntime.jsx(material.Badge,{badgeContent:e.grouping?.length,color:"primary",children:jsxRuntime.jsx(Th__default.default,{})})})}),jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.summary"),children:jsxRuntime.jsx(material.IconButton,{sx:{color:e.showSummary?"primary.main":"text.primary"},onClick:h=>e.setSummaryAnchorEl(h.currentTarget),children:jsxRuntime.jsx(Ih__default.default,{})})}),jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.columns"),children:jsxRuntime.jsx(material.IconButton,{sx:{color:"text.primary"},onClick:h=>e.setAnchorEl(h.currentTarget),children:jsxRuntime.jsx(kh__default.default,{})})}),jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.export"),children:jsxRuntime.jsx(material.IconButton,{sx:{color:"text.primary"},onClick:e.handleExport,children:jsxRuntime.jsx(wh__default.default,{})})}),e.showCreateButton&&jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.newItem"),children:jsxRuntime.jsx(material.IconButton,{onClick:e.onOpenCreateDialog,color:"primary",children:jsxRuntime.jsx(Rh__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,children:jsxRuntime.jsx(Dh__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,children:jsxRuntime.jsx(Mh__default.default,{})})})}),e.onOpenGraphReport&&jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.graphicReport"),children:jsxRuntime.jsx(material.IconButton,{sx:{color:"text.primary"},onClick:e.onOpenGraphReport,children:jsxRuntime.jsx(Ph__default.default,{})})}),e.onLayoutSave&&!e.layoutManager&&jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.saveLayout"),children:jsxRuntime.jsx(material.IconButton,{sx:{color:"text.primary"},onClick:h=>e.onLayoutSave(h),children:jsxRuntime.jsx(Xp__default.default,{})})}),e.layoutManager]})]})};var Ei=e=>{let{t}=ee(),{onSelectAllClick:o,order:a,orderBy:r,numSelected:n=0,rowCount:i=0,onRequestSort:c,columns:d,visibleColumns:s,selectionMode:l,grouping:g=[],isAllExpanded:f=false,handleToggleAll:u,onColumnResize:h,columnWidths:w}=e,[p,C]=vt.useState(null),m=vt.useRef(null),y=v=>M=>{p||c(v);},b=(v,M,S)=>{v.preventDefault(),v.stopPropagation(),C(M),m.current={startX:v.clientX,startWidth:S,colId:M},document.addEventListener("mousemove",T),document.addEventListener("mouseup",B),document.body.style.cursor="col-resize";},T=v=>{if(!m.current)return;let{startX:M,startWidth:S,colId:I}=m.current,D=v.clientX-M,G=Math.max(50,S+D);h&&h(I,G);},B=()=>{C(null),m.current=null,document.removeEventListener("mousemove",T),document.removeEventListener("mouseup",B),document.body.style.cursor="";};vt.useEffect(()=>()=>{document.removeEventListener("mousemove",T),document.removeEventListener("mouseup",B);},[]);let R=l==="multiple"||l==="single",k=g.length>0&&!!u,A=t(f?"table.group.collapseAll":"table.group.expandAll"),P=d.filter(v=>s.includes(v.id));return jsxRuntime.jsx(zh__default.default,{children:jsxRuntime.jsxs(Nh__default.default,{children:[R&&jsxRuntime.jsx(zs__default.default,{padding:"checkbox",sx:v=>({width:48,position:"sticky",top:0,zIndex:4,backgroundColor:v.palette.mode==="dark"?"#000000":"#f5f5f5",color:v.palette.mode==="dark"?"#ffffff":v.palette.text.primary}),children:jsxRuntime.jsx(Vh__default.default,{color:"primary",indeterminate:n>0&&n<i,checked:i>0&&n===i,onChange:o,disabled:l==="single"})}),k&&jsxRuntime.jsx(zs__default.default,{align:"center",padding:"checkbox",sx:v=>({width:44,position:"sticky",top:0,zIndex:4,backgroundColor:v.palette.mode==="dark"?"#000000":"#f5f5f5",color:v.palette.mode==="dark"?"#ffffff":v.palette.text.primary}),children:jsxRuntime.jsx(Wh__default.default,{title:A,children:jsxRuntime.jsx(Hh__default.default,{size:"small",onClick:v=>{v.stopPropagation(),u?.(!f);},sx:{p:.2},children:f?jsxRuntime.jsx(Gh__default.default,{fontSize:"small"}):jsxRuntime.jsx($h__default.default,{fontSize:"small"})})})}),P.map(v=>{let M=w?.[v.id]||v.minWidth||100;return jsxRuntime.jsxs(zs__default.default,{align:"left",padding:v.disablePadding?"none":"normal",sortDirection:r===v.id?a:false,style:{width:M,minWidth:M,maxWidth:M},sx:S=>({position:"sticky",top:0,zIndex:4,backgroundColor:S.palette.mode==="dark"?"#000000":"#f5f5f5",color:S.palette.mode==="dark"?"#ffffff":S.palette.text.primary,fontWeight:"bold",userSelect:"none"}),children:[jsxRuntime.jsx(Oh__default.default,{active:r===v.id,direction:r===v.id?a:"asc",onClick:y(v.id),sx:S=>({"&.MuiTableSortLabel-root":{width:"100%"},"& .MuiTableSortLabel-icon":{color:S.palette.mode==="dark"?"#ffffff":S.palette.text.primary,opacity:r===v.id?1:0,transition:"opacity 0.2s"},"&:hover .MuiTableSortLabel-icon":{opacity:.5},"&.Mui-active .MuiTableSortLabel-icon":{opacity:1,color:S.palette.mode==="dark"?"#ffffff":S.palette.text.primary},fontWeight:"bold",fontSize:"0.85rem",color:S.palette.mode==="dark"?"#ffffff":S.palette.text.primary}),children:jsxRuntime.jsx(Yn__default.default,{component:"span",sx:{overflow:"visible",textOverflow:"clip",whiteSpace:"normal",lineHeight:1.2,wordBreak:"break-word",pr:1},children:v.label})}),jsxRuntime.jsx(Yn__default.default,{onMouseDown:S=>b(S,v.id,typeof M=="number"?M:100),onClick:S=>S.stopPropagation(),sx:{position:"absolute",right:0,top:0,bottom:0,width:5,cursor:"col-resize","&:hover":{backgroundColor:"primary.main",opacity:.5},zIndex:1}})]},v.id)})]})})};var ep=e=>{let{t}=ee(),{visibleRows:o,visibleColumns:a,selected:r=[],handleClick:n,columns:i,toggleGroupExpand:c,expandedGroups:d=new Set,selectionMode:s,grouping:l=[],isGroupFullyExpanded:g,handleExpandGroupRecursively:f,handleCollapseGroupRecursively:u}=e,h=m=>r.indexOf(m)!==-1,w=s==="multiple"||s==="single",p=l.length>0,C=a.length+(w?1:0)+(p?1:0);return jsxRuntime.jsxs(material.TableBody,{children:[o.map((m,y)=>{if(m.type==="group"){let b=d.has(m.id),T=m.childIds||[],B=T.filter(P=>h(P)).length,R=T.length>0&&B===T.length,k=B>0&&B<T.length;return jsxRuntime.jsxs(material.TableRow,{sx:P=>({backgroundColor:P.palette.mode==="dark"?"#111111":"#f5f5f5","& .MuiTableCell-root":{color:P.palette.text.primary,borderBottomColor:P.palette.divider},"& .MuiIconButton-root":{color:P.palette.text.primary},"& .MuiCheckbox-root":{color:P.palette.text.secondary},"& .MuiCheckbox-root.Mui-checked, & .MuiCheckbox-root.MuiCheckbox-indeterminate":{color:P.palette.primary.main}}),children:[w&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",children:jsxRuntime.jsx(material.Checkbox,{size:"small",checked:R,indeterminate:k,onChange:P=>{if(P.stopPropagation(),!!e.onSelectionChange)if(R){let v=r.filter(M=>!T.includes(M));e.onSelectionChange(v);}else {let v=Array.from(new Set([...r,...T]));e.onSelectionChange(v);}},onClick:P=>P.stopPropagation(),sx:{p:.5}})}),p&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",sx:{width:44},children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:.25},children:[l.length>1&&m.level<l.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)?u?.(m.id):f?.(m.id);},sx:{p:.25},children:g?.(m.id)?jsxRuntime.jsx(Gh__default.default,{fontSize:"small"}):jsxRuntime.jsx($h__default.default,{fontSize:"small"})})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>c&&c(m.id),sx:{p:.25},children:b?jsxRuntime.jsx(Zh__default.default,{}):jsxRuntime.jsx(Bh__default.default,{})})]})}),jsxRuntime.jsx(material.TableCell,{colSpan:a.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 b=m.data||m,T=m.id||b.id||y,B=h(T),R=`enhanced-table-checkbox-${y}`,A=(m.level!==void 0?m.level:0)*4;return jsxRuntime.jsxs(material.TableRow,{hover:true,onClick:P=>n&&n(P,b),role:"checkbox","aria-checked":B,tabIndex:-1,selected:B,sx:{cursor:"pointer"},children:[w&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",sx:{pl:A>0?A+1:void 0},children:jsxRuntime.jsx(material.Checkbox,{color:"primary",checked:B,inputProps:{"aria-labelledby":R}})}),p&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",sx:{width:44}}),i.filter(P=>a.includes(P.id)).map((P,v)=>{let S=!w&&v===0&&A>0?{pl:A+2}:{};return jsxRuntime.jsx(material.TableCell,{align:"left",sx:S,children:P.render?P.render(b[P.id],b):(function(){let D=b[P.id];if(P.numeric){if(typeof D=="number")return D.toLocaleString();if(typeof D=="string"&&D.trim()!==""&&!isNaN(Number(D)))return Number(D).toLocaleString()}return D})()},P.id)})]},T)}}),o.length===0&&jsxRuntime.jsx(material.TableRow,{children:jsxRuntime.jsx(material.TableCell,{colSpan:C,align:"center",children:t("common.noData")})})]})};var tp=e=>{let{visibleColumns:t,summaryRow:o,selectionMode:a,grouping:r=[]}=e;if(!e.showSummary)return null;let n=a==="multiple"||a==="single",i=r.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:{bgcolor:"background.paper"}}),i&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",sx:{bgcolor:"background.paper",width:44}}),t.map(c=>jsxRuntime.jsx(material.TableCell,{sx:{fontWeight:"bold",fontSize:"0.85rem",bgcolor:"background.paper",color:"text.primary"},children:(function(){let s=o[c];return s==null||s===""?"":typeof s=="number"?s.toLocaleString():typeof s=="string"&&s.trim()!==""&&!isNaN(Number(s))?Number(s).toLocaleString():s})()},c))]})})};var ap=e=>{let{t}=ee();return jsxRuntime.jsx(material.Box,{sx:{p:2},children:jsxRuntime.jsx(material.Typography,{children:t("table.mobile.notImplemented")})})};var Wr=({groupAnchorEl:e,setGroupAnchorEl:t,grouping:o,setGrouping:a,columns:r,toggleGroupField:n})=>{let{t:i}=ee();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:()=>a([]),startIcon:jsxRuntime.jsx(dy__default.default,{}),children:i("table.menu.clearAll")})]}),jsxRuntime.jsx(material.Divider,{}),r.map(c=>{let d=o.includes(c.id),s=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:s,color:"primary",sx:{mr:2}})]})},c.id)})]})},$r=({anchorEl:e,setAnchorEl:t,columns:o,visibleColumns:a,toggleColumnVisibility:r})=>{let{t:n}=ee();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:()=>r(i.id),children:[jsxRuntime.jsx(material.Checkbox,{checked:a.includes(i.id),size:"small"}),jsxRuntime.jsx(material.ListItemText,{primary:i.label})]},i.id))]})},Ni=({anchorEl:e,setAnchorEl:t,showSummary:o,setShowSummary:a,columns:r,summaryColumns:n,toggleSummaryColumn:i})=>{let{t:c}=ee();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=>a(d.target.checked),size:"small"}),label:c("table.menu.showSummaryRow")})}),jsxRuntime.jsx(material.Divider,{}),r.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)),r.filter(d=>d.numeric).length===0&&jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.ListItemText,{primary:c("table.menu.noNumericColumns")})})]})},Vi=({contextMenu:e,handleCloseContextMenu:t,columns:o,visibleColumns:a,toggleColumnVisibility:r})=>{let{t:n}=ee();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:()=>r(i.id),children:[jsxRuntime.jsx(material.ListItemIcon,{children:a.includes(i.id)&&jsxRuntime.jsx(cy__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{children:i.label})]},i.id))]})};var Vn=(e,t=2)=>e.toLocaleString(void 0,{maximumFractionDigits:t}),ip=({kpis:e})=>{let{t}=ee(),o=[{label:t("graph.kpi.totalRecords"),value:Vn(e.totalRecords,0),color:"text.primary"},{label:t("graph.kpi.totalReport"),value:Vn(e.totalReportHours),color:"text.primary"},{label:t("graph.kpi.totalBillable"),value:Vn(e.totalBillableHours),color:"success.main"},{label:t("graph.kpi.efficiency"),value:`${e.efficiency.toFixed(2)}%`,color:"warning.main"},{label:t("graph.kpi.amount"),value:Vn(e.totalAmount),color:"info.main"},{label:t("graph.kpi.flagged"),value:Vn(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(a=>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:a.label}),jsxRuntime.jsx(material.Typography,{variant:"h4",fontWeight:800,sx:{color:a.color},children:a.value})]},a.label))})};var Oi=({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 Hn=({data:e,orientation:t="horizontal",valueSuffix:o="",minHeight:a=210,activeName:r,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:a},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===r?"primary.dark":"primary.main",borderRadius:"8px 8px 0 0",cursor:n?"pointer":"default",opacity:r&&c.name!==r?.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:r&&c.name!==r?.45:1},children:jsxRuntime.jsx(material.Box,{sx:{width:`${c.value/i*100}%`,height:"100%",bgcolor:c.name===r?"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:a=220})=>{if(e.length===0)return jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:"No data"});let r=640,n=28,i=e.map(f=>f.value),c=Math.min(...i,0),s=Math.max(...i,1)-c||1,l=e.map((f,u)=>{let h=n+u*(r-n*2)/Math.max(e.length-1,1),w=a-n-(f.value-c)/s*(a-n*2);return {x:h,y:w,...f}}),g=l.map(f=>`${f.x},${f.y}`).join(" ");return jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsxs(material.Box,{component:"svg",viewBox:`0 0 ${r} ${a}`,sx:{width:"100%",height:a},children:[jsxRuntime.jsx("line",{x1:n,y1:a-n,x2:r-n,y2:a-n,stroke:"rgba(148,163,184,0.4)"}),jsxRuntime.jsx("polyline",{fill:"none",stroke:t,strokeWidth:3,points:g}),l.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 dp=({data:e,barColor:t="#64B5F6",lineColor:o="#FFB74D",height:a=220})=>{if(e.length===0)return jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:"No data"});let r=640,n=28,i=Math.max(...e.map(l=>l.barValue),1),c=Math.max(...e.map(l=>l.lineValue),1),d=e.map((l,g)=>{let f=(r-n*2)/e.length,u=Math.max(f*.5,8),h=n+g*f+(f-u)/2,w=l.barValue/i*(a-n*2),p=a-n-w;return {x:h,y:p,barHeight:w,barWidth:u,item:l}}),s=e.map((l,g)=>{let f=(r-n*2)/e.length,u=n+g*f+f/2,h=a-n-l.lineValue/c*(a-n*2);return {x:u,y:h,item:l}});return jsxRuntime.jsxs(material.Stack,{spacing:1.25,children:[jsxRuntime.jsxs(material.Box,{component:"svg",viewBox:`0 0 ${r} ${a}`,sx:{width:"100%",height:a},children:[jsxRuntime.jsx("line",{x1:n,y1:a-n,x2:r-n,y2:a-n,stroke:"rgba(148,163,184,0.4)"}),d.map(l=>jsxRuntime.jsx("rect",{x:l.x,y:l.y,width:l.barWidth,height:Math.max(l.barHeight,4),rx:6,fill:t},l.item.name)),jsxRuntime.jsx("polyline",{fill:"none",stroke:o,strokeWidth:3,points:s.map(l=>`${l.x},${l.y}`).join(" ")}),s.map(l=>jsxRuntime.jsx("circle",{cx:l.x,cy:l.y,r:3.5,fill:o},`${l.item.name}-line`))]}),jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${e.length}, minmax(0, 1fr))`,gap:1},children:e.map(l=>jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",noWrap:true,title:l.name,sx:{display:"block"},children:l.name}),jsxRuntime.jsxs(material.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:["Bar: ",l.barValue.toFixed(1)]}),jsxRuntime.jsxs(material.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:["Line: ",l.lineValue.toFixed(1)]})]},l.name))})]})};var by=e=>`rgba(30, 136, 229, ${.2+Math.max(0,Math.min(1,e))*.8})`,up=({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))),a=Math.max(...e.map(n=>n.value),1),r=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=r.get(`${n}__${i}`)||0,d=c/a;return jsxRuntime.jsx(material.Box,{sx:{height:36,borderRadius:1,bgcolor:by(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"],qi=({data:e,variant:t="donut",colors:o=xy,size:a=180,activeName:r,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,s)=>{let l=i;return i+=d.percent,`${o[s%o.length]} ${l}% ${i}%`});return jsxRuntime.jsxs(material.Stack,{direction:{xs:"column",sm:"row"},spacing:2,alignItems:"center",children:[jsxRuntime.jsx(material.Box,{sx:{width:a,height:a,borderRadius:"50%",background:`conic-gradient(${c.join(", ")})`,position:"relative",flexShrink:0},children:t==="donut"&&jsxRuntime.jsx(material.Box,{sx:{position:"absolute",inset:Math.round(a*.18),bgcolor:"background.paper",borderRadius:"50%"}})}),jsxRuntime.jsx(material.Stack,{spacing:1,sx:{minWidth:180},children:e.map((d,s)=>jsxRuntime.jsxs(material.Box,{onClick:()=>n?.(d),sx:{display:"flex",alignItems:"center",gap:1,cursor:n?"pointer":"default",opacity:r&&d.name!==r?.45:1},children:[jsxRuntime.jsx(material.Box,{sx:{width:10,height:10,borderRadius:"50%",bgcolor:o[s%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((r,n)=>n%2===0),a=t.filter((r,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(r=>jsxRuntime.jsxs(material.Box,{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",fontWeight:700,children:r.title}),r.causes.map(n=>jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:n},n))]},r.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(a.length,1)}, minmax(0, 1fr))`,gap:1},children:a.map(r=>jsxRuntime.jsxs(material.Box,{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",fontWeight:700,children:r.title}),r.causes.map(n=>jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:n},n))]},r.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,a=e.map(g=>{let f=g.type==="total"?0:o,u=g.type==="total"?g.value:o+g.value;return g.type!=="total"&&(o=u),{...g,start:f,end:u,delta:u-f}}),r=a.flatMap(g=>[g.start,g.end]),n=Math.min(...r,0),i=Math.max(...r,1),c=680,d=30,s=i-n||1,l=g=>t-d-(g-n)/s*(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:l(0),x2:c-d,y2:l(0),stroke:"rgba(148,163,184,0.4)"}),a.map((g,f)=>{let u=(c-d*2)/a.length,h=Math.max(u*.55,8),w=d+f*u+(u-h)/2,p=l(Math.max(g.start,g.end)),C=l(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:w,y:p,width:h,height:Math.max(C-p,4),rx:6,fill:m}),jsxRuntime.jsx("text",{x:w+h/2,y:p-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(${a.length}, minmax(0, 1fr))`,gap:1},children:a.map(g=>jsxRuntime.jsx(material.Typography,{variant:"caption",noWrap:true,title:g.name,children:g.name},g.name))})]})};var Gn=({apiKey:e,query:t,zoom:o=14,mapType:a="roadmap"})=>{let r=encodeURIComponent(t);return `https://www.google.com/maps/embed/v1/place?key=${encodeURIComponent(e)}&q=${r}&zoom=${o}&maptype=${a}`},eR=(e,t=360)=>{let o=Gn(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:a=14,mapType:r="roadmap",height:n=320})=>{let i=o||(e&&t?Gn({apiKey:e,query:t,zoom:a,mapType:r}):"");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 Zi=({keyword:e,location:t,src:o="orbcafe-ui"})=>{if(t){let a=encodeURIComponent(t.name||e||"Location");return `https://uri.amap.com/marker?position=${t.lng},${t.lat}&name=${a}&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 Sp=({keyword:e,location:t,embedUrl:o,height:a=320})=>{let r=o||Zi({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:r,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",sx:{width:"100%",height:a,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:r,target:"_blank",rel:"noreferrer",children:"AMap"})]})]})};var wp=({billableByPrimary:e,efficiencyBySecondary:t,statusDistribution:o,interaction:a})=>{let{t:r}=ee();return jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",lg:"1.2fr 1.2fr 1fr"}},children:[jsxRuntime.jsx(Oi,{title:r("graph.chart.billable.title"),subtitle:r("graph.chart.billable.subtitle"),children:jsxRuntime.jsx(Hn,{data:e,orientation:"horizontal",activeName:a?.filters?.primaryDimension,onItemClick:n=>a?.onPrimaryDimensionClick?.(n.name)})}),jsxRuntime.jsx(Oi,{title:r("graph.chart.efficiency.title"),subtitle:r("graph.chart.efficiency.subtitle"),children:jsxRuntime.jsx(Hn,{data:t,orientation:"vertical",valueSuffix:"%",activeName:a?.filters?.secondaryDimension,onItemClick:n=>a?.onSecondaryDimensionClick?.(n.name)})}),jsxRuntime.jsx(Oi,{title:r("graph.chart.status.title"),subtitle:r("graph.chart.status.subtitle"),children:jsxRuntime.jsx(qi,{data:o,variant:"donut",activeName:a?.filters?.status,onItemClick:n=>a?.onStatusClick?.(n.name)})})]})};var _t=e=>jsxRuntime.jsx(material.TextField,{...e,variant:e.variant||"outlined",size:e.size||"small",fullWidth:e.fullWidth!==void 0?e.fullWidth:true});var js=e=>jsxRuntime.jsx(material.TextField,{...e,multiline:true,minRows:3,fullWidth:true,variant:"outlined"});var Vy=["doubao-lite","gpt-4o-mini","gpt-4.1-mini","claude-3.5-sonnet"],Oy=["zh","en","de","fr","ja","ko"],Pp=({open:e,onClose:t,value:o,onSaveAll:a,modelOptions:r=Vy,promptLangOptions:n=Oy,analysisTemplateOptions:i=[],responseTemplateOptions:c=[],defaultAnalysisTemplateId:d,defaultResponseTemplateId:s})=>{let[l,g]=vt.useState(o),[f,u]=vt.useState(d||""),[h,w]=vt.useState(s||""),[p,C]=vt.useState(false);vt.useEffect(()=>{e&&(g(o),u(d||""),w(s||""));},[e,o,d,s]);let m=(b,T)=>{g(B=>({...B,[b]:T}));},y=async()=>{if(a)try{C(!0),await a({settings:l,analysisTemplateId:f||void 0,responseTemplateId:h||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(lh__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(_t,{size:"small",value:l.baseUrl,onChange:b=>m("baseUrl",b.target.value),fullWidth:true,label:"Base URL"})}),jsxRuntime.jsx(material.Box,{children:jsxRuntime.jsx(_t,{size:"small",type:"password",value:l.apiKey,onChange:b=>m("apiKey",b.target.value),fullWidth:true,label:"API Key"})}),jsxRuntime.jsx(material.Box,{children:jsxRuntime.jsx(_t,{size:"small",value:l.model,onChange:b=>m("model",b.target.value),fullWidth:true,select:true,label:"Model",children:r.map(b=>jsxRuntime.jsx(material.MenuItem,{value:b,children:b},b))})}),jsxRuntime.jsx(material.Box,{children:jsxRuntime.jsx(_t,{size:"small",value:l.promptLang,onChange:b=>m("promptLang",b.target.value),fullWidth:true,select:true,label:"Prompt Lang",children:n.map(b=>jsxRuntime.jsx(material.MenuItem,{value:b,children:b},b))})})]}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[jsxRuntime.jsxs(_t,{size:"small",value:f,onChange:b=>u(b.target.value),fullWidth:true,select:true,label:"Analysis Template",children:[jsxRuntime.jsx(material.MenuItem,{value:"",children:"Default"}),i.map(b=>jsxRuntime.jsx(material.MenuItem,{value:b.id,children:b.label},b.id))]}),jsxRuntime.jsx(js,{multiline:true,minRows:8,value:l.analysisPrompt,onChange:b=>m("analysisPrompt",b.target.value),fullWidth:true,label:"Analysis Prompt",sx:{"& .MuiInputBase-root":{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"}}}),jsxRuntime.jsxs(_t,{size:"small",value:h,onChange:b=>w(b.target.value),fullWidth:true,select:true,label:"Response Template",children:[jsxRuntime.jsx(material.MenuItem,{value:"",children:"Default"}),c.map(b=>jsxRuntime.jsx(material.MenuItem,{value:b.id,children:b.label},b.id))]}),jsxRuntime.jsx(js,{multiline:true,minRows:8,value:l.responsePrompt,onChange:b=>m("responsePrompt",b.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:y,disabled:!a||p,children:"Save"})]})]})};var el=({open:e,onClose:t,model:o,tableContent:a,extraCharts:r,interaction:n,aiAssistant:i})=>{let{t:c}=ee(),[d,s]=vt.useState(i?.defaultPrompt||""),[l,g]=vt.useState(false),[f,u]=vt.useState(false),h=n?.enabled!==false&&!!n,w=i?.enabled!==false,p=n?.filters||{},C=!!(p.primaryDimension||p.secondaryDimension||p.status),m=i?.placeholder||"Ask AI to analyze data, create charts, or find insights...";vt.useEffect(()=>{e&&s(i?.defaultPrompt||"");},[e,i?.defaultPrompt]);let y=i?.settings||{baseUrl:"/llm-api",apiKey:"",model:"doubao-lite",promptLang:"zh",analysisPrompt:"",responsePrompt:""},b=async()=>{let T=d.trim();if(!(!T||!i?.onSubmit))try{g(!0),await i.onSubmit(T,{filters:p,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})}),h&&p.primaryDimension&&jsxRuntime.jsx(material.Chip,{size:"small",variant:"outlined",label:`${n?.fieldMapping.primaryDimension}: ${p.primaryDimension}`,onDelete:()=>n?.onClearFilter("primaryDimension")}),h&&p.secondaryDimension&&jsxRuntime.jsx(material.Chip,{size:"small",variant:"outlined",label:`${n?.fieldMapping.secondaryDimension}: ${p.secondaryDimension}`,onDelete:()=>n?.onClearFilter("secondaryDimension")}),h&&p.status&&jsxRuntime.jsx(material.Chip,{size:"small",variant:"outlined",label:`${n?.fieldMapping.status}: ${p.status}`,onDelete:()=>n?.onClearFilter("status")}),h&&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:[w&&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(Ky__default.default,{sx:{fontSize:18,color:"text.secondary"}})}),jsxRuntime.jsx(material.InputBase,{fullWidth:true,value:d,onChange:T=>s(T.target.value),onKeyDown:T=>{T.key==="Enter"&&(T.preventDefault(),b());},placeholder:m,sx:{fontSize:"0.9rem"}}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:b,disabled:l||!d.trim(),children:jsxRuntime.jsx(_y__default.default,{sx:{fontSize:18}})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>u(true),children:jsxRuntime.jsx(qy__default.default,{sx:{fontSize:18}})})]}),jsxRuntime.jsx(material.IconButton,{onClick:t,children:jsxRuntime.jsx(lh__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:h?{filters:p,onPrimaryDimensionClick:T=>n?.onPrimaryDimensionClick(T),onSecondaryDimensionClick:T=>n?.onSecondaryDimensionClick(T),onStatusClick:T=>n?.onStatusClick(T)}:void 0}),r,a]}),jsxRuntime.jsx(Pp,{open:f,onClose:()=>u(false),value:y,onSaveAll:i?.onSaveAll,modelOptions:i?.modelOptions,promptLangOptions:i?.promptLangOptions,analysisTemplateOptions:i?.analysisTemplateOptions,responseTemplateOptions:i?.responseTemplateOptions,defaultAnalysisTemplateId:i?.defaultAnalysisTemplateId,defaultResponseTemplateId:i?.defaultResponseTemplateId})]})})};var za={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"]},Zy=5,Rp=e=>e.toLowerCase().replace(/[\s_-]/g,""),Na=(e,t,o,a)=>{if(t)return t;if(e.length===0)return a;let r=Object.keys(e[0]),n=new Map(r.map(i=>[Rp(i),i]));for(let i of o){let c=n.get(Rp(i));if(c)return c}return r[0]||a},po=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},$t=(e,t)=>e==null||e===""?t:String(e),Xy=(e,t,o,a,r)=>{let n=new Map;return e.forEach(i=>{let c=$t(i[t],r);n.set(c,(n.get(c)||0)+po(i[o]));}),Array.from(n.entries()).map(([i,c])=>({name:i,value:c})).sort((i,c)=>c.value-i.value).slice(0,a)},Yy=(e,t,o,a,r,n)=>{let i=new Map;return e.forEach(c=>{let d=$t(c[t],n),s=i.get(d)||{report:0,billable:0};s.report+=po(c[o]),s.billable+=po(c[a]),i.set(d,s);}),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,r)},Qy=(e,t,o)=>{let a=e.length;if(a===0)return [];let r=new Map;return e.forEach(n=>{let i=$t(n[t],o);r.set(i,(r.get(i)||0)+1);}),Array.from(r.entries()).map(([n,i])=>({name:n,value:i,percent:i/a*100}))},Dp=(e,t,o)=>{let a=new Map;return e.forEach(r=>{let n=$t(r[t],"N/A");a.set(n,(a.get(n)||0)+po(r[o]));}),Array.from(a.entries()).sort(([r],[n])=>r.localeCompare(n)).map(([r,n])=>({name:r,value:n}))},Jy=(e,t,o,a,r,n)=>{let i=new Map;return e.forEach(c=>{let d=$t(c[t],n),s=i.get(d)||{report:0,billable:0};s.report+=po(c[o]),s.billable+=po(c[a]),i.set(d,s);}),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,r)},eb=(e,t,o,a,r)=>{let n=new Map;return e.forEach(i=>{let c=$t(i[t],r),d=$t(i[o],r),s=`${c}__${d}`;n.set(s,(n.get(s)||0)+po(i[a]));}),Array.from(n.entries()).map(([i,c])=>{let[d,s]=i.split("__");return {x:d,y:s,value:c}})},tb=(e,t,o)=>{let a=Dp(e,t,o),r=a.map(i=>({name:i.name,value:i.value,type:"delta"})),n=a.reduce((i,c)=>i+c.value,0);return [...r,{name:"Total",value:n,type:"total"}]},ob=(e,t,o,a,r,n)=>{let i=new Map;return e.forEach(c=>{let d=$t(c[t],n),s=`${$t(c[o],n)} / ${$t(c[a],n)}`,l=i.get(d)||new Map;l.set(s,(l.get(s)||0)+1),i.set(d,l);}),Array.from(i.entries()).map(([c,d])=>({title:c,causes:Array.from(d.entries()).sort((s,l)=>l[1]-s[1]).slice(0,r).map(([s,l])=>`${s} (${l})`)})).slice(0,6)},Qr=({rows:e,config:t})=>{let{t:o}=ee(),a=o("graph.unassigned"),r=vt.useMemo(()=>{let l=t?.fieldMapping;return {primaryDimension:Na(e,l?.primaryDimension,za.primaryDimension,"Category"),secondaryDimension:Na(e,l?.secondaryDimension,za.secondaryDimension,"Owner"),status:Na(e,l?.status,za.status,"Status"),date:Na(e,l?.date,za.date,"Date"),description:Na(e,l?.description,za.description,"Description"),reportHours:Na(e,l?.reportHours,za.reportHours,"ReportHours"),billableHours:Na(e,l?.billableHours,za.billableHours,"BillableHours"),amount:Na(e,l?.amount,za.amount,"Amount")}},[e,t?.fieldMapping]),n=vt.useMemo(()=>e.map((l,g)=>{let f=po(l[r.reportHours]),u=po(l[r.billableHours]),h=po(l[r.amount]),w=f>0?u/f*100:0;return {id:`graph-row-${g}`,Date:$t(l[r.date],""),Primary:$t(l[r.primaryDimension],a),Secondary:$t(l[r.secondaryDimension],a),Description:$t(l[r.description],""),ReportHours:f,BillableHours:u,Amount:h,Efficiency:w,Status:$t(l[r.status],a)}}),[e,r,a]),i=vt.useMemo(()=>{let l=n.length,g=n.reduce((C,m)=>C+po(m.ReportHours),0),f=n.reduce((C,m)=>C+po(m.BillableHours),0),u=n.reduce((C,m)=>C+po(m.Amount),0),h=g>0?f/g*100:0,w=t?.statusFlagValues||["flag","flagged","warning","risk"],p=n.filter(C=>w.includes($t(C.Status,"").toLowerCase())).length;return {totalRecords:l,totalReportHours:g,totalBillableHours:f,efficiency:h,totalAmount:u,flaggedCount:p}},[n,t?.statusFlagValues]),c=t?.topN||Zy,d=vt.useMemo(()=>({billableByPrimary:Xy(n,"Primary","BillableHours",c,a),efficiencyBySecondary:Yy(n,"Secondary","ReportHours","BillableHours",c,a),statusDistribution:Qy(n,"Status",a),lineByDate:Dp(n,"Date","BillableHours"),comboByPrimary:Jy(n,"Primary","ReportHours","BillableHours",c,a),heatmapPrimarySecondary:eb(n,"Primary","Secondary","BillableHours",a),waterfallBillable:tb(n,"Date","BillableHours"),fishboneStatusCauses:ob(n,"Status","Primary","Secondary",3,a)}),[n,c,a]),s=vt.useMemo(()=>({title:t?.title||o("graph.reportTitle"),kpis:i,charts:d,table:{columns:[{id:"Date",label:r.date},{id:"Primary",label:r.primaryDimension},{id:"Secondary",label:r.secondaryDimension},{id:"Description",label:r.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:r.status}],rows:n}}),[d,t?.title,r,i,n,o]);return {fieldMapping:r,model:s}};var Jr=e=>String(e??"").trim(),ol=(e={})=>{let[t,o]=vt.useState(e),a=vt.useCallback((d,s)=>{o(l=>{let g=s?.trim();if(!g){let f={...l};return delete f[d],f}if(l[d]===g){let f={...l};return delete f[d],f}return {...l,[d]:g}});},[]),r=vt.useCallback(d=>{o(s=>{if(!s[d])return s;let l={...s};return delete l[d],l});},[]),n=vt.useCallback(()=>{o({});},[]),i=vt.useMemo(()=>!!(t.primaryDimension||t.secondaryDimension||t.status),[t]),c=vt.useCallback((d,s)=>d.filter(l=>!(t.primaryDimension&&Jr(l[s.primaryDimension])!==Jr(t.primaryDimension)||t.secondaryDimension&&Jr(l[s.secondaryDimension])!==Jr(t.secondaryDimension)||t.status&&Jr(l[s.status])!==Jr(t.status))),[t]);return {filters:t,setFilter:a,clearFilter:r,clearAll:n,hasActiveFilters:i,applyRows:c}};var rl=({variants:e,currentVariantId:t,onLoad:o,onSave:a,onDelete:r,onSetDefault:n})=>{let{t:i}=ee(),d=material.useTheme().palette.mode==="dark",s="0.85rem",l={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]=vt.useState(false),[u,h]=vt.useState(""),[w,p]=vt.useState(false),[C,m]=vt.useState(false),y=e.find(B=>B.id===t),b=()=>{h(y?.name||i("variant.newVariant")),p(y?.isDefault||false),m(y?.isPublic||false),f(true);},T=()=>{a({name:u,isDefault:w,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:l,"& .MuiInputBase-root":{fontSize:s,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:s},"& .MuiAutocomplete-noOptions":{fontSize:s}},noOptionsText:jsxRuntime.jsx(material.Typography,{sx:{fontSize:s},children:i("variant.noOptions")}),options:e,getOptionLabel:B=>B.name+(B.isDefault?` (${i("variant.defaultSuffix")})`:""),value:y||null,onChange:(B,R)=>{R&&o(R);},renderInput:B=>jsxRuntime.jsx(material.TextField,{...B,variant:"outlined",size:"small",InputProps:{...B.InputProps,sx:{fontSize:s,color:d?"#E3F2FD":"#0D47A1"}},placeholder:i("variant.selectVariant")}),renderOption:(B,R)=>jsxRuntime.jsx("li",{...B,children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",width:"100%"},children:[jsxRuntime.jsx(material.Typography,{sx:{flex:1,fontSize:s},children:R.name}),R.isDefault&&jsxRuntime.jsx(gb__default.default,{fontSize:"small",color:"action"})]})})}),jsxRuntime.jsx(material.Tooltip,{title:i("variant.saveView"),children:jsxRuntime.jsx(material.IconButton,{onClick:b,size:"small",color:"primary",children:jsxRuntime.jsx(Xp__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:u,onChange:B=>h(B.target.value)}),jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{checked:w,onChange:B=>p(B.target.checked)}),label:i("variant.setDefault")}),jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{checked:C,onChange:B=>m(B.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:T,variant:"contained",children:i("common.save")})]})]})]})};var Np=({appId:e,tableKey:t="default",currentFilters:o,currentLayoutId:a,layoutRefs:r,onLoad:n,variantService:i,serviceUrl:c,onError:d,onSuccess:s,currentVariantId:l,onVariantChange:g})=>{let{t:f}=ee(),[u,h]=vt.useState([]),[w,p]=vt.useState(""),C=`orbcafe.variants.${e}.${t}`,m=l!==void 0?l:w,y=M=>{l===void 0&&p(M),g&&g(M);},b=vt.useCallback(()=>{try{let M=localStorage.getItem(C);if(!M)return [];let S=JSON.parse(M);return Array.isArray(S)?S:[]}catch{return []}},[C]),T=vt.useCallback(M=>{try{localStorage.setItem(C,JSON.stringify(M));}catch{}},[C]),B=vt.useCallback(M=>{h(M);let S=M.find(I=>I.isDefault);S&&!m&&(y(S.id),n(S));},[m,n,y]),R=vt.useCallback(async()=>{if(!e)return [];try{let M=[];if(i)M=await i.getVariants(e,t);else if(c){let S=await fetch(`${c}/api/variants?appId=${encodeURIComponent(e)}&tableKey=${encodeURIComponent(t)}`);if(!S.ok)throw new Error(f("variant.toast.fetchFailed"));M=await S.json();}else M=b();return B(M),M}catch(M){console.error("Error fetching variants",M);let S=b();return B(S),d&&d(f("variant.toast.fetchFailed")),S}},[e,t,i,c,b,B,d,f]);return vt.useEffect(()=>{R();},[e,t]),jsxRuntime.jsx(rl,{variants:u,currentVariantId:m,onLoad:M=>{y(M.id),n(M);},onSave:async M=>{let S=Date.now().toString(),I;try{let D=M.scope||"Both",G=u.find(oe=>oe.name===M.name);S=G?G.id:Date.now().toString();let V=[];if(G&&(Array.isArray(G.filters)?V=[...G.filters]:G.filters&&(V=[{scope:"default",filters:G.filters}])),D==="Search"||D==="Both"){let oe=(Array.isArray(o),o);if(oe)if(Array.isArray(oe)&&oe.length>0&&oe[0].scope)oe.forEach(re=>{let _=V.findIndex(qe=>qe.scope===re.scope);_>=0?V[_]=re:V.push(re);});else {let re={scope:t,filters:oe},_=V.findIndex(qe=>qe.scope===t);_>=0?V[_]=re:V.push(re);}}let X=G?.layout||{},de=[];if(G&&Array.isArray(G.layoutRefs)&&(de=[...G.layoutRefs]),D==="Layout"||D==="Both")if(r&&r.length>0)r.forEach(oe=>{let re=de.findIndex(_=>_.tableKey===oe.tableKey);re>=0?de[re]=oe:de.push(oe);});else {let oe={tableKey:t,layoutId:a||null},re=de.findIndex(_=>_.tableKey===t);re>=0?de[re]=oe:de.push(oe);}if(I={appId:e,tableKey:t,...M,scope:D,id:S,createdAt:new Date().toISOString(),filters:V,layout:X,layoutRefs:de},i)await i.saveVariant(I,e,t);else if(c){if(!(await fetch(`${c}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(I)})).ok)throw new Error(f("variant.toast.saveFailed"))}else {let re=u.some(_=>_.id===S)?u.map(_=>_.id===S?I:_):[...u,I];h(re),T(re);}s&&s(f("variant.toast.saveSuccess")),(i||c)&&await R(),y(S),n(I);}catch(D){console.error("Error saving variant",D);let V=u.some(X=>X.id===S)?u.map(X=>X.id===S?I:X):[...u,I];h(V),T(V),y(S),n(I),d&&d(f("variant.toast.saveFailed"));}},onDelete:async M=>{try{if(i)await i.deleteVariant(M);else if(c){if(!(await fetch(`${c}/api/variants/${M}`,{method:"DELETE"})).ok)throw new Error(f("variant.toast.deleteFailed"))}else {let S=u.filter(I=>I.id!==M);h(S),T(S);}m===M&&y(""),(i||c)&&R(),s&&s(f("variant.toast.deleteSuccess"));}catch(S){console.error("Error deleting variant",S);let I=u.filter(D=>D.id!==M);h(I),T(I),m===M&&y(""),d&&d(f("variant.toast.deleteFailed"));}},onSetDefault:async M=>{try{let S=u.find(D=>D.id===M);if(!S)return;let I={appId:e,tableKey:t,...S,isDefault:!0};if(i)await i.setDefaultVariant(M,e,t);else if(c){if(!(await fetch(`${c}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(I)})).ok)throw new Error(f("variant.toast.defaultFailed"))}else {let D=u.map(G=>({...G,isDefault:G.id===M}));h(D),T(D);}(i||c)&&await R(),s&&s(f("variant.toast.defaultSuccess"));}catch(S){console.error("Error setting default variant",S);let I=u.map(D=>({...D,isDefault:D.id===M}));h(I),T(I),d&&d(f("variant.toast.defaultFailed"));}}})};ta__default.default.extend(Bb__default.default);ta__default.default.extend(Eb__default.default);var Fb=[null,null],Js="0.85rem",Lb={en:"en",zh:"zh-cn",fr:"fr",de:"de",ja:"ja",ko:"ko"},zb=material.styled(PickersDay.PickersDay,{shouldForwardProp:e=>e!=="isInRange"&&e!=="isStart"&&e!=="isEnd"&&e!=="isHovered"})(({theme:e,isInRange:t,isStart:o,isEnd:a,isHovered:r})=>({...t&&{borderRadius:0,backgroundColor:e.palette.primary.light,color:e.palette.primary.contrastText,"&:hover":{backgroundColor:e.palette.primary.main}},...r&&!t&&!o&&!a&&{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}},...a&&{borderRadius:"0 50% 50% 0",backgroundColor:e.palette.primary.main,color:e.palette.primary.contrastText,"&:hover":{backgroundColor:e.palette.primary.dark}},...o&&a&&{borderRadius:"50%"}})),Hp=({label:e,value:t=Fb,onChange:o})=>{let{t:a,locale:r}=ee(),n=Lb[r]||"en",i=e||a("dateRange.label"),[c,d]=vt.useState(null),[s,l]=vt.useState(t),[g,f]=vt.useState("start"),[u,h]=vt.useState(null),[w,p]=vt.useState((t[0]||ta__default.default()).locale(n)),C=vt__namespace.default.useRef(t);vt.useEffect(()=>{let[S,I]=t,[D,G]=C.current,V=oe=>oe&&typeof oe.isSame=="function",X=!(S===null&&D===null||V(S)&&V(D)&&S.isSame(D,"day")),de=!(I===null&&G===null||V(I)&&V(G)&&I.isSame(G,"day"));(X||de)&&(l(t),t[0]&&V(t[0])&&p(t[0].locale(n))),C.current=t;},[t,n]);let m=S=>{d(S.currentTarget);},y=()=>{d(null),f("start"),h(null);},b=!!c,T=S=>{if(!S)return;let I=[...s];if(g==="start")I=[S,null],f("end");else {let D=I[0];D&&S.isBefore(D)?(I=[S,null],f("end")):(I=[D,S],f("start"));}l(I);},B=S=>{let I=ta__default.default().locale(n),D=[null,null];switch(S){case "today":D=[I,I];break;case "week":D=[I.startOf("week"),I.endOf("week")];break;case "month":D=[I.startOf("month"),I.endOf("month")];break}l(D),f("start"),p(I);},R=()=>{l([null,null]),f("start"),p(ta__default.default().locale(n));},k=()=>{o&&o(s),y();},A=()=>{l(t),f("start"),y();},P=vt.useCallback(S=>{let{day:I,...D}=S,[G,V]=s,X=G?I.isSame(G,"day"):false,de=V?I.isSame(V,"day"):false,oe=G&&V?I.isBetween(G,V,"day","()"):false,re=false;return g==="end"&&G&&!V&&u&&I.isAfter(G,"day")&&I.isBefore(u.add(1,"day"),"day")&&(re=true),jsxRuntime.jsx(zb,{...D,day:I,disableMargin:true,isStart:X,isEnd:de,isInRange:oe||re,onMouseEnter:()=>h(I)})},[s,g,u]),v=S=>S?S.locale(n).format("YYYY-MM-DD"):"",M=S=>S?S.locale(n).format("ll"):"";return jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsx(material.TextField,{label:i,value:s[0]?`${v(s[0])} - ${v(s[1])}`:"",onClick:m,fullWidth:true,size:"small",InputLabelProps:{sx:{fontSize:Js}},InputProps:{readOnly:true,sx:{fontSize:Js,"& .MuiOutlinedInput-input":{fontSize:Js},paddingRight:"4px"},endAdornment:jsxRuntime.jsxs(material.InputAdornment,{position:"end",sx:{ml:0},children:[(s[0]||s[1])&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:S=>{S.stopPropagation(),R();},edge:"end",sx:{mr:.5,padding:"2px"},children:jsxRuntime.jsx(ih__default.default,{sx:{fontSize:"1rem"}})}),jsxRuntime.jsx(material.IconButton,{size:"small",edge:"end",onClick:m,sx:{padding:"2px"},children:jsxRuntime.jsx(Db__default.default,{sx:{fontSize:"1rem"},color:"action"})})]})}}),jsxRuntime.jsxs(material.Popover,{open:b,anchorEl:c,onClose:y,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{sx:{display:"flex",flexDirection:"column",p:0,minWidth: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:2,justifyContent:"space-between",children:[jsxRuntime.jsxs(material.Box,{sx:{p:1,border:1,borderColor:g==="start"?"primary.main":"divider",borderRadius:1,bgcolor:g==="start"?"action.hover":"transparent",flex:1,cursor:"pointer"},onClick:()=>f("start"),children:[jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",display:"block",children:a("dateRange.startDate")}),jsxRuntime.jsx(material.Typography,{variant:"body2",fontWeight:500,children:s[0]?M(s[0]):a("dateRange.select")})]}),jsxRuntime.jsx(Ab__default.default,{color:"action",fontSize:"small"}),jsxRuntime.jsxs(material.Box,{sx:{p:1,border:1,borderColor:g==="end"?"primary.main":"divider",borderRadius:1,bgcolor:g==="end"?"action.hover":"transparent",flex:1,cursor:"pointer"},onClick:()=>{s[0]&&f("end");},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",display:"block",children:a("dateRange.endDate")}),jsxRuntime.jsx(material.Typography,{variant:"body2",fontWeight:500,children:s[1]?M(s[1]):a("dateRange.select")})]})]})}),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:a("dateRange.today"),onClick:()=>B("today"),clickable:true,size:"small",variant:"outlined"}),jsxRuntime.jsx(material.Chip,{label:a("dateRange.thisWeek"),onClick:()=>B("week"),clickable:true,size:"small",variant:"outlined"}),jsxRuntime.jsx(material.Chip,{label:a("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:w,onMonthChange:p,onYearChange:p,onChange:T,slots:{day:P},views:["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:A,color:"inherit",children:a("common.cancel")}),jsxRuntime.jsx(material.Button,{size:"small",variant:"contained",onClick:k,children:a("common.done")})]})]})]})};var sl={equals:"=",contains:"\u2287",notContains:"\u2285",wildcard:"*","=":"=","!=":"!=",">":">","<":"<",">=":"\u2265","<=":"\u2264",between:"\u2194"},_b={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"},jb=["equals","contains","notContains","wildcard"],Gp=["=","!=",">","<",">=","<=","between"],mt="0.85rem",Zb=({field:e,value:t,onChange:o})=>{let{t:a}=ee(),[r,n]=vt.useState(null),[i,c]=vt.useState(null),[d,s]=vt.useState(""),[l,g]=vt.useState(""),[f,u]=vt.useState(false),[h,w]=vt.useState(""),[p,C]=vt.useState("");vt.useEffect(()=>{let v=setTimeout(()=>{C(h);},1e3);return ()=>clearTimeout(v)},[h]);let m=t?.operator||(e.type==="number"?"=":"equals"),y=t?.value,b=v=>{let M=_b[v];return M?a(M):v},T=v=>{n(v.currentTarget);},B=v=>{o({...t,operator:v,value:y}),n(null);},R={size:"small",fullWidth:true,variant:"outlined",InputLabelProps:{sx:{fontSize:mt}},InputProps:{sx:{fontSize:mt}},SelectProps:{MenuProps:{PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:mt,paddingTop:"4px",paddingBottom:"4px",minHeight:"auto"}}}}}},k=e.type||"text";if(k==="date"){let M=(S=>{if(!S)return [null,null];if(Array.isArray(S)&&S.length===2){let I=S[0]?ta__default.default.isDayjs(S[0])?S[0]:ta__default.default(S[0]):null,D=S[1]?ta__default.default.isDayjs(S[1])?S[1]:ta__default.default(S[1]):null;return [I,D]}return ta__default.default.isDayjs(S)||typeof S=="string"?[ta__default.default.isDayjs(S)?S:ta__default.default(S),null]:[null,null]})(y);return jsxRuntime.jsx(Hp,{label:e.label,value:M,onChange:S=>o({value:S,operator:"between"})})}if(k==="number"&&m==="between"){let v=()=>{o({value:[d,l],operator:"between"}),c(null);},M=Array.isArray(y)?`${y[0]||""} - ${y[1]||""}`:"";return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.TextField,{...R,label:e.label,value:M,placeholder:a("smartFilter.minMaxPlaceholder"),InputProps:{...R.InputProps,startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(material.Tooltip,{title:b("between"),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:T,sx:{width:24,height:24,fontSize:mt},children:sl.between})})}),readOnly:true},onClick:S=>c(S.currentTarget)}),jsxRuntime.jsx(material.Menu,{anchorEl:r,open:!!r,onClose:()=>n(null),PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:mt,minHeight:"auto",py:.5}}},children:Gp.map(S=>jsxRuntime.jsxs(material.MenuItem,{selected:S===m,onClick:()=>B(S),children:[jsxRuntime.jsx(material.Box,{sx:{width:24,display:"inline-block",fontWeight:"bold"},children:sl[S]}),jsxRuntime.jsx(material.ListItemText,{primary:b(S),primaryTypographyProps:{fontSize:mt}})]},S))}),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:a("smartFilter.min"),type:"number",value:d,onChange:S=>s(S.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:mt}},InputProps:{sx:{fontSize:mt}}}),jsxRuntime.jsx(qb__default.default,{color:"action"}),jsxRuntime.jsx(material.TextField,{size:"small",label:a("smartFilter.max"),type:"number",value:l,onChange:S=>g(S.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:mt}},InputProps:{sx:{fontSize:mt}}}),jsxRuntime.jsx(material.Button,{variant:"contained",size:"small",onClick:v,children:a("common.ok")})]})})]})}if(e.isValueHelp||k==="value-help"){let v=e.valueHelp?.mode||"single";return jsxRuntime.jsx(_d,{...R,...e.valueHelp,label:e.label,placeholder:e.placeholder||e.valueHelp?.placeholder,value:y??(v==="multiple"?[]:null),mode:v,onChange:M=>o({value:M,operator:v==="multiple"?"anyOf":"equals"})})}if(k==="select")return jsxRuntime.jsxs(material.TextField,{...R,select:true,label:e.label,value:y||"",onChange:v=>o({...t,value:v.target.value,operator:"equals"}),children:[jsxRuntime.jsx(material.MenuItem,{value:"",children:jsxRuntime.jsx("em",{children:a("common.none")})}),e.options?.map(v=>jsxRuntime.jsx(material.MenuItem,{value:v.value,children:v.label},v.value))]});if(k==="multi-select"){let v=Array.isArray(y)?y:[],M=e.options?.filter(S=>S.label.toLowerCase().includes(p.toLowerCase()))||[];return jsxRuntime.jsxs(material.TextField,{...R,select:true,label:e.label,value:v,onChange:S=>o({...t,value:S.target.value,operator:"anyOf"}),SelectProps:{...R.SelectProps,multiple:true,onClose:()=>{w(""),C("");},renderValue:S=>{if(!Array.isArray(S)||S.length===0)return jsxRuntime.jsx("em",{children:a("common.none")});let I=G=>e.options?.find(V=>V.value===G)?.label||G,D=S.map(I);return D.length>2?`${D.slice(0,2).join(", ")} +${D.length-2}`:D.join(", ")}},children:[jsxRuntime.jsx(material.ListSubheader,{children:jsxRuntime.jsx(material.TextField,{size:"small",autoFocus:true,placeholder:a("smartFilter.searchPlaceholder"),fullWidth:true,InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(Gd__default.default,{fontSize:"small"})}),sx:{fontSize:mt}},value:h,onChange:S=>w(S.target.value),onKeyDown:S=>{S.key!=="Escape"&&S.stopPropagation();},onClick:S=>S.stopPropagation()})}),M.length>0?M.map(S=>jsxRuntime.jsxs(material.MenuItem,{value:S.value,children:[jsxRuntime.jsx(material.Checkbox,{checked:v.indexOf(S.value)>-1,size:"small"}),jsxRuntime.jsx(material.ListItemText,{primary:S.label,primaryTypographyProps:{fontSize:mt}})]},S.value)):jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.ListItemText,{primary:a("smartFilter.noOptionsFound"),primaryTypographyProps:{fontSize:mt}})})]})}let A=k==="number"?Gp:jb,P=f||y!==void 0&&y!==""&&y!==null||!!r;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.TextField,{...R,label:e.label,sx:{minWidth:"120px"},value:y||"",type:k==="number"?"number":"text",onChange:v=>o({...t,value:v.target.value,operator:m}),onFocus:()=>u(true),onBlur:()=>u(false),InputProps:{...R.InputProps,startAdornment:P?jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(material.Tooltip,{title:b(m),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:T,onMouseDown:v=>v.preventDefault(),sx:{width:24,height:24,fontSize:mt,fontWeight:"bold",color:"primary.main",bgcolor:"action.hover"},children:sl[m]})})}):null,endAdornment:e.hasSearchIcon?jsxRuntime.jsx(material.InputAdornment,{position:"end",children:jsxRuntime.jsx(Gd__default.default,{color:"action"})}):void 0}}),jsxRuntime.jsx(material.Menu,{anchorEl:r,open:!!r,onClose:()=>n(null),PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:mt,minHeight:"auto",py:.5}}},children:A.map(v=>jsxRuntime.jsxs(material.MenuItem,{selected:v===m,onClick:()=>B(v),children:[jsxRuntime.jsx(material.Box,{sx:{width:24,display:"inline-block",fontWeight:"bold"},children:sl[v]}),jsxRuntime.jsx(material.ListItemText,{primary:b(v),primaryTypographyProps:{fontSize:mt}})]},v))})]})},ma=({fields:e,filters:t,onFilterChange:o,variants:a=[],currentVariantId:r,onVariantLoad:n,onVariantSave:i,onVariantDelete:c,onVariantSetDefault:d,onSearch:s,loading:l=false,appId:g,tableKey:f,currentLayout:u,currentLayoutId:h,layoutRefs:w,variantService:p,serviceUrl:C})=>{let{t:m}=ee(),[y,b]=vt.useState(true),[T,B]=vt.useState(null),[R,k]=vt.useState(e.filter(M=>!M.hidden).map(M=>M.id)),A=(M,S)=>{o({...t,[M]:S});},P=M=>{R.includes(M)?k(R.filter(S=>S!==M)):k([...R,M]);};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(Np,{appId:g,tableKey:f,currentFilters:{values:t,visibleFields:R},currentLayout:u,currentLayoutId:h,layoutRefs:w,onLoad:M=>{if(!M.filters)return;let S=null;if(Array.isArray(M.filters)){let I=f||"default",D=M.filters.find(G=>G.scope===I);S=D?D.filters:null;}else S=M.filters;S&&(S.values||S.visibleFields?(S.visibleFields&&Array.isArray(S.visibleFields)&&k(S.visibleFields),S.values&&o(S.values)):o(S)),n&&n(M);},variantService:p,serviceUrl:C,currentVariantId:r}):jsxRuntime.jsx(rl,{variants:a,currentVariantId:r,onLoad:n,onSave:M=>{i&&i({...M,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:M=>B(M.currentTarget),size:"small",color:"primary",startIcon:jsxRuntime.jsx(Gb__default.default,{fontSize:"small"}),sx:{textTransform:"none",fontSize:mt,whiteSpace:"nowrap",minWidth:"fit-content"},children:m("smartFilter.adaptFilters")})}),jsxRuntime.jsx(material.Button,{variant:"contained",size:"small",onClick:s,disabled:l,sx:{minWidth:"52px",fontWeight:"bold",fontSize:mt},children:m(l?"common.loading":"smartFilter.go")}),jsxRuntime.jsxs(material.Menu,{anchorEl:T,open:!!T,onClose:()=>B(null),slotProps:{paper:{style:{maxHeight:400,width:"25ch"},sx:{"& .MuiMenuItem-root":{fontSize:mt,minHeight:32}}}},children:[jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.ListItemText,{primary:m("smartFilter.visibleFilters"),primaryTypographyProps:{fontSize:mt}})}),jsxRuntime.jsx(material.Divider,{}),e.map(M=>jsxRuntime.jsxs(material.MenuItem,{onClick:()=>P(M.id),children:[jsxRuntime.jsx(material.Checkbox,{checked:R.includes(M.id),size:"small"}),jsxRuntime.jsx(material.ListItemText,{primary:M.label,primaryTypographyProps:{fontSize:mt}})]},M.id))]})]})]}),jsxRuntime.jsx(material.Collapse,{in:y,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(M=>R.includes(M.id)).map(M=>jsxRuntime.jsx(material.Grid,{size:1,children:jsxRuntime.jsx(Zb,{field:M,value:t[M.id]||{value:"",operator:M.type==="number"?"=":"equals"},onChange:S=>A(M.id,S)})},M.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:()=>b(!y),sx:{bgcolor:"background.paper",boxShadow:2,border:"1px solid",borderColor:"divider",width:20,height:20,minHeight:0,p:0,"&:hover":{bgcolor:"background.paper"}},children:y?jsxRuntime.jsx(Ub__default.default,{sx:{fontSize:16},color:"action"}):jsxRuntime.jsx(Zh__default.default,{sx:{fontSize:16},color:"action"})})})]})};var Yp=({layouts:e,currentLayoutId:t,onLoad:o,onSave:a,onDelete:r,onSetDefault:n})=>{let{t:i}=ee(),[c,d]=vt.useState(null),[s,l]=vt.useState(false),[g,f]=vt.useState(""),[u,h]=vt.useState(""),[w,p]=vt.useState({isDefault:false,isPublic:false}),C=e.find(R=>R.id===t),m=R=>{d(R.currentTarget);},y=()=>{d(null);},b=R=>{o(R),y();},T=()=>{f(""),h(""),p({isDefault:false,isPublic:false}),l(true),y();},B=()=>{g.trim()&&(a({name:g,description:u,...w}),l(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:T,color:"primary",size:"small",children:jsxRuntime.jsx(Xp__default.default,{})})}),jsxRuntime.jsx(material.Tooltip,{title:i("layout.layoutOptions"),children:jsxRuntime.jsx(material.IconButton,{onClick:m,color:C?"primary":"default",children:jsxRuntime.jsx(lx__default.default,{})})}),jsxRuntime.jsxs(material.Menu,{anchorEl:c,open:!!c,onClose:y,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:T,children:[jsxRuntime.jsx(material.ListItemIcon,{children:jsxRuntime.jsx(Xp__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,k)=>jsxRuntime.jsx(material.MenuItem,{onClick:()=>b(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:A=>A.stopPropagation(),children:[jsxRuntime.jsx(material.Tooltip,{title:R.isDefault?i("layout.removeDefault"):i("layout.setAsDefault"),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:A=>{A.stopPropagation(),n(R.id);},children:R.isDefault?jsxRuntime.jsx(gb__default.default,{fontSize:"small",color:"warning"}):jsxRuntime.jsx(ix__default.default,{fontSize:"small"})})}),jsxRuntime.jsx(material.Tooltip,{title:i("common.delete"),children:jsxRuntime.jsx(material.IconButton,{size:"small",color:"error",onClick:A=>{A.stopPropagation(),r(R.id);},children:jsxRuntime.jsx(Mh__default.default,{fontSize:"small"})})})]})]})},R.id||k))]}),jsxRuntime.jsxs(material.Dialog,{open:s,onClose:()=>l(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:u,onChange:R=>h(R.target.value),fullWidth:true,size:"small"}),jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{checked:w.isDefault,onChange:R=>p({...w,isDefault:R.target.checked})}),label:i("layout.useAsDefault")}),jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{checked:w.isPublic,onChange:R=>p({...w,isPublic:R.target.checked})}),label:i("layout.publicAllUsers")})]})}),jsxRuntime.jsxs(material.DialogActions,{children:[jsxRuntime.jsx(material.Button,{onClick:()=>l(false),children:i("common.cancel")}),jsxRuntime.jsx(material.Button,{onClick:B,variant:"contained",disabled:!g,children:i("common.save")})]})]})]})};var ul=({appId:e,tableKey:t="default",currentLayoutData:o,onLayoutLoad:a,targetLayoutId:r,activeLayoutId:n,serviceUrl:i,onError:c,onSuccess:d})=>{let{t:s}=ee(),[l,g]=vt.useState([]),[f,u]=vt.useState(""),h=`orbcafe.layouts.${e}.${t}`,w=k=>({id:k.layoutId,name:k.name,description:k.description??"",isDefault:!!k.isDefault,isPublic:!!k.isPublic,createdAt:k.createdAt??new Date().toISOString(),layoutData:k.layout??{}}),p=k=>({appId:e,tableKey:t,layoutId:k.id,name:k.name,description:k.description??"",isDefault:!!k.isDefault,isPublic:!!k.isPublic,createdAt:k.createdAt,layout:k.layoutData}),C=vt.useCallback(()=>{try{let k=localStorage.getItem(h);if(!k)return [];let A=JSON.parse(k);return Array.isArray(A)?A:[]}catch{return []}},[h]),m=vt.useCallback(k=>{try{localStorage.setItem(h,JSON.stringify(k));}catch{}},[h]);vt.useEffect(()=>{n!==void 0&&u(n);},[n]),vt.useEffect(()=>{if(r&&l.length>0){let k=l.find(A=>A.id===r);k&&(u(k.id),a(k));}},[r,l,a]);let y=vt.useCallback(async()=>{if(e){if(!i){let k=C();g(k);let A=k.find(P=>P.isDefault);A&&!f&&!r&&(u(A.id),a(A));return}try{let k=await fetch(`${i}/api/layouts?appId=${encodeURIComponent(e)}&tableKey=${encodeURIComponent(t)}`);if(!k.ok)throw new Error("LAYOUT_FETCH_FAILED");let P=(await k.json()).map(w);g(P);let v=P.find(M=>M.isDefault);v&&!f&&!r&&(u(v.id),a(v));}catch(k){console.error("Error fetching layouts",k);let A=C();g(A);let P=A.find(v=>v.isDefault);P&&!f&&!r&&(u(P.id),a(P)),c&&c(s("layout.toast.loadFallback"));}}},[e,t,i,c,f,a,r,C,s]);return vt.useEffect(()=>{y();},[e,t]),jsxRuntime.jsx(Yp,{layouts:l,currentLayoutId:f,onLoad:k=>{u(k.id),a(k);},onSave:async k=>{let A=l.find(M=>M.name===k.name),P=A?A.id:Date.now().toString(),v={id:P,...k,createdAt:new Date().toISOString(),layoutData:o,isDefault:k.isDefault??false,isPublic:k.isPublic??false};if(!i){let S=l.some(I=>I.id===P)?l.map(I=>I.id===P?v:I):[...l,v];g(S),m(S),u(P),a(v),d&&d(s("layout.toast.saveLocalSuccess"));return}try{if(!(await fetch(`${i}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(p(v))})).ok)throw new Error("LAYOUT_SAVE_FAILED");d&&d(s("layout.toast.saveSuccess")),await y(),u(P),a(v);}catch(M){console.error("Error saving layout",M);let I=l.some(D=>D.id===P)?l.map(D=>D.id===P?v:D):[...l,v];g(I),m(I),u(P),a(v),d&&d(s("layout.toast.saveLocalSuccess")),c&&c(s("layout.toast.backendUnavailableSavedLocal"));}},onDelete:async k=>{if(!i){let A=l.filter(P=>P.id!==k);g(A),m(A),f===k&&u(""),d&&d(s("layout.toast.deleteLocalSuccess"));return}try{if(!(await fetch(`${i}/api/layouts/${encodeURIComponent(k)}`,{method:"DELETE"})).ok)throw new Error("LAYOUT_DELETE_FAILED");f===k&&u(""),d&&d(s("layout.toast.deleteSuccess")),await y();}catch(A){console.error("Error deleting layout",A);let P=l.filter(v=>v.id!==k);g(P),m(P),f===k&&u(""),d&&d(s("layout.toast.deleteLocalSuccess")),c&&c(s("layout.toast.backendUnavailableDeletedLocal"));}},onSetDefault:async k=>{if(!i){let A=l.map(P=>({...P,isDefault:P.id===k}));g(A),m(A),d&&d(s("layout.toast.defaultLocalSuccess"));return}try{let A=l.find(v=>v.id===k);if(!A)return;if(!(await fetch(`${i}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(p({...A,isDefault:!0}))})).ok)throw new Error("LAYOUT_DEFAULT_FAILED");d&&d(s("layout.toast.defaultSuccess")),await y();}catch(A){console.error("Error setting default",A);let P=l.map(v=>({...v,isDefault:v.id===k}));g(P),m(P),d&&d(s("layout.toast.defaultLocalSuccess")),c&&c(s("layout.toast.backendUnavailableDefaultLocal"));}}})};var Jp=(e,t)=>{if(!e||!e.filters)return null;if(Array.isArray(e.filters)){let o=e.filters.find(r=>r.scope===t);if(o)return o.filters;let a=e.filters.find(r=>r.scope==="default");return a?a.filters:null}return typeof e.filters=="object"?e.filters:null},ml=(e,t)=>{if(!e)return {layout:null,layoutId:null};let o=null,a=null;if(Array.isArray(e.layoutRefs)){let r=e.layoutRefs.find(n=>n.tableKey===t);r&&(o=r.layoutId);}return !o&&e.layoutId&&(o=e.layoutId),e.layout&&typeof e.layout=="object"&&!Array.isArray(e.layout)&&(a=e.layout),{layoutId:o,layout:a}};function eu(e,t,o){return t[o]<e[o]?-1:t[o]>e[o]?1:0}function cx(e,t){return e==="desc"?(o,a)=>eu(o,a,t):(o,a)=>-eu(o,a,t)}function dx(e,t){let o=e.map((a,r)=>[a,r]);return o.sort((a,r)=>{let n=t(a[0],r[0]);return n!==0?n:a[1]-r[1]}),o.map(a=>a[0])}var on=e=>{let t=vt.useCallback(z=>{let N=String(z?.label??z?.id??"").length*9+64,ne=typeof z?.minWidth=="number"?z.minWidth:0;return Math.max(100,ne,N)},[]),o=vt.useCallback(()=>(e.columns||[]).filter(z=>!!z?.numeric).map(z=>z.id),[e.columns]),[a,r]=vt.useState(""),[n,i]=vt.useState(e.order||"asc"),[c,d]=vt.useState(e.orderBy||""),[s,l]=vt.useState(e.page||0),[g,f]=vt.useState(e.rowsPerPage||20),[u,h]=vt.useState(e.selected||[]),[w,p]=vt.useState(e.columns?e.columns.map(z=>z.id):[]),[C,m]=vt.useState(e.showSummary||false),[y,b]=vt.useState(()=>o()),[T,B]=vt.useState([]),[R,k]=vt.useState(new Set),[A,P]=vt.useState(()=>{let z={};return (e.columns||[]).forEach(O=>{z[O.id]=t(O);}),z}),[v,M]=vt.useState(null),[S,I]=vt.useState(null),[D,G]=vt.useState(null),[V,X]=vt.useState(null),[de,oe]=vt.useState(false),[re,_]=vt.useState(""),[qe,it]=vt.useState("");vt.useEffect(()=>{e.layout&&ze(e.layout);},[e.layout]),vt.useEffect(()=>{e.order!==void 0&&i(e.order),e.orderBy!==void 0&&d(e.orderBy);},[e.order,e.orderBy]),vt.useEffect(()=>{e.selected!==void 0&&h(e.selected);},[e.selected]),vt.useEffect(()=>{e.page!==void 0&&l(e.page);},[e.page]),vt.useEffect(()=>{e.rowsPerPage!==void 0&&f(e.rowsPerPage);},[e.rowsPerPage]),vt.useEffect(()=>{let z=o();b(O=>O.filter(ne=>z.includes(ne)));},[o]),vt.useEffect(()=>{P(z=>{let O={...z};return (e.columns||[]).forEach(N=>{O[N.id]===void 0&&(O[N.id]=t(N));}),O});},[e.columns,t]);let Y=vt.useMemo(()=>{let z=e.rows||[];return a&&(z=z.filter(O=>Object.keys(O).some(N=>String(O[N]).toLowerCase().includes(a.toLowerCase())))),z},[e.rows,a]),le=vt.useMemo(()=>e.onSortChange||!c?Y:dx(Y,cx(n,c)),[Y,n,c,e.onSortChange]),Be=vt.useCallback(z=>{if(T.length===0)return z.map(we=>({type:"row",data:we,id:we[e.rowKey||"id"]}));let O=[...z].sort((we,ae)=>{for(let Me of T){if(we[Me]<ae[Me])return -1;if(we[Me]>ae[Me])return 1}return 0}),N=(we,ae=0)=>{if(ae>=T.length)return we;let Me=T[ae],Te={},Ne=[];return we.forEach(Ie=>{let Re=Ie[Me],Ve=`${Me}:${Re}`;Te[Ve]||(Te[Ve]={key:Ve,field:Me,value:Re,children:[],count:0,level:ae},Ne.push(Te[Ve])),Te[Ve].children.push(Ie),Te[Ve].count++;}),Ne.forEach(Ie=>{Ie.children&&(Ie.children=N(Ie.children,ae+1));}),Ne},ne=N(O),se=(we,ae="")=>{let Me=[];return we.forEach(Te=>{if(Te.children){let Ne=ae?`${ae}>${Te.key}`:Te.key,Ie=R.has(Ne);Me.push({type:"group",id:Ne,field:Te.field,value:Te.value,level:Te.level,count:Te.count,isExpanded:Ie,childIds:(function Re(Ve){let It=[];return Ve.children.forEach(xo=>{xo.children?It=It.concat(Re(xo)):It.push(xo[e.rowKey||"id"]);}),It})(Te)}),Ie&&(Me=Me.concat(se(Te.children,Ne)));}else Me.push({type:"row",data:Te,id:Te[e.rowKey||"id"],level:T.length});}),Me};return se(ne)},[T,R,e.rowKey]),Ee=vt.useCallback(z=>{if(T.length===0)return [];let O=[...z].sort((se,we)=>{for(let ae of T){if(se[ae]<we[ae])return -1;if(se[ae]>we[ae])return 1}return 0}),N=[],ne=(se,we,ae)=>{if(we>=T.length)return;let Me=T[we],Te=new Map;se.forEach(Ne=>{let Ie=Ne[Me],Re=Te.get(Ie);Re?Re.push(Ne):Te.set(Ie,[Ne]);}),Te.forEach((Ne,Ie)=>{let Re=`${Me}:${Ie}`,Ve=ae?`${ae}>${Re}`:Re;N.push(Ve),ne(Ne,we+1,Ve);});};return ne(O,0,""),N},[T]),Ue=vt.useMemo(()=>Be(le),[le,Be]),ot=vt.useMemo(()=>Ee(le),[le,Ee]),Fe=vt.useMemo(()=>{let z=(e.rows||[]).length;return typeof e.count=="number"&&e.count>z},[e.count,e.rows]),_e=vt.useMemo(()=>Fe?Ue:g>0?Ue.slice(s*g,s*g+g):Ue,[Ue,s,g,Fe]),ht=vt.useMemo(()=>Fe&&typeof e.count=="number"?e.count:Ue.length,[Ue.length,Fe,e.count]),j=z=>{k(O=>{let N=new Set(O);return N.has(z)?N.delete(z):N.add(z),N});},pe=z=>{let O=ot.filter(N=>N===z||N.startsWith(`${z}>`));k(N=>{let ne=new Set(N);return O.forEach(se=>ne.add(se)),ne});},De=z=>{k(O=>{let N=new Set(O);return Array.from(N).forEach(ne=>{(ne===z||ne.startsWith(`${z}>`))&&N.delete(ne);}),N});},Le=z=>{if(!z){k(new Set);return}k(new Set(ot));},We=z=>{let O=ot.filter(N=>N.startsWith(`${z}>`));return O.length===0?R.has(z):R.has(z)&&O.every(N=>R.has(N))},U=z=>{let O=c===z&&n==="asc",N=c===z&&n==="desc";if(e.onSortChange){O?e.onSortChange(z,"desc"):N?e.onSortChange("","asc"):e.onSortChange(z,"asc");return}O?(i("desc"),d(z)):N?(i("asc"),d("")):(i("asc"),d(z));},ye=(z,O)=>{P(N=>({...N,[z]:O}));},be=z=>{if(z.target.checked){let O=Y.map(N=>N[e.rowKey||"id"]);h(O),e.onSelectionChange&&e.onSelectionChange(O);return}h([]),e.onSelectionChange&&e.onSelectionChange([]);},Pe=(z,O)=>{let N=O[e.rowKey||"id"],ne=u.indexOf(N),se=[];ne===-1?se=se.concat(u,N):ne===0?se=se.concat(u.slice(1)):ne===u.length-1?se=se.concat(u.slice(0,-1)):ne>0&&(se=se.concat(u.slice(0,ne),u.slice(ne+1))),h(se),e.onSelectionChange&&e.onSelectionChange(se);},et=z=>{l(z),e.onPageChange&&e.onPageChange(z);},Ge=z=>{f(z),l(0),e.onPageChange&&e.onPageChange(0),e.onRowsPerPageChange&&e.onRowsPerPageChange(z);},Tt=z=>{let O=w.indexOf(z),N=[...w];O===-1?N.push(z):N.splice(O,1),p(N);},ro=z=>{let O=T.indexOf(z),N=[...T];O===-1?N.push(z):N.splice(O,1),B(N);},Yt=z=>{o().includes(z)&&b(N=>N.includes(z)?N.filter(ne=>ne!==z):[...N,z]);},Ht=z=>{e.onLayoutSave&&e.onLayoutSave({visibleColumns:w,order:n,orderBy:c,grouping:T,columnWidths:A,showSummary:C,summaryColumns:y});},Qt=z=>{let{layout:O,layoutId:N}=ml(z,e.tableKey||"default");N?(it(N),_(N)):(it(""),_("")),O&&(O.visibleColumns&&p(O.visibleColumns),O.order&&i(O.order),O.orderBy&&d(O.orderBy),O.grouping&&B(O.grouping),O.columnWidths&&P(O.columnWidths),O.showSummary!==void 0&&m(!!O.showSummary),Array.isArray(O.summaryColumns)&&b(O.summaryColumns));},ze=z=>{let O=z?.layoutData||z?.layout||z||{};O.visibleColumns&&p(O.visibleColumns),O.order&&i(O.order),O.orderBy!==void 0&&d(O.orderBy),O.grouping&&B(O.grouping),O.columnWidths&&P(O.columnWidths),O.showSummary!==void 0&&m(!!O.showSummary),Array.isArray(O.summaryColumns)&&b(O.summaryColumns),k(new Set),l(0),z?.id&&_(z.id),it("");};vt.useEffect(()=>{e.layout&&Qt({layout:e.layout});},[e.layout]);let Ce=z=>{z.preventDefault(),X(V===null?{mouseX:z.clientX+2,mouseY:z.clientY-6}:null);},L=()=>{X(null);},$=vt.useMemo(()=>{if(!C)return {};let z={};e.columns.forEach(N=>{if(N.numeric&&y.includes(N.id)){let ne=Y.reduce((se,we)=>{let ae=parseFloat(we[N.id]);return se+(isNaN(ae)?0:ae)},0);z[N.id]=ne.toFixed(2);}else z[N.id]="";});let O=e.columns.find(N=>w.includes(N.id));return O&&!O.numeric&&(z[O.id]="Total"),z},[Y,e.columns,C,y,w]),Z=()=>{if(!e.columns||!Y)return;let z=e.columns.map(we=>we.label).join(","),O=Y.map(we=>e.columns.map(ae=>{let Me=we[ae.id];return `"${(Me==null?"":String(Me)).replace(/"/g,'""')}"`}).join(",")).join(`
184
- `),N=`data:text/csv;charset=utf-8,${z}
185
- ${O}`,ne=encodeURI(N),se=document.createElement("a");se.setAttribute("href",ne),se.setAttribute("download",`${e.title||"export"}.csv`),document.body.appendChild(se),se.click(),document.body.removeChild(se);},te=()=>{oe(true);},ke=()=>{oe(false);};return {isMobile:false,columns:e.columns,order:n,setOrder:i,orderBy:c,setOrderBy:d,filterText:a,setFilterText:r,visibleColumns:w,setVisibleColumns:p,showSummary:C,setShowSummary:m,summaryColumns:y,grouping:T,setGrouping:B,expandedGroups:R,setExpandedGroups:k,groupAnchorEl:S,setGroupAnchorEl:I,summaryAnchorEl:D,setSummaryAnchorEl:G,columnWidths:A,setColumnWidths:P,anchorEl:v,setAnchorEl:M,contextMenu:V,setContextMenu:X,sensors:void 0,sortedAndFilteredRows:le,visibleRows:_e,summaryRow:$,page:s,setPage:et,rowsPerPage:g,setRowsPerPage:Ge,totalDisplayCount:ht,selected:u,setSelected:h,isAllExpanded:ot.length>0&&ot.every(z=>R.has(z)),handleColumnResize:ye,handleRequestSort:U,handleSelectAllClick:be,handleClick:Pe,toggleSummaryColumn:Yt,handleDragEnd:()=>{},handleExport:Z,handleContextMenu:Ce,handleCloseContextMenu:L,toggleColumnVisibility:Tt,toggleGroupExpand:j,toggleGroupField:ro,handleToggleAll:Le,handleExpandGroupRecursively:pe,handleCollapseGroupRecursively:De,isGroupFullyExpanded:We,handleLayoutLoad:ze,handleVariantLoad:Qt,handleLayoutSave:Ht,effectiveAppId:e.appId||"",currentLayoutData:{visibleColumns:w,order:n,orderBy:c,grouping:T,columnWidths:A,showSummary:C,summaryColumns:y},currentLayoutId:re,layoutIdToLoad:qe,onPageChange:et,onRowsPerPageChange:Ge,graphReportOpen:de,handleOpenGraphReport:te,handleCloseGraphReport:ke}};var $M=e=>jsxRuntime.jsx(mx__default.default,{...e}),GM=e=>jsxRuntime.jsx(zs__default.default,{...e}),UM=e=>jsxRuntime.jsx(lu__default.default,{...e}),KM=e=>jsxRuntime.jsx(zh__default.default,{...e}),qM=e=>jsxRuntime.jsx(Nh__default.default,{...e}),$a=e=>{let{t}=ee(),o="0.85rem",{title:a,showToolbar:r=true,selectionMode:n,selected:i=[],onSelectionChange:c,actions:d,extraTools:s,fitContainer:l=false,fullWidth:g=false,maxHeight:f,loading:u=false,rowsPerPageOptions:h=[20,50,100,-1],onLayoutSave:w,filterConfig:p,rowKey:C,tableKey:m="default",graphReport:y,quickCreate:b,quickEdit:T,quickDelete:B,serviceUrl:R}=e,k=a||t("table.title.default"),{isMobile:A,columns:P,order:v,orderBy:M,filterText:S,setFilterText:I,visibleColumns:D,showSummary:G,setShowSummary:V,summaryColumns:X,grouping:de,setGrouping:oe,expandedGroups:re,groupAnchorEl:_,setGroupAnchorEl:qe,summaryAnchorEl:it,setSummaryAnchorEl:Y,columnWidths:le,anchorEl:Be,setAnchorEl:Ee,contextMenu:Ue,sensors:ot,sortedAndFilteredRows:Fe,summaryRow:_e,visibleRows:ht,isAllExpanded:j,page:pe,setPage:De,rowsPerPage:Le,setRowsPerPage:We,totalDisplayCount:U,setSelected:ye,handleColumnResize:be,handleRequestSort:Pe,handleSelectAllClick:et,handleClick:Ge,toggleSummaryColumn:Tt,handleDragEnd:ro,handleExport:Yt,handleContextMenu:Ht,handleCloseContextMenu:Qt,toggleColumnVisibility:ze,toggleGroupExpand:Ce,toggleGroupField:L,handleToggleAll:$,handleExpandGroupRecursively:Z,handleCollapseGroupRecursively:te,isGroupFullyExpanded:ke,handleLayoutLoad:z,handleVariantLoad:O,handleLayoutSave:N,effectiveAppId:ne,currentLayoutData:se,currentLayoutId:we,layoutIdToLoad:ae,graphReportOpen:Me,handleOpenGraphReport:Te,handleCloseGraphReport:Ne}=on(e),Ie=y?.enabled??false,Re=Ie&&(y?.interaction?.enabled??true),Ve=ol(),It=!!b?.enabled,xo=!!T?.enabled,yt=!!B?.enabled,At=b?.fields,vo=b?.excludeFields||[],Ra=b?.initialValues||{},[Br,Do]=vt__namespace.default.useState(false),[no,er]=vt__namespace.default.useState(false),[oa,Kt]=vt__namespace.default.useState({}),[io,Wt]=vt__namespace.default.useState(false),[je,aa]=vt__namespace.default.useState(false),[Go,ra]=vt__namespace.default.useState({}),[tr,Uo]=vt__namespace.default.useState(false),[or,ar]=vt__namespace.default.useState(false),Ko=u||no||je||or,na=vt__namespace.default.useMemo(()=>{let H=[...P];if(Array.isArray(At)&&At.length>0){let J=new Set(At);H=H.filter(Q=>J.has(Q.id));}if(vo.length>0){let J=new Set(vo);H=H.filter(Q=>!J.has(Q.id));}return H.filter(J=>!!J?.id)},[P,vo,At]),Da=C||"id",qt=vt__namespace.default.useMemo(()=>{let H=new Set(i);return Fe.filter(J=>H.has(J?.[Da]))},[i,Fe,Da]),Mo=qt.length===1?qt[0]:null,ia=T?.fields,Co=T?.excludeFields||[],qo=T?.editableFields||[],rr=T?.nonEditableFields||[],Er=T?.primaryKeys?.length?T.primaryKeys:[Da],Ma=vt__namespace.default.useMemo(()=>{let H=[...P];if(Array.isArray(ia)&&ia.length>0){let J=new Set(ia);H=H.filter(Q=>J.has(Q.id));}if(Co.length>0){let J=new Set(Co);H=H.filter(Q=>!J.has(Q.id));}return H.filter(J=>!!J?.id)},[P,Co,ia]),nr=vt__namespace.default.useMemo(()=>new Set(Er),[Er]),la=vt__namespace.default.useMemo(()=>new Set(qo),[qo]),Jt=vt__namespace.default.useMemo(()=>new Set(rr),[rr]),Ao=vt__namespace.default.useCallback(H=>la.size>0?la.has(H):!(Jt.has(H)||nr.has(H)),[la,Jt,nr]);vt__namespace.default.useEffect(()=>{!Me&&Ve.hasActiveFilters&&Ve.clearAll();},[Me,Ve.hasActiveFilters,Ve.clearAll]);let Fr=()=>{let H={};na.forEach(J=>{H[J.id]=Ra[J.id]??"";}),Kt(H),Do(true);},ir=()=>{no||Do(false);},Lr=(H,J)=>{Kt(Q=>({...Q,[H]:J}));},zr=async()=>{if(!b?.onSubmit){Do(false);return}try{er(!0),await b.onSubmit(oa),Do(!1);}finally{er(false);}},Nr=()=>{if(!Mo)return;let H={};Ma.forEach(Q=>{H[Q.id]=Mo[Q.id]??"";});let J=T?.getInitialValues?{...H,...T.getInitialValues(Mo)}:H;ra(J),Wt(true);},lo=()=>{je||Wt(false);},Vr=(H,J)=>{ra(Q=>({...Q,[H]:J}));},Or=async()=>{if(Mo){if(!T?.onSubmit){Wt(false);return}try{aa(!0),await T.onSubmit(Go,Mo),Wt(!1);}finally{aa(false);}}},lr=()=>{qt.length!==0&&Uo(true);},sa=()=>{or||Uo(false);},Aa=async()=>{if(qt.length===0){Uo(false);return}if(!B?.onConfirm){Uo(false),ye([]),c?.([]);return}try{ar(!0),await B.onConfirm(qt),Uo(!1),ye([]),c?.([]);}finally{ar(false);}},Ba=Fe,{fieldMapping:x}=Qr({rows:Ba,config:{...y,title:y?.title||`${k} ${t("graph.reportTitle")}`}}),E=vt__namespace.default.useMemo(()=>Re?Ve.applyRows(Ba,x):Ba,[Re,Ve.applyRows,Ba,x]),{model:F}=Qr({rows:E,config:{...y,title:y?.title||`${k} ${t("graph.reportTitle")}`,fieldMapping:x}}),K=F.table.columns.map(H=>({id:H.id,label:H.label,align:H.align||"left",minWidth:120,numeric:H.align==="right"})),ce=ne?jsxRuntime.jsx(ul,{appId:ne,tableKey:m,currentLayoutData:se,onLayoutLoad:z,targetLayoutId:ae,activeLayoutId:we,serviceUrl:R??p?.serviceUrl}):null,Se=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Wr,{groupAnchorEl:_,setGroupAnchorEl:qe,grouping:de,setGrouping:oe,columns:P,toggleGroupField:L}),jsxRuntime.jsx($r,{anchorEl:Be,setAnchorEl:Ee,columns:P,visibleColumns:D,toggleColumnVisibility:ze}),jsxRuntime.jsx(Ni,{anchorEl:it,setAnchorEl:Y,showSummary:G,setShowSummary:V,columns:P,summaryColumns:X,toggleSummaryColumn:Tt}),jsxRuntime.jsx(Vi,{contextMenu:Ue,handleCloseContextMenu:Qt,columns:P,visibleColumns:D,toggleColumnVisibility:ze})]});return A?jsxRuntime.jsxs(Yn__default.default,{sx:{display:"flex",flexDirection:"column",gap:2,height:"100%"},children:[p&&jsxRuntime.jsx(ma,{fields:p.fields,filters:p.filters,onFilterChange:p.onFilterChange,onSearch:p.onSearch,variants:p.variants||[],currentVariantId:p.currentVariantId,onVariantLoad:p.onVariantLoad,onVariantSave:p.onVariantSave,onVariantDelete:p.onVariantDelete,onVariantSetDefault:p.onVariantSetDefault,appId:p.appId,tableKey:m,currentLayout:[{tableKey:m,layoutData:se}],variantService:p.variantService,serviceUrl:R??p.serviceUrl}),jsxRuntime.jsx(ap,{title:k,loading:u,showSummary:G,setShowSummary:V,setAnchorEl:Ee,setSummaryAnchorEl:Y,filterText:S,setFilterText:I,sortedAndFilteredRows:Fe,selected:i,columns:P,visibleColumns:D,summaryRow:_e,handleClick:Ge,selectionMode:n}),Se]}):jsxRuntime.jsxs(Yn__default.default,{sx:{width:g?"100%":"auto",mb:l?0:2,...l?{flex:1,display:"flex",flexDirection:"column",minHeight:0,height:"100%",overflow:"hidden"}:{}},children:[p&&jsxRuntime.jsx(Yn__default.default,{sx:{mb:2},children:jsxRuntime.jsx(ma,{fields:p.fields,filters:p.filters,onFilterChange:p.onFilterChange,onSearch:p.onSearch,variants:p.variants||[],currentVariantId:p.currentVariantId,onVariantLoad:H=>{O(H),p.onVariantLoad&&p.onVariantLoad(H);},onVariantSave:p.onVariantSave,onVariantDelete:p.onVariantDelete,onVariantSetDefault:p.onVariantSetDefault,loading:u,appId:p.appId,tableKey:m,currentLayout:[{tableKey:m,layoutData:se}],currentLayoutId:we,layoutRefs:[{tableKey:m,layoutId:we}],variantService:p.variantService,serviceUrl:R??p.serviceUrl})}),jsxRuntime.jsxs(px__default.default,{sx:{width:g?"100%":"auto",mb:l?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative","&::before":Ko?{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}:l?{flex:1,minHeight:0,height:"100%"}:{}},children:[r&&jsxRuntime.jsx(Bi,{filterText:S,setFilterText:I,onRowsPerPageChange:We,rowsPerPage:Le,rowsPerPageOptions:h,page:pe,count:U,onPageChange:De,actions:d,extraTools:s,grouping:de,setGroupAnchorEl:qe,showSummary:G,setShowSummary:V,setAnchorEl:Ee,setSummaryAnchorEl:Y,handleExport:Yt,showCreateButton:It,onOpenCreateDialog:Fr,showEditButton:xo,onOpenEditDialog:Nr,editDisabled:qt.length!==1,showDeleteButton:yt,onOpenDeleteConfirm:lr,deleteDisabled:qt.length===0,onLayoutSave:w||p?.variantService&&p?.appId?N:void 0,loading:u,layoutManager:ce,onOpenGraphReport:Ie?Te:void 0}),jsxRuntime.jsx(lu__default.default,{sx:{flex:1,...f?{maxHeight:f,height:f}:l?{height:0,maxHeight:"none"}:{maxHeight:"calc(100vh - 320px)"},overflowY:"auto",overflowX:"auto",position:"relative",minHeight:0},children:jsxRuntime.jsx(core.DndContext,{sensors:ot,collisionDetection:core.closestCenter,onDragEnd:ro,modifiers:[modifiers.restrictToHorizontalAxis],children:jsxRuntime.jsxs(ux__default.default,{sx:{minWidth:g?750:"auto",width:g?"100%":"auto",tableLayout:Object.keys(le).length>0?"fixed":"auto",borderCollapse:"separate",borderSpacing:0,"& .MuiTableCell-root":{fontSize:o}},"aria-labelledby":"tableTitle",size:"small",stickyHeader:true,children:[jsxRuntime.jsx(Ei,{columns:P,visibleColumns:D,order:v,orderBy:M,onRequestSort:Pe,onContextMenu:Ht,selectionMode:n,grouping:de,isAllExpanded:j,handleToggleAll:$,rowCount:Fe.length,numSelected:i.length,onSelectAllClick:et,columnWidths:le,onColumnResize:be}),jsxRuntime.jsx(ep,{visibleRows:ht,columns:P,visibleColumns:D,selectionMode:n,selected:i,orderBy:M,loading:u,expandedGroups:re,toggleGroupExpand:Ce,handleExpandGroupRecursively:Z,handleCollapseGroupRecursively:te,isGroupFullyExpanded:ke,handleClick:Ge,onSelectionChange:c,grouping:de,rowKeyProp:C,page:pe,rowsPerPage:Le}),G&&jsxRuntime.jsx(tp,{showSummary:G,columns:P,visibleColumns:D,summaryRow:_e,selectionMode:n?.toString(),grouping:de,orderBy:M,zIndex:3})]})})})]}),It&&jsxRuntime.jsxs(tu__default.default,{open:Br,onClose:ir,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:H=>`1px solid ${H.palette.divider}`,bgcolor:"background.paper"}}},children:[jsxRuntime.jsx(ou__default.default,{sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:b?.title||t("quickCreate.createWithTitle",{title:k})}),jsxRuntime.jsx(au__default.default,{sx:{pt:"8px !important"},children:jsxRuntime.jsxs(Yn__default.default,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[na.map(H=>{let J=H.type==="number"||H.numeric?"number":H.type==="date"?"date":"text",Q=H.label||H.id;return jsxRuntime.jsx(nu__default.default,{label:Q,value:oa[H.id]??"",onChange:at=>Lr(H.id,at.target.value),type:J,size:"small",fullWidth:true,InputLabelProps:{shrink:J==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-create-${H.id}`)}),b?.description&&jsxRuntime.jsx(iu__default.default,{severity:"info",sx:{fontSize:"0.85rem","& .MuiAlert-message":{fontSize:"0.85rem"}},children:b.description})]})}),jsxRuntime.jsxs(ru__default.default,{sx:{px:3,pb:2},children:[jsxRuntime.jsx(fl__default.default,{onClick:ir,sx:{fontSize:"0.85rem"},disabled:no,children:b?.cancelLabel||t("common.cancel")}),jsxRuntime.jsx(fl__default.default,{onClick:zr,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:no,children:b?.submitLabel||t("common.save")})]})]}),xo&&jsxRuntime.jsxs(tu__default.default,{open:io,onClose:lo,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:H=>`1px solid ${H.palette.divider}`,bgcolor:"background.paper"}}},children:[jsxRuntime.jsx(ou__default.default,{sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:T?.title||t("quickEdit.editWithTitle",{title:k})}),jsxRuntime.jsx(au__default.default,{sx:{pt:"8px !important"},children:jsxRuntime.jsxs(Yn__default.default,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Ma.map(H=>{let J=H.type==="number"||H.numeric?"number":H.type==="date"?"date":"text",Q=H.label||H.id,at=Ao(H.id);return jsxRuntime.jsx(nu__default.default,{label:Q,value:Go[H.id]??"",onChange:W=>Vr(H.id,W.target.value),type:J,size:"small",fullWidth:true,disabled:!at,InputLabelProps:{shrink:J==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-edit-${H.id}`)}),T?.description&&jsxRuntime.jsx(iu__default.default,{severity:"info",sx:{fontSize:"0.85rem","& .MuiAlert-message":{fontSize:"0.85rem"}},children:T.description})]})}),jsxRuntime.jsxs(ru__default.default,{sx:{px:3,pb:2},children:[jsxRuntime.jsx(fl__default.default,{onClick:lo,sx:{fontSize:"0.85rem"},disabled:je,children:T?.cancelLabel||t("common.cancel")}),jsxRuntime.jsx(fl__default.default,{onClick:Or,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:je||!Mo,children:T?.submitLabel||t("common.save")})]})]}),yt&&jsxRuntime.jsx(Bn,{open:tr,type:"warning",title:B?.title||t("quickDelete.confirmTitle"),message:B?.message||(qt.length>1?t("quickDelete.confirmMessageMultiple",{count:qt.length}):t("quickDelete.confirmMessageSingle")),confirmText:B?.confirmText||t("common.delete"),cancelText:B?.cancelText||t("common.cancel"),onClose:sa,onConfirm:Aa}),Se,Ie&&jsxRuntime.jsx(el,{open:Me,onClose:Ne,model:F,aiAssistant:y?.aiAssistant,interaction:Re?{enabled:true,filters:Ve.filters,fieldMapping:x,onPrimaryDimensionClick:H=>Ve.setFilter("primaryDimension",H),onSecondaryDimensionClick:H=>Ve.setFilter("secondaryDimension",H),onStatusClick:H=>Ve.setFilter("status",H),onClearFilter:Ve.clearFilter,onClearAll:Ve.clearAll}:void 0,tableContent:jsxRuntime.jsx($a,{appId:ne||"graph-report-internal",title:t("graph.dataBody"),columns:K,rows:F.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false}})})]})},_M=$a;var e2=({id:e,title:t,hideHeader:o=true,filterConfig:a,tableProps:r,children:n,spacing:i=1,mode:c="separated"})=>{let d=a?{...a,appId:a.appId||e}:void 0,s={...r,appId:r.appId||e};return jsxRuntime.jsxs(jd,{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(ma,{...d})}),jsxRuntime.jsx(material.Box,{sx:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:jsxRuntime.jsx($a,{...s,fitContainer:true,filterConfig:c==="integrated"?d:void 0})})]}),n]})};var i2=({metadata:e,fetchData:t,initialRowsPerPage:o=20,rowsPerPageOptions:a=[20,50,100,-1],tableKey:r="default",mode:n="integrated",serviceUrl:i,variantService:c})=>{let{t:d}=ee(),[s,l]=vt.useState(false),[g,f]=vt.useState([]),[u,h]=vt.useState({}),[w,p]=vt.useState(e.variants||[]),[C,m]=vt.useState(e.layout||null),[y,b]=vt.useState(""),[T,B]=vt.useState(0),[R,k]=vt.useState(0),[A,P]=vt.useState(o),[v,M]=vt.useState([]),[S,I]=vt.useState("asc"),[D,G]=vt.useState("");vt.useEffect(()=>{let le={};e.filters.forEach(Be=>{Be.defaultValue!==void 0&&(le[Be.id]=Be.defaultValue);}),h(le);},[e.filters]);let V=vt.useCallback(async(le,Be,Ee,Ue,ot)=>{l(true);try{let Fe={...le,page:Be+1,limit:Ee,sort:ot,order:Ue},_e;t?_e=await t(Fe):typeof e.api=="function"?_e=await e.api(Fe):e.api&&typeof e.api=="object"?(console.log("Fetching from URL:",e.api.url,Fe),_e={rows:[],total:0}):(console.warn("No API configured for report"),_e={rows:[],total:0}),_e&&(f(_e.rows||[]),B(_e.total||0));}catch(Fe){console.error("Failed to fetch report data",Fe);}finally{l(false);}},[e.api,t]);vt.useEffect(()=>{V(u,R,A,S,D);},[V,R,A,S,D]);let X=()=>{k(0),V(u,0,A,S,D);},de=le=>{k(0),P(le);},oe=(le,Be)=>{I(Be),G(le);},re=le=>{h(le);},_=le=>{b(le?.id||"");let Be=Jp(le,r);if(Be){let Ue=Be.values??Be;h(Ue),V(Ue,0,A,S,D),k(0);}let{layout:Ee}=ml(le,r);Ee&&m(Ee);},qe=le=>{let Be={...le,id:Date.now().toString(),createdAt:new Date().toISOString()};p(Ee=>[...Ee,Be]);},it=le=>{m(le);};return {pageProps:{id:e.id,title:e.title,mode:n,filterConfig:{appId:e.id,tableKey:r,fields:e.filters,filters:u,onFilterChange:re,onSearch:X,onVariantLoad:_,onVariantSave:qe,onVariantDelete:le=>p(Be=>Be.filter(Ee=>Ee.id!==le)),onVariantSetDefault:le=>{p(Be=>Be.map(Ee=>({...Ee,isDefault:Ee.id===le})));},variants:w,currentVariantId:y,variantService:c,serviceUrl:i},tableProps:{appId:e.id,tableKey:r,columns:e.columns,rows:g,loading:s,rowKey:"id",count:T,page:R,rowsPerPage:A,rowsPerPageOptions:a,onPageChange:k,onRowsPerPageChange:de,selectionMode:"multiple",selected:v,onSelectionChange:M,onLayoutSave:it,layout:C,title:e.title,showSummary:true,order:S,orderBy:D,serviceUrl:i,onSortChange:oe,graphReport:e.graphReport||{enabled:true,title:`${e.title} ${d("graph.reportTitle")}`}}},filters:u,rows:g,loading:s,refresh:X}};var Sx=e=>[...e].sort((t,o)=>o.value-t.value),c2=({bars:e=[],lines:t=[],combos:o=[],heatmap:a=[],pies:r=[],waterfalls:n=[]})=>{let i=vt.useMemo(()=>Sx(e),[e]),c=vt.useMemo(()=>[...t],[t]),d=vt.useMemo(()=>[...o],[o]),s=vt.useMemo(()=>[...a],[a]),l=vt.useMemo(()=>{let f=r.reduce((u,h)=>u+h.value,0);return r.map(u=>({...u,percent:f>0?u.value/f*100:u.percent}))},[r]),g=vt.useMemo(()=>[...n],[n]);return {bars:i,lines:c,combos:d,heatmap:s,pies:l,waterfalls:g}};var g2=({apiKey:e,query:t,zoom:o=14,mapType:a="roadmap"})=>vt.useMemo(()=>!e||!t?"":Gn({apiKey:e,query:t,zoom:o,mapType:a}),[e,t,o,a]),f2=({keyword:e,location:t})=>vt.useMemo(()=>Zi({keyword:e,location:t?{lng:t.lng,lat:t.lat,name:t.name}:void 0}),[e,t]);var Qn=({code:e,language:t="text",copyable:o=true,showLineNumbers:a=false,wrapLongLines:r=false,maxHeight:n})=>{let[i,c]=vt.useState(false),d=vt.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(Mx__default.default,{fontSize:"inherit"}):jsxRuntime.jsx(Dx__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:a?d.map((l,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:r?"pre-wrap":"pre",wordBreak:r?"break-word":"normal"},children:l})]},`${g}-${l}`)):jsxRuntime.jsx(material.Box,{component:"code",sx:{display:"block",whiteSpace:r?"pre-wrap":"pre",wordBreak:r?"break-word":"normal"},children:e})})]})};var Lx=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},zx=async e=>new Function("m","return import(m)")(e),Jn=({expression:e,inline:t=false,allowKatex:o=false})=>{let a=vt.useMemo(()=>Lx(e),[e]),[r,n]=vt.useState("");return vt.useEffect(()=>{let i=true;return (async()=>{if(!o||!a){n("");return}try{let d=await zx("katex"),l=(d?.default||d)?.renderToString?.(a,{displayMode:!t,throwOnError:!1,strict:"warn"});i&&typeof l=="string"&&n(l);}catch{i&&n("");}})(),()=>{i=false;}},[o,a,t]),a?r?jsxRuntime.jsx(material.Box,{component:t?"span":"div",sx:{display:t?"inline-flex":"block",my:t?0:.5,overflowX:"auto"},dangerouslySetInnerHTML:{__html:r}}):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:a}):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:a})}):null};var Gx=async e=>new Function("m","return import(m)")(e),dc=({code:e,title:t="Mermaid Diagram",height:o=320,enabled:a=true})=>{let[r,n]=vt.useState(""),[i,c]=vt.useState(""),[d,s]=vt.useState(false),l=vt.useMemo(()=>e.trim(),[e]);return vt.useEffect(()=>{let g=true;return (async()=>{if(!a||!l){n(""),c("");return}s(true),c(""),n("");try{let u=await Gx("mermaid"),h=u?.default||u;if(!h||typeof h.render!="function")throw new Error("Mermaid runtime is not available");h.initialize?.({startOnLoad:!1,securityLevel:"loose",theme:"default"});let w=await h.render(`orbcafe-mermaid-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,l),p=typeof w=="string"?w:w?.svg;g&&typeof p=="string"&&n(p);}catch(u){if(g){let h=u instanceof Error?u.message:"Failed to render Mermaid diagram";c(h);}}finally{g&&s(false);}})(),()=>{g=false;}},[a,l]),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&&r&&jsxRuntime.jsx(material.Box,{sx:{maxHeight:o,overflow:"auto","& svg":{display:"block",mx:"auto",maxWidth:"100%",height:"auto"}},dangerouslySetInnerHTML:{__html:r}}),!d&&!r&&jsxRuntime.jsxs(material.Box,{children:[i&&jsxRuntime.jsx(material.Alert,{severity:"info",sx:{mb:1},children:i}),jsxRuntime.jsx(Qn,{code:l,language:"mermaid",copyable:true,showLineNumbers:true,wrapLongLines:true})]})]})]})};var pc=e=>e.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(o=>o.trim()),Yx=e=>/^:?-{3,}:?$/.test(e.trim()),Qx=e=>{let t=e.trim(),o=t.startsWith(":"),a=t.endsWith(":");return o&&a?"center":a?"right":"left"},bl=e=>{let t=e.split(`
187
- `).map(i=>i.trim()).filter(Boolean);if(t.length<2)return null;let o=pc(t[0]),a=pc(t[1]);if(o.length===0||a.length!==o.length||!a.every(Yx))return null;let r=a.map(Qx),n=t.slice(2).filter(i=>i.includes("|")).map(i=>{let c=pc(i);return c.length<o.length?[...c,...Array.from({length:o.length-c.length},()=>"")]:c.slice(0,o.length)});return {headers:o,aligns:r,rows:n}},uc=({markdown:e,table:t,maxHeight:o=360})=>{let a=vt.useMemo(()=>t||(e?bl(e):null),[t,e]);return !a||a.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:a.headers.map((r,n)=>jsxRuntime.jsx(material.TableCell,{align:a.aligns[n],sx:{fontWeight:700,bgcolor:"background.paper"},children:r},`${r}-${n}`))})}),jsxRuntime.jsx(material.TableBody,{children:a.rows.map((r,n)=>jsxRuntime.jsx(material.TableRow,{hover:true,children:r.map((i,c)=>jsxRuntime.jsx(material.TableCell,{align:a.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 vl=({content:e,title:t="Thinking",defaultExpanded:o=false,isStreaming:a=false})=>{let[r,n]=vt.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:r?"rotate(180deg)":"rotate(0deg)",transition:"transform .15s ease"},children:jsxRuntime.jsx(n0__default.default,{fontSize:"inherit"})}),jsxRuntime.jsxs(material.Typography,{variant:"caption",color:"text.secondary",sx:{fontStyle:"italic"},children:[t,a?" ...":""]})]}),jsxRuntime.jsx(material.Collapse,{in:r,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 gc=/(\*\*[^*]+\*\*|`[^`]+`|\[[^\]]+\]\([^)]+\)|\*[^*]+\*|\$[^$\n]+\$)/g,Cl=e=>e.trim().startsWith("```"),yu=e=>/^#{1,6}\s+/.test(e.trim()),fc=e=>/^[-*+]\s+/.test(e.trim()),hc=e=>/^\d+\.\s+/.test(e.trim()),bu=e=>/^(?:-{3,}|\*{3,}|_{3,})$/.test(e.trim()),yc=e=>e.trim().startsWith(">"),xu=(e,t)=>{if(t+1>=e.length)return false;let o=e[t],a=e[t+1];return !o.includes("|")||!a.includes("|")?false:/^\s*\|?\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)+\|?\s*$/.test(a.trim())},vu=e=>e.trim().startsWith("<think>")||e.trim()===":::think",oi=(e,t,o)=>{let a=[],r=0,n=0;gc.lastIndex=0;let i=gc.exec(e);for(;i;){i.index>r&&a.push(e.slice(r,i.index));let c=i[0],d=`${o}-${n}`;if(c.startsWith("**")&&c.endsWith("**"))a.push(jsxRuntime.jsx("strong",{children:c.slice(2,-2)},d));else if(c.startsWith("*")&&c.endsWith("*"))a.push(jsxRuntime.jsx("em",{children:c.slice(1,-1)},d));else if(c.startsWith("`")&&c.endsWith("`"))a.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 s=c.match(/^\[([^\]]+)\]\(([^)]+)\)$/);s?a.push(jsxRuntime.jsx(material.Link,{href:s[2],target:"_blank",rel:"noreferrer",underline:"hover",children:s[1]},d)):a.push(c);}else c.startsWith("$")&&c.endsWith("$")&&t.enableMath?a.push(jsxRuntime.jsx(Jn,{expression:c,inline:true,allowKatex:true},d)):a.push(c);r=i.index+c.length,n+=1,i=gc.exec(e);}return r<e.length&&a.push(e.slice(r)),a.length>0?a:[e]},ai=({markdown:e,content:t,className:o,enableMath:a=true,enableMermaid:r=true,enableThinkBlock:n=true,codeCopyable:i=true,codeLineNumbers:c=false})=>{let d=e??t??"",s=vt.useMemo(()=>{let l=[],g=d.replace(/\r\n/g,`
183
+ `;return St.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:ig(r)}}}),u=new ogl.Mesh(s,{geometry:g,program:f});function h(){if(!d)return;let R=window.devicePixelRatio||1,k=d.clientWidth,B=d.clientHeight;l.setSize(k*R,B*R),s.canvas.style.width=k+"px",s.canvas.style.height=B+"px",f.uniforms.iResolution.value.set(s.canvas.width,s.canvas.height,s.canvas.width/s.canvas.height);}window.addEventListener("resize",h),h();let w=0,p=0,S=0,m=.3,y=R=>{let k=d.getBoundingClientRect(),B=R.clientX-k.left,P=R.clientY-k.top,C=k.width,D=k.height,T=Math.min(C,D),I=C/2,A=D/2,W=(B-I)/T*2,z=(P-A)/T*2;Math.sqrt(W*W+z*z)<.8?w=1:w=0;},b=()=>{w=0;};d.addEventListener("mousemove",y),d.addEventListener("mouseleave",b);let v,E=R=>{v=requestAnimationFrame(E);let k=(R-p)*.001;p=R,f.uniforms.iTime.value=R*.001,f.uniforms.hue.value=e,f.uniforms.hoverIntensity.value=t,f.uniforms.backgroundColor.value=ig(r);let B=a?1:w;f.uniforms.hover.value+=(B-f.uniforms.hover.value)*.1,o&&B>.5&&(S+=k*m),f.uniforms.rot.value=S,l.render({scene:u});};return v=requestAnimationFrame(E),()=>{cancelAnimationFrame(v),window.removeEventListener("resize",h),d.removeEventListener("mousemove",y),d.removeEventListener("mouseleave",b),s.canvas.parentNode===d&&d.removeChild(s.canvas),s.getExtension("WEBGL_lose_context")?.loseContext();}},[e,t,o,a,r]),jsxRuntime.jsx("div",{ref:n,className:"w-full h-full"})}function dS(e,t,o){let a,r,n;if(t===0)a=r=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;a=i(d,c,e+1/3),r=i(d,c,e),n=i(d,c,e-1/3);}return new ogl.Vec3(a,r,n)}function ig(e){if(e==="transparent")return new ogl.Vec3(0,0,0);if(e.startsWith("#")){let a=parseInt(e.slice(1,3),16)/255,r=parseInt(e.slice(3,5),16)/255,n=parseInt(e.slice(5,7),16)/255;return new ogl.Vec3(a,r,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 a=parseInt(o[1])/360,r=parseInt(o[2])/100,n=parseInt(o[3])/100;return dS(a,r,n)}return new ogl.Vec3(0,0,0)}var sg=pf(()=>{"use client";});function Io(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var Ts={primary:"#000000",primaryHover:"#333333"},Di={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"},Mn={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",full:"rounded-full"},Pd=()=>"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 yf=classVarianceAuthority.cva(Pd(),{variants:{variant:{default:`${Di.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:`${Di.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:Di.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-[${Ts.primary}] hover:bg-[${Ts.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:Mn.none,sm:Mn.sm,md:Mn.md,full:Mn.full}},defaultVariants:{variant:"default",size:"default",rounded:"md"}}),Is=St__namespace.forwardRef(({className:e,variant:t,size:o,asChild:a=false,...r},n)=>jsxRuntime.jsx(a?reactSlot.Slot:"button",{className:Io(yf({variant:t,size:o,className:e})),ref:n,...r}));Is.displayName="Button";var xf={"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.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}","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","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"},vf={"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.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}","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","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"},Cf={"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.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}","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","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"},kf={"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.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","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","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"},Sf={"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.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","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","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"},wf={"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.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","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","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"},An={en:xf,zh:vf,fr:Cf,de:kf,ja:Sf,ko:wf};var Dd=(e,t)=>t?e.replace(/\{(\w+)\}/g,(o,a)=>{let r=t[a];return r==null?"":String(r)}):e,Rf={locale:"en",t:(e,t)=>Dd(An.en[e]||e,t)},Md=St.createContext(Rf),Mi=({locale:e="en",messages:t,children:o})=>{let a=St.useMemo(()=>{let r=An[e]||An.en,n=t?.[e]||{},i={...An.en,...r,...n};return {locale:e,t:(c,d)=>Dd(i[c]||c,d)}},[e,t]);return jsxRuntime.jsx(Md.Provider,{value:a,children:o})},ee=()=>St.useContext(Md);function Rs({items:e,onItemClick:t,className:o="",level:a=0,expandedIds:r,onToggleExpand:n,colorMode:i="light"}){let{t:c}=ee(),d=i==="dark",l=navigation.usePathname(),[s,g]=St.useState(false),[f,u]=St.useState(new Set),h=r!==void 0&&n!==void 0,w=h?r:f;St.useEffect(()=>{g(true);},[]);let p=m=>{if(h)n(m);else {let y=new Set(f);y.has(m)?y.delete(m):y.add(m),u(y);}},S=m=>{m.children&&m.children.length>0&&p(m.id),t&&t(m);};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:c("navigation.noItems")})}):jsxRuntime.jsx("div",{className:Io("tree-menu",o),children:e.map(m=>{let y=w.has(m.id)||m.isExpanded,b=m.children&&m.children.length>0,v=m.appurl||m.href,E=s&&v?l===v:false;return jsxRuntime.jsxs("div",{className:"tree-menu-item relative",children:[E&&jsxRuntime.jsx("div",{className:Io("absolute left-0 top-2 bottom-2 w-[3px] rounded-r-full z-10",d?"bg-[#90caf9]":"bg-[#1976d2]")}),jsxRuntime.jsxs(Is,{variant:"ghost",className:Io("w-full justify-start gap-2 h-auto py-2 relative overflow-hidden group",`ml-${a*4}`,E?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"),onClick:()=>S(m),children:[b&&jsxRuntime.jsx("div",{className:Io("flex-shrink-0 transition-transform duration-200",y&&"rotate-90",E?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"})}),!b&&jsxRuntime.jsx("div",{className:"w-4 h-4 flex-shrink-0"}),m.icon&&jsxRuntime.jsx("div",{className:Io("flex-shrink-0 transition-colors duration-200",E?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:Io("text-sm truncate transition-colors duration-200",E?"font-semibold":"font-medium"),children:m.title||m.label}),m.description&&jsxRuntime.jsx("div",{className:Io("text-xs truncate transition-colors duration-200",E?d?"text-[#90caf9]/70":"text-[#1976d2]/75":d?"text-gray-400":"text-gray-500"),title:m.description,children:m.description})]})]}),b&&jsxRuntime.jsx("div",{className:Io("grid transition-[grid-template-rows] duration-300 ease-in-out",y?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:jsxRuntime.jsx("div",{className:"overflow-hidden",children:jsxRuntime.jsx(Rs,{items:m.children,onItemClick:t,level:a+1,expandedIds:r,onToggleExpand:n,colorMode:i})})})]},m.id)})})}var zd=({collapsed:e,onToggle:t,className:o="",maxHeight:a,menuData:r=[],colorMode:n="light"})=>{let{t:i}=ee(),c=n==="dark",d=navigation.useRouter(),[l,s]=St.useState(""),[g,f]=St.useState(new Set);St.useEffect(()=>{e&&f(new Set);},[e]);let u=St.useCallback(S=>{let m=[],y=b=>{b.forEach(v=>{m.push(v.id),v.children&&y(v.children);});};return y(S),m},[]),h=St.useMemo(()=>{if(!l.trim())return r;let S=m=>m.reduce((y,b)=>{let v=b.title?.toLowerCase().includes(l.toLowerCase())||b.description?.toLowerCase().includes(l.toLowerCase()),E=b.children?S(b.children):[];return (v||E.length>0)&&y.push({...b,children:E.length>0?E:b.children}),y},[]);return S(r)},[l,r]),w=St.useMemo(()=>l.trim()?new Set(u(r)):g,[l,r,g,u]),p=St.useCallback(async S=>{if(console.log("\u{1F5B1}\uFE0F \u5BFC\u822A\u83DC\u5355\u9879\u70B9\u51FB:",S),S.id==="chat"||S.appurl==="/chat"){console.log("\u{1F4AC} \u68C0\u6D4B\u5230chat\u83DC\u5355\u70B9\u51FB\uFF0C\u8DF3\u8F6C\u5230\u65B0\u7684\u804A\u5929\u89C6\u56FE");try{d.push("/chat?new=true");}catch(y){console.error("\u274C \u65E0\u6CD5\u8DF3\u8F6C\u5230\u65B0\u804A\u5929\u89C6\u56FE:",y),d.push("/chat");}return}let m=S.appurl||S.href;m&&(m.startsWith("http://")||m.startsWith("https://")?window.open(m,"_blank"):d.push(m));},[d]);return jsxRuntime.jsxs("div",{className:`flex flex-col backdrop-blur-xl border shadow-[0_4px_8px_0_rgba(31,38,135,0.1)] ${e?"w-14 rounded-full":"w-[234px] rounded-2xl"} relative ${o} ${c?"bg-[#111111] border-white/10":"bg-white/70 border-white/30"}`,style:{backdropFilter:"blur(16px) saturate(180%)",WebkitBackdropFilter:"blur(16px) saturate(180%)",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",maxHeight:a?`${a}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 ${c?"text-gray-300 hover:bg-gray-800":"text-gray-500 hover:bg-gray-50"}`,title:i("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:i("navigation.searchPlaceholder"),value:l,onChange:S=>s(S.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 ${c?"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 ${c?"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:h.length===0?jsxRuntime.jsx("div",{className:"flex items-center justify-center py-8 text-gray-500 text-sm",children:e?"\u{1F4C2}":i(l?"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(Rs,{items:h,onItemClick:p,className:"space-y-1",expandedIds:w,colorMode:n,onToggleExpand:S=>{let m=new Set(g);h.some(b=>b.id===S)?m.has(S)?m.delete(S):(h.forEach(b=>{b.id!==S&&m.has(b.id)&&m.delete(b.id);}),m.add(S)):m.has(S)?m.delete(S):m.add(S),f(m);}})}),e&&jsxRuntime.jsx("div",{className:"space-y-2",children:r.map(S=>jsxRuntime.jsx("div",{className:"space-y-1",children:jsxRuntime.jsx("button",{onClick:()=>{t();let m=new Set([S.id]);f(m);},className:`w-full flex items-center justify-center p-2 rounded-lg cursor-pointer transition-colors duration-200 ${c?"text-gray-400 hover:bg-gray-800":"text-gray-600 hover:bg-gray-50"}`,title:i("navigation.expandView",{title:S.title||""}),children:S.icon||jsxRuntime.jsx("div",{className:`w-6 h-6 rounded text-xs flex items-center justify-center font-medium ${c?"bg-[#90caf9] text-[#0b0b0b]":"bg-[#1976d2] text-white"}`,children:S.title?.charAt(0)||"?"})})},S.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 ${c?"hover:bg-gray-800/50":"hover:bg-white/20"}`,title:i("navigation.collapse"),children:jsxRuntime.jsx("div",{className:"absolute",style:{bottom:"0px",right:"0px",width:"16px",height:"16px",overflow:"hidden"},children:jsxRuntime.jsx("div",{className:c?"border-yellow-400":"",style:{width:"32px",height:"32px",borderRadius:"16px",border:"3px solid #21BCFF",backgroundColor:"transparent",position:"absolute",top:"-16px",left:"-16px"}})})})]})};var Vd=(e={})=>{let{initialCollapsed:t=false,content:o=[]}=e,[a,r]=St.useState(t),[n,i]=St.useState(o),c=St.useCallback(()=>{r(l=>!l);},[]),d=St.useMemo(()=>({collapsed:a,onToggle:c,menuData:n}),[a,c,n]);return {collapsed:a,setCollapsed:r,toggleCollapsed:c,menuData:n,setMenuData:i,navigationIslandProps:d}};var zo=e=>jsxRuntime.jsx(material.Button,{...e,variant:e.variant||"contained",size:e.size||"medium",sx:{textTransform:"none",...e.sx}});var Ms=class{constructor(){Id(this,"listener",null);}register(t){this.listener=t;}unregister(){this.listener=null;}show(t,o,a){this.listener&&this.listener({type:t,content:o,options:a});}hide(){this.listener&&this.listener(null);}},ua=new Ms,JT={success:(e,t)=>ua.show("success",e,t),error:(e,t)=>ua.show("error",e,t),warning:(e,t)=>ua.show("warning",e,t),info:(e,t)=>ua.show("info",e,t),show:(e,t,o)=>ua.show(e,t,o),hide:()=>ua.hide()};var Xf={success:{icon:jsxRuntime.jsx(qf__default.default,{sx:{fontSize:40}}),color:"#e8f5e9",iconColor:"#66bb6a",borderColor:"#a5d6a7"},warning:{icon:jsxRuntime.jsx(_f__default.default,{sx:{fontSize:40}}),color:"#fff3e0",iconColor:"#ffa726",borderColor:"#ffcc80"},error:{icon:jsxRuntime.jsx(jf__default.default,{sx:{fontSize:40}}),color:"#ffebee",iconColor:"#ef5350",borderColor:"#ef9a9a"},info:{icon:jsxRuntime.jsx(Zf__default.default,{sx:{fontSize:40}}),color:"#e3f2fd",iconColor:"#42a5f5",borderColor:"#90caf9"},default:{icon:null,color:"transparent",iconColor:"inherit",borderColor:"transparent"}},Bn=({open:e,title:t,message:o,onClose:a,onConfirm:r,confirmText:n,cancelText:i,showCancel:c=true,maxWidth:d="xs",type:l="default"})=>{let{t:s}=ee(),g=n||s("messageBox.confirm"),f=i||s("messageBox.cancel"),u=()=>{r?r():a();},h=Xf[l],w=l!=="default";return jsxRuntime.jsxs(au__default.default,{open:e,onClose:a,maxWidth:d,fullWidth:true,PaperProps:{sx:{borderRadius:3,...w&&{borderTop:`6px solid ${h.iconColor}`}}},children:[w&&jsxRuntime.jsx(Yn__default.default,{sx:{display:"flex",justifyContent:"center",pt:3,color:h.iconColor},children:h.icon}),t&&jsxRuntime.jsx(ru__default.default,{sx:{textAlign:w?"center":"left",pt:w?1:2},children:t}),jsxRuntime.jsx(nu__default.default,{sx:{textAlign:w?"center":"left"},children:typeof o=="string"?jsxRuntime.jsx(Gf__default.default,{children:o}):o}),jsxRuntime.jsxs(iu__default.default,{sx:{justifyContent:w?"center":"flex-end",pb:3,px:3},children:[c&&jsxRuntime.jsx(zo,{onClick:a,variant:"text",color:"inherit",children:f}),jsxRuntime.jsx(zo,{onClick:u,variant:"contained",sx:{bgcolor:w?h.iconColor:void 0,"&:hover":{bgcolor:w?h.iconColor:void 0,filter:"brightness(0.9)"}},autoFocus:true,children:g})]})]})},hI=()=>{let[e,t]=St__namespace.default.useState(null),[o,a]=St__namespace.default.useState(false);St__namespace.default.useEffect(()=>{let i=c=>{c?(t(c),a(true)):(a(false),t(null));};return ua.register(i),()=>ua.unregister()},[]);let r=()=>{a(false),e?.options?.onClose&&e.options.onClose(),t(null);},n=()=>{e?.options?.onConfirm&&e.options.onConfirm(),a(false),t(null);};return e?jsxRuntime.jsx(Bn,{open:o,type:e.type,message:e.content,title:e.options?.title,onClose:r,onConfirm:n,confirmText:e.options?.confirmText,cancelText:e.options?.cancelText,showCancel:e.options?.showCancel,maxWidth:e.options?.maxWidth}):null};var ph=[{field:"value",label:"Value",minWidth:120},{field:"label",label:"Description",minWidth:180}],qd=e=>Array.isArray(e)?e:e==null||e===""?[]:[e],Qo=e=>String(e),_d=(e,t)=>e[t],jd=e=>{let t=e.value??e.id??e.key??e.code;return typeof t=="number"||typeof t=="string"?t:""},uh=e=>{let t=e.label??e.description??e.name??e.title;return String(typeof t=="number"||typeof t=="string"?t:jd(e))},mh=e=>{let t=e.description??e.subtitle;return typeof t=="number"||typeof t=="string"?String(t):void 0},Zd=({value:e=null,items:t=[],columns:o,mode:a="single",dialogTitle:r="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,selectedItems:u=[],displayValue:h,getOptionValue:w=jd,getOptionLabel:p=uh,getOptionDescription:S=mh,onChange:m,onSearch:y,disabled:b,InputProps:v,onKeyDown:E,...R})=>{let k=a==="multiple",[B,P]=St.useState(false),[C,D]=St.useState(""),[T,I]=St.useState(null),[A,W]=St.useState(false),[z,Q]=St.useState(()=>qd(e)),re=St.useMemo(()=>o&&o.length>0?o:ph,[o]),ne=T??t,ae=St.useMemo(()=>{let X=[...u,...t,...T??[]],pe=new Map;return X.forEach(Be=>{pe.set(Qo(w(Be)),Be);}),pe},[w,t,T,u]),_=St.useMemo(()=>qd(e),[e]);St.useEffect(()=>{B||Q(_);},[B,_]);let Ue=St.useMemo(()=>{let X=C.trim().toLowerCase();if(!X||y)return ne;let pe=re.filter(Be=>Be.searchable!==false);return ne.filter(Be=>[w(Be),p(Be),S(Be),...pe.map(qe=>_d(Be,qe.field))].some(qe=>String(qe??"").toLowerCase().includes(X)))},[ne,S,p,w,y,C,re]),Ze=St.useMemo(()=>{if(h!==void 0)return h;if(_.length===0)return "";let X=pe=>{let Be=ae.get(Qo(pe));if(!Be)return String(pe);let Ee=p(Be);return Ee&&Ee!==String(pe)?`${pe} - ${Ee}`:String(pe)};return k?_.length>2?`${_.length} selected`:_.map(X).join(", "):X(_[0])},[h,p,k,ae,_]),Oe=St.useCallback(async()=>{if(y){W(true);try{let X=await y(C);Array.isArray(X)&&I(X);}finally{W(false);}}},[y,C]),ie=()=>{b||(Q(_),P(true));},we=()=>{P(false);},Ae=()=>{m?.(k?[]:null,k?[]:null),Q([]);},Ye=X=>{let pe=w(X);if(k){Q(Be=>Be.some(qe=>Qo(qe)===Qo(pe))?Be.filter(qe=>Qo(qe)!==Qo(pe)):[...Be,pe]);return}Q([pe]);},st=()=>{let X=z.map(pe=>ae.get(Qo(pe))).filter(pe=>!!pe);k?m?.(z,X):m?.(z[0]??null,X[0]??null),P(false);},Z=X=>{if(X.key==="F4"){X.preventDefault(),ie();return}E?.(X);},Ke=g||A,xt=_.length>0;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.TextField,{...R,disabled:b,value:Ze,onKeyDown:Z,InputProps:{...v,readOnly:true,endAdornment:jsxRuntime.jsxs(material.InputAdornment,{position:"end",children:[Ke?jsxRuntime.jsx(material.CircularProgress,{size:18}):null,f&&xt&&!b?jsxRuntime.jsx(material.Tooltip,{title:c,children:jsxRuntime.jsx(material.IconButton,{size:"small",edge:"end","aria-label":c,onClick:Ae,children:jsxRuntime.jsx(ch__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:ie,disabled:b,children:jsxRuntime.jsx(Kd__default.default,{fontSize:"small"})})})})]})}}),jsxRuntime.jsxs(material.Dialog,{open:B,onClose:we,fullWidth:true,maxWidth:"md",PaperProps:{sx:X=>({borderRadius:2,overflow:"hidden",border:`1px solid ${X.palette.divider}`,boxShadow:X.palette.mode==="dark"?`0 24px 80px ${styles.alpha(X.palette.common.black,.72)}`:`0 24px 80px ${styles.alpha(X.palette.common.black,.18)}`})},children:[jsxRuntime.jsxs(material.DialogTitle,{sx:X=>({display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,px:2.5,py:2,pr:1.5,borderBottom:`1px solid ${X.palette.divider}`,bgcolor:X.palette.background.paper}),children:[jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1.05rem",fontWeight:800,lineHeight:1.25},children:r}),k?jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",sx:{mt:.25},children:`${z.length} selected`}):null]}),jsxRuntime.jsx(material.IconButton,{"aria-label":"Close",onClick:we,size:"small",children:jsxRuntime.jsx(dh__default.default,{fontSize:"small"})})]}),jsxRuntime.jsxs(material.DialogContent,{sx:{p:0},children:[jsxRuntime.jsxs(material.Stack,{direction:{xs:"column",sm:"row"},spacing:1,sx:X=>({px:2.5,py:1.5,borderBottom:`1px solid ${X.palette.divider}`,bgcolor:X.palette.mode==="dark"?styles.alpha(X.palette.common.white,.025):styles.alpha(X.palette.primary.main,.035)}),children:[jsxRuntime.jsx(material.TextField,{size:"small",fullWidth:true,value:C,placeholder:n,onChange:X=>D(X.target.value),onKeyDown:X=>{X.key==="Enter"&&(X.preventDefault(),Oe());},InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(Kd__default.default,{fontSize:"small"})}),sx:X=>({borderRadius:1,bgcolor:X.palette.background.paper,"& fieldset":{borderColor:styles.alpha(X.palette.text.primary,X.palette.mode==="dark"?.2:.16)},"&:hover fieldset":{borderColor:styles.alpha(X.palette.primary.main,.52)},"&.Mui-focused fieldset":{borderColor:X.palette.primary.main}})}}),y?jsxRuntime.jsx(material.Button,{variant:"outlined",onClick:()=>{Oe();},disabled:Ke,sx:{minWidth:96,textTransform:"none",fontWeight:700},children:Ke?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:X=>({bgcolor:X.palette.mode==="dark"?"#111111":X.palette.background.paper,borderBottom:`1px solid ${X.palette.divider}`})}),re.map(X=>jsxRuntime.jsx(material.TableCell,{align:X.align,sx:pe=>({minWidth:X.minWidth,width:X.width,fontSize:"0.78rem",fontWeight:800,bgcolor:pe.palette.mode==="dark"?"#111111":pe.palette.background.paper,borderBottom:`1px solid ${pe.palette.divider}`}),children:X.label},String(X.field)))]})}),jsxRuntime.jsxs(material.TableBody,{children:[Ue.map(X=>{let pe=w(X),Be=z.some(Ee=>Qo(Ee)===Qo(pe));return jsxRuntime.jsxs(material.TableRow,{hover:true,selected:Be,onClick:()=>Ye(X),onDoubleClick:()=>{k||(Q([pe]),m?.(pe,X),P(false));},sx:Ee=>({cursor:"pointer","&.Mui-selected":{bgcolor:styles.alpha(Ee.palette.primary.main,Ee.palette.mode==="dark"?.22:.12)},"&.Mui-selected:hover":{bgcolor:styles.alpha(Ee.palette.primary.main,Ee.palette.mode==="dark"?.28:.18)}}),children:[jsxRuntime.jsx(material.TableCell,{padding:"checkbox",children:jsxRuntime.jsx(material.Checkbox,{size:"small",checked:Be})}),re.map(Ee=>{let qe=_d(X,Ee.field);return jsxRuntime.jsx(material.TableCell,{align:Ee.align,sx:{fontSize:"0.82rem",py:1},children:Ee.render?Ee.render(qe,X):String(qe??"")},String(Ee.field))})]},Qo(pe))}),Ue.length===0?jsxRuntime.jsx(material.TableRow,{children:jsxRuntime.jsx(material.TableCell,{colSpan:re.length+1,children:jsxRuntime.jsx(material.Box,{sx:{py:5,textAlign:"center",color:"text.secondary"},children:s})})}):null]})]})})]}),jsxRuntime.jsxs(material.DialogActions,{sx:X=>({px:2.5,py:1.5,borderTop:`1px solid ${X.palette.divider}`,bgcolor:X.palette.background.paper,"& .MuiButton-root":{textTransform:"none",fontWeight:700}}),children:[f&&(xt||z.length>0)?jsxRuntime.jsx(material.Button,{onClick:Ae,children:c}):null,jsxRuntime.jsx(material.Box,{sx:{flex:1}}),jsxRuntime.jsx(material.Button,{onClick:we,children:d}),jsxRuntime.jsx(material.Button,{variant:"contained",onClick:st,disabled:!k&&z.length===0,children:i})]})]})]})};var Xd=({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 Bi=e=>{let{t}=ee(),o="0.85rem",a=Array.isArray(e.actions)?e.actions:e.actions?[e.actions]:[],r=Array.isArray(e.extraTools)?e.extraTools:e.extraTools?[e.extraTools]:[],n=[...a,...r],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,u=l<s-1&&i!==-1;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:h=>e.setFilterText(h.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(Kd__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:h=>e.onRowsPerPageChange?.(Number(h.target.value)),sx:{fontSize:o,fontWeight:600,color:"text.primary",minWidth:64,"& .MuiSelect-select":{py:.25,pr:"16px !important"},"& .MuiSvgIcon-root":{color:"text.primary"}},children:c.map(h=>jsxRuntime.jsx(material.MenuItem,{value:h,sx:{fontSize:o},children:h===-1?t("common.all"):h},`rows-per-page-${h}`))}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>e.onPageChange?.(Math.max(l-1,0)),disabled:!f,sx:{p:.35,color:"text.primary"},children:jsxRuntime.jsx(Fh__default.default,{fontSize:"small"})}),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:!u,sx:{p:.35,color:"text.primary"},children:jsxRuntime.jsx(ef__default.default,{fontSize:"small"})})]}),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((h,w)=>jsxRuntime.jsx(St__namespace.default.Fragment,{children:h},`toolbar-custom-${w}`))}),jsxRuntime.jsx(material.Box,{sx:{width:"1px",height:20,bgcolor:"divider",mx:.5}}),jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.groupBy"),children:jsxRuntime.jsx(material.IconButton,{sx:{color:"text.primary"},onClick:h=>e.setGroupAnchorEl(h.currentTarget),children:jsxRuntime.jsx(material.Badge,{badgeContent:e.grouping?.length,color:"primary",children:jsxRuntime.jsx(Rh__default.default,{})})})}),jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.summary"),children:jsxRuntime.jsx(material.IconButton,{sx:{color:e.showSummary?"primary.main":"text.primary"},onClick:h=>e.setSummaryAnchorEl(h.currentTarget),children:jsxRuntime.jsx(Dh__default.default,{})})}),jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.columns"),children:jsxRuntime.jsx(material.IconButton,{sx:{color:"text.primary"},onClick:h=>e.setAnchorEl(h.currentTarget),children:jsxRuntime.jsx(Th__default.default,{})})}),jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.export"),children:jsxRuntime.jsx(material.IconButton,{sx:{color:"text.primary"},onClick:e.handleExport,children:jsxRuntime.jsx(Ph__default.default,{})})}),e.showCreateButton&&jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.newItem"),children:jsxRuntime.jsx(material.IconButton,{onClick:e.onOpenCreateDialog,color:"primary",children:jsxRuntime.jsx(Ah__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,children:jsxRuntime.jsx(Bh__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,children:jsxRuntime.jsx(Eh__default.default,{})})})}),e.onOpenGraphReport&&jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.graphicReport"),children:jsxRuntime.jsx(material.IconButton,{sx:{color:"text.primary"},onClick:e.onOpenGraphReport,children:jsxRuntime.jsx(Mh__default.default,{})})}),e.onLayoutSave&&!e.layoutManager&&jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.saveLayout"),children:jsxRuntime.jsx(material.IconButton,{sx:{color:"text.primary"},onClick:h=>e.onLayoutSave(h),children:jsxRuntime.jsx(Qp__default.default,{})})}),e.layoutManager]})]})};var Ei=e=>{let{t}=ee(),{onSelectAllClick:o,order:a,orderBy:r,numSelected:n=0,rowCount:i=0,onRequestSort:c,columns:d,visibleColumns:l,selectionMode:s,grouping:g=[],isAllExpanded:f=false,handleToggleAll:u,onColumnResize:h,columnWidths:w}=e,[p,S]=St.useState(null),m=St.useRef(null),y=C=>D=>{p||c(C);},b=(C,D,T)=>{C.preventDefault(),C.stopPropagation(),S(D),m.current={startX:C.clientX,startWidth:T,colId:D},document.addEventListener("mousemove",v),document.addEventListener("mouseup",E),document.body.style.cursor="col-resize";},v=C=>{if(!m.current)return;let{startX:D,startWidth:T,colId:I}=m.current,A=C.clientX-D,W=Math.max(50,T+A);h&&h(I,W);},E=()=>{S(null),m.current=null,document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",E),document.body.style.cursor="";};St.useEffect(()=>()=>{document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",E);},[]);let R=s==="multiple"||s==="single",k=g.length>0&&!!u,B=t(f?"table.group.collapseAll":"table.group.expandAll"),P=d.filter(C=>l.includes(C.id));return jsxRuntime.jsx(Oh__default.default,{children:jsxRuntime.jsxs(Hh__default.default,{children:[R&&jsxRuntime.jsx(Vs__default.default,{padding:"checkbox",sx:C=>({width:48,position:"sticky",top:0,zIndex:4,backgroundColor:C.palette.mode==="dark"?"#000000":"#f5f5f5",color:C.palette.mode==="dark"?"#ffffff":C.palette.text.primary}),children:jsxRuntime.jsx(Wh__default.default,{color:"primary",indeterminate:n>0&&n<i,checked:i>0&&n===i,onChange:o,disabled:s==="single"})}),k&&jsxRuntime.jsx(Vs__default.default,{align:"center",padding:"checkbox",sx:C=>({width:44,position:"sticky",top:0,zIndex:4,backgroundColor:C.palette.mode==="dark"?"#000000":"#f5f5f5",color:C.palette.mode==="dark"?"#ffffff":C.palette.text.primary}),children:jsxRuntime.jsx(Uh__default.default,{title:B,children:jsxRuntime.jsx(Gh__default.default,{size:"small",onClick:C=>{C.stopPropagation(),u?.(!f);},sx:{p:.2},children:f?jsxRuntime.jsx(qh__default.default,{fontSize:"small"}):jsxRuntime.jsx(Kh__default.default,{fontSize:"small"})})})}),P.map(C=>{let D=w?.[C.id]||C.minWidth||100;return jsxRuntime.jsxs(Vs__default.default,{align:"left",padding:C.disablePadding?"none":"normal",sortDirection:r===C.id?a:false,style:{width:D,minWidth:D,maxWidth:D},sx:T=>({position:"sticky",top:0,zIndex:4,backgroundColor:T.palette.mode==="dark"?"#000000":"#f5f5f5",color:T.palette.mode==="dark"?"#ffffff":T.palette.text.primary,fontWeight:"bold",userSelect:"none"}),children:[jsxRuntime.jsx($h__default.default,{active:r===C.id,direction:r===C.id?a:"asc",onClick:y(C.id),sx:T=>({"&.MuiTableSortLabel-root":{width:"100%"},"& .MuiTableSortLabel-icon":{color:T.palette.mode==="dark"?"#ffffff":T.palette.text.primary,opacity:r===C.id?1:0,transition:"opacity 0.2s"},"&:hover .MuiTableSortLabel-icon":{opacity:.5},"&.Mui-active .MuiTableSortLabel-icon":{opacity:1,color:T.palette.mode==="dark"?"#ffffff":T.palette.text.primary},fontWeight:"bold",fontSize:"0.85rem",color:T.palette.mode==="dark"?"#ffffff":T.palette.text.primary}),children:jsxRuntime.jsx(Yn__default.default,{component:"span",sx:{overflow:"visible",textOverflow:"clip",whiteSpace:"normal",lineHeight:1.2,wordBreak:"break-word",pr:1},children:C.label})}),jsxRuntime.jsx(Yn__default.default,{onMouseDown:T=>b(T,C.id,typeof D=="number"?D:100),onClick:T=>T.stopPropagation(),sx:{position:"absolute",right:0,top:0,bottom:0,width:5,cursor:"col-resize","&:hover":{backgroundColor:"primary.main",opacity:.5},zIndex:1}})]},C.id)})]})})};var op=e=>{let{t}=ee(),{visibleRows:o,visibleColumns:a,selected:r=[],handleClick:n,columns:i,toggleGroupExpand:c,expandedGroups:d=new Set,selectionMode:l,grouping:s=[],isGroupFullyExpanded:g,handleExpandGroupRecursively:f,handleCollapseGroupRecursively:u}=e,h=m=>r.indexOf(m)!==-1,w=l==="multiple"||l==="single",p=s.length>0,S=a.length+(w?1:0)+(p?1:0);return jsxRuntime.jsxs(material.TableBody,{children:[o.map((m,y)=>{if(m.type==="group"){let b=d.has(m.id),v=m.childIds||[],E=v.filter(P=>h(P)).length,R=v.length>0&&E===v.length,k=E>0&&E<v.length;return jsxRuntime.jsxs(material.TableRow,{sx:P=>({backgroundColor:P.palette.mode==="dark"?"#111111":"#f5f5f5","& .MuiTableCell-root":{color:P.palette.text.primary,borderBottomColor:P.palette.divider},"& .MuiIconButton-root":{color:P.palette.text.primary},"& .MuiCheckbox-root":{color:P.palette.text.secondary},"& .MuiCheckbox-root.Mui-checked, & .MuiCheckbox-root.MuiCheckbox-indeterminate":{color:P.palette.primary.main}}),children:[w&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",children:jsxRuntime.jsx(material.Checkbox,{size:"small",checked:R,indeterminate:k,onChange:P=>{if(P.stopPropagation(),!!e.onSelectionChange)if(R){let C=r.filter(D=>!v.includes(D));e.onSelectionChange(C);}else {let C=Array.from(new Set([...r,...v]));e.onSelectionChange(C);}},onClick:P=>P.stopPropagation(),sx:{p:.5}})}),p&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",sx:{width:44},children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:.25},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)?u?.(m.id):f?.(m.id);},sx:{p:.25},children:g?.(m.id)?jsxRuntime.jsx(qh__default.default,{fontSize:"small"}):jsxRuntime.jsx(Kh__default.default,{fontSize:"small"})})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>c&&c(m.id),sx:{p:.25},children:b?jsxRuntime.jsx(Qh__default.default,{}):jsxRuntime.jsx(ef__default.default,{})})]})}),jsxRuntime.jsx(material.TableCell,{colSpan:a.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 b=m.data||m,v=m.id||b.id||y,E=h(v),R=`enhanced-table-checkbox-${y}`,B=(m.level!==void 0?m.level:0)*4;return jsxRuntime.jsxs(material.TableRow,{hover:true,onClick:P=>n&&n(P,b),role:"checkbox","aria-checked":E,tabIndex:-1,selected:E,sx:{cursor:"pointer"},children:[w&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",sx:{pl:B>0?B+1:void 0},children:jsxRuntime.jsx(material.Checkbox,{color:"primary",checked:E,inputProps:{"aria-labelledby":R}})}),p&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",sx:{width:44}}),i.filter(P=>a.includes(P.id)).map((P,C)=>{let T=!w&&C===0&&B>0?{pl:B+2}:{};return jsxRuntime.jsx(material.TableCell,{align:"left",sx:T,children:P.render?P.render(b[P.id],b):(function(){let A=b[P.id];if(P.numeric){if(typeof A=="number")return A.toLocaleString();if(typeof A=="string"&&A.trim()!==""&&!isNaN(Number(A)))return Number(A).toLocaleString()}return A})()},P.id)})]},v)}}),o.length===0&&jsxRuntime.jsx(material.TableRow,{children:jsxRuntime.jsx(material.TableCell,{colSpan:S,align:"center",children:t("common.noData")})})]})};var ap=e=>{let{visibleColumns:t,summaryRow:o,selectionMode:a,grouping:r=[]}=e;if(!e.showSummary)return null;let n=a==="multiple"||a==="single",i=r.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:{bgcolor:"background.paper"}}),i&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",sx:{bgcolor:"background.paper",width:44}}),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 np=e=>{let{t}=ee();return jsxRuntime.jsx(material.Box,{sx:{p:2},children:jsxRuntime.jsx(material.Typography,{children:t("table.mobile.notImplemented")})})};var Wr=({groupAnchorEl:e,setGroupAnchorEl:t,grouping:o,setGrouping:a,columns:r,toggleGroupField:n})=>{let{t:i}=ee();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:()=>a([]),startIcon:jsxRuntime.jsx(my__default.default,{}),children:i("table.menu.clearAll")})]}),jsxRuntime.jsx(material.Divider,{}),r.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)})]})},$r=({anchorEl:e,setAnchorEl:t,columns:o,visibleColumns:a,toggleColumnVisibility:r})=>{let{t:n}=ee();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:()=>r(i.id),children:[jsxRuntime.jsx(material.Checkbox,{checked:a.includes(i.id),size:"small"}),jsxRuntime.jsx(material.ListItemText,{primary:i.label})]},i.id))]})},Ni=({anchorEl:e,setAnchorEl:t,showSummary:o,setShowSummary:a,columns:r,summaryColumns:n,toggleSummaryColumn:i})=>{let{t:c}=ee();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=>a(d.target.checked),size:"small"}),label:c("table.menu.showSummaryRow")})}),jsxRuntime.jsx(material.Divider,{}),r.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)),r.filter(d=>d.numeric).length===0&&jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.ListItemText,{primary:c("table.menu.noNumericColumns")})})]})},Vi=({contextMenu:e,handleCloseContextMenu:t,columns:o,visibleColumns:a,toggleColumnVisibility:r})=>{let{t:n}=ee();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:()=>r(i.id),children:[jsxRuntime.jsx(material.ListItemIcon,{children:a.includes(i.id)&&jsxRuntime.jsx(uy__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{children:i.label})]},i.id))]})};var Vn=(e,t=2)=>e.toLocaleString(void 0,{maximumFractionDigits:t}),sp=({kpis:e})=>{let{t}=ee(),o=[{label:t("graph.kpi.totalRecords"),value:Vn(e.totalRecords,0),color:"text.primary"},{label:t("graph.kpi.totalReport"),value:Vn(e.totalReportHours),color:"text.primary"},{label:t("graph.kpi.totalBillable"),value:Vn(e.totalBillableHours),color:"success.main"},{label:t("graph.kpi.efficiency"),value:`${e.efficiency.toFixed(2)}%`,color:"warning.main"},{label:t("graph.kpi.amount"),value:Vn(e.totalAmount),color:"info.main"},{label:t("graph.kpi.flagged"),value:Vn(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(a=>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:a.label}),jsxRuntime.jsx(material.Typography,{variant:"h4",fontWeight:800,sx:{color:a.color},children:a.value})]},a.label))})};var Oi=({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 Hn=({data:e,orientation:t="horizontal",valueSuffix:o="",minHeight:a=210,activeName:r,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:a},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===r?"primary.dark":"primary.main",borderRadius:"8px 8px 0 0",cursor:n?"pointer":"default",opacity:r&&c.name!==r?.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:r&&c.name!==r?.45:1},children:jsxRuntime.jsx(material.Box,{sx:{width:`${c.value/i*100}%`,height:"100%",bgcolor:c.name===r?"primary.dark":"primary.main"}})}),jsxRuntime.jsxs(material.Typography,{variant:"caption",sx:{textAlign:"right",fontWeight:600},children:[c.value.toFixed(1),o]})]},c.name))})};var pp=({data:e,color:t="#42A5F5",valueSuffix:o="",height:a=220})=>{if(e.length===0)return jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:"No data"});let r=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,u)=>{let h=n+u*(r-n*2)/Math.max(e.length-1,1),w=a-n-(f.value-c)/l*(a-n*2);return {x:h,y:w,...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 ${r} ${a}`,sx:{width:"100%",height:a},children:[jsxRuntime.jsx("line",{x1:n,y1:a-n,x2:r-n,y2:a-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 up=({data:e,barColor:t="#64B5F6",lineColor:o="#FFB74D",height:a=220})=>{if(e.length===0)return jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:"No data"});let r=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=(r-n*2)/e.length,u=Math.max(f*.5,8),h=n+g*f+(f-u)/2,w=s.barValue/i*(a-n*2),p=a-n-w;return {x:h,y:p,barHeight:w,barWidth:u,item:s}}),l=e.map((s,g)=>{let f=(r-n*2)/e.length,u=n+g*f+f/2,h=a-n-s.lineValue/c*(a-n*2);return {x:u,y:h,item:s}});return jsxRuntime.jsxs(material.Stack,{spacing:1.25,children:[jsxRuntime.jsxs(material.Box,{component:"svg",viewBox:`0 0 ${r} ${a}`,sx:{width:"100%",height:a},children:[jsxRuntime.jsx("line",{x1:n,y1:a-n,x2:r-n,y2:a-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 Cy=e=>`rgba(30, 136, 229, ${.2+Math.max(0,Math.min(1,e))*.8})`,gp=({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))),a=Math.max(...e.map(n=>n.value),1),r=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=r.get(`${n}__${i}`)||0,d=c/a;return jsxRuntime.jsx(material.Box,{sx:{height:36,borderRadius:1,bgcolor:Cy(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 ky=["#1E88E5","#1ABC9C","#FBC02D","#EF5350","#7E57C2","#78909C"],qi=({data:e,variant:t="donut",colors:o=ky,size:a=180,activeName:r,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:a,height:a,borderRadius:"50%",background:`conic-gradient(${c.join(", ")})`,position:"relative",flexShrink:0},children:t==="donut"&&jsxRuntime.jsx(material.Box,{sx:{position:"absolute",inset:Math.round(a*.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:r&&d.name!==r?.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 hp=({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((r,n)=>n%2===0),a=t.filter((r,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(r=>jsxRuntime.jsxs(material.Box,{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",fontWeight:700,children:r.title}),r.causes.map(n=>jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:n},n))]},r.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(a.length,1)}, minmax(0, 1fr))`,gap:1},children:a.map(r=>jsxRuntime.jsxs(material.Box,{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",fontWeight:700,children:r.title}),r.causes.map(n=>jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:n},n))]},r.title))})]})};var bp=({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,a=e.map(g=>{let f=g.type==="total"?0:o,u=g.type==="total"?g.value:o+g.value;return g.type!=="total"&&(o=u),{...g,start:f,end:u,delta:u-f}}),r=a.flatMap(g=>[g.start,g.end]),n=Math.min(...r,0),i=Math.max(...r,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)"}),a.map((g,f)=>{let u=(c-d*2)/a.length,h=Math.max(u*.55,8),w=d+f*u+(u-h)/2,p=s(Math.max(g.start,g.end)),S=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:w,y:p,width:h,height:Math.max(S-p,4),rx:6,fill:m}),jsxRuntime.jsx("text",{x:w+h/2,y:p-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(${a.length}, minmax(0, 1fr))`,gap:1},children:a.map(g=>jsxRuntime.jsx(material.Typography,{variant:"caption",noWrap:true,title:g.name,children:g.name},g.name))})]})};var Gn=({apiKey:e,query:t,zoom:o=14,mapType:a="roadmap"})=>{let r=encodeURIComponent(t);return `https://www.google.com/maps/embed/v1/place?key=${encodeURIComponent(e)}&q=${r}&zoom=${o}&maptype=${a}`},aR=(e,t=360)=>{let o=Gn(e);return `<iframe width="100%" height="${t}" style="border:0" loading="lazy" allowfullscreen referrerpolicy="no-referrer-when-downgrade" src="${o}"></iframe>`};var Cp=({apiKey:e,query:t,embedUrl:o,zoom:a=14,mapType:r="roadmap",height:n=320})=>{let i=o||(e&&t?Gn({apiKey:e,query:t,zoom:a,mapType:r}):"");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 Zi=({keyword:e,location:t,src:o="orbcafe-ui"})=>{if(t){let a=encodeURIComponent(t.name||e||"Location");return `https://uri.amap.com/marker?position=${t.lng},${t.lat}&name=${a}&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 Tp=({keyword:e,location:t,embedUrl:o,height:a=320})=>{let r=o||Zi({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:r,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",sx:{width:"100%",height:a,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:r,target:"_blank",rel:"noreferrer",children:"AMap"})]})]})};var Ip=({billableByPrimary:e,efficiencyBySecondary:t,statusDistribution:o,interaction:a})=>{let{t:r}=ee();return jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",lg:"1.2fr 1.2fr 1fr"}},children:[jsxRuntime.jsx(Oi,{title:r("graph.chart.billable.title"),subtitle:r("graph.chart.billable.subtitle"),children:jsxRuntime.jsx(Hn,{data:e,orientation:"horizontal",activeName:a?.filters?.primaryDimension,onItemClick:n=>a?.onPrimaryDimensionClick?.(n.name)})}),jsxRuntime.jsx(Oi,{title:r("graph.chart.efficiency.title"),subtitle:r("graph.chart.efficiency.subtitle"),children:jsxRuntime.jsx(Hn,{data:t,orientation:"vertical",valueSuffix:"%",activeName:a?.filters?.secondaryDimension,onItemClick:n=>a?.onSecondaryDimensionClick?.(n.name)})}),jsxRuntime.jsx(Oi,{title:r("graph.chart.status.title"),subtitle:r("graph.chart.status.subtitle"),children:jsxRuntime.jsx(qi,{data:o,variant:"donut",activeName:a?.filters?.status,onItemClick:n=>a?.onStatusClick?.(n.name)})})]})};var Qt=e=>jsxRuntime.jsx(material.TextField,{...e,variant:e.variant||"outlined",size:e.size||"small",fullWidth:e.fullWidth!==void 0?e.fullWidth:true});var Xs=e=>jsxRuntime.jsx(material.TextField,{...e,multiline:true,minRows:3,fullWidth:true,variant:"outlined"});var Wy=["doubao-lite","gpt-4o-mini","gpt-4.1-mini","claude-3.5-sonnet"],$y=["zh","en","de","fr","ja","ko"],Dp=({open:e,onClose:t,value:o,onSaveAll:a,modelOptions:r=Wy,promptLangOptions:n=$y,analysisTemplateOptions:i=[],responseTemplateOptions:c=[],defaultAnalysisTemplateId:d,defaultResponseTemplateId:l})=>{let[s,g]=St.useState(o),[f,u]=St.useState(d||""),[h,w]=St.useState(l||""),[p,S]=St.useState(false);St.useEffect(()=>{e&&(g(o),u(d||""),w(l||""));},[e,o,d,l]);let m=(b,v)=>{g(E=>({...E,[b]:v}));},y=async()=>{if(a)try{S(!0),await a({settings:s,analysisTemplateId:f||void 0,responseTemplateId:h||void 0});}finally{S(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(dh__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(Qt,{size:"small",value:s.baseUrl,onChange:b=>m("baseUrl",b.target.value),fullWidth:true,label:"Base URL"})}),jsxRuntime.jsx(material.Box,{children:jsxRuntime.jsx(Qt,{size:"small",type:"password",value:s.apiKey,onChange:b=>m("apiKey",b.target.value),fullWidth:true,label:"API Key"})}),jsxRuntime.jsx(material.Box,{children:jsxRuntime.jsx(Qt,{size:"small",value:s.model,onChange:b=>m("model",b.target.value),fullWidth:true,select:true,label:"Model",children:r.map(b=>jsxRuntime.jsx(material.MenuItem,{value:b,children:b},b))})}),jsxRuntime.jsx(material.Box,{children:jsxRuntime.jsx(Qt,{size:"small",value:s.promptLang,onChange:b=>m("promptLang",b.target.value),fullWidth:true,select:true,label:"Prompt Lang",children:n.map(b=>jsxRuntime.jsx(material.MenuItem,{value:b,children:b},b))})})]}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[jsxRuntime.jsxs(Qt,{size:"small",value:f,onChange:b=>u(b.target.value),fullWidth:true,select:true,label:"Analysis Template",children:[jsxRuntime.jsx(material.MenuItem,{value:"",children:"Default"}),i.map(b=>jsxRuntime.jsx(material.MenuItem,{value:b.id,children:b.label},b.id))]}),jsxRuntime.jsx(Xs,{multiline:true,minRows:8,value:s.analysisPrompt,onChange:b=>m("analysisPrompt",b.target.value),fullWidth:true,label:"Analysis Prompt",sx:{"& .MuiInputBase-root":{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"}}}),jsxRuntime.jsxs(Qt,{size:"small",value:h,onChange:b=>w(b.target.value),fullWidth:true,select:true,label:"Response Template",children:[jsxRuntime.jsx(material.MenuItem,{value:"",children:"Default"}),c.map(b=>jsxRuntime.jsx(material.MenuItem,{value:b.id,children:b.label},b.id))]}),jsxRuntime.jsx(Xs,{multiline:true,minRows:8,value:s.responsePrompt,onChange:b=>m("responsePrompt",b.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:y,disabled:!a||p,children:"Save"})]})]})};var el=({open:e,onClose:t,model:o,tableContent:a,extraCharts:r,interaction:n,aiAssistant:i})=>{let{t:c}=ee(),[d,l]=St.useState(i?.defaultPrompt||""),[s,g]=St.useState(false),[f,u]=St.useState(false),h=n?.enabled!==false&&!!n,w=i?.enabled!==false,p=n?.filters||{},S=!!(p.primaryDimension||p.secondaryDimension||p.status),m=i?.placeholder||"Ask AI to analyze data, create charts, or find insights...";St.useEffect(()=>{e&&l(i?.defaultPrompt||"");},[e,i?.defaultPrompt]);let y=i?.settings||{baseUrl:"/llm-api",apiKey:"",model:"doubao-lite",promptLang:"zh",analysisPrompt:"",responsePrompt:""},b=async()=>{let v=d.trim();if(!(!v||!i?.onSubmit))try{g(!0),await i.onSubmit(v,{filters:p,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})}),h&&p.primaryDimension&&jsxRuntime.jsx(material.Chip,{size:"small",variant:"outlined",label:`${n?.fieldMapping.primaryDimension}: ${p.primaryDimension}`,onDelete:()=>n?.onClearFilter("primaryDimension")}),h&&p.secondaryDimension&&jsxRuntime.jsx(material.Chip,{size:"small",variant:"outlined",label:`${n?.fieldMapping.secondaryDimension}: ${p.secondaryDimension}`,onDelete:()=>n?.onClearFilter("secondaryDimension")}),h&&p.status&&jsxRuntime.jsx(material.Chip,{size:"small",variant:"outlined",label:`${n?.fieldMapping.status}: ${p.status}`,onDelete:()=>n?.onClearFilter("status")}),h&&S&&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:[w&&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(jy__default.default,{sx:{fontSize:18,color:"text.secondary"}})}),jsxRuntime.jsx(material.InputBase,{fullWidth:true,value:d,onChange:v=>l(v.target.value),onKeyDown:v=>{v.key==="Enter"&&(v.preventDefault(),b());},placeholder:m,sx:{fontSize:"0.9rem"}}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:b,disabled:s||!d.trim(),children:jsxRuntime.jsx(Xy__default.default,{sx:{fontSize:18}})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>u(true),children:jsxRuntime.jsx(Zy__default.default,{sx:{fontSize:18}})})]}),jsxRuntime.jsx(material.IconButton,{onClick:t,children:jsxRuntime.jsx(dh__default.default,{})})]})]})}),jsxRuntime.jsxs(material.Box,{sx:{p:2,display:"flex",flexDirection:"column",gap:1.5,overflow:"auto",minHeight:0},children:[jsxRuntime.jsx(sp,{kpis:o.kpis}),jsxRuntime.jsx(Ip,{billableByPrimary:o.charts.billableByPrimary,efficiencyBySecondary:o.charts.efficiencyBySecondary,statusDistribution:o.charts.statusDistribution,interaction:h?{filters:p,onPrimaryDimensionClick:v=>n?.onPrimaryDimensionClick(v),onSecondaryDimensionClick:v=>n?.onSecondaryDimensionClick(v),onStatusClick:v=>n?.onStatusClick(v)}:void 0}),r,a]}),jsxRuntime.jsx(Dp,{open:f,onClose:()=>u(false),value:y,onSaveAll:i?.onSaveAll,modelOptions:i?.modelOptions,promptLangOptions:i?.promptLangOptions,analysisTemplateOptions:i?.analysisTemplateOptions,responseTemplateOptions:i?.responseTemplateOptions,defaultAnalysisTemplateId:i?.defaultAnalysisTemplateId,defaultResponseTemplateId:i?.defaultResponseTemplateId})]})})};var Va={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"]},Qy=5,Mp=e=>e.toLowerCase().replace(/[\s_-]/g,""),Oa=(e,t,o,a)=>{if(t)return t;if(e.length===0)return a;let r=Object.keys(e[0]),n=new Map(r.map(i=>[Mp(i),i]));for(let i of o){let c=n.get(Mp(i));if(c)return c}return r[0]||a},yo=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},_t=(e,t)=>e==null||e===""?t:String(e),Jy=(e,t,o,a,r)=>{let n=new Map;return e.forEach(i=>{let c=_t(i[t],r);n.set(c,(n.get(c)||0)+yo(i[o]));}),Array.from(n.entries()).map(([i,c])=>({name:i,value:c})).sort((i,c)=>c.value-i.value).slice(0,a)},eb=(e,t,o,a,r,n)=>{let i=new Map;return e.forEach(c=>{let d=_t(c[t],n),l=i.get(d)||{report:0,billable:0};l.report+=yo(c[o]),l.billable+=yo(c[a]),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,r)},tb=(e,t,o)=>{let a=e.length;if(a===0)return [];let r=new Map;return e.forEach(n=>{let i=_t(n[t],o);r.set(i,(r.get(i)||0)+1);}),Array.from(r.entries()).map(([n,i])=>({name:n,value:i,percent:i/a*100}))},Ap=(e,t,o)=>{let a=new Map;return e.forEach(r=>{let n=_t(r[t],"N/A");a.set(n,(a.get(n)||0)+yo(r[o]));}),Array.from(a.entries()).sort(([r],[n])=>r.localeCompare(n)).map(([r,n])=>({name:r,value:n}))},ob=(e,t,o,a,r,n)=>{let i=new Map;return e.forEach(c=>{let d=_t(c[t],n),l=i.get(d)||{report:0,billable:0};l.report+=yo(c[o]),l.billable+=yo(c[a]),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,r)},ab=(e,t,o,a,r)=>{let n=new Map;return e.forEach(i=>{let c=_t(i[t],r),d=_t(i[o],r),l=`${c}__${d}`;n.set(l,(n.get(l)||0)+yo(i[a]));}),Array.from(n.entries()).map(([i,c])=>{let[d,l]=i.split("__");return {x:d,y:l,value:c}})},rb=(e,t,o)=>{let a=Ap(e,t,o),r=a.map(i=>({name:i.name,value:i.value,type:"delta"})),n=a.reduce((i,c)=>i+c.value,0);return [...r,{name:"Total",value:n,type:"total"}]},nb=(e,t,o,a,r,n)=>{let i=new Map;return e.forEach(c=>{let d=_t(c[t],n),l=`${_t(c[o],n)} / ${_t(c[a],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,r).map(([l,s])=>`${l} (${s})`)})).slice(0,6)},Qr=({rows:e,config:t})=>{let{t:o}=ee(),a=o("graph.unassigned"),r=St.useMemo(()=>{let s=t?.fieldMapping;return {primaryDimension:Oa(e,s?.primaryDimension,Va.primaryDimension,"Category"),secondaryDimension:Oa(e,s?.secondaryDimension,Va.secondaryDimension,"Owner"),status:Oa(e,s?.status,Va.status,"Status"),date:Oa(e,s?.date,Va.date,"Date"),description:Oa(e,s?.description,Va.description,"Description"),reportHours:Oa(e,s?.reportHours,Va.reportHours,"ReportHours"),billableHours:Oa(e,s?.billableHours,Va.billableHours,"BillableHours"),amount:Oa(e,s?.amount,Va.amount,"Amount")}},[e,t?.fieldMapping]),n=St.useMemo(()=>e.map((s,g)=>{let f=yo(s[r.reportHours]),u=yo(s[r.billableHours]),h=yo(s[r.amount]),w=f>0?u/f*100:0;return {id:`graph-row-${g}`,Date:_t(s[r.date],""),Primary:_t(s[r.primaryDimension],a),Secondary:_t(s[r.secondaryDimension],a),Description:_t(s[r.description],""),ReportHours:f,BillableHours:u,Amount:h,Efficiency:w,Status:_t(s[r.status],a)}}),[e,r,a]),i=St.useMemo(()=>{let s=n.length,g=n.reduce((S,m)=>S+yo(m.ReportHours),0),f=n.reduce((S,m)=>S+yo(m.BillableHours),0),u=n.reduce((S,m)=>S+yo(m.Amount),0),h=g>0?f/g*100:0,w=t?.statusFlagValues||["flag","flagged","warning","risk"],p=n.filter(S=>w.includes(_t(S.Status,"").toLowerCase())).length;return {totalRecords:s,totalReportHours:g,totalBillableHours:f,efficiency:h,totalAmount:u,flaggedCount:p}},[n,t?.statusFlagValues]),c=t?.topN||Qy,d=St.useMemo(()=>({billableByPrimary:Jy(n,"Primary","BillableHours",c,a),efficiencyBySecondary:eb(n,"Secondary","ReportHours","BillableHours",c,a),statusDistribution:tb(n,"Status",a),lineByDate:Ap(n,"Date","BillableHours"),comboByPrimary:ob(n,"Primary","ReportHours","BillableHours",c,a),heatmapPrimarySecondary:ab(n,"Primary","Secondary","BillableHours",a),waterfallBillable:rb(n,"Date","BillableHours"),fishboneStatusCauses:nb(n,"Status","Primary","Secondary",3,a)}),[n,c,a]),l=St.useMemo(()=>({title:t?.title||o("graph.reportTitle"),kpis:i,charts:d,table:{columns:[{id:"Date",label:r.date},{id:"Primary",label:r.primaryDimension},{id:"Secondary",label:r.secondaryDimension},{id:"Description",label:r.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:r.status}],rows:n}}),[d,t?.title,r,i,n,o]);return {fieldMapping:r,model:l}};var Jr=e=>String(e??"").trim(),ol=(e={})=>{let[t,o]=St.useState(e),a=St.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}});},[]),r=St.useCallback(d=>{o(l=>{if(!l[d])return l;let s={...l};return delete s[d],s});},[]),n=St.useCallback(()=>{o({});},[]),i=St.useMemo(()=>!!(t.primaryDimension||t.secondaryDimension||t.status),[t]),c=St.useCallback((d,l)=>d.filter(s=>!(t.primaryDimension&&Jr(s[l.primaryDimension])!==Jr(t.primaryDimension)||t.secondaryDimension&&Jr(s[l.secondaryDimension])!==Jr(t.secondaryDimension)||t.status&&Jr(s[l.status])!==Jr(t.status))),[t]);return {filters:t,setFilter:a,clearFilter:r,clearAll:n,hasActiveFilters:i,applyRows:c}};var rl=({variants:e,currentVariantId:t,onLoad:o,onSave:a,onDelete:r,onSetDefault:n})=>{let{t:i}=ee(),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]=St.useState(false),[u,h]=St.useState(""),[w,p]=St.useState(false),[S,m]=St.useState(false),y=e.find(E=>E.id===t),b=()=>{h(y?.name||i("variant.newVariant")),p(y?.isDefault||false),m(y?.isPublic||false),f(true);},v=()=>{a({name:u,isDefault:w,isPublic:S,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:y||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)=>jsxRuntime.jsx("li",{...E,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(yb__default.default,{fontSize:"small",color:"action"})]})})}),jsxRuntime.jsx(material.Tooltip,{title:i("variant.saveView"),children:jsxRuntime.jsx(material.IconButton,{onClick:b,size:"small",color:"primary",children:jsxRuntime.jsx(Qp__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:u,onChange:E=>h(E.target.value)}),jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{checked:w,onChange:E=>p(E.target.checked)}),label:i("variant.setDefault")}),jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{checked:S,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:v,variant:"contained",children:i("common.save")})]})]})]})};var Op=({appId:e,tableKey:t="default",currentFilters:o,currentLayoutId:a,layoutRefs:r,onLoad:n,variantService:i,serviceUrl:c,onError:d,onSuccess:l,currentVariantId:s,onVariantChange:g})=>{let{t:f}=ee(),[u,h]=St.useState([]),[w,p]=St.useState(""),S=`orbcafe.variants.${e}.${t}`,m=s!==void 0?s:w,y=D=>{s===void 0&&p(D),g&&g(D);},b=St.useCallback(()=>{try{let D=localStorage.getItem(S);if(!D)return [];let T=JSON.parse(D);return Array.isArray(T)?T:[]}catch{return []}},[S]),v=St.useCallback(D=>{try{localStorage.setItem(S,JSON.stringify(D));}catch{}},[S]),E=St.useCallback(D=>{h(D);let T=D.find(I=>I.isDefault);T&&!m&&(y(T.id),n(T));},[m,n,y]),R=St.useCallback(async()=>{if(!e)return [];try{let D=[];if(i)D=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(f("variant.toast.fetchFailed"));D=await T.json();}else D=b();return E(D),D}catch(D){console.error("Error fetching variants",D);let T=b();return E(T),d&&d(f("variant.toast.fetchFailed")),T}},[e,t,i,c,b,E,d,f]);return St.useEffect(()=>{R();},[e,t]),jsxRuntime.jsx(rl,{variants:u,currentVariantId:m,onLoad:D=>{y(D.id),n(D);},onSave:async D=>{let T=Date.now().toString(),I;try{let A=D.scope||"Both",W=u.find(ne=>ne.name===D.name);T=W?W.id:Date.now().toString();let z=[];if(W&&(Array.isArray(W.filters)?z=[...W.filters]:W.filters&&(z=[{scope:"default",filters:W.filters}])),A==="Search"||A==="Both"){let ne=(Array.isArray(o),o);if(ne)if(Array.isArray(ne)&&ne.length>0&&ne[0].scope)ne.forEach(ae=>{let _=z.findIndex(Ue=>Ue.scope===ae.scope);_>=0?z[_]=ae:z.push(ae);});else {let ae={scope:t,filters:ne},_=z.findIndex(Ue=>Ue.scope===t);_>=0?z[_]=ae:z.push(ae);}}let Q=W?.layout||{},re=[];if(W&&Array.isArray(W.layoutRefs)&&(re=[...W.layoutRefs]),A==="Layout"||A==="Both")if(r&&r.length>0)r.forEach(ne=>{let ae=re.findIndex(_=>_.tableKey===ne.tableKey);ae>=0?re[ae]=ne:re.push(ne);});else {let ne={tableKey:t,layoutId:a||null},ae=re.findIndex(_=>_.tableKey===t);ae>=0?re[ae]=ne:re.push(ne);}if(I={appId:e,tableKey:t,...D,scope:A,id:T,createdAt:new Date().toISOString(),filters:z,layout:Q,layoutRefs:re},i)await i.saveVariant(I,e,t);else if(c){if(!(await fetch(`${c}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(I)})).ok)throw new Error(f("variant.toast.saveFailed"))}else {let ae=u.some(_=>_.id===T)?u.map(_=>_.id===T?I:_):[...u,I];h(ae),v(ae);}l&&l(f("variant.toast.saveSuccess")),(i||c)&&await R(),y(T),n(I);}catch(A){console.error("Error saving variant",A);let z=u.some(Q=>Q.id===T)?u.map(Q=>Q.id===T?I:Q):[...u,I];h(z),v(z),y(T),n(I),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 T=u.filter(I=>I.id!==D);h(T),v(T);}m===D&&y(""),(i||c)&&R(),l&&l(f("variant.toast.deleteSuccess"));}catch(T){console.error("Error deleting variant",T);let I=u.filter(A=>A.id!==D);h(I),v(I),m===D&&y(""),d&&d(f("variant.toast.deleteFailed"));}},onSetDefault:async D=>{try{let T=u.find(A=>A.id===D);if(!T)return;let I={appId:e,tableKey:t,...T,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(I)})).ok)throw new Error(f("variant.toast.defaultFailed"))}else {let A=u.map(W=>({...W,isDefault:W.id===D}));h(A),v(A);}(i||c)&&await R(),l&&l(f("variant.toast.defaultSuccess"));}catch(T){console.error("Error setting default variant",T);let I=u.map(A=>({...A,isDefault:A.id===D}));h(I),v(I),d&&d(f("variant.toast.defaultFailed"));}}})};na__default.default.extend(Lb__default.default);na__default.default.extend(zb__default.default);var Nb=[null,null],tc="0.85rem",Vb={en:"en",zh:"zh-cn",fr:"fr",de:"de",ja:"ja",ko:"ko"},Ob=material.styled(PickersDay.PickersDay,{shouldForwardProp:e=>e!=="isInRange"&&e!=="isStart"&&e!=="isEnd"&&e!=="isHovered"})(({theme:e,isInRange:t,isStart:o,isEnd:a,isHovered:r})=>({...t&&{borderRadius:0,backgroundColor:e.palette.primary.light,color:e.palette.primary.contrastText,"&:hover":{backgroundColor:e.palette.primary.main}},...r&&!t&&!o&&!a&&{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}},...a&&{borderRadius:"0 50% 50% 0",backgroundColor:e.palette.primary.main,color:e.palette.primary.contrastText,"&:hover":{backgroundColor:e.palette.primary.dark}},...o&&a&&{borderRadius:"50%"}})),$p=({label:e,value:t=Nb,onChange:o})=>{let{t:a,locale:r}=ee(),n=Vb[r]||"en",i=e||a("dateRange.label"),[c,d]=St.useState(null),[l,s]=St.useState(t),[g,f]=St.useState("start"),[u,h]=St.useState(null),[w,p]=St.useState((t[0]||na__default.default()).locale(n)),S=St__namespace.default.useRef(t);St.useEffect(()=>{let[T,I]=t,[A,W]=S.current,z=ne=>ne&&typeof ne.isSame=="function",Q=!(T===null&&A===null||z(T)&&z(A)&&T.isSame(A,"day")),re=!(I===null&&W===null||z(I)&&z(W)&&I.isSame(W,"day"));(Q||re)&&(s(t),t[0]&&z(t[0])&&p(t[0].locale(n))),S.current=t;},[t,n]);let m=T=>{d(T.currentTarget);},y=()=>{d(null),f("start"),h(null);},b=!!c,v=T=>{if(!T)return;let I=[...l];if(g==="start")I=[T,null],f("end");else {let A=I[0];A&&T.isBefore(A)?(I=[T,null],f("end")):(I=[A,T],f("start"));}s(I);},E=T=>{let I=na__default.default().locale(n),A=[null,null];switch(T){case "today":A=[I,I];break;case "week":A=[I.startOf("week"),I.endOf("week")];break;case "month":A=[I.startOf("month"),I.endOf("month")];break}s(A),f("start"),p(I);},R=()=>{s([null,null]),f("start"),p(na__default.default().locale(n));},k=()=>{o&&o(l),y();},B=()=>{s(t),f("start"),y();},P=St.useCallback(T=>{let{day:I,...A}=T,[W,z]=l,Q=W?I.isSame(W,"day"):false,re=z?I.isSame(z,"day"):false,ne=W&&z?I.isBetween(W,z,"day","()"):false,ae=false;return g==="end"&&W&&!z&&u&&I.isAfter(W,"day")&&I.isBefore(u.add(1,"day"),"day")&&(ae=true),jsxRuntime.jsx(Ob,{...A,day:I,disableMargin:true,isStart:Q,isEnd:re,isInRange:ne||ae,onMouseEnter:()=>h(I)})},[l,g,u]),C=T=>T?T.locale(n).format("YYYY-MM-DD"):"",D=T=>T?T.locale(n).format("ll"):"";return jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsx(material.TextField,{label:i,value:l[0]?`${C(l[0])} - ${C(l[1])}`:"",onClick:m,fullWidth:true,size:"small",InputLabelProps:{sx:{fontSize:tc}},InputProps:{readOnly:true,sx:{fontSize:tc,"& .MuiOutlinedInput-input":{fontSize:tc},paddingRight:"4px"},endAdornment:jsxRuntime.jsxs(material.InputAdornment,{position:"end",sx:{ml:0},children:[(l[0]||l[1])&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:T=>{T.stopPropagation(),R();},edge:"end",sx:{mr:.5,padding:"2px"},children:jsxRuntime.jsx(ch__default.default,{sx:{fontSize:"1rem"}})}),jsxRuntime.jsx(material.IconButton,{size:"small",edge:"end",onClick:m,sx:{padding:"2px"},children:jsxRuntime.jsx(Bb__default.default,{sx:{fontSize:"1rem"},color:"action"})})]})}}),jsxRuntime.jsxs(material.Popover,{open:b,anchorEl:c,onClose:y,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{sx:{display:"flex",flexDirection:"column",p:0,minWidth: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:2,justifyContent:"space-between",children:[jsxRuntime.jsxs(material.Box,{sx:{p:1,border:1,borderColor:g==="start"?"primary.main":"divider",borderRadius:1,bgcolor:g==="start"?"action.hover":"transparent",flex:1,cursor:"pointer"},onClick:()=>f("start"),children:[jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",display:"block",children:a("dateRange.startDate")}),jsxRuntime.jsx(material.Typography,{variant:"body2",fontWeight:500,children:l[0]?D(l[0]):a("dateRange.select")})]}),jsxRuntime.jsx(Fb__default.default,{color:"action",fontSize:"small"}),jsxRuntime.jsxs(material.Box,{sx:{p:1,border:1,borderColor:g==="end"?"primary.main":"divider",borderRadius:1,bgcolor:g==="end"?"action.hover":"transparent",flex:1,cursor:"pointer"},onClick:()=>{l[0]&&f("end");},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",display:"block",children:a("dateRange.endDate")}),jsxRuntime.jsx(material.Typography,{variant:"body2",fontWeight:500,children:l[1]?D(l[1]):a("dateRange.select")})]})]})}),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:a("dateRange.today"),onClick:()=>E("today"),clickable:true,size:"small",variant:"outlined"}),jsxRuntime.jsx(material.Chip,{label:a("dateRange.thisWeek"),onClick:()=>E("week"),clickable:true,size:"small",variant:"outlined"}),jsxRuntime.jsx(material.Chip,{label:a("dateRange.thisMonth"),onClick:()=>E("month"),clickable:true,size:"small",variant:"outlined"})]})}),jsxRuntime.jsx(LocalizationProvider.LocalizationProvider,{dateAdapter:AdapterDayjs.AdapterDayjs,adapterLocale:n,children:jsxRuntime.jsx(DateCalendar.DateCalendar,{value:null,referenceDate:w,onMonthChange:p,onYearChange:p,onChange:v,slots:{day:P},views:["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:B,color:"inherit",children:a("common.cancel")}),jsxRuntime.jsx(material.Button,{size:"small",variant:"contained",onClick:k,children:a("common.done")})]})]})]})};var sl={equals:"=",contains:"\u2287",notContains:"\u2285",wildcard:"*","=":"=","!=":"!=",">":">","<":"<",">=":"\u2265","<=":"\u2264",between:"\u2194"},Xb={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"},Yb=["equals","contains","notContains","wildcard"],Kp=["=","!=",">","<",">=","<=","between"],ht="0.85rem",Qb=({field:e,value:t,onChange:o})=>{let{t:a}=ee(),[r,n]=St.useState(null),[i,c]=St.useState(null),[d,l]=St.useState(""),[s,g]=St.useState(""),[f,u]=St.useState(false),[h,w]=St.useState(""),[p,S]=St.useState("");St.useEffect(()=>{let C=setTimeout(()=>{S(h);},1e3);return ()=>clearTimeout(C)},[h]);let m=t?.operator||(e.type==="number"?"=":"equals"),y=t?.value,b=C=>{let D=Xb[C];return D?a(D):C},v=C=>{n(C.currentTarget);},E=C=>{o({...t,operator:C,value:y}),n(null);},R={size:"small",fullWidth:true,variant:"outlined",InputLabelProps:{sx:{fontSize:ht}},InputProps:{sx:{fontSize:ht}},SelectProps:{MenuProps:{PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:ht,paddingTop:"4px",paddingBottom:"4px",minHeight:"auto"}}}}}},k=e.type||"text";if(k==="date"){let D=(T=>{if(!T)return [null,null];if(Array.isArray(T)&&T.length===2){let I=T[0]?na__default.default.isDayjs(T[0])?T[0]:na__default.default(T[0]):null,A=T[1]?na__default.default.isDayjs(T[1])?T[1]:na__default.default(T[1]):null;return [I,A]}return na__default.default.isDayjs(T)||typeof T=="string"?[na__default.default.isDayjs(T)?T:na__default.default(T),null]:[null,null]})(y);return jsxRuntime.jsx($p,{label:e.label,value:D,onChange:T=>o({value:T,operator:"between"})})}if(k==="number"&&m==="between"){let C=()=>{o({value:[d,s],operator:"between"}),c(null);},D=Array.isArray(y)?`${y[0]||""} - ${y[1]||""}`:"";return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.TextField,{...R,label:e.label,value:D,placeholder:a("smartFilter.minMaxPlaceholder"),InputProps:{...R.InputProps,startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(material.Tooltip,{title:b("between"),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:v,sx:{width:24,height:24,fontSize:ht},children:sl.between})})}),readOnly:true},onClick:T=>c(T.currentTarget)}),jsxRuntime.jsx(material.Menu,{anchorEl:r,open:!!r,onClose:()=>n(null),PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:ht,minHeight:"auto",py:.5}}},children:Kp.map(T=>jsxRuntime.jsxs(material.MenuItem,{selected:T===m,onClick:()=>E(T),children:[jsxRuntime.jsx(material.Box,{sx:{width:24,display:"inline-block",fontWeight:"bold"},children:sl[T]}),jsxRuntime.jsx(material.ListItemText,{primary:b(T),primaryTypographyProps:{fontSize:ht}})]},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:a("smartFilter.min"),type:"number",value:d,onChange:T=>l(T.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:ht}},InputProps:{sx:{fontSize:ht}}}),jsxRuntime.jsx(Zb__default.default,{color:"action"}),jsxRuntime.jsx(material.TextField,{size:"small",label:a("smartFilter.max"),type:"number",value:s,onChange:T=>g(T.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:ht}},InputProps:{sx:{fontSize:ht}}}),jsxRuntime.jsx(material.Button,{variant:"contained",size:"small",onClick:C,children:a("common.ok")})]})})]})}if(e.isValueHelp||k==="value-help"){let C=e.valueHelp?.mode||"single";return jsxRuntime.jsx(Zd,{...R,...e.valueHelp,label:e.label,placeholder:e.placeholder||e.valueHelp?.placeholder,value:y??(C==="multiple"?[]:null),mode:C,onChange:D=>o({value:D,operator:C==="multiple"?"anyOf":"equals"})})}if(k==="select")return jsxRuntime.jsxs(material.TextField,{...R,select:true,label:e.label,value:y||"",onChange:C=>o({...t,value:C.target.value,operator:"equals"}),children:[jsxRuntime.jsx(material.MenuItem,{value:"",children:jsxRuntime.jsx("em",{children:a("common.none")})}),e.options?.map(C=>jsxRuntime.jsx(material.MenuItem,{value:C.value,children:C.label},C.value))]});if(k==="multi-select"){let C=Array.isArray(y)?y:[],D=e.options?.filter(T=>T.label.toLowerCase().includes(p.toLowerCase()))||[];return jsxRuntime.jsxs(material.TextField,{...R,select:true,label:e.label,value:C,onChange:T=>o({...t,value:T.target.value,operator:"anyOf"}),SelectProps:{...R.SelectProps,multiple:true,onClose:()=>{w(""),S("");},renderValue:T=>{if(!Array.isArray(T)||T.length===0)return jsxRuntime.jsx("em",{children:a("common.none")});let I=W=>e.options?.find(z=>z.value===W)?.label||W,A=T.map(I);return A.length>2?`${A.slice(0,2).join(", ")} +${A.length-2}`:A.join(", ")}},children:[jsxRuntime.jsx(material.ListSubheader,{children:jsxRuntime.jsx(material.TextField,{size:"small",autoFocus:true,placeholder:a("smartFilter.searchPlaceholder"),fullWidth:true,InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(Kd__default.default,{fontSize:"small"})}),sx:{fontSize:ht}},value:h,onChange:T=>w(T.target.value),onKeyDown:T=>{T.key!=="Escape"&&T.stopPropagation();},onClick:T=>T.stopPropagation()})}),D.length>0?D.map(T=>jsxRuntime.jsxs(material.MenuItem,{value:T.value,children:[jsxRuntime.jsx(material.Checkbox,{checked:C.indexOf(T.value)>-1,size:"small"}),jsxRuntime.jsx(material.ListItemText,{primary:T.label,primaryTypographyProps:{fontSize:ht}})]},T.value)):jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.ListItemText,{primary:a("smartFilter.noOptionsFound"),primaryTypographyProps:{fontSize:ht}})})]})}let B=k==="number"?Kp:Yb,P=f||y!==void 0&&y!==""&&y!==null||!!r;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.TextField,{...R,label:e.label,sx:{minWidth:"120px"},value:y||"",type:k==="number"?"number":"text",onChange:C=>o({...t,value:C.target.value,operator:m}),onFocus:()=>u(true),onBlur:()=>u(false),InputProps:{...R.InputProps,startAdornment:P?jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(material.Tooltip,{title:b(m),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:v,onMouseDown:C=>C.preventDefault(),sx:{width:24,height:24,fontSize:ht,fontWeight:"bold",color:"primary.main",bgcolor:"action.hover"},children:sl[m]})})}):null,endAdornment:e.hasSearchIcon?jsxRuntime.jsx(material.InputAdornment,{position:"end",children:jsxRuntime.jsx(Kd__default.default,{color:"action"})}):void 0}}),jsxRuntime.jsx(material.Menu,{anchorEl:r,open:!!r,onClose:()=>n(null),PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:ht,minHeight:"auto",py:.5}}},children:B.map(C=>jsxRuntime.jsxs(material.MenuItem,{selected:C===m,onClick:()=>E(C),children:[jsxRuntime.jsx(material.Box,{sx:{width:24,display:"inline-block",fontWeight:"bold"},children:sl[C]}),jsxRuntime.jsx(material.ListItemText,{primary:b(C),primaryTypographyProps:{fontSize:ht}})]},C))})]})},ha=({fields:e,filters:t,onFilterChange:o,variants:a=[],currentVariantId:r,onVariantLoad:n,onVariantSave:i,onVariantDelete:c,onVariantSetDefault:d,onSearch:l,loading:s=false,appId:g,tableKey:f,currentLayout:u,currentLayoutId:h,layoutRefs:w,variantService:p,serviceUrl:S})=>{let{t:m}=ee(),[y,b]=St.useState(true),[v,E]=St.useState(null),[R,k]=St.useState(e.filter(D=>!D.hidden).map(D=>D.id)),B=(D,T)=>{o({...t,[D]:T});},P=D=>{R.includes(D)?k(R.filter(T=>T!==D)):k([...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(Op,{appId:g,tableKey:f,currentFilters:{values:t,visibleFields:R},currentLayout:u,currentLayoutId:h,layoutRefs:w,onLoad:D=>{if(!D.filters)return;let T=null;if(Array.isArray(D.filters)){let I=f||"default",A=D.filters.find(W=>W.scope===I);T=A?A.filters:null;}else T=D.filters;T&&(T.values||T.visibleFields?(T.visibleFields&&Array.isArray(T.visibleFields)&&k(T.visibleFields),T.values&&o(T.values)):o(T)),n&&n(D);},variantService:p,serviceUrl:S,currentVariantId:r}):jsxRuntime.jsx(rl,{variants:a,currentVariantId:r,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(qb__default.default,{fontSize:"small"}),sx:{textTransform:"none",fontSize:ht,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:ht},children:m(s?"common.loading":"smartFilter.go")}),jsxRuntime.jsxs(material.Menu,{anchorEl:v,open:!!v,onClose:()=>E(null),slotProps:{paper:{style:{maxHeight:400,width:"25ch"},sx:{"& .MuiMenuItem-root":{fontSize:ht,minHeight:32}}}},children:[jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.ListItemText,{primary:m("smartFilter.visibleFilters"),primaryTypographyProps:{fontSize:ht}})}),jsxRuntime.jsx(material.Divider,{}),e.map(D=>jsxRuntime.jsxs(material.MenuItem,{onClick:()=>P(D.id),children:[jsxRuntime.jsx(material.Checkbox,{checked:R.includes(D.id),size:"small"}),jsxRuntime.jsx(material.ListItemText,{primary:D.label,primaryTypographyProps:{fontSize:ht}})]},D.id))]})]})]}),jsxRuntime.jsx(material.Collapse,{in:y,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(Qb,{field:D,value:t[D.id]||{value:"",operator:D.type==="number"?"=":"equals"},onChange:T=>B(D.id,T)})},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:()=>b(!y),sx:{bgcolor:"background.paper",boxShadow:2,border:"1px solid",borderColor:"divider",width:20,height:20,minHeight:0,p:0,"&:hover":{bgcolor:"background.paper"}},children:y?jsxRuntime.jsx(_b__default.default,{sx:{fontSize:16},color:"action"}):jsxRuntime.jsx(Qh__default.default,{sx:{fontSize:16},color:"action"})})})]})};var Jp=({layouts:e,currentLayoutId:t,onLoad:o,onSave:a,onDelete:r,onSetDefault:n})=>{let{t:i}=ee(),[c,d]=St.useState(null),[l,s]=St.useState(false),[g,f]=St.useState(""),[u,h]=St.useState(""),[w,p]=St.useState({isDefault:false,isPublic:false}),S=e.find(R=>R.id===t),m=R=>{d(R.currentTarget);},y=()=>{d(null);},b=R=>{o(R),y();},v=()=>{f(""),h(""),p({isDefault:false,isPublic:false}),s(true),y();},E=()=>{g.trim()&&(a({name:g,description:u,...w}),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:v,color:"primary",size:"small",children:jsxRuntime.jsx(Qp__default.default,{})})}),jsxRuntime.jsx(material.Tooltip,{title:i("layout.layoutOptions"),children:jsxRuntime.jsx(material.IconButton,{onClick:m,color:S?"primary":"default",children:jsxRuntime.jsx(dx__default.default,{})})}),jsxRuntime.jsxs(material.Menu,{anchorEl:c,open:!!c,onClose:y,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:v,children:[jsxRuntime.jsx(material.ListItemIcon,{children:jsxRuntime.jsx(Qp__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,k)=>jsxRuntime.jsx(material.MenuItem,{onClick:()=>b(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:B=>B.stopPropagation(),children:[jsxRuntime.jsx(material.Tooltip,{title:R.isDefault?i("layout.removeDefault"):i("layout.setAsDefault"),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:B=>{B.stopPropagation(),n(R.id);},children:R.isDefault?jsxRuntime.jsx(yb__default.default,{fontSize:"small",color:"warning"}):jsxRuntime.jsx(cx__default.default,{fontSize:"small"})})}),jsxRuntime.jsx(material.Tooltip,{title:i("common.delete"),children:jsxRuntime.jsx(material.IconButton,{size:"small",color:"error",onClick:B=>{B.stopPropagation(),r(R.id);},children:jsxRuntime.jsx(Eh__default.default,{fontSize:"small"})})})]})]})},R.id||k))]}),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:u,onChange:R=>h(R.target.value),fullWidth:true,size:"small"}),jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{checked:w.isDefault,onChange:R=>p({...w,isDefault:R.target.checked})}),label:i("layout.useAsDefault")}),jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{checked:w.isPublic,onChange:R=>p({...w,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 ul=({appId:e,tableKey:t="default",currentLayoutData:o,onLayoutLoad:a,targetLayoutId:r,activeLayoutId:n,serviceUrl:i,onError:c,onSuccess:d})=>{let{t:l}=ee(),[s,g]=St.useState([]),[f,u]=St.useState(""),h=`orbcafe.layouts.${e}.${t}`,w=k=>({id:k.layoutId,name:k.name,description:k.description??"",isDefault:!!k.isDefault,isPublic:!!k.isPublic,createdAt:k.createdAt??new Date().toISOString(),layoutData:k.layout??{}}),p=k=>({appId:e,tableKey:t,layoutId:k.id,name:k.name,description:k.description??"",isDefault:!!k.isDefault,isPublic:!!k.isPublic,createdAt:k.createdAt,layout:k.layoutData}),S=St.useCallback(()=>{try{let k=localStorage.getItem(h);if(!k)return [];let B=JSON.parse(k);return Array.isArray(B)?B:[]}catch{return []}},[h]),m=St.useCallback(k=>{try{localStorage.setItem(h,JSON.stringify(k));}catch{}},[h]);St.useEffect(()=>{n!==void 0&&u(n);},[n]),St.useEffect(()=>{if(r&&s.length>0){let k=s.find(B=>B.id===r);k&&(u(k.id),a(k));}},[r,s,a]);let y=St.useCallback(async()=>{if(e){if(!i){let k=S();g(k);let B=k.find(P=>P.isDefault);B&&!f&&!r&&(u(B.id),a(B));return}try{let k=await fetch(`${i}/api/layouts?appId=${encodeURIComponent(e)}&tableKey=${encodeURIComponent(t)}`);if(!k.ok)throw new Error("LAYOUT_FETCH_FAILED");let P=(await k.json()).map(w);g(P);let C=P.find(D=>D.isDefault);C&&!f&&!r&&(u(C.id),a(C));}catch(k){console.error("Error fetching layouts",k);let B=S();g(B);let P=B.find(C=>C.isDefault);P&&!f&&!r&&(u(P.id),a(P)),c&&c(l("layout.toast.loadFallback"));}}},[e,t,i,c,f,a,r,S,l]);return St.useEffect(()=>{y();},[e,t]),jsxRuntime.jsx(Jp,{layouts:s,currentLayoutId:f,onLoad:k=>{u(k.id),a(k);},onSave:async k=>{let B=s.find(D=>D.name===k.name),P=B?B.id:Date.now().toString(),C={id:P,...k,createdAt:new Date().toISOString(),layoutData:o,isDefault:k.isDefault??false,isPublic:k.isPublic??false};if(!i){let T=s.some(I=>I.id===P)?s.map(I=>I.id===P?C:I):[...s,C];g(T),m(T),u(P),a(C),d&&d(l("layout.toast.saveLocalSuccess"));return}try{if(!(await fetch(`${i}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(p(C))})).ok)throw new Error("LAYOUT_SAVE_FAILED");d&&d(l("layout.toast.saveSuccess")),await y(),u(P),a(C);}catch(D){console.error("Error saving layout",D);let I=s.some(A=>A.id===P)?s.map(A=>A.id===P?C:A):[...s,C];g(I),m(I),u(P),a(C),d&&d(l("layout.toast.saveLocalSuccess")),c&&c(l("layout.toast.backendUnavailableSavedLocal"));}},onDelete:async k=>{if(!i){let B=s.filter(P=>P.id!==k);g(B),m(B),f===k&&u(""),d&&d(l("layout.toast.deleteLocalSuccess"));return}try{if(!(await fetch(`${i}/api/layouts/${encodeURIComponent(k)}`,{method:"DELETE"})).ok)throw new Error("LAYOUT_DELETE_FAILED");f===k&&u(""),d&&d(l("layout.toast.deleteSuccess")),await y();}catch(B){console.error("Error deleting layout",B);let P=s.filter(C=>C.id!==k);g(P),m(P),f===k&&u(""),d&&d(l("layout.toast.deleteLocalSuccess")),c&&c(l("layout.toast.backendUnavailableDeletedLocal"));}},onSetDefault:async k=>{if(!i){let B=s.map(P=>({...P,isDefault:P.id===k}));g(B),m(B),d&&d(l("layout.toast.defaultLocalSuccess"));return}try{let B=s.find(C=>C.id===k);if(!B)return;if(!(await fetch(`${i}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(p({...B,isDefault:!0}))})).ok)throw new Error("LAYOUT_DEFAULT_FAILED");d&&d(l("layout.toast.defaultSuccess")),await y();}catch(B){console.error("Error setting default",B);let P=s.map(C=>({...C,isDefault:C.id===k}));g(P),m(P),d&&d(l("layout.toast.defaultLocalSuccess")),c&&c(l("layout.toast.backendUnavailableDefaultLocal"));}}})};var tu=(e,t)=>{if(!e||!e.filters)return null;if(Array.isArray(e.filters)){let o=e.filters.find(r=>r.scope===t);if(o)return o.filters;let a=e.filters.find(r=>r.scope==="default");return a?a.filters:null}return typeof e.filters=="object"?e.filters:null},ml=(e,t)=>{if(!e)return {layout:null,layoutId:null};let o=null,a=null;if(Array.isArray(e.layoutRefs)){let r=e.layoutRefs.find(n=>n.tableKey===t);r&&(o=r.layoutId);}return !o&&e.layoutId&&(o=e.layoutId),e.layout&&typeof e.layout=="object"&&!Array.isArray(e.layout)&&(a=e.layout),{layoutId:o,layout:a}};function ou(e,t,o){return t[o]<e[o]?-1:t[o]>e[o]?1:0}function ux(e,t){return e==="desc"?(o,a)=>ou(o,a,t):(o,a)=>-ou(o,a,t)}function mx(e,t){let o=e.map((a,r)=>[a,r]);return o.sort((a,r)=>{let n=t(a[0],r[0]);return n!==0?n:a[1]-r[1]}),o.map(a=>a[0])}var on=e=>{let t=St.useCallback(H=>{let Y=String(H?.label??H?.id??"").length*9+64,Ie=typeof H?.minWidth=="number"?H.minWidth:0;return Math.max(100,Ie,Y)},[]),o=St.useCallback(()=>(e.columns||[]).filter(H=>!!H?.numeric).map(H=>H.id),[e.columns]),[a,r]=St.useState(""),[n,i]=St.useState(e.order||"asc"),[c,d]=St.useState(e.orderBy||""),[l,s]=St.useState(e.page||0),[g,f]=St.useState(e.rowsPerPage||20),[u,h]=St.useState(e.selected||[]),[w,p]=St.useState(e.columns?e.columns.map(H=>H.id):[]),[S,m]=St.useState(e.showSummary||false),[y,b]=St.useState(()=>o()),[v,E]=St.useState([]),[R,k]=St.useState(new Set),[B,P]=St.useState(()=>{let H={};return (e.columns||[]).forEach($=>{H[$.id]=t($);}),H}),[C,D]=St.useState(null),[T,I]=St.useState(null),[A,W]=St.useState(null),[z,Q]=St.useState(null),[re,ne]=St.useState(false),[ae,_]=St.useState(""),[Ue,Ze]=St.useState("");St.useEffect(()=>{e.layout&&De(e.layout);},[e.layout]),St.useEffect(()=>{e.order!==void 0&&i(e.order),e.orderBy!==void 0&&d(e.orderBy);},[e.order,e.orderBy]),St.useEffect(()=>{e.selected!==void 0&&h(e.selected);},[e.selected]),St.useEffect(()=>{e.page!==void 0&&s(e.page);},[e.page]),St.useEffect(()=>{e.rowsPerPage!==void 0&&f(e.rowsPerPage);},[e.rowsPerPage]),St.useEffect(()=>{let H=o();b($=>$.filter(Ie=>H.includes(Ie)));},[o]),St.useEffect(()=>{P(H=>{let $={...H};return (e.columns||[]).forEach(Y=>{$[Y.id]===void 0&&($[Y.id]=t(Y));}),$});},[e.columns,t]);let Oe=St.useMemo(()=>{let H=e.rows||[];return a&&(H=H.filter($=>Object.keys($).some(Y=>String($[Y]).toLowerCase().includes(a.toLowerCase())))),H},[e.rows,a]),ie=St.useMemo(()=>e.onSortChange||!c?Oe:mx(Oe,ux(n,c)),[Oe,n,c,e.onSortChange]),we=St.useCallback(H=>{if(v.length===0)return H.map(Ve=>({type:"row",data:Ve,id:Ve[e.rowKey||"id"]}));let $=[...H].sort((Ve,Ce)=>{for(let $e of v){if(Ve[$e]<Ce[$e])return -1;if(Ve[$e]>Ce[$e])return 1}return 0}),Y=(Ve,Ce=0)=>{if(Ce>=v.length)return Ve;let $e=v[Ce],M={},O=[];return Ve.forEach(U=>{let G=U[$e],te=`${$e}:${G}`;M[te]||(M[te]={key:te,field:$e,value:G,children:[],count:0,level:Ce},O.push(M[te])),M[te].children.push(U),M[te].count++;}),O.forEach(U=>{U.children&&(U.children=Y(U.children,Ce+1));}),O},Ie=Y($),Te=(Ve,Ce="")=>{let $e=[];return Ve.forEach(M=>{if(M.children){let O=Ce?`${Ce}>${M.key}`:M.key,U=R.has(O);$e.push({type:"group",id:O,field:M.field,value:M.value,level:M.level,count:M.count,isExpanded:U,childIds:(function G(te){let Re=[];return te.children.forEach(ze=>{ze.children?Re=Re.concat(G(ze)):Re.push(ze[e.rowKey||"id"]);}),Re})(M)}),U&&($e=$e.concat(Te(M.children,O)));}else $e.push({type:"row",data:M,id:M[e.rowKey||"id"],level:v.length});}),$e};return Te(Ie)},[v,R,e.rowKey]),Ae=St.useCallback(H=>{if(v.length===0)return [];let $=[...H].sort((Te,Ve)=>{for(let Ce of v){if(Te[Ce]<Ve[Ce])return -1;if(Te[Ce]>Ve[Ce])return 1}return 0}),Y=[],Ie=(Te,Ve,Ce)=>{if(Ve>=v.length)return;let $e=v[Ve],M=new Map;Te.forEach(O=>{let U=O[$e],G=M.get(U);G?G.push(O):M.set(U,[O]);}),M.forEach((O,U)=>{let G=`${$e}:${U}`,te=Ce?`${Ce}>${G}`:G;Y.push(te),Ie(O,Ve+1,te);});};return Ie($,0,""),Y},[v]),Ye=St.useMemo(()=>we(ie),[ie,we]),st=St.useMemo(()=>Ae(ie),[ie,Ae]),Z=St.useMemo(()=>{let H=(e.rows||[]).length;return typeof e.count=="number"&&e.count>H},[e.count,e.rows]),Ke=St.useMemo(()=>Z?Ye:g>0?Ye.slice(l*g,l*g+g):Ye,[Ye,l,g,Z]),xt=St.useMemo(()=>Z&&typeof e.count=="number"?e.count:Ye.length,[Ye.length,Z,e.count]),X=H=>{k($=>{let Y=new Set($);return Y.has(H)?Y.delete(H):Y.add(H),Y});},pe=H=>{let $=st.filter(Y=>Y===H||Y.startsWith(`${H}>`));k(Y=>{let Ie=new Set(Y);return $.forEach(Te=>Ie.add(Te)),Ie});},Be=H=>{k($=>{let Y=new Set($);return Array.from(Y).forEach(Ie=>{(Ie===H||Ie.startsWith(`${H}>`))&&Y.delete(Ie);}),Y});},Ee=H=>{if(!H){k(new Set);return}k(new Set(st));},qe=H=>{let $=st.filter(Y=>Y.startsWith(`${H}>`));return $.length===0?R.has(H):R.has(H)&&$.every(Y=>R.has(Y))},K=H=>{let $=c===H&&n==="asc",Y=c===H&&n==="desc";if(e.onSortChange){$?e.onSortChange(H,"desc"):Y?e.onSortChange("","asc"):e.onSortChange(H,"asc");return}$?(i("desc"),d(H)):Y?(i("asc"),d("")):(i("asc"),d(H));},ye=(H,$)=>{P(Y=>({...Y,[H]:$}));},be=H=>{if(H.target.checked){let $=Oe.map(Y=>Y[e.rowKey||"id"]);h($),e.onSelectionChange&&e.onSelectionChange($);return}h([]),e.onSelectionChange&&e.onSelectionChange([]);},xe=(H,$)=>{let Y=$[e.rowKey||"id"],Ie=u.indexOf(Y),Te=[];Ie===-1?Te=Te.concat(u,Y):Ie===0?Te=Te.concat(u.slice(1)):Ie===u.length-1?Te=Te.concat(u.slice(0,-1)):Ie>0&&(Te=Te.concat(u.slice(0,Ie),u.slice(Ie+1))),h(Te),e.onSelectionChange&&e.onSelectionChange(Te);},Qe=H=>{s(H),e.onPageChange&&e.onPageChange(H);},He=H=>{f(H),s(0),e.onPageChange&&e.onPageChange(0),e.onRowsPerPageChange&&e.onRowsPerPageChange(H);},qt=H=>{let $=w.indexOf(H),Y=[...w];$===-1?Y.push(H):Y.splice($,1),p(Y);},ao=H=>{let $=v.indexOf(H),Y=[...v];$===-1?Y.push(H):Y.splice($,1),E(Y);},ro=H=>{o().includes(H)&&b(Y=>Y.includes(H)?Y.filter(Ie=>Ie!==H):[...Y,H]);},uo=H=>{e.onLayoutSave&&e.onLayoutSave({visibleColumns:w,order:n,orderBy:c,grouping:v,columnWidths:B,showSummary:S,summaryColumns:y});},Et=H=>{let{layout:$,layoutId:Y}=ml(H,e.tableKey||"default");Y?(Ze(Y),_(Y)):(Ze(""),_("")),$&&($.visibleColumns&&p($.visibleColumns),$.order&&i($.order),$.orderBy&&d($.orderBy),$.grouping&&E($.grouping),$.columnWidths&&P($.columnWidths),$.showSummary!==void 0&&m(!!$.showSummary),Array.isArray($.summaryColumns)&&b($.summaryColumns));},De=H=>{let $=H?.layoutData||H?.layout||H||{};$.visibleColumns&&p($.visibleColumns),$.order&&i($.order),$.orderBy!==void 0&&d($.orderBy),$.grouping&&E($.grouping),$.columnWidths&&P($.columnWidths),$.showSummary!==void 0&&m(!!$.showSummary),Array.isArray($.summaryColumns)&&b($.summaryColumns),k(new Set),s(0),H?.id&&_(H.id),Ze("");};St.useEffect(()=>{e.layout&&Et({layout:e.layout});},[e.layout]);let he=H=>{H.preventDefault(),Q(z===null?{mouseX:H.clientX+2,mouseY:H.clientY-6}:null);},Tt=()=>{Q(null);},_e=St.useMemo(()=>{if(!S)return {};let H={};e.columns.forEach(Y=>{if(Y.numeric&&y.includes(Y.id)){let Ie=Oe.reduce((Te,Ve)=>{let Ce=parseFloat(Ve[Y.id]);return Te+(isNaN(Ce)?0:Ce)},0);H[Y.id]=Ie.toFixed(2);}else H[Y.id]="";});let $=e.columns.find(Y=>w.includes(Y.id));return $&&!$.numeric&&(H[$.id]="Total"),H},[Oe,e.columns,S,y,w]),It=()=>{if(!e.columns||!Oe)return;let H=e.columns.map(Ve=>Ve.label).join(","),$=Oe.map(Ve=>e.columns.map(Ce=>{let $e=Ve[Ce.id];return `"${($e==null?"":String($e)).replace(/"/g,'""')}"`}).join(",")).join(`
184
+ `),Y=`data:text/csv;charset=utf-8,${H}
185
+ ${$}`,Ie=encodeURI(Y),Te=document.createElement("a");Te.setAttribute("href",Ie),Te.setAttribute("download",`${e.title||"export"}.csv`),document.body.appendChild(Te),Te.click(),document.body.removeChild(Te);},mo=()=>{ne(true);},ia=()=>{ne(false);};return {isMobile:false,columns:e.columns,order:n,setOrder:i,orderBy:c,setOrderBy:d,filterText:a,setFilterText:r,visibleColumns:w,setVisibleColumns:p,showSummary:S,setShowSummary:m,summaryColumns:y,grouping:v,setGrouping:E,expandedGroups:R,setExpandedGroups:k,groupAnchorEl:T,setGroupAnchorEl:I,summaryAnchorEl:A,setSummaryAnchorEl:W,columnWidths:B,setColumnWidths:P,anchorEl:C,setAnchorEl:D,contextMenu:z,setContextMenu:Q,sensors:void 0,sortedAndFilteredRows:ie,visibleRows:Ke,summaryRow:_e,page:l,setPage:Qe,rowsPerPage:g,setRowsPerPage:He,totalDisplayCount:xt,selected:u,setSelected:h,isAllExpanded:st.length>0&&st.every(H=>R.has(H)),handleColumnResize:ye,handleRequestSort:K,handleSelectAllClick:be,handleClick:xe,toggleSummaryColumn:ro,handleDragEnd:()=>{},handleExport:It,handleContextMenu:he,handleCloseContextMenu:Tt,toggleColumnVisibility:qt,toggleGroupExpand:X,toggleGroupField:ao,handleToggleAll:Ee,handleExpandGroupRecursively:pe,handleCollapseGroupRecursively:Be,isGroupFullyExpanded:qe,handleLayoutLoad:De,handleVariantLoad:Et,handleLayoutSave:uo,effectiveAppId:e.appId||"",currentLayoutData:{visibleColumns:w,order:n,orderBy:c,grouping:v,columnWidths:B,showSummary:S,summaryColumns:y},currentLayoutId:ae,layoutIdToLoad:Ue,onPageChange:Qe,onRowsPerPageChange:He,graphReportOpen:re,handleOpenGraphReport:mo,handleCloseGraphReport:ia}};var KM=e=>jsxRuntime.jsx(hx__default.default,{...e}),qM=e=>jsxRuntime.jsx(Vs__default.default,{...e}),_M=e=>jsxRuntime.jsx(cu__default.default,{...e}),jM=e=>jsxRuntime.jsx(Oh__default.default,{...e}),ZM=e=>jsxRuntime.jsx(Hh__default.default,{...e}),Ua=e=>{let{t}=ee(),o="0.85rem",{title:a,showToolbar:r=true,selectionMode:n,selected:i=[],onSelectionChange:c,actions:d,extraTools:l,fitContainer:s=false,fullWidth:g=false,maxHeight:f,loading:u=false,rowsPerPageOptions:h=[20,50,100,-1],onLayoutSave:w,filterConfig:p,rowKey:S,tableKey:m="default",graphReport:y,quickCreate:b,quickEdit:v,quickDelete:E,serviceUrl:R}=e,k=a||t("table.title.default"),{isMobile:B,columns:P,order:C,orderBy:D,filterText:T,setFilterText:I,visibleColumns:A,showSummary:W,setShowSummary:z,summaryColumns:Q,grouping:re,setGrouping:ne,expandedGroups:ae,groupAnchorEl:_,setGroupAnchorEl:Ue,summaryAnchorEl:Ze,setSummaryAnchorEl:Oe,columnWidths:ie,anchorEl:we,setAnchorEl:Ae,contextMenu:Ye,sensors:st,sortedAndFilteredRows:Z,summaryRow:Ke,visibleRows:xt,isAllExpanded:X,page:pe,setPage:Be,rowsPerPage:Ee,setRowsPerPage:qe,totalDisplayCount:K,setSelected:ye,handleColumnResize:be,handleRequestSort:xe,handleSelectAllClick:Qe,handleClick:He,toggleSummaryColumn:qt,handleDragEnd:ao,handleExport:ro,handleContextMenu:uo,handleCloseContextMenu:Et,toggleColumnVisibility:De,toggleGroupExpand:he,toggleGroupField:Tt,handleToggleAll:_e,handleExpandGroupRecursively:It,handleCollapseGroupRecursively:mo,isGroupFullyExpanded:ia,handleLayoutLoad:H,handleVariantLoad:$,handleLayoutSave:Y,effectiveAppId:Ie,currentLayoutData:Te,currentLayoutId:Ve,layoutIdToLoad:Ce,graphReportOpen:$e,handleOpenGraphReport:M,handleCloseGraphReport:O}=on(e),U=y?.enabled??false,G=U&&(y?.interaction?.enabled??true),te=ol(),Re=!!b?.enabled,ze=!!v?.enabled,le=!!E?.enabled,Pe=b?.fields,We=b?.excludeFields||[],vt=b?.initialValues||{},[je,gt]=St__namespace.default.useState(false),[Pt,no]=St__namespace.default.useState(false),[Rt,Ft]=St__namespace.default.useState({}),[Xt,Dt]=St__namespace.default.useState(false),[Xe,Eo]=St__namespace.default.useState(false),[_o,la]=St__namespace.default.useState({}),[or,jo]=St__namespace.default.useState(false),[ar,rr]=St__namespace.default.useState(false),Zo=u||Pt||Xe||ar,sa=St__namespace.default.useMemo(()=>{let N=[...P];if(Array.isArray(Pe)&&Pe.length>0){let oe=new Set(Pe);N=N.filter(J=>oe.has(J.id));}if(We.length>0){let oe=new Set(We);N=N.filter(J=>!oe.has(J.id));}return N.filter(oe=>!!oe?.id)},[P,We,Pe]),Aa=S||"id",Yt=St__namespace.default.useMemo(()=>{let N=new Set(i);return Z.filter(oe=>N.has(oe?.[Aa]))},[i,Z,Aa]),Fo=Yt.length===1?Yt[0]:null,ca=v?.fields,To=v?.excludeFields||[],Xo=v?.editableFields||[],nr=v?.nonEditableFields||[],Er=v?.primaryKeys?.length?v.primaryKeys:[Aa],Ba=St__namespace.default.useMemo(()=>{let N=[...P];if(Array.isArray(ca)&&ca.length>0){let oe=new Set(ca);N=N.filter(J=>oe.has(J.id));}if(To.length>0){let oe=new Set(To);N=N.filter(J=>!oe.has(J.id));}return N.filter(oe=>!!oe?.id)},[P,To,ca]),ir=St__namespace.default.useMemo(()=>new Set(Er),[Er]),da=St__namespace.default.useMemo(()=>new Set(Xo),[Xo]),io=St__namespace.default.useMemo(()=>new Set(nr),[nr]),Lo=St__namespace.default.useCallback(N=>da.size>0?da.has(N):!(io.has(N)||ir.has(N)),[da,io,ir]);St__namespace.default.useEffect(()=>{!$e&&te.hasActiveFilters&&te.clearAll();},[$e,te.hasActiveFilters,te.clearAll]);let Fr=()=>{let N={};sa.forEach(oe=>{N[oe.id]=vt[oe.id]??"";}),Ft(N),gt(true);},lr=()=>{Pt||gt(false);},Lr=(N,oe)=>{Ft(J=>({...J,[N]:oe}));},zr=async()=>{if(!b?.onSubmit){gt(false);return}try{no(!0),await b.onSubmit(Rt),gt(!1);}finally{no(false);}},Nr=()=>{if(!Fo)return;let N={};Ba.forEach(J=>{N[J.id]=Fo[J.id]??"";});let oe=v?.getInitialValues?{...N,...v.getInitialValues(Fo)}:N;la(oe),Dt(true);},go=()=>{Xe||Dt(false);},Vr=(N,oe)=>{la(J=>({...J,[N]:oe}));},Or=async()=>{if(Fo){if(!v?.onSubmit){Dt(false);return}try{Eo(!0),await v.onSubmit(_o,Fo),Dt(!1);}finally{Eo(false);}}},sr=()=>{Yt.length!==0&&jo(true);},pa=()=>{ar||jo(false);},Ea=async()=>{if(Yt.length===0){jo(false);return}if(!E?.onConfirm){jo(false),ye([]),c?.([]);return}try{rr(!0),await E.onConfirm(Yt),jo(!1),ye([]),c?.([]);}finally{rr(false);}},Fa=Z,{fieldMapping:x}=Qr({rows:Fa,config:{...y,title:y?.title||`${k} ${t("graph.reportTitle")}`}}),F=St__namespace.default.useMemo(()=>G?te.applyRows(Fa,x):Fa,[G,te.applyRows,Fa,x]),{model:L}=Qr({rows:F,config:{...y,title:y?.title||`${k} ${t("graph.reportTitle")}`,fieldMapping:x}}),q=L.table.columns.map(N=>({id:N.id,label:N.label,align:N.align||"left",minWidth:120,numeric:N.align==="right"})),ce=Ie?jsxRuntime.jsx(ul,{appId:Ie,tableKey:m,currentLayoutData:Te,onLayoutLoad:H,targetLayoutId:Ce,activeLayoutId:Ve,serviceUrl:R??p?.serviceUrl}):null,Se=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Wr,{groupAnchorEl:_,setGroupAnchorEl:Ue,grouping:re,setGrouping:ne,columns:P,toggleGroupField:Tt}),jsxRuntime.jsx($r,{anchorEl:we,setAnchorEl:Ae,columns:P,visibleColumns:A,toggleColumnVisibility:De}),jsxRuntime.jsx(Ni,{anchorEl:Ze,setAnchorEl:Oe,showSummary:W,setShowSummary:z,columns:P,summaryColumns:Q,toggleSummaryColumn:qt}),jsxRuntime.jsx(Vi,{contextMenu:Ye,handleCloseContextMenu:Et,columns:P,visibleColumns:A,toggleColumnVisibility:De})]});return B?jsxRuntime.jsxs(Yn__default.default,{sx:{display:"flex",flexDirection:"column",gap:2,height:"100%"},children:[p&&jsxRuntime.jsx(ha,{fields:p.fields,filters:p.filters,onFilterChange:p.onFilterChange,onSearch:p.onSearch,variants:p.variants||[],currentVariantId:p.currentVariantId,onVariantLoad:p.onVariantLoad,onVariantSave:p.onVariantSave,onVariantDelete:p.onVariantDelete,onVariantSetDefault:p.onVariantSetDefault,appId:p.appId,tableKey:m,currentLayout:[{tableKey:m,layoutData:Te}],variantService:p.variantService,serviceUrl:R??p.serviceUrl}),jsxRuntime.jsx(np,{title:k,loading:u,showSummary:W,setShowSummary:z,setAnchorEl:Ae,setSummaryAnchorEl:Oe,filterText:T,setFilterText:I,sortedAndFilteredRows:Z,selected:i,columns:P,visibleColumns:A,summaryRow:Ke,handleClick:He,selectionMode:n}),Se]}):jsxRuntime.jsxs(Yn__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:[p&&jsxRuntime.jsx(Yn__default.default,{sx:{mb:2},children:jsxRuntime.jsx(ha,{fields:p.fields,filters:p.filters,onFilterChange:p.onFilterChange,onSearch:p.onSearch,variants:p.variants||[],currentVariantId:p.currentVariantId,onVariantLoad:N=>{$(N),p.onVariantLoad&&p.onVariantLoad(N);},onVariantSave:p.onVariantSave,onVariantDelete:p.onVariantDelete,onVariantSetDefault:p.onVariantSetDefault,loading:u,appId:p.appId,tableKey:m,currentLayout:[{tableKey:m,layoutData:Te}],currentLayoutId:Ve,layoutRefs:[{tableKey:m,layoutId:Ve}],variantService:p.variantService,serviceUrl:R??p.serviceUrl})}),jsxRuntime.jsxs(gx__default.default,{sx:{width:g?"100%":"auto",mb:s?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative","&::before":Zo?{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:[r&&jsxRuntime.jsx(Bi,{filterText:T,setFilterText:I,onRowsPerPageChange:qe,rowsPerPage:Ee,rowsPerPageOptions:h,page:pe,count:K,onPageChange:Be,actions:d,extraTools:l,grouping:re,setGroupAnchorEl:Ue,showSummary:W,setShowSummary:z,setAnchorEl:Ae,setSummaryAnchorEl:Oe,handleExport:ro,showCreateButton:Re,onOpenCreateDialog:Fr,showEditButton:ze,onOpenEditDialog:Nr,editDisabled:Yt.length!==1,showDeleteButton:le,onOpenDeleteConfirm:sr,deleteDisabled:Yt.length===0,onLayoutSave:w||p?.variantService&&p?.appId?Y:void 0,loading:u,layoutManager:ce,onOpenGraphReport:U?M:void 0}),jsxRuntime.jsx(cu__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:st,collisionDetection:core.closestCenter,onDragEnd:ao,modifiers:[modifiers.restrictToHorizontalAxis],children:jsxRuntime.jsxs(fx__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(Ei,{columns:P,visibleColumns:A,order:C,orderBy:D,onRequestSort:xe,onContextMenu:uo,selectionMode:n,grouping:re,isAllExpanded:X,handleToggleAll:_e,rowCount:Z.length,numSelected:i.length,onSelectAllClick:Qe,columnWidths:ie,onColumnResize:be}),jsxRuntime.jsx(op,{visibleRows:xt,columns:P,visibleColumns:A,selectionMode:n,selected:i,orderBy:D,loading:u,expandedGroups:ae,toggleGroupExpand:he,handleExpandGroupRecursively:It,handleCollapseGroupRecursively:mo,isGroupFullyExpanded:ia,handleClick:He,onSelectionChange:c,grouping:re,rowKeyProp:S,page:pe,rowsPerPage:Ee}),W&&jsxRuntime.jsx(ap,{showSummary:W,columns:P,visibleColumns:A,summaryRow:Ke,selectionMode:n?.toString(),grouping:re,orderBy:D,zIndex:3})]})})})]}),Re&&jsxRuntime.jsxs(au__default.default,{open:je,onClose:lr,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:N=>`1px solid ${N.palette.divider}`,bgcolor:"background.paper"}}},children:[jsxRuntime.jsx(ru__default.default,{sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:b?.title||t("quickCreate.createWithTitle",{title:k})}),jsxRuntime.jsx(nu__default.default,{sx:{pt:"8px !important"},children:jsxRuntime.jsxs(Yn__default.default,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[sa.map(N=>{let oe=N.type==="number"||N.numeric?"number":N.type==="date"?"date":"text",J=N.label||N.id;return jsxRuntime.jsx(lu__default.default,{label:J,value:Rt[N.id]??"",onChange:nt=>Lr(N.id,nt.target.value),type:oe,size:"small",fullWidth:true,InputLabelProps:{shrink:oe==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-create-${N.id}`)}),b?.description&&jsxRuntime.jsx(su__default.default,{severity:"info",sx:{fontSize:"0.85rem","& .MuiAlert-message":{fontSize:"0.85rem"}},children:b.description})]})}),jsxRuntime.jsxs(iu__default.default,{sx:{px:3,pb:2},children:[jsxRuntime.jsx(fl__default.default,{onClick:lr,sx:{fontSize:"0.85rem"},disabled:Pt,children:b?.cancelLabel||t("common.cancel")}),jsxRuntime.jsx(fl__default.default,{onClick:zr,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:Pt,children:b?.submitLabel||t("common.save")})]})]}),ze&&jsxRuntime.jsxs(au__default.default,{open:Xt,onClose:go,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:N=>`1px solid ${N.palette.divider}`,bgcolor:"background.paper"}}},children:[jsxRuntime.jsx(ru__default.default,{sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:v?.title||t("quickEdit.editWithTitle",{title:k})}),jsxRuntime.jsx(nu__default.default,{sx:{pt:"8px !important"},children:jsxRuntime.jsxs(Yn__default.default,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Ba.map(N=>{let oe=N.type==="number"||N.numeric?"number":N.type==="date"?"date":"text",J=N.label||N.id,nt=Lo(N.id);return jsxRuntime.jsx(lu__default.default,{label:J,value:_o[N.id]??"",onChange:V=>Vr(N.id,V.target.value),type:oe,size:"small",fullWidth:true,disabled:!nt,InputLabelProps:{shrink:oe==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-edit-${N.id}`)}),v?.description&&jsxRuntime.jsx(su__default.default,{severity:"info",sx:{fontSize:"0.85rem","& .MuiAlert-message":{fontSize:"0.85rem"}},children:v.description})]})}),jsxRuntime.jsxs(iu__default.default,{sx:{px:3,pb:2},children:[jsxRuntime.jsx(fl__default.default,{onClick:go,sx:{fontSize:"0.85rem"},disabled:Xe,children:v?.cancelLabel||t("common.cancel")}),jsxRuntime.jsx(fl__default.default,{onClick:Or,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:Xe||!Fo,children:v?.submitLabel||t("common.save")})]})]}),le&&jsxRuntime.jsx(Bn,{open:or,type:"warning",title:E?.title||t("quickDelete.confirmTitle"),message:E?.message||(Yt.length>1?t("quickDelete.confirmMessageMultiple",{count:Yt.length}):t("quickDelete.confirmMessageSingle")),confirmText:E?.confirmText||t("common.delete"),cancelText:E?.cancelText||t("common.cancel"),onClose:pa,onConfirm:Ea}),Se,U&&jsxRuntime.jsx(el,{open:$e,onClose:O,model:L,aiAssistant:y?.aiAssistant,interaction:G?{enabled:true,filters:te.filters,fieldMapping:x,onPrimaryDimensionClick:N=>te.setFilter("primaryDimension",N),onSecondaryDimensionClick:N=>te.setFilter("secondaryDimension",N),onStatusClick:N=>te.setFilter("status",N),onClearFilter:te.clearFilter,onClearAll:te.clearAll}:void 0,tableContent:jsxRuntime.jsx(Ua,{appId:Ie||"graph-report-internal",title:t("graph.dataBody"),columns:q,rows:L.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false}})})]})},XM=Ua;var a2=({id:e,title:t,hideHeader:o=true,filterConfig:a,tableProps:r,children:n,spacing:i=1,mode:c="separated"})=>{let d=a?{...a,appId:a.appId||e}:void 0,l={...r,appId:r.appId||e};return jsxRuntime.jsxs(Xd,{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(ha,{...d})}),jsxRuntime.jsx(material.Box,{sx:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:jsxRuntime.jsx(Ua,{...l,fitContainer:true,filterConfig:c==="integrated"?d:void 0})})]}),n]})};var c2=({metadata:e,fetchData:t,initialRowsPerPage:o=20,rowsPerPageOptions:a=[20,50,100,-1],tableKey:r="default",mode:n="integrated",serviceUrl:i,variantService:c})=>{let{t:d}=ee(),[l,s]=St.useState(false),[g,f]=St.useState([]),[u,h]=St.useState({}),[w,p]=St.useState(e.variants||[]),[S,m]=St.useState(e.layout||null),[y,b]=St.useState(""),[v,E]=St.useState(0),[R,k]=St.useState(0),[B,P]=St.useState(o),[C,D]=St.useState([]),[T,I]=St.useState("asc"),[A,W]=St.useState("");St.useEffect(()=>{let ie={};e.filters.forEach(we=>{we.defaultValue!==void 0&&(ie[we.id]=we.defaultValue);}),h(ie);},[e.filters]);let z=St.useCallback(async(ie,we,Ae,Ye,st)=>{s(true);try{let Z={...ie,page:we+1,limit:Ae,sort:st,order:Ye},Ke;t?Ke=await t(Z):typeof e.api=="function"?Ke=await e.api(Z):e.api&&typeof e.api=="object"?(console.log("Fetching from URL:",e.api.url,Z),Ke={rows:[],total:0}):(console.warn("No API configured for report"),Ke={rows:[],total:0}),Ke&&(f(Ke.rows||[]),E(Ke.total||0));}catch(Z){console.error("Failed to fetch report data",Z);}finally{s(false);}},[e.api,t]);St.useEffect(()=>{z(u,R,B,T,A);},[z,R,B,T,A]);let Q=()=>{k(0),z(u,0,B,T,A);},re=ie=>{k(0),P(ie);},ne=(ie,we)=>{I(we),W(ie);},ae=ie=>{h(ie);},_=ie=>{b(ie?.id||"");let we=tu(ie,r);if(we){let Ye=we.values??we;h(Ye),z(Ye,0,B,T,A),k(0);}let{layout:Ae}=ml(ie,r);Ae&&m(Ae);},Ue=ie=>{let we={...ie,id:Date.now().toString(),createdAt:new Date().toISOString()};p(Ae=>[...Ae,we]);},Ze=ie=>{m(ie);};return {pageProps:{id:e.id,title:e.title,mode:n,filterConfig:{appId:e.id,tableKey:r,fields:e.filters,filters:u,onFilterChange:ae,onSearch:Q,onVariantLoad:_,onVariantSave:Ue,onVariantDelete:ie=>p(we=>we.filter(Ae=>Ae.id!==ie)),onVariantSetDefault:ie=>{p(we=>we.map(Ae=>({...Ae,isDefault:Ae.id===ie})));},variants:w,currentVariantId:y,variantService:c,serviceUrl:i},tableProps:{appId:e.id,tableKey:r,columns:e.columns,rows:g,loading:l,rowKey:"id",count:v,page:R,rowsPerPage:B,rowsPerPageOptions:a,onPageChange:k,onRowsPerPageChange:re,selectionMode:"multiple",selected:C,onSelectionChange:D,onLayoutSave:Ze,layout:S,title:e.title,showSummary:true,order:T,orderBy:A,serviceUrl:i,onSortChange:ne,graphReport:e.graphReport||{enabled:true,title:`${e.title} ${d("graph.reportTitle")}`}}},filters:u,rows:g,loading:l,refresh:Q}};var Ix=e=>[...e].sort((t,o)=>o.value-t.value),u2=({bars:e=[],lines:t=[],combos:o=[],heatmap:a=[],pies:r=[],waterfalls:n=[]})=>{let i=St.useMemo(()=>Ix(e),[e]),c=St.useMemo(()=>[...t],[t]),d=St.useMemo(()=>[...o],[o]),l=St.useMemo(()=>[...a],[a]),s=St.useMemo(()=>{let f=r.reduce((u,h)=>u+h.value,0);return r.map(u=>({...u,percent:f>0?u.value/f*100:u.percent}))},[r]),g=St.useMemo(()=>[...n],[n]);return {bars:i,lines:c,combos:d,heatmap:l,pies:s,waterfalls:g}};var y2=({apiKey:e,query:t,zoom:o=14,mapType:a="roadmap"})=>St.useMemo(()=>!e||!t?"":Gn({apiKey:e,query:t,zoom:o,mapType:a}),[e,t,o,a]),b2=({keyword:e,location:t})=>St.useMemo(()=>Zi({keyword:e,location:t?{lng:t.lng,lat:t.lat,name:t.name}:void 0}),[e,t]);var Qn=({code:e,language:t="text",copyable:o=true,showLineNumbers:a=false,wrapLongLines:r=false,maxHeight:n})=>{let[i,c]=St.useState(false),d=St.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(Ex__default.default,{fontSize:"inherit"}):jsxRuntime.jsx(Bx__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:a?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:r?"pre-wrap":"pre",wordBreak:r?"break-word":"normal"},children:s})]},`${g}-${s}`)):jsxRuntime.jsx(material.Box,{component:"code",sx:{display:"block",whiteSpace:r?"pre-wrap":"pre",wordBreak:r?"break-word":"normal"},children:e})})]})};var Vx=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},Ox=async e=>new Function("m","return import(m)")(e),Jn=({expression:e,inline:t=false,allowKatex:o=false})=>{let a=St.useMemo(()=>Vx(e),[e]),[r,n]=St.useState("");return St.useEffect(()=>{let i=true;return (async()=>{if(!o||!a){n("");return}try{let d=await Ox("katex"),s=(d?.default||d)?.renderToString?.(a,{displayMode:!t,throwOnError:!1,strict:"warn"});i&&typeof s=="string"&&n(s);}catch{i&&n("");}})(),()=>{i=false;}},[o,a,t]),a?r?jsxRuntime.jsx(material.Box,{component:t?"span":"div",sx:{display:t?"inline-flex":"block",my:t?0:.5,overflowX:"auto"},dangerouslySetInnerHTML:{__html:r}}):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:a}):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:a})}):null};var qx=async e=>new Function("m","return import(m)")(e),uc=({code:e,title:t="Mermaid Diagram",height:o=320,enabled:a=true})=>{let[r,n]=St.useState(""),[i,c]=St.useState(""),[d,l]=St.useState(false),s=St.useMemo(()=>e.trim(),[e]);return St.useEffect(()=>{let g=true;return (async()=>{if(!a||!s){n(""),c("");return}l(true),c(""),n("");try{let u=await qx("mermaid"),h=u?.default||u;if(!h||typeof h.render!="function")throw new Error("Mermaid runtime is not available");h.initialize?.({startOnLoad:!1,securityLevel:"loose",theme:"default"});let w=await h.render(`orbcafe-mermaid-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,s),p=typeof w=="string"?w:w?.svg;g&&typeof p=="string"&&n(p);}catch(u){if(g){let h=u instanceof Error?u.message:"Failed to render Mermaid diagram";c(h);}}finally{g&&l(false);}})(),()=>{g=false;}},[a,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&&r&&jsxRuntime.jsx(material.Box,{sx:{maxHeight:o,overflow:"auto","& svg":{display:"block",mx:"auto",maxWidth:"100%",height:"auto"}},dangerouslySetInnerHTML:{__html:r}}),!d&&!r&&jsxRuntime.jsxs(material.Box,{children:[i&&jsxRuntime.jsx(material.Alert,{severity:"info",sx:{mb:1},children:i}),jsxRuntime.jsx(Qn,{code:s,language:"mermaid",copyable:true,showLineNumbers:true,wrapLongLines:true})]})]})]})};var mc=e=>e.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(o=>o.trim()),e0=e=>/^:?-{3,}:?$/.test(e.trim()),t0=e=>{let t=e.trim(),o=t.startsWith(":"),a=t.endsWith(":");return o&&a?"center":a?"right":"left"},bl=e=>{let t=e.split(`
187
+ `).map(i=>i.trim()).filter(Boolean);if(t.length<2)return null;let o=mc(t[0]),a=mc(t[1]);if(o.length===0||a.length!==o.length||!a.every(e0))return null;let r=a.map(t0),n=t.slice(2).filter(i=>i.includes("|")).map(i=>{let c=mc(i);return c.length<o.length?[...c,...Array.from({length:o.length-c.length},()=>"")]:c.slice(0,o.length)});return {headers:o,aligns:r,rows:n}},gc=({markdown:e,table:t,maxHeight:o=360})=>{let a=St.useMemo(()=>t||(e?bl(e):null),[t,e]);return !a||a.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:a.headers.map((r,n)=>jsxRuntime.jsx(material.TableCell,{align:a.aligns[n],sx:{fontWeight:700,bgcolor:"background.paper"},children:r},`${r}-${n}`))})}),jsxRuntime.jsx(material.TableBody,{children:a.rows.map((r,n)=>jsxRuntime.jsx(material.TableRow,{hover:true,children:r.map((i,c)=>jsxRuntime.jsx(material.TableCell,{align:a.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 vl=({content:e,title:t="Thinking",defaultExpanded:o=false,isStreaming:a=false})=>{let[r,n]=St.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:r?"rotate(180deg)":"rotate(0deg)",transition:"transform .15s ease"},children:jsxRuntime.jsx(s0__default.default,{fontSize:"inherit"})}),jsxRuntime.jsxs(material.Typography,{variant:"caption",color:"text.secondary",sx:{fontStyle:"italic"},children:[t,a?" ...":""]})]}),jsxRuntime.jsx(material.Collapse,{in:r,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 hc=/(\*\*[^*]+\*\*|`[^`]+`|\[[^\]]+\]\([^)]+\)|\*[^*]+\*|\$[^$\n]+\$)/g,Cl=e=>e.trim().startsWith("```"),xu=e=>/^#{1,6}\s+/.test(e.trim()),yc=e=>/^[-*+]\s+/.test(e.trim()),bc=e=>/^\d+\.\s+/.test(e.trim()),vu=e=>/^(?:-{3,}|\*{3,}|_{3,})$/.test(e.trim()),xc=e=>e.trim().startsWith(">"),Cu=(e,t)=>{if(t+1>=e.length)return false;let o=e[t],a=e[t+1];return !o.includes("|")||!a.includes("|")?false:/^\s*\|?\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)+\|?\s*$/.test(a.trim())},ku=e=>e.trim().startsWith("<think>")||e.trim()===":::think",oi=(e,t,o)=>{let a=[],r=0,n=0;hc.lastIndex=0;let i=hc.exec(e);for(;i;){i.index>r&&a.push(e.slice(r,i.index));let c=i[0],d=`${o}-${n}`;if(c.startsWith("**")&&c.endsWith("**"))a.push(jsxRuntime.jsx("strong",{children:c.slice(2,-2)},d));else if(c.startsWith("*")&&c.endsWith("*"))a.push(jsxRuntime.jsx("em",{children:c.slice(1,-1)},d));else if(c.startsWith("`")&&c.endsWith("`"))a.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?a.push(jsxRuntime.jsx(material.Link,{href:l[2],target:"_blank",rel:"noreferrer",underline:"hover",children:l[1]},d)):a.push(c);}else c.startsWith("$")&&c.endsWith("$")&&t.enableMath?a.push(jsxRuntime.jsx(Jn,{expression:c,inline:true,allowKatex:true},d)):a.push(c);r=i.index+c.length,n+=1,i=hc.exec(e);}return r<e.length&&a.push(e.slice(r)),a.length>0?a:[e]},ai=({markdown:e,content:t,className:o,enableMath:a=true,enableMermaid:r=true,enableThinkBlock:n=true,codeCopyable:i=true,codeLineNumbers:c=false})=>{let d=e??t??"",l=St.useMemo(()=>{let s=[],g=d.replace(/\r\n/g,`
188
188
  `).split(`
189
- `),f={enableMath:a},u=0;for(;u<g.length;){let h=g[u],w=h.trim();if(!w){u+=1;continue}if(n&&vu(h)){if(w.startsWith("<think>")){let m=[],y=h;for(;;){let b=y.indexOf("<think>"),T=b>=0?y.slice(b+7):y,B=T.indexOf("</think>");if(B>=0){m.push(T.slice(0,B)),u+=1;break}if(m.push(T),u+=1,u>=g.length)break;y=g[u];}l.push(jsxRuntime.jsx(vl,{content:m.join(`
190
- `).trim()},`think-tag-${u}`));continue}u+=1;let C=[];for(;u<g.length&&g[u].trim()!==":::";)C.push(g[u]),u+=1;u<g.length&&g[u].trim()===":::"&&(u+=1),l.push(jsxRuntime.jsx(vl,{content:C.join(`
191
- `).trim()},`think-fence-${u}`));continue}if(Cl(h)){let C=w.slice(3).trim().toLowerCase(),m=[];for(u+=1;u<g.length&&!Cl(g[u]);)m.push(g[u]),u+=1;u<g.length&&Cl(g[u])&&(u+=1);let y=m.join(`
192
- `);if(r&&C==="mermaid"){l.push(jsxRuntime.jsx(dc,{code:y},`mermaid-${u}`));continue}if(a&&["math","latex","katex"].includes(C)){l.push(jsxRuntime.jsx(Jn,{expression:y,allowKatex:true},`math-fence-${u}`));continue}l.push(jsxRuntime.jsx(Qn,{code:y,language:C||"text",copyable:i,showLineNumbers:c,wrapLongLines:true},`code-${u}`));continue}if(a&&w.startsWith("$$")){let C=[];if(w.endsWith("$$")&&w!=="$$")C.push(w.slice(2,-2)),u+=1;else {let y=h.slice(h.indexOf("$$")+2);for(y.trim()&&C.push(y),u+=1;u<g.length;){let b=g[u],T=b.indexOf("$$");if(T>=0){C.push(b.slice(0,T)),u+=1;break}C.push(b),u+=1;}}l.push(jsxRuntime.jsx(Jn,{expression:C.join(`
193
- `).trim(),allowKatex:true},`math-${u}`));continue}if(yu(h)){let C=Math.min(6,h.match(/^#{1,6}/)?.[0]?.length||1),m=h.replace(/^#{1,6}\s+/,""),y=C===1?"h5":C===2?"h6":"subtitle1";l.push(jsxRuntime.jsx(material.Typography,{variant:y,sx:{mt:C===1?1.2:.8,mb:.5,fontWeight:700},children:oi(m,f,`h-${u}`)},`heading-${u}`)),u+=1;continue}if(bu(h)){l.push(jsxRuntime.jsx(material.Divider,{sx:{my:1.2}},`hr-${u}`)),u+=1;continue}if(xu(g,u)){let C=u+2;for(;C<g.length&&g[C].trim()&&g[C].includes("|");)C+=1;let m=g.slice(u,C).join(`
194
- `),y=bl(m);if(y){l.push(jsxRuntime.jsx(uc,{table:y},`table-${u}`)),u=C;continue}}if(yc(h)){let C=[];for(;u<g.length&&yc(g[u]);)C.push(g[u].replace(/^\s*>\s?/,"")),u+=1;l.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,y)=>jsxRuntime.jsxs(vt.Fragment,{children:[y>0&&jsxRuntime.jsx("br",{}),oi(m,f,`q-${u}-${y}`)]},`quote-line-${y}`))})},`quote-${u}`));continue}if(fc(h)){let C=[];for(;u<g.length&&fc(g[u]);)C.push(g[u].trim().replace(/^[-*+]\s+/,"")),u+=1;l.push(jsxRuntime.jsx(material.Box,{component:"ul",sx:{my:.8,pl:2.5},children:C.map((m,y)=>jsxRuntime.jsx(material.Box,{component:"li",sx:{mb:.45},children:jsxRuntime.jsx(material.Typography,{variant:"body2",children:oi(m,f,`ul-${u}-${y}`)})},`ul-item-${y}`))},`ul-${u}`));continue}if(hc(h)){let C=[];for(;u<g.length&&hc(g[u]);)C.push(g[u].trim().replace(/^\d+\.\s+/,"")),u+=1;l.push(jsxRuntime.jsx(material.Box,{component:"ol",sx:{my:.8,pl:2.7},children:C.map((m,y)=>jsxRuntime.jsx(material.Box,{component:"li",sx:{mb:.45},children:jsxRuntime.jsx(material.Typography,{variant:"body2",children:oi(m,f,`ol-${u}-${y}`)})},`ol-item-${y}`))},`ol-${u}`));continue}let p=[];for(;u<g.length;){let C=g[u],m=C.trim();if(!m||Cl(C)||yu(C)||bu(C)||fc(C)||hc(C)||yc(C)||xu(g,u)||n&&vu(C)||a&&m.startsWith("$$"))break;p.push(C),u+=1;}p.length>0?l.push(jsxRuntime.jsx(material.Typography,{variant:"body2",sx:{my:.65,lineHeight:1.65},children:p.map((C,m)=>jsxRuntime.jsxs(vt.Fragment,{children:[m>0&&jsxRuntime.jsx("br",{}),oi(C,f,`p-${u}-${m}`)]},`p-line-${m}`))},`p-${u}`)):u+=1;}return l},[d,a,r,n,i,c]);return jsxRuntime.jsx(material.Box,{className:o,sx:{"& strong":{fontWeight:700},"& em":{fontStyle:"italic"},"& a":{wordBreak:"break-all"}},children:s})};var Y2=(e,t)=>jsxRuntime.jsx(ai,{markdown:e,...t});var Su=({value:e,onChange:t,onSubmit:o,onVoiceInput:a,onClear:r,placeholder:n,statusText:i,loading:c=false,compact:d=false,showStatusText:s=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(Gd__default.default,{sx:{fontSize:d?16:18,color:"text.secondary"}}),jsxRuntime.jsx(material.InputBase,{fullWidth:true,value:e,onChange:l=>t(l.target.value),onKeyDown:l=>{l.key==="Enter"&&(l.preventDefault(),o());},placeholder:n,sx:{fontSize:d?"0.84rem":"0.9rem"}}),e&&r&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:r,children:jsxRuntime.jsx(lh__default.default,{sx:{fontSize:d?16:18}})}),a&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:a,children:jsxRuntime.jsx(Ky__default.default,{sx:{fontSize:d?16:18}})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:o,disabled:c||!e.trim(),children:jsxRuntime.jsx(_y__default.default,{sx:{fontSize:d?16:18}})})]}),s&&i&&jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",children:i})]});var wu=(e,t)=>{let o=t.trim();if(!o)return e;let a=e.toLowerCase(),r=o.toLowerCase(),n=a.indexOf(r);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)]})},kl=({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(a=>{let r=typeof a.value=="string"||typeof a.value=="number"?String(a.value):null;return jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:wu(a.label,t)}),jsxRuntime.jsx(material.Typography,{component:"div",variant:"body2",sx:{mt:.2,fontWeight:500,wordBreak:"break-word"},children:r?wu(r,t):a.value})]},a.id)})})]})};var kc=e=>e==null?"":typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):"",wl=e=>e.trim().toLowerCase(),S0=(e,t)=>{let o=[];return e.forEach(a=>{a.fields.forEach(r=>{let n=r.searchableText||kc(r.value),i={source:"section",sourceId:a.id,sourceSectionId:a.id,sourceTitle:a.title,fieldId:r.id,fieldLabel:r.label,fieldValue:n};o.push({hit:i,text:wl(`${a.title} ${r.label} ${n}`)});});}),t.forEach(a=>{(a.fields||[]).forEach(r=>{let n=r.searchableText||kc(r.value),i={source:"tab",sourceId:a.id,sourceTitle:a.label,fieldId:r.id,fieldLabel:r.label,fieldValue:n};o.push({hit:i,text:wl(`${a.label} ${r.label} ${n}`)});}),(a.sections||[]).forEach(r=>{r.fields.forEach(n=>{let i=n.searchableText||kc(n.value),c={source:"tab",sourceId:a.id,sourceSectionId:r.id,sourceTitle:`${a.label} / ${r.title}`,fieldId:n.id,fieldLabel:n.label,fieldValue:i};o.push({hit:c,text:wl(`${a.label} ${r.title} ${n.label} ${i}`)});});});}),o},Tu=({sections:e,tabs:t=[],defaultTabId:o,ai:a})=>{let{t:r}=ee(),[n,i]=vt.useState(""),[c,d]=vt.useState(o||t[0]?.id),[s,l]=vt.useState("idle"),[g,f]=vt.useState([]),[u,h]=vt.useState(""),[w,p]=vt.useState(""),[C,m]=vt.useState(false),y=vt.useMemo(()=>S0(e,t),[e,t]);vt.useEffect(()=>{if(t.length===0){d(void 0);return}t.some(A=>A.id===c)||d(o||t[0]?.id);},[t,c,o]);let b=vt.useCallback(()=>{l("idle"),f([]),h(""),p("");},[]),T=vt.useCallback(k=>{i(k),k.trim()||(l("idle"),f([]),h(""),p(""));},[]),B=vt.useCallback(k=>{let A=wl(k);return A?y.filter(P=>P.text.includes(A)).map(P=>P.hit):[]},[y]),R=vt.useCallback(async()=>{let k=n.trim();if(!k)return;m(true);let A=B(k);if(f(A),A.length>0){l("search"),p(""),h(r("detail.searchAi.matches",{count:A.length})),m(false);return}if(a?.enabled!==false&&a?.onSubmit){l("ai"),h(r("detail.searchAi.autoAiFallback"));try{let v=await a.onSubmit(k,{query:k,hits:A,activeTabId:c,sections:e,tabs:t});p(typeof v=="string"?v:"");}finally{m(false);}return}l("search"),p(""),h(r("detail.searchAi.noMatch")),m(false);},[n,B,r,a,c,e,t]);return {query:n,setQuery:T,activeTabId:c,setActiveTabId:d,searchMode:s,hits:g,statusText:u,aiResponse:w,searching:C,handleSubmit:R,clearResult:b}};var RA=({title:e,subtitle:t,sections:o,tabs:a=[],defaultTabId:r,table:n,ai:i,rightHeaderSlot:c,searchBarWidth:d=460,onClose:s,closeLabel:l="Close"})=>{let{t:g}=ee(),{query:f,setQuery:u,activeTabId:h,setActiveTabId:w,searchMode:p,hits:C,statusText:m,aiResponse:y,searching:b,handleSubmit:T,clearResult:B}=Tu({sections:o,tabs:a,defaultTabId:r,ai:i}),R=vt.useMemo(()=>a.find(P=>P.id===h)||a[0],[a,h]),k=vt.useCallback(P=>{let v=M=>{let S=document.getElementById(P);if(S){S.scrollIntoView({behavior:"smooth",block:"center"});return}M<4&&setTimeout(()=>v(M+1),60);};requestAnimationFrame(()=>v(0));},[]),A=vt.useCallback((P,v)=>{if(a.some(M=>M.id===P)){w(P),k(v?`detail-tab-${P}-section-${v}`:`detail-tab-${P}`);return}k(`detail-section-${P}`);},[a,w,k]);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(Su,{value:f,onChange:u,onSubmit:T,onVoiceInput:i?.onVoiceInput,onClear:()=>{u(""),B();},placeholder:i?.placeholder||g("detail.searchAi.placeholder"),statusText:m,loading:b,compact:true,showStatusText:false})}),s&&jsxRuntime.jsx(material.Tooltip,{title:l,children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:s,children:jsxRuntime.jsx(D0__default.default,{fontSize:"small"})})}),c]})]}),m&&jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",sx:{mt:-0.7},children:m}),p==="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(P=>jsxRuntime.jsx(material.Box,{component:"button",type:"button",onClick:()=>A(P.sourceId,P.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:P.sourceTitle})," \xB7 ",jsxRuntime.jsx(material.Box,{component:"span",sx:{fontWeight:700},children:P.fieldLabel})," = ",jsxRuntime.jsx(material.Box,{component:"span",children:P.fieldValue||"-"})]})},`${P.source}|${P.sourceId}|${P.fieldId}`))})]}),p==="ai"&&y&&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(ai,{markdown:y})})]}),jsxRuntime.jsx(material.Box,{sx:{display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",lg:"repeat(2, minmax(0, 1fr))"}},children:o.map(P=>jsxRuntime.jsx(material.Box,{id:`detail-section-${P.id}`,children:jsxRuntime.jsx(kl,{section:P,highlightQuery:f})},P.id))}),a.length>0&&jsxRuntime.jsxs(material.Paper,{variant:"outlined",sx:{borderRadius:2,overflow:"hidden"},children:[jsxRuntime.jsx(material.Tabs,{value:R?.id||false,onChange:(P,v)=>w(v),variant:"scrollable",scrollButtons:"auto",sx:{borderBottom:"1px solid",borderColor:"divider"},children:a.map(P=>jsxRuntime.jsx(material.Tab,{value:P.id,label:P.label,sx:{textTransform:"none"}},P.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(P=>jsxRuntime.jsx(material.Box,{id:`detail-tab-${R?.id}-section-${P.id}`,children:jsxRuntime.jsx(kl,{section:P,highlightQuery:f})},P.id)),R?.fields&&R.fields.length>0&&jsxRuntime.jsx(kl,{section:{id:`${R.id}-fields`,title:R.label,fields:R.fields,columns:2},highlightQuery:f})]})]})]}),n&&jsxRuntime.jsx($a,{title:n.title||g("detail.table.title"),...n.tableProps,filterConfig:void 0,fitContainer:false})]})};var Du=({bucket:e,cardCount:t,highlighted:o=false,children:a,emptyLabel:r,maxHeight:n,sx:i})=>{let{t:c}=ee();return jsxRuntime.jsx(material.Paper,{sx:[d=>{let s=e.accentColor??d.palette.primary.main;return {position:"relative",minWidth:0,borderRadius:4,overflow:"hidden",border:`1px solid ${styles.alpha(s,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(s,.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:s}}},...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?a: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:r??e.emptyLabel??c("kanban.empty")})})})]})})};var F0={success:"success",warning:"warning",info:"info",error:"error"},L0={critical:"error",high:"warning",medium:"info",low:"success"},z0=(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}},N0=e=>e?e.split(/\s+/).map(t=>t.charAt(0).toUpperCase()).slice(0,2).join(""):"NA",wc=({card:e,bucket:t,dragging:o=false,overlay:a=false,onClick:r,sx:n})=>{let{t:i}=ee(),c=!!(r&&t),d=e.tone??(e.priority?L0[e.priority]:"default"),s=d==="default"?"primary":F0[d],l=t?{card:e,bucket:t}:void 0;return jsxRuntime.jsx(material.Paper,{onClick:c?()=>l&&r?.(l):void 0,onKeyDown:c?g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),l&&r?.(l));}:void 0,role:c?"button":void 0,tabIndex:c?0:void 0,sx:[g=>{let f=d==="default"?g.palette.primary.main:g.palette[s].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:a?`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:a?"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:s,label:z0(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:s,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??N0(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 O0=(e,t)=>Number.isNaN(e)||e<0?0:e>t?t:e,Bu=({buckets:e,cards:t})=>{let o=new Map;return t.forEach((a,r)=>{let n=o.get(a.bucketId)??[];n.push({card:a,sourceIndex:r}),o.set(a.bucketId,n);}),{buckets:e.map(a=>{let r=[...o.get(a.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:a.id,position:i}));return {...a,cards:r}})}},Oo=(e,t)=>{for(let o=0;o<e.buckets.length;o+=1){let a=e.buckets[o],r=a.cards.findIndex(n=>n.id===t);if(r>=0)return {card:a.cards[r],bucket:a,bucketIndex:o,cardIndex:r}}},Pl=(e,t)=>{let o=Oo(e,t.cardId);if(!o)return e;let a=e.buckets.findIndex(s=>s.id===t.toBucketId);if(a<0)return e;let r=e.buckets.map(s=>({...s,cards:s.cards.map(l=>({...l}))})),n=r[o.bucketIndex],[i]=n.cards.splice(o.cardIndex,1);if(!i)return e;let c=r[a],d=O0(t.targetIndex??c.cards.length,c.cards.length);return c.cards.splice(d,0,{...i,bucketId:t.toBucketId}),{buckets:r.map(s=>({...s,cards:s.cards.map((l,g)=>({...l,bucketId:s.id,position:g}))}))}};var Tc="kanban-card|",Ic="kanban-bucket|",zu=e=>`${Tc}${e}`,Q0=e=>`${Ic}${e}`,Rl=e=>e?.startsWith(Tc)?e.slice(Tc.length):void 0,Lu=e=>e?.startsWith(Ic)?e.slice(Ic.length):void 0,J0=({card:e,bucket:t,onCardClick:o})=>{let{setNodeRef:a,attributes:r,listeners:n,transform:i,transition:c,isDragging:d}=sortable.useSortable({id:zu(e.id)}),s={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:a,style:s,...r,...n,children:jsxRuntime.jsx(wc,{card:e,bucket:t,dragging:d,onClick:o})})},ev=({bucket:e,highlighted:t,bucketMaxHeight:o,emptyBucketLabel:a,onCardClick:r})=>{let{isOver:n,setNodeRef:i}=core.useDroppable({id:Q0(e.id)});return jsxRuntime.jsx(material.Box,{ref:i,sx:{minWidth:0},children:jsxRuntime.jsx(Du,{bucket:e,cardCount:e.cards.length,highlighted:t||n,emptyLabel:a,maxHeight:o,children:jsxRuntime.jsx(sortable.SortableContext,{items:e.cards.map(c=>zu(c.id)),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:1,children:e.cards.map(c=>jsxRuntime.jsx(J0,{card:c,bucket:e,onCardClick:r},c.id))})})})})},ZA=({model:e,onCardMove:t,onCardClick:o,minBucketWidth:a=320,bucketMaxHeight:r,emptyBucketLabel:n,sx:i})=>{let[c,d]=vt.useState(null),[s,l]=vt.useState(),g=core.useSensors(core.useSensor(core.PointerSensor,{activationConstraint:{distance:6}}),core.useSensor(core.TouchSensor,{activationConstraint:{delay:120,tolerance:8}})),f=vt.useMemo(()=>c?Oo(e,c):void 0,[c,e]),u=vt.useCallback(()=>{d(null),l(void 0);},[]),h=vt.useCallback(m=>{if(!m)return;let y=Rl(m);return y?Oo(e,y)?.bucket.id:Lu(m)},[e]),w=vt.useCallback(m=>{d(Rl(String(m.active.id))??null);},[]),p=vt.useCallback(m=>{l(h(m.over?String(m.over.id):void 0));},[h]),C=vt.useCallback(m=>{let y=Rl(String(m.active.id)),b=m.over?String(m.over.id):void 0;if(!y||!b){u();return}let T=Oo(e,y);if(!T){u();return}let B=T.bucket.id,R=T.cardIndex,k=Rl(b);if(k){let v=Oo(e,k);if(!v){u();return}B=v.bucket.id,R=v.cardIndex;}else {let v=Lu(b),M=e.buckets.find(S=>S.id===v);if(!v||!M){u();return}B=v,R=M.cards.length;}if(T.bucket.id===B&&T.cardIndex===R){u();return}let A=Pl(e,{cardId:y,fromBucketId:T.bucket.id,toBucketId:B,targetIndex:R}),P=Oo(A,y);P&&!(P.bucket.id===T.bucket.id&&P.cardIndex===T.cardIndex)&&t?.({cardId:y,fromBucketId:T.bucket.id,toBucketId:P.bucket.id,targetIndex:P.cardIndex,card:P.card,model:A}),u();},[e,t,u]);return jsxRuntime.jsxs(core.DndContext,{sensors:g,collisionDetection:core.closestCorners,onDragStart:w,onDragOver:p,onDragEnd:C,onDragCancel:u,children:[jsxRuntime.jsx(material.Box,{sx:[{display:"grid",gridAutoFlow:"column",gridAutoColumns:`minmax(${a}px, 1fr)`,gap:2,alignItems:"start",overflowX:"auto",pb:.5},...Array.isArray(i)?i:i?[i]:[]],children:e.buckets.map(m=>jsxRuntime.jsx(ev,{bucket:m,highlighted:m.id===s,bucketMaxHeight:r,emptyBucketLabel:n,onCardClick:o},m.id))}),jsxRuntime.jsx(core.DragOverlay,{children:f?jsxRuntime.jsx(material.Box,{sx:{width:Math.max(a-24,260)},children:jsxRuntime.jsx(wc,{card:f.card,bucket:f.bucket,overlay:true})}):null})]})};var rv=({initialModel:e,initialBuckets:t,initialCards:o})=>e||Bu({buckets:t??[],cards:o??[]}),eB=e=>{let{onCardMove:t,onCardClick:o}=e,[a,r]=vt.useState(()=>rv(e)),n=vt.useCallback(l=>{r(g=>typeof l=="function"?l(g):l);},[]),i=vt.useCallback(l=>Oo(a,l),[a]),c=vt.useCallback((l,g,f)=>{let u=Oo(a,l);if(!u)return;let h=Pl(a,{cardId:l,fromBucketId:u.bucket.id,toBucketId:g,targetIndex:f}),w=Oo(h,l);if(!w||w.bucket.id===u.bucket.id&&w.cardIndex===u.cardIndex)return;r(h);let p={cardId:l,fromBucketId:u.bucket.id,toBucketId:w.bucket.id,targetIndex:w.cardIndex,card:w.card,model:h};return t?.(p),p},[a,t]),d=vt.useCallback((l,g)=>{r(f=>({buckets:f.buckets.map(u=>({...u,cards:u.cards.map(h=>h.id!==l?h:typeof g=="function"?g(h):{...h,...g})}))}));},[]),s=vt.useMemo(()=>({model:a,onCardMove:l=>{c(l.cardId,l.toBucketId,l.targetIndex);},onCardClick:o}),[a,c,o]);return {model:a,actions:{replaceModel:n,moveCard:c,updateCard:d,getCard:i},boardProps:s}};var Hu=64,xv="#E9EDF2",vv="linear-gradient(90deg, #F5F7FA 0%, #E9EDF2 50%, #F5F7FA 100%)",Cv=["en","zh","fr","de","ja","ko"],Wu={en:"EN",zh:"\u4E2D\u6587",fr:"FR",de:"DE",ja:"\u65E5\u672C\u8A9E",ko:"\uD55C\uAD6D\uC5B4"},Bl=({appTitle:e,logo:t,mode:o="dark",onToggleMode:a,locale:r,localeLabel:n,localeOptions:i,onLocaleChange:c,searchPlaceholder:d,onSearch:s,user:l,onUserSetting:g,onUserLogout:f,userMenuItems:u,leftSlot:h,rightSlot:w})=>{let{t:p,locale:C}=ee(),y=material.useTheme().palette.mode==="dark",[b,T]=vt.useState(""),[B,R]=vt.useState(null),[k,A]=vt.useState(null),P=_=>{_.preventDefault(),s&&s(b.trim());},v=o==="system"?jsxRuntime.jsx(gv__default.default,{fontSize:"small"}):o==="dark"?jsxRuntime.jsx(fv__default.default,{fontSize:"small"}):jsxRuntime.jsx(hv__default.default,{fontSize:"small"}),M=p(o==="system"?"header.theme.system":o==="dark"?"header.theme.dark":"header.theme.light"),S=r||C,I=i&&i.length>0?i:Cv,D=n||Wu[S]||S.toUpperCase(),G=!!B,V=d||p("header.searchPlaceholder"),X=!!k,de=[{key:"setting",label:p("header.menu.setting"),icon:jsxRuntime.jsx(Gb__default.default,{sx:{fontSize:18}}),onClick:g},{key:"logout",label:p("header.menu.logout"),icon:jsxRuntime.jsx(bv__default.default,{sx:{fontSize:18}}),onClick:f}],oe=u&&u.length>0?u:de,re=_=>{A(null),_?.();};return jsxRuntime.jsxs(material.AppBar,{position:"sticky",elevation:0,sx:_=>({top:0,zIndex:_.zIndex.drawer+10,height:Hu,backgroundColor:_.palette.mode==="dark"?"#0D0D0D":xv,backgroundImage:_.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%)",vv,"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:_.palette.mode==="dark"?"rgba(255,255,255,0.12)":"rgba(15,23,42,0.12)"}),children:[jsxRuntime.jsxs(material.Toolbar,{sx:{minHeight:`${Hu}px !important`,px:2,gap:2},children:[jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:1.5,sx:{minWidth:220},children:[h,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:y?"common.white":"#111827"},children:e})]}),jsxRuntime.jsx(material.Box,{sx:{flex:1,display:"flex",justifyContent:"center",minWidth:0},children:jsxRuntime.jsx(material.Box,{component:"form",onSubmit:P,sx:{width:"100%",maxWidth:540},children:jsxRuntime.jsx(material.TextField,{size:"small",fullWidth:true,value:b,onChange:_=>T(_.target.value),placeholder:V,InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(Gd__default.default,{sx:{color:y?"rgba(255,255,255,0.7)":"rgba(15,23,42,0.55)",fontSize:18}})}),sx:{color:y?"common.white":"rgba(17,24,39,0.9)",bgcolor:y?"rgba(255,255,255,0.08)":"#ffffff",borderRadius:999,"& .MuiOutlinedInput-notchedOutline":{borderColor:y?"rgba(255,255,255,0.15)":"rgba(15,23,42,0.2)"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:y?"rgba(255,255,255,0.35)":"rgba(15,23,42,0.35)"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:y?"rgba(255,255,255,0.5)":"rgba(15,23,42,0.55)"}}},inputProps:{style:{color:y?"white":"#111827"}}})})}),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:_=>R(_.currentTarget),sx:{color:y?"common.white":"#111827",borderRadius:1,px:.5},children:jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:.45,children:[jsxRuntime.jsx(Ou__default.default,{sx:{fontSize:18}}),jsxRuntime.jsx(material.Typography,{variant:"caption",sx:{fontWeight:500},children:D})]})}),jsxRuntime.jsx(material.Menu,{anchorEl:B,open:G,onClose:()=>R(null),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:I.map(_=>jsxRuntime.jsx(material.MenuItem,{selected:_===S,onClick:()=>{c(_),R(null);},sx:{fontSize:"0.82rem"},children:Wu[_]},_))})]}):jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:.5,children:[jsxRuntime.jsx(Ou__default.default,{sx:{color:y?"common.white":"#111827",fontSize:18}}),jsxRuntime.jsx(material.Typography,{variant:"caption",sx:{color:y?"common.white":"#111827",fontWeight:500},children:D})]}),jsxRuntime.jsx(material.IconButton,{size:"small",sx:{color:y?"common.white":"#111827"},onClick:a,title:M,children:v}),l&&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:y?"common.white":"#111827",fontWeight:700,lineHeight:1.15},children:l.name}),l.subtitle&&jsxRuntime.jsx(material.Typography,{variant:"caption",sx:{display:"block",mt:.25,color:y?"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:l.subtitle,children:l.subtitle})]}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:_=>A(_.currentTarget),sx:{p:0},children:jsxRuntime.jsx(material.Avatar,{src:l.avatarSrc,imgProps:{style:{objectFit:"cover"}},sx:{width:34,height:34,bgcolor:"grey.100",color:"grey.700",fontSize:"0.85rem"},children:l.avatarText||l.name.slice(0,1).toUpperCase()})})]}),w]})]}),l&&jsxRuntime.jsx(material.Menu,{anchorEl:k,open:X,onClose:()=>A(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:oe.map(_=>jsxRuntime.jsxs(material.MenuItem,{disabled:_.disabled,onClick:()=>re(_.onClick),children:[_.icon&&jsxRuntime.jsx(material.ListItemIcon,{children:_.icon}),jsxRuntime.jsx(material.ListItemText,{primary:_.label,slotProps:{primary:{sx:{fontSize:"0.86rem",fontWeight:500}}}})]},_.key))})]})};var $u=({menuData:e=[],initialNavigationCollapsed:t=false}={})=>{let{navigationIslandProps:o}=zd({initialCollapsed:t,content:e}),[a,r]=vt.useState(900);vt.useEffect(()=>{let i=()=>r(window.innerHeight);return i(),window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[]);let n=vt.useMemo(()=>Math.max(280,a-100),[a]);return {navigationIslandProps:o,navigationMaxHeight:n}};var wB=({appTitle:e,menuData:t=[],children:o,showNavigation:a=true,locale:r="en",localeLabel:n,localeOptions:i,onLocaleChange:c,user:d,onUserSetting:s,onUserLogout:l,userMenuItems:g,logo:f,onSearch:u,rightHeaderSlot:h,leftHeaderSlot:w,contentSx:p})=>{let C="orbcafe:page-layout-mode",[m,y]=vt.useState("system"),[b,T]=vt.useState("light"),[B,R]=vt.useState(false),k=m==="system"?B?b:"light":m;vt.useEffect(()=>{try{let I=window.localStorage.getItem(C);(I==="light"||I==="dark"||I==="system")&&y(I);}catch{}R(true);let M=window.matchMedia("(prefers-color-scheme: dark)"),S=()=>{T(M.matches?"dark":"light");};return S(),M.addEventListener("change",S),()=>M.removeEventListener("change",S)},[]),vt.useEffect(()=>{if(B)try{window.localStorage.setItem(C,m);}catch{}},[B,m]),vt.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 A=vt.useMemo(()=>material.createTheme({palette:{mode:k}}),[k]),{navigationIslandProps:P,navigationMaxHeight:v}=$u({menuData:t,initialNavigationCollapsed:false});return jsxRuntime.jsx(material.ThemeProvider,{theme:A,children:jsxRuntime.jsx(Mi,{locale:r,children:jsxRuntime.jsxs(material.Box,{sx:M=>({minHeight:"100vh",display:"flex",flexDirection:"column",background:M.palette.mode==="dark"?"linear-gradient(180deg, #0A0A0A 0%, #141414 55%, #1A1A1A 100%)":M.palette.background.default}),children:[jsxRuntime.jsx(Bl,{appTitle:e,logo:f,mode:m,onToggleMode:()=>y(M=>M==="system"?"dark":M==="dark"?"light":"system"),locale:r,localeLabel:n,localeOptions:i,onLocaleChange:c,user:d,onUserSetting:s,onUserLogout:l,userMenuItems:g,onSearch:u,leftSlot:w,rightSlot:h}),jsxRuntime.jsxs(material.Box,{sx:{flex:1,minHeight:0,display:"flex"},children:[a&&jsxRuntime.jsx(material.Box,{sx:{p:1.5,display:"flex",alignItems:"flex-start",flexShrink:0},children:jsxRuntime.jsx(Fd,{...P,maxHeight:v,colorMode:k})}),jsxRuntime.jsx(material.Box,{sx:{flex:1,minWidth:0,minHeight:0,overflow:"auto",p:1.5,...p},children:o})]})]})})})};var Fl="(blank)",Uu="Result",Ku="Grand Total",qu={sum:"Sum",count:"Count",avg:"Average",min:"Min",max:"Max"},_u=["sum","count","avg","min","max"];var ju=["palette","rows","columns","filters","values"];var Zu=e=>ju.includes(e),Xu=e=>e==="rows"||e==="columns"||e==="filters",Ll=e=>{let t=e.split("|");return t.length===2&&t[0]==="container"&&Zu(t[1])?{kind:"container",zone:t[1]}:t.length===3&&t[0]==="item"&&Zu(t[1])&&t[2]?{kind:"item",zone:t[1],key:t[2]}:null},ba=e=>e==null||e===""?Fl:e instanceof Date?e.toISOString().slice(0,10):String(e),Cr=e=>JSON.stringify(e),Yu=(e,t)=>{let o=e.join(""),a=t.join("");return o.localeCompare(a,void 0,{sensitivity:"base"})},Dv=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},ln=(e,t,o)=>{if(o==="count")return e.length;let a=e.map(r=>Dv(r[t])).filter(r=>r!==null);return a.length===0?0:o==="sum"?a.reduce((r,n)=>r+n,0):o==="avg"?a.reduce((r,n)=>r+n,0)/a.length:o==="min"?Math.min(...a):Math.max(...a)},Rt=(e,t)=>{if(!e||e.length===0)return [];let o=new Set,a=[];return e.forEach(r=>{!t.has(r)||o.has(r)||(o.add(r),a.push(r));}),a},xa=(e,t)=>e.length!==t.length?false:e.every((o,a)=>o===t[a]),Qu=(e,t)=>{let o=Object.keys(e),a=Object.keys(t);return o.length!==a.length?false:o.every(r=>{let n=e[r]??[],i=t[r]??[];return xa(n,i)})},zl=(e,t)=>e.length!==t.length?false:e.every((o,a)=>{let r=t[a];return o.tokenId===r.tokenId&&o.fieldId===r.fieldId&&o.aggregation===r.aggregation}),Ac=e=>!e?.aggregations||e.aggregations.length===0?_u:e.aggregations,jt=(e,t)=>{let o=Ac(t);return e&&o.includes(e)?e:t?.type==="number"&&o.includes("sum")?"sum":o.includes("count")?"count":o[0]},di=(e,t,o)=>{let a=o.get(t.fieldId);return a?.formatValue?a.formatValue(e):t.aggregation==="count"?Math.round(e).toLocaleString():e.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:2})};var tm=({options:e,selectedValues:t,onChange:o,minWidth:a=96})=>{let{t:r}=ee(),[n,i]=vt.useState(""),c=vt.useMemo(()=>{let s=n.trim().toLowerCase();return s?e.filter(l=>l.toLowerCase().includes(s)):e},[e,n]),d=e.length>0&&t.length===e.length;return jsxRuntime.jsx(material.FormControl,{size:"small",sx:{minWidth:a},children:jsxRuntime.jsxs(material.Select,{multiple:true,value:t,onChange:s=>{let l=s.target.value,g=typeof l=="string"?l.split(","):l;o(g);},onClick:s=>s.stopPropagation(),onMouseDown:s=>s.stopPropagation(),renderValue:s=>{let l=s;return e.length===0?r("pivot.filter.na"):l.length===0?r("common.none"):l.length===e.length?r("common.all"):`${l.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:s=>({bgcolor:"background.paper",py:.8,lineHeight:"normal",borderBottom:`1px solid ${s.palette.divider}`}),children:jsxRuntime.jsx(material.TextField,{size:"small",placeholder:`${r("common.search")}...`,fullWidth:true,value:n,onChange:s=>i(s.target.value),onKeyDown:s=>s.stopPropagation(),onClick:s=>s.stopPropagation(),sx:{m:0,"& .MuiInputBase-input":{fontSize:"0.75rem",py:.7}}})}),jsxRuntime.jsx(material.Box,{sx:s=>({px:1.5,py:.5,borderBottom:`1px solid ${s.palette.divider}`,bgcolor:"background.paper"}),onMouseDown:s=>{s.preventDefault(),s.stopPropagation();},onClick:s=>{s.preventDefault(),s.stopPropagation();},children:jsxRuntime.jsx(material.Button,{variant:"text",size:"small",onClick:s=>{s.preventDefault(),s.stopPropagation(),o(d?[]:e);},sx:{minWidth:"auto",px:0,py:.2,fontSize:"0.76rem",fontWeight:700,textTransform:"none"},children:r(d?"pivot.filter.deselectAll":"pivot.filter.selectAll")})}),c.length===0&&jsxRuntime.jsx(material.MenuItem,{disabled:true,sx:{fontSize:"0.75rem"},children:r("pivot.filter.noResults")}),c.map(s=>{let l=t.includes(s);return jsxRuntime.jsxs(material.MenuItem,{value:s,sx:{fontSize:"0.75rem",py:.25},children:[jsxRuntime.jsx(material.Checkbox,{size:"small",checked:l,sx:{p:.5,mr:.5}}),jsxRuntime.jsx(material.ListItemText,{primary:s,primaryTypographyProps:{sx:{fontSize:"0.75rem",lineHeight:1.2}}})]},s)})]})})};var Ec=({label:e,subtitle:t,isDragging:o,dragRef:a,listeners:r,attributes:n,style:i})=>jsxRuntime.jsx(material.Paper,{ref:a,...r,...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(Wv__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})]})]})}),rm=({id:e,label:t,subtitle:o})=>{let{setNodeRef:a,listeners:r,attributes:n,isDragging:i}=core.useDraggable({id:e});return jsxRuntime.jsx(Ec,{label:t,subtitle:o,isDragging:i,dragRef:a,listeners:r,attributes:n})};var dn=({zone:e,title:t,hint:o,icon:a,children:r,itemCount:n,onClear:i})=>{let c=`container|${e}`,{isOver:d,setNodeRef:s}=core.useDroppable({id:c}),{t:l}=ee();return jsxRuntime.jsxs(material.Paper,{ref:s,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:[a,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:l("pivot.clearArea"),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:i,sx:{p:.25},children:jsxRuntime.jsx(qv__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:r})]})};var im={xs:1.2,md:1.6},un=({title:e,subtitle:t,collapsed:o,onToggleCollapse:a,expandAriaLabel:r,collapseAriaLabel:n,children:i,bodySx:c,unmountOnExit:d=false,headerActions:s})=>jsxRuntime.jsxs(material.Paper,{sx:l=>({borderRadius:3,border:`1px solid ${l.palette.divider}`,overflow:"hidden",bgcolor:styles.alpha(l.palette.background.paper,.95)}),children:[jsxRuntime.jsxs(material.Box,{sx:l=>({px:im,py:1,display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,borderBottom:o?"none":`1px solid ${l.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:[s,jsxRuntime.jsx(material.IconButton,{size:"small","aria-label":o?r:n,onClick:a,sx:l=>({border:`1px solid ${l.palette.divider}`,bgcolor:styles.alpha(l.palette.background.paper,.88),width:28,height:28,borderRadius:999,flexShrink:0,"&:hover":{bgcolor:l.palette.mode==="dark"?styles.alpha(l.palette.primary.main,.18):styles.alpha(l.palette.primary.main,.08)}}),children:jsxRuntime.jsx(Ub__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:im,py:{xs:1.2,md:1.6}},...Array.isArray(c)?c:c?[c]:[]],children:i})})]});var Wl=({label:e,caption:t,onRemove:o,trailing:a,isDragging:r,dragRef:n,listeners:i,attributes:c,style:d})=>jsxRuntime.jsx(material.Paper,{ref:n,style:d,sx:s=>({p:1,borderRadius:2,border:"1px solid",borderColor:"divider",bgcolor:s.palette.mode==="dark"?"#111111":"background.paper",touchAction:"none",opacity:r?0:1}),children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:.8},children:[jsxRuntime.jsx(material.Box,{...c,...i,sx:s=>({display:"inline-flex",alignItems:"center",justifyContent:"center",p:.25,borderRadius:1,bgcolor:s.palette.mode==="dark"?"rgba(255,255,255,0.12)":"rgba(17, 24, 39, 0.08)",cursor:"grab"}),children:jsxRuntime.jsx(Wv__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})]}),a,o&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:s=>{s.stopPropagation(),o();},sx:{p:.2},children:jsxRuntime.jsx(lh__default.default,{sx:{fontSize:16}})})]})}),pi=({id:e,label:t,caption:o,onRemove:a,trailing:r})=>{let{setNodeRef:n,attributes:i,listeners:c,transform:d,transition:s,isDragging:l}=sortable.useSortable({id:e}),g={transform:d?`translate3d(${d.x}px, ${d.y}px, 0)`:void 0,transition:s,zIndex:l?999:"auto"};return jsxRuntime.jsx(Wl,{label:t,caption:o,onRemove:a,trailing:r,isDragging:l,dragRef:n,listeners:c,attributes:i,style:g})};var Ul={rows:jsxRuntime.jsx(iC__default.default,{fontSize:"small"}),columns:jsxRuntime.jsx(kh__default.default,{fontSize:"small"}),filters:jsxRuntime.jsx(nC__default.default,{fontSize:"small"}),values:jsxRuntime.jsx(Ih__default.default,{fontSize:"small"})},cm=({isConfiguratorCollapsed:e,onToggleCollapse:t,availableFields:o,fieldMap:a,filterFields:r,columnFields:n,rowFields:i,valueFields:c,clearZone:d,removeFieldFromZone:s,getFilterSelectionSummary:l,renderDimensionFilterSelect:g,renderAggregationSelect:f,getAggregationLabel:u})=>{let{t:h}=ee(),w=[`${h("pivot.zone.rows")} ${i.length}`,`${h("pivot.zone.columns")} ${n.length}`,`${h("pivot.zone.filters")} ${r.length}`,`${h("pivot.zone.values")} ${c.length}`].join(" \xB7 ");return jsxRuntime.jsx(un,{title:h("pivot.config.title"),subtitle:w,collapsed:e,onToggleCollapse:t,expandAriaLabel:h("pivot.collapse.ariaExpand"),collapseAriaLabel:h("pivot.collapse.ariaCollapse"),unmountOnExit:true,children:jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",lg:"260px 1fr"},gap:2},children:[jsxRuntime.jsx(dn,{zone:"palette",title:h("pivot.fieldList"),hint:h("pivot.availableDimensions"),itemCount:o.length,icon:jsxRuntime.jsx(Wv__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:h("pivot.allFieldsInUse")}),o.map(p=>jsxRuntime.jsx(rm,{id:`item|palette|${p.id}`,label:p.label,subtitle:p.type??"string"},p.id))]})}),jsxRuntime.jsxs(material.Stack,{spacing:2,children:[jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[jsxRuntime.jsx(dn,{zone:"filters",title:h("pivot.zone.filters"),hint:h("pivot.hint.filters"),icon:Ul.filters,itemCount:r.length,onClear:()=>d("filters"),children:jsxRuntime.jsx(sortable.SortableContext,{items:r.map(p=>`item|filters|${p}`),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:.7,children:r.map(p=>jsxRuntime.jsx(pi,{id:`item|filters|${p}`,label:a.get(p)?.label??p,caption:l(p),trailing:g(p),onRemove:()=>s("filters",p)},p))})})}),jsxRuntime.jsx(dn,{zone:"columns",title:h("pivot.zone.columns"),hint:h("pivot.hint.columns"),icon:Ul.columns,itemCount:n.length,onClear:()=>d("columns"),children:jsxRuntime.jsx(sortable.SortableContext,{items:n.map(p=>`item|columns|${p}`),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:.7,children:n.map(p=>jsxRuntime.jsx(pi,{id:`item|columns|${p}`,label:a.get(p)?.label??p,caption:`${a.get(p)?.type??"dimension"} \u2022 ${l(p)}`,trailing:g(p),onRemove:()=>s("columns",p)},p))})})})]}),jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[jsxRuntime.jsx(dn,{zone:"rows",title:h("pivot.zone.rows"),hint:h("pivot.hint.rows"),icon:Ul.rows,itemCount:i.length,onClear:()=>d("rows"),children:jsxRuntime.jsx(sortable.SortableContext,{items:i.map(p=>`item|rows|${p}`),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:.7,children:i.map(p=>jsxRuntime.jsx(pi,{id:`item|rows|${p}`,label:a.get(p)?.label??p,caption:`${a.get(p)?.type??"dimension"} \u2022 ${l(p)}`,trailing:g(p),onRemove:()=>s("rows",p)},p))})})}),jsxRuntime.jsx(dn,{zone:"values",title:h("pivot.zone.values"),hint:h("pivot.hint.values"),icon:Ul.values,itemCount:c.length,onClear:()=>d("values"),children:jsxRuntime.jsx(sortable.SortableContext,{items:c.map(p=>`item|values|${p.tokenId}`),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:.7,children:c.map(p=>{let C=a.get(p.fieldId)?.label??p.fieldId,m=`${u(p.aggregation)}(${C})`;return jsxRuntime.jsx(pi,{id:`item|values|${p.tokenId}`,label:C,caption:m,trailing:f(p),onRemove:()=>s("values",p.tokenId)},p.tokenId)})})})})]})]})]})})};var dm=e=>e.toLocaleString(void 0,{maximumFractionDigits:1}),pm=({data:e,primaryLabel:t,secondaryLabel:o,formatPrimaryValue:a,formatSecondaryValue:r})=>{let n=styles.useTheme();if(e.length===0)return null;let i=720,c=250,d={top:20,right:24,bottom:40,left:52},s=o?e.map(p=>p.primaryValue):e.map((p,C)=>C+1),l=o?e.map(p=>p.secondaryValue??0):e.map(p=>p.primaryValue),g=Math.max(...s,1),f=Math.max(...l,1),u=i-d.left-d.right,h=c-d.top-d.bottom,w=e.map((p,C)=>{let m=o?p.primaryValue:C+1,y=o?p.secondaryValue??0:p.primaryValue,b=d.left+m/g*u,T=c-d.bottom-y/f*h;return {...p,x:b,y:T,rawX:m,rawY:y}});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)}),w.map(p=>jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("circle",{cx:p.x,cy:p.y,r:7,fill:styles.alpha(n.palette.primary.main,.18)}),jsxRuntime.jsx("circle",{cx:p.x,cy:p.y,r:4.5,fill:n.palette.primary.main,children:jsxRuntime.jsxs("title",{children:[p.name,`
189
+ `),f={enableMath:a},u=0;for(;u<g.length;){let h=g[u],w=h.trim();if(!w){u+=1;continue}if(n&&ku(h)){if(w.startsWith("<think>")){let m=[],y=h;for(;;){let b=y.indexOf("<think>"),v=b>=0?y.slice(b+7):y,E=v.indexOf("</think>");if(E>=0){m.push(v.slice(0,E)),u+=1;break}if(m.push(v),u+=1,u>=g.length)break;y=g[u];}s.push(jsxRuntime.jsx(vl,{content:m.join(`
190
+ `).trim()},`think-tag-${u}`));continue}u+=1;let S=[];for(;u<g.length&&g[u].trim()!==":::";)S.push(g[u]),u+=1;u<g.length&&g[u].trim()===":::"&&(u+=1),s.push(jsxRuntime.jsx(vl,{content:S.join(`
191
+ `).trim()},`think-fence-${u}`));continue}if(Cl(h)){let S=w.slice(3).trim().toLowerCase(),m=[];for(u+=1;u<g.length&&!Cl(g[u]);)m.push(g[u]),u+=1;u<g.length&&Cl(g[u])&&(u+=1);let y=m.join(`
192
+ `);if(r&&S==="mermaid"){s.push(jsxRuntime.jsx(uc,{code:y},`mermaid-${u}`));continue}if(a&&["math","latex","katex"].includes(S)){s.push(jsxRuntime.jsx(Jn,{expression:y,allowKatex:true},`math-fence-${u}`));continue}s.push(jsxRuntime.jsx(Qn,{code:y,language:S||"text",copyable:i,showLineNumbers:c,wrapLongLines:true},`code-${u}`));continue}if(a&&w.startsWith("$$")){let S=[];if(w.endsWith("$$")&&w!=="$$")S.push(w.slice(2,-2)),u+=1;else {let y=h.slice(h.indexOf("$$")+2);for(y.trim()&&S.push(y),u+=1;u<g.length;){let b=g[u],v=b.indexOf("$$");if(v>=0){S.push(b.slice(0,v)),u+=1;break}S.push(b),u+=1;}}s.push(jsxRuntime.jsx(Jn,{expression:S.join(`
193
+ `).trim(),allowKatex:true},`math-${u}`));continue}if(xu(h)){let S=Math.min(6,h.match(/^#{1,6}/)?.[0]?.length||1),m=h.replace(/^#{1,6}\s+/,""),y=S===1?"h5":S===2?"h6":"subtitle1";s.push(jsxRuntime.jsx(material.Typography,{variant:y,sx:{mt:S===1?1.2:.8,mb:.5,fontWeight:700},children:oi(m,f,`h-${u}`)},`heading-${u}`)),u+=1;continue}if(vu(h)){s.push(jsxRuntime.jsx(material.Divider,{sx:{my:1.2}},`hr-${u}`)),u+=1;continue}if(Cu(g,u)){let S=u+2;for(;S<g.length&&g[S].trim()&&g[S].includes("|");)S+=1;let m=g.slice(u,S).join(`
194
+ `),y=bl(m);if(y){s.push(jsxRuntime.jsx(gc,{table:y},`table-${u}`)),u=S;continue}}if(xc(h)){let S=[];for(;u<g.length&&xc(g[u]);)S.push(g[u].replace(/^\s*>\s?/,"")),u+=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:S.map((m,y)=>jsxRuntime.jsxs(St.Fragment,{children:[y>0&&jsxRuntime.jsx("br",{}),oi(m,f,`q-${u}-${y}`)]},`quote-line-${y}`))})},`quote-${u}`));continue}if(yc(h)){let S=[];for(;u<g.length&&yc(g[u]);)S.push(g[u].trim().replace(/^[-*+]\s+/,"")),u+=1;s.push(jsxRuntime.jsx(material.Box,{component:"ul",sx:{my:.8,pl:2.5},children:S.map((m,y)=>jsxRuntime.jsx(material.Box,{component:"li",sx:{mb:.45},children:jsxRuntime.jsx(material.Typography,{variant:"body2",children:oi(m,f,`ul-${u}-${y}`)})},`ul-item-${y}`))},`ul-${u}`));continue}if(bc(h)){let S=[];for(;u<g.length&&bc(g[u]);)S.push(g[u].trim().replace(/^\d+\.\s+/,"")),u+=1;s.push(jsxRuntime.jsx(material.Box,{component:"ol",sx:{my:.8,pl:2.7},children:S.map((m,y)=>jsxRuntime.jsx(material.Box,{component:"li",sx:{mb:.45},children:jsxRuntime.jsx(material.Typography,{variant:"body2",children:oi(m,f,`ol-${u}-${y}`)})},`ol-item-${y}`))},`ol-${u}`));continue}let p=[];for(;u<g.length;){let S=g[u],m=S.trim();if(!m||Cl(S)||xu(S)||vu(S)||yc(S)||bc(S)||xc(S)||Cu(g,u)||n&&ku(S)||a&&m.startsWith("$$"))break;p.push(S),u+=1;}p.length>0?s.push(jsxRuntime.jsx(material.Typography,{variant:"body2",sx:{my:.65,lineHeight:1.65},children:p.map((S,m)=>jsxRuntime.jsxs(St.Fragment,{children:[m>0&&jsxRuntime.jsx("br",{}),oi(S,f,`p-${u}-${m}`)]},`p-line-${m}`))},`p-${u}`)):u+=1;}return s},[d,a,r,n,i,c]);return jsxRuntime.jsx(material.Box,{className:o,sx:{"& strong":{fontWeight:700},"& em":{fontStyle:"italic"},"& a":{wordBreak:"break-all"}},children:l})};var eA=(e,t)=>jsxRuntime.jsx(ai,{markdown:e,...t});var Tu=({value:e,onChange:t,onSubmit:o,onVoiceInput:a,onClear:r,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(Kd__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&&r&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:r,children:jsxRuntime.jsx(dh__default.default,{sx:{fontSize:d?16:18}})}),a&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:a,children:jsxRuntime.jsx(jy__default.default,{sx:{fontSize:d?16:18}})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:o,disabled:c||!e.trim(),children:jsxRuntime.jsx(Xy__default.default,{sx:{fontSize:d?16:18}})})]}),l&&i&&jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",children:i})]});var Iu=(e,t)=>{let o=t.trim();if(!o)return e;let a=e.toLowerCase(),r=o.toLowerCase(),n=a.indexOf(r);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)]})},kl=({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(a=>{let r=typeof a.value=="string"||typeof a.value=="number"?String(a.value):null;return jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:Iu(a.label,t)}),jsxRuntime.jsx(material.Typography,{component:"div",variant:"body2",sx:{mt:.2,fontWeight:500,wordBreak:"break-word"},children:r?Iu(r,t):a.value})]},a.id)})})]})};var wc=e=>e==null?"":typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):"",wl=e=>e.trim().toLowerCase(),I0=(e,t)=>{let o=[];return e.forEach(a=>{a.fields.forEach(r=>{let n=r.searchableText||wc(r.value),i={source:"section",sourceId:a.id,sourceSectionId:a.id,sourceTitle:a.title,fieldId:r.id,fieldLabel:r.label,fieldValue:n};o.push({hit:i,text:wl(`${a.title} ${r.label} ${n}`)});});}),t.forEach(a=>{(a.fields||[]).forEach(r=>{let n=r.searchableText||wc(r.value),i={source:"tab",sourceId:a.id,sourceTitle:a.label,fieldId:r.id,fieldLabel:r.label,fieldValue:n};o.push({hit:i,text:wl(`${a.label} ${r.label} ${n}`)});}),(a.sections||[]).forEach(r=>{r.fields.forEach(n=>{let i=n.searchableText||wc(n.value),c={source:"tab",sourceId:a.id,sourceSectionId:r.id,sourceTitle:`${a.label} / ${r.title}`,fieldId:n.id,fieldLabel:n.label,fieldValue:i};o.push({hit:c,text:wl(`${a.label} ${r.title} ${n.label} ${i}`)});});});}),o},Pu=({sections:e,tabs:t=[],defaultTabId:o,ai:a})=>{let{t:r}=ee(),[n,i]=St.useState(""),[c,d]=St.useState(o||t[0]?.id),[l,s]=St.useState("idle"),[g,f]=St.useState([]),[u,h]=St.useState(""),[w,p]=St.useState(""),[S,m]=St.useState(false),y=St.useMemo(()=>I0(e,t),[e,t]);St.useEffect(()=>{if(t.length===0){d(void 0);return}t.some(B=>B.id===c)||d(o||t[0]?.id);},[t,c,o]);let b=St.useCallback(()=>{s("idle"),f([]),h(""),p("");},[]),v=St.useCallback(k=>{i(k),k.trim()||(s("idle"),f([]),h(""),p(""));},[]),E=St.useCallback(k=>{let B=wl(k);return B?y.filter(P=>P.text.includes(B)).map(P=>P.hit):[]},[y]),R=St.useCallback(async()=>{let k=n.trim();if(!k)return;m(true);let B=E(k);if(f(B),B.length>0){s("search"),p(""),h(r("detail.searchAi.matches",{count:B.length})),m(false);return}if(a?.enabled!==false&&a?.onSubmit){s("ai"),h(r("detail.searchAi.autoAiFallback"));try{let C=await a.onSubmit(k,{query:k,hits:B,activeTabId:c,sections:e,tabs:t});p(typeof C=="string"?C:"");}finally{m(false);}return}s("search"),p(""),h(r("detail.searchAi.noMatch")),m(false);},[n,E,r,a,c,e,t]);return {query:n,setQuery:v,activeTabId:c,setActiveTabId:d,searchMode:l,hits:g,statusText:u,aiResponse:w,searching:S,handleSubmit:R,clearResult:b}};var AA=({title:e,subtitle:t,sections:o,tabs:a=[],defaultTabId:r,table:n,ai:i,rightHeaderSlot:c,searchBarWidth:d=460,onClose:l,closeLabel:s="Close"})=>{let{t:g}=ee(),{query:f,setQuery:u,activeTabId:h,setActiveTabId:w,searchMode:p,hits:S,statusText:m,aiResponse:y,searching:b,handleSubmit:v,clearResult:E}=Pu({sections:o,tabs:a,defaultTabId:r,ai:i}),R=St.useMemo(()=>a.find(P=>P.id===h)||a[0],[a,h]),k=St.useCallback(P=>{let C=D=>{let T=document.getElementById(P);if(T){T.scrollIntoView({behavior:"smooth",block:"center"});return}D<4&&setTimeout(()=>C(D+1),60);};requestAnimationFrame(()=>C(0));},[]),B=St.useCallback((P,C)=>{if(a.some(D=>D.id===P)){w(P),k(C?`detail-tab-${P}-section-${C}`:`detail-tab-${P}`);return}k(`detail-section-${P}`);},[a,w,k]);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(Tu,{value:f,onChange:u,onSubmit:v,onVoiceInput:i?.onVoiceInput,onClear:()=>{u(""),E();},placeholder:i?.placeholder||g("detail.searchAi.placeholder"),statusText:m,loading:b,compact:true,showStatusText:false})}),l&&jsxRuntime.jsx(material.Tooltip,{title:s,children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:l,children:jsxRuntime.jsx(B0__default.default,{fontSize:"small"})})}),c]})]}),m&&jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",sx:{mt:-0.7},children:m}),p==="search"&&S.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:S.length})}),jsxRuntime.jsx(material.Stack,{spacing:.35,children:S.slice(0,8).map(P=>jsxRuntime.jsx(material.Box,{component:"button",type:"button",onClick:()=>B(P.sourceId,P.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:P.sourceTitle})," \xB7 ",jsxRuntime.jsx(material.Box,{component:"span",sx:{fontWeight:700},children:P.fieldLabel})," = ",jsxRuntime.jsx(material.Box,{component:"span",children:P.fieldValue||"-"})]})},`${P.source}|${P.sourceId}|${P.fieldId}`))})]}),p==="ai"&&y&&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(ai,{markdown:y})})]}),jsxRuntime.jsx(material.Box,{sx:{display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",lg:"repeat(2, minmax(0, 1fr))"}},children:o.map(P=>jsxRuntime.jsx(material.Box,{id:`detail-section-${P.id}`,children:jsxRuntime.jsx(kl,{section:P,highlightQuery:f})},P.id))}),a.length>0&&jsxRuntime.jsxs(material.Paper,{variant:"outlined",sx:{borderRadius:2,overflow:"hidden"},children:[jsxRuntime.jsx(material.Tabs,{value:R?.id||false,onChange:(P,C)=>w(C),variant:"scrollable",scrollButtons:"auto",sx:{borderBottom:"1px solid",borderColor:"divider"},children:a.map(P=>jsxRuntime.jsx(material.Tab,{value:P.id,label:P.label,sx:{textTransform:"none"}},P.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(P=>jsxRuntime.jsx(material.Box,{id:`detail-tab-${R?.id}-section-${P.id}`,children:jsxRuntime.jsx(kl,{section:P,highlightQuery:f})},P.id)),R?.fields&&R.fields.length>0&&jsxRuntime.jsx(kl,{section:{id:`${R.id}-fields`,title:R.label,fields:R.fields,columns:2},highlightQuery:f})]})]})]}),n&&jsxRuntime.jsx(Ua,{title:n.title||g("detail.table.title"),...n.tableProps,filterConfig:void 0,fitContainer:false})]})};var Au=({bucket:e,cardCount:t,highlighted:o=false,children:a,emptyLabel:r,maxHeight:n,sx:i})=>{let{t:c}=ee();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?a: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:r??e.emptyLabel??c("kanban.empty")})})})]})})};var N0={success:"success",warning:"warning",info:"info",error:"error"},V0={critical:"error",high:"warning",medium:"info",low:"success"},O0=(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}},H0=e=>e?e.split(/\s+/).map(t=>t.charAt(0).toUpperCase()).slice(0,2).join(""):"NA",Ic=({card:e,bucket:t,dragging:o=false,overlay:a=false,onClick:r,sx:n})=>{let{t:i}=ee(),c=!!(r&&t),d=e.tone??(e.priority?V0[e.priority]:"default"),l=d==="default"?"primary":N0[d],s=t?{card:e,bucket:t}:void 0;return jsxRuntime.jsx(material.Paper,{onClick:c?()=>s&&r?.(s):void 0,onKeyDown:c?g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),s&&r?.(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:a?`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:a?"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:O0(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??H0(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 $0=(e,t)=>Number.isNaN(e)||e<0?0:e>t?t:e,Fu=({buckets:e,cards:t})=>{let o=new Map;return t.forEach((a,r)=>{let n=o.get(a.bucketId)??[];n.push({card:a,sourceIndex:r}),o.set(a.bucketId,n);}),{buckets:e.map(a=>{let r=[...o.get(a.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:a.id,position:i}));return {...a,cards:r}})}},Go=(e,t)=>{for(let o=0;o<e.buckets.length;o+=1){let a=e.buckets[o],r=a.cards.findIndex(n=>n.id===t);if(r>=0)return {card:a.cards[r],bucket:a,bucketIndex:o,cardIndex:r}}},Pl=(e,t)=>{let o=Go(e,t.cardId);if(!o)return e;let a=e.buckets.findIndex(l=>l.id===t.toBucketId);if(a<0)return e;let r=e.buckets.map(l=>({...l,cards:l.cards.map(s=>({...s}))})),n=r[o.bucketIndex],[i]=n.cards.splice(o.cardIndex,1);if(!i)return e;let c=r[a],d=$0(t.targetIndex??c.cards.length,c.cards.length);return c.cards.splice(d,0,{...i,bucketId:t.toBucketId}),{buckets:r.map(l=>({...l,cards:l.cards.map((s,g)=>({...s,bucketId:l.id,position:g}))}))}};var Pc="kanban-card|",Rc="kanban-bucket|",Vu=e=>`${Pc}${e}`,tv=e=>`${Rc}${e}`,Rl=e=>e?.startsWith(Pc)?e.slice(Pc.length):void 0,Nu=e=>e?.startsWith(Rc)?e.slice(Rc.length):void 0,ov=({card:e,bucket:t,onCardClick:o})=>{let{setNodeRef:a,attributes:r,listeners:n,transform:i,transition:c,isDragging:d}=sortable.useSortable({id:Vu(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:a,style:l,...r,...n,children:jsxRuntime.jsx(Ic,{card:e,bucket:t,dragging:d,onClick:o})})},av=({bucket:e,highlighted:t,bucketMaxHeight:o,emptyBucketLabel:a,onCardClick:r})=>{let{isOver:n,setNodeRef:i}=core.useDroppable({id:tv(e.id)});return jsxRuntime.jsx(material.Box,{ref:i,sx:{minWidth:0},children:jsxRuntime.jsx(Au,{bucket:e,cardCount:e.cards.length,highlighted:t||n,emptyLabel:a,maxHeight:o,children:jsxRuntime.jsx(sortable.SortableContext,{items:e.cards.map(c=>Vu(c.id)),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:1,children:e.cards.map(c=>jsxRuntime.jsx(ov,{card:c,bucket:e,onCardClick:r},c.id))})})})})},QA=({model:e,onCardMove:t,onCardClick:o,minBucketWidth:a=320,bucketMaxHeight:r,emptyBucketLabel:n,sx:i})=>{let[c,d]=St.useState(null),[l,s]=St.useState(),g=core.useSensors(core.useSensor(core.PointerSensor,{activationConstraint:{distance:6}}),core.useSensor(core.TouchSensor,{activationConstraint:{delay:120,tolerance:8}})),f=St.useMemo(()=>c?Go(e,c):void 0,[c,e]),u=St.useCallback(()=>{d(null),s(void 0);},[]),h=St.useCallback(m=>{if(!m)return;let y=Rl(m);return y?Go(e,y)?.bucket.id:Nu(m)},[e]),w=St.useCallback(m=>{d(Rl(String(m.active.id))??null);},[]),p=St.useCallback(m=>{s(h(m.over?String(m.over.id):void 0));},[h]),S=St.useCallback(m=>{let y=Rl(String(m.active.id)),b=m.over?String(m.over.id):void 0;if(!y||!b){u();return}let v=Go(e,y);if(!v){u();return}let E=v.bucket.id,R=v.cardIndex,k=Rl(b);if(k){let C=Go(e,k);if(!C){u();return}E=C.bucket.id,R=C.cardIndex;}else {let C=Nu(b),D=e.buckets.find(T=>T.id===C);if(!C||!D){u();return}E=C,R=D.cards.length;}if(v.bucket.id===E&&v.cardIndex===R){u();return}let B=Pl(e,{cardId:y,fromBucketId:v.bucket.id,toBucketId:E,targetIndex:R}),P=Go(B,y);P&&!(P.bucket.id===v.bucket.id&&P.cardIndex===v.cardIndex)&&t?.({cardId:y,fromBucketId:v.bucket.id,toBucketId:P.bucket.id,targetIndex:P.cardIndex,card:P.card,model:B}),u();},[e,t,u]);return jsxRuntime.jsxs(core.DndContext,{sensors:g,collisionDetection:core.closestCorners,onDragStart:w,onDragOver:p,onDragEnd:S,onDragCancel:u,children:[jsxRuntime.jsx(material.Box,{sx:[{display:"grid",gridAutoFlow:"column",gridAutoColumns:`minmax(${a}px, 1fr)`,gap:2,alignItems:"start",overflowX:"auto",pb:.5},...Array.isArray(i)?i:i?[i]:[]],children:e.buckets.map(m=>jsxRuntime.jsx(av,{bucket:m,highlighted:m.id===l,bucketMaxHeight:r,emptyBucketLabel:n,onCardClick:o},m.id))}),jsxRuntime.jsx(core.DragOverlay,{children:f?jsxRuntime.jsx(material.Box,{sx:{width:Math.max(a-24,260)},children:jsxRuntime.jsx(Ic,{card:f.card,bucket:f.bucket,overlay:true})}):null})]})};var lv=({initialModel:e,initialBuckets:t,initialCards:o})=>e||Fu({buckets:t??[],cards:o??[]}),aB=e=>{let{onCardMove:t,onCardClick:o}=e,[a,r]=St.useState(()=>lv(e)),n=St.useCallback(s=>{r(g=>typeof s=="function"?s(g):s);},[]),i=St.useCallback(s=>Go(a,s),[a]),c=St.useCallback((s,g,f)=>{let u=Go(a,s);if(!u)return;let h=Pl(a,{cardId:s,fromBucketId:u.bucket.id,toBucketId:g,targetIndex:f}),w=Go(h,s);if(!w||w.bucket.id===u.bucket.id&&w.cardIndex===u.cardIndex)return;r(h);let p={cardId:s,fromBucketId:u.bucket.id,toBucketId:w.bucket.id,targetIndex:w.cardIndex,card:w.card,model:h};return t?.(p),p},[a,t]),d=St.useCallback((s,g)=>{r(f=>({buckets:f.buckets.map(u=>({...u,cards:u.cards.map(h=>h.id!==s?h:typeof g=="function"?g(h):{...h,...g})}))}));},[]),l=St.useMemo(()=>({model:a,onCardMove:s=>{c(s.cardId,s.toBucketId,s.targetIndex);},onCardClick:o}),[a,c,o]);return {model:a,actions:{replaceModel:n,moveCard:c,updateCard:d,getCard:i},boardProps:l}};var $u=64,kv="#E9EDF2",Sv="linear-gradient(90deg, #F5F7FA 0%, #E9EDF2 50%, #F5F7FA 100%)",wv=["en","zh","fr","de","ja","ko"],Gu={en:"EN",zh:"\u4E2D\u6587",fr:"FR",de:"DE",ja:"\u65E5\u672C\u8A9E",ko:"\uD55C\uAD6D\uC5B4"},Bl=({appTitle:e,logo:t,mode:o="dark",onToggleMode:a,locale:r,localeLabel:n,localeOptions:i,onLocaleChange:c,searchPlaceholder:d,onSearch:l,user:s,onUserSetting:g,onUserLogout:f,userMenuItems:u,leftSlot:h,rightSlot:w})=>{let{t:p,locale:S}=ee(),y=material.useTheme().palette.mode==="dark",[b,v]=St.useState(""),[E,R]=St.useState(null),[k,B]=St.useState(null),P=_=>{_.preventDefault(),l&&l(b.trim());},C=o==="system"?jsxRuntime.jsx(yv__default.default,{fontSize:"small"}):o==="dark"?jsxRuntime.jsx(bv__default.default,{fontSize:"small"}):jsxRuntime.jsx(xv__default.default,{fontSize:"small"}),D=p(o==="system"?"header.theme.system":o==="dark"?"header.theme.dark":"header.theme.light"),T=r||S,I=i&&i.length>0?i:wv,A=n||Gu[T]||T.toUpperCase(),W=!!E,z=d||p("header.searchPlaceholder"),Q=!!k,re=[{key:"setting",label:p("header.menu.setting"),icon:jsxRuntime.jsx(qb__default.default,{sx:{fontSize:18}}),onClick:g},{key:"logout",label:p("header.menu.logout"),icon:jsxRuntime.jsx(Cv__default.default,{sx:{fontSize:18}}),onClick:f}],ne=u&&u.length>0?u:re,ae=_=>{B(null),_?.();};return jsxRuntime.jsxs(material.AppBar,{position:"sticky",elevation:0,sx:_=>({top:0,zIndex:_.zIndex.drawer+10,height:$u,backgroundColor:_.palette.mode==="dark"?"#0D0D0D":kv,backgroundImage:_.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%)",Sv,"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:_.palette.mode==="dark"?"rgba(255,255,255,0.12)":"rgba(15,23,42,0.12)"}),children:[jsxRuntime.jsxs(material.Toolbar,{sx:{minHeight:`${$u}px !important`,px:2,gap:2},children:[jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:1.5,sx:{minWidth:220},children:[h,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:y?"common.white":"#111827"},children:e})]}),jsxRuntime.jsx(material.Box,{sx:{flex:1,display:"flex",justifyContent:"center",minWidth:0},children:jsxRuntime.jsx(material.Box,{component:"form",onSubmit:P,sx:{width:"100%",maxWidth:540},children:jsxRuntime.jsx(material.TextField,{size:"small",fullWidth:true,value:b,onChange:_=>v(_.target.value),placeholder:z,InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(Kd__default.default,{sx:{color:y?"rgba(255,255,255,0.7)":"rgba(15,23,42,0.55)",fontSize:18}})}),sx:{color:y?"common.white":"rgba(17,24,39,0.9)",bgcolor:y?"rgba(255,255,255,0.08)":"#ffffff",borderRadius:999,"& .MuiOutlinedInput-notchedOutline":{borderColor:y?"rgba(255,255,255,0.15)":"rgba(15,23,42,0.2)"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:y?"rgba(255,255,255,0.35)":"rgba(15,23,42,0.35)"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:y?"rgba(255,255,255,0.5)":"rgba(15,23,42,0.55)"}}},inputProps:{style:{color:y?"white":"#111827"}}})})}),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:_=>R(_.currentTarget),sx:{color:y?"common.white":"#111827",borderRadius:1,px:.5},children:jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:.45,children:[jsxRuntime.jsx(Wu__default.default,{sx:{fontSize:18}}),jsxRuntime.jsx(material.Typography,{variant:"caption",sx:{fontWeight:500},children:A})]})}),jsxRuntime.jsx(material.Menu,{anchorEl:E,open:W,onClose:()=>R(null),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:I.map(_=>jsxRuntime.jsx(material.MenuItem,{selected:_===T,onClick:()=>{c(_),R(null);},sx:{fontSize:"0.82rem"},children:Gu[_]},_))})]}):jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:.5,children:[jsxRuntime.jsx(Wu__default.default,{sx:{color:y?"common.white":"#111827",fontSize:18}}),jsxRuntime.jsx(material.Typography,{variant:"caption",sx:{color:y?"common.white":"#111827",fontWeight:500},children:A})]}),jsxRuntime.jsx(material.IconButton,{size:"small",sx:{color:y?"common.white":"#111827"},onClick:a,title:D,children:C}),s&&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:y?"common.white":"#111827",fontWeight:700,lineHeight:1.15},children:s.name}),s.subtitle&&jsxRuntime.jsx(material.Typography,{variant:"caption",sx:{display:"block",mt:.25,color:y?"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:s.subtitle,children:s.subtitle})]}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:_=>B(_.currentTarget),sx:{p:0},children:jsxRuntime.jsx(material.Avatar,{src:s.avatarSrc,imgProps:{style:{objectFit:"cover"}},sx:{width:34,height:34,bgcolor:"grey.100",color:"grey.700",fontSize:"0.85rem"},children:s.avatarText||s.name.slice(0,1).toUpperCase()})})]}),w]})]}),s&&jsxRuntime.jsx(material.Menu,{anchorEl:k,open:Q,onClose:()=>B(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:ne.map(_=>jsxRuntime.jsxs(material.MenuItem,{disabled:_.disabled,onClick:()=>ae(_.onClick),children:[_.icon&&jsxRuntime.jsx(material.ListItemIcon,{children:_.icon}),jsxRuntime.jsx(material.ListItemText,{primary:_.label,slotProps:{primary:{sx:{fontSize:"0.86rem",fontWeight:500}}}})]},_.key))})]})};var Uu=({menuData:e=[],initialNavigationCollapsed:t=false}={})=>{let{navigationIslandProps:o}=Vd({initialCollapsed:t,content:e}),[a,r]=St.useState(900);St.useEffect(()=>{let i=()=>r(window.innerHeight);return i(),window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[]);let n=St.useMemo(()=>Math.max(280,a-100),[a]);return {navigationIslandProps:o,navigationMaxHeight:n}};var PB=({appTitle:e,menuData:t=[],children:o,showNavigation:a=true,locale:r="en",localeLabel:n,localeOptions:i,onLocaleChange:c,user:d,onUserSetting:l,onUserLogout:s,userMenuItems:g,logo:f,onSearch:u,rightHeaderSlot:h,leftHeaderSlot:w,contentSx:p})=>{let S="orbcafe:page-layout-mode",[m,y]=St.useState("system"),[b,v]=St.useState("light"),[E,R]=St.useState(false),k=m==="system"?E?b:"light":m;St.useEffect(()=>{try{let I=window.localStorage.getItem(S);(I==="light"||I==="dark"||I==="system")&&y(I);}catch{}R(true);let D=window.matchMedia("(prefers-color-scheme: dark)"),T=()=>{v(D.matches?"dark":"light");};return T(),D.addEventListener("change",T),()=>D.removeEventListener("change",T)},[]),St.useEffect(()=>{if(E)try{window.localStorage.setItem(S,m);}catch{}},[E,m]),St.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 B=St.useMemo(()=>material.createTheme({palette:{mode:k}}),[k]),{navigationIslandProps:P,navigationMaxHeight:C}=Uu({menuData:t,initialNavigationCollapsed:false});return jsxRuntime.jsx(material.ThemeProvider,{theme:B,children:jsxRuntime.jsx(Mi,{locale:r,children:jsxRuntime.jsxs(material.Box,{sx:D=>({minHeight:"100vh",display:"flex",flexDirection:"column",background:D.palette.mode==="dark"?"linear-gradient(180deg, #0A0A0A 0%, #141414 55%, #1A1A1A 100%)":D.palette.background.default}),children:[jsxRuntime.jsx(Bl,{appTitle:e,logo:f,mode:m,onToggleMode:()=>y(D=>D==="system"?"dark":D==="dark"?"light":"system"),locale:r,localeLabel:n,localeOptions:i,onLocaleChange:c,user:d,onUserSetting:l,onUserLogout:s,userMenuItems:g,onSearch:u,leftSlot:w,rightSlot:h}),jsxRuntime.jsxs(material.Box,{sx:{flex:1,minHeight:0,display:"flex"},children:[a&&jsxRuntime.jsx(material.Box,{sx:{p:1.5,display:"flex",alignItems:"flex-start",flexShrink:0},children:jsxRuntime.jsx(zd,{...P,maxHeight:C,colorMode:k})}),jsxRuntime.jsx(material.Box,{sx:{flex:1,minWidth:0,minHeight:0,overflow:"auto",p:1.5,...p},children:o})]})]})})})};var Fl="(blank)",qu="Result",_u="Grand Total",ju={sum:"Sum",count:"Count",avg:"Average",min:"Min",max:"Max"},Zu=["sum","count","avg","min","max"];var Xu=["palette","rows","columns","filters","values"];var Yu=e=>Xu.includes(e),Qu=e=>e==="rows"||e==="columns"||e==="filters",Ll=e=>{let t=e.split("|");return t.length===2&&t[0]==="container"&&Yu(t[1])?{kind:"container",zone:t[1]}:t.length===3&&t[0]==="item"&&Yu(t[1])&&t[2]?{kind:"item",zone:t[1],key:t[2]}:null},Ca=e=>e==null||e===""?Fl:e instanceof Date?e.toISOString().slice(0,10):String(e),kr=e=>JSON.stringify(e),Ju=(e,t)=>{let o=e.join(""),a=t.join("");return o.localeCompare(a,void 0,{sensitivity:"base"})},Bv=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},ln=(e,t,o)=>{if(o==="count")return e.length;let a=e.map(r=>Bv(r[t])).filter(r=>r!==null);return a.length===0?0:o==="sum"?a.reduce((r,n)=>r+n,0):o==="avg"?a.reduce((r,n)=>r+n,0)/a.length:o==="min"?Math.min(...a):Math.max(...a)},zt=(e,t)=>{if(!e||e.length===0)return [];let o=new Set,a=[];return e.forEach(r=>{!t.has(r)||o.has(r)||(o.add(r),a.push(r));}),a},ka=(e,t)=>e.length!==t.length?false:e.every((o,a)=>o===t[a]),em=(e,t)=>{let o=Object.keys(e),a=Object.keys(t);return o.length!==a.length?false:o.every(r=>{let n=e[r]??[],i=t[r]??[];return ka(n,i)})},zl=(e,t)=>e.length!==t.length?false:e.every((o,a)=>{let r=t[a];return o.tokenId===r.tokenId&&o.fieldId===r.fieldId&&o.aggregation===r.aggregation}),Ec=e=>!e?.aggregations||e.aggregations.length===0?Zu:e.aggregations,Jt=(e,t)=>{let o=Ec(t);return e&&o.includes(e)?e:t?.type==="number"&&o.includes("sum")?"sum":o.includes("count")?"count":o[0]},di=(e,t,o)=>{let a=o.get(t.fieldId);return a?.formatValue?a.formatValue(e):t.aggregation==="count"?Math.round(e).toLocaleString():e.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:2})};var am=({options:e,selectedValues:t,onChange:o,minWidth:a=96})=>{let{t:r}=ee(),[n,i]=St.useState(""),c=St.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:a},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?r("pivot.filter.na"):s.length===0?r("common.none"):s.length===e.length?r("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:`${r("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:r(d?"pivot.filter.deselectAll":"pivot.filter.selectAll")})}),c.length===0&&jsxRuntime.jsx(material.MenuItem,{disabled:true,sx:{fontSize:"0.75rem"},children:r("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 Lc=({label:e,subtitle:t,isDragging:o,dragRef:a,listeners:r,attributes:n,style:i})=>jsxRuntime.jsx(material.Paper,{ref:a,...r,...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(Uv__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})]})]})}),im=({id:e,label:t,subtitle:o})=>{let{setNodeRef:a,listeners:r,attributes:n,isDragging:i}=core.useDraggable({id:e});return jsxRuntime.jsx(Lc,{label:t,subtitle:o,isDragging:i,dragRef:a,listeners:r,attributes:n})};var dn=({zone:e,title:t,hint:o,icon:a,children:r,itemCount:n,onClear:i})=>{let c=`container|${e}`,{isOver:d,setNodeRef:l}=core.useDroppable({id:c}),{t:s}=ee();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:[a,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(Zv__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:r})]})};var sm={xs:1.2,md:1.6},un=({title:e,subtitle:t,collapsed:o,onToggleCollapse:a,expandAriaLabel:r,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:sm,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?r:n,onClick:a,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(_b__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:sm,py:{xs:1.2,md:1.6}},...Array.isArray(c)?c:c?[c]:[]],children:i})})]});var Wl=({label:e,caption:t,onRemove:o,trailing:a,isDragging:r,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:r?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(Uv__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})]}),a,o&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:l=>{l.stopPropagation(),o();},sx:{p:.2},children:jsxRuntime.jsx(dh__default.default,{sx:{fontSize:16}})})]})}),pi=({id:e,label:t,caption:o,onRemove:a,trailing:r})=>{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(Wl,{label:t,caption:o,onRemove:a,trailing:r,isDragging:s,dragRef:n,listeners:c,attributes:i,style:g})};var Ul={rows:jsxRuntime.jsx(cC__default.default,{fontSize:"small"}),columns:jsxRuntime.jsx(Th__default.default,{fontSize:"small"}),filters:jsxRuntime.jsx(sC__default.default,{fontSize:"small"}),values:jsxRuntime.jsx(Dh__default.default,{fontSize:"small"})},pm=({isConfiguratorCollapsed:e,onToggleCollapse:t,availableFields:o,fieldMap:a,filterFields:r,columnFields:n,rowFields:i,valueFields:c,clearZone:d,removeFieldFromZone:l,getFilterSelectionSummary:s,renderDimensionFilterSelect:g,renderAggregationSelect:f,getAggregationLabel:u})=>{let{t:h}=ee(),w=[`${h("pivot.zone.rows")} ${i.length}`,`${h("pivot.zone.columns")} ${n.length}`,`${h("pivot.zone.filters")} ${r.length}`,`${h("pivot.zone.values")} ${c.length}`].join(" \xB7 ");return jsxRuntime.jsx(un,{title:h("pivot.config.title"),subtitle:w,collapsed:e,onToggleCollapse:t,expandAriaLabel:h("pivot.collapse.ariaExpand"),collapseAriaLabel:h("pivot.collapse.ariaCollapse"),unmountOnExit:true,children:jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",lg:"260px 1fr"},gap:2},children:[jsxRuntime.jsx(dn,{zone:"palette",title:h("pivot.fieldList"),hint:h("pivot.availableDimensions"),itemCount:o.length,icon:jsxRuntime.jsx(Uv__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:h("pivot.allFieldsInUse")}),o.map(p=>jsxRuntime.jsx(im,{id:`item|palette|${p.id}`,label:p.label,subtitle:p.type??"string"},p.id))]})}),jsxRuntime.jsxs(material.Stack,{spacing:2,children:[jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[jsxRuntime.jsx(dn,{zone:"filters",title:h("pivot.zone.filters"),hint:h("pivot.hint.filters"),icon:Ul.filters,itemCount:r.length,onClear:()=>d("filters"),children:jsxRuntime.jsx(sortable.SortableContext,{items:r.map(p=>`item|filters|${p}`),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:.7,children:r.map(p=>jsxRuntime.jsx(pi,{id:`item|filters|${p}`,label:a.get(p)?.label??p,caption:s(p),trailing:g(p),onRemove:()=>l("filters",p)},p))})})}),jsxRuntime.jsx(dn,{zone:"columns",title:h("pivot.zone.columns"),hint:h("pivot.hint.columns"),icon:Ul.columns,itemCount:n.length,onClear:()=>d("columns"),children:jsxRuntime.jsx(sortable.SortableContext,{items:n.map(p=>`item|columns|${p}`),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:.7,children:n.map(p=>jsxRuntime.jsx(pi,{id:`item|columns|${p}`,label:a.get(p)?.label??p,caption:`${a.get(p)?.type??"dimension"} \u2022 ${s(p)}`,trailing:g(p),onRemove:()=>l("columns",p)},p))})})})]}),jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[jsxRuntime.jsx(dn,{zone:"rows",title:h("pivot.zone.rows"),hint:h("pivot.hint.rows"),icon:Ul.rows,itemCount:i.length,onClear:()=>d("rows"),children:jsxRuntime.jsx(sortable.SortableContext,{items:i.map(p=>`item|rows|${p}`),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:.7,children:i.map(p=>jsxRuntime.jsx(pi,{id:`item|rows|${p}`,label:a.get(p)?.label??p,caption:`${a.get(p)?.type??"dimension"} \u2022 ${s(p)}`,trailing:g(p),onRemove:()=>l("rows",p)},p))})})}),jsxRuntime.jsx(dn,{zone:"values",title:h("pivot.zone.values"),hint:h("pivot.hint.values"),icon:Ul.values,itemCount:c.length,onClear:()=>d("values"),children:jsxRuntime.jsx(sortable.SortableContext,{items:c.map(p=>`item|values|${p.tokenId}`),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:.7,children:c.map(p=>{let S=a.get(p.fieldId)?.label??p.fieldId,m=`${u(p.aggregation)}(${S})`;return jsxRuntime.jsx(pi,{id:`item|values|${p.tokenId}`,label:S,caption:m,trailing:f(p),onRemove:()=>l("values",p.tokenId)},p.tokenId)})})})})]})]})]})})};var um=e=>e.toLocaleString(void 0,{maximumFractionDigits:1}),mm=({data:e,primaryLabel:t,secondaryLabel:o,formatPrimaryValue:a,formatSecondaryValue:r})=>{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(p=>p.primaryValue):e.map((p,S)=>S+1),s=o?e.map(p=>p.secondaryValue??0):e.map(p=>p.primaryValue),g=Math.max(...l,1),f=Math.max(...s,1),u=i-d.left-d.right,h=c-d.top-d.bottom,w=e.map((p,S)=>{let m=o?p.primaryValue:S+1,y=o?p.secondaryValue??0:p.primaryValue,b=d.left+m/g*u,v=c-d.bottom-y/f*h;return {...p,x:b,y:v,rawX:m,rawY:y}});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)}),w.map(p=>jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("circle",{cx:p.x,cy:p.y,r:7,fill:styles.alpha(n.palette.primary.main,.18)}),jsxRuntime.jsx("circle",{cx:p.x,cy:p.y,r:4.5,fill:n.palette.primary.main,children:jsxRuntime.jsxs("title",{children:[p.name,`
195
195
  `,o?`${t}: ${a(p.primaryValue)}`:`${t}: ${a(p.primaryValue)}`,o?`
196
- ${o}: ${(r??a)(p.secondaryValue??0)}`:""]})}),jsxRuntime.jsx("text",{x:p.x,y:Math.max(p.y-12,d.top+8),textAnchor:"middle",fontSize:"10",fill:n.palette.text.secondary,children:p.name})]},p.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:dm(f)}),jsxRuntime.jsx("text",{x:i-d.right,y:c-d.bottom+16,textAnchor:"end",fontSize:"10",fill:n.palette.text.secondary,children:dm(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(p=>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:p.name,children:p.name}),jsxRuntime.jsxs(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:[t,": ",a(p.primaryValue)]}),o&&jsxRuntime.jsxs(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:[o,": ",(r??a)(p.secondaryValue??0)]})]},p.name))})]})};var Oc=e=>Math.max(...e,1),mm=({data:e,chartType:t,primaryLabel:o,secondaryLabel:a,formatPrimaryValue:r,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=Oc(e.flatMap(y=>[y.primaryValue,y.secondaryValue??0]));return jsxRuntime.jsx(material.Stack,{spacing:1.1,children:e.map(y=>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:y.name,children:y.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:`${y.primaryValue/m*100}%`,height:"100%",bgcolor:c}})}),a&&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:`${(y.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:r(y.primaryValue)}),a&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",textAlign:{xs:"left",md:"right"},color:"text.secondary"},children:(n??r)(y.secondaryValue??0)})]})]},y.name))})}if(t==="bar-vertical"){let m=Oc(e.flatMap(b=>[b.primaryValue,b.secondaryValue??0])),y=a?92:76;return jsxRuntime.jsx(material.Box,{sx:{overflowX:"auto",pb:.5},children:jsxRuntime.jsx(material.Box,{sx:{minWidth:Math.max(620,e.length*y),display:"grid",gridTemplateColumns:`repeat(${e.length}, minmax(56px, 1fr))`,gap:1,alignItems:"end"},children:e.map(b=>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:a?16:26,minHeight:8,height:`${Math.max(b.primaryValue/m*188,8)}px`,borderRadius:"10px 10px 2px 2px",bgcolor:c},title:`${o}: ${r(b.primaryValue)}`}),a&&jsxRuntime.jsx(material.Box,{sx:{width:16,minHeight:8,height:`${Math.max((b.secondaryValue??0)/m*188,8)}px`,borderRadius:"10px 10px 2px 2px",bgcolor:d},title:`${a}: ${(n??r)(b.secondaryValue??0)}`})]}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.76rem",fontWeight:700},noWrap:true,title:b.name,children:b.name}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.7rem",color:"text.secondary"},noWrap:true,title:r(b.primaryValue),children:r(b.primaryValue)}),a&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.7rem",color:"text.secondary"},noWrap:true,title:(n??r)(b.secondaryValue??0),children:(n??r)(b.secondaryValue??0)})]},b.name))})})}let s=Math.max(680,e.length*74),l=240,g={top:20,right:18,bottom:36,left:18},f=Oc(e.flatMap(m=>[m.primaryValue,m.secondaryValue??0])),u=s-g.left-g.right,h=l-g.top-g.bottom,w=m=>e.map((y,b)=>{let T=g.left+b*u/Math.max(e.length-1,1),B=l-g.bottom-m(y)/f*h;return {x:T,y:B,item:y}}),p=w(m=>m.primaryValue),C=a?w(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 ${s} ${l}`,sx:{width:"100%",minWidth:s,height:l},children:[jsxRuntime.jsx("line",{x1:g.left,y1:l-g.bottom,x2:s-g.right,y2:l-g.bottom,stroke:styles.alpha(i.palette.text.secondary,.35)}),jsxRuntime.jsx("polyline",{fill:"none",stroke:c,strokeWidth:3,points:p.map(m=>`${m.x},${m.y}`).join(" ")}),p.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,": ",r(m.item.primaryValue)]})},`primary-${m.item.name}`)),a&&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
- `,a,": ",(n??r)(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:y=>({borderRadius:2,px:1.1,py:.9,border:`1px solid ${styles.alpha(y.palette.divider,.7)}`,bgcolor:styles.alpha(y.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:r(m.primaryValue)}),a&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.71rem",color:"text.secondary"},children:(n??r)(m.secondaryValue??0)})]},m.name))})]})};var gm=(e,t,o)=>{let a=new Set,r=[];return e.forEach(n=>{a.has(n)||(a.add(n),r.push({fieldId:n,label:o.get(n)?.label??n,zone:"rows"}));}),t.forEach(n=>{a.has(n)||(a.add(n),r.push({fieldId:n,label:o.get(n)?.label??n,zone:"columns"}));}),r},fm=(e,t,o)=>e.map(a=>{let r=t.get(a.fieldId),n=r?.label??a.fieldId;return {fieldId:a.fieldId,label:`${o(a.aggregation)} \xB7 ${n}`,item:a,field:r}}),hm=({rows:e,dimensionFieldId:t,primaryValue:o,secondaryValue:a})=>{if(!t)return [];let r=new Map;return e.forEach(n=>{let i=ba(n[t]),c=r.get(i);if(c){c.push(n);return}r.set(i,[n]);}),Array.from(r.entries()).sort((n,i)=>n[0].localeCompare(i[0],void 0,{sensitivity:"base"})).map(([n,i])=>({name:n,primaryValue:ln(i,o.fieldId,o.aggregation),secondaryValue:a?ln(i,a.fieldId,a.aggregation):void 0}))};var ym=({rows:e,fieldMap:t,rowFields:o,columnFields:a,valueFields:r,chartDimensionFieldId:n,chartPrimaryValueFieldId:i,chartSecondaryValueFieldId:c,chartType:d,isCollapsed:s,onChartDimensionFieldIdChange:l,onChartPrimaryValueFieldIdChange:g,onChartSecondaryValueFieldIdChange:f,onChartTypeChange:u,onToggleCollapse:h,getAggregationLabel:w})=>{let{t:p}=ee(),C=vt.useMemo(()=>gm(o,a,t),[a,t,o]),m=vt.useMemo(()=>fm(r,t,w),[t,w,r]),y=m.find(v=>v.fieldId===i)??m[0],b=m.find(v=>v.fieldId===c&&v.fieldId!==y?.fieldId)??null,T=C.find(v=>v.fieldId===n)??C[0],B=T&&y?p("pivot.chart.subtitleReady",{dimension:T.label,measure:b?`${y.label} / ${b.label}`:y.label}):p("pivot.chart.subtitle"),R=vt.useMemo(()=>!T||!y?[]:hm({rows:e,dimensionFieldId:T.fieldId,primaryValue:y.item,secondaryValue:b?.item}),[y,e,b,T]),k=v=>y?di(v,y.item,t):v.toLocaleString(),A=v=>b?di(v,b.item,t):v.toLocaleString(),P=C.length>1||m.length>1;return jsxRuntime.jsxs(un,{title:p("pivot.chart.title"),subtitle:B,collapsed:s,onToggleCollapse:h,expandAriaLabel:p("pivot.chart.collapse.ariaExpand"),collapseAriaLabel:p("pivot.chart.collapse.ariaCollapse"),bodySx:{display:"flex",flexDirection:"column",gap:1.1},children:[P&&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:p("pivot.chart.dimension")}),jsxRuntime.jsx(material.Select,{value:T?.fieldId??"",onChange:v=>l(String(v.target.value)),sx:{fontSize:"0.75rem",height:32},children:C.map(v=>jsxRuntime.jsx(material.MenuItem,{value:v.fieldId,sx:{fontSize:"0.75rem"},children:v.label},v.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:p("pivot.chart.primaryMeasure")}),jsxRuntime.jsx(material.Select,{value:y?.fieldId??"",onChange:v=>g(String(v.target.value)),sx:{fontSize:"0.75rem",height:32},children:m.map(v=>jsxRuntime.jsx(material.MenuItem,{value:v.fieldId,sx:{fontSize:"0.75rem"},children:v.label},v.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:p("pivot.chart.secondaryMeasure")}),jsxRuntime.jsxs(material.Select,{value:b?.fieldId??"",onChange:v=>f(String(v.target.value)),sx:{fontSize:"0.75rem",height:32},children:[jsxRuntime.jsx(material.MenuItem,{value:"",sx:{fontSize:"0.75rem",color:"text.secondary"},children:p("common.none")}),m.filter(v=>v.fieldId!==y?.fieldId).map(v=>jsxRuntime.jsx(material.MenuItem,{value:v.fieldId,sx:{fontSize:"0.75rem"},children:v.label},v.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:p("pivot.chart.chartType")}),jsxRuntime.jsxs(material.Select,{value:d,onChange:v=>u(v.target.value),sx:{fontSize:"0.75rem",height:32},children:[jsxRuntime.jsx(material.MenuItem,{value:"bar-vertical",sx:{fontSize:"0.75rem"},children:p("pivot.chart.style.barVertical")}),jsxRuntime.jsx(material.MenuItem,{value:"bar-horizontal",sx:{fontSize:"0.75rem"},children:p("pivot.chart.style.barHorizontal")}),jsxRuntime.jsx(material.MenuItem,{value:"line",sx:{fontSize:"0.75rem"},children:p("pivot.chart.style.line")}),jsxRuntime.jsx(material.MenuItem,{value:"scatter",sx:{fontSize:"0.75rem"},children:p("pivot.chart.style.scatter")})]})]})]}),jsxRuntime.jsx(material.Box,{children:T?y?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:p("pivot.chart.emptyNoData")})}):d==="scatter"?jsxRuntime.jsx(pm,{data:R,primaryLabel:y.label,secondaryLabel:b?.label,formatPrimaryValue:k,formatSecondaryValue:A}):jsxRuntime.jsx(mm,{data:R,chartType:d,primaryLabel:y.label,secondaryLabel:b?.label,formatPrimaryValue:k,formatSecondaryValue:A}):jsxRuntime.jsx(material.Box,{sx:{py:5,textAlign:"center"},children:jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.86rem",color:"text.secondary"},children:p("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:p("pivot.chart.emptyNoDimension")})})})]})};var _l=({node:e,dataColumns:t,fieldMap:o,level:a,expandedKeys:r,onToggle:n,getValue:i})=>{let c=r.has(e.key),d=e.children.length>0,s=e.isGrandTotal;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(material.TableRow,{sx:l=>({bgcolor:s?l.palette.mode==="dark"?"rgba(25, 118, 210, 0.22)":"rgba(47, 91, 255, 0.08)":l.palette.mode==="dark"?"#111111":"background.paper","&:hover":{bgcolor:s?l.palette.mode==="dark"?"rgba(25, 118, 210, 0.28)":"rgba(47, 91, 255, 0.12)":l.palette.mode==="dark"?"#181818":"rgba(0, 0, 0, 0.02)"}}),children:[jsxRuntime.jsxs(material.TableCell,{sx:l=>({fontSize:"0.76rem",fontWeight:s?800:600,borderBottom:`1px solid ${l.palette.divider}`,whiteSpace:"nowrap",pl:a*2+1,display:"flex",alignItems:"center",height:40}),children:[d&&!s&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>n(e.key),sx:{p:.2,mr:.5,ml:-1},children:c?jsxRuntime.jsx(Zh__default.default,{sx:{fontSize:16}}):jsxRuntime.jsx(Bh__default.default,{sx:{fontSize:16}})}),!d&&!s&&a>0&&jsxRuntime.jsx(material.Box,{sx:{width:20}}),e.value]}),t.map(l=>jsxRuntime.jsx(material.TableCell,{align:"right",sx:{fontSize:"0.76rem",fontWeight:s?800:500,borderBottom:g=>`1px solid ${g.palette.divider}`,whiteSpace:"nowrap"},children:di(i?i(e,l.id):e.aggregatedValues[l.id]??0,l.valueItem,o)},`${e.key}-${l.id}`))]}),c&&e.children.map(l=>jsxRuntime.jsx(_l,{node:l,dataColumns:t,fieldMap:o,level:a+1,expandedKeys:r,onToggle:n,getValue:i},l.key))]})};var Uc=(e,t,o)=>{let a=[...e,...t];return o&&a.includes(o)?o:a[0]??""},Xl=(e,t)=>t&&e.some(o=>o.fieldId===t)?t:e[0]?.fieldId??"",Kc=(e,t,o)=>o===""?"":o&&o!==t&&e.some(a=>a.fieldId===o)?o:e.find(a=>a.fieldId!==t)?.fieldId??"",wm=e=>{let t=new Set,o=a=>{a.forEach(r=>{r.children.length>0&&(t.add(r.key),o(r.children));});};return o(e),t},Im=(e,t,o=0)=>e.length===0?o:e.reduce((a,r)=>r.children.length===0||!t.has(r.key)?Math.max(a,o+1):Math.max(a,Im(r.children,t,o+1)),o),$C=(e,t)=>{let o=[],a=r=>{r.forEach(n=>{if(n.children.length>0&&t.has(n.key)){a(n.children);return}o.push(n);});};return a(e),o},uE=({title:e,rows:t,fields:o,initialLayout:a,initialChart:r,emptyText:n,maxPreviewHeight:i=520,initialChartCollapsed:c=false,initialTableCollapsed:d=false,model:s,enablePresetManagement:l=false,presets:g,defaultPresets:f,onPresetsChange:u,initialPresetId:h,onPresetApplied:w})=>{let{t:p}=ee(),C=core.useSensors(core.useSensor(core.PointerSensor,{activationConstraint:{distance:8}})),m=vt.useRef(0),y=vt.useRef(false),b=e??p("pivot.title.default"),T=n??p("pivot.empty"),B=vt.useMemo(()=>({sum:p("pivot.agg.sum"),count:p("pivot.agg.count"),avg:p("pivot.agg.avg"),min:p("pivot.agg.min"),max:p("pivot.agg.max")}),[p]),R=vt.useCallback(x=>B[x]??qu[x],[B]),k=vt.useMemo(()=>new Set(o.map(x=>x.id)),[o]),A=vt.useMemo(()=>new Map(o.map(x=>[x.id,x])),[o]),[P,v]=vt.useState(()=>Rt(a?.rows,k)),[M,S]=vt.useState(()=>Rt(a?.columns,k)),[I,D]=vt.useState(()=>Rt(a?.filters,k)),[G,V]=vt.useState(()=>{let x=a?.values??[],E=new Set,F=[];return x.forEach(K=>{if(!k.has(K.fieldId)||E.has(K.fieldId))return;E.add(K.fieldId),m.current+=1;let ce=A.get(K.fieldId);F.push({tokenId:`v${m.current}`,fieldId:K.fieldId,aggregation:jt(K.aggregation,ce)});}),F}),[X,de]=vt.useState({}),[oe,re]=vt.useState(true),[_,qe]=vt.useState(false),[it,Y]=vt.useState(()=>Uc(Rt(a?.rows,k),Rt(a?.columns,k),r?.dimensionFieldId)),[le,Be]=vt.useState(()=>{let x=(a?.values??[]).filter((E,F,K)=>k.has(E.fieldId)&&K.findIndex(ce=>ce.fieldId===E.fieldId)===F).map(E=>({tokenId:E.fieldId,fieldId:E.fieldId,aggregation:jt(E.aggregation,A.get(E.fieldId))}));return Xl(x,r?.primaryValueFieldId)}),[Ee,Ue]=vt.useState(()=>{let x=(a?.values??[]).filter((F,K,ce)=>k.has(F.fieldId)&&ce.findIndex(Se=>Se.fieldId===F.fieldId)===K).map(F=>({tokenId:F.fieldId,fieldId:F.fieldId,aggregation:jt(F.aggregation,A.get(F.fieldId))})),E=Xl(x,r?.primaryValueFieldId);return Kc(x,E,r?.secondaryValueFieldId)}),[ot,Fe]=vt.useState(r?.chartType??"bar-vertical"),[_e,ht]=vt.useState(c),[j,pe]=vt.useState(d),[De,Le]=vt.useState(()=>f??[]),[We,U]=vt.useState(""),[ye,be]=vt.useState(false),[Pe,et]=vt.useState(""),[Ge,Tt]=vt.useState(null),[ro,Yt]=vt.useState(new Set(["__grand_total__"])),[Ht,Qt]=vt.useState(new Set),ze=s?.rowFields??P,Ce=s?.columnFields??M,L=s?.filterFields??I,$=s?.valueFields??G,Z=s?.filterSelections??X,te=s?.showGrandTotal??oe,ke=s?.isConfiguratorCollapsed??_,z=s?.chartDimensionFieldId??it,O=s?.chartPrimaryValueFieldId??le,N=s?.chartSecondaryValueFieldId??Ee,ne=s?.chartType??ot,se=s?.isChartCollapsed??_e,we=s?.isTableCollapsed??j,ae=g??De,Me=l||ae.length>0||!!u,Te=vt.useCallback(x=>{if(s?.setRowFields){s.setRowFields(x);return}v(x);},[s]),Ne=vt.useCallback(x=>{if(s?.setColumnFields){s.setColumnFields(x);return}S(x);},[s]),Ie=vt.useCallback(x=>{if(s?.setFilterFields){s.setFilterFields(x);return}D(x);},[s]),Re=vt.useCallback(x=>{if(s?.setValueFields){s.setValueFields(x);return}V(x);},[s]),Ve=vt.useCallback(x=>{if(s?.setFilterSelections){s.setFilterSelections(x);return}de(x);},[s]),It=vt.useCallback(x=>{if(s?.setShowGrandTotal){s.setShowGrandTotal(x);return}re(x);},[s]),xo=vt.useCallback(x=>{if(s?.setIsConfiguratorCollapsed){s.setIsConfiguratorCollapsed(x);return}qe(x);},[s]),yt=vt.useCallback(x=>{if(s?.setChartDimensionFieldId){s.setChartDimensionFieldId(x);return}Y(x);},[s]),At=vt.useCallback(x=>{if(s?.setChartPrimaryValueFieldId){s.setChartPrimaryValueFieldId(x);return}Be(x);},[s]),vo=vt.useCallback(x=>{if(s?.setChartSecondaryValueFieldId){s.setChartSecondaryValueFieldId(x);return}Ue(x);},[s]),Ra=vt.useCallback(x=>{if(s?.setChartType){s.setChartType(x);return}Fe(x);},[s]),Br=vt.useCallback(x=>{if(s?.setIsChartCollapsed){s.setIsChartCollapsed(x);return}ht(x);},[s]),Do=vt.useCallback(x=>{if(s?.setIsTableCollapsed){s.setIsTableCollapsed(x);return}pe(x);},[s]),no=vt.useCallback(x=>{let E=typeof x=="function"?x(ae):x;g||Le(E),u?.(E);},[u,ae,g]),er=vt.useMemo(()=>new Set([...ze,...Ce,...L]),[ze,Ce,L]),oa=vt.useMemo(()=>o.filter(x=>!er.has(x.id)),[o,er]),Kt=vt.useMemo(()=>{let x=[...ze,...Ce,...L],E=new Set,F=[];return x.forEach(K=>{E.has(K)||(E.add(K),F.push(K));}),F},[Ce,L,ze]);vt.useEffect(()=>{Te(x=>{let E=x.filter(F=>k.has(F));return xa(x,E)?x:E}),Ne(x=>{let E=x.filter(F=>k.has(F));return xa(x,E)?x:E}),Ie(x=>{let E=x.filter(F=>k.has(F));return xa(x,E)?x:E}),Re(x=>{let E=x.filter(F=>k.has(F.fieldId)).map(F=>({...F,aggregation:jt(F.aggregation,A.get(F.fieldId))}));return zl(x,E)?x:E});},[A,k]);let io=vt.useMemo(()=>{let x={};return Kt.forEach(E=>{let F=new Set;t.forEach(K=>{F.add(ba(K[E]));}),x[E]=Array.from(F).sort((K,ce)=>K.localeCompare(ce));}),x},[Kt,t]);vt.useEffect(()=>{Ve(x=>{let E={};return Kt.forEach(F=>{let K=io[F]??[],Se=(x[F]??[]).filter(J=>K.includes(J)),H=Object.prototype.hasOwnProperty.call(x,F);E[F]=H?Se:K;}),Qu(x,E)?x:E});},[Kt,io]),vt.useEffect(()=>{yt(x=>Uc(ze,Ce,x));},[Ce,ze,yt]),vt.useEffect(()=>{At(x=>Xl($,x));},[At,$]),vt.useEffect(()=>{vo(x=>Kc($,O,x));},[O,vo,$]);let Wt=vt.useMemo(()=>t.filter(x=>Kt.every(E=>{let F=Z[E]??[],K=io[E]??[];if(F.length===K.length)return true;if(F.length===0)return false;let ce=ba(x[E]);return F.includes(ce)})),[Kt,io,Z,t]),je=vt.useMemo(()=>{if($.length===0)return null;let x=new Map;if(Wt.forEach(H=>{let J=Ce.length>0?Ce.map(at=>ba(H[at])):[p("pivot.valueLabel")],Q=Cr(J);x.set(Q,J);}),x.size===0){let H=Ce.length>0?Ce.map(()=>Fl):[p("pivot.valueLabel")];x.set(Cr(H),H);}let E=Array.from(x.entries()).sort((H,J)=>Yu(H[1],J[1])),F=E.flatMap(([H,J])=>$.map(Q=>{let at=A.get(Q.fieldId),W=`${R(Q.aggregation)} ${at?.label??Q.fieldId}`,ie=Ce.length===0||$.length>1?`${J.join(" / ")} \u2022 ${W}`:J.join(" / ");return {id:`${H}::${Q.tokenId}`,colKey:H,valueItem:Q,label:ie}})),K=[];Ce.length>0&&E.forEach(([H,J])=>{let Q=F.filter(ie=>ie.colKey===H),at=K,W=[];J.forEach((ie,q)=>{W.push(`d${q}:${ie}`);let ge=`col::${Cr(W)}`,Ze=at.find(_o=>_o.key===ge);Ze||(Ze={key:ge,label:ie,children:[],leafColumnIds:[],path:J.slice(0,q+1),depth:q},at.push(Ze)),Q.forEach(_o=>{Ze.leafColumnIds.includes(_o.id)||Ze.leafColumnIds.push(_o.id);}),at=Ze.children;});});let ce=H=>{let J={};return F.forEach(Q=>{let at=H.filter(W=>{let ie=Ce.length>0?Ce.map(q=>ba(W[q])):[p("pivot.valueLabel")];return Cr(ie)===Q.colKey});J[Q.id]=ln(at,Q.valueItem.fieldId,Q.valueItem.aggregation);}),J},Se=[];if(ze.length===0)Se.push({key:"root",value:p("pivot.resultLabel")||Uu,children:[],isLeaf:true,aggregatedValues:ce(Wt),path:[],depth:0});else {let H=(J,Q,at)=>{if(Q>=ze.length)return [];let W=ze[Q],ie=new Map;return J.forEach(q=>{let ge=ba(q[W]);ie.has(ge)||ie.set(ge,[]),ie.get(ge).push(q);}),Array.from(ie.keys()).sort().map(q=>{let ge=ie.get(q),Ze=[...at,q];return {key:Cr(Ze),value:q,fieldId:W,aggregatedValues:ce(ge),children:H(ge,Q+1,Ze),isLeaf:Q===ze.length-1,path:Ze,depth:Q}})};Se.push(...H(Wt,0,[]));}return {dataColumns:F,columnTree:K,rowTree:Se}},[Ce,A,Wt,R,ze,p,$]),aa=vt.useCallback((x,E)=>(m.current+=1,{tokenId:`v${m.current}`,fieldId:x,aggregation:jt(E,A.get(x))}),[A]),Go=vt.useCallback(x=>{if(x==="rows")return Te([]);if(x==="columns")return Ne([]);if(x==="filters")return Ie([]);Re([]);},[]),ra=vt.useCallback((x,E)=>{if(x==="rows")return Te(F=>F.filter(K=>K!==E));if(x==="columns")return Ne(F=>F.filter(K=>K!==E));if(x==="filters")return Ie(F=>F.filter(K=>K!==E));Re(F=>F.filter(K=>K.tokenId!==E));},[]),tr=vt.useCallback((x,E)=>{Re(F=>F.map(K=>K.tokenId===x?{...K,aggregation:jt(E,A.get(K.fieldId))}:K));},[A]),Uo=vt.useCallback(x=>{Tt(String(x.active.id));},[]),or=vt.useCallback(x=>{if(Tt(null),!x.over)return;let E=Ll(String(x.active.id)),F=Ll(String(x.over.id));if(!E||!F||E.kind!=="item"||!E.key)return;if(E.zone===F.zone&&F.kind==="item"){if(E.zone==="rows"){let q=ze.indexOf(E.key),ge=ze.indexOf(F.key??"");q!==-1&&ge!==-1&&q!==ge&&Te(Ze=>sortable.arrayMove(Ze,q,ge));return}if(E.zone==="columns"){let q=Ce.indexOf(E.key),ge=Ce.indexOf(F.key??"");q!==-1&&ge!==-1&&q!==ge&&Ne(Ze=>sortable.arrayMove(Ze,q,ge));return}if(E.zone==="filters"){let q=L.indexOf(E.key),ge=L.indexOf(F.key??"");q!==-1&&ge!==-1&&q!==ge&&Ie(Ze=>sortable.arrayMove(Ze,q,ge));return}if(E.zone==="values"){let q=$.findIndex(Ze=>Ze.tokenId===E.key),ge=$.findIndex(Ze=>Ze.tokenId===(F.key??""));q!==-1&&ge!==-1&&q!==ge&&Re(Ze=>sortable.arrayMove(Ze,q,ge));}return}let K=F.zone,ce=[...ze],Se=[...Ce],H=[...L],J=[...$],Q="",at=null;if(E.zone==="palette")Q=E.key;else if(E.zone==="values"){let q=J.find(ge=>ge.tokenId===E.key);if(!q)return;Q=q.fieldId,at=q,J=J.filter(ge=>ge.tokenId!==E.key);}else E.zone==="rows"?(Q=E.key,ce=ce.filter(q=>q!==Q)):E.zone==="columns"?(Q=E.key,Se=Se.filter(q=>q!==Q)):E.zone==="filters"&&(Q=E.key,H=H.filter(q=>q!==Q));if(!Q)return;let W=()=>{ce=ce.filter(q=>q!==Q),Se=Se.filter(q=>q!==Q),H=H.filter(q=>q!==Q);},ie=q=>{if(F.kind!=="item"||!F.key)return q==="rows"?ce.length:q==="columns"?Se.length:q==="filters"?H.length:q==="values"?J.length:0;if(q==="rows"){let ge=ce.indexOf(F.key);return ge>=0?ge:ce.length}if(q==="columns"){let ge=Se.indexOf(F.key);return ge>=0?ge:Se.length}if(q==="filters"){let ge=H.indexOf(F.key);return ge>=0?ge:H.length}if(q==="values"){let ge=J.findIndex(Ze=>Ze.tokenId===F.key);return ge>=0?ge:J.length}return 0};if(K==="palette"){Te(ce),Ne(Se),Ie(H),Re(J);return}if(K==="values"){let q=ie("values"),ge=at??aa(Q);J.splice(q,0,ge),Te(ce),Ne(Se),Ie(H),Re(J);return}if(Xu(K)){W();let q=ie(K);K==="rows"?ce.splice(q,0,Q):K==="columns"?Se.splice(q,0,Q):H.splice(q,0,Q),Te(ce),Ne(Se),Ie(H),Re(J);}},[Ce,aa,L,ze,$]),ar=vt.useCallback((x,E)=>{Ve(F=>({...F,[x]:E}));},[]),Ko=vt.useCallback(x=>{Yt(E=>{let F=new Set(E);return F.has(x)?F.delete(x):F.add(x),F});},[]),na=vt.useCallback(x=>{Qt(E=>{let F=new Set(E);return F.has(x)?F.delete(x):F.add(x),F});},[]),Da=vt.useCallback(x=>{let E=A.get(x.fieldId),F=Ac(E);return jsxRuntime.jsx(material.FormControl,{size:"small",sx:{minWidth:98},children:jsxRuntime.jsx(material.Select,{value:x.aggregation,onChange:K=>tr(x.tokenId,K.target.value),onClick:K=>K.stopPropagation(),onMouseDown:K=>K.stopPropagation(),sx:{fontSize:"0.72rem",height:26,"& .MuiSelect-select":{py:.35}},children:F.map(K=>jsxRuntime.jsx(material.MenuItem,{value:K,sx:{fontSize:"0.75rem"},children:R(K)},K))})})},[A,R,tr]),qt=vt.useCallback(x=>{let E=io[x]??[],F=Z[x]??E;return E.length===0?p("pivot.filter.noValues"):F.length===0?p("pivot.filter.noneSelected"):F.length===E.length?p("pivot.filter.allValues"):p("pivot.filter.selectedCount",{selected:F.length,total:E.length})},[io,Z,p]),Mo=vt.useCallback(x=>{let E=io[x]??[],F=Z[x]??E;return jsxRuntime.jsx(tm,{options:E,selectedValues:F,onChange:K=>ar(x,K)})},[io,Z,ar]),ia=vt.useCallback(()=>`pivot-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,[]),Co=vt.useCallback(()=>{let x={};return new Set([...Kt,...Object.keys(Z)]).forEach(F=>{if(!k.has(F))return;let K=Z[F]??[];x[F]=[...K];}),{layout:{rows:[...ze],columns:[...Ce],filters:[...L],values:$.map(F=>({fieldId:F.fieldId,aggregation:F.aggregation}))},filterSelections:x,showGrandTotal:te,chart:{dimensionFieldId:z,primaryValueFieldId:O,secondaryValueFieldId:N,chartType:ne}}},[Kt,z,O,N,ne,Ce,L,Z,ze,te,k,$]),qo=vt.useCallback(x=>{let E=Rt(x.layout.rows,k),F=Rt(x.layout.columns,k),K=Rt(x.layout.filters,k),ce=new Set,Se=(x.layout.values??[]).filter(Q=>!k.has(Q.fieldId)||ce.has(Q.fieldId)?false:(ce.add(Q.fieldId),true)).map(Q=>aa(Q.fieldId,Q.aggregation)),H={};Object.entries(x.filterSelections??{}).forEach(([Q,at])=>{!k.has(Q)||!Array.isArray(at)||(H[Q]=Array.from(new Set(at.map(W=>String(W)))));}),Te(E),Ne(F),Ie(K),Re(Se),Ve(H),typeof x.showGrandTotal=="boolean"&&It(x.showGrandTotal),yt(Uc(E,F,x.chart?.dimensionFieldId));let J=Xl(Se,x.chart?.primaryValueFieldId);At(J),vo(Kc(Se,J,x.chart?.secondaryValueFieldId)),Ra(x.chart?.chartType??"bar-vertical"),U(x.id),w?.(x);},[aa,w,yt,At,vo,Ra,Ne,Ie,Ve,Te,It,Re,k]),rr=vt.useCallback(x=>{if(!x){U("");return}let E=ae.find(F=>F.id===x);if(!E){U("");return}qo(E);},[qo,ae]),Er=vt.useCallback(()=>{let x=p("pivot.preset.defaultName",{index:ae.length+1});et(x),be(true);},[ae.length,p]),Ma=vt.useCallback(()=>{let x=Pe.trim();if(!x)return;let E={id:ia(),name:x,...Co()};no(F=>[...F,E]),U(E.id),be(false);},[Co,ia,Pe,no]),nr=vt.useCallback(()=>{We&&(no(x=>x.filter(E=>E.id!==We)),U(""));},[We,no]);vt.useEffect(()=>{if(!h||y.current)return;let x=ae.find(E=>E.id===h);x&&(y.current=true,qo(x));},[qo,h,ae]),vt.useEffect(()=>{We&&(ae.some(x=>x.id===We)||U(""));},[We,ae]);let la=vt.useMemo(()=>{if(!te||!je||!ze.length)return null;let x={};return je.dataColumns.forEach(E=>{let F=Wt.filter(K=>{let ce=Ce.length>0?Ce.map(Se=>ba(K[Se])):[p("pivot.valueLabel")];return Cr(ce)===E.colKey});x[E.id]=ln(F,E.valueItem.fieldId,E.valueItem.aggregation);}),{key:"__grand_total__",value:p("pivot.grandTotal")||Ku,children:[],isLeaf:false,isGrandTotal:true,aggregatedValues:x,path:[],depth:-1}},[te,je,Wt,Ce,ze.length,p]),Jt=vt.useMemo(()=>wm(je?.rowTree??[]),[je]),Ao=vt.useMemo(()=>wm(je?.columnTree??[]),[je]);vt.useEffect(()=>{Yt(x=>{let E=new Set;return x.has("__grand_total__")&&E.add("__grand_total__"),Jt.forEach(F=>{x.has(F)&&E.add(F);}),E});},[Jt]),vt.useEffect(()=>{Qt(x=>{let E=new Set;return Ao.forEach(F=>{x.has(F)&&E.add(F);}),E});},[Ao]);let Fr=vt.useCallback(()=>{Yt(x=>{let E=new Set(x);return Jt.forEach(F=>E.add(F)),E});},[Jt]),ir=vt.useCallback(()=>{Yt(x=>{let E=new Set;return x.has("__grand_total__")&&E.add("__grand_total__"),E});},[]),Lr=vt.useCallback(()=>{Qt(new Set(Ao));},[Ao]),zr=vt.useCallback(()=>{Qt(new Set);},[]),Nr=vt.useMemo(()=>!je||Ce.length===0?[]:$C(je.columnTree,Ht),[Ce.length,Ht,je]),lo=vt.useMemo(()=>{if(!je)return [];if(Ce.length===0)return je.dataColumns.map(E=>({id:E.id,label:E.label,leafColumnIds:[E.id],valueItem:E.valueItem}));let x=new Map(je.dataColumns.map(E=>[E.id,E]));return Nr.flatMap(E=>{let F=new Map;return E.leafColumnIds.forEach(K=>{let ce=x.get(K);if(!ce)return;let Se=ce.valueItem.tokenId,H=`${R(ce.valueItem.aggregation)} ${A.get(ce.valueItem.fieldId)?.label??ce.valueItem.fieldId}`,J=F.get(Se);if(J){J.leafColumnIds.push(K);return}F.set(Se,{id:`${E.key}::${Se}`,label:$.length>1?H:E.label,leafColumnIds:[K],valueItem:ce.valueItem});}),Array.from(F.values())})},[Ce.length,A,R,je,$.length,Nr]),Vr=vt.useMemo(()=>new Map(lo.map(x=>[x.id,x])),[lo]),Or=vt.useMemo(()=>lo.map(x=>({id:x.id,colKey:x.id,valueItem:x.valueItem,label:x.label})),[lo]),lr=vt.useMemo(()=>{if(!je||Ce.length===0)return [];let x=[],E=Im(je.columnTree,Ht),F=E+($.length>1?1:0),K=(ce,Se)=>{x[Se]??(x[Se]=[]),ce.forEach(H=>{let J=H.children.length>0&&Ht.has(H.key),Q=lo.filter(W=>H.leafColumnIds.some(ie=>W.leafColumnIds.includes(ie))).length,at=J||$.length>1?1:F-Se;x[Se].push({key:H.key,label:H.label,colSpan:Q,rowSpan:at,expandable:H.children.length>0,expanded:J}),J&&K(H.children,Se+1);});};return K(je.columnTree,0),$.length>1&&(x[E]=lo.map(ce=>({key:ce.id,label:ce.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))),x},[Ce.length,Ht,je,$.length,lo]),sa=vt.useCallback((x,E)=>E.leafColumnIds.reduce((F,K)=>F+(x.aggregatedValues[K]??0),0),[]),Aa=vt.useMemo(()=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.Button,{size:"small",variant:"text",onClick:Fr,disabled:Jt.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:p("pivot.table.expandRowsAll")}),jsxRuntime.jsx(material.Button,{size:"small",variant:"text",onClick:ir,disabled:Jt.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:p("pivot.table.collapseRowsAll")}),jsxRuntime.jsx(material.Divider,{orientation:"vertical",flexItem:true}),jsxRuntime.jsx(material.Button,{size:"small",variant:"text",onClick:Lr,disabled:Ao.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:p("pivot.table.expandColumnsAll")}),jsxRuntime.jsx(material.Button,{size:"small",variant:"text",onClick:zr,disabled:Ce.length===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:p("pivot.table.collapseColumnsAll")})]}),[Ce.length,Ao.size,Jt.size,zr,ir,Lr,Fr,p]),Ba=()=>{if(!Ge)return null;let x=Ll(Ge);if(!x||x.kind!=="item"||!x.key)return null;if(x.zone==="palette"){let ce=A.get(x.key);return ce?jsxRuntime.jsx(Ec,{label:ce.label,subtitle:ce.type}):null}if(x.zone==="values"){let ce=$.find(Q=>Q.tokenId===x.key);if(!ce)return null;let H=A.get(ce.fieldId)?.label??ce.fieldId,J=`${R(ce.aggregation)}(${H})`;return jsxRuntime.jsx(Wl,{label:H,caption:J})}let F=A.get(x.key)?.label??x.key,K=qt(x.key);return jsxRuntime.jsx(Wl,{label:F,caption:K})};return jsxRuntime.jsxs(material.Paper,{sx:x=>({p:{xs:1.2,md:2},borderRadius:4,border:`1px solid ${x.palette.divider}`,bgcolor:"background.paper",boxShadow:x.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:b}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.78rem",color:"text.secondary"},children:p("pivot.subtitle.default")})]}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1.5,alignItems:"center",children:[Me&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.FormControl,{size:"small",sx:{minWidth:200},children:jsxRuntime.jsxs(material.Select,{value:We,displayEmpty:true,onChange:x=>rr(String(x.target.value)),sx:{fontSize:"0.75rem",height:32},children:[jsxRuntime.jsx(material.MenuItem,{value:"",sx:{fontSize:"0.75rem",color:"text.secondary"},children:p("pivot.preset.selectPlaceholder")}),ae.map(x=>jsxRuntime.jsx(material.MenuItem,{value:x.id,sx:{fontSize:"0.75rem"},children:x.name},x.id))]})}),jsxRuntime.jsx(material.Tooltip,{title:p("pivot.preset.save"),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:Er,"aria-label":p("pivot.preset.save"),children:jsxRuntime.jsx(Xp__default.default,{sx:{fontSize:18}})})}),jsxRuntime.jsx(material.Tooltip,{title:p("pivot.preset.delete"),children:jsxRuntime.jsx("span",{children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:nr,disabled:!We,"aria-label":p("pivot.preset.delete"),children:jsxRuntime.jsx(EC__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:[p("pivot.records"),": ",jsxRuntime.jsx("strong",{children:t.length.toLocaleString()})," / ",p("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:p("pivot.grandTotal")}),jsxRuntime.jsx(material.Switch,{size:"small",checked:te,onChange:x=>It(x.target.checked)})]})]})]}),jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsxs(core.DndContext,{sensors:C,collisionDetection:core.closestCenter,onDragStart:Uo,onDragEnd:or,children:[jsxRuntime.jsx(cm,{isConfiguratorCollapsed:ke,onToggleCollapse:()=>xo(x=>!x),availableFields:oa,fieldMap:A,filterFields:L,columnFields:Ce,rowFields:ze,valueFields:$,clearZone:Go,removeFieldFromZone:ra,getFilterSelectionSummary:qt,renderDimensionFilterSelect:Mo,renderAggregationSelect:Da,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:Ba()})})]}),jsxRuntime.jsx(ym,{rows:Wt,fieldMap:A,rowFields:ze,columnFields:Ce,valueFields:$,chartDimensionFieldId:z,chartPrimaryValueFieldId:O,chartSecondaryValueFieldId:N,chartType:ne,isCollapsed:se,onChartDimensionFieldIdChange:x=>yt(x),onChartPrimaryValueFieldIdChange:x=>At(x),onChartSecondaryValueFieldIdChange:x=>vo(x),onChartTypeChange:x=>Ra(x),onToggleCollapse:()=>Br(x=>!x),getAggregationLabel:R}),jsxRuntime.jsx(un,{title:p("pivot.table.sectionTitle"),subtitle:ze.length>0?ze.map(x=>A.get(x)?.label??x).join(" > "):p("pivot.table.dimensions"),collapsed:we,onToggleCollapse:()=>Do(x=>!x),expandAriaLabel:p("pivot.table.collapse.ariaExpand"),collapseAriaLabel:p("pivot.table.collapse.ariaCollapse"),bodySx:{p:0},headerActions:Aa,children:je===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:T})}):jsxRuntime.jsx(material.TableContainer,{sx:{maxHeight:i},children:jsxRuntime.jsxs(material.Table,{size:"small",stickyHeader:true,children:[jsxRuntime.jsx(material.TableHead,{children:(lr.length>0?lr:[[]]).map((x,E)=>jsxRuntime.jsxs(material.TableRow,{children:[E===0&&jsxRuntime.jsx(material.TableCell,{rowSpan:Math.max(lr.length,1),sx:F=>({fontWeight:800,fontSize:"0.76rem",color:"text.primary",bgcolor:F.palette.mode==="dark"?"#000000":"#f5f5f5",borderBottom:`1px solid ${F.palette.divider}`,pl:2,minWidth:220,verticalAlign:"middle"}),children:ze.length>0?ze.map(F=>A.get(F)?.label).join(" > "):p("pivot.table.dimensions")}),(x.length>0?x:lo.map(F=>({key:F.id,label:F.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))).map(F=>jsxRuntime.jsx(material.TableCell,{align:"center",colSpan:F.colSpan,rowSpan:F.rowSpan,sx:K=>({fontWeight:800,fontSize:"0.75rem",color:"text.primary",bgcolor:K.palette.mode==="dark"?"#000000":"#f5f5f5",borderBottom:`1px solid ${K.palette.divider}`,minWidth:148,verticalAlign:"middle"}),children:jsxRuntime.jsxs(material.Box,{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:.4},children:[F.expandable&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>na(F.key),sx:{p:.1,ml:-0.3},children:F.expanded?jsxRuntime.jsx(Zh__default.default,{sx:{fontSize:16}}):jsxRuntime.jsx(Bh__default.default,{sx:{fontSize:16}})}),jsxRuntime.jsx(material.Box,{component:"span",children:F.label})]})},F.key))]},`pivot-header-row-${E}`))}),jsxRuntime.jsxs(material.TableBody,{children:[je.rowTree.map(x=>jsxRuntime.jsx(_l,{node:x,dataColumns:Or,fieldMap:A,level:0,expandedKeys:ro,onToggle:Ko,getValue:(E,F)=>{let K=Vr.get(F);return K?sa(E,K):0}},x.key)),la&&jsxRuntime.jsx(_l,{node:la,dataColumns:Or,fieldMap:A,level:0,expandedKeys:ro,onToggle:Ko,getValue:(x,E)=>{let F=Vr.get(E);return F?sa(x,F):0}})]})]})})}),jsxRuntime.jsxs(material.Dialog,{open:ye,onClose:()=>be(false),maxWidth:"xs",fullWidth:true,children:[jsxRuntime.jsx(material.DialogTitle,{children:p("pivot.preset.saveDialogTitle")}),jsxRuntime.jsx(material.DialogContent,{children:jsxRuntime.jsx(material.TextField,{autoFocus:true,fullWidth:true,margin:"dense",label:p("pivot.preset.nameLabel"),value:Pe,onChange:x=>et(x.target.value),onKeyDown:x=>{x.key==="Enter"&&(x.preventDefault(),Ma());}})}),jsxRuntime.jsxs(material.DialogActions,{children:[jsxRuntime.jsx(material.Button,{onClick:()=>be(false),children:p("common.cancel")}),jsxRuntime.jsx(material.Button,{variant:"contained",onClick:Ma,disabled:!Pe.trim(),children:p("common.save")})]})]})]})};var Pm=(e,t,o)=>{let a=[...e,...t];return o&&a.includes(o)?o:a[0]??""},_c=(e,t)=>t&&e.some(o=>o.fieldId===t)?t:e[0]?.fieldId??"",Rm=(e,t,o)=>o===""?"":o&&o!==t&&e.some(a=>a.fieldId===o)?o:e.find(a=>a.fieldId!==t)?.fieldId??"",yE=({fields:e,initialLayout:t,initialFilterSelections:o={},initialShowGrandTotal:a=true,initialConfiguratorCollapsed:r=false,initialChart:n,initialChartCollapsed:i=false,initialTableCollapsed:c=false})=>{let d=vt.useRef(0),s=vt.useMemo(()=>new Set(e.map(U=>U.id)),[e]),l=vt.useMemo(()=>new Map(e.map(U=>[U.id,U])),[e]),[g,f]=vt.useState(()=>Rt(t?.rows,s)),[u,h]=vt.useState(()=>Rt(t?.columns,s)),[w,p]=vt.useState(()=>Rt(t?.filters,s)),[C,m]=vt.useState(()=>{let U=t?.values??[],ye=new Set,be=[];return U.forEach(Pe=>{!s.has(Pe.fieldId)||ye.has(Pe.fieldId)||(ye.add(Pe.fieldId),d.current+=1,be.push({tokenId:`v${d.current}`,fieldId:Pe.fieldId,aggregation:jt(Pe.aggregation,l.get(Pe.fieldId))}));}),be}),[y,b]=vt.useState(o),[T,B]=vt.useState(a),[R,k]=vt.useState(r),[A,P]=vt.useState(()=>Pm(Rt(t?.rows,s),Rt(t?.columns,s),n?.dimensionFieldId)),[v,M]=vt.useState(()=>{let U=(()=>{let ye=t?.values??[],be=new Set,Pe=[];return ye.forEach(et=>{!s.has(et.fieldId)||be.has(et.fieldId)||(be.add(et.fieldId),Pe.push({tokenId:et.fieldId,fieldId:et.fieldId,aggregation:jt(et.aggregation,l.get(et.fieldId))}));}),Pe})();return _c(U,n?.primaryValueFieldId)}),[S,I]=vt.useState(()=>{let U=(()=>{let be=t?.values??[],Pe=new Set,et=[];return be.forEach(Ge=>{!s.has(Ge.fieldId)||Pe.has(Ge.fieldId)||(Pe.add(Ge.fieldId),et.push({tokenId:Ge.fieldId,fieldId:Ge.fieldId,aggregation:jt(Ge.aggregation,l.get(Ge.fieldId))}));}),et})(),ye=_c(U,n?.primaryValueFieldId);return Rm(U,ye,n?.secondaryValueFieldId)}),[D,G]=vt.useState(n?.chartType??"bar-vertical"),[V,X]=vt.useState(i),[de,oe]=vt.useState(c);vt.useEffect(()=>{f(U=>{let ye=U.filter(be=>s.has(be));return xa(U,ye)?U:ye}),h(U=>{let ye=U.filter(be=>s.has(be));return xa(U,ye)?U:ye}),p(U=>{let ye=U.filter(be=>s.has(be));return xa(U,ye)?U:ye}),m(U=>{let ye=U.filter(be=>s.has(be.fieldId)).map(be=>({...be,aggregation:jt(be.aggregation,l.get(be.fieldId))}));return zl(U,ye)?U:ye});},[l,s]),vt.useEffect(()=>{P(U=>Pm(g,u,U));},[u,g]),vt.useEffect(()=>{M(U=>_c(C,U));},[C]),vt.useEffect(()=>{I(U=>Rm(C,v,U));},[v,C]);let re=vt.useCallback(U=>{f(Rt(U,s));},[s]),_=vt.useCallback(U=>{h(Rt(U,s));},[s]),qe=vt.useCallback(U=>{p(Rt(U,s));},[s]),it=vt.useCallback(U=>{m(ye=>{let be=U??[],Pe=new Set,et=[];return be.forEach(Ge=>{if(!s.has(Ge.fieldId)||Pe.has(Ge.fieldId))return;Pe.add(Ge.fieldId);let Tt=ye.find(ro=>ro.fieldId===Ge.fieldId);if(Tt){et.push({...Tt,aggregation:jt(Ge.aggregation??Tt.aggregation,l.get(Ge.fieldId))});return}d.current+=1,et.push({tokenId:`v${d.current}`,fieldId:Ge.fieldId,aggregation:jt(Ge.aggregation,l.get(Ge.fieldId))});}),et});},[l,s]),Y=vt.useCallback(U=>{re(U.rows??[]),_(U.columns??[]),qe(U.filters??[]),it(U.values??[]);},[_,qe,re,it]),le=vt.useCallback(U=>{if(U==="rows")return f([]);if(U==="columns")return h([]);if(U==="filters")return p([]);m([]);},[]),Be=vt.useCallback((U,ye)=>{if(U==="rows")return f(be=>be.filter(Pe=>Pe!==ye));if(U==="columns")return h(be=>be.filter(Pe=>Pe!==ye));if(U==="filters")return p(be=>be.filter(Pe=>Pe!==ye));m(be=>be.filter(Pe=>Pe.tokenId!==ye));},[]),Ee=vt.useCallback((U,ye)=>{m(be=>be.map(Pe=>Pe.tokenId===U?{...Pe,aggregation:jt(ye,l.get(Pe.fieldId))}:Pe));},[l]),Ue=vt.useCallback((U,ye)=>{b(be=>({...be,[U]:ye}));},[]),ot=vt.useCallback(()=>{b({});},[]),Fe=vt.useCallback(()=>{B(U=>!U);},[]),_e=vt.useCallback(()=>{k(U=>!U);},[]),ht=vt.useCallback(U=>{P(U);},[]),j=vt.useCallback(U=>{M(U);},[]),pe=vt.useCallback(U=>{I(U);},[]),De=vt.useCallback(()=>{X(U=>!U);},[]),Le=vt.useCallback(()=>{oe(U=>!U);},[]);return {model:vt.useMemo(()=>({rowFields:g,setRowFields:f,columnFields:u,setColumnFields:h,filterFields:w,setFilterFields:p,valueFields:C,setValueFields:m,filterSelections:y,setFilterSelections:b,showGrandTotal:T,setShowGrandTotal:B,isConfiguratorCollapsed:R,setIsConfiguratorCollapsed:k,chartDimensionFieldId:A,setChartDimensionFieldId:P,chartPrimaryValueFieldId:v,setChartPrimaryValueFieldId:M,chartSecondaryValueFieldId:S,setChartSecondaryValueFieldId:I,chartType:D,setChartType:G,isChartCollapsed:V,setIsChartCollapsed:X,isTableCollapsed:de,setIsTableCollapsed:oe}),[A,v,S,D,u,w,y,V,R,de,g,T,C]),actions:{setRows:re,setColumns:_,setFilters:qe,setValues:it,setLayout:Y,clearZone:le,removeFieldFromZone:Be,setAggregationForValue:Ee,setFilterSelection:Ue,resetFilterSelections:ot,toggleGrandTotal:Fe,toggleConfigurator:_e,setChartDimension:ht,setChartPrimaryValue:j,setChartSecondaryValue:pe,setChartType:G,toggleChart:De,toggleTable:Le}}};var kE=({orientation:e="auto",defaultNavigationOpen:t,onNavOpenChange:o}={})=>{let a=styles.useTheme(),r=material.useMediaQuery("(orientation: portrait)",{noSsr:true}),n=material.useMediaQuery(a.breakpoints.down("md"),{noSsr:true}),i=vt.useMemo(()=>e==="auto"?r||n?"portrait":"landscape":e,[n,r,e]),[c,d]=vt.useState(t??i==="landscape");vt.useEffect(()=>{d(t??i==="landscape");},[t,i]);let s=g=>{d(g),o?.(g);};return {resolvedOrientation:i,isPortraitViewport:r,isCompactViewport:n,navigationOpen:c,setNavigationOpen:s,toggleNavigationOpen:()=>s(!c)}};var ZC=e=>{let t=Number(e||0);return Number.isFinite(t)?t:0},TE=({rows:e,rowKey:t="id",numericField:o,defaultSelectedId:a})=>{let n=e[0]?.[t],[i,c]=vt.useState(a??n),d=vt.useMemo(()=>e.find(u=>u[t]===i)||e[0],[t,e,i]),[s,l]=vt.useState(()=>{let u=d?.[o];return u==null?"0":String(u)});return {selectedId:i,selectedRecord:d,editorValue:s,setEditorValue:l,selectRecord:u=>{let h=u[t];c(h);let w=u[o];l(w==null?"0":String(w));},applyEditorValue:u=>{if(i===void 0)return;let h=ZC(s),w=e.map(p=>p[t]===i?{...p,[o]:h}:p);u(w);}}};var ik=["code_128","ean_13","ean_8","qr_code","upc_a","upc_e"],Fm=(e,t,o,a)=>{t?.(e),a&&o?.();},AE=({open:e,onClose:t,title:o="Scan barcode",subtitle:a="Use the rear camera on the device. If scanning is unavailable, enter the code manually.",formats:r=ik,facingMode:n="environment",manualEntry:i=true,autoCloseOnDetect:c=true,scanIntervalMs:d=600,confirmLabel:s="Use code",cancelLabel:l="Close",manualPlaceholder:g="Enter barcode manually",onDetected:f,onError:u,sx:h})=>{let w=vt__namespace.default.useRef(null),p=vt__namespace.default.useRef(null),C=vt__namespace.default.useRef(null),m=vt__namespace.default.useRef(null),[y,b]=vt__namespace.default.useState("idle"),[T,B]=vt__namespace.default.useState(""),[R,k]=vt__namespace.default.useState(null),[A,P]=vt__namespace.default.useState(null),v=vt__namespace.default.useCallback(()=>{C.current!==null&&(window.clearInterval(C.current),C.current=null),p.current&&(p.current.getTracks().forEach(I=>I.stop()),p.current=null),w.current&&(w.current.srcObject=null);},[]),M=vt__namespace.default.useCallback(I=>{P(I),b("error"),u?.(I);},[u]);vt__namespace.default.useEffect(()=>{if(!e){v(),b("idle"),P(null),B("");return}let I=false;return (async()=>{if(!(typeof window>"u"||typeof navigator>"u")){if(!navigator.mediaDevices?.getUserMedia){b("unsupported"),P("Camera access is not supported in this browser.");return}b("starting"),P(null);try{let G=await navigator.mediaDevices.getUserMedia({audio:!1,video:{facingMode:{ideal:n}}});if(I){G.getTracks().forEach(V=>V.stop());return}if(p.current=G,w.current&&(w.current.srcObject=G,await w.current.play()),!window.BarcodeDetector){b("unsupported"),P("BarcodeDetector is not available. Camera preview is ready and manual entry is enabled.");return}m.current=new window.BarcodeDetector({formats:r}),b("ready"),C.current=window.setInterval(async()=>{if(!(!w.current||!m.current)&&!(w.current.readyState<HTMLMediaElement.HAVE_CURRENT_DATA))try{let X=(await m.current.detect(w.current)).find(oe=>oe.rawValue);if(!X?.rawValue)return;let de={rawValue:X.rawValue,format:X.format};k(de),v(),Fm(de,f,t,c);}catch(V){M(V instanceof Error?V.message:"Failed to detect barcode.");}},d);}catch(G){M(G instanceof Error?G.message:"Unable to start camera.");}}})(),()=>{I=true,v();}},[c,n,r,t,f,e,M,d,v]);let S=()=>{let I=T.trim();if(!I)return;let D={rawValue:I,format:"manual"};k(D),Fm(D,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:h,children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.88rem",color:"text.secondary",lineHeight:1.55},children:a}),jsxRuntime.jsxs(material.Paper,{elevation:0,sx:I=>({position:"relative",overflow:"hidden",borderRadius:4,border:"1px solid",borderColor:"divider",minHeight:280,background:I.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:w,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(rk__default.default,{}),label:y==="ready"?"Camera ready":y==="starting"?"Starting camera":y==="unsupported"?"Preview only":y==="error"?"Scanner error":"Idle",size:"small",color:y==="error"?"error":"primary",variant:"filled"}),R?jsxRuntime.jsx(material.Chip,{icon:jsxRuntime.jsx(nk__default.default,{}),label:`${R.format||"barcode"}: ${R.rawValue}`,size:"small",color:"success",variant:"filled"}):null]})]}),A?jsxRuntime.jsx(material.Alert,{severity:y==="unsupported"?"info":"warning",children:A}):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:T,onChange:I=>B(I.target.value)}),jsxRuntime.jsx(material.Button,{variant:"contained",onClick:S,sx:{minHeight:56,px:2.5},children:s})]}):null]})}),jsxRuntime.jsx(material.DialogActions,{sx:{px:3,pb:2},children:jsxRuntime.jsx(material.Button,{onClick:t,children:l})})]})};var dk={default:"#475569",primary:"#1d4ed8",success:"#047857",warning:"#b45309",error:"#b91c1c",info:"#0369a1"},NE=({title:e,description:t,kicker:o,icon:a,badges:r=[],metrics:n=[],footer:i,children:c,selected:d=false,draggable:s=false,isDragging:l=false,swipeThreshold:g=88,startAction:f,endAction:u,dragHandleProps:h,onClick:w,onSwipe:p,sx:C})=>{let[m,y]=vt.useState(0),[b,T]=vt.useState(false),B=vt.useRef(null),R=vt.useRef(0),k=vt.useRef(0),A=!!(f||u),P=132,v=()=>{y(0),T(false),B.current=null,R.current=0,k.current=0;},M=V=>{(V==="start"?f:u)?.onTrigger?.(),p?.(V),v();},S=V=>{!A||V.target.closest('button, a, input, textarea, [data-no-swipe="true"]')||(B.current=V.pointerId,R.current=V.clientX,k.current=V.clientX,T(true),V.currentTarget.setPointerCapture(V.pointerId));},I=V=>{if(!b||B.current!==V.pointerId)return;k.current=V.clientX;let X=k.current-R.current,de=Math.max(-P,Math.min(P,X));y(de);},D=V=>{if(!b||B.current!==V.pointerId)return;let X=k.current-R.current;if(X>=g&&f){M("start");return}if(X<=-g&&u){M("end");return}Math.abs(X)<12&&w?.(),v();},G=(V,X)=>{if(!V)return null;let de=V.backgroundColor||dk[V.tone||"default"];return jsxRuntime.jsx(material.Box,{sx:{position:"absolute",top:0,bottom:0,[X]:0,width:P,px:2,display:"flex",alignItems:"center",justifyContent:X==="left"?"flex-start":"flex-end",color:"#fff",background:`linear-gradient(135deg, ${de}, rgba(15,23,42,0.92))`},children:jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,alignItems:"center",children:[V.icon,jsxRuntime.jsx(material.Typography,{sx:{fontWeight:700,fontSize:"0.95rem"},children:V.label})]})})};return jsxRuntime.jsxs(material.Box,{sx:{position:"relative",overflow:"hidden",borderRadius:4,...C},children:[G(f,"left"),G(u,"right"),jsxRuntime.jsx(material.Paper,{elevation:0,onPointerDown:S,onPointerMove:I,onPointerUp:D,onPointerCancel:v,sx:V=>({position:"relative",zIndex:1,p:2,borderRadius:4,border:"1px solid",borderColor:d?"primary.main":"divider",background:V.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(${l?.985:1})`,transition:b?"none":"transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease",touchAction:"pan-y",cursor:w?"pointer":"default",opacity:l?.9:1}),children:jsxRuntime.jsxs(material.Stack,{spacing:1.5,children:[jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1.5,alignItems:"flex-start",children:[a?jsxRuntime.jsx(material.Box,{sx:{mt:.25},children:a}):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]}),s?jsxRuntime.jsx(material.Box,{"data-no-swipe":"true",...h,sx:{alignSelf:"center",display:"inline-flex",touchAction:"none"},children:jsxRuntime.jsx(material.IconButton,{size:"small",children:jsxRuntime.jsx(ck__default.default,{})})}):null]}),r.length>0?jsxRuntime.jsx(material.Stack,{direction:"row",spacing:1,useFlexGap:true,flexWrap:"wrap",children:r.map((V,X)=>jsxRuntime.jsx(material.Chip,{label:V,size:"small",sx:{borderRadius:999,fontWeight:700,bgcolor:"action.hover",color:"text.primary"}},X))}):null,n.length>0?jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(110px, 1fr))",gap:1},children:n.map(V=>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:V.label}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1rem",fontWeight:800,lineHeight:1.2},children:V.value})]},V.id))}):null,c,i]})})]})};var vi=({label:e,onPress:t,emphasis:o="default"})=>jsxRuntime.jsx(material.Box,{component:"button",type:"button",onClick:t,sx:a=>({minHeight:72,borderRadius:3,border:"1px solid",borderColor:o==="primary"?"primary.main":"divider",background:o==="primary"?a.palette.primary.main:o==="danger"?a.palette.mode==="dark"?"rgba(239,68,68,0.18)":"rgba(239,68,68,0.10)":a.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}),qE=({value:e,defaultValue:t="",title:o,subtitle:a,placeholder:r="0",allowDecimal:n=false,allowNegative:i=false,maxLength:c,confirmLabel:d,clearLabel:s,backspaceLabel:l,onChange:g,onSubmit:f,onClose:u,sx:h})=>{let{t:w}=ee(),[p,C]=vt.useState(t),m=e??p,y=v=>{e===void 0&&C(v),g?.(v);},b=v=>{c&&m.length>=c||y(`${m}${v}`);},T=v=>{if(v==="00"){if(!m){y("0");return}b("00");return}b(v);},B=()=>{!n||m.includes(".")||y(m?`${m}.`:"0.");},R=()=>{if(i){if(m.startsWith("-")){y(m.slice(1));return}y(m?`-${m}`:"-");}},k=()=>{y(m.slice(0,-1));},A=()=>{y("");},P=()=>{f?.(m);};return jsxRuntime.jsx(material.Paper,{elevation:0,sx:{p:2,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",...h},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,a?jsxRuntime.jsx(material.Typography,{sx:{mt:.5,fontSize:"0.86rem",color:"text.secondary"},children:a}):null]}),u?jsxRuntime.jsx(material.IconButton,{onClick:u,size:"small",children:jsxRuntime.jsx(gk__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||r})}),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(v=>jsxRuntime.jsx(vi,{label:v,onPress:()=>T(v)},v)),jsxRuntime.jsx(vi,{label:i?"+/-":"00",onPress:i?R:()=>T("00")}),jsxRuntime.jsx(vi,{label:"0",onPress:()=>T("0")}),jsxRuntime.jsx(vi,{label:n?".":l?String(l):"DEL",onPress:n?B:k})]}),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:k,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(mk__default.default,{}),jsxRuntime.jsx(material.Typography,{sx:{fontWeight:700},children:l||"DEL"})]})}),jsxRuntime.jsx(vi,{label:String(s||"CLR"),onPress:A,emphasis:"danger"}),jsxRuntime.jsx(material.Box,{component:"button",type:"button",onClick:P,sx:v=>({minHeight:64,borderRadius:3,border:"1px solid",borderColor:"primary.main",background:v.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(fk__default.default,{}),jsxRuntime.jsx(material.Typography,{sx:{fontWeight:800},children:d||w("common.ok")})]})})]})]})})};var Om=({touchMode:e="comfortable",sx:t,...o})=>{let a=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:a?56:50,borderRadius:3,fontSize:a?"0.98rem":"0.92rem"},"& .MuiInputBase-input":{py:a?1.6:1.25,fontSize:a?"0.98rem":"0.92rem"},"& .MuiInputLabel-root":{fontSize:a?"0.95rem":"0.88rem"},"& .MuiButton-root":{minHeight:a?48:44,px:a?2.25:1.75,borderRadius:3,fontSize:a?"0.95rem":"0.88rem",fontWeight:700},"& .MuiIconButton-root":{width:a?40:36,height:a?40:36},"& .MuiMenuItem-root":{minHeight:a?44:38,fontSize:a?"0.95rem":"0.88rem"},"& .MuiListSubheader-root":{py:1},"& .MuiCheckbox-root":{p:a?1:.75},"& .MuiFormControlLabel-label":{fontSize:a?"0.95rem":"0.88rem"},"& .MuiDialog-paper":{borderRadius:4},"& .MuiDialogTitle-root":{fontSize:a?"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(ma,{...o})})};var kk=(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);}},$m=({items:e,selectedId:t,orientation:o="auto",onItemSelect:a,sx:r})=>{let n=styles.useTheme(),[i,c]=vt.useState(false);vt.useEffect(()=>{c(true);},[]);let d=material.useMediaQuery("(orientation: portrait)",{noSsr:true}),s=material.useMediaQuery(n.breakpoints.down("md"),{noSsr:true}),l=o==="auto"?d||s?"portrait":"landscape":o,g=navigation.useRouter();return jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:!i||l==="portrait"?"repeat(2, minmax(0, 1fr))":"repeat(auto-fit, minmax(180px, 1fr))",gap:1.5,...r},children:e.map(f=>{let u=f.id===t,h=f.color||(u?n.palette.primary.main:n.palette.divider);return jsxRuntime.jsx(material.Paper,{elevation:0,sx:{overflow:"hidden",borderRadius:4,border:"1px solid",borderColor:u?"primary.main":"divider",boxShadow:u?"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:()=>kk(g,f,a),sx:{width:"100%",p:2,minHeight:l==="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:u?"#fff":"text.primary",background:u?h:"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:u?"primary.main":"action.hover",color:u?"#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 qm=(e,t)=>t.trim()?e.reduce((o,a)=>{let r=a.title?.toLowerCase().includes(t.toLowerCase())||a.label?.toLowerCase().includes(t.toLowerCase())||a.description?.toLowerCase().includes(t.toLowerCase()),n=a.children?qm(a.children,t):[];return (r||n.length>0)&&o.push({...a,children:n.length>0?n:a.children}),o},[]):e,Lk=e=>{let t=new Set,o=a=>{a.forEach(r=>{r.children?.length&&(t.add(r.id),o(r.children));});};return o(e),t},_m=({collapsed:e=false,onToggle:t,className:o="",maxHeight:a,menuData:r=[],colorMode:n="light",orientation:i="auto",headerSlot:c,footerSlot:d,activeHref:s,onItemSelect:l})=>{let{t:g}=ee(),f=styles.useTheme(),u=material.useMediaQuery("(orientation: portrait)"),h=material.useMediaQuery(f.breakpoints.down("md")),w=i==="auto"?u||h?"portrait":"landscape":i,p=n==="dark",C=navigation.useRouter(),m=navigation.usePathname(),[y,b]=vt.useState(""),[T,B]=vt.useState(new Set),R=vt.useMemo(()=>qm(r,y),[r,y]),k=vt.useMemo(()=>y.trim()?Lk(R):T,[T,R,y]);vt.useEffect(()=>{e&&B(new Set);},[e]);let A=I=>I.appurl||I.href||"",P=I=>{l?.(I);let D=A(I);if(D){if(D.startsWith("http://")||D.startsWith("https://")){window.open(D,"_blank");return}C.push(D);}},v=I=>{let D=!!I.children?.length;if(e&&D){t?.();return}if(D){B(G=>{let V=new Set(G);return V.has(I.id)?V.delete(I.id):V.add(I.id),V});return}P(I);},M=I=>{let D=s||m,G=A(I);return !!(G&&D===G)},S=(I,D=0)=>{let G=!!I.children?.length,V=k.has(I.id),X=M(I);return jsxRuntime.jsx(material.Box,{sx:{pl:D===0?0:1.5},children:jsxRuntime.jsxs(material.Paper,{elevation:0,sx:{mb:1,overflow:"hidden",borderRadius:3,border:"1px solid",borderColor:X?"primary.main":"divider",bgcolor:X?"action.selected":"background.paper"},children:[jsxRuntime.jsxs(material.Box,{component:"button",type:"button",onClick:()=>v(I),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:X?"primary.main":"action.hover",color:X?"#fff":"text.primary"},children:I.icon||(I.title||I.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:I.title||I.label}),I.description?jsxRuntime.jsx(material.Typography,{sx:{mt:.4,fontSize:"0.78rem",color:"text.secondary",lineHeight:1.35},children:I.description}):null]}),G?jsxRuntime.jsx(Ek__default.default,{sx:{transform:V?"rotate(180deg)":"rotate(0deg)",transition:"transform 180ms ease"}}):jsxRuntime.jsx(Fk__default.default,{color:"action"})]}),G?jsxRuntime.jsx(material.Collapse,{in:V,children:jsxRuntime.jsx(material.Box,{sx:{px:1.25,pb:1.25},children:I.children?.map(de=>S(de,D+1))})}):null]})},I.id)};return e?jsxRuntime.jsx(material.Paper,{elevation:0,className:o,sx:{width:w==="portrait"?"100%":88,p:1,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:p?"#101828":"rgba(255,255,255,0.88)",maxHeight:a?`${a}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(Bk__default.default,{})}),r.map(I=>jsxRuntime.jsx(material.IconButton,{onClick:()=>v(I),sx:{width:56,height:56,alignSelf:"center",borderRadius:3,bgcolor:M(I)?"primary.main":"action.hover",color:M(I)?"#fff":"text.primary"},children:I.icon||(I.title||I.label||"?").slice(0,1).toUpperCase()},I.id))]})}):jsxRuntime.jsx(material.Paper,{elevation:0,className:o,sx:{width:w==="portrait"?"100%":320,p:1.25,borderRadius:5,border:"1px solid",borderColor:"divider",bgcolor:p?"#101828":"rgba(255,255,255,0.88)",maxHeight:a?`${a}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:y,onChange:I=>b(I.target.value),placeholder:g("navigation.searchPlaceholder"),size:"small",fullWidth:true,InputProps:{startAdornment:jsxRuntime.jsx(Mk__default.default,{fontSize:"small",color:"action"})}}),w==="landscape"&&!e?jsxRuntime.jsx(material.IconButton,{onClick:t,sx:{bgcolor:"action.hover"},children:jsxRuntime.jsx(Ak__default.default,{})}):null]}),c,jsxRuntime.jsx(material.Box,{sx:{flex:1,minHeight:0,overflowY:"auto",pr:.25},children:R.length>0?R.map(I=>S(I)):jsxRuntime.jsx(material.Typography,{sx:{p:2,fontSize:"0.88rem",color:"text.secondary",textAlign:"center"},children:g("navigation.noMatch")})}),d]})})};var tg=(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)},Wk=e=>vt__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}),$k=(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)},Gk=({summaryRow:e,visibleColumns:t,columns:o})=>{let a=o.filter(r=>t.includes(r.id)&&e[r.id]!=="");return a.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:a.map(r=>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:r.label}),jsxRuntime.jsx(material.Typography,{sx:{mt:.25,fontSize:"0.96rem",fontWeight:800},children:e[r.id]})]},`summary-${r.id}`))})]})})},Uk=e=>{let{t}=ee(),o=styles.useTheme(),{title:a,showToolbar:r=true,selectionMode:n,selected:i=[],onSelectionChange:c,actions:d,extraTools:s,fitContainer:l=false,fullWidth:g=false,maxHeight:f,loading:u=false,rowsPerPageOptions:h=[20,50,100,-1],onLayoutSave:w,filterConfig:p,rowKey:C,tableKey:m="default",graphReport:y,quickCreate:b,quickEdit:T,quickDelete:B,serviceUrl:R,orientation:k="auto",cardTitleField:A,cardSubtitleFields:P,toolbarSlot:v,emptyState:M,rowHeight:S="comfortable",cardActionSlot:I,renderCardFooter:D,onRowClick:G}=e,V=a||t("table.title.default"),X=material.useMediaQuery("(orientation: portrait)"),de=material.useMediaQuery(o.breakpoints.down("md")),oe=k==="auto"?X||de?"portrait":"landscape":k,{columns:re,filterText:_,setFilterText:qe,visibleColumns:it,showSummary:Y,setShowSummary:le,summaryColumns:Be,grouping:Ee,setGrouping:Ue,expandedGroups:ot,groupAnchorEl:Fe,setGroupAnchorEl:_e,summaryAnchorEl:ht,setSummaryAnchorEl:j,anchorEl:pe,setAnchorEl:De,contextMenu:Le,sortedAndFilteredRows:We,summaryRow:U,visibleRows:ye,page:be,setPage:Pe,rowsPerPage:et,setRowsPerPage:Ge,totalDisplayCount:Tt,setSelected:ro,handleClick:Yt,toggleSummaryColumn:Ht,handleExport:Qt,handleCloseContextMenu:ze,toggleColumnVisibility:Ce,toggleGroupExpand:L,toggleGroupField:$,handleExpandGroupRecursively:Z,handleCollapseGroupRecursively:te,handleLayoutLoad:ke,handleVariantLoad:z,handleLayoutSave:O,effectiveAppId:N,currentLayoutData:ne,currentLayoutId:se,layoutIdToLoad:we,graphReportOpen:ae,handleOpenGraphReport:Me,handleCloseGraphReport:Te}=on(e),Ne=y?.enabled??false,Ie=Ne&&(y?.interaction?.enabled??true),Re=ol(),Ve=C||"id",It=vt__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]),xo=vt__namespace.default.useMemo(()=>({...It,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)}),[It,o]),yt=vt__namespace.default.useMemo(()=>{let W=new Set(i);return We.filter(ie=>W.has(ie?.[Ve]))},[Ve,i,We]),At=yt.length===1?yt[0]:null,vo=!!b?.enabled,Ra=!!T?.enabled,Br=!!B?.enabled,Do=b?.fields,no=b?.excludeFields||[],er=b?.initialValues||{},oa=T?.fields,Kt=T?.excludeFields||[],io=T?.editableFields||[],Wt=T?.nonEditableFields||[],je=T?.primaryKeys?.length?T.primaryKeys:[Ve],[aa,Go]=vt__namespace.default.useState(false),[ra,tr]=vt__namespace.default.useState(false),[Uo,or]=vt__namespace.default.useState({}),[ar,Ko]=vt__namespace.default.useState(false),[na,Da]=vt__namespace.default.useState(false),[qt,Mo]=vt__namespace.default.useState({}),[ia,Co]=vt__namespace.default.useState(false),[qo,rr]=vt__namespace.default.useState(false),Er=u||ra||na||qo,Ma=vt__namespace.default.useMemo(()=>{let W=[...re];if(Array.isArray(Do)&&Do.length>0){let ie=new Set(Do);W=W.filter(q=>ie.has(q.id));}if(no.length>0){let ie=new Set(no);W=W.filter(q=>!ie.has(q.id));}return W.filter(ie=>!!ie?.id)},[re,no,Do]),nr=vt__namespace.default.useMemo(()=>{let W=[...re];if(Array.isArray(oa)&&oa.length>0){let ie=new Set(oa);W=W.filter(q=>ie.has(q.id));}if(Kt.length>0){let ie=new Set(Kt);W=W.filter(q=>!ie.has(q.id));}return W.filter(ie=>!!ie?.id)},[re,Kt,oa]),la=vt__namespace.default.useMemo(()=>new Set(je),[je]),Jt=vt__namespace.default.useMemo(()=>new Set(io),[io]),Ao=vt__namespace.default.useMemo(()=>new Set(Wt),[Wt]),Fr=vt__namespace.default.useCallback(W=>Jt.size>0?Jt.has(W):!(Ao.has(W)||la.has(W)),[Jt,Ao,la]);vt__namespace.default.useEffect(()=>{!ae&&Re.hasActiveFilters&&Re.clearAll();},[Re,ae]);let ir=()=>{let W={};Ma.forEach(ie=>{W[ie.id]=er[ie.id]??"";}),or(W),Go(true);},Lr=(W,ie)=>{or(q=>({...q,[W]:ie}));},zr=async()=>{if(!b?.onSubmit){Go(false);return}try{tr(!0),await b.onSubmit(Uo),Go(!1);}finally{tr(false);}},Nr=()=>{if(!At)return;let W={};nr.forEach(q=>{W[q.id]=At[q.id]??"";});let ie=T?.getInitialValues?{...W,...T.getInitialValues(At)}:W;Mo(ie),Ko(true);},lo=(W,ie)=>{Mo(q=>({...q,[W]:ie}));},Vr=async()=>{if(At){if(!T?.onSubmit){Ko(false);return}try{Da(!0),await T.onSubmit(qt,At),Ko(!1);}finally{Da(false);}}},Or=()=>{yt.length!==0&&Co(true);},lr=async()=>{if(yt.length===0){Co(false);return}if(!B?.onConfirm){Co(false),ro([]),c?.([]);return}try{rr(!0),await B.onConfirm(yt),Co(!1),ro([]),c?.([]);}finally{rr(false);}},sa=We,{fieldMapping:Aa}=Qr({rows:sa,config:{...y,title:y?.title||`${V} ${t("graph.reportTitle")}`}}),Ba=vt__namespace.default.useMemo(()=>Ie?Re.applyRows(sa,Aa):sa,[Aa,Re,Ie,sa]),{model:x}=Qr({rows:Ba,config:{...y,title:y?.title||`${V} ${t("graph.reportTitle")}`,fieldMapping:Aa}}),E=x.table.columns.map(W=>({id:W.id,label:W.label,align:W.align||"left",minWidth:120,numeric:W.align==="right"})),F=N?jsxRuntime.jsx(ul,{appId:N,tableKey:m,currentLayoutData:ne,onLayoutLoad:ke,targetLayoutId:we,activeLayoutId:se,serviceUrl:R??p?.serviceUrl}):null,K=re.filter(W=>it.includes(W.id)),ce=K.find(W=>W.id===A)||K[0],Se=P?.map(W=>K.find(ie=>ie.id===W)).filter(Boolean)||K.filter(W=>W.id!==ce?.id).slice(0,oe==="portrait"?2:3),H=K.filter(W=>W.id!==ce?.id&&!Se.some(ie=>ie.id===W.id)),J=[v,s].filter(Boolean),Q=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Wr,{groupAnchorEl:Fe,setGroupAnchorEl:_e,grouping:Ee,setGrouping:Ue,columns:re,toggleGroupField:$}),jsxRuntime.jsx($r,{anchorEl:pe,setAnchorEl:De,columns:re,visibleColumns:it,toggleColumnVisibility:Ce}),jsxRuntime.jsx(Ni,{anchorEl:ht,setAnchorEl:j,showSummary:Y,setShowSummary:le,columns:re,summaryColumns:Be,toggleSummaryColumn:Ht}),jsxRuntime.jsx(Vi,{contextMenu:Le,handleCloseContextMenu:ze,columns:re,visibleColumns:it,toggleColumnVisibility:Ce})]}),at=(W,ie,q)=>{let ge=i.includes(ie),Ze=oe==="portrait"?"repeat(2, minmax(0, 1fr))":"repeat(auto-fit, minmax(140px, 1fr))",_o=q%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),nf=styles.alpha(o.palette.divider,.22);return jsxRuntime.jsx(material.Paper,{elevation:0,onClick:()=>{Yt({},W),G?.(W);},sx:{p:S==="compact"?1.25:1.5,borderRadius:4,border:"0.5px solid",borderColor:ge?styles.alpha(o.palette.primary.main,.38):nf,background:ge?`linear-gradient(135deg, ${styles.alpha(o.palette.primary.main,.13)}, ${styles.alpha(o.palette.primary.main,.06)})`:`linear-gradient(135deg, ${_o}, ${styles.alpha(o.palette.primary.main,.015)})`,boxShadow:ge?`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:ge?o.palette.primary.main:q%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:ge,onClick:so=>so.stopPropagation(),onChange:()=>Yt({},W),sx:{mt:-0.6,ml:-0.6}}):null,jsxRuntime.jsxs(material.Box,{sx:{flex:1,minWidth:0},children:[ce?jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1rem",fontWeight:900,lineHeight:1.25},children:tg(ce,W)}):null,Se.length>0?jsxRuntime.jsx(material.Stack,{direction:"row",spacing:.75,useFlexGap:true,flexWrap:"wrap",sx:{mt:.75},children:Se.map(so=>jsxRuntime.jsx(material.Chip,{label:`${so.label}: ${$k(so,W)}`,size:"small",variant:"outlined",sx:It},`${ie}-${so.id}`))}):null]}),I?jsxRuntime.jsx(material.Box,{onClick:so=>so.stopPropagation(),children:I(W)}):null]}),H.length>0?jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:Ze,gap:1},children:H.map(so=>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:so.label}),Wk(tg(so,W))]},`${ie}-${so.id}-detail`))}):null,D?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsx(material.Box,{onClick:so=>so.stopPropagation(),children:D(W)})]}):null]})},ie)};return jsxRuntime.jsxs(material.Box,{sx:{width:g?"100%":"auto",mb:l?0:2,...l?{flex:1,display:"flex",flexDirection:"column",minHeight:0,height:"100%",overflow:"hidden"}:{}},children:[p?jsxRuntime.jsx(material.Box,{sx:{mb:2},children:jsxRuntime.jsx(Om,{...p,onVariantLoad:W=>{z(W),p.onVariantLoad?.(W);},appId:p.appId,tableKey:m,currentLayout:[{tableKey:m,layoutData:ne}],currentLayoutId:se,layoutRefs:[{tableKey:m,layoutId:se}],variantService:p.variantService,serviceUrl:R??p.serviceUrl,touchMode:oe==="portrait"?"expanded":"comfortable"})}):null,jsxRuntime.jsxs(material.Paper,{sx:{width:g?"100%":"auto",mb:l?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative",bgcolor:"transparent",backgroundImage:"none",boxShadow:"none","&::before":Er?{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}:l?{flex:1,minHeight:0,height:"100%"}:{}},children:[r?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(Bi,{filterText:_,setFilterText:qe,onRowsPerPageChange:Ge,rowsPerPage:et,rowsPerPageOptions:h,page:be,count:Tt,onPageChange:Pe,actions:d,extraTools:J,grouping:Ee,setGroupAnchorEl:_e,showSummary:Y,setShowSummary:le,setAnchorEl:De,setSummaryAnchorEl:j,handleExport:Qt,showCreateButton:vo,onOpenCreateDialog:ir,showEditButton:Ra,onOpenEditDialog:Nr,editDisabled:yt.length!==1,showDeleteButton:Br,onOpenDeleteConfirm:Or,deleteDisabled:yt.length===0,onLayoutSave:w||p?.variantService&&p?.appId?O:void 0,loading:u,layoutManager:F,onOpenGraphReport:Ne?Me: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:[ye.length===0&&!u?M||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,ye.map((W,ie)=>{if(W.type==="group"){let Ze=ot.has(W.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:()=>L(W.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:[Ze?jsxRuntime.jsx(Ek__default.default,{}):jsxRuntime.jsx(Fk__default.default,{}),jsxRuntime.jsxs(material.Box,{sx:{flex:1,minWidth:0},children:[jsxRuntime.jsxs(material.Typography,{sx:{fontSize:"0.94rem",fontWeight:800},children:[W.field,": ",W.value]}),jsxRuntime.jsxs(material.Typography,{sx:{mt:.2,fontSize:"0.76rem",color:"text.secondary"},children:[W.count," records"]})]}),Ee.length>1&&W.level<Ee.length-1?jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:.5,children:[jsxRuntime.jsx(material.Chip,{size:"small",label:t("table.group.expandAll"),onClick:_o=>{_o.stopPropagation(),Z(W.id);},sx:xo}),jsxRuntime.jsx(material.Chip,{size:"small",label:t("table.group.collapseAll"),onClick:_o=>{_o.stopPropagation(),te(W.id);},sx:xo})]}):null]})},W.id)}let q=W.data||W,ge=W.id||q[Ve]||ie;return at(q,ge,ie)}),Y?jsxRuntime.jsx(Gk,{summaryRow:U,visibleColumns:it,columns:re}):null,u?jsxRuntime.jsx(material.Typography,{sx:{py:1,fontSize:"0.84rem",color:"text.secondary",textAlign:"center"},children:t("common.loading")}):null]})})]}),vo?jsxRuntime.jsxs(material.Dialog,{open:aa,onClose:()=>!ra&&Go(false),fullWidth:true,maxWidth:"sm",children:[jsxRuntime.jsx(material.DialogTitle,{sx:{fontSize:"1rem",fontWeight:800},children:b?.title||t("quickCreate.createWithTitle",{title:V})}),jsxRuntime.jsx(material.DialogContent,{sx:{pt:"8px !important"},children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Ma.map(W=>{let ie=W.type==="number"||W.numeric?"number":W.type==="date"?"date":"text";return jsxRuntime.jsx(material.TextField,{label:W.label||W.id,value:Uo[W.id]??"",onChange:q=>Lr(W.id,q.target.value),type:ie,fullWidth:true,InputLabelProps:{shrink:ie==="date"?true:void 0}},`quick-create-${W.id}`)}),b?.description?jsxRuntime.jsx(material.Alert,{severity:"info",children:b.description}):null]})}),jsxRuntime.jsxs(material.DialogActions,{sx:{px:3,pb:2},children:[jsxRuntime.jsx(material.Button,{onClick:()=>Go(false),disabled:ra,children:b?.cancelLabel||t("common.cancel")}),jsxRuntime.jsx(material.Button,{onClick:zr,variant:"contained",disabled:ra,children:b?.submitLabel||t("common.save")})]})]}):null,Ra?jsxRuntime.jsxs(material.Dialog,{open:ar,onClose:()=>!na&&Ko(false),fullWidth:true,maxWidth:"sm",children:[jsxRuntime.jsx(material.DialogTitle,{sx:{fontSize:"1rem",fontWeight:800},children:T?.title||t("quickEdit.editWithTitle",{title:V})}),jsxRuntime.jsx(material.DialogContent,{sx:{pt:"8px !important"},children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[nr.map(W=>{let ie=W.type==="number"||W.numeric?"number":W.type==="date"?"date":"text";return jsxRuntime.jsx(material.TextField,{label:W.label||W.id,value:qt[W.id]??"",onChange:q=>lo(W.id,q.target.value),type:ie,disabled:!Fr(W.id),fullWidth:true,InputLabelProps:{shrink:ie==="date"?true:void 0}},`quick-edit-${W.id}`)}),T?.description?jsxRuntime.jsx(material.Alert,{severity:"info",children:T.description}):null]})}),jsxRuntime.jsxs(material.DialogActions,{sx:{px:3,pb:2},children:[jsxRuntime.jsx(material.Button,{onClick:()=>Ko(false),disabled:na,children:T?.cancelLabel||t("common.cancel")}),jsxRuntime.jsx(material.Button,{onClick:Vr,variant:"contained",disabled:na||!At,children:T?.submitLabel||t("common.save")})]})]}):null,Br?jsxRuntime.jsx(Bn,{open:ia,type:"warning",title:B?.title||t("quickDelete.confirmTitle"),message:B?.message||(yt.length>1?t("quickDelete.confirmMessageMultiple",{count:yt.length}):t("quickDelete.confirmMessageSingle")),confirmText:B?.confirmText||t("common.delete"),cancelText:B?.cancelText||t("common.cancel"),onClose:()=>!qo&&Co(false),onConfirm:lr}):null,Q,Ne?jsxRuntime.jsx(el,{open:ae,onClose:Te,model:x,aiAssistant:y?.aiAssistant,interaction:Ie?{enabled:true,filters:Re.filters,fieldMapping:Aa,onPrimaryDimensionClick:W=>Re.setFilter("primaryDimension",W),onSecondaryDimensionClick:W=>Re.setFilter("secondaryDimension",W),onStatusClick:W=>Re.setFilter("status",W),onClearFilter:Re.clearFilter,onClearAll:Re.clearAll}:void 0,tableContent:jsxRuntime.jsx(Uk,{appId:N||"graph-report-internal",title:t("graph.dataBody"),columns:E,rows:x.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false},showSummary:false})}):null]})};var $F=({appTitle:e,children:t,menuData:o=[],workloadItems:a=[],workloadSelectedId:r,showNavigation:n=true,showWorkloadNav:i=true,orientation:c="auto",logo:d,headerSlot:s,actionSlot:l,portraitBottomSlot:g,contentSx:f,containerSx:u,user:h,onSearch:w,defaultNavigationOpen:p,navOpen:C,onNavOpenChange:m,onWorkloadSelect:y,locale:b="en",localeLabel:T,localeOptions:B,onLocaleChange:R,onUserSetting:k,onUserLogout:A,userMenuItems:P,leftHeaderSlot:v,rightHeaderSlot:M})=>{let S="orbcafe:page-layout-mode",[I,D]=vt.useState("system"),[G,V]=vt.useState("light"),[X,de]=vt.useState(false),[oe,re]=vt.useState(false),_=I==="system"?oe?G:"light":I;vt.useEffect(()=>{de(true);},[]),vt.useEffect(()=>{try{let Le=window.localStorage.getItem(S);(Le==="light"||Le==="dark"||Le==="system")&&D(Le);}catch{}re(true);let pe=window.matchMedia("(prefers-color-scheme: dark)"),De=()=>{V(pe.matches?"dark":"light");};return De(),pe.addEventListener("change",De),()=>pe.removeEventListener("change",De)},[]),vt.useEffect(()=>{if(oe)try{window.localStorage.setItem(S,I);}catch{}},[oe,I]),vt.useEffect(()=>{_==="dark"?(document.documentElement.classList.add("dark"),document.documentElement.style.colorScheme="dark"):(document.documentElement.classList.remove("dark"),document.documentElement.style.colorScheme="light");},[_]);let qe=vt.useMemo(()=>styles.createTheme({palette:_==="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:_==="dark"?"#060913":"#eef3f8"}}},MuiPaper:{styleOverrides:{root:{backgroundImage:"none"}}}}}),[_]),it=material.useMediaQuery("(orientation: portrait)"),Y=material.useMediaQuery(qe.breakpoints.down("md")),le=c==="auto"?!X||it||Y?"portrait":"landscape":c,[Be,Ee]=vt.useState({landscape:p??true,portrait:false}),Ue=Be[le],ot=C??Ue,Fe=pe=>{C===void 0&&Ee(De=>({...De,[le]:pe})),m?.(pe);},_e=jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,alignItems:"center",children:[!X||n&&le==="portrait"?jsxRuntime.jsx(material.IconButton,{onClick:()=>Fe(!ot),sx:{bgcolor:"action.hover"},children:jsxRuntime.jsx(Bk__default.default,{})}):null,v]}),ht=jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,alignItems:"center",children:[l,M]}),j=jsxRuntime.jsx(_m,{collapsed:le==="landscape"?!ot:false,onToggle:()=>Fe(!ot),menuData:o,orientation:le,colorMode:_,maxHeight:le==="landscape"?900:void 0});return jsxRuntime.jsx(styles.ThemeProvider,{theme:qe,children:jsxRuntime.jsx(Mi,{locale:b,children:jsxRuntime.jsxs(material.Box,{sx:[pe=>({minHeight:"100vh",display:"flex",flexDirection:"column",background:pe.palette.mode==="dark"?"linear-gradient(180deg, #0A0A0A 0%, #141414 55%, #1A1A1A 100%)":pe.palette.background.default}),...Array.isArray(u)?u:[u]],children:[jsxRuntime.jsx(Bl,{appTitle:e,logo:d===void 0?null:d,mode:I,onToggleMode:()=>D(pe=>pe==="system"?"dark":pe==="dark"?"light":"system"),locale:b,localeLabel:T,localeOptions:B,onLocaleChange:R,user:h,onUserSetting:k,onUserLogout:A,userMenuItems:P,onSearch:w,leftSlot:_e,rightSlot:ht}),s?jsxRuntime.jsx(material.Box,{sx:{px:{xs:2,md:3},py:1.5,borderBottom:"1px solid",borderColor:"divider"},children:s}):null,jsxRuntime.jsxs(material.Box,{sx:{flex:1,minHeight:0,display:"flex",position:"relative"},children:[X&&n&&le==="landscape"?jsxRuntime.jsx(material.Box,{sx:{p:1.5,pr:0,flexShrink:0},children:j}):null,!X||n&&le==="portrait"?jsxRuntime.jsx(material.Drawer,{open:ot,onClose:()=>Fe(false),PaperProps:{sx:{width:"min(88vw, 360px)",p:1.25,bgcolor:"transparent",boxShadow:"none"}},children:j}):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&&a.length>0?jsxRuntime.jsx($m,{items:a,selectedId:r,orientation:le,onItemSelect:y}):null,jsxRuntime.jsx(material.Paper,{elevation:0,sx:{flex:1,minHeight:le==="portrait"?420:560,p:{xs:1.25,md:1.5},borderRadius:5,border:"1px solid",borderColor:"divider",bgcolor:qe.palette.mode==="dark"?"rgba(15,23,42,0.72)":"rgba(255,255,255,0.72)",backdropFilter:"blur(12px)",color:"text.primary"},children:t})]})})]}),le==="portrait"&&g?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsx(material.Box,{sx:{p:1.5},children:g})]}):null]})})})};var lg=cS__default.default(()=>Promise.resolve().then(()=>(ig(),ng)).then(e=>e.COrbCanvas),{ssr:false,loading:()=>jsxRuntime.jsx("div",{className:"h-full w-full bg-transparent"})});function od({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(lg,{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(lg,{hue:10,hoverIntensity:.8,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})})]})})})}var XF=od;function rs({onTextUpdate:e,onComplete:t,onError:o,wsUrl:a="ws://localhost:8765",silenceThresholdMs:r=2e3,minVolumeRms:n=.015}){let[i,c]=vt.useState(false),d=vt.useRef(null),s=vt.useRef(null),l=vt.useRef(null),g=vt.useRef(null),f=vt.useRef(null),u=vt.useRef(0),h=vt.useRef(false),w=vt.useRef(false),p=vt.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),s.current&&(s.current.getTracks().forEach(y=>y.stop()),s.current=null),l.current&&(l.current.close(),l.current=null),w.current=false,c(false);},[]),C=vt.useCallback(()=>{h.current||(h.current=true,d.current?.readyState===WebSocket.OPEN&&d.current.send(JSON.stringify({type:"stop"})),setTimeout(p,500));},[p]),m=vt.useCallback(async()=>{if(!(i||w.current)){w.current=true,h.current=false,u.current=Date.now();try{let y=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,sampleRate:16e3,echoCancellation:!0,noiseSuppression:!0}});s.current=y;let b=new WebSocket(a);d.current=b,b.onopen=()=>{c(!0),w.current=!1;},b.onmessage=A=>{try{let P=JSON.parse(A.data);if(P.type==="recognition")P.is_final?t(P.text):e?.(P.text);else if(P.type==="error"){let v=P.message||"Voice recognition error";o?.(v),C();}}catch{o?.("Failed to parse voice message");}},b.onerror=()=>{o?.("Voice service connection failed"),p();},b.onclose=()=>{p();};let T=window.AudioContext||window.webkitAudioContext;if(!T)throw new Error("AudioContext is not supported in this browser");let B=new T({sampleRate:16e3});l.current=B;let R=B.createMediaStreamSource(y);f.current=R;let k=B.createScriptProcessor(4096,1,1);g.current=k,k.onaudioprocess=A=>{if(d.current?.readyState!==WebSocket.OPEN)return;let P=A.inputBuffer.getChannelData(0),v=0;for(let I=0;I<P.length;I+=1)v+=P[I]*P[I];if(Math.sqrt(v/P.length)>n)u.current=Date.now();else if(Date.now()-u.current>r&&!h.current){C();return}let S=new Int16Array(P.length);for(let I=0;I<P.length;I+=1){let D=Math.max(-1,Math.min(1,P[I]));S[I]=D<0?D*32768:D*32767;}d.current.send(S.buffer);},R.connect(k),k.connect(B.destination);}catch{o?.("Cannot access microphone"),p();}}},[p,i,n,t,o,e,r,C,a]);return vt.useEffect(()=>p,[p]),{isRecording:i,startRecording:m,stopRecording:C}}var cg=vt.createContext(null);function xS(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 vS({children:e,onVoiceSubmit:t,onVoicePartial:o,onVoiceError:a,longPressMs:r=200,disableSpaceTrigger:n=false,ignoreWhenFocusedInput:i=true,renderOverlay:c=true,wsUrl:d,silenceThresholdMs:s,minVolumeRms:l}){let[g,f]=vt.useState(false),[u,h]=vt.useState(false),w=vt.useRef(null),p=vt.useRef(false),C=vt.useRef(false),m=vt.useCallback(()=>{C.current=false,f(false);},[]),{isRecording:y,startRecording:b,stopRecording:T}=rs({wsUrl:d,silenceThresholdMs:s,minVolumeRms:l,onTextUpdate:A=>{o?.(A);},onComplete:async A=>{try{A.trim()&&(h(!0),await t(A.trim()));}catch(P){let v=P instanceof Error?P.message:"Failed to process voice command";a?.(v);}finally{h(!1),m();}},onError:A=>{a?.(A),h(!1),p.current||m();}}),B=vt.useCallback(async()=>{C.current=false,await b();},[b]),R=vt.useCallback(()=>{T();},[T]);vt.useEffect(()=>{if(n)return;let A=v=>{v.isComposing||(v.code==="Space"||v.key===" ")&&(p.current||v.repeat||i&&xS(document.activeElement)||(p.current=true,v.preventDefault(),w.current=setTimeout(()=>{C.current=true,f(true),b();},r)));},P=v=>{(v.code==="Space"||v.key===" ")&&(w.current&&(clearTimeout(w.current),w.current=null),p.current=false,C.current&&(v.preventDefault(),f(false),T()));};return window.addEventListener("keydown",A),window.addEventListener("keyup",P),()=>{window.removeEventListener("keydown",A),window.removeEventListener("keyup",P),w.current&&(clearTimeout(w.current),w.current=null);}},[n,i,r,b,T]);let k=vt.useMemo(()=>({isRecording:y,isHotkeyRecording:g,isSubmitting:u,startRecording:B,stopRecording:R}),[g,y,u,B,R]);return jsxRuntime.jsxs(cg.Provider,{value:k,children:[c?jsxRuntime.jsx(od,{isRecording:g}):null,e]})}function CS(){let e=vt.useContext(cg);if(!e)throw new Error("useAINav must be used within CAINavProvider");return e}var rL=vS,nL=CS;function He(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var RS=({content:e,theme:t="light",size:o="base",defaultExpanded:a=false})=>{let[r,n]=vt.useState(a),i=vt.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(!r),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 ${r?"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"})})]}),r&&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})]})},dg=RS;var zS=({content:e,language:t="text",isStreaming:o=false,className:a=""})=>{let{theme:r}=nextThemes.useTheme(),[n,i]=vt.useState(false),c=async()=>{try{await navigator.clipboard.writeText(e),i(!0),setTimeout(()=>i(!1),2e3);}catch(s){console.error("\u590D\u5236\u5931\u8D25:",s);}},d=r==="dark"?prism.oneDark:prism.oneLight;return jsxRuntime.jsxs("div",{className:He("rounded-lg overflow-hidden border border-gray-200 dark:border-gray-700 my-4",a),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:r==="dark"?"#1f2937":"#ffffff"},wrapLongLines:true,children:e})})]})},ug=zS;var HS=({content:e,isLoading:t,className:o="",style:a})=>{let r=vt.useRef(null),[n,i]=vt.useState(false),[c,d]=vt.useState(null),{theme:s}=nextThemes.useTheme();return vt.useEffect(()=>{let l=async()=>{if(!(!e.trim()||!r.current)){i(true),d(null);try{gg__default.default.initialize({startOnLoad:!1,theme:s==="dark"?"dark":"default",securityLevel:"loose",fontFamily:"inherit"});let f=`mermaid-${Math.random().toString(36).substr(2,9)}`,u=e.replace(/```mermaid\n?|\n?```/g,"").trim(),{svg:h}=await gg__default.default.render(f,u);r.current&&(r.current.innerHTML=h);}catch(f){console.error("Mermaid render failed:",f),d(f instanceof Error?f.message:"Render failed"),r.current&&(r.current.innerText=e);}finally{i(false);}}},g=setTimeout(()=>{l();},100);return ()=>clearTimeout(g)},[e,s]),t||n?jsxRuntime.jsx("div",{className:`mermaid-block loading ${o}`,style:a,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:a,ref:r})},hg=HS;var qS=({title:e="\u53D1\u751F\u9519\u8BEF",content:t,errorCode:o,stack:a,icon:r,closable:n=true,onClose:i,onRetry:c,className:d="",...s})=>{let[l,g]=vt.useState(false),[f,u]=vt.useState(false),h=async()=>{if(c){u(true);try{await c();}catch(w){console.error("\u91CD\u8BD5\u5931\u8D25:",w);}finally{u(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}`,...s,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:r||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||a)&&jsxRuntime.jsxs("div",{className:"flex items-center space-x-4 mt-2",children:[c&&jsxRuntime.jsxs("button",{onClick:h,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"]}),a&&jsxRuntime.jsxs("button",{onClick:()=>g(!l),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:[l?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"}),l?"\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"})})]}),a&&l&&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:a})})]})},ns=qS;var QS=({title:e="\u8B66\u544A",content:t,warningType:o,severity:a="warning",warnings:r=[],icon:n,closable:i=true,onClose:c,onConfirm:d,actionText:s,className:l="",...g})=>{let f=()=>{switch(a){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"}}},u=()=>{switch(a){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"})}},h=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 ${l}`,...g,children:[jsxRuntime.jsxs("div",{className:`flex p-4 border-l-4 ${h.borderLeftColor} ${h.bgColor}`,children:[jsxRuntime.jsx("div",{className:`flex-shrink-0 mr-3 ${h.iconColor}`,children:n||u()}),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}),r&&r.length>0&&jsxRuntime.jsx("ul",{className:"mt-2 space-y-1",children:r.map((w,p)=>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:w})]},p))})]}),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:s||"\u786E\u8BA4"})})]})},is=QS;var ow=({title:e="\u76F8\u5173\u63A8\u8350",content:t,suggestions:o,onSuggestionClick:a,maxDisplay:r=5,icon:n,closable:i=false,onClose:c,className:d="",...s})=>{let[l,g]=vt.useState(false),[f,u]=vt.useState(""),[h,w]=vt.useState(false),p=vt.useMemo(()=>f.trim()?o.filter(y=>y.toLowerCase().includes(f.toLowerCase())):o,[o,f]),C=vt.useMemo(()=>l?p:p.slice(0,r),[p,l,r]),m=y=>{a?.(y);};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}`,...s,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:()=>w(!h),className:`p-1.5 rounded-md transition-colors ${h?"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:h?"\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"})})]})]}),h&&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:y=>u(y.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((y,b)=>jsxRuntime.jsx("li",{children:jsxRuntime.jsxs("button",{onClick:()=>m(y),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:y}),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"})]})},b))}),p.length>r&&jsxRuntime.jsx("button",{onClick:()=>g(!l),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:l?"\u6536\u8D77":`\u67E5\u770B\u5168\u90E8 (${p.length})`}),p.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"})]})]})},ls=ow;var cw=({title:e,content:t,toolName:o,parameters:a,result:r,status:n,duration:i,icon:c,closable:d=false,onClose:s,onAction:l,actionText:g,className:f="",...u})=>{let[h,w]=vt.useState(false),[p,C]=vt.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"}}},y=()=>{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"})}},b=R=>R?R<1e3?`${R}ms`:`${(R/1e3).toFixed(2)}s`:"",T=m(),B=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}`,...u,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 ${T.iconColor}`,children:c||y()}),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:B}),jsxRuntime.jsx("span",{className:`text-[10px] font-medium px-1.5 py-0.5 rounded ${T.badgeBg} ${T.badgeText}`,children:T.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"}),b(i)]}),d&&s&&jsxRuntime.jsx("button",{onClick:s,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}),a&&jsxRuntime.jsxs("div",{className:"mb-3",children:[jsxRuntime.jsxs("button",{onClick:()=>w(!h),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:[h?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"]}),h&&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(a,null,2)})})]}),r&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("button",{onClick:()=>C(!p),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:[p?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"]}),p&&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 r=="string"?r:JSON.stringify(r,null,2)})})]}),l&&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:l,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"})})]})]})},ss=cw;var pw=({data:e})=>{if(!e)return null;let t=vt.useMemo(()=>{let o=[],a=[],r="\u6570\u636E\u8868\u683C";return Array.isArray(e)?(o=e,o.length>0&&(a=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"&&(r=e.title||r,o=Array.isArray(e.rows)?e.rows:Array.isArray(e.data)?e.data:[],Array.isArray(e.columns)?a=e.columns.map(i=>({id:i.key||i.id,label:i.title||i.label,numeric:i.dataType==="number"||i.numeric})):o.length>0&&(a=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:r,columns:a,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($a,{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]})})},cs=pw;var vw=({title:e,subtitle:t,data:o,type:a,config:r={}})=>{let n=()=>{switch(a){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&&a!=="google-map-card"&&a!=="amap-card")return jsxRuntime.jsx("div",{className:"text-gray-500 text-sm p-4 text-center",children:"No data available"});try{switch(a){case "bar-chart-card":return jsxRuntime.jsx(Hn,{data:o,orientation:r.orientation||"horizontal",valueSuffix:r.valueSuffix||"",minHeight:r.minHeight});case "line-chart-card":return jsxRuntime.jsx(cp,{data:o,color:r.color,valueSuffix:r.valueSuffix||"",height:r.height});case "pie-chart-card":let c=o.reduce((s,l)=>s+(Number(l.value)||0),0),d=o.map(s=>({name:s.name,value:Number(s.value)||0,percent:typeof s.percent=="number"?s.percent:c>0?(Number(s.value)||0)/c*100:0}));return jsxRuntime.jsx(qi,{data:d,variant:r.variant||"donut",size:r.size,colors:r.colors});case "combo-chart-card":return jsxRuntime.jsx(dp,{data:o,barColor:r.barColor,lineColor:r.lineColor});case "heatmap-chart-card":return jsxRuntime.jsx(up,{data:o});case "fishbone-chart-card":return jsxRuntime.jsx(gp,{branches:o,effect:r.effect||e||"Problem"});case "waterfall-chart-card":return jsxRuntime.jsx(hp,{data:o,height:r.height});case "google-map-card":return jsxRuntime.jsx(xp,{embedUrl:r.embedUrl||o&&o[0]?.embedUrl,apiKey:r.apiKey,query:r.query||o&&o[0]?.query||e,height:r.height});case "amap-card":return jsxRuntime.jsx(Sp,{embedUrl:r.embedUrl||o&&o[0]?.embedUrl,keyword:r.keyword||o&&o[0]?.keyword||e,height:r.height});default:return jsxRuntime.jsxs("div",{className:"text-gray-500 text-sm p-4 text-center",children:["Unsupported chart type: ",a]})}}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)})]})})]})]})},ds=vw;var kw=({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)})})})]}),us=kw;var ms=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 Rw=({content:e,theme:t,size:o="base",className:a,enableCodeHighlight:r=true,enableMermaid:n=true,messageId:i,cardHooks:c})=>{let d=vt.useMemo(()=>e?e.replace(/<think>([\s\S]*?)<\/think>/g,(f,u)=>`<div data-component="thinkbox" data-think-content="${encodeURIComponent(u.trim())}"></div>`):"",[e]),s=(f,u,h,w,p)=>{c?.onCardEvent?.({messageId:i,cardType:f,action:u,title:h,payload:w,rawData:p});},l=(f,u,h,w,p,C)=>{if(!(!p&&!c?.onCardEvent))return (...m)=>{let y=p?.(...m),b=C?C(...m):void 0;return s(f,u,h,b,w),y}},g=vt.useMemo(()=>({div(f){let{"data-component":u,"data-think-content":h,...w}=f;return u==="thinkbox"&&h?jsxRuntime.jsx(dg,{content:decodeURIComponent(h),theme:t,size:o,defaultExpanded:false}):jsxRuntime.jsx("div",{...w})},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:u}){return jsxRuntime.jsx("th",{className:`px-3 py-2 font-semibold text-gray-800 dark:text-gray-100 ${u==="center"?"text-center":u==="right"?"text-right":"text-left"}`,children:f})},td({children:f,align:u}){return jsxRuntime.jsx("td",{className:`px-3 py-2 text-gray-700 dark:text-gray-200 align-top ${u==="center"?"text-center":u==="right"?"text-right":"text-left"}`,children:f})},code({inline:f,className:u,children:h,...w}){let p=/language-([\w-]+)/.exec(u||""),C=p?p[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",...w,children:h});let m=String(h).replace(/\n$/,"");if(n&&C==="mermaid")return jsxRuntime.jsx(hg,{content:m});if(C==="json"){let y=ms(m);if(y)switch(y.type){case "table":return jsxRuntime.jsx(cs,{data:y.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(ds,{...y});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return jsxRuntime.jsx(us,{...y});case "error-card":{let b=y;return jsxRuntime.jsx(ns,{...b,onClose:l("error-card","close",b.title,b,b.onClose),onRetry:l("error-card","retry",b.title,b,b.onRetry)})}case "warning-card":{let b=y,T=b.onConfirm?l("warning-card","confirm",b.title,b,b.onConfirm):b.actionText&&c?.onCardEvent?l("warning-card","confirm",b.title,b):void 0;return jsxRuntime.jsx(is,{...b,onClose:l("warning-card","close",b.title,b,b.onClose),onConfirm:T})}case "suggestions-card":{let b=y;return jsxRuntime.jsx(ls,{...b,onClose:l("suggestions-card","close",b.title,b,b.onClose),onSuggestionClick:l("suggestions-card","suggestion-click",b.title,b,b.onSuggestionClick,T=>({suggestion:T}))})}case "tool-result-card":{let b=y;return jsxRuntime.jsx(ss,{...b,onClose:l("tool-result-card","close",b.title,b,b.onClose),onAction:l("tool-result-card","action",b.title,b,b.onAction)})}}}return r?jsxRuntime.jsx(ug,{content:m,language:C,className:"not-prose"}):jsxRuntime.jsx("code",{className:u,...w,children:h})}}),[t,o,n,r,c,i]);return jsxRuntime.jsx("div",{className:He("markdown-body prose dark:prose-invert max-w-none",a),children:jsxRuntime.jsx(Sw__default.default,{remarkPlugins:[ww__default.default,Tw__default.default],rehypePlugins:[Iw__default.default,Pw__default.default],components:g,children:d})})},gs=Rw;var Dw=({content:e,messageId:t,cardHooks:o})=>{let a=(i,c,d,s,l)=>{o?.onCardEvent?.({messageId:t,cardType:i,action:c,title:d,payload:s,rawData:l});},r=(i,c,d,s,l,g)=>{if(!(!l&&!o?.onCardEvent))return (...f)=>{let u=l?.(...f),h=g?g(...f):void 0;return a(i,c,d,h,s),u}},n=ms(e);if(n)switch(n.type){case "table":return jsxRuntime.jsx(cs,{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(ds,{...n});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return jsxRuntime.jsx(us,{...n});case "error-card":{let i=n;return jsxRuntime.jsx(ns,{...i,onClose:r("error-card","close",i.title,i,i.onClose),onRetry:r("error-card","retry",i.title,i,i.onRetry)})}case "warning-card":{let i=n,c=i.onConfirm?r("warning-card","confirm",i.title,i,i.onConfirm):i.actionText&&o?.onCardEvent?r("warning-card","confirm",i.title,i):void 0;return jsxRuntime.jsx(is,{...i,onClose:r("warning-card","close",i.title,i,i.onClose),onConfirm:c})}case "suggestions-card":{let i=n;return jsxRuntime.jsx(ls,{...i,onClose:r("suggestions-card","close",i.title,i,i.onClose),onSuggestionClick:r("suggestions-card","suggestion-click",i.title,i,i.onSuggestionClick,c=>({suggestion:c}))})}case "tool-result-card":{let i=n;return jsxRuntime.jsx(ss,{...i,onClose:r("tool-result-card","close",i.title,i,i.onClose),onAction:r("tool-result-card","action",i.title,i,i.onAction)})}}return jsxRuntime.jsx("div",{className:"dynamic-card-fallback",children:jsxRuntime.jsx(gs,{content:e,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:t,cardHooks:o})})},Ig=Dw;var pd=class{static analyze(t){if(!t.trim())return {blocks:[],hasComplexContent:false,overallType:"simple"};let a=/```json\s*\{\s*"type":\s*"[^"]+"/g.test(t),r=/<[^>]+>[\s\S]*?<\/[^>]+>/.test(t),n=t.includes("NQ#")||t.includes("data-component");return a||r||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"}}},Aw=({content:e,className:t="",messageId:o,cardHooks:a})=>{let r=vt__namespace.default.useMemo(()=>pd.analyze(e),[e]);return jsxRuntime.jsx("div",{className:`universal-content-renderer ${t}`,children:r.blocks.map((n,i)=>n.type==="mixed"||n.type==="json-card"?jsxRuntime.jsx(Ig,{content:n.content,messageId:o,cardHooks:a},`block-${i}`):jsxRuntime.jsx(gs,{content:n.content,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:o,cardHooks:a},`block-${i}`))})},Pg=Aw;var Bw=({content:e,isStreaming:t=true,onComplete:o,className:a="",streamIntervalMs:r=24,streamChunkSize:n=3,messageId:i,cardHooks:c})=>{let[d,s]=vt.useState(t?0:e.length),[l,g]=vt.useState(!t);vt.useEffect(()=>{if(t){s(0),g(false);return}s(e.length),g(true);},[e,t]),vt.useEffect(()=>{if(!t||l)return;if(d>=e.length){g(true),o?.();return}let p=window.setTimeout(()=>{s(C=>Math.min(C+n,e.length));},r);return ()=>{window.clearTimeout(p);}},[e.length,l,t,o,n,r,d]);let f=()=>{t&&!l&&(s(e.length),g(true),o?.());},u=t?e.slice(0,d):e,h=t&&!l,w=t&&!l;return jsxRuntime.jsxs("div",{className:`streaming-markdown ${a}`,onClick:f,style:{cursor:t?"pointer":"default"},children:[jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx(Pg,{content:u,messageId:i,cardHooks:c}),h&&jsxRuntime.jsx("span",{className:"inline-block w-0.5 h-5 bg-blue-500 ml-1 animate-pulse",style:{verticalAlign:"text-bottom"}})]}),w&&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"})]})},Ag=Bw;var Bg=({buttons:e,className:t})=>{let o=a=>{switch(a){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:He("flex items-center gap-1",t),children:e.map((a,r)=>jsxRuntime.jsx("button",{onClick:a.onClick,disabled:a.disabled,className:He("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",a.active&&"text-blue-600 bg-blue-50 dark:text-blue-400 dark:bg-blue-900/20",a.type==="refresh"&&a.disabled&&"animate-spin"),title:a.type,type:"button",children:o(a.type)},`${a.type}-${r}`))})};var fs=({message:e,onStreamingComplete:t,assistantActions:o,streamIntervalMs:a,streamChunkSize:r,cardHooks:n})=>e.type==="assistant"?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(Ag,{content:e.content,isStreaming:e.isStreaming??false,onComplete:t,streamIntervalMs:a,streamChunkSize:r,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(Bg,{buttons:[{type:"refresh",onClick:()=>o?.onRegenerate?.(),disabled:!o?.onRegenerate},{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()})]})}):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 Fg=({onTextUpdate:e,onComplete:t,onCancel:o,disabled:a,className:r})=>{let{isRecording:n,startRecording:i,stopRecording:c}=rs({onTextUpdate:e,onComplete:s=>{t?.(s);},onError:s=>{console.error("Voice input error:",s),o?.();}});return jsxRuntime.jsx("button",{onClick:async()=>{n?c():await i();},disabled:a,className:He("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",a&&"opacity-50 cursor-not-allowed",r),title:n?"Stop recording":"Start recording",type:"button",children:n?jsxRuntime.jsx(Ow__default.default,{sx:{fontSize:24}}):jsxRuntime.jsx(Vw__default.default,{sx:{fontSize:24}})})};var Ct={container:"w-full max-w-4xl mx-auto",inputContainer:He("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:He("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:He("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:He("bg-transparent hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-500 dark:text-gray-400","cursor-pointer active:scale-95"),sendButton:He("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:He("cursor-not-allowed opacity-40 bg-transparent text-gray-400"),stopButton:He("cursor-pointer bg-red-500 hover:bg-red-600 text-white shadow-sm active:scale-95")},_w={padding:0,lineHeight:"1.5",border:"none !important",boxShadow:"none !important",backgroundColor:"transparent",height:"auto",fontFeatureSettings:'"liga" 1, "kern" 1',WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},jw=({enabled:e,onClick:t})=>jsxRuntime.jsx("button",{className:He(Ct.buttonBase,Ct.buttonSmall,Ct.buttonNormal),onClick:t,disabled:!e,"aria-label":"Upload file",type:"button",children:jsxRuntime.jsx(Kw__default.default,{sx:{fontSize:24}})}),Zw=()=>jsxRuntime.jsxs("button",{className:He(Ct.buttonBase,"h-10 px-3 py-2 gap-1.5 rounded-full",Ct.buttonNormal),"aria-label":"Tools",type:"button",children:[jsxRuntime.jsx(qw__default.default,{sx:{fontSize:20}}),jsxRuntime.jsx("span",{className:"text-sm font-medium",children:"Tools"})]}),Xw=({canSend:e,isResponding:t,onSend:o,onStop:a})=>t?jsxRuntime.jsx("button",{className:He(Ct.buttonBase,Ct.buttonSmall,Ct.stopButton),onClick:a,"aria-label":"Stop generating",type:"button",children:jsxRuntime.jsx(iconsMaterial.Stop,{sx:{fontSize:20}})}):jsxRuntime.jsx("button",{className:He(Ct.buttonBase,Ct.buttonSmall,e?Ct.sendButton:Ct.sendButtonDisabled),onClick:o,disabled:!e,"aria-label":"Send message",type:"button",children:jsxRuntime.jsx(Uw__default.default,{sx:{fontSize:24},className:e?"text-gray-500 dark:text-gray-400":"text-gray-300 dark:text-gray-600"})}),Lg=({onSend:e,onStop:t,isResponding:o=false,placeholder:a,getText:r})=>{let[n,i]=vt.useState(""),[c,d]=vt.useState([]),[s,l]=vt.useState(false),[g,f]=vt.useState(false),u=vt.useRef(null),h=a||(r?r("00019","Type a message..."):"Type a message..."),w=(n.trim().length>0||c.length>0)&&!o,p={enabled:true},C=vt.useCallback(D=>{i(D.target.value),D.target.style.height="auto",D.target.style.height=`${Math.min(D.target.scrollHeight,200)}px`;},[]),m=vt.useCallback(D=>{if(D.target.files&&D.target.files.length>0){let G=Array.from(D.target.files);d(V=>{let X=G.filter(oe=>V.some(re=>re.name===oe.name&&re.size===oe.size));X.length>0&&console.warn("Duplicate files ignored:",X.map(oe=>oe.name));let de=G.filter(oe=>!V.some(re=>re.name===oe.name&&re.size===oe.size));return [...V,...de]}),u.current&&(u.current.value="");}},[]),y=vt.useCallback(D=>{d(G=>G.filter((V,X)=>X!==D));},[]),b=vt.useCallback(()=>{u.current?.click();},[]),T=vt.useCallback(async()=>{if(!w)return;let D=n,G=[...c];i(""),d([]),u.current&&(u.current.value="");try{await e(D,G);}catch(V){console.error("Failed to send message:",V),i(D),d(G);}},[n,w,e,c]),B=vt.useCallback(D=>{D.key==="Enter"&&!D.shiftKey&&!s&&(D.preventDefault(),T());},[T,s]),R=vt.useCallback(()=>{l(true);},[]),k=vt.useCallback(()=>{l(false);},[]),A=vt.useCallback(D=>{i(D);},[]),P=vt.useCallback(D=>{i(D);},[]),v=vt.useCallback(()=>{},[]),M=vt.useCallback(D=>{D.preventDefault(),f(true);},[]),S=vt.useCallback(D=>{D.preventDefault(),f(false);},[]),I=vt.useCallback(D=>{if(D.preventDefault(),f(false),D.dataTransfer.files&&D.dataTransfer.files.length>0){let G=Array.from(D.dataTransfer.files);d(V=>[...V,...G]);}},[]);return jsxRuntime.jsx("div",{className:Ct.container,children:jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("input",{type:"file",multiple:true,className:"hidden",ref:u,onChange:m}),jsxRuntime.jsxs("div",{className:He(Ct.inputContainer,g&&Ct.dragActive),style:{borderRadius:"32px"},onDragOver:M,onDragLeave:S,onDrop:I,children:[c.length>0&&jsxRuntime.jsx("div",{className:Ct.filePreviewArea,children:c.map((D,G)=>jsxRuntime.jsxs("div",{className:Ct.fileTag,children:[jsxRuntime.jsx(iconsMaterial.InsertDriveFile,{sx:{fontSize:16},className:"text-blue-500"}),jsxRuntime.jsx("span",{className:"truncate max-w-[150px]",children:D.name}),jsxRuntime.jsx("button",{onClick:()=>y(G),className:"ml-1 hover:text-red-500 focus:outline-none",type:"button",children:jsxRuntime.jsx(iconsMaterial.Close,{sx:{fontSize:16}})})]},`${D.name}-${G}`))}),jsxRuntime.jsxs("div",{className:"flex flex-col w-full p-2",children:[jsxRuntime.jsx("div",{className:He(Ct.textareaWrapper,"px-3 pt-2 pb-3 min-h-[60px]"),children:jsxRuntime.jsx("textarea",{className:He(Ct.textarea,"min-h-[24px] py-0 px-0"),placeholder:h,value:n,onChange:C,onKeyDown:B,onCompositionStart:R,onCompositionEnd:k,style:_w,"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(jw,{enabled:p.enabled,onClick:b}),jsxRuntime.jsx(Zw,{})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Fg,{onTextUpdate:A,onComplete:P,onCancel:v,disabled:o,className:Ct.buttonSmall}),jsxRuntime.jsx(Xw,{canSend:w,isResponding:o,onSend:T,onStop:t})]})]})]})]})]})})};var Vg=({messages:e,onSend:t,onStop:o,onRegenerate:a,isResponding:r=false,className:n,placeholder:i,streamIntervalMs:c,streamChunkSize:d,onMessageStreamingComplete:s,cardHooks:l,showInput:g=true})=>{let f=vt.useRef(null),u=vt.useRef(e.length);return vt.useEffect(()=>{e.length>u.current&&f.current?.scrollIntoView({behavior:"smooth"}),u.current=e.length;},[e]),jsxRuntime.jsxs("div",{className:He("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((h,w)=>{let p=h.type==="assistant"&&w===e.length-1,C=h.type==="assistant"?{isLatestAssistant:p,onRegenerate:a?()=>a(h.id):void 0}:void 0;return jsxRuntime.jsx(fs,{message:h,assistantActions:C,onStreamingComplete:()=>s?.(h.id),streamIntervalMs:c,streamChunkSize:d,cardHooks:l},h.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(Lg,{onSend:t||(async()=>{}),onStop:o||(()=>{}),isResponding:r,placeholder:i})})]})};var yo={};var Jw={idle:"Idle",running:"Running",success:"Success",error:"Error",pending:"Pending"},MN=({title:e="AI Agent",description:t,headerActions:o,className:a,agentStatus:r,showInput:n=false,...i})=>{let c=r??(i.isResponding?"running":"idle");return jsxRuntime.jsxs("div",{className:He("relative flex h-full w-full",yo.agentPanel,a),"data-status":c,children:[jsxRuntime.jsx("div",{className:yo.colorHalo,"data-status":c,"aria-hidden":"true"}),jsxRuntime.jsxs("div",{className:yo.marqueeBorder,"data-status":c,"aria-hidden":"true",children:[jsxRuntime.jsx("span",{className:He(yo.edge,yo.top)}),jsxRuntime.jsx("span",{className:He(yo.edge,yo.right)}),jsxRuntime.jsx("span",{className:He(yo.edge,yo.bottom)}),jsxRuntime.jsx("span",{className:He(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:"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",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":c}),jsxRuntime.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-gray-600 dark:text-gray-300",children:Jw[c]})]}),o]})]}),jsxRuntime.jsx("div",{className:"flex-1 min-h-0 relative z-10",children:jsxRuntime.jsx(Vg,{...i,showInput:n})})]})]})};var r1={"top-left":"bottom-right","top-right":"bottom-left","bottom-left":"top-right","bottom-right":"top-left"},VN=({messages:e,onSend:t,onRegenerate:o,isResponding:a=false,className:r,placeholder:n,title:i="Copilot",corner:c="bottom-right",onCollapse:d,onHeaderPointerDown:s,onPlusClick:l,onMicClick:g,streamIntervalMs:f,streamChunkSize:u,onMessageStreamingComplete:h,cardHooks:w})=>{let[p,C]=vt.useState(""),[m,y]=vt.useState(false),b=vt.useRef(null),T=r1[c];vt.useEffect(()=>{b.current?.scrollIntoView({behavior:"smooth"});},[e,a]);let B=vt.useCallback(async()=>{let k=p.trim();!k||a||(C(""),await t(k));},[a,t,p]),R=vt.useCallback(async k=>{k.key==="Enter"&&!m&&(k.preventDefault(),await B());},[B,m]);return jsxRuntime.jsxs("div",{className:He("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",r),children:[d&&jsxRuntime.jsx("button",{onClick:d,className:He("absolute z-20 flex h-10 w-10 items-center justify-center rounded-full transition-colors hover:bg-transparent dark:hover:bg-transparent",T==="top-left"&&"-left-2 -top-2",T==="top-right"&&"-right-2 -top-2",T==="bottom-left"&&"-bottom-2 -left-2",T==="bottom-right"&&"-bottom-2 -right-2"),type:"button","aria-label":"Collapse Copilot",children:jsxRuntime.jsx("span",{className:He("block h-4 w-4 border-[#21BCFF]",T==="top-left"&&"rounded-tl-full border-l-[3px] border-t-[3px]",T==="top-right"&&"rounded-tr-full border-r-[3px] border-t-[3px]",T==="bottom-left"&&"rounded-bl-full border-b-[3px] border-l-[3px]",T==="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:s,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((k,A)=>{let P=k.type==="assistant"&&A===e.length-1,v=k.type==="assistant"?{isLatestAssistant:P,onRegenerate:o?()=>o(k.id):void 0}:void 0;return jsxRuntime.jsx(fs,{message:k,assistantActions:v,onStreamingComplete:()=>h?.(k.id),streamIntervalMs:f,streamChunkSize:u,cardHooks:w},k.id)}),jsxRuntime.jsx("div",{ref:b})]}),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:l,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:p,onChange:k=>C(k.target.value),onCompositionStart:()=>y(true),onCompositionEnd:()=>y(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 $N=({defaultMode:e="login",onLogin:t,onRegister:o,onForgotPassword:a}={})=>{let[r,n]=vt.useState(e),[i,c]=vt.useState(false),d=vt.useCallback(async u=>{c(true);try{await u?.();}finally{c(false);}},[]),s=vt.useCallback(u=>d(()=>t?.(u)),[t,d]),l=vt.useCallback(u=>d(()=>o?.(u)),[o,d]),g=vt.useCallback(u=>d(()=>a?.(u)),[a,d]),f=vt.useMemo(()=>({mode:r,loading:i,onModeChange:n,onLogin:s,onRegister:l,onForgotPassword:g}),[g,s,l,i,r]);return {mode:r,loading:i,setMode:n,authPageProps:f}};var gd=({label:e,...t})=>jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{...t}),label:e});var Ii=vt.forwardRef((e,t)=>jsxRuntime.jsx(material.Paper,{ref:t,...e,elevation:e.elevation||1,sx:{p:2,mb:2,...e.sx}}));Ii.displayName="CPaper";var y1={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."},sV=({mode:e,defaultMode:t="login",onModeChange:o,onLogin:a,onRegister:r,onForgotPassword:n,loading:i=false,logo:c,copy:d,sx:s})=>{let l=material.useTheme(),g=e!==void 0,[f,u]=vt.useState(t),h=e??f,w=vt.useMemo(()=>({...y1,...d}),[d]),[p,C]=vt.useState({username:"demo@orbcafe.local",password:"orbcafe-demo",remember:true}),[m,y]=vt.useState({name:"",email:"",password:"",confirmPassword:"",acceptedTerms:false}),[b,T]=vt.useState({email:""}),[B,R]=vt.useState(""),k=I=>{g||u(I),R(""),o?.(I);},A=async I=>{I.preventDefault(),await a?.(p),R("Demo login accepted. No real authentication request was sent.");},P=async I=>{I.preventDefault(),await r?.(m),R("Demo registration saved locally for this screen.");},v=async I=>{I.preventDefault(),await n?.(b),R("Demo reset link request created. No email was sent.");},M=h==="login"?w.loginTitle:h==="register"?w.registerTitle:w.forgotTitle,S=h==="login"?w.loginSubtitle:h==="register"?w.registerSubtitle:w.forgotSubtitle;return jsxRuntime.jsxs(material.Box,{sx:{minHeight:"100vh",display:"grid",gridTemplateColumns:{xs:"1fr",md:"minmax(320px, 0.9fr) minmax(420px, 1.1fr)"},background:l.palette.mode==="dark"?"linear-gradient(135deg, #071018 0%, #151515 48%, #101827 100%)":"linear-gradient(135deg, #eef3f8 0%, #ffffff 52%, #e8f2f0 100%)",...s},children:[jsxRuntime.jsxs(material.Box,{sx:{display:{xs:"none",md:"flex"},flexDirection:"column",justifyContent:"space-between",p:{md:6,lg:8},borderRight:`1px solid ${l.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:w.productName}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:{md:34,lg:42},lineHeight:1.06,fontWeight:800},children:w.headline}),jsxRuntime.jsx(material.Typography,{sx:{maxWidth:460,color:"text.secondary",fontSize:16,lineHeight:1.7},children:w.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(Ii,{elevation:0,sx:{width:"100%",maxWidth:460,m:0,p:{xs:2.5,sm:4},borderRadius:3,border:`1px solid ${l.palette.divider}`,backgroundColor:l.palette.mode==="dark"?"rgba(15, 23, 42, 0.86)":"rgba(255, 255, 255, 0.88)",backdropFilter:"blur(18px)",boxShadow:l.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:M}),jsxRuntime.jsx(material.Typography,{sx:{color:"text.secondary"},children:S})]}),B&&jsxRuntime.jsx(material.Alert,{severity:"success",children:B}),h==="login"&&jsxRuntime.jsx(material.Box,{component:"form",onSubmit:A,children:jsxRuntime.jsxs(material.Stack,{spacing:2,children:[jsxRuntime.jsx(_t,{label:"Email or user ID",value:p.username,onChange:I=>C(D=>({...D,username:I.target.value})),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(Ug__default.default,{fontSize:"small"})})}}),jsxRuntime.jsx(_t,{label:"Password",type:"password",value:p.password,onChange:I=>C(D=>({...D,password:I.target.value})),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(f1__default.default,{fontSize:"small"})})}}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:2},children:[jsxRuntime.jsx(gd,{label:"Remember me",checked:p.remember,onChange:I=>C(D=>({...D,remember:I.target.checked}))}),jsxRuntime.jsx(Bo,{type:"button",variant:"text",size:"small",onClick:()=>k("forgot"),children:"Forgot?"})]}),jsxRuntime.jsx(Bo,{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(Bo,{type:"button",variant:"text",size:"small",onClick:()=>k("register"),sx:{minWidth:0,p:0},children:"Register"})]})]})}),h==="register"&&jsxRuntime.jsx(material.Box,{component:"form",onSubmit:P,children:jsxRuntime.jsxs(material.Stack,{spacing:2,children:[jsxRuntime.jsx(_t,{label:"Full name",value:m.name,onChange:I=>y(D=>({...D,name:I.target.value})),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(Ug__default.default,{fontSize:"small"})})}}),jsxRuntime.jsx(_t,{label:"Work email",type:"email",value:m.email,onChange:I=>y(D=>({...D,email:I.target.value})),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(Gg__default.default,{fontSize:"small"})})}}),jsxRuntime.jsx(_t,{label:"Password",type:"password",value:m.password,onChange:I=>y(D=>({...D,password:I.target.value})),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(h1__default.default,{fontSize:"small"})})}}),jsxRuntime.jsx(_t,{label:"Confirm password",type:"password",value:m.confirmPassword,onChange:I=>y(D=>({...D,confirmPassword:I.target.value}))}),jsxRuntime.jsx(gd,{label:"I accept the demo workspace terms",checked:m.acceptedTerms,onChange:I=>y(D=>({...D,acceptedTerms:I.target.checked}))}),jsxRuntime.jsx(Bo,{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(Bo,{type:"button",variant:"text",size:"small",onClick:()=>k("login"),sx:{minWidth:0,p:0},children:"Sign in"})]})]})}),h==="forgot"&&jsxRuntime.jsx(material.Box,{component:"form",onSubmit:v,children:jsxRuntime.jsxs(material.Stack,{spacing:2,children:[jsxRuntime.jsx(_t,{label:"Work email",type:"email",value:b.email,onChange:I=>T({email:I.target.value}),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(Gg__default.default,{fontSize:"small"})})}}),jsxRuntime.jsx(Bo,{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(Bo,{type:"button",variant:"text",size:"small",onClick:()=>k("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 v1={keyword:{value:"",operator:"contains"},status:{value:"",operator:"equals"},owner:{value:"",operator:"contains"},workCenter:{value:"",operator:"contains"}},C1=[{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"}],Kg=({tasks:e,defaultScale:t="week",defaultSelectedTaskId:o,initialFilters:a,filterFields:r,filterAppId:n="planning-gantt-filter",filterTableKey:i="planning",columns:c,onFilterSearch:d,onFilterVariantLoad:s,enableRowReorder:l,onTaskReorder:g})=>{let[f,u]=vt.useState(t),[h,w]=vt.useState(o??e[0]?.id??""),[p,C]=vt.useState({...v1,...a}),m=vt.useMemo(()=>{let B=String(p.keyword?.value??"").trim().toLowerCase(),R=String(p.status?.value??"").trim(),k=String(p.owner?.value??"").trim().toLowerCase(),A=String(p.workCenter?.value??"").trim().toLowerCase(),P=p.dateRange?.value,v=P?.[0]?ta__default.default(P[0]):null,M=P?.[1]?ta__default.default(P[1]):null;return e.filter(S=>{if(B&&![S.id,S.code,S.title,S.project,S.workCenter,S.owner?.name].join(" ").toLowerCase().includes(B)||R&&S.status!==R||k&&!String(S.owner?.name??"").toLowerCase().includes(k)||A&&!String(S.workCenter??"").toLowerCase().includes(A))return false;if(v||M){let I=ta__default.default(S.startDate),D=ta__default.default(S.endDate),G=v?D.isAfter(v)||D.isSame(v,"day"):true,V=M?I.isBefore(M)||I.isSame(M,"day"):true;if(!G||!V)return false}return true})},[p,e]);vt.useEffect(()=>{m.length!==0&&(m.some(B=>B.id===h)||w(m[0].id));},[m,h]);let y=vt.useCallback(B=>{w(B.id);},[]),b=vt.useMemo(()=>({appId:n,tableKey:i,fields:r??C1,filters:p,onFilterChange:C,onVariantLoad:s??(()=>{}),onSearch:d??(()=>{})}),[n,r,i,p,d,s]),T=vt.useMemo(()=>({tasks:m,columns:c,scale:f,onScaleChange:u,selectedTaskId:h,onTaskSelect:y,enableRowReorder:l,onTaskReorder:g}),[c,l,m,g,y,f,h]);return {scale:f,setScale:u,selectedTaskId:h,setSelectedTaskId:w,filters:p,setFilters:C,filteredTasks:m,smartFilterProps:b,planningGanttProps:T}};var hV=e=>{let t=Kg(e),o=vt.useMemo(()=>({filterProps:t.smartFilterProps,ganttProps:t.planningGanttProps}),[t.planningGanttProps,t.smartFilterProps]);return {...t,layoutProps:o}};var qg=e=>jsxRuntime.jsx(material.Chip,{...e,size:e.size||"small",variant:e.variant||"outlined"});var Qa=vt.forwardRef(({tooltip:e,...t},o)=>{let a=jsxRuntime.jsx(material.IconButton,{ref:o,...t,size:t.size||"small"});return e?jsxRuntime.jsx(material.Tooltip,{title:e,children:a}):a});Qa.displayName="CIconButton";var jg=({label:e,options:t,minWidth:o=120,...a})=>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,...a,children:t.map(r=>jsxRuntime.jsx(material.MenuItem,{value:r.value,children:r.label},r.value))})]});ta__default.default.extend(E1__default.default);var bd=[{value:"hour",label:"Hour",width:56},{value:"day",label:"Day",width:46},{value:"week",label:"Week",width:78},{value:"month",label:"Month",width:104}],xd=56,Ar=58,vd=8,Cd=260,X1=320,Ja="220ms cubic-bezier(0.2, 0, 0, 1)",Qg={"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"}},Y1=e=>e?Qg[e]?.label??e:"Planned",Q1=e=>e?Qg[e]?.color??"default":"info",Jg=e=>Math.min(100,Math.max(0,e??0)),ef=(e,t=0)=>e.flatMap(o=>[{...o,level:t},...ef(o.children??[],t+1)]),J1=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:Y1(e.status),statusTone:e.status??"planned",progress:Jg(e.progress),startDate:e.startDate,endDate:e.endDate,color:e.color,reorderable:e.reorderable!==false}),tf=(e,t)=>t==="month"?e.startOf("month"):t==="week"?e.startOf("week"):t==="day"?e.startOf("day"):e.startOf("hour"),of=(e,t)=>t==="month"?e.endOf("month"):t==="week"?e.endOf("week"):t==="day"?e.endOf("day"):e.endOf("hour"),eT=(e,t,o)=>{let a=[],r=tf(e,o),n=of(t,o);for(;r.isBefore(n)||r.isSame(n);){let i=o==="month"?r.add(1,"month"):o==="week"?r.add(1,"week"):o==="day"?r.add(1,"day"):r.add(1,"hour");a.push({key:`${o}-${r.valueOf()}`,label:o==="month"?r.format("MMM YYYY"):o==="week"?r.format("MMM D"):o==="day"?r.format("D"):r.format("HH:mm"),contextLabel:o==="hour"?r.format("MMM D"):o==="day"?r.format("MMM"):o==="week"?`W${r.isoWeek()}`:void 0,title:o==="hour"?r.format("MMM D, YYYY HH:mm"):o==="day"?r.format("MMM D, YYYY"):o==="week"?`${r.format("MMM D, YYYY")} - Week ${r.isoWeek()}`:void 0,start:r,end:i}),r=i;}return a},kd=(e,t,o)=>{let a=0;for(let r of t){if(e.isBefore(r.start))return a;if(e.isBefore(r.end)){let n=Math.max(1,r.end.valueOf()-r.start.valueOf()),i=Math.max(0,e.valueOf()-r.start.valueOf());return a+i/n*o}a+=o;}return a},af=({title:e="Project Plan",subtitle:t="Task table and timeline view",extraTools:o,bodyHeight:a=560,tasks:r,columns:n,scale:i="week",onScaleChange:c,timelineStart:d,timelineEnd:s,selectedTaskId:l,onTaskSelect:g,enableRowReorder:f=true,onTaskReorder:u,emptyLabel:h="No planning tasks available.",sx:w})=>{let p=material.useTheme(),C=vt.useRef(null),m=vt.useRef(null),y=vt.useRef(null),b=vt.useRef(false),[T,B]=vt.useState(null),[R,k]=vt.useState(null),[A,P]=vt.useState({}),[v,M]=vt.useState(xd),[S,I]=vt.useState([]),[D,G]=vt.useState({activeId:null,overId:null}),V=vt.useRef(null),X=vt.useMemo(()=>ef(r),[r]),de=vt.useMemo(()=>{if(S.length===0)return X;let L=new Map(X.map(te=>[te.id,te])),$=S.map(te=>L.get(te)).filter(te=>!!te),Z=new Set($.map(te=>te.id));return [...$,...X.filter(te=>!Z.has(te.id))]},[X,S]),oe=vt.useMemo(()=>new Map(de.map(L=>[L.id,L])),[de]),re=vt.useMemo(()=>de.map(L=>J1(L)),[de]),_=vt.useMemo(()=>new Map(re.map(L=>[L.id,L])),[re]),qe=vt.useMemo(()=>[{id:"code",label:"ID",minWidth:90},{id:"title",label:"Task",minWidth:260,render:(L,$)=>jsxRuntime.jsxs(material.Stack,{spacing:.2,children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:15,fontWeight:700,lineHeight:1.2},children:$.title}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:13,color:"text.secondary"},children:$.titleSub})]})},{id:"owner",label:"Owner",minWidth:170},{id:"status",label:"Status",minWidth:130,render:(L,$)=>jsxRuntime.jsx(qg,{label:$.status,color:Q1($.statusTone),size:"small"})},{id:"progress",label:"Progress",minWidth:140,numeric:true,render:L=>jsxRuntime.jsxs(material.Stack,{spacing:.6,children:[jsxRuntime.jsxs(material.Typography,{variant:"caption",sx:{color:"text.secondary"},children:[L,"%"]}),jsxRuntime.jsx(material.LinearProgress,{variant:"determinate",value:L,sx:{height:6,borderRadius:999}})]})},{id:"startDate",label:"Start",minWidth:120},{id:"endDate",label:"End",minWidth:120}],[]),it=vt.useMemo(()=>{if(!n||n.length===0)return qe;let L=new Map(qe.map($=>[$.id,$]));return n.map($=>{let Z=L.get($.id),te=$.width??Z?.minWidth??120,ke={id:$.id,label:$.label,minWidth:te};if(Z?.numeric&&(ke.numeric=true),$.render){let z=$.render;return ke.render=(O,N)=>{let ne=oe.get(N.id);return z(ne||N)},ke}return Z?.render?(ke.render=Z.render,ke):(ke.render=(z,O)=>{let N=O[$.id];if(N!=null&&String(N).length>0)return String(N);let se=oe.get(O.id)?.[$.id];return se!=null&&String(se).length>0?String(se):"-"},ke)})},[n,qe,oe]),Y=on({appId:"planning-gantt",title:e,columns:it,rows:re,rowKey:"id",rowsPerPage:-1,rowsPerPageOptions:[-1],count:re.length,showSummary:false}),le=Y.visibleRows;vt.useEffect(()=>{let L=X.map($=>$.id);I($=>{let Z=new Set(L),te=$.filter(N=>Z.has(N)),ke=new Set(te),z=L.filter(N=>!ke.has(N)),O=[...te,...z];return O.length===$.length&&O.every((N,ne)=>N===$[ne])?$:O});},[X]);let Be=L=>L.type==="group"?`group-${L.id}`:`row-${(L.data||L)?.id}`,Ee=vt.useMemo(()=>{let L=re.map(ne=>ta__default.default(ne.startDate)),$=re.map(ne=>ta__default.default(ne.endDate)),Z=d?ta__default.default(d):L.reduce((ne,se)=>se.isBefore(ne)?se:ne,L[0]??ta__default.default()),te=s?ta__default.default(s):$.reduce((ne,se)=>se.isAfter(ne)?se:ne,$[0]??ta__default.default().add(30,"day")),ke=i==="month"?"month":i==="week"?"week":i==="day"?"day":"hour",z=i==="month"?"month":i==="week"?"week":i==="day"?"day":"hour",O=i==="hour"?12:1,N=i==="hour"?12:1;return {start:tf(Z.subtract(O,ke),i),end:of(te.add(N,z),i)}},[re,i,s,d]),Ue=bd.find(L=>L.value===i)??bd[1],ot=Array.isArray(o)?o:o?[o]:[],Fe=vt.useMemo(()=>eT(Ee.start,Ee.end,i),[Ee.end,Ee.start,i]),_e=Fe.length*Ue.width,ht=(Y.columns||[]).filter(L=>Y.visibleColumns.includes(L.id)).reduce((L,$)=>L+(Y.columnWidths?.[$.id]||$.minWidth||100),0),j=T??ht,pe=R==="table",De=R==="timeline",Le=De?0:pe?"100%":j,We=R==="timeline",U=R==="table",ye=!We&&!U,be=pe?"minmax(0, 1fr) 0px 0px":De?"0px 0px minmax(0, 1fr)":`${j}px ${vd}px minmax(0, 1fr)`;vt.useEffect(()=>{B(L=>L===null?null:Math.min(Math.max(L,Cd),ht));},[ht]);let Pe=L=>{L.preventDefault(),L.currentTarget.setPointerCapture(L.pointerId),k(null),V.current={startX:L.clientX,startWidth:j};let $=te=>{let ke=V.current;if(!ke)return;let z=C.current?.clientWidth??0,O=z>0?Math.max(Cd,z-vd-X1):ht,N=Math.min(Math.max(ke.startWidth+te.clientX-ke.startX,Cd),O);B(N);},Z=()=>{V.current=null,window.removeEventListener("pointermove",$),window.removeEventListener("pointerup",Z),document.body.style.cursor="",document.body.style.userSelect="";};document.body.style.cursor="col-resize",document.body.style.userSelect="none",window.addEventListener("pointermove",$),window.addEventListener("pointerup",Z);},et=()=>{k(null),B(null);},Ge=L=>!f||!L?false:_.get(L)?.reorderable!==false,Tt=(L,$)=>{if(!L||!$||L===$||!Ge(L)||!Ge($))return false;if(Y.grouping.length===0)return true;let Z=_.get(L),te=_.get($);return !Z||!te?false:Y.grouping.every(ke=>Z[ke]===te[ke])},ro=(L,$)=>{if(!Tt(L,$))return;let Z=le.filter(ae=>ae.type!=="group").map(ae=>String((ae.data||ae)?.id)),te=Z.indexOf(L),ke=Z.indexOf($);if(te<0||ke<0)return;let z=[...Z];[z[te],z[ke]]=[z[ke],z[te]];let O=new Set(Z),N=de.map(ae=>ae.id),ne=[...z,...N.filter(ae=>!O.has(ae))],se=oe.get(L),we=oe.get($);if(Y.setOrder("asc"),Y.setOrderBy(""),I(ne),se&&we){let{level:ae,...Me}=se,{level:Te,...Ne}=we,Ie=ne.reduce((Re,Ve)=>{let It=oe.get(Ve);if(It){let{level:xo,...yt}=It;Re.push(yt);}return Re},[]);u?.(Ie,{activeTask:Me,targetTask:Ne});}},Yt=(L,$)=>{if(!Ge($.id)){L.preventDefault();return}L.stopPropagation(),L.dataTransfer.effectAllowed="move",L.dataTransfer.setData("text/plain",$.id),G({activeId:$.id,overId:null}),g?.(oe.get($.id)||$);},Ht=(L,$)=>{if(!Tt(D.activeId,$)){G(Z=>Z.overId===null?Z:{...Z,overId:null});return}L.preventDefault(),L.stopPropagation(),L.dataTransfer.dropEffect="move",G(Z=>Z.overId===$?Z:{...Z,overId:$});},Qt=(L,$)=>{let Z=D.activeId||L.dataTransfer.getData("text/plain");if(!Tt(Z,$)){G({activeId:null,overId:null});return}L.preventDefault(),L.stopPropagation(),ro(Z,$),G({activeId:null,overId:null});},ze=()=>{G({activeId:null,overId:null});},Ce=L=>{if(b.current)return;let $=L==="table"?m.current:y.current,Z=L==="table"?y.current:m.current;!$||!Z||(b.current=true,Z.scrollTop=$.scrollTop,window.requestAnimationFrame(()=>{b.current=false;}));};return vt.useLayoutEffect(()=>{if(!l||U)return;let L=y.current,$=m.current;if(!L)return;let Z=`row-${l}`,te=Array.from(L.querySelectorAll("[data-planning-timeline-row-key]")).find(O=>O.dataset.planningTimelineRowKey===Z),ke=_.get(l);if(!te||!ke)return;let z=window.requestAnimationFrame(()=>{let O=L.getBoundingClientRect(),N=te.getBoundingClientRect(),ne=Math.max(1,L.clientHeight-v),se=L.scrollTop+N.top-O.top-v-(ne-N.height)/2;b.current=true,L.scrollTop=Math.max(0,se),$&&!We&&($.scrollTop=L.scrollTop);let we=kd(ta__default.default(ke.startDate),Fe,Ue.width),ae=Math.max(0,we-Ue.width);L.scrollLeft=Math.min(ae,Math.max(0,_e-L.clientWidth)),window.requestAnimationFrame(()=>{b.current=false;});});return ()=>window.cancelAnimationFrame(z)},[Ue.width,v,l,We,_,U,le,_e,Fe]),vt.useLayoutEffect(()=>{let L=m.current;if(!L)return;let $=0,Z=()=>{let N=L.querySelector("thead"),ne=Array.from(L.querySelectorAll("tbody tr[data-planning-row-key]"));if(ne.length===0)return;let se=N?.getBoundingClientRect().height||xd,we={};ne.forEach(ae=>{let Me=ae.dataset.planningRowKey;Me&&(we[Me]=ae.getBoundingClientRect().height);}),M(ae=>Math.abs(ae-se)<.01?ae:se),P(ae=>{let Me=Object.keys(ae),Te=Object.keys(we);return Me.length===Te.length&&Te.every(Ne=>Math.abs((ae[Ne]??0)-we[Ne])<.01)?ae:we});},te=()=>{window.cancelAnimationFrame($),$=window.requestAnimationFrame(Z);};if(Z(),typeof ResizeObserver>"u")return window.addEventListener("resize",te),()=>{window.cancelAnimationFrame($),window.removeEventListener("resize",te);};let ke=new ResizeObserver(te),z=L.querySelector("table"),O=L.querySelector("thead");return z&&ke.observe(z),O&&ke.observe(O),L.querySelectorAll("tbody tr[data-planning-row-key]").forEach(N=>ke.observe(N)),window.addEventListener("resize",te),()=>{window.cancelAnimationFrame($),ke.disconnect(),window.removeEventListener("resize",te);}},[le,Y.visibleColumns,Y.grouping,Y.columnWidths]),jsxRuntime.jsxs(Ii,{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,...w},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:1.5,alignItems:"center",children:[jsxRuntime.jsx(material.Box,{sx:{width:38,height:38,borderRadius:2,display:"grid",placeItems:"center",backgroundColor:"primary.main",color:"primary.contrastText"},children:jsxRuntime.jsx(W1__default.default,{fontSize:"small"})}),jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:18,fontWeight:800},children:e}),jsxRuntime.jsx(material.Typography,{variant:"body2",sx:{color:"text.secondary"},children:t})]})]}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,alignItems:"center",sx:{flexWrap:"wrap"},children:[ot.length>0&&jsxRuntime.jsx(material.Stack,{direction:"row",spacing:.75,alignItems:"center",children:ot.map((L,$)=>jsxRuntime.jsx(material.Box,{sx:{display:"flex",alignItems:"center"},children:L},`planning-extra-tool-${$}`))}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:.25,sx:{p:.5,borderRadius:2,backgroundColor:"action.hover"},children:[jsxRuntime.jsx(Qa,{tooltip:"Column visibility",onClick:L=>Y.setAnchorEl(L.currentTarget),color:"default",children:jsxRuntime.jsx(kh__default.default,{fontSize:"small"})}),jsxRuntime.jsx(Qa,{tooltip:"Group by",onClick:L=>Y.setGroupAnchorEl(L.currentTarget),color:"default",children:jsxRuntime.jsx(Th__default.default,{fontSize:"small"})}),jsxRuntime.jsx(Qa,{tooltip:"Sort by first visible column",onClick:()=>{let L=(Y.columns||[]).find($=>Y.visibleColumns.includes($.id));L&&Y.handleRequestSort(L.id);},color:Y.orderBy?"primary":"default",children:jsxRuntime.jsx(j1__default.default,{fontSize:"small"})})]}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:.25,sx:{p:.5,borderRadius:2,backgroundColor:"action.hover"},children:[jsxRuntime.jsx(Qa,{tooltip:"Expand task table",onClick:()=>k("table"),color:R==="table"?"primary":"default",children:jsxRuntime.jsx(q1__default.default,{fontSize:"small"})}),jsxRuntime.jsx(Qa,{tooltip:"Reset split",onClick:et,color:R===null?"primary":"default",children:jsxRuntime.jsx(_1__default.default,{fontSize:"small"})}),jsxRuntime.jsx(Qa,{tooltip:"Expand timeline",onClick:()=>k("timeline"),color:R==="timeline"?"primary":"default",children:jsxRuntime.jsx(K1__default.default,{fontSize:"small"})})]}),jsxRuntime.jsx(material.Box,{sx:{minWidth:120},children:jsxRuntime.jsx(jg,{label:"",value:i,options:bd.map(L=>({value:L.value,label:L.label})),onChange:L=>c?.(L.target.value),sx:{"& .MuiSelect-select":{fontSize:"0.92rem",py:.65},"& .MuiSvgIcon-root":{fontSize:20}}})})]})]}),re.length===0?jsxRuntime.jsx(material.Box,{sx:{minHeight:240,display:"grid",placeItems:"center",color:"text.secondary"},children:h}):jsxRuntime.jsx(material.Box,{sx:{overflow:"hidden",flex:1,minHeight:0},children:jsxRuntime.jsxs(material.Box,{ref:C,sx:{height:"100%",display:"grid",gridTemplateColumns:be,transition:`grid-template-columns ${Ja}`},children:[jsxRuntime.jsx(material.TableContainer,{"data-planning-scroll-pane":"table",ref:m,onScroll:()=>Ce("table"),sx:{width:Le,height:a,overflowX:"auto",overflowY:"auto",opacity:We?0:1,transform:We?"translateX(-10px)":"translateX(0)",pointerEvents:We?"none":"auto",transition:`opacity ${Ja}, transform ${Ja}, width ${Ja}`},children:jsxRuntime.jsxs(material.Table,{size:"small",stickyHeader:true,sx:{tableLayout:"fixed",width:ht,"& thead .MuiTableCell-root":{height:xd,py:0,lineHeight:1.15,boxSizing:"border-box"}},children:[jsxRuntime.jsx(Ei,{columns:Y.columns,visibleColumns:Y.visibleColumns,order:Y.order,orderBy:Y.orderBy,onRequestSort:Y.handleRequestSort,grouping:Y.grouping,isAllExpanded:Y.isAllExpanded,handleToggleAll:Y.handleToggleAll,columnWidths:Y.columnWidths,onColumnResize:Y.handleColumnResize}),jsxRuntime.jsx(material.TableBody,{children:le.map(L=>{let $=Be(L);if(L.type==="group")return jsxRuntime.jsxs(material.TableRow,{"data-planning-row-key":$,sx:{height:Ar,backgroundColor:p.palette.action.hover},children:[Y.grouping.length>0&&jsxRuntime.jsx(material.TableCell,{sx:{width:44,height:Ar,py:0,borderBottom:`1px solid ${p.palette.divider}`},children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>Y.toggleGroupExpand(L.id),children:L.isExpanded?jsxRuntime.jsx(Zh__default.default,{fontSize:"small"}):jsxRuntime.jsx(Bh__default.default,{fontSize:"small"})})}),jsxRuntime.jsx(material.TableCell,{colSpan:Y.visibleColumns.length,sx:{height:Ar,py:0,borderBottom:`1px solid ${p.palette.divider}`},children:jsxRuntime.jsxs(material.Typography,{sx:{fontSize:13,fontWeight:700},children:[L.field,": ",L.value," (",L.count,")"]})})]},L.id);let Z=L.data||L,te=Z.id===l,ke=Ge(Z.id),z=D.activeId===Z.id,O=D.overId===Z.id&&Tt(D.activeId,Z.id);return jsxRuntime.jsxs(material.TableRow,{"data-planning-row-key":$,draggable:ke,hover:true,selected:te,onDragStart:N=>Yt(N,Z),onDragOver:N=>Ht(N,Z.id),onDragEnter:N=>Ht(N,Z.id),onDrop:N=>Qt(N,Z.id),onDragEnd:ze,onClick:()=>g?.(oe.get(Z.id)||Z),sx:{cursor:z?"grabbing":ke?"grab":g?"pointer":"default",height:Ar,opacity:z?.56:1,"& .MuiTableCell-root":O?{borderTop:`2px solid ${p.palette.primary.main}`}:void 0,transition:"background-color 120ms ease, opacity 120ms ease"},children:[Y.grouping.length>0&&jsxRuntime.jsx(material.TableCell,{sx:{width:44,height:Ar,py:0,borderBottom:`1px solid ${p.palette.divider}`}}),(Y.columns||[]).filter(N=>Y.visibleColumns.includes(N.id)).map(N=>jsxRuntime.jsx(material.TableCell,{sx:{width:Y.columnWidths?.[N.id]||N.minWidth||100,height:Ar,py:0,overflow:"hidden",borderBottom:`1px solid ${p.palette.divider}`},children:N.render?N.render(Z[N.id],Z):String(Z[N.id]??"-")},`${Z.id}-${N.id}`))]},Z.id)})})]})}),jsxRuntime.jsx(material.Box,{onPointerDown:ye?Pe:void 0,role:"separator","aria-orientation":"vertical",sx:{width:ye?vd:0,cursor:ye?"col-resize":"default",opacity:ye?1:0,pointerEvents:ye?"auto":"none",borderLeft:ye?`1px solid ${p.palette.divider}`:"0 solid transparent",borderRight:ye?`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 ${Ja}, opacity ${Ja}, 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:ye?"col-resize":"default"}}}),jsxRuntime.jsx(material.Box,{sx:{minWidth:0,overflow:"hidden",opacity:U?0:1,transform:U?"translateX(10px)":"translateX(0)",pointerEvents:U?"none":"auto",transition:`opacity ${Ja}, transform ${Ja}`},children:jsxRuntime.jsx(material.Box,{"data-planning-scroll-pane":"timeline",ref:y,onScroll:()=>Ce("timeline"),sx:{width:"100%",height:a,overflowX:"auto",overflowY:"auto"},children:jsxRuntime.jsxs(material.Box,{sx:{width:_e},children:[jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${Fe.length}, ${Ue.width}px)`,height:v,boxSizing:"border-box",borderBottom:`1px solid ${p.palette.divider}`,position:"sticky",top:0,zIndex:2,backgroundColor:p.palette.background.paper},children:Fe.map(L=>jsxRuntime.jsxs(material.Box,{title:L.title,sx:{px:.75,display:"flex",flexDirection:L.contextLabel?"column":"row",alignItems:"center",justifyContent:"center",gap:L.contextLabel?.15:0,borderRight:`1px solid ${p.palette.divider}`,color:L.contextLabel?"text.primary":"text.secondary",overflow:"hidden"},children:[L.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:L.contextLabel}),jsxRuntime.jsx(material.Typography,{component:"span",sx:{maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:12,fontWeight:700,lineHeight:1.15},children:L.label})]},L.key))}),jsxRuntime.jsx(material.Stack,{sx:{position:"relative"},children:le.map(L=>{let $=Be(L),Z=A[$]??Ar;if(L.type==="group")return jsxRuntime.jsx(material.Box,{"data-planning-timeline-row-key":$,sx:{position:"relative",height:Z,boxSizing:"border-box",borderBottom:`1px solid ${p.palette.divider}`,backgroundColor:p.palette.action.hover}},L.id);let te=L.data||L,ke=ta__default.default(te.startDate),z=ta__default.default(te.endDate),O=kd(ke,Fe,Ue.width),N=kd(z,Fe,Ue.width),ne=Math.max(18,N-O),se=Jg(te.progress),we=te.id===l,ae=Ge(te.id),Me=D.activeId===te.id,Te=D.overId===te.id&&Tt(D.activeId,te.id),Ne=te.color??(te.statusTone==="blocked"?p.palette.error.main:p.palette.primary.main);return jsxRuntime.jsx(material.Box,{"data-planning-timeline-row-key":$,draggable:ae,onDragStart:Ie=>Yt(Ie,te),onDragOver:Ie=>Ht(Ie,te.id),onDragEnter:Ie=>Ht(Ie,te.id),onDrop:Ie=>Qt(Ie,te.id),onDragEnd:ze,onClick:()=>g?.(oe.get(te.id)||te),sx:{position:"relative",height:Z,boxSizing:"border-box",borderBottom:`1px solid ${p.palette.divider}`,opacity:Me?.56:1,"&::before":{content:'""',position:"absolute",top:0,left:0,right:0,height:2,backgroundColor:p.palette.primary.main,opacity:Te?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:`${Ue.width}px 100%`,cursor:Me?"grabbing":ae?"grab":g?"pointer":"default",transition:"opacity 120ms ease"},children:jsxRuntime.jsx(material.Tooltip,{title:`${te.title}: ${ke.format("MMM D HH:mm")} - ${z.format("MMM D HH:mm")}`,children:jsxRuntime.jsxs(material.Box,{sx:{position:"absolute",left:O,top:Math.max(8,(Z-24)/2),width:ne,height:24,borderRadius:999,overflow:"hidden",backgroundColor:p.palette.mode==="dark"?"rgba(148,163,184,0.18)":"rgba(15,23,42,0.10)",outline:we?`2px solid ${p.palette.warning.main}`:"none",outlineOffset:2},children:[jsxRuntime.jsx(material.Box,{sx:{height:"100%",width:`${se}%`,backgroundColor:Ne}}),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:te.code})]})})},te.id)})})]})})})]})}),jsxRuntime.jsx(Wr,{groupAnchorEl:Y.groupAnchorEl,setGroupAnchorEl:Y.setGroupAnchorEl,grouping:Y.grouping,setGrouping:Y.setGrouping,columns:Y.columns,toggleGroupField:Y.toggleGroupField}),jsxRuntime.jsx($r,{anchorEl:Y.anchorEl,setAnchorEl:Y.setAnchorEl,columns:Y.columns,visibleColumns:Y.visibleColumns,toggleColumnVisibility:Y.toggleColumnVisibility})]})};var eO=({filterProps:e,ganttProps:t,spacing:o=2,sx:a,children:r})=>{let n=a?[{height:"100%",overflow:"hidden"},a]:{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(ma,{...e})}),jsxRuntime.jsx(material.Box,{sx:{flex:1,minHeight:0,overflow:"hidden"},children:jsxRuntime.jsx(af,{...t,bodyHeight:t.bodyHeight??"100%",sx:i})}),r]})};var sT={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)"}}},nO=({children:e,transitionKey:t,variant:o="fade",durationMs:a=220,delayMs:r=0,easing:n="cubic-bezier(0.22, 1, 0.36, 1)",disabled:i=false,sx:c})=>{let d=material.useMediaQuery("(prefers-reduced-motion: reduce)"),[s,l]=vt.useState("to"),g=!i&&!d&&o!=="none";vt.useEffect(()=>{if(!g){l("to");return}l("from");let h=requestAnimationFrame(()=>{h=requestAnimationFrame(()=>{l("to");});});return ()=>cancelAnimationFrame(h)},[t,g]);let f=sT[o],u=vt.useMemo(()=>g?s==="from"?f.from:f.to:{opacity:1,transform:"none"},[g,s,f.from,f.to]);return jsxRuntime.jsx(material.Box,{sx:{willChange:g?"opacity, transform":"auto",transition:g?`opacity ${a}ms ${n} ${r}ms, transform ${a}ms ${n} ${r}ms`:"none",backfaceVisibility:"hidden",...u,...c},children:e})},iO={subtle:{variant:"fade",durationMs:180},smooth:{variant:"slide-up",durationMs:220},snappy:{variant:"scale",durationMs:160}};
199
- exports.AgentPanel=MN;exports.Button=ws;exports.CAINavProvider=vS;exports.CAmapChart=Sp;exports.CAppHeader=Bl;exports.CAppPageLayout=wB;exports.CAuthPage=sV;exports.CBarChart=Hn;exports.CChartCard=Oi;exports.CComboChart=dp;exports.CCustomizeAgent=Pp;exports.CDetailInfoPage=RA;exports.CDetailSearchAiBar=Su;exports.CDetailSectionCard=kl;exports.CFishboneChart=gp;exports.CGoogleMapChart=xp;exports.CGraphCharts=wp;exports.CGraphKpiCards=ip;exports.CGraphReport=el;exports.CHeatmapChart=up;exports.CKanbanBoard=ZA;exports.CKanbanBucket=Du;exports.CKanbanCard=wc;exports.CLayoutManagement=Yp;exports.CLayoutManager=ul;exports.CLineChart=cp;exports.CMessageBox=Bn;exports.COrbCanvas=iS;exports.CPageLayout=jd;exports.CPageTransition=nO;exports.CPieChart=qi;exports.CPivotTable=uE;exports.CPlanningGantt=af;exports.CPlanningLayout=eO;exports.CSmartFilter=ma;exports.CSmartTable=_M;exports.CStandardPage=e2;exports.CTable=$a;exports.CTableBody=$M;exports.CTableCell=GM;exports.CTableContainer=UM;exports.CTableHead=KM;exports.CTableRow=qM;exports.CValueHelp=_d;exports.CVariantManagement=rl;exports.CVariantManager=Np;exports.CVoiceWaveOverlay=od;exports.CWaterfallChart=hp;exports.CodeBlock=Qn;exports.CopilotChat=VN;exports.GlobalMessage=mI;exports.MarkdownRenderer=ai;exports.MathBlock=Jn;exports.MermaidBlock=dc;exports.NavigationIsland=Fd;exports.ORBCAFE_I18N_MESSAGES=An;exports.OrbcafeI18nProvider=Mi;exports.PAGE_TRANSITION_PRESETS=iO;exports.PAppPageLayout=$F;exports.PBarcodeScanner=AE;exports.PNavIsland=_m;exports.PNumericKeypad=qE;exports.PSmartFilter=Om;exports.PTable=Uk;exports.PTouchCard=NE;exports.PWorkloadNav=$m;exports.PivotChartPanel=ym;exports.StdChat=Vg;exports.TableBlock=uc;exports.ThinkBlock=vl;exports.TreeMenu=Is;exports.VoiceNavigatorProvider=rL;exports.VoiceWaveOverlay=XF;exports.buildAmapEmbedUrl=Zi;exports.buildGoogleMapEmbedUrl=Gn;exports.buildGoogleMapIframe=eR;exports.buttonVariants=gf;exports.createKanbanBoardModel=Bu;exports.findKanbanCard=Oo;exports.message=XT;exports.messageManager=ca;exports.moveKanbanCard=Pl;exports.parseMarkdownTable=bl;exports.renderMarkdown=Y2;exports.resolveVariantFilters=Jp;exports.resolveVariantLayout=ml;exports.useAINav=CS;exports.useAmapEmbedUrl=f2;exports.useAuthPage=$N;exports.useDetailInfo=Tu;exports.useGoogleMapEmbedUrl=g2;exports.useGraphChartData=c2;exports.useGraphInteraction=ol;exports.useGraphReport=Qr;exports.useKanbanBoard=eB;exports.useNavigationIsland=zd;exports.useOrbcafeI18n=ee;exports.usePadLayout=kE;exports.usePadRecordEditor=TE;exports.usePageLayout=$u;exports.usePivotTable=yE;exports.usePlanningGantt=Kg;exports.usePlanningLayout=hV;exports.useStandardReport=i2;exports.useVoiceInput=rs;exports.useVoiceNavigator=nL;
196
+ ${o}: ${(r??a)(p.secondaryValue??0)}`:""]})}),jsxRuntime.jsx("text",{x:p.x,y:Math.max(p.y-12,d.top+8),textAnchor:"middle",fontSize:"10",fill:n.palette.text.secondary,children:p.name})]},p.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:um(f)}),jsxRuntime.jsx("text",{x:i-d.right,y:c-d.bottom+16,textAnchor:"end",fontSize:"10",fill:n.palette.text.secondary,children:um(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(p=>jsxRuntime.jsxs(material.Box,{sx:S=>({borderRadius:2,px:1.25,py:1,border:`1px solid ${styles.alpha(S.palette.divider,.7)}`,bgcolor:styles.alpha(S.palette.background.default,.35)}),children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.78rem",fontWeight:700},noWrap:true,title:p.name,children:p.name}),jsxRuntime.jsxs(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:[t,": ",a(p.primaryValue)]}),o&&jsxRuntime.jsxs(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:[o,": ",(r??a)(p.secondaryValue??0)]})]},p.name))})]})};var Wc=e=>Math.max(...e,1),fm=({data:e,chartType:t,primaryLabel:o,secondaryLabel:a,formatPrimaryValue:r,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=Wc(e.flatMap(y=>[y.primaryValue,y.secondaryValue??0]));return jsxRuntime.jsx(material.Stack,{spacing:1.1,children:e.map(y=>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:y.name,children:y.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:`${y.primaryValue/m*100}%`,height:"100%",bgcolor:c}})}),a&&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:`${(y.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:r(y.primaryValue)}),a&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",textAlign:{xs:"left",md:"right"},color:"text.secondary"},children:(n??r)(y.secondaryValue??0)})]})]},y.name))})}if(t==="bar-vertical"){let m=Wc(e.flatMap(b=>[b.primaryValue,b.secondaryValue??0])),y=a?92:76;return jsxRuntime.jsx(material.Box,{sx:{overflowX:"auto",pb:.5},children:jsxRuntime.jsx(material.Box,{sx:{minWidth:Math.max(620,e.length*y),display:"grid",gridTemplateColumns:`repeat(${e.length}, minmax(56px, 1fr))`,gap:1,alignItems:"end"},children:e.map(b=>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:a?16:26,minHeight:8,height:`${Math.max(b.primaryValue/m*188,8)}px`,borderRadius:"10px 10px 2px 2px",bgcolor:c},title:`${o}: ${r(b.primaryValue)}`}),a&&jsxRuntime.jsx(material.Box,{sx:{width:16,minHeight:8,height:`${Math.max((b.secondaryValue??0)/m*188,8)}px`,borderRadius:"10px 10px 2px 2px",bgcolor:d},title:`${a}: ${(n??r)(b.secondaryValue??0)}`})]}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.76rem",fontWeight:700},noWrap:true,title:b.name,children:b.name}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.7rem",color:"text.secondary"},noWrap:true,title:r(b.primaryValue),children:r(b.primaryValue)}),a&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.7rem",color:"text.secondary"},noWrap:true,title:(n??r)(b.secondaryValue??0),children:(n??r)(b.secondaryValue??0)})]},b.name))})})}let l=Math.max(680,e.length*74),s=240,g={top:20,right:18,bottom:36,left:18},f=Wc(e.flatMap(m=>[m.primaryValue,m.secondaryValue??0])),u=l-g.left-g.right,h=s-g.top-g.bottom,w=m=>e.map((y,b)=>{let v=g.left+b*u/Math.max(e.length-1,1),E=s-g.bottom-m(y)/f*h;return {x:v,y:E,item:y}}),p=w(m=>m.primaryValue),S=a?w(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:p.map(m=>`${m.x},${m.y}`).join(" ")}),p.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,": ",r(m.item.primaryValue)]})},`primary-${m.item.name}`)),a&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("polyline",{fill:"none",stroke:d,strokeWidth:2.5,strokeDasharray:"5 5",points:S.map(m=>`${m.x},${m.y}`).join(" ")}),S.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
+ `,a,": ",(n??r)(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:y=>({borderRadius:2,px:1.1,py:.9,border:`1px solid ${styles.alpha(y.palette.divider,.7)}`,bgcolor:styles.alpha(y.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:r(m.primaryValue)}),a&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.71rem",color:"text.secondary"},children:(n??r)(m.secondaryValue??0)})]},m.name))})]})};var hm=(e,t,o)=>{let a=new Set,r=[];return e.forEach(n=>{a.has(n)||(a.add(n),r.push({fieldId:n,label:o.get(n)?.label??n,zone:"rows"}));}),t.forEach(n=>{a.has(n)||(a.add(n),r.push({fieldId:n,label:o.get(n)?.label??n,zone:"columns"}));}),r},ym=(e,t,o)=>e.map(a=>{let r=t.get(a.fieldId),n=r?.label??a.fieldId;return {fieldId:a.fieldId,label:`${o(a.aggregation)} \xB7 ${n}`,item:a,field:r}}),bm=({rows:e,dimensionFieldId:t,primaryValue:o,secondaryValue:a})=>{if(!t)return [];let r=new Map;return e.forEach(n=>{let i=Ca(n[t]),c=r.get(i);if(c){c.push(n);return}r.set(i,[n]);}),Array.from(r.entries()).sort((n,i)=>n[0].localeCompare(i[0],void 0,{sensitivity:"base"})).map(([n,i])=>({name:n,primaryValue:ln(i,o.fieldId,o.aggregation),secondaryValue:a?ln(i,a.fieldId,a.aggregation):void 0}))};var xm=({rows:e,fieldMap:t,rowFields:o,columnFields:a,valueFields:r,chartDimensionFieldId:n,chartPrimaryValueFieldId:i,chartSecondaryValueFieldId:c,chartType:d,isCollapsed:l,onChartDimensionFieldIdChange:s,onChartPrimaryValueFieldIdChange:g,onChartSecondaryValueFieldIdChange:f,onChartTypeChange:u,onToggleCollapse:h,getAggregationLabel:w})=>{let{t:p}=ee(),S=St.useMemo(()=>hm(o,a,t),[a,t,o]),m=St.useMemo(()=>ym(r,t,w),[t,w,r]),y=m.find(C=>C.fieldId===i)??m[0],b=m.find(C=>C.fieldId===c&&C.fieldId!==y?.fieldId)??null,v=S.find(C=>C.fieldId===n)??S[0],E=v&&y?p("pivot.chart.subtitleReady",{dimension:v.label,measure:b?`${y.label} / ${b.label}`:y.label}):p("pivot.chart.subtitle"),R=St.useMemo(()=>!v||!y?[]:bm({rows:e,dimensionFieldId:v.fieldId,primaryValue:y.item,secondaryValue:b?.item}),[y,e,b,v]),k=C=>y?di(C,y.item,t):C.toLocaleString(),B=C=>b?di(C,b.item,t):C.toLocaleString(),P=S.length>1||m.length>1;return jsxRuntime.jsxs(un,{title:p("pivot.chart.title"),subtitle:E,collapsed:l,onToggleCollapse:h,expandAriaLabel:p("pivot.chart.collapse.ariaExpand"),collapseAriaLabel:p("pivot.chart.collapse.ariaCollapse"),bodySx:{display:"flex",flexDirection:"column",gap:1.1},children:[P&&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:p("pivot.chart.dimension")}),jsxRuntime.jsx(material.Select,{value:v?.fieldId??"",onChange:C=>s(String(C.target.value)),sx:{fontSize:"0.75rem",height:32},children:S.map(C=>jsxRuntime.jsx(material.MenuItem,{value:C.fieldId,sx:{fontSize:"0.75rem"},children:C.label},C.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:p("pivot.chart.primaryMeasure")}),jsxRuntime.jsx(material.Select,{value:y?.fieldId??"",onChange:C=>g(String(C.target.value)),sx:{fontSize:"0.75rem",height:32},children:m.map(C=>jsxRuntime.jsx(material.MenuItem,{value:C.fieldId,sx:{fontSize:"0.75rem"},children:C.label},C.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:p("pivot.chart.secondaryMeasure")}),jsxRuntime.jsxs(material.Select,{value:b?.fieldId??"",onChange:C=>f(String(C.target.value)),sx:{fontSize:"0.75rem",height:32},children:[jsxRuntime.jsx(material.MenuItem,{value:"",sx:{fontSize:"0.75rem",color:"text.secondary"},children:p("common.none")}),m.filter(C=>C.fieldId!==y?.fieldId).map(C=>jsxRuntime.jsx(material.MenuItem,{value:C.fieldId,sx:{fontSize:"0.75rem"},children:C.label},C.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:p("pivot.chart.chartType")}),jsxRuntime.jsxs(material.Select,{value:d,onChange:C=>u(C.target.value),sx:{fontSize:"0.75rem",height:32},children:[jsxRuntime.jsx(material.MenuItem,{value:"bar-vertical",sx:{fontSize:"0.75rem"},children:p("pivot.chart.style.barVertical")}),jsxRuntime.jsx(material.MenuItem,{value:"bar-horizontal",sx:{fontSize:"0.75rem"},children:p("pivot.chart.style.barHorizontal")}),jsxRuntime.jsx(material.MenuItem,{value:"line",sx:{fontSize:"0.75rem"},children:p("pivot.chart.style.line")}),jsxRuntime.jsx(material.MenuItem,{value:"scatter",sx:{fontSize:"0.75rem"},children:p("pivot.chart.style.scatter")})]})]})]}),jsxRuntime.jsx(material.Box,{children:v?y?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:p("pivot.chart.emptyNoData")})}):d==="scatter"?jsxRuntime.jsx(mm,{data:R,primaryLabel:y.label,secondaryLabel:b?.label,formatPrimaryValue:k,formatSecondaryValue:B}):jsxRuntime.jsx(fm,{data:R,chartType:d,primaryLabel:y.label,secondaryLabel:b?.label,formatPrimaryValue:k,formatSecondaryValue:B}):jsxRuntime.jsx(material.Box,{sx:{py:5,textAlign:"center"},children:jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.86rem",color:"text.secondary"},children:p("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:p("pivot.chart.emptyNoDimension")})})})]})};var _l=({node:e,dataColumns:t,fieldMap:o,level:a,expandedKeys:r,onToggle:n,getValue:i})=>{let c=r.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:a*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(Qh__default.default,{sx:{fontSize:16}}):jsxRuntime.jsx(ef__default.default,{sx:{fontSize:16}})}),!d&&!l&&a>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:di(i?i(e,s.id):e.aggregatedValues[s.id]??0,s.valueItem,o)},`${e.key}-${s.id}`))]}),c&&e.children.map(s=>jsxRuntime.jsx(_l,{node:s,dataColumns:t,fieldMap:o,level:a+1,expandedKeys:r,onToggle:n,getValue:i},s.key))]})};var qc=(e,t,o)=>{let a=[...e,...t];return o&&a.includes(o)?o:a[0]??""},Xl=(e,t)=>t&&e.some(o=>o.fieldId===t)?t:e[0]?.fieldId??"",_c=(e,t,o)=>o===""?"":o&&o!==t&&e.some(a=>a.fieldId===o)?o:e.find(a=>a.fieldId!==t)?.fieldId??"",Im=e=>{let t=new Set,o=a=>{a.forEach(r=>{r.children.length>0&&(t.add(r.key),o(r.children));});};return o(e),t},Rm=(e,t,o=0)=>e.length===0?o:e.reduce((a,r)=>r.children.length===0||!t.has(r.key)?Math.max(a,o+1):Math.max(a,Rm(r.children,t,o+1)),o),KC=(e,t)=>{let o=[],a=r=>{r.forEach(n=>{if(n.children.length>0&&t.has(n.key)){a(n.children);return}o.push(n);});};return a(e),o},fE=({title:e,rows:t,fields:o,initialLayout:a,initialChart:r,emptyText:n,maxPreviewHeight:i=520,initialChartCollapsed:c=false,initialTableCollapsed:d=false,model:l,enablePresetManagement:s=false,presets:g,defaultPresets:f,onPresetsChange:u,initialPresetId:h,onPresetApplied:w})=>{let{t:p}=ee(),S=core.useSensors(core.useSensor(core.PointerSensor,{activationConstraint:{distance:8}})),m=St.useRef(0),y=St.useRef(false),b=e??p("pivot.title.default"),v=n??p("pivot.empty"),E=St.useMemo(()=>({sum:p("pivot.agg.sum"),count:p("pivot.agg.count"),avg:p("pivot.agg.avg"),min:p("pivot.agg.min"),max:p("pivot.agg.max")}),[p]),R=St.useCallback(x=>E[x]??ju[x],[E]),k=St.useMemo(()=>new Set(o.map(x=>x.id)),[o]),B=St.useMemo(()=>new Map(o.map(x=>[x.id,x])),[o]),[P,C]=St.useState(()=>zt(a?.rows,k)),[D,T]=St.useState(()=>zt(a?.columns,k)),[I,A]=St.useState(()=>zt(a?.filters,k)),[W,z]=St.useState(()=>{let x=a?.values??[],F=new Set,L=[];return x.forEach(q=>{if(!k.has(q.fieldId)||F.has(q.fieldId))return;F.add(q.fieldId),m.current+=1;let ce=B.get(q.fieldId);L.push({tokenId:`v${m.current}`,fieldId:q.fieldId,aggregation:Jt(q.aggregation,ce)});}),L}),[Q,re]=St.useState({}),[ne,ae]=St.useState(true),[_,Ue]=St.useState(false),[Ze,Oe]=St.useState(()=>qc(zt(a?.rows,k),zt(a?.columns,k),r?.dimensionFieldId)),[ie,we]=St.useState(()=>{let x=(a?.values??[]).filter((F,L,q)=>k.has(F.fieldId)&&q.findIndex(ce=>ce.fieldId===F.fieldId)===L).map(F=>({tokenId:F.fieldId,fieldId:F.fieldId,aggregation:Jt(F.aggregation,B.get(F.fieldId))}));return Xl(x,r?.primaryValueFieldId)}),[Ae,Ye]=St.useState(()=>{let x=(a?.values??[]).filter((L,q,ce)=>k.has(L.fieldId)&&ce.findIndex(Se=>Se.fieldId===L.fieldId)===q).map(L=>({tokenId:L.fieldId,fieldId:L.fieldId,aggregation:Jt(L.aggregation,B.get(L.fieldId))})),F=Xl(x,r?.primaryValueFieldId);return _c(x,F,r?.secondaryValueFieldId)}),[st,Z]=St.useState(r?.chartType??"bar-vertical"),[Ke,xt]=St.useState(c),[X,pe]=St.useState(d),[Be,Ee]=St.useState(()=>f??[]),[qe,K]=St.useState(""),[ye,be]=St.useState(false),[xe,Qe]=St.useState(""),[He,qt]=St.useState(null),[ao,ro]=St.useState(new Set(["__grand_total__"])),[uo,Et]=St.useState(new Set),De=l?.rowFields??P,he=l?.columnFields??D,Tt=l?.filterFields??I,_e=l?.valueFields??W,It=l?.filterSelections??Q,mo=l?.showGrandTotal??ne,ia=l?.isConfiguratorCollapsed??_,H=l?.chartDimensionFieldId??Ze,$=l?.chartPrimaryValueFieldId??ie,Y=l?.chartSecondaryValueFieldId??Ae,Ie=l?.chartType??st,Te=l?.isChartCollapsed??Ke,Ve=l?.isTableCollapsed??X,Ce=g??Be,$e=s||Ce.length>0||!!u,M=St.useCallback(x=>{if(l?.setRowFields){l.setRowFields(x);return}C(x);},[l]),O=St.useCallback(x=>{if(l?.setColumnFields){l.setColumnFields(x);return}T(x);},[l]),U=St.useCallback(x=>{if(l?.setFilterFields){l.setFilterFields(x);return}A(x);},[l]),G=St.useCallback(x=>{if(l?.setValueFields){l.setValueFields(x);return}z(x);},[l]),te=St.useCallback(x=>{if(l?.setFilterSelections){l.setFilterSelections(x);return}re(x);},[l]),Re=St.useCallback(x=>{if(l?.setShowGrandTotal){l.setShowGrandTotal(x);return}ae(x);},[l]),ze=St.useCallback(x=>{if(l?.setIsConfiguratorCollapsed){l.setIsConfiguratorCollapsed(x);return}Ue(x);},[l]),le=St.useCallback(x=>{if(l?.setChartDimensionFieldId){l.setChartDimensionFieldId(x);return}Oe(x);},[l]),Pe=St.useCallback(x=>{if(l?.setChartPrimaryValueFieldId){l.setChartPrimaryValueFieldId(x);return}we(x);},[l]),We=St.useCallback(x=>{if(l?.setChartSecondaryValueFieldId){l.setChartSecondaryValueFieldId(x);return}Ye(x);},[l]),vt=St.useCallback(x=>{if(l?.setChartType){l.setChartType(x);return}Z(x);},[l]),je=St.useCallback(x=>{if(l?.setIsChartCollapsed){l.setIsChartCollapsed(x);return}xt(x);},[l]),gt=St.useCallback(x=>{if(l?.setIsTableCollapsed){l.setIsTableCollapsed(x);return}pe(x);},[l]),Pt=St.useCallback(x=>{let F=typeof x=="function"?x(Ce):x;g||Ee(F),u?.(F);},[u,Ce,g]),no=St.useMemo(()=>new Set([...De,...he,...Tt]),[De,he,Tt]),Rt=St.useMemo(()=>o.filter(x=>!no.has(x.id)),[o,no]),Ft=St.useMemo(()=>{let x=[...De,...he,...Tt],F=new Set,L=[];return x.forEach(q=>{F.has(q)||(F.add(q),L.push(q));}),L},[he,Tt,De]);St.useEffect(()=>{M(x=>{let F=x.filter(L=>k.has(L));return ka(x,F)?x:F}),O(x=>{let F=x.filter(L=>k.has(L));return ka(x,F)?x:F}),U(x=>{let F=x.filter(L=>k.has(L));return ka(x,F)?x:F}),G(x=>{let F=x.filter(L=>k.has(L.fieldId)).map(L=>({...L,aggregation:Jt(L.aggregation,B.get(L.fieldId))}));return zl(x,F)?x:F});},[B,k]);let Xt=St.useMemo(()=>{let x={};return Ft.forEach(F=>{let L=new Set;t.forEach(q=>{L.add(Ca(q[F]));}),x[F]=Array.from(L).sort((q,ce)=>q.localeCompare(ce));}),x},[Ft,t]);St.useEffect(()=>{te(x=>{let F={};return Ft.forEach(L=>{let q=Xt[L]??[],Se=(x[L]??[]).filter(oe=>q.includes(oe)),N=Object.prototype.hasOwnProperty.call(x,L);F[L]=N?Se:q;}),em(x,F)?x:F});},[Ft,Xt]),St.useEffect(()=>{le(x=>qc(De,he,x));},[he,De,le]),St.useEffect(()=>{Pe(x=>Xl(_e,x));},[Pe,_e]),St.useEffect(()=>{We(x=>_c(_e,$,x));},[$,We,_e]);let Dt=St.useMemo(()=>t.filter(x=>Ft.every(F=>{let L=It[F]??[],q=Xt[F]??[];if(L.length===q.length)return true;if(L.length===0)return false;let ce=Ca(x[F]);return L.includes(ce)})),[Ft,Xt,It,t]),Xe=St.useMemo(()=>{if(_e.length===0)return null;let x=new Map;if(Dt.forEach(N=>{let oe=he.length>0?he.map(nt=>Ca(N[nt])):[p("pivot.valueLabel")],J=kr(oe);x.set(J,oe);}),x.size===0){let N=he.length>0?he.map(()=>Fl):[p("pivot.valueLabel")];x.set(kr(N),N);}let F=Array.from(x.entries()).sort((N,oe)=>Ju(N[1],oe[1])),L=F.flatMap(([N,oe])=>_e.map(J=>{let nt=B.get(J.fieldId),V=`${R(J.aggregation)} ${nt?.label??J.fieldId}`,se=he.length===0||_e.length>1?`${oe.join(" / ")} \u2022 ${V}`:oe.join(" / ");return {id:`${N}::${J.tokenId}`,colKey:N,valueItem:J,label:se}})),q=[];he.length>0&&F.forEach(([N,oe])=>{let J=L.filter(se=>se.colKey===N),nt=q,V=[];oe.forEach((se,j)=>{V.push(`d${j}:${se}`);let ge=`col::${kr(V)}`,Je=nt.find(Yo=>Yo.key===ge);Je||(Je={key:ge,label:se,children:[],leafColumnIds:[],path:oe.slice(0,j+1),depth:j},nt.push(Je)),J.forEach(Yo=>{Je.leafColumnIds.includes(Yo.id)||Je.leafColumnIds.push(Yo.id);}),nt=Je.children;});});let ce=N=>{let oe={};return L.forEach(J=>{let nt=N.filter(V=>{let se=he.length>0?he.map(j=>Ca(V[j])):[p("pivot.valueLabel")];return kr(se)===J.colKey});oe[J.id]=ln(nt,J.valueItem.fieldId,J.valueItem.aggregation);}),oe},Se=[];if(De.length===0)Se.push({key:"root",value:p("pivot.resultLabel")||qu,children:[],isLeaf:true,aggregatedValues:ce(Dt),path:[],depth:0});else {let N=(oe,J,nt)=>{if(J>=De.length)return [];let V=De[J],se=new Map;return oe.forEach(j=>{let ge=Ca(j[V]);se.has(ge)||se.set(ge,[]),se.get(ge).push(j);}),Array.from(se.keys()).sort().map(j=>{let ge=se.get(j),Je=[...nt,j];return {key:kr(Je),value:j,fieldId:V,aggregatedValues:ce(ge),children:N(ge,J+1,Je),isLeaf:J===De.length-1,path:Je,depth:J}})};Se.push(...N(Dt,0,[]));}return {dataColumns:L,columnTree:q,rowTree:Se}},[he,B,Dt,R,De,p,_e]),Eo=St.useCallback((x,F)=>(m.current+=1,{tokenId:`v${m.current}`,fieldId:x,aggregation:Jt(F,B.get(x))}),[B]),_o=St.useCallback(x=>{if(x==="rows")return M([]);if(x==="columns")return O([]);if(x==="filters")return U([]);G([]);},[]),la=St.useCallback((x,F)=>{if(x==="rows")return M(L=>L.filter(q=>q!==F));if(x==="columns")return O(L=>L.filter(q=>q!==F));if(x==="filters")return U(L=>L.filter(q=>q!==F));G(L=>L.filter(q=>q.tokenId!==F));},[]),or=St.useCallback((x,F)=>{G(L=>L.map(q=>q.tokenId===x?{...q,aggregation:Jt(F,B.get(q.fieldId))}:q));},[B]),jo=St.useCallback(x=>{qt(String(x.active.id));},[]),ar=St.useCallback(x=>{if(qt(null),!x.over)return;let F=Ll(String(x.active.id)),L=Ll(String(x.over.id));if(!F||!L||F.kind!=="item"||!F.key)return;if(F.zone===L.zone&&L.kind==="item"){if(F.zone==="rows"){let j=De.indexOf(F.key),ge=De.indexOf(L.key??"");j!==-1&&ge!==-1&&j!==ge&&M(Je=>sortable.arrayMove(Je,j,ge));return}if(F.zone==="columns"){let j=he.indexOf(F.key),ge=he.indexOf(L.key??"");j!==-1&&ge!==-1&&j!==ge&&O(Je=>sortable.arrayMove(Je,j,ge));return}if(F.zone==="filters"){let j=Tt.indexOf(F.key),ge=Tt.indexOf(L.key??"");j!==-1&&ge!==-1&&j!==ge&&U(Je=>sortable.arrayMove(Je,j,ge));return}if(F.zone==="values"){let j=_e.findIndex(Je=>Je.tokenId===F.key),ge=_e.findIndex(Je=>Je.tokenId===(L.key??""));j!==-1&&ge!==-1&&j!==ge&&G(Je=>sortable.arrayMove(Je,j,ge));}return}let q=L.zone,ce=[...De],Se=[...he],N=[...Tt],oe=[..._e],J="",nt=null;if(F.zone==="palette")J=F.key;else if(F.zone==="values"){let j=oe.find(ge=>ge.tokenId===F.key);if(!j)return;J=j.fieldId,nt=j,oe=oe.filter(ge=>ge.tokenId!==F.key);}else F.zone==="rows"?(J=F.key,ce=ce.filter(j=>j!==J)):F.zone==="columns"?(J=F.key,Se=Se.filter(j=>j!==J)):F.zone==="filters"&&(J=F.key,N=N.filter(j=>j!==J));if(!J)return;let V=()=>{ce=ce.filter(j=>j!==J),Se=Se.filter(j=>j!==J),N=N.filter(j=>j!==J);},se=j=>{if(L.kind!=="item"||!L.key)return j==="rows"?ce.length:j==="columns"?Se.length:j==="filters"?N.length:j==="values"?oe.length:0;if(j==="rows"){let ge=ce.indexOf(L.key);return ge>=0?ge:ce.length}if(j==="columns"){let ge=Se.indexOf(L.key);return ge>=0?ge:Se.length}if(j==="filters"){let ge=N.indexOf(L.key);return ge>=0?ge:N.length}if(j==="values"){let ge=oe.findIndex(Je=>Je.tokenId===L.key);return ge>=0?ge:oe.length}return 0};if(q==="palette"){M(ce),O(Se),U(N),G(oe);return}if(q==="values"){let j=se("values"),ge=nt??Eo(J);oe.splice(j,0,ge),M(ce),O(Se),U(N),G(oe);return}if(Qu(q)){V();let j=se(q);q==="rows"?ce.splice(j,0,J):q==="columns"?Se.splice(j,0,J):N.splice(j,0,J),M(ce),O(Se),U(N),G(oe);}},[he,Eo,Tt,De,_e]),rr=St.useCallback((x,F)=>{te(L=>({...L,[x]:F}));},[]),Zo=St.useCallback(x=>{ro(F=>{let L=new Set(F);return L.has(x)?L.delete(x):L.add(x),L});},[]),sa=St.useCallback(x=>{Et(F=>{let L=new Set(F);return L.has(x)?L.delete(x):L.add(x),L});},[]),Aa=St.useCallback(x=>{let F=B.get(x.fieldId),L=Ec(F);return jsxRuntime.jsx(material.FormControl,{size:"small",sx:{minWidth:98},children:jsxRuntime.jsx(material.Select,{value:x.aggregation,onChange:q=>or(x.tokenId,q.target.value),onClick:q=>q.stopPropagation(),onMouseDown:q=>q.stopPropagation(),sx:{fontSize:"0.72rem",height:26,"& .MuiSelect-select":{py:.35}},children:L.map(q=>jsxRuntime.jsx(material.MenuItem,{value:q,sx:{fontSize:"0.75rem"},children:R(q)},q))})})},[B,R,or]),Yt=St.useCallback(x=>{let F=Xt[x]??[],L=It[x]??F;return F.length===0?p("pivot.filter.noValues"):L.length===0?p("pivot.filter.noneSelected"):L.length===F.length?p("pivot.filter.allValues"):p("pivot.filter.selectedCount",{selected:L.length,total:F.length})},[Xt,It,p]),Fo=St.useCallback(x=>{let F=Xt[x]??[],L=It[x]??F;return jsxRuntime.jsx(am,{options:F,selectedValues:L,onChange:q=>rr(x,q)})},[Xt,It,rr]),ca=St.useCallback(()=>`pivot-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,[]),To=St.useCallback(()=>{let x={};return new Set([...Ft,...Object.keys(It)]).forEach(L=>{if(!k.has(L))return;let q=It[L]??[];x[L]=[...q];}),{layout:{rows:[...De],columns:[...he],filters:[...Tt],values:_e.map(L=>({fieldId:L.fieldId,aggregation:L.aggregation}))},filterSelections:x,showGrandTotal:mo,chart:{dimensionFieldId:H,primaryValueFieldId:$,secondaryValueFieldId:Y,chartType:Ie}}},[Ft,H,$,Y,Ie,he,Tt,It,De,mo,k,_e]),Xo=St.useCallback(x=>{let F=zt(x.layout.rows,k),L=zt(x.layout.columns,k),q=zt(x.layout.filters,k),ce=new Set,Se=(x.layout.values??[]).filter(J=>!k.has(J.fieldId)||ce.has(J.fieldId)?false:(ce.add(J.fieldId),true)).map(J=>Eo(J.fieldId,J.aggregation)),N={};Object.entries(x.filterSelections??{}).forEach(([J,nt])=>{!k.has(J)||!Array.isArray(nt)||(N[J]=Array.from(new Set(nt.map(V=>String(V)))));}),M(F),O(L),U(q),G(Se),te(N),typeof x.showGrandTotal=="boolean"&&Re(x.showGrandTotal),le(qc(F,L,x.chart?.dimensionFieldId));let oe=Xl(Se,x.chart?.primaryValueFieldId);Pe(oe),We(_c(Se,oe,x.chart?.secondaryValueFieldId)),vt(x.chart?.chartType??"bar-vertical"),K(x.id),w?.(x);},[Eo,w,le,Pe,We,vt,O,U,te,M,Re,G,k]),nr=St.useCallback(x=>{if(!x){K("");return}let F=Ce.find(L=>L.id===x);if(!F){K("");return}Xo(F);},[Xo,Ce]),Er=St.useCallback(()=>{let x=p("pivot.preset.defaultName",{index:Ce.length+1});Qe(x),be(true);},[Ce.length,p]),Ba=St.useCallback(()=>{let x=xe.trim();if(!x)return;let F={id:ca(),name:x,...To()};Pt(L=>[...L,F]),K(F.id),be(false);},[To,ca,xe,Pt]),ir=St.useCallback(()=>{qe&&(Pt(x=>x.filter(F=>F.id!==qe)),K(""));},[qe,Pt]);St.useEffect(()=>{if(!h||y.current)return;let x=Ce.find(F=>F.id===h);x&&(y.current=true,Xo(x));},[Xo,h,Ce]),St.useEffect(()=>{qe&&(Ce.some(x=>x.id===qe)||K(""));},[qe,Ce]);let da=St.useMemo(()=>{if(!mo||!Xe||!De.length)return null;let x={};return Xe.dataColumns.forEach(F=>{let L=Dt.filter(q=>{let ce=he.length>0?he.map(Se=>Ca(q[Se])):[p("pivot.valueLabel")];return kr(ce)===F.colKey});x[F.id]=ln(L,F.valueItem.fieldId,F.valueItem.aggregation);}),{key:"__grand_total__",value:p("pivot.grandTotal")||_u,children:[],isLeaf:false,isGrandTotal:true,aggregatedValues:x,path:[],depth:-1}},[mo,Xe,Dt,he,De.length,p]),io=St.useMemo(()=>Im(Xe?.rowTree??[]),[Xe]),Lo=St.useMemo(()=>Im(Xe?.columnTree??[]),[Xe]);St.useEffect(()=>{ro(x=>{let F=new Set;return x.has("__grand_total__")&&F.add("__grand_total__"),io.forEach(L=>{x.has(L)&&F.add(L);}),F});},[io]),St.useEffect(()=>{Et(x=>{let F=new Set;return Lo.forEach(L=>{x.has(L)&&F.add(L);}),F});},[Lo]);let Fr=St.useCallback(()=>{ro(x=>{let F=new Set(x);return io.forEach(L=>F.add(L)),F});},[io]),lr=St.useCallback(()=>{ro(x=>{let F=new Set;return x.has("__grand_total__")&&F.add("__grand_total__"),F});},[]),Lr=St.useCallback(()=>{Et(new Set(Lo));},[Lo]),zr=St.useCallback(()=>{Et(new Set);},[]),Nr=St.useMemo(()=>!Xe||he.length===0?[]:KC(Xe.columnTree,uo),[he.length,uo,Xe]),go=St.useMemo(()=>{if(!Xe)return [];if(he.length===0)return Xe.dataColumns.map(F=>({id:F.id,label:F.label,leafColumnIds:[F.id],valueItem:F.valueItem}));let x=new Map(Xe.dataColumns.map(F=>[F.id,F]));return Nr.flatMap(F=>{let L=new Map;return F.leafColumnIds.forEach(q=>{let ce=x.get(q);if(!ce)return;let Se=ce.valueItem.tokenId,N=`${R(ce.valueItem.aggregation)} ${B.get(ce.valueItem.fieldId)?.label??ce.valueItem.fieldId}`,oe=L.get(Se);if(oe){oe.leafColumnIds.push(q);return}L.set(Se,{id:`${F.key}::${Se}`,label:_e.length>1?N:F.label,leafColumnIds:[q],valueItem:ce.valueItem});}),Array.from(L.values())})},[he.length,B,R,Xe,_e.length,Nr]),Vr=St.useMemo(()=>new Map(go.map(x=>[x.id,x])),[go]),Or=St.useMemo(()=>go.map(x=>({id:x.id,colKey:x.id,valueItem:x.valueItem,label:x.label})),[go]),sr=St.useMemo(()=>{if(!Xe||he.length===0)return [];let x=[],F=Rm(Xe.columnTree,uo),L=F+(_e.length>1?1:0),q=(ce,Se)=>{x[Se]??(x[Se]=[]),ce.forEach(N=>{let oe=N.children.length>0&&uo.has(N.key),J=go.filter(V=>N.leafColumnIds.some(se=>V.leafColumnIds.includes(se))).length,nt=oe||_e.length>1?1:L-Se;x[Se].push({key:N.key,label:N.label,colSpan:J,rowSpan:nt,expandable:N.children.length>0,expanded:oe}),oe&&q(N.children,Se+1);});};return q(Xe.columnTree,0),_e.length>1&&(x[F]=go.map(ce=>({key:ce.id,label:ce.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))),x},[he.length,uo,Xe,_e.length,go]),pa=St.useCallback((x,F)=>F.leafColumnIds.reduce((L,q)=>L+(x.aggregatedValues[q]??0),0),[]),Ea=St.useMemo(()=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.Button,{size:"small",variant:"text",onClick:Fr,disabled:io.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:p("pivot.table.expandRowsAll")}),jsxRuntime.jsx(material.Button,{size:"small",variant:"text",onClick:lr,disabled:io.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:p("pivot.table.collapseRowsAll")}),jsxRuntime.jsx(material.Divider,{orientation:"vertical",flexItem:true}),jsxRuntime.jsx(material.Button,{size:"small",variant:"text",onClick:Lr,disabled:Lo.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:p("pivot.table.expandColumnsAll")}),jsxRuntime.jsx(material.Button,{size:"small",variant:"text",onClick:zr,disabled:he.length===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:p("pivot.table.collapseColumnsAll")})]}),[he.length,Lo.size,io.size,zr,lr,Lr,Fr,p]),Fa=()=>{if(!He)return null;let x=Ll(He);if(!x||x.kind!=="item"||!x.key)return null;if(x.zone==="palette"){let ce=B.get(x.key);return ce?jsxRuntime.jsx(Lc,{label:ce.label,subtitle:ce.type}):null}if(x.zone==="values"){let ce=_e.find(J=>J.tokenId===x.key);if(!ce)return null;let N=B.get(ce.fieldId)?.label??ce.fieldId,oe=`${R(ce.aggregation)}(${N})`;return jsxRuntime.jsx(Wl,{label:N,caption:oe})}let L=B.get(x.key)?.label??x.key,q=Yt(x.key);return jsxRuntime.jsx(Wl,{label:L,caption:q})};return jsxRuntime.jsxs(material.Paper,{sx:x=>({p:{xs:1.2,md:2},borderRadius:4,border:`1px solid ${x.palette.divider}`,bgcolor:"background.paper",boxShadow:x.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:b}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.78rem",color:"text.secondary"},children:p("pivot.subtitle.default")})]}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1.5,alignItems:"center",children:[$e&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.FormControl,{size:"small",sx:{minWidth:200},children:jsxRuntime.jsxs(material.Select,{value:qe,displayEmpty:true,onChange:x=>nr(String(x.target.value)),sx:{fontSize:"0.75rem",height:32},children:[jsxRuntime.jsx(material.MenuItem,{value:"",sx:{fontSize:"0.75rem",color:"text.secondary"},children:p("pivot.preset.selectPlaceholder")}),Ce.map(x=>jsxRuntime.jsx(material.MenuItem,{value:x.id,sx:{fontSize:"0.75rem"},children:x.name},x.id))]})}),jsxRuntime.jsx(material.Tooltip,{title:p("pivot.preset.save"),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:Er,"aria-label":p("pivot.preset.save"),children:jsxRuntime.jsx(Qp__default.default,{sx:{fontSize:18}})})}),jsxRuntime.jsx(material.Tooltip,{title:p("pivot.preset.delete"),children:jsxRuntime.jsx("span",{children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:ir,disabled:!qe,"aria-label":p("pivot.preset.delete"),children:jsxRuntime.jsx(zC__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:[p("pivot.records"),": ",jsxRuntime.jsx("strong",{children:t.length.toLocaleString()})," / ",p("pivot.afterFilter"),":"," ",jsxRuntime.jsx("strong",{children:Dt.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:p("pivot.grandTotal")}),jsxRuntime.jsx(material.Switch,{size:"small",checked:mo,onChange:x=>Re(x.target.checked)})]})]})]}),jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsxs(core.DndContext,{sensors:S,collisionDetection:core.closestCenter,onDragStart:jo,onDragEnd:ar,children:[jsxRuntime.jsx(pm,{isConfiguratorCollapsed:ia,onToggleCollapse:()=>ze(x=>!x),availableFields:Rt,fieldMap:B,filterFields:Tt,columnFields:he,rowFields:De,valueFields:_e,clearZone:_o,removeFieldFromZone:la,getFilterSelectionSummary:Yt,renderDimensionFilterSelect:Fo,renderAggregationSelect:Aa,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:Fa()})})]}),jsxRuntime.jsx(xm,{rows:Dt,fieldMap:B,rowFields:De,columnFields:he,valueFields:_e,chartDimensionFieldId:H,chartPrimaryValueFieldId:$,chartSecondaryValueFieldId:Y,chartType:Ie,isCollapsed:Te,onChartDimensionFieldIdChange:x=>le(x),onChartPrimaryValueFieldIdChange:x=>Pe(x),onChartSecondaryValueFieldIdChange:x=>We(x),onChartTypeChange:x=>vt(x),onToggleCollapse:()=>je(x=>!x),getAggregationLabel:R}),jsxRuntime.jsx(un,{title:p("pivot.table.sectionTitle"),subtitle:De.length>0?De.map(x=>B.get(x)?.label??x).join(" > "):p("pivot.table.dimensions"),collapsed:Ve,onToggleCollapse:()=>gt(x=>!x),expandAriaLabel:p("pivot.table.collapse.ariaExpand"),collapseAriaLabel:p("pivot.table.collapse.ariaCollapse"),bodySx:{p:0},headerActions:Ea,children:Xe===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:v})}):jsxRuntime.jsx(material.TableContainer,{sx:{maxHeight:i},children:jsxRuntime.jsxs(material.Table,{size:"small",stickyHeader:true,children:[jsxRuntime.jsx(material.TableHead,{children:(sr.length>0?sr:[[]]).map((x,F)=>jsxRuntime.jsxs(material.TableRow,{children:[F===0&&jsxRuntime.jsx(material.TableCell,{rowSpan:Math.max(sr.length,1),sx:L=>({fontWeight:800,fontSize:"0.76rem",color:"text.primary",bgcolor:L.palette.mode==="dark"?"#000000":"#f5f5f5",borderBottom:`1px solid ${L.palette.divider}`,pl:2,minWidth:220,verticalAlign:"middle"}),children:De.length>0?De.map(L=>B.get(L)?.label).join(" > "):p("pivot.table.dimensions")}),(x.length>0?x:go.map(L=>({key:L.id,label:L.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))).map(L=>jsxRuntime.jsx(material.TableCell,{align:"center",colSpan:L.colSpan,rowSpan:L.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:[L.expandable&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>sa(L.key),sx:{p:.1,ml:-0.3},children:L.expanded?jsxRuntime.jsx(Qh__default.default,{sx:{fontSize:16}}):jsxRuntime.jsx(ef__default.default,{sx:{fontSize:16}})}),jsxRuntime.jsx(material.Box,{component:"span",children:L.label})]})},L.key))]},`pivot-header-row-${F}`))}),jsxRuntime.jsxs(material.TableBody,{children:[Xe.rowTree.map(x=>jsxRuntime.jsx(_l,{node:x,dataColumns:Or,fieldMap:B,level:0,expandedKeys:ao,onToggle:Zo,getValue:(F,L)=>{let q=Vr.get(L);return q?pa(F,q):0}},x.key)),da&&jsxRuntime.jsx(_l,{node:da,dataColumns:Or,fieldMap:B,level:0,expandedKeys:ao,onToggle:Zo,getValue:(x,F)=>{let L=Vr.get(F);return L?pa(x,L):0}})]})]})})}),jsxRuntime.jsxs(material.Dialog,{open:ye,onClose:()=>be(false),maxWidth:"xs",fullWidth:true,children:[jsxRuntime.jsx(material.DialogTitle,{children:p("pivot.preset.saveDialogTitle")}),jsxRuntime.jsx(material.DialogContent,{children:jsxRuntime.jsx(material.TextField,{autoFocus:true,fullWidth:true,margin:"dense",label:p("pivot.preset.nameLabel"),value:xe,onChange:x=>Qe(x.target.value),onKeyDown:x=>{x.key==="Enter"&&(x.preventDefault(),Ba());}})}),jsxRuntime.jsxs(material.DialogActions,{children:[jsxRuntime.jsx(material.Button,{onClick:()=>be(false),children:p("common.cancel")}),jsxRuntime.jsx(material.Button,{variant:"contained",onClick:Ba,disabled:!xe.trim(),children:p("common.save")})]})]})]})};var Dm=(e,t,o)=>{let a=[...e,...t];return o&&a.includes(o)?o:a[0]??""},Zc=(e,t)=>t&&e.some(o=>o.fieldId===t)?t:e[0]?.fieldId??"",Mm=(e,t,o)=>o===""?"":o&&o!==t&&e.some(a=>a.fieldId===o)?o:e.find(a=>a.fieldId!==t)?.fieldId??"",vE=({fields:e,initialLayout:t,initialFilterSelections:o={},initialShowGrandTotal:a=true,initialConfiguratorCollapsed:r=false,initialChart:n,initialChartCollapsed:i=false,initialTableCollapsed:c=false})=>{let d=St.useRef(0),l=St.useMemo(()=>new Set(e.map(K=>K.id)),[e]),s=St.useMemo(()=>new Map(e.map(K=>[K.id,K])),[e]),[g,f]=St.useState(()=>zt(t?.rows,l)),[u,h]=St.useState(()=>zt(t?.columns,l)),[w,p]=St.useState(()=>zt(t?.filters,l)),[S,m]=St.useState(()=>{let K=t?.values??[],ye=new Set,be=[];return K.forEach(xe=>{!l.has(xe.fieldId)||ye.has(xe.fieldId)||(ye.add(xe.fieldId),d.current+=1,be.push({tokenId:`v${d.current}`,fieldId:xe.fieldId,aggregation:Jt(xe.aggregation,s.get(xe.fieldId))}));}),be}),[y,b]=St.useState(o),[v,E]=St.useState(a),[R,k]=St.useState(r),[B,P]=St.useState(()=>Dm(zt(t?.rows,l),zt(t?.columns,l),n?.dimensionFieldId)),[C,D]=St.useState(()=>{let K=(()=>{let ye=t?.values??[],be=new Set,xe=[];return ye.forEach(Qe=>{!l.has(Qe.fieldId)||be.has(Qe.fieldId)||(be.add(Qe.fieldId),xe.push({tokenId:Qe.fieldId,fieldId:Qe.fieldId,aggregation:Jt(Qe.aggregation,s.get(Qe.fieldId))}));}),xe})();return Zc(K,n?.primaryValueFieldId)}),[T,I]=St.useState(()=>{let K=(()=>{let be=t?.values??[],xe=new Set,Qe=[];return be.forEach(He=>{!l.has(He.fieldId)||xe.has(He.fieldId)||(xe.add(He.fieldId),Qe.push({tokenId:He.fieldId,fieldId:He.fieldId,aggregation:Jt(He.aggregation,s.get(He.fieldId))}));}),Qe})(),ye=Zc(K,n?.primaryValueFieldId);return Mm(K,ye,n?.secondaryValueFieldId)}),[A,W]=St.useState(n?.chartType??"bar-vertical"),[z,Q]=St.useState(i),[re,ne]=St.useState(c);St.useEffect(()=>{f(K=>{let ye=K.filter(be=>l.has(be));return ka(K,ye)?K:ye}),h(K=>{let ye=K.filter(be=>l.has(be));return ka(K,ye)?K:ye}),p(K=>{let ye=K.filter(be=>l.has(be));return ka(K,ye)?K:ye}),m(K=>{let ye=K.filter(be=>l.has(be.fieldId)).map(be=>({...be,aggregation:Jt(be.aggregation,s.get(be.fieldId))}));return zl(K,ye)?K:ye});},[s,l]),St.useEffect(()=>{P(K=>Dm(g,u,K));},[u,g]),St.useEffect(()=>{D(K=>Zc(S,K));},[S]),St.useEffect(()=>{I(K=>Mm(S,C,K));},[C,S]);let ae=St.useCallback(K=>{f(zt(K,l));},[l]),_=St.useCallback(K=>{h(zt(K,l));},[l]),Ue=St.useCallback(K=>{p(zt(K,l));},[l]),Ze=St.useCallback(K=>{m(ye=>{let be=K??[],xe=new Set,Qe=[];return be.forEach(He=>{if(!l.has(He.fieldId)||xe.has(He.fieldId))return;xe.add(He.fieldId);let qt=ye.find(ao=>ao.fieldId===He.fieldId);if(qt){Qe.push({...qt,aggregation:Jt(He.aggregation??qt.aggregation,s.get(He.fieldId))});return}d.current+=1,Qe.push({tokenId:`v${d.current}`,fieldId:He.fieldId,aggregation:Jt(He.aggregation,s.get(He.fieldId))});}),Qe});},[s,l]),Oe=St.useCallback(K=>{ae(K.rows??[]),_(K.columns??[]),Ue(K.filters??[]),Ze(K.values??[]);},[_,Ue,ae,Ze]),ie=St.useCallback(K=>{if(K==="rows")return f([]);if(K==="columns")return h([]);if(K==="filters")return p([]);m([]);},[]),we=St.useCallback((K,ye)=>{if(K==="rows")return f(be=>be.filter(xe=>xe!==ye));if(K==="columns")return h(be=>be.filter(xe=>xe!==ye));if(K==="filters")return p(be=>be.filter(xe=>xe!==ye));m(be=>be.filter(xe=>xe.tokenId!==ye));},[]),Ae=St.useCallback((K,ye)=>{m(be=>be.map(xe=>xe.tokenId===K?{...xe,aggregation:Jt(ye,s.get(xe.fieldId))}:xe));},[s]),Ye=St.useCallback((K,ye)=>{b(be=>({...be,[K]:ye}));},[]),st=St.useCallback(()=>{b({});},[]),Z=St.useCallback(()=>{E(K=>!K);},[]),Ke=St.useCallback(()=>{k(K=>!K);},[]),xt=St.useCallback(K=>{P(K);},[]),X=St.useCallback(K=>{D(K);},[]),pe=St.useCallback(K=>{I(K);},[]),Be=St.useCallback(()=>{Q(K=>!K);},[]),Ee=St.useCallback(()=>{ne(K=>!K);},[]);return {model:St.useMemo(()=>({rowFields:g,setRowFields:f,columnFields:u,setColumnFields:h,filterFields:w,setFilterFields:p,valueFields:S,setValueFields:m,filterSelections:y,setFilterSelections:b,showGrandTotal:v,setShowGrandTotal:E,isConfiguratorCollapsed:R,setIsConfiguratorCollapsed:k,chartDimensionFieldId:B,setChartDimensionFieldId:P,chartPrimaryValueFieldId:C,setChartPrimaryValueFieldId:D,chartSecondaryValueFieldId:T,setChartSecondaryValueFieldId:I,chartType:A,setChartType:W,isChartCollapsed:z,setIsChartCollapsed:Q,isTableCollapsed:re,setIsTableCollapsed:ne}),[B,C,T,A,u,w,y,z,R,re,g,v,S]),actions:{setRows:ae,setColumns:_,setFilters:Ue,setValues:Ze,setLayout:Oe,clearZone:ie,removeFieldFromZone:we,setAggregationForValue:Ae,setFilterSelection:Ye,resetFilterSelections:st,toggleGrandTotal:Z,toggleConfigurator:Ke,setChartDimension:xt,setChartPrimaryValue:X,setChartSecondaryValue:pe,setChartType:W,toggleChart:Be,toggleTable:Ee}}};var TE=({orientation:e="auto",defaultNavigationOpen:t,onNavOpenChange:o}={})=>{let a=styles.useTheme(),r=material.useMediaQuery("(orientation: portrait)",{noSsr:true}),n=material.useMediaQuery(a.breakpoints.down("md"),{noSsr:true}),i=St.useMemo(()=>e==="auto"?r||n?"portrait":"landscape":e,[n,r,e]),[c,d]=St.useState(t??i==="landscape");St.useEffect(()=>{d(t??i==="landscape");},[t,i]);let l=g=>{d(g),o?.(g);};return {resolvedOrientation:i,isPortraitViewport:r,isCompactViewport:n,navigationOpen:c,setNavigationOpen:l,toggleNavigationOpen:()=>l(!c)}};var QC=e=>{let t=Number(e||0);return Number.isFinite(t)?t:0},RE=({rows:e,rowKey:t="id",numericField:o,defaultSelectedId:a})=>{let n=e[0]?.[t],[i,c]=St.useState(a??n),d=St.useMemo(()=>e.find(u=>u[t]===i)||e[0],[t,e,i]),[l,s]=St.useState(()=>{let u=d?.[o];return u==null?"0":String(u)});return {selectedId:i,selectedRecord:d,editorValue:l,setEditorValue:s,selectRecord:u=>{let h=u[t];c(h);let w=u[o];s(w==null?"0":String(w));},applyEditorValue:u=>{if(i===void 0)return;let h=QC(l),w=e.map(p=>p[t]===i?{...p,[o]:h}:p);u(w);}}};var ck=["code_128","ean_13","ean_8","qr_code","upc_a","upc_e"],zm=(e,t,o,a)=>{t?.(e),a&&o?.();},FE=({open:e,onClose:t,title:o="Scan barcode",subtitle:a="Use the rear camera on the device. If scanning is unavailable, enter the code manually.",formats:r=ck,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:u,sx:h})=>{let w=St__namespace.default.useRef(null),p=St__namespace.default.useRef(null),S=St__namespace.default.useRef(null),m=St__namespace.default.useRef(null),[y,b]=St__namespace.default.useState("idle"),[v,E]=St__namespace.default.useState(""),[R,k]=St__namespace.default.useState(null),[B,P]=St__namespace.default.useState(null),C=St__namespace.default.useCallback(()=>{S.current!==null&&(window.clearInterval(S.current),S.current=null),p.current&&(p.current.getTracks().forEach(I=>I.stop()),p.current=null),w.current&&(w.current.srcObject=null);},[]),D=St__namespace.default.useCallback(I=>{P(I),b("error"),u?.(I);},[u]);St__namespace.default.useEffect(()=>{if(!e){C(),b("idle"),P(null),E("");return}let I=false;return (async()=>{if(!(typeof window>"u"||typeof navigator>"u")){if(!navigator.mediaDevices?.getUserMedia){b("unsupported"),P("Camera access is not supported in this browser.");return}b("starting"),P(null);try{let W=await navigator.mediaDevices.getUserMedia({audio:!1,video:{facingMode:{ideal:n}}});if(I){W.getTracks().forEach(z=>z.stop());return}if(p.current=W,w.current&&(w.current.srcObject=W,await w.current.play()),!window.BarcodeDetector){b("unsupported"),P("BarcodeDetector is not available. Camera preview is ready and manual entry is enabled.");return}m.current=new window.BarcodeDetector({formats:r}),b("ready"),S.current=window.setInterval(async()=>{if(!(!w.current||!m.current)&&!(w.current.readyState<HTMLMediaElement.HAVE_CURRENT_DATA))try{let Q=(await m.current.detect(w.current)).find(ne=>ne.rawValue);if(!Q?.rawValue)return;let re={rawValue:Q.rawValue,format:Q.format};k(re),C(),zm(re,f,t,c);}catch(z){D(z instanceof Error?z.message:"Failed to detect barcode.");}},d);}catch(W){D(W instanceof Error?W.message:"Unable to start camera.");}}})(),()=>{I=true,C();}},[c,n,r,t,f,e,D,d,C]);let T=()=>{let I=v.trim();if(!I)return;let A={rawValue:I,format:"manual"};k(A),zm(A,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:h,children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.88rem",color:"text.secondary",lineHeight:1.55},children:a}),jsxRuntime.jsxs(material.Paper,{elevation:0,sx:I=>({position:"relative",overflow:"hidden",borderRadius:4,border:"1px solid",borderColor:"divider",minHeight:280,background:I.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:w,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(lk__default.default,{}),label:y==="ready"?"Camera ready":y==="starting"?"Starting camera":y==="unsupported"?"Preview only":y==="error"?"Scanner error":"Idle",size:"small",color:y==="error"?"error":"primary",variant:"filled"}),R?jsxRuntime.jsx(material.Chip,{icon:jsxRuntime.jsx(sk__default.default,{}),label:`${R.format||"barcode"}: ${R.rawValue}`,size:"small",color:"success",variant:"filled"}):null]})]}),B?jsxRuntime.jsx(material.Alert,{severity:y==="unsupported"?"info":"warning",children:B}):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:v,onChange:I=>E(I.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 mk={default:"#475569",primary:"#1d4ed8",success:"#047857",warning:"#b45309",error:"#b91c1c",info:"#0369a1"},HE=({title:e,description:t,kicker:o,icon:a,badges:r=[],metrics:n=[],footer:i,children:c,selected:d=false,draggable:l=false,isDragging:s=false,swipeThreshold:g=88,startAction:f,endAction:u,dragHandleProps:h,onClick:w,onSwipe:p,sx:S})=>{let[m,y]=St.useState(0),[b,v]=St.useState(false),E=St.useRef(null),R=St.useRef(0),k=St.useRef(0),B=!!(f||u),P=132,C=()=>{y(0),v(false),E.current=null,R.current=0,k.current=0;},D=z=>{(z==="start"?f:u)?.onTrigger?.(),p?.(z),C();},T=z=>{!B||z.target.closest('button, a, input, textarea, [data-no-swipe="true"]')||(E.current=z.pointerId,R.current=z.clientX,k.current=z.clientX,v(true),z.currentTarget.setPointerCapture(z.pointerId));},I=z=>{if(!b||E.current!==z.pointerId)return;k.current=z.clientX;let Q=k.current-R.current,re=Math.max(-P,Math.min(P,Q));y(re);},A=z=>{if(!b||E.current!==z.pointerId)return;let Q=k.current-R.current;if(Q>=g&&f){D("start");return}if(Q<=-g&&u){D("end");return}Math.abs(Q)<12&&w?.(),C();},W=(z,Q)=>{if(!z)return null;let re=z.backgroundColor||mk[z.tone||"default"];return jsxRuntime.jsx(material.Box,{sx:{position:"absolute",top:0,bottom:0,[Q]:0,width:P,px:2,display:"flex",alignItems:"center",justifyContent:Q==="left"?"flex-start":"flex-end",color:"#fff",background:`linear-gradient(135deg, ${re}, rgba(15,23,42,0.92))`},children:jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,alignItems:"center",children:[z.icon,jsxRuntime.jsx(material.Typography,{sx:{fontWeight:700,fontSize:"0.95rem"},children:z.label})]})})};return jsxRuntime.jsxs(material.Box,{sx:{position:"relative",overflow:"hidden",borderRadius:4,...S},children:[W(f,"left"),W(u,"right"),jsxRuntime.jsx(material.Paper,{elevation:0,onPointerDown:T,onPointerMove:I,onPointerUp:A,onPointerCancel:C,sx:z=>({position:"relative",zIndex:1,p:2,borderRadius:4,border:"1px solid",borderColor:d?"primary.main":"divider",background:z.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:b?"none":"transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease",touchAction:"pan-y",cursor:w?"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:[a?jsxRuntime.jsx(material.Box,{sx:{mt:.25},children:a}):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",...h,sx:{alignSelf:"center",display:"inline-flex",touchAction:"none"},children:jsxRuntime.jsx(material.IconButton,{size:"small",children:jsxRuntime.jsx(uk__default.default,{})})}):null]}),r.length>0?jsxRuntime.jsx(material.Stack,{direction:"row",spacing:1,useFlexGap:true,flexWrap:"wrap",children:r.map((z,Q)=>jsxRuntime.jsx(material.Chip,{label:z,size:"small",sx:{borderRadius:999,fontWeight:700,bgcolor:"action.hover",color:"text.primary"}},Q))}):null,n.length>0?jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(110px, 1fr))",gap:1},children:n.map(z=>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:z.label}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1rem",fontWeight:800,lineHeight:1.2},children:z.value})]},z.id))}):null,c,i]})})]})};var vi=({label:e,onPress:t,emphasis:o="default"})=>jsxRuntime.jsx(material.Box,{component:"button",type:"button",onClick:t,sx:a=>({minHeight:72,borderRadius:3,border:"1px solid",borderColor:o==="primary"?"primary.main":"divider",background:o==="primary"?a.palette.primary.main:o==="danger"?a.palette.mode==="dark"?"rgba(239,68,68,0.18)":"rgba(239,68,68,0.10)":a.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}),ZE=({value:e,defaultValue:t="",title:o,subtitle:a,placeholder:r="0",allowDecimal:n=false,allowNegative:i=false,maxLength:c,confirmLabel:d,clearLabel:l,backspaceLabel:s,onChange:g,onSubmit:f,onClose:u,sx:h})=>{let{t:w}=ee(),[p,S]=St.useState(t),m=e??p,y=C=>{e===void 0&&S(C),g?.(C);},b=C=>{c&&m.length>=c||y(`${m}${C}`);},v=C=>{if(C==="00"){if(!m){y("0");return}b("00");return}b(C);},E=()=>{!n||m.includes(".")||y(m?`${m}.`:"0.");},R=()=>{if(i){if(m.startsWith("-")){y(m.slice(1));return}y(m?`-${m}`:"-");}},k=()=>{y(m.slice(0,-1));},B=()=>{y("");},P=()=>{f?.(m);};return jsxRuntime.jsx(material.Paper,{elevation:0,sx:{p:2,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",...h},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,a?jsxRuntime.jsx(material.Typography,{sx:{mt:.5,fontSize:"0.86rem",color:"text.secondary"},children:a}):null]}),u?jsxRuntime.jsx(material.IconButton,{onClick:u,size:"small",children:jsxRuntime.jsx(yk__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||r})}),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(C=>jsxRuntime.jsx(vi,{label:C,onPress:()=>v(C)},C)),jsxRuntime.jsx(vi,{label:i?"+/-":"00",onPress:i?R:()=>v("00")}),jsxRuntime.jsx(vi,{label:"0",onPress:()=>v("0")}),jsxRuntime.jsx(vi,{label:n?".":s?String(s):"DEL",onPress:n?E:k})]}),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:k,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(hk__default.default,{}),jsxRuntime.jsx(material.Typography,{sx:{fontWeight:700},children:s||"DEL"})]})}),jsxRuntime.jsx(vi,{label:String(l||"CLR"),onPress:B,emphasis:"danger"}),jsxRuntime.jsx(material.Box,{component:"button",type:"button",onClick:P,sx:C=>({minHeight:64,borderRadius:3,border:"1px solid",borderColor:"primary.main",background:C.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(bk__default.default,{}),jsxRuntime.jsx(material.Typography,{sx:{fontWeight:800},children:d||w("common.ok")})]})})]})]})})};var Wm=({touchMode:e="comfortable",sx:t,...o})=>{let a=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:a?56:50,borderRadius:3,fontSize:a?"0.98rem":"0.92rem"},"& .MuiInputBase-input":{py:a?1.6:1.25,fontSize:a?"0.98rem":"0.92rem"},"& .MuiInputLabel-root":{fontSize:a?"0.95rem":"0.88rem"},"& .MuiButton-root":{minHeight:a?48:44,px:a?2.25:1.75,borderRadius:3,fontSize:a?"0.95rem":"0.88rem",fontWeight:700},"& .MuiIconButton-root":{width:a?40:36,height:a?40:36},"& .MuiMenuItem-root":{minHeight:a?44:38,fontSize:a?"0.95rem":"0.88rem"},"& .MuiListSubheader-root":{py:1},"& .MuiCheckbox-root":{p:a?1:.75},"& .MuiFormControlLabel-label":{fontSize:a?"0.95rem":"0.88rem"},"& .MuiDialog-paper":{borderRadius:4},"& .MuiDialogTitle-root":{fontSize:a?"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(ha,{...o})})};var Tk=(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);}},Um=({items:e,selectedId:t,orientation:o="auto",onItemSelect:a,sx:r})=>{let n=styles.useTheme(),[i,c]=St.useState(false);St.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,...r},children:e.map(f=>{let u=f.id===t,h=f.color||(u?n.palette.primary.main:n.palette.divider);return jsxRuntime.jsx(material.Paper,{elevation:0,sx:{overflow:"hidden",borderRadius:4,border:"1px solid",borderColor:u?"primary.main":"divider",boxShadow:u?"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:()=>Tk(g,f,a),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:u?"#fff":"text.primary",background:u?h:"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:u?"primary.main":"action.hover",color:u?"#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 jm=(e,t)=>t.trim()?e.reduce((o,a)=>{let r=a.title?.toLowerCase().includes(t.toLowerCase())||a.label?.toLowerCase().includes(t.toLowerCase())||a.description?.toLowerCase().includes(t.toLowerCase()),n=a.children?jm(a.children,t):[];return (r||n.length>0)&&o.push({...a,children:n.length>0?n:a.children}),o},[]):e,Vk=e=>{let t=new Set,o=a=>{a.forEach(r=>{r.children?.length&&(t.add(r.id),o(r.children));});};return o(e),t},Zm=({collapsed:e=false,onToggle:t,className:o="",maxHeight:a,menuData:r=[],colorMode:n="light",orientation:i="auto",headerSlot:c,footerSlot:d,activeHref:l,onItemSelect:s})=>{let{t:g}=ee(),f=styles.useTheme(),u=material.useMediaQuery("(orientation: portrait)"),h=material.useMediaQuery(f.breakpoints.down("md")),w=i==="auto"?u||h?"portrait":"landscape":i,p=n==="dark",S=navigation.useRouter(),m=navigation.usePathname(),[y,b]=St.useState(""),[v,E]=St.useState(new Set),R=St.useMemo(()=>jm(r,y),[r,y]),k=St.useMemo(()=>y.trim()?Vk(R):v,[v,R,y]);St.useEffect(()=>{e&&E(new Set);},[e]);let B=I=>I.appurl||I.href||"",P=I=>{s?.(I);let A=B(I);if(A){if(A.startsWith("http://")||A.startsWith("https://")){window.open(A,"_blank");return}S.push(A);}},C=I=>{let A=!!I.children?.length;if(e&&A){t?.();return}if(A){E(W=>{let z=new Set(W);return z.has(I.id)?z.delete(I.id):z.add(I.id),z});return}P(I);},D=I=>{let A=l||m,W=B(I);return !!(W&&A===W)},T=(I,A=0)=>{let W=!!I.children?.length,z=k.has(I.id),Q=D(I);return jsxRuntime.jsx(material.Box,{sx:{pl:A===0?0:1.5},children:jsxRuntime.jsxs(material.Paper,{elevation:0,sx:{mb:1,overflow:"hidden",borderRadius:3,border:"1px solid",borderColor:Q?"primary.main":"divider",bgcolor:Q?"action.selected":"background.paper"},children:[jsxRuntime.jsxs(material.Box,{component:"button",type:"button",onClick:()=>C(I),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:Q?"primary.main":"action.hover",color:Q?"#fff":"text.primary"},children:I.icon||(I.title||I.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:I.title||I.label}),I.description?jsxRuntime.jsx(material.Typography,{sx:{mt:.4,fontSize:"0.78rem",color:"text.secondary",lineHeight:1.35},children:I.description}):null]}),W?jsxRuntime.jsx(zk__default.default,{sx:{transform:z?"rotate(180deg)":"rotate(0deg)",transition:"transform 180ms ease"}}):jsxRuntime.jsx(Nk__default.default,{color:"action"})]}),W?jsxRuntime.jsx(material.Collapse,{in:z,children:jsxRuntime.jsx(material.Box,{sx:{px:1.25,pb:1.25},children:I.children?.map(re=>T(re,A+1))})}):null]})},I.id)};return e?jsxRuntime.jsx(material.Paper,{elevation:0,className:o,sx:{width:w==="portrait"?"100%":88,p:1,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:p?"#101828":"rgba(255,255,255,0.88)",maxHeight:a?`${a}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(Lk__default.default,{})}),r.map(I=>jsxRuntime.jsx(material.IconButton,{onClick:()=>C(I),sx:{width:56,height:56,alignSelf:"center",borderRadius:3,bgcolor:D(I)?"primary.main":"action.hover",color:D(I)?"#fff":"text.primary"},children:I.icon||(I.title||I.label||"?").slice(0,1).toUpperCase()},I.id))]})}):jsxRuntime.jsx(material.Paper,{elevation:0,className:o,sx:{width:w==="portrait"?"100%":320,p:1.25,borderRadius:5,border:"1px solid",borderColor:"divider",bgcolor:p?"#101828":"rgba(255,255,255,0.88)",maxHeight:a?`${a}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:y,onChange:I=>b(I.target.value),placeholder:g("navigation.searchPlaceholder"),size:"small",fullWidth:true,InputProps:{startAdornment:jsxRuntime.jsx(Ek__default.default,{fontSize:"small",color:"action"})}}),w==="landscape"&&!e?jsxRuntime.jsx(material.IconButton,{onClick:t,sx:{bgcolor:"action.hover"},children:jsxRuntime.jsx(Fk__default.default,{})}):null]}),c,jsxRuntime.jsx(material.Box,{sx:{flex:1,minHeight:0,overflowY:"auto",pr:.25},children:R.length>0?R.map(I=>T(I)):jsxRuntime.jsx(material.Typography,{sx:{p:2,fontSize:"0.88rem",color:"text.secondary",textAlign:"center"},children:g("navigation.noMatch")})}),d]})})};var ag=(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)},Uk=e=>St__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}),Kk=(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)},qk=({summaryRow:e,visibleColumns:t,columns:o})=>{let a=o.filter(r=>t.includes(r.id)&&e[r.id]!=="");return a.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:a.map(r=>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:r.label}),jsxRuntime.jsx(material.Typography,{sx:{mt:.25,fontSize:"0.96rem",fontWeight:800},children:e[r.id]})]},`summary-${r.id}`))})]})})},_k=e=>{let{t}=ee(),o=styles.useTheme(),{title:a,showToolbar:r=true,selectionMode:n,selected:i=[],onSelectionChange:c,actions:d,extraTools:l,fitContainer:s=false,fullWidth:g=false,maxHeight:f,loading:u=false,rowsPerPageOptions:h=[20,50,100,-1],onLayoutSave:w,filterConfig:p,rowKey:S,tableKey:m="default",graphReport:y,quickCreate:b,quickEdit:v,quickDelete:E,serviceUrl:R,orientation:k="auto",cardTitleField:B,cardSubtitleFields:P,toolbarSlot:C,emptyState:D,rowHeight:T="comfortable",cardActionSlot:I,renderCardFooter:A,onRowClick:W}=e,z=a||t("table.title.default"),Q=material.useMediaQuery("(orientation: portrait)"),re=material.useMediaQuery(o.breakpoints.down("md")),ne=k==="auto"?Q||re?"portrait":"landscape":k,{columns:ae,filterText:_,setFilterText:Ue,visibleColumns:Ze,showSummary:Oe,setShowSummary:ie,summaryColumns:we,grouping:Ae,setGrouping:Ye,expandedGroups:st,groupAnchorEl:Z,setGroupAnchorEl:Ke,summaryAnchorEl:xt,setSummaryAnchorEl:X,anchorEl:pe,setAnchorEl:Be,contextMenu:Ee,sortedAndFilteredRows:qe,summaryRow:K,visibleRows:ye,page:be,setPage:xe,rowsPerPage:Qe,setRowsPerPage:He,totalDisplayCount:qt,setSelected:ao,handleClick:ro,toggleSummaryColumn:uo,handleExport:Et,handleCloseContextMenu:De,toggleColumnVisibility:he,toggleGroupExpand:Tt,toggleGroupField:_e,handleExpandGroupRecursively:It,handleCollapseGroupRecursively:mo,handleLayoutLoad:ia,handleVariantLoad:H,handleLayoutSave:$,effectiveAppId:Y,currentLayoutData:Ie,currentLayoutId:Te,layoutIdToLoad:Ve,graphReportOpen:Ce,handleOpenGraphReport:$e,handleCloseGraphReport:M}=on(e),O=y?.enabled??false,U=O&&(y?.interaction?.enabled??true),G=ol(),te=S||"id",Re=St__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]),ze=St__namespace.default.useMemo(()=>({...Re,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)}),[Re,o]),le=St__namespace.default.useMemo(()=>{let V=new Set(i);return qe.filter(se=>V.has(se?.[te]))},[te,i,qe]),Pe=le.length===1?le[0]:null,We=!!b?.enabled,vt=!!v?.enabled,je=!!E?.enabled,gt=b?.fields,Pt=b?.excludeFields||[],no=b?.initialValues||{},Rt=v?.fields,Ft=v?.excludeFields||[],Xt=v?.editableFields||[],Dt=v?.nonEditableFields||[],Xe=v?.primaryKeys?.length?v.primaryKeys:[te],[Eo,_o]=St__namespace.default.useState(false),[la,or]=St__namespace.default.useState(false),[jo,ar]=St__namespace.default.useState({}),[rr,Zo]=St__namespace.default.useState(false),[sa,Aa]=St__namespace.default.useState(false),[Yt,Fo]=St__namespace.default.useState({}),[ca,To]=St__namespace.default.useState(false),[Xo,nr]=St__namespace.default.useState(false),Er=u||la||sa||Xo,Ba=St__namespace.default.useMemo(()=>{let V=[...ae];if(Array.isArray(gt)&&gt.length>0){let se=new Set(gt);V=V.filter(j=>se.has(j.id));}if(Pt.length>0){let se=new Set(Pt);V=V.filter(j=>!se.has(j.id));}return V.filter(se=>!!se?.id)},[ae,Pt,gt]),ir=St__namespace.default.useMemo(()=>{let V=[...ae];if(Array.isArray(Rt)&&Rt.length>0){let se=new Set(Rt);V=V.filter(j=>se.has(j.id));}if(Ft.length>0){let se=new Set(Ft);V=V.filter(j=>!se.has(j.id));}return V.filter(se=>!!se?.id)},[ae,Ft,Rt]),da=St__namespace.default.useMemo(()=>new Set(Xe),[Xe]),io=St__namespace.default.useMemo(()=>new Set(Xt),[Xt]),Lo=St__namespace.default.useMemo(()=>new Set(Dt),[Dt]),Fr=St__namespace.default.useCallback(V=>io.size>0?io.has(V):!(Lo.has(V)||da.has(V)),[io,Lo,da]);St__namespace.default.useEffect(()=>{!Ce&&G.hasActiveFilters&&G.clearAll();},[G,Ce]);let lr=()=>{let V={};Ba.forEach(se=>{V[se.id]=no[se.id]??"";}),ar(V),_o(true);},Lr=(V,se)=>{ar(j=>({...j,[V]:se}));},zr=async()=>{if(!b?.onSubmit){_o(false);return}try{or(!0),await b.onSubmit(jo),_o(!1);}finally{or(false);}},Nr=()=>{if(!Pe)return;let V={};ir.forEach(j=>{V[j.id]=Pe[j.id]??"";});let se=v?.getInitialValues?{...V,...v.getInitialValues(Pe)}:V;Fo(se),Zo(true);},go=(V,se)=>{Fo(j=>({...j,[V]:se}));},Vr=async()=>{if(Pe){if(!v?.onSubmit){Zo(false);return}try{Aa(!0),await v.onSubmit(Yt,Pe),Zo(!1);}finally{Aa(false);}}},Or=()=>{le.length!==0&&To(true);},sr=async()=>{if(le.length===0){To(false);return}if(!E?.onConfirm){To(false),ao([]),c?.([]);return}try{nr(!0),await E.onConfirm(le),To(!1),ao([]),c?.([]);}finally{nr(false);}},pa=qe,{fieldMapping:Ea}=Qr({rows:pa,config:{...y,title:y?.title||`${z} ${t("graph.reportTitle")}`}}),Fa=St__namespace.default.useMemo(()=>U?G.applyRows(pa,Ea):pa,[Ea,G,U,pa]),{model:x}=Qr({rows:Fa,config:{...y,title:y?.title||`${z} ${t("graph.reportTitle")}`,fieldMapping:Ea}}),F=x.table.columns.map(V=>({id:V.id,label:V.label,align:V.align||"left",minWidth:120,numeric:V.align==="right"})),L=Y?jsxRuntime.jsx(ul,{appId:Y,tableKey:m,currentLayoutData:Ie,onLayoutLoad:ia,targetLayoutId:Ve,activeLayoutId:Te,serviceUrl:R??p?.serviceUrl}):null,q=ae.filter(V=>Ze.includes(V.id)),ce=q.find(V=>V.id===B)||q[0],Se=P?.map(V=>q.find(se=>se.id===V)).filter(Boolean)||q.filter(V=>V.id!==ce?.id).slice(0,ne==="portrait"?2:3),N=q.filter(V=>V.id!==ce?.id&&!Se.some(se=>se.id===V.id)),oe=[C,l].filter(Boolean),J=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Wr,{groupAnchorEl:Z,setGroupAnchorEl:Ke,grouping:Ae,setGrouping:Ye,columns:ae,toggleGroupField:_e}),jsxRuntime.jsx($r,{anchorEl:pe,setAnchorEl:Be,columns:ae,visibleColumns:Ze,toggleColumnVisibility:he}),jsxRuntime.jsx(Ni,{anchorEl:xt,setAnchorEl:X,showSummary:Oe,setShowSummary:ie,columns:ae,summaryColumns:we,toggleSummaryColumn:uo}),jsxRuntime.jsx(Vi,{contextMenu:Ee,handleCloseContextMenu:De,columns:ae,visibleColumns:Ze,toggleColumnVisibility:he})]}),nt=(V,se,j)=>{let ge=i.includes(se),Je=ne==="portrait"?"repeat(2, minmax(0, 1fr))":"repeat(auto-fit, minmax(140px, 1fr))",Yo=j%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),cf=styles.alpha(o.palette.divider,.22);return jsxRuntime.jsx(material.Paper,{elevation:0,onClick:()=>{ro({},V),W?.(V);},sx:{p:T==="compact"?1.25:1.5,borderRadius:4,border:"0.5px solid",borderColor:ge?styles.alpha(o.palette.primary.main,.38):cf,background:ge?`linear-gradient(135deg, ${styles.alpha(o.palette.primary.main,.13)}, ${styles.alpha(o.palette.primary.main,.06)})`:`linear-gradient(135deg, ${Yo}, ${styles.alpha(o.palette.primary.main,.015)})`,boxShadow:ge?`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:ge?o.palette.primary.main:j%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:ge,onClick:fo=>fo.stopPropagation(),onChange:()=>ro({},V),sx:{mt:-0.6,ml:-0.6}}):null,jsxRuntime.jsxs(material.Box,{sx:{flex:1,minWidth:0},children:[ce?jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1rem",fontWeight:900,lineHeight:1.25},children:ag(ce,V)}):null,Se.length>0?jsxRuntime.jsx(material.Stack,{direction:"row",spacing:.75,useFlexGap:true,flexWrap:"wrap",sx:{mt:.75},children:Se.map(fo=>jsxRuntime.jsx(material.Chip,{label:`${fo.label}: ${Kk(fo,V)}`,size:"small",variant:"outlined",sx:Re},`${se}-${fo.id}`))}):null]}),I?jsxRuntime.jsx(material.Box,{onClick:fo=>fo.stopPropagation(),children:I(V)}):null]}),N.length>0?jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:Je,gap:1},children:N.map(fo=>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:fo.label}),Uk(ag(fo,V))]},`${se}-${fo.id}-detail`))}):null,A?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsx(material.Box,{onClick:fo=>fo.stopPropagation(),children:A(V)})]}):null]})},se)};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:[p?jsxRuntime.jsx(material.Box,{sx:{mb:2},children:jsxRuntime.jsx(Wm,{...p,onVariantLoad:V=>{H(V),p.onVariantLoad?.(V);},appId:p.appId,tableKey:m,currentLayout:[{tableKey:m,layoutData:Ie}],currentLayoutId:Te,layoutRefs:[{tableKey:m,layoutId:Te}],variantService:p.variantService,serviceUrl:R??p.serviceUrl,touchMode:ne==="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":Er?{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:[r?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(Bi,{filterText:_,setFilterText:Ue,onRowsPerPageChange:He,rowsPerPage:Qe,rowsPerPageOptions:h,page:be,count:qt,onPageChange:xe,actions:d,extraTools:oe,grouping:Ae,setGroupAnchorEl:Ke,showSummary:Oe,setShowSummary:ie,setAnchorEl:Be,setSummaryAnchorEl:X,handleExport:Et,showCreateButton:We,onOpenCreateDialog:lr,showEditButton:vt,onOpenEditDialog:Nr,editDisabled:le.length!==1,showDeleteButton:je,onOpenDeleteConfirm:Or,deleteDisabled:le.length===0,onLayoutSave:w||p?.variantService&&p?.appId?$:void 0,loading:u,layoutManager:L,onOpenGraphReport:O?$e: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:[ye.length===0&&!u?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,ye.map((V,se)=>{if(V.type==="group"){let Je=st.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:()=>Tt(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:[Je?jsxRuntime.jsx(zk__default.default,{}):jsxRuntime.jsx(Nk__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"]})]}),Ae.length>1&&V.level<Ae.length-1?jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:.5,children:[jsxRuntime.jsx(material.Chip,{size:"small",label:t("table.group.expandAll"),onClick:Yo=>{Yo.stopPropagation(),It(V.id);},sx:ze}),jsxRuntime.jsx(material.Chip,{size:"small",label:t("table.group.collapseAll"),onClick:Yo=>{Yo.stopPropagation(),mo(V.id);},sx:ze})]}):null]})},V.id)}let j=V.data||V,ge=V.id||j[te]||se;return nt(j,ge,se)}),Oe?jsxRuntime.jsx(qk,{summaryRow:K,visibleColumns:Ze,columns:ae}):null,u?jsxRuntime.jsx(material.Typography,{sx:{py:1,fontSize:"0.84rem",color:"text.secondary",textAlign:"center"},children:t("common.loading")}):null]})})]}),We?jsxRuntime.jsxs(material.Dialog,{open:Eo,onClose:()=>!la&&_o(false),fullWidth:true,maxWidth:"sm",children:[jsxRuntime.jsx(material.DialogTitle,{sx:{fontSize:"1rem",fontWeight:800},children:b?.title||t("quickCreate.createWithTitle",{title:z})}),jsxRuntime.jsx(material.DialogContent,{sx:{pt:"8px !important"},children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Ba.map(V=>{let se=V.type==="number"||V.numeric?"number":V.type==="date"?"date":"text";return jsxRuntime.jsx(material.TextField,{label:V.label||V.id,value:jo[V.id]??"",onChange:j=>Lr(V.id,j.target.value),type:se,fullWidth:true,InputLabelProps:{shrink:se==="date"?true:void 0}},`quick-create-${V.id}`)}),b?.description?jsxRuntime.jsx(material.Alert,{severity:"info",children:b.description}):null]})}),jsxRuntime.jsxs(material.DialogActions,{sx:{px:3,pb:2},children:[jsxRuntime.jsx(material.Button,{onClick:()=>_o(false),disabled:la,children:b?.cancelLabel||t("common.cancel")}),jsxRuntime.jsx(material.Button,{onClick:zr,variant:"contained",disabled:la,children:b?.submitLabel||t("common.save")})]})]}):null,vt?jsxRuntime.jsxs(material.Dialog,{open:rr,onClose:()=>!sa&&Zo(false),fullWidth:true,maxWidth:"sm",children:[jsxRuntime.jsx(material.DialogTitle,{sx:{fontSize:"1rem",fontWeight:800},children:v?.title||t("quickEdit.editWithTitle",{title:z})}),jsxRuntime.jsx(material.DialogContent,{sx:{pt:"8px !important"},children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[ir.map(V=>{let se=V.type==="number"||V.numeric?"number":V.type==="date"?"date":"text";return jsxRuntime.jsx(material.TextField,{label:V.label||V.id,value:Yt[V.id]??"",onChange:j=>go(V.id,j.target.value),type:se,disabled:!Fr(V.id),fullWidth:true,InputLabelProps:{shrink:se==="date"?true:void 0}},`quick-edit-${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:()=>Zo(false),disabled:sa,children:v?.cancelLabel||t("common.cancel")}),jsxRuntime.jsx(material.Button,{onClick:Vr,variant:"contained",disabled:sa||!Pe,children:v?.submitLabel||t("common.save")})]})]}):null,je?jsxRuntime.jsx(Bn,{open:ca,type:"warning",title:E?.title||t("quickDelete.confirmTitle"),message:E?.message||(le.length>1?t("quickDelete.confirmMessageMultiple",{count:le.length}):t("quickDelete.confirmMessageSingle")),confirmText:E?.confirmText||t("common.delete"),cancelText:E?.cancelText||t("common.cancel"),onClose:()=>!Xo&&To(false),onConfirm:sr}):null,J,O?jsxRuntime.jsx(el,{open:Ce,onClose:M,model:x,aiAssistant:y?.aiAssistant,interaction:U?{enabled:true,filters:G.filters,fieldMapping:Ea,onPrimaryDimensionClick:V=>G.setFilter("primaryDimension",V),onSecondaryDimensionClick:V=>G.setFilter("secondaryDimension",V),onStatusClick:V=>G.setFilter("status",V),onClearFilter:G.clearFilter,onClearAll:G.clearAll}:void 0,tableContent:jsxRuntime.jsx(_k,{appId:Y||"graph-report-internal",title:t("graph.dataBody"),columns:F,rows:x.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false},showSummary:false})}):null]})};var KF=({appTitle:e,children:t,menuData:o=[],workloadItems:a=[],workloadSelectedId:r,showNavigation:n=true,showWorkloadNav:i=true,orientation:c="auto",logo:d,headerSlot:l,actionSlot:s,portraitBottomSlot:g,contentSx:f,containerSx:u,user:h,onSearch:w,defaultNavigationOpen:p,navOpen:S,onNavOpenChange:m,onWorkloadSelect:y,locale:b="en",localeLabel:v,localeOptions:E,onLocaleChange:R,onUserSetting:k,onUserLogout:B,userMenuItems:P,leftHeaderSlot:C,rightHeaderSlot:D})=>{let T="orbcafe:page-layout-mode",[I,A]=St.useState("system"),[W,z]=St.useState("light"),[Q,re]=St.useState(false),[ne,ae]=St.useState(false),_=I==="system"?ne?W:"light":I;St.useEffect(()=>{re(true);},[]),St.useEffect(()=>{try{let Ee=window.localStorage.getItem(T);(Ee==="light"||Ee==="dark"||Ee==="system")&&A(Ee);}catch{}ae(true);let pe=window.matchMedia("(prefers-color-scheme: dark)"),Be=()=>{z(pe.matches?"dark":"light");};return Be(),pe.addEventListener("change",Be),()=>pe.removeEventListener("change",Be)},[]),St.useEffect(()=>{if(ne)try{window.localStorage.setItem(T,I);}catch{}},[ne,I]),St.useEffect(()=>{_==="dark"?(document.documentElement.classList.add("dark"),document.documentElement.style.colorScheme="dark"):(document.documentElement.classList.remove("dark"),document.documentElement.style.colorScheme="light");},[_]);let Ue=St.useMemo(()=>styles.createTheme({palette:_==="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:_==="dark"?"#060913":"#eef3f8"}}},MuiPaper:{styleOverrides:{root:{backgroundImage:"none"}}}}}),[_]),Ze=material.useMediaQuery("(orientation: portrait)"),Oe=material.useMediaQuery(Ue.breakpoints.down("md")),ie=c==="auto"?!Q||Ze||Oe?"portrait":"landscape":c,[we,Ae]=St.useState({landscape:p??true,portrait:false}),Ye=we[ie],st=S??Ye,Z=pe=>{S===void 0&&Ae(Be=>({...Be,[ie]:pe})),m?.(pe);},Ke=jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,alignItems:"center",children:[!Q||n&&ie==="portrait"?jsxRuntime.jsx(material.IconButton,{onClick:()=>Z(!st),sx:{bgcolor:"action.hover"},children:jsxRuntime.jsx(Lk__default.default,{})}):null,C]}),xt=jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,alignItems:"center",children:[s,D]}),X=jsxRuntime.jsx(Zm,{collapsed:ie==="landscape"?!st:false,onToggle:()=>Z(!st),menuData:o,orientation:ie,colorMode:_,maxHeight:ie==="landscape"?900:void 0});return jsxRuntime.jsx(styles.ThemeProvider,{theme:Ue,children:jsxRuntime.jsx(Mi,{locale:b,children:jsxRuntime.jsxs(material.Box,{sx:[pe=>({minHeight:"100vh",display:"flex",flexDirection:"column",background:pe.palette.mode==="dark"?"linear-gradient(180deg, #0A0A0A 0%, #141414 55%, #1A1A1A 100%)":pe.palette.background.default}),...Array.isArray(u)?u:[u]],children:[jsxRuntime.jsx(Bl,{appTitle:e,logo:d===void 0?null:d,mode:I,onToggleMode:()=>A(pe=>pe==="system"?"dark":pe==="dark"?"light":"system"),locale:b,localeLabel:v,localeOptions:E,onLocaleChange:R,user:h,onUserSetting:k,onUserLogout:B,userMenuItems:P,onSearch:w,leftSlot:Ke,rightSlot:xt}),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:[Q&&n&&ie==="landscape"?jsxRuntime.jsx(material.Box,{sx:{p:1.5,pr:0,flexShrink:0},children:X}):null,!Q||n&&ie==="portrait"?jsxRuntime.jsx(material.Drawer,{open:st,onClose:()=>Z(false),PaperProps:{sx:{width:"min(88vw, 360px)",p:1.25,bgcolor:"transparent",boxShadow:"none"}},children:X}):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&&a.length>0?jsxRuntime.jsx(Um,{items:a,selectedId:r,orientation:ie,onItemSelect:y}):null,jsxRuntime.jsx(material.Paper,{elevation:0,sx:{flex:1,minHeight:ie==="portrait"?420:560,p:{xs:1.25,md:1.5},borderRadius:5,border:"1px solid",borderColor:"divider",bgcolor:Ue.palette.mode==="dark"?"rgba(15,23,42,0.72)":"rgba(255,255,255,0.72)",backdropFilter:"blur(12px)",color:"text.primary"},children:t})]})})]}),ie==="portrait"&&g?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsx(material.Box,{sx:{p:1.5},children:g})]}):null]})})})};var cg=uS__default.default(()=>Promise.resolve().then(()=>(sg(),lg)).then(e=>e.COrbCanvas),{ssr:false,loading:()=>jsxRuntime.jsx("div",{className:"h-full w-full bg-transparent"})});function rd({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(cg,{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(cg,{hue:10,hoverIntensity:.8,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})})]})})})}var JF=rd;function rs({onTextUpdate:e,onComplete:t,onError:o,wsUrl:a="ws://localhost:8765",silenceThresholdMs:r=2e3,minVolumeRms:n=.015}){let[i,c]=St.useState(false),d=St.useRef(null),l=St.useRef(null),s=St.useRef(null),g=St.useRef(null),f=St.useRef(null),u=St.useRef(0),h=St.useRef(false),w=St.useRef(false),p=St.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(y=>y.stop()),l.current=null),s.current&&(s.current.close(),s.current=null),w.current=false,c(false);},[]),S=St.useCallback(()=>{h.current||(h.current=true,d.current?.readyState===WebSocket.OPEN&&d.current.send(JSON.stringify({type:"stop"})),setTimeout(p,500));},[p]),m=St.useCallback(async()=>{if(!(i||w.current)){w.current=true,h.current=false,u.current=Date.now();try{let y=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,sampleRate:16e3,echoCancellation:!0,noiseSuppression:!0}});l.current=y;let b=new WebSocket(a);d.current=b,b.onopen=()=>{c(!0),w.current=!1;},b.onmessage=B=>{try{let P=JSON.parse(B.data);if(P.type==="recognition")P.is_final?t(P.text):e?.(P.text);else if(P.type==="error"){let C=P.message||"Voice recognition error";o?.(C),S();}}catch{o?.("Failed to parse voice message");}},b.onerror=()=>{o?.("Voice service connection failed"),p();},b.onclose=()=>{p();};let v=window.AudioContext||window.webkitAudioContext;if(!v)throw new Error("AudioContext is not supported in this browser");let E=new v({sampleRate:16e3});s.current=E;let R=E.createMediaStreamSource(y);f.current=R;let k=E.createScriptProcessor(4096,1,1);g.current=k,k.onaudioprocess=B=>{if(d.current?.readyState!==WebSocket.OPEN)return;let P=B.inputBuffer.getChannelData(0),C=0;for(let I=0;I<P.length;I+=1)C+=P[I]*P[I];if(Math.sqrt(C/P.length)>n)u.current=Date.now();else if(Date.now()-u.current>r&&!h.current){S();return}let T=new Int16Array(P.length);for(let I=0;I<P.length;I+=1){let A=Math.max(-1,Math.min(1,P[I]));T[I]=A<0?A*32768:A*32767;}d.current.send(T.buffer);},R.connect(k),k.connect(E.destination);}catch{o?.("Cannot access microphone"),p();}}},[p,i,n,t,o,e,r,S,a]);return St.useEffect(()=>p,[p]),{isRecording:i,startRecording:m,stopRecording:S}}var pg=St.createContext(null);function kS(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 SS({children:e,onVoiceSubmit:t,onVoicePartial:o,onVoiceError:a,longPressMs:r=200,disableSpaceTrigger:n=false,ignoreWhenFocusedInput:i=true,renderOverlay:c=true,wsUrl:d,silenceThresholdMs:l,minVolumeRms:s}){let[g,f]=St.useState(false),[u,h]=St.useState(false),w=St.useRef(null),p=St.useRef(false),S=St.useRef(false),m=St.useCallback(()=>{S.current=false,f(false);},[]),{isRecording:y,startRecording:b,stopRecording:v}=rs({wsUrl:d,silenceThresholdMs:l,minVolumeRms:s,onTextUpdate:B=>{o?.(B);},onComplete:async B=>{try{B.trim()&&(h(!0),await t(B.trim()));}catch(P){let C=P instanceof Error?P.message:"Failed to process voice command";a?.(C);}finally{h(!1),m();}},onError:B=>{a?.(B),h(!1),p.current||m();}}),E=St.useCallback(async()=>{S.current=false,await b();},[b]),R=St.useCallback(()=>{v();},[v]);St.useEffect(()=>{if(n)return;let B=C=>{C.isComposing||(C.code==="Space"||C.key===" ")&&(p.current||C.repeat||i&&kS(document.activeElement)||(p.current=true,C.preventDefault(),w.current=setTimeout(()=>{S.current=true,f(true),b();},r)));},P=C=>{(C.code==="Space"||C.key===" ")&&(w.current&&(clearTimeout(w.current),w.current=null),p.current=false,S.current&&(C.preventDefault(),f(false),v()));};return window.addEventListener("keydown",B),window.addEventListener("keyup",P),()=>{window.removeEventListener("keydown",B),window.removeEventListener("keyup",P),w.current&&(clearTimeout(w.current),w.current=null);}},[n,i,r,b,v]);let k=St.useMemo(()=>({isRecording:y,isHotkeyRecording:g,isSubmitting:u,startRecording:E,stopRecording:R}),[g,y,u,E,R]);return jsxRuntime.jsxs(pg.Provider,{value:k,children:[c?jsxRuntime.jsx(rd,{isRecording:g}):null,e]})}function wS(){let e=St.useContext(pg);if(!e)throw new Error("useAINav must be used within CAINavProvider");return e}var lL=SS,sL=wS;function Le(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var AS=({content:e,theme:t="light",size:o="base",defaultExpanded:a=false})=>{let[r,n]=St.useState(a),i=St.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(!r),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 ${r?"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"})})]}),r&&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})]})},ug=AS;var OS=({content:e,language:t="text",isStreaming:o=false,className:a=""})=>{let{theme:r}=nextThemes.useTheme(),[n,i]=St.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=r==="dark"?prism.oneDark:prism.oneLight;return jsxRuntime.jsxs("div",{className:Le("rounded-lg overflow-hidden border border-gray-200 dark:border-gray-700 my-4",a),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:r==="dark"?"#1f2937":"#ffffff"},wrapLongLines:true,children:e})})]})},gg=OS;var GS=({content:e,isLoading:t,className:o="",style:a})=>{let r=St.useRef(null),[n,i]=St.useState(false),[c,d]=St.useState(null),{theme:l}=nextThemes.useTheme();return St.useEffect(()=>{let s=async()=>{if(!(!e.trim()||!r.current)){i(true),d(null);try{hg__default.default.initialize({startOnLoad:!1,theme:l==="dark"?"dark":"default",securityLevel:"loose",fontFamily:"inherit"});let f=`mermaid-${Math.random().toString(36).substr(2,9)}`,u=e.replace(/```mermaid\n?|\n?```/g,"").trim(),{svg:h}=await hg__default.default.render(f,u);r.current&&(r.current.innerHTML=h);}catch(f){console.error("Mermaid render failed:",f),d(f instanceof Error?f.message:"Render failed"),r.current&&(r.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:a,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:a,ref:r})},bg=GS;var ZS=({title:e="\u53D1\u751F\u9519\u8BEF",content:t,errorCode:o,stack:a,icon:r,closable:n=true,onClose:i,onRetry:c,className:d="",...l})=>{let[s,g]=St.useState(false),[f,u]=St.useState(false),h=async()=>{if(c){u(true);try{await c();}catch(w){console.error("\u91CD\u8BD5\u5931\u8D25:",w);}finally{u(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:r||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||a)&&jsxRuntime.jsxs("div",{className:"flex items-center space-x-4 mt-2",children:[c&&jsxRuntime.jsxs("button",{onClick:h,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"]}),a&&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"})})]}),a&&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:a})})]})},ns=ZS;var tw=({title:e="\u8B66\u544A",content:t,warningType:o,severity:a="warning",warnings:r=[],icon:n,closable:i=true,onClose:c,onConfirm:d,actionText:l,className:s="",...g})=>{let f=()=>{switch(a){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"}}},u=()=>{switch(a){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"})}},h=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 ${h.borderLeftColor} ${h.bgColor}`,children:[jsxRuntime.jsx("div",{className:`flex-shrink-0 mr-3 ${h.iconColor}`,children:n||u()}),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}),r&&r.length>0&&jsxRuntime.jsx("ul",{className:"mt-2 space-y-1",children:r.map((w,p)=>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:w})]},p))})]}),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"})})]})},is=tw;var nw=({title:e="\u76F8\u5173\u63A8\u8350",content:t,suggestions:o,onSuggestionClick:a,maxDisplay:r=5,icon:n,closable:i=false,onClose:c,className:d="",...l})=>{let[s,g]=St.useState(false),[f,u]=St.useState(""),[h,w]=St.useState(false),p=St.useMemo(()=>f.trim()?o.filter(y=>y.toLowerCase().includes(f.toLowerCase())):o,[o,f]),S=St.useMemo(()=>s?p:p.slice(0,r),[p,s,r]),m=y=>{a?.(y);};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:()=>w(!h),className:`p-1.5 rounded-md transition-colors ${h?"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:h?"\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"})})]})]}),h&&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:y=>u(y.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:S.map((y,b)=>jsxRuntime.jsx("li",{children:jsxRuntime.jsxs("button",{onClick:()=>m(y),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:y}),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"})]})},b))}),p.length>r&&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 (${p.length})`}),p.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"})]})]})},ls=nw;var uw=({title:e,content:t,toolName:o,parameters:a,result:r,status:n,duration:i,icon:c,closable:d=false,onClose:l,onAction:s,actionText:g,className:f="",...u})=>{let[h,w]=St.useState(false),[p,S]=St.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"}}},y=()=>{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"})}},b=R=>R?R<1e3?`${R}ms`:`${(R/1e3).toFixed(2)}s`:"",v=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}`,...u,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 ${v.iconColor}`,children:c||y()}),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 ${v.badgeBg} ${v.badgeText}`,children:v.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"}),b(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}),a&&jsxRuntime.jsxs("div",{className:"mb-3",children:[jsxRuntime.jsxs("button",{onClick:()=>w(!h),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:[h?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"]}),h&&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(a,null,2)})})]}),r&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("button",{onClick:()=>S(!p),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:[p?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"]}),p&&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 r=="string"?r:JSON.stringify(r,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"})})]})]})},ss=uw;var gw=({data:e})=>{if(!e)return null;let t=St.useMemo(()=>{let o=[],a=[],r="\u6570\u636E\u8868\u683C";return Array.isArray(e)?(o=e,o.length>0&&(a=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"&&(r=e.title||r,o=Array.isArray(e.rows)?e.rows:Array.isArray(e.data)?e.data:[],Array.isArray(e.columns)?a=e.columns.map(i=>({id:i.key||i.id,label:i.title||i.label,numeric:i.dataType==="number"||i.numeric})):o.length>0&&(a=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:r,columns:a,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(Ua,{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]})})},cs=gw;var Sw=({title:e,subtitle:t,data:o,type:a,config:r={}})=>{let n=()=>{switch(a){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&&a!=="google-map-card"&&a!=="amap-card")return jsxRuntime.jsx("div",{className:"text-gray-500 text-sm p-4 text-center",children:"No data available"});try{switch(a){case "bar-chart-card":return jsxRuntime.jsx(Hn,{data:o,orientation:r.orientation||"horizontal",valueSuffix:r.valueSuffix||"",minHeight:r.minHeight});case "line-chart-card":return jsxRuntime.jsx(pp,{data:o,color:r.color,valueSuffix:r.valueSuffix||"",height:r.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(qi,{data:d,variant:r.variant||"donut",size:r.size,colors:r.colors});case "combo-chart-card":return jsxRuntime.jsx(up,{data:o,barColor:r.barColor,lineColor:r.lineColor});case "heatmap-chart-card":return jsxRuntime.jsx(gp,{data:o});case "fishbone-chart-card":return jsxRuntime.jsx(hp,{branches:o,effect:r.effect||e||"Problem"});case "waterfall-chart-card":return jsxRuntime.jsx(bp,{data:o,height:r.height});case "google-map-card":return jsxRuntime.jsx(Cp,{embedUrl:r.embedUrl||o&&o[0]?.embedUrl,apiKey:r.apiKey,query:r.query||o&&o[0]?.query||e,height:r.height});case "amap-card":return jsxRuntime.jsx(Tp,{embedUrl:r.embedUrl||o&&o[0]?.embedUrl,keyword:r.keyword||o&&o[0]?.keyword||e,height:r.height});default:return jsxRuntime.jsxs("div",{className:"text-gray-500 text-sm p-4 text-center",children:["Unsupported chart type: ",a]})}}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)})]})})]})]})},ds=Sw;var Tw=({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)})})})]}),us=Tw;var ms=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 Aw=({content:e,theme:t,size:o="base",className:a,enableCodeHighlight:r=true,enableMermaid:n=true,messageId:i,cardHooks:c})=>{let d=St.useMemo(()=>e?e.replace(/<think>([\s\S]*?)<\/think>/g,(f,u)=>`<div data-component="thinkbox" data-think-content="${encodeURIComponent(u.trim())}"></div>`):"",[e]),l=(f,u,h,w,p)=>{c?.onCardEvent?.({messageId:i,cardType:f,action:u,title:h,payload:w,rawData:p});},s=(f,u,h,w,p,S)=>{if(!(!p&&!c?.onCardEvent))return (...m)=>{let y=p?.(...m),b=S?S(...m):void 0;return l(f,u,h,b,w),y}},g=St.useMemo(()=>({div(f){let{"data-component":u,"data-think-content":h,...w}=f;return u==="thinkbox"&&h?jsxRuntime.jsx(ug,{content:decodeURIComponent(h),theme:t,size:o,defaultExpanded:false}):jsxRuntime.jsx("div",{...w})},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:u}){return jsxRuntime.jsx("th",{className:`px-3 py-2 font-semibold text-gray-800 dark:text-gray-100 ${u==="center"?"text-center":u==="right"?"text-right":"text-left"}`,children:f})},td({children:f,align:u}){return jsxRuntime.jsx("td",{className:`px-3 py-2 text-gray-700 dark:text-gray-200 align-top ${u==="center"?"text-center":u==="right"?"text-right":"text-left"}`,children:f})},code({inline:f,className:u,children:h,...w}){let p=/language-([\w-]+)/.exec(u||""),S=p?p[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",...w,children:h});let m=String(h).replace(/\n$/,"");if(n&&S==="mermaid")return jsxRuntime.jsx(bg,{content:m});if(S==="json"){let y=ms(m);if(y)switch(y.type){case "table":return jsxRuntime.jsx(cs,{data:y.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(ds,{...y});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return jsxRuntime.jsx(us,{...y});case "error-card":{let b=y;return jsxRuntime.jsx(ns,{...b,onClose:s("error-card","close",b.title,b,b.onClose),onRetry:s("error-card","retry",b.title,b,b.onRetry)})}case "warning-card":{let b=y,v=b.onConfirm?s("warning-card","confirm",b.title,b,b.onConfirm):b.actionText&&c?.onCardEvent?s("warning-card","confirm",b.title,b):void 0;return jsxRuntime.jsx(is,{...b,onClose:s("warning-card","close",b.title,b,b.onClose),onConfirm:v})}case "suggestions-card":{let b=y;return jsxRuntime.jsx(ls,{...b,onClose:s("suggestions-card","close",b.title,b,b.onClose),onSuggestionClick:s("suggestions-card","suggestion-click",b.title,b,b.onSuggestionClick,v=>({suggestion:v}))})}case "tool-result-card":{let b=y;return jsxRuntime.jsx(ss,{...b,onClose:s("tool-result-card","close",b.title,b,b.onClose),onAction:s("tool-result-card","action",b.title,b,b.onAction)})}}}return r?jsxRuntime.jsx(gg,{content:m,language:S,className:"not-prose"}):jsxRuntime.jsx("code",{className:u,...w,children:h})}}),[t,o,n,r,c,i]);return jsxRuntime.jsx("div",{className:Le("markdown-body prose dark:prose-invert max-w-none",a),children:jsxRuntime.jsx(Iw__default.default,{remarkPlugins:[Pw__default.default,Rw__default.default],rehypePlugins:[Dw__default.default,Mw__default.default],components:g,children:d})})},gs=Aw;var Bw=({content:e,messageId:t,cardHooks:o})=>{let a=(i,c,d,l,s)=>{o?.onCardEvent?.({messageId:t,cardType:i,action:c,title:d,payload:l,rawData:s});},r=(i,c,d,l,s,g)=>{if(!(!s&&!o?.onCardEvent))return (...f)=>{let u=s?.(...f),h=g?g(...f):void 0;return a(i,c,d,h,l),u}},n=ms(e);if(n)switch(n.type){case "table":return jsxRuntime.jsx(cs,{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(ds,{...n});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return jsxRuntime.jsx(us,{...n});case "error-card":{let i=n;return jsxRuntime.jsx(ns,{...i,onClose:r("error-card","close",i.title,i,i.onClose),onRetry:r("error-card","retry",i.title,i,i.onRetry)})}case "warning-card":{let i=n,c=i.onConfirm?r("warning-card","confirm",i.title,i,i.onConfirm):i.actionText&&o?.onCardEvent?r("warning-card","confirm",i.title,i):void 0;return jsxRuntime.jsx(is,{...i,onClose:r("warning-card","close",i.title,i,i.onClose),onConfirm:c})}case "suggestions-card":{let i=n;return jsxRuntime.jsx(ls,{...i,onClose:r("suggestions-card","close",i.title,i,i.onClose),onSuggestionClick:r("suggestions-card","suggestion-click",i.title,i,i.onSuggestionClick,c=>({suggestion:c}))})}case "tool-result-card":{let i=n;return jsxRuntime.jsx(ss,{...i,onClose:r("tool-result-card","close",i.title,i,i.onClose),onAction:r("tool-result-card","action",i.title,i,i.onAction)})}}return jsxRuntime.jsx("div",{className:"dynamic-card-fallback",children:jsxRuntime.jsx(gs,{content:e,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:t,cardHooks:o})})},Rg=Bw;var md=class{static analyze(t){if(!t.trim())return {blocks:[],hasComplexContent:false,overallType:"simple"};let a=/```json\s*\{\s*"type":\s*"[^"]+"/g.test(t),r=/<[^>]+>[\s\S]*?<\/[^>]+>/.test(t),n=t.includes("NQ#")||t.includes("data-component");return a||r||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"}}},Fw=({content:e,className:t="",messageId:o,cardHooks:a})=>{let r=St__namespace.default.useMemo(()=>md.analyze(e),[e]);return jsxRuntime.jsx("div",{className:`universal-content-renderer ${t}`,children:r.blocks.map((n,i)=>n.type==="mixed"||n.type==="json-card"?jsxRuntime.jsx(Rg,{content:n.content,messageId:o,cardHooks:a},`block-${i}`):jsxRuntime.jsx(gs,{content:n.content,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:o,cardHooks:a},`block-${i}`))})},Dg=Fw;var Lw=({content:e,isStreaming:t=true,onComplete:o,className:a="",streamIntervalMs:r=24,streamChunkSize:n=3,messageId:i,cardHooks:c})=>{let[d,l]=St.useState(t?0:e.length),[s,g]=St.useState(!t);St.useEffect(()=>{if(t){l(0),g(false);return}l(e.length),g(true);},[e,t]),St.useEffect(()=>{if(!t||s)return;if(d>=e.length){g(true),o?.();return}let p=window.setTimeout(()=>{l(S=>Math.min(S+n,e.length));},r);return ()=>{window.clearTimeout(p);}},[e.length,s,t,o,n,r,d]);let f=()=>{t&&!s&&(l(e.length),g(true),o?.());},u=t?e.slice(0,d):e,h=t&&!s,w=t&&!s;return jsxRuntime.jsxs("div",{className:`streaming-markdown ${a}`,onClick:f,style:{cursor:t?"pointer":"default"},children:[jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx(Dg,{content:u,messageId:i,cardHooks:c}),h&&jsxRuntime.jsx("span",{className:"inline-block w-0.5 h-5 bg-blue-500 ml-1 animate-pulse",style:{verticalAlign:"text-bottom"}})]}),w&&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"})]})},Eg=Lw;var Fg=({buttons:e,className:t})=>{let o=a=>{switch(a){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:Le("flex items-center gap-1",t),children:e.map((a,r)=>jsxRuntime.jsx("button",{onClick:a.onClick,disabled:a.disabled,className:Le("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",a.active&&"text-blue-600 bg-blue-50 dark:text-blue-400 dark:bg-blue-900/20",a.type==="refresh"&&a.disabled&&"animate-spin"),title:a.type,type:"button",children:o(a.type)},`${a.type}-${r}`))})};var fs=({message:e,onStreamingComplete:t,assistantActions:o,streamIntervalMs:a,streamChunkSize:r,cardHooks:n})=>e.type==="assistant"?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(Eg,{content:e.content,isStreaming:e.isStreaming??false,onComplete:t,streamIntervalMs:a,streamChunkSize:r,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(Fg,{buttons:[{type:"refresh",onClick:()=>o?.onRegenerate?.(),disabled:!o?.onRegenerate},{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()})]})}):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 zg=({onTextUpdate:e,onComplete:t,onCancel:o,disabled:a,className:r})=>{let{isRecording:n,startRecording:i,stopRecording:c}=rs({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:a,className:Le("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",a&&"opacity-50 cursor-not-allowed",r),title:n?"Stop recording":"Start recording",type:"button",children:n?jsxRuntime.jsx($w__default.default,{sx:{fontSize:24}}):jsxRuntime.jsx(Ww__default.default,{sx:{fontSize:24}})})};var wt={container:"w-full max-w-4xl mx-auto",inputContainer:Le("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:Le("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:Le("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:Le("bg-transparent hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-500 dark:text-gray-400","cursor-pointer active:scale-95"),sendButton:Le("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:Le("cursor-not-allowed opacity-40 bg-transparent text-gray-400"),stopButton:Le("cursor-pointer bg-red-500 hover:bg-red-600 text-white shadow-sm active:scale-95")},Xw={padding:0,lineHeight:"1.5",border:"none !important",boxShadow:"none !important",backgroundColor:"transparent",height:"auto",fontFeatureSettings:'"liga" 1, "kern" 1',WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},Yw=({enabled:e,onClick:t})=>jsxRuntime.jsx("button",{className:Le(wt.buttonBase,wt.buttonSmall,wt.buttonNormal),onClick:t,disabled:!e,"aria-label":"Upload file",type:"button",children:jsxRuntime.jsx(jw__default.default,{sx:{fontSize:24}})}),Qw=()=>jsxRuntime.jsxs("button",{className:Le(wt.buttonBase,"h-10 px-3 py-2 gap-1.5 rounded-full",wt.buttonNormal),"aria-label":"Tools",type:"button",children:[jsxRuntime.jsx(Zw__default.default,{sx:{fontSize:20}}),jsxRuntime.jsx("span",{className:"text-sm font-medium",children:"Tools"})]}),Jw=({canSend:e,isResponding:t,onSend:o,onStop:a})=>t?jsxRuntime.jsx("button",{className:Le(wt.buttonBase,wt.buttonSmall,wt.stopButton),onClick:a,"aria-label":"Stop generating",type:"button",children:jsxRuntime.jsx(iconsMaterial.Stop,{sx:{fontSize:20}})}):jsxRuntime.jsx("button",{className:Le(wt.buttonBase,wt.buttonSmall,e?wt.sendButton:wt.sendButtonDisabled),onClick:o,disabled:!e,"aria-label":"Send message",type:"button",children:jsxRuntime.jsx(_w__default.default,{sx:{fontSize:24},className:e?"text-gray-500 dark:text-gray-400":"text-gray-300 dark:text-gray-600"})}),Ng=({onSend:e,onStop:t,isResponding:o=false,placeholder:a,getText:r})=>{let[n,i]=St.useState(""),[c,d]=St.useState([]),[l,s]=St.useState(false),[g,f]=St.useState(false),u=St.useRef(null),h=a||(r?r("00019","Type a message..."):"Type a message..."),w=(n.trim().length>0||c.length>0)&&!o,p={enabled:true},S=St.useCallback(A=>{i(A.target.value),A.target.style.height="auto",A.target.style.height=`${Math.min(A.target.scrollHeight,200)}px`;},[]),m=St.useCallback(A=>{if(A.target.files&&A.target.files.length>0){let W=Array.from(A.target.files);d(z=>{let Q=W.filter(ne=>z.some(ae=>ae.name===ne.name&&ae.size===ne.size));Q.length>0&&console.warn("Duplicate files ignored:",Q.map(ne=>ne.name));let re=W.filter(ne=>!z.some(ae=>ae.name===ne.name&&ae.size===ne.size));return [...z,...re]}),u.current&&(u.current.value="");}},[]),y=St.useCallback(A=>{d(W=>W.filter((z,Q)=>Q!==A));},[]),b=St.useCallback(()=>{u.current?.click();},[]),v=St.useCallback(async()=>{if(!w)return;let A=n,W=[...c];i(""),d([]),u.current&&(u.current.value="");try{await e(A,W);}catch(z){console.error("Failed to send message:",z),i(A),d(W);}},[n,w,e,c]),E=St.useCallback(A=>{A.key==="Enter"&&!A.shiftKey&&!l&&(A.preventDefault(),v());},[v,l]),R=St.useCallback(()=>{s(true);},[]),k=St.useCallback(()=>{s(false);},[]),B=St.useCallback(A=>{i(A);},[]),P=St.useCallback(A=>{i(A);},[]),C=St.useCallback(()=>{},[]),D=St.useCallback(A=>{A.preventDefault(),f(true);},[]),T=St.useCallback(A=>{A.preventDefault(),f(false);},[]),I=St.useCallback(A=>{if(A.preventDefault(),f(false),A.dataTransfer.files&&A.dataTransfer.files.length>0){let W=Array.from(A.dataTransfer.files);d(z=>[...z,...W]);}},[]);return jsxRuntime.jsx("div",{className:wt.container,children:jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("input",{type:"file",multiple:true,className:"hidden",ref:u,onChange:m}),jsxRuntime.jsxs("div",{className:Le(wt.inputContainer,g&&wt.dragActive),style:{borderRadius:"32px"},onDragOver:D,onDragLeave:T,onDrop:I,children:[c.length>0&&jsxRuntime.jsx("div",{className:wt.filePreviewArea,children:c.map((A,W)=>jsxRuntime.jsxs("div",{className:wt.fileTag,children:[jsxRuntime.jsx(iconsMaterial.InsertDriveFile,{sx:{fontSize:16},className:"text-blue-500"}),jsxRuntime.jsx("span",{className:"truncate max-w-[150px]",children:A.name}),jsxRuntime.jsx("button",{onClick:()=>y(W),className:"ml-1 hover:text-red-500 focus:outline-none",type:"button",children:jsxRuntime.jsx(iconsMaterial.Close,{sx:{fontSize:16}})})]},`${A.name}-${W}`))}),jsxRuntime.jsxs("div",{className:"flex flex-col w-full p-2",children:[jsxRuntime.jsx("div",{className:Le(wt.textareaWrapper,"px-3 pt-2 pb-3 min-h-[60px]"),children:jsxRuntime.jsx("textarea",{className:Le(wt.textarea,"min-h-[24px] py-0 px-0"),placeholder:h,value:n,onChange:S,onKeyDown:E,onCompositionStart:R,onCompositionEnd:k,style:Xw,"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(Yw,{enabled:p.enabled,onClick:b}),jsxRuntime.jsx(Qw,{})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(zg,{onTextUpdate:B,onComplete:P,onCancel:C,disabled:o,className:wt.buttonSmall}),jsxRuntime.jsx(Jw,{canSend:w,isResponding:o,onSend:v,onStop:t})]})]})]})]})]})})};var Hg=({messages:e,onSend:t,onStop:o,onRegenerate:a,isResponding:r=false,className:n,placeholder:i,streamIntervalMs:c,streamChunkSize:d,onMessageStreamingComplete:l,cardHooks:s,showInput:g=true})=>{let f=St.useRef(null),u=St.useRef(e.length);return St.useEffect(()=>{e.length>u.current&&f.current?.scrollIntoView({behavior:"smooth"}),u.current=e.length;},[e]),jsxRuntime.jsxs("div",{className:Le("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((h,w)=>{let p=h.type==="assistant"&&w===e.length-1,S=h.type==="assistant"?{isLatestAssistant:p,onRegenerate:a?()=>a(h.id):void 0}:void 0;return jsxRuntime.jsx(fs,{message:h,assistantActions:S,onStreamingComplete:()=>l?.(h.id),streamIntervalMs:c,streamChunkSize:d,cardHooks:s},h.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(Ng,{onSend:t||(async()=>{}),onStop:o||(()=>{}),isResponding:r,placeholder:i})})]})};var So={};var o1={idle:"Idle",running:"Running",success:"Success",error:"Error",pending:"Pending"},EN=({title:e="AI Agent",description:t,headerActions:o,className:a,agentStatus:r,showInput:n=false,...i})=>{let c=r??(i.isResponding?"running":"idle");return jsxRuntime.jsxs("div",{className:Le("relative flex h-full w-full",So.agentPanel,a),"data-status":c,children:[jsxRuntime.jsx("div",{className:So.colorHalo,"data-status":c,"aria-hidden":"true"}),jsxRuntime.jsxs("div",{className:So.marqueeBorder,"data-status":c,"aria-hidden":"true",children:[jsxRuntime.jsx("span",{className:Le(So.edge,So.top)}),jsxRuntime.jsx("span",{className:Le(So.edge,So.right)}),jsxRuntime.jsx("span",{className:Le(So.edge,So.bottom)}),jsxRuntime.jsx("span",{className:Le(So.edge,So.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:"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",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:So.statusDot,"data-status":c}),jsxRuntime.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-gray-600 dark:text-gray-300",children:o1[c]})]}),o]})]}),jsxRuntime.jsx("div",{className:"flex-1 min-h-0 relative z-10",children:jsxRuntime.jsx(Hg,{...i,showInput:n})})]})]})};var l1={"top-left":"bottom-right","top-right":"bottom-left","bottom-left":"top-right","bottom-right":"top-left"},WN=({messages:e,onSend:t,onRegenerate:o,isResponding:a=false,className:r,placeholder:n,title:i="Copilot",corner:c="bottom-right",onCollapse:d,onHeaderPointerDown:l,onPlusClick:s,onMicClick:g,streamIntervalMs:f,streamChunkSize:u,onMessageStreamingComplete:h,cardHooks:w})=>{let[p,S]=St.useState(""),[m,y]=St.useState(false),b=St.useRef(null),v=l1[c];St.useEffect(()=>{b.current?.scrollIntoView({behavior:"smooth"});},[e,a]);let E=St.useCallback(async()=>{let k=p.trim();!k||a||(S(""),await t(k));},[a,t,p]),R=St.useCallback(async k=>{k.key==="Enter"&&!m&&(k.preventDefault(),await E());},[E,m]);return jsxRuntime.jsxs("div",{className:Le("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",r),children:[d&&jsxRuntime.jsx("button",{onClick:d,className:Le("absolute z-20 flex h-10 w-10 items-center justify-center rounded-full transition-colors hover:bg-transparent dark:hover:bg-transparent",v==="top-left"&&"-left-2 -top-2",v==="top-right"&&"-right-2 -top-2",v==="bottom-left"&&"-bottom-2 -left-2",v==="bottom-right"&&"-bottom-2 -right-2"),type:"button","aria-label":"Collapse Copilot",children:jsxRuntime.jsx("span",{className:Le("block h-4 w-4 border-[#21BCFF]",v==="top-left"&&"rounded-tl-full border-l-[3px] border-t-[3px]",v==="top-right"&&"rounded-tr-full border-r-[3px] border-t-[3px]",v==="bottom-left"&&"rounded-bl-full border-b-[3px] border-l-[3px]",v==="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((k,B)=>{let P=k.type==="assistant"&&B===e.length-1,C=k.type==="assistant"?{isLatestAssistant:P,onRegenerate:o?()=>o(k.id):void 0}:void 0;return jsxRuntime.jsx(fs,{message:k,assistantActions:C,onStreamingComplete:()=>h?.(k.id),streamIntervalMs:f,streamChunkSize:u,cardHooks:w},k.id)}),jsxRuntime.jsx("div",{ref:b})]}),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:p,onChange:k=>S(k.target.value),onCompositionStart:()=>y(true),onCompositionEnd:()=>y(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 KN=({defaultMode:e="login",onLogin:t,onRegister:o,onForgotPassword:a}={})=>{let[r,n]=St.useState(e),[i,c]=St.useState(false),d=St.useCallback(async u=>{c(true);try{await u?.();}finally{c(false);}},[]),l=St.useCallback(u=>d(()=>t?.(u)),[t,d]),s=St.useCallback(u=>d(()=>o?.(u)),[o,d]),g=St.useCallback(u=>d(()=>a?.(u)),[a,d]),f=St.useMemo(()=>({mode:r,loading:i,onModeChange:n,onLogin:l,onRegister:s,onForgotPassword:g}),[g,l,s,i,r]);return {mode:r,loading:i,setMode:n,authPageProps:f}};var hd=({label:e,...t})=>jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{...t}),label:e});var Ii=St.forwardRef((e,t)=>jsxRuntime.jsx(material.Paper,{ref:t,...e,elevation:e.elevation||1,sx:{p:2,mb:2,...e.sx}}));Ii.displayName="CPaper";var v1={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."},pV=({mode:e,defaultMode:t="login",onModeChange:o,onLogin:a,onRegister:r,onForgotPassword:n,loading:i=false,logo:c,copy:d,sx:l})=>{let s=material.useTheme(),g=e!==void 0,[f,u]=St.useState(t),h=e??f,w=St.useMemo(()=>({...v1,...d}),[d]),[p,S]=St.useState({username:"demo@orbcafe.local",password:"orbcafe-demo",remember:true}),[m,y]=St.useState({name:"",email:"",password:"",confirmPassword:"",acceptedTerms:false}),[b,v]=St.useState({email:""}),[E,R]=St.useState(""),k=I=>{g||u(I),R(""),o?.(I);},B=async I=>{I.preventDefault(),await a?.(p),R("Demo login accepted. No real authentication request was sent.");},P=async I=>{I.preventDefault(),await r?.(m),R("Demo registration saved locally for this screen.");},C=async I=>{I.preventDefault(),await n?.(b),R("Demo reset link request created. No email was sent.");},D=h==="login"?w.loginTitle:h==="register"?w.registerTitle:w.forgotTitle,T=h==="login"?w.loginSubtitle:h==="register"?w.registerSubtitle:w.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:w.productName}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:{md:34,lg:42},lineHeight:1.06,fontWeight:800},children:w.headline}),jsxRuntime.jsx(material.Typography,{sx:{maxWidth:460,color:"text.secondary",fontSize:16,lineHeight:1.7},children:w.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(Ii,{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:T})]}),E&&jsxRuntime.jsx(material.Alert,{severity:"success",children:E}),h==="login"&&jsxRuntime.jsx(material.Box,{component:"form",onSubmit:B,children:jsxRuntime.jsxs(material.Stack,{spacing:2,children:[jsxRuntime.jsx(Qt,{label:"Email or user ID",value:p.username,onChange:I=>S(A=>({...A,username:I.target.value})),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(qg__default.default,{fontSize:"small"})})}}),jsxRuntime.jsx(Qt,{label:"Password",type:"password",value:p.password,onChange:I=>S(A=>({...A,password:I.target.value})),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(b1__default.default,{fontSize:"small"})})}}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:2},children:[jsxRuntime.jsx(hd,{label:"Remember me",checked:p.remember,onChange:I=>S(A=>({...A,remember:I.target.checked}))}),jsxRuntime.jsx(zo,{type:"button",variant:"text",size:"small",onClick:()=>k("forgot"),children:"Forgot?"})]}),jsxRuntime.jsx(zo,{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(zo,{type:"button",variant:"text",size:"small",onClick:()=>k("register"),sx:{minWidth:0,p:0},children:"Register"})]})]})}),h==="register"&&jsxRuntime.jsx(material.Box,{component:"form",onSubmit:P,children:jsxRuntime.jsxs(material.Stack,{spacing:2,children:[jsxRuntime.jsx(Qt,{label:"Full name",value:m.name,onChange:I=>y(A=>({...A,name:I.target.value})),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(qg__default.default,{fontSize:"small"})})}}),jsxRuntime.jsx(Qt,{label:"Work email",type:"email",value:m.email,onChange:I=>y(A=>({...A,email:I.target.value})),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(Kg__default.default,{fontSize:"small"})})}}),jsxRuntime.jsx(Qt,{label:"Password",type:"password",value:m.password,onChange:I=>y(A=>({...A,password:I.target.value})),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(x1__default.default,{fontSize:"small"})})}}),jsxRuntime.jsx(Qt,{label:"Confirm password",type:"password",value:m.confirmPassword,onChange:I=>y(A=>({...A,confirmPassword:I.target.value}))}),jsxRuntime.jsx(hd,{label:"I accept the demo workspace terms",checked:m.acceptedTerms,onChange:I=>y(A=>({...A,acceptedTerms:I.target.checked}))}),jsxRuntime.jsx(zo,{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(zo,{type:"button",variant:"text",size:"small",onClick:()=>k("login"),sx:{minWidth:0,p:0},children:"Sign in"})]})]})}),h==="forgot"&&jsxRuntime.jsx(material.Box,{component:"form",onSubmit:C,children:jsxRuntime.jsxs(material.Stack,{spacing:2,children:[jsxRuntime.jsx(Qt,{label:"Work email",type:"email",value:b.email,onChange:I=>v({email:I.target.value}),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(Kg__default.default,{fontSize:"small"})})}}),jsxRuntime.jsx(zo,{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(zo,{type:"button",variant:"text",size:"small",onClick:()=>k("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 S1={keyword:{value:"",operator:"contains"},status:{value:"",operator:"equals"},owner:{value:"",operator:"contains"},workCenter:{value:"",operator:"contains"}},w1=[{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"}],_g=({tasks:e,defaultScale:t="week",defaultSelectedTaskId:o,initialFilters:a,filterFields:r,filterAppId:n="planning-gantt-filter",filterTableKey:i="planning",columns:c,page:d,rowsPerPage:l,rowsPerPageOptions:s,count:g,onPageChange:f,onRowsPerPageChange:u,onFilterSearch:h,onFilterVariantLoad:w,enableRowReorder:p,onTaskReorder:S})=>{let[m,y]=St.useState(t),[b,v]=St.useState(o??e[0]?.id??""),[E,R]=St.useState({...S1,...a}),k=St.useMemo(()=>{let D=String(E.keyword?.value??"").trim().toLowerCase(),T=String(E.status?.value??"").trim(),I=String(E.owner?.value??"").trim().toLowerCase(),A=String(E.workCenter?.value??"").trim().toLowerCase(),W=E.dateRange?.value,z=W?.[0]?na__default.default(W[0]):null,Q=W?.[1]?na__default.default(W[1]):null;return e.filter(re=>{if(D&&![re.id,re.code,re.title,re.project,re.workCenter,re.owner?.name].join(" ").toLowerCase().includes(D)||T&&re.status!==T||I&&!String(re.owner?.name??"").toLowerCase().includes(I)||A&&!String(re.workCenter??"").toLowerCase().includes(A))return false;if(z||Q){let ne=na__default.default(re.startDate),ae=na__default.default(re.endDate),_=z?ae.isAfter(z)||ae.isSame(z,"day"):true,Ue=Q?ne.isBefore(Q)||ne.isSame(Q,"day"):true;if(!_||!Ue)return false}return true})},[E,e]);St.useEffect(()=>{k.length!==0&&(k.some(D=>D.id===b)||v(k[0].id));},[k,b]);let B=St.useCallback(D=>{v(D.id);},[]),P=St.useMemo(()=>({appId:n,tableKey:i,fields:r??w1,filters:E,onFilterChange:R,onVariantLoad:w??(()=>{}),onSearch:h??(()=>{})}),[n,r,i,E,h,w]),C=St.useMemo(()=>({tasks:k,columns:c,scale:m,onScaleChange:y,page:d,rowsPerPage:l,rowsPerPageOptions:s,count:g,onPageChange:f,onRowsPerPageChange:u,selectedTaskId:b,onTaskSelect:B,enableRowReorder:p,onTaskReorder:S}),[c,g,p,k,f,u,S,B,d,l,s,m,b]);return {scale:m,setScale:y,selectedTaskId:b,setSelectedTaskId:v,filters:E,setFilters:R,filteredTasks:k,smartFilterProps:P,planningGanttProps:C}};var xV=e=>{let t=_g(e),o=St.useMemo(()=>({filterProps:t.smartFilterProps,ganttProps:t.planningGanttProps}),[t.planningGanttProps,t.smartFilterProps]);return {...t,layoutProps:o}};var jg=e=>jsxRuntime.jsx(material.Chip,{...e,size:e.size||"small",variant:e.variant||"outlined"});var er=St.forwardRef(({tooltip:e,...t},o)=>{let a=jsxRuntime.jsx(material.IconButton,{ref:o,...t,size:t.size||"small"});return e?jsxRuntime.jsx(material.Tooltip,{title:e,children:a}):a});er.displayName="CIconButton";var Xg=({label:e,options:t,minWidth:o=120,...a})=>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,...a,children:t.map(r=>jsxRuntime.jsx(material.MenuItem,{value:r.value,children:r.label},r.value))})]});na__default.default.extend(z1__default.default);var Cd=[{value:"hour",label:"Hour",width:56},{value:"day",label:"Day",width:46},{value:"week",label:"Week",width:78},{value:"month",label:"Month",width:104}],kd=56,Br=58,ks=8,Sd=260,J1=320,Ss="0.85rem",tr="220ms cubic-bezier(0.2, 0, 0, 1)",tf={"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"}},eT=e=>e?tf[e]?.label??e:"Planned",tT=e=>e?tf[e]?.color??"default":"info",of=e=>Math.min(100,Math.max(0,e??0)),af=(e,t=0)=>e.flatMap(o=>[{...o,level:t},...af(o.children??[],t+1)]),oT=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:eT(e.status),statusTone:e.status??"planned",progress:of(e.progress),startDate:e.startDate,endDate:e.endDate,color:e.color,reorderable:e.reorderable!==false}),rf=(e,t)=>t==="month"?e.startOf("month"):t==="week"?e.startOf("week"):t==="day"?e.startOf("day"):e.startOf("hour"),nf=(e,t)=>t==="month"?e.endOf("month"):t==="week"?e.endOf("week"):t==="day"?e.endOf("day"):e.endOf("hour"),aT=(e,t,o)=>{let a=[],r=rf(e,o),n=nf(t,o);for(;r.isBefore(n)||r.isSame(n);){let i=o==="month"?r.add(1,"month"):o==="week"?r.add(1,"week"):o==="day"?r.add(1,"day"):r.add(1,"hour");a.push({key:`${o}-${r.valueOf()}`,label:o==="month"?r.format("MMM YYYY"):o==="week"?r.format("MMM D"):o==="day"?r.format("D"):r.format("HH:mm"),contextLabel:o==="hour"?r.format("MMM D"):o==="day"?r.format("MMM"):o==="week"?`W${r.isoWeek()}`:void 0,title:o==="hour"?r.format("MMM D, YYYY HH:mm"):o==="day"?r.format("MMM D, YYYY"):o==="week"?`${r.format("MMM D, YYYY")} - Week ${r.isoWeek()}`:void 0,start:r,end:i}),r=i;}return a},wd=(e,t,o)=>{let a=0;for(let r of t){if(e.isBefore(r.start))return a;if(e.isBefore(r.end)){let n=Math.max(1,r.end.valueOf()-r.start.valueOf()),i=Math.max(0,e.valueOf()-r.start.valueOf());return a+i/n*o}a+=o;}return a},lf=({title:e="Project Plan",extraTools:t,bodyHeight:o=560,tasks:a,columns:r,scale:n="week",onScaleChange:i,page:c,rowsPerPage:d=20,rowsPerPageOptions:l=[20,50,100,-1],count:s,onPageChange:g,onRowsPerPageChange:f,timelineStart:u,timelineEnd:h,selectedTaskId:w,onTaskSelect:p,enableRowReorder:S=true,onTaskReorder:m,emptyLabel:y="No planning tasks available.",sx:b})=>{let v=material.useTheme(),{t:E}=ee(),R=St.useRef(null),k=St.useRef(null),B=St.useRef(null),P=St.useRef(false),[C,D]=St.useState(null),[T,I]=St.useState(null),[A,W]=St.useState({}),[z,Q]=St.useState(kd),[re,ne]=St.useState([]),[ae,_]=St.useState({activeId:null,overId:null}),Ue=St.useRef(null),Ze=St.useMemo(()=>af(a),[a]),Oe=St.useMemo(()=>{if(re.length===0)return Ze;let M=new Map(Ze.map(G=>[G.id,G])),O=re.map(G=>M.get(G)).filter(G=>!!G),U=new Set(O.map(G=>G.id));return [...O,...Ze.filter(G=>!U.has(G.id))]},[Ze,re]),ie=St.useMemo(()=>new Map(Oe.map(M=>[M.id,M])),[Oe]),we=St.useMemo(()=>Oe.map(M=>oT(M)),[Oe]),Ae=St.useMemo(()=>new Map(we.map(M=>[M.id,M])),[we]),Ye=St.useMemo(()=>[{id:"code",label:"ID",minWidth:90},{id:"title",label:"Task",minWidth:260,render:(M,O)=>jsxRuntime.jsxs(material.Stack,{spacing:.2,children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:15,fontWeight:700,lineHeight:1.2},children:O.title}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:13,color:"text.secondary"},children:O.titleSub})]})},{id:"owner",label:"Owner",minWidth:170},{id:"status",label:"Status",minWidth:130,render:(M,O)=>jsxRuntime.jsx(jg,{label:O.status,color:tT(O.statusTone),size:"small"})},{id:"progress",label:"Progress",minWidth:140,numeric:true,render:M=>jsxRuntime.jsxs(material.Stack,{spacing:.6,children:[jsxRuntime.jsxs(material.Typography,{variant:"caption",sx:{color:"text.secondary"},children:[M,"%"]}),jsxRuntime.jsx(material.LinearProgress,{variant:"determinate",value:M,sx:{height:6,borderRadius:999}})]})},{id:"startDate",label:"Start",minWidth:120},{id:"endDate",label:"End",minWidth:120}],[]),st=St.useMemo(()=>{if(!r||r.length===0)return Ye;let M=new Map(Ye.map(O=>[O.id,O]));return r.map(O=>{let U=M.get(O.id),G=O.width??U?.minWidth??120,te={id:O.id,label:O.label,minWidth:G};if(U?.numeric&&(te.numeric=true),O.render){let Re=O.render;return te.render=(ze,le)=>{let Pe=ie.get(le.id);return Re(Pe||le)},te}return U?.render?(te.render=U.render,te):(te.render=(Re,ze)=>{let le=ze[O.id];if(le!=null&&String(le).length>0)return String(le);let We=ie.get(ze.id)?.[O.id];return We!=null&&String(We).length>0?String(We):"-"},te)})},[r,Ye,ie]),Z=on({appId:"planning-gantt",title:e,columns:st,rows:we,rowKey:"id",page:c,rowsPerPage:d,rowsPerPageOptions:l,count:s??we.length,onPageChange:g,onRowsPerPageChange:f,showSummary:false}),Ke=Z.visibleRows,xt=Z.rowsPerPage===-1?1:Math.max(1,Math.ceil(Z.totalDisplayCount/Z.rowsPerPage)),X=Math.max(0,Math.min(Z.page,xt-1)),pe=Math.min(X+1,xt),Be=X>0,Ee=X<xt-1&&Z.rowsPerPage!==-1;St.useEffect(()=>{let M=Ze.map(O=>O.id);ne(O=>{let U=new Set(M),G=O.filter(le=>U.has(le)),te=new Set(G),Re=M.filter(le=>!te.has(le)),ze=[...G,...Re];return ze.length===O.length&&ze.every((le,Pe)=>le===O[Pe])?O:ze});},[Ze]);let qe=M=>M.type==="group"?`group-${M.id}`:`row-${(M.data||M)?.id}`,K=St.useMemo(()=>{let M=we.map(Pe=>na__default.default(Pe.startDate)),O=we.map(Pe=>na__default.default(Pe.endDate)),U=u?na__default.default(u):M.reduce((Pe,We)=>We.isBefore(Pe)?We:Pe,M[0]??na__default.default()),G=h?na__default.default(h):O.reduce((Pe,We)=>We.isAfter(Pe)?We:Pe,O[0]??na__default.default().add(30,"day")),te=n==="month"?"month":n==="week"?"week":n==="day"?"day":"hour",Re=n==="month"?"month":n==="week"?"week":n==="day"?"day":"hour",ze=n==="hour"?12:1,le=n==="hour"?12:1;return {start:rf(U.subtract(ze,te),n),end:nf(G.add(le,Re),n)}},[we,n,h,u]),ye=Cd.find(M=>M.value===n)??Cd[1],be=Array.isArray(t)?t:t?[t]:[],xe=St.useMemo(()=>aT(K.start,K.end,n),[K.end,K.start,n]),Qe=xe.length*ye.width,He=(Z.columns||[]).filter(M=>Z.visibleColumns.includes(M.id)).reduce((M,O)=>M+(Z.columnWidths?.[O.id]||O.minWidth||100),0),qt=C??He,ao=T==="table",ro=T==="timeline",uo=ro?0:ao?"100%":qt,Et=T==="timeline",De=T==="table",he=!Et&&!De,Tt=ao?"minmax(0, 1fr) 0px 0px":ro?"0px 0px minmax(0, 1fr)":`${qt}px ${ks}px minmax(0, 1fr)`,_e=()=>{let M=R.current?.clientWidth??0;return M>0?Math.max(Sd,M-ks-J1):Math.max(Sd,He)},It=M=>Math.min(Math.max(M,Sd),_e());St.useEffect(()=>{D(M=>M===null?null:It(M));},[He]);let mo=M=>{M.preventDefault(),M.currentTarget.setPointerCapture(M.pointerId),I(null),Ue.current={startX:M.clientX,startWidth:qt};let O=G=>{let te=Ue.current;if(!te)return;let Re=It(te.startWidth+G.clientX-te.startX);D(Re);},U=()=>{Ue.current=null,window.removeEventListener("pointermove",O),window.removeEventListener("pointerup",U),document.body.style.cursor="",document.body.style.userSelect="";};document.body.style.cursor="col-resize",document.body.style.userSelect="none",window.addEventListener("pointermove",O),window.addEventListener("pointerup",U);},ia=()=>{let M=R.current?.clientWidth??0;if(I(null),M<=0){D(null);return}D(It((M-ks)/2));},H=M=>!S||!M?false:Ae.get(M)?.reorderable!==false,$=(M,O)=>{if(!M||!O||M===O||!H(M)||!H(O))return false;if(Z.grouping.length===0)return true;let U=Ae.get(M),G=Ae.get(O);return !U||!G?false:Z.grouping.every(te=>U[te]===G[te])},Y=(M,O)=>{if(!$(M,O))return;let U=Ke.filter(je=>je.type!=="group").map(je=>String((je.data||je)?.id)),G=U.indexOf(M),te=U.indexOf(O);if(G<0||te<0)return;let Re=[...U];[Re[G],Re[te]]=[Re[te],Re[G]];let ze=new Set(U),le=Oe.map(je=>je.id),Pe=[...Re,...le.filter(je=>!ze.has(je))],We=ie.get(M),vt=ie.get(O);if(Z.setOrder("asc"),Z.setOrderBy(""),ne(Pe),We&&vt){let{level:je,...gt}=We,{level:Pt,...no}=vt,Rt=Pe.reduce((Ft,Xt)=>{let Dt=ie.get(Xt);if(Dt){let{level:Xe,...Eo}=Dt;Ft.push(Eo);}return Ft},[]);m?.(Rt,{activeTask:gt,targetTask:no});}},Ie=(M,O)=>{if(!H(O.id)){M.preventDefault();return}M.stopPropagation(),M.dataTransfer.effectAllowed="move",M.dataTransfer.setData("text/plain",O.id),_({activeId:O.id,overId:null}),p?.(ie.get(O.id)||O);},Te=(M,O)=>{if(!$(ae.activeId,O)){_(U=>U.overId===null?U:{...U,overId:null});return}M.preventDefault(),M.stopPropagation(),M.dataTransfer.dropEffect="move",_(U=>U.overId===O?U:{...U,overId:O});},Ve=(M,O)=>{let U=ae.activeId||M.dataTransfer.getData("text/plain");if(!$(U,O)){_({activeId:null,overId:null});return}M.preventDefault(),M.stopPropagation(),Y(U,O),_({activeId:null,overId:null});},Ce=()=>{_({activeId:null,overId:null});},$e=M=>{if(P.current)return;let O=M==="table"?k.current:B.current,U=M==="table"?B.current:k.current;!O||!U||(P.current=true,U.scrollTop=O.scrollTop,window.requestAnimationFrame(()=>{P.current=false;}));};return St.useLayoutEffect(()=>{if(!w||De)return;let M=B.current,O=k.current;if(!M)return;let U=`row-${w}`,G=Array.from(M.querySelectorAll("[data-planning-timeline-row-key]")).find(ze=>ze.dataset.planningTimelineRowKey===U),te=Ae.get(w);if(!G||!te)return;let Re=window.requestAnimationFrame(()=>{let ze=M.getBoundingClientRect(),le=G.getBoundingClientRect(),Pe=Math.max(1,M.clientHeight-z),We=M.scrollTop+le.top-ze.top-z-(Pe-le.height)/2;P.current=true,M.scrollTop=Math.max(0,We),O&&!Et&&(O.scrollTop=M.scrollTop);let vt=wd(na__default.default(te.startDate),xe,ye.width),je=Math.max(0,vt-ye.width);M.scrollLeft=Math.min(je,Math.max(0,Qe-M.clientWidth)),window.requestAnimationFrame(()=>{P.current=false;});});return ()=>window.cancelAnimationFrame(Re)},[ye.width,z,w,Et,Ae,De,Ke,Qe,xe]),St.useLayoutEffect(()=>{let M=k.current;if(!M)return;let O=0,U=()=>{let le=M.querySelector("thead"),Pe=Array.from(M.querySelectorAll("tbody tr[data-planning-row-key]"));if(Pe.length===0)return;let We=le?.getBoundingClientRect().height||kd,vt={};Pe.forEach(je=>{let gt=je.dataset.planningRowKey;gt&&(vt[gt]=je.getBoundingClientRect().height);}),Q(je=>Math.abs(je-We)<.01?je:We),W(je=>{let gt=Object.keys(je),Pt=Object.keys(vt);return gt.length===Pt.length&&Pt.every(no=>Math.abs((je[no]??0)-vt[no])<.01)?je:vt});},G=()=>{window.cancelAnimationFrame(O),O=window.requestAnimationFrame(U);};if(U(),typeof ResizeObserver>"u")return window.addEventListener("resize",G),()=>{window.cancelAnimationFrame(O),window.removeEventListener("resize",G);};let te=new ResizeObserver(G),Re=M.querySelector("table"),ze=M.querySelector("thead");return Re&&te.observe(Re),ze&&te.observe(ze),M.querySelectorAll("tbody tr[data-planning-row-key]").forEach(le=>te.observe(le)),window.addEventListener("resize",G),()=>{window.cancelAnimationFrame(O),te.disconnect(),window.removeEventListener("resize",G);}},[Ke,Z.visibleColumns,Z.grouping,Z.columnWidths]),jsxRuntime.jsxs(Ii,{elevation:0,sx:{m:0,p:0,display:"flex",flexDirection:"column",minHeight:0,overflow:"hidden",borderRadius:3,border:`1px solid ${v.palette.divider}`,backgroundColor:v.palette.background.paper,...b},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 ${v.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:Ss,color:"text.secondary",whiteSpace:"nowrap"},children:E("table.toolbar.itemsPerPage")}),jsxRuntime.jsx(material.Select,{size:"small",variant:"standard",value:Z.rowsPerPage,disableUnderline:true,onChange:M=>Z.setRowsPerPage(Number(M.target.value)),sx:{fontSize:Ss,fontWeight:600,color:"text.primary",minWidth:64,"& .MuiSelect-select":{py:.25,pr:"16px !important"},"& .MuiSvgIcon-root":{color:"text.primary"}},children:l.map(M=>jsxRuntime.jsx(material.MenuItem,{value:M,sx:{fontSize:Ss},children:M===-1?E("common.all"):M},`planning-rows-per-page-${M}`))}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>Z.setPage(Math.max(X-1,0)),disabled:!Be,sx:{p:.35,color:"text.primary"},children:jsxRuntime.jsx(Fh__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:Ss,fontWeight:600,minWidth:88,textAlign:"center",color:"text.primary"},children:E("table.toolbar.pageOf",{current:pe,total:xt})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>Z.setPage(Math.min(X+1,xt-1)),disabled:!Ee,sx:{p:.35,color:"text.primary"},children:jsxRuntime.jsx(ef__default.default,{fontSize:"small"})})]}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,alignItems:"center",sx:{flexWrap:"wrap"},children:[be.length>0&&jsxRuntime.jsx(material.Stack,{direction:"row",spacing:.75,alignItems:"center",children:be.map((M,O)=>jsxRuntime.jsx(material.Box,{sx:{display:"flex",alignItems:"center"},children:M},`planning-extra-tool-${O}`))}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:.25,sx:{p:.5,borderRadius:2,backgroundColor:"action.hover"},children:[jsxRuntime.jsx(er,{tooltip:"Column visibility",onClick:M=>Z.setAnchorEl(M.currentTarget),color:"default",children:jsxRuntime.jsx(Th__default.default,{fontSize:"small"})}),jsxRuntime.jsx(er,{tooltip:"Group by",onClick:M=>Z.setGroupAnchorEl(M.currentTarget),color:"default",children:jsxRuntime.jsx(Rh__default.default,{fontSize:"small"})}),jsxRuntime.jsx(er,{tooltip:"Sort by first visible column",onClick:()=>{let M=(Z.columns||[]).find(O=>Z.visibleColumns.includes(O.id));M&&Z.handleRequestSort(M.id);},color:Z.orderBy?"primary":"default",children:jsxRuntime.jsx(Y1__default.default,{fontSize:"small"})})]}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:.25,sx:{p:.5,borderRadius:2,backgroundColor:"action.hover"},children:[jsxRuntime.jsx(er,{tooltip:"Expand task table",onClick:()=>I("table"),color:T==="table"?"primary":"default",children:jsxRuntime.jsx(Z1__default.default,{fontSize:"small"})}),jsxRuntime.jsx(er,{tooltip:"Split evenly",onClick:ia,color:T===null?"primary":"default",children:jsxRuntime.jsx(X1__default.default,{fontSize:"small"})}),jsxRuntime.jsx(er,{tooltip:"Expand timeline",onClick:()=>I("timeline"),color:T==="timeline"?"primary":"default",children:jsxRuntime.jsx(j1__default.default,{fontSize:"small"})})]}),jsxRuntime.jsx(material.Box,{sx:{minWidth:120},children:jsxRuntime.jsx(Xg,{label:"",value:n,options:Cd.map(M=>({value:M.value,label:M.label})),onChange:M=>i?.(M.target.value),sx:{"& .MuiSelect-select":{fontSize:"0.92rem",py:.65},"& .MuiSvgIcon-root":{fontSize:20}}})})]})]}),we.length===0?jsxRuntime.jsx(material.Box,{sx:{minHeight:240,display:"grid",placeItems:"center",color:"text.secondary"},children:y}):jsxRuntime.jsx(material.Box,{sx:{overflow:"hidden",flex:1,minHeight:0},children:jsxRuntime.jsxs(material.Box,{ref:R,sx:{height:"100%",display:"grid",gridTemplateColumns:Tt,transition:`grid-template-columns ${tr}`},children:[jsxRuntime.jsx(material.TableContainer,{"data-planning-scroll-pane":"table",ref:k,onScroll:()=>$e("table"),sx:{width:uo,height:o,overflowX:"auto",overflowY:"auto",opacity:Et?0:1,transform:Et?"translateX(-10px)":"translateX(0)",pointerEvents:Et?"none":"auto",transition:`opacity ${tr}, transform ${tr}, width ${tr}`},children:jsxRuntime.jsxs(material.Table,{size:"small",stickyHeader:true,sx:{tableLayout:"fixed",width:He,"& thead .MuiTableCell-root":{height:kd,py:0,lineHeight:1.15,boxSizing:"border-box"}},children:[jsxRuntime.jsx(Ei,{columns:Z.columns,visibleColumns:Z.visibleColumns,order:Z.order,orderBy:Z.orderBy,onRequestSort:Z.handleRequestSort,grouping:Z.grouping,isAllExpanded:Z.isAllExpanded,handleToggleAll:Z.handleToggleAll,columnWidths:Z.columnWidths,onColumnResize:Z.handleColumnResize}),jsxRuntime.jsx(material.TableBody,{children:Ke.map(M=>{let O=qe(M);if(M.type==="group")return jsxRuntime.jsxs(material.TableRow,{"data-planning-row-key":O,sx:{height:Br,backgroundColor:v.palette.action.hover},children:[Z.grouping.length>0&&jsxRuntime.jsx(material.TableCell,{sx:{width:44,height:Br,py:0,borderBottom:`1px solid ${v.palette.divider}`},children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>Z.toggleGroupExpand(M.id),children:M.isExpanded?jsxRuntime.jsx(Qh__default.default,{fontSize:"small"}):jsxRuntime.jsx(ef__default.default,{fontSize:"small"})})}),jsxRuntime.jsx(material.TableCell,{colSpan:Z.visibleColumns.length,sx:{height:Br,py:0,borderBottom:`1px solid ${v.palette.divider}`},children:jsxRuntime.jsxs(material.Typography,{sx:{fontSize:13,fontWeight:700},children:[M.field,": ",M.value," (",M.count,")"]})})]},M.id);let U=M.data||M,G=U.id===w,te=H(U.id),Re=ae.activeId===U.id,ze=ae.overId===U.id&&$(ae.activeId,U.id);return jsxRuntime.jsxs(material.TableRow,{"data-planning-row-key":O,draggable:te,hover:true,selected:G,onDragStart:le=>Ie(le,U),onDragOver:le=>Te(le,U.id),onDragEnter:le=>Te(le,U.id),onDrop:le=>Ve(le,U.id),onDragEnd:Ce,onClick:()=>p?.(ie.get(U.id)||U),sx:{cursor:Re?"grabbing":te?"grab":p?"pointer":"default",height:Br,opacity:Re?.56:1,"& .MuiTableCell-root":ze?{borderTop:`2px solid ${v.palette.primary.main}`}:void 0,transition:"background-color 120ms ease, opacity 120ms ease"},children:[Z.grouping.length>0&&jsxRuntime.jsx(material.TableCell,{sx:{width:44,height:Br,py:0,borderBottom:`1px solid ${v.palette.divider}`}}),(Z.columns||[]).filter(le=>Z.visibleColumns.includes(le.id)).map(le=>jsxRuntime.jsx(material.TableCell,{sx:{width:Z.columnWidths?.[le.id]||le.minWidth||100,height:Br,py:0,overflow:"hidden",borderBottom:`1px solid ${v.palette.divider}`},children:le.render?le.render(U[le.id],U):String(U[le.id]??"-")},`${U.id}-${le.id}`))]},U.id)})})]})}),jsxRuntime.jsx(material.Box,{onPointerDown:he?mo:void 0,role:"separator","aria-orientation":"vertical",sx:{width:he?ks:0,cursor:he?"col-resize":"default",opacity:he?1:0,pointerEvents:he?"auto":"none",borderLeft:he?`1px solid ${v.palette.divider}`:"0 solid transparent",borderRight:he?`1px solid ${v.palette.divider}`:"0 solid transparent",backgroundColor:v.palette.mode==="dark"?"rgba(148,163,184,0.10)":"rgba(15,23,42,0.04)",transition:`width ${tr}, opacity ${tr}, background-color 120ms ease`,position:"relative","&:hover":{backgroundColor:v.palette.action.selected},"&::before":{content:'""',position:"absolute",top:0,bottom:0,left:-6,right:-6,cursor:he?"col-resize":"default"}}}),jsxRuntime.jsx(material.Box,{sx:{minWidth:0,overflow:"hidden",opacity:De?0:1,transform:De?"translateX(10px)":"translateX(0)",pointerEvents:De?"none":"auto",transition:`opacity ${tr}, transform ${tr}`},children:jsxRuntime.jsx(material.Box,{"data-planning-scroll-pane":"timeline",ref:B,onScroll:()=>$e("timeline"),sx:{width:"100%",height:o,overflowX:"auto",overflowY:"auto"},children:jsxRuntime.jsxs(material.Box,{sx:{width:Qe},children:[jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${xe.length}, ${ye.width}px)`,height:z,boxSizing:"border-box",borderBottom:`1px solid ${v.palette.divider}`,position:"sticky",top:0,zIndex:2,backgroundColor:v.palette.background.paper},children:xe.map(M=>jsxRuntime.jsxs(material.Box,{title:M.title,sx:{px:.75,display:"flex",flexDirection:M.contextLabel?"column":"row",alignItems:"center",justifyContent:"center",gap:M.contextLabel?.15:0,borderRight:`1px solid ${v.palette.divider}`,color:M.contextLabel?"text.primary":"text.secondary",overflow:"hidden"},children:[M.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:M.contextLabel}),jsxRuntime.jsx(material.Typography,{component:"span",sx:{maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:12,fontWeight:700,lineHeight:1.15},children:M.label})]},M.key))}),jsxRuntime.jsx(material.Stack,{sx:{position:"relative"},children:Ke.map(M=>{let O=qe(M),U=A[O]??Br;if(M.type==="group")return jsxRuntime.jsx(material.Box,{"data-planning-timeline-row-key":O,sx:{position:"relative",height:U,boxSizing:"border-box",borderBottom:`1px solid ${v.palette.divider}`,backgroundColor:v.palette.action.hover}},M.id);let G=M.data||M,te=na__default.default(G.startDate),Re=na__default.default(G.endDate),ze=wd(te,xe,ye.width),le=wd(Re,xe,ye.width),Pe=Math.max(18,le-ze),We=of(G.progress),vt=G.id===w,je=H(G.id),gt=ae.activeId===G.id,Pt=ae.overId===G.id&&$(ae.activeId,G.id),no=G.color??(G.statusTone==="blocked"?v.palette.error.main:v.palette.primary.main);return jsxRuntime.jsx(material.Box,{"data-planning-timeline-row-key":O,draggable:je,onDragStart:Rt=>Ie(Rt,G),onDragOver:Rt=>Te(Rt,G.id),onDragEnter:Rt=>Te(Rt,G.id),onDrop:Rt=>Ve(Rt,G.id),onDragEnd:Ce,onClick:()=>p?.(ie.get(G.id)||G),sx:{position:"relative",height:U,boxSizing:"border-box",borderBottom:`1px solid ${v.palette.divider}`,opacity:gt?.56:1,"&::before":{content:'""',position:"absolute",top:0,left:0,right:0,height:2,backgroundColor:v.palette.primary.main,opacity:Pt?1:0,transition:"opacity 120ms ease",pointerEvents:"none",zIndex:3},backgroundImage:v.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:`${ye.width}px 100%`,cursor:gt?"grabbing":je?"grab":p?"pointer":"default",transition:"opacity 120ms ease"},children:jsxRuntime.jsx(material.Tooltip,{title:`${G.title}: ${te.format("MMM D HH:mm")} - ${Re.format("MMM D HH:mm")}`,children:jsxRuntime.jsxs(material.Box,{sx:{position:"absolute",left:ze,top:Math.max(8,(U-24)/2),width:Pe,height:24,borderRadius:999,overflow:"hidden",backgroundColor:v.palette.mode==="dark"?"rgba(148,163,184,0.18)":"rgba(15,23,42,0.10)",outline:vt?`2px solid ${v.palette.warning.main}`:"none",outlineOffset:2},children:[jsxRuntime.jsx(material.Box,{sx:{height:"100%",width:`${We}%`,backgroundColor:no}}),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:G.code})]})})},G.id)})})]})})})]})}),jsxRuntime.jsx(Wr,{groupAnchorEl:Z.groupAnchorEl,setGroupAnchorEl:Z.setGroupAnchorEl,grouping:Z.grouping,setGrouping:Z.setGrouping,columns:Z.columns,toggleGroupField:Z.toggleGroupField}),jsxRuntime.jsx($r,{anchorEl:Z.anchorEl,setAnchorEl:Z.setAnchorEl,columns:Z.columns,visibleColumns:Z.visibleColumns,toggleColumnVisibility:Z.toggleColumnVisibility})]})};var rO=({filterProps:e,ganttProps:t,spacing:o=2,sx:a,children:r})=>{let n=a?[{height:"100%",overflow:"hidden"},a]:{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(ha,{...e})}),jsxRuntime.jsx(material.Box,{sx:{flex:1,minHeight:0,overflow:"hidden"},children:jsxRuntime.jsx(lf,{...t,bodyHeight:t.bodyHeight??"100%",sx:i})}),r]})};var pT={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)"}}},cO=({children:e,transitionKey:t,variant:o="fade",durationMs:a=220,delayMs:r=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]=St.useState("to"),g=!i&&!d&&o!=="none";St.useEffect(()=>{if(!g){s("to");return}s("from");let h=requestAnimationFrame(()=>{h=requestAnimationFrame(()=>{s("to");});});return ()=>cancelAnimationFrame(h)},[t,g]);let f=pT[o],u=St.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 ${a}ms ${n} ${r}ms, transform ${a}ms ${n} ${r}ms`:"none",backfaceVisibility:"hidden",...u,...c},children:e})},dO={subtle:{variant:"fade",durationMs:180},smooth:{variant:"slide-up",durationMs:220},snappy:{variant:"scale",durationMs:160}};
199
+ exports.AgentPanel=EN;exports.Button=Is;exports.CAINavProvider=SS;exports.CAmapChart=Tp;exports.CAppHeader=Bl;exports.CAppPageLayout=PB;exports.CAuthPage=pV;exports.CBarChart=Hn;exports.CChartCard=Oi;exports.CComboChart=up;exports.CCustomizeAgent=Dp;exports.CDetailInfoPage=AA;exports.CDetailSearchAiBar=Tu;exports.CDetailSectionCard=kl;exports.CFishboneChart=hp;exports.CGoogleMapChart=Cp;exports.CGraphCharts=Ip;exports.CGraphKpiCards=sp;exports.CGraphReport=el;exports.CHeatmapChart=gp;exports.CKanbanBoard=QA;exports.CKanbanBucket=Au;exports.CKanbanCard=Ic;exports.CLayoutManagement=Jp;exports.CLayoutManager=ul;exports.CLineChart=pp;exports.CMessageBox=Bn;exports.COrbCanvas=cS;exports.CPageLayout=Xd;exports.CPageTransition=cO;exports.CPieChart=qi;exports.CPivotTable=fE;exports.CPlanningGantt=lf;exports.CPlanningLayout=rO;exports.CSmartFilter=ha;exports.CSmartTable=XM;exports.CStandardPage=a2;exports.CTable=Ua;exports.CTableBody=KM;exports.CTableCell=qM;exports.CTableContainer=_M;exports.CTableHead=jM;exports.CTableRow=ZM;exports.CValueHelp=Zd;exports.CVariantManagement=rl;exports.CVariantManager=Op;exports.CVoiceWaveOverlay=rd;exports.CWaterfallChart=bp;exports.CodeBlock=Qn;exports.CopilotChat=WN;exports.GlobalMessage=hI;exports.MarkdownRenderer=ai;exports.MathBlock=Jn;exports.MermaidBlock=uc;exports.NavigationIsland=zd;exports.ORBCAFE_I18N_MESSAGES=An;exports.OrbcafeI18nProvider=Mi;exports.PAGE_TRANSITION_PRESETS=dO;exports.PAppPageLayout=KF;exports.PBarcodeScanner=FE;exports.PNavIsland=Zm;exports.PNumericKeypad=ZE;exports.PSmartFilter=Wm;exports.PTable=_k;exports.PTouchCard=HE;exports.PWorkloadNav=Um;exports.PivotChartPanel=xm;exports.StdChat=Hg;exports.TableBlock=gc;exports.ThinkBlock=vl;exports.TreeMenu=Rs;exports.VoiceNavigatorProvider=lL;exports.VoiceWaveOverlay=JF;exports.buildAmapEmbedUrl=Zi;exports.buildGoogleMapEmbedUrl=Gn;exports.buildGoogleMapIframe=aR;exports.buttonVariants=yf;exports.createKanbanBoardModel=Fu;exports.findKanbanCard=Go;exports.message=JT;exports.messageManager=ua;exports.moveKanbanCard=Pl;exports.parseMarkdownTable=bl;exports.renderMarkdown=eA;exports.resolveVariantFilters=tu;exports.resolveVariantLayout=ml;exports.useAINav=wS;exports.useAmapEmbedUrl=b2;exports.useAuthPage=KN;exports.useDetailInfo=Pu;exports.useGoogleMapEmbedUrl=y2;exports.useGraphChartData=u2;exports.useGraphInteraction=ol;exports.useGraphReport=Qr;exports.useKanbanBoard=aB;exports.useNavigationIsland=Vd;exports.useOrbcafeI18n=ee;exports.usePadLayout=TE;exports.usePadRecordEditor=RE;exports.usePageLayout=Uu;exports.usePivotTable=vE;exports.usePlanningGantt=_g;exports.usePlanningLayout=xV;exports.useStandardReport=c2;exports.useVoiceInput=rs;exports.useVoiceNavigator=sL;