orbcafe-ui 1.3.9 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- 'use strict';var ogl=require('ogl'),Rt=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'),xp=require('@mui/material/Dialog'),vp=require('@mui/material/DialogTitle'),Cp=require('@mui/material/DialogContent'),ih=require('@mui/material/DialogContentText'),kp=require('@mui/material/DialogActions'),oi=require('@mui/material/Box'),ch=require('@mui/icons-material/CheckCircle'),dh=require('@mui/icons-material/Warning'),uh=require('@mui/icons-material/Error'),ph=require('@mui/icons-material/Info'),material=require('@mui/material'),styles=require('@mui/material/styles'),Ih=require('@mui/icons-material/Clear'),Ph=require('@mui/icons-material/Close'),Jd=require('@mui/icons-material/Search'),Ox=require('@mui/material/Paper'),Hx=require('@mui/material/Table'),Wx=require('@mui/material/TableBody'),Gs=require('@mui/material/TableCell'),Tp=require('@mui/material/TableContainer'),ob=require('@mui/material/TableHead'),rb=require('@mui/material/TableRow'),Sp=require('@mui/material/TextField'),xl=require('@mui/material/Button'),wp=require('@mui/material/Alert'),core=require('@dnd-kit/core'),modifiers=require('@dnd-kit/modifiers'),$h=require('@mui/icons-material/ViewColumn'),gp=require('@mui/icons-material/Save'),Uh=require('@mui/icons-material/Download'),Kh=require('@mui/icons-material/AccountTree'),qh=require('@mui/icons-material/Functions'),_h=require('@mui/icons-material/Insights'),xu=require('@mui/icons-material/Add'),Zh=require('@mui/icons-material/Edit'),Xh=require('@mui/icons-material/Delete'),Yh=require('@mui/icons-material/KeyboardArrowLeft'),yf=require('@mui/icons-material/KeyboardArrowRight'),ab=require('@mui/material/Checkbox'),nb=require('@mui/material/TableSortLabel'),ib=require('@mui/material/IconButton'),lb=require('@mui/material/Tooltip'),sb=require('@mui/icons-material/UnfoldMore'),cb=require('@mui/icons-material/UnfoldLess'),sortable=require('@dnd-kit/sortable'),xb=require('@mui/icons-material/KeyboardArrowDown'),Eb=require('@mui/icons-material/Check'),hu=require('@mui/icons-material/ClearAll'),bu=require('@mui/icons-material/ArrowUpward'),yu=require('@mui/icons-material/ArrowDownward'),Fb=require('@mui/icons-material/VisibilityOff'),Nb=require('@mui/icons-material/DeleteOutline'),vy=require('@mui/icons-material/MicNoneOutlined'),Cy=require('@mui/icons-material/SettingsOutlined'),ky=require('@mui/icons-material/SendOutlined'),bx=require('@mui/icons-material/Settings'),yx=require('@mui/icons-material/KeyboardArrowUp'),vx=require('@mui/icons-material/ArrowRightAlt'),Gy=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'),ox=require('@mui/icons-material/CalendarMonth'),ax=require('@mui/icons-material/ArrowForward'),mr=require('dayjs'),nx=require('dayjs/plugin/isBetween'),ix=require('dayjs/plugin/localizedFormat'),lx=require('dayjs/plugin/customParseFormat');require('dayjs/locale/zh-cn'),require('dayjs/locale/fr'),require('dayjs/locale/de'),require('dayjs/locale/ja'),require('dayjs/locale/ko');var Fx=require('@mui/icons-material/StarBorder'),Lx=require('@mui/icons-material/ViewQuilt'),rv=require('@mui/icons-material/CloseOutlined'),r0=require('@mui/icons-material/ContentCopyOutlined'),a0=require('@mui/icons-material/CheckOutlined'),E0=require('@mui/icons-material/ExpandMore'),rm=require('@mui/icons-material/Language'),$v=require('@mui/icons-material/DesktopWindows'),Gv=require('@mui/icons-material/DarkMode'),Uv=require('@mui/icons-material/LightMode'),qv=require('@mui/icons-material/Logout'),fC=require('@mui/icons-material/DragIndicator'),EC=require('@mui/icons-material/FilterList'),FC=require('@mui/icons-material/TableRows'),vC=require('@mui/icons-material/LayersClear'),Bk=require('@mui/icons-material/CameraAltRounded'),Ek=require('@mui/icons-material/QrCodeScannerRounded'),Nk=require('@mui/icons-material/DragIndicatorRounded'),Wk=require('@mui/icons-material/BackspaceRounded'),$k=require('@mui/icons-material/CloseRounded'),Gk=require('@mui/icons-material/CheckRounded'),aS=require('@mui/icons-material/SearchRounded'),nS=require('@mui/icons-material/MenuOpenRounded'),iS=require('@mui/icons-material/MenuRounded'),lS=require('@mui/icons-material/ExpandMoreRounded'),sS=require('@mui/icons-material/ChevronRightRounded'),NS=require('next/dynamic'),framerMotion=require('framer-motion'),Yw=require('react-markdown'),Qw=require('remark-gfm'),Jw=require('remark-math'),e1=require('rehype-katex'),t1=require('rehype-raw'),reactSyntaxHighlighter=require('react-syntax-highlighter'),prism=require('react-syntax-highlighter/dist/esm/styles/prism'),nextThemes=require('next-themes'),Bg=require('mermaid'),p1=require('@mui/icons-material/MicRounded'),m1=require('@mui/icons-material/MicOffRounded'),iconsMaterial=require('@mui/icons-material'),y1=require('@mui/icons-material/SendRounded'),x1=require('@mui/icons-material/AddRounded'),v1=require('@mui/icons-material/HardwareRounded'),_1=require('@mui/icons-material/LockOutlined'),cf=require('@mui/icons-material/MailOutline'),df=require('@mui/icons-material/PersonOutline'),j1=require('@mui/icons-material/VpnKeyOutlined'),uT=require('dayjs/plugin/isoWeek'),DT=require('@mui/icons-material/KeyboardDoubleArrowLeftOutlined'),MT=require('@mui/icons-material/KeyboardDoubleArrowRightOutlined'),AT=require('@mui/icons-material/SplitscreenOutlined'),BT=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 Rt__namespace=/*#__PURE__*/_interopNamespace(Rt);var xp__default=/*#__PURE__*/_interopDefault(xp);var vp__default=/*#__PURE__*/_interopDefault(vp);var Cp__default=/*#__PURE__*/_interopDefault(Cp);var ih__default=/*#__PURE__*/_interopDefault(ih);var kp__default=/*#__PURE__*/_interopDefault(kp);var oi__default=/*#__PURE__*/_interopDefault(oi);var ch__default=/*#__PURE__*/_interopDefault(ch);var dh__default=/*#__PURE__*/_interopDefault(dh);var uh__default=/*#__PURE__*/_interopDefault(uh);var ph__default=/*#__PURE__*/_interopDefault(ph);var Ih__default=/*#__PURE__*/_interopDefault(Ih);var Ph__default=/*#__PURE__*/_interopDefault(Ph);var Jd__default=/*#__PURE__*/_interopDefault(Jd);var Ox__default=/*#__PURE__*/_interopDefault(Ox);var Hx__default=/*#__PURE__*/_interopDefault(Hx);var Wx__default=/*#__PURE__*/_interopDefault(Wx);var Gs__default=/*#__PURE__*/_interopDefault(Gs);var Tp__default=/*#__PURE__*/_interopDefault(Tp);var ob__default=/*#__PURE__*/_interopDefault(ob);var rb__default=/*#__PURE__*/_interopDefault(rb);var Sp__default=/*#__PURE__*/_interopDefault(Sp);var xl__default=/*#__PURE__*/_interopDefault(xl);var wp__default=/*#__PURE__*/_interopDefault(wp);var $h__default=/*#__PURE__*/_interopDefault($h);var gp__default=/*#__PURE__*/_interopDefault(gp);var Uh__default=/*#__PURE__*/_interopDefault(Uh);var Kh__default=/*#__PURE__*/_interopDefault(Kh);var qh__default=/*#__PURE__*/_interopDefault(qh);var _h__default=/*#__PURE__*/_interopDefault(_h);var xu__default=/*#__PURE__*/_interopDefault(xu);var Zh__default=/*#__PURE__*/_interopDefault(Zh);var Xh__default=/*#__PURE__*/_interopDefault(Xh);var Yh__default=/*#__PURE__*/_interopDefault(Yh);var yf__default=/*#__PURE__*/_interopDefault(yf);var ab__default=/*#__PURE__*/_interopDefault(ab);var nb__default=/*#__PURE__*/_interopDefault(nb);var ib__default=/*#__PURE__*/_interopDefault(ib);var lb__default=/*#__PURE__*/_interopDefault(lb);var sb__default=/*#__PURE__*/_interopDefault(sb);var cb__default=/*#__PURE__*/_interopDefault(cb);var xb__default=/*#__PURE__*/_interopDefault(xb);var Eb__default=/*#__PURE__*/_interopDefault(Eb);var hu__default=/*#__PURE__*/_interopDefault(hu);var bu__default=/*#__PURE__*/_interopDefault(bu);var yu__default=/*#__PURE__*/_interopDefault(yu);var Fb__default=/*#__PURE__*/_interopDefault(Fb);var Nb__default=/*#__PURE__*/_interopDefault(Nb);var vy__default=/*#__PURE__*/_interopDefault(vy);var Cy__default=/*#__PURE__*/_interopDefault(Cy);var ky__default=/*#__PURE__*/_interopDefault(ky);var bx__default=/*#__PURE__*/_interopDefault(bx);var yx__default=/*#__PURE__*/_interopDefault(yx);var vx__default=/*#__PURE__*/_interopDefault(vx);var Gy__default=/*#__PURE__*/_interopDefault(Gy);var ox__default=/*#__PURE__*/_interopDefault(ox);var ax__default=/*#__PURE__*/_interopDefault(ax);var mr__default=/*#__PURE__*/_interopDefault(mr);var nx__default=/*#__PURE__*/_interopDefault(nx);var ix__default=/*#__PURE__*/_interopDefault(ix);var lx__default=/*#__PURE__*/_interopDefault(lx);var Fx__default=/*#__PURE__*/_interopDefault(Fx);var Lx__default=/*#__PURE__*/_interopDefault(Lx);var rv__default=/*#__PURE__*/_interopDefault(rv);var r0__default=/*#__PURE__*/_interopDefault(r0);var a0__default=/*#__PURE__*/_interopDefault(a0);var E0__default=/*#__PURE__*/_interopDefault(E0);var rm__default=/*#__PURE__*/_interopDefault(rm);var $v__default=/*#__PURE__*/_interopDefault($v);var Gv__default=/*#__PURE__*/_interopDefault(Gv);var Uv__default=/*#__PURE__*/_interopDefault(Uv);var qv__default=/*#__PURE__*/_interopDefault(qv);var fC__default=/*#__PURE__*/_interopDefault(fC);var EC__default=/*#__PURE__*/_interopDefault(EC);var FC__default=/*#__PURE__*/_interopDefault(FC);var vC__default=/*#__PURE__*/_interopDefault(vC);var Bk__default=/*#__PURE__*/_interopDefault(Bk);var Ek__default=/*#__PURE__*/_interopDefault(Ek);var Nk__default=/*#__PURE__*/_interopDefault(Nk);var Wk__default=/*#__PURE__*/_interopDefault(Wk);var $k__default=/*#__PURE__*/_interopDefault($k);var Gk__default=/*#__PURE__*/_interopDefault(Gk);var aS__default=/*#__PURE__*/_interopDefault(aS);var nS__default=/*#__PURE__*/_interopDefault(nS);var iS__default=/*#__PURE__*/_interopDefault(iS);var lS__default=/*#__PURE__*/_interopDefault(lS);var sS__default=/*#__PURE__*/_interopDefault(sS);var NS__default=/*#__PURE__*/_interopDefault(NS);var Yw__default=/*#__PURE__*/_interopDefault(Yw);var Qw__default=/*#__PURE__*/_interopDefault(Qw);var Jw__default=/*#__PURE__*/_interopDefault(Jw);var e1__default=/*#__PURE__*/_interopDefault(e1);var t1__default=/*#__PURE__*/_interopDefault(t1);var Bg__default=/*#__PURE__*/_interopDefault(Bg);var p1__default=/*#__PURE__*/_interopDefault(p1);var m1__default=/*#__PURE__*/_interopDefault(m1);var y1__default=/*#__PURE__*/_interopDefault(y1);var x1__default=/*#__PURE__*/_interopDefault(x1);var v1__default=/*#__PURE__*/_interopDefault(v1);var _1__default=/*#__PURE__*/_interopDefault(_1);var cf__default=/*#__PURE__*/_interopDefault(cf);var df__default=/*#__PURE__*/_interopDefault(df);var j1__default=/*#__PURE__*/_interopDefault(j1);var uT__default=/*#__PURE__*/_interopDefault(uT);var DT__default=/*#__PURE__*/_interopDefault(DT);var MT__default=/*#__PURE__*/_interopDefault(MT);var AT__default=/*#__PURE__*/_interopDefault(AT);var BT__default=/*#__PURE__*/_interopDefault(BT);var Ed=Object.defineProperty;var Pf=(e,t,o)=>t in e?Ed(e,t,{enumerable:true,configurable:true,writable:true,value:o}):e[t]=o;var Rf=(e,t)=>()=>(e&&(t=e(e=0)),t);var Df=(e,t)=>{for(var o in t)Ed(e,o,{get:t[o],enumerable:true});};var Fd=(e,t,o)=>Pf(e,t+"",o);var Sg={};Df(Sg,{COrbCanvas:()=>FS});function FS({hue:e=0,hoverIntensity:t=.2,rotateOnHover:o=true,forceHoverState:r=false,backgroundColor:a="transparent"}){let n=Rt.useRef(null),i=`
1
+ 'use strict';var ogl=require('ogl'),Et=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'),Sp=require('@mui/material/Dialog'),wp=require('@mui/material/DialogTitle'),Tp=require('@mui/material/DialogContent'),gh=require('@mui/material/DialogContentText'),Ip=require('@mui/material/DialogActions'),li=require('@mui/material/Box'),bh=require('@mui/icons-material/CheckCircle'),yh=require('@mui/icons-material/Warning'),xh=require('@mui/icons-material/Error'),vh=require('@mui/icons-material/Info'),material=require('@mui/material'),styles=require('@mui/material/styles'),Fh=require('@mui/icons-material/Clear'),Lh=require('@mui/icons-material/Close'),au=require('@mui/icons-material/Search'),_x=require('@mui/material/Paper'),jx=require('@mui/material/Table'),Zx=require('@mui/material/TableBody'),Ys=require('@mui/material/TableCell'),Mp=require('@mui/material/TableContainer'),db=require('@mui/material/TableHead'),ub=require('@mui/material/TableRow'),Pp=require('@mui/material/TextField'),Tl=require('@mui/material/Button'),Rp=require('@mui/material/Alert'),core=require('@dnd-kit/core'),modifiers=require('@dnd-kit/modifiers'),Xh=require('@mui/icons-material/ViewColumn'),yp=require('@mui/icons-material/Save'),Qh=require('@mui/icons-material/Download'),Jh=require('@mui/icons-material/AccountTree'),eb=require('@mui/icons-material/Functions'),tb=require('@mui/icons-material/Insights'),Su=require('@mui/icons-material/Add'),ab=require('@mui/icons-material/Edit'),rb=require('@mui/icons-material/Delete'),nb=require('@mui/icons-material/KeyboardArrowLeft'),If=require('@mui/icons-material/KeyboardArrowRight'),pb=require('@mui/material/Checkbox'),mb=require('@mui/material/TableSortLabel'),gb=require('@mui/material/IconButton'),fb=require('@mui/material/Tooltip'),hb=require('@mui/icons-material/UnfoldMore'),bb=require('@mui/icons-material/UnfoldLess'),sortable=require('@dnd-kit/sortable'),Pb=require('@mui/icons-material/KeyboardArrowDown'),Wb=require('@mui/icons-material/Check'),vu=require('@mui/icons-material/ClearAll'),Cu=require('@mui/icons-material/ArrowUpward'),ku=require('@mui/icons-material/ArrowDownward'),$b=require('@mui/icons-material/VisibilityOff'),Kb=require('@mui/icons-material/DeleteOutline'),Ry=require('@mui/icons-material/MicNoneOutlined'),My=require('@mui/icons-material/SettingsOutlined'),Dy=require('@mui/icons-material/SendOutlined'),Tx=require('@mui/icons-material/Settings'),Ix=require('@mui/icons-material/KeyboardArrowUp'),Rx=require('@mui/icons-material/ArrowRightAlt'),Yy=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'),dx=require('@mui/icons-material/CalendarMonth'),px=require('@mui/icons-material/ArrowForward'),ga=require('dayjs'),mx=require('dayjs/plugin/isBetween'),gx=require('dayjs/plugin/localizedFormat'),fx=require('dayjs/plugin/customParseFormat');require('dayjs/locale/zh-cn'),require('dayjs/locale/fr'),require('dayjs/locale/de'),require('dayjs/locale/ja'),require('dayjs/locale/ko');var $x=require('@mui/icons-material/StarBorder'),Gx=require('@mui/icons-material/ViewQuilt'),uv=require('@mui/icons-material/CloseOutlined'),u0=require('@mui/icons-material/ContentCopyOutlined'),p0=require('@mui/icons-material/CheckOutlined'),W0=require('@mui/icons-material/ExpandMore'),lm=require('@mui/icons-material/Language'),Xv=require('@mui/icons-material/DesktopWindows'),Yv=require('@mui/icons-material/DarkMode'),Qv=require('@mui/icons-material/LightMode'),eC=require('@mui/icons-material/Logout'),SC=require('@mui/icons-material/DragIndicator'),WC=require('@mui/icons-material/FilterList'),$C=require('@mui/icons-material/TableRows'),RC=require('@mui/icons-material/LayersClear'),Hk=require('@mui/icons-material/CameraAltRounded'),Wk=require('@mui/icons-material/QrCodeScannerRounded'),Kk=require('@mui/icons-material/DragIndicatorRounded'),Zk=require('@mui/icons-material/BackspaceRounded'),Xk=require('@mui/icons-material/CloseRounded'),Yk=require('@mui/icons-material/CheckRounded'),pS=require('@mui/icons-material/SearchRounded'),mS=require('@mui/icons-material/MenuOpenRounded'),gS=require('@mui/icons-material/MenuRounded'),fS=require('@mui/icons-material/ExpandMoreRounded'),hS=require('@mui/icons-material/ChevronRightRounded'),KS=require('next/dynamic'),framerMotion=require('framer-motion'),n1=require('react-markdown'),i1=require('remark-gfm'),l1=require('remark-math'),s1=require('rehype-katex'),c1=require('rehype-raw'),reactSyntaxHighlighter=require('react-syntax-highlighter'),prism=require('react-syntax-highlighter/dist/esm/styles/prism'),nextThemes=require('next-themes'),Hg=require('mermaid'),v1=require('@mui/icons-material/MicRounded'),C1=require('@mui/icons-material/MicOffRounded'),iconsMaterial=require('@mui/icons-material'),I1=require('@mui/icons-material/SendRounded'),P1=require('@mui/icons-material/AddRounded'),R1=require('@mui/icons-material/HardwareRounded'),tT=require('@mui/icons-material/LockOutlined'),bf=require('@mui/icons-material/MailOutline'),yf=require('@mui/icons-material/PersonOutline'),oT=require('@mui/icons-material/VpnKeyOutlined'),xT=require('dayjs/plugin/isoWeek'),NT=require('@mui/icons-material/KeyboardDoubleArrowLeftOutlined'),VT=require('@mui/icons-material/KeyboardDoubleArrowRightOutlined'),OT=require('@mui/icons-material/SplitscreenOutlined'),HT=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 Et__namespace=/*#__PURE__*/_interopNamespace(Et);var Sp__default=/*#__PURE__*/_interopDefault(Sp);var wp__default=/*#__PURE__*/_interopDefault(wp);var Tp__default=/*#__PURE__*/_interopDefault(Tp);var gh__default=/*#__PURE__*/_interopDefault(gh);var Ip__default=/*#__PURE__*/_interopDefault(Ip);var li__default=/*#__PURE__*/_interopDefault(li);var bh__default=/*#__PURE__*/_interopDefault(bh);var yh__default=/*#__PURE__*/_interopDefault(yh);var xh__default=/*#__PURE__*/_interopDefault(xh);var vh__default=/*#__PURE__*/_interopDefault(vh);var Fh__default=/*#__PURE__*/_interopDefault(Fh);var Lh__default=/*#__PURE__*/_interopDefault(Lh);var au__default=/*#__PURE__*/_interopDefault(au);var _x__default=/*#__PURE__*/_interopDefault(_x);var jx__default=/*#__PURE__*/_interopDefault(jx);var Zx__default=/*#__PURE__*/_interopDefault(Zx);var Ys__default=/*#__PURE__*/_interopDefault(Ys);var Mp__default=/*#__PURE__*/_interopDefault(Mp);var db__default=/*#__PURE__*/_interopDefault(db);var ub__default=/*#__PURE__*/_interopDefault(ub);var Pp__default=/*#__PURE__*/_interopDefault(Pp);var Tl__default=/*#__PURE__*/_interopDefault(Tl);var Rp__default=/*#__PURE__*/_interopDefault(Rp);var Xh__default=/*#__PURE__*/_interopDefault(Xh);var yp__default=/*#__PURE__*/_interopDefault(yp);var Qh__default=/*#__PURE__*/_interopDefault(Qh);var Jh__default=/*#__PURE__*/_interopDefault(Jh);var eb__default=/*#__PURE__*/_interopDefault(eb);var tb__default=/*#__PURE__*/_interopDefault(tb);var Su__default=/*#__PURE__*/_interopDefault(Su);var ab__default=/*#__PURE__*/_interopDefault(ab);var rb__default=/*#__PURE__*/_interopDefault(rb);var nb__default=/*#__PURE__*/_interopDefault(nb);var If__default=/*#__PURE__*/_interopDefault(If);var pb__default=/*#__PURE__*/_interopDefault(pb);var mb__default=/*#__PURE__*/_interopDefault(mb);var gb__default=/*#__PURE__*/_interopDefault(gb);var fb__default=/*#__PURE__*/_interopDefault(fb);var hb__default=/*#__PURE__*/_interopDefault(hb);var bb__default=/*#__PURE__*/_interopDefault(bb);var Pb__default=/*#__PURE__*/_interopDefault(Pb);var Wb__default=/*#__PURE__*/_interopDefault(Wb);var vu__default=/*#__PURE__*/_interopDefault(vu);var Cu__default=/*#__PURE__*/_interopDefault(Cu);var ku__default=/*#__PURE__*/_interopDefault(ku);var $b__default=/*#__PURE__*/_interopDefault($b);var Kb__default=/*#__PURE__*/_interopDefault(Kb);var Ry__default=/*#__PURE__*/_interopDefault(Ry);var My__default=/*#__PURE__*/_interopDefault(My);var Dy__default=/*#__PURE__*/_interopDefault(Dy);var Tx__default=/*#__PURE__*/_interopDefault(Tx);var Ix__default=/*#__PURE__*/_interopDefault(Ix);var Rx__default=/*#__PURE__*/_interopDefault(Rx);var Yy__default=/*#__PURE__*/_interopDefault(Yy);var dx__default=/*#__PURE__*/_interopDefault(dx);var px__default=/*#__PURE__*/_interopDefault(px);var ga__default=/*#__PURE__*/_interopDefault(ga);var mx__default=/*#__PURE__*/_interopDefault(mx);var gx__default=/*#__PURE__*/_interopDefault(gx);var fx__default=/*#__PURE__*/_interopDefault(fx);var $x__default=/*#__PURE__*/_interopDefault($x);var Gx__default=/*#__PURE__*/_interopDefault(Gx);var uv__default=/*#__PURE__*/_interopDefault(uv);var u0__default=/*#__PURE__*/_interopDefault(u0);var p0__default=/*#__PURE__*/_interopDefault(p0);var W0__default=/*#__PURE__*/_interopDefault(W0);var lm__default=/*#__PURE__*/_interopDefault(lm);var Xv__default=/*#__PURE__*/_interopDefault(Xv);var Yv__default=/*#__PURE__*/_interopDefault(Yv);var Qv__default=/*#__PURE__*/_interopDefault(Qv);var eC__default=/*#__PURE__*/_interopDefault(eC);var SC__default=/*#__PURE__*/_interopDefault(SC);var WC__default=/*#__PURE__*/_interopDefault(WC);var $C__default=/*#__PURE__*/_interopDefault($C);var RC__default=/*#__PURE__*/_interopDefault(RC);var Hk__default=/*#__PURE__*/_interopDefault(Hk);var Wk__default=/*#__PURE__*/_interopDefault(Wk);var Kk__default=/*#__PURE__*/_interopDefault(Kk);var Zk__default=/*#__PURE__*/_interopDefault(Zk);var Xk__default=/*#__PURE__*/_interopDefault(Xk);var Yk__default=/*#__PURE__*/_interopDefault(Yk);var pS__default=/*#__PURE__*/_interopDefault(pS);var mS__default=/*#__PURE__*/_interopDefault(mS);var gS__default=/*#__PURE__*/_interopDefault(gS);var fS__default=/*#__PURE__*/_interopDefault(fS);var hS__default=/*#__PURE__*/_interopDefault(hS);var KS__default=/*#__PURE__*/_interopDefault(KS);var n1__default=/*#__PURE__*/_interopDefault(n1);var i1__default=/*#__PURE__*/_interopDefault(i1);var l1__default=/*#__PURE__*/_interopDefault(l1);var s1__default=/*#__PURE__*/_interopDefault(s1);var c1__default=/*#__PURE__*/_interopDefault(c1);var Hg__default=/*#__PURE__*/_interopDefault(Hg);var v1__default=/*#__PURE__*/_interopDefault(v1);var C1__default=/*#__PURE__*/_interopDefault(C1);var I1__default=/*#__PURE__*/_interopDefault(I1);var P1__default=/*#__PURE__*/_interopDefault(P1);var R1__default=/*#__PURE__*/_interopDefault(R1);var tT__default=/*#__PURE__*/_interopDefault(tT);var bf__default=/*#__PURE__*/_interopDefault(bf);var yf__default=/*#__PURE__*/_interopDefault(yf);var oT__default=/*#__PURE__*/_interopDefault(oT);var xT__default=/*#__PURE__*/_interopDefault(xT);var NT__default=/*#__PURE__*/_interopDefault(NT);var VT__default=/*#__PURE__*/_interopDefault(VT);var OT__default=/*#__PURE__*/_interopDefault(OT);var HT__default=/*#__PURE__*/_interopDefault(HT);var Od=Object.defineProperty;var Lf=(e,t,o)=>t in e?Od(e,t,{enumerable:true,configurable:true,writable:true,value:o}):e[t]=o;var zf=(e,t)=>()=>(e&&(t=e(e=0)),t);var Nf=(e,t)=>{for(var o in t)Od(e,o,{get:t[o],enumerable:true});};var Hd=(e,t,o)=>Lf(e,t+"",o);var Ag={};Nf(Ag,{COrbCanvas:()=>$S});function $S({hue:e=0,hoverIntensity:t=.2,rotateOnHover:o=true,forceHoverState:a=false,backgroundColor:r="transparent"}){let n=Et.useRef(null),i=`
2
2
  precision highp float;
3
3
  attribute vec2 position;
4
4
  attribute vec2 uv;
@@ -180,22 +180,22 @@
180
180
  vec4 col = mainImage(fragCoord);
181
181
  gl_FragColor = vec4(col.rgb * col.a, col.a);
182
182
  }
183
- `;return Rt.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:kg(a)}}}),m=new ogl.Mesh(s,{geometry:g,program:f});function b(){if(!d)return;let P=window.devicePixelRatio||1,k=d.clientWidth,R=d.clientHeight;l.setSize(k*P,R*P),s.canvas.style.width=k+"px",s.canvas.style.height=R+"px",f.uniforms.iResolution.value.set(s.canvas.width,s.canvas.height,s.canvas.width/s.canvas.height);}window.addEventListener("resize",b),b();let C=0,u=0,v=0,p=.3,h=P=>{let k=d.getBoundingClientRect(),R=P.clientX-k.left,I=P.clientY-k.top,w=k.width,A=k.height,M=Math.min(w,A),D=w/2,B=A/2,j=(R-D)/M*2,W=(I-B)/M*2;Math.sqrt(j*j+W*W)<.8?C=1:C=0;},y=()=>{C=0;};d.addEventListener("mousemove",h),d.addEventListener("mouseleave",y);let S,E=P=>{S=requestAnimationFrame(E);let k=(P-u)*.001;u=P,f.uniforms.iTime.value=P*.001,f.uniforms.hue.value=e,f.uniforms.hoverIntensity.value=t,f.uniforms.backgroundColor.value=kg(a);let R=r?1:C;f.uniforms.hover.value+=(R-f.uniforms.hover.value)*.1,o&&R>.5&&(v+=k*p),f.uniforms.rot.value=v,l.render({scene:m});};return S=requestAnimationFrame(E),()=>{cancelAnimationFrame(S),window.removeEventListener("resize",b),d.removeEventListener("mousemove",h),d.removeEventListener("mouseleave",y),s.canvas.parentNode===d&&d.removeChild(s.canvas),s.getExtension("WEBGL_lose_context")?.loseContext();}},[e,t,o,r,a]),jsxRuntime.jsx("div",{ref:n,className:"w-full h-full"})}function LS(e,t,o){let r,a,n;if(t===0)r=a=n=o;else {let i=(l,s,g)=>(g<0&&(g+=1),g>1&&(g-=1),g<.16666666666666666?l+(s-l)*6*g:g<.5?s:g<.6666666666666666?l+(s-l)*(.6666666666666666-g)*6:l),c=o<.5?o*(1+t):o+t-o*t,d=2*o-c;r=i(d,c,e+1/3),a=i(d,c,e),n=i(d,c,e-1/3);}return new ogl.Vec3(r,a,n)}function kg(e){if(e==="transparent")return new ogl.Vec3(0,0,0);if(e.startsWith("#")){let r=parseInt(e.slice(1,3),16)/255,a=parseInt(e.slice(3,5),16)/255,n=parseInt(e.slice(5,7),16)/255;return new ogl.Vec3(r,a,n)}let t=e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);if(t)return new ogl.Vec3(parseInt(t[1])/255,parseInt(t[2])/255,parseInt(t[3])/255);let o=e.match(/hsla?\((\d+),\s*(\d+)%,\s*(\d+)%/);if(o){let r=parseInt(o[1])/360,a=parseInt(o[2])/100,n=parseInt(o[3])/100;return LS(r,a,n)}return new ogl.Vec3(0,0,0)}var wg=Rf(()=>{"use client";});function No(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var Ds={primary:"#000000",primaryHover:"#333333"},Fi={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"},Ln={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",full:"rounded-full"},Ld=()=>"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 Ff=classVarianceAuthority.cva(Ld(),{variants:{variant:{default:`${Fi.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:`${Fi.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:Fi.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-[${Ds.primary}] hover:bg-[${Ds.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:Ln.none,sm:Ln.sm,md:Ln.md,full:Ln.full}},defaultVariants:{variant:"default",size:"default",rounded:"md"}}),Ms=Rt__namespace.forwardRef(({className:e,variant:t,size:o,asChild:r=false,...a},n)=>jsxRuntime.jsx(r?reactSlot.Slot:"button",{className:No(Ff({variant:t,size:o,className:e})),ref:n,...a}));Ms.displayName="Button";var zf={"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","table.headerMenu.sortAsc":"Sort Ascending","table.headerMenu.sortDesc":"Sort Descending","table.headerMenu.clearSort":"Clear Sort","table.headerMenu.configureSort":"Configure Sort...","table.headerMenu.group":"Group by this column","table.headerMenu.ungroup":"Remove from grouping","table.headerMenu.addSummary":"Include in Summary","table.headerMenu.removeSummary":"Remove from Summary","table.headerMenu.hideColumn":"Hide Column","table.sortDialog.title":"Sort Settings","table.sortDialog.empty":"No sort rules. Add one to start ordering rows.","table.sortDialog.addRule":"Add Sort Rule","table.sortDialog.clearAll":"Clear All","table.sortDialog.asc":"Ascending","table.sortDialog.desc":"Descending","pivot.title.default":"Pivot Table Builder","pivot.subtitle.default":"Drag fields to configure the pivot table.","pivot.empty":"Drag at least one field into Values to render the pivot result.","pivot.records":"Records","pivot.afterFilter":"After filter","pivot.grandTotal":"Grand Total","pivot.resultLabel":"Result","pivot.valueLabel":"Value","pivot.table.dimensions":"Dimensions","pivot.config.title":"Configuration","pivot.fieldList":"Field List","pivot.availableDimensions":"Available dimensions","pivot.allFieldsInUse":"All fields are in use.","pivot.zone.rows":"Rows","pivot.zone.columns":"Columns","pivot.zone.filters":"Filters","pivot.zone.values":"Values","pivot.hint.rows":"Drag fields here to build row hierarchy","pivot.hint.columns":"Drag fields here to build column hierarchy","pivot.hint.filters":"Drag fields here for report filters","pivot.hint.values":"Drag numeric fields here for aggregation","pivot.clearArea":"Clear area","pivot.filter.na":"N/A","pivot.filter.noValues":"No values","pivot.filter.noneSelected":"None selected","pivot.filter.allValues":"All values","pivot.filter.selectedCount":"{selected} / {total} selected","pivot.filter.selectAll":"Select All","pivot.filter.deselectAll":"Deselect All","pivot.filter.noResults":"No results","pivot.collapse.ariaExpand":"Expand configuration area","pivot.collapse.ariaCollapse":"Collapse configuration area","pivot.agg.sum":"Sum","pivot.agg.count":"Count","pivot.agg.avg":"Average","pivot.agg.min":"Min","pivot.agg.max":"Max","pivot.preset.selectPlaceholder":"Select preset","pivot.preset.save":"Save preset","pivot.preset.delete":"Delete preset","pivot.preset.saveDialogTitle":"Save current preset","pivot.preset.nameLabel":"Preset name","pivot.preset.defaultName":"Preset {index}","pivot.table.sectionTitle":"Pivot Result","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"Expand pivot result","pivot.table.collapse.ariaCollapse":"Collapse pivot result","pivot.chart.title":"Pivot Chart","pivot.chart.subtitle":"Map one dimension and up to two measures into a compact chart.","pivot.chart.subtitleReady":"{dimension} by {measure}","pivot.chart.emptyNoDimension":"Add at least one row or column field to render the chart.","pivot.chart.emptyNoValue":"Add at least one value field to render the chart.","pivot.chart.emptyNoData":"No data available for the current chart selection.","pivot.chart.dimension":"Dimension","pivot.chart.primaryMeasure":"Measure","pivot.chart.secondaryMeasure":"Compare measure","pivot.chart.chartType":"Chart type","pivot.chart.style.barVertical":"Vertical bars","pivot.chart.style.barHorizontal":"Horizontal bars","pivot.chart.style.line":"Line","pivot.chart.style.scatter":"Scatter","pivot.chart.collapse.ariaExpand":"Expand chart area","pivot.chart.collapse.ariaCollapse":"Collapse chart area","smartFilter.adaptFilters":"Adapt Filters","smartFilter.addFilters":"Add Filters","smartFilter.go":"Go","smartFilter.visibleFilters":"Visible Filters","smartFilter.searchPlaceholder":"Search...","smartFilter.noOptionsFound":"No options found","smartFilter.min":"Min","smartFilter.max":"Max","smartFilter.minMaxPlaceholder":"Min - Max","smartFilter.operator.equals":"Equals","smartFilter.operator.contains":"Contains","smartFilter.operator.notContains":"Does Not Contain","smartFilter.operator.wildcard":"Wildcard Search","smartFilter.operator.notEquals":"Not Equals","smartFilter.operator.greaterThan":"Greater Than","smartFilter.operator.lessThan":"Less Than","smartFilter.operator.greaterOrEqual":"Greater Than or Equal","smartFilter.operator.lessOrEqual":"Less Than or Equal","smartFilter.operator.between":"Between","variant.noOptions":"No options","variant.defaultSuffix":"Default","variant.selectVariant":"Select Variant","variant.saveView":"Save View","variant.newVariant":"New Variant","variant.viewName":"View Name","variant.setDefault":"Set as Default","variant.publicAllUsers":"Public (All Users)","variant.toast.fetchFailed":"Failed to load variants","variant.toast.saveFailed":"Failed to save variant","variant.toast.saveSuccess":"Variant saved successfully","variant.toast.deleteFailed":"Failed to delete variant","variant.toast.deleteSuccess":"Variant deleted successfully","variant.toast.defaultFailed":"Failed to update default variant","variant.toast.defaultSuccess":"Default variant updated","layout.saveLayout":"Save Layout","layout.layoutOptions":"Layout Options","layout.selectLayout":"Select Layout","layout.saveCurrentLayout":"Save Current Layout...","layout.noSavedLayouts":"No saved layouts","layout.removeDefault":"Remove Default","layout.setAsDefault":"Set as Default","layout.layoutName":"Layout Name","layout.layoutDescription":"Description","layout.layoutNameHelper":"e.g., 'Compact View'","layout.warningOverwrite":"Warning: Existing layout will be overwritten","layout.useAsDefault":"Use as Default Layout","layout.publicAllUsers":"Public (Visible to all users)","layout.toast.loadFallback":"Failed to load layouts from backend, fallback to local storage","layout.toast.saveSuccess":"Layout saved successfully","layout.toast.saveLocalSuccess":"Layout saved to local storage","layout.toast.backendUnavailableSavedLocal":"Backend unavailable, saved to local storage","layout.toast.deleteSuccess":"Layout deleted successfully","layout.toast.deleteLocalSuccess":"Layout deleted from local storage","layout.toast.backendUnavailableDeletedLocal":"Backend unavailable, deleted from local storage","layout.toast.defaultSuccess":"Default layout set","layout.toast.defaultLocalSuccess":"Default layout set in local storage","layout.toast.backendUnavailableDefaultLocal":"Backend unavailable, default saved to local storage","dateRange.label":"Date Range","dateRange.startDate":"Start Date","dateRange.endDate":"End Date","dateRange.select":"Select...","dateRange.today":"Today","dateRange.thisWeek":"This Week","dateRange.thisMonth":"This Month","graph.records":"{count} records","graph.kpi.totalRecords":"Total Records","graph.kpi.totalReport":"Total Report","graph.kpi.totalBillable":"Total Billable","graph.kpi.efficiency":"Efficiency","graph.kpi.amount":"Amount","graph.kpi.flagged":"Flagged","graph.chart.billable.title":"Billable by Dimension","graph.chart.billable.subtitle":"Top values by billable hours","graph.chart.efficiency.title":"Efficiency by Person","graph.chart.efficiency.subtitle":"Lowest efficiency first","graph.chart.status.title":"Status Distribution","graph.chart.status.subtitle":"Record ratio by status","graph.dataBody":"Data Body","graph.reportTitle":"Graphic Report","graph.unassigned":"Unassigned","graph.column.reportHours":"Report Hours","graph.column.billableHours":"Billable Hours","detail.searchAi.placeholder":"Search fields, or ask AI if no match...","detail.searchAi.matches":"{count} matches found","detail.searchAi.noMatch":"No matching field found.","detail.searchAi.autoAiFallback":"No direct match. Triggering AI analysis...","detail.searchAi.aiResultTitle":"AI Insight","detail.table.title":"Related Records","kanban.empty":"Drop cards here","kanban.bucket.limit":"Limit","kanban.bucket.dropHere":"Release to move into this bucket","kanban.card.progress":"Progress","kanban.card.openDetail":"Open Detail","kanban.priority.critical":"Critical","kanban.priority.high":"High","kanban.priority.medium":"Medium","kanban.priority.low":"Low","quickCreate.newItem":"New Item","quickCreate.createWithTitle":"Create {title}","quickEdit.editWithTitle":"Edit {title}","quickDelete.confirmTitle":"Confirm Delete","quickDelete.confirmMessageSingle":"Are you sure you want to delete the selected record?","quickDelete.confirmMessageMultiple":"Are you sure you want to delete {count} selected records?","messageBox.confirm":"OK","messageBox.cancel":"Cancel"},Nf={"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","table.headerMenu.sortAsc":"\u5347\u5E8F\u6392\u5217","table.headerMenu.sortDesc":"\u964D\u5E8F\u6392\u5217","table.headerMenu.clearSort":"\u6E05\u9664\u6392\u5E8F","table.headerMenu.configureSort":"\u6392\u5E8F\u8BBE\u7F6E...","table.headerMenu.group":"\u6309\u6B64\u5217\u5206\u7EC4","table.headerMenu.ungroup":"\u53D6\u6D88\u5206\u7EC4","table.headerMenu.addSummary":"\u52A0\u5165\u6C47\u603B","table.headerMenu.removeSummary":"\u4ECE\u6C47\u603B\u4E2D\u79FB\u9664","table.headerMenu.hideColumn":"\u9690\u85CF\u8BE5\u5217","table.sortDialog.title":"\u6392\u5E8F\u8BBE\u7F6E","table.sortDialog.empty":"\u6682\u65E0\u6392\u5E8F\u89C4\u5219\uFF0C\u8BF7\u6DFB\u52A0\u89C4\u5219\u8FDB\u884C\u6392\u5E8F\u3002","table.sortDialog.addRule":"\u6DFB\u52A0\u6392\u5E8F\u89C4\u5219","table.sortDialog.clearAll":"\u6E05\u7A7A\u89C4\u5219","table.sortDialog.asc":"\u5347\u5E8F","table.sortDialog.desc":"\u964D\u5E8F","pivot.title.default":"\u6570\u636E\u900F\u89C6\u8868","pivot.subtitle.default":"\u62D6\u62FD\u5B57\u6BB5\u4EE5\u914D\u7F6E\u900F\u89C6\u8868\u3002","pivot.empty":"\u8BF7\u81F3\u5C11\u62D6\u5165\u4E00\u4E2A\u503C\u5B57\u6BB5\u540E\u518D\u67E5\u770B\u900F\u89C6\u7ED3\u679C\u3002","pivot.records":"\u8BB0\u5F55\u6570","pivot.afterFilter":"\u7B5B\u9009\u540E","pivot.grandTotal":"\u603B\u8BA1","pivot.resultLabel":"\u7ED3\u679C","pivot.valueLabel":"\u503C","pivot.table.dimensions":"\u7EF4\u5EA6","pivot.config.title":"\u5E03\u5C40\u914D\u7F6E","pivot.fieldList":"\u5B57\u6BB5\u5217\u8868","pivot.availableDimensions":"\u53EF\u7528\u7EF4\u5EA6","pivot.allFieldsInUse":"\u6240\u6709\u5B57\u6BB5\u90FD\u5DF2\u4F7F\u7528\u3002","pivot.zone.rows":"\u884C","pivot.zone.columns":"\u5217","pivot.zone.filters":"\u7B5B\u9009","pivot.zone.values":"\u503C","pivot.hint.rows":"\u5C06\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u6784\u5EFA\u884C\u5C42\u7EA7","pivot.hint.columns":"\u5C06\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u6784\u5EFA\u5217\u5C42\u7EA7","pivot.hint.filters":"\u5C06\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u4F5C\u4E3A\u62A5\u8868\u7B5B\u9009","pivot.hint.values":"\u5C06\u6570\u503C\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u8FDB\u884C\u805A\u5408","pivot.clearArea":"\u6E05\u7A7A\u533A\u57DF","pivot.filter.na":"\u4E0D\u53EF\u7528","pivot.filter.noValues":"\u65E0\u53EF\u9009\u503C","pivot.filter.noneSelected":"\u672A\u9009\u62E9","pivot.filter.allValues":"\u5168\u90E8\u503C","pivot.filter.selectedCount":"\u5DF2\u9009 {selected} / {total}","pivot.filter.selectAll":"\u5168\u9009","pivot.filter.deselectAll":"\u53D6\u6D88\u5168\u9009","pivot.filter.noResults":"\u65E0\u5339\u914D\u7ED3\u679C","pivot.collapse.ariaExpand":"\u5C55\u5F00\u914D\u7F6E\u533A\u57DF","pivot.collapse.ariaCollapse":"\u6298\u53E0\u914D\u7F6E\u533A\u57DF","pivot.agg.sum":"\u6C42\u548C","pivot.agg.count":"\u8BA1\u6570","pivot.agg.avg":"\u5E73\u5747\u503C","pivot.agg.min":"\u6700\u5C0F\u503C","pivot.agg.max":"\u6700\u5927\u503C","pivot.preset.selectPlaceholder":"\u9009\u62E9\u65B9\u6848","pivot.preset.save":"\u4FDD\u5B58\u65B9\u6848","pivot.preset.delete":"\u5220\u9664\u65B9\u6848","pivot.preset.saveDialogTitle":"\u4FDD\u5B58\u5F53\u524D\u65B9\u6848","pivot.preset.nameLabel":"\u65B9\u6848\u540D\u79F0","pivot.preset.defaultName":"\u65B9\u6848 {index}","pivot.table.sectionTitle":"\u900F\u89C6\u7ED3\u679C","pivot.table.expandRowsAll":"\u884C\u5168\u90E8\u6253\u5F00","pivot.table.collapseRowsAll":"\u884C\u5168\u90E8\u6298\u53E0","pivot.table.expandColumnsAll":"\u5217\u5168\u90E8\u6253\u5F00","pivot.table.collapseColumnsAll":"\u5217\u5168\u90E8\u6298\u53E0","pivot.table.collapse.ariaExpand":"\u5C55\u5F00\u900F\u89C6\u7ED3\u679C","pivot.table.collapse.ariaCollapse":"\u6298\u53E0\u900F\u89C6\u7ED3\u679C","pivot.chart.title":"\u900F\u89C6\u56FE\u8868","pivot.chart.subtitle":"\u5C06\u4E00\u4E2A\u7EF4\u5EA6\u4E0E\u6700\u591A\u4E24\u4E2A\u5EA6\u91CF\u6620\u5C04\u4E3A\u7D27\u51D1\u56FE\u8868\u3002","pivot.chart.subtitleReady":"{dimension} \xB7 {measure}","pivot.chart.emptyNoDimension":"\u8BF7\u81F3\u5C11\u653E\u5165\u4E00\u4E2A\u884C\u6216\u5217\u5B57\u6BB5\u540E\u518D\u67E5\u770B\u56FE\u8868\u3002","pivot.chart.emptyNoValue":"\u8BF7\u81F3\u5C11\u653E\u5165\u4E00\u4E2A\u503C\u5B57\u6BB5\u540E\u518D\u67E5\u770B\u56FE\u8868\u3002","pivot.chart.emptyNoData":"\u5F53\u524D\u56FE\u8868\u9009\u62E9\u4E0B\u6682\u65E0\u53EF\u5C55\u793A\u6570\u636E\u3002","pivot.chart.dimension":"\u56FE\u8868\u7EF4\u5EA6","pivot.chart.primaryMeasure":"\u4E3B\u5EA6\u91CF","pivot.chart.secondaryMeasure":"\u5BF9\u6BD4\u5EA6\u91CF","pivot.chart.chartType":"\u56FE\u8868\u7C7B\u578B","pivot.chart.style.barVertical":"\u7EB5\u5411\u67F1\u72B6\u56FE","pivot.chart.style.barHorizontal":"\u6A2A\u5411\u67F1\u72B6\u56FE","pivot.chart.style.line":"\u6298\u7EBF\u56FE","pivot.chart.style.scatter":"\u6563\u70B9\u56FE","pivot.chart.collapse.ariaExpand":"\u5C55\u5F00\u56FE\u8868\u533A\u57DF","pivot.chart.collapse.ariaCollapse":"\u6298\u53E0\u56FE\u8868\u533A\u57DF","smartFilter.adaptFilters":"\u7B5B\u9009\u8BBE\u7F6E","smartFilter.addFilters":"\u6DFB\u52A0\u7B5B\u9009","smartFilter.go":"\u6267\u884C","smartFilter.visibleFilters":"\u53EF\u89C1\u7B5B\u9009\u9879","smartFilter.searchPlaceholder":"\u641C\u7D22...","smartFilter.noOptionsFound":"\u672A\u627E\u5230\u9009\u9879","smartFilter.min":"\u6700\u5C0F\u503C","smartFilter.max":"\u6700\u5927\u503C","smartFilter.minMaxPlaceholder":"\u6700\u5C0F\u503C - \u6700\u5927\u503C","smartFilter.operator.equals":"\u7B49\u4E8E","smartFilter.operator.contains":"\u5305\u542B","smartFilter.operator.notContains":"\u4E0D\u5305\u542B","smartFilter.operator.wildcard":"\u901A\u914D\u7B26\u641C\u7D22","smartFilter.operator.notEquals":"\u4E0D\u7B49\u4E8E","smartFilter.operator.greaterThan":"\u5927\u4E8E","smartFilter.operator.lessThan":"\u5C0F\u4E8E","smartFilter.operator.greaterOrEqual":"\u5927\u4E8E\u7B49\u4E8E","smartFilter.operator.lessOrEqual":"\u5C0F\u4E8E\u7B49\u4E8E","smartFilter.operator.between":"\u533A\u95F4","variant.noOptions":"\u65E0\u9009\u9879","variant.defaultSuffix":"\u9ED8\u8BA4","variant.selectVariant":"\u9009\u62E9\u89C6\u56FE","variant.saveView":"\u4FDD\u5B58\u89C6\u56FE","variant.newVariant":"\u65B0\u89C6\u56FE","variant.viewName":"\u89C6\u56FE\u540D\u79F0","variant.setDefault":"\u8BBE\u4E3A\u9ED8\u8BA4","variant.publicAllUsers":"\u516C\u5F00\uFF08\u6240\u6709\u7528\u6237\uFF09","variant.toast.fetchFailed":"\u52A0\u8F7D\u89C6\u56FE\u5931\u8D25","variant.toast.saveFailed":"\u4FDD\u5B58\u89C6\u56FE\u5931\u8D25","variant.toast.saveSuccess":"\u89C6\u56FE\u4FDD\u5B58\u6210\u529F","variant.toast.deleteFailed":"\u5220\u9664\u89C6\u56FE\u5931\u8D25","variant.toast.deleteSuccess":"\u89C6\u56FE\u5220\u9664\u6210\u529F","variant.toast.defaultFailed":"\u66F4\u65B0\u9ED8\u8BA4\u89C6\u56FE\u5931\u8D25","variant.toast.defaultSuccess":"\u9ED8\u8BA4\u89C6\u56FE\u5DF2\u66F4\u65B0","layout.saveLayout":"\u4FDD\u5B58\u5E03\u5C40","layout.layoutOptions":"\u5E03\u5C40\u9009\u9879","layout.selectLayout":"\u9009\u62E9\u5E03\u5C40","layout.saveCurrentLayout":"\u4FDD\u5B58\u5F53\u524D\u5E03\u5C40...","layout.noSavedLayouts":"\u6682\u65E0\u5DF2\u4FDD\u5B58\u5E03\u5C40","layout.removeDefault":"\u53D6\u6D88\u9ED8\u8BA4","layout.setAsDefault":"\u8BBE\u4E3A\u9ED8\u8BA4","layout.layoutName":"\u5E03\u5C40\u540D\u79F0","layout.layoutDescription":"\u63CF\u8FF0","layout.layoutNameHelper":"\u4F8B\u5982\uFF1A\u7D27\u51D1\u89C6\u56FE","layout.warningOverwrite":"\u8B66\u544A\uFF1A\u5C06\u8986\u76D6\u540C\u540D\u5E03\u5C40","layout.useAsDefault":"\u7528\u4F5C\u9ED8\u8BA4\u5E03\u5C40","layout.publicAllUsers":"\u516C\u5F00\uFF08\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09","layout.toast.loadFallback":"\u540E\u7AEF\u52A0\u8F7D\u5E03\u5C40\u5931\u8D25\uFF0C\u5DF2\u56DE\u9000\u5230\u672C\u5730\u5B58\u50A8","layout.toast.saveSuccess":"\u5E03\u5C40\u4FDD\u5B58\u6210\u529F","layout.toast.saveLocalSuccess":"\u5E03\u5C40\u5DF2\u4FDD\u5B58\u5230\u672C\u5730\u5B58\u50A8","layout.toast.backendUnavailableSavedLocal":"\u540E\u7AEF\u4E0D\u53EF\u7528\uFF0C\u5DF2\u4FDD\u5B58\u5230\u672C\u5730\u5B58\u50A8","layout.toast.deleteSuccess":"\u5E03\u5C40\u5220\u9664\u6210\u529F","layout.toast.deleteLocalSuccess":"\u5E03\u5C40\u5DF2\u4ECE\u672C\u5730\u5B58\u50A8\u5220\u9664","layout.toast.backendUnavailableDeletedLocal":"\u540E\u7AEF\u4E0D\u53EF\u7528\uFF0C\u5DF2\u4ECE\u672C\u5730\u5B58\u50A8\u5220\u9664","layout.toast.defaultSuccess":"\u9ED8\u8BA4\u5E03\u5C40\u5DF2\u8BBE\u7F6E","layout.toast.defaultLocalSuccess":"\u9ED8\u8BA4\u5E03\u5C40\u5DF2\u5728\u672C\u5730\u5B58\u50A8\u8BBE\u7F6E","layout.toast.backendUnavailableDefaultLocal":"\u540E\u7AEF\u4E0D\u53EF\u7528\uFF0C\u9ED8\u8BA4\u5E03\u5C40\u5DF2\u4FDD\u5B58\u5230\u672C\u5730\u5B58\u50A8","dateRange.label":"\u65E5\u671F\u8303\u56F4","dateRange.startDate":"\u5F00\u59CB\u65E5\u671F","dateRange.endDate":"\u7ED3\u675F\u65E5\u671F","dateRange.select":"\u8BF7\u9009\u62E9...","dateRange.today":"\u4ECA\u5929","dateRange.thisWeek":"\u672C\u5468","dateRange.thisMonth":"\u672C\u6708","graph.records":"{count} \u6761\u8BB0\u5F55","graph.kpi.totalRecords":"\u603B\u8BB0\u5F55\u6570","graph.kpi.totalReport":"\u603B\u7533\u62A5\u5DE5\u65F6","graph.kpi.totalBillable":"\u603B\u53EF\u8BA1\u8D39\u5DE5\u65F6","graph.kpi.efficiency":"\u6548\u7387","graph.kpi.amount":"\u91D1\u989D","graph.kpi.flagged":"\u6807\u8BB0","graph.chart.billable.title":"\u7EF4\u5EA6\u8BA1\u8D39\u5DE5\u65F6","graph.chart.billable.subtitle":"\u6309\u53EF\u8BA1\u8D39\u5DE5\u65F6\u6392\u5E8F\u524D\u5217","graph.chart.efficiency.title":"\u4EBA\u5458\u6548\u7387","graph.chart.efficiency.subtitle":"\u6309\u6700\u4F4E\u6548\u7387\u4F18\u5148","graph.chart.status.title":"\u72B6\u6001\u5206\u5E03","graph.chart.status.subtitle":"\u6309\u72B6\u6001\u8BB0\u5F55\u5360\u6BD4","graph.dataBody":"\u6570\u636E\u660E\u7EC6","graph.reportTitle":"\u56FE\u8868\u62A5\u8868","graph.unassigned":"\u672A\u5206\u914D","graph.column.reportHours":"\u7533\u62A5\u5DE5\u65F6","graph.column.billableHours":"\u53EF\u8BA1\u8D39\u5DE5\u65F6","detail.searchAi.placeholder":"\u641C\u7D22\u5B57\u6BB5\uFF1B\u5982\u65E0\u7ED3\u679C\u5219\u81EA\u52A8\u89E6\u53D1 AI...","detail.searchAi.matches":"{count} \u6761\u5339\u914D\u7ED3\u679C","detail.searchAi.noMatch":"\u672A\u627E\u5230\u5339\u914D\u5B57\u6BB5\u3002","detail.searchAi.autoAiFallback":"\u672A\u547D\u4E2D\u5B57\u6BB5\uFF0C\u6B63\u5728\u89E6\u53D1 AI \u5206\u6790...","detail.searchAi.aiResultTitle":"AI \u5206\u6790\u7ED3\u679C","detail.table.title":"\u5173\u8054\u8BB0\u5F55","kanban.empty":"\u5C06\u5361\u7247\u62D6\u5230\u8FD9\u91CC","kanban.bucket.limit":"\u4E0A\u9650","kanban.bucket.dropHere":"\u91CA\u653E\u540E\u79FB\u52A8\u5230\u8BE5 bucket","kanban.card.progress":"\u8FDB\u5EA6","kanban.card.openDetail":"\u6253\u5F00\u8BE6\u60C5","kanban.priority.critical":"\u7D27\u6025","kanban.priority.high":"\u9AD8","kanban.priority.medium":"\u4E2D","kanban.priority.low":"\u4F4E","quickCreate.newItem":"\u65B0\u5EFA\u6761\u76EE","quickCreate.createWithTitle":"\u521B\u5EFA{title}","quickEdit.editWithTitle":"\u7F16\u8F91{title}","quickDelete.confirmTitle":"\u786E\u8BA4\u5220\u9664","quickDelete.confirmMessageSingle":"\u786E\u8BA4\u5220\u9664\u5F53\u524D\u9009\u4E2D\u8BB0\u5F55\u5417\uFF1F","quickDelete.confirmMessageMultiple":"\u786E\u8BA4\u5220\u9664\u5DF2\u9009\u4E2D\u7684 {count} \u6761\u8BB0\u5F55\u5417\uFF1F","messageBox.confirm":"\u786E\u5B9A","messageBox.cancel":"\u53D6\u6D88"},Vf={"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","table.headerMenu.sortAsc":"Trier ascendant","table.headerMenu.sortDesc":"Trier descendant","table.headerMenu.clearSort":"Effacer le tri","table.headerMenu.configureSort":"Configurer le tri...","table.headerMenu.group":"Grouper par cette colonne","table.headerMenu.ungroup":"Retirer du groupement","table.headerMenu.addSummary":"Inclure dans le r\xE9sum\xE9","table.headerMenu.removeSummary":"Retirer du r\xE9sum\xE9","table.headerMenu.hideColumn":"Masquer la colonne","table.sortDialog.title":"Param\xE8tres de tri","table.sortDialog.empty":"Aucune r\xE8gle de tri. Ajoutez-en une pour commencer.","table.sortDialog.addRule":"Ajouter une r\xE8gle","table.sortDialog.clearAll":"Tout effacer","table.sortDialog.asc":"Ascendant","table.sortDialog.desc":"Descendant","pivot.title.default":"Tableau crois\xE9 dynamique","pivot.subtitle.default":"Faites glisser les champs pour configurer le tableau crois\xE9.","pivot.empty":"Ajoutez au moins un champ de valeur pour afficher le r\xE9sultat.","pivot.records":"Enregistrements","pivot.afterFilter":"Apr\xE8s filtre","pivot.grandTotal":"Total g\xE9n\xE9ral","pivot.resultLabel":"R\xE9sultat","pivot.valueLabel":"Valeur","pivot.table.dimensions":"Dimensions","pivot.config.title":"Configuration","pivot.fieldList":"Liste des champs","pivot.availableDimensions":"Dimensions disponibles","pivot.allFieldsInUse":"Tous les champs sont d\xE9j\xE0 utilis\xE9s.","pivot.zone.rows":"Lignes","pivot.zone.columns":"Colonnes","pivot.zone.filters":"Filtres","pivot.zone.values":"Valeurs","pivot.hint.rows":"D\xE9posez les champs ici pour construire la hi\xE9rarchie des lignes","pivot.hint.columns":"D\xE9posez les champs ici pour construire la hi\xE9rarchie des colonnes","pivot.hint.filters":"D\xE9posez les champs ici pour les filtres du rapport","pivot.hint.values":"D\xE9posez les champs num\xE9riques ici pour les agr\xE9gations","pivot.clearArea":"Vider la zone","pivot.filter.na":"N/A","pivot.filter.noValues":"Aucune valeur","pivot.filter.noneSelected":"Aucune s\xE9lection","pivot.filter.allValues":"Toutes les valeurs","pivot.filter.selectedCount":"{selected} / {total} s\xE9lectionn\xE9es","pivot.filter.selectAll":"Tout s\xE9lectionner","pivot.filter.deselectAll":"Tout d\xE9s\xE9lectionner","pivot.filter.noResults":"Aucun r\xE9sultat","pivot.collapse.ariaExpand":"D\xE9velopper la zone de configuration","pivot.collapse.ariaCollapse":"R\xE9duire la zone de configuration","pivot.agg.sum":"Somme","pivot.agg.count":"Compte","pivot.agg.avg":"Moyenne","pivot.agg.min":"Min","pivot.agg.max":"Max","pivot.preset.selectPlaceholder":"S\xE9lectionner un preset","pivot.preset.save":"Enregistrer le preset","pivot.preset.delete":"Supprimer le preset","pivot.preset.saveDialogTitle":"Enregistrer le preset actuel","pivot.preset.nameLabel":"Nom du preset","pivot.preset.defaultName":"Preset {index}","pivot.table.sectionTitle":"R\xE9sultat du pivot","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"D\xE9velopper le r\xE9sultat du pivot","pivot.table.collapse.ariaCollapse":"R\xE9duire le r\xE9sultat du pivot","pivot.chart.title":"Graphique pivot","pivot.chart.subtitle":"Associez une dimension et jusqu\u2019\xE0 deux mesures dans un graphique compact.","pivot.chart.subtitleReady":"{dimension} par {measure}","pivot.chart.emptyNoDimension":"Ajoutez au moins un champ de ligne ou de colonne pour afficher le graphique.","pivot.chart.emptyNoValue":"Ajoutez au moins un champ de valeur pour afficher le graphique.","pivot.chart.emptyNoData":"Aucune donn\xE9e disponible pour la s\xE9lection actuelle du graphique.","pivot.chart.dimension":"Dimension","pivot.chart.primaryMeasure":"Mesure","pivot.chart.secondaryMeasure":"Mesure de comparaison","pivot.chart.chartType":"Type de graphique","pivot.chart.style.barVertical":"Barres verticales","pivot.chart.style.barHorizontal":"Barres horizontales","pivot.chart.style.line":"Ligne","pivot.chart.style.scatter":"Nuage de points","pivot.chart.collapse.ariaExpand":"D\xE9velopper la zone du graphique","pivot.chart.collapse.ariaCollapse":"R\xE9duire la zone du graphique","smartFilter.adaptFilters":"Adapter les filtres","smartFilter.addFilters":"Ajouter des filtres","smartFilter.go":"Ex\xE9cuter","smartFilter.visibleFilters":"Filtres visibles","smartFilter.searchPlaceholder":"Rechercher...","smartFilter.noOptionsFound":"Aucune option trouv\xE9e","smartFilter.min":"Min","smartFilter.max":"Max","smartFilter.minMaxPlaceholder":"Min - Max","smartFilter.operator.equals":"\xC9gal \xE0","smartFilter.operator.contains":"Contient","smartFilter.operator.notContains":"Ne contient pas","smartFilter.operator.wildcard":"Recherche g\xE9n\xE9rique","smartFilter.operator.notEquals":"Diff\xE9rent de","smartFilter.operator.greaterThan":"Sup\xE9rieur \xE0","smartFilter.operator.lessThan":"Inf\xE9rieur \xE0","smartFilter.operator.greaterOrEqual":"Sup\xE9rieur ou \xE9gal","smartFilter.operator.lessOrEqual":"Inf\xE9rieur ou \xE9gal","smartFilter.operator.between":"Entre","variant.noOptions":"Aucune option","variant.defaultSuffix":"Par d\xE9faut","variant.selectVariant":"S\xE9lectionner une vue","variant.saveView":"Enregistrer la vue","variant.newVariant":"Nouvelle vue","variant.viewName":"Nom de la vue","variant.setDefault":"D\xE9finir par d\xE9faut","variant.publicAllUsers":"Public (tous les utilisateurs)","variant.toast.fetchFailed":"\xC9chec du chargement des vues","variant.toast.saveFailed":"\xC9chec de l'enregistrement de la vue","variant.toast.saveSuccess":"Vue enregistr\xE9e avec succ\xE8s","variant.toast.deleteFailed":"\xC9chec de la suppression de la vue","variant.toast.deleteSuccess":"Vue supprim\xE9e avec succ\xE8s","variant.toast.defaultFailed":"\xC9chec de la mise \xE0 jour de la vue par d\xE9faut","variant.toast.defaultSuccess":"Vue par d\xE9faut mise \xE0 jour","layout.saveLayout":"Enregistrer la vue","layout.layoutOptions":"Options de vue","layout.selectLayout":"S\xE9lectionner une vue","layout.saveCurrentLayout":"Enregistrer la vue actuelle...","layout.noSavedLayouts":"Aucune vue enregistr\xE9e","layout.removeDefault":"Retirer le d\xE9faut","layout.setAsDefault":"D\xE9finir par d\xE9faut","layout.layoutName":"Nom de la vue","layout.layoutDescription":"Description","layout.layoutNameHelper":"ex. : Vue compacte","layout.warningOverwrite":"Attention : la vue existante sera \xE9cras\xE9e","layout.useAsDefault":"Utiliser comme vue par d\xE9faut","layout.publicAllUsers":"Public (visible par tous les utilisateurs)","layout.toast.loadFallback":"\xC9chec du chargement depuis le backend, bascule vers le stockage local","layout.toast.saveSuccess":"Vue enregistr\xE9e avec succ\xE8s","layout.toast.saveLocalSuccess":"Vue enregistr\xE9e dans le stockage local","layout.toast.backendUnavailableSavedLocal":"Backend indisponible, enregistr\xE9 en local","layout.toast.deleteSuccess":"Vue supprim\xE9e avec succ\xE8s","layout.toast.deleteLocalSuccess":"Vue supprim\xE9e du stockage local","layout.toast.backendUnavailableDeletedLocal":"Backend indisponible, supprim\xE9 en local","layout.toast.defaultSuccess":"Vue par d\xE9faut d\xE9finie","layout.toast.defaultLocalSuccess":"Vue par d\xE9faut d\xE9finie en local","layout.toast.backendUnavailableDefaultLocal":"Backend indisponible, d\xE9faut enregistr\xE9 en local","dateRange.label":"Plage de dates","dateRange.startDate":"Date de d\xE9but","dateRange.endDate":"Date de fin","dateRange.select":"S\xE9lectionner...","dateRange.today":"Aujourd'hui","dateRange.thisWeek":"Cette semaine","dateRange.thisMonth":"Ce mois-ci","graph.records":"{count} enregistrements","graph.kpi.totalRecords":"Total des enregistrements","graph.kpi.totalReport":"Total d\xE9clar\xE9","graph.kpi.totalBillable":"Total facturable","graph.kpi.efficiency":"Efficacit\xE9","graph.kpi.amount":"Montant","graph.kpi.flagged":"Signal\xE9","graph.chart.billable.title":"Facturable par dimension","graph.chart.billable.subtitle":"Top valeurs par heures facturables","graph.chart.efficiency.title":"Efficacit\xE9 par personne","graph.chart.efficiency.subtitle":"Efficacit\xE9 la plus faible en premier","graph.chart.status.title":"R\xE9partition des statuts","graph.chart.status.subtitle":"Ratio des enregistrements par statut","graph.dataBody":"Donn\xE9es","graph.reportTitle":"Rapport graphique","graph.unassigned":"Non attribu\xE9","graph.column.reportHours":"Heures d\xE9clar\xE9es","graph.column.billableHours":"Heures facturables","detail.searchAi.placeholder":"Rechercher des champs, ou interroger l\u2019IA en cas d\u2019absence de r\xE9sultat...","detail.searchAi.matches":"{count} correspondances trouv\xE9es","detail.searchAi.noMatch":"Aucun champ correspondant trouv\xE9.","detail.searchAi.autoAiFallback":"Aucune correspondance directe. Analyse IA en cours...","detail.searchAi.aiResultTitle":"Analyse IA","detail.table.title":"Enregistrements li\xE9s","kanban.empty":"D\xE9posez les cartes ici","kanban.bucket.limit":"Limite","kanban.bucket.dropHere":"Rel\xE2chez pour d\xE9placer dans cette colonne","kanban.card.progress":"Progression","kanban.card.openDetail":"Ouvrir le d\xE9tail","kanban.priority.critical":"Critique","kanban.priority.high":"\xC9lev\xE9e","kanban.priority.medium":"Moyenne","kanban.priority.low":"Faible","quickCreate.newItem":"Nouvel \xE9l\xE9ment","quickCreate.createWithTitle":"Cr\xE9er {title}","quickEdit.editWithTitle":"Modifier {title}","quickDelete.confirmTitle":"Confirmer la suppression","quickDelete.confirmMessageSingle":"Voulez-vous vraiment supprimer l\u2019enregistrement s\xE9lectionn\xE9 ?","quickDelete.confirmMessageMultiple":"Voulez-vous vraiment supprimer les {count} enregistrements s\xE9lectionn\xE9s ?","messageBox.confirm":"OK","messageBox.cancel":"Annuler"},Of={"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","table.headerMenu.sortAsc":"Aufsteigend sortieren","table.headerMenu.sortDesc":"Absteigend sortieren","table.headerMenu.clearSort":"Sortierung entfernen","table.headerMenu.configureSort":"Sortierung konfigurieren...","table.headerMenu.group":"Nach dieser Spalte gruppieren","table.headerMenu.ungroup":"Aus Gruppierung entfernen","table.headerMenu.addSummary":"In Summe einbeziehen","table.headerMenu.removeSummary":"Aus Summe entfernen","table.headerMenu.hideColumn":"Spalte ausblenden","table.sortDialog.title":"Sortiereinstellungen","table.sortDialog.empty":"Keine Sortierregeln. F\xFCgen Sie eine hinzu, um zu sortieren.","table.sortDialog.addRule":"Regel hinzuf\xFCgen","table.sortDialog.clearAll":"Alle l\xF6schen","table.sortDialog.asc":"Aufsteigend","table.sortDialog.desc":"Absteigend","pivot.title.default":"Pivot-Tabelle","pivot.subtitle.default":"Ziehen Sie Felder, um die Pivot-Tabelle zu konfigurieren.","pivot.empty":"Ziehen Sie mindestens ein Wertefeld, um das Ergebnis anzuzeigen.","pivot.records":"Datens\xE4tze","pivot.afterFilter":"Nach Filter","pivot.grandTotal":"Gesamtsumme","pivot.resultLabel":"Ergebnis","pivot.valueLabel":"Wert","pivot.table.dimensions":"Dimensionen","pivot.config.title":"Konfiguration","pivot.fieldList":"Feldliste","pivot.availableDimensions":"Verf\xFCgbare Dimensionen","pivot.allFieldsInUse":"Alle Felder sind bereits verwendet.","pivot.zone.rows":"Zeilen","pivot.zone.columns":"Spalten","pivot.zone.filters":"Filter","pivot.zone.values":"Werte","pivot.hint.rows":"Felder hierhin ziehen, um die Zeilenhierarchie zu erstellen","pivot.hint.columns":"Felder hierhin ziehen, um die Spaltenhierarchie zu erstellen","pivot.hint.filters":"Felder hierhin ziehen f\xFCr Berichtsfilter","pivot.hint.values":"Numerische Felder hierhin ziehen f\xFCr Aggregation","pivot.clearArea":"Bereich leeren","pivot.filter.na":"N/V","pivot.filter.noValues":"Keine Werte","pivot.filter.noneSelected":"Nichts ausgew\xE4hlt","pivot.filter.allValues":"Alle Werte","pivot.filter.selectedCount":"{selected} / {total} ausgew\xE4hlt","pivot.filter.selectAll":"Alle ausw\xE4hlen","pivot.filter.deselectAll":"Alle abw\xE4hlen","pivot.filter.noResults":"Keine Ergebnisse","pivot.collapse.ariaExpand":"Konfigurationsbereich erweitern","pivot.collapse.ariaCollapse":"Konfigurationsbereich reduzieren","pivot.agg.sum":"Summe","pivot.agg.count":"Anzahl","pivot.agg.avg":"Durchschnitt","pivot.agg.min":"Min","pivot.agg.max":"Max","pivot.preset.selectPlaceholder":"Preset w\xE4hlen","pivot.preset.save":"Preset speichern","pivot.preset.delete":"Preset l\xF6schen","pivot.preset.saveDialogTitle":"Aktuelles Preset speichern","pivot.preset.nameLabel":"Preset-Name","pivot.preset.defaultName":"Preset {index}","pivot.table.sectionTitle":"Pivot-Ergebnis","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"Pivot-Ergebnis erweitern","pivot.table.collapse.ariaCollapse":"Pivot-Ergebnis reduzieren","pivot.chart.title":"Pivot-Diagramm","pivot.chart.subtitle":"Eine Dimension und bis zu zwei Kennzahlen in einem kompakten Diagramm abbilden.","pivot.chart.subtitleReady":"{dimension} nach {measure}","pivot.chart.emptyNoDimension":"F\xFCgen Sie mindestens ein Zeilen- oder Spaltenfeld hinzu, um das Diagramm anzuzeigen.","pivot.chart.emptyNoValue":"F\xFCgen Sie mindestens ein Wertefeld hinzu, um das Diagramm anzuzeigen.","pivot.chart.emptyNoData":"F\xFCr die aktuelle Diagrammauswahl sind keine Daten verf\xFCgbar.","pivot.chart.dimension":"Dimension","pivot.chart.primaryMeasure":"Kennzahl","pivot.chart.secondaryMeasure":"Vergleichskennzahl","pivot.chart.chartType":"Diagrammtyp","pivot.chart.style.barVertical":"Vertikale Balken","pivot.chart.style.barHorizontal":"Horizontale Balken","pivot.chart.style.line":"Linie","pivot.chart.style.scatter":"Streudiagramm","pivot.chart.collapse.ariaExpand":"Diagrammbereich erweitern","pivot.chart.collapse.ariaCollapse":"Diagrammbereich reduzieren","smartFilter.adaptFilters":"Filter anpassen","smartFilter.addFilters":"Filter hinzuf\xFCgen","smartFilter.go":"Los","smartFilter.visibleFilters":"Sichtbare Filter","smartFilter.searchPlaceholder":"Suchen...","smartFilter.noOptionsFound":"Keine Optionen gefunden","smartFilter.min":"Min","smartFilter.max":"Max","smartFilter.minMaxPlaceholder":"Min - Max","smartFilter.operator.equals":"Gleich","smartFilter.operator.contains":"Enth\xE4lt","smartFilter.operator.notContains":"Enth\xE4lt nicht","smartFilter.operator.wildcard":"Wildcard-Suche","smartFilter.operator.notEquals":"Ungleich","smartFilter.operator.greaterThan":"Gr\xF6\xDFer als","smartFilter.operator.lessThan":"Kleiner als","smartFilter.operator.greaterOrEqual":"Gr\xF6\xDFer gleich","smartFilter.operator.lessOrEqual":"Kleiner gleich","smartFilter.operator.between":"Zwischen","variant.noOptions":"Keine Optionen","variant.defaultSuffix":"Standard","variant.selectVariant":"Variante w\xE4hlen","variant.saveView":"Ansicht speichern","variant.newVariant":"Neue Variante","variant.viewName":"Ansichtsname","variant.setDefault":"Als Standard setzen","variant.publicAllUsers":"\xD6ffentlich (alle Benutzer)","variant.toast.fetchFailed":"Varianten konnten nicht geladen werden","variant.toast.saveFailed":"Variante konnte nicht gespeichert werden","variant.toast.saveSuccess":"Variante erfolgreich gespeichert","variant.toast.deleteFailed":"Variante konnte nicht gel\xF6scht werden","variant.toast.deleteSuccess":"Variante erfolgreich gel\xF6scht","variant.toast.defaultFailed":"Standardvariante konnte nicht aktualisiert werden","variant.toast.defaultSuccess":"Standardvariante aktualisiert","layout.saveLayout":"Layout speichern","layout.layoutOptions":"Layout-Optionen","layout.selectLayout":"Layout w\xE4hlen","layout.saveCurrentLayout":"Aktuelles Layout speichern...","layout.noSavedLayouts":"Keine gespeicherten Layouts","layout.removeDefault":"Standard entfernen","layout.setAsDefault":"Als Standard setzen","layout.layoutName":"Layoutname","layout.layoutDescription":"Beschreibung","layout.layoutNameHelper":"z. B. Kompaktansicht","layout.warningOverwrite":"Warnung: Vorhandenes Layout wird \xFCberschrieben","layout.useAsDefault":"Als Standardlayout verwenden","layout.publicAllUsers":"\xD6ffentlich (f\xFCr alle sichtbar)","layout.toast.loadFallback":"Layouts konnten nicht vom Backend geladen werden, Wechsel zu lokalem Speicher","layout.toast.saveSuccess":"Layout erfolgreich gespeichert","layout.toast.saveLocalSuccess":"Layout im lokalen Speicher gespeichert","layout.toast.backendUnavailableSavedLocal":"Backend nicht verf\xFCgbar, lokal gespeichert","layout.toast.deleteSuccess":"Layout erfolgreich gel\xF6scht","layout.toast.deleteLocalSuccess":"Layout aus lokalem Speicher gel\xF6scht","layout.toast.backendUnavailableDeletedLocal":"Backend nicht verf\xFCgbar, lokal gel\xF6scht","layout.toast.defaultSuccess":"Standardlayout gesetzt","layout.toast.defaultLocalSuccess":"Standardlayout lokal gesetzt","layout.toast.backendUnavailableDefaultLocal":"Backend nicht verf\xFCgbar, Standard lokal gespeichert","dateRange.label":"Datumsbereich","dateRange.startDate":"Startdatum","dateRange.endDate":"Enddatum","dateRange.select":"Ausw\xE4hlen...","dateRange.today":"Heute","dateRange.thisWeek":"Diese Woche","dateRange.thisMonth":"Diesen Monat","graph.records":"{count} Datens\xE4tze","graph.kpi.totalRecords":"Gesamt Datens\xE4tze","graph.kpi.totalReport":"Gesamt Report","graph.kpi.totalBillable":"Gesamt abrechenbar","graph.kpi.efficiency":"Effizienz","graph.kpi.amount":"Betrag","graph.kpi.flagged":"Markiert","graph.chart.billable.title":"Abrechenbar nach Dimension","graph.chart.billable.subtitle":"Top-Werte nach abrechenbaren Stunden","graph.chart.efficiency.title":"Effizienz pro Person","graph.chart.efficiency.subtitle":"Niedrigste Effizienz zuerst","graph.chart.status.title":"Statusverteilung","graph.chart.status.subtitle":"Anteil je Status","graph.dataBody":"Datentabelle","graph.reportTitle":"Grafikbericht","graph.unassigned":"Nicht zugewiesen","graph.column.reportHours":"Melde-Stunden","graph.column.billableHours":"Abrechenbare Stunden","detail.searchAi.placeholder":"Felder suchen, oder bei keinem Treffer die KI fragen...","detail.searchAi.matches":"{count} Treffer gefunden","detail.searchAi.noMatch":"Kein passendes Feld gefunden.","detail.searchAi.autoAiFallback":"Keine direkte \xDCbereinstimmung. KI-Analyse wird gestartet...","detail.searchAi.aiResultTitle":"KI-Ergebnis","detail.table.title":"Verkn\xFCpfte Eintr\xE4ge","kanban.empty":"Karten hier ablegen","kanban.bucket.limit":"Limit","kanban.bucket.dropHere":"Loslassen, um in diese Spalte zu verschieben","kanban.card.progress":"Fortschritt","kanban.card.openDetail":"Detail \xF6ffnen","kanban.priority.critical":"Kritisch","kanban.priority.high":"Hoch","kanban.priority.medium":"Mittel","kanban.priority.low":"Niedrig","quickCreate.newItem":"Neuer Eintrag","quickCreate.createWithTitle":"{title} erstellen","quickEdit.editWithTitle":"{title} bearbeiten","quickDelete.confirmTitle":"L\xF6schen best\xE4tigen","quickDelete.confirmMessageSingle":"M\xF6chten Sie den ausgew\xE4hlten Datensatz wirklich l\xF6schen?","quickDelete.confirmMessageMultiple":"M\xF6chten Sie die {count} ausgew\xE4hlten Datens\xE4tze wirklich l\xF6schen?","messageBox.confirm":"OK","messageBox.cancel":"Abbrechen"},Hf={"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","table.headerMenu.sortAsc":"\u6607\u9806\u3067\u4E26\u3079\u66FF\u3048","table.headerMenu.sortDesc":"\u964D\u9806\u3067\u4E26\u3079\u66FF\u3048","table.headerMenu.clearSort":"\u4E26\u3079\u66FF\u3048\u3092\u89E3\u9664","table.headerMenu.configureSort":"\u4E26\u3079\u66FF\u3048\u3092\u8A2D\u5B9A...","table.headerMenu.group":"\u3053\u306E\u5217\u3067\u30B0\u30EB\u30FC\u30D7\u5316","table.headerMenu.ungroup":"\u30B0\u30EB\u30FC\u30D7\u304B\u3089\u5916\u3059","table.headerMenu.addSummary":"\u96C6\u8A08\u306B\u8FFD\u52A0","table.headerMenu.removeSummary":"\u96C6\u8A08\u304B\u3089\u524A\u9664","table.headerMenu.hideColumn":"\u5217\u3092\u975E\u8868\u793A","table.sortDialog.title":"\u4E26\u3079\u66FF\u3048\u8A2D\u5B9A","table.sortDialog.empty":"\u4E26\u3079\u66FF\u3048\u30EB\u30FC\u30EB\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","table.sortDialog.addRule":"\u30EB\u30FC\u30EB\u3092\u8FFD\u52A0","table.sortDialog.clearAll":"\u3059\u3079\u3066\u30AF\u30EA\u30A2","table.sortDialog.asc":"\u6607\u9806","table.sortDialog.desc":"\u964D\u9806","pivot.title.default":"\u30D4\u30DC\u30C3\u30C8\u30C6\u30FC\u30D6\u30EB","pivot.subtitle.default":"\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u30D4\u30DC\u30C3\u30C8\u30C6\u30FC\u30D6\u30EB\u3092\u8A2D\u5B9A\u3057\u307E\u3059\u3002","pivot.empty":"\u7D50\u679C\u3092\u8868\u793A\u3059\u308B\u306B\u306F\u3001\u5024\u30A8\u30EA\u30A2\u306B\u5C11\u306A\u304F\u3068\u30821\u3064\u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","pivot.records":"\u30EC\u30B3\u30FC\u30C9","pivot.afterFilter":"\u30D5\u30A3\u30EB\u30BF\u30FC\u5F8C","pivot.grandTotal":"\u7DCF\u8A08","pivot.resultLabel":"\u7D50\u679C","pivot.valueLabel":"\u5024","pivot.table.dimensions":"\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3","pivot.config.title":"\u8A2D\u5B9A","pivot.fieldList":"\u30D5\u30A3\u30FC\u30EB\u30C9\u4E00\u89A7","pivot.availableDimensions":"\u5229\u7528\u53EF\u80FD\u306A\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3","pivot.allFieldsInUse":"\u3059\u3079\u3066\u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u304C\u4F7F\u7528\u4E2D\u3067\u3059\u3002","pivot.zone.rows":"\u884C","pivot.zone.columns":"\u5217","pivot.zone.filters":"\u30D5\u30A3\u30EB\u30BF\u30FC","pivot.zone.values":"\u5024","pivot.hint.rows":"\u3053\u3053\u306B\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u884C\u968E\u5C64\u3092\u4F5C\u6210","pivot.hint.columns":"\u3053\u3053\u306B\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u5217\u968E\u5C64\u3092\u4F5C\u6210","pivot.hint.filters":"\u3053\u3053\u306B\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u30EC\u30DD\u30FC\u30C8\u30D5\u30A3\u30EB\u30BF\u30FC\u3092\u8A2D\u5B9A","pivot.hint.values":"\u3053\u3053\u306B\u6570\u5024\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u96C6\u8A08","pivot.clearArea":"\u30A8\u30EA\u30A2\u3092\u30AF\u30EA\u30A2","pivot.filter.na":"N/A","pivot.filter.noValues":"\u5024\u304C\u3042\u308A\u307E\u305B\u3093","pivot.filter.noneSelected":"\u672A\u9078\u629E","pivot.filter.allValues":"\u3059\u3079\u3066\u306E\u5024","pivot.filter.selectedCount":"{selected} / {total} \u3092\u9078\u629E","pivot.filter.selectAll":"\u3059\u3079\u3066\u9078\u629E","pivot.filter.deselectAll":"\u3059\u3079\u3066\u89E3\u9664","pivot.filter.noResults":"\u7D50\u679C\u304C\u3042\u308A\u307E\u305B\u3093","pivot.collapse.ariaExpand":"\u8A2D\u5B9A\u30A8\u30EA\u30A2\u3092\u5C55\u958B","pivot.collapse.ariaCollapse":"\u8A2D\u5B9A\u30A8\u30EA\u30A2\u3092\u6298\u308A\u305F\u305F\u3080","pivot.agg.sum":"\u5408\u8A08","pivot.agg.count":"\u4EF6\u6570","pivot.agg.avg":"\u5E73\u5747","pivot.agg.min":"\u6700\u5C0F","pivot.agg.max":"\u6700\u5927","pivot.preset.selectPlaceholder":"\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u9078\u629E","pivot.preset.save":"\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u4FDD\u5B58","pivot.preset.delete":"\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u524A\u9664","pivot.preset.saveDialogTitle":"\u73FE\u5728\u306E\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u4FDD\u5B58","pivot.preset.nameLabel":"\u30D7\u30EA\u30BB\u30C3\u30C8\u540D","pivot.preset.defaultName":"\u30D7\u30EA\u30BB\u30C3\u30C8 {index}","pivot.table.sectionTitle":"\u30D4\u30DC\u30C3\u30C8\u7D50\u679C","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"\u30D4\u30DC\u30C3\u30C8\u7D50\u679C\u3092\u5C55\u958B","pivot.table.collapse.ariaCollapse":"\u30D4\u30DC\u30C3\u30C8\u7D50\u679C\u3092\u6298\u308A\u305F\u305F\u3080","pivot.chart.title":"\u30D4\u30DC\u30C3\u30C8\u30C1\u30E3\u30FC\u30C8","pivot.chart.subtitle":"1\u3064\u306E\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3\u3068\u6700\u59272\u3064\u306E\u6307\u6A19\u3092\u30B3\u30F3\u30D1\u30AF\u30C8\u306A\u30C1\u30E3\u30FC\u30C8\u306B\u307E\u3068\u3081\u307E\u3059\u3002","pivot.chart.subtitleReady":"{dimension} \u3054\u3068\u306E {measure}","pivot.chart.emptyNoDimension":"\u30C1\u30E3\u30FC\u30C8\u3092\u8868\u793A\u3059\u308B\u306B\u306F\u3001\u5C11\u306A\u304F\u3068\u30821\u3064\u306E\u884C\u307E\u305F\u306F\u5217\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","pivot.chart.emptyNoValue":"\u30C1\u30E3\u30FC\u30C8\u3092\u8868\u793A\u3059\u308B\u306B\u306F\u3001\u5C11\u306A\u304F\u3068\u30821\u3064\u306E\u5024\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","pivot.chart.emptyNoData":"\u73FE\u5728\u306E\u30C1\u30E3\u30FC\u30C8\u9078\u629E\u3067\u306F\u8868\u793A\u3067\u304D\u308B\u30C7\u30FC\u30BF\u304C\u3042\u308A\u307E\u305B\u3093\u3002","pivot.chart.dimension":"\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3","pivot.chart.primaryMeasure":"\u6307\u6A19","pivot.chart.secondaryMeasure":"\u6BD4\u8F03\u6307\u6A19","pivot.chart.chartType":"\u30C1\u30E3\u30FC\u30C8\u7A2E\u5225","pivot.chart.style.barVertical":"\u7E26\u68D2\u30B0\u30E9\u30D5","pivot.chart.style.barHorizontal":"\u6A2A\u68D2\u30B0\u30E9\u30D5","pivot.chart.style.line":"\u6298\u308C\u7DDA\u30B0\u30E9\u30D5","pivot.chart.style.scatter":"\u6563\u5E03\u56F3","pivot.chart.collapse.ariaExpand":"\u30C1\u30E3\u30FC\u30C8\u9818\u57DF\u3092\u5C55\u958B","pivot.chart.collapse.ariaCollapse":"\u30C1\u30E3\u30FC\u30C8\u9818\u57DF\u3092\u6298\u308A\u305F\u305F\u3080","smartFilter.adaptFilters":"\u30D5\u30A3\u30EB\u30BF\u30FC\u8ABF\u6574","smartFilter.addFilters":"\u30D5\u30A3\u30EB\u30BF\u30FC\u8FFD\u52A0","smartFilter.go":"\u5B9F\u884C","smartFilter.visibleFilters":"\u8868\u793A\u30D5\u30A3\u30EB\u30BF\u30FC","smartFilter.searchPlaceholder":"\u691C\u7D22...","smartFilter.noOptionsFound":"\u30AA\u30D7\u30B7\u30E7\u30F3\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093","smartFilter.min":"\u6700\u5C0F","smartFilter.max":"\u6700\u5927","smartFilter.minMaxPlaceholder":"\u6700\u5C0F - \u6700\u5927","smartFilter.operator.equals":"\u7B49\u3057\u3044","smartFilter.operator.contains":"\u542B\u3080","smartFilter.operator.notContains":"\u542B\u307E\u306A\u3044","smartFilter.operator.wildcard":"\u30EF\u30A4\u30EB\u30C9\u30AB\u30FC\u30C9\u691C\u7D22","smartFilter.operator.notEquals":"\u7B49\u3057\u304F\u306A\u3044","smartFilter.operator.greaterThan":"\u3088\u308A\u5927\u304D\u3044","smartFilter.operator.lessThan":"\u3088\u308A\u5C0F\u3055\u3044","smartFilter.operator.greaterOrEqual":"\u4EE5\u4E0A","smartFilter.operator.lessOrEqual":"\u4EE5\u4E0B","smartFilter.operator.between":"\u7BC4\u56F2","variant.noOptions":"\u30AA\u30D7\u30B7\u30E7\u30F3\u306A\u3057","variant.defaultSuffix":"\u30C7\u30D5\u30A9\u30EB\u30C8","variant.selectVariant":"\u30D3\u30E5\u30FC\u3092\u9078\u629E","variant.saveView":"\u30D3\u30E5\u30FC\u4FDD\u5B58","variant.newVariant":"\u65B0\u3057\u3044\u30D3\u30E5\u30FC","variant.viewName":"\u30D3\u30E5\u30FC\u540D","variant.setDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u306B\u8A2D\u5B9A","variant.publicAllUsers":"\u516C\u958B\uFF08\u5168\u30E6\u30FC\u30B6\u30FC\uFF09","variant.toast.fetchFailed":"\u30D3\u30E5\u30FC\u306E\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.saveFailed":"\u30D3\u30E5\u30FC\u306E\u4FDD\u5B58\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.saveSuccess":"\u30D3\u30E5\u30FC\u3092\u4FDD\u5B58\u3057\u307E\u3057\u305F","variant.toast.deleteFailed":"\u30D3\u30E5\u30FC\u306E\u524A\u9664\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.deleteSuccess":"\u30D3\u30E5\u30FC\u3092\u524A\u9664\u3057\u307E\u3057\u305F","variant.toast.defaultFailed":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30D3\u30E5\u30FC\u306E\u66F4\u65B0\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.defaultSuccess":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30D3\u30E5\u30FC\u3092\u66F4\u65B0\u3057\u307E\u3057\u305F","layout.saveLayout":"\u30EC\u30A4\u30A2\u30A6\u30C8\u4FDD\u5B58","layout.layoutOptions":"\u30EC\u30A4\u30A2\u30A6\u30C8\u30AA\u30D7\u30B7\u30E7\u30F3","layout.selectLayout":"\u30EC\u30A4\u30A2\u30A6\u30C8\u9078\u629E","layout.saveCurrentLayout":"\u73FE\u5728\u306E\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u4FDD\u5B58...","layout.noSavedLayouts":"\u4FDD\u5B58\u6E08\u307F\u30EC\u30A4\u30A2\u30A6\u30C8\u306A\u3057","layout.removeDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u89E3\u9664","layout.setAsDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u306B\u8A2D\u5B9A","layout.layoutName":"\u30EC\u30A4\u30A2\u30A6\u30C8\u540D","layout.layoutDescription":"\u8AAC\u660E","layout.layoutNameHelper":"\u4F8B\uFF1A\u30B3\u30F3\u30D1\u30AF\u30C8\u8868\u793A","layout.warningOverwrite":"\u8B66\u544A\uFF1A\u65E2\u5B58\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u4E0A\u66F8\u304D\u3057\u307E\u3059","layout.useAsDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30EC\u30A4\u30A2\u30A6\u30C8\u3068\u3057\u3066\u4F7F\u7528","layout.publicAllUsers":"\u516C\u958B\uFF08\u5168\u30E6\u30FC\u30B6\u30FC\u306B\u8868\u793A\uFF09","layout.toast.loadFallback":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u304B\u3089\u306E\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u3001\u30ED\u30FC\u30AB\u30EB\u4FDD\u5B58\u306B\u5207\u308A\u66FF\u3048\u307E\u3057\u305F","layout.toast.saveSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u4FDD\u5B58\u3057\u307E\u3057\u305F","layout.toast.saveLocalSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u4FDD\u5B58\u3057\u307E\u3057\u305F","layout.toast.backendUnavailableSavedLocal":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u672A\u63A5\u7D9A\u306E\u305F\u3081\u30ED\u30FC\u30AB\u30EB\u306B\u4FDD\u5B58\u3057\u307E\u3057\u305F","layout.toast.deleteSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u524A\u9664\u3057\u307E\u3057\u305F","layout.toast.deleteLocalSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u304B\u3089\u524A\u9664\u3057\u307E\u3057\u305F","layout.toast.backendUnavailableDeletedLocal":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u672A\u63A5\u7D9A\u306E\u305F\u3081\u30ED\u30FC\u30AB\u30EB\u304B\u3089\u524A\u9664\u3057\u307E\u3057\u305F","layout.toast.defaultSuccess":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u8A2D\u5B9A\u3057\u307E\u3057\u305F","layout.toast.defaultLocalSuccess":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u306B\u8A2D\u5B9A\u3057\u307E\u3057\u305F","layout.toast.backendUnavailableDefaultLocal":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u672A\u63A5\u7D9A\u306E\u305F\u3081\u30C7\u30D5\u30A9\u30EB\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u4FDD\u5B58\u3057\u307E\u3057\u305F","dateRange.label":"\u65E5\u4ED8\u7BC4\u56F2","dateRange.startDate":"\u958B\u59CB\u65E5","dateRange.endDate":"\u7D42\u4E86\u65E5","dateRange.select":"\u9078\u629E...","dateRange.today":"\u4ECA\u65E5","dateRange.thisWeek":"\u4ECA\u9031","dateRange.thisMonth":"\u4ECA\u6708","graph.records":"{count} \u4EF6","graph.kpi.totalRecords":"\u7DCF\u30EC\u30B3\u30FC\u30C9","graph.kpi.totalReport":"\u7DCF\u5831\u544A\u6642\u9593","graph.kpi.totalBillable":"\u7DCF\u8ACB\u6C42\u53EF\u80FD\u6642\u9593","graph.kpi.efficiency":"\u52B9\u7387","graph.kpi.amount":"\u91D1\u984D","graph.kpi.flagged":"\u8981\u78BA\u8A8D","graph.chart.billable.title":"\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3\u5225\u8ACB\u6C42\u53EF\u80FD\u6642\u9593","graph.chart.billable.subtitle":"\u8ACB\u6C42\u53EF\u80FD\u6642\u9593\u306E\u4E0A\u4F4D","graph.chart.efficiency.title":"\u62C5\u5F53\u8005\u5225\u52B9\u7387","graph.chart.efficiency.subtitle":"\u52B9\u7387\u306E\u4F4E\u3044\u9806","graph.chart.status.title":"\u30B9\u30C6\u30FC\u30BF\u30B9\u5206\u5E03","graph.chart.status.subtitle":"\u30B9\u30C6\u30FC\u30BF\u30B9\u5225\u6BD4\u7387","graph.dataBody":"\u30C7\u30FC\u30BF\u672C\u4F53","graph.reportTitle":"\u30B0\u30E9\u30D5\u30A3\u30C3\u30AF\u30EC\u30DD\u30FC\u30C8","graph.unassigned":"\u672A\u5272\u308A\u5F53\u3066","graph.column.reportHours":"\u5831\u544A\u6642\u9593","graph.column.billableHours":"\u8ACB\u6C42\u53EF\u80FD\u6642\u9593","detail.searchAi.placeholder":"\u9805\u76EE\u3092\u691C\u7D22\u3002\u898B\u3064\u304B\u3089\u306A\u3044\u5834\u5408\u306FAI\u306B\u8CEA\u554F\u3057\u307E\u3059...","detail.searchAi.matches":"{count} \u4EF6\u306E\u4E00\u81F4","detail.searchAi.noMatch":"\u4E00\u81F4\u3059\u308B\u9805\u76EE\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002","detail.searchAi.autoAiFallback":"\u4E00\u81F4\u306A\u3057\u3002AI\u5206\u6790\u3092\u5B9F\u884C\u3057\u307E\u3059...","detail.searchAi.aiResultTitle":"AI\u5206\u6790\u7D50\u679C","detail.table.title":"\u95A2\u9023\u30EC\u30B3\u30FC\u30C9","kanban.empty":"\u3053\u3053\u306B\u30AB\u30FC\u30C9\u3092\u30C9\u30ED\u30C3\u30D7","kanban.bucket.limit":"\u4E0A\u9650","kanban.bucket.dropHere":"\u96E2\u3059\u3068\u3053\u306E bucket \u306B\u79FB\u52D5\u3057\u307E\u3059","kanban.card.progress":"\u9032\u6357","kanban.card.openDetail":"\u8A73\u7D30\u3092\u958B\u304F","kanban.priority.critical":"\u7DCA\u6025","kanban.priority.high":"\u9AD8","kanban.priority.medium":"\u4E2D","kanban.priority.low":"\u4F4E","quickCreate.newItem":"\u65B0\u898F\u4F5C\u6210","quickCreate.createWithTitle":"{title} \u3092\u4F5C\u6210","quickEdit.editWithTitle":"{title} \u3092\u7DE8\u96C6","quickDelete.confirmTitle":"\u524A\u9664\u306E\u78BA\u8A8D","quickDelete.confirmMessageSingle":"\u9078\u629E\u3057\u305F\u30EC\u30B3\u30FC\u30C9\u3092\u524A\u9664\u3057\u3066\u3082\u3088\u308D\u3057\u3044\u3067\u3059\u304B\uFF1F","quickDelete.confirmMessageMultiple":"\u9078\u629E\u3057\u305F {count} \u4EF6\u306E\u30EC\u30B3\u30FC\u30C9\u3092\u524A\u9664\u3057\u3066\u3082\u3088\u308D\u3057\u3044\u3067\u3059\u304B\uFF1F","messageBox.confirm":"OK","messageBox.cancel":"\u30AD\u30E3\u30F3\u30BB\u30EB"},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","table.headerMenu.sortAsc":"\uC624\uB984\uCC28\uC21C \uC815\uB82C","table.headerMenu.sortDesc":"\uB0B4\uB9BC\uCC28\uC21C \uC815\uB82C","table.headerMenu.clearSort":"\uC815\uB82C \uD574\uC81C","table.headerMenu.configureSort":"\uC815\uB82C \uC124\uC815...","table.headerMenu.group":"\uC774 \uC5F4\uB85C \uADF8\uB8F9\uD654","table.headerMenu.ungroup":"\uADF8\uB8F9\uC5D0\uC11C \uC81C\uAC70","table.headerMenu.addSummary":"\uC694\uC57D\uC5D0 \uCD94\uAC00","table.headerMenu.removeSummary":"\uC694\uC57D\uC5D0\uC11C \uC81C\uAC70","table.headerMenu.hideColumn":"\uC5F4 \uC228\uAE30\uAE30","table.sortDialog.title":"\uC815\uB82C \uC124\uC815","table.sortDialog.empty":"\uC815\uB82C \uADDC\uCE59\uC774 \uC5C6\uC2B5\uB2C8\uB2E4. \uCD94\uAC00\uD558\uC138\uC694.","table.sortDialog.addRule":"\uADDC\uCE59 \uCD94\uAC00","table.sortDialog.clearAll":"\uBAA8\uB450 \uC9C0\uC6B0\uAE30","table.sortDialog.asc":"\uC624\uB984\uCC28\uC21C","table.sortDialog.desc":"\uB0B4\uB9BC\uCC28\uC21C","pivot.title.default":"\uD53C\uBC97 \uD14C\uC774\uBE14","pivot.subtitle.default":"\uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uD53C\uBC97 \uD14C\uC774\uBE14\uC744 \uAD6C\uC131\uD558\uC138\uC694.","pivot.empty":"\uACB0\uACFC\uB97C \uBCF4\uB824\uBA74 \uAC12 \uC601\uC5ED\uC5D0 \uCD5C\uC18C \uD55C \uAC1C\uC758 \uD544\uB4DC\uB97C \uCD94\uAC00\uD558\uC138\uC694.","pivot.records":"\uB808\uCF54\uB4DC","pivot.afterFilter":"\uD544\uD130 \uD6C4","pivot.grandTotal":"\uCD1D\uD569","pivot.resultLabel":"\uACB0\uACFC","pivot.valueLabel":"\uAC12","pivot.table.dimensions":"\uCC28\uC6D0","pivot.config.title":"\uAD6C\uC131","pivot.fieldList":"\uD544\uB4DC \uBAA9\uB85D","pivot.availableDimensions":"\uC0AC\uC6A9 \uAC00\uB2A5\uD55C \uCC28\uC6D0","pivot.allFieldsInUse":"\uBAA8\uB4E0 \uD544\uB4DC\uAC00 \uC774\uBBF8 \uC0AC\uC6A9 \uC911\uC785\uB2C8\uB2E4.","pivot.zone.rows":"\uD589","pivot.zone.columns":"\uC5F4","pivot.zone.filters":"\uD544\uD130","pivot.zone.values":"\uAC12","pivot.hint.rows":"\uC5EC\uAE30\uC5D0 \uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uD589 \uACC4\uCE35\uC744 \uAD6C\uC131","pivot.hint.columns":"\uC5EC\uAE30\uC5D0 \uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uC5F4 \uACC4\uCE35\uC744 \uAD6C\uC131","pivot.hint.filters":"\uC5EC\uAE30\uC5D0 \uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uBCF4\uACE0\uC11C \uD544\uD130\uB85C \uC0AC\uC6A9","pivot.hint.values":"\uC22B\uC790 \uD544\uB4DC\uB97C \uC5EC\uAE30\uC5D0 \uB4DC\uB798\uADF8\uD558\uC5EC \uC9D1\uACC4","pivot.clearArea":"\uC601\uC5ED \uBE44\uC6B0\uAE30","pivot.filter.na":"\uD574\uB2F9 \uC5C6\uC74C","pivot.filter.noValues":"\uAC12 \uC5C6\uC74C","pivot.filter.noneSelected":"\uC120\uD0DD \uC5C6\uC74C","pivot.filter.allValues":"\uBAA8\uB4E0 \uAC12","pivot.filter.selectedCount":"{selected} / {total} \uC120\uD0DD\uB428","pivot.filter.selectAll":"\uC804\uCCB4 \uC120\uD0DD","pivot.filter.deselectAll":"\uC804\uCCB4 \uD574\uC81C","pivot.filter.noResults":"\uAC80\uC0C9 \uACB0\uACFC \uC5C6\uC74C","pivot.collapse.ariaExpand":"\uAD6C\uC131 \uC601\uC5ED \uD3BC\uCE58\uAE30","pivot.collapse.ariaCollapse":"\uAD6C\uC131 \uC601\uC5ED \uC811\uAE30","pivot.agg.sum":"\uD569\uACC4","pivot.agg.count":"\uAC1C\uC218","pivot.agg.avg":"\uD3C9\uADE0","pivot.agg.min":"\uCD5C\uC18C","pivot.agg.max":"\uCD5C\uB300","pivot.preset.selectPlaceholder":"\uD504\uB9AC\uC14B \uC120\uD0DD","pivot.preset.save":"\uD504\uB9AC\uC14B \uC800\uC7A5","pivot.preset.delete":"\uD504\uB9AC\uC14B \uC0AD\uC81C","pivot.preset.saveDialogTitle":"\uD604\uC7AC \uD504\uB9AC\uC14B \uC800\uC7A5","pivot.preset.nameLabel":"\uD504\uB9AC\uC14B \uC774\uB984","pivot.preset.defaultName":"\uD504\uB9AC\uC14B {index}","pivot.table.sectionTitle":"\uD53C\uBC97 \uACB0\uACFC","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"\uD53C\uBC97 \uACB0\uACFC \uD3BC\uCE58\uAE30","pivot.table.collapse.ariaCollapse":"\uD53C\uBC97 \uACB0\uACFC \uC811\uAE30","pivot.chart.title":"\uD53C\uBC97 \uCC28\uD2B8","pivot.chart.subtitle":"\uD558\uB098\uC758 \uCC28\uC6D0\uACFC \uCD5C\uB300 \uB450 \uAC1C\uC758 \uCE21\uC815\uAC12\uC744 \uAC04\uACB0\uD55C \uCC28\uD2B8\uB85C \uD45C\uC2DC\uD569\uB2C8\uB2E4.","pivot.chart.subtitleReady":"{dimension}\uBCC4 {measure}","pivot.chart.emptyNoDimension":"\uCC28\uD2B8\uB97C \uBCF4\uB824\uBA74 \uCD5C\uC18C \uD55C \uAC1C\uC758 \uD589 \uB610\uB294 \uC5F4 \uD544\uB4DC\uB97C \uCD94\uAC00\uD558\uC138\uC694.","pivot.chart.emptyNoValue":"\uCC28\uD2B8\uB97C \uBCF4\uB824\uBA74 \uCD5C\uC18C \uD55C \uAC1C\uC758 \uAC12 \uD544\uB4DC\uB97C \uCD94\uAC00\uD558\uC138\uC694.","pivot.chart.emptyNoData":"\uD604\uC7AC \uCC28\uD2B8 \uC120\uD0DD\uC5D0 \uD45C\uC2DC\uD560 \uB370\uC774\uD130\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.","pivot.chart.dimension":"\uCC28\uD2B8 \uCC28\uC6D0","pivot.chart.primaryMeasure":"\uC8FC \uCE21\uC815\uAC12","pivot.chart.secondaryMeasure":"\uBE44\uAD50 \uCE21\uC815\uAC12","pivot.chart.chartType":"\uCC28\uD2B8 \uC720\uD615","pivot.chart.style.barVertical":"\uC138\uB85C \uB9C9\uB300","pivot.chart.style.barHorizontal":"\uAC00\uB85C \uB9C9\uB300","pivot.chart.style.line":"\uC120\uD615 \uCC28\uD2B8","pivot.chart.style.scatter":"\uC0B0\uC810\uB3C4","pivot.chart.collapse.ariaExpand":"\uCC28\uD2B8 \uC601\uC5ED \uD3BC\uCE58\uAE30","pivot.chart.collapse.ariaCollapse":"\uCC28\uD2B8 \uC601\uC5ED \uC811\uAE30","smartFilter.adaptFilters":"\uD544\uD130 \uC870\uC815","smartFilter.addFilters":"\uD544\uD130 \uCD94\uAC00","smartFilter.go":"\uC2E4\uD589","smartFilter.visibleFilters":"\uD45C\uC2DC \uD544\uD130","smartFilter.searchPlaceholder":"\uAC80\uC0C9...","smartFilter.noOptionsFound":"\uC635\uC158\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4","smartFilter.min":"\uCD5C\uC18C","smartFilter.max":"\uCD5C\uB300","smartFilter.minMaxPlaceholder":"\uCD5C\uC18C - \uCD5C\uB300","smartFilter.operator.equals":"\uAC19\uC74C","smartFilter.operator.contains":"\uD3EC\uD568","smartFilter.operator.notContains":"\uBBF8\uD3EC\uD568","smartFilter.operator.wildcard":"\uC640\uC77C\uB4DC\uCE74\uB4DC \uAC80\uC0C9","smartFilter.operator.notEquals":"\uAC19\uC9C0 \uC54A\uC74C","smartFilter.operator.greaterThan":"\uBCF4\uB2E4 \uD07C","smartFilter.operator.lessThan":"\uBCF4\uB2E4 \uC791\uC74C","smartFilter.operator.greaterOrEqual":"\uC774\uC0C1","smartFilter.operator.lessOrEqual":"\uC774\uD558","smartFilter.operator.between":"\uBC94\uC704","variant.noOptions":"\uC635\uC158 \uC5C6\uC74C","variant.defaultSuffix":"\uAE30\uBCF8","variant.selectVariant":"\uBDF0 \uC120\uD0DD","variant.saveView":"\uBDF0 \uC800\uC7A5","variant.newVariant":"\uC0C8 \uBDF0","variant.viewName":"\uBDF0 \uC774\uB984","variant.setDefault":"\uAE30\uBCF8\uC73C\uB85C \uC124\uC815","variant.publicAllUsers":"\uACF5\uAC1C(\uC804\uCCB4 \uC0AC\uC6A9\uC790)","variant.toast.fetchFailed":"\uBDF0\uB97C \uBD88\uB7EC\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.saveFailed":"\uBDF0\uB97C \uC800\uC7A5\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.saveSuccess":"\uBDF0\uAC00 \uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4","variant.toast.deleteFailed":"\uBDF0\uB97C \uC0AD\uC81C\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.deleteSuccess":"\uBDF0\uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4","variant.toast.defaultFailed":"\uAE30\uBCF8 \uBDF0\uB97C \uC5C5\uB370\uC774\uD2B8\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.defaultSuccess":"\uAE30\uBCF8 \uBDF0\uAC00 \uC5C5\uB370\uC774\uD2B8\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.saveLayout":"\uB808\uC774\uC544\uC6C3 \uC800\uC7A5","layout.layoutOptions":"\uB808\uC774\uC544\uC6C3 \uC635\uC158","layout.selectLayout":"\uB808\uC774\uC544\uC6C3 \uC120\uD0DD","layout.saveCurrentLayout":"\uD604\uC7AC \uB808\uC774\uC544\uC6C3 \uC800\uC7A5...","layout.noSavedLayouts":"\uC800\uC7A5\uB41C \uB808\uC774\uC544\uC6C3 \uC5C6\uC74C","layout.removeDefault":"\uAE30\uBCF8 \uD574\uC81C","layout.setAsDefault":"\uAE30\uBCF8\uC73C\uB85C \uC124\uC815","layout.layoutName":"\uB808\uC774\uC544\uC6C3 \uC774\uB984","layout.layoutDescription":"\uC124\uBA85","layout.layoutNameHelper":"\uC608: \uCEF4\uD329\uD2B8 \uBDF0","layout.warningOverwrite":"\uACBD\uACE0: \uAE30\uC874 \uB808\uC774\uC544\uC6C3\uC774 \uB36E\uC5B4\uC4F0\uAE30 \uB429\uB2C8\uB2E4","layout.useAsDefault":"\uAE30\uBCF8 \uB808\uC774\uC544\uC6C3\uC73C\uB85C \uC0AC\uC6A9","layout.publicAllUsers":"\uACF5\uAC1C(\uBAA8\uB4E0 \uC0AC\uC6A9\uC790\uC5D0\uAC8C \uD45C\uC2DC)","layout.toast.loadFallback":"\uBC31\uC5D4\uB4DC\uC5D0\uC11C \uB808\uC774\uC544\uC6C3\uC744 \uBD88\uB7EC\uC624\uC9C0 \uBABB\uD574 \uB85C\uCEEC \uC800\uC7A5\uC18C\uB85C \uC804\uD658\uD588\uC2B5\uB2C8\uB2E4","layout.toast.saveSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.saveLocalSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uB85C\uCEEC \uC800\uC7A5\uC18C\uC5D0 \uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.backendUnavailableSavedLocal":"\uBC31\uC5D4\uB4DC\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC5B4 \uB85C\uCEEC\uC5D0 \uC800\uC7A5\uD588\uC2B5\uB2C8\uB2E4","layout.toast.deleteSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.deleteLocalSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uB85C\uCEEC \uC800\uC7A5\uC18C\uC5D0\uC11C \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.backendUnavailableDeletedLocal":"\uBC31\uC5D4\uB4DC\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC5B4 \uB85C\uCEEC\uC5D0\uC11C \uC0AD\uC81C\uD588\uC2B5\uB2C8\uB2E4","layout.toast.defaultSuccess":"\uAE30\uBCF8 \uB808\uC774\uC544\uC6C3\uC774 \uC124\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.defaultLocalSuccess":"\uAE30\uBCF8 \uB808\uC774\uC544\uC6C3\uC774 \uB85C\uCEEC\uC5D0 \uC124\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.backendUnavailableDefaultLocal":"\uBC31\uC5D4\uB4DC\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC5B4 \uAE30\uBCF8\uAC12\uC744 \uB85C\uCEEC\uC5D0 \uC800\uC7A5\uD588\uC2B5\uB2C8\uB2E4","dateRange.label":"\uB0A0\uC9DC \uBC94\uC704","dateRange.startDate":"\uC2DC\uC791\uC77C","dateRange.endDate":"\uC885\uB8CC\uC77C","dateRange.select":"\uC120\uD0DD...","dateRange.today":"\uC624\uB298","dateRange.thisWeek":"\uC774\uBC88 \uC8FC","dateRange.thisMonth":"\uC774\uBC88 \uB2EC","graph.records":"{count}\uAC74","graph.kpi.totalRecords":"\uCD1D \uB808\uCF54\uB4DC","graph.kpi.totalReport":"\uCD1D \uBCF4\uACE0 \uC2DC\uAC04","graph.kpi.totalBillable":"\uCD1D \uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04","graph.kpi.efficiency":"\uD6A8\uC728","graph.kpi.amount":"\uAE08\uC561","graph.kpi.flagged":"\uD50C\uB798\uADF8","graph.chart.billable.title":"\uCC28\uC6D0\uBCC4 \uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04","graph.chart.billable.subtitle":"\uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04 \uC0C1\uC704 \uAC12","graph.chart.efficiency.title":"\uB2F4\uB2F9\uC790\uBCC4 \uD6A8\uC728","graph.chart.efficiency.subtitle":"\uB0AE\uC740 \uD6A8\uC728 \uC6B0\uC120","graph.chart.status.title":"\uC0C1\uD0DC \uBD84\uD3EC","graph.chart.status.subtitle":"\uC0C1\uD0DC\uBCC4 \uBE44\uC728","graph.dataBody":"\uB370\uC774\uD130 \uBCF8\uBB38","graph.reportTitle":"\uADF8\uB798\uD504 \uB9AC\uD3EC\uD2B8","graph.unassigned":"\uBBF8\uC9C0\uC815","graph.column.reportHours":"\uBCF4\uACE0 \uC2DC\uAC04","graph.column.billableHours":"\uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04","detail.searchAi.placeholder":"\uD544\uB4DC\uB97C \uAC80\uC0C9\uD558\uACE0, \uACB0\uACFC\uAC00 \uC5C6\uC73C\uBA74 AI\uC5D0 \uC9C8\uBB38\uD558\uC138\uC694...","detail.searchAi.matches":"{count}\uAC1C \uC77C\uCE58 \uD56D\uBAA9","detail.searchAi.noMatch":"\uC77C\uCE58\uD558\uB294 \uD544\uB4DC\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.","detail.searchAi.autoAiFallback":"\uC77C\uCE58 \uD56D\uBAA9\uC774 \uC5C6\uC5B4 AI \uBD84\uC11D\uC744 \uC2E4\uD589\uD569\uB2C8\uB2E4...","detail.searchAi.aiResultTitle":"AI \uBD84\uC11D \uACB0\uACFC","detail.table.title":"\uAD00\uB828 \uB808\uCF54\uB4DC","kanban.empty":"\uC5EC\uAE30\uC5D0 \uCE74\uB4DC\uB97C \uB193\uC73C\uC138\uC694","kanban.bucket.limit":"\uD55C\uB3C4","kanban.bucket.dropHere":"\uB193\uC73C\uBA74 \uC774 \uBC84\uD0B7\uC73C\uB85C \uC774\uB3D9\uD569\uB2C8\uB2E4","kanban.card.progress":"\uC9C4\uD589\uB960","kanban.card.openDetail":"\uC0C1\uC138 \uC5F4\uAE30","kanban.priority.critical":"\uAE34\uAE09","kanban.priority.high":"\uB192\uC74C","kanban.priority.medium":"\uBCF4\uD1B5","kanban.priority.low":"\uB0AE\uC74C","quickCreate.newItem":"\uC2E0\uADDC \uD56D\uBAA9","quickCreate.createWithTitle":"{title} \uC0DD\uC131","quickEdit.editWithTitle":"{title} \uC218\uC815","quickDelete.confirmTitle":"\uC0AD\uC81C \uD655\uC778","quickDelete.confirmMessageSingle":"\uC120\uD0DD\uD55C \uD56D\uBAA9\uC744 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?","quickDelete.confirmMessageMultiple":"\uC120\uD0DD\uD55C {count}\uAC1C \uD56D\uBAA9\uC744 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?","messageBox.confirm":"\uD655\uC778","messageBox.cancel":"\uCDE8\uC18C"},zn={en:zf,zh:Nf,fr:Vf,de:Of,ja:Hf,ko:Wf};var Nd=(e,t)=>t?e.replace(/\{(\w+)\}/g,(o,r)=>{let a=t[r];return a==null?"":String(a)}):e,Kf={locale:"en",t:(e,t)=>Nd(zn.en[e]||e,t)},Vd=Rt.createContext(Kf),Li=({locale:e="en",messages:t,children:o})=>{let r=Rt.useMemo(()=>{let a=zn[e]||zn.en,n=t?.[e]||{},i={...zn.en,...a,...n};return {locale:e,t:(c,d)=>Nd(i[c]||c,d)}},[e,t]);return jsxRuntime.jsx(Vd.Provider,{value:r,children:o})},te=()=>Rt.useContext(Vd);function Bs({items:e,onItemClick:t,className:o="",level:r=0,expandedIds:a,onToggleExpand:n,colorMode:i="light"}){let{t:c}=te(),d=i==="dark",l=navigation.usePathname(),[s,g]=Rt.useState(false),[f,m]=Rt.useState(new Set),b=a!==void 0&&n!==void 0,C=b?a:f;Rt.useEffect(()=>{g(true);},[]);let u=p=>{if(b)n(p);else {let h=new Set(f);h.has(p)?h.delete(p):h.add(p),m(h);}},v=p=>{p.children&&p.children.length>0&&u(p.id),t&&t(p);};return !e||!Array.isArray(e)?jsxRuntime.jsx("div",{className:No("tree-menu",o),children:jsxRuntime.jsx("div",{className:"text-sm text-gray-500 p-2",children:c("navigation.noItems")})}):jsxRuntime.jsx("div",{className:No("tree-menu",o),children:e.map(p=>{let h=C.has(p.id)||p.isExpanded,y=p.children&&p.children.length>0,S=p.appurl||p.href,E=s&&S?l===S:false;return jsxRuntime.jsxs("div",{className:"tree-menu-item relative",children:[E&&jsxRuntime.jsx("div",{className:No("absolute left-0 top-2 bottom-2 w-[3px] rounded-r-full z-10",d?"bg-[#90caf9]":"bg-[#1976d2]")}),jsxRuntime.jsxs(Ms,{variant:"ghost",className:No("w-full justify-start gap-2 h-auto py-2 relative overflow-hidden group",`ml-${r*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:()=>v(p),children:[y&&jsxRuntime.jsx("div",{className:No("flex-shrink-0 transition-transform duration-200",h&&"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"})}),!y&&jsxRuntime.jsx("div",{className:"w-4 h-4 flex-shrink-0"}),p.icon&&jsxRuntime.jsx("div",{className:No("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:p.icon}),jsxRuntime.jsxs("div",{className:"flex-1 text-left overflow-hidden z-10",children:[jsxRuntime.jsx("div",{className:No("text-sm truncate transition-colors duration-200",E?"font-semibold":"font-medium"),children:p.title||p.label}),p.description&&jsxRuntime.jsx("div",{className:No("text-xs truncate transition-colors duration-200",E?d?"text-[#90caf9]/70":"text-[#1976d2]/75":d?"text-gray-400":"text-gray-500"),title:p.description,children:p.description})]})]}),y&&jsxRuntime.jsx("div",{className:No("grid transition-[grid-template-rows] duration-300 ease-in-out",h?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:jsxRuntime.jsx("div",{className:"overflow-hidden",children:jsxRuntime.jsx(Bs,{items:p.children,onItemClick:t,level:r+1,expandedIds:a,onToggleExpand:n,colorMode:i})})})]},p.id)})})}var Ud=({collapsed:e,onToggle:t,className:o="",maxHeight:r,menuData:a=[],colorMode:n="light"})=>{let{t:i}=te(),c=n==="dark",d=navigation.useRouter(),[l,s]=Rt.useState(""),[g,f]=Rt.useState(new Set);Rt.useEffect(()=>{e&&f(new Set);},[e]);let m=Rt.useCallback(v=>{let p=[],h=y=>{y.forEach(S=>{p.push(S.id),S.children&&h(S.children);});};return h(v),p},[]),b=Rt.useMemo(()=>{if(!l.trim())return a;let v=p=>p.reduce((h,y)=>{let S=y.title?.toLowerCase().includes(l.toLowerCase())||y.description?.toLowerCase().includes(l.toLowerCase()),E=y.children?v(y.children):[];return (S||E.length>0)&&h.push({...y,children:E.length>0?E:y.children}),h},[]);return v(a)},[l,a]),C=Rt.useMemo(()=>l.trim()?new Set(m(a)):g,[l,a,g,m]),u=Rt.useCallback(async v=>{if(console.log("\u{1F5B1}\uFE0F \u5BFC\u822A\u83DC\u5355\u9879\u70B9\u51FB:",v),v.id==="chat"||v.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(h){console.error("\u274C \u65E0\u6CD5\u8DF3\u8F6C\u5230\u65B0\u804A\u5929\u89C6\u56FE:",h),d.push("/chat");}return}let p=v.appurl||v.href;p&&(p.startsWith("http://")||p.startsWith("https://")?window.open(p,"_blank"):d.push(p));},[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:r?`${r}px`:void 0},children:[jsxRuntime.jsx("div",{className:`pt-4 pb-2 transition-all duration-500 ease-in-out ${e?"px-1":"px-2"}`,children:e?jsxRuntime.jsx("div",{className:"flex justify-center",children:jsxRuntime.jsx("button",{onClick:t,className:`w-10 h-10 flex items-center justify-center rounded-lg transition-colors duration-200 ${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:v=>s(v.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:b.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(Bs,{items:b,onItemClick:u,className:"space-y-1",expandedIds:C,colorMode:n,onToggleExpand:v=>{let p=new Set(g);b.some(y=>y.id===v)?p.has(v)?p.delete(v):(b.forEach(y=>{y.id!==v&&p.has(y.id)&&p.delete(y.id);}),p.add(v)):p.has(v)?p.delete(v):p.add(v),f(p);}})}),e&&jsxRuntime.jsx("div",{className:"space-y-2",children:a.map(v=>jsxRuntime.jsx("div",{className:"space-y-1",children:jsxRuntime.jsx("button",{onClick:()=>{t();let p=new Set([v.id]);f(p);},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:v.title||""}),children:v.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:v.title?.charAt(0)||"?"})})},v.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 qd=(e={})=>{let{initialCollapsed:t=false,content:o=[]}=e,[r,a]=Rt.useState(t),[n,i]=Rt.useState(o),c=Rt.useCallback(()=>{a(l=>!l);},[]),d=Rt.useMemo(()=>({collapsed:r,onToggle:c,menuData:n}),[r,c,n]);return {collapsed:r,setCollapsed:a,toggleCollapsed:c,menuData:n,setMenuData:i,navigationIslandProps:d}};var jo=e=>jsxRuntime.jsx(material.Button,{...e,variant:e.variant||"contained",size:e.size||"medium",sx:{textTransform:"none",...e.sx}});var Fs=class{constructor(){Fd(this,"listener",null);}register(t){this.listener=t;}unregister(){this.listener=null;}show(t,o,r){this.listener&&this.listener({type:t,content:o,options:r});}hide(){this.listener&&this.listener(null);}},yr=new Fs,FI={success:(e,t)=>yr.show("success",e,t),error:(e,t)=>yr.show("error",e,t),warning:(e,t)=>yr.show("warning",e,t),info:(e,t)=>yr.show("info",e,t),show:(e,t,o)=>yr.show(e,t,o),hide:()=>yr.hide()};var mh={success:{icon:jsxRuntime.jsx(ch__default.default,{sx:{fontSize:40}}),color:"#e8f5e9",iconColor:"#66bb6a",borderColor:"#a5d6a7"},warning:{icon:jsxRuntime.jsx(dh__default.default,{sx:{fontSize:40}}),color:"#fff3e0",iconColor:"#ffa726",borderColor:"#ffcc80"},error:{icon:jsxRuntime.jsx(uh__default.default,{sx:{fontSize:40}}),color:"#ffebee",iconColor:"#ef5350",borderColor:"#ef9a9a"},info:{icon:jsxRuntime.jsx(ph__default.default,{sx:{fontSize:40}}),color:"#e3f2fd",iconColor:"#42a5f5",borderColor:"#90caf9"},default:{icon:null,color:"transparent",iconColor:"inherit",borderColor:"transparent"}},Nn=({open:e,title:t,message:o,onClose:r,onConfirm:a,confirmText:n,cancelText:i,showCancel:c=true,maxWidth:d="xs",type:l="default"})=>{let{t:s}=te(),g=n||s("messageBox.confirm"),f=i||s("messageBox.cancel"),m=()=>{a?a():r();},b=mh[l],C=l!=="default";return jsxRuntime.jsxs(xp__default.default,{open:e,onClose:r,maxWidth:d,fullWidth:true,PaperProps:{sx:{borderRadius:3,...C&&{borderTop:`6px solid ${b.iconColor}`}}},children:[C&&jsxRuntime.jsx(oi__default.default,{sx:{display:"flex",justifyContent:"center",pt:3,color:b.iconColor},children:b.icon}),t&&jsxRuntime.jsx(vp__default.default,{sx:{textAlign:C?"center":"left",pt:C?1:2},children:t}),jsxRuntime.jsx(Cp__default.default,{sx:{textAlign:C?"center":"left"},children:typeof o=="string"?jsxRuntime.jsx(ih__default.default,{children:o}):o}),jsxRuntime.jsxs(kp__default.default,{sx:{justifyContent:C?"center":"flex-end",pb:3,px:3},children:[c&&jsxRuntime.jsx(jo,{onClick:r,variant:"text",color:"inherit",children:f}),jsxRuntime.jsx(jo,{onClick:m,variant:"contained",sx:{bgcolor:C?b.iconColor:void 0,"&:hover":{bgcolor:C?b.iconColor:void 0,filter:"brightness(0.9)"}},autoFocus:true,children:g})]})]})},YI=()=>{let[e,t]=Rt__namespace.default.useState(null),[o,r]=Rt__namespace.default.useState(false);Rt__namespace.default.useEffect(()=>{let i=c=>{c?(t(c),r(true)):(r(false),t(null));};return yr.register(i),()=>yr.unregister()},[]);let a=()=>{r(false),e?.options?.onClose&&e.options.onClose(),t(null);},n=()=>{e?.options?.onConfirm&&e.options.onConfirm(),r(false),t(null);};return e?jsxRuntime.jsx(Nn,{open:o,type:e.type,message:e.content,title:e.options?.title,onClose:a,onConfirm:n,confirmText:e.options?.confirmText,cancelText:e.options?.cancelText,showCancel:e.options?.showCancel,maxWidth:e.options?.maxWidth}):null};var Rh=[{field:"value",label:"Value",minWidth:120},{field:"label",label:"Description",minWidth:180}],eu=e=>Array.isArray(e)?e:e==null||e===""?[]:[e],ir=e=>String(e),tu=(e,t)=>e[t],ou=e=>{let t=e.value??e.id??e.key??e.code;return typeof t=="number"||typeof t=="string"?t:""},Dh=e=>{let t=e.label??e.description??e.name??e.title;return String(typeof t=="number"||typeof t=="string"?t:ou(e))},Mh=e=>{let t=e.description??e.subtitle;return typeof t=="number"||typeof t=="string"?String(t):void 0},ru=({value:e=null,items:t=[],columns:o,mode:r="single",dialogTitle:a="Value Help",searchPlaceholder:n="Search values...",selectLabel:i="Select",clearLabel:c="Clear",cancelLabel:d="Cancel",valueHelpLabel:l="Open value help",noResultsText:s="No matching values",loading:g=false,clearable:f=true,selectedItems:m=[],displayValue:b,getOptionValue:C=ou,getOptionLabel:u=Dh,getOptionDescription:v=Mh,onChange:p,onSearch:h,disabled:y,InputProps:S,onKeyDown:E,...P})=>{let k=r==="multiple",[R,I]=Rt.useState(false),[w,A]=Rt.useState(""),[M,D]=Rt.useState(null),[B,j]=Rt.useState(false),[W,q]=Rt.useState(()=>eu(e)),ee=Rt.useMemo(()=>o&&o.length>0?o:Rh,[o]),le=M??t,_=Rt.useMemo(()=>{let Z=[...m,...t,...M??[]],se=new Map;return Z.forEach(Ae=>{se.set(ir(C(Ae)),Ae);}),se},[C,t,M,m]),U=Rt.useMemo(()=>eu(e),[e]);Rt.useEffect(()=>{R||q(U);},[R,U]);let ge=Rt.useMemo(()=>{let Z=w.trim().toLowerCase();if(!Z||h)return le;let se=ee.filter(Ae=>Ae.searchable!==false);return le.filter(Ae=>[C(Ae),u(Ae),v(Ae),...se.map(G=>tu(Ae,G.field))].some(G=>String(G??"").toLowerCase().includes(Z)))},[le,v,u,C,h,w,ee]),Me=Rt.useMemo(()=>{if(b!==void 0)return b;if(U.length===0)return "";let Z=se=>{let Ae=_.get(ir(se));if(!Ae)return String(se);let He=u(Ae);return He&&He!==String(se)?`${se} - ${He}`:String(se)};return k?U.length>2?`${U.length} selected`:U.map(Z).join(", "):Z(U[0])},[b,u,k,_,U]),Ee=Rt.useCallback(async()=>{if(h){j(true);try{let Z=await h(w);Array.isArray(Z)&&D(Z);}finally{j(false);}}},[h,w]),ie=()=>{y||(q(U),I(true));},Re=()=>{I(false);},Be=()=>{p?.(k?[]:null,k?[]:null),q([]);},lt=Z=>{let se=C(Z);if(k){q(Ae=>Ae.some(G=>ir(G)===ir(se))?Ae.filter(G=>ir(G)!==ir(se)):[...Ae,se]);return}q([se]);},Ze=()=>{let Z=W.map(se=>_.get(ir(se))).filter(se=>!!se);k?p?.(W,Z):p?.(W[0]??null,Z[0]??null),I(false);},Oe=Z=>{if(Z.key==="F4"){Z.preventDefault(),ie();return}E?.(Z);},qe=g||B,ot=U.length>0;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.TextField,{...P,disabled:y,value:Me,onKeyDown:Oe,InputProps:{...S,readOnly:true,endAdornment:jsxRuntime.jsxs(material.InputAdornment,{position:"end",children:[qe?jsxRuntime.jsx(material.CircularProgress,{size:18}):null,f&&ot&&!y?jsxRuntime.jsx(material.Tooltip,{title:c,children:jsxRuntime.jsx(material.IconButton,{size:"small",edge:"end","aria-label":c,onClick:Be,children:jsxRuntime.jsx(Ih__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:y,children:jsxRuntime.jsx(Jd__default.default,{fontSize:"small"})})})})]})}}),jsxRuntime.jsxs(material.Dialog,{open:R,onClose:Re,fullWidth:true,maxWidth:"md",PaperProps:{sx:Z=>({borderRadius:2,overflow:"hidden",border:`1px solid ${Z.palette.divider}`,boxShadow:Z.palette.mode==="dark"?`0 24px 80px ${styles.alpha(Z.palette.common.black,.72)}`:`0 24px 80px ${styles.alpha(Z.palette.common.black,.18)}`})},children:[jsxRuntime.jsxs(material.DialogTitle,{sx:Z=>({display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,px:2.5,py:2,pr:1.5,borderBottom:`1px solid ${Z.palette.divider}`,bgcolor:Z.palette.background.paper}),children:[jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1.05rem",fontWeight:800,lineHeight:1.25},children:a}),k?jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",sx:{mt:.25},children:`${W.length} selected`}):null]}),jsxRuntime.jsx(material.IconButton,{"aria-label":"Close",onClick:Re,size:"small",children:jsxRuntime.jsx(Ph__default.default,{fontSize:"small"})})]}),jsxRuntime.jsxs(material.DialogContent,{sx:{p:0},children:[jsxRuntime.jsxs(material.Stack,{direction:{xs:"column",sm:"row"},spacing:1,sx:Z=>({px:2.5,py:1.5,borderBottom:`1px solid ${Z.palette.divider}`,bgcolor:Z.palette.mode==="dark"?styles.alpha(Z.palette.common.white,.025):styles.alpha(Z.palette.primary.main,.035)}),children:[jsxRuntime.jsx(material.TextField,{size:"small",fullWidth:true,value:w,placeholder:n,onChange:Z=>A(Z.target.value),onKeyDown:Z=>{Z.key==="Enter"&&(Z.preventDefault(),Ee());},InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(Jd__default.default,{fontSize:"small"})}),sx:Z=>({borderRadius:1,bgcolor:Z.palette.background.paper,"& fieldset":{borderColor:styles.alpha(Z.palette.text.primary,Z.palette.mode==="dark"?.2:.16)},"&:hover fieldset":{borderColor:styles.alpha(Z.palette.primary.main,.52)},"&.Mui-focused fieldset":{borderColor:Z.palette.primary.main}})}}),h?jsxRuntime.jsx(material.Button,{variant:"outlined",onClick:()=>{Ee();},disabled:qe,sx:{minWidth:96,textTransform:"none",fontWeight:700},children:qe?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:Z=>({bgcolor:Z.palette.mode==="dark"?"#111111":Z.palette.background.paper,borderBottom:`1px solid ${Z.palette.divider}`})}),ee.map(Z=>jsxRuntime.jsx(material.TableCell,{align:Z.align,sx:se=>({minWidth:Z.minWidth,width:Z.width,fontSize:"0.78rem",fontWeight:800,bgcolor:se.palette.mode==="dark"?"#111111":se.palette.background.paper,borderBottom:`1px solid ${se.palette.divider}`}),children:Z.label},String(Z.field)))]})}),jsxRuntime.jsxs(material.TableBody,{children:[ge.map(Z=>{let se=C(Z),Ae=W.some(He=>ir(He)===ir(se));return jsxRuntime.jsxs(material.TableRow,{hover:true,selected:Ae,onClick:()=>lt(Z),onDoubleClick:()=>{k||(q([se]),p?.(se,Z),I(false));},sx:He=>({cursor:"pointer","&.Mui-selected":{bgcolor:styles.alpha(He.palette.primary.main,He.palette.mode==="dark"?.22:.12)},"&.Mui-selected:hover":{bgcolor:styles.alpha(He.palette.primary.main,He.palette.mode==="dark"?.28:.18)}}),children:[jsxRuntime.jsx(material.TableCell,{padding:"checkbox",children:jsxRuntime.jsx(material.Checkbox,{size:"small",checked:Ae})}),ee.map(He=>{let G=tu(Z,He.field);return jsxRuntime.jsx(material.TableCell,{align:He.align,sx:{fontSize:"0.82rem",py:1},children:He.render?He.render(G,Z):String(G??"")},String(He.field))})]},ir(se))}),ge.length===0?jsxRuntime.jsx(material.TableRow,{children:jsxRuntime.jsx(material.TableCell,{colSpan:ee.length+1,children:jsxRuntime.jsx(material.Box,{sx:{py:5,textAlign:"center",color:"text.secondary"},children:s})})}):null]})]})})]}),jsxRuntime.jsxs(material.DialogActions,{sx:Z=>({px:2.5,py:1.5,borderTop:`1px solid ${Z.palette.divider}`,bgcolor:Z.palette.background.paper,"& .MuiButton-root":{textTransform:"none",fontWeight:700}}),children:[f&&(ot||W.length>0)?jsxRuntime.jsx(material.Button,{onClick:Be,children:c}):null,jsxRuntime.jsx(material.Box,{sx:{flex:1}}),jsxRuntime.jsx(material.Button,{onClick:Re,children:d}),jsxRuntime.jsx(material.Button,{variant:"contained",onClick:Ze,disabled:!k&&W.length===0,children:i})]})]})]})};var au=({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 Ni=e=>{let{t}=te(),o="0.85rem",r=Array.isArray(e.actions)?e.actions:e.actions?[e.actions]:[],a=Array.isArray(e.extraTools)?e.extraTools:e.extraTools?[e.extraTools]:[],n=[...r,...a],i=typeof e.rowsPerPage=="number"?e.rowsPerPage:20,c=Array.isArray(e.rowsPerPageOptions)&&e.rowsPerPageOptions.length>0?e.rowsPerPageOptions:[20,50,100,-1],d=typeof e.count=="number"?e.count:0,l=Math.max(0,typeof e.page=="number"?e.page:0),s=i===-1?1:Math.max(1,Math.ceil(d/i)),g=Math.min(l+1,s),f=l>0,m=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:b=>e.setFilterText(b.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(Jd__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:b=>e.onRowsPerPageChange?.(Number(b.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(b=>jsxRuntime.jsx(material.MenuItem,{value:b,sx:{fontSize:o},children:b===-1?t("common.all"):b},`rows-per-page-${b}`))}),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(Yh__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:!m,sx:{p:.35,color:"text.primary"},children:jsxRuntime.jsx(yf__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((b,C)=>jsxRuntime.jsx(Rt__namespace.default.Fragment,{children:b},`toolbar-custom-${C}`))}),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:b=>e.setGroupAnchorEl(b.currentTarget),children:jsxRuntime.jsx(material.Badge,{badgeContent:e.grouping?.length,color:"primary",children:jsxRuntime.jsx(Kh__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:b=>e.setSummaryAnchorEl(b.currentTarget),children:jsxRuntime.jsx(qh__default.default,{})})}),jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.columns"),children:jsxRuntime.jsx(material.IconButton,{sx:{color:"text.primary"},onClick:b=>e.setAnchorEl(b.currentTarget),children:jsxRuntime.jsx($h__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(Uh__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(xu__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(Zh__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(Xh__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(_h__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:b=>e.onLayoutSave(b),children:jsxRuntime.jsx(gp__default.default,{})})}),e.layoutManager]})]})};var Vi=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:o}=e;return "translate3d("+(t?Math.round(t):0)+"px, "+(o?Math.round(o):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:o}=e;return "scaleX("+t+") scaleY("+o+")"}},Transform:{toString(e){if(e)return [Vi.Translate.toString(e),Vi.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:o,easing:r}=e;return t+" "+o+"ms "+r}}});var Oi=e=>{let{t}=te(),{onSelectAllClick:o,order:r,orderBy:a,sortBy:n=[],numSelected:i=0,rowCount:c=0,onRequestSort:d,onContextMenu:l,columns:s,visibleColumns:g,selectionMode:f,grouping:m=[],isAllExpanded:b=false,handleToggleAll:C,onColumnResize:u,columnWidths:v,enableColumnReorder:p=false}=e,[h,y]=Rt.useState(null),S=Rt.useRef(null),E=q=>ee=>{h||d(q);},P=(q,ee,le)=>{q.preventDefault(),q.stopPropagation(),y(ee),S.current={startX:q.clientX,startWidth:le,colId:ee},document.addEventListener("mousemove",k),document.addEventListener("mouseup",R),document.body.style.cursor="col-resize";},k=q=>{if(!S.current)return;let{startX:ee,startWidth:le,colId:_}=S.current,U=q.clientX-ee,ge=Math.max(50,le+U);u&&u(_,ge);},R=()=>{y(null),S.current=null,document.removeEventListener("mousemove",k),document.removeEventListener("mouseup",R),document.body.style.cursor="";};Rt.useEffect(()=>()=>{document.removeEventListener("mousemove",k),document.removeEventListener("mouseup",R);},[]);let I=f==="multiple"||f==="single",w=m.length>0&&!!C,A=t(b?"table.group.collapseAll":"table.group.expandAll"),M=s.filter(q=>g.includes(q.id)),D=new Map(n.map((q,ee)=>[q.field,{...q,priority:ee+1}])),B=M.map(q=>{let ee=v?.[q.id]||q.minWidth||100,le=D.get(q.id);return jsxRuntime.jsx(mb,{headCell:q,width:typeof ee=="number"?ee:100,order:r,orderBy:a,multiSortInfo:le,onRequestSort:E(q.id),onContextMenu:l,onResizeMouseDown:_=>P(_,q.id,typeof ee=="number"?ee:100),enableColumnReorder:p},q.id)}),j=M.map(q=>q.id),W=jsxRuntime.jsxs(rb__default.default,{children:[I&&jsxRuntime.jsx(Gs__default.default,{padding:"checkbox",sx:q=>({width:48,position:"sticky",top:0,zIndex:4,backgroundColor:q.palette.mode==="dark"?"#000000":"#f5f5f5",color:q.palette.mode==="dark"?"#ffffff":q.palette.text.primary}),children:jsxRuntime.jsx(ab__default.default,{color:"primary",indeterminate:i>0&&i<c,checked:c>0&&i===c,onChange:o,disabled:f==="single"})}),w&&jsxRuntime.jsx(Gs__default.default,{align:"center",padding:"checkbox",sx:q=>({width:44,position:"sticky",top:0,zIndex:4,backgroundColor:q.palette.mode==="dark"?"#000000":"#f5f5f5",color:q.palette.mode==="dark"?"#ffffff":q.palette.text.primary}),children:jsxRuntime.jsx(lb__default.default,{title:A,children:jsxRuntime.jsx(ib__default.default,{size:"small",onClick:q=>{q.stopPropagation(),C?.(!b);},sx:{p:.2},children:b?jsxRuntime.jsx(cb__default.default,{fontSize:"small"}):jsxRuntime.jsx(sb__default.default,{fontSize:"small"})})})}),p?jsxRuntime.jsx(sortable.SortableContext,{items:j,strategy:sortable.horizontalListSortingStrategy,children:B}):B]});return jsxRuntime.jsx(ob__default.default,{children:W})},mb=({headCell:e,width:t,order:o,orderBy:r,multiSortInfo:a,onRequestSort:n,onContextMenu:i,onResizeMouseDown:c,enableColumnReorder:d})=>{let{setNodeRef:l,attributes:s,listeners:g,transform:f,transition:m,isDragging:b}=sortable.useSortable({id:e.id,disabled:!d}),C=d?{transform:Vi.Transform.toString(f),transition:m,opacity:b?.6:1}:{},u=a?.direction??(r===e.id?o:"asc"),v=!!a||r===e.id;return jsxRuntime.jsxs(Gs__default.default,{ref:d?l:void 0,align:"left",padding:e.disablePadding?"none":"normal",sortDirection:v?u:false,onContextMenu:i?p=>i(p,e.id):void 0,style:{width:t,minWidth:t,maxWidth:t,...C},sx:p=>({position:"sticky",top:0,zIndex:4,backgroundColor:p.palette.mode==="dark"?"#000000":"#f5f5f5",color:p.palette.mode==="dark"?"#ffffff":p.palette.text.primary,fontWeight:"bold",userSelect:"none",cursor:d?b?"grabbing":"grab":void 0}),...d?s:{},...d?g:{},children:[jsxRuntime.jsx(nb__default.default,{active:v,direction:u,onClick:n,sx:p=>({"&.MuiTableSortLabel-root":{width:"100%"},"& .MuiTableSortLabel-icon":{color:p.palette.mode==="dark"?"#ffffff":p.palette.text.primary,opacity:v?1:0,transition:"opacity 0.2s"},"&:hover .MuiTableSortLabel-icon":{opacity:.5},"&.Mui-active .MuiTableSortLabel-icon":{opacity:1,color:p.palette.mode==="dark"?"#ffffff":p.palette.text.primary},fontWeight:"bold",fontSize:"0.85rem",color:p.palette.mode==="dark"?"#ffffff":p.palette.text.primary}),children:jsxRuntime.jsxs(oi__default.default,{component:"span",sx:{overflow:"visible",textOverflow:"clip",whiteSpace:"normal",lineHeight:1.2,wordBreak:"break-word",pr:1,display:"inline-flex",alignItems:"center",gap:.5},children:[e.label,a&&jsxRuntime.jsx(oi__default.default,{component:"span",sx:p=>({display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:16,height:16,px:.5,borderRadius:999,fontSize:10,fontWeight:700,color:"#fff",backgroundColor:p.palette.primary.main}),children:a.priority})]})}),jsxRuntime.jsx(oi__default.default,{onMouseDown:c,onPointerDown:p=>p.stopPropagation(),onClick:p=>p.stopPropagation(),sx:p=>({position:"absolute",right:0,top:0,bottom:0,width:5,cursor:"col-resize",backgroundColor:"transparent",transition:"background-color 120ms ease","&:hover":{backgroundColor:p.palette.mode==="dark"?"rgba(148,163,184,0.28)":"rgba(15,23,42,0.12)"},zIndex:1})})]})};var su=e=>{let{t}=te(),{visibleRows:o,visibleColumns:r,selected:a=[],handleClick:n,columns:i,toggleGroupExpand:c,expandedGroups:d=new Set,selectionMode:l,grouping:s=[],isGroupFullyExpanded:g,handleExpandGroupRecursively:f,handleCollapseGroupRecursively:m}=e,b=p=>a.indexOf(p)!==-1,C=l==="multiple"||l==="single",u=s.length>0,v=r.length+(C?1:0)+(u?1:0);return jsxRuntime.jsxs(material.TableBody,{children:[o.map((p,h)=>{if(p.type==="group"){let y=d.has(p.id),S=p.childIds||[],E=S.filter(I=>b(I)).length,P=S.length>0&&E===S.length,k=E>0&&E<S.length;return jsxRuntime.jsxs(material.TableRow,{sx:I=>({backgroundColor:I.palette.mode==="dark"?"#111111":"#f5f5f5","& .MuiTableCell-root":{color:I.palette.text.primary,borderBottomColor:I.palette.divider},"& .MuiIconButton-root":{color:I.palette.text.primary},"& .MuiCheckbox-root":{color:I.palette.text.secondary},"& .MuiCheckbox-root.Mui-checked, & .MuiCheckbox-root.MuiCheckbox-indeterminate":{color:I.palette.primary.main}}),children:[C&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",children:jsxRuntime.jsx(material.Checkbox,{size:"small",checked:P,indeterminate:k,onChange:I=>{if(I.stopPropagation(),!!e.onSelectionChange)if(P){let w=a.filter(A=>!S.includes(A));e.onSelectionChange(w);}else {let w=Array.from(new Set([...a,...S]));e.onSelectionChange(w);}},onClick:I=>I.stopPropagation(),sx:{p:.5}})}),u&&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&&p.level<s.length-1&&jsxRuntime.jsx(material.Tooltip,{title:g?.(p.id)?t("table.group.collapseAll"):t("table.group.expandAll"),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>{g?.(p.id)?m?.(p.id):f?.(p.id);},sx:{p:.25},children:g?.(p.id)?jsxRuntime.jsx(cb__default.default,{fontSize:"small"}):jsxRuntime.jsx(sb__default.default,{fontSize:"small"})})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>c&&c(p.id),sx:{p:.25},children:y?jsxRuntime.jsx(xb__default.default,{}):jsxRuntime.jsx(yf__default.default,{})})]})}),jsxRuntime.jsx(material.TableCell,{colSpan:r.length,sx:{py:1,pl:p.level*3+1},children:jsxRuntime.jsxs(material.Typography,{variant:"body2",fontWeight:"bold",color:"text.primary",sx:{fontSize:"0.85rem"},children:[p.field,": ",p.value," (",p.count,")"]})})]},p.id)}else {let y=p.data||p,S=p.id||y.id||h,E=b(S),P=`enhanced-table-checkbox-${h}`,R=(p.level!==void 0?p.level:0)*4;return jsxRuntime.jsxs(material.TableRow,{hover:true,onClick:I=>n&&n(I,y),role:"checkbox","aria-checked":E,tabIndex:-1,selected:E,sx:{cursor:"pointer"},children:[C&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",sx:{pl:R>0?R+1:void 0},children:jsxRuntime.jsx(material.Checkbox,{color:"primary",checked:E,inputProps:{"aria-labelledby":P}})}),u&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",sx:{width:44}}),i.filter(I=>r.includes(I.id)).map((I,w)=>{let M=!C&&w===0&&R>0?{pl:R+2}:{};return jsxRuntime.jsx(material.TableCell,{align:"left",sx:M,children:I.render?I.render(y[I.id],y):(function(){let B=y[I.id];if(I.numeric){if(typeof B=="number")return B.toLocaleString();if(typeof B=="string"&&B.trim()!==""&&!isNaN(Number(B)))return Number(B).toLocaleString()}return B})()},I.id)})]},S)}}),o.length===0&&jsxRuntime.jsx(material.TableRow,{children:jsxRuntime.jsx(material.TableCell,{colSpan:v,align:"center",children:t("common.noData")})})]})};var cu=e=>{let{visibleColumns:t,summaryRow:o,selectionMode:r,grouping:a=[]}=e;if(!e.showSummary)return null;let n=r==="multiple"||r==="single",i=a.length>0;return jsxRuntime.jsx(material.TableFooter,{sx:{position:"sticky",bottom:0,zIndex:e.zIndex,bgcolor:"background.paper"},children:jsxRuntime.jsxs(material.TableRow,{children:[n&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",sx:{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 uu=e=>{let{t}=te();return jsxRuntime.jsx(material.Box,{sx:{p:2},children:jsxRuntime.jsx(material.Typography,{children:t("table.mobile.notImplemented")})})};var qa=({groupAnchorEl:e,setGroupAnchorEl:t,grouping:o,setGrouping:r,columns:a,toggleGroupField:n})=>{let{t:i}=te();return jsxRuntime.jsxs(material.Menu,{anchorEl:e,open:!!e,onClose:()=>t(null),children:[jsxRuntime.jsxs(material.Box,{sx:{p:1,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[jsxRuntime.jsx(material.Typography,{variant:"subtitle2",sx:{px:1},children:i("table.menu.groupBy")}),o.length>0&&jsxRuntime.jsx(material.Button,{size:"small",color:"error",onClick:()=>r([]),startIcon:jsxRuntime.jsx(hu__default.default,{}),children:i("table.menu.clearAll")})]}),jsxRuntime.jsx(material.Divider,{}),a.map(c=>{let d=o.includes(c.id),l=o.indexOf(c.id)+1;return jsxRuntime.jsx(material.MenuItem,{onClick:()=>n(c.id),children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",width:"100%"},children:[jsxRuntime.jsx(material.Checkbox,{checked:d,size:"small"}),jsxRuntime.jsx(material.ListItemText,{primary:c.label}),d&&jsxRuntime.jsx(material.Badge,{badgeContent:l,color:"primary",sx:{mr:2}})]})},c.id)})]})},_a=({anchorEl:e,setAnchorEl:t,columns:o,visibleColumns:r,toggleColumnVisibility:a})=>{let{t:n}=te();return jsxRuntime.jsxs(material.Menu,{anchorEl:e,open:!!e,onClose:()=>t(null),children:[jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.ListItemText,{primary:n("table.menu.visibleColumns")})}),jsxRuntime.jsx(material.Divider,{}),o.map(i=>jsxRuntime.jsxs(material.MenuItem,{onClick:()=>a(i.id),children:[jsxRuntime.jsx(material.Checkbox,{checked:r.includes(i.id),size:"small"}),jsxRuntime.jsx(material.ListItemText,{primary:i.label})]},i.id))]})},$i=({anchorEl:e,setAnchorEl:t,showSummary:o,setShowSummary:r,columns:a,summaryColumns:n,toggleSummaryColumn:i})=>{let{t:c}=te();return jsxRuntime.jsxs(material.Menu,{anchorEl:e,open:!!e,onClose:()=>t(null),children:[jsxRuntime.jsx(material.MenuItem,{children:jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Switch,{checked:o,onChange:d=>r(d.target.checked),size:"small"}),label:c("table.menu.showSummaryRow")})}),jsxRuntime.jsx(material.Divider,{}),a.filter(d=>d.numeric).map(d=>jsxRuntime.jsxs(material.MenuItem,{onClick:()=>i(d.id),disabled:!o,children:[jsxRuntime.jsx(material.Checkbox,{checked:n.includes(d.id),size:"small"}),jsxRuntime.jsx(material.ListItemText,{primary:d.label})]},d.id)),a.filter(d=>d.numeric).length===0&&jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.ListItemText,{primary:c("table.menu.noNumericColumns")})})]})},Gi=({contextMenu:e,handleCloseContextMenu:t,columns:o,visibleColumns:r,toggleColumnVisibility:a})=>{let{t:n}=te();return jsxRuntime.jsxs(material.Menu,{open:e!==null,onClose:t,anchorReference:"anchorPosition",anchorPosition:e!==null?{top:e.mouseY,left:e.mouseX}:void 0,children:[jsxRuntime.jsx(material.MenuItem,{onClick:t,children:n("common.copy")}),jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsx(material.MenuItem,{disabled:true,children:n("table.menu.visibleColumns")}),o.map(i=>jsxRuntime.jsxs(material.MenuItem,{onClick:()=>a(i.id),children:[jsxRuntime.jsx(material.ListItemIcon,{children:r.includes(i.id)&&jsxRuntime.jsx(Eb__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{children:i.label})]},i.id))]})},vu=({contextMenu:e,handleClose:t,columns:o,visibleColumns:r,grouping:a,summaryColumns:n,showSummary:i,sortBy:c,orderBy:d,order:l,onSortAsc:s,onSortDesc:g,onClearSort:f,onHideColumn:m,onToggleGroup:b,onToggleSummary:C,onOpenSortDialog:u})=>{let{t:v}=te(),p=e?.columnId??"",h=o.find(w=>w.id===p),y=a.includes(p),S=n.includes(p),E=!!h?.numeric,P=c.find(w=>w.field===p),k=P?P.direction==="asc":d===p&&l==="asc",R=P?P.direction==="desc":d===p&&l==="desc",I=k||R;return jsxRuntime.jsxs(material.Menu,{open:e!==null,onClose:t,anchorReference:"anchorPosition",anchorPosition:e!==null?{top:e.mouseY,left:e.mouseX}:void 0,children:[jsxRuntime.jsx(material.MenuItem,{disabled:true,sx:{opacity:"1 !important",fontWeight:700},children:jsxRuntime.jsx(material.ListItemText,{primary:h?.label??p})}),jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsxs(material.MenuItem,{onClick:()=>{s(p),t();},selected:k,children:[jsxRuntime.jsx(material.ListItemIcon,{children:jsxRuntime.jsx(bu__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{primary:v("table.headerMenu.sortAsc")})]}),jsxRuntime.jsxs(material.MenuItem,{onClick:()=>{g(p),t();},selected:R,children:[jsxRuntime.jsx(material.ListItemIcon,{children:jsxRuntime.jsx(yu__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{primary:v("table.headerMenu.sortDesc")})]}),I&&jsxRuntime.jsxs(material.MenuItem,{onClick:()=>{f(p),t();},children:[jsxRuntime.jsx(material.ListItemIcon,{children:jsxRuntime.jsx(hu__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{primary:v("table.headerMenu.clearSort")})]}),jsxRuntime.jsxs(material.MenuItem,{onClick:()=>{u(),t();},children:[jsxRuntime.jsx(material.ListItemIcon,{children:jsxRuntime.jsx(xu__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{primary:v("table.headerMenu.configureSort")})]}),jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsxs(material.MenuItem,{onClick:()=>{b(p),t();},selected:y,children:[jsxRuntime.jsx(material.ListItemIcon,{children:jsxRuntime.jsx(Kh__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{primary:v(y?"table.headerMenu.ungroup":"table.headerMenu.group")})]}),E&&i&&jsxRuntime.jsxs(material.MenuItem,{onClick:()=>{C(p),t();},selected:S,children:[jsxRuntime.jsx(material.ListItemIcon,{children:jsxRuntime.jsx(qh__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{primary:v(S?"table.headerMenu.removeSummary":"table.headerMenu.addSummary")})]}),jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsxs(material.MenuItem,{onClick:()=>{m(p),t();},children:[jsxRuntime.jsx(material.ListItemIcon,{children:jsxRuntime.jsx(Fb__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{primary:v("table.headerMenu.hideColumn")})]})]})},Cu=({open:e,onClose:t,columns:o,initialRules:r,onApply:a,onClear:n})=>{let{t:i}=te(),[c,d]=Rt.useState([]);Rt.useEffect(()=>{e&&d(r.length>0?r.map(C=>({...C})):[]);},[e,r]);let l=Rt.useMemo(()=>new Set(c.map(C=>C.field)),[c]),s=Rt.useMemo(()=>o.filter(C=>!l.has(C.id)),[o,l]),g=()=>{let C=s[0];C&&d(u=>[...u,{field:C.id,direction:"asc"}]);},f=C=>{d(u=>u.filter((v,p)=>p!==C));},m=(C,u)=>{d(v=>v.map((p,h)=>h===C?{...p,...u}:p));},b=(C,u)=>{d(v=>{let p=C+u;if(p<0||p>=v.length)return v;let h=[...v],[y]=h.splice(C,1);return h.splice(p,0,y),h});};return jsxRuntime.jsxs(material.Dialog,{open:e,onClose:t,maxWidth:"sm",fullWidth:true,children:[jsxRuntime.jsx(material.DialogTitle,{children:i("table.sortDialog.title")}),jsxRuntime.jsxs(material.DialogContent,{dividers:true,children:[c.length===0?jsxRuntime.jsx(material.Typography,{variant:"body2",sx:{color:"text.secondary",py:2},children:i("table.sortDialog.empty")}):jsxRuntime.jsx(material.Stack,{spacing:1,children:c.map((C,u)=>{let v=new Set(c.filter((h,y)=>y!==u).map(h=>h.field)),p=o.filter(h=>!v.has(h.id));return jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:"24px 1fr 110px auto auto",alignItems:"center",gap:1},children:[jsxRuntime.jsx(material.Badge,{badgeContent:u+1,color:"primary",sx:{ml:.5}}),jsxRuntime.jsx("select",{value:C.field,onChange:h=>m(u,{field:h.target.value}),style:{padding:6,fontSize:13,borderRadius:4},children:p.map(h=>jsxRuntime.jsx("option",{value:h.id,children:h.label},h.id))}),jsxRuntime.jsxs("select",{value:C.direction,onChange:h=>m(u,{direction:h.target.value}),style:{padding:6,fontSize:13,borderRadius:4},children:[jsxRuntime.jsx("option",{value:"asc",children:i("table.sortDialog.asc")}),jsxRuntime.jsx("option",{value:"desc",children:i("table.sortDialog.desc")})]}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>b(u,-1),disabled:u===0,children:jsxRuntime.jsx(bu__default.default,{fontSize:"small"})}),jsxRuntime.jsxs(material.Stack,{direction:"row",children:[jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>b(u,1),disabled:u===c.length-1,children:jsxRuntime.jsx(yu__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>f(u),children:jsxRuntime.jsx(Nb__default.default,{fontSize:"small"})})]})]},`sort-rule-${u}`)})}),jsxRuntime.jsx(material.Button,{size:"small",onClick:g,disabled:s.length===0,startIcon:jsxRuntime.jsx(xu__default.default,{}),sx:{mt:2},children:i("table.sortDialog.addRule")})]}),jsxRuntime.jsxs(material.DialogActions,{children:[jsxRuntime.jsx(material.Button,{color:"inherit",onClick:()=>{n(),t();},children:i("table.sortDialog.clearAll")}),jsxRuntime.jsx(material.Box,{sx:{flex:1}}),jsxRuntime.jsx(material.Button,{onClick:t,children:i("common.cancel")}),jsxRuntime.jsx(material.Button,{variant:"contained",onClick:()=>{a(c),t();},children:i("common.ok")})]})]})};var Kn=(e,t=2)=>e.toLocaleString(void 0,{maximumFractionDigits:t}),Su=({kpis:e})=>{let{t}=te(),o=[{label:t("graph.kpi.totalRecords"),value:Kn(e.totalRecords,0),color:"text.primary"},{label:t("graph.kpi.totalReport"),value:Kn(e.totalReportHours),color:"text.primary"},{label:t("graph.kpi.totalBillable"),value:Kn(e.totalBillableHours),color:"success.main"},{label:t("graph.kpi.efficiency"),value:`${e.efficiency.toFixed(2)}%`,color:"warning.main"},{label:t("graph.kpi.amount"),value:Kn(e.totalAmount),color:"info.main"},{label:t("graph.kpi.flagged"),value:Kn(e.flaggedCount,0),color:"error.main"}];return jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",lg:"repeat(6, minmax(0, 1fr))"},gap:1.5},children:o.map(r=>jsxRuntime.jsxs(material.Paper,{variant:"outlined",sx:{p:1.5,borderRadius:2,minHeight:96,display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",children:r.label}),jsxRuntime.jsx(material.Typography,{variant:"h4",fontWeight:800,sx:{color:r.color},children:r.value})]},r.label))})};var Ui=({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 _n=({data:e,orientation:t="horizontal",valueSuffix:o="",minHeight:r=210,activeName:a,onItemClick:n})=>{if(e.length===0)return jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:"No data"});let i=Math.max(...e.map(c=>c.value),1);return t==="vertical"?jsxRuntime.jsx(material.Box,{sx:{display:"flex",gap:1,alignItems:"flex-end",minHeight:r},children:e.map(c=>jsxRuntime.jsxs(material.Box,{sx:{flex:1,minWidth:0},children:[jsxRuntime.jsx(material.Box,{onClick:()=>n?.(c),sx:{height:`${Math.max(c.value/i*180,6)}px`,bgcolor:c.name===a?"primary.dark":"primary.main",borderRadius:"8px 8px 0 0",cursor:n?"pointer":"default",opacity:a&&c.name!==a?.45:1}}),jsxRuntime.jsx(material.Typography,{variant:"caption",noWrap:true,title:c.name,sx:{display:"block",mt:.5},children:c.name}),jsxRuntime.jsxs(material.Typography,{variant:"caption",color:"text.secondary",children:[c.value.toFixed(1),o]})]},c.name))}):jsxRuntime.jsx(material.Stack,{spacing:1,children:e.map(c=>jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:"140px 1fr 64px",gap:1},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",noWrap:true,title:c.name,children:c.name}),jsxRuntime.jsx(material.Box,{onClick:()=>n?.(c),sx:{alignSelf:"center",bgcolor:"action.hover",height:10,borderRadius:999,overflow:"hidden",cursor:n?"pointer":"default",opacity:a&&c.name!==a?.45:1},children:jsxRuntime.jsx(material.Box,{sx:{width:`${c.value/i*100}%`,height:"100%",bgcolor:c.name===a?"primary.dark":"primary.main"}})}),jsxRuntime.jsxs(material.Typography,{variant:"caption",sx:{textAlign:"right",fontWeight:600},children:[c.value.toFixed(1),o]})]},c.name))})};var Iu=({data:e,color:t="#42A5F5",valueSuffix:o="",height:r=220})=>{if(e.length===0)return jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:"No data"});let a=640,n=28,i=e.map(f=>f.value),c=Math.min(...i,0),l=Math.max(...i,1)-c||1,s=e.map((f,m)=>{let b=n+m*(a-n*2)/Math.max(e.length-1,1),C=r-n-(f.value-c)/l*(r-n*2);return {x:b,y:C,...f}}),g=s.map(f=>`${f.x},${f.y}`).join(" ");return jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsxs(material.Box,{component:"svg",viewBox:`0 0 ${a} ${r}`,sx:{width:"100%",height:r},children:[jsxRuntime.jsx("line",{x1:n,y1:r-n,x2:a-n,y2:r-n,stroke:"rgba(148,163,184,0.4)"}),jsxRuntime.jsx("polyline",{fill:"none",stroke:t,strokeWidth:3,points:g}),s.map(f=>jsxRuntime.jsx("circle",{cx:f.x,cy:f.y,r:4,fill:t},f.name))]}),jsxRuntime.jsx(material.Box,{sx:{mt:1,display:"grid",gridTemplateColumns:`repeat(${e.length}, minmax(0, 1fr))`,gap:1},children:e.map(f=>jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",noWrap:true,title:f.name,sx:{display:"block"},children:f.name}),jsxRuntime.jsxs(material.Typography,{variant:"caption",color:"text.secondary",children:[f.value.toFixed(1),o]})]},f.name))})]})};var Pu=({data:e,barColor:t="#64B5F6",lineColor:o="#FFB74D",height:r=220})=>{if(e.length===0)return jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:"No data"});let a=640,n=28,i=Math.max(...e.map(s=>s.barValue),1),c=Math.max(...e.map(s=>s.lineValue),1),d=e.map((s,g)=>{let f=(a-n*2)/e.length,m=Math.max(f*.5,8),b=n+g*f+(f-m)/2,C=s.barValue/i*(r-n*2),u=r-n-C;return {x:b,y:u,barHeight:C,barWidth:m,item:s}}),l=e.map((s,g)=>{let f=(a-n*2)/e.length,m=n+g*f+f/2,b=r-n-s.lineValue/c*(r-n*2);return {x:m,y:b,item:s}});return jsxRuntime.jsxs(material.Stack,{spacing:1.25,children:[jsxRuntime.jsxs(material.Box,{component:"svg",viewBox:`0 0 ${a} ${r}`,sx:{width:"100%",height:r},children:[jsxRuntime.jsx("line",{x1:n,y1:r-n,x2:a-n,y2:r-n,stroke:"rgba(148,163,184,0.4)"}),d.map(s=>jsxRuntime.jsx("rect",{x:s.x,y:s.y,width:s.barWidth,height:Math.max(s.barHeight,4),rx:6,fill:t},s.item.name)),jsxRuntime.jsx("polyline",{fill:"none",stroke:o,strokeWidth:3,points:l.map(s=>`${s.x},${s.y}`).join(" ")}),l.map(s=>jsxRuntime.jsx("circle",{cx:s.x,cy:s.y,r:3.5,fill:o},`${s.item.name}-line`))]}),jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${e.length}, minmax(0, 1fr))`,gap:1},children:e.map(s=>jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",noWrap:true,title:s.name,sx:{display:"block"},children:s.name}),jsxRuntime.jsxs(material.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:["Bar: ",s.barValue.toFixed(1)]}),jsxRuntime.jsxs(material.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:["Line: ",s.lineValue.toFixed(1)]})]},s.name))})]})};var _b=e=>`rgba(30, 136, 229, ${.2+Math.max(0,Math.min(1,e))*.8})`,Du=({data:e})=>{if(e.length===0)return jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:"No data"});let t=Array.from(new Set(e.map(n=>n.x))),o=Array.from(new Set(e.map(n=>n.y))),r=Math.max(...e.map(n=>n.value),1),a=new Map(e.map(n=>[`${n.y}__${n.x}`,n.value]));return jsxRuntime.jsx(material.Box,{sx:{overflowX:"auto"},children:jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:`120px repeat(${t.length}, minmax(64px, 1fr))`,gap:1,minWidth:120+t.length*64},children:[jsxRuntime.jsx(material.Box,{}),t.map(n=>jsxRuntime.jsx(material.Typography,{variant:"caption",sx:{textAlign:"center",fontWeight:600},children:n},n)),o.map(n=>jsxRuntime.jsxs(material.Box,{sx:{display:"contents"},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",sx:{alignSelf:"center"},children:n}),t.map(i=>{let c=a.get(`${n}__${i}`)||0,d=c/r;return jsxRuntime.jsx(material.Box,{sx:{height:36,borderRadius:1,bgcolor:_b(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 jb=["#1E88E5","#1ABC9C","#FBC02D","#EF5350","#7E57C2","#78909C"],Yi=({data:e,variant:t="donut",colors:o=jb,size:r=180,activeName:a,onItemClick:n})=>{if(e.length===0)return jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:"No data"});let i=0,c=e.map((d,l)=>{let s=i;return i+=d.percent,`${o[l%o.length]} ${s}% ${i}%`});return jsxRuntime.jsxs(material.Stack,{direction:{xs:"column",sm:"row"},spacing:2,alignItems:"center",children:[jsxRuntime.jsx(material.Box,{sx:{width:r,height:r,borderRadius:"50%",background:`conic-gradient(${c.join(", ")})`,position:"relative",flexShrink:0},children:t==="donut"&&jsxRuntime.jsx(material.Box,{sx:{position:"absolute",inset:Math.round(r*.18),bgcolor:"background.paper",borderRadius:"50%"}})}),jsxRuntime.jsx(material.Stack,{spacing:1,sx:{minWidth:180},children:e.map((d,l)=>jsxRuntime.jsxs(material.Box,{onClick:()=>n?.(d),sx:{display:"flex",alignItems:"center",gap:1,cursor:n?"pointer":"default",opacity:a&&d.name!==a?.45:1},children:[jsxRuntime.jsx(material.Box,{sx:{width:10,height:10,borderRadius:"50%",bgcolor:o[l%o.length]}}),jsxRuntime.jsx(material.Typography,{variant:"caption",sx:{flex:1},children:d.name}),jsxRuntime.jsxs(material.Typography,{variant:"caption",sx:{fontWeight:700},children:[d.percent.toFixed(0),"%"]})]},d.name))})]})};var Au=({effect:e,branches:t})=>{if(t.length===0)return jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:"No data"});let o=t.filter((a,n)=>n%2===0),r=t.filter((a,n)=>n%2===1);return jsxRuntime.jsxs(material.Stack,{spacing:1.5,children:[jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${Math.max(o.length,1)}, minmax(0, 1fr))`,gap:1},children:o.map(a=>jsxRuntime.jsxs(material.Box,{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",fontWeight:700,children:a.title}),a.causes.map(n=>jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:n},n))]},a.title))}),jsxRuntime.jsxs(material.Box,{sx:{position:"relative",height:32},children:[jsxRuntime.jsx(material.Box,{sx:{position:"absolute",inset:"50% 0 auto 0",borderTop:"2px solid",borderColor:"primary.main"}}),jsxRuntime.jsx(material.Box,{sx:{position:"absolute",right:0,top:"calc(50% - 12px)",px:1,py:.25,borderRadius:1,bgcolor:"primary.main",color:"primary.contrastText"},children:jsxRuntime.jsx(material.Typography,{variant:"caption",fontWeight:700,children:e})})]}),jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${Math.max(r.length,1)}, minmax(0, 1fr))`,gap:1},children:r.map(a=>jsxRuntime.jsxs(material.Box,{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",fontWeight:700,children:a.title}),a.causes.map(n=>jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:n},n))]},a.title))})]})};var Eu=({data:e,height:t=240})=>{if(e.length===0)return jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:"No data"});let o=0,r=e.map(g=>{let f=g.type==="total"?0:o,m=g.type==="total"?g.value:o+g.value;return g.type!=="total"&&(o=m),{...g,start:f,end:m,delta:m-f}}),a=r.flatMap(g=>[g.start,g.end]),n=Math.min(...a,0),i=Math.max(...a,1),c=680,d=30,l=i-n||1,s=g=>t-d-(g-n)/l*(t-d*2);return jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsxs(material.Box,{component:"svg",viewBox:`0 0 ${c} ${t}`,sx:{width:"100%",height:t},children:[jsxRuntime.jsx("line",{x1:d,y1:s(0),x2:c-d,y2:s(0),stroke:"rgba(148,163,184,0.4)"}),r.map((g,f)=>{let m=(c-d*2)/r.length,b=Math.max(m*.55,8),C=d+f*m+(m-b)/2,u=s(Math.max(g.start,g.end)),v=s(Math.min(g.start,g.end)),p=g.type==="total"?"#42A5F5":g.delta>=0?"#66BB6A":"#EF5350";return jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("rect",{x:C,y:u,width:b,height:Math.max(v-u,4),rx:6,fill:p}),jsxRuntime.jsx("text",{x:C+b/2,y:u-6,textAnchor:"middle",fill:"currentColor",fontSize:"11",children:g.end.toFixed(1)})]},g.name)})]}),jsxRuntime.jsx(material.Box,{sx:{mt:1,display:"grid",gridTemplateColumns:`repeat(${r.length}, minmax(0, 1fr))`,gap:1},children:r.map(g=>jsxRuntime.jsx(material.Typography,{variant:"caption",noWrap:true,title:g.name,children:g.name},g.name))})]})};var Xn=({apiKey:e,query:t,zoom:o=14,mapType:r="roadmap"})=>{let a=encodeURIComponent(t);return `https://www.google.com/maps/embed/v1/place?key=${encodeURIComponent(e)}&q=${a}&zoom=${o}&maptype=${r}`},oD=(e,t=360)=>{let o=Xn(e);return `<iframe width="100%" height="${t}" style="border:0" loading="lazy" allowfullscreen referrerpolicy="no-referrer-when-downgrade" src="${o}"></iframe>`};var zu=({apiKey:e,query:t,embedUrl:o,zoom:r=14,mapType:a="roadmap",height:n=320})=>{let i=o||(e&&t?Xn({apiKey:e,query:t,zoom:r,mapType:a}):"");return i?jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsx(material.Box,{component:"iframe",src:i,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",sx:{width:"100%",height:n,border:0,borderRadius:2}}),jsxRuntime.jsxs(material.Typography,{variant:"caption",color:"text.secondary",sx:{mt:.75,display:"block"},children:["If iframe is blocked, open directly: ",jsxRuntime.jsx(material.Link,{href:i,target:"_blank",rel:"noreferrer",children:"Google Maps"})]})]}):jsxRuntime.jsx(material.Box,{children:jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:"Google Map requires `embedUrl` or (`apiKey` + `query`)."})})};var el=({keyword:e,location:t,src:o="orbcafe-ui"})=>{if(t){let r=encodeURIComponent(t.name||e||"Location");return `https://uri.amap.com/marker?position=${t.lng},${t.lat}&name=${r}&src=${encodeURIComponent(o)}&coordinate=gaode&callnative=0`}return e?`https://uri.amap.com/search?keyword=${encodeURIComponent(e)}&src=${encodeURIComponent(o)}&callnative=0`:"https://uri.amap.com/search?keyword=%E5%8C%97%E4%BA%AC&src=orbcafe-ui&callnative=0"};var Hu=({keyword:e,location:t,embedUrl:o,height:r=320})=>{let a=o||el({keyword:e,location:t?{lng:t.lng,lat:t.lat,name:t.name}:void 0});return jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsx(material.Box,{component:"iframe",src:a,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",sx:{width:"100%",height:r,border:0,borderRadius:2}}),jsxRuntime.jsxs(material.Typography,{variant:"caption",color:"text.secondary",sx:{mt:.75,display:"block"},children:["If iframe is blocked, open directly: ",jsxRuntime.jsx(material.Link,{href:a,target:"_blank",rel:"noreferrer",children:"AMap"})]})]})};var Wu=({billableByPrimary:e,efficiencyBySecondary:t,statusDistribution:o,interaction:r})=>{let{t:a}=te();return jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",lg:"1.2fr 1.2fr 1fr"}},children:[jsxRuntime.jsx(Ui,{title:a("graph.chart.billable.title"),subtitle:a("graph.chart.billable.subtitle"),children:jsxRuntime.jsx(_n,{data:e,orientation:"horizontal",activeName:r?.filters?.primaryDimension,onItemClick:n=>r?.onPrimaryDimensionClick?.(n.name)})}),jsxRuntime.jsx(Ui,{title:a("graph.chart.efficiency.title"),subtitle:a("graph.chart.efficiency.subtitle"),children:jsxRuntime.jsx(_n,{data:t,orientation:"vertical",valueSuffix:"%",activeName:r?.filters?.secondaryDimension,onItemClick:n=>r?.onSecondaryDimensionClick?.(n.name)})}),jsxRuntime.jsx(Ui,{title:a("graph.chart.status.title"),subtitle:a("graph.chart.status.subtitle"),children:jsxRuntime.jsx(Yi,{data:o,variant:"donut",activeName:r?.filters?.status,onItemClick:n=>r?.onStatusClick?.(n.name)})})]})};var io=e=>jsxRuntime.jsx(material.TextField,{...e,variant:e.variant||"outlined",size:e.size||"small",fullWidth:e.fullWidth!==void 0?e.fullWidth:true});var rc=e=>jsxRuntime.jsx(material.TextField,{...e,multiline:true,minRows:3,fullWidth:true,variant:"outlined"});var my=["doubao-lite","gpt-4o-mini","gpt-4.1-mini","claude-3.5-sonnet"],gy=["zh","en","de","fr","ja","ko"],Uu=({open:e,onClose:t,value:o,onSaveAll:r,modelOptions:a=my,promptLangOptions:n=gy,analysisTemplateOptions:i=[],responseTemplateOptions:c=[],defaultAnalysisTemplateId:d,defaultResponseTemplateId:l})=>{let[s,g]=Rt.useState(o),[f,m]=Rt.useState(d||""),[b,C]=Rt.useState(l||""),[u,v]=Rt.useState(false);Rt.useEffect(()=>{e&&(g(o),m(d||""),C(l||""));},[e,o,d,l]);let p=(y,S)=>{g(E=>({...E,[y]:S}));},h=async()=>{if(r)try{v(!0),await r({settings:s,analysisTemplateId:f||void 0,responseTemplateId:b||void 0});}finally{v(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(Ph__default.default,{})})]}),jsxRuntime.jsx(material.DialogContent,{sx:{pt:"18px !important"},children:jsxRuntime.jsxs(material.Stack,{spacing:2.2,children:[jsxRuntime.jsxs(material.Box,{sx:{mt:.8,display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",md:"repeat(2, minmax(0, 1fr))"}},children:[jsxRuntime.jsx(material.Box,{children:jsxRuntime.jsx(io,{size:"small",value:s.baseUrl,onChange:y=>p("baseUrl",y.target.value),fullWidth:true,label:"Base URL"})}),jsxRuntime.jsx(material.Box,{children:jsxRuntime.jsx(io,{size:"small",type:"password",value:s.apiKey,onChange:y=>p("apiKey",y.target.value),fullWidth:true,label:"API Key"})}),jsxRuntime.jsx(material.Box,{children:jsxRuntime.jsx(io,{size:"small",value:s.model,onChange:y=>p("model",y.target.value),fullWidth:true,select:true,label:"Model",children:a.map(y=>jsxRuntime.jsx(material.MenuItem,{value:y,children:y},y))})}),jsxRuntime.jsx(material.Box,{children:jsxRuntime.jsx(io,{size:"small",value:s.promptLang,onChange:y=>p("promptLang",y.target.value),fullWidth:true,select:true,label:"Prompt Lang",children:n.map(y=>jsxRuntime.jsx(material.MenuItem,{value:y,children:y},y))})})]}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[jsxRuntime.jsxs(io,{size:"small",value:f,onChange:y=>m(y.target.value),fullWidth:true,select:true,label:"Analysis Template",children:[jsxRuntime.jsx(material.MenuItem,{value:"",children:"Default"}),i.map(y=>jsxRuntime.jsx(material.MenuItem,{value:y.id,children:y.label},y.id))]}),jsxRuntime.jsx(rc,{multiline:true,minRows:8,value:s.analysisPrompt,onChange:y=>p("analysisPrompt",y.target.value),fullWidth:true,label:"Analysis Prompt",sx:{"& .MuiInputBase-root":{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"}}}),jsxRuntime.jsxs(io,{size:"small",value:b,onChange:y=>C(y.target.value),fullWidth:true,select:true,label:"Response Template",children:[jsxRuntime.jsx(material.MenuItem,{value:"",children:"Default"}),c.map(y=>jsxRuntime.jsx(material.MenuItem,{value:y.id,children:y.label},y.id))]}),jsxRuntime.jsx(rc,{multiline:true,minRows:8,value:s.responsePrompt,onChange:y=>p("responsePrompt",y.target.value),fullWidth:true,label:"Response Prompt",sx:{"& .MuiInputBase-root":{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"}}})]})]})}),jsxRuntime.jsxs(material.DialogActions,{sx:{px:3,pb:2.5,pt:1.2,gap:1},children:[jsxRuntime.jsx(material.Button,{variant:"outlined",onClick:t,children:"Cancel"}),jsxRuntime.jsx(material.Button,{variant:"contained",onClick:h,disabled:!r||u,children:"Save"})]})]})};var nl=({open:e,onClose:t,model:o,tableContent:r,extraCharts:a,interaction:n,aiAssistant:i})=>{let{t:c}=te(),[d,l]=Rt.useState(i?.defaultPrompt||""),[s,g]=Rt.useState(false),[f,m]=Rt.useState(false),b=n?.enabled!==false&&!!n,C=i?.enabled!==false,u=n?.filters||{},v=!!(u.primaryDimension||u.secondaryDimension||u.status),p=i?.placeholder||"Ask AI to analyze data, create charts, or find insights...";Rt.useEffect(()=>{e&&l(i?.defaultPrompt||"");},[e,i?.defaultPrompt]);let h=i?.settings||{baseUrl:"/llm-api",apiKey:"",model:"doubao-lite",promptLang:"zh",analysisPrompt:"",responsePrompt:""},y=async()=>{let S=d.trim();if(!(!S||!i?.onSubmit))try{g(!0),await i.onSubmit(S,{filters:u,model:o});}finally{g(false);}};return jsxRuntime.jsx(material.Dialog,{open:e,onClose:t,fullScreen:true,children:jsxRuntime.jsxs(material.Box,{sx:{height:"100%",display:"flex",flexDirection:"column",bgcolor:"background.default"},children:[jsxRuntime.jsx(material.Box,{sx:{p:2,borderBottom:1,borderColor:"divider"},children:jsxRuntime.jsxs(material.Stack,{direction:{xs:"column",lg:"row"},alignItems:{xs:"stretch",lg:"center"},justifyContent:"space-between",spacing:1.5,children:[jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1.25,alignItems:"center",sx:{flexWrap:"wrap"},children:[jsxRuntime.jsx(material.Typography,{variant:"h5",fontWeight:800,children:o.title}),jsxRuntime.jsx(material.Chip,{size:"small",label:c("graph.records",{count:o.kpis.totalRecords})}),b&&u.primaryDimension&&jsxRuntime.jsx(material.Chip,{size:"small",variant:"outlined",label:`${n?.fieldMapping.primaryDimension}: ${u.primaryDimension}`,onDelete:()=>n?.onClearFilter("primaryDimension")}),b&&u.secondaryDimension&&jsxRuntime.jsx(material.Chip,{size:"small",variant:"outlined",label:`${n?.fieldMapping.secondaryDimension}: ${u.secondaryDimension}`,onDelete:()=>n?.onClearFilter("secondaryDimension")}),b&&u.status&&jsxRuntime.jsx(material.Chip,{size:"small",variant:"outlined",label:`${n?.fieldMapping.status}: ${u.status}`,onDelete:()=>n?.onClearFilter("status")}),b&&v&&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:[C&&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(vy__default.default,{sx:{fontSize:18,color:"text.secondary"}})}),jsxRuntime.jsx(material.InputBase,{fullWidth:true,value:d,onChange:S=>l(S.target.value),onKeyDown:S=>{S.key==="Enter"&&(S.preventDefault(),y());},placeholder:p,sx:{fontSize:"0.9rem"}}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:y,disabled:s||!d.trim(),children:jsxRuntime.jsx(ky__default.default,{sx:{fontSize:18}})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>m(true),children:jsxRuntime.jsx(Cy__default.default,{sx:{fontSize:18}})})]}),jsxRuntime.jsx(material.IconButton,{onClick:t,children:jsxRuntime.jsx(Ph__default.default,{})})]})]})}),jsxRuntime.jsxs(material.Box,{sx:{p:2,display:"flex",flexDirection:"column",gap:1.5,overflow:"auto",minHeight:0},children:[jsxRuntime.jsx(Su,{kpis:o.kpis}),jsxRuntime.jsx(Wu,{billableByPrimary:o.charts.billableByPrimary,efficiencyBySecondary:o.charts.efficiencyBySecondary,statusDistribution:o.charts.statusDistribution,interaction:b?{filters:u,onPrimaryDimensionClick:S=>n?.onPrimaryDimensionClick(S),onSecondaryDimensionClick:S=>n?.onSecondaryDimensionClick(S),onStatusClick:S=>n?.onStatusClick(S)}:void 0}),a,r]}),jsxRuntime.jsx(Uu,{open:f,onClose:()=>m(false),value:h,onSaveAll:i?.onSaveAll,modelOptions:i?.modelOptions,promptLangOptions:i?.promptLangOptions,analysisTemplateOptions:i?.analysisTemplateOptions,responseTemplateOptions:i?.responseTemplateOptions,defaultAnalysisTemplateId:i?.defaultAnalysisTemplateId,defaultResponseTemplateId:i?.defaultResponseTemplateId})]})})};var _r={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"]},wy=5,Ku=e=>e.toLowerCase().replace(/[\s_-]/g,""),jr=(e,t,o,r)=>{if(t)return t;if(e.length===0)return r;let a=Object.keys(e[0]),n=new Map(a.map(i=>[Ku(i),i]));for(let i of o){let c=n.get(Ku(i));if(c)return c}return a[0]||r},Ro=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},Yt=(e,t)=>e==null||e===""?t:String(e),Ty=(e,t,o,r,a)=>{let n=new Map;return e.forEach(i=>{let c=Yt(i[t],a);n.set(c,(n.get(c)||0)+Ro(i[o]));}),Array.from(n.entries()).map(([i,c])=>({name:i,value:c})).sort((i,c)=>c.value-i.value).slice(0,r)},Iy=(e,t,o,r,a,n)=>{let i=new Map;return e.forEach(c=>{let d=Yt(c[t],n),l=i.get(d)||{report:0,billable:0};l.report+=Ro(c[o]),l.billable+=Ro(c[r]),i.set(d,l);}),Array.from(i.entries()).map(([c,d])=>({name:c,value:d.report>0?d.billable/d.report*100:0})).sort((c,d)=>c.value-d.value).slice(0,a)},Py=(e,t,o)=>{let r=e.length;if(r===0)return [];let a=new Map;return e.forEach(n=>{let i=Yt(n[t],o);a.set(i,(a.get(i)||0)+1);}),Array.from(a.entries()).map(([n,i])=>({name:n,value:i,percent:i/r*100}))},qu=(e,t,o)=>{let r=new Map;return e.forEach(a=>{let n=Yt(a[t],"N/A");r.set(n,(r.get(n)||0)+Ro(a[o]));}),Array.from(r.entries()).sort(([a],[n])=>a.localeCompare(n)).map(([a,n])=>({name:a,value:n}))},Ry=(e,t,o,r,a,n)=>{let i=new Map;return e.forEach(c=>{let d=Yt(c[t],n),l=i.get(d)||{report:0,billable:0};l.report+=Ro(c[o]),l.billable+=Ro(c[r]),i.set(d,l);}),Array.from(i.entries()).map(([c,d])=>({name:c,barValue:d.billable,lineValue:d.report>0?d.billable/d.report*100:0})).sort((c,d)=>d.barValue-c.barValue).slice(0,a)},Dy=(e,t,o,r,a)=>{let n=new Map;return e.forEach(i=>{let c=Yt(i[t],a),d=Yt(i[o],a),l=`${c}__${d}`;n.set(l,(n.get(l)||0)+Ro(i[r]));}),Array.from(n.entries()).map(([i,c])=>{let[d,l]=i.split("__");return {x:d,y:l,value:c}})},My=(e,t,o)=>{let r=qu(e,t,o),a=r.map(i=>({name:i.name,value:i.value,type:"delta"})),n=r.reduce((i,c)=>i+c.value,0);return [...a,{name:"Total",value:n,type:"total"}]},Ay=(e,t,o,r,a,n)=>{let i=new Map;return e.forEach(c=>{let d=Yt(c[t],n),l=`${Yt(c[o],n)} / ${Yt(c[r],n)}`,s=i.get(d)||new Map;s.set(l,(s.get(l)||0)+1),i.set(d,s);}),Array.from(i.entries()).map(([c,d])=>({title:c,causes:Array.from(d.entries()).sort((l,s)=>s[1]-l[1]).slice(0,a).map(([l,s])=>`${l} (${s})`)})).slice(0,6)},rn=({rows:e,config:t})=>{let{t:o}=te(),r=o("graph.unassigned"),a=Rt.useMemo(()=>{let s=t?.fieldMapping;return {primaryDimension:jr(e,s?.primaryDimension,_r.primaryDimension,"Category"),secondaryDimension:jr(e,s?.secondaryDimension,_r.secondaryDimension,"Owner"),status:jr(e,s?.status,_r.status,"Status"),date:jr(e,s?.date,_r.date,"Date"),description:jr(e,s?.description,_r.description,"Description"),reportHours:jr(e,s?.reportHours,_r.reportHours,"ReportHours"),billableHours:jr(e,s?.billableHours,_r.billableHours,"BillableHours"),amount:jr(e,s?.amount,_r.amount,"Amount")}},[e,t?.fieldMapping]),n=Rt.useMemo(()=>e.map((s,g)=>{let f=Ro(s[a.reportHours]),m=Ro(s[a.billableHours]),b=Ro(s[a.amount]),C=f>0?m/f*100:0;return {id:`graph-row-${g}`,Date:Yt(s[a.date],""),Primary:Yt(s[a.primaryDimension],r),Secondary:Yt(s[a.secondaryDimension],r),Description:Yt(s[a.description],""),ReportHours:f,BillableHours:m,Amount:b,Efficiency:C,Status:Yt(s[a.status],r)}}),[e,a,r]),i=Rt.useMemo(()=>{let s=n.length,g=n.reduce((v,p)=>v+Ro(p.ReportHours),0),f=n.reduce((v,p)=>v+Ro(p.BillableHours),0),m=n.reduce((v,p)=>v+Ro(p.Amount),0),b=g>0?f/g*100:0,C=t?.statusFlagValues||["flag","flagged","warning","risk"],u=n.filter(v=>C.includes(Yt(v.Status,"").toLowerCase())).length;return {totalRecords:s,totalReportHours:g,totalBillableHours:f,efficiency:b,totalAmount:m,flaggedCount:u}},[n,t?.statusFlagValues]),c=t?.topN||wy,d=Rt.useMemo(()=>({billableByPrimary:Ty(n,"Primary","BillableHours",c,r),efficiencyBySecondary:Iy(n,"Secondary","ReportHours","BillableHours",c,r),statusDistribution:Py(n,"Status",r),lineByDate:qu(n,"Date","BillableHours"),comboByPrimary:Ry(n,"Primary","ReportHours","BillableHours",c,r),heatmapPrimarySecondary:Dy(n,"Primary","Secondary","BillableHours",r),waterfallBillable:My(n,"Date","BillableHours"),fishboneStatusCauses:Ay(n,"Status","Primary","Secondary",3,r)}),[n,c,r]),l=Rt.useMemo(()=>({title:t?.title||o("graph.reportTitle"),kpis:i,charts:d,table:{columns:[{id:"Date",label:a.date},{id:"Primary",label:a.primaryDimension},{id:"Secondary",label:a.secondaryDimension},{id:"Description",label:a.description},{id:"ReportHours",label:o("graph.column.reportHours"),align:"right"},{id:"BillableHours",label:o("graph.column.billableHours"),align:"right"},{id:"Amount",label:"Amount",align:"right"},{id:"Efficiency",label:"Efficiency",align:"right"},{id:"Status",label:a.status}],rows:n}}),[d,t?.title,a,i,n,o]);return {fieldMapping:a,model:l}};var an=e=>String(e??"").trim(),ll=(e={})=>{let[t,o]=Rt.useState(e),r=Rt.useCallback((d,l)=>{o(s=>{let g=l?.trim();if(!g){let f={...s};return delete f[d],f}if(s[d]===g){let f={...s};return delete f[d],f}return {...s,[d]:g}});},[]),a=Rt.useCallback(d=>{o(l=>{if(!l[d])return l;let s={...l};return delete s[d],s});},[]),n=Rt.useCallback(()=>{o({});},[]),i=Rt.useMemo(()=>!!(t.primaryDimension||t.secondaryDimension||t.status),[t]),c=Rt.useCallback((d,l)=>d.filter(s=>!(t.primaryDimension&&an(s[l.primaryDimension])!==an(t.primaryDimension)||t.secondaryDimension&&an(s[l.secondaryDimension])!==an(t.secondaryDimension)||t.status&&an(s[l.status])!==an(t.status))),[t]);return {filters:t,setFilter:r,clearFilter:a,clearAll:n,hasActiveFilters:i,applyRows:c}};var cl=({variants:e,currentVariantId:t,onLoad:o,onSave:r,onDelete:a,onSetDefault:n})=>{let{t:i}=te(),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]=Rt.useState(false),[m,b]=Rt.useState(""),[C,u]=Rt.useState(false),[v,p]=Rt.useState(false),h=e.find(E=>E.id===t),y=()=>{b(h?.name||i("variant.newVariant")),u(h?.isDefault||false),p(h?.isPublic||false),f(true);},S=()=>{r({name:m,isDefault:C,isPublic:v,description:""}),f(false);};return jsxRuntime.jsxs(material.Box,{sx:{display:"flex",gap:1,alignItems:"center",width:"100%",maxWidth:"100%"},children:[jsxRuntime.jsx(material.Autocomplete,{size:"small",sx:{width:s,"& .MuiInputBase-root":{fontSize:l,bgcolor:d?"rgba(25, 118, 210, 0.2)":"#e7f1ff","& .MuiOutlinedInput-notchedOutline":{borderColor:d?"rgba(144,202,249,0.45)":"rgba(25,118,210,0.45)"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:d?"rgba(144,202,249,0.7)":"rgba(25,118,210,0.65)"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:d?"rgba(144,202,249,0.9)":"rgba(25,118,210,0.85)"}},"& .MuiInputBase-input":{fontSize:l},"& .MuiAutocomplete-noOptions":{fontSize:l}},noOptionsText:jsxRuntime.jsx(material.Typography,{sx:{fontSize:l},children:i("variant.noOptions")}),options:e,getOptionLabel:E=>E.name+(E.isDefault?` (${i("variant.defaultSuffix")})`:""),value:h||null,onChange:(E,P)=>{P&&o(P);},renderInput:E=>jsxRuntime.jsx(material.TextField,{...E,variant:"outlined",size:"small",InputProps:{...E.InputProps,sx:{fontSize:l,color:d?"#E3F2FD":"#0D47A1"}},placeholder:i("variant.selectVariant")}),renderOption:(E,P)=>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:P.name}),P.isDefault&&jsxRuntime.jsx(Gy__default.default,{fontSize:"small",color:"action"})]})})}),jsxRuntime.jsx(material.Tooltip,{title:i("variant.saveView"),children:jsxRuntime.jsx(material.IconButton,{onClick:y,size:"small",color:"primary",children:jsxRuntime.jsx(gp__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:m,onChange:E=>b(E.target.value)}),jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{checked:C,onChange:E=>u(E.target.checked)}),label:i("variant.setDefault")}),jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{checked:v,onChange:E=>p(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:S,variant:"contained",children:i("common.save")})]})]})]})};var ep=({appId:e,tableKey:t="default",currentFilters:o,currentLayoutId:r,layoutRefs:a,onLoad:n,variantService:i,serviceUrl:c,onError:d,onSuccess:l,currentVariantId:s,onVariantChange:g})=>{let{t:f}=te(),[m,b]=Rt.useState([]),[C,u]=Rt.useState(""),v=`orbcafe.variants.${e}.${t}`,p=s!==void 0?s:C,h=A=>{s===void 0&&u(A),g&&g(A);},y=Rt.useCallback(()=>{try{let A=localStorage.getItem(v);if(!A)return [];let M=JSON.parse(A);return Array.isArray(M)?M:[]}catch{return []}},[v]),S=Rt.useCallback(A=>{try{localStorage.setItem(v,JSON.stringify(A));}catch{}},[v]),E=Rt.useCallback(A=>{b(A);let M=A.find(D=>D.isDefault);M&&!p&&(h(M.id),n(M));},[p,n,h]),P=Rt.useCallback(async()=>{if(!e)return [];try{let A=[];if(i)A=await i.getVariants(e,t);else if(c){let M=await fetch(`${c}/api/variants?appId=${encodeURIComponent(e)}&tableKey=${encodeURIComponent(t)}`);if(!M.ok)throw new Error(f("variant.toast.fetchFailed"));A=await M.json();}else A=y();return E(A),A}catch(A){console.error("Error fetching variants",A);let M=y();return E(M),d&&d(f("variant.toast.fetchFailed")),M}},[e,t,i,c,y,E,d,f]);return Rt.useEffect(()=>{P();},[e,t]),jsxRuntime.jsx(cl,{variants:m,currentVariantId:p,onLoad:A=>{h(A.id),n(A);},onSave:async A=>{let M=Date.now().toString(),D;try{let B=A.scope||"Both",j=m.find(le=>le.name===A.name);M=j?j.id:Date.now().toString();let W=[];if(j&&(Array.isArray(j.filters)?W=[...j.filters]:j.filters&&(W=[{scope:"default",filters:j.filters}])),B==="Search"||B==="Both"){let le=(Array.isArray(o),o);if(le)if(Array.isArray(le)&&le.length>0&&le[0].scope)le.forEach(_=>{let U=W.findIndex(ge=>ge.scope===_.scope);U>=0?W[U]=_:W.push(_);});else {let _={scope:t,filters:le},U=W.findIndex(ge=>ge.scope===t);U>=0?W[U]=_:W.push(_);}}let q=j?.layout||{},ee=[];if(j&&Array.isArray(j.layoutRefs)&&(ee=[...j.layoutRefs]),B==="Layout"||B==="Both")if(a&&a.length>0)a.forEach(le=>{let _=ee.findIndex(U=>U.tableKey===le.tableKey);_>=0?ee[_]=le:ee.push(le);});else {let le={tableKey:t,layoutId:r||null},_=ee.findIndex(U=>U.tableKey===t);_>=0?ee[_]=le:ee.push(le);}if(D={appId:e,tableKey:t,...A,scope:B,id:M,createdAt:new Date().toISOString(),filters:W,layout:q,layoutRefs:ee},i)await i.saveVariant(D,e,t);else if(c){if(!(await fetch(`${c}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(D)})).ok)throw new Error(f("variant.toast.saveFailed"))}else {let _=m.some(U=>U.id===M)?m.map(U=>U.id===M?D:U):[...m,D];b(_),S(_);}l&&l(f("variant.toast.saveSuccess")),(i||c)&&await P(),h(M),n(D);}catch(B){console.error("Error saving variant",B);let W=m.some(q=>q.id===M)?m.map(q=>q.id===M?D:q):[...m,D];b(W),S(W),h(M),n(D),d&&d(f("variant.toast.saveFailed"));}},onDelete:async A=>{try{if(i)await i.deleteVariant(A);else if(c){if(!(await fetch(`${c}/api/variants/${A}`,{method:"DELETE"})).ok)throw new Error(f("variant.toast.deleteFailed"))}else {let M=m.filter(D=>D.id!==A);b(M),S(M);}p===A&&h(""),(i||c)&&P(),l&&l(f("variant.toast.deleteSuccess"));}catch(M){console.error("Error deleting variant",M);let D=m.filter(B=>B.id!==A);b(D),S(D),p===A&&h(""),d&&d(f("variant.toast.deleteFailed"));}},onSetDefault:async A=>{try{let M=m.find(B=>B.id===A);if(!M)return;let D={appId:e,tableKey:t,...M,isDefault:!0};if(i)await i.setDefaultVariant(A,e,t);else if(c){if(!(await fetch(`${c}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(D)})).ok)throw new Error(f("variant.toast.defaultFailed"))}else {let B=m.map(j=>({...j,isDefault:j.id===A}));b(B),S(B);}(i||c)&&await P(),l&&l(f("variant.toast.defaultSuccess"));}catch(M){console.error("Error setting default variant",M);let D=m.map(B=>({...B,isDefault:B.id===A}));b(D),S(D),d&&d(f("variant.toast.defaultFailed"));}}})};mr__default.default.extend(nx__default.default);mr__default.default.extend(ix__default.default);mr__default.default.extend(lx__default.default);var Jn="YYYY-MM-DD",sx=[null,null],ba="0.85rem",cx={en:"en",zh:"zh-cn",fr:"fr",de:"de",ja:"ja",ko:"ko"},dx=material.styled(PickersDay.PickersDay,{shouldForwardProp:e=>e!=="isInRange"&&e!=="isStart"&&e!=="isEnd"&&e!=="isHovered"})(({theme:e,isInRange:t,isStart:o,isEnd:r,isHovered:a})=>({...t&&{borderRadius:0,backgroundColor:e.palette.primary.light,color:e.palette.primary.contrastText,"&:hover":{backgroundColor:e.palette.primary.main}},...a&&!t&&!o&&!r&&{borderRadius:0,backgroundColor:e.palette.action.hover,border:`1px dashed ${e.palette.primary.main}`},...o&&{borderRadius:"50% 0 0 50%",backgroundColor:e.palette.primary.main,color:e.palette.primary.contrastText,"&:hover":{backgroundColor:e.palette.primary.dark}},...r&&{borderRadius:"0 50% 50% 0",backgroundColor:e.palette.primary.main,color:e.palette.primary.contrastText,"&:hover":{backgroundColor:e.palette.primary.dark}},...o&&r&&{borderRadius:"50%"}})),ap=({label:e,value:t=sx,onChange:o})=>{let{t:r,locale:a}=te(),n=cx[a]||"en",i=e||r("dateRange.label"),[c,d]=Rt.useState(null),[l,s]=Rt.useState(t),[g,f]=Rt.useState("start"),[m,b]=Rt.useState(null),[C,u]=Rt.useState((t[0]||mr__default.default()).locale(n)),[v,p]=Rt.useState(""),[h,y]=Rt.useState(""),[S,E]=Rt.useState(false),[P,k]=Rt.useState(false),R=Rt__namespace.default.useRef(t);Rt.useEffect(()=>{let[_,U]=t,[ge,Me]=R.current,Ee=Be=>Be&&typeof Be.isSame=="function",ie=!(_===null&&ge===null||Ee(_)&&Ee(ge)&&_.isSame(ge,"day")),Re=!(U===null&&Me===null||Ee(U)&&Ee(Me)&&U.isSame(Me,"day"));(ie||Re)&&(s(t),t[0]&&Ee(t[0])&&u(t[0].locale(n))),R.current=t;},[t,n]),Rt.useEffect(()=>{p(l[0]?l[0].locale(n).format(Jn):""),y(l[1]?l[1].locale(n).format(Jn):""),E(false),k(false);},[l,n]);let I=(_,U)=>{let ge=U.trim(),Me=_==="start"?E:k;if(!ge){let Re=_==="start"?[null,l[1]]:[l[0],null];Me(false),s(Re);return}let Ee=mr__default.default(ge,Jn,true).locale(n);if(!Ee.isValid()){Me(true);return}Me(false);let ie=[...l];if(_==="start")ie[0]=Ee,ie[1]&&Ee.isAfter(ie[1],"day")&&(ie[1]=null),f(ie[1]?"start":"end");else {let Re=ie[0];Re&&Ee.isBefore(Re,"day")?(ie=[Ee,null],f("end")):(ie[1]=Ee,f("start"));}s(ie),u(Ee);},w=_=>{d(_.currentTarget);},A=()=>{d(null),f("start"),b(null);},M=!!c,D=_=>{if(!_)return;let U=[...l];if(g==="start")U=[_,null],f("end");else {let ge=U[0];ge&&_.isBefore(ge)?(U=[_,null],f("end")):(U=[ge,_],f("start"));}s(U);},B=_=>{let U=mr__default.default().locale(n),ge=[null,null];switch(_){case "today":ge=[U,U];break;case "week":ge=[U.startOf("week"),U.endOf("week")];break;case "month":ge=[U.startOf("month"),U.endOf("month")];break}s(ge),f("start"),u(U);},j=()=>{s([null,null]),f("start"),u(mr__default.default().locale(n));},W=()=>{o&&o(l),A();},q=()=>{s(t),f("start"),A();},ee=Rt.useCallback(_=>{let{day:U,...ge}=_,[Me,Ee]=l,ie=Me?U.isSame(Me,"day"):false,Re=Ee?U.isSame(Ee,"day"):false,Be=Me&&Ee?U.isBetween(Me,Ee,"day","()"):false,lt=false;return g==="end"&&Me&&!Ee&&m&&U.isAfter(Me,"day")&&U.isBefore(m.add(1,"day"),"day")&&(lt=true),jsxRuntime.jsx(dx,{...ge,day:U,disableMargin:true,isStart:ie,isEnd:Re,isInRange:Be||lt,onMouseEnter:()=>b(U)})},[l,g,m]),le=_=>_?_.locale(n).format("YYYY-MM-DD"):"";return jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsx(material.TextField,{label:i,value:l[0]?`${le(l[0])} - ${le(l[1])}`:"",onClick:w,fullWidth:true,size:"small",InputLabelProps:{sx:{fontSize:ba}},InputProps:{readOnly:true,sx:{fontSize:ba,"& .MuiOutlinedInput-input":{fontSize:ba},paddingRight:"4px"},endAdornment:jsxRuntime.jsxs(material.InputAdornment,{position:"end",sx:{ml:0},children:[(l[0]||l[1])&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:_=>{_.stopPropagation(),j();},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:w,sx:{padding:"2px"},children:jsxRuntime.jsx(ox__default.default,{sx:{fontSize:"1rem"},color:"action"})})]})}}),jsxRuntime.jsxs(material.Popover,{open:M,anchorEl:c,onClose:A,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{sx:{display:"flex",flexDirection:"column",p:0,width:320}}},children:[jsxRuntime.jsx(material.Box,{sx:{p:2,bgcolor:"background.default",borderBottom:1,borderColor:"divider"},children:jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:1.5,justifyContent:"space-between",children:[jsxRuntime.jsx(material.TextField,{label:r("dateRange.startDate"),placeholder:Jn,value:v,error:S,size:"small",onFocus:()=>f("start"),onChange:_=>{p(_.target.value),S&&E(false);},onBlur:()=>I("start",v),onKeyDown:_=>{_.key==="Enter"&&(_.preventDefault(),I("start",v));},sx:{flex:1,"& .MuiInputBase-input":{fontSize:ba,py:.75},"& .MuiInputLabel-root":{fontSize:ba}}}),jsxRuntime.jsx(ax__default.default,{color:"action",fontSize:"small"}),jsxRuntime.jsx(material.TextField,{label:r("dateRange.endDate"),placeholder:Jn,value:h,error:P,size:"small",onFocus:()=>{l[0]&&f("end");},onChange:_=>{y(_.target.value),P&&k(false);},onBlur:()=>I("end",h),onKeyDown:_=>{_.key==="Enter"&&(_.preventDefault(),I("end",h));},sx:{flex:1,"& .MuiInputBase-input":{fontSize:ba,py:.75},"& .MuiInputLabel-root":{fontSize:ba}}})]})}),jsxRuntime.jsx(material.Box,{sx:{p:2,pb:0},children:jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,justifyContent:"center",children:[jsxRuntime.jsx(material.Chip,{label:r("dateRange.today"),onClick:()=>B("today"),clickable:true,size:"small",variant:"outlined"}),jsxRuntime.jsx(material.Chip,{label:r("dateRange.thisWeek"),onClick:()=>B("week"),clickable:true,size:"small",variant:"outlined"}),jsxRuntime.jsx(material.Chip,{label:r("dateRange.thisMonth"),onClick:()=>B("month"),clickable:true,size:"small",variant:"outlined"})]})}),jsxRuntime.jsx(LocalizationProvider.LocalizationProvider,{dateAdapter:AdapterDayjs.AdapterDayjs,adapterLocale:n,children:jsxRuntime.jsx(DateCalendar.DateCalendar,{value:null,referenceDate:C,onMonthChange:u,onYearChange:u,onChange:D,slots:{day:ee},views:["year","month","day"],openTo:"day",showDaysOutsideCurrentMonth:true,sx:{m:0}})}),jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsxs(material.Stack,{direction:"row",justifyContent:"flex-end",spacing:1,sx:{p:2},children:[jsxRuntime.jsx(material.Button,{size:"small",onClick:q,color:"inherit",children:r("common.cancel")}),jsxRuntime.jsx(material.Button,{size:"small",variant:"contained",onClick:W,children:r("common.done")})]})]})]})};var pl={equals:"=",contains:"\u2287",notContains:"\u2285",wildcard:"*","=":"=","!=":"!=",">":">","<":"<",">=":"\u2265","<=":"\u2264",between:"\u2194"},Cx={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"},kx=["equals","contains","notContains","wildcard"],lp=["=","!=",">","<",">=","<=","between"],Ct="0.85rem",Sx=({field:e,value:t,onChange:o})=>{let{t:r}=te(),[a,n]=Rt.useState(null),[i,c]=Rt.useState(null),[d,l]=Rt.useState(""),[s,g]=Rt.useState(""),[f,m]=Rt.useState(false),[b,C]=Rt.useState(""),[u,v]=Rt.useState("");Rt.useEffect(()=>{let w=setTimeout(()=>{v(b);},1e3);return ()=>clearTimeout(w)},[b]);let p=t?.operator||(e.type==="number"?"=":"equals"),h=t?.value,y=w=>{let A=Cx[w];return A?r(A):w},S=w=>{n(w.currentTarget);},E=w=>{o({...t,operator:w,value:h}),n(null);},P={size:"small",fullWidth:true,variant:"outlined",InputLabelProps:{sx:{fontSize:Ct}},InputProps:{sx:{fontSize:Ct}},SelectProps:{MenuProps:{PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:Ct,paddingTop:"4px",paddingBottom:"4px",minHeight:"auto"}}}}}},k=e.type||"text";if(k==="date"){let A=(M=>{if(!M)return [null,null];if(Array.isArray(M)&&M.length===2){let D=M[0]?mr__default.default.isDayjs(M[0])?M[0]:mr__default.default(M[0]):null,B=M[1]?mr__default.default.isDayjs(M[1])?M[1]:mr__default.default(M[1]):null;return [D,B]}return mr__default.default.isDayjs(M)||typeof M=="string"?[mr__default.default.isDayjs(M)?M:mr__default.default(M),null]:[null,null]})(h);return jsxRuntime.jsx(ap,{label:e.label,value:A,onChange:M=>o({value:M,operator:"between"})})}if(k==="number"&&p==="between"){let w=()=>{o({value:[d,s],operator:"between"}),c(null);},A=Array.isArray(h)?`${h[0]||""} - ${h[1]||""}`:"";return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.TextField,{...P,label:e.label,value:A,placeholder:r("smartFilter.minMaxPlaceholder"),InputProps:{...P.InputProps,startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(material.Tooltip,{title:y("between"),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:S,sx:{width:24,height:24,fontSize:Ct},children:pl.between})})}),readOnly:true},onClick:M=>c(M.currentTarget)}),jsxRuntime.jsx(material.Menu,{anchorEl:a,open:!!a,onClose:()=>n(null),PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:Ct,minHeight:"auto",py:.5}}},children:lp.map(M=>jsxRuntime.jsxs(material.MenuItem,{selected:M===p,onClick:()=>E(M),children:[jsxRuntime.jsx(material.Box,{sx:{width:24,display:"inline-block",fontWeight:"bold"},children:pl[M]}),jsxRuntime.jsx(material.ListItemText,{primary:y(M),primaryTypographyProps:{fontSize:Ct}})]},M))}),jsxRuntime.jsx(material.Popover,{open:!!i,anchorEl:i,onClose:()=>c(null),anchorOrigin:{vertical:"bottom",horizontal:"left"},children:jsxRuntime.jsxs(material.Box,{sx:{p:2,display:"flex",gap:1,alignItems:"center"},children:[jsxRuntime.jsx(material.TextField,{size:"small",label:r("smartFilter.min"),type:"number",value:d,onChange:M=>l(M.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:Ct}},InputProps:{sx:{fontSize:Ct}}}),jsxRuntime.jsx(vx__default.default,{color:"action"}),jsxRuntime.jsx(material.TextField,{size:"small",label:r("smartFilter.max"),type:"number",value:s,onChange:M=>g(M.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:Ct}},InputProps:{sx:{fontSize:Ct}}}),jsxRuntime.jsx(material.Button,{variant:"contained",size:"small",onClick:w,children:r("common.ok")})]})})]})}if(e.isValueHelp||k==="value-help"){let w=e.valueHelp?.mode||"single";return jsxRuntime.jsx(ru,{...P,...e.valueHelp,label:e.label,placeholder:e.placeholder||e.valueHelp?.placeholder,value:h??(w==="multiple"?[]:null),mode:w,onChange:A=>o({value:A,operator:w==="multiple"?"anyOf":"equals"})})}if(k==="select")return jsxRuntime.jsxs(material.TextField,{...P,select:true,label:e.label,value:h||"",onChange:w=>o({...t,value:w.target.value,operator:"equals"}),children:[jsxRuntime.jsx(material.MenuItem,{value:"",children:jsxRuntime.jsx("em",{children:r("common.none")})}),e.options?.map(w=>jsxRuntime.jsx(material.MenuItem,{value:w.value,children:w.label},w.value))]});if(k==="multi-select"){let w=Array.isArray(h)?h:[],A=e.options?.filter(M=>M.label.toLowerCase().includes(u.toLowerCase()))||[];return jsxRuntime.jsxs(material.TextField,{...P,select:true,label:e.label,value:w,onChange:M=>o({...t,value:M.target.value,operator:"anyOf"}),SelectProps:{...P.SelectProps,multiple:true,onClose:()=>{C(""),v("");},renderValue:M=>{if(!Array.isArray(M)||M.length===0)return jsxRuntime.jsx("em",{children:r("common.none")});let D=j=>e.options?.find(W=>W.value===j)?.label||j,B=M.map(D);return B.length>2?`${B.slice(0,2).join(", ")} +${B.length-2}`:B.join(", ")}},children:[jsxRuntime.jsx(material.ListSubheader,{children:jsxRuntime.jsx(material.TextField,{size:"small",autoFocus:true,placeholder:r("smartFilter.searchPlaceholder"),fullWidth:true,InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(Jd__default.default,{fontSize:"small"})}),sx:{fontSize:Ct}},value:b,onChange:M=>C(M.target.value),onKeyDown:M=>{M.key!=="Escape"&&M.stopPropagation();},onClick:M=>M.stopPropagation()})}),A.length>0?A.map(M=>jsxRuntime.jsxs(material.MenuItem,{value:M.value,children:[jsxRuntime.jsx(material.Checkbox,{checked:w.indexOf(M.value)>-1,size:"small"}),jsxRuntime.jsx(material.ListItemText,{primary:M.label,primaryTypographyProps:{fontSize:Ct}})]},M.value)):jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.ListItemText,{primary:r("smartFilter.noOptionsFound"),primaryTypographyProps:{fontSize:Ct}})})]})}let R=k==="number"?lp:kx,I=f||h!==void 0&&h!==""&&h!==null||!!a;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.TextField,{...P,label:e.label,sx:{minWidth:"120px"},value:h||"",type:k==="number"?"number":"text",onChange:w=>o({...t,value:w.target.value,operator:p}),onFocus:()=>m(true),onBlur:()=>m(false),InputProps:{...P.InputProps,startAdornment:I?jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(material.Tooltip,{title:y(p),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:S,onMouseDown:w=>w.preventDefault(),sx:{width:24,height:24,fontSize:Ct,fontWeight:"bold",color:"primary.main",bgcolor:"action.hover"},children:pl[p]})})}):null,endAdornment:e.hasSearchIcon?jsxRuntime.jsx(material.InputAdornment,{position:"end",children:jsxRuntime.jsx(Jd__default.default,{color:"action"})}):void 0}}),jsxRuntime.jsx(material.Menu,{anchorEl:a,open:!!a,onClose:()=>n(null),PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:Ct,minHeight:"auto",py:.5}}},children:R.map(w=>jsxRuntime.jsxs(material.MenuItem,{selected:w===p,onClick:()=>E(w),children:[jsxRuntime.jsx(material.Box,{sx:{width:24,display:"inline-block",fontWeight:"bold"},children:pl[w]}),jsxRuntime.jsx(material.ListItemText,{primary:y(w),primaryTypographyProps:{fontSize:Ct}})]},w))})]})},Cr=({fields:e,filters:t,onFilterChange:o,variants:r=[],currentVariantId:a,onVariantLoad:n,onVariantSave:i,onVariantDelete:c,onVariantSetDefault:d,onSearch:l,loading:s=false,appId:g,tableKey:f,currentLayout:m,currentLayoutId:b,layoutRefs:C,variantService:u,serviceUrl:v})=>{let{t:p}=te(),[h,y]=Rt.useState(true),[S,E]=Rt.useState(null),[P,k]=Rt.useState(e.filter(A=>!A.hidden).map(A=>A.id)),R=(A,M)=>{o({...t,[A]:M});},I=A=>{P.includes(A)?k(P.filter(M=>M!==A)):k([...P,A]);};return jsxRuntime.jsxs(material.Paper,{sx:{mb:0,display:"flex",flexDirection:"column",overflow:"visible",position:"relative"},children:[jsxRuntime.jsxs(material.Box,{sx:{p:2,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[g?jsxRuntime.jsx(ep,{appId:g,tableKey:f,currentFilters:{values:t,visibleFields:P},currentLayout:m,currentLayoutId:b,layoutRefs:C,onLoad:A=>{if(!A.filters)return;let M=null;if(Array.isArray(A.filters)){let D=f||"default",B=A.filters.find(j=>j.scope===D);M=B?B.filters:null;}else M=A.filters;M&&(M.values||M.visibleFields?(M.visibleFields&&Array.isArray(M.visibleFields)&&k(M.visibleFields),M.values&&o(M.values)):o(M)),n&&n(A);},variantService:u,serviceUrl:v,currentVariantId:a}):jsxRuntime.jsx(cl,{variants:r,currentVariantId:a,onLoad:n,onSave:A=>{i&&i({...A,filters:{values:t,visibleFields:P}});},onDelete:c,onSetDefault:d}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[jsxRuntime.jsx(material.Tooltip,{title:p("smartFilter.addFilters"),children:jsxRuntime.jsx(material.Button,{onClick:A=>E(A.currentTarget),size:"small",color:"primary",startIcon:jsxRuntime.jsx(bx__default.default,{fontSize:"small"}),sx:{textTransform:"none",fontSize:Ct,whiteSpace:"nowrap",minWidth:"fit-content"},children:p("smartFilter.adaptFilters")})}),jsxRuntime.jsx(material.Button,{variant:"contained",size:"small",onClick:l,disabled:s,sx:{minWidth:"52px",fontWeight:"bold",fontSize:Ct},children:p(s?"common.loading":"smartFilter.go")}),jsxRuntime.jsxs(material.Menu,{anchorEl:S,open:!!S,onClose:()=>E(null),slotProps:{paper:{style:{maxHeight:400,width:"25ch"},sx:{"& .MuiMenuItem-root":{fontSize:Ct,minHeight:32}}}},children:[jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.ListItemText,{primary:p("smartFilter.visibleFilters"),primaryTypographyProps:{fontSize:Ct}})}),jsxRuntime.jsx(material.Divider,{}),e.map(A=>jsxRuntime.jsxs(material.MenuItem,{onClick:()=>I(A.id),children:[jsxRuntime.jsx(material.Checkbox,{checked:P.includes(A.id),size:"small"}),jsxRuntime.jsx(material.ListItemText,{primary:A.label,primaryTypographyProps:{fontSize:Ct}})]},A.id))]})]})]}),jsxRuntime.jsx(material.Collapse,{in:h,children:jsxRuntime.jsx(material.Box,{sx:{px:2,pb:2},children:jsxRuntime.jsx(material.Grid,{container:true,spacing:2,columns:{xs:2,sm:3,md:4,lg:6},children:e.filter(A=>P.includes(A.id)).map(A=>jsxRuntime.jsx(material.Grid,{size:1,children:jsxRuntime.jsx(Sx,{field:A,value:t[A.id]||{value:"",operator:A.type==="number"?"=":"equals"},onChange:M=>R(A.id,M)})},A.id))})})}),jsxRuntime.jsx(material.Box,{sx:{position:"absolute",bottom:0,left:"50%",transform:"translate(-50%, 50%)",zIndex:10},children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>y(!h),sx:{bgcolor:"background.paper",boxShadow:2,border:"1px solid",borderColor:"divider",width:20,height:20,minHeight:0,p:0,"&:hover":{bgcolor:"background.paper"}},children:h?jsxRuntime.jsx(yx__default.default,{sx:{fontSize:16},color:"action"}):jsxRuntime.jsx(xb__default.default,{sx:{fontSize:16},color:"action"})})})]})};var fp=({layouts:e,currentLayoutId:t,onLoad:o,onSave:r,onDelete:a,onSetDefault:n})=>{let{t:i}=te(),[c,d]=Rt.useState(null),[l,s]=Rt.useState(false),[g,f]=Rt.useState(""),[m,b]=Rt.useState(""),[C,u]=Rt.useState({isDefault:false,isPublic:false}),v=e.find(P=>P.id===t),p=P=>{d(P.currentTarget);},h=()=>{d(null);},y=P=>{o(P),h();},S=()=>{f(""),b(""),u({isDefault:false,isPublic:false}),s(true),h();},E=()=>{g.trim()&&(r({name:g,description:m,...C}),s(false));};return jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[jsxRuntime.jsx(material.Tooltip,{title:i("layout.saveLayout"),children:jsxRuntime.jsx(material.IconButton,{onClick:S,color:"primary",size:"small",children:jsxRuntime.jsx(gp__default.default,{})})}),jsxRuntime.jsx(material.Tooltip,{title:i("layout.layoutOptions"),children:jsxRuntime.jsx(material.IconButton,{onClick:p,color:v?"primary":"default",children:jsxRuntime.jsx(Lx__default.default,{})})}),jsxRuntime.jsxs(material.Menu,{anchorEl:c,open:!!c,onClose:h,PaperProps:{sx:{width:320,maxHeight:400}},children:[jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.Typography,{variant:"caption",children:i("layout.selectLayout")})}),jsxRuntime.jsxs(material.MenuItem,{onClick:S,children:[jsxRuntime.jsx(material.ListItemIcon,{children:jsxRuntime.jsx(gp__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{children:i("layout.saveCurrentLayout")})]}),jsxRuntime.jsx(material.Divider,{}),e.length===0&&jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:i("layout.noSavedLayouts")})}),e.map((P,k)=>jsxRuntime.jsx(material.MenuItem,{onClick:()=>y(P),selected:P.id===t,children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",width:"100%",justifyContent:"space-between"},children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",overflow:"hidden",mr:1},children:[jsxRuntime.jsx(material.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:jsxRuntime.jsx(material.Typography,{variant:"body2",fontWeight:P.id===t?"bold":"normal",noWrap:true,children:P.name})}),P.description&&jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",noWrap:true,children:P.description})]}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center"},onClick:R=>R.stopPropagation(),children:[jsxRuntime.jsx(material.Tooltip,{title:P.isDefault?i("layout.removeDefault"):i("layout.setAsDefault"),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:R=>{R.stopPropagation(),n(P.id);},children:P.isDefault?jsxRuntime.jsx(Gy__default.default,{fontSize:"small",color:"warning"}):jsxRuntime.jsx(Fx__default.default,{fontSize:"small"})})}),jsxRuntime.jsx(material.Tooltip,{title:i("common.delete"),children:jsxRuntime.jsx(material.IconButton,{size:"small",color:"error",onClick:R=>{R.stopPropagation(),a(P.id);},children:jsxRuntime.jsx(Xh__default.default,{fontSize:"small"})})})]})]})},P.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:P=>f(P.target.value),fullWidth:true,autoFocus:true,size:"small",helperText:i("layout.layoutNameHelper")}),e.some(P=>P.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:m,onChange:P=>b(P.target.value),fullWidth:true,size:"small"}),jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{checked:C.isDefault,onChange:P=>u({...C,isDefault:P.target.checked})}),label:i("layout.useAsDefault")}),jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{checked:C.isPublic,onChange:P=>u({...C,isPublic:P.target.checked})}),label:i("layout.publicAllUsers")})]})}),jsxRuntime.jsxs(material.DialogActions,{children:[jsxRuntime.jsx(material.Button,{onClick:()=>s(false),children:i("common.cancel")}),jsxRuntime.jsx(material.Button,{onClick:E,variant:"contained",disabled:!g,children:i("common.save")})]})]})]})};var hl=({appId:e,tableKey:t="default",currentLayoutData:o,onLayoutLoad:r,targetLayoutId:a,activeLayoutId:n,serviceUrl:i,onError:c,onSuccess:d})=>{let{t:l}=te(),[s,g]=Rt.useState([]),[f,m]=Rt.useState(""),b=`orbcafe.layouts.${e}.${t}`,C=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??{}}),u=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}),v=Rt.useCallback(()=>{try{let k=localStorage.getItem(b);if(!k)return [];let R=JSON.parse(k);return Array.isArray(R)?R:[]}catch{return []}},[b]),p=Rt.useCallback(k=>{try{localStorage.setItem(b,JSON.stringify(k));}catch{}},[b]);Rt.useEffect(()=>{n!==void 0&&m(n);},[n]),Rt.useEffect(()=>{if(a&&s.length>0){let k=s.find(R=>R.id===a);k&&(m(k.id),r(k));}},[a,s,r]);let h=Rt.useCallback(async()=>{if(e){if(!i){let k=v();g(k);let R=k.find(I=>I.isDefault);R&&!f&&!a&&(m(R.id),r(R));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 I=(await k.json()).map(C);g(I);let w=I.find(A=>A.isDefault);w&&!f&&!a&&(m(w.id),r(w));}catch(k){console.error("Error fetching layouts",k);let R=v();g(R);let I=R.find(w=>w.isDefault);I&&!f&&!a&&(m(I.id),r(I)),c&&c(l("layout.toast.loadFallback"));}}},[e,t,i,c,f,r,a,v,l]);return Rt.useEffect(()=>{h();},[e,t]),jsxRuntime.jsx(fp,{layouts:s,currentLayoutId:f,onLoad:k=>{m(k.id),r(k);},onSave:async k=>{let R=s.find(A=>A.name===k.name),I=R?R.id:Date.now().toString(),w={id:I,...k,createdAt:new Date().toISOString(),layoutData:o,isDefault:k.isDefault??false,isPublic:k.isPublic??false};if(!i){let M=s.some(D=>D.id===I)?s.map(D=>D.id===I?w:D):[...s,w];g(M),p(M),m(I),r(w),d&&d(l("layout.toast.saveLocalSuccess"));return}try{if(!(await fetch(`${i}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(u(w))})).ok)throw new Error("LAYOUT_SAVE_FAILED");d&&d(l("layout.toast.saveSuccess")),await h(),m(I),r(w);}catch(A){console.error("Error saving layout",A);let D=s.some(B=>B.id===I)?s.map(B=>B.id===I?w:B):[...s,w];g(D),p(D),m(I),r(w),d&&d(l("layout.toast.saveLocalSuccess")),c&&c(l("layout.toast.backendUnavailableSavedLocal"));}},onDelete:async k=>{if(!i){let R=s.filter(I=>I.id!==k);g(R),p(R),f===k&&m(""),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&&m(""),d&&d(l("layout.toast.deleteSuccess")),await h();}catch(R){console.error("Error deleting layout",R);let I=s.filter(w=>w.id!==k);g(I),p(I),f===k&&m(""),d&&d(l("layout.toast.deleteLocalSuccess")),c&&c(l("layout.toast.backendUnavailableDeletedLocal"));}},onSetDefault:async k=>{if(!i){let R=s.map(I=>({...I,isDefault:I.id===k}));g(R),p(R),d&&d(l("layout.toast.defaultLocalSuccess"));return}try{let R=s.find(w=>w.id===k);if(!R)return;if(!(await fetch(`${i}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(u({...R,isDefault:!0}))})).ok)throw new Error("LAYOUT_DEFAULT_FAILED");d&&d(l("layout.toast.defaultSuccess")),await h();}catch(R){console.error("Error setting default",R);let I=s.map(w=>({...w,isDefault:w.id===k}));g(I),p(I),d&&d(l("layout.toast.defaultLocalSuccess")),c&&c(l("layout.toast.backendUnavailableDefaultLocal"));}}})};var bp=(e,t)=>{if(!e||!e.filters)return null;if(Array.isArray(e.filters)){let o=e.filters.find(a=>a.scope===t);if(o)return o.filters;let r=e.filters.find(a=>a.scope==="default");return r?r.filters:null}return typeof e.filters=="object"?e.filters:null},bl=(e,t)=>{if(!e)return {layout:null,layoutId:null};let o=null,r=null;if(Array.isArray(e.layoutRefs)){let a=e.layoutRefs.find(n=>n.tableKey===t);a&&(o=a.layoutId);}return !o&&e.layoutId&&(o=e.layoutId),e.layout&&typeof e.layout=="object"&&!Array.isArray(e.layout)&&(r=e.layout),{layoutId:o,layout:r}};function yp(e,t,o){return t[o]<e[o]?-1:t[o]>e[o]?1:0}function Nx(e,t){return e==="desc"?(o,r)=>yp(o,r,t):(o,r)=>-yp(o,r,t)}function Vx(e,t){let o=e.map((r,a)=>[r,a]);return o.sort((r,a)=>{let n=t(r[0],a[0]);return n!==0?n:r[1]-a[1]}),o.map(r=>r[0])}var cn=e=>{let t=Rt.useCallback(z=>{let O=String(z?.label??z?.id??"").length*9+64,ne=typeof z?.minWidth=="number"?z.minWidth:0;return Math.max(100,ne,O)},[]),o=Rt.useCallback(()=>(e.columns||[]).filter(z=>!!z?.numeric).map(z=>z.id),[e.columns]),[r,a]=Rt.useState(""),[n,i]=Rt.useState(e.order||"asc"),[c,d]=Rt.useState(e.orderBy||""),[l,s]=Rt.useState([]),[g,f]=Rt.useState(e.page||0),[m,b]=Rt.useState(e.rowsPerPage||20),[C,u]=Rt.useState(e.selected||[]),[v,p]=Rt.useState(e.columns?e.columns.map(z=>z.id):[]),[h,y]=Rt.useState(e.columns?e.columns.map(z=>z.id):[]),[S,E]=Rt.useState(e.showSummary||false),[P,k]=Rt.useState(()=>o()),[R,I]=Rt.useState([]),[w,A]=Rt.useState(new Set),[M,D]=Rt.useState(()=>{let z={};return (e.columns||[]).forEach(V=>{z[V.id]=t(V);}),z}),[B,j]=Rt.useState(null),[W,q]=Rt.useState(null),[ee,le]=Rt.useState(null),[_,U]=Rt.useState(null),[ge,Me]=Rt.useState(false),[Ee,ie]=Rt.useState(""),[Re,Be]=Rt.useState("");Rt.useEffect(()=>{e.layout&&fo(e.layout);},[e.layout]),Rt.useEffect(()=>{e.order!==void 0&&i(e.order),e.orderBy!==void 0&&d(e.orderBy);},[e.order,e.orderBy]),Rt.useEffect(()=>{e.selected!==void 0&&u(e.selected);},[e.selected]),Rt.useEffect(()=>{e.page!==void 0&&f(e.page);},[e.page]),Rt.useEffect(()=>{e.rowsPerPage!==void 0&&b(e.rowsPerPage);},[e.rowsPerPage]),Rt.useEffect(()=>{let z=o();k(V=>V.filter(ne=>z.includes(ne)));},[o]),Rt.useEffect(()=>{D(z=>{let V={...z};return (e.columns||[]).forEach(O=>{V[O.id]===void 0&&(V[O.id]=t(O));}),V});},[e.columns,t]),Rt.useEffect(()=>{y(z=>{let V=(e.columns||[]).map(N=>N.id),O=new Set(V),ne=z.filter(N=>O.has(N)),ce=new Set(ne),Se=V.filter(N=>!ce.has(N)),T=[...ne,...Se];return T.length===z.length&&T.every((N,K)=>N===z[K])?z:T});},[e.columns]);let lt=Rt.useMemo(()=>{let z=e.columns||[];if(h.length===0)return z;let V=new Map(z.map(ce=>[ce.id,ce])),O=[],ne=new Set;return h.forEach(ce=>{let Se=V.get(ce);Se&&(O.push(Se),ne.add(ce));}),z.forEach(ce=>{ne.has(ce.id)||O.push(ce);}),O},[e.columns,h]),Ze=Rt.useMemo(()=>{let z=e.rows||[];return r&&(z=z.filter(V=>Object.keys(V).some(O=>String(V[O]).toLowerCase().includes(r.toLowerCase())))),z},[e.rows,r]),Oe=Rt.useMemo(()=>{if(e.onSortChange)return Ze;if(l.length>0){let z=[...Ze];return z.sort((V,O)=>{for(let ne of l){let ce=V?.[ne.field],Se=O?.[ne.field];if(!(ce==null&&Se==null)){if(ce==null)return ne.direction==="asc"?-1:1;if(Se==null)return ne.direction==="asc"?1:-1;if(ce<Se)return ne.direction==="asc"?-1:1;if(ce>Se)return ne.direction==="asc"?1:-1}}return 0}),z}return c?Vx(Ze,Nx(n,c)):Ze},[Ze,n,c,l,e.onSortChange]),qe=Rt.useCallback(z=>{if(R.length===0)return z.map(Se=>({type:"row",data:Se,id:Se[e.rowKey||"id"]}));let V=[...z].sort((Se,T)=>{for(let N of R){if(Se[N]<T[N])return -1;if(Se[N]>T[N])return 1}return 0}),O=(Se,T=0)=>{if(T>=R.length)return Se;let N=R[T],K={},J=[];return Se.forEach(pe=>{let be=pe[N],xe=`${N}:${be}`;K[xe]||(K[xe]={key:xe,field:N,value:be,children:[],count:0,level:T},J.push(K[xe])),K[xe].children.push(pe),K[xe].count++;}),J.forEach(pe=>{pe.children&&(pe.children=O(pe.children,T+1));}),J},ne=O(V),ce=(Se,T="")=>{let N=[];return Se.forEach(K=>{if(K.children){let J=T?`${T}>${K.key}`:K.key,pe=w.has(J);N.push({type:"group",id:J,field:K.field,value:K.value,level:K.level,count:K.count,isExpanded:pe,childIds:(function be(xe){let fe=[];return xe.children.forEach(ze=>{ze.children?fe=fe.concat(be(ze)):fe.push(ze[e.rowKey||"id"]);}),fe})(K)}),pe&&(N=N.concat(ce(K.children,J)));}else N.push({type:"row",data:K,id:K[e.rowKey||"id"],level:R.length});}),N};return ce(ne)},[R,w,e.rowKey]),ot=Rt.useCallback(z=>{if(R.length===0)return [];let V=[...z].sort((ce,Se)=>{for(let T of R){if(ce[T]<Se[T])return -1;if(ce[T]>Se[T])return 1}return 0}),O=[],ne=(ce,Se,T)=>{if(Se>=R.length)return;let N=R[Se],K=new Map;ce.forEach(J=>{let pe=J[N],be=K.get(pe);be?be.push(J):K.set(pe,[J]);}),K.forEach((J,pe)=>{let be=`${N}:${pe}`,xe=T?`${T}>${be}`:be;O.push(xe),ne(J,Se+1,xe);});};return ne(V,0,""),O},[R]),Z=Rt.useMemo(()=>qe(Oe),[Oe,qe]),se=Rt.useMemo(()=>ot(Oe),[Oe,ot]),Ae=Rt.useMemo(()=>{let z=(e.rows||[]).length;return typeof e.count=="number"&&e.count>z},[e.count,e.rows]),He=Rt.useMemo(()=>Ae?Z:m>0?Z.slice(g*m,g*m+m):Z,[Z,g,m,Ae]),G=Rt.useMemo(()=>Ae&&typeof e.count=="number"?e.count:Z.length,[Z.length,Ae,e.count]),X=z=>{A(V=>{let O=new Set(V);return O.has(z)?O.delete(z):O.add(z),O});},Ie=z=>{let V=se.filter(O=>O===z||O.startsWith(`${z}>`));A(O=>{let ne=new Set(O);return V.forEach(ce=>ne.add(ce)),ne});},ke=z=>{A(V=>{let O=new Set(V);return Array.from(O).forEach(ne=>{(ne===z||ne.startsWith(`${z}>`))&&O.delete(ne);}),O});},Fe=z=>{if(!z){A(new Set);return}A(new Set(se));},rt=z=>{let V=se.filter(O=>O.startsWith(`${z}>`));return V.length===0?w.has(z):w.has(z)&&V.every(O=>w.has(O))},Xe=z=>{l.length>0&&s([]);let V=c===z&&n==="asc",O=c===z&&n==="desc";if(e.onSortChange){V?e.onSortChange(z,"desc"):O?e.onSortChange("","asc"):e.onSortChange(z,"asc");return}V?(i("desc"),d(z)):O?(i("asc"),d("")):(i("asc"),d(z));},eo=z=>{let V=z.filter(O=>O&&O.field);s(V),V.length>0&&d("");},Zt=()=>{s([]);},Tt=(z,V)=>{D(O=>({...O,[z]:V}));},po=z=>{if(z.target.checked){let V=Ze.map(O=>O[e.rowKey||"id"]);u(V),e.onSelectionChange&&e.onSelectionChange(V);return}u([]),e.onSelectionChange&&e.onSelectionChange([]);},Et=(z,V)=>{let O=V[e.rowKey||"id"],ne=C.indexOf(O),ce=[];ne===-1?ce=ce.concat(C,O):ne===0?ce=ce.concat(C.slice(1)):ne===C.length-1?ce=ce.concat(C.slice(0,-1)):ne>0&&(ce=ce.concat(C.slice(0,ne),C.slice(ne+1))),u(ce),e.onSelectionChange&&e.onSelectionChange(ce);},Ne=z=>{f(z),e.onPageChange&&e.onPageChange(z);},we=z=>{b(z),f(0),e.onPageChange&&e.onPageChange(0),e.onRowsPerPageChange&&e.onRowsPerPageChange(z);},yt=z=>{let V=v.indexOf(z),O=[...v];V===-1?O.push(z):O.splice(V,1),p(O);},_e=z=>{let V=R.indexOf(z),O=[...R];V===-1?O.push(z):O.splice(V,1),I(O);},Ft=z=>{o().includes(z)&&k(O=>O.includes(z)?O.filter(ne=>ne!==z):[...O,z]);},mo=(z,V)=>{!z||!V||z===V||y(O=>{let ne=O.indexOf(z),ce=O.indexOf(V);if(ne===-1||ce===-1)return O;let Se=[...O];return Se.splice(ne,1),Se.splice(ce,0,z),Se});},go=z=>{let V=z?.active?.id,O=z?.over?.id;typeof V=="string"&&typeof O=="string"&&mo(V,O);},Xt=z=>{e.onLayoutSave&&e.onLayoutSave({visibleColumns:v,columnOrder:h,order:n,orderBy:c,sortBy:l,grouping:R,columnWidths:M,showSummary:S,summaryColumns:P});},xt=z=>{let{layout:V,layoutId:O}=bl(z,e.tableKey||"default");O?(Be(O),ie(O)):(Be(""),ie("")),V&&(V.visibleColumns&&p(V.visibleColumns),Array.isArray(V.columnOrder)&&y(V.columnOrder),V.order&&i(V.order),V.orderBy&&d(V.orderBy),Array.isArray(V.sortBy)&&s(V.sortBy),V.grouping&&I(V.grouping),V.columnWidths&&D(V.columnWidths),V.showSummary!==void 0&&E(!!V.showSummary),Array.isArray(V.summaryColumns)&&k(V.summaryColumns));},fo=z=>{let V=z?.layoutData||z?.layout||z||{};V.visibleColumns&&p(V.visibleColumns),Array.isArray(V.columnOrder)&&y(V.columnOrder),V.order&&i(V.order),V.orderBy!==void 0&&d(V.orderBy),Array.isArray(V.sortBy)&&s(V.sortBy),V.grouping&&I(V.grouping),V.columnWidths&&D(V.columnWidths),V.showSummary!==void 0&&E(!!V.showSummary),Array.isArray(V.summaryColumns)&&k(V.summaryColumns),A(new Set),f(0),z?.id&&ie(z.id),Be("");};Rt.useEffect(()=>{e.layout&&xt({layout:e.layout});},[e.layout]);let ho=z=>{z.preventDefault(),U(_===null?{mouseX:z.clientX+2,mouseY:z.clientY-6}:null);},bo=()=>{U(null);},Uo=Rt.useMemo(()=>{if(!S)return {};let z={};e.columns.forEach(O=>{if(O.numeric&&P.includes(O.id)){let ne=Ze.reduce((ce,Se)=>{let T=parseFloat(Se[O.id]);return ce+(isNaN(T)?0:T)},0);z[O.id]=ne.toFixed(2);}else z[O.id]="";});let V=e.columns.find(O=>v.includes(O.id));return V&&!V.numeric&&(z[V.id]="Total"),z},[Ze,e.columns,S,P,v]),mt=()=>{if(!e.columns||!Ze)return;let z=e.columns.map(Se=>Se.label).join(","),V=Ze.map(Se=>e.columns.map(T=>{let N=Se[T.id];return `"${(N==null?"":String(N)).replace(/"/g,'""')}"`}).join(",")).join(`
184
- `),O=`data:text/csv;charset=utf-8,${z}
185
- ${V}`,ne=encodeURI(O),ce=document.createElement("a");ce.setAttribute("href",ne),ce.setAttribute("download",`${e.title||"export"}.csv`),document.body.appendChild(ce),ce.click(),document.body.removeChild(ce);},to=()=>{Me(true);},vt=()=>{Me(false);};return {isMobile:false,columns:lt,order:n,setOrder:i,orderBy:c,setOrderBy:d,sortBy:l,setSortBy:s,applyMultiSort:eo,clearMultiSort:Zt,columnOrder:h,setColumnOrder:y,filterText:r,setFilterText:a,visibleColumns:v,setVisibleColumns:p,showSummary:S,setShowSummary:E,summaryColumns:P,grouping:R,setGrouping:I,expandedGroups:w,setExpandedGroups:A,groupAnchorEl:W,setGroupAnchorEl:q,summaryAnchorEl:ee,setSummaryAnchorEl:le,columnWidths:M,setColumnWidths:D,anchorEl:B,setAnchorEl:j,contextMenu:_,setContextMenu:U,sensors:void 0,sortedAndFilteredRows:Oe,visibleRows:He,summaryRow:Uo,page:g,setPage:Ne,rowsPerPage:m,setRowsPerPage:we,totalDisplayCount:G,selected:C,setSelected:u,isAllExpanded:se.length>0&&se.every(z=>w.has(z)),handleColumnResize:Tt,handleRequestSort:Xe,handleSelectAllClick:po,handleClick:Et,toggleSummaryColumn:Ft,handleDragEnd:go,handleColumnReorder:mo,handleExport:mt,handleContextMenu:ho,handleCloseContextMenu:bo,toggleColumnVisibility:yt,toggleGroupExpand:X,toggleGroupField:_e,handleToggleAll:Fe,handleExpandGroupRecursively:Ie,handleCollapseGroupRecursively:ke,isGroupFullyExpanded:rt,handleLayoutLoad:fo,handleVariantLoad:xt,handleLayoutSave:Xt,effectiveAppId:e.appId||"",currentLayoutData:{visibleColumns:v,order:n,orderBy:c,sortBy:l,columnOrder:h,grouping:R,columnWidths:M,showSummary:S,summaryColumns:P},currentLayoutId:Ee,layoutIdToLoad:Re,onPageChange:Ne,onRowsPerPageChange:we,graphReportOpen:ge,handleOpenGraphReport:to,handleCloseGraphReport:vt}};var KA=e=>jsxRuntime.jsx(Wx__default.default,{...e}),qA=e=>jsxRuntime.jsx(Gs__default.default,{...e}),_A=e=>jsxRuntime.jsx(Tp__default.default,{...e}),jA=e=>jsxRuntime.jsx(ob__default.default,{...e}),ZA=e=>jsxRuntime.jsx(rb__default.default,{...e}),Xr=e=>{let{t}=te(),o="0.85rem",{title:r,showToolbar:a=true,selectionMode:n,selected:i=[],onSelectionChange:c,actions:d,extraTools:l,fitContainer:s=false,fullWidth:g=false,maxHeight:f,loading:m=false,rowsPerPageOptions:b=[20,50,100,-1],onLayoutSave:C,filterConfig:u,rowKey:v,tableKey:p="default",graphReport:h,quickCreate:y,quickEdit:S,quickDelete:E,serviceUrl:P}=e,k=r||t("table.title.default"),{isMobile:R,columns:I,order:w,orderBy:A,filterText:M,setFilterText:D,visibleColumns:B,showSummary:j,setShowSummary:W,summaryColumns:q,grouping:ee,setGrouping:le,expandedGroups:_,groupAnchorEl:U,setGroupAnchorEl:ge,summaryAnchorEl:Me,setSummaryAnchorEl:Ee,columnWidths:ie,anchorEl:Re,setAnchorEl:Be,contextMenu:lt,sensors:Ze,sortedAndFilteredRows:Oe,summaryRow:qe,visibleRows:ot,isAllExpanded:Z,page:se,setPage:Ae,rowsPerPage:He,setRowsPerPage:G,totalDisplayCount:X,setSelected:Ie,handleColumnResize:ke,handleRequestSort:Fe,handleSelectAllClick:rt,handleClick:Xe,toggleSummaryColumn:eo,handleDragEnd:Zt,handleExport:Tt,handleContextMenu:po,handleCloseContextMenu:Et,toggleColumnVisibility:Ne,toggleGroupExpand:we,toggleGroupField:yt,handleToggleAll:_e,handleExpandGroupRecursively:Ft,handleCollapseGroupRecursively:mo,isGroupFullyExpanded:go,handleLayoutLoad:Xt,handleVariantLoad:xt,handleLayoutSave:fo,effectiveAppId:ho,currentLayoutData:bo,currentLayoutId:Uo,layoutIdToLoad:mt,graphReportOpen:to,handleOpenGraphReport:vt,handleCloseGraphReport:z}=cn(e),V=h?.enabled??false,O=V&&(h?.interaction?.enabled??true),ne=ll(),ce=!!y?.enabled,Se=!!S?.enabled,T=!!E?.enabled,N=y?.fields,K=y?.excludeFields||[],J=y?.initialValues||{},[pe,be]=Rt__namespace.default.useState(false),[xe,fe]=Rt__namespace.default.useState(false),[ze,We]=Rt__namespace.default.useState({}),[st,Ke]=Rt__namespace.default.useState(false),[Ve,Lt]=Rt__namespace.default.useState(false),[Ot,gt]=Rt__namespace.default.useState({}),[oo,ft]=Rt__namespace.default.useState(false),[ro,Ko]=Rt__namespace.default.useState(false),ao=m||xe||Ve||ro,gr=Rt__namespace.default.useMemo(()=>{let H=[...I];if(Array.isArray(N)&&N.length>0){let ae=new Set(N);H=H.filter(re=>ae.has(re.id));}if(K.length>0){let ae=new Set(K);H=H.filter(re=>!ae.has(re.id));}return H.filter(ae=>!!ae?.id)},[I,K,N]),Or=v||"id",no=Rt__namespace.default.useMemo(()=>{let H=new Set(i);return Oe.filter(ae=>H.has(ae?.[Or]))},[i,Oe,Or]),qo=no.length===1?no[0]:null,fr=S?.fields,zo=S?.excludeFields||[],ar=S?.editableFields||[],sa=S?.nonEditableFields||[],Oa=S?.primaryKeys?.length?S.primaryKeys:[Or],Hr=Rt__namespace.default.useMemo(()=>{let H=[...I];if(Array.isArray(fr)&&fr.length>0){let ae=new Set(fr);H=H.filter(re=>ae.has(re.id));}if(zo.length>0){let ae=new Set(zo);H=H.filter(re=>!ae.has(re.id));}return H.filter(ae=>!!ae?.id)},[I,zo,fr]),ca=Rt__namespace.default.useMemo(()=>new Set(Oa),[Oa]),hr=Rt__namespace.default.useMemo(()=>new Set(ar),[ar]),yo=Rt__namespace.default.useMemo(()=>new Set(sa),[sa]),_o=Rt__namespace.default.useCallback(H=>hr.size>0?hr.has(H):!(yo.has(H)||ca.has(H)),[hr,yo,ca]);Rt__namespace.default.useEffect(()=>{!to&&ne.hasActiveFilters&&ne.clearAll();},[to,ne.hasActiveFilters,ne.clearAll]);let Ha=()=>{let H={};gr.forEach(ae=>{H[ae.id]=J[ae.id]??"";}),We(H),be(true);},da=()=>{xe||be(false);},Wa=(H,ae)=>{We(re=>({...re,[H]:ae}));},$a=async()=>{if(!y?.onSubmit){be(false);return}try{fe(!0),await y.onSubmit(ze),be(!1);}finally{fe(false);}},Ga=()=>{if(!qo)return;let H={};Hr.forEach(re=>{H[re.id]=qo[re.id]??"";});let ae=S?.getInitialValues?{...H,...S.getInitialValues(qo)}:H;gt(ae),Ke(true);},wo=()=>{Ve||Ke(false);},Ua=(H,ae)=>{gt(re=>({...re,[H]:ae}));},Ka=async()=>{if(qo){if(!S?.onSubmit){Ke(false);return}try{Lt(!0),await S.onSubmit(Ot,qo),Ke(!1);}finally{Lt(false);}}},ua=()=>{no.length!==0&&ft(true);},br=()=>{ro||ft(false);},Wr=async()=>{if(no.length===0){ft(false);return}if(!E?.onConfirm){ft(false),Ie([]),c?.([]);return}try{Ko(!0),await E.onConfirm(no),ft(!1),Ie([]),c?.([]);}finally{Ko(false);}},$r=Oe,{fieldMapping:x}=rn({rows:$r,config:{...h,title:h?.title||`${k} ${t("graph.reportTitle")}`}}),F=Rt__namespace.default.useMemo(()=>O?ne.applyRows($r,x):$r,[O,ne.applyRows,$r,x]),{model:L}=rn({rows:F,config:{...h,title:h?.title||`${k} ${t("graph.reportTitle")}`,fieldMapping:x}}),Y=L.table.columns.map(H=>({id:H.id,label:H.label,align:H.align||"left",minWidth:120,numeric:H.align==="right"})),ue=ho?jsxRuntime.jsx(hl,{appId:ho,tableKey:p,currentLayoutData:bo,onLayoutLoad:Xt,targetLayoutId:mt,activeLayoutId:Uo,serviceUrl:P??u?.serviceUrl}):null,De=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(qa,{groupAnchorEl:U,setGroupAnchorEl:ge,grouping:ee,setGrouping:le,columns:I,toggleGroupField:yt}),jsxRuntime.jsx(_a,{anchorEl:Re,setAnchorEl:Be,columns:I,visibleColumns:B,toggleColumnVisibility:Ne}),jsxRuntime.jsx($i,{anchorEl:Me,setAnchorEl:Ee,showSummary:j,setShowSummary:W,columns:I,summaryColumns:q,toggleSummaryColumn:eo}),jsxRuntime.jsx(Gi,{contextMenu:lt,handleCloseContextMenu:Et,columns:I,visibleColumns:B,toggleColumnVisibility:Ne})]});return R?jsxRuntime.jsxs(oi__default.default,{sx:{display:"flex",flexDirection:"column",gap:2,height:"100%"},children:[u&&jsxRuntime.jsx(Cr,{fields:u.fields,filters:u.filters,onFilterChange:u.onFilterChange,onSearch:u.onSearch,variants:u.variants||[],currentVariantId:u.currentVariantId,onVariantLoad:u.onVariantLoad,onVariantSave:u.onVariantSave,onVariantDelete:u.onVariantDelete,onVariantSetDefault:u.onVariantSetDefault,appId:u.appId,tableKey:p,currentLayout:[{tableKey:p,layoutData:bo}],variantService:u.variantService,serviceUrl:P??u.serviceUrl}),jsxRuntime.jsx(uu,{title:k,loading:m,showSummary:j,setShowSummary:W,setAnchorEl:Be,setSummaryAnchorEl:Ee,filterText:M,setFilterText:D,sortedAndFilteredRows:Oe,selected:i,columns:I,visibleColumns:B,summaryRow:qe,handleClick:Xe,selectionMode:n}),De]}):jsxRuntime.jsxs(oi__default.default,{sx:{width:g?"100%":"auto",mb:s?0:2,...s?{flex:1,display:"flex",flexDirection:"column",minHeight:0,height:"100%",overflow:"hidden"}:{}},children:[u&&jsxRuntime.jsx(oi__default.default,{sx:{mb:2},children:jsxRuntime.jsx(Cr,{fields:u.fields,filters:u.filters,onFilterChange:u.onFilterChange,onSearch:u.onSearch,variants:u.variants||[],currentVariantId:u.currentVariantId,onVariantLoad:H=>{xt(H),u.onVariantLoad&&u.onVariantLoad(H);},onVariantSave:u.onVariantSave,onVariantDelete:u.onVariantDelete,onVariantSetDefault:u.onVariantSetDefault,loading:m,appId:u.appId,tableKey:p,currentLayout:[{tableKey:p,layoutData:bo}],currentLayoutId:Uo,layoutRefs:[{tableKey:p,layoutId:Uo}],variantService:u.variantService,serviceUrl:P??u.serviceUrl})}),jsxRuntime.jsxs(Ox__default.default,{sx:{width:g?"100%":"auto",mb:s?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative","&::before":ao?{content:'""',position:"absolute",top:0,left:0,width:"100%",height:"3px",background:"linear-gradient(90deg, rgba(25, 118, 210, 0) 0%, rgba(25, 118, 210, 0.25) 25%, rgba(25, 118, 210, 1) 50%, rgba(25, 118, 210, 0.25) 75%, rgba(25, 118, 210, 0) 100%)",backgroundSize:"220% 100%",animation:"cTableTopMarquee 1.2s linear infinite",zIndex:6,pointerEvents:"none"}:{},"@keyframes cTableTopMarquee":{"0%":{backgroundPosition:"220% 0"},"100%":{backgroundPosition:"-120% 0"}},...f?{height:f}:s?{flex:1,minHeight:0,height:"100%"}:{}},children:[a&&jsxRuntime.jsx(Ni,{filterText:M,setFilterText:D,onRowsPerPageChange:G,rowsPerPage:He,rowsPerPageOptions:b,page:se,count:X,onPageChange:Ae,actions:d,extraTools:l,grouping:ee,setGroupAnchorEl:ge,showSummary:j,setShowSummary:W,setAnchorEl:Be,setSummaryAnchorEl:Ee,handleExport:Tt,showCreateButton:ce,onOpenCreateDialog:Ha,showEditButton:Se,onOpenEditDialog:Ga,editDisabled:no.length!==1,showDeleteButton:T,onOpenDeleteConfirm:ua,deleteDisabled:no.length===0,onLayoutSave:C||u?.variantService&&u?.appId?fo:void 0,loading:m,layoutManager:ue,onOpenGraphReport:V?vt:void 0}),jsxRuntime.jsx(Tp__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:Ze,collisionDetection:core.closestCenter,onDragEnd:Zt,modifiers:[modifiers.restrictToHorizontalAxis],children:jsxRuntime.jsxs(Hx__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(Oi,{columns:I,visibleColumns:B,order:w,orderBy:A,onRequestSort:Fe,onContextMenu:po,selectionMode:n,grouping:ee,isAllExpanded:Z,handleToggleAll:_e,rowCount:Oe.length,numSelected:i.length,onSelectAllClick:rt,columnWidths:ie,onColumnResize:ke}),jsxRuntime.jsx(su,{visibleRows:ot,columns:I,visibleColumns:B,selectionMode:n,selected:i,orderBy:A,loading:m,expandedGroups:_,toggleGroupExpand:we,handleExpandGroupRecursively:Ft,handleCollapseGroupRecursively:mo,isGroupFullyExpanded:go,handleClick:Xe,onSelectionChange:c,grouping:ee,rowKeyProp:v,page:se,rowsPerPage:He}),j&&jsxRuntime.jsx(cu,{showSummary:j,columns:I,visibleColumns:B,summaryRow:qe,selectionMode:n?.toString(),grouping:ee,orderBy:A,zIndex:3})]})})})]}),ce&&jsxRuntime.jsxs(xp__default.default,{open:pe,onClose:da,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:H=>`1px solid ${H.palette.divider}`,bgcolor:"background.paper"}}},children:[jsxRuntime.jsx(vp__default.default,{sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:y?.title||t("quickCreate.createWithTitle",{title:k})}),jsxRuntime.jsx(Cp__default.default,{sx:{pt:"8px !important"},children:jsxRuntime.jsxs(oi__default.default,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[gr.map(H=>{let ae=H.type==="number"||H.numeric?"number":H.type==="date"?"date":"text",re=H.label||H.id;return jsxRuntime.jsx(Sp__default.default,{label:re,value:ze[H.id]??"",onChange:at=>Wa(H.id,at.target.value),type:ae,size:"small",fullWidth:true,InputLabelProps:{shrink:ae==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-create-${H.id}`)}),y?.description&&jsxRuntime.jsx(wp__default.default,{severity:"info",sx:{fontSize:"0.85rem","& .MuiAlert-message":{fontSize:"0.85rem"}},children:y.description})]})}),jsxRuntime.jsxs(kp__default.default,{sx:{px:3,pb:2},children:[jsxRuntime.jsx(xl__default.default,{onClick:da,sx:{fontSize:"0.85rem"},disabled:xe,children:y?.cancelLabel||t("common.cancel")}),jsxRuntime.jsx(xl__default.default,{onClick:$a,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:xe,children:y?.submitLabel||t("common.save")})]})]}),Se&&jsxRuntime.jsxs(xp__default.default,{open:st,onClose:wo,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:H=>`1px solid ${H.palette.divider}`,bgcolor:"background.paper"}}},children:[jsxRuntime.jsx(vp__default.default,{sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:S?.title||t("quickEdit.editWithTitle",{title:k})}),jsxRuntime.jsx(Cp__default.default,{sx:{pt:"8px !important"},children:jsxRuntime.jsxs(oi__default.default,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Hr.map(H=>{let ae=H.type==="number"||H.numeric?"number":H.type==="date"?"date":"text",re=H.label||H.id,at=_o(H.id);return jsxRuntime.jsx(Sp__default.default,{label:re,value:Ot[H.id]??"",onChange:$=>Ua(H.id,$.target.value),type:ae,size:"small",fullWidth:true,disabled:!at,InputLabelProps:{shrink:ae==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-edit-${H.id}`)}),S?.description&&jsxRuntime.jsx(wp__default.default,{severity:"info",sx:{fontSize:"0.85rem","& .MuiAlert-message":{fontSize:"0.85rem"}},children:S.description})]})}),jsxRuntime.jsxs(kp__default.default,{sx:{px:3,pb:2},children:[jsxRuntime.jsx(xl__default.default,{onClick:wo,sx:{fontSize:"0.85rem"},disabled:Ve,children:S?.cancelLabel||t("common.cancel")}),jsxRuntime.jsx(xl__default.default,{onClick:Ka,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:Ve||!qo,children:S?.submitLabel||t("common.save")})]})]}),T&&jsxRuntime.jsx(Nn,{open:oo,type:"warning",title:E?.title||t("quickDelete.confirmTitle"),message:E?.message||(no.length>1?t("quickDelete.confirmMessageMultiple",{count:no.length}):t("quickDelete.confirmMessageSingle")),confirmText:E?.confirmText||t("common.delete"),cancelText:E?.cancelText||t("common.cancel"),onClose:br,onConfirm:Wr}),De,V&&jsxRuntime.jsx(nl,{open:to,onClose:z,model:L,aiAssistant:h?.aiAssistant,interaction:O?{enabled:true,filters:ne.filters,fieldMapping:x,onPrimaryDimensionClick:H=>ne.setFilter("primaryDimension",H),onSecondaryDimensionClick:H=>ne.setFilter("secondaryDimension",H),onStatusClick:H=>ne.setFilter("status",H),onClearFilter:ne.clearFilter,onClearAll:ne.clearAll}:void 0,tableContent:jsxRuntime.jsx(Xr,{appId:ho||"graph-report-internal",title:t("graph.dataBody"),columns:Y,rows:L.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false}})})]})},XA=Xr;var r2=({id:e,title:t,hideHeader:o=true,filterConfig:r,tableProps:a,children:n,spacing:i=1,mode:c="separated"})=>{let d=r?{...r,appId:r.appId||e}:void 0,l={...a,appId:a.appId||e};return jsxRuntime.jsxs(au,{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(Cr,{...d})}),jsxRuntime.jsx(material.Box,{sx:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:jsxRuntime.jsx(Xr,{...l,fitContainer:true,filterConfig:c==="integrated"?d:void 0})})]}),n]})};var c2=({metadata:e,fetchData:t,initialRowsPerPage:o=20,rowsPerPageOptions:r=[20,50,100,-1],tableKey:a="default",mode:n="integrated",serviceUrl:i,variantService:c})=>{let{t:d}=te(),[l,s]=Rt.useState(false),[g,f]=Rt.useState([]),[m,b]=Rt.useState({}),[C,u]=Rt.useState(e.variants||[]),[v,p]=Rt.useState(e.layout||null),[h,y]=Rt.useState(""),[S,E]=Rt.useState(0),[P,k]=Rt.useState(0),[R,I]=Rt.useState(o),[w,A]=Rt.useState([]),[M,D]=Rt.useState("asc"),[B,j]=Rt.useState("");Rt.useEffect(()=>{let ie={};e.filters.forEach(Re=>{Re.defaultValue!==void 0&&(ie[Re.id]=Re.defaultValue);}),b(ie);},[e.filters]);let W=Rt.useCallback(async(ie,Re,Be,lt,Ze)=>{s(true);try{let Oe={...ie,page:Re+1,limit:Be,sort:Ze,order:lt},qe;t?qe=await t(Oe):typeof e.api=="function"?qe=await e.api(Oe):e.api&&typeof e.api=="object"?(console.log("Fetching from URL:",e.api.url,Oe),qe={rows:[],total:0}):(console.warn("No API configured for report"),qe={rows:[],total:0}),qe&&(f(qe.rows||[]),E(qe.total||0));}catch(Oe){console.error("Failed to fetch report data",Oe);}finally{s(false);}},[e.api,t]);Rt.useEffect(()=>{W(m,P,R,M,B);},[W,P,R,M,B]);let q=()=>{k(0),W(m,0,R,M,B);},ee=ie=>{k(0),I(ie);},le=(ie,Re)=>{D(Re),j(ie);},_=ie=>{b(ie);},U=ie=>{y(ie?.id||"");let Re=bp(ie,a);if(Re){let lt=Re.values??Re;b(lt),W(lt,0,R,M,B),k(0);}let{layout:Be}=bl(ie,a);Be&&p(Be);},ge=ie=>{let Re={...ie,id:Date.now().toString(),createdAt:new Date().toISOString()};u(Be=>[...Be,Re]);},Me=ie=>{p(ie);};return {pageProps:{id:e.id,title:e.title,mode:n,filterConfig:{appId:e.id,tableKey:a,fields:e.filters,filters:m,onFilterChange:_,onSearch:q,onVariantLoad:U,onVariantSave:ge,onVariantDelete:ie=>u(Re=>Re.filter(Be=>Be.id!==ie)),onVariantSetDefault:ie=>{u(Re=>Re.map(Be=>({...Be,isDefault:Be.id===ie})));},variants:C,currentVariantId:h,variantService:c,serviceUrl:i},tableProps:{appId:e.id,tableKey:a,columns:e.columns,rows:g,loading:l,rowKey:"id",count:S,page:P,rowsPerPage:R,rowsPerPageOptions:r,onPageChange:k,onRowsPerPageChange:ee,selectionMode:"multiple",selected:w,onSelectionChange:A,onLayoutSave:Me,layout:v,title:e.title,showSummary:true,order:M,orderBy:B,serviceUrl:i,onSortChange:le,graphReport:e.graphReport||{enabled:true,title:`${e.title} ${d("graph.reportTitle")}`}}},filters:m,rows:g,loading:l,refresh:q}};var Yx=e=>[...e].sort((t,o)=>o.value-t.value),p2=({bars:e=[],lines:t=[],combos:o=[],heatmap:r=[],pies:a=[],waterfalls:n=[]})=>{let i=Rt.useMemo(()=>Yx(e),[e]),c=Rt.useMemo(()=>[...t],[t]),d=Rt.useMemo(()=>[...o],[o]),l=Rt.useMemo(()=>[...r],[r]),s=Rt.useMemo(()=>{let f=a.reduce((m,b)=>m+b.value,0);return a.map(m=>({...m,percent:f>0?m.value/f*100:m.percent}))},[a]),g=Rt.useMemo(()=>[...n],[n]);return {bars:i,lines:c,combos:d,heatmap:l,pies:s,waterfalls:g}};var b2=({apiKey:e,query:t,zoom:o=14,mapType:r="roadmap"})=>Rt.useMemo(()=>!e||!t?"":Xn({apiKey:e,query:t,zoom:o,mapType:r}),[e,t,o,r]),y2=({keyword:e,location:t})=>Rt.useMemo(()=>el({keyword:e,location:t?{lng:t.lng,lat:t.lat,name:t.name}:void 0}),[e,t]);var ri=({code:e,language:t="text",copyable:o=true,showLineNumbers:r=false,wrapLongLines:a=false,maxHeight:n})=>{let[i,c]=Rt.useState(false),d=Rt.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(a0__default.default,{fontSize:"inherit"}):jsxRuntime.jsx(r0__default.default,{fontSize:"inherit"})})})]}),jsxRuntime.jsx(material.Box,{component:"pre",sx:{m:0,p:1.25,fontSize:"0.82rem",lineHeight:1.55,overflow:"auto",maxHeight:n,bgcolor:"background.default",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:r?d.map((s,g)=>jsxRuntime.jsxs(material.Box,{sx:{display:"flex"},children:[jsxRuntime.jsx(material.Box,{component:"span",sx:{width:34,flexShrink:0,textAlign:"right",pr:1,color:"text.disabled",userSelect:"none"},children:g+1}),jsxRuntime.jsx(material.Box,{component:"span",sx:{whiteSpace:a?"pre-wrap":"pre",wordBreak:a?"break-word":"normal"},children:s})]},`${g}-${s}`)):jsxRuntime.jsx(material.Box,{component:"code",sx:{display:"block",whiteSpace:a?"pre-wrap":"pre",wordBreak:a?"break-word":"normal"},children:e})})]})};var c0=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},d0=async e=>new Function("m","return import(m)")(e),ai=({expression:e,inline:t=false,allowKatex:o=false})=>{let r=Rt.useMemo(()=>c0(e),[e]),[a,n]=Rt.useState("");return Rt.useEffect(()=>{let i=true;return (async()=>{if(!o||!r){n("");return}try{let d=await d0("katex"),s=(d?.default||d)?.renderToString?.(r,{displayMode:!t,throwOnError:!1,strict:"warn"});i&&typeof s=="string"&&n(s);}catch{i&&n("");}})(),()=>{i=false;}},[o,r,t]),r?a?jsxRuntime.jsx(material.Box,{component:t?"span":"div",sx:{display:t?"inline-flex":"block",my:t?0:.5,overflowX:"auto"},dangerouslySetInnerHTML:{__html:a}}):t?jsxRuntime.jsx(material.Box,{component:"code",sx:{px:.4,py:.05,borderRadius:.8,bgcolor:"action.hover",fontSize:"0.82em",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:r}):jsxRuntime.jsx(material.Box,{sx:{my:1,p:1,borderRadius:1.2,border:"1px dashed",borderColor:"divider",bgcolor:"background.paper"},children:jsxRuntime.jsx(material.Typography,{component:"pre",sx:{m:0,whiteSpace:"pre-wrap",fontSize:"0.9rem",lineHeight:1.5,fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:r})}):null};var b0=async e=>new Function("m","return import(m)")(e),vc=({code:e,title:t="Mermaid Diagram",height:o=320,enabled:r=true})=>{let[a,n]=Rt.useState(""),[i,c]=Rt.useState(""),[d,l]=Rt.useState(false),s=Rt.useMemo(()=>e.trim(),[e]);return Rt.useEffect(()=>{let g=true;return (async()=>{if(!r||!s){n(""),c("");return}l(true),c(""),n("");try{let m=await b0("mermaid"),b=m?.default||m;if(!b||typeof b.render!="function")throw new Error("Mermaid runtime is not available");b.initialize?.({startOnLoad:!1,securityLevel:"loose",theme:"default"});let C=await b.render(`orbcafe-mermaid-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,s),u=typeof C=="string"?C:C?.svg;g&&typeof u=="string"&&n(u);}catch(m){if(g){let b=m instanceof Error?m.message:"Failed to render Mermaid diagram";c(b);}}finally{g&&l(false);}})(),()=>{g=false;}},[r,s]),jsxRuntime.jsxs(material.Paper,{variant:"outlined",sx:{borderRadius:1.5,overflow:"hidden",my:1},children:[jsxRuntime.jsx(material.Box,{sx:{px:1,py:.6,borderBottom:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",sx:{letterSpacing:.4,textTransform:"uppercase"},children:t})}),jsxRuntime.jsxs(material.Box,{sx:{p:1},children:[d&&jsxRuntime.jsx(material.Box,{sx:{minHeight:120,display:"flex",alignItems:"center",justifyContent:"center"},children:jsxRuntime.jsx(material.CircularProgress,{size:20})}),!d&&a&&jsxRuntime.jsx(material.Box,{sx:{maxHeight:o,overflow:"auto","& svg":{display:"block",mx:"auto",maxWidth:"100%",height:"auto"}},dangerouslySetInnerHTML:{__html:a}}),!d&&!a&&jsxRuntime.jsxs(material.Box,{children:[i&&jsxRuntime.jsx(material.Alert,{severity:"info",sx:{mb:1},children:i}),jsxRuntime.jsx(ri,{code:s,language:"mermaid",copyable:true,showLineNumbers:true,wrapLongLines:true})]})]})]})};var Cc=e=>e.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(o=>o.trim()),T0=e=>/^:?-{3,}:?$/.test(e.trim()),I0=e=>{let t=e.trim(),o=t.startsWith(":"),r=t.endsWith(":");return o&&r?"center":r?"right":"left"},kl=e=>{let t=e.split(`
187
- `).map(i=>i.trim()).filter(Boolean);if(t.length<2)return null;let o=Cc(t[0]),r=Cc(t[1]);if(o.length===0||r.length!==o.length||!r.every(T0))return null;let a=r.map(I0),n=t.slice(2).filter(i=>i.includes("|")).map(i=>{let c=Cc(i);return c.length<o.length?[...c,...Array.from({length:o.length-c.length},()=>"")]:c.slice(0,o.length)});return {headers:o,aligns:a,rows:n}},kc=({markdown:e,table:t,maxHeight:o=360})=>{let r=Rt.useMemo(()=>t||(e?kl(e):null),[t,e]);return !r||r.headers.length===0?jsxRuntime.jsx(material.Paper,{variant:"outlined",sx:{p:1.2,borderRadius:1.5},children:jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:"Invalid table block"})}):jsxRuntime.jsx(material.Paper,{variant:"outlined",sx:{borderRadius:1.5,overflow:"hidden",my:1},children:jsxRuntime.jsx(material.TableContainer,{sx:{maxHeight:o},children:jsxRuntime.jsxs(material.Table,{size:"small",stickyHeader:true,children:[jsxRuntime.jsx(material.TableHead,{children:jsxRuntime.jsx(material.TableRow,{children:r.headers.map((a,n)=>jsxRuntime.jsx(material.TableCell,{align:r.aligns[n],sx:{fontWeight:700,bgcolor:"background.paper"},children:a},`${a}-${n}`))})}),jsxRuntime.jsx(material.TableBody,{children:r.rows.map((a,n)=>jsxRuntime.jsx(material.TableRow,{hover:true,children:a.map((i,c)=>jsxRuntime.jsx(material.TableCell,{align:r.aligns[c],sx:{whiteSpace:"pre-wrap",wordBreak:"break-word"},children:i||jsxRuntime.jsx(material.Box,{component:"span",sx:{color:"text.disabled"},children:"-"})},`cell-${n}-${c}`))},`row-${n}`))})]})})})};var wl=({content:e,title:t="Thinking",defaultExpanded:o=false,isStreaming:r=false})=>{let[a,n]=Rt.useState(o);return jsxRuntime.jsxs(material.Box,{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1,my:.8},children:[jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:.6,children:[jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>n(i=>!i),sx:{transform:a?"rotate(180deg)":"rotate(0deg)",transition:"transform .15s ease"},children:jsxRuntime.jsx(E0__default.default,{fontSize:"inherit"})}),jsxRuntime.jsxs(material.Typography,{variant:"caption",color:"text.secondary",sx:{fontStyle:"italic"},children:[t,r?" ...":""]})]}),jsxRuntime.jsx(material.Collapse,{in:a,children:jsxRuntime.jsx(material.Typography,{variant:"body2",sx:{pl:4,pt:.4,whiteSpace:"pre-wrap",color:"text.secondary",fontStyle:"italic",lineHeight:1.55},children:e})})]})};var wc=/(\*\*[^*]+\*\*|`[^`]+`|\[[^\]]+\]\([^)]+\)|\*[^*]+\*|\$[^$\n]+\$)/g,Tl=e=>e.trim().startsWith("```"),Lp=e=>/^#{1,6}\s+/.test(e.trim()),Tc=e=>/^[-*+]\s+/.test(e.trim()),Ic=e=>/^\d+\.\s+/.test(e.trim()),zp=e=>/^(?:-{3,}|\*{3,}|_{3,})$/.test(e.trim()),Pc=e=>e.trim().startsWith(">"),Np=(e,t)=>{if(t+1>=e.length)return false;let o=e[t],r=e[t+1];return !o.includes("|")||!r.includes("|")?false:/^\s*\|?\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)+\|?\s*$/.test(r.trim())},Vp=e=>e.trim().startsWith("<think>")||e.trim()===":::think",li=(e,t,o)=>{let r=[],a=0,n=0;wc.lastIndex=0;let i=wc.exec(e);for(;i;){i.index>a&&r.push(e.slice(a,i.index));let c=i[0],d=`${o}-${n}`;if(c.startsWith("**")&&c.endsWith("**"))r.push(jsxRuntime.jsx("strong",{children:c.slice(2,-2)},d));else if(c.startsWith("*")&&c.endsWith("*"))r.push(jsxRuntime.jsx("em",{children:c.slice(1,-1)},d));else if(c.startsWith("`")&&c.endsWith("`"))r.push(jsxRuntime.jsx(material.Box,{component:"code",sx:{px:.45,py:.08,borderRadius:.8,bgcolor:"action.hover",fontSize:"0.82em",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:c.slice(1,-1)},d));else if(c.startsWith("[")&&c.includes("](")&&c.endsWith(")")){let l=c.match(/^\[([^\]]+)\]\(([^)]+)\)$/);l?r.push(jsxRuntime.jsx(material.Link,{href:l[2],target:"_blank",rel:"noreferrer",underline:"hover",children:l[1]},d)):r.push(c);}else c.startsWith("$")&&c.endsWith("$")&&t.enableMath?r.push(jsxRuntime.jsx(ai,{expression:c,inline:true,allowKatex:true},d)):r.push(c);a=i.index+c.length,n+=1,i=wc.exec(e);}return a<e.length&&r.push(e.slice(a)),r.length>0?r:[e]},si=({markdown:e,content:t,className:o,enableMath:r=true,enableMermaid:a=true,enableThinkBlock:n=true,codeCopyable:i=true,codeLineNumbers:c=false})=>{let d=e??t??"",l=Rt.useMemo(()=>{let s=[],g=d.replace(/\r\n/g,`
183
+ `;return Et.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:Dg(r)}}}),p=new ogl.Mesh(l,{geometry:g,program:f});function b(){if(!d)return;let R=window.devicePixelRatio||1,C=d.clientWidth,I=d.clientHeight;s.setSize(C*R,I*R),l.canvas.style.width=C+"px",l.canvas.style.height=I+"px",f.uniforms.iResolution.value.set(l.canvas.width,l.canvas.height,l.canvas.width/l.canvas.height);}window.addEventListener("resize",b),b();let v=0,u=0,w=0,m=.3,h=R=>{let C=d.getBoundingClientRect(),I=R.clientX-C.left,T=R.clientY-C.top,S=C.width,A=C.height,M=Math.min(S,A),D=S/2,B=A/2,Z=(I-D)/M*2,O=(T-B)/M*2;Math.sqrt(Z*Z+O*O)<.8?v=1:v=0;},y=()=>{v=0;};d.addEventListener("mousemove",h),d.addEventListener("mouseleave",y);let k,E=R=>{k=requestAnimationFrame(E);let C=(R-u)*.001;u=R,f.uniforms.iTime.value=R*.001,f.uniforms.hue.value=e,f.uniforms.hoverIntensity.value=t,f.uniforms.backgroundColor.value=Dg(r);let I=a?1:v;f.uniforms.hover.value+=(I-f.uniforms.hover.value)*.1,o&&I>.5&&(w+=C*m),f.uniforms.rot.value=w,s.render({scene:p});};return k=requestAnimationFrame(E),()=>{cancelAnimationFrame(k),window.removeEventListener("resize",b),d.removeEventListener("mousemove",h),d.removeEventListener("mouseleave",y),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 GS(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 Dg(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 GS(a,r,n)}return new ogl.Vec3(0,0,0)}var Bg=zf(()=>{"use client";});function No(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var Ls={primary:"#000000",primaryHover:"#333333"},Hi={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"},Hn={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",full:"rounded-full"},Wd=()=>"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 $f=classVarianceAuthority.cva(Wd(),{variants:{variant:{default:`${Hi.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:`${Hi.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:Hi.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-[${Ls.primary}] hover:bg-[${Ls.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:Hn.none,sm:Hn.sm,md:Hn.md,full:Hn.full}},defaultVariants:{variant:"default",size:"default",rounded:"md"}}),zs=Et__namespace.forwardRef(({className:e,variant:t,size:o,asChild:a=false,...r},n)=>jsxRuntime.jsx(a?reactSlot.Slot:"button",{className:No($f({variant:t,size:o,className:e})),ref:n,...r}));zs.displayName="Button";var Uf={"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}","navigation.mode.switchToFixed":"Switch to fixed navigation","navigation.mode.switchToFloating":"Switch to floating navigation","table.toolbar.searchPlaceholder":"Search...","table.title.default":"Data Table","table.toolbar.groupBy":"Group By","table.toolbar.summary":"Summary","table.toolbar.columns":"Columns","table.toolbar.export":"Export","table.toolbar.itemsPerPage":"Items per page:","table.toolbar.pageOf":"Page {current} of {total}","table.toolbar.newItem":"New Item","table.toolbar.editItem":"Edit Item","table.toolbar.deleteItem":"Delete Item","table.toolbar.graphicReport":"Graphic Report","table.toolbar.saveLayout":"Save Layout","table.menu.groupBy":"Group By","table.menu.clearAll":"Clear All","table.menu.visibleColumns":"Visible Columns","table.menu.showSummaryRow":"Show Summary Row","table.menu.noNumericColumns":"No numeric columns","table.group.expandAll":"Expand All Groups","table.group.collapseAll":"Collapse All Groups","table.mobile.notImplemented":"Mobile View Not Implemented","table.headerMenu.sortAsc":"Sort Ascending","table.headerMenu.sortDesc":"Sort Descending","table.headerMenu.clearSort":"Clear Sort","table.headerMenu.configureSort":"Configure Sort...","table.headerMenu.group":"Group by this column","table.headerMenu.ungroup":"Remove from grouping","table.headerMenu.addSummary":"Include in Summary","table.headerMenu.removeSummary":"Remove from Summary","table.headerMenu.hideColumn":"Hide Column","table.sortDialog.title":"Sort Settings","table.sortDialog.empty":"No sort rules. Add one to start ordering rows.","table.sortDialog.addRule":"Add Sort Rule","table.sortDialog.clearAll":"Clear All","table.sortDialog.asc":"Ascending","table.sortDialog.desc":"Descending","pivot.title.default":"Pivot Table Builder","pivot.subtitle.default":"Drag fields to configure the pivot table.","pivot.empty":"Drag at least one field into Values to render the pivot result.","pivot.records":"Records","pivot.afterFilter":"After filter","pivot.grandTotal":"Grand Total","pivot.resultLabel":"Result","pivot.valueLabel":"Value","pivot.table.dimensions":"Dimensions","pivot.config.title":"Configuration","pivot.fieldList":"Field List","pivot.availableDimensions":"Available dimensions","pivot.allFieldsInUse":"All fields are in use.","pivot.zone.rows":"Rows","pivot.zone.columns":"Columns","pivot.zone.filters":"Filters","pivot.zone.values":"Values","pivot.hint.rows":"Drag fields here to build row hierarchy","pivot.hint.columns":"Drag fields here to build column hierarchy","pivot.hint.filters":"Drag fields here for report filters","pivot.hint.values":"Drag numeric fields here for aggregation","pivot.clearArea":"Clear area","pivot.filter.na":"N/A","pivot.filter.noValues":"No values","pivot.filter.noneSelected":"None selected","pivot.filter.allValues":"All values","pivot.filter.selectedCount":"{selected} / {total} selected","pivot.filter.selectAll":"Select All","pivot.filter.deselectAll":"Deselect All","pivot.filter.noResults":"No results","pivot.collapse.ariaExpand":"Expand configuration area","pivot.collapse.ariaCollapse":"Collapse configuration area","pivot.agg.sum":"Sum","pivot.agg.count":"Count","pivot.agg.avg":"Average","pivot.agg.min":"Min","pivot.agg.max":"Max","pivot.preset.selectPlaceholder":"Select preset","pivot.preset.save":"Save preset","pivot.preset.delete":"Delete preset","pivot.preset.saveDialogTitle":"Save current preset","pivot.preset.nameLabel":"Preset name","pivot.preset.defaultName":"Preset {index}","pivot.table.sectionTitle":"Pivot Result","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"Expand pivot result","pivot.table.collapse.ariaCollapse":"Collapse pivot result","pivot.chart.title":"Pivot Chart","pivot.chart.subtitle":"Map one dimension and up to two measures into a compact chart.","pivot.chart.subtitleReady":"{dimension} by {measure}","pivot.chart.emptyNoDimension":"Add at least one row or column field to render the chart.","pivot.chart.emptyNoValue":"Add at least one value field to render the chart.","pivot.chart.emptyNoData":"No data available for the current chart selection.","pivot.chart.dimension":"Dimension","pivot.chart.primaryMeasure":"Measure","pivot.chart.secondaryMeasure":"Compare measure","pivot.chart.chartType":"Chart type","pivot.chart.style.barVertical":"Vertical bars","pivot.chart.style.barHorizontal":"Horizontal bars","pivot.chart.style.line":"Line","pivot.chart.style.scatter":"Scatter","pivot.chart.collapse.ariaExpand":"Expand chart area","pivot.chart.collapse.ariaCollapse":"Collapse chart area","smartFilter.adaptFilters":"Adapt Filters","smartFilter.addFilters":"Add Filters","smartFilter.go":"Go","smartFilter.visibleFilters":"Visible Filters","smartFilter.searchPlaceholder":"Search...","smartFilter.noOptionsFound":"No options found","smartFilter.min":"Min","smartFilter.max":"Max","smartFilter.minMaxPlaceholder":"Min - Max","smartFilter.operator.equals":"Equals","smartFilter.operator.contains":"Contains","smartFilter.operator.notContains":"Does Not Contain","smartFilter.operator.wildcard":"Wildcard Search","smartFilter.operator.notEquals":"Not Equals","smartFilter.operator.greaterThan":"Greater Than","smartFilter.operator.lessThan":"Less Than","smartFilter.operator.greaterOrEqual":"Greater Than or Equal","smartFilter.operator.lessOrEqual":"Less Than or Equal","smartFilter.operator.between":"Between","variant.noOptions":"No options","variant.defaultSuffix":"Default","variant.selectVariant":"Select Variant","variant.saveView":"Save View","variant.newVariant":"New Variant","variant.viewName":"View Name","variant.setDefault":"Set as Default","variant.publicAllUsers":"Public (All Users)","variant.toast.fetchFailed":"Failed to load variants","variant.toast.saveFailed":"Failed to save variant","variant.toast.saveSuccess":"Variant saved successfully","variant.toast.deleteFailed":"Failed to delete variant","variant.toast.deleteSuccess":"Variant deleted successfully","variant.toast.defaultFailed":"Failed to update default variant","variant.toast.defaultSuccess":"Default variant updated","layout.saveLayout":"Save Layout","layout.layoutOptions":"Layout Options","layout.selectLayout":"Select Layout","layout.saveCurrentLayout":"Save Current Layout...","layout.noSavedLayouts":"No saved layouts","layout.removeDefault":"Remove Default","layout.setAsDefault":"Set as Default","layout.layoutName":"Layout Name","layout.layoutDescription":"Description","layout.layoutNameHelper":"e.g., 'Compact View'","layout.warningOverwrite":"Warning: Existing layout will be overwritten","layout.useAsDefault":"Use as Default Layout","layout.publicAllUsers":"Public (Visible to all users)","layout.toast.loadFallback":"Failed to load layouts from backend, fallback to local storage","layout.toast.saveSuccess":"Layout saved successfully","layout.toast.saveLocalSuccess":"Layout saved to local storage","layout.toast.backendUnavailableSavedLocal":"Backend unavailable, saved to local storage","layout.toast.deleteSuccess":"Layout deleted successfully","layout.toast.deleteLocalSuccess":"Layout deleted from local storage","layout.toast.backendUnavailableDeletedLocal":"Backend unavailable, deleted from local storage","layout.toast.defaultSuccess":"Default layout set","layout.toast.defaultLocalSuccess":"Default layout set in local storage","layout.toast.backendUnavailableDefaultLocal":"Backend unavailable, default saved to local storage","dateRange.label":"Date Range","dateRange.startDate":"Start Date","dateRange.endDate":"End Date","dateRange.select":"Select...","dateRange.today":"Today","dateRange.thisWeek":"This Week","dateRange.thisMonth":"This Month","graph.records":"{count} records","graph.kpi.totalRecords":"Total Records","graph.kpi.totalReport":"Total Report","graph.kpi.totalBillable":"Total Billable","graph.kpi.efficiency":"Efficiency","graph.kpi.amount":"Amount","graph.kpi.flagged":"Flagged","graph.chart.billable.title":"Billable by Dimension","graph.chart.billable.subtitle":"Top values by billable hours","graph.chart.efficiency.title":"Efficiency by Person","graph.chart.efficiency.subtitle":"Lowest efficiency first","graph.chart.status.title":"Status Distribution","graph.chart.status.subtitle":"Record ratio by status","graph.dataBody":"Data Body","graph.reportTitle":"Graphic Report","graph.unassigned":"Unassigned","graph.column.reportHours":"Report Hours","graph.column.billableHours":"Billable Hours","detail.searchAi.placeholder":"Search fields, or ask AI if no match...","detail.searchAi.matches":"{count} matches found","detail.searchAi.noMatch":"No matching field found.","detail.searchAi.autoAiFallback":"No direct match. Triggering AI analysis...","detail.searchAi.aiResultTitle":"AI Insight","detail.table.title":"Related Records","kanban.empty":"Drop cards here","kanban.bucket.limit":"Limit","kanban.bucket.dropHere":"Release to move into this bucket","kanban.card.progress":"Progress","kanban.card.openDetail":"Open Detail","kanban.priority.critical":"Critical","kanban.priority.high":"High","kanban.priority.medium":"Medium","kanban.priority.low":"Low","quickCreate.newItem":"New Item","quickCreate.createWithTitle":"Create {title}","quickEdit.editWithTitle":"Edit {title}","quickDelete.confirmTitle":"Confirm Delete","quickDelete.confirmMessageSingle":"Are you sure you want to delete the selected record?","quickDelete.confirmMessageMultiple":"Are you sure you want to delete {count} selected records?","messageBox.confirm":"OK","messageBox.cancel":"Cancel"},Kf={"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}","navigation.mode.switchToFixed":"\u5207\u6362\u4E3A\u56FA\u5B9A\u5BFC\u822A","navigation.mode.switchToFloating":"\u5207\u6362\u4E3A\u60AC\u6D6E\u5BFC\u822A","table.toolbar.searchPlaceholder":"\u641C\u7D22...","table.title.default":"\u6570\u636E\u8868","table.toolbar.groupBy":"\u5206\u7EC4","table.toolbar.summary":"\u6C47\u603B","table.toolbar.columns":"\u5217","table.toolbar.export":"\u5BFC\u51FA","table.toolbar.itemsPerPage":"\u6BCF\u9875\u6761\u6570\uFF1A","table.toolbar.pageOf":"\u7B2C {current} / {total} \u9875","table.toolbar.newItem":"\u65B0\u5EFA\u6761\u76EE","table.toolbar.editItem":"\u7F16\u8F91\u6761\u76EE","table.toolbar.deleteItem":"\u5220\u9664\u6761\u76EE","table.toolbar.graphicReport":"\u56FE\u8868\u62A5\u8868","table.toolbar.saveLayout":"\u4FDD\u5B58\u5E03\u5C40","table.menu.groupBy":"\u5206\u7EC4","table.menu.clearAll":"\u6E05\u7A7A","table.menu.visibleColumns":"\u53EF\u89C1\u5217","table.menu.showSummaryRow":"\u663E\u793A\u6C47\u603B\u884C","table.menu.noNumericColumns":"\u6CA1\u6709\u6570\u503C\u5217","table.group.expandAll":"\u5C55\u5F00\u5168\u90E8\u5206\u7EC4","table.group.collapseAll":"\u6298\u53E0\u5168\u90E8\u5206\u7EC4","table.mobile.notImplemented":"\u79FB\u52A8\u7AEF\u89C6\u56FE\u6682\u672A\u5B9E\u73B0","table.headerMenu.sortAsc":"\u5347\u5E8F\u6392\u5217","table.headerMenu.sortDesc":"\u964D\u5E8F\u6392\u5217","table.headerMenu.clearSort":"\u6E05\u9664\u6392\u5E8F","table.headerMenu.configureSort":"\u6392\u5E8F\u8BBE\u7F6E...","table.headerMenu.group":"\u6309\u6B64\u5217\u5206\u7EC4","table.headerMenu.ungroup":"\u53D6\u6D88\u5206\u7EC4","table.headerMenu.addSummary":"\u52A0\u5165\u6C47\u603B","table.headerMenu.removeSummary":"\u4ECE\u6C47\u603B\u4E2D\u79FB\u9664","table.headerMenu.hideColumn":"\u9690\u85CF\u8BE5\u5217","table.sortDialog.title":"\u6392\u5E8F\u8BBE\u7F6E","table.sortDialog.empty":"\u6682\u65E0\u6392\u5E8F\u89C4\u5219\uFF0C\u8BF7\u6DFB\u52A0\u89C4\u5219\u8FDB\u884C\u6392\u5E8F\u3002","table.sortDialog.addRule":"\u6DFB\u52A0\u6392\u5E8F\u89C4\u5219","table.sortDialog.clearAll":"\u6E05\u7A7A\u89C4\u5219","table.sortDialog.asc":"\u5347\u5E8F","table.sortDialog.desc":"\u964D\u5E8F","pivot.title.default":"\u6570\u636E\u900F\u89C6\u8868","pivot.subtitle.default":"\u62D6\u62FD\u5B57\u6BB5\u4EE5\u914D\u7F6E\u900F\u89C6\u8868\u3002","pivot.empty":"\u8BF7\u81F3\u5C11\u62D6\u5165\u4E00\u4E2A\u503C\u5B57\u6BB5\u540E\u518D\u67E5\u770B\u900F\u89C6\u7ED3\u679C\u3002","pivot.records":"\u8BB0\u5F55\u6570","pivot.afterFilter":"\u7B5B\u9009\u540E","pivot.grandTotal":"\u603B\u8BA1","pivot.resultLabel":"\u7ED3\u679C","pivot.valueLabel":"\u503C","pivot.table.dimensions":"\u7EF4\u5EA6","pivot.config.title":"\u5E03\u5C40\u914D\u7F6E","pivot.fieldList":"\u5B57\u6BB5\u5217\u8868","pivot.availableDimensions":"\u53EF\u7528\u7EF4\u5EA6","pivot.allFieldsInUse":"\u6240\u6709\u5B57\u6BB5\u90FD\u5DF2\u4F7F\u7528\u3002","pivot.zone.rows":"\u884C","pivot.zone.columns":"\u5217","pivot.zone.filters":"\u7B5B\u9009","pivot.zone.values":"\u503C","pivot.hint.rows":"\u5C06\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u6784\u5EFA\u884C\u5C42\u7EA7","pivot.hint.columns":"\u5C06\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u6784\u5EFA\u5217\u5C42\u7EA7","pivot.hint.filters":"\u5C06\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u4F5C\u4E3A\u62A5\u8868\u7B5B\u9009","pivot.hint.values":"\u5C06\u6570\u503C\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u8FDB\u884C\u805A\u5408","pivot.clearArea":"\u6E05\u7A7A\u533A\u57DF","pivot.filter.na":"\u4E0D\u53EF\u7528","pivot.filter.noValues":"\u65E0\u53EF\u9009\u503C","pivot.filter.noneSelected":"\u672A\u9009\u62E9","pivot.filter.allValues":"\u5168\u90E8\u503C","pivot.filter.selectedCount":"\u5DF2\u9009 {selected} / {total}","pivot.filter.selectAll":"\u5168\u9009","pivot.filter.deselectAll":"\u53D6\u6D88\u5168\u9009","pivot.filter.noResults":"\u65E0\u5339\u914D\u7ED3\u679C","pivot.collapse.ariaExpand":"\u5C55\u5F00\u914D\u7F6E\u533A\u57DF","pivot.collapse.ariaCollapse":"\u6298\u53E0\u914D\u7F6E\u533A\u57DF","pivot.agg.sum":"\u6C42\u548C","pivot.agg.count":"\u8BA1\u6570","pivot.agg.avg":"\u5E73\u5747\u503C","pivot.agg.min":"\u6700\u5C0F\u503C","pivot.agg.max":"\u6700\u5927\u503C","pivot.preset.selectPlaceholder":"\u9009\u62E9\u65B9\u6848","pivot.preset.save":"\u4FDD\u5B58\u65B9\u6848","pivot.preset.delete":"\u5220\u9664\u65B9\u6848","pivot.preset.saveDialogTitle":"\u4FDD\u5B58\u5F53\u524D\u65B9\u6848","pivot.preset.nameLabel":"\u65B9\u6848\u540D\u79F0","pivot.preset.defaultName":"\u65B9\u6848 {index}","pivot.table.sectionTitle":"\u900F\u89C6\u7ED3\u679C","pivot.table.expandRowsAll":"\u884C\u5168\u90E8\u6253\u5F00","pivot.table.collapseRowsAll":"\u884C\u5168\u90E8\u6298\u53E0","pivot.table.expandColumnsAll":"\u5217\u5168\u90E8\u6253\u5F00","pivot.table.collapseColumnsAll":"\u5217\u5168\u90E8\u6298\u53E0","pivot.table.collapse.ariaExpand":"\u5C55\u5F00\u900F\u89C6\u7ED3\u679C","pivot.table.collapse.ariaCollapse":"\u6298\u53E0\u900F\u89C6\u7ED3\u679C","pivot.chart.title":"\u900F\u89C6\u56FE\u8868","pivot.chart.subtitle":"\u5C06\u4E00\u4E2A\u7EF4\u5EA6\u4E0E\u6700\u591A\u4E24\u4E2A\u5EA6\u91CF\u6620\u5C04\u4E3A\u7D27\u51D1\u56FE\u8868\u3002","pivot.chart.subtitleReady":"{dimension} \xB7 {measure}","pivot.chart.emptyNoDimension":"\u8BF7\u81F3\u5C11\u653E\u5165\u4E00\u4E2A\u884C\u6216\u5217\u5B57\u6BB5\u540E\u518D\u67E5\u770B\u56FE\u8868\u3002","pivot.chart.emptyNoValue":"\u8BF7\u81F3\u5C11\u653E\u5165\u4E00\u4E2A\u503C\u5B57\u6BB5\u540E\u518D\u67E5\u770B\u56FE\u8868\u3002","pivot.chart.emptyNoData":"\u5F53\u524D\u56FE\u8868\u9009\u62E9\u4E0B\u6682\u65E0\u53EF\u5C55\u793A\u6570\u636E\u3002","pivot.chart.dimension":"\u56FE\u8868\u7EF4\u5EA6","pivot.chart.primaryMeasure":"\u4E3B\u5EA6\u91CF","pivot.chart.secondaryMeasure":"\u5BF9\u6BD4\u5EA6\u91CF","pivot.chart.chartType":"\u56FE\u8868\u7C7B\u578B","pivot.chart.style.barVertical":"\u7EB5\u5411\u67F1\u72B6\u56FE","pivot.chart.style.barHorizontal":"\u6A2A\u5411\u67F1\u72B6\u56FE","pivot.chart.style.line":"\u6298\u7EBF\u56FE","pivot.chart.style.scatter":"\u6563\u70B9\u56FE","pivot.chart.collapse.ariaExpand":"\u5C55\u5F00\u56FE\u8868\u533A\u57DF","pivot.chart.collapse.ariaCollapse":"\u6298\u53E0\u56FE\u8868\u533A\u57DF","smartFilter.adaptFilters":"\u7B5B\u9009\u8BBE\u7F6E","smartFilter.addFilters":"\u6DFB\u52A0\u7B5B\u9009","smartFilter.go":"\u6267\u884C","smartFilter.visibleFilters":"\u53EF\u89C1\u7B5B\u9009\u9879","smartFilter.searchPlaceholder":"\u641C\u7D22...","smartFilter.noOptionsFound":"\u672A\u627E\u5230\u9009\u9879","smartFilter.min":"\u6700\u5C0F\u503C","smartFilter.max":"\u6700\u5927\u503C","smartFilter.minMaxPlaceholder":"\u6700\u5C0F\u503C - \u6700\u5927\u503C","smartFilter.operator.equals":"\u7B49\u4E8E","smartFilter.operator.contains":"\u5305\u542B","smartFilter.operator.notContains":"\u4E0D\u5305\u542B","smartFilter.operator.wildcard":"\u901A\u914D\u7B26\u641C\u7D22","smartFilter.operator.notEquals":"\u4E0D\u7B49\u4E8E","smartFilter.operator.greaterThan":"\u5927\u4E8E","smartFilter.operator.lessThan":"\u5C0F\u4E8E","smartFilter.operator.greaterOrEqual":"\u5927\u4E8E\u7B49\u4E8E","smartFilter.operator.lessOrEqual":"\u5C0F\u4E8E\u7B49\u4E8E","smartFilter.operator.between":"\u533A\u95F4","variant.noOptions":"\u65E0\u9009\u9879","variant.defaultSuffix":"\u9ED8\u8BA4","variant.selectVariant":"\u9009\u62E9\u89C6\u56FE","variant.saveView":"\u4FDD\u5B58\u89C6\u56FE","variant.newVariant":"\u65B0\u89C6\u56FE","variant.viewName":"\u89C6\u56FE\u540D\u79F0","variant.setDefault":"\u8BBE\u4E3A\u9ED8\u8BA4","variant.publicAllUsers":"\u516C\u5F00\uFF08\u6240\u6709\u7528\u6237\uFF09","variant.toast.fetchFailed":"\u52A0\u8F7D\u89C6\u56FE\u5931\u8D25","variant.toast.saveFailed":"\u4FDD\u5B58\u89C6\u56FE\u5931\u8D25","variant.toast.saveSuccess":"\u89C6\u56FE\u4FDD\u5B58\u6210\u529F","variant.toast.deleteFailed":"\u5220\u9664\u89C6\u56FE\u5931\u8D25","variant.toast.deleteSuccess":"\u89C6\u56FE\u5220\u9664\u6210\u529F","variant.toast.defaultFailed":"\u66F4\u65B0\u9ED8\u8BA4\u89C6\u56FE\u5931\u8D25","variant.toast.defaultSuccess":"\u9ED8\u8BA4\u89C6\u56FE\u5DF2\u66F4\u65B0","layout.saveLayout":"\u4FDD\u5B58\u5E03\u5C40","layout.layoutOptions":"\u5E03\u5C40\u9009\u9879","layout.selectLayout":"\u9009\u62E9\u5E03\u5C40","layout.saveCurrentLayout":"\u4FDD\u5B58\u5F53\u524D\u5E03\u5C40...","layout.noSavedLayouts":"\u6682\u65E0\u5DF2\u4FDD\u5B58\u5E03\u5C40","layout.removeDefault":"\u53D6\u6D88\u9ED8\u8BA4","layout.setAsDefault":"\u8BBE\u4E3A\u9ED8\u8BA4","layout.layoutName":"\u5E03\u5C40\u540D\u79F0","layout.layoutDescription":"\u63CF\u8FF0","layout.layoutNameHelper":"\u4F8B\u5982\uFF1A\u7D27\u51D1\u89C6\u56FE","layout.warningOverwrite":"\u8B66\u544A\uFF1A\u5C06\u8986\u76D6\u540C\u540D\u5E03\u5C40","layout.useAsDefault":"\u7528\u4F5C\u9ED8\u8BA4\u5E03\u5C40","layout.publicAllUsers":"\u516C\u5F00\uFF08\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09","layout.toast.loadFallback":"\u540E\u7AEF\u52A0\u8F7D\u5E03\u5C40\u5931\u8D25\uFF0C\u5DF2\u56DE\u9000\u5230\u672C\u5730\u5B58\u50A8","layout.toast.saveSuccess":"\u5E03\u5C40\u4FDD\u5B58\u6210\u529F","layout.toast.saveLocalSuccess":"\u5E03\u5C40\u5DF2\u4FDD\u5B58\u5230\u672C\u5730\u5B58\u50A8","layout.toast.backendUnavailableSavedLocal":"\u540E\u7AEF\u4E0D\u53EF\u7528\uFF0C\u5DF2\u4FDD\u5B58\u5230\u672C\u5730\u5B58\u50A8","layout.toast.deleteSuccess":"\u5E03\u5C40\u5220\u9664\u6210\u529F","layout.toast.deleteLocalSuccess":"\u5E03\u5C40\u5DF2\u4ECE\u672C\u5730\u5B58\u50A8\u5220\u9664","layout.toast.backendUnavailableDeletedLocal":"\u540E\u7AEF\u4E0D\u53EF\u7528\uFF0C\u5DF2\u4ECE\u672C\u5730\u5B58\u50A8\u5220\u9664","layout.toast.defaultSuccess":"\u9ED8\u8BA4\u5E03\u5C40\u5DF2\u8BBE\u7F6E","layout.toast.defaultLocalSuccess":"\u9ED8\u8BA4\u5E03\u5C40\u5DF2\u5728\u672C\u5730\u5B58\u50A8\u8BBE\u7F6E","layout.toast.backendUnavailableDefaultLocal":"\u540E\u7AEF\u4E0D\u53EF\u7528\uFF0C\u9ED8\u8BA4\u5E03\u5C40\u5DF2\u4FDD\u5B58\u5230\u672C\u5730\u5B58\u50A8","dateRange.label":"\u65E5\u671F\u8303\u56F4","dateRange.startDate":"\u5F00\u59CB\u65E5\u671F","dateRange.endDate":"\u7ED3\u675F\u65E5\u671F","dateRange.select":"\u8BF7\u9009\u62E9...","dateRange.today":"\u4ECA\u5929","dateRange.thisWeek":"\u672C\u5468","dateRange.thisMonth":"\u672C\u6708","graph.records":"{count} \u6761\u8BB0\u5F55","graph.kpi.totalRecords":"\u603B\u8BB0\u5F55\u6570","graph.kpi.totalReport":"\u603B\u7533\u62A5\u5DE5\u65F6","graph.kpi.totalBillable":"\u603B\u53EF\u8BA1\u8D39\u5DE5\u65F6","graph.kpi.efficiency":"\u6548\u7387","graph.kpi.amount":"\u91D1\u989D","graph.kpi.flagged":"\u6807\u8BB0","graph.chart.billable.title":"\u7EF4\u5EA6\u8BA1\u8D39\u5DE5\u65F6","graph.chart.billable.subtitle":"\u6309\u53EF\u8BA1\u8D39\u5DE5\u65F6\u6392\u5E8F\u524D\u5217","graph.chart.efficiency.title":"\u4EBA\u5458\u6548\u7387","graph.chart.efficiency.subtitle":"\u6309\u6700\u4F4E\u6548\u7387\u4F18\u5148","graph.chart.status.title":"\u72B6\u6001\u5206\u5E03","graph.chart.status.subtitle":"\u6309\u72B6\u6001\u8BB0\u5F55\u5360\u6BD4","graph.dataBody":"\u6570\u636E\u660E\u7EC6","graph.reportTitle":"\u56FE\u8868\u62A5\u8868","graph.unassigned":"\u672A\u5206\u914D","graph.column.reportHours":"\u7533\u62A5\u5DE5\u65F6","graph.column.billableHours":"\u53EF\u8BA1\u8D39\u5DE5\u65F6","detail.searchAi.placeholder":"\u641C\u7D22\u5B57\u6BB5\uFF1B\u5982\u65E0\u7ED3\u679C\u5219\u81EA\u52A8\u89E6\u53D1 AI...","detail.searchAi.matches":"{count} \u6761\u5339\u914D\u7ED3\u679C","detail.searchAi.noMatch":"\u672A\u627E\u5230\u5339\u914D\u5B57\u6BB5\u3002","detail.searchAi.autoAiFallback":"\u672A\u547D\u4E2D\u5B57\u6BB5\uFF0C\u6B63\u5728\u89E6\u53D1 AI \u5206\u6790...","detail.searchAi.aiResultTitle":"AI \u5206\u6790\u7ED3\u679C","detail.table.title":"\u5173\u8054\u8BB0\u5F55","kanban.empty":"\u5C06\u5361\u7247\u62D6\u5230\u8FD9\u91CC","kanban.bucket.limit":"\u4E0A\u9650","kanban.bucket.dropHere":"\u91CA\u653E\u540E\u79FB\u52A8\u5230\u8BE5 bucket","kanban.card.progress":"\u8FDB\u5EA6","kanban.card.openDetail":"\u6253\u5F00\u8BE6\u60C5","kanban.priority.critical":"\u7D27\u6025","kanban.priority.high":"\u9AD8","kanban.priority.medium":"\u4E2D","kanban.priority.low":"\u4F4E","quickCreate.newItem":"\u65B0\u5EFA\u6761\u76EE","quickCreate.createWithTitle":"\u521B\u5EFA{title}","quickEdit.editWithTitle":"\u7F16\u8F91{title}","quickDelete.confirmTitle":"\u786E\u8BA4\u5220\u9664","quickDelete.confirmMessageSingle":"\u786E\u8BA4\u5220\u9664\u5F53\u524D\u9009\u4E2D\u8BB0\u5F55\u5417\uFF1F","quickDelete.confirmMessageMultiple":"\u786E\u8BA4\u5220\u9664\u5DF2\u9009\u4E2D\u7684 {count} \u6761\u8BB0\u5F55\u5417\uFF1F","messageBox.confirm":"\u786E\u5B9A","messageBox.cancel":"\u53D6\u6D88"},qf={"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}","navigation.mode.switchToFixed":"Basculer vers la navigation fixe","navigation.mode.switchToFloating":"Basculer vers la navigation flottante","table.toolbar.searchPlaceholder":"Rechercher...","table.title.default":"Tableau de donn\xE9es","table.toolbar.groupBy":"Grouper","table.toolbar.summary":"R\xE9sum\xE9","table.toolbar.columns":"Colonnes","table.toolbar.export":"Exporter","table.toolbar.itemsPerPage":"Lignes par page :","table.toolbar.pageOf":"Page {current} sur {total}","table.toolbar.newItem":"Nouvel \xE9l\xE9ment","table.toolbar.editItem":"Modifier l'\xE9l\xE9ment","table.toolbar.deleteItem":"Supprimer l'\xE9l\xE9ment","table.toolbar.graphicReport":"Rapport graphique","table.toolbar.saveLayout":"Enregistrer la vue","table.menu.groupBy":"Grouper","table.menu.clearAll":"Tout effacer","table.menu.visibleColumns":"Colonnes visibles","table.menu.showSummaryRow":"Afficher la ligne de r\xE9sum\xE9","table.menu.noNumericColumns":"Aucune colonne num\xE9rique","table.group.expandAll":"D\xE9velopper tous les groupes","table.group.collapseAll":"R\xE9duire tous les groupes","table.mobile.notImplemented":"Vue mobile non impl\xE9ment\xE9e","table.headerMenu.sortAsc":"Trier ascendant","table.headerMenu.sortDesc":"Trier descendant","table.headerMenu.clearSort":"Effacer le tri","table.headerMenu.configureSort":"Configurer le tri...","table.headerMenu.group":"Grouper par cette colonne","table.headerMenu.ungroup":"Retirer du groupement","table.headerMenu.addSummary":"Inclure dans le r\xE9sum\xE9","table.headerMenu.removeSummary":"Retirer du r\xE9sum\xE9","table.headerMenu.hideColumn":"Masquer la colonne","table.sortDialog.title":"Param\xE8tres de tri","table.sortDialog.empty":"Aucune r\xE8gle de tri. Ajoutez-en une pour commencer.","table.sortDialog.addRule":"Ajouter une r\xE8gle","table.sortDialog.clearAll":"Tout effacer","table.sortDialog.asc":"Ascendant","table.sortDialog.desc":"Descendant","pivot.title.default":"Tableau crois\xE9 dynamique","pivot.subtitle.default":"Faites glisser les champs pour configurer le tableau crois\xE9.","pivot.empty":"Ajoutez au moins un champ de valeur pour afficher le r\xE9sultat.","pivot.records":"Enregistrements","pivot.afterFilter":"Apr\xE8s filtre","pivot.grandTotal":"Total g\xE9n\xE9ral","pivot.resultLabel":"R\xE9sultat","pivot.valueLabel":"Valeur","pivot.table.dimensions":"Dimensions","pivot.config.title":"Configuration","pivot.fieldList":"Liste des champs","pivot.availableDimensions":"Dimensions disponibles","pivot.allFieldsInUse":"Tous les champs sont d\xE9j\xE0 utilis\xE9s.","pivot.zone.rows":"Lignes","pivot.zone.columns":"Colonnes","pivot.zone.filters":"Filtres","pivot.zone.values":"Valeurs","pivot.hint.rows":"D\xE9posez les champs ici pour construire la hi\xE9rarchie des lignes","pivot.hint.columns":"D\xE9posez les champs ici pour construire la hi\xE9rarchie des colonnes","pivot.hint.filters":"D\xE9posez les champs ici pour les filtres du rapport","pivot.hint.values":"D\xE9posez les champs num\xE9riques ici pour les agr\xE9gations","pivot.clearArea":"Vider la zone","pivot.filter.na":"N/A","pivot.filter.noValues":"Aucune valeur","pivot.filter.noneSelected":"Aucune s\xE9lection","pivot.filter.allValues":"Toutes les valeurs","pivot.filter.selectedCount":"{selected} / {total} s\xE9lectionn\xE9es","pivot.filter.selectAll":"Tout s\xE9lectionner","pivot.filter.deselectAll":"Tout d\xE9s\xE9lectionner","pivot.filter.noResults":"Aucun r\xE9sultat","pivot.collapse.ariaExpand":"D\xE9velopper la zone de configuration","pivot.collapse.ariaCollapse":"R\xE9duire la zone de configuration","pivot.agg.sum":"Somme","pivot.agg.count":"Compte","pivot.agg.avg":"Moyenne","pivot.agg.min":"Min","pivot.agg.max":"Max","pivot.preset.selectPlaceholder":"S\xE9lectionner un preset","pivot.preset.save":"Enregistrer le preset","pivot.preset.delete":"Supprimer le preset","pivot.preset.saveDialogTitle":"Enregistrer le preset actuel","pivot.preset.nameLabel":"Nom du preset","pivot.preset.defaultName":"Preset {index}","pivot.table.sectionTitle":"R\xE9sultat du pivot","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"D\xE9velopper le r\xE9sultat du pivot","pivot.table.collapse.ariaCollapse":"R\xE9duire le r\xE9sultat du pivot","pivot.chart.title":"Graphique pivot","pivot.chart.subtitle":"Associez une dimension et jusqu\u2019\xE0 deux mesures dans un graphique compact.","pivot.chart.subtitleReady":"{dimension} par {measure}","pivot.chart.emptyNoDimension":"Ajoutez au moins un champ de ligne ou de colonne pour afficher le graphique.","pivot.chart.emptyNoValue":"Ajoutez au moins un champ de valeur pour afficher le graphique.","pivot.chart.emptyNoData":"Aucune donn\xE9e disponible pour la s\xE9lection actuelle du graphique.","pivot.chart.dimension":"Dimension","pivot.chart.primaryMeasure":"Mesure","pivot.chart.secondaryMeasure":"Mesure de comparaison","pivot.chart.chartType":"Type de graphique","pivot.chart.style.barVertical":"Barres verticales","pivot.chart.style.barHorizontal":"Barres horizontales","pivot.chart.style.line":"Ligne","pivot.chart.style.scatter":"Nuage de points","pivot.chart.collapse.ariaExpand":"D\xE9velopper la zone du graphique","pivot.chart.collapse.ariaCollapse":"R\xE9duire la zone du graphique","smartFilter.adaptFilters":"Adapter les filtres","smartFilter.addFilters":"Ajouter des filtres","smartFilter.go":"Ex\xE9cuter","smartFilter.visibleFilters":"Filtres visibles","smartFilter.searchPlaceholder":"Rechercher...","smartFilter.noOptionsFound":"Aucune option trouv\xE9e","smartFilter.min":"Min","smartFilter.max":"Max","smartFilter.minMaxPlaceholder":"Min - Max","smartFilter.operator.equals":"\xC9gal \xE0","smartFilter.operator.contains":"Contient","smartFilter.operator.notContains":"Ne contient pas","smartFilter.operator.wildcard":"Recherche g\xE9n\xE9rique","smartFilter.operator.notEquals":"Diff\xE9rent de","smartFilter.operator.greaterThan":"Sup\xE9rieur \xE0","smartFilter.operator.lessThan":"Inf\xE9rieur \xE0","smartFilter.operator.greaterOrEqual":"Sup\xE9rieur ou \xE9gal","smartFilter.operator.lessOrEqual":"Inf\xE9rieur ou \xE9gal","smartFilter.operator.between":"Entre","variant.noOptions":"Aucune option","variant.defaultSuffix":"Par d\xE9faut","variant.selectVariant":"S\xE9lectionner une vue","variant.saveView":"Enregistrer la vue","variant.newVariant":"Nouvelle vue","variant.viewName":"Nom de la vue","variant.setDefault":"D\xE9finir par d\xE9faut","variant.publicAllUsers":"Public (tous les utilisateurs)","variant.toast.fetchFailed":"\xC9chec du chargement des vues","variant.toast.saveFailed":"\xC9chec de l'enregistrement de la vue","variant.toast.saveSuccess":"Vue enregistr\xE9e avec succ\xE8s","variant.toast.deleteFailed":"\xC9chec de la suppression de la vue","variant.toast.deleteSuccess":"Vue supprim\xE9e avec succ\xE8s","variant.toast.defaultFailed":"\xC9chec de la mise \xE0 jour de la vue par d\xE9faut","variant.toast.defaultSuccess":"Vue par d\xE9faut mise \xE0 jour","layout.saveLayout":"Enregistrer la vue","layout.layoutOptions":"Options de vue","layout.selectLayout":"S\xE9lectionner une vue","layout.saveCurrentLayout":"Enregistrer la vue actuelle...","layout.noSavedLayouts":"Aucune vue enregistr\xE9e","layout.removeDefault":"Retirer le d\xE9faut","layout.setAsDefault":"D\xE9finir par d\xE9faut","layout.layoutName":"Nom de la vue","layout.layoutDescription":"Description","layout.layoutNameHelper":"ex. : Vue compacte","layout.warningOverwrite":"Attention : la vue existante sera \xE9cras\xE9e","layout.useAsDefault":"Utiliser comme vue par d\xE9faut","layout.publicAllUsers":"Public (visible par tous les utilisateurs)","layout.toast.loadFallback":"\xC9chec du chargement depuis le backend, bascule vers le stockage local","layout.toast.saveSuccess":"Vue enregistr\xE9e avec succ\xE8s","layout.toast.saveLocalSuccess":"Vue enregistr\xE9e dans le stockage local","layout.toast.backendUnavailableSavedLocal":"Backend indisponible, enregistr\xE9 en local","layout.toast.deleteSuccess":"Vue supprim\xE9e avec succ\xE8s","layout.toast.deleteLocalSuccess":"Vue supprim\xE9e du stockage local","layout.toast.backendUnavailableDeletedLocal":"Backend indisponible, supprim\xE9 en local","layout.toast.defaultSuccess":"Vue par d\xE9faut d\xE9finie","layout.toast.defaultLocalSuccess":"Vue par d\xE9faut d\xE9finie en local","layout.toast.backendUnavailableDefaultLocal":"Backend indisponible, d\xE9faut enregistr\xE9 en local","dateRange.label":"Plage de dates","dateRange.startDate":"Date de d\xE9but","dateRange.endDate":"Date de fin","dateRange.select":"S\xE9lectionner...","dateRange.today":"Aujourd'hui","dateRange.thisWeek":"Cette semaine","dateRange.thisMonth":"Ce mois-ci","graph.records":"{count} enregistrements","graph.kpi.totalRecords":"Total des enregistrements","graph.kpi.totalReport":"Total d\xE9clar\xE9","graph.kpi.totalBillable":"Total facturable","graph.kpi.efficiency":"Efficacit\xE9","graph.kpi.amount":"Montant","graph.kpi.flagged":"Signal\xE9","graph.chart.billable.title":"Facturable par dimension","graph.chart.billable.subtitle":"Top valeurs par heures facturables","graph.chart.efficiency.title":"Efficacit\xE9 par personne","graph.chart.efficiency.subtitle":"Efficacit\xE9 la plus faible en premier","graph.chart.status.title":"R\xE9partition des statuts","graph.chart.status.subtitle":"Ratio des enregistrements par statut","graph.dataBody":"Donn\xE9es","graph.reportTitle":"Rapport graphique","graph.unassigned":"Non attribu\xE9","graph.column.reportHours":"Heures d\xE9clar\xE9es","graph.column.billableHours":"Heures facturables","detail.searchAi.placeholder":"Rechercher des champs, ou interroger l\u2019IA en cas d\u2019absence de r\xE9sultat...","detail.searchAi.matches":"{count} correspondances trouv\xE9es","detail.searchAi.noMatch":"Aucun champ correspondant trouv\xE9.","detail.searchAi.autoAiFallback":"Aucune correspondance directe. Analyse IA en cours...","detail.searchAi.aiResultTitle":"Analyse IA","detail.table.title":"Enregistrements li\xE9s","kanban.empty":"D\xE9posez les cartes ici","kanban.bucket.limit":"Limite","kanban.bucket.dropHere":"Rel\xE2chez pour d\xE9placer dans cette colonne","kanban.card.progress":"Progression","kanban.card.openDetail":"Ouvrir le d\xE9tail","kanban.priority.critical":"Critique","kanban.priority.high":"\xC9lev\xE9e","kanban.priority.medium":"Moyenne","kanban.priority.low":"Faible","quickCreate.newItem":"Nouvel \xE9l\xE9ment","quickCreate.createWithTitle":"Cr\xE9er {title}","quickEdit.editWithTitle":"Modifier {title}","quickDelete.confirmTitle":"Confirmer la suppression","quickDelete.confirmMessageSingle":"Voulez-vous vraiment supprimer l\u2019enregistrement s\xE9lectionn\xE9 ?","quickDelete.confirmMessageMultiple":"Voulez-vous vraiment supprimer les {count} enregistrements s\xE9lectionn\xE9s ?","messageBox.confirm":"OK","messageBox.cancel":"Annuler"},_f={"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","navigation.mode.switchToFixed":"Zu fester Navigation wechseln","navigation.mode.switchToFloating":"Zu schwebender Navigation wechseln","table.toolbar.searchPlaceholder":"Suchen...","table.title.default":"Datentabelle","table.toolbar.groupBy":"Gruppieren","table.toolbar.summary":"Zusammenfassung","table.toolbar.columns":"Spalten","table.toolbar.export":"Export","table.toolbar.itemsPerPage":"Zeilen pro Seite:","table.toolbar.pageOf":"Seite {current} von {total}","table.toolbar.newItem":"Neuer Eintrag","table.toolbar.editItem":"Eintrag bearbeiten","table.toolbar.deleteItem":"Eintrag l\xF6schen","table.toolbar.graphicReport":"Grafikbericht","table.toolbar.saveLayout":"Layout speichern","table.menu.groupBy":"Gruppieren","table.menu.clearAll":"Alles l\xF6schen","table.menu.visibleColumns":"Sichtbare Spalten","table.menu.showSummaryRow":"Summenzeile anzeigen","table.menu.noNumericColumns":"Keine numerischen Spalten","table.group.expandAll":"Alle Gruppen aufklappen","table.group.collapseAll":"Alle Gruppen zuklappen","table.mobile.notImplemented":"Mobile Ansicht nicht implementiert","table.headerMenu.sortAsc":"Aufsteigend sortieren","table.headerMenu.sortDesc":"Absteigend sortieren","table.headerMenu.clearSort":"Sortierung entfernen","table.headerMenu.configureSort":"Sortierung konfigurieren...","table.headerMenu.group":"Nach dieser Spalte gruppieren","table.headerMenu.ungroup":"Aus Gruppierung entfernen","table.headerMenu.addSummary":"In Summe einbeziehen","table.headerMenu.removeSummary":"Aus Summe entfernen","table.headerMenu.hideColumn":"Spalte ausblenden","table.sortDialog.title":"Sortiereinstellungen","table.sortDialog.empty":"Keine Sortierregeln. F\xFCgen Sie eine hinzu, um zu sortieren.","table.sortDialog.addRule":"Regel hinzuf\xFCgen","table.sortDialog.clearAll":"Alle l\xF6schen","table.sortDialog.asc":"Aufsteigend","table.sortDialog.desc":"Absteigend","pivot.title.default":"Pivot-Tabelle","pivot.subtitle.default":"Ziehen Sie Felder, um die Pivot-Tabelle zu konfigurieren.","pivot.empty":"Ziehen Sie mindestens ein Wertefeld, um das Ergebnis anzuzeigen.","pivot.records":"Datens\xE4tze","pivot.afterFilter":"Nach Filter","pivot.grandTotal":"Gesamtsumme","pivot.resultLabel":"Ergebnis","pivot.valueLabel":"Wert","pivot.table.dimensions":"Dimensionen","pivot.config.title":"Konfiguration","pivot.fieldList":"Feldliste","pivot.availableDimensions":"Verf\xFCgbare Dimensionen","pivot.allFieldsInUse":"Alle Felder sind bereits verwendet.","pivot.zone.rows":"Zeilen","pivot.zone.columns":"Spalten","pivot.zone.filters":"Filter","pivot.zone.values":"Werte","pivot.hint.rows":"Felder hierhin ziehen, um die Zeilenhierarchie zu erstellen","pivot.hint.columns":"Felder hierhin ziehen, um die Spaltenhierarchie zu erstellen","pivot.hint.filters":"Felder hierhin ziehen f\xFCr Berichtsfilter","pivot.hint.values":"Numerische Felder hierhin ziehen f\xFCr Aggregation","pivot.clearArea":"Bereich leeren","pivot.filter.na":"N/V","pivot.filter.noValues":"Keine Werte","pivot.filter.noneSelected":"Nichts ausgew\xE4hlt","pivot.filter.allValues":"Alle Werte","pivot.filter.selectedCount":"{selected} / {total} ausgew\xE4hlt","pivot.filter.selectAll":"Alle ausw\xE4hlen","pivot.filter.deselectAll":"Alle abw\xE4hlen","pivot.filter.noResults":"Keine Ergebnisse","pivot.collapse.ariaExpand":"Konfigurationsbereich erweitern","pivot.collapse.ariaCollapse":"Konfigurationsbereich reduzieren","pivot.agg.sum":"Summe","pivot.agg.count":"Anzahl","pivot.agg.avg":"Durchschnitt","pivot.agg.min":"Min","pivot.agg.max":"Max","pivot.preset.selectPlaceholder":"Preset w\xE4hlen","pivot.preset.save":"Preset speichern","pivot.preset.delete":"Preset l\xF6schen","pivot.preset.saveDialogTitle":"Aktuelles Preset speichern","pivot.preset.nameLabel":"Preset-Name","pivot.preset.defaultName":"Preset {index}","pivot.table.sectionTitle":"Pivot-Ergebnis","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"Pivot-Ergebnis erweitern","pivot.table.collapse.ariaCollapse":"Pivot-Ergebnis reduzieren","pivot.chart.title":"Pivot-Diagramm","pivot.chart.subtitle":"Eine Dimension und bis zu zwei Kennzahlen in einem kompakten Diagramm abbilden.","pivot.chart.subtitleReady":"{dimension} nach {measure}","pivot.chart.emptyNoDimension":"F\xFCgen Sie mindestens ein Zeilen- oder Spaltenfeld hinzu, um das Diagramm anzuzeigen.","pivot.chart.emptyNoValue":"F\xFCgen Sie mindestens ein Wertefeld hinzu, um das Diagramm anzuzeigen.","pivot.chart.emptyNoData":"F\xFCr die aktuelle Diagrammauswahl sind keine Daten verf\xFCgbar.","pivot.chart.dimension":"Dimension","pivot.chart.primaryMeasure":"Kennzahl","pivot.chart.secondaryMeasure":"Vergleichskennzahl","pivot.chart.chartType":"Diagrammtyp","pivot.chart.style.barVertical":"Vertikale Balken","pivot.chart.style.barHorizontal":"Horizontale Balken","pivot.chart.style.line":"Linie","pivot.chart.style.scatter":"Streudiagramm","pivot.chart.collapse.ariaExpand":"Diagrammbereich erweitern","pivot.chart.collapse.ariaCollapse":"Diagrammbereich reduzieren","smartFilter.adaptFilters":"Filter anpassen","smartFilter.addFilters":"Filter hinzuf\xFCgen","smartFilter.go":"Los","smartFilter.visibleFilters":"Sichtbare Filter","smartFilter.searchPlaceholder":"Suchen...","smartFilter.noOptionsFound":"Keine Optionen gefunden","smartFilter.min":"Min","smartFilter.max":"Max","smartFilter.minMaxPlaceholder":"Min - Max","smartFilter.operator.equals":"Gleich","smartFilter.operator.contains":"Enth\xE4lt","smartFilter.operator.notContains":"Enth\xE4lt nicht","smartFilter.operator.wildcard":"Wildcard-Suche","smartFilter.operator.notEquals":"Ungleich","smartFilter.operator.greaterThan":"Gr\xF6\xDFer als","smartFilter.operator.lessThan":"Kleiner als","smartFilter.operator.greaterOrEqual":"Gr\xF6\xDFer gleich","smartFilter.operator.lessOrEqual":"Kleiner gleich","smartFilter.operator.between":"Zwischen","variant.noOptions":"Keine Optionen","variant.defaultSuffix":"Standard","variant.selectVariant":"Variante w\xE4hlen","variant.saveView":"Ansicht speichern","variant.newVariant":"Neue Variante","variant.viewName":"Ansichtsname","variant.setDefault":"Als Standard setzen","variant.publicAllUsers":"\xD6ffentlich (alle Benutzer)","variant.toast.fetchFailed":"Varianten konnten nicht geladen werden","variant.toast.saveFailed":"Variante konnte nicht gespeichert werden","variant.toast.saveSuccess":"Variante erfolgreich gespeichert","variant.toast.deleteFailed":"Variante konnte nicht gel\xF6scht werden","variant.toast.deleteSuccess":"Variante erfolgreich gel\xF6scht","variant.toast.defaultFailed":"Standardvariante konnte nicht aktualisiert werden","variant.toast.defaultSuccess":"Standardvariante aktualisiert","layout.saveLayout":"Layout speichern","layout.layoutOptions":"Layout-Optionen","layout.selectLayout":"Layout w\xE4hlen","layout.saveCurrentLayout":"Aktuelles Layout speichern...","layout.noSavedLayouts":"Keine gespeicherten Layouts","layout.removeDefault":"Standard entfernen","layout.setAsDefault":"Als Standard setzen","layout.layoutName":"Layoutname","layout.layoutDescription":"Beschreibung","layout.layoutNameHelper":"z. B. Kompaktansicht","layout.warningOverwrite":"Warnung: Vorhandenes Layout wird \xFCberschrieben","layout.useAsDefault":"Als Standardlayout verwenden","layout.publicAllUsers":"\xD6ffentlich (f\xFCr alle sichtbar)","layout.toast.loadFallback":"Layouts konnten nicht vom Backend geladen werden, Wechsel zu lokalem Speicher","layout.toast.saveSuccess":"Layout erfolgreich gespeichert","layout.toast.saveLocalSuccess":"Layout im lokalen Speicher gespeichert","layout.toast.backendUnavailableSavedLocal":"Backend nicht verf\xFCgbar, lokal gespeichert","layout.toast.deleteSuccess":"Layout erfolgreich gel\xF6scht","layout.toast.deleteLocalSuccess":"Layout aus lokalem Speicher gel\xF6scht","layout.toast.backendUnavailableDeletedLocal":"Backend nicht verf\xFCgbar, lokal gel\xF6scht","layout.toast.defaultSuccess":"Standardlayout gesetzt","layout.toast.defaultLocalSuccess":"Standardlayout lokal gesetzt","layout.toast.backendUnavailableDefaultLocal":"Backend nicht verf\xFCgbar, Standard lokal gespeichert","dateRange.label":"Datumsbereich","dateRange.startDate":"Startdatum","dateRange.endDate":"Enddatum","dateRange.select":"Ausw\xE4hlen...","dateRange.today":"Heute","dateRange.thisWeek":"Diese Woche","dateRange.thisMonth":"Diesen Monat","graph.records":"{count} Datens\xE4tze","graph.kpi.totalRecords":"Gesamt Datens\xE4tze","graph.kpi.totalReport":"Gesamt Report","graph.kpi.totalBillable":"Gesamt abrechenbar","graph.kpi.efficiency":"Effizienz","graph.kpi.amount":"Betrag","graph.kpi.flagged":"Markiert","graph.chart.billable.title":"Abrechenbar nach Dimension","graph.chart.billable.subtitle":"Top-Werte nach abrechenbaren Stunden","graph.chart.efficiency.title":"Effizienz pro Person","graph.chart.efficiency.subtitle":"Niedrigste Effizienz zuerst","graph.chart.status.title":"Statusverteilung","graph.chart.status.subtitle":"Anteil je Status","graph.dataBody":"Datentabelle","graph.reportTitle":"Grafikbericht","graph.unassigned":"Nicht zugewiesen","graph.column.reportHours":"Melde-Stunden","graph.column.billableHours":"Abrechenbare Stunden","detail.searchAi.placeholder":"Felder suchen, oder bei keinem Treffer die KI fragen...","detail.searchAi.matches":"{count} Treffer gefunden","detail.searchAi.noMatch":"Kein passendes Feld gefunden.","detail.searchAi.autoAiFallback":"Keine direkte \xDCbereinstimmung. KI-Analyse wird gestartet...","detail.searchAi.aiResultTitle":"KI-Ergebnis","detail.table.title":"Verkn\xFCpfte Eintr\xE4ge","kanban.empty":"Karten hier ablegen","kanban.bucket.limit":"Limit","kanban.bucket.dropHere":"Loslassen, um in diese Spalte zu verschieben","kanban.card.progress":"Fortschritt","kanban.card.openDetail":"Detail \xF6ffnen","kanban.priority.critical":"Kritisch","kanban.priority.high":"Hoch","kanban.priority.medium":"Mittel","kanban.priority.low":"Niedrig","quickCreate.newItem":"Neuer Eintrag","quickCreate.createWithTitle":"{title} erstellen","quickEdit.editWithTitle":"{title} bearbeiten","quickDelete.confirmTitle":"L\xF6schen best\xE4tigen","quickDelete.confirmMessageSingle":"M\xF6chten Sie den ausgew\xE4hlten Datensatz wirklich l\xF6schen?","quickDelete.confirmMessageMultiple":"M\xF6chten Sie die {count} ausgew\xE4hlten Datens\xE4tze wirklich l\xF6schen?","messageBox.confirm":"OK","messageBox.cancel":"Abbrechen"},jf={"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","navigation.mode.switchToFixed":"\u56FA\u5B9A\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u306B\u5207\u308A\u66FF\u3048","navigation.mode.switchToFloating":"\u30D5\u30ED\u30FC\u30C6\u30A3\u30F3\u30B0\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u306B\u5207\u308A\u66FF\u3048","table.toolbar.searchPlaceholder":"\u691C\u7D22...","table.title.default":"\u30C7\u30FC\u30BF\u30C6\u30FC\u30D6\u30EB","table.toolbar.groupBy":"\u30B0\u30EB\u30FC\u30D7\u5316","table.toolbar.summary":"\u96C6\u8A08","table.toolbar.columns":"\u5217","table.toolbar.export":"\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8","table.toolbar.itemsPerPage":"1\u30DA\u30FC\u30B8\u306E\u4EF6\u6570\uFF1A","table.toolbar.pageOf":"{current} / {total} \u30DA\u30FC\u30B8","table.toolbar.newItem":"\u65B0\u898F\u4F5C\u6210","table.toolbar.editItem":"\u7DE8\u96C6","table.toolbar.deleteItem":"\u524A\u9664","table.toolbar.graphicReport":"\u30B0\u30E9\u30D5\u30A3\u30C3\u30AF\u30EC\u30DD\u30FC\u30C8","table.toolbar.saveLayout":"\u30EC\u30A4\u30A2\u30A6\u30C8\u4FDD\u5B58","table.menu.groupBy":"\u30B0\u30EB\u30FC\u30D7\u5316","table.menu.clearAll":"\u3059\u3079\u3066\u30AF\u30EA\u30A2","table.menu.visibleColumns":"\u8868\u793A\u5217","table.menu.showSummaryRow":"\u96C6\u8A08\u884C\u3092\u8868\u793A","table.menu.noNumericColumns":"\u6570\u5024\u5217\u304C\u3042\u308A\u307E\u305B\u3093","table.group.expandAll":"\u3059\u3079\u3066\u306E\u30B0\u30EB\u30FC\u30D7\u3092\u5C55\u958B","table.group.collapseAll":"\u3059\u3079\u3066\u306E\u30B0\u30EB\u30FC\u30D7\u3092\u6298\u308A\u305F\u305F\u3080","table.mobile.notImplemented":"\u30E2\u30D0\u30A4\u30EB\u8868\u793A\u306F\u672A\u5B9F\u88C5\u3067\u3059","table.headerMenu.sortAsc":"\u6607\u9806\u3067\u4E26\u3079\u66FF\u3048","table.headerMenu.sortDesc":"\u964D\u9806\u3067\u4E26\u3079\u66FF\u3048","table.headerMenu.clearSort":"\u4E26\u3079\u66FF\u3048\u3092\u89E3\u9664","table.headerMenu.configureSort":"\u4E26\u3079\u66FF\u3048\u3092\u8A2D\u5B9A...","table.headerMenu.group":"\u3053\u306E\u5217\u3067\u30B0\u30EB\u30FC\u30D7\u5316","table.headerMenu.ungroup":"\u30B0\u30EB\u30FC\u30D7\u304B\u3089\u5916\u3059","table.headerMenu.addSummary":"\u96C6\u8A08\u306B\u8FFD\u52A0","table.headerMenu.removeSummary":"\u96C6\u8A08\u304B\u3089\u524A\u9664","table.headerMenu.hideColumn":"\u5217\u3092\u975E\u8868\u793A","table.sortDialog.title":"\u4E26\u3079\u66FF\u3048\u8A2D\u5B9A","table.sortDialog.empty":"\u4E26\u3079\u66FF\u3048\u30EB\u30FC\u30EB\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","table.sortDialog.addRule":"\u30EB\u30FC\u30EB\u3092\u8FFD\u52A0","table.sortDialog.clearAll":"\u3059\u3079\u3066\u30AF\u30EA\u30A2","table.sortDialog.asc":"\u6607\u9806","table.sortDialog.desc":"\u964D\u9806","pivot.title.default":"\u30D4\u30DC\u30C3\u30C8\u30C6\u30FC\u30D6\u30EB","pivot.subtitle.default":"\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u30D4\u30DC\u30C3\u30C8\u30C6\u30FC\u30D6\u30EB\u3092\u8A2D\u5B9A\u3057\u307E\u3059\u3002","pivot.empty":"\u7D50\u679C\u3092\u8868\u793A\u3059\u308B\u306B\u306F\u3001\u5024\u30A8\u30EA\u30A2\u306B\u5C11\u306A\u304F\u3068\u30821\u3064\u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","pivot.records":"\u30EC\u30B3\u30FC\u30C9","pivot.afterFilter":"\u30D5\u30A3\u30EB\u30BF\u30FC\u5F8C","pivot.grandTotal":"\u7DCF\u8A08","pivot.resultLabel":"\u7D50\u679C","pivot.valueLabel":"\u5024","pivot.table.dimensions":"\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3","pivot.config.title":"\u8A2D\u5B9A","pivot.fieldList":"\u30D5\u30A3\u30FC\u30EB\u30C9\u4E00\u89A7","pivot.availableDimensions":"\u5229\u7528\u53EF\u80FD\u306A\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3","pivot.allFieldsInUse":"\u3059\u3079\u3066\u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u304C\u4F7F\u7528\u4E2D\u3067\u3059\u3002","pivot.zone.rows":"\u884C","pivot.zone.columns":"\u5217","pivot.zone.filters":"\u30D5\u30A3\u30EB\u30BF\u30FC","pivot.zone.values":"\u5024","pivot.hint.rows":"\u3053\u3053\u306B\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u884C\u968E\u5C64\u3092\u4F5C\u6210","pivot.hint.columns":"\u3053\u3053\u306B\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u5217\u968E\u5C64\u3092\u4F5C\u6210","pivot.hint.filters":"\u3053\u3053\u306B\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u30EC\u30DD\u30FC\u30C8\u30D5\u30A3\u30EB\u30BF\u30FC\u3092\u8A2D\u5B9A","pivot.hint.values":"\u3053\u3053\u306B\u6570\u5024\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u96C6\u8A08","pivot.clearArea":"\u30A8\u30EA\u30A2\u3092\u30AF\u30EA\u30A2","pivot.filter.na":"N/A","pivot.filter.noValues":"\u5024\u304C\u3042\u308A\u307E\u305B\u3093","pivot.filter.noneSelected":"\u672A\u9078\u629E","pivot.filter.allValues":"\u3059\u3079\u3066\u306E\u5024","pivot.filter.selectedCount":"{selected} / {total} \u3092\u9078\u629E","pivot.filter.selectAll":"\u3059\u3079\u3066\u9078\u629E","pivot.filter.deselectAll":"\u3059\u3079\u3066\u89E3\u9664","pivot.filter.noResults":"\u7D50\u679C\u304C\u3042\u308A\u307E\u305B\u3093","pivot.collapse.ariaExpand":"\u8A2D\u5B9A\u30A8\u30EA\u30A2\u3092\u5C55\u958B","pivot.collapse.ariaCollapse":"\u8A2D\u5B9A\u30A8\u30EA\u30A2\u3092\u6298\u308A\u305F\u305F\u3080","pivot.agg.sum":"\u5408\u8A08","pivot.agg.count":"\u4EF6\u6570","pivot.agg.avg":"\u5E73\u5747","pivot.agg.min":"\u6700\u5C0F","pivot.agg.max":"\u6700\u5927","pivot.preset.selectPlaceholder":"\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u9078\u629E","pivot.preset.save":"\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u4FDD\u5B58","pivot.preset.delete":"\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u524A\u9664","pivot.preset.saveDialogTitle":"\u73FE\u5728\u306E\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u4FDD\u5B58","pivot.preset.nameLabel":"\u30D7\u30EA\u30BB\u30C3\u30C8\u540D","pivot.preset.defaultName":"\u30D7\u30EA\u30BB\u30C3\u30C8 {index}","pivot.table.sectionTitle":"\u30D4\u30DC\u30C3\u30C8\u7D50\u679C","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"\u30D4\u30DC\u30C3\u30C8\u7D50\u679C\u3092\u5C55\u958B","pivot.table.collapse.ariaCollapse":"\u30D4\u30DC\u30C3\u30C8\u7D50\u679C\u3092\u6298\u308A\u305F\u305F\u3080","pivot.chart.title":"\u30D4\u30DC\u30C3\u30C8\u30C1\u30E3\u30FC\u30C8","pivot.chart.subtitle":"1\u3064\u306E\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3\u3068\u6700\u59272\u3064\u306E\u6307\u6A19\u3092\u30B3\u30F3\u30D1\u30AF\u30C8\u306A\u30C1\u30E3\u30FC\u30C8\u306B\u307E\u3068\u3081\u307E\u3059\u3002","pivot.chart.subtitleReady":"{dimension} \u3054\u3068\u306E {measure}","pivot.chart.emptyNoDimension":"\u30C1\u30E3\u30FC\u30C8\u3092\u8868\u793A\u3059\u308B\u306B\u306F\u3001\u5C11\u306A\u304F\u3068\u30821\u3064\u306E\u884C\u307E\u305F\u306F\u5217\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","pivot.chart.emptyNoValue":"\u30C1\u30E3\u30FC\u30C8\u3092\u8868\u793A\u3059\u308B\u306B\u306F\u3001\u5C11\u306A\u304F\u3068\u30821\u3064\u306E\u5024\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","pivot.chart.emptyNoData":"\u73FE\u5728\u306E\u30C1\u30E3\u30FC\u30C8\u9078\u629E\u3067\u306F\u8868\u793A\u3067\u304D\u308B\u30C7\u30FC\u30BF\u304C\u3042\u308A\u307E\u305B\u3093\u3002","pivot.chart.dimension":"\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3","pivot.chart.primaryMeasure":"\u6307\u6A19","pivot.chart.secondaryMeasure":"\u6BD4\u8F03\u6307\u6A19","pivot.chart.chartType":"\u30C1\u30E3\u30FC\u30C8\u7A2E\u5225","pivot.chart.style.barVertical":"\u7E26\u68D2\u30B0\u30E9\u30D5","pivot.chart.style.barHorizontal":"\u6A2A\u68D2\u30B0\u30E9\u30D5","pivot.chart.style.line":"\u6298\u308C\u7DDA\u30B0\u30E9\u30D5","pivot.chart.style.scatter":"\u6563\u5E03\u56F3","pivot.chart.collapse.ariaExpand":"\u30C1\u30E3\u30FC\u30C8\u9818\u57DF\u3092\u5C55\u958B","pivot.chart.collapse.ariaCollapse":"\u30C1\u30E3\u30FC\u30C8\u9818\u57DF\u3092\u6298\u308A\u305F\u305F\u3080","smartFilter.adaptFilters":"\u30D5\u30A3\u30EB\u30BF\u30FC\u8ABF\u6574","smartFilter.addFilters":"\u30D5\u30A3\u30EB\u30BF\u30FC\u8FFD\u52A0","smartFilter.go":"\u5B9F\u884C","smartFilter.visibleFilters":"\u8868\u793A\u30D5\u30A3\u30EB\u30BF\u30FC","smartFilter.searchPlaceholder":"\u691C\u7D22...","smartFilter.noOptionsFound":"\u30AA\u30D7\u30B7\u30E7\u30F3\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093","smartFilter.min":"\u6700\u5C0F","smartFilter.max":"\u6700\u5927","smartFilter.minMaxPlaceholder":"\u6700\u5C0F - \u6700\u5927","smartFilter.operator.equals":"\u7B49\u3057\u3044","smartFilter.operator.contains":"\u542B\u3080","smartFilter.operator.notContains":"\u542B\u307E\u306A\u3044","smartFilter.operator.wildcard":"\u30EF\u30A4\u30EB\u30C9\u30AB\u30FC\u30C9\u691C\u7D22","smartFilter.operator.notEquals":"\u7B49\u3057\u304F\u306A\u3044","smartFilter.operator.greaterThan":"\u3088\u308A\u5927\u304D\u3044","smartFilter.operator.lessThan":"\u3088\u308A\u5C0F\u3055\u3044","smartFilter.operator.greaterOrEqual":"\u4EE5\u4E0A","smartFilter.operator.lessOrEqual":"\u4EE5\u4E0B","smartFilter.operator.between":"\u7BC4\u56F2","variant.noOptions":"\u30AA\u30D7\u30B7\u30E7\u30F3\u306A\u3057","variant.defaultSuffix":"\u30C7\u30D5\u30A9\u30EB\u30C8","variant.selectVariant":"\u30D3\u30E5\u30FC\u3092\u9078\u629E","variant.saveView":"\u30D3\u30E5\u30FC\u4FDD\u5B58","variant.newVariant":"\u65B0\u3057\u3044\u30D3\u30E5\u30FC","variant.viewName":"\u30D3\u30E5\u30FC\u540D","variant.setDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u306B\u8A2D\u5B9A","variant.publicAllUsers":"\u516C\u958B\uFF08\u5168\u30E6\u30FC\u30B6\u30FC\uFF09","variant.toast.fetchFailed":"\u30D3\u30E5\u30FC\u306E\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.saveFailed":"\u30D3\u30E5\u30FC\u306E\u4FDD\u5B58\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.saveSuccess":"\u30D3\u30E5\u30FC\u3092\u4FDD\u5B58\u3057\u307E\u3057\u305F","variant.toast.deleteFailed":"\u30D3\u30E5\u30FC\u306E\u524A\u9664\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.deleteSuccess":"\u30D3\u30E5\u30FC\u3092\u524A\u9664\u3057\u307E\u3057\u305F","variant.toast.defaultFailed":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30D3\u30E5\u30FC\u306E\u66F4\u65B0\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.defaultSuccess":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30D3\u30E5\u30FC\u3092\u66F4\u65B0\u3057\u307E\u3057\u305F","layout.saveLayout":"\u30EC\u30A4\u30A2\u30A6\u30C8\u4FDD\u5B58","layout.layoutOptions":"\u30EC\u30A4\u30A2\u30A6\u30C8\u30AA\u30D7\u30B7\u30E7\u30F3","layout.selectLayout":"\u30EC\u30A4\u30A2\u30A6\u30C8\u9078\u629E","layout.saveCurrentLayout":"\u73FE\u5728\u306E\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u4FDD\u5B58...","layout.noSavedLayouts":"\u4FDD\u5B58\u6E08\u307F\u30EC\u30A4\u30A2\u30A6\u30C8\u306A\u3057","layout.removeDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u89E3\u9664","layout.setAsDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u306B\u8A2D\u5B9A","layout.layoutName":"\u30EC\u30A4\u30A2\u30A6\u30C8\u540D","layout.layoutDescription":"\u8AAC\u660E","layout.layoutNameHelper":"\u4F8B\uFF1A\u30B3\u30F3\u30D1\u30AF\u30C8\u8868\u793A","layout.warningOverwrite":"\u8B66\u544A\uFF1A\u65E2\u5B58\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u4E0A\u66F8\u304D\u3057\u307E\u3059","layout.useAsDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30EC\u30A4\u30A2\u30A6\u30C8\u3068\u3057\u3066\u4F7F\u7528","layout.publicAllUsers":"\u516C\u958B\uFF08\u5168\u30E6\u30FC\u30B6\u30FC\u306B\u8868\u793A\uFF09","layout.toast.loadFallback":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u304B\u3089\u306E\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u3001\u30ED\u30FC\u30AB\u30EB\u4FDD\u5B58\u306B\u5207\u308A\u66FF\u3048\u307E\u3057\u305F","layout.toast.saveSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u4FDD\u5B58\u3057\u307E\u3057\u305F","layout.toast.saveLocalSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u4FDD\u5B58\u3057\u307E\u3057\u305F","layout.toast.backendUnavailableSavedLocal":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u672A\u63A5\u7D9A\u306E\u305F\u3081\u30ED\u30FC\u30AB\u30EB\u306B\u4FDD\u5B58\u3057\u307E\u3057\u305F","layout.toast.deleteSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u524A\u9664\u3057\u307E\u3057\u305F","layout.toast.deleteLocalSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u304B\u3089\u524A\u9664\u3057\u307E\u3057\u305F","layout.toast.backendUnavailableDeletedLocal":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u672A\u63A5\u7D9A\u306E\u305F\u3081\u30ED\u30FC\u30AB\u30EB\u304B\u3089\u524A\u9664\u3057\u307E\u3057\u305F","layout.toast.defaultSuccess":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u8A2D\u5B9A\u3057\u307E\u3057\u305F","layout.toast.defaultLocalSuccess":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u306B\u8A2D\u5B9A\u3057\u307E\u3057\u305F","layout.toast.backendUnavailableDefaultLocal":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u672A\u63A5\u7D9A\u306E\u305F\u3081\u30C7\u30D5\u30A9\u30EB\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u4FDD\u5B58\u3057\u307E\u3057\u305F","dateRange.label":"\u65E5\u4ED8\u7BC4\u56F2","dateRange.startDate":"\u958B\u59CB\u65E5","dateRange.endDate":"\u7D42\u4E86\u65E5","dateRange.select":"\u9078\u629E...","dateRange.today":"\u4ECA\u65E5","dateRange.thisWeek":"\u4ECA\u9031","dateRange.thisMonth":"\u4ECA\u6708","graph.records":"{count} \u4EF6","graph.kpi.totalRecords":"\u7DCF\u30EC\u30B3\u30FC\u30C9","graph.kpi.totalReport":"\u7DCF\u5831\u544A\u6642\u9593","graph.kpi.totalBillable":"\u7DCF\u8ACB\u6C42\u53EF\u80FD\u6642\u9593","graph.kpi.efficiency":"\u52B9\u7387","graph.kpi.amount":"\u91D1\u984D","graph.kpi.flagged":"\u8981\u78BA\u8A8D","graph.chart.billable.title":"\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3\u5225\u8ACB\u6C42\u53EF\u80FD\u6642\u9593","graph.chart.billable.subtitle":"\u8ACB\u6C42\u53EF\u80FD\u6642\u9593\u306E\u4E0A\u4F4D","graph.chart.efficiency.title":"\u62C5\u5F53\u8005\u5225\u52B9\u7387","graph.chart.efficiency.subtitle":"\u52B9\u7387\u306E\u4F4E\u3044\u9806","graph.chart.status.title":"\u30B9\u30C6\u30FC\u30BF\u30B9\u5206\u5E03","graph.chart.status.subtitle":"\u30B9\u30C6\u30FC\u30BF\u30B9\u5225\u6BD4\u7387","graph.dataBody":"\u30C7\u30FC\u30BF\u672C\u4F53","graph.reportTitle":"\u30B0\u30E9\u30D5\u30A3\u30C3\u30AF\u30EC\u30DD\u30FC\u30C8","graph.unassigned":"\u672A\u5272\u308A\u5F53\u3066","graph.column.reportHours":"\u5831\u544A\u6642\u9593","graph.column.billableHours":"\u8ACB\u6C42\u53EF\u80FD\u6642\u9593","detail.searchAi.placeholder":"\u9805\u76EE\u3092\u691C\u7D22\u3002\u898B\u3064\u304B\u3089\u306A\u3044\u5834\u5408\u306FAI\u306B\u8CEA\u554F\u3057\u307E\u3059...","detail.searchAi.matches":"{count} \u4EF6\u306E\u4E00\u81F4","detail.searchAi.noMatch":"\u4E00\u81F4\u3059\u308B\u9805\u76EE\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002","detail.searchAi.autoAiFallback":"\u4E00\u81F4\u306A\u3057\u3002AI\u5206\u6790\u3092\u5B9F\u884C\u3057\u307E\u3059...","detail.searchAi.aiResultTitle":"AI\u5206\u6790\u7D50\u679C","detail.table.title":"\u95A2\u9023\u30EC\u30B3\u30FC\u30C9","kanban.empty":"\u3053\u3053\u306B\u30AB\u30FC\u30C9\u3092\u30C9\u30ED\u30C3\u30D7","kanban.bucket.limit":"\u4E0A\u9650","kanban.bucket.dropHere":"\u96E2\u3059\u3068\u3053\u306E bucket \u306B\u79FB\u52D5\u3057\u307E\u3059","kanban.card.progress":"\u9032\u6357","kanban.card.openDetail":"\u8A73\u7D30\u3092\u958B\u304F","kanban.priority.critical":"\u7DCA\u6025","kanban.priority.high":"\u9AD8","kanban.priority.medium":"\u4E2D","kanban.priority.low":"\u4F4E","quickCreate.newItem":"\u65B0\u898F\u4F5C\u6210","quickCreate.createWithTitle":"{title} \u3092\u4F5C\u6210","quickEdit.editWithTitle":"{title} \u3092\u7DE8\u96C6","quickDelete.confirmTitle":"\u524A\u9664\u306E\u78BA\u8A8D","quickDelete.confirmMessageSingle":"\u9078\u629E\u3057\u305F\u30EC\u30B3\u30FC\u30C9\u3092\u524A\u9664\u3057\u3066\u3082\u3088\u308D\u3057\u3044\u3067\u3059\u304B\uFF1F","quickDelete.confirmMessageMultiple":"\u9078\u629E\u3057\u305F {count} \u4EF6\u306E\u30EC\u30B3\u30FC\u30C9\u3092\u524A\u9664\u3057\u3066\u3082\u3088\u308D\u3057\u3044\u3067\u3059\u304B\uFF1F","messageBox.confirm":"OK","messageBox.cancel":"\u30AD\u30E3\u30F3\u30BB\u30EB"},Zf={"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","navigation.mode.switchToFixed":"\uACE0\uC815 \uD0D0\uC0C9\uC73C\uB85C \uC804\uD658","navigation.mode.switchToFloating":"\uD50C\uB85C\uD305 \uD0D0\uC0C9\uC73C\uB85C \uC804\uD658","table.toolbar.searchPlaceholder":"\uAC80\uC0C9...","table.title.default":"\uB370\uC774\uD130 \uD14C\uC774\uBE14","table.toolbar.groupBy":"\uADF8\uB8F9","table.toolbar.summary":"\uC694\uC57D","table.toolbar.columns":"\uC5F4","table.toolbar.export":"\uB0B4\uBCF4\uB0B4\uAE30","table.toolbar.itemsPerPage":"\uD398\uC774\uC9C0\uB2F9 \uD589 \uC218:","table.toolbar.pageOf":"{current} / {total} \uD398\uC774\uC9C0","table.toolbar.newItem":"\uC2E0\uADDC \uD56D\uBAA9","table.toolbar.editItem":"\uD56D\uBAA9 \uC218\uC815","table.toolbar.deleteItem":"\uD56D\uBAA9 \uC0AD\uC81C","table.toolbar.graphicReport":"\uADF8\uB798\uD504 \uB9AC\uD3EC\uD2B8","table.toolbar.saveLayout":"\uB808\uC774\uC544\uC6C3 \uC800\uC7A5","table.menu.groupBy":"\uADF8\uB8F9","table.menu.clearAll":"\uBAA8\uB450 \uC9C0\uC6B0\uAE30","table.menu.visibleColumns":"\uD45C\uC2DC \uC5F4","table.menu.showSummaryRow":"\uC694\uC57D \uD589 \uD45C\uC2DC","table.menu.noNumericColumns":"\uC22B\uC790 \uC5F4 \uC5C6\uC74C","table.group.expandAll":"\uBAA8\uB4E0 \uADF8\uB8F9 \uD3BC\uCE58\uAE30","table.group.collapseAll":"\uBAA8\uB4E0 \uADF8\uB8F9 \uC811\uAE30","table.mobile.notImplemented":"\uBAA8\uBC14\uC77C \uBDF0\uB294 \uC544\uC9C1 \uAD6C\uD604\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4","table.headerMenu.sortAsc":"\uC624\uB984\uCC28\uC21C \uC815\uB82C","table.headerMenu.sortDesc":"\uB0B4\uB9BC\uCC28\uC21C \uC815\uB82C","table.headerMenu.clearSort":"\uC815\uB82C \uD574\uC81C","table.headerMenu.configureSort":"\uC815\uB82C \uC124\uC815...","table.headerMenu.group":"\uC774 \uC5F4\uB85C \uADF8\uB8F9\uD654","table.headerMenu.ungroup":"\uADF8\uB8F9\uC5D0\uC11C \uC81C\uAC70","table.headerMenu.addSummary":"\uC694\uC57D\uC5D0 \uCD94\uAC00","table.headerMenu.removeSummary":"\uC694\uC57D\uC5D0\uC11C \uC81C\uAC70","table.headerMenu.hideColumn":"\uC5F4 \uC228\uAE30\uAE30","table.sortDialog.title":"\uC815\uB82C \uC124\uC815","table.sortDialog.empty":"\uC815\uB82C \uADDC\uCE59\uC774 \uC5C6\uC2B5\uB2C8\uB2E4. \uCD94\uAC00\uD558\uC138\uC694.","table.sortDialog.addRule":"\uADDC\uCE59 \uCD94\uAC00","table.sortDialog.clearAll":"\uBAA8\uB450 \uC9C0\uC6B0\uAE30","table.sortDialog.asc":"\uC624\uB984\uCC28\uC21C","table.sortDialog.desc":"\uB0B4\uB9BC\uCC28\uC21C","pivot.title.default":"\uD53C\uBC97 \uD14C\uC774\uBE14","pivot.subtitle.default":"\uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uD53C\uBC97 \uD14C\uC774\uBE14\uC744 \uAD6C\uC131\uD558\uC138\uC694.","pivot.empty":"\uACB0\uACFC\uB97C \uBCF4\uB824\uBA74 \uAC12 \uC601\uC5ED\uC5D0 \uCD5C\uC18C \uD55C \uAC1C\uC758 \uD544\uB4DC\uB97C \uCD94\uAC00\uD558\uC138\uC694.","pivot.records":"\uB808\uCF54\uB4DC","pivot.afterFilter":"\uD544\uD130 \uD6C4","pivot.grandTotal":"\uCD1D\uD569","pivot.resultLabel":"\uACB0\uACFC","pivot.valueLabel":"\uAC12","pivot.table.dimensions":"\uCC28\uC6D0","pivot.config.title":"\uAD6C\uC131","pivot.fieldList":"\uD544\uB4DC \uBAA9\uB85D","pivot.availableDimensions":"\uC0AC\uC6A9 \uAC00\uB2A5\uD55C \uCC28\uC6D0","pivot.allFieldsInUse":"\uBAA8\uB4E0 \uD544\uB4DC\uAC00 \uC774\uBBF8 \uC0AC\uC6A9 \uC911\uC785\uB2C8\uB2E4.","pivot.zone.rows":"\uD589","pivot.zone.columns":"\uC5F4","pivot.zone.filters":"\uD544\uD130","pivot.zone.values":"\uAC12","pivot.hint.rows":"\uC5EC\uAE30\uC5D0 \uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uD589 \uACC4\uCE35\uC744 \uAD6C\uC131","pivot.hint.columns":"\uC5EC\uAE30\uC5D0 \uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uC5F4 \uACC4\uCE35\uC744 \uAD6C\uC131","pivot.hint.filters":"\uC5EC\uAE30\uC5D0 \uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uBCF4\uACE0\uC11C \uD544\uD130\uB85C \uC0AC\uC6A9","pivot.hint.values":"\uC22B\uC790 \uD544\uB4DC\uB97C \uC5EC\uAE30\uC5D0 \uB4DC\uB798\uADF8\uD558\uC5EC \uC9D1\uACC4","pivot.clearArea":"\uC601\uC5ED \uBE44\uC6B0\uAE30","pivot.filter.na":"\uD574\uB2F9 \uC5C6\uC74C","pivot.filter.noValues":"\uAC12 \uC5C6\uC74C","pivot.filter.noneSelected":"\uC120\uD0DD \uC5C6\uC74C","pivot.filter.allValues":"\uBAA8\uB4E0 \uAC12","pivot.filter.selectedCount":"{selected} / {total} \uC120\uD0DD\uB428","pivot.filter.selectAll":"\uC804\uCCB4 \uC120\uD0DD","pivot.filter.deselectAll":"\uC804\uCCB4 \uD574\uC81C","pivot.filter.noResults":"\uAC80\uC0C9 \uACB0\uACFC \uC5C6\uC74C","pivot.collapse.ariaExpand":"\uAD6C\uC131 \uC601\uC5ED \uD3BC\uCE58\uAE30","pivot.collapse.ariaCollapse":"\uAD6C\uC131 \uC601\uC5ED \uC811\uAE30","pivot.agg.sum":"\uD569\uACC4","pivot.agg.count":"\uAC1C\uC218","pivot.agg.avg":"\uD3C9\uADE0","pivot.agg.min":"\uCD5C\uC18C","pivot.agg.max":"\uCD5C\uB300","pivot.preset.selectPlaceholder":"\uD504\uB9AC\uC14B \uC120\uD0DD","pivot.preset.save":"\uD504\uB9AC\uC14B \uC800\uC7A5","pivot.preset.delete":"\uD504\uB9AC\uC14B \uC0AD\uC81C","pivot.preset.saveDialogTitle":"\uD604\uC7AC \uD504\uB9AC\uC14B \uC800\uC7A5","pivot.preset.nameLabel":"\uD504\uB9AC\uC14B \uC774\uB984","pivot.preset.defaultName":"\uD504\uB9AC\uC14B {index}","pivot.table.sectionTitle":"\uD53C\uBC97 \uACB0\uACFC","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"\uD53C\uBC97 \uACB0\uACFC \uD3BC\uCE58\uAE30","pivot.table.collapse.ariaCollapse":"\uD53C\uBC97 \uACB0\uACFC \uC811\uAE30","pivot.chart.title":"\uD53C\uBC97 \uCC28\uD2B8","pivot.chart.subtitle":"\uD558\uB098\uC758 \uCC28\uC6D0\uACFC \uCD5C\uB300 \uB450 \uAC1C\uC758 \uCE21\uC815\uAC12\uC744 \uAC04\uACB0\uD55C \uCC28\uD2B8\uB85C \uD45C\uC2DC\uD569\uB2C8\uB2E4.","pivot.chart.subtitleReady":"{dimension}\uBCC4 {measure}","pivot.chart.emptyNoDimension":"\uCC28\uD2B8\uB97C \uBCF4\uB824\uBA74 \uCD5C\uC18C \uD55C \uAC1C\uC758 \uD589 \uB610\uB294 \uC5F4 \uD544\uB4DC\uB97C \uCD94\uAC00\uD558\uC138\uC694.","pivot.chart.emptyNoValue":"\uCC28\uD2B8\uB97C \uBCF4\uB824\uBA74 \uCD5C\uC18C \uD55C \uAC1C\uC758 \uAC12 \uD544\uB4DC\uB97C \uCD94\uAC00\uD558\uC138\uC694.","pivot.chart.emptyNoData":"\uD604\uC7AC \uCC28\uD2B8 \uC120\uD0DD\uC5D0 \uD45C\uC2DC\uD560 \uB370\uC774\uD130\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.","pivot.chart.dimension":"\uCC28\uD2B8 \uCC28\uC6D0","pivot.chart.primaryMeasure":"\uC8FC \uCE21\uC815\uAC12","pivot.chart.secondaryMeasure":"\uBE44\uAD50 \uCE21\uC815\uAC12","pivot.chart.chartType":"\uCC28\uD2B8 \uC720\uD615","pivot.chart.style.barVertical":"\uC138\uB85C \uB9C9\uB300","pivot.chart.style.barHorizontal":"\uAC00\uB85C \uB9C9\uB300","pivot.chart.style.line":"\uC120\uD615 \uCC28\uD2B8","pivot.chart.style.scatter":"\uC0B0\uC810\uB3C4","pivot.chart.collapse.ariaExpand":"\uCC28\uD2B8 \uC601\uC5ED \uD3BC\uCE58\uAE30","pivot.chart.collapse.ariaCollapse":"\uCC28\uD2B8 \uC601\uC5ED \uC811\uAE30","smartFilter.adaptFilters":"\uD544\uD130 \uC870\uC815","smartFilter.addFilters":"\uD544\uD130 \uCD94\uAC00","smartFilter.go":"\uC2E4\uD589","smartFilter.visibleFilters":"\uD45C\uC2DC \uD544\uD130","smartFilter.searchPlaceholder":"\uAC80\uC0C9...","smartFilter.noOptionsFound":"\uC635\uC158\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4","smartFilter.min":"\uCD5C\uC18C","smartFilter.max":"\uCD5C\uB300","smartFilter.minMaxPlaceholder":"\uCD5C\uC18C - \uCD5C\uB300","smartFilter.operator.equals":"\uAC19\uC74C","smartFilter.operator.contains":"\uD3EC\uD568","smartFilter.operator.notContains":"\uBBF8\uD3EC\uD568","smartFilter.operator.wildcard":"\uC640\uC77C\uB4DC\uCE74\uB4DC \uAC80\uC0C9","smartFilter.operator.notEquals":"\uAC19\uC9C0 \uC54A\uC74C","smartFilter.operator.greaterThan":"\uBCF4\uB2E4 \uD07C","smartFilter.operator.lessThan":"\uBCF4\uB2E4 \uC791\uC74C","smartFilter.operator.greaterOrEqual":"\uC774\uC0C1","smartFilter.operator.lessOrEqual":"\uC774\uD558","smartFilter.operator.between":"\uBC94\uC704","variant.noOptions":"\uC635\uC158 \uC5C6\uC74C","variant.defaultSuffix":"\uAE30\uBCF8","variant.selectVariant":"\uBDF0 \uC120\uD0DD","variant.saveView":"\uBDF0 \uC800\uC7A5","variant.newVariant":"\uC0C8 \uBDF0","variant.viewName":"\uBDF0 \uC774\uB984","variant.setDefault":"\uAE30\uBCF8\uC73C\uB85C \uC124\uC815","variant.publicAllUsers":"\uACF5\uAC1C(\uC804\uCCB4 \uC0AC\uC6A9\uC790)","variant.toast.fetchFailed":"\uBDF0\uB97C \uBD88\uB7EC\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.saveFailed":"\uBDF0\uB97C \uC800\uC7A5\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.saveSuccess":"\uBDF0\uAC00 \uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4","variant.toast.deleteFailed":"\uBDF0\uB97C \uC0AD\uC81C\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.deleteSuccess":"\uBDF0\uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4","variant.toast.defaultFailed":"\uAE30\uBCF8 \uBDF0\uB97C \uC5C5\uB370\uC774\uD2B8\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.defaultSuccess":"\uAE30\uBCF8 \uBDF0\uAC00 \uC5C5\uB370\uC774\uD2B8\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.saveLayout":"\uB808\uC774\uC544\uC6C3 \uC800\uC7A5","layout.layoutOptions":"\uB808\uC774\uC544\uC6C3 \uC635\uC158","layout.selectLayout":"\uB808\uC774\uC544\uC6C3 \uC120\uD0DD","layout.saveCurrentLayout":"\uD604\uC7AC \uB808\uC774\uC544\uC6C3 \uC800\uC7A5...","layout.noSavedLayouts":"\uC800\uC7A5\uB41C \uB808\uC774\uC544\uC6C3 \uC5C6\uC74C","layout.removeDefault":"\uAE30\uBCF8 \uD574\uC81C","layout.setAsDefault":"\uAE30\uBCF8\uC73C\uB85C \uC124\uC815","layout.layoutName":"\uB808\uC774\uC544\uC6C3 \uC774\uB984","layout.layoutDescription":"\uC124\uBA85","layout.layoutNameHelper":"\uC608: \uCEF4\uD329\uD2B8 \uBDF0","layout.warningOverwrite":"\uACBD\uACE0: \uAE30\uC874 \uB808\uC774\uC544\uC6C3\uC774 \uB36E\uC5B4\uC4F0\uAE30 \uB429\uB2C8\uB2E4","layout.useAsDefault":"\uAE30\uBCF8 \uB808\uC774\uC544\uC6C3\uC73C\uB85C \uC0AC\uC6A9","layout.publicAllUsers":"\uACF5\uAC1C(\uBAA8\uB4E0 \uC0AC\uC6A9\uC790\uC5D0\uAC8C \uD45C\uC2DC)","layout.toast.loadFallback":"\uBC31\uC5D4\uB4DC\uC5D0\uC11C \uB808\uC774\uC544\uC6C3\uC744 \uBD88\uB7EC\uC624\uC9C0 \uBABB\uD574 \uB85C\uCEEC \uC800\uC7A5\uC18C\uB85C \uC804\uD658\uD588\uC2B5\uB2C8\uB2E4","layout.toast.saveSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.saveLocalSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uB85C\uCEEC \uC800\uC7A5\uC18C\uC5D0 \uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.backendUnavailableSavedLocal":"\uBC31\uC5D4\uB4DC\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC5B4 \uB85C\uCEEC\uC5D0 \uC800\uC7A5\uD588\uC2B5\uB2C8\uB2E4","layout.toast.deleteSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.deleteLocalSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uB85C\uCEEC \uC800\uC7A5\uC18C\uC5D0\uC11C \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.backendUnavailableDeletedLocal":"\uBC31\uC5D4\uB4DC\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC5B4 \uB85C\uCEEC\uC5D0\uC11C \uC0AD\uC81C\uD588\uC2B5\uB2C8\uB2E4","layout.toast.defaultSuccess":"\uAE30\uBCF8 \uB808\uC774\uC544\uC6C3\uC774 \uC124\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.defaultLocalSuccess":"\uAE30\uBCF8 \uB808\uC774\uC544\uC6C3\uC774 \uB85C\uCEEC\uC5D0 \uC124\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.backendUnavailableDefaultLocal":"\uBC31\uC5D4\uB4DC\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC5B4 \uAE30\uBCF8\uAC12\uC744 \uB85C\uCEEC\uC5D0 \uC800\uC7A5\uD588\uC2B5\uB2C8\uB2E4","dateRange.label":"\uB0A0\uC9DC \uBC94\uC704","dateRange.startDate":"\uC2DC\uC791\uC77C","dateRange.endDate":"\uC885\uB8CC\uC77C","dateRange.select":"\uC120\uD0DD...","dateRange.today":"\uC624\uB298","dateRange.thisWeek":"\uC774\uBC88 \uC8FC","dateRange.thisMonth":"\uC774\uBC88 \uB2EC","graph.records":"{count}\uAC74","graph.kpi.totalRecords":"\uCD1D \uB808\uCF54\uB4DC","graph.kpi.totalReport":"\uCD1D \uBCF4\uACE0 \uC2DC\uAC04","graph.kpi.totalBillable":"\uCD1D \uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04","graph.kpi.efficiency":"\uD6A8\uC728","graph.kpi.amount":"\uAE08\uC561","graph.kpi.flagged":"\uD50C\uB798\uADF8","graph.chart.billable.title":"\uCC28\uC6D0\uBCC4 \uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04","graph.chart.billable.subtitle":"\uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04 \uC0C1\uC704 \uAC12","graph.chart.efficiency.title":"\uB2F4\uB2F9\uC790\uBCC4 \uD6A8\uC728","graph.chart.efficiency.subtitle":"\uB0AE\uC740 \uD6A8\uC728 \uC6B0\uC120","graph.chart.status.title":"\uC0C1\uD0DC \uBD84\uD3EC","graph.chart.status.subtitle":"\uC0C1\uD0DC\uBCC4 \uBE44\uC728","graph.dataBody":"\uB370\uC774\uD130 \uBCF8\uBB38","graph.reportTitle":"\uADF8\uB798\uD504 \uB9AC\uD3EC\uD2B8","graph.unassigned":"\uBBF8\uC9C0\uC815","graph.column.reportHours":"\uBCF4\uACE0 \uC2DC\uAC04","graph.column.billableHours":"\uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04","detail.searchAi.placeholder":"\uD544\uB4DC\uB97C \uAC80\uC0C9\uD558\uACE0, \uACB0\uACFC\uAC00 \uC5C6\uC73C\uBA74 AI\uC5D0 \uC9C8\uBB38\uD558\uC138\uC694...","detail.searchAi.matches":"{count}\uAC1C \uC77C\uCE58 \uD56D\uBAA9","detail.searchAi.noMatch":"\uC77C\uCE58\uD558\uB294 \uD544\uB4DC\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.","detail.searchAi.autoAiFallback":"\uC77C\uCE58 \uD56D\uBAA9\uC774 \uC5C6\uC5B4 AI \uBD84\uC11D\uC744 \uC2E4\uD589\uD569\uB2C8\uB2E4...","detail.searchAi.aiResultTitle":"AI \uBD84\uC11D \uACB0\uACFC","detail.table.title":"\uAD00\uB828 \uB808\uCF54\uB4DC","kanban.empty":"\uC5EC\uAE30\uC5D0 \uCE74\uB4DC\uB97C \uB193\uC73C\uC138\uC694","kanban.bucket.limit":"\uD55C\uB3C4","kanban.bucket.dropHere":"\uB193\uC73C\uBA74 \uC774 \uBC84\uD0B7\uC73C\uB85C \uC774\uB3D9\uD569\uB2C8\uB2E4","kanban.card.progress":"\uC9C4\uD589\uB960","kanban.card.openDetail":"\uC0C1\uC138 \uC5F4\uAE30","kanban.priority.critical":"\uAE34\uAE09","kanban.priority.high":"\uB192\uC74C","kanban.priority.medium":"\uBCF4\uD1B5","kanban.priority.low":"\uB0AE\uC74C","quickCreate.newItem":"\uC2E0\uADDC \uD56D\uBAA9","quickCreate.createWithTitle":"{title} \uC0DD\uC131","quickEdit.editWithTitle":"{title} \uC218\uC815","quickDelete.confirmTitle":"\uC0AD\uC81C \uD655\uC778","quickDelete.confirmMessageSingle":"\uC120\uD0DD\uD55C \uD56D\uBAA9\uC744 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?","quickDelete.confirmMessageMultiple":"\uC120\uD0DD\uD55C {count}\uAC1C \uD56D\uBAA9\uC744 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?","messageBox.confirm":"\uD655\uC778","messageBox.cancel":"\uCDE8\uC18C"},Wn={en:Uf,zh:Kf,fr:qf,de:_f,ja:jf,ko:Zf};var Gd=(e,t)=>t?e.replace(/\{(\w+)\}/g,(o,a)=>{let r=t[a];return r==null?"":String(r)}):e,Jf={locale:"en",t:(e,t)=>Gd(Wn.en[e]||e,t)},Ud=Et.createContext(Jf),Wi=({locale:e="en",messages:t,children:o})=>{let a=Et.useMemo(()=>{let r=Wn[e]||Wn.en,n=t?.[e]||{},i={...Wn.en,...r,...n};return {locale:e,t:(c,d)=>Gd(i[c]||c,d)}},[e,t]);return jsxRuntime.jsx(Ud.Provider,{value:a,children:o})},re=()=>Et.useContext(Ud);function Vs({items:e,onItemClick:t,className:o="",level:a=0,expandedIds:r,onToggleExpand:n,colorMode:i="light"}){let{t:c}=re(),d=i==="dark",s=navigation.usePathname(),[l,g]=Et.useState(false),[f,p]=Et.useState(new Set),b=r!==void 0&&n!==void 0,v=b?r:f;Et.useEffect(()=>{g(true);},[]);let u=m=>{if(b)n(m);else {let h=new Set(f);h.has(m)?h.delete(m):h.add(m),p(h);}},w=m=>{m.children&&m.children.length>0&&u(m.id),t&&t(m);};return !e||!Array.isArray(e)?jsxRuntime.jsx("div",{className:No("tree-menu",o),children:jsxRuntime.jsx("div",{className:"text-sm text-gray-500 p-2",children:c("navigation.noItems")})}):jsxRuntime.jsx("div",{className:No("tree-menu",o),children:e.map(m=>{let h=v.has(m.id)||m.isExpanded,y=m.children&&m.children.length>0,k=m.appurl||m.href,E=l&&k?s===k:false;return jsxRuntime.jsxs("div",{className:"tree-menu-item relative",children:[E&&jsxRuntime.jsx("div",{className:No("absolute left-0 top-2 bottom-2 w-[3px] rounded-r-full z-10",d?"bg-[#90caf9]":"bg-[#1976d2]")}),jsxRuntime.jsxs(zs,{variant:"ghost",className:No("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:()=>w(m),children:[y&&jsxRuntime.jsx("div",{className:No("flex-shrink-0 transition-transform duration-200",h&&"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"})}),!y&&jsxRuntime.jsx("div",{className:"w-4 h-4 flex-shrink-0"}),m.icon&&jsxRuntime.jsx("div",{className:No("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:No("text-sm truncate transition-colors duration-200",E?"font-semibold":"font-medium"),children:m.title||m.label}),m.description&&jsxRuntime.jsx("div",{className:No("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})]})]}),y&&jsxRuntime.jsx("div",{className:No("grid transition-[grid-template-rows] duration-300 ease-in-out",h?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:jsxRuntime.jsx("div",{className:"overflow-hidden",children:jsxRuntime.jsx(Vs,{items:m.children,onItemClick:t,level:a+1,expandedIds:r,onToggleExpand:n,colorMode:i})})})]},m.id)})})}var Hs=({collapsed:e,onToggle:t,className:o="",maxHeight:a,menuData:r=[],colorMode:n="light",displayMode:i="fixed",onDisplayModeChange:c,showDisplayModeToggle:d=true})=>{let{t:s}=re(),l=n==="dark",g=i==="floating",f=Et__namespace.default.useId().replace(/:/g,""),p=`orbcafe-nav-mode-arc-${f}`,b=`orbcafe-nav-mode-glow-${f}`,v=navigation.useRouter(),[u,w]=Et.useState(""),[m,h]=Et.useState(new Set);Et.useEffect(()=>{e&&h(new Set);},[e]);let y=Et.useCallback(I=>{let T=[],S=A=>{A.forEach(M=>{T.push(M.id),M.children&&S(M.children);});};return S(I),T},[]),k=Et.useMemo(()=>{if(!u.trim())return r;let I=T=>T.reduce((S,A)=>{let M=A.title?.toLowerCase().includes(u.toLowerCase())||A.description?.toLowerCase().includes(u.toLowerCase()),D=A.children?I(A.children):[];return (M||D.length>0)&&S.push({...A,children:D.length>0?D:A.children}),S},[]);return I(r)},[u,r]),E=Et.useMemo(()=>u.trim()?new Set(y(r)):m,[u,r,m,y]),R=Et.useCallback(async I=>{if(console.log("\u{1F5B1}\uFE0F \u5BFC\u822A\u83DC\u5355\u9879\u70B9\u51FB:",I),I.id==="chat"||I.appurl==="/chat"){console.log("\u{1F4AC} \u68C0\u6D4B\u5230chat\u83DC\u5355\u70B9\u51FB\uFF0C\u8DF3\u8F6C\u5230\u65B0\u7684\u804A\u5929\u89C6\u56FE");try{v.push("/chat?new=true");}catch(S){console.error("\u274C \u65E0\u6CD5\u8DF3\u8F6C\u5230\u65B0\u804A\u5929\u89C6\u56FE:",S),v.push("/chat");}return}let T=I.appurl||I.href;T&&(T.startsWith("http://")||T.startsWith("https://")?window.open(T,"_blank"):v.push(T));},[v]),C=Et.useCallback(()=>{c?.(i==="fixed"?"floating":"fixed");},[i,c]);return jsxRuntime.jsxs("div",{className:`flex flex-col backdrop-blur-xl border ${g?"shadow-[0_28px_80px_rgba(15,23,42,0.34)]":"shadow-[0_4px_8px_0_rgba(31,38,135,0.1)]"} ${e?"w-14 rounded-full":"w-[234px] rounded-2xl"} relative ${o} ${l?g?"border-white/25":"bg-[#111111] border-white/10":g?"border-white/70":"bg-white/70 border-white/30"}`,style:{backdropFilter:g?"blur(34px) saturate(230%) contrast(1.12)":"blur(16px) saturate(180%)",WebkitBackdropFilter:g?"blur(34px) saturate(230%) contrast(1.12)":"blur(16px) saturate(180%)",backgroundColor:g?l?"rgba(8, 12, 18, 0.34)":"rgba(255, 255, 255, 0.24)":void 0,backgroundImage:g?l?"radial-gradient(circle at 28% 8%, rgba(255,255,255,0.14), rgba(255,255,255,0) 44%), linear-gradient(145deg, rgba(255,255,255,0.08), rgba(255,255,255,0.015) 50%, rgba(33,188,255,0.05))":"radial-gradient(circle at 28% 8%, rgba(255,255,255,0.42), rgba(255,255,255,0) 46%), linear-gradient(145deg, rgba(255,255,255,0.22), rgba(255,255,255,0.07) 50%, rgba(33,188,255,0.08))":void 0,boxShadow:g?l?"inset 0 1px 0 rgba(255,255,255,0.20), inset 0 -1px 0 rgba(255,255,255,0.08), 0 26px 90px rgba(0,0,0,0.52), 0 0 0 1px rgba(255,255,255,0.06)":"inset 0 1px 0 rgba(255,255,255,0.88), inset 0 -1px 0 rgba(255,255,255,0.34), 0 26px 90px rgba(15,23,42,0.24), 0 0 0 1px rgba(255,255,255,0.35)":void 0,transition:"width 400ms cubic-bezier(0.4, 0.0, 0.2, 1), border-radius 0ms cubic-bezier(0.4, 0.0, 0.2, 1), box-shadow 400ms ease-out, background-color 220ms ease-out, backdrop-filter 220ms ease-out",maxHeight: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 ${l?"text-gray-300 hover:bg-gray-800":"text-gray-500 hover:bg-gray-50"}`,title:s("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:s("navigation.searchPlaceholder"),value:u,onChange:I=>w(I.target.value),className:`w-full pl-10 pr-4 py-2 text-sm border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent ${l?"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 ${l?"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:k.length===0?jsxRuntime.jsx("div",{className:"flex items-center justify-center py-8 text-gray-500 text-sm",children:e?"\u{1F4C2}":s(u?"navigation.noMatch":"navigation.noAccessibleApp")}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[!e&&jsxRuntime.jsx("div",{className:`transition-opacity duration-300 ${e?"opacity-0":"opacity-100 delay-200"}`,children:jsxRuntime.jsx(Vs,{items:k,onItemClick:R,className:"space-y-1",expandedIds:E,colorMode:n,onToggleExpand:I=>{let T=new Set(m);k.some(A=>A.id===I)?T.has(I)?T.delete(I):(k.forEach(A=>{A.id!==I&&T.has(A.id)&&T.delete(A.id);}),T.add(I)):T.has(I)?T.delete(I):T.add(I),h(T);}})}),e&&jsxRuntime.jsx("div",{className:"space-y-2",children:r.map(I=>jsxRuntime.jsx("div",{className:"space-y-1",children:jsxRuntime.jsx("button",{onClick:()=>{t();let T=new Set([I.id]);h(T);},className:`w-full flex items-center justify-center p-2 rounded-lg cursor-pointer transition-colors duration-200 ${l?"text-gray-400 hover:bg-gray-800":"text-gray-600 hover:bg-gray-50"}`,title:s("navigation.expandView",{title:I.title||""}),children:I.icon||jsxRuntime.jsx("div",{className:`w-6 h-6 rounded text-xs flex items-center justify-center font-medium ${l?"bg-[#90caf9] text-[#0b0b0b]":"bg-[#1976d2] text-white"}`,children:I.title?.charAt(0)||"?"})})},I.id))})]})}),!e&&jsxRuntime.jsx("button",{onClick:t,className:`absolute -bottom-1 -right-1 w-6 h-6 bg-transparent rounded-full flex items-center justify-center transition-all duration-300 ease-in-out z-20 ${l?"hover:bg-gray-800/50":"hover:bg-white/20"}`,title:s("navigation.collapse"),children:jsxRuntime.jsx("div",{className:"absolute",style:{bottom:"0px",right:"0px",width:"16px",height:"16px",overflow:"hidden"},children:jsxRuntime.jsx("div",{className:l?"border-yellow-400":"",style:{width:"32px",height:"32px",borderRadius:"16px",border:"3px solid #21BCFF",backgroundColor:"transparent",position:"absolute",top:"-16px",left:"-16px"}})})}),d&&e&&jsxRuntime.jsx("button",{type:"button",onClick:C,className:"absolute -bottom-5 left-1/2 z-30 flex h-11 -translate-x-1/2 items-end justify-center rounded-full bg-transparent px-2 pb-1 transition-opacity duration-200 hover:opacity-95 focus:outline-none focus:ring-2 focus:ring-cyan-400/70",style:{width:"62px",touchAction:"manipulation"},title:s(g?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),"aria-label":s(g?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),children:jsxRuntime.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 118 34",preserveAspectRatio:"none",className:"h-[34px] w-full overflow-visible",children:[jsxRuntime.jsxs("defs",{children:[jsxRuntime.jsxs("linearGradient",{id:p,x1:"0",x2:"1",y1:"0",y2:"0",children:[jsxRuntime.jsx("stop",{offset:"0%",stopColor:"#21BCFF"}),jsxRuntime.jsx("stop",{offset:"52%",stopColor:"#7C3AED"}),jsxRuntime.jsx("stop",{offset:"100%",stopColor:"#F59E0B"})]}),jsxRuntime.jsxs("filter",{id:b,x:"-70%",y:"-180%",width:"240%",height:"460%",children:[jsxRuntime.jsx("feGaussianBlur",{stdDeviation:"8.5",result:"coloredBlur"}),jsxRuntime.jsxs("feMerge",{children:[jsxRuntime.jsx("feMergeNode",{in:"coloredBlur"}),jsxRuntime.jsx("feMergeNode",{in:"SourceGraphic"})]})]})]}),jsxRuntime.jsx("path",{d:"M8 4 C27 21 91 21 110 4",fill:"none",stroke:`url(#${p})`,strokeLinecap:"round",strokeWidth:"18",opacity:g?.28:.2,filter:`url(#${b})`}),jsxRuntime.jsx("path",{d:"M8 4 C27 21 91 21 110 4",fill:"none",stroke:`url(#${p})`,strokeLinecap:"round",strokeWidth:"12",opacity:g?.4:.3,filter:`url(#${b})`}),jsxRuntime.jsx("path",{d:"M8 4 C27 21 91 21 110 4",fill:"none",stroke:`url(#${p})`,strokeLinecap:"round",strokeWidth:"6",opacity:g?.34:.25,filter:`url(#${b})`}),jsxRuntime.jsx("path",{d:"M8 4 C27 21 91 21 110 4",fill:"none",stroke:`url(#${p})`,strokeLinecap:"round",strokeWidth:"1",opacity:g?.28:.18})]})})]})};var Xd=(e={})=>{let{initialCollapsed:t=false,initialDisplayMode:o="fixed",content:a=[]}=e,[r,n]=Et.useState(t),[i,c]=Et.useState(o),[d,s]=Et.useState(a),l=Et.useCallback(()=>{n(p=>!p);},[]),g=Et.useCallback(()=>{c(p=>p==="fixed"?"floating":"fixed");},[]),f=Et.useMemo(()=>({collapsed:r,onToggle:l,menuData:d,displayMode:i,onDisplayModeChange:c}),[r,l,d,i,c]);return {collapsed:r,setCollapsed:n,toggleCollapsed:l,displayMode:i,setDisplayMode:c,toggleDisplayMode:g,menuData:d,setMenuData:s,navigationIslandProps:f}};var Zo=e=>jsxRuntime.jsx(material.Button,{...e,variant:e.variant||"contained",size:e.size||"medium",sx:{textTransform:"none",...e.sx}});var $s=class{constructor(){Hd(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);}},xa=new $s,WI={success:(e,t)=>xa.show("success",e,t),error:(e,t)=>xa.show("error",e,t),warning:(e,t)=>xa.show("warning",e,t),info:(e,t)=>xa.show("info",e,t),show:(e,t,o)=>xa.show(e,t,o),hide:()=>xa.hide()};var Ch={success:{icon:jsxRuntime.jsx(bh__default.default,{sx:{fontSize:40}}),color:"#e8f5e9",iconColor:"#66bb6a",borderColor:"#a5d6a7"},warning:{icon:jsxRuntime.jsx(yh__default.default,{sx:{fontSize:40}}),color:"#fff3e0",iconColor:"#ffa726",borderColor:"#ffcc80"},error:{icon:jsxRuntime.jsx(xh__default.default,{sx:{fontSize:40}}),color:"#ffebee",iconColor:"#ef5350",borderColor:"#ef9a9a"},info:{icon:jsxRuntime.jsx(vh__default.default,{sx:{fontSize:40}}),color:"#e3f2fd",iconColor:"#42a5f5",borderColor:"#90caf9"},default:{icon:null,color:"transparent",iconColor:"inherit",borderColor:"transparent"}},$n=({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}=re(),g=n||l("messageBox.confirm"),f=i||l("messageBox.cancel"),p=()=>{r?r():a();},b=Ch[s],v=s!=="default";return jsxRuntime.jsxs(Sp__default.default,{open:e,onClose:a,maxWidth:d,fullWidth:true,PaperProps:{sx:{borderRadius:3,...v&&{borderTop:`6px solid ${b.iconColor}`}}},children:[v&&jsxRuntime.jsx(li__default.default,{sx:{display:"flex",justifyContent:"center",pt:3,color:b.iconColor},children:b.icon}),t&&jsxRuntime.jsx(wp__default.default,{sx:{textAlign:v?"center":"left",pt:v?1:2},children:t}),jsxRuntime.jsx(Tp__default.default,{sx:{textAlign:v?"center":"left"},children:typeof o=="string"?jsxRuntime.jsx(gh__default.default,{children:o}):o}),jsxRuntime.jsxs(Ip__default.default,{sx:{justifyContent:v?"center":"flex-end",pb:3,px:3},children:[c&&jsxRuntime.jsx(Zo,{onClick:a,variant:"text",color:"inherit",children:f}),jsxRuntime.jsx(Zo,{onClick:p,variant:"contained",sx:{bgcolor:v?b.iconColor:void 0,"&:hover":{bgcolor:v?b.iconColor:void 0,filter:"brightness(0.9)"}},autoFocus:true,children:g})]})]})},rP=()=>{let[e,t]=Et__namespace.default.useState(null),[o,a]=Et__namespace.default.useState(false);Et__namespace.default.useEffect(()=>{let i=c=>{c?(t(c),a(true)):(a(false),t(null));};return xa.register(i),()=>xa.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($n,{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 zh=[{field:"value",label:"Value",minWidth:120},{field:"label",label:"Description",minWidth:180}],ru=e=>Array.isArray(e)?e:e==null||e===""?[]:[e],la=e=>String(e),nu=(e,t)=>e[t],iu=e=>{let t=e.value??e.id??e.key??e.code;return typeof t=="number"||typeof t=="string"?t:""},Nh=e=>{let t=e.label??e.description??e.name??e.title;return String(typeof t=="number"||typeof t=="string"?t:iu(e))},Vh=e=>{let t=e.description??e.subtitle;return typeof t=="number"||typeof t=="string"?String(t):void 0},lu=({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:p=[],displayValue:b,getOptionValue:v=iu,getOptionLabel:u=Nh,getOptionDescription:w=Vh,onChange:m,onSearch:h,disabled:y,InputProps:k,onKeyDown:E,...R})=>{let C=a==="multiple",[I,T]=Et.useState(false),[S,A]=Et.useState(""),[M,D]=Et.useState(null),[B,Z]=Et.useState(false),[O,K]=Et.useState(()=>ru(e)),te=Et.useMemo(()=>o&&o.length>0?o:zh,[o]),se=M??t,_=Et.useMemo(()=>{let j=[...p,...t,...M??[]],de=new Map;return j.forEach(De=>{de.set(la(v(De)),De);}),de},[v,t,M,p]),$=Et.useMemo(()=>ru(e),[e]);Et.useEffect(()=>{I||K($);},[I,$]);let ue=Et.useMemo(()=>{let j=S.trim().toLowerCase();if(!j||h)return se;let de=te.filter(De=>De.searchable!==false);return se.filter(De=>[v(De),u(De),w(De),...de.map(G=>nu(De,G.field))].some(G=>String(G??"").toLowerCase().includes(j)))},[se,w,u,v,h,S,te]),Re=Et.useMemo(()=>{if(b!==void 0)return b;if($.length===0)return "";let j=de=>{let De=_.get(la(de));if(!De)return String(de);let Ve=u(De);return Ve&&Ve!==String(de)?`${de} - ${Ve}`:String(de)};return C?$.length>2?`${$.length} selected`:$.map(j).join(", "):j($[0])},[b,u,C,_,$]),Ae=Et.useCallback(async()=>{if(h){Z(true);try{let j=await h(S);Array.isArray(j)&&D(j);}finally{Z(false);}}},[h,S]),ae=()=>{y||(K($),T(true));},ve=()=>{T(false);},Pe=()=>{m?.(C?[]:null,C?[]:null),K([]);},lt=j=>{let de=v(j);if(C){K(De=>De.some(G=>la(G)===la(de))?De.filter(G=>la(G)!==la(de)):[...De,de]);return}K([de]);},Xe=()=>{let j=O.map(de=>_.get(la(de))).filter(de=>!!de);C?m?.(O,j):m?.(O[0]??null,j[0]??null),T(false);},Le=j=>{if(j.key==="F4"){j.preventDefault(),ae();return}E?.(j);},$e=g||B,Ne=$.length>0;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.TextField,{...R,disabled:y,value:Re,onKeyDown:Le,InputProps:{...k,readOnly:true,endAdornment:jsxRuntime.jsxs(material.InputAdornment,{position:"end",children:[$e?jsxRuntime.jsx(material.CircularProgress,{size:18}):null,f&&Ne&&!y?jsxRuntime.jsx(material.Tooltip,{title:c,children:jsxRuntime.jsx(material.IconButton,{size:"small",edge:"end","aria-label":c,onClick:Pe,children:jsxRuntime.jsx(Fh__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:ae,disabled:y,children:jsxRuntime.jsx(au__default.default,{fontSize:"small"})})})})]})}}),jsxRuntime.jsxs(material.Dialog,{open:I,onClose:ve,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}),C?jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",sx:{mt:.25},children:`${O.length} selected`}):null]}),jsxRuntime.jsx(material.IconButton,{"aria-label":"Close",onClick:ve,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:S,placeholder:n,onChange:j=>A(j.target.value),onKeyDown:j=>{j.key==="Enter"&&(j.preventDefault(),Ae());},InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(au__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}})}}),h?jsxRuntime.jsx(material.Button,{variant:"outlined",onClick:()=>{Ae();},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}`})}),te.map(j=>jsxRuntime.jsx(material.TableCell,{align:j.align,sx:de=>({minWidth:j.minWidth,width:j.width,fontSize:"0.78rem",fontWeight:800,bgcolor:de.palette.mode==="dark"?"#111111":de.palette.background.paper,borderBottom:`1px solid ${de.palette.divider}`}),children:j.label},String(j.field)))]})}),jsxRuntime.jsxs(material.TableBody,{children:[ue.map(j=>{let de=v(j),De=O.some(Ve=>la(Ve)===la(de));return jsxRuntime.jsxs(material.TableRow,{hover:true,selected:De,onClick:()=>lt(j),onDoubleClick:()=>{C||(K([de]),m?.(de,j),T(false));},sx:Ve=>({cursor:"pointer","&.Mui-selected":{bgcolor:styles.alpha(Ve.palette.primary.main,Ve.palette.mode==="dark"?.22:.12)},"&.Mui-selected:hover":{bgcolor:styles.alpha(Ve.palette.primary.main,Ve.palette.mode==="dark"?.28:.18)}}),children:[jsxRuntime.jsx(material.TableCell,{padding:"checkbox",children:jsxRuntime.jsx(material.Checkbox,{size:"small",checked:De})}),te.map(Ve=>{let G=nu(j,Ve.field);return jsxRuntime.jsx(material.TableCell,{align:Ve.align,sx:{fontSize:"0.82rem",py:1},children:Ve.render?Ve.render(G,j):String(G??"")},String(Ve.field))})]},la(de))}),ue.length===0?jsxRuntime.jsx(material.TableRow,{children:jsxRuntime.jsx(material.TableCell,{colSpan:te.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&&(Ne||O.length>0)?jsxRuntime.jsx(material.Button,{onClick:Pe,children:c}):null,jsxRuntime.jsx(material.Box,{sx:{flex:1}}),jsxRuntime.jsx(material.Button,{onClick:ve,children:d}),jsxRuntime.jsx(material.Button,{variant:"contained",onClick:Xe,disabled:!C&&O.length===0,children:i})]})]})]})};var su=({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 Gi=e=>{let{t}=re(),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,p=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:b=>e.setFilterText(b.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(au__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:b=>e.onRowsPerPageChange?.(Number(b.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(b=>jsxRuntime.jsx(material.MenuItem,{value:b,sx:{fontSize:o},children:b===-1?t("common.all"):b},`rows-per-page-${b}`))}),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(nb__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:!p,sx:{p:.35,color:"text.primary"},children:jsxRuntime.jsx(If__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((b,v)=>jsxRuntime.jsx(Et__namespace.default.Fragment,{children:b},`toolbar-custom-${v}`))}),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:b=>e.setGroupAnchorEl(b.currentTarget),children:jsxRuntime.jsx(material.Badge,{badgeContent:e.grouping?.length,color:"primary",children:jsxRuntime.jsx(Jh__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:b=>e.setSummaryAnchorEl(b.currentTarget),children:jsxRuntime.jsx(eb__default.default,{})})}),jsxRuntime.jsx(material.Tooltip,{title:t("table.toolbar.columns"),children:jsxRuntime.jsx(material.IconButton,{sx:{color:"text.primary"},onClick:b=>e.setAnchorEl(b.currentTarget),children:jsxRuntime.jsx(Xh__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(Qh__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(Su__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(ab__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(rb__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(tb__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:b=>e.onLayoutSave(b),children:jsxRuntime.jsx(yp__default.default,{})})}),e.layoutManager]})]})};var Ui=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:o}=e;return "translate3d("+(t?Math.round(t):0)+"px, "+(o?Math.round(o):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:o}=e;return "scaleX("+t+") scaleY("+o+")"}},Transform:{toString(e){if(e)return [Ui.Translate.toString(e),Ui.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:o,easing:a}=e;return t+" "+o+"ms "+a}}});var Ki=e=>{let{t}=re(),{onSelectAllClick:o,order:a,orderBy:r,sortBy:n=[],numSelected:i=0,rowCount:c=0,onRequestSort:d,onContextMenu:s,columns:l,visibleColumns:g,selectionMode:f,grouping:p=[],isAllExpanded:b=false,handleToggleAll:v,onColumnResize:u,columnWidths:w,enableColumnReorder:m=false}=e,[h,y]=Et.useState(null),k=Et.useRef(null),E=K=>te=>{h||d(K);},R=(K,te,se)=>{K.preventDefault(),K.stopPropagation(),y(te),k.current={startX:K.clientX,startWidth:se,colId:te},document.addEventListener("mousemove",C),document.addEventListener("mouseup",I),document.body.style.cursor="col-resize";},C=K=>{if(!k.current)return;let{startX:te,startWidth:se,colId:_}=k.current,$=K.clientX-te,ue=Math.max(50,se+$);u&&u(_,ue);},I=()=>{y(null),k.current=null,document.removeEventListener("mousemove",C),document.removeEventListener("mouseup",I),document.body.style.cursor="";};Et.useEffect(()=>()=>{document.removeEventListener("mousemove",C),document.removeEventListener("mouseup",I);},[]);let T=f==="multiple"||f==="single",S=p.length>0&&!!v,A=t(b?"table.group.collapseAll":"table.group.expandAll"),M=l.filter(K=>g.includes(K.id)),D=new Map(n.map((K,te)=>[K.field,{...K,priority:te+1}])),B=M.map(K=>{let te=w?.[K.id]||K.minWidth||100,se=D.get(K.id);return jsxRuntime.jsx(Cb,{headCell:K,width:typeof te=="number"?te:100,order:a,orderBy:r,multiSortInfo:se,onRequestSort:E(K.id),onContextMenu:s,onResizeMouseDown:_=>R(_,K.id,typeof te=="number"?te:100),enableColumnReorder:m},K.id)}),Z=M.map(K=>K.id),O=jsxRuntime.jsxs(ub__default.default,{children:[T&&jsxRuntime.jsx(Ys__default.default,{padding:"checkbox",sx:K=>({width:48,position:"sticky",top:0,zIndex:4,backgroundColor:K.palette.mode==="dark"?"#000000":"#f5f5f5",color:K.palette.mode==="dark"?"#ffffff":K.palette.text.primary}),children:jsxRuntime.jsx(pb__default.default,{color:"primary",indeterminate:i>0&&i<c,checked:c>0&&i===c,onChange:o,disabled:f==="single"})}),S&&jsxRuntime.jsx(Ys__default.default,{align:"center",padding:"checkbox",sx:K=>({width:44,position:"sticky",top:0,zIndex:4,backgroundColor:K.palette.mode==="dark"?"#000000":"#f5f5f5",color:K.palette.mode==="dark"?"#ffffff":K.palette.text.primary}),children:jsxRuntime.jsx(fb__default.default,{title:A,children:jsxRuntime.jsx(gb__default.default,{size:"small",onClick:K=>{K.stopPropagation(),v?.(!b);},sx:{p:.2},children:b?jsxRuntime.jsx(bb__default.default,{fontSize:"small"}):jsxRuntime.jsx(hb__default.default,{fontSize:"small"})})})}),m?jsxRuntime.jsx(sortable.SortableContext,{items:Z,strategy:sortable.horizontalListSortingStrategy,children:B}):B]});return jsxRuntime.jsx(db__default.default,{children:O})},Cb=({headCell:e,width:t,order:o,orderBy:a,multiSortInfo:r,onRequestSort:n,onContextMenu:i,onResizeMouseDown:c,enableColumnReorder:d})=>{let{setNodeRef:s,attributes:l,listeners:g,transform:f,transition:p,isDragging:b}=sortable.useSortable({id:e.id,disabled:!d}),v=d?{transform:Ui.Transform.toString(f),transition:p,opacity:b?.6:1}:{},u=r?.direction??(a===e.id?o:"asc"),w=!!r||a===e.id;return jsxRuntime.jsxs(Ys__default.default,{ref:d?s:void 0,align:"left",padding:e.disablePadding?"none":"normal",sortDirection:w?u:false,onContextMenu:i?m=>i(m,e.id):void 0,style:{width:t,minWidth:t,maxWidth:t,...v},sx:m=>({position:"sticky",top:0,zIndex:4,backgroundColor:m.palette.mode==="dark"?"#000000":"#f5f5f5",color:m.palette.mode==="dark"?"#ffffff":m.palette.text.primary,fontWeight:"bold",userSelect:"none",cursor:d?b?"grabbing":"grab":void 0}),...d?l:{},...d?g:{},children:[jsxRuntime.jsx(mb__default.default,{active:w,direction:u,onClick:n,sx:m=>({"&.MuiTableSortLabel-root":{width:"100%"},"& .MuiTableSortLabel-icon":{color:m.palette.mode==="dark"?"#ffffff":m.palette.text.primary,opacity:w?1:0,transition:"opacity 0.2s"},"&:hover .MuiTableSortLabel-icon":{opacity:.5},"&.Mui-active .MuiTableSortLabel-icon":{opacity:1,color:m.palette.mode==="dark"?"#ffffff":m.palette.text.primary},fontWeight:"bold",fontSize:"0.85rem",color:m.palette.mode==="dark"?"#ffffff":m.palette.text.primary}),children:jsxRuntime.jsxs(li__default.default,{component:"span",sx:{overflow:"visible",textOverflow:"clip",whiteSpace:"normal",lineHeight:1.2,wordBreak:"break-word",pr:1,display:"inline-flex",alignItems:"center",gap:.5},children:[e.label,r&&jsxRuntime.jsx(li__default.default,{component:"span",sx:m=>({display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:16,height:16,px:.5,borderRadius:999,fontSize:10,fontWeight:700,color:"#fff",backgroundColor:m.palette.primary.main}),children:r.priority})]})}),jsxRuntime.jsx(li__default.default,{onMouseDown:c,onPointerDown:m=>m.stopPropagation(),onClick:m=>m.stopPropagation(),sx:m=>({position:"absolute",right:0,top:0,bottom:0,width:5,cursor:"col-resize",backgroundColor:"transparent",transition:"background-color 120ms ease","&:hover":{backgroundColor:m.palette.mode==="dark"?"rgba(148,163,184,0.28)":"rgba(15,23,42,0.12)"},zIndex:1})})]})};var pu=e=>{let{t}=re(),{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:p}=e,b=m=>r.indexOf(m)!==-1,v=s==="multiple"||s==="single",u=l.length>0,w=a.length+(v?1:0)+(u?1:0);return jsxRuntime.jsxs(material.TableBody,{children:[o.map((m,h)=>{if(m.type==="group"){let y=d.has(m.id),k=m.childIds||[],E=k.filter(T=>b(T)).length,R=k.length>0&&E===k.length,C=E>0&&E<k.length;return jsxRuntime.jsxs(material.TableRow,{sx:T=>({backgroundColor:T.palette.mode==="dark"?"#111111":"#f5f5f5","& .MuiTableCell-root":{color:T.palette.text.primary,borderBottomColor:T.palette.divider},"& .MuiIconButton-root":{color:T.palette.text.primary},"& .MuiCheckbox-root":{color:T.palette.text.secondary},"& .MuiCheckbox-root.Mui-checked, & .MuiCheckbox-root.MuiCheckbox-indeterminate":{color:T.palette.primary.main}}),children:[v&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",children:jsxRuntime.jsx(material.Checkbox,{size:"small",checked:R,indeterminate:C,onChange:T=>{if(T.stopPropagation(),!!e.onSelectionChange)if(R){let S=r.filter(A=>!k.includes(A));e.onSelectionChange(S);}else {let S=Array.from(new Set([...r,...k]));e.onSelectionChange(S);}},onClick:T=>T.stopPropagation(),sx:{p:.5}})}),u&&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)?p?.(m.id):f?.(m.id);},sx:{p:.25},children:g?.(m.id)?jsxRuntime.jsx(bb__default.default,{fontSize:"small"}):jsxRuntime.jsx(hb__default.default,{fontSize:"small"})})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>c&&c(m.id),sx:{p:.25},children:y?jsxRuntime.jsx(Pb__default.default,{}):jsxRuntime.jsx(If__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 y=m.data||m,k=m.id||y.id||h,E=b(k),R=`enhanced-table-checkbox-${h}`,I=(m.level!==void 0?m.level:0)*4;return jsxRuntime.jsxs(material.TableRow,{hover:true,onClick:T=>n&&n(T,y),role:"checkbox","aria-checked":E,tabIndex:-1,selected:E,sx:{cursor:"pointer"},children:[v&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",sx:{pl:I>0?I+1:void 0},children:jsxRuntime.jsx(material.Checkbox,{color:"primary",checked:E,inputProps:{"aria-labelledby":R}})}),u&&jsxRuntime.jsx(material.TableCell,{padding:"checkbox",sx:{width:44}}),i.filter(T=>a.includes(T.id)).map((T,S)=>{let M=!v&&S===0&&I>0?{pl:I+2}:{};return jsxRuntime.jsx(material.TableCell,{align:"left",sx:M,children:T.render?T.render(y[T.id],y):(function(){let B=y[T.id];if(T.numeric){if(typeof B=="number")return B.toLocaleString();if(typeof B=="string"&&B.trim()!==""&&!isNaN(Number(B)))return Number(B).toLocaleString()}return B})()},T.id)})]},k)}}),o.length===0&&jsxRuntime.jsx(material.TableRow,{children:jsxRuntime.jsx(material.TableCell,{colSpan:w,align:"center",children:t("common.noData")})})]})};var mu=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 fu=e=>{let{t}=re();return jsxRuntime.jsx(material.Box,{sx:{p:2},children:jsxRuntime.jsx(material.Typography,{children:t("table.mobile.notImplemented")})})};var Xr=({groupAnchorEl:e,setGroupAnchorEl:t,grouping:o,setGrouping:a,columns:r,toggleGroupField:n})=>{let{t:i}=re();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(vu__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)})]})},Yr=({anchorEl:e,setAnchorEl:t,columns:o,visibleColumns:a,toggleColumnVisibility:r})=>{let{t:n}=re();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))]})},ji=({anchorEl:e,setAnchorEl:t,showSummary:o,setShowSummary:a,columns:r,summaryColumns:n,toggleSummaryColumn:i})=>{let{t:c}=re();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")})})]})},Zi=({contextMenu:e,handleCloseContextMenu:t,columns:o,visibleColumns:a,toggleColumnVisibility:r})=>{let{t:n}=re();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(Wb__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{children:i.label})]},i.id))]})},wu=({contextMenu:e,handleClose:t,columns:o,visibleColumns:a,grouping:r,summaryColumns:n,showSummary:i,sortBy:c,orderBy:d,order:s,onSortAsc:l,onSortDesc:g,onClearSort:f,onHideColumn:p,onToggleGroup:b,onToggleSummary:v,onOpenSortDialog:u})=>{let{t:w}=re(),m=e?.columnId??"",h=o.find(S=>S.id===m),y=r.includes(m),k=n.includes(m),E=!!h?.numeric,R=c.find(S=>S.field===m),C=R?R.direction==="asc":d===m&&s==="asc",I=R?R.direction==="desc":d===m&&s==="desc",T=C||I;return jsxRuntime.jsxs(material.Menu,{open:e!==null,onClose:t,anchorReference:"anchorPosition",anchorPosition:e!==null?{top:e.mouseY,left:e.mouseX}:void 0,children:[jsxRuntime.jsx(material.MenuItem,{disabled:true,sx:{opacity:"1 !important",fontWeight:700},children:jsxRuntime.jsx(material.ListItemText,{primary:h?.label??m})}),jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsxs(material.MenuItem,{onClick:()=>{l(m),t();},selected:C,children:[jsxRuntime.jsx(material.ListItemIcon,{children:jsxRuntime.jsx(Cu__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{primary:w("table.headerMenu.sortAsc")})]}),jsxRuntime.jsxs(material.MenuItem,{onClick:()=>{g(m),t();},selected:I,children:[jsxRuntime.jsx(material.ListItemIcon,{children:jsxRuntime.jsx(ku__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{primary:w("table.headerMenu.sortDesc")})]}),T&&jsxRuntime.jsxs(material.MenuItem,{onClick:()=>{f(m),t();},children:[jsxRuntime.jsx(material.ListItemIcon,{children:jsxRuntime.jsx(vu__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{primary:w("table.headerMenu.clearSort")})]}),jsxRuntime.jsxs(material.MenuItem,{onClick:()=>{u(),t();},children:[jsxRuntime.jsx(material.ListItemIcon,{children:jsxRuntime.jsx(Su__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{primary:w("table.headerMenu.configureSort")})]}),jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsxs(material.MenuItem,{onClick:()=>{b(m),t();},selected:y,children:[jsxRuntime.jsx(material.ListItemIcon,{children:jsxRuntime.jsx(Jh__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{primary:w(y?"table.headerMenu.ungroup":"table.headerMenu.group")})]}),E&&i&&jsxRuntime.jsxs(material.MenuItem,{onClick:()=>{v(m),t();},selected:k,children:[jsxRuntime.jsx(material.ListItemIcon,{children:jsxRuntime.jsx(eb__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{primary:w(k?"table.headerMenu.removeSummary":"table.headerMenu.addSummary")})]}),jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsxs(material.MenuItem,{onClick:()=>{p(m),t();},children:[jsxRuntime.jsx(material.ListItemIcon,{children:jsxRuntime.jsx($b__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{primary:w("table.headerMenu.hideColumn")})]})]})},Tu=({open:e,onClose:t,columns:o,initialRules:a,onApply:r,onClear:n})=>{let{t:i}=re(),[c,d]=Et.useState([]);Et.useEffect(()=>{e&&d(a.length>0?a.map(v=>({...v})):[]);},[e,a]);let s=Et.useMemo(()=>new Set(c.map(v=>v.field)),[c]),l=Et.useMemo(()=>o.filter(v=>!s.has(v.id)),[o,s]),g=()=>{let v=l[0];v&&d(u=>[...u,{field:v.id,direction:"asc"}]);},f=v=>{d(u=>u.filter((w,m)=>m!==v));},p=(v,u)=>{d(w=>w.map((m,h)=>h===v?{...m,...u}:m));},b=(v,u)=>{d(w=>{let m=v+u;if(m<0||m>=w.length)return w;let h=[...w],[y]=h.splice(v,1);return h.splice(m,0,y),h});};return jsxRuntime.jsxs(material.Dialog,{open:e,onClose:t,maxWidth:"sm",fullWidth:true,children:[jsxRuntime.jsx(material.DialogTitle,{children:i("table.sortDialog.title")}),jsxRuntime.jsxs(material.DialogContent,{dividers:true,children:[c.length===0?jsxRuntime.jsx(material.Typography,{variant:"body2",sx:{color:"text.secondary",py:2},children:i("table.sortDialog.empty")}):jsxRuntime.jsx(material.Stack,{spacing:1,children:c.map((v,u)=>{let w=new Set(c.filter((h,y)=>y!==u).map(h=>h.field)),m=o.filter(h=>!w.has(h.id));return jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:"24px 1fr 110px auto auto",alignItems:"center",gap:1},children:[jsxRuntime.jsx(material.Badge,{badgeContent:u+1,color:"primary",sx:{ml:.5}}),jsxRuntime.jsx("select",{value:v.field,onChange:h=>p(u,{field:h.target.value}),style:{padding:6,fontSize:13,borderRadius:4},children:m.map(h=>jsxRuntime.jsx("option",{value:h.id,children:h.label},h.id))}),jsxRuntime.jsxs("select",{value:v.direction,onChange:h=>p(u,{direction:h.target.value}),style:{padding:6,fontSize:13,borderRadius:4},children:[jsxRuntime.jsx("option",{value:"asc",children:i("table.sortDialog.asc")}),jsxRuntime.jsx("option",{value:"desc",children:i("table.sortDialog.desc")})]}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>b(u,-1),disabled:u===0,children:jsxRuntime.jsx(Cu__default.default,{fontSize:"small"})}),jsxRuntime.jsxs(material.Stack,{direction:"row",children:[jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>b(u,1),disabled:u===c.length-1,children:jsxRuntime.jsx(ku__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>f(u),children:jsxRuntime.jsx(Kb__default.default,{fontSize:"small"})})]})]},`sort-rule-${u}`)})}),jsxRuntime.jsx(material.Button,{size:"small",onClick:g,disabled:l.length===0,startIcon:jsxRuntime.jsx(Su__default.default,{}),sx:{mt:2},children:i("table.sortDialog.addRule")})]}),jsxRuntime.jsxs(material.DialogActions,{children:[jsxRuntime.jsx(material.Button,{color:"inherit",onClick:()=>{n(),t();},children:i("table.sortDialog.clearAll")}),jsxRuntime.jsx(material.Box,{sx:{flex:1}}),jsxRuntime.jsx(material.Button,{onClick:t,children:i("common.cancel")}),jsxRuntime.jsx(material.Button,{variant:"contained",onClick:()=>{r(c),t();},children:i("common.ok")})]})]})};var Xn=(e,t=2)=>e.toLocaleString(void 0,{maximumFractionDigits:t}),Pu=({kpis:e})=>{let{t}=re(),o=[{label:t("graph.kpi.totalRecords"),value:Xn(e.totalRecords,0),color:"text.primary"},{label:t("graph.kpi.totalReport"),value:Xn(e.totalReportHours),color:"text.primary"},{label:t("graph.kpi.totalBillable"),value:Xn(e.totalBillableHours),color:"success.main"},{label:t("graph.kpi.efficiency"),value:`${e.efficiency.toFixed(2)}%`,color:"warning.main"},{label:t("graph.kpi.amount"),value:Xn(e.totalAmount),color:"info.main"},{label:t("graph.kpi.flagged"),value:Xn(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 Xi=({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 Qn=({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 Du=({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,p)=>{let b=n+p*(r-n*2)/Math.max(e.length-1,1),v=a-n-(f.value-c)/s*(a-n*2);return {x:b,y:v,...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 Au=({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,p=Math.max(f*.5,8),b=n+g*f+(f-p)/2,v=l.barValue/i*(a-n*2),u=a-n-v;return {x:b,y:u,barHeight:v,barWidth:p,item:l}}),s=e.map((l,g)=>{let f=(r-n*2)/e.length,p=n+g*f+f/2,b=a-n-l.lineValue/c*(a-n*2);return {x:p,y:b,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 ty=e=>`rgba(30, 136, 229, ${.2+Math.max(0,Math.min(1,e))*.8})`,Eu=({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:ty(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 oy=["#1E88E5","#1ABC9C","#FBC02D","#EF5350","#7E57C2","#78909C"],al=({data:e,variant:t="donut",colors:o=oy,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 Lu=({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 Nu=({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,p=g.type==="total"?g.value:o+g.value;return g.type!=="total"&&(o=p),{...g,start:f,end:p,delta:p-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 p=(c-d*2)/a.length,b=Math.max(p*.55,8),v=d+f*p+(p-b)/2,u=l(Math.max(g.start,g.end)),w=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:v,y:u,width:b,height:Math.max(w-u,4),rx:6,fill:m}),jsxRuntime.jsx("text",{x:v+b/2,y:u-6,textAnchor:"middle",fill:"currentColor",fontSize:"11",children:g.end.toFixed(1)})]},g.name)})]}),jsxRuntime.jsx(material.Box,{sx:{mt:1,display:"grid",gridTemplateColumns:`repeat(${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 ti=({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}`},cM=(e,t=360)=>{let o=ti(e);return `<iframe width="100%" height="${t}" style="border:0" loading="lazy" allowfullscreen referrerpolicy="no-referrer-when-downgrade" src="${o}"></iframe>`};var Hu=({apiKey:e,query:t,embedUrl:o,zoom:a=14,mapType:r="roadmap",height:n=320})=>{let i=o||(e&&t?ti({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 il=({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 Uu=({keyword:e,location:t,embedUrl:o,height:a=320})=>{let r=o||il({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 Ku=({billableByPrimary:e,efficiencyBySecondary:t,statusDistribution:o,interaction:a})=>{let{t:r}=re();return jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",lg:"1.2fr 1.2fr 1fr"}},children:[jsxRuntime.jsx(Xi,{title:r("graph.chart.billable.title"),subtitle:r("graph.chart.billable.subtitle"),children:jsxRuntime.jsx(Qn,{data:e,orientation:"horizontal",activeName:a?.filters?.primaryDimension,onItemClick:n=>a?.onPrimaryDimensionClick?.(n.name)})}),jsxRuntime.jsx(Xi,{title:r("graph.chart.efficiency.title"),subtitle:r("graph.chart.efficiency.subtitle"),children:jsxRuntime.jsx(Qn,{data:t,orientation:"vertical",valueSuffix:"%",activeName:a?.filters?.secondaryDimension,onItemClick:n=>a?.onSecondaryDimensionClick?.(n.name)})}),jsxRuntime.jsx(Xi,{title:r("graph.chart.status.title"),subtitle:r("graph.chart.status.subtitle"),children:jsxRuntime.jsx(al,{data:o,variant:"donut",activeName:a?.filters?.status,onItemClick:n=>a?.onStatusClick?.(n.name)})})]})};var lo=e=>jsxRuntime.jsx(material.TextField,{...e,variant:e.variant||"outlined",size:e.size||"small",fullWidth:e.fullWidth!==void 0?e.fullWidth:true});var uc=e=>jsxRuntime.jsx(material.TextField,{...e,multiline:true,minRows:3,fullWidth:true,variant:"outlined"});var Cy=["doubao-lite","gpt-4o-mini","gpt-4.1-mini","claude-3.5-sonnet"],ky=["zh","en","de","fr","ja","ko"],ju=({open:e,onClose:t,value:o,onSaveAll:a,modelOptions:r=Cy,promptLangOptions:n=ky,analysisTemplateOptions:i=[],responseTemplateOptions:c=[],defaultAnalysisTemplateId:d,defaultResponseTemplateId:s})=>{let[l,g]=Et.useState(o),[f,p]=Et.useState(d||""),[b,v]=Et.useState(s||""),[u,w]=Et.useState(false);Et.useEffect(()=>{e&&(g(o),p(d||""),v(s||""));},[e,o,d,s]);let m=(y,k)=>{g(E=>({...E,[y]:k}));},h=async()=>{if(a)try{w(!0),await a({settings:l,analysisTemplateId:f||void 0,responseTemplateId:b||void 0});}finally{w(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(lo,{size:"small",value:l.baseUrl,onChange:y=>m("baseUrl",y.target.value),fullWidth:true,label:"Base URL"})}),jsxRuntime.jsx(material.Box,{children:jsxRuntime.jsx(lo,{size:"small",type:"password",value:l.apiKey,onChange:y=>m("apiKey",y.target.value),fullWidth:true,label:"API Key"})}),jsxRuntime.jsx(material.Box,{children:jsxRuntime.jsx(lo,{size:"small",value:l.model,onChange:y=>m("model",y.target.value),fullWidth:true,select:true,label:"Model",children:r.map(y=>jsxRuntime.jsx(material.MenuItem,{value:y,children:y},y))})}),jsxRuntime.jsx(material.Box,{children:jsxRuntime.jsx(lo,{size:"small",value:l.promptLang,onChange:y=>m("promptLang",y.target.value),fullWidth:true,select:true,label:"Prompt Lang",children:n.map(y=>jsxRuntime.jsx(material.MenuItem,{value:y,children:y},y))})})]}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[jsxRuntime.jsxs(lo,{size:"small",value:f,onChange:y=>p(y.target.value),fullWidth:true,select:true,label:"Analysis Template",children:[jsxRuntime.jsx(material.MenuItem,{value:"",children:"Default"}),i.map(y=>jsxRuntime.jsx(material.MenuItem,{value:y.id,children:y.label},y.id))]}),jsxRuntime.jsx(uc,{multiline:true,minRows:8,value:l.analysisPrompt,onChange:y=>m("analysisPrompt",y.target.value),fullWidth:true,label:"Analysis Prompt",sx:{"& .MuiInputBase-root":{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"}}}),jsxRuntime.jsxs(lo,{size:"small",value:b,onChange:y=>v(y.target.value),fullWidth:true,select:true,label:"Response Template",children:[jsxRuntime.jsx(material.MenuItem,{value:"",children:"Default"}),c.map(y=>jsxRuntime.jsx(material.MenuItem,{value:y.id,children:y.label},y.id))]}),jsxRuntime.jsx(uc,{multiline:true,minRows:8,value:l.responsePrompt,onChange:y=>m("responsePrompt",y.target.value),fullWidth:true,label:"Response Prompt",sx:{"& .MuiInputBase-root":{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"}}})]})]})}),jsxRuntime.jsxs(material.DialogActions,{sx:{px:3,pb:2.5,pt:1.2,gap:1},children:[jsxRuntime.jsx(material.Button,{variant:"outlined",onClick:t,children:"Cancel"}),jsxRuntime.jsx(material.Button,{variant:"contained",onClick:h,disabled:!a||u,children:"Save"})]})]})};var ul=({open:e,onClose:t,model:o,tableContent:a,extraCharts:r,interaction:n,aiAssistant:i})=>{let{t:c}=re(),[d,s]=Et.useState(i?.defaultPrompt||""),[l,g]=Et.useState(false),[f,p]=Et.useState(false),b=n?.enabled!==false&&!!n,v=i?.enabled!==false,u=n?.filters||{},w=!!(u.primaryDimension||u.secondaryDimension||u.status),m=i?.placeholder||"Ask AI to analyze data, create charts, or find insights...";Et.useEffect(()=>{e&&s(i?.defaultPrompt||"");},[e,i?.defaultPrompt]);let h=i?.settings||{baseUrl:"/llm-api",apiKey:"",model:"doubao-lite",promptLang:"zh",analysisPrompt:"",responsePrompt:""},y=async()=>{let k=d.trim();if(!(!k||!i?.onSubmit))try{g(!0),await i.onSubmit(k,{filters:u,model:o});}finally{g(false);}};return jsxRuntime.jsx(material.Dialog,{open:e,onClose:t,fullScreen:true,children:jsxRuntime.jsxs(material.Box,{sx:{height:"100%",display:"flex",flexDirection:"column",bgcolor:"background.default"},children:[jsxRuntime.jsx(material.Box,{sx:{p:2,borderBottom:1,borderColor:"divider"},children:jsxRuntime.jsxs(material.Stack,{direction:{xs:"column",lg:"row"},alignItems:{xs:"stretch",lg:"center"},justifyContent:"space-between",spacing:1.5,children:[jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1.25,alignItems:"center",sx:{flexWrap:"wrap"},children:[jsxRuntime.jsx(material.Typography,{variant:"h5",fontWeight:800,children:o.title}),jsxRuntime.jsx(material.Chip,{size:"small",label:c("graph.records",{count:o.kpis.totalRecords})}),b&&u.primaryDimension&&jsxRuntime.jsx(material.Chip,{size:"small",variant:"outlined",label:`${n?.fieldMapping.primaryDimension}: ${u.primaryDimension}`,onDelete:()=>n?.onClearFilter("primaryDimension")}),b&&u.secondaryDimension&&jsxRuntime.jsx(material.Chip,{size:"small",variant:"outlined",label:`${n?.fieldMapping.secondaryDimension}: ${u.secondaryDimension}`,onDelete:()=>n?.onClearFilter("secondaryDimension")}),b&&u.status&&jsxRuntime.jsx(material.Chip,{size:"small",variant:"outlined",label:`${n?.fieldMapping.status}: ${u.status}`,onDelete:()=>n?.onClearFilter("status")}),b&&w&&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:[v&&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(Ry__default.default,{sx:{fontSize:18,color:"text.secondary"}})}),jsxRuntime.jsx(material.InputBase,{fullWidth:true,value:d,onChange:k=>s(k.target.value),onKeyDown:k=>{k.key==="Enter"&&(k.preventDefault(),y());},placeholder:m,sx:{fontSize:"0.9rem"}}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:y,disabled:l||!d.trim(),children:jsxRuntime.jsx(Dy__default.default,{sx:{fontSize:18}})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>p(true),children:jsxRuntime.jsx(My__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(Pu,{kpis:o.kpis}),jsxRuntime.jsx(Ku,{billableByPrimary:o.charts.billableByPrimary,efficiencyBySecondary:o.charts.efficiencyBySecondary,statusDistribution:o.charts.statusDistribution,interaction:b?{filters:u,onPrimaryDimensionClick:k=>n?.onPrimaryDimensionClick(k),onSecondaryDimensionClick:k=>n?.onSecondaryDimensionClick(k),onStatusClick:k=>n?.onStatusClick(k)}:void 0}),r,a]}),jsxRuntime.jsx(ju,{open:f,onClose:()=>p(false),value:h,onSaveAll:i?.onSaveAll,modelOptions:i?.modelOptions,promptLangOptions:i?.promptLangOptions,analysisTemplateOptions:i?.analysisTemplateOptions,responseTemplateOptions:i?.responseTemplateOptions,defaultAnalysisTemplateId:i?.defaultAnalysisTemplateId,defaultResponseTemplateId:i?.defaultResponseTemplateId})]})})};var 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"]},By=5,Zu=e=>e.toLowerCase().replace(/[\s_-]/g,""),Xa=(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=>[Zu(i),i]));for(let i of o){let c=n.get(Zu(i));if(c)return c}return r[0]||a},Ro=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},Jt=(e,t)=>e==null||e===""?t:String(e),Ey=(e,t,o,a,r)=>{let n=new Map;return e.forEach(i=>{let c=Jt(i[t],r);n.set(c,(n.get(c)||0)+Ro(i[o]));}),Array.from(n.entries()).map(([i,c])=>({name:i,value:c})).sort((i,c)=>c.value-i.value).slice(0,a)},Fy=(e,t,o,a,r,n)=>{let i=new Map;return e.forEach(c=>{let d=Jt(c[t],n),s=i.get(d)||{report:0,billable:0};s.report+=Ro(c[o]),s.billable+=Ro(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)},Ly=(e,t,o)=>{let a=e.length;if(a===0)return [];let r=new Map;return e.forEach(n=>{let i=Jt(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}))},Xu=(e,t,o)=>{let a=new Map;return e.forEach(r=>{let n=Jt(r[t],"N/A");a.set(n,(a.get(n)||0)+Ro(r[o]));}),Array.from(a.entries()).sort(([r],[n])=>r.localeCompare(n)).map(([r,n])=>({name:r,value:n}))},zy=(e,t,o,a,r,n)=>{let i=new Map;return e.forEach(c=>{let d=Jt(c[t],n),s=i.get(d)||{report:0,billable:0};s.report+=Ro(c[o]),s.billable+=Ro(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)},Ny=(e,t,o,a,r)=>{let n=new Map;return e.forEach(i=>{let c=Jt(i[t],r),d=Jt(i[o],r),s=`${c}__${d}`;n.set(s,(n.get(s)||0)+Ro(i[a]));}),Array.from(n.entries()).map(([i,c])=>{let[d,s]=i.split("__");return {x:d,y:s,value:c}})},Vy=(e,t,o)=>{let a=Xu(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"}]},Oy=(e,t,o,a,r,n)=>{let i=new Map;return e.forEach(c=>{let d=Jt(c[t],n),s=`${Jt(c[o],n)} / ${Jt(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)},sn=({rows:e,config:t})=>{let{t:o}=re(),a=o("graph.unassigned"),r=Et.useMemo(()=>{let l=t?.fieldMapping;return {primaryDimension:Xa(e,l?.primaryDimension,Za.primaryDimension,"Category"),secondaryDimension:Xa(e,l?.secondaryDimension,Za.secondaryDimension,"Owner"),status:Xa(e,l?.status,Za.status,"Status"),date:Xa(e,l?.date,Za.date,"Date"),description:Xa(e,l?.description,Za.description,"Description"),reportHours:Xa(e,l?.reportHours,Za.reportHours,"ReportHours"),billableHours:Xa(e,l?.billableHours,Za.billableHours,"BillableHours"),amount:Xa(e,l?.amount,Za.amount,"Amount")}},[e,t?.fieldMapping]),n=Et.useMemo(()=>e.map((l,g)=>{let f=Ro(l[r.reportHours]),p=Ro(l[r.billableHours]),b=Ro(l[r.amount]),v=f>0?p/f*100:0;return {id:`graph-row-${g}`,Date:Jt(l[r.date],""),Primary:Jt(l[r.primaryDimension],a),Secondary:Jt(l[r.secondaryDimension],a),Description:Jt(l[r.description],""),ReportHours:f,BillableHours:p,Amount:b,Efficiency:v,Status:Jt(l[r.status],a)}}),[e,r,a]),i=Et.useMemo(()=>{let l=n.length,g=n.reduce((w,m)=>w+Ro(m.ReportHours),0),f=n.reduce((w,m)=>w+Ro(m.BillableHours),0),p=n.reduce((w,m)=>w+Ro(m.Amount),0),b=g>0?f/g*100:0,v=t?.statusFlagValues||["flag","flagged","warning","risk"],u=n.filter(w=>v.includes(Jt(w.Status,"").toLowerCase())).length;return {totalRecords:l,totalReportHours:g,totalBillableHours:f,efficiency:b,totalAmount:p,flaggedCount:u}},[n,t?.statusFlagValues]),c=t?.topN||By,d=Et.useMemo(()=>({billableByPrimary:Ey(n,"Primary","BillableHours",c,a),efficiencyBySecondary:Fy(n,"Secondary","ReportHours","BillableHours",c,a),statusDistribution:Ly(n,"Status",a),lineByDate:Xu(n,"Date","BillableHours"),comboByPrimary:zy(n,"Primary","ReportHours","BillableHours",c,a),heatmapPrimarySecondary:Ny(n,"Primary","Secondary","BillableHours",a),waterfallBillable:Vy(n,"Date","BillableHours"),fishboneStatusCauses:Oy(n,"Status","Primary","Secondary",3,a)}),[n,c,a]),s=Et.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 cn=e=>String(e??"").trim(),ml=(e={})=>{let[t,o]=Et.useState(e),a=Et.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=Et.useCallback(d=>{o(s=>{if(!s[d])return s;let l={...s};return delete l[d],l});},[]),n=Et.useCallback(()=>{o({});},[]),i=Et.useMemo(()=>!!(t.primaryDimension||t.secondaryDimension||t.status),[t]),c=Et.useCallback((d,s)=>d.filter(l=>!(t.primaryDimension&&cn(l[s.primaryDimension])!==cn(t.primaryDimension)||t.secondaryDimension&&cn(l[s.secondaryDimension])!==cn(t.secondaryDimension)||t.status&&cn(l[s.status])!==cn(t.status))),[t]);return {filters:t,setFilter:a,clearFilter:r,clearAll:n,hasActiveFilters:i,applyRows:c}};var fl=({variants:e,currentVariantId:t,onLoad:o,onSave:a,onDelete:r,onSetDefault:n})=>{let{t:i}=re(),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]=Et.useState(false),[p,b]=Et.useState(""),[v,u]=Et.useState(false),[w,m]=Et.useState(false),h=e.find(E=>E.id===t),y=()=>{b(h?.name||i("variant.newVariant")),u(h?.isDefault||false),m(h?.isPublic||false),f(true);},k=()=>{a({name:p,isDefault:v,isPublic:w,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:E=>E.name+(E.isDefault?` (${i("variant.defaultSuffix")})`:""),value:h||null,onChange:(E,R)=>{R&&o(R);},renderInput:E=>jsxRuntime.jsx(material.TextField,{...E,variant:"outlined",size:"small",InputProps:{...E.InputProps,sx:{fontSize:s,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:s},children:R.name}),R.isDefault&&jsxRuntime.jsx(Yy__default.default,{fontSize:"small",color:"action"})]})})}),jsxRuntime.jsx(material.Tooltip,{title:i("variant.saveView"),children:jsxRuntime.jsx(material.IconButton,{onClick:y,size:"small",color:"primary",children:jsxRuntime.jsx(yp__default.default,{fontSize:"small"})})}),jsxRuntime.jsxs(material.Dialog,{open:g,onClose:()=>f(false),children:[jsxRuntime.jsx(material.DialogTitle,{children:i("variant.saveView")}),jsxRuntime.jsxs(material.DialogContent,{children:[jsxRuntime.jsx(material.TextField,{autoFocus:true,margin:"dense",label:i("variant.viewName"),fullWidth:true,variant:"outlined",value:p,onChange:E=>b(E.target.value)}),jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{checked:v,onChange:E=>u(E.target.checked)}),label:i("variant.setDefault")}),jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{checked:w,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:k,variant:"contained",children:i("common.save")})]})]})]})};var rp=({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}=re(),[p,b]=Et.useState([]),[v,u]=Et.useState(""),w=`orbcafe.variants.${e}.${t}`,m=l!==void 0?l:v,h=A=>{l===void 0&&u(A),g&&g(A);},y=Et.useCallback(()=>{try{let A=localStorage.getItem(w);if(!A)return [];let M=JSON.parse(A);return Array.isArray(M)?M:[]}catch{return []}},[w]),k=Et.useCallback(A=>{try{localStorage.setItem(w,JSON.stringify(A));}catch{}},[w]),E=Et.useCallback(A=>{b(A);let M=A.find(D=>D.isDefault);M&&!m&&(h(M.id),n(M));},[m,n,h]),R=Et.useCallback(async()=>{if(!e)return [];try{let A=[];if(i)A=await i.getVariants(e,t);else if(c){let M=await fetch(`${c}/api/variants?appId=${encodeURIComponent(e)}&tableKey=${encodeURIComponent(t)}`);if(!M.ok)throw new Error(f("variant.toast.fetchFailed"));A=await M.json();}else A=y();return E(A),A}catch(A){console.error("Error fetching variants",A);let M=y();return E(M),d&&d(f("variant.toast.fetchFailed")),M}},[e,t,i,c,y,E,d,f]);return Et.useEffect(()=>{R();},[e,t]),jsxRuntime.jsx(fl,{variants:p,currentVariantId:m,onLoad:A=>{h(A.id),n(A);},onSave:async A=>{let M=Date.now().toString(),D;try{let B=A.scope||"Both",Z=p.find(se=>se.name===A.name);M=Z?Z.id:Date.now().toString();let O=[];if(Z&&(Array.isArray(Z.filters)?O=[...Z.filters]:Z.filters&&(O=[{scope:"default",filters:Z.filters}])),B==="Search"||B==="Both"){let se=(Array.isArray(o),o);if(se)if(Array.isArray(se)&&se.length>0&&se[0].scope)se.forEach(_=>{let $=O.findIndex(ue=>ue.scope===_.scope);$>=0?O[$]=_:O.push(_);});else {let _={scope:t,filters:se},$=O.findIndex(ue=>ue.scope===t);$>=0?O[$]=_:O.push(_);}}let K=Z?.layout||{},te=[];if(Z&&Array.isArray(Z.layoutRefs)&&(te=[...Z.layoutRefs]),B==="Layout"||B==="Both")if(r&&r.length>0)r.forEach(se=>{let _=te.findIndex($=>$.tableKey===se.tableKey);_>=0?te[_]=se:te.push(se);});else {let se={tableKey:t,layoutId:a||null},_=te.findIndex($=>$.tableKey===t);_>=0?te[_]=se:te.push(se);}if(D={appId:e,tableKey:t,...A,scope:B,id:M,createdAt:new Date().toISOString(),filters:O,layout:K,layoutRefs:te},i)await i.saveVariant(D,e,t);else if(c){if(!(await fetch(`${c}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(D)})).ok)throw new Error(f("variant.toast.saveFailed"))}else {let _=p.some($=>$.id===M)?p.map($=>$.id===M?D:$):[...p,D];b(_),k(_);}s&&s(f("variant.toast.saveSuccess")),(i||c)&&await R(),h(M),n(D);}catch(B){console.error("Error saving variant",B);let O=p.some(K=>K.id===M)?p.map(K=>K.id===M?D:K):[...p,D];b(O),k(O),h(M),n(D),d&&d(f("variant.toast.saveFailed"));}},onDelete:async A=>{try{if(i)await i.deleteVariant(A);else if(c){if(!(await fetch(`${c}/api/variants/${A}`,{method:"DELETE"})).ok)throw new Error(f("variant.toast.deleteFailed"))}else {let M=p.filter(D=>D.id!==A);b(M),k(M);}m===A&&h(""),(i||c)&&R(),s&&s(f("variant.toast.deleteSuccess"));}catch(M){console.error("Error deleting variant",M);let D=p.filter(B=>B.id!==A);b(D),k(D),m===A&&h(""),d&&d(f("variant.toast.deleteFailed"));}},onSetDefault:async A=>{try{let M=p.find(B=>B.id===A);if(!M)return;let D={appId:e,tableKey:t,...M,isDefault:!0};if(i)await i.setDefaultVariant(A,e,t);else if(c){if(!(await fetch(`${c}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(D)})).ok)throw new Error(f("variant.toast.defaultFailed"))}else {let B=p.map(Z=>({...Z,isDefault:Z.id===A}));b(B),k(B);}(i||c)&&await R(),s&&s(f("variant.toast.defaultSuccess"));}catch(M){console.error("Error setting default variant",M);let D=p.map(B=>({...B,isDefault:B.id===A}));b(D),k(D),d&&d(f("variant.toast.defaultFailed"));}}})};ga__default.default.extend(mx__default.default);ga__default.default.extend(gx__default.default);ga__default.default.extend(fx__default.default);var ri="YYYY-MM-DD",hx=[null,null],Cr="0.85rem",bx={en:"en",zh:"zh-cn",fr:"fr",de:"de",ja:"ja",ko:"ko"},yx=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%"}})),sp=({label:e,value:t=hx,onChange:o})=>{let{t:a,locale:r}=re(),n=bx[r]||"en",i=e||a("dateRange.label"),[c,d]=Et.useState(null),[s,l]=Et.useState(t),[g,f]=Et.useState("start"),[p,b]=Et.useState(null),[v,u]=Et.useState((t[0]||ga__default.default()).locale(n)),[w,m]=Et.useState(""),[h,y]=Et.useState(""),[k,E]=Et.useState(false),[R,C]=Et.useState(false),I=Et__namespace.default.useRef(t);Et.useEffect(()=>{let[_,$]=t,[ue,Re]=I.current,Ae=Pe=>Pe&&typeof Pe.isSame=="function",ae=!(_===null&&ue===null||Ae(_)&&Ae(ue)&&_.isSame(ue,"day")),ve=!($===null&&Re===null||Ae($)&&Ae(Re)&&$.isSame(Re,"day"));(ae||ve)&&(l(t),t[0]&&Ae(t[0])&&u(t[0].locale(n))),I.current=t;},[t,n]),Et.useEffect(()=>{m(s[0]?s[0].locale(n).format(ri):""),y(s[1]?s[1].locale(n).format(ri):""),E(false),C(false);},[s,n]);let T=(_,$)=>{let ue=$.trim(),Re=_==="start"?E:C;if(!ue){let ve=_==="start"?[null,s[1]]:[s[0],null];Re(false),l(ve);return}let Ae=ga__default.default(ue,ri,true).locale(n);if(!Ae.isValid()){Re(true);return}Re(false);let ae=[...s];if(_==="start")ae[0]=Ae,ae[1]&&Ae.isAfter(ae[1],"day")&&(ae[1]=null),f(ae[1]?"start":"end");else {let ve=ae[0];ve&&Ae.isBefore(ve,"day")?(ae=[Ae,null],f("end")):(ae[1]=Ae,f("start"));}l(ae),u(Ae);},S=_=>{d(_.currentTarget);},A=()=>{d(null),f("start"),b(null);},M=!!c,D=_=>{if(!_)return;let $=[...s];if(g==="start")$=[_,null],f("end");else {let ue=$[0];ue&&_.isBefore(ue)?($=[_,null],f("end")):($=[ue,_],f("start"));}l($);},B=_=>{let $=ga__default.default().locale(n),ue=[null,null];switch(_){case "today":ue=[$,$];break;case "week":ue=[$.startOf("week"),$.endOf("week")];break;case "month":ue=[$.startOf("month"),$.endOf("month")];break}l(ue),f("start"),u($);},Z=()=>{l([null,null]),f("start"),u(ga__default.default().locale(n));},O=()=>{o&&o(s),A();},K=()=>{l(t),f("start"),A();},te=Et.useCallback(_=>{let{day:$,...ue}=_,[Re,Ae]=s,ae=Re?$.isSame(Re,"day"):false,ve=Ae?$.isSame(Ae,"day"):false,Pe=Re&&Ae?$.isBetween(Re,Ae,"day","()"):false,lt=false;return g==="end"&&Re&&!Ae&&p&&$.isAfter(Re,"day")&&$.isBefore(p.add(1,"day"),"day")&&(lt=true),jsxRuntime.jsx(yx,{...ue,day:$,disableMargin:true,isStart:ae,isEnd:ve,isInRange:Pe||lt,onMouseEnter:()=>b($)})},[s,g,p]),se=_=>_?_.locale(n).format("YYYY-MM-DD"):"";return jsxRuntime.jsxs(material.Box,{children:[jsxRuntime.jsx(material.TextField,{label:i,value:s[0]?`${se(s[0])} - ${se(s[1])}`:"",onClick:S,fullWidth:true,size:"small",InputLabelProps:{sx:{fontSize:Cr}},InputProps:{readOnly:true,sx:{fontSize:Cr,"& .MuiOutlinedInput-input":{fontSize:Cr},paddingRight:"4px"},endAdornment:jsxRuntime.jsxs(material.InputAdornment,{position:"end",sx:{ml:0},children:[(s[0]||s[1])&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:_=>{_.stopPropagation(),Z();},edge:"end",sx:{mr:.5,padding:"2px"},children:jsxRuntime.jsx(Fh__default.default,{sx:{fontSize:"1rem"}})}),jsxRuntime.jsx(material.IconButton,{size:"small",edge:"end",onClick:S,sx:{padding:"2px"},children:jsxRuntime.jsx(dx__default.default,{sx:{fontSize:"1rem"},color:"action"})})]})}}),jsxRuntime.jsxs(material.Popover,{open:M,anchorEl:c,onClose:A,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{sx:{display:"flex",flexDirection:"column",p:0,width:320}}},children:[jsxRuntime.jsx(material.Box,{sx:{p:2,bgcolor:"background.default",borderBottom:1,borderColor:"divider"},children:jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:1.5,justifyContent:"space-between",children:[jsxRuntime.jsx(material.TextField,{label:a("dateRange.startDate"),placeholder:ri,value:w,error:k,size:"small",onFocus:()=>f("start"),onChange:_=>{m(_.target.value),k&&E(false);},onBlur:()=>T("start",w),onKeyDown:_=>{_.key==="Enter"&&(_.preventDefault(),T("start",w));},sx:{flex:1,"& .MuiInputBase-input":{fontSize:Cr,py:.75},"& .MuiInputLabel-root":{fontSize:Cr}}}),jsxRuntime.jsx(px__default.default,{color:"action",fontSize:"small"}),jsxRuntime.jsx(material.TextField,{label:a("dateRange.endDate"),placeholder:ri,value:h,error:R,size:"small",onFocus:()=>{s[0]&&f("end");},onChange:_=>{y(_.target.value),R&&C(false);},onBlur:()=>T("end",h),onKeyDown:_=>{_.key==="Enter"&&(_.preventDefault(),T("end",h));},sx:{flex:1,"& .MuiInputBase-input":{fontSize:Cr,py:.75},"& .MuiInputLabel-root":{fontSize:Cr}}})]})}),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:v,onMonthChange:u,onYearChange:u,onChange:D,slots:{day:te},views:["year","month","day"],openTo:"day",showDaysOutsideCurrentMonth:true,sx:{m:0}})}),jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsxs(material.Stack,{direction:"row",justifyContent:"flex-end",spacing:1,sx:{p:2},children:[jsxRuntime.jsx(material.Button,{size:"small",onClick:K,color:"inherit",children:a("common.cancel")}),jsxRuntime.jsx(material.Button,{size:"small",variant:"contained",onClick:O,children:a("common.done")})]})]})]})};var yl={equals:"=",contains:"\u2287",notContains:"\u2285",wildcard:"*","=":"=","!=":"!=",">":">","<":"<",">=":"\u2265","<=":"\u2264",between:"\u2194"},Mx={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"},Dx=["equals","contains","notContains","wildcard"],up=["=","!=",">","<",">=","<=","between"],It="0.85rem",Ax=({field:e,value:t,onChange:o})=>{let{t:a}=re(),[r,n]=Et.useState(null),[i,c]=Et.useState(null),[d,s]=Et.useState(""),[l,g]=Et.useState(""),[f,p]=Et.useState(false),[b,v]=Et.useState(""),[u,w]=Et.useState("");Et.useEffect(()=>{let S=setTimeout(()=>{w(b);},1e3);return ()=>clearTimeout(S)},[b]);let m=t?.operator||(e.type==="number"?"=":"equals"),h=t?.value,y=S=>{let A=Mx[S];return A?a(A):S},k=S=>{n(S.currentTarget);},E=S=>{o({...t,operator:S,value:h}),n(null);},R={size:"small",fullWidth:true,variant:"outlined",InputLabelProps:{sx:{fontSize:It}},InputProps:{sx:{fontSize:It}},SelectProps:{MenuProps:{PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:It,paddingTop:"4px",paddingBottom:"4px",minHeight:"auto"}}}}}},C=e.type||"text";if(C==="date"){let A=(M=>{if(!M)return [null,null];if(Array.isArray(M)&&M.length===2){let D=M[0]?ga__default.default.isDayjs(M[0])?M[0]:ga__default.default(M[0]):null,B=M[1]?ga__default.default.isDayjs(M[1])?M[1]:ga__default.default(M[1]):null;return [D,B]}return ga__default.default.isDayjs(M)||typeof M=="string"?[ga__default.default.isDayjs(M)?M:ga__default.default(M),null]:[null,null]})(h);return jsxRuntime.jsx(sp,{label:e.label,value:A,onChange:M=>o({value:M,operator:"between"})})}if(C==="number"&&m==="between"){let S=()=>{o({value:[d,l],operator:"between"}),c(null);},A=Array.isArray(h)?`${h[0]||""} - ${h[1]||""}`:"";return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.TextField,{...R,label:e.label,value:A,placeholder:a("smartFilter.minMaxPlaceholder"),InputProps:{...R.InputProps,startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(material.Tooltip,{title:y("between"),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:k,sx:{width:24,height:24,fontSize:It},children:yl.between})})}),readOnly:true},onClick:M=>c(M.currentTarget)}),jsxRuntime.jsx(material.Menu,{anchorEl:r,open:!!r,onClose:()=>n(null),PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:It,minHeight:"auto",py:.5}}},children:up.map(M=>jsxRuntime.jsxs(material.MenuItem,{selected:M===m,onClick:()=>E(M),children:[jsxRuntime.jsx(material.Box,{sx:{width:24,display:"inline-block",fontWeight:"bold"},children:yl[M]}),jsxRuntime.jsx(material.ListItemText,{primary:y(M),primaryTypographyProps:{fontSize:It}})]},M))}),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:M=>s(M.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:It}},InputProps:{sx:{fontSize:It}}}),jsxRuntime.jsx(Rx__default.default,{color:"action"}),jsxRuntime.jsx(material.TextField,{size:"small",label:a("smartFilter.max"),type:"number",value:l,onChange:M=>g(M.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:It}},InputProps:{sx:{fontSize:It}}}),jsxRuntime.jsx(material.Button,{variant:"contained",size:"small",onClick:S,children:a("common.ok")})]})})]})}if(e.isValueHelp||C==="value-help"){let S=e.valueHelp?.mode||"single";return jsxRuntime.jsx(lu,{...R,...e.valueHelp,label:e.label,placeholder:e.placeholder||e.valueHelp?.placeholder,value:h??(S==="multiple"?[]:null),mode:S,onChange:A=>o({value:A,operator:S==="multiple"?"anyOf":"equals"})})}if(C==="select")return jsxRuntime.jsxs(material.TextField,{...R,select:true,label:e.label,value:h||"",onChange:S=>o({...t,value:S.target.value,operator:"equals"}),children:[jsxRuntime.jsx(material.MenuItem,{value:"",children:jsxRuntime.jsx("em",{children:a("common.none")})}),e.options?.map(S=>jsxRuntime.jsx(material.MenuItem,{value:S.value,children:S.label},S.value))]});if(C==="multi-select"){let S=Array.isArray(h)?h:[],A=e.options?.filter(M=>M.label.toLowerCase().includes(u.toLowerCase()))||[];return jsxRuntime.jsxs(material.TextField,{...R,select:true,label:e.label,value:S,onChange:M=>o({...t,value:M.target.value,operator:"anyOf"}),SelectProps:{...R.SelectProps,multiple:true,onClose:()=>{v(""),w("");},renderValue:M=>{if(!Array.isArray(M)||M.length===0)return jsxRuntime.jsx("em",{children:a("common.none")});let D=Z=>e.options?.find(O=>O.value===Z)?.label||Z,B=M.map(D);return B.length>2?`${B.slice(0,2).join(", ")} +${B.length-2}`:B.join(", ")}},children:[jsxRuntime.jsx(material.ListSubheader,{children:jsxRuntime.jsx(material.TextField,{size:"small",autoFocus:true,placeholder:a("smartFilter.searchPlaceholder"),fullWidth:true,InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(au__default.default,{fontSize:"small"})}),sx:{fontSize:It}},value:b,onChange:M=>v(M.target.value),onKeyDown:M=>{M.key!=="Escape"&&M.stopPropagation();},onClick:M=>M.stopPropagation()})}),A.length>0?A.map(M=>jsxRuntime.jsxs(material.MenuItem,{value:M.value,children:[jsxRuntime.jsx(material.Checkbox,{checked:S.indexOf(M.value)>-1,size:"small"}),jsxRuntime.jsx(material.ListItemText,{primary:M.label,primaryTypographyProps:{fontSize:It}})]},M.value)):jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.ListItemText,{primary:a("smartFilter.noOptionsFound"),primaryTypographyProps:{fontSize:It}})})]})}let I=C==="number"?up:Dx,T=f||h!==void 0&&h!==""&&h!==null||!!r;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.TextField,{...R,label:e.label,sx:{minWidth:"120px"},value:h||"",type:C==="number"?"number":"text",onChange:S=>o({...t,value:S.target.value,operator:m}),onFocus:()=>p(true),onBlur:()=>p(false),InputProps:{...R.InputProps,startAdornment:T?jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(material.Tooltip,{title:y(m),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:k,onMouseDown:S=>S.preventDefault(),sx:{width:24,height:24,fontSize:It,fontWeight:"bold",color:"primary.main",bgcolor:"action.hover"},children:yl[m]})})}):null,endAdornment:e.hasSearchIcon?jsxRuntime.jsx(material.InputAdornment,{position:"end",children:jsxRuntime.jsx(au__default.default,{color:"action"})}):void 0}}),jsxRuntime.jsx(material.Menu,{anchorEl:r,open:!!r,onClose:()=>n(null),PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:It,minHeight:"auto",py:.5}}},children:I.map(S=>jsxRuntime.jsxs(material.MenuItem,{selected:S===m,onClick:()=>E(S),children:[jsxRuntime.jsx(material.Box,{sx:{width:24,display:"inline-block",fontWeight:"bold"},children:yl[S]}),jsxRuntime.jsx(material.ListItemText,{primary:y(S),primaryTypographyProps:{fontSize:It}})]},S))})]})},ka=({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:p,currentLayoutId:b,layoutRefs:v,variantService:u,serviceUrl:w})=>{let{t:m}=re(),[h,y]=Et.useState(true),[k,E]=Et.useState(null),[R,C]=Et.useState(e.filter(A=>!A.hidden).map(A=>A.id)),I=(A,M)=>{o({...t,[A]:M});},T=A=>{R.includes(A)?C(R.filter(M=>M!==A)):C([...R,A]);};return jsxRuntime.jsxs(material.Paper,{sx:{mb:0,display:"flex",flexDirection:"column",overflow:"visible",position:"relative"},children:[jsxRuntime.jsxs(material.Box,{sx:{p:2,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[g?jsxRuntime.jsx(rp,{appId:g,tableKey:f,currentFilters:{values:t,visibleFields:R},currentLayout:p,currentLayoutId:b,layoutRefs:v,onLoad:A=>{if(!A.filters)return;let M=null;if(Array.isArray(A.filters)){let D=f||"default",B=A.filters.find(Z=>Z.scope===D);M=B?B.filters:null;}else M=A.filters;M&&(M.values||M.visibleFields?(M.visibleFields&&Array.isArray(M.visibleFields)&&C(M.visibleFields),M.values&&o(M.values)):o(M)),n&&n(A);},variantService:u,serviceUrl:w,currentVariantId:r}):jsxRuntime.jsx(fl,{variants:a,currentVariantId:r,onLoad:n,onSave:A=>{i&&i({...A,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:A=>E(A.currentTarget),size:"small",color:"primary",startIcon:jsxRuntime.jsx(Tx__default.default,{fontSize:"small"}),sx:{textTransform:"none",fontSize:It,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:It},children:m(l?"common.loading":"smartFilter.go")}),jsxRuntime.jsxs(material.Menu,{anchorEl:k,open:!!k,onClose:()=>E(null),slotProps:{paper:{style:{maxHeight:400,width:"25ch"},sx:{"& .MuiMenuItem-root":{fontSize:It,minHeight:32}}}},children:[jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.ListItemText,{primary:m("smartFilter.visibleFilters"),primaryTypographyProps:{fontSize:It}})}),jsxRuntime.jsx(material.Divider,{}),e.map(A=>jsxRuntime.jsxs(material.MenuItem,{onClick:()=>T(A.id),children:[jsxRuntime.jsx(material.Checkbox,{checked:R.includes(A.id),size:"small"}),jsxRuntime.jsx(material.ListItemText,{primary:A.label,primaryTypographyProps:{fontSize:It}})]},A.id))]})]})]}),jsxRuntime.jsx(material.Collapse,{in:h,children:jsxRuntime.jsx(material.Box,{sx:{px:2,pb:2},children:jsxRuntime.jsx(material.Grid,{container:true,spacing:2,columns:{xs:2,sm:3,md:4,lg:6},children:e.filter(A=>R.includes(A.id)).map(A=>jsxRuntime.jsx(material.Grid,{size:1,children:jsxRuntime.jsx(Ax,{field:A,value:t[A.id]||{value:"",operator:A.type==="number"?"=":"equals"},onChange:M=>I(A.id,M)})},A.id))})})}),jsxRuntime.jsx(material.Box,{sx:{position:"absolute",bottom:0,left:"50%",transform:"translate(-50%, 50%)",zIndex:10},children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>y(!h),sx:{bgcolor:"background.paper",boxShadow:2,border:"1px solid",borderColor:"divider",width:20,height:20,minHeight:0,p:0,"&:hover":{bgcolor:"background.paper"}},children:h?jsxRuntime.jsx(Ix__default.default,{sx:{fontSize:16},color:"action"}):jsxRuntime.jsx(Pb__default.default,{sx:{fontSize:16},color:"action"})})})]})};var xp=({layouts:e,currentLayoutId:t,onLoad:o,onSave:a,onDelete:r,onSetDefault:n})=>{let{t:i}=re(),[c,d]=Et.useState(null),[s,l]=Et.useState(false),[g,f]=Et.useState(""),[p,b]=Et.useState(""),[v,u]=Et.useState({isDefault:false,isPublic:false}),w=e.find(R=>R.id===t),m=R=>{d(R.currentTarget);},h=()=>{d(null);},y=R=>{o(R),h();},k=()=>{f(""),b(""),u({isDefault:false,isPublic:false}),l(true),h();},E=()=>{g.trim()&&(a({name:g,description:p,...v}),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:k,color:"primary",size:"small",children:jsxRuntime.jsx(yp__default.default,{})})}),jsxRuntime.jsx(material.Tooltip,{title:i("layout.layoutOptions"),children:jsxRuntime.jsx(material.IconButton,{onClick:m,color:w?"primary":"default",children:jsxRuntime.jsx(Gx__default.default,{})})}),jsxRuntime.jsxs(material.Menu,{anchorEl:c,open:!!c,onClose:h,PaperProps:{sx:{width:320,maxHeight:400}},children:[jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.Typography,{variant:"caption",children:i("layout.selectLayout")})}),jsxRuntime.jsxs(material.MenuItem,{onClick:k,children:[jsxRuntime.jsx(material.ListItemIcon,{children:jsxRuntime.jsx(yp__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.ListItemText,{children:i("layout.saveCurrentLayout")})]}),jsxRuntime.jsx(material.Divider,{}),e.length===0&&jsxRuntime.jsx(material.MenuItem,{disabled:true,children:jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",children:i("layout.noSavedLayouts")})}),e.map((R,C)=>jsxRuntime.jsx(material.MenuItem,{onClick:()=>y(R),selected:R.id===t,children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",width:"100%",justifyContent:"space-between"},children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",overflow:"hidden",mr:1},children:[jsxRuntime.jsx(material.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:jsxRuntime.jsx(material.Typography,{variant:"body2",fontWeight:R.id===t?"bold":"normal",noWrap:true,children:R.name})}),R.description&&jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",noWrap:true,children:R.description})]}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center"},onClick:I=>I.stopPropagation(),children:[jsxRuntime.jsx(material.Tooltip,{title:R.isDefault?i("layout.removeDefault"):i("layout.setAsDefault"),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:I=>{I.stopPropagation(),n(R.id);},children:R.isDefault?jsxRuntime.jsx(Yy__default.default,{fontSize:"small",color:"warning"}):jsxRuntime.jsx($x__default.default,{fontSize:"small"})})}),jsxRuntime.jsx(material.Tooltip,{title:i("common.delete"),children:jsxRuntime.jsx(material.IconButton,{size:"small",color:"error",onClick:I=>{I.stopPropagation(),r(R.id);},children:jsxRuntime.jsx(rb__default.default,{fontSize:"small"})})})]})]})},R.id||C))]}),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:p,onChange:R=>b(R.target.value),fullWidth:true,size:"small"}),jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{checked:v.isDefault,onChange:R=>u({...v,isDefault:R.target.checked})}),label:i("layout.useAsDefault")}),jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{checked:v.isPublic,onChange:R=>u({...v,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:E,variant:"contained",disabled:!g,children:i("common.save")})]})]})]})};var kl=({appId:e,tableKey:t="default",currentLayoutData:o,onLayoutLoad:a,targetLayoutId:r,activeLayoutId:n,serviceUrl:i,onError:c,onSuccess:d})=>{let{t:s}=re(),[l,g]=Et.useState([]),[f,p]=Et.useState(""),b=`orbcafe.layouts.${e}.${t}`,v=C=>({id:C.layoutId,name:C.name,description:C.description??"",isDefault:!!C.isDefault,isPublic:!!C.isPublic,createdAt:C.createdAt??new Date().toISOString(),layoutData:C.layout??{}}),u=C=>({appId:e,tableKey:t,layoutId:C.id,name:C.name,description:C.description??"",isDefault:!!C.isDefault,isPublic:!!C.isPublic,createdAt:C.createdAt,layout:C.layoutData}),w=Et.useCallback(()=>{try{let C=localStorage.getItem(b);if(!C)return [];let I=JSON.parse(C);return Array.isArray(I)?I:[]}catch{return []}},[b]),m=Et.useCallback(C=>{try{localStorage.setItem(b,JSON.stringify(C));}catch{}},[b]);Et.useEffect(()=>{n!==void 0&&p(n);},[n]),Et.useEffect(()=>{if(r&&l.length>0){let C=l.find(I=>I.id===r);C&&(p(C.id),a(C));}},[r,l,a]);let h=Et.useCallback(async()=>{if(e){if(!i){let C=w();g(C);let I=C.find(T=>T.isDefault);I&&!f&&!r&&(p(I.id),a(I));return}try{let C=await fetch(`${i}/api/layouts?appId=${encodeURIComponent(e)}&tableKey=${encodeURIComponent(t)}`);if(!C.ok)throw new Error("LAYOUT_FETCH_FAILED");let T=(await C.json()).map(v);g(T);let S=T.find(A=>A.isDefault);S&&!f&&!r&&(p(S.id),a(S));}catch(C){console.error("Error fetching layouts",C);let I=w();g(I);let T=I.find(S=>S.isDefault);T&&!f&&!r&&(p(T.id),a(T)),c&&c(s("layout.toast.loadFallback"));}}},[e,t,i,c,f,a,r,w,s]);return Et.useEffect(()=>{h();},[e,t]),jsxRuntime.jsx(xp,{layouts:l,currentLayoutId:f,onLoad:C=>{p(C.id),a(C);},onSave:async C=>{let I=l.find(A=>A.name===C.name),T=I?I.id:Date.now().toString(),S={id:T,...C,createdAt:new Date().toISOString(),layoutData:o,isDefault:C.isDefault??false,isPublic:C.isPublic??false};if(!i){let M=l.some(D=>D.id===T)?l.map(D=>D.id===T?S:D):[...l,S];g(M),m(M),p(T),a(S),d&&d(s("layout.toast.saveLocalSuccess"));return}try{if(!(await fetch(`${i}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(u(S))})).ok)throw new Error("LAYOUT_SAVE_FAILED");d&&d(s("layout.toast.saveSuccess")),await h(),p(T),a(S);}catch(A){console.error("Error saving layout",A);let D=l.some(B=>B.id===T)?l.map(B=>B.id===T?S:B):[...l,S];g(D),m(D),p(T),a(S),d&&d(s("layout.toast.saveLocalSuccess")),c&&c(s("layout.toast.backendUnavailableSavedLocal"));}},onDelete:async C=>{if(!i){let I=l.filter(T=>T.id!==C);g(I),m(I),f===C&&p(""),d&&d(s("layout.toast.deleteLocalSuccess"));return}try{if(!(await fetch(`${i}/api/layouts/${encodeURIComponent(C)}`,{method:"DELETE"})).ok)throw new Error("LAYOUT_DELETE_FAILED");f===C&&p(""),d&&d(s("layout.toast.deleteSuccess")),await h();}catch(I){console.error("Error deleting layout",I);let T=l.filter(S=>S.id!==C);g(T),m(T),f===C&&p(""),d&&d(s("layout.toast.deleteLocalSuccess")),c&&c(s("layout.toast.backendUnavailableDeletedLocal"));}},onSetDefault:async C=>{if(!i){let I=l.map(T=>({...T,isDefault:T.id===C}));g(I),m(I),d&&d(s("layout.toast.defaultLocalSuccess"));return}try{let I=l.find(S=>S.id===C);if(!I)return;if(!(await fetch(`${i}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(u({...I,isDefault:!0}))})).ok)throw new Error("LAYOUT_DEFAULT_FAILED");d&&d(s("layout.toast.defaultSuccess")),await h();}catch(I){console.error("Error setting default",I);let T=l.map(S=>({...S,isDefault:S.id===C}));g(T),m(T),d&&d(s("layout.toast.defaultLocalSuccess")),c&&c(s("layout.toast.backendUnavailableDefaultLocal"));}}})};var Cp=(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},Sl=(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 kp(e,t,o){return t[o]<e[o]?-1:t[o]>e[o]?1:0}function Kx(e,t){return e==="desc"?(o,a)=>kp(o,a,t):(o,a)=>-kp(o,a,t)}function qx(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 mn=e=>{let t=Et.useCallback(z=>{let H=String(z?.label??z?.id??"").length*9+64,ce=typeof z?.minWidth=="number"?z.minWidth:0;return Math.max(100,ce,H)},[]),o=Et.useCallback(()=>(e.columns||[]).filter(z=>!!z?.numeric).map(z=>z.id),[e.columns]),[a,r]=Et.useState(""),[n,i]=Et.useState(e.order||"asc"),[c,d]=Et.useState(e.orderBy||""),[s,l]=Et.useState([]),[g,f]=Et.useState(e.page||0),[p,b]=Et.useState(e.rowsPerPage||20),[v,u]=Et.useState(e.selected||[]),[w,m]=Et.useState(e.columns?e.columns.map(z=>z.id):[]),[h,y]=Et.useState(e.columns?e.columns.map(z=>z.id):[]),[k,E]=Et.useState(e.showSummary||false),[R,C]=Et.useState(()=>o()),[I,T]=Et.useState([]),[S,A]=Et.useState(new Set),[M,D]=Et.useState(()=>{let z={};return (e.columns||[]).forEach(V=>{z[V.id]=t(V);}),z}),[B,Z]=Et.useState(null),[O,K]=Et.useState(null),[te,se]=Et.useState(null),[_,$]=Et.useState(null),[ue,Re]=Et.useState(false),[Ae,ae]=Et.useState(""),[ve,Pe]=Et.useState("");Et.useEffect(()=>{e.layout&&fo(e.layout);},[e.layout]),Et.useEffect(()=>{e.order!==void 0&&i(e.order),e.orderBy!==void 0&&d(e.orderBy);},[e.order,e.orderBy]),Et.useEffect(()=>{e.selected!==void 0&&u(e.selected);},[e.selected]),Et.useEffect(()=>{e.page!==void 0&&f(e.page);},[e.page]),Et.useEffect(()=>{e.rowsPerPage!==void 0&&b(e.rowsPerPage);},[e.rowsPerPage]),Et.useEffect(()=>{let z=o();C(V=>V.filter(ce=>z.includes(ce)));},[o]),Et.useEffect(()=>{D(z=>{let V={...z};return (e.columns||[]).forEach(H=>{V[H.id]===void 0&&(V[H.id]=t(H));}),V});},[e.columns,t]),Et.useEffect(()=>{y(z=>{let V=(e.columns||[]).map(N=>N.id),H=new Set(V),ce=z.filter(N=>H.has(N)),me=new Set(ce),Me=V.filter(N=>!me.has(N)),P=[...ce,...Me];return P.length===z.length&&P.every((N,q)=>N===z[q])?z:P});},[e.columns]);let lt=Et.useMemo(()=>{let z=e.columns||[];if(h.length===0)return z;let V=new Map(z.map(me=>[me.id,me])),H=[],ce=new Set;return h.forEach(me=>{let Me=V.get(me);Me&&(H.push(Me),ce.add(me));}),z.forEach(me=>{ce.has(me.id)||H.push(me);}),H},[e.columns,h]),Xe=Et.useMemo(()=>{let z=e.rows||[];return a&&(z=z.filter(V=>Object.keys(V).some(H=>String(V[H]).toLowerCase().includes(a.toLowerCase())))),z},[e.rows,a]),Le=Et.useMemo(()=>{if(e.onSortChange)return Xe;if(s.length>0){let z=[...Xe];return z.sort((V,H)=>{for(let ce of s){let me=V?.[ce.field],Me=H?.[ce.field];if(!(me==null&&Me==null)){if(me==null)return ce.direction==="asc"?-1:1;if(Me==null)return ce.direction==="asc"?1:-1;if(me<Me)return ce.direction==="asc"?-1:1;if(me>Me)return ce.direction==="asc"?1:-1}}return 0}),z}return c?qx(Xe,Kx(n,c)):Xe},[Xe,n,c,s,e.onSortChange]),$e=Et.useCallback(z=>{if(I.length===0)return z.map(Me=>({type:"row",data:Me,id:Me[e.rowKey||"id"]}));let V=[...z].sort((Me,P)=>{for(let N of I){if(Me[N]<P[N])return -1;if(Me[N]>P[N])return 1}return 0}),H=(Me,P=0)=>{if(P>=I.length)return Me;let N=I[P],q={},oe=[];return Me.forEach(he=>{let Ce=he[N],Se=`${N}:${Ce}`;q[Se]||(q[Se]={key:Se,field:N,value:Ce,children:[],count:0,level:P},oe.push(q[Se])),q[Se].children.push(he),q[Se].count++;}),oe.forEach(he=>{he.children&&(he.children=H(he.children,P+1));}),oe},ce=H(V),me=(Me,P="")=>{let N=[];return Me.forEach(q=>{if(q.children){let oe=P?`${P}>${q.key}`:q.key,he=S.has(oe);N.push({type:"group",id:oe,field:q.field,value:q.value,level:q.level,count:q.count,isExpanded:he,childIds:(function Ce(Se){let ye=[];return Se.children.forEach(He=>{He.children?ye=ye.concat(Ce(He)):ye.push(He[e.rowKey||"id"]);}),ye})(q)}),he&&(N=N.concat(me(q.children,oe)));}else N.push({type:"row",data:q,id:q[e.rowKey||"id"],level:I.length});}),N};return me(ce)},[I,S,e.rowKey]),Ne=Et.useCallback(z=>{if(I.length===0)return [];let V=[...z].sort((me,Me)=>{for(let P of I){if(me[P]<Me[P])return -1;if(me[P]>Me[P])return 1}return 0}),H=[],ce=(me,Me,P)=>{if(Me>=I.length)return;let N=I[Me],q=new Map;me.forEach(oe=>{let he=oe[N],Ce=q.get(he);Ce?Ce.push(oe):q.set(he,[oe]);}),q.forEach((oe,he)=>{let Ce=`${N}:${he}`,Se=P?`${P}>${Ce}`:Ce;H.push(Se),ce(oe,Me+1,Se);});};return ce(V,0,""),H},[I]),j=Et.useMemo(()=>$e(Le),[Le,$e]),de=Et.useMemo(()=>Ne(Le),[Le,Ne]),De=Et.useMemo(()=>{let z=(e.rows||[]).length;return typeof e.count=="number"&&e.count>z},[e.count,e.rows]),Ve=Et.useMemo(()=>De?j:p>0?j.slice(g*p,g*p+p):j,[j,g,p,De]),G=Et.useMemo(()=>De&&typeof e.count=="number"?e.count:j.length,[j.length,De,e.count]),X=z=>{A(V=>{let H=new Set(V);return H.has(z)?H.delete(z):H.add(z),H});},Y=z=>{let V=de.filter(H=>H===z||H.startsWith(`${z}>`));A(H=>{let ce=new Set(H);return V.forEach(me=>ce.add(me)),ce});},J=z=>{A(V=>{let H=new Set(V);return Array.from(H).forEach(ce=>{(ce===z||ce.startsWith(`${z}>`))&&H.delete(ce);}),H});},pe=z=>{if(!z){A(new Set);return}A(new Set(de));},qe=z=>{let V=de.filter(H=>H.startsWith(`${z}>`));return V.length===0?S.has(z):S.has(z)&&V.every(H=>S.has(H))},_e=z=>{s.length>0&&l([]);let V=c===z&&n==="asc",H=c===z&&n==="desc";if(e.onSortChange){V?e.onSortChange(z,"desc"):H?e.onSortChange("","asc"):e.onSortChange(z,"asc");return}V?(i("desc"),d(z)):H?(i("asc"),d("")):(i("asc"),d(z));},ut=z=>{let V=z.filter(H=>H&&H.field);l(V),V.length>0&&d("");},pt=()=>{l([]);},at=(z,V)=>{D(H=>({...H,[z]:V}));},Dt=z=>{if(z.target.checked){let V=Xe.map(H=>H[e.rowKey||"id"]);u(V),e.onSelectionChange&&e.onSelectionChange(V);return}u([]),e.onSelectionChange&&e.onSelectionChange([]);},rt=(z,V)=>{let H=V[e.rowKey||"id"],ce=v.indexOf(H),me=[];ce===-1?me=me.concat(v,H):ce===0?me=me.concat(v.slice(1)):ce===v.length-1?me=me.concat(v.slice(0,-1)):ce>0&&(me=me.concat(v.slice(0,ce),v.slice(ce+1))),u(me),e.onSelectionChange&&e.onSelectionChange(me);},Oe=z=>{f(z),e.onPageChange&&e.onPageChange(z);},Ie=z=>{b(z),f(0),e.onPageChange&&e.onPageChange(0),e.onRowsPerPageChange&&e.onRowsPerPageChange(z);},mt=z=>{let V=w.indexOf(z),H=[...w];V===-1?H.push(z):H.splice(V,1),m(H);},je=z=>{let V=I.indexOf(z),H=[...I];V===-1?H.push(z):H.splice(V,1),T(H);},Vt=z=>{o().includes(z)&&C(H=>H.includes(z)?H.filter(ce=>ce!==z):[...H,z]);},mo=(z,V)=>{!z||!V||z===V||y(H=>{let ce=H.indexOf(z),me=H.indexOf(V);if(ce===-1||me===-1)return H;let Me=[...H];return Me.splice(ce,1),Me.splice(me,0,z),Me});},go=z=>{let V=z?.active?.id,H=z?.over?.id;typeof V=="string"&&typeof H=="string"&&mo(V,H);},Qt=z=>{e.onLayoutSave&&e.onLayoutSave({visibleColumns:w,columnOrder:h,order:n,orderBy:c,sortBy:s,grouping:I,columnWidths:M,showSummary:k,summaryColumns:R});},wt=z=>{let{layout:V,layoutId:H}=Sl(z,e.tableKey||"default");H?(Pe(H),ae(H)):(Pe(""),ae("")),V&&(V.visibleColumns&&m(V.visibleColumns),Array.isArray(V.columnOrder)&&y(V.columnOrder),V.order&&i(V.order),V.orderBy&&d(V.orderBy),Array.isArray(V.sortBy)&&l(V.sortBy),V.grouping&&T(V.grouping),V.columnWidths&&D(V.columnWidths),V.showSummary!==void 0&&E(!!V.showSummary),Array.isArray(V.summaryColumns)&&C(V.summaryColumns));},fo=z=>{let V=z?.layoutData||z?.layout||z||{};V.visibleColumns&&m(V.visibleColumns),Array.isArray(V.columnOrder)&&y(V.columnOrder),V.order&&i(V.order),V.orderBy!==void 0&&d(V.orderBy),Array.isArray(V.sortBy)&&l(V.sortBy),V.grouping&&T(V.grouping),V.columnWidths&&D(V.columnWidths),V.showSummary!==void 0&&E(!!V.showSummary),Array.isArray(V.summaryColumns)&&C(V.summaryColumns),A(new Set),f(0),z?.id&&ae(z.id),Pe("");};Et.useEffect(()=>{e.layout&&wt({layout:e.layout});},[e.layout]);let ho=z=>{z.preventDefault(),$(_===null?{mouseX:z.clientX+2,mouseY:z.clientY-6}:null);},bo=()=>{$(null);},Ko=Et.useMemo(()=>{if(!k)return {};let z={};e.columns.forEach(H=>{if(H.numeric&&R.includes(H.id)){let ce=Xe.reduce((me,Me)=>{let P=parseFloat(Me[H.id]);return me+(isNaN(P)?0:P)},0);z[H.id]=ce.toFixed(2);}else z[H.id]="";});let V=e.columns.find(H=>w.includes(H.id));return V&&!V.numeric&&(z[V.id]="Total"),z},[Xe,e.columns,k,R,w]),xt=()=>{if(!e.columns||!Xe)return;let z=e.columns.map(Me=>Me.label).join(","),V=Xe.map(Me=>e.columns.map(P=>{let N=Me[P.id];return `"${(N==null?"":String(N)).replace(/"/g,'""')}"`}).join(",")).join(`
184
+ `),H=`data:text/csv;charset=utf-8,${z}
185
+ ${V}`,ce=encodeURI(H),me=document.createElement("a");me.setAttribute("href",ce),me.setAttribute("download",`${e.title||"export"}.csv`),document.body.appendChild(me),me.click(),document.body.removeChild(me);},oo=()=>{Re(true);},Tt=()=>{Re(false);};return {isMobile:false,columns:lt,order:n,setOrder:i,orderBy:c,setOrderBy:d,sortBy:s,setSortBy:l,applyMultiSort:ut,clearMultiSort:pt,columnOrder:h,setColumnOrder:y,filterText:a,setFilterText:r,visibleColumns:w,setVisibleColumns:m,showSummary:k,setShowSummary:E,summaryColumns:R,grouping:I,setGrouping:T,expandedGroups:S,setExpandedGroups:A,groupAnchorEl:O,setGroupAnchorEl:K,summaryAnchorEl:te,setSummaryAnchorEl:se,columnWidths:M,setColumnWidths:D,anchorEl:B,setAnchorEl:Z,contextMenu:_,setContextMenu:$,sensors:void 0,sortedAndFilteredRows:Le,visibleRows:Ve,summaryRow:Ko,page:g,setPage:Oe,rowsPerPage:p,setRowsPerPage:Ie,totalDisplayCount:G,selected:v,setSelected:u,isAllExpanded:de.length>0&&de.every(z=>S.has(z)),handleColumnResize:at,handleRequestSort:_e,handleSelectAllClick:Dt,handleClick:rt,toggleSummaryColumn:Vt,handleDragEnd:go,handleColumnReorder:mo,handleExport:xt,handleContextMenu:ho,handleCloseContextMenu:bo,toggleColumnVisibility:mt,toggleGroupExpand:X,toggleGroupField:je,handleToggleAll:pe,handleExpandGroupRecursively:Y,handleCollapseGroupRecursively:J,isGroupFullyExpanded:qe,handleLayoutLoad:fo,handleVariantLoad:wt,handleLayoutSave:Qt,effectiveAppId:e.appId||"",currentLayoutData:{visibleColumns:w,order:n,orderBy:c,sortBy:s,columnOrder:h,grouping:I,columnWidths:M,showSummary:k,summaryColumns:R},currentLayoutId:Ae,layoutIdToLoad:ve,onPageChange:Oe,onRowsPerPageChange:Ie,graphReportOpen:ue,handleOpenGraphReport:oo,handleCloseGraphReport:Tt}};var Q2=e=>jsxRuntime.jsx(Zx__default.default,{...e}),J2=e=>jsxRuntime.jsx(Ys__default.default,{...e}),eA=e=>jsxRuntime.jsx(Mp__default.default,{...e}),tA=e=>jsxRuntime.jsx(db__default.default,{...e}),oA=e=>jsxRuntime.jsx(ub__default.default,{...e}),Qa=e=>{let{t}=re(),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:p=false,rowsPerPageOptions:b=[20,50,100,-1],onLayoutSave:v,filterConfig:u,rowKey:w,tableKey:m="default",graphReport:h,quickCreate:y,quickEdit:k,quickDelete:E,serviceUrl:R}=e,C=a||t("table.title.default"),{isMobile:I,columns:T,order:S,orderBy:A,filterText:M,setFilterText:D,visibleColumns:B,showSummary:Z,setShowSummary:O,summaryColumns:K,grouping:te,setGrouping:se,expandedGroups:_,groupAnchorEl:$,setGroupAnchorEl:ue,summaryAnchorEl:Re,setSummaryAnchorEl:Ae,columnWidths:ae,anchorEl:ve,setAnchorEl:Pe,contextMenu:lt,sensors:Xe,sortedAndFilteredRows:Le,summaryRow:$e,visibleRows:Ne,isAllExpanded:j,page:de,setPage:De,rowsPerPage:Ve,setRowsPerPage:G,totalDisplayCount:X,setSelected:Y,handleColumnResize:J,handleRequestSort:pe,handleSelectAllClick:qe,handleClick:_e,toggleSummaryColumn:ut,handleDragEnd:pt,handleExport:at,handleContextMenu:Dt,handleCloseContextMenu:rt,toggleColumnVisibility:Oe,toggleGroupExpand:Ie,toggleGroupField:mt,handleToggleAll:je,handleExpandGroupRecursively:Vt,handleCollapseGroupRecursively:mo,isGroupFullyExpanded:go,handleLayoutLoad:Qt,handleVariantLoad:wt,handleLayoutSave:fo,effectiveAppId:ho,currentLayoutData:bo,currentLayoutId:Ko,layoutIdToLoad:xt,graphReportOpen:oo,handleOpenGraphReport:Tt,handleCloseGraphReport:z}=mn(e),V=h?.enabled??false,H=V&&(h?.interaction?.enabled??true),ce=ml(),me=!!y?.enabled,Me=!!k?.enabled,P=!!E?.enabled,N=y?.fields,q=y?.excludeFields||[],oe=y?.initialValues||{},[he,Ce]=Et__namespace.default.useState(false),[Se,ye]=Et__namespace.default.useState(false),[He,Ge]=Et__namespace.default.useState({}),[gt,Ye]=Et__namespace.default.useState(false),[We,Ot]=Et__namespace.default.useState(false),[$t,vt]=Et__namespace.default.useState({}),[ao,Ct]=Et__namespace.default.useState(false),[ro,qo]=Et__namespace.default.useState(false),no=p||Se||We||ro,fa=Et__namespace.default.useMemo(()=>{let W=[...T];if(Array.isArray(N)&&N.length>0){let le=new Set(N);W=W.filter(ie=>le.has(ie.id));}if(q.length>0){let le=new Set(q);W=W.filter(ie=>!le.has(ie.id));}return W.filter(le=>!!le?.id)},[T,q,N]),Ha=w||"id",io=Et__namespace.default.useMemo(()=>{let W=new Set(i);return Le.filter(le=>W.has(le?.[Ha]))},[i,Le,Ha]),_o=io.length===1?io[0]:null,ha=k?.fields,zo=k?.excludeFields||[],na=k?.editableFields||[],pr=k?.nonEditableFields||[],Gr=k?.primaryKeys?.length?k.primaryKeys:[Ha],Wa=Et__namespace.default.useMemo(()=>{let W=[...T];if(Array.isArray(ha)&&ha.length>0){let le=new Set(ha);W=W.filter(ie=>le.has(ie.id));}if(zo.length>0){let le=new Set(zo);W=W.filter(ie=>!le.has(ie.id));}return W.filter(le=>!!le?.id)},[T,zo,ha]),mr=Et__namespace.default.useMemo(()=>new Set(Gr),[Gr]),ba=Et__namespace.default.useMemo(()=>new Set(na),[na]),yo=Et__namespace.default.useMemo(()=>new Set(pr),[pr]),jo=Et__namespace.default.useCallback(W=>ba.size>0?ba.has(W):!(yo.has(W)||mr.has(W)),[ba,yo,mr]);Et__namespace.default.useEffect(()=>{!oo&&ce.hasActiveFilters&&ce.clearAll();},[oo,ce.hasActiveFilters,ce.clearAll]);let Ur=()=>{let W={};fa.forEach(le=>{W[le.id]=oe[le.id]??"";}),Ge(W),Ce(true);},gr=()=>{Se||Ce(false);},Kr=(W,le)=>{Ge(ie=>({...ie,[W]:le}));},qr=async()=>{if(!y?.onSubmit){Ce(false);return}try{ye(!0),await y.onSubmit(He),Ce(!1);}finally{ye(false);}},_r=()=>{if(!_o)return;let W={};Wa.forEach(ie=>{W[ie.id]=_o[ie.id]??"";});let le=k?.getInitialValues?{...W,...k.getInitialValues(_o)}:W;vt(le),Ye(true);},wo=()=>{We||Ye(false);},jr=(W,le)=>{vt(ie=>({...ie,[W]:le}));},Zr=async()=>{if(_o){if(!k?.onSubmit){Ye(false);return}try{Ot(!0),await k.onSubmit($t,_o),Ye(!1);}finally{Ot(false);}}},fr=()=>{io.length!==0&&Ct(true);},ya=()=>{ro||Ct(false);},$a=async()=>{if(io.length===0){Ct(false);return}if(!E?.onConfirm){Ct(false),Y([]),c?.([]);return}try{qo(!0),await E.onConfirm(io),Ct(!1),Y([]),c?.([]);}finally{qo(false);}},Ga=Le,{fieldMapping:x}=sn({rows:Ga,config:{...h,title:h?.title||`${C} ${t("graph.reportTitle")}`}}),F=Et__namespace.default.useMemo(()=>H?ce.applyRows(Ga,x):Ga,[H,ce.applyRows,Ga,x]),{model:L}=sn({rows:F,config:{...h,title:h?.title||`${C} ${t("graph.reportTitle")}`,fieldMapping:x}}),Q=L.table.columns.map(W=>({id:W.id,label:W.label,align:W.align||"left",minWidth:120,numeric:W.align==="right"})),fe=ho?jsxRuntime.jsx(kl,{appId:ho,tableKey:m,currentLayoutData:bo,onLayoutLoad:Qt,targetLayoutId:xt,activeLayoutId:Ko,serviceUrl:R??u?.serviceUrl}):null,Fe=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Xr,{groupAnchorEl:$,setGroupAnchorEl:ue,grouping:te,setGrouping:se,columns:T,toggleGroupField:mt}),jsxRuntime.jsx(Yr,{anchorEl:ve,setAnchorEl:Pe,columns:T,visibleColumns:B,toggleColumnVisibility:Oe}),jsxRuntime.jsx(ji,{anchorEl:Re,setAnchorEl:Ae,showSummary:Z,setShowSummary:O,columns:T,summaryColumns:K,toggleSummaryColumn:ut}),jsxRuntime.jsx(Zi,{contextMenu:lt,handleCloseContextMenu:rt,columns:T,visibleColumns:B,toggleColumnVisibility:Oe})]});return I?jsxRuntime.jsxs(li__default.default,{sx:{display:"flex",flexDirection:"column",gap:2,height:"100%"},children:[u&&jsxRuntime.jsx(ka,{fields:u.fields,filters:u.filters,onFilterChange:u.onFilterChange,onSearch:u.onSearch,variants:u.variants||[],currentVariantId:u.currentVariantId,onVariantLoad:u.onVariantLoad,onVariantSave:u.onVariantSave,onVariantDelete:u.onVariantDelete,onVariantSetDefault:u.onVariantSetDefault,appId:u.appId,tableKey:m,currentLayout:[{tableKey:m,layoutData:bo}],variantService:u.variantService,serviceUrl:R??u.serviceUrl}),jsxRuntime.jsx(fu,{title:C,loading:p,showSummary:Z,setShowSummary:O,setAnchorEl:Pe,setSummaryAnchorEl:Ae,filterText:M,setFilterText:D,sortedAndFilteredRows:Le,selected:i,columns:T,visibleColumns:B,summaryRow:$e,handleClick:_e,selectionMode:n}),Fe]}):jsxRuntime.jsxs(li__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:[u&&jsxRuntime.jsx(li__default.default,{sx:{mb:2},children:jsxRuntime.jsx(ka,{fields:u.fields,filters:u.filters,onFilterChange:u.onFilterChange,onSearch:u.onSearch,variants:u.variants||[],currentVariantId:u.currentVariantId,onVariantLoad:W=>{wt(W),u.onVariantLoad&&u.onVariantLoad(W);},onVariantSave:u.onVariantSave,onVariantDelete:u.onVariantDelete,onVariantSetDefault:u.onVariantSetDefault,loading:p,appId:u.appId,tableKey:m,currentLayout:[{tableKey:m,layoutData:bo}],currentLayoutId:Ko,layoutRefs:[{tableKey:m,layoutId:Ko}],variantService:u.variantService,serviceUrl:R??u.serviceUrl})}),jsxRuntime.jsxs(_x__default.default,{sx:{width:g?"100%":"auto",mb:l?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative","&::before":no?{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(Gi,{filterText:M,setFilterText:D,onRowsPerPageChange:G,rowsPerPage:Ve,rowsPerPageOptions:b,page:de,count:X,onPageChange:De,actions:d,extraTools:s,grouping:te,setGroupAnchorEl:ue,showSummary:Z,setShowSummary:O,setAnchorEl:Pe,setSummaryAnchorEl:Ae,handleExport:at,showCreateButton:me,onOpenCreateDialog:Ur,showEditButton:Me,onOpenEditDialog:_r,editDisabled:io.length!==1,showDeleteButton:P,onOpenDeleteConfirm:fr,deleteDisabled:io.length===0,onLayoutSave:v||u?.variantService&&u?.appId?fo:void 0,loading:p,layoutManager:fe,onOpenGraphReport:V?Tt:void 0}),jsxRuntime.jsx(Mp__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:Xe,collisionDetection:core.closestCenter,onDragEnd:pt,modifiers:[modifiers.restrictToHorizontalAxis],children:jsxRuntime.jsxs(jx__default.default,{sx:{minWidth:g?750:"auto",width:g?"100%":"auto",tableLayout:Object.keys(ae).length>0?"fixed":"auto",borderCollapse:"separate",borderSpacing:0,"& .MuiTableCell-root":{fontSize:o}},"aria-labelledby":"tableTitle",size:"small",stickyHeader:true,children:[jsxRuntime.jsx(Ki,{columns:T,visibleColumns:B,order:S,orderBy:A,onRequestSort:pe,onContextMenu:Dt,selectionMode:n,grouping:te,isAllExpanded:j,handleToggleAll:je,rowCount:Le.length,numSelected:i.length,onSelectAllClick:qe,columnWidths:ae,onColumnResize:J}),jsxRuntime.jsx(pu,{visibleRows:Ne,columns:T,visibleColumns:B,selectionMode:n,selected:i,orderBy:A,loading:p,expandedGroups:_,toggleGroupExpand:Ie,handleExpandGroupRecursively:Vt,handleCollapseGroupRecursively:mo,isGroupFullyExpanded:go,handleClick:_e,onSelectionChange:c,grouping:te,rowKeyProp:w,page:de,rowsPerPage:Ve}),Z&&jsxRuntime.jsx(mu,{showSummary:Z,columns:T,visibleColumns:B,summaryRow:$e,selectionMode:n?.toString(),grouping:te,orderBy:A,zIndex:3})]})})})]}),me&&jsxRuntime.jsxs(Sp__default.default,{open:he,onClose:gr,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:W=>`1px solid ${W.palette.divider}`,bgcolor:"background.paper"}}},children:[jsxRuntime.jsx(wp__default.default,{sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:y?.title||t("quickCreate.createWithTitle",{title:C})}),jsxRuntime.jsx(Tp__default.default,{sx:{pt:"8px !important"},children:jsxRuntime.jsxs(li__default.default,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[fa.map(W=>{let le=W.type==="number"||W.numeric?"number":W.type==="date"?"date":"text",ie=W.label||W.id;return jsxRuntime.jsx(Pp__default.default,{label:ie,value:He[W.id]??"",onChange:st=>Kr(W.id,st.target.value),type:le,size:"small",fullWidth:true,InputLabelProps:{shrink:le==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-create-${W.id}`)}),y?.description&&jsxRuntime.jsx(Rp__default.default,{severity:"info",sx:{fontSize:"0.85rem","& .MuiAlert-message":{fontSize:"0.85rem"}},children:y.description})]})}),jsxRuntime.jsxs(Ip__default.default,{sx:{px:3,pb:2},children:[jsxRuntime.jsx(Tl__default.default,{onClick:gr,sx:{fontSize:"0.85rem"},disabled:Se,children:y?.cancelLabel||t("common.cancel")}),jsxRuntime.jsx(Tl__default.default,{onClick:qr,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:Se,children:y?.submitLabel||t("common.save")})]})]}),Me&&jsxRuntime.jsxs(Sp__default.default,{open:gt,onClose:wo,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:W=>`1px solid ${W.palette.divider}`,bgcolor:"background.paper"}}},children:[jsxRuntime.jsx(wp__default.default,{sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:k?.title||t("quickEdit.editWithTitle",{title:C})}),jsxRuntime.jsx(Tp__default.default,{sx:{pt:"8px !important"},children:jsxRuntime.jsxs(li__default.default,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Wa.map(W=>{let le=W.type==="number"||W.numeric?"number":W.type==="date"?"date":"text",ie=W.label||W.id,st=jo(W.id);return jsxRuntime.jsx(Pp__default.default,{label:ie,value:$t[W.id]??"",onChange:U=>jr(W.id,U.target.value),type:le,size:"small",fullWidth:true,disabled:!st,InputLabelProps:{shrink:le==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-edit-${W.id}`)}),k?.description&&jsxRuntime.jsx(Rp__default.default,{severity:"info",sx:{fontSize:"0.85rem","& .MuiAlert-message":{fontSize:"0.85rem"}},children:k.description})]})}),jsxRuntime.jsxs(Ip__default.default,{sx:{px:3,pb:2},children:[jsxRuntime.jsx(Tl__default.default,{onClick:wo,sx:{fontSize:"0.85rem"},disabled:We,children:k?.cancelLabel||t("common.cancel")}),jsxRuntime.jsx(Tl__default.default,{onClick:Zr,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:We||!_o,children:k?.submitLabel||t("common.save")})]})]}),P&&jsxRuntime.jsx($n,{open:ao,type:"warning",title:E?.title||t("quickDelete.confirmTitle"),message:E?.message||(io.length>1?t("quickDelete.confirmMessageMultiple",{count:io.length}):t("quickDelete.confirmMessageSingle")),confirmText:E?.confirmText||t("common.delete"),cancelText:E?.cancelText||t("common.cancel"),onClose:ya,onConfirm:$a}),Fe,V&&jsxRuntime.jsx(ul,{open:oo,onClose:z,model:L,aiAssistant:h?.aiAssistant,interaction:H?{enabled:true,filters:ce.filters,fieldMapping:x,onPrimaryDimensionClick:W=>ce.setFilter("primaryDimension",W),onSecondaryDimensionClick:W=>ce.setFilter("secondaryDimension",W),onStatusClick:W=>ce.setFilter("status",W),onClearFilter:ce.clearFilter,onClearAll:ce.clearAll}:void 0,tableContent:jsxRuntime.jsx(Qa,{appId:ho||"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}})})]})},aA=Qa;var dA=({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(su,{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(ka,{...d})}),jsxRuntime.jsx(material.Box,{sx:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:jsxRuntime.jsx(Qa,{...s,fitContainer:true,filterConfig:c==="integrated"?d:void 0})})]}),n]})};var hA=({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}=re(),[s,l]=Et.useState(false),[g,f]=Et.useState([]),[p,b]=Et.useState({}),[v,u]=Et.useState(e.variants||[]),[w,m]=Et.useState(e.layout||null),[h,y]=Et.useState(""),[k,E]=Et.useState(0),[R,C]=Et.useState(0),[I,T]=Et.useState(o),[S,A]=Et.useState([]),[M,D]=Et.useState("asc"),[B,Z]=Et.useState("");Et.useEffect(()=>{let ae={};e.filters.forEach(ve=>{ve.defaultValue!==void 0&&(ae[ve.id]=ve.defaultValue);}),b(ae);},[e.filters]);let O=Et.useCallback(async(ae,ve,Pe,lt,Xe)=>{l(true);try{let Le={...ae,page:ve+1,limit:Pe,sort:Xe,order:lt},$e;t?$e=await t(Le):typeof e.api=="function"?$e=await e.api(Le):e.api&&typeof e.api=="object"?(console.log("Fetching from URL:",e.api.url,Le),$e={rows:[],total:0}):(console.warn("No API configured for report"),$e={rows:[],total:0}),$e&&(f($e.rows||[]),E($e.total||0));}catch(Le){console.error("Failed to fetch report data",Le);}finally{l(false);}},[e.api,t]);Et.useEffect(()=>{O(p,R,I,M,B);},[O,R,I,M,B]);let K=()=>{C(0),O(p,0,I,M,B);},te=ae=>{C(0),T(ae);},se=(ae,ve)=>{D(ve),Z(ae);},_=ae=>{b(ae);},$=ae=>{y(ae?.id||"");let ve=Cp(ae,r);if(ve){let lt=ve.values??ve;b(lt),O(lt,0,I,M,B),C(0);}let{layout:Pe}=Sl(ae,r);Pe&&m(Pe);},ue=ae=>{let ve={...ae,id:Date.now().toString(),createdAt:new Date().toISOString()};u(Pe=>[...Pe,ve]);},Re=ae=>{m(ae);};return {pageProps:{id:e.id,title:e.title,mode:n,filterConfig:{appId:e.id,tableKey:r,fields:e.filters,filters:p,onFilterChange:_,onSearch:K,onVariantLoad:$,onVariantSave:ue,onVariantDelete:ae=>u(ve=>ve.filter(Pe=>Pe.id!==ae)),onVariantSetDefault:ae=>{u(ve=>ve.map(Pe=>({...Pe,isDefault:Pe.id===ae})));},variants:v,currentVariantId:h,variantService:c,serviceUrl:i},tableProps:{appId:e.id,tableKey:r,columns:e.columns,rows:g,loading:s,rowKey:"id",count:k,page:R,rowsPerPage:I,rowsPerPageOptions:a,onPageChange:C,onRowsPerPageChange:te,selectionMode:"multiple",selected:S,onSelectionChange:A,onLayoutSave:Re,layout:w,title:e.title,showSummary:true,order:M,orderBy:B,serviceUrl:i,onSortChange:se,graphReport:e.graphReport||{enabled:true,title:`${e.title} ${d("graph.reportTitle")}`}}},filters:p,rows:g,loading:s,refresh:K}};var n0=e=>[...e].sort((t,o)=>o.value-t.value),xA=({bars:e=[],lines:t=[],combos:o=[],heatmap:a=[],pies:r=[],waterfalls:n=[]})=>{let i=Et.useMemo(()=>n0(e),[e]),c=Et.useMemo(()=>[...t],[t]),d=Et.useMemo(()=>[...o],[o]),s=Et.useMemo(()=>[...a],[a]),l=Et.useMemo(()=>{let f=r.reduce((p,b)=>p+b.value,0);return r.map(p=>({...p,percent:f>0?p.value/f*100:p.percent}))},[r]),g=Et.useMemo(()=>[...n],[n]);return {bars:i,lines:c,combos:d,heatmap:s,pies:l,waterfalls:g}};var wA=({apiKey:e,query:t,zoom:o=14,mapType:a="roadmap"})=>Et.useMemo(()=>!e||!t?"":ti({apiKey:e,query:t,zoom:o,mapType:a}),[e,t,o,a]),TA=({keyword:e,location:t})=>Et.useMemo(()=>il({keyword:e,location:t?{lng:t.lng,lat:t.lat,name:t.name}:void 0}),[e,t]);var si=({code:e,language:t="text",copyable:o=true,showLineNumbers:a=false,wrapLongLines:r=false,maxHeight:n})=>{let[i,c]=Et.useState(false),d=Et.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(p0__default.default,{fontSize:"inherit"}):jsxRuntime.jsx(u0__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 b0=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},y0=async e=>new Function("m","return import(m)")(e),ci=({expression:e,inline:t=false,allowKatex:o=false})=>{let a=Et.useMemo(()=>b0(e),[e]),[r,n]=Et.useState("");return Et.useEffect(()=>{let i=true;return (async()=>{if(!o||!a){n("");return}try{let d=await y0("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 T0=async e=>new Function("m","return import(m)")(e),Rc=({code:e,title:t="Mermaid Diagram",height:o=320,enabled:a=true})=>{let[r,n]=Et.useState(""),[i,c]=Et.useState(""),[d,s]=Et.useState(false),l=Et.useMemo(()=>e.trim(),[e]);return Et.useEffect(()=>{let g=true;return (async()=>{if(!a||!l){n(""),c("");return}s(true),c(""),n("");try{let p=await T0("mermaid"),b=p?.default||p;if(!b||typeof b.render!="function")throw new Error("Mermaid runtime is not available");b.initialize?.({startOnLoad:!1,securityLevel:"loose",theme:"default"});let v=await b.render(`orbcafe-mermaid-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,l),u=typeof v=="string"?v:v?.svg;g&&typeof u=="string"&&n(u);}catch(p){if(g){let b=p instanceof Error?p.message:"Failed to render Mermaid diagram";c(b);}}finally{g&&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(si,{code:l,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()),F0=e=>{let t=e.trim(),o=t.startsWith(":"),a=t.endsWith(":");return o&&a?"center":a?"right":"left"},Rl=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(F0),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}},Dc=({markdown:e,table:t,maxHeight:o=360})=>{let a=Et.useMemo(()=>t||(e?Rl(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 Dl=({content:e,title:t="Thinking",defaultExpanded:o=false,isStreaming:a=false})=>{let[r,n]=Et.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(W0__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 Bc=/(\*\*[^*]+\*\*|`[^`]+`|\[[^\]]+\]\([^)]+\)|\*[^*]+\*|\$[^$\n]+\$)/g,Al=e=>e.trim().startsWith("```"),Op=e=>/^#{1,6}\s+/.test(e.trim()),Ec=e=>/^[-*+]\s+/.test(e.trim()),Fc=e=>/^\d+\.\s+/.test(e.trim()),Hp=e=>/^(?:-{3,}|\*{3,}|_{3,})$/.test(e.trim()),Lc=e=>e.trim().startsWith(">"),Wp=(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())},$p=e=>e.trim().startsWith("<think>")||e.trim()===":::think",pi=(e,t,o)=>{let a=[],r=0,n=0;Bc.lastIndex=0;let i=Bc.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(ci,{expression:c,inline:true,allowKatex:true},d)):a.push(c);r=i.index+c.length,n+=1,i=Bc.exec(e);}return r<e.length&&a.push(e.slice(r)),a.length>0?a:[e]},mi=({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=Et.useMemo(()=>{let l=[],g=d.replace(/\r\n/g,`
188
188
  `).split(`
189
- `),f={enableMath:r},m=0;for(;m<g.length;){let b=g[m],C=b.trim();if(!C){m+=1;continue}if(n&&Vp(b)){if(C.startsWith("<think>")){let p=[],h=b;for(;;){let y=h.indexOf("<think>"),S=y>=0?h.slice(y+7):h,E=S.indexOf("</think>");if(E>=0){p.push(S.slice(0,E)),m+=1;break}if(p.push(S),m+=1,m>=g.length)break;h=g[m];}s.push(jsxRuntime.jsx(wl,{content:p.join(`
190
- `).trim()},`think-tag-${m}`));continue}m+=1;let v=[];for(;m<g.length&&g[m].trim()!==":::";)v.push(g[m]),m+=1;m<g.length&&g[m].trim()===":::"&&(m+=1),s.push(jsxRuntime.jsx(wl,{content:v.join(`
191
- `).trim()},`think-fence-${m}`));continue}if(Tl(b)){let v=C.slice(3).trim().toLowerCase(),p=[];for(m+=1;m<g.length&&!Tl(g[m]);)p.push(g[m]),m+=1;m<g.length&&Tl(g[m])&&(m+=1);let h=p.join(`
192
- `);if(a&&v==="mermaid"){s.push(jsxRuntime.jsx(vc,{code:h},`mermaid-${m}`));continue}if(r&&["math","latex","katex"].includes(v)){s.push(jsxRuntime.jsx(ai,{expression:h,allowKatex:true},`math-fence-${m}`));continue}s.push(jsxRuntime.jsx(ri,{code:h,language:v||"text",copyable:i,showLineNumbers:c,wrapLongLines:true},`code-${m}`));continue}if(r&&C.startsWith("$$")){let v=[];if(C.endsWith("$$")&&C!=="$$")v.push(C.slice(2,-2)),m+=1;else {let h=b.slice(b.indexOf("$$")+2);for(h.trim()&&v.push(h),m+=1;m<g.length;){let y=g[m],S=y.indexOf("$$");if(S>=0){v.push(y.slice(0,S)),m+=1;break}v.push(y),m+=1;}}s.push(jsxRuntime.jsx(ai,{expression:v.join(`
193
- `).trim(),allowKatex:true},`math-${m}`));continue}if(Lp(b)){let v=Math.min(6,b.match(/^#{1,6}/)?.[0]?.length||1),p=b.replace(/^#{1,6}\s+/,""),h=v===1?"h5":v===2?"h6":"subtitle1";s.push(jsxRuntime.jsx(material.Typography,{variant:h,sx:{mt:v===1?1.2:.8,mb:.5,fontWeight:700},children:li(p,f,`h-${m}`)},`heading-${m}`)),m+=1;continue}if(zp(b)){s.push(jsxRuntime.jsx(material.Divider,{sx:{my:1.2}},`hr-${m}`)),m+=1;continue}if(Np(g,m)){let v=m+2;for(;v<g.length&&g[v].trim()&&g[v].includes("|");)v+=1;let p=g.slice(m,v).join(`
194
- `),h=kl(p);if(h){s.push(jsxRuntime.jsx(kc,{table:h},`table-${m}`)),m=v;continue}}if(Pc(b)){let v=[];for(;m<g.length&&Pc(g[m]);)v.push(g[m].replace(/^\s*>\s?/,"")),m+=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:v.map((p,h)=>jsxRuntime.jsxs(Rt.Fragment,{children:[h>0&&jsxRuntime.jsx("br",{}),li(p,f,`q-${m}-${h}`)]},`quote-line-${h}`))})},`quote-${m}`));continue}if(Tc(b)){let v=[];for(;m<g.length&&Tc(g[m]);)v.push(g[m].trim().replace(/^[-*+]\s+/,"")),m+=1;s.push(jsxRuntime.jsx(material.Box,{component:"ul",sx:{my:.8,pl:2.5},children:v.map((p,h)=>jsxRuntime.jsx(material.Box,{component:"li",sx:{mb:.45},children:jsxRuntime.jsx(material.Typography,{variant:"body2",children:li(p,f,`ul-${m}-${h}`)})},`ul-item-${h}`))},`ul-${m}`));continue}if(Ic(b)){let v=[];for(;m<g.length&&Ic(g[m]);)v.push(g[m].trim().replace(/^\d+\.\s+/,"")),m+=1;s.push(jsxRuntime.jsx(material.Box,{component:"ol",sx:{my:.8,pl:2.7},children:v.map((p,h)=>jsxRuntime.jsx(material.Box,{component:"li",sx:{mb:.45},children:jsxRuntime.jsx(material.Typography,{variant:"body2",children:li(p,f,`ol-${m}-${h}`)})},`ol-item-${h}`))},`ol-${m}`));continue}let u=[];for(;m<g.length;){let v=g[m],p=v.trim();if(!p||Tl(v)||Lp(v)||zp(v)||Tc(v)||Ic(v)||Pc(v)||Np(g,m)||n&&Vp(v)||r&&p.startsWith("$$"))break;u.push(v),m+=1;}u.length>0?s.push(jsxRuntime.jsx(material.Typography,{variant:"body2",sx:{my:.65,lineHeight:1.65},children:u.map((v,p)=>jsxRuntime.jsxs(Rt.Fragment,{children:[p>0&&jsxRuntime.jsx("br",{}),li(v,f,`p-${m}-${p}`)]},`p-line-${p}`))},`p-${m}`)):m+=1;}return s},[d,r,a,n,i,c]);return jsxRuntime.jsx(material.Box,{className:o,sx:{"& strong":{fontWeight:700},"& em":{fontStyle:"italic"},"& a":{wordBreak:"break-all"}},children:l})};var eB=(e,t)=>jsxRuntime.jsx(si,{markdown:e,...t});var Wp=({value:e,onChange:t,onSubmit:o,onVoiceInput:r,onClear:a,placeholder:n,statusText:i,loading:c=false,compact:d=false,showStatusText:l=true})=>jsxRuntime.jsxs(material.Stack,{spacing:.75,children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:1,px:1.2,py:d?.25:.4,borderRadius:999,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",minHeight:d?38:44},children:[jsxRuntime.jsx(Jd__default.default,{sx:{fontSize:d?16:18,color:"text.secondary"}}),jsxRuntime.jsx(material.InputBase,{fullWidth:true,value:e,onChange:s=>t(s.target.value),onKeyDown:s=>{s.key==="Enter"&&(s.preventDefault(),o());},placeholder:n,sx:{fontSize:d?"0.84rem":"0.9rem"}}),e&&a&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:a,children:jsxRuntime.jsx(Ph__default.default,{sx:{fontSize:d?16:18}})}),r&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:r,children:jsxRuntime.jsx(vy__default.default,{sx:{fontSize:d?16:18}})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:o,disabled:c||!e.trim(),children:jsxRuntime.jsx(ky__default.default,{sx:{fontSize:d?16:18}})})]}),l&&i&&jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",children:i})]});var $p=(e,t)=>{let o=t.trim();if(!o)return e;let r=e.toLowerCase(),a=o.toLowerCase(),n=r.indexOf(a);return n<0?e:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e.slice(0,n),jsxRuntime.jsx(material.Box,{component:"mark",sx:{bgcolor:"warning.light",color:"warning.contrastText",px:.15,borderRadius:.4},children:e.slice(n,n+o.length)}),e.slice(n+o.length)]})},Il=({section:e,highlightQuery:t=""})=>{let o=e.columns||2;return jsxRuntime.jsxs(material.Paper,{variant:"outlined",sx:{p:1.8,borderRadius:2},children:[jsxRuntime.jsx(material.Typography,{variant:"subtitle1",sx:{fontWeight:700,mb:1.4},children:e.title}),jsxRuntime.jsx(material.Box,{sx:{display:"grid",gap:1.15,gridTemplateColumns:{xs:"1fr",md:o===3?"repeat(3, minmax(0, 1fr))":o===1?"1fr":"repeat(2, minmax(0, 1fr))"}},children:e.fields.map(r=>{let a=typeof r.value=="string"||typeof r.value=="number"?String(r.value):null;return jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:$p(r.label,t)}),jsxRuntime.jsx(material.Typography,{component:"div",variant:"body2",sx:{mt:.2,fontWeight:500,wordBreak:"break-word"},children:a?$p(a,t):r.value})]},r.id)})})]})};var Bc=e=>e==null?"":typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):"",Rl=e=>e.trim().toLowerCase(),Y0=(e,t)=>{let o=[];return e.forEach(r=>{r.fields.forEach(a=>{let n=a.searchableText||Bc(a.value),i={source:"section",sourceId:r.id,sourceSectionId:r.id,sourceTitle:r.title,fieldId:a.id,fieldLabel:a.label,fieldValue:n};o.push({hit:i,text:Rl(`${r.title} ${a.label} ${n}`)});});}),t.forEach(r=>{(r.fields||[]).forEach(a=>{let n=a.searchableText||Bc(a.value),i={source:"tab",sourceId:r.id,sourceTitle:r.label,fieldId:a.id,fieldLabel:a.label,fieldValue:n};o.push({hit:i,text:Rl(`${r.label} ${a.label} ${n}`)});}),(r.sections||[]).forEach(a=>{a.fields.forEach(n=>{let i=n.searchableText||Bc(n.value),c={source:"tab",sourceId:r.id,sourceSectionId:a.id,sourceTitle:`${r.label} / ${a.title}`,fieldId:n.id,fieldLabel:n.label,fieldValue:i};o.push({hit:c,text:Rl(`${r.label} ${a.title} ${n.label} ${i}`)});});});}),o},Gp=({sections:e,tabs:t=[],defaultTabId:o,ai:r})=>{let{t:a}=te(),[n,i]=Rt.useState(""),[c,d]=Rt.useState(o||t[0]?.id),[l,s]=Rt.useState("idle"),[g,f]=Rt.useState([]),[m,b]=Rt.useState(""),[C,u]=Rt.useState(""),[v,p]=Rt.useState(false),h=Rt.useMemo(()=>Y0(e,t),[e,t]);Rt.useEffect(()=>{if(t.length===0){d(void 0);return}t.some(R=>R.id===c)||d(o||t[0]?.id);},[t,c,o]);let y=Rt.useCallback(()=>{s("idle"),f([]),b(""),u("");},[]),S=Rt.useCallback(k=>{i(k),k.trim()||(s("idle"),f([]),b(""),u(""));},[]),E=Rt.useCallback(k=>{let R=Rl(k);return R?h.filter(I=>I.text.includes(R)).map(I=>I.hit):[]},[h]),P=Rt.useCallback(async()=>{let k=n.trim();if(!k)return;p(true);let R=E(k);if(f(R),R.length>0){s("search"),u(""),b(a("detail.searchAi.matches",{count:R.length})),p(false);return}if(r?.enabled!==false&&r?.onSubmit){s("ai"),b(a("detail.searchAi.autoAiFallback"));try{let w=await r.onSubmit(k,{query:k,hits:R,activeTabId:c,sections:e,tabs:t});u(typeof w=="string"?w:"");}finally{p(false);}return}s("search"),u(""),b(a("detail.searchAi.noMatch")),p(false);},[n,E,a,r,c,e,t]);return {query:n,setQuery:S,activeTabId:c,setActiveTabId:d,searchMode:l,hits:g,statusText:m,aiResponse:C,searching:v,handleSubmit:P,clearResult:y}};var AB=({title:e,subtitle:t,sections:o,tabs:r=[],defaultTabId:a,table:n,ai:i,rightHeaderSlot:c,searchBarWidth:d=460,onClose:l,closeLabel:s="Close"})=>{let{t:g}=te(),{query:f,setQuery:m,activeTabId:b,setActiveTabId:C,searchMode:u,hits:v,statusText:p,aiResponse:h,searching:y,handleSubmit:S,clearResult:E}=Gp({sections:o,tabs:r,defaultTabId:a,ai:i}),P=Rt.useMemo(()=>r.find(I=>I.id===b)||r[0],[r,b]),k=Rt.useCallback(I=>{let w=A=>{let M=document.getElementById(I);if(M){M.scrollIntoView({behavior:"smooth",block:"center"});return}A<4&&setTimeout(()=>w(A+1),60);};requestAnimationFrame(()=>w(0));},[]),R=Rt.useCallback((I,w)=>{if(r.some(A=>A.id===I)){C(I),k(w?`detail-tab-${I}-section-${w}`:`detail-tab-${I}`);return}k(`detail-section-${I}`);},[r,C,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(Wp,{value:f,onChange:m,onSubmit:S,onVoiceInput:i?.onVoiceInput,onClear:()=>{m(""),E();},placeholder:i?.placeholder||g("detail.searchAi.placeholder"),statusText:p,loading:y,compact:true,showStatusText:false})}),l&&jsxRuntime.jsx(material.Tooltip,{title:s,children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:l,children:jsxRuntime.jsx(rv__default.default,{fontSize:"small"})})}),c]})]}),p&&jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",sx:{mt:-0.7},children:p}),u==="search"&&v.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:v.length})}),jsxRuntime.jsx(material.Stack,{spacing:.35,children:v.slice(0,8).map(I=>jsxRuntime.jsx(material.Box,{component:"button",type:"button",onClick:()=>R(I.sourceId,I.sourceSectionId),sx:{textAlign:"left",border:0,bgcolor:"transparent",p:.2,cursor:"pointer",color:"text.primary",borderRadius:1,"&:hover":{bgcolor:"action.hover"}},children:jsxRuntime.jsxs(material.Typography,{variant:"body2",sx:{fontSize:"0.84rem"},children:[jsxRuntime.jsx(material.Box,{component:"span",sx:{color:"text.secondary"},children:I.sourceTitle})," \xB7 ",jsxRuntime.jsx(material.Box,{component:"span",sx:{fontWeight:700},children:I.fieldLabel})," = ",jsxRuntime.jsx(material.Box,{component:"span",children:I.fieldValue||"-"})]})},`${I.source}|${I.sourceId}|${I.fieldId}`))})]}),u==="ai"&&h&&jsxRuntime.jsxs(material.Paper,{variant:"outlined",sx:{p:1.5,borderRadius:2},children:[jsxRuntime.jsx(material.Typography,{variant:"subtitle2",sx:{fontWeight:700,mb:.7},children: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(si,{markdown:h})})]}),jsxRuntime.jsx(material.Box,{sx:{display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",lg:"repeat(2, minmax(0, 1fr))"}},children:o.map(I=>jsxRuntime.jsx(material.Box,{id:`detail-section-${I.id}`,children:jsxRuntime.jsx(Il,{section:I,highlightQuery:f})},I.id))}),r.length>0&&jsxRuntime.jsxs(material.Paper,{variant:"outlined",sx:{borderRadius:2,overflow:"hidden"},children:[jsxRuntime.jsx(material.Tabs,{value:P?.id||false,onChange:(I,w)=>C(w),variant:"scrollable",scrollButtons:"auto",sx:{borderBottom:"1px solid",borderColor:"divider"},children:r.map(I=>jsxRuntime.jsx(material.Tab,{value:I.id,label:I.label,sx:{textTransform:"none"}},I.id))}),jsxRuntime.jsxs(material.Box,{sx:{p:1.5},children:[jsxRuntime.jsx(material.Box,{id:`detail-tab-${P?.id||""}`}),P?.description&&jsxRuntime.jsx(material.Typography,{variant:"body2",color:"text.secondary",sx:{mb:1.2},children:P.description}),P?.content?P.content:jsxRuntime.jsxs(material.Stack,{spacing:1.5,children:[(P?.sections||[]).map(I=>jsxRuntime.jsx(material.Box,{id:`detail-tab-${P?.id}-section-${I.id}`,children:jsxRuntime.jsx(Il,{section:I,highlightQuery:f})},I.id)),P?.fields&&P.fields.length>0&&jsxRuntime.jsx(Il,{section:{id:`${P.id}-fields`,title:P.label,fields:P.fields,columns:2},highlightQuery:f})]})]})]}),n&&jsxRuntime.jsx(Xr,{title:n.title||g("detail.table.title"),...n.tableProps,filterConfig:void 0,fitContainer:false})]})};var _p=({bucket:e,cardCount:t,highlighted:o=false,children:r,emptyLabel:a,maxHeight:n,sx:i})=>{let{t:c}=te();return jsxRuntime.jsx(material.Paper,{sx:[d=>{let l=e.accentColor??d.palette.primary.main;return {position:"relative",minWidth:0,borderRadius:4,overflow:"hidden",border:`1px solid ${styles.alpha(l,o?.58:d.palette.mode==="dark"?.28:.18)}`,bgcolor:styles.alpha(d.palette.background.paper,d.palette.mode==="dark"?.92:.97),boxShadow:o?`0 18px 40px ${styles.alpha(l,.22)}`:`0 10px 28px ${styles.alpha(d.palette.common.black,d.palette.mode==="dark"?.18:.08)}`,transition:"border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease","&::before":{content:'""',display:"block",height:4,bgcolor:l}}},...Array.isArray(i)?i:i?[i]:[]],children:jsxRuntime.jsxs(material.Stack,{spacing:1.2,sx:{p:1.5},children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:1},children:[jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:.8},children:[e.icon,jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.96rem",fontWeight:800},children:e.title})]}),e.description&&jsxRuntime.jsx(material.Typography,{sx:{mt:.45,fontSize:"0.76rem",color:"text.secondary",lineHeight:1.45},children:e.description})]}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:.8,sx:{flexShrink:0},children:[jsxRuntime.jsx(material.Chip,{size:"small",label:t,sx:{fontWeight:700}}),typeof e.limit=="number"&&jsxRuntime.jsx(material.Chip,{size:"small",label:`${c("kanban.bucket.limit")} ${e.limit}`,color:t>e.limit?"warning":"default",variant:"outlined"})]})]}),o&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",color:"primary.main",fontWeight:700},children:c("kanban.bucket.dropHere")}),jsxRuntime.jsx(material.Box,{sx:{minHeight:220,maxHeight:n,overflowY:n?"auto":"visible",pr:n?.4:0},children:t>0?r:jsxRuntime.jsx(material.Box,{sx:d=>({minHeight:160,borderRadius:3,border:`1px dashed ${styles.alpha(d.palette.divider,.9)}`,bgcolor:d.palette.mode==="dark"?styles.alpha(d.palette.common.white,.02):styles.alpha(d.palette.primary.main,.03),display:"grid",placeItems:"center",px:2,textAlign:"center"}),children:jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.78rem",color:"text.secondary"},children:a??e.emptyLabel??c("kanban.empty")})})})]})})};var sv={success:"success",warning:"warning",info:"info",error:"error"},cv={critical:"error",high:"warning",medium:"info",low:"success"},dv=(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}},uv=e=>e?e.split(/\s+/).map(t=>t.charAt(0).toUpperCase()).slice(0,2).join(""):"NA",Fc=({card:e,bucket:t,dragging:o=false,overlay:r=false,onClick:a,sx:n})=>{let{t:i}=te(),c=!!(a&&t),d=e.tone??(e.priority?cv[e.priority]:"default"),l=d==="default"?"primary":sv[d],s=t?{card:e,bucket:t}:void 0;return jsxRuntime.jsx(material.Paper,{onClick:c?()=>s&&a?.(s):void 0,onKeyDown:c?g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),s&&a?.(s));}:void 0,role:c?"button":void 0,tabIndex:c?0:void 0,sx:[g=>{let f=d==="default"?g.palette.primary.main:g.palette[l].main;return {position:"relative",overflow:"hidden",p:1.4,borderRadius:3,border:`1px solid ${styles.alpha(f,g.palette.mode==="dark"?.42:.2)}`,bgcolor:styles.alpha(g.palette.background.paper,g.palette.mode==="dark"?.96:.98),boxShadow:r?`0 20px 45px ${styles.alpha(g.palette.common.black,.24)}`:o?"none":`0 8px 24px ${styles.alpha(g.palette.common.black,g.palette.mode==="dark"?.18:.08)}`,transform:r?"rotate(1deg) scale(1.01)":"none",transition:"transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease",cursor:c?"pointer":"default",opacity:o?.5:1,"&::before":{content:'""',position:"absolute",inset:"0 auto 0 0",width:4,bgcolor:f},"&:hover":c?{transform:"translateY(-1px)",boxShadow:`0 14px 32px ${styles.alpha(g.palette.common.black,g.palette.mode==="dark"?.28:.12)}`}:void 0}},...Array.isArray(n)?n:n?[n]:[]],children:jsxRuntime.jsxs(material.Stack,{spacing:1.1,children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:1},children:[jsxRuntime.jsxs(material.Box,{sx:{minWidth:0,flex:1},children:[(e.kicker||t?.title)&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",fontWeight:700,letterSpacing:.4,color:"text.secondary",textTransform:"uppercase"},children:e.kicker??t?.title}),jsxRuntime.jsx(material.Typography,{sx:{mt:.2,fontSize:"0.98rem",fontWeight:800,lineHeight:1.3},children:e.title})]}),e.priority&&jsxRuntime.jsx(material.Chip,{size:"small",color:l,label:dv(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??uv(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 mv=(e,t)=>Number.isNaN(e)||e<0?0:e>t?t:e,Xp=({buckets:e,cards:t})=>{let o=new Map;return t.forEach((r,a)=>{let n=o.get(r.bucketId)??[];n.push({card:r,sourceIndex:a}),o.set(r.bucketId,n);}),{buckets:e.map(r=>{let a=[...o.get(r.id)??[]].sort((n,i)=>n.card.position===void 0&&i.card.position===void 0?n.sourceIndex-i.sourceIndex:n.card.position===void 0?1:i.card.position===void 0?-1:n.card.position-i.card.position||n.sourceIndex-i.sourceIndex).map(({card:n},i)=>({...n,bucketId:r.id,position:i}));return {...r,cards:a}})}},er=(e,t)=>{for(let o=0;o<e.buckets.length;o+=1){let r=e.buckets[o],a=r.cards.findIndex(n=>n.id===t);if(a>=0)return {card:r.cards[a],bucket:r,bucketIndex:o,cardIndex:a}}},Al=(e,t)=>{let o=er(e,t.cardId);if(!o)return e;let r=e.buckets.findIndex(l=>l.id===t.toBucketId);if(r<0)return e;let a=e.buckets.map(l=>({...l,cards:l.cards.map(s=>({...s}))})),n=a[o.bucketIndex],[i]=n.cards.splice(o.cardIndex,1);if(!i)return e;let c=a[r],d=mv(t.targetIndex??c.cards.length,c.cards.length);return c.cards.splice(d,0,{...i,bucketId:t.toBucketId}),{buckets:a.map(l=>({...l,cards:l.cards.map((s,g)=>({...s,bucketId:l.id,position:g}))}))}};var Lc="kanban-card|",zc="kanban-bucket|",em=e=>`${Lc}${e}`,Iv=e=>`${zc}${e}`,Bl=e=>e?.startsWith(Lc)?e.slice(Lc.length):void 0,Jp=e=>e?.startsWith(zc)?e.slice(zc.length):void 0,Pv=({card:e,bucket:t,onCardClick:o})=>{let{setNodeRef:r,attributes:a,listeners:n,transform:i,transition:c,isDragging:d}=sortable.useSortable({id:em(e.id)}),l={transform:i?`translate3d(${i.x}px, ${i.y}px, 0)`:void 0,transition:c,zIndex:d?2:1,touchAction:"none",cursor:d?"grabbing":"grab"};return jsxRuntime.jsx(material.Box,{ref:r,style:l,...a,...n,children:jsxRuntime.jsx(Fc,{card:e,bucket:t,dragging:d,onClick:o})})},Rv=({bucket:e,highlighted:t,bucketMaxHeight:o,emptyBucketLabel:r,onCardClick:a})=>{let{isOver:n,setNodeRef:i}=core.useDroppable({id:Iv(e.id)});return jsxRuntime.jsx(material.Box,{ref:i,sx:{minWidth:0},children:jsxRuntime.jsx(_p,{bucket:e,cardCount:e.cards.length,highlighted:t||n,emptyLabel:r,maxHeight:o,children:jsxRuntime.jsx(sortable.SortableContext,{items:e.cards.map(c=>em(c.id)),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:1,children:e.cards.map(c=>jsxRuntime.jsx(Pv,{card:c,bucket:e,onCardClick:a},c.id))})})})})},QB=({model:e,onCardMove:t,onCardClick:o,minBucketWidth:r=320,bucketMaxHeight:a,emptyBucketLabel:n,sx:i})=>{let[c,d]=Rt.useState(null),[l,s]=Rt.useState(),g=core.useSensors(core.useSensor(core.PointerSensor,{activationConstraint:{distance:6}}),core.useSensor(core.TouchSensor,{activationConstraint:{delay:120,tolerance:8}})),f=Rt.useMemo(()=>c?er(e,c):void 0,[c,e]),m=Rt.useCallback(()=>{d(null),s(void 0);},[]),b=Rt.useCallback(p=>{if(!p)return;let h=Bl(p);return h?er(e,h)?.bucket.id:Jp(p)},[e]),C=Rt.useCallback(p=>{d(Bl(String(p.active.id))??null);},[]),u=Rt.useCallback(p=>{s(b(p.over?String(p.over.id):void 0));},[b]),v=Rt.useCallback(p=>{let h=Bl(String(p.active.id)),y=p.over?String(p.over.id):void 0;if(!h||!y){m();return}let S=er(e,h);if(!S){m();return}let E=S.bucket.id,P=S.cardIndex,k=Bl(y);if(k){let w=er(e,k);if(!w){m();return}E=w.bucket.id,P=w.cardIndex;}else {let w=Jp(y),A=e.buckets.find(M=>M.id===w);if(!w||!A){m();return}E=w,P=A.cards.length;}if(S.bucket.id===E&&S.cardIndex===P){m();return}let R=Al(e,{cardId:h,fromBucketId:S.bucket.id,toBucketId:E,targetIndex:P}),I=er(R,h);I&&!(I.bucket.id===S.bucket.id&&I.cardIndex===S.cardIndex)&&t?.({cardId:h,fromBucketId:S.bucket.id,toBucketId:I.bucket.id,targetIndex:I.cardIndex,card:I.card,model:R}),m();},[e,t,m]);return jsxRuntime.jsxs(core.DndContext,{sensors:g,collisionDetection:core.closestCorners,onDragStart:C,onDragOver:u,onDragEnd:v,onDragCancel:m,children:[jsxRuntime.jsx(material.Box,{sx:[{display:"grid",gridAutoFlow:"column",gridAutoColumns:`minmax(${r}px, 1fr)`,gap:2,alignItems:"start",overflowX:"auto",pb:.5},...Array.isArray(i)?i:i?[i]:[]],children:e.buckets.map(p=>jsxRuntime.jsx(Rv,{bucket:p,highlighted:p.id===l,bucketMaxHeight:a,emptyBucketLabel:n,onCardClick:o},p.id))}),jsxRuntime.jsx(core.DragOverlay,{children:f?jsxRuntime.jsx(material.Box,{sx:{width:Math.max(r-24,260)},children:jsxRuntime.jsx(Fc,{card:f.card,bucket:f.bucket,overlay:true})}):null})]})};var Bv=({initialModel:e,initialBuckets:t,initialCards:o})=>e||Xp({buckets:t??[],cards:o??[]}),r5=e=>{let{onCardMove:t,onCardClick:o}=e,[r,a]=Rt.useState(()=>Bv(e)),n=Rt.useCallback(s=>{a(g=>typeof s=="function"?s(g):s);},[]),i=Rt.useCallback(s=>er(r,s),[r]),c=Rt.useCallback((s,g,f)=>{let m=er(r,s);if(!m)return;let b=Al(r,{cardId:s,fromBucketId:m.bucket.id,toBucketId:g,targetIndex:f}),C=er(b,s);if(!C||C.bucket.id===m.bucket.id&&C.cardIndex===m.cardIndex)return;a(b);let u={cardId:s,fromBucketId:m.bucket.id,toBucketId:C.bucket.id,targetIndex:C.cardIndex,card:C.card,model:b};return t?.(u),u},[r,t]),d=Rt.useCallback((s,g)=>{a(f=>({buckets:f.buckets.map(m=>({...m,cards:m.cards.map(b=>b.id!==s?b:typeof g=="function"?g(b):{...b,...g})}))}));},[]),l=Rt.useMemo(()=>({model:r,onCardMove:s=>{c(s.cardId,s.toBucketId,s.targetIndex);},onCardClick:o}),[r,c,o]);return {model:r,actions:{replaceModel:n,moveCard:c,updateCard:d,getCard:i},boardProps:l}};var am=64,_v="#E9EDF2",jv="linear-gradient(90deg, #F5F7FA 0%, #E9EDF2 50%, #F5F7FA 100%)",Zv=["en","zh","fr","de","ja","ko"],nm={en:"EN",zh:"\u4E2D\u6587",fr:"FR",de:"DE",ja:"\u65E5\u672C\u8A9E",ko:"\uD55C\uAD6D\uC5B4"},zl=({appTitle:e,logo:t,mode:o="dark",onToggleMode:r,locale:a,localeLabel:n,localeOptions:i,onLocaleChange:c,searchPlaceholder:d,onSearch:l,user:s,onUserSetting:g,onUserLogout:f,userMenuItems:m,leftSlot:b,rightSlot:C})=>{let{t:u,locale:v}=te(),h=material.useTheme().palette.mode==="dark",[y,S]=Rt.useState(""),[E,P]=Rt.useState(null),[k,R]=Rt.useState(null),I=U=>{U.preventDefault(),l&&l(y.trim());},w=o==="system"?jsxRuntime.jsx($v__default.default,{fontSize:"small"}):o==="dark"?jsxRuntime.jsx(Gv__default.default,{fontSize:"small"}):jsxRuntime.jsx(Uv__default.default,{fontSize:"small"}),A=u(o==="system"?"header.theme.system":o==="dark"?"header.theme.dark":"header.theme.light"),M=a||v,D=i&&i.length>0?i:Zv,B=n||nm[M]||M.toUpperCase(),j=!!E,W=d||u("header.searchPlaceholder"),q=!!k,ee=[{key:"setting",label:u("header.menu.setting"),icon:jsxRuntime.jsx(bx__default.default,{sx:{fontSize:18}}),onClick:g},{key:"logout",label:u("header.menu.logout"),icon:jsxRuntime.jsx(qv__default.default,{sx:{fontSize:18}}),onClick:f}],le=m&&m.length>0?m:ee,_=U=>{R(null),U?.();};return jsxRuntime.jsxs(material.AppBar,{position:"sticky",elevation:0,sx:U=>({top:0,zIndex:U.zIndex.drawer+10,height:am,backgroundColor:U.palette.mode==="dark"?"#0D0D0D":_v,backgroundImage:U.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%)",jv,"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:U.palette.mode==="dark"?"rgba(255,255,255,0.12)":"rgba(15,23,42,0.12)"}),children:[jsxRuntime.jsxs(material.Toolbar,{sx:{minHeight:`${am}px !important`,px:2,gap:2},children:[jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:1.5,sx:{minWidth:220},children:[b,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:h?"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:I,sx:{width:"100%",maxWidth:540},children:jsxRuntime.jsx(material.TextField,{size:"small",fullWidth:true,value:y,onChange:U=>S(U.target.value),placeholder:W,InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(Jd__default.default,{sx:{color:h?"rgba(255,255,255,0.7)":"rgba(15,23,42,0.55)",fontSize:18}})}),sx:{color:h?"common.white":"rgba(17,24,39,0.9)",bgcolor:h?"rgba(255,255,255,0.08)":"#ffffff",borderRadius:999,"& .MuiOutlinedInput-notchedOutline":{borderColor:h?"rgba(255,255,255,0.15)":"rgba(15,23,42,0.2)"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:h?"rgba(255,255,255,0.35)":"rgba(15,23,42,0.35)"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:h?"rgba(255,255,255,0.5)":"rgba(15,23,42,0.55)"}}},inputProps:{style:{color:h?"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:U=>P(U.currentTarget),sx:{color:h?"common.white":"#111827",borderRadius:1,px:.5},children:jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:.45,children:[jsxRuntime.jsx(rm__default.default,{sx:{fontSize:18}}),jsxRuntime.jsx(material.Typography,{variant:"caption",sx:{fontWeight:500},children:B})]})}),jsxRuntime.jsx(material.Menu,{anchorEl:E,open:j,onClose:()=>P(null),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:D.map(U=>jsxRuntime.jsx(material.MenuItem,{selected:U===M,onClick:()=>{c(U),P(null);},sx:{fontSize:"0.82rem"},children:nm[U]},U))})]}):jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:.5,children:[jsxRuntime.jsx(rm__default.default,{sx:{color:h?"common.white":"#111827",fontSize:18}}),jsxRuntime.jsx(material.Typography,{variant:"caption",sx:{color:h?"common.white":"#111827",fontWeight:500},children:B})]}),jsxRuntime.jsx(material.IconButton,{size:"small",sx:{color:h?"common.white":"#111827"},onClick:r,title:A,children:w}),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:h?"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:h?"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:U=>R(U.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()})})]}),C]})]}),s&&jsxRuntime.jsx(material.Menu,{anchorEl:k,open:q,onClose:()=>R(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:le.map(U=>jsxRuntime.jsxs(material.MenuItem,{disabled:U.disabled,onClick:()=>_(U.onClick),children:[U.icon&&jsxRuntime.jsx(material.ListItemIcon,{children:U.icon}),jsxRuntime.jsx(material.ListItemText,{primary:U.label,slotProps:{primary:{sx:{fontSize:"0.86rem",fontWeight:500}}}})]},U.key))})]})};var im=({menuData:e=[],initialNavigationCollapsed:t=false}={})=>{let{navigationIslandProps:o}=qd({initialCollapsed:t,content:e}),[r,a]=Rt.useState(900);Rt.useEffect(()=>{let i=()=>a(window.innerHeight);return i(),window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[]);let n=Rt.useMemo(()=>Math.max(280,r-100),[r]);return {navigationIslandProps:o,navigationMaxHeight:n}};var P5=({appTitle:e,menuData:t=[],children:o,showNavigation:r=true,locale:a="en",localeLabel:n,localeOptions:i,onLocaleChange:c,user:d,onUserSetting:l,onUserLogout:s,userMenuItems:g,logo:f,onSearch:m,rightHeaderSlot:b,leftHeaderSlot:C,contentSx:u})=>{let v="orbcafe:page-layout-mode",[p,h]=Rt.useState("system"),[y,S]=Rt.useState("light"),[E,P]=Rt.useState(false),k=p==="system"?E?y:"light":p;Rt.useEffect(()=>{try{let D=window.localStorage.getItem(v);(D==="light"||D==="dark"||D==="system")&&h(D);}catch{}P(true);let A=window.matchMedia("(prefers-color-scheme: dark)"),M=()=>{S(A.matches?"dark":"light");};return M(),A.addEventListener("change",M),()=>A.removeEventListener("change",M)},[]),Rt.useEffect(()=>{if(E)try{window.localStorage.setItem(v,p);}catch{}},[E,p]),Rt.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 R=Rt.useMemo(()=>material.createTheme({palette:{mode:k}}),[k]),{navigationIslandProps:I,navigationMaxHeight:w}=im({menuData:t,initialNavigationCollapsed:false});return jsxRuntime.jsx(material.ThemeProvider,{theme:R,children:jsxRuntime.jsx(Li,{locale:a,children:jsxRuntime.jsxs(material.Box,{sx:A=>({minHeight:"100vh",width:"100%",display:"flex",flexDirection:"column",overflowX:"hidden",background:A.palette.mode==="dark"?"linear-gradient(180deg, #0A0A0A 0%, #141414 55%, #1A1A1A 100%)":A.palette.background.default}),children:[jsxRuntime.jsx(zl,{appTitle:e,logo:f,mode:p,onToggleMode:()=>h(A=>A==="system"?"dark":A==="dark"?"light":"system"),locale:a,localeLabel:n,localeOptions:i,onLocaleChange:c,user:d,onUserSetting:l,onUserLogout:s,userMenuItems:g,onSearch:m,leftSlot:C,rightSlot:b}),jsxRuntime.jsxs(material.Box,{sx:{flex:1,minHeight:0,minWidth:0,display:"flex",overflowX:"hidden"},children:[r&&jsxRuntime.jsx(material.Box,{sx:{p:1.5,display:"flex",alignItems:"flex-start",flexShrink:0},children:jsxRuntime.jsx(Ud,{...I,maxHeight:w,colorMode:k})}),jsxRuntime.jsx(material.Box,{sx:{flex:1,minWidth:0,minHeight:0,overflow:"auto",p:1.5,...u},children:o})]})]})})})};var Vl="(blank)",sm="Result",cm="Grand Total",dm={sum:"Sum",count:"Count",avg:"Average",min:"Min",max:"Max"},um=["sum","count","avg","min","max"];var pm=["palette","rows","columns","filters","values"];var mm=e=>pm.includes(e),gm=e=>e==="rows"||e==="columns"||e==="filters",Ol=e=>{let t=e.split("|");return t.length===2&&t[0]==="container"&&mm(t[1])?{kind:"container",zone:t[1]}:t.length===3&&t[0]==="item"&&mm(t[1])&&t[2]?{kind:"item",zone:t[1],key:t[2]}:null},Rr=e=>e==null||e===""?Vl:e instanceof Date?e.toISOString().slice(0,10):String(e),Ra=e=>JSON.stringify(e),fm=(e,t)=>{let o=e.join(""),r=t.join("");return o.localeCompare(r,void 0,{sensitivity:"base"})},rC=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},mn=(e,t,o)=>{if(o==="count")return e.length;let r=e.map(a=>rC(a[t])).filter(a=>a!==null);return r.length===0?0:o==="sum"?r.reduce((a,n)=>a+n,0):o==="avg"?r.reduce((a,n)=>a+n,0)/r.length:o==="min"?Math.min(...r):Math.max(...r)},Nt=(e,t)=>{if(!e||e.length===0)return [];let o=new Set,r=[];return e.forEach(a=>{!t.has(a)||o.has(a)||(o.add(a),r.push(a));}),r},Dr=(e,t)=>e.length!==t.length?false:e.every((o,r)=>o===t[r]),hm=(e,t)=>{let o=Object.keys(e),r=Object.keys(t);return o.length!==r.length?false:o.every(a=>{let n=e[a]??[],i=t[a]??[];return Dr(n,i)})},Hl=(e,t)=>e.length!==t.length?false:e.every((o,r)=>{let a=t[r];return o.tokenId===a.tokenId&&o.fieldId===a.fieldId&&o.aggregation===a.aggregation}),Wc=e=>!e?.aggregations||e.aggregations.length===0?um:e.aggregations,lo=(e,t)=>{let o=Wc(t);return e&&o.includes(e)?e:t?.type==="number"&&o.includes("sum")?"sum":o.includes("count")?"count":o[0]},fi=(e,t,o)=>{let r=o.get(t.fieldId);return r?.formatValue?r.formatValue(e):t.aggregation==="count"?Math.round(e).toLocaleString():e.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:2})};var xm=({options:e,selectedValues:t,onChange:o,minWidth:r=96})=>{let{t:a}=te(),[n,i]=Rt.useState(""),c=Rt.useMemo(()=>{let l=n.trim().toLowerCase();return l?e.filter(s=>s.toLowerCase().includes(l)):e},[e,n]),d=e.length>0&&t.length===e.length;return jsxRuntime.jsx(material.FormControl,{size:"small",sx:{minWidth:r},children:jsxRuntime.jsxs(material.Select,{multiple:true,value:t,onChange:l=>{let s=l.target.value,g=typeof s=="string"?s.split(","):s;o(g);},onClick:l=>l.stopPropagation(),onMouseDown:l=>l.stopPropagation(),renderValue:l=>{let s=l;return e.length===0?a("pivot.filter.na"):s.length===0?a("common.none"):s.length===e.length?a("common.all"):`${s.length}/${e.length}`},MenuProps:{PaperProps:{sx:{maxHeight:320,bgcolor:"background.paper"}}},sx:{fontSize:"0.72rem",height:26,"& .MuiSelect-select":{py:.35}},children:[jsxRuntime.jsx(material.ListSubheader,{disableSticky:true,sx:l=>({bgcolor:"background.paper",py:.8,lineHeight:"normal",borderBottom:`1px solid ${l.palette.divider}`}),children:jsxRuntime.jsx(material.TextField,{size:"small",placeholder:`${a("common.search")}...`,fullWidth:true,value:n,onChange:l=>i(l.target.value),onKeyDown:l=>l.stopPropagation(),onClick:l=>l.stopPropagation(),sx:{m:0,"& .MuiInputBase-input":{fontSize:"0.75rem",py:.7}}})}),jsxRuntime.jsx(material.Box,{sx:l=>({px:1.5,py:.5,borderBottom:`1px solid ${l.palette.divider}`,bgcolor:"background.paper"}),onMouseDown:l=>{l.preventDefault(),l.stopPropagation();},onClick:l=>{l.preventDefault(),l.stopPropagation();},children:jsxRuntime.jsx(material.Button,{variant:"text",size:"small",onClick:l=>{l.preventDefault(),l.stopPropagation(),o(d?[]:e);},sx:{minWidth:"auto",px:0,py:.2,fontSize:"0.76rem",fontWeight:700,textTransform:"none"},children:a(d?"pivot.filter.deselectAll":"pivot.filter.selectAll")})}),c.length===0&&jsxRuntime.jsx(material.MenuItem,{disabled:true,sx:{fontSize:"0.75rem"},children:a("pivot.filter.noResults")}),c.map(l=>{let s=t.includes(l);return jsxRuntime.jsxs(material.MenuItem,{value:l,sx:{fontSize:"0.75rem",py:.25},children:[jsxRuntime.jsx(material.Checkbox,{size:"small",checked:s,sx:{p:.5,mr:.5}}),jsxRuntime.jsx(material.ListItemText,{primary:l,primaryTypographyProps:{sx:{fontSize:"0.75rem",lineHeight:1.2}}})]},l)})]})})};var Gc=({label:e,subtitle:t,isDragging:o,dragRef:r,listeners:a,attributes:n,style:i})=>jsxRuntime.jsx(material.Paper,{ref:r,...a,...n,sx:c=>({p:1,borderRadius:2,border:"1px solid",borderColor:"divider",bgcolor:c.palette.mode==="dark"?"#111111":"background.paper",touchAction:"none"}),style:{...i,opacity:o?.3:1,cursor:o?"grabbing":"grab"},children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:.8},children:[jsxRuntime.jsx(material.Box,{sx:c=>({display:"inline-flex",alignItems:"center",justifyContent:"center",p:.3,borderRadius:1,bgcolor:c.palette.mode==="dark"?"rgba(255,255,255,0.12)":"rgba(17, 24, 39, 0.08)"}),children:jsxRuntime.jsx(fC__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})]})]})}),km=({id:e,label:t,subtitle:o})=>{let{setNodeRef:r,listeners:a,attributes:n,isDragging:i}=core.useDraggable({id:e});return jsxRuntime.jsx(Gc,{label:t,subtitle:o,isDragging:i,dragRef:r,listeners:a,attributes:n})};var hn=({zone:e,title:t,hint:o,icon:r,children:a,itemCount:n,onClear:i})=>{let c=`container|${e}`,{isOver:d,setNodeRef:l}=core.useDroppable({id:c}),{t:s}=te();return jsxRuntime.jsxs(material.Paper,{ref:l,sx:g=>({p:1.1,borderRadius:3,border:"1px dashed",borderColor:d?"primary.main":g.palette.divider,bgcolor:d?g.palette.mode==="dark"?"rgba(25, 118, 210, 0.16)":"rgba(47, 91, 255, 0.06)":g.palette.mode==="dark"?"rgba(255,255,255,0.02)":"rgba(245, 248, 255, 0.86)",transition:"all 120ms ease",minHeight:120,display:"flex",flexDirection:"column"}),children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1},children:[jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:.8},children:[r,jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.79rem",fontWeight:800,letterSpacing:.2},children:t}),jsxRuntime.jsxs(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:["(",n,")"]})]}),n>0&&i&&jsxRuntime.jsx(material.Tooltip,{title:s("pivot.clearArea"),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:i,sx:{p:.25},children:jsxRuntime.jsx(vC__default.default,{sx:{fontSize:16}})})})]}),jsxRuntime.jsx(material.Typography,{sx:{mt:.5,mb:.9,fontSize:"0.7rem",color:"text.secondary"},children:o}),jsxRuntime.jsx(material.Box,{sx:{flex:1},children:a})]})};var wm={xs:1.2,md:1.6},yn=({title:e,subtitle:t,collapsed:o,onToggleCollapse:r,expandAriaLabel:a,collapseAriaLabel:n,children:i,bodySx:c,unmountOnExit:d=false,headerActions:l})=>jsxRuntime.jsxs(material.Paper,{sx:s=>({borderRadius:3,border:`1px solid ${s.palette.divider}`,overflow:"hidden",bgcolor:styles.alpha(s.palette.background.paper,.95)}),children:[jsxRuntime.jsxs(material.Box,{sx:s=>({px:wm,py:1,display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,borderBottom:o?"none":`1px solid ${s.palette.divider}`}),children:[jsxRuntime.jsxs(material.Box,{sx:{minWidth:0,flex:1},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.9rem",fontWeight:800},children:e}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.74rem",color:"text.secondary",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t})]}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:.75,flexShrink:0},children:[l,jsxRuntime.jsx(material.IconButton,{size:"small","aria-label":o?a:n,onClick:r,sx:s=>({border:`1px solid ${s.palette.divider}`,bgcolor:styles.alpha(s.palette.background.paper,.88),width:28,height:28,borderRadius:999,flexShrink:0,"&:hover":{bgcolor:s.palette.mode==="dark"?styles.alpha(s.palette.primary.main,.18):styles.alpha(s.palette.primary.main,.08)}}),children:jsxRuntime.jsx(yx__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:wm,py:{xs:1.2,md:1.6}},...Array.isArray(c)?c:c?[c]:[]],children:i})})]});var Kl=({label:e,caption:t,onRemove:o,trailing:r,isDragging:a,dragRef:n,listeners:i,attributes:c,style:d})=>jsxRuntime.jsx(material.Paper,{ref:n,style:d,sx:l=>({p:1,borderRadius:2,border:"1px solid",borderColor:"divider",bgcolor:l.palette.mode==="dark"?"#111111":"background.paper",touchAction:"none",opacity:a?0:1}),children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:.8},children:[jsxRuntime.jsx(material.Box,{...c,...i,sx:l=>({display:"inline-flex",alignItems:"center",justifyContent:"center",p:.25,borderRadius:1,bgcolor:l.palette.mode==="dark"?"rgba(255,255,255,0.12)":"rgba(17, 24, 39, 0.08)",cursor:"grab"}),children:jsxRuntime.jsx(fC__default.default,{sx:{fontSize:15,color:"text.secondary"}})}),jsxRuntime.jsxs(material.Box,{sx:{minWidth:0,flex:1},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.8rem",fontWeight:700,lineHeight:1.2},children:e}),t&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.7rem",color:"text.secondary",lineHeight:1.2},children:t})]}),r,o&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:l=>{l.stopPropagation(),o();},sx:{p:.2},children:jsxRuntime.jsx(Ph__default.default,{sx:{fontSize:16}})})]})}),hi=({id:e,label:t,caption:o,onRemove:r,trailing:a})=>{let{setNodeRef:n,attributes:i,listeners:c,transform:d,transition:l,isDragging:s}=sortable.useSortable({id:e}),g={transform:d?`translate3d(${d.x}px, ${d.y}px, 0)`:void 0,transition:l,zIndex:s?999:"auto"};return jsxRuntime.jsx(Kl,{label:t,caption:o,onRemove:r,trailing:a,isDragging:s,dragRef:n,listeners:c,attributes:i,style:g})};var jl={rows:jsxRuntime.jsx(FC__default.default,{fontSize:"small"}),columns:jsxRuntime.jsx($h__default.default,{fontSize:"small"}),filters:jsxRuntime.jsx(EC__default.default,{fontSize:"small"}),values:jsxRuntime.jsx(qh__default.default,{fontSize:"small"})},Pm=({isConfiguratorCollapsed:e,onToggleCollapse:t,availableFields:o,fieldMap:r,filterFields:a,columnFields:n,rowFields:i,valueFields:c,clearZone:d,removeFieldFromZone:l,getFilterSelectionSummary:s,renderDimensionFilterSelect:g,renderAggregationSelect:f,getAggregationLabel:m})=>{let{t:b}=te(),C=[`${b("pivot.zone.rows")} ${i.length}`,`${b("pivot.zone.columns")} ${n.length}`,`${b("pivot.zone.filters")} ${a.length}`,`${b("pivot.zone.values")} ${c.length}`].join(" \xB7 ");return jsxRuntime.jsx(yn,{title:b("pivot.config.title"),subtitle:C,collapsed:e,onToggleCollapse:t,expandAriaLabel:b("pivot.collapse.ariaExpand"),collapseAriaLabel:b("pivot.collapse.ariaCollapse"),unmountOnExit:true,children:jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",lg:"260px 1fr"},gap:2},children:[jsxRuntime.jsx(hn,{zone:"palette",title:b("pivot.fieldList"),hint:b("pivot.availableDimensions"),itemCount:o.length,icon:jsxRuntime.jsx(fC__default.default,{sx:{fontSize:16,color:"text.secondary"}}),children:jsxRuntime.jsxs(material.Stack,{spacing:.8,sx:{maxHeight:400,overflowY:"auto",pr:.5},children:[o.length===0&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.74rem",color:"text.secondary",py:1},children:b("pivot.allFieldsInUse")}),o.map(u=>jsxRuntime.jsx(km,{id:`item|palette|${u.id}`,label:u.label,subtitle:u.type??"string"},u.id))]})}),jsxRuntime.jsxs(material.Stack,{spacing:2,children:[jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[jsxRuntime.jsx(hn,{zone:"filters",title:b("pivot.zone.filters"),hint:b("pivot.hint.filters"),icon:jl.filters,itemCount:a.length,onClear:()=>d("filters"),children:jsxRuntime.jsx(sortable.SortableContext,{items:a.map(u=>`item|filters|${u}`),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:.7,children:a.map(u=>jsxRuntime.jsx(hi,{id:`item|filters|${u}`,label:r.get(u)?.label??u,caption:s(u),trailing:g(u),onRemove:()=>l("filters",u)},u))})})}),jsxRuntime.jsx(hn,{zone:"columns",title:b("pivot.zone.columns"),hint:b("pivot.hint.columns"),icon:jl.columns,itemCount:n.length,onClear:()=>d("columns"),children:jsxRuntime.jsx(sortable.SortableContext,{items:n.map(u=>`item|columns|${u}`),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:.7,children:n.map(u=>jsxRuntime.jsx(hi,{id:`item|columns|${u}`,label:r.get(u)?.label??u,caption:`${r.get(u)?.type??"dimension"} \u2022 ${s(u)}`,trailing:g(u),onRemove:()=>l("columns",u)},u))})})})]}),jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[jsxRuntime.jsx(hn,{zone:"rows",title:b("pivot.zone.rows"),hint:b("pivot.hint.rows"),icon:jl.rows,itemCount:i.length,onClear:()=>d("rows"),children:jsxRuntime.jsx(sortable.SortableContext,{items:i.map(u=>`item|rows|${u}`),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:.7,children:i.map(u=>jsxRuntime.jsx(hi,{id:`item|rows|${u}`,label:r.get(u)?.label??u,caption:`${r.get(u)?.type??"dimension"} \u2022 ${s(u)}`,trailing:g(u),onRemove:()=>l("rows",u)},u))})})}),jsxRuntime.jsx(hn,{zone:"values",title:b("pivot.zone.values"),hint:b("pivot.hint.values"),icon:jl.values,itemCount:c.length,onClear:()=>d("values"),children:jsxRuntime.jsx(sortable.SortableContext,{items:c.map(u=>`item|values|${u.tokenId}`),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:.7,children:c.map(u=>{let v=r.get(u.fieldId)?.label??u.fieldId,p=`${m(u.aggregation)}(${v})`;return jsxRuntime.jsx(hi,{id:`item|values|${u.tokenId}`,label:v,caption:p,trailing:f(u),onRemove:()=>l("values",u.tokenId)},u.tokenId)})})})})]})]})]})})};var Rm=e=>e.toLocaleString(void 0,{maximumFractionDigits:1}),Dm=({data:e,primaryLabel:t,secondaryLabel:o,formatPrimaryValue:r,formatSecondaryValue:a})=>{let n=styles.useTheme();if(e.length===0)return null;let i=720,c=250,d={top:20,right:24,bottom:40,left:52},l=o?e.map(u=>u.primaryValue):e.map((u,v)=>v+1),s=o?e.map(u=>u.secondaryValue??0):e.map(u=>u.primaryValue),g=Math.max(...l,1),f=Math.max(...s,1),m=i-d.left-d.right,b=c-d.top-d.bottom,C=e.map((u,v)=>{let p=o?u.primaryValue:v+1,h=o?u.secondaryValue??0:u.primaryValue,y=d.left+p/g*m,S=c-d.bottom-h/f*b;return {...u,x:y,y:S,rawX:p,rawY:h}});return jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[jsxRuntime.jsx(material.Box,{sx:{overflowX:"auto"},children:jsxRuntime.jsxs(material.Box,{component:"svg",viewBox:`0 0 ${i} ${c}`,sx:{width:"100%",minWidth:i,height:c},children:[jsxRuntime.jsx("line",{x1:d.left,y1:c-d.bottom,x2:i-d.right,y2:c-d.bottom,stroke:styles.alpha(n.palette.text.secondary,.35)}),jsxRuntime.jsx("line",{x1:d.left,y1:d.top,x2:d.left,y2:c-d.bottom,stroke:styles.alpha(n.palette.text.secondary,.35)}),C.map(u=>jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("circle",{cx:u.x,cy:u.y,r:7,fill:styles.alpha(n.palette.primary.main,.18)}),jsxRuntime.jsx("circle",{cx:u.x,cy:u.y,r:4.5,fill:n.palette.primary.main,children:jsxRuntime.jsxs("title",{children:[u.name,`
195
- `,o?`${t}: ${r(u.primaryValue)}`:`${t}: ${r(u.primaryValue)}`,o?`
196
- ${o}: ${(a??r)(u.secondaryValue??0)}`:""]})}),jsxRuntime.jsx("text",{x:u.x,y:Math.max(u.y-12,d.top+8),textAnchor:"middle",fontSize:"10",fill:n.palette.text.secondary,children:u.name})]},u.name)),jsxRuntime.jsx("text",{x:i/2,y:c-10,textAnchor:"middle",fontSize:"11",fill:n.palette.text.secondary,children:o?t:"Index"}),jsxRuntime.jsx("text",{x:16,y:c/2,textAnchor:"middle",transform:`rotate(-90 16 ${c/2})`,fontSize:"11",fill:n.palette.text.secondary,children:o??t}),jsxRuntime.jsx("text",{x:d.left,y:d.top-4,fontSize:"10",fill:n.palette.text.secondary,children:Rm(f)}),jsxRuntime.jsx("text",{x:i-d.right,y:c-d.bottom+16,textAnchor:"end",fontSize:"10",fill:n.palette.text.secondary,children:Rm(g)})]})}),jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",lg:"repeat(3, minmax(0, 1fr))"},gap:1},children:e.map(u=>jsxRuntime.jsxs(material.Box,{sx:v=>({borderRadius:2,px:1.25,py:1,border:`1px solid ${styles.alpha(v.palette.divider,.7)}`,bgcolor:styles.alpha(v.palette.background.default,.35)}),children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.78rem",fontWeight:700},noWrap:true,title:u.name,children:u.name}),jsxRuntime.jsxs(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:[t,": ",r(u.primaryValue)]}),o&&jsxRuntime.jsxs(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:[o,": ",(a??r)(u.secondaryValue??0)]})]},u.name))})]})};var Zc=e=>Math.max(...e,1),Am=({data:e,chartType:t,primaryLabel:o,secondaryLabel:r,formatPrimaryValue:a,formatSecondaryValue:n})=>{let i=styles.useTheme(),c=i.palette.primary.main,d=i.palette.warning.main;if(e.length===0)return null;if(t==="bar-horizontal"){let p=Zc(e.flatMap(h=>[h.primaryValue,h.secondaryValue??0]));return jsxRuntime.jsx(material.Stack,{spacing:1.1,children:e.map(h=>jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",md:"160px 1fr 128px"},gap:1.25,alignItems:"center"},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.78rem",fontWeight:700},noWrap:true,title:h.name,children:h.name}),jsxRuntime.jsxs(material.Stack,{spacing:.65,children:[jsxRuntime.jsx(material.Box,{sx:{height:10,borderRadius:999,overflow:"hidden",bgcolor:styles.alpha(i.palette.action.active,.08)},children:jsxRuntime.jsx(material.Box,{sx:{width:`${h.primaryValue/p*100}%`,height:"100%",bgcolor:c}})}),r&&jsxRuntime.jsx(material.Box,{sx:{height:8,borderRadius:999,overflow:"hidden",bgcolor:styles.alpha(i.palette.action.active,.08)},children:jsxRuntime.jsx(material.Box,{sx:{width:`${(h.secondaryValue??0)/p*100}%`,height:"100%",bgcolor:d}})})]}),jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",textAlign:{xs:"left",md:"right"},fontWeight:700},children:a(h.primaryValue)}),r&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",textAlign:{xs:"left",md:"right"},color:"text.secondary"},children:(n??a)(h.secondaryValue??0)})]})]},h.name))})}if(t==="bar-vertical"){let p=Zc(e.flatMap(y=>[y.primaryValue,y.secondaryValue??0])),h=r?92:76;return jsxRuntime.jsx(material.Box,{sx:{overflowX:"auto",pb:.5},children:jsxRuntime.jsx(material.Box,{sx:{minWidth:Math.max(620,e.length*h),display:"grid",gridTemplateColumns:`repeat(${e.length}, minmax(56px, 1fr))`,gap:1,alignItems:"end"},children:e.map(y=>jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsxs(material.Box,{sx:{height:210,display:"flex",alignItems:"flex-end",justifyContent:"center",gap:.8},children:[jsxRuntime.jsx(material.Box,{sx:{width:r?16:26,minHeight:8,height:`${Math.max(y.primaryValue/p*188,8)}px`,borderRadius:"10px 10px 2px 2px",bgcolor:c},title:`${o}: ${a(y.primaryValue)}`}),r&&jsxRuntime.jsx(material.Box,{sx:{width:16,minHeight:8,height:`${Math.max((y.secondaryValue??0)/p*188,8)}px`,borderRadius:"10px 10px 2px 2px",bgcolor:d},title:`${r}: ${(n??a)(y.secondaryValue??0)}`})]}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.76rem",fontWeight:700},noWrap:true,title:y.name,children:y.name}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.7rem",color:"text.secondary"},noWrap:true,title:a(y.primaryValue),children:a(y.primaryValue)}),r&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.7rem",color:"text.secondary"},noWrap:true,title:(n??a)(y.secondaryValue??0),children:(n??a)(y.secondaryValue??0)})]},y.name))})})}let l=Math.max(680,e.length*74),s=240,g={top:20,right:18,bottom:36,left:18},f=Zc(e.flatMap(p=>[p.primaryValue,p.secondaryValue??0])),m=l-g.left-g.right,b=s-g.top-g.bottom,C=p=>e.map((h,y)=>{let S=g.left+y*m/Math.max(e.length-1,1),E=s-g.bottom-p(h)/f*b;return {x:S,y:E,item:h}}),u=C(p=>p.primaryValue),v=r?C(p=>p.secondaryValue??0):[];return jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:1.1},children:[jsxRuntime.jsx(material.Box,{sx:{overflowX:"auto"},children:jsxRuntime.jsxs(material.Box,{component:"svg",viewBox:`0 0 ${l} ${s}`,sx:{width:"100%",minWidth:l,height:s},children:[jsxRuntime.jsx("line",{x1:g.left,y1:s-g.bottom,x2:l-g.right,y2:s-g.bottom,stroke:styles.alpha(i.palette.text.secondary,.35)}),jsxRuntime.jsx("polyline",{fill:"none",stroke:c,strokeWidth:3,points:u.map(p=>`${p.x},${p.y}`).join(" ")}),u.map(p=>jsxRuntime.jsx("circle",{cx:p.x,cy:p.y,r:4,fill:c,children:jsxRuntime.jsxs("title",{children:[p.item.name,`
197
- `,o,": ",a(p.item.primaryValue)]})},`primary-${p.item.name}`)),r&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("polyline",{fill:"none",stroke:d,strokeWidth:2.5,strokeDasharray:"5 5",points:v.map(p=>`${p.x},${p.y}`).join(" ")}),v.map(p=>jsxRuntime.jsx("circle",{cx:p.x,cy:p.y,r:3.5,fill:d,children:jsxRuntime.jsxs("title",{children:[p.item.name,`
198
- `,r,": ",(n??a)(p.item.secondaryValue??0)]})},`secondary-${p.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(p=>jsxRuntime.jsxs(material.Box,{sx:h=>({borderRadius:2,px:1.1,py:.9,border:`1px solid ${styles.alpha(h.palette.divider,.7)}`,bgcolor:styles.alpha(h.palette.background.default,.35)}),children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.76rem",fontWeight:700},noWrap:true,title:p.name,children:p.name}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.71rem",color:"text.secondary"},children:a(p.primaryValue)}),r&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.71rem",color:"text.secondary"},children:(n??a)(p.secondaryValue??0)})]},p.name))})]})};var Bm=(e,t,o)=>{let r=new Set,a=[];return e.forEach(n=>{r.has(n)||(r.add(n),a.push({fieldId:n,label:o.get(n)?.label??n,zone:"rows"}));}),t.forEach(n=>{r.has(n)||(r.add(n),a.push({fieldId:n,label:o.get(n)?.label??n,zone:"columns"}));}),a},Em=(e,t,o)=>e.map(r=>{let a=t.get(r.fieldId),n=a?.label??r.fieldId;return {fieldId:r.fieldId,label:`${o(r.aggregation)} \xB7 ${n}`,item:r,field:a}}),Fm=({rows:e,dimensionFieldId:t,primaryValue:o,secondaryValue:r})=>{if(!t)return [];let a=new Map;return e.forEach(n=>{let i=Rr(n[t]),c=a.get(i);if(c){c.push(n);return}a.set(i,[n]);}),Array.from(a.entries()).sort((n,i)=>n[0].localeCompare(i[0],void 0,{sensitivity:"base"})).map(([n,i])=>({name:n,primaryValue:mn(i,o.fieldId,o.aggregation),secondaryValue:r?mn(i,r.fieldId,r.aggregation):void 0}))};var Lm=({rows:e,fieldMap:t,rowFields:o,columnFields:r,valueFields:a,chartDimensionFieldId:n,chartPrimaryValueFieldId:i,chartSecondaryValueFieldId:c,chartType:d,isCollapsed:l,onChartDimensionFieldIdChange:s,onChartPrimaryValueFieldIdChange:g,onChartSecondaryValueFieldIdChange:f,onChartTypeChange:m,onToggleCollapse:b,getAggregationLabel:C})=>{let{t:u}=te(),v=Rt.useMemo(()=>Bm(o,r,t),[r,t,o]),p=Rt.useMemo(()=>Em(a,t,C),[t,C,a]),h=p.find(w=>w.fieldId===i)??p[0],y=p.find(w=>w.fieldId===c&&w.fieldId!==h?.fieldId)??null,S=v.find(w=>w.fieldId===n)??v[0],E=S&&h?u("pivot.chart.subtitleReady",{dimension:S.label,measure:y?`${h.label} / ${y.label}`:h.label}):u("pivot.chart.subtitle"),P=Rt.useMemo(()=>!S||!h?[]:Fm({rows:e,dimensionFieldId:S.fieldId,primaryValue:h.item,secondaryValue:y?.item}),[h,e,y,S]),k=w=>h?fi(w,h.item,t):w.toLocaleString(),R=w=>y?fi(w,y.item,t):w.toLocaleString(),I=v.length>1||p.length>1;return jsxRuntime.jsxs(yn,{title:u("pivot.chart.title"),subtitle:E,collapsed:l,onToggleCollapse:b,expandAriaLabel:u("pivot.chart.collapse.ariaExpand"),collapseAriaLabel:u("pivot.chart.collapse.ariaCollapse"),bodySx:{display:"flex",flexDirection:"column",gap:1.1},children:[I&&jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",xl:"repeat(4, minmax(0, 1fr))"},gap:1,alignItems:"start"},children:[jsxRuntime.jsxs(material.FormControl,{size:"small",sx:{minWidth:0,width:"100%"},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.68rem",color:"text.secondary",mb:.45},children:u("pivot.chart.dimension")}),jsxRuntime.jsx(material.Select,{value:S?.fieldId??"",onChange:w=>s(String(w.target.value)),sx:{fontSize:"0.75rem",height:32},children:v.map(w=>jsxRuntime.jsx(material.MenuItem,{value:w.fieldId,sx:{fontSize:"0.75rem"},children:w.label},w.fieldId))})]}),jsxRuntime.jsxs(material.FormControl,{size:"small",sx:{minWidth:0,width:"100%"},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.68rem",color:"text.secondary",mb:.45},children:u("pivot.chart.primaryMeasure")}),jsxRuntime.jsx(material.Select,{value:h?.fieldId??"",onChange:w=>g(String(w.target.value)),sx:{fontSize:"0.75rem",height:32},children:p.map(w=>jsxRuntime.jsx(material.MenuItem,{value:w.fieldId,sx:{fontSize:"0.75rem"},children:w.label},w.fieldId))})]}),jsxRuntime.jsxs(material.FormControl,{size:"small",sx:{minWidth:0,width:"100%"},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.68rem",color:"text.secondary",mb:.45},children:u("pivot.chart.secondaryMeasure")}),jsxRuntime.jsxs(material.Select,{value:y?.fieldId??"",onChange:w=>f(String(w.target.value)),sx:{fontSize:"0.75rem",height:32},children:[jsxRuntime.jsx(material.MenuItem,{value:"",sx:{fontSize:"0.75rem",color:"text.secondary"},children:u("common.none")}),p.filter(w=>w.fieldId!==h?.fieldId).map(w=>jsxRuntime.jsx(material.MenuItem,{value:w.fieldId,sx:{fontSize:"0.75rem"},children:w.label},w.fieldId))]})]}),jsxRuntime.jsxs(material.FormControl,{size:"small",sx:{minWidth:0,width:"100%"},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.68rem",color:"text.secondary",mb:.45},children:u("pivot.chart.chartType")}),jsxRuntime.jsxs(material.Select,{value:d,onChange:w=>m(w.target.value),sx:{fontSize:"0.75rem",height:32},children:[jsxRuntime.jsx(material.MenuItem,{value:"bar-vertical",sx:{fontSize:"0.75rem"},children:u("pivot.chart.style.barVertical")}),jsxRuntime.jsx(material.MenuItem,{value:"bar-horizontal",sx:{fontSize:"0.75rem"},children:u("pivot.chart.style.barHorizontal")}),jsxRuntime.jsx(material.MenuItem,{value:"line",sx:{fontSize:"0.75rem"},children:u("pivot.chart.style.line")}),jsxRuntime.jsx(material.MenuItem,{value:"scatter",sx:{fontSize:"0.75rem"},children:u("pivot.chart.style.scatter")})]})]})]}),jsxRuntime.jsx(material.Box,{children:S?h?P.length===0?jsxRuntime.jsx(material.Box,{sx:{py:5,textAlign:"center"},children:jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.86rem",color:"text.secondary"},children:u("pivot.chart.emptyNoData")})}):d==="scatter"?jsxRuntime.jsx(Dm,{data:P,primaryLabel:h.label,secondaryLabel:y?.label,formatPrimaryValue:k,formatSecondaryValue:R}):jsxRuntime.jsx(Am,{data:P,chartType:d,primaryLabel:h.label,secondaryLabel:y?.label,formatPrimaryValue:k,formatSecondaryValue:R}):jsxRuntime.jsx(material.Box,{sx:{py:5,textAlign:"center"},children:jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.86rem",color:"text.secondary"},children:u("pivot.chart.emptyNoValue")})}):jsxRuntime.jsx(material.Box,{sx:{py:5,textAlign:"center"},children:jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.86rem",color:"text.secondary"},children:u("pivot.chart.emptyNoDimension")})})})]})};var Yl=({node:e,dataColumns:t,fieldMap:o,level:r,expandedKeys:a,onToggle:n,getValue:i})=>{let c=a.has(e.key),d=e.children.length>0,l=e.isGrandTotal;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(material.TableRow,{sx:s=>({bgcolor:l?s.palette.mode==="dark"?"rgba(25, 118, 210, 0.22)":"rgba(47, 91, 255, 0.08)":s.palette.mode==="dark"?"#111111":"background.paper","&:hover":{bgcolor:l?s.palette.mode==="dark"?"rgba(25, 118, 210, 0.28)":"rgba(47, 91, 255, 0.12)":s.palette.mode==="dark"?"#181818":"rgba(0, 0, 0, 0.02)"}}),children:[jsxRuntime.jsxs(material.TableCell,{sx:s=>({fontSize:"0.76rem",fontWeight:l?800:600,borderBottom:`1px solid ${s.palette.divider}`,whiteSpace:"nowrap",pl:r*2+1,display:"flex",alignItems:"center",height:40}),children:[d&&!l&&jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>n(e.key),sx:{p:.2,mr:.5,ml:-1},children:c?jsxRuntime.jsx(xb__default.default,{sx:{fontSize:16}}):jsxRuntime.jsx(yf__default.default,{sx:{fontSize:16}})}),!d&&!l&&r>0&&jsxRuntime.jsx(material.Box,{sx:{width:20}}),e.value]}),t.map(s=>jsxRuntime.jsx(material.TableCell,{align:"right",sx:{fontSize:"0.76rem",fontWeight:l?800:500,borderBottom:g=>`1px solid ${g.palette.divider}`,whiteSpace:"nowrap"},children:fi(i?i(e,s.id):e.aggregatedValues[s.id]??0,s.valueItem,o)},`${e.key}-${s.id}`))]}),c&&e.children.map(s=>jsxRuntime.jsx(Yl,{node:s,dataColumns:t,fieldMap:o,level:r+1,expandedKeys:a,onToggle:n,getValue:i},s.key))]})};var ed=(e,t,o)=>{let r=[...e,...t];return o&&r.includes(o)?o:r[0]??""},es=(e,t)=>t&&e.some(o=>o.fieldId===t)?t:e[0]?.fieldId??"",td=(e,t,o)=>o===""?"":o&&o!==t&&e.some(r=>r.fieldId===o)?o:e.find(r=>r.fieldId!==t)?.fieldId??"",$m=e=>{let t=new Set,o=r=>{r.forEach(a=>{a.children.length>0&&(t.add(a.key),o(a.children));});};return o(e),t},Um=(e,t,o=0)=>e.length===0?o:e.reduce((r,a)=>a.children.length===0||!t.has(a.key)?Math.max(r,o+1):Math.max(r,Um(a.children,t,o+1)),o),hk=(e,t)=>{let o=[],r=a=>{a.forEach(n=>{if(n.children.length>0&&t.has(n.key)){r(n.children);return}o.push(n);});};return r(e),o},fF=({title:e,rows:t,fields:o,initialLayout:r,initialChart:a,emptyText:n,maxPreviewHeight:i=520,initialChartCollapsed:c=false,initialTableCollapsed:d=false,model:l,enablePresetManagement:s=false,presets:g,defaultPresets:f,onPresetsChange:m,initialPresetId:b,onPresetApplied:C})=>{let{t:u}=te(),v=core.useSensors(core.useSensor(core.PointerSensor,{activationConstraint:{distance:8}})),p=Rt.useRef(0),h=Rt.useRef(false),y=e??u("pivot.title.default"),S=n??u("pivot.empty"),E=Rt.useMemo(()=>({sum:u("pivot.agg.sum"),count:u("pivot.agg.count"),avg:u("pivot.agg.avg"),min:u("pivot.agg.min"),max:u("pivot.agg.max")}),[u]),P=Rt.useCallback(x=>E[x]??dm[x],[E]),k=Rt.useMemo(()=>new Set(o.map(x=>x.id)),[o]),R=Rt.useMemo(()=>new Map(o.map(x=>[x.id,x])),[o]),[I,w]=Rt.useState(()=>Nt(r?.rows,k)),[A,M]=Rt.useState(()=>Nt(r?.columns,k)),[D,B]=Rt.useState(()=>Nt(r?.filters,k)),[j,W]=Rt.useState(()=>{let x=r?.values??[],F=new Set,L=[];return x.forEach(Y=>{if(!k.has(Y.fieldId)||F.has(Y.fieldId))return;F.add(Y.fieldId),p.current+=1;let ue=R.get(Y.fieldId);L.push({tokenId:`v${p.current}`,fieldId:Y.fieldId,aggregation:lo(Y.aggregation,ue)});}),L}),[q,ee]=Rt.useState({}),[le,_]=Rt.useState(true),[U,ge]=Rt.useState(false),[Me,Ee]=Rt.useState(()=>ed(Nt(r?.rows,k),Nt(r?.columns,k),a?.dimensionFieldId)),[ie,Re]=Rt.useState(()=>{let x=(r?.values??[]).filter((F,L,Y)=>k.has(F.fieldId)&&Y.findIndex(ue=>ue.fieldId===F.fieldId)===L).map(F=>({tokenId:F.fieldId,fieldId:F.fieldId,aggregation:lo(F.aggregation,R.get(F.fieldId))}));return es(x,a?.primaryValueFieldId)}),[Be,lt]=Rt.useState(()=>{let x=(r?.values??[]).filter((L,Y,ue)=>k.has(L.fieldId)&&ue.findIndex(De=>De.fieldId===L.fieldId)===Y).map(L=>({tokenId:L.fieldId,fieldId:L.fieldId,aggregation:lo(L.aggregation,R.get(L.fieldId))})),F=es(x,a?.primaryValueFieldId);return td(x,F,a?.secondaryValueFieldId)}),[Ze,Oe]=Rt.useState(a?.chartType??"bar-vertical"),[qe,ot]=Rt.useState(c),[Z,se]=Rt.useState(d),[Ae,He]=Rt.useState(()=>f??[]),[G,X]=Rt.useState(""),[Ie,ke]=Rt.useState(false),[Fe,rt]=Rt.useState(""),[Xe,eo]=Rt.useState(null),[Zt,Tt]=Rt.useState(new Set(["__grand_total__"])),[po,Et]=Rt.useState(new Set),Ne=l?.rowFields??I,we=l?.columnFields??A,yt=l?.filterFields??D,_e=l?.valueFields??j,Ft=l?.filterSelections??q,mo=l?.showGrandTotal??le,go=l?.isConfiguratorCollapsed??U,Xt=l?.chartDimensionFieldId??Me,xt=l?.chartPrimaryValueFieldId??ie,fo=l?.chartSecondaryValueFieldId??Be,ho=l?.chartType??Ze,bo=l?.isChartCollapsed??qe,Uo=l?.isTableCollapsed??Z,mt=g??Ae,to=s||mt.length>0||!!m,vt=Rt.useCallback(x=>{if(l?.setRowFields){l.setRowFields(x);return}w(x);},[l]),z=Rt.useCallback(x=>{if(l?.setColumnFields){l.setColumnFields(x);return}M(x);},[l]),V=Rt.useCallback(x=>{if(l?.setFilterFields){l.setFilterFields(x);return}B(x);},[l]),O=Rt.useCallback(x=>{if(l?.setValueFields){l.setValueFields(x);return}W(x);},[l]),ne=Rt.useCallback(x=>{if(l?.setFilterSelections){l.setFilterSelections(x);return}ee(x);},[l]),ce=Rt.useCallback(x=>{if(l?.setShowGrandTotal){l.setShowGrandTotal(x);return}_(x);},[l]),Se=Rt.useCallback(x=>{if(l?.setIsConfiguratorCollapsed){l.setIsConfiguratorCollapsed(x);return}ge(x);},[l]),T=Rt.useCallback(x=>{if(l?.setChartDimensionFieldId){l.setChartDimensionFieldId(x);return}Ee(x);},[l]),N=Rt.useCallback(x=>{if(l?.setChartPrimaryValueFieldId){l.setChartPrimaryValueFieldId(x);return}Re(x);},[l]),K=Rt.useCallback(x=>{if(l?.setChartSecondaryValueFieldId){l.setChartSecondaryValueFieldId(x);return}lt(x);},[l]),J=Rt.useCallback(x=>{if(l?.setChartType){l.setChartType(x);return}Oe(x);},[l]),pe=Rt.useCallback(x=>{if(l?.setIsChartCollapsed){l.setIsChartCollapsed(x);return}ot(x);},[l]),be=Rt.useCallback(x=>{if(l?.setIsTableCollapsed){l.setIsTableCollapsed(x);return}se(x);},[l]),xe=Rt.useCallback(x=>{let F=typeof x=="function"?x(mt):x;g||He(F),m?.(F);},[m,mt,g]),fe=Rt.useMemo(()=>new Set([...Ne,...we,...yt]),[Ne,we,yt]),ze=Rt.useMemo(()=>o.filter(x=>!fe.has(x.id)),[o,fe]),We=Rt.useMemo(()=>{let x=[...Ne,...we,...yt],F=new Set,L=[];return x.forEach(Y=>{F.has(Y)||(F.add(Y),L.push(Y));}),L},[we,yt,Ne]);Rt.useEffect(()=>{vt(x=>{let F=x.filter(L=>k.has(L));return Dr(x,F)?x:F}),z(x=>{let F=x.filter(L=>k.has(L));return Dr(x,F)?x:F}),V(x=>{let F=x.filter(L=>k.has(L));return Dr(x,F)?x:F}),O(x=>{let F=x.filter(L=>k.has(L.fieldId)).map(L=>({...L,aggregation:lo(L.aggregation,R.get(L.fieldId))}));return Hl(x,F)?x:F});},[R,k]);let st=Rt.useMemo(()=>{let x={};return We.forEach(F=>{let L=new Set;t.forEach(Y=>{L.add(Rr(Y[F]));}),x[F]=Array.from(L).sort((Y,ue)=>Y.localeCompare(ue));}),x},[We,t]);Rt.useEffect(()=>{ne(x=>{let F={};return We.forEach(L=>{let Y=st[L]??[],De=(x[L]??[]).filter(ae=>Y.includes(ae)),H=Object.prototype.hasOwnProperty.call(x,L);F[L]=H?De:Y;}),hm(x,F)?x:F});},[We,st]),Rt.useEffect(()=>{T(x=>ed(Ne,we,x));},[we,Ne,T]),Rt.useEffect(()=>{N(x=>es(_e,x));},[N,_e]),Rt.useEffect(()=>{K(x=>td(_e,xt,x));},[xt,K,_e]);let Ke=Rt.useMemo(()=>t.filter(x=>We.every(F=>{let L=Ft[F]??[],Y=st[F]??[];if(L.length===Y.length)return true;if(L.length===0)return false;let ue=Rr(x[F]);return L.includes(ue)})),[We,st,Ft,t]),Ve=Rt.useMemo(()=>{if(_e.length===0)return null;let x=new Map;if(Ke.forEach(H=>{let ae=we.length>0?we.map(at=>Rr(H[at])):[u("pivot.valueLabel")],re=Ra(ae);x.set(re,ae);}),x.size===0){let H=we.length>0?we.map(()=>Vl):[u("pivot.valueLabel")];x.set(Ra(H),H);}let F=Array.from(x.entries()).sort((H,ae)=>fm(H[1],ae[1])),L=F.flatMap(([H,ae])=>_e.map(re=>{let at=R.get(re.fieldId),$=`${P(re.aggregation)} ${at?.label??re.fieldId}`,de=we.length===0||_e.length>1?`${ae.join(" / ")} \u2022 ${$}`:ae.join(" / ");return {id:`${H}::${re.tokenId}`,colKey:H,valueItem:re,label:de}})),Y=[];we.length>0&&F.forEach(([H,ae])=>{let re=L.filter(de=>de.colKey===H),at=Y,$=[];ae.forEach((de,Q)=>{$.push(`d${Q}:${de}`);let ve=`col::${Ra($)}`,Ye=at.find(nr=>nr.key===ve);Ye||(Ye={key:ve,label:de,children:[],leafColumnIds:[],path:ae.slice(0,Q+1),depth:Q},at.push(Ye)),re.forEach(nr=>{Ye.leafColumnIds.includes(nr.id)||Ye.leafColumnIds.push(nr.id);}),at=Ye.children;});});let ue=H=>{let ae={};return L.forEach(re=>{let at=H.filter($=>{let de=we.length>0?we.map(Q=>Rr($[Q])):[u("pivot.valueLabel")];return Ra(de)===re.colKey});ae[re.id]=mn(at,re.valueItem.fieldId,re.valueItem.aggregation);}),ae},De=[];if(Ne.length===0)De.push({key:"root",value:u("pivot.resultLabel")||sm,children:[],isLeaf:true,aggregatedValues:ue(Ke),path:[],depth:0});else {let H=(ae,re,at)=>{if(re>=Ne.length)return [];let $=Ne[re],de=new Map;return ae.forEach(Q=>{let ve=Rr(Q[$]);de.has(ve)||de.set(ve,[]),de.get(ve).push(Q);}),Array.from(de.keys()).sort().map(Q=>{let ve=de.get(Q),Ye=[...at,Q];return {key:Ra(Ye),value:Q,fieldId:$,aggregatedValues:ue(ve),children:H(ve,re+1,Ye),isLeaf:re===Ne.length-1,path:Ye,depth:re}})};De.push(...H(Ke,0,[]));}return {dataColumns:L,columnTree:Y,rowTree:De}},[we,R,Ke,P,Ne,u,_e]),Lt=Rt.useCallback((x,F)=>(p.current+=1,{tokenId:`v${p.current}`,fieldId:x,aggregation:lo(F,R.get(x))}),[R]),Ot=Rt.useCallback(x=>{if(x==="rows")return vt([]);if(x==="columns")return z([]);if(x==="filters")return V([]);O([]);},[]),gt=Rt.useCallback((x,F)=>{if(x==="rows")return vt(L=>L.filter(Y=>Y!==F));if(x==="columns")return z(L=>L.filter(Y=>Y!==F));if(x==="filters")return V(L=>L.filter(Y=>Y!==F));O(L=>L.filter(Y=>Y.tokenId!==F));},[]),oo=Rt.useCallback((x,F)=>{O(L=>L.map(Y=>Y.tokenId===x?{...Y,aggregation:lo(F,R.get(Y.fieldId))}:Y));},[R]),ft=Rt.useCallback(x=>{eo(String(x.active.id));},[]),ro=Rt.useCallback(x=>{if(eo(null),!x.over)return;let F=Ol(String(x.active.id)),L=Ol(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 Q=Ne.indexOf(F.key),ve=Ne.indexOf(L.key??"");Q!==-1&&ve!==-1&&Q!==ve&&vt(Ye=>sortable.arrayMove(Ye,Q,ve));return}if(F.zone==="columns"){let Q=we.indexOf(F.key),ve=we.indexOf(L.key??"");Q!==-1&&ve!==-1&&Q!==ve&&z(Ye=>sortable.arrayMove(Ye,Q,ve));return}if(F.zone==="filters"){let Q=yt.indexOf(F.key),ve=yt.indexOf(L.key??"");Q!==-1&&ve!==-1&&Q!==ve&&V(Ye=>sortable.arrayMove(Ye,Q,ve));return}if(F.zone==="values"){let Q=_e.findIndex(Ye=>Ye.tokenId===F.key),ve=_e.findIndex(Ye=>Ye.tokenId===(L.key??""));Q!==-1&&ve!==-1&&Q!==ve&&O(Ye=>sortable.arrayMove(Ye,Q,ve));}return}let Y=L.zone,ue=[...Ne],De=[...we],H=[...yt],ae=[..._e],re="",at=null;if(F.zone==="palette")re=F.key;else if(F.zone==="values"){let Q=ae.find(ve=>ve.tokenId===F.key);if(!Q)return;re=Q.fieldId,at=Q,ae=ae.filter(ve=>ve.tokenId!==F.key);}else F.zone==="rows"?(re=F.key,ue=ue.filter(Q=>Q!==re)):F.zone==="columns"?(re=F.key,De=De.filter(Q=>Q!==re)):F.zone==="filters"&&(re=F.key,H=H.filter(Q=>Q!==re));if(!re)return;let $=()=>{ue=ue.filter(Q=>Q!==re),De=De.filter(Q=>Q!==re),H=H.filter(Q=>Q!==re);},de=Q=>{if(L.kind!=="item"||!L.key)return Q==="rows"?ue.length:Q==="columns"?De.length:Q==="filters"?H.length:Q==="values"?ae.length:0;if(Q==="rows"){let ve=ue.indexOf(L.key);return ve>=0?ve:ue.length}if(Q==="columns"){let ve=De.indexOf(L.key);return ve>=0?ve:De.length}if(Q==="filters"){let ve=H.indexOf(L.key);return ve>=0?ve:H.length}if(Q==="values"){let ve=ae.findIndex(Ye=>Ye.tokenId===L.key);return ve>=0?ve:ae.length}return 0};if(Y==="palette"){vt(ue),z(De),V(H),O(ae);return}if(Y==="values"){let Q=de("values"),ve=at??Lt(re);ae.splice(Q,0,ve),vt(ue),z(De),V(H),O(ae);return}if(gm(Y)){$();let Q=de(Y);Y==="rows"?ue.splice(Q,0,re):Y==="columns"?De.splice(Q,0,re):H.splice(Q,0,re),vt(ue),z(De),V(H),O(ae);}},[we,Lt,yt,Ne,_e]),Ko=Rt.useCallback((x,F)=>{ne(L=>({...L,[x]:F}));},[]),ao=Rt.useCallback(x=>{Tt(F=>{let L=new Set(F);return L.has(x)?L.delete(x):L.add(x),L});},[]),gr=Rt.useCallback(x=>{Et(F=>{let L=new Set(F);return L.has(x)?L.delete(x):L.add(x),L});},[]),Or=Rt.useCallback(x=>{let F=R.get(x.fieldId),L=Wc(F);return jsxRuntime.jsx(material.FormControl,{size:"small",sx:{minWidth:98},children:jsxRuntime.jsx(material.Select,{value:x.aggregation,onChange:Y=>oo(x.tokenId,Y.target.value),onClick:Y=>Y.stopPropagation(),onMouseDown:Y=>Y.stopPropagation(),sx:{fontSize:"0.72rem",height:26,"& .MuiSelect-select":{py:.35}},children:L.map(Y=>jsxRuntime.jsx(material.MenuItem,{value:Y,sx:{fontSize:"0.75rem"},children:P(Y)},Y))})})},[R,P,oo]),no=Rt.useCallback(x=>{let F=st[x]??[],L=Ft[x]??F;return F.length===0?u("pivot.filter.noValues"):L.length===0?u("pivot.filter.noneSelected"):L.length===F.length?u("pivot.filter.allValues"):u("pivot.filter.selectedCount",{selected:L.length,total:F.length})},[st,Ft,u]),qo=Rt.useCallback(x=>{let F=st[x]??[],L=Ft[x]??F;return jsxRuntime.jsx(xm,{options:F,selectedValues:L,onChange:Y=>Ko(x,Y)})},[st,Ft,Ko]),fr=Rt.useCallback(()=>`pivot-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,[]),zo=Rt.useCallback(()=>{let x={};return new Set([...We,...Object.keys(Ft)]).forEach(L=>{if(!k.has(L))return;let Y=Ft[L]??[];x[L]=[...Y];}),{layout:{rows:[...Ne],columns:[...we],filters:[...yt],values:_e.map(L=>({fieldId:L.fieldId,aggregation:L.aggregation}))},filterSelections:x,showGrandTotal:mo,chart:{dimensionFieldId:Xt,primaryValueFieldId:xt,secondaryValueFieldId:fo,chartType:ho}}},[We,Xt,xt,fo,ho,we,yt,Ft,Ne,mo,k,_e]),ar=Rt.useCallback(x=>{let F=Nt(x.layout.rows,k),L=Nt(x.layout.columns,k),Y=Nt(x.layout.filters,k),ue=new Set,De=(x.layout.values??[]).filter(re=>!k.has(re.fieldId)||ue.has(re.fieldId)?false:(ue.add(re.fieldId),true)).map(re=>Lt(re.fieldId,re.aggregation)),H={};Object.entries(x.filterSelections??{}).forEach(([re,at])=>{!k.has(re)||!Array.isArray(at)||(H[re]=Array.from(new Set(at.map($=>String($)))));}),vt(F),z(L),V(Y),O(De),ne(H),typeof x.showGrandTotal=="boolean"&&ce(x.showGrandTotal),T(ed(F,L,x.chart?.dimensionFieldId));let ae=es(De,x.chart?.primaryValueFieldId);N(ae),K(td(De,ae,x.chart?.secondaryValueFieldId)),J(x.chart?.chartType??"bar-vertical"),X(x.id),C?.(x);},[Lt,C,T,N,K,J,z,V,ne,vt,ce,O,k]),sa=Rt.useCallback(x=>{if(!x){X("");return}let F=mt.find(L=>L.id===x);if(!F){X("");return}ar(F);},[ar,mt]),Oa=Rt.useCallback(()=>{let x=u("pivot.preset.defaultName",{index:mt.length+1});rt(x),ke(true);},[mt.length,u]),Hr=Rt.useCallback(()=>{let x=Fe.trim();if(!x)return;let F={id:fr(),name:x,...zo()};xe(L=>[...L,F]),X(F.id),ke(false);},[zo,fr,Fe,xe]),ca=Rt.useCallback(()=>{G&&(xe(x=>x.filter(F=>F.id!==G)),X(""));},[G,xe]);Rt.useEffect(()=>{if(!b||h.current)return;let x=mt.find(F=>F.id===b);x&&(h.current=true,ar(x));},[ar,b,mt]),Rt.useEffect(()=>{G&&(mt.some(x=>x.id===G)||X(""));},[G,mt]);let hr=Rt.useMemo(()=>{if(!mo||!Ve||!Ne.length)return null;let x={};return Ve.dataColumns.forEach(F=>{let L=Ke.filter(Y=>{let ue=we.length>0?we.map(De=>Rr(Y[De])):[u("pivot.valueLabel")];return Ra(ue)===F.colKey});x[F.id]=mn(L,F.valueItem.fieldId,F.valueItem.aggregation);}),{key:"__grand_total__",value:u("pivot.grandTotal")||cm,children:[],isLeaf:false,isGrandTotal:true,aggregatedValues:x,path:[],depth:-1}},[mo,Ve,Ke,we,Ne.length,u]),yo=Rt.useMemo(()=>$m(Ve?.rowTree??[]),[Ve]),_o=Rt.useMemo(()=>$m(Ve?.columnTree??[]),[Ve]);Rt.useEffect(()=>{Tt(x=>{let F=new Set;return x.has("__grand_total__")&&F.add("__grand_total__"),yo.forEach(L=>{x.has(L)&&F.add(L);}),F});},[yo]),Rt.useEffect(()=>{Et(x=>{let F=new Set;return _o.forEach(L=>{x.has(L)&&F.add(L);}),F});},[_o]);let Ha=Rt.useCallback(()=>{Tt(x=>{let F=new Set(x);return yo.forEach(L=>F.add(L)),F});},[yo]),da=Rt.useCallback(()=>{Tt(x=>{let F=new Set;return x.has("__grand_total__")&&F.add("__grand_total__"),F});},[]),Wa=Rt.useCallback(()=>{Et(new Set(_o));},[_o]),$a=Rt.useCallback(()=>{Et(new Set);},[]),Ga=Rt.useMemo(()=>!Ve||we.length===0?[]:hk(Ve.columnTree,po),[we.length,po,Ve]),wo=Rt.useMemo(()=>{if(!Ve)return [];if(we.length===0)return Ve.dataColumns.map(F=>({id:F.id,label:F.label,leafColumnIds:[F.id],valueItem:F.valueItem}));let x=new Map(Ve.dataColumns.map(F=>[F.id,F]));return Ga.flatMap(F=>{let L=new Map;return F.leafColumnIds.forEach(Y=>{let ue=x.get(Y);if(!ue)return;let De=ue.valueItem.tokenId,H=`${P(ue.valueItem.aggregation)} ${R.get(ue.valueItem.fieldId)?.label??ue.valueItem.fieldId}`,ae=L.get(De);if(ae){ae.leafColumnIds.push(Y);return}L.set(De,{id:`${F.key}::${De}`,label:_e.length>1?H:F.label,leafColumnIds:[Y],valueItem:ue.valueItem});}),Array.from(L.values())})},[we.length,R,P,Ve,_e.length,Ga]),Ua=Rt.useMemo(()=>new Map(wo.map(x=>[x.id,x])),[wo]),Ka=Rt.useMemo(()=>wo.map(x=>({id:x.id,colKey:x.id,valueItem:x.valueItem,label:x.label})),[wo]),ua=Rt.useMemo(()=>{if(!Ve||we.length===0)return [];let x=[],F=Um(Ve.columnTree,po),L=F+(_e.length>1?1:0),Y=(ue,De)=>{x[De]??(x[De]=[]),ue.forEach(H=>{let ae=H.children.length>0&&po.has(H.key),re=wo.filter($=>H.leafColumnIds.some(de=>$.leafColumnIds.includes(de))).length,at=ae||_e.length>1?1:L-De;x[De].push({key:H.key,label:H.label,colSpan:re,rowSpan:at,expandable:H.children.length>0,expanded:ae}),ae&&Y(H.children,De+1);});};return Y(Ve.columnTree,0),_e.length>1&&(x[F]=wo.map(ue=>({key:ue.id,label:ue.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))),x},[we.length,po,Ve,_e.length,wo]),br=Rt.useCallback((x,F)=>F.leafColumnIds.reduce((L,Y)=>L+(x.aggregatedValues[Y]??0),0),[]),Wr=Rt.useMemo(()=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.Button,{size:"small",variant:"text",onClick:Ha,disabled:yo.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:u("pivot.table.expandRowsAll")}),jsxRuntime.jsx(material.Button,{size:"small",variant:"text",onClick:da,disabled:yo.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:u("pivot.table.collapseRowsAll")}),jsxRuntime.jsx(material.Divider,{orientation:"vertical",flexItem:true}),jsxRuntime.jsx(material.Button,{size:"small",variant:"text",onClick:Wa,disabled:_o.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:u("pivot.table.expandColumnsAll")}),jsxRuntime.jsx(material.Button,{size:"small",variant:"text",onClick:$a,disabled:we.length===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:u("pivot.table.collapseColumnsAll")})]}),[we.length,_o.size,yo.size,$a,da,Wa,Ha,u]),$r=()=>{if(!Xe)return null;let x=Ol(Xe);if(!x||x.kind!=="item"||!x.key)return null;if(x.zone==="palette"){let ue=R.get(x.key);return ue?jsxRuntime.jsx(Gc,{label:ue.label,subtitle:ue.type}):null}if(x.zone==="values"){let ue=_e.find(re=>re.tokenId===x.key);if(!ue)return null;let H=R.get(ue.fieldId)?.label??ue.fieldId,ae=`${P(ue.aggregation)}(${H})`;return jsxRuntime.jsx(Kl,{label:H,caption:ae})}let L=R.get(x.key)?.label??x.key,Y=no(x.key);return jsxRuntime.jsx(Kl,{label:L,caption:Y})};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:y}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.78rem",color:"text.secondary"},children:u("pivot.subtitle.default")})]}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1.5,alignItems:"center",children:[to&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.FormControl,{size:"small",sx:{minWidth:200},children:jsxRuntime.jsxs(material.Select,{value:G,displayEmpty:true,onChange:x=>sa(String(x.target.value)),sx:{fontSize:"0.75rem",height:32},children:[jsxRuntime.jsx(material.MenuItem,{value:"",sx:{fontSize:"0.75rem",color:"text.secondary"},children:u("pivot.preset.selectPlaceholder")}),mt.map(x=>jsxRuntime.jsx(material.MenuItem,{value:x.id,sx:{fontSize:"0.75rem"},children:x.name},x.id))]})}),jsxRuntime.jsx(material.Tooltip,{title:u("pivot.preset.save"),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:Oa,"aria-label":u("pivot.preset.save"),children:jsxRuntime.jsx(gp__default.default,{sx:{fontSize:18}})})}),jsxRuntime.jsx(material.Tooltip,{title:u("pivot.preset.delete"),children:jsxRuntime.jsx("span",{children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:ca,disabled:!G,"aria-label":u("pivot.preset.delete"),children:jsxRuntime.jsx(Nb__default.default,{sx:{fontSize:18}})})})}),jsxRuntime.jsx(material.Divider,{flexItem:true,orientation:"vertical"})]}),jsxRuntime.jsxs(material.Typography,{sx:{fontSize:"0.74rem",color:"text.secondary"},children:[u("pivot.records"),": ",jsxRuntime.jsx("strong",{children:t.length.toLocaleString()})," / ",u("pivot.afterFilter"),":"," ",jsxRuntime.jsx("strong",{children:Ke.length.toLocaleString()})]}),jsxRuntime.jsx(material.Divider,{flexItem:true,orientation:"vertical"}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:.6},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.74rem"},children:u("pivot.grandTotal")}),jsxRuntime.jsx(material.Switch,{size:"small",checked:mo,onChange:x=>ce(x.target.checked)})]})]})]}),jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsxs(core.DndContext,{sensors:v,collisionDetection:core.closestCenter,onDragStart:ft,onDragEnd:ro,children:[jsxRuntime.jsx(Pm,{isConfiguratorCollapsed:go,onToggleCollapse:()=>Se(x=>!x),availableFields:ze,fieldMap:R,filterFields:yt,columnFields:we,rowFields:Ne,valueFields:_e,clearZone:Ot,removeFieldFromZone:gt,getFilterSelectionSummary:no,renderDimensionFilterSelect:qo,renderAggregationSelect:Or,getAggregationLabel:P}),jsxRuntime.jsx(material.Portal,{children:jsxRuntime.jsx(core.DragOverlay,{dropAnimation:{duration:250,easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)"},children:$r()})})]}),jsxRuntime.jsx(Lm,{rows:Ke,fieldMap:R,rowFields:Ne,columnFields:we,valueFields:_e,chartDimensionFieldId:Xt,chartPrimaryValueFieldId:xt,chartSecondaryValueFieldId:fo,chartType:ho,isCollapsed:bo,onChartDimensionFieldIdChange:x=>T(x),onChartPrimaryValueFieldIdChange:x=>N(x),onChartSecondaryValueFieldIdChange:x=>K(x),onChartTypeChange:x=>J(x),onToggleCollapse:()=>pe(x=>!x),getAggregationLabel:P}),jsxRuntime.jsx(yn,{title:u("pivot.table.sectionTitle"),subtitle:Ne.length>0?Ne.map(x=>R.get(x)?.label??x).join(" > "):u("pivot.table.dimensions"),collapsed:Uo,onToggleCollapse:()=>be(x=>!x),expandAriaLabel:u("pivot.table.collapse.ariaExpand"),collapseAriaLabel:u("pivot.table.collapse.ariaCollapse"),bodySx:{p:0},headerActions:Wr,children:Ve===null?jsxRuntime.jsx(material.Box,{sx:{py:5,px:{xs:1.2,md:1.6},textAlign:"center"},children:jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.86rem",color:"text.secondary"},children:S})}):jsxRuntime.jsx(material.TableContainer,{sx:{maxHeight:i},children:jsxRuntime.jsxs(material.Table,{size:"small",stickyHeader:true,children:[jsxRuntime.jsx(material.TableHead,{children:(ua.length>0?ua:[[]]).map((x,F)=>jsxRuntime.jsxs(material.TableRow,{children:[F===0&&jsxRuntime.jsx(material.TableCell,{rowSpan:Math.max(ua.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:Ne.length>0?Ne.map(L=>R.get(L)?.label).join(" > "):u("pivot.table.dimensions")}),(x.length>0?x:wo.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:Y=>({fontWeight:800,fontSize:"0.75rem",color:"text.primary",bgcolor:Y.palette.mode==="dark"?"#000000":"#f5f5f5",borderBottom:`1px solid ${Y.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:()=>gr(L.key),sx:{p:.1,ml:-0.3},children:L.expanded?jsxRuntime.jsx(xb__default.default,{sx:{fontSize:16}}):jsxRuntime.jsx(yf__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:[Ve.rowTree.map(x=>jsxRuntime.jsx(Yl,{node:x,dataColumns:Ka,fieldMap:R,level:0,expandedKeys:Zt,onToggle:ao,getValue:(F,L)=>{let Y=Ua.get(L);return Y?br(F,Y):0}},x.key)),hr&&jsxRuntime.jsx(Yl,{node:hr,dataColumns:Ka,fieldMap:R,level:0,expandedKeys:Zt,onToggle:ao,getValue:(x,F)=>{let L=Ua.get(F);return L?br(x,L):0}})]})]})})}),jsxRuntime.jsxs(material.Dialog,{open:Ie,onClose:()=>ke(false),maxWidth:"xs",fullWidth:true,children:[jsxRuntime.jsx(material.DialogTitle,{children:u("pivot.preset.saveDialogTitle")}),jsxRuntime.jsx(material.DialogContent,{children:jsxRuntime.jsx(material.TextField,{autoFocus:true,fullWidth:true,margin:"dense",label:u("pivot.preset.nameLabel"),value:Fe,onChange:x=>rt(x.target.value),onKeyDown:x=>{x.key==="Enter"&&(x.preventDefault(),Hr());}})}),jsxRuntime.jsxs(material.DialogActions,{children:[jsxRuntime.jsx(material.Button,{onClick:()=>ke(false),children:u("common.cancel")}),jsxRuntime.jsx(material.Button,{variant:"contained",onClick:Hr,disabled:!Fe.trim(),children:u("common.save")})]})]})]})};var Km=(e,t,o)=>{let r=[...e,...t];return o&&r.includes(o)?o:r[0]??""},rd=(e,t)=>t&&e.some(o=>o.fieldId===t)?t:e[0]?.fieldId??"",qm=(e,t,o)=>o===""?"":o&&o!==t&&e.some(r=>r.fieldId===o)?o:e.find(r=>r.fieldId!==t)?.fieldId??"",vF=({fields:e,initialLayout:t,initialFilterSelections:o={},initialShowGrandTotal:r=true,initialConfiguratorCollapsed:a=false,initialChart:n,initialChartCollapsed:i=false,initialTableCollapsed:c=false})=>{let d=Rt.useRef(0),l=Rt.useMemo(()=>new Set(e.map(X=>X.id)),[e]),s=Rt.useMemo(()=>new Map(e.map(X=>[X.id,X])),[e]),[g,f]=Rt.useState(()=>Nt(t?.rows,l)),[m,b]=Rt.useState(()=>Nt(t?.columns,l)),[C,u]=Rt.useState(()=>Nt(t?.filters,l)),[v,p]=Rt.useState(()=>{let X=t?.values??[],Ie=new Set,ke=[];return X.forEach(Fe=>{!l.has(Fe.fieldId)||Ie.has(Fe.fieldId)||(Ie.add(Fe.fieldId),d.current+=1,ke.push({tokenId:`v${d.current}`,fieldId:Fe.fieldId,aggregation:lo(Fe.aggregation,s.get(Fe.fieldId))}));}),ke}),[h,y]=Rt.useState(o),[S,E]=Rt.useState(r),[P,k]=Rt.useState(a),[R,I]=Rt.useState(()=>Km(Nt(t?.rows,l),Nt(t?.columns,l),n?.dimensionFieldId)),[w,A]=Rt.useState(()=>{let X=(()=>{let Ie=t?.values??[],ke=new Set,Fe=[];return Ie.forEach(rt=>{!l.has(rt.fieldId)||ke.has(rt.fieldId)||(ke.add(rt.fieldId),Fe.push({tokenId:rt.fieldId,fieldId:rt.fieldId,aggregation:lo(rt.aggregation,s.get(rt.fieldId))}));}),Fe})();return rd(X,n?.primaryValueFieldId)}),[M,D]=Rt.useState(()=>{let X=(()=>{let ke=t?.values??[],Fe=new Set,rt=[];return ke.forEach(Xe=>{!l.has(Xe.fieldId)||Fe.has(Xe.fieldId)||(Fe.add(Xe.fieldId),rt.push({tokenId:Xe.fieldId,fieldId:Xe.fieldId,aggregation:lo(Xe.aggregation,s.get(Xe.fieldId))}));}),rt})(),Ie=rd(X,n?.primaryValueFieldId);return qm(X,Ie,n?.secondaryValueFieldId)}),[B,j]=Rt.useState(n?.chartType??"bar-vertical"),[W,q]=Rt.useState(i),[ee,le]=Rt.useState(c);Rt.useEffect(()=>{f(X=>{let Ie=X.filter(ke=>l.has(ke));return Dr(X,Ie)?X:Ie}),b(X=>{let Ie=X.filter(ke=>l.has(ke));return Dr(X,Ie)?X:Ie}),u(X=>{let Ie=X.filter(ke=>l.has(ke));return Dr(X,Ie)?X:Ie}),p(X=>{let Ie=X.filter(ke=>l.has(ke.fieldId)).map(ke=>({...ke,aggregation:lo(ke.aggregation,s.get(ke.fieldId))}));return Hl(X,Ie)?X:Ie});},[s,l]),Rt.useEffect(()=>{I(X=>Km(g,m,X));},[m,g]),Rt.useEffect(()=>{A(X=>rd(v,X));},[v]),Rt.useEffect(()=>{D(X=>qm(v,w,X));},[w,v]);let _=Rt.useCallback(X=>{f(Nt(X,l));},[l]),U=Rt.useCallback(X=>{b(Nt(X,l));},[l]),ge=Rt.useCallback(X=>{u(Nt(X,l));},[l]),Me=Rt.useCallback(X=>{p(Ie=>{let ke=X??[],Fe=new Set,rt=[];return ke.forEach(Xe=>{if(!l.has(Xe.fieldId)||Fe.has(Xe.fieldId))return;Fe.add(Xe.fieldId);let eo=Ie.find(Zt=>Zt.fieldId===Xe.fieldId);if(eo){rt.push({...eo,aggregation:lo(Xe.aggregation??eo.aggregation,s.get(Xe.fieldId))});return}d.current+=1,rt.push({tokenId:`v${d.current}`,fieldId:Xe.fieldId,aggregation:lo(Xe.aggregation,s.get(Xe.fieldId))});}),rt});},[s,l]),Ee=Rt.useCallback(X=>{_(X.rows??[]),U(X.columns??[]),ge(X.filters??[]),Me(X.values??[]);},[U,ge,_,Me]),ie=Rt.useCallback(X=>{if(X==="rows")return f([]);if(X==="columns")return b([]);if(X==="filters")return u([]);p([]);},[]),Re=Rt.useCallback((X,Ie)=>{if(X==="rows")return f(ke=>ke.filter(Fe=>Fe!==Ie));if(X==="columns")return b(ke=>ke.filter(Fe=>Fe!==Ie));if(X==="filters")return u(ke=>ke.filter(Fe=>Fe!==Ie));p(ke=>ke.filter(Fe=>Fe.tokenId!==Ie));},[]),Be=Rt.useCallback((X,Ie)=>{p(ke=>ke.map(Fe=>Fe.tokenId===X?{...Fe,aggregation:lo(Ie,s.get(Fe.fieldId))}:Fe));},[s]),lt=Rt.useCallback((X,Ie)=>{y(ke=>({...ke,[X]:Ie}));},[]),Ze=Rt.useCallback(()=>{y({});},[]),Oe=Rt.useCallback(()=>{E(X=>!X);},[]),qe=Rt.useCallback(()=>{k(X=>!X);},[]),ot=Rt.useCallback(X=>{I(X);},[]),Z=Rt.useCallback(X=>{A(X);},[]),se=Rt.useCallback(X=>{D(X);},[]),Ae=Rt.useCallback(()=>{q(X=>!X);},[]),He=Rt.useCallback(()=>{le(X=>!X);},[]);return {model:Rt.useMemo(()=>({rowFields:g,setRowFields:f,columnFields:m,setColumnFields:b,filterFields:C,setFilterFields:u,valueFields:v,setValueFields:p,filterSelections:h,setFilterSelections:y,showGrandTotal:S,setShowGrandTotal:E,isConfiguratorCollapsed:P,setIsConfiguratorCollapsed:k,chartDimensionFieldId:R,setChartDimensionFieldId:I,chartPrimaryValueFieldId:w,setChartPrimaryValueFieldId:A,chartSecondaryValueFieldId:M,setChartSecondaryValueFieldId:D,chartType:B,setChartType:j,isChartCollapsed:W,setIsChartCollapsed:q,isTableCollapsed:ee,setIsTableCollapsed:le}),[R,w,M,B,m,C,h,W,P,ee,g,S,v]),actions:{setRows:_,setColumns:U,setFilters:ge,setValues:Me,setLayout:Ee,clearZone:ie,removeFieldFromZone:Re,setAggregationForValue:Be,setFilterSelection:lt,resetFilterSelections:Ze,toggleGrandTotal:Oe,toggleConfigurator:qe,setChartDimension:ot,setChartPrimaryValue:Z,setChartSecondaryValue:se,setChartType:j,toggleChart:Ae,toggleTable:He}}};var TF=({orientation:e="auto",defaultNavigationOpen:t,onNavOpenChange:o}={})=>{let r=styles.useTheme(),a=material.useMediaQuery("(orientation: portrait)",{noSsr:true}),n=material.useMediaQuery(r.breakpoints.down("md"),{noSsr:true}),i=Rt.useMemo(()=>e==="auto"?a||n?"portrait":"landscape":e,[n,a,e]),[c,d]=Rt.useState(t??i==="landscape");Rt.useEffect(()=>{d(t??i==="landscape");},[t,i]);let l=g=>{d(g),o?.(g);};return {resolvedOrientation:i,isPortraitViewport:a,isCompactViewport:n,navigationOpen:c,setNavigationOpen:l,toggleNavigationOpen:()=>l(!c)}};var Sk=e=>{let t=Number(e||0);return Number.isFinite(t)?t:0},RF=({rows:e,rowKey:t="id",numericField:o,defaultSelectedId:r})=>{let n=e[0]?.[t],[i,c]=Rt.useState(r??n),d=Rt.useMemo(()=>e.find(m=>m[t]===i)||e[0],[t,e,i]),[l,s]=Rt.useState(()=>{let m=d?.[o];return m==null?"0":String(m)});return {selectedId:i,selectedRecord:d,editorValue:l,setEditorValue:s,selectRecord:m=>{let b=m[t];c(b);let C=m[o];s(C==null?"0":String(C));},applyEditorValue:m=>{if(i===void 0)return;let b=Sk(l),C=e.map(u=>u[t]===i?{...u,[o]:b}:u);m(C);}}};var Fk=["code_128","ean_13","ean_8","qr_code","upc_a","upc_e"],Qm=(e,t,o,r)=>{t?.(e),r&&o?.();},FF=({open:e,onClose:t,title:o="Scan barcode",subtitle:r="Use the rear camera on the device. If scanning is unavailable, enter the code manually.",formats:a=Fk,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:m,sx:b})=>{let C=Rt__namespace.default.useRef(null),u=Rt__namespace.default.useRef(null),v=Rt__namespace.default.useRef(null),p=Rt__namespace.default.useRef(null),[h,y]=Rt__namespace.default.useState("idle"),[S,E]=Rt__namespace.default.useState(""),[P,k]=Rt__namespace.default.useState(null),[R,I]=Rt__namespace.default.useState(null),w=Rt__namespace.default.useCallback(()=>{v.current!==null&&(window.clearInterval(v.current),v.current=null),u.current&&(u.current.getTracks().forEach(D=>D.stop()),u.current=null),C.current&&(C.current.srcObject=null);},[]),A=Rt__namespace.default.useCallback(D=>{I(D),y("error"),m?.(D);},[m]);Rt__namespace.default.useEffect(()=>{if(!e){w(),y("idle"),I(null),E("");return}let D=false;return (async()=>{if(!(typeof window>"u"||typeof navigator>"u")){if(!navigator.mediaDevices?.getUserMedia){y("unsupported"),I("Camera access is not supported in this browser.");return}y("starting"),I(null);try{let j=await navigator.mediaDevices.getUserMedia({audio:!1,video:{facingMode:{ideal:n}}});if(D){j.getTracks().forEach(W=>W.stop());return}if(u.current=j,C.current&&(C.current.srcObject=j,await C.current.play()),!window.BarcodeDetector){y("unsupported"),I("BarcodeDetector is not available. Camera preview is ready and manual entry is enabled.");return}p.current=new window.BarcodeDetector({formats:a}),y("ready"),v.current=window.setInterval(async()=>{if(!(!C.current||!p.current)&&!(C.current.readyState<HTMLMediaElement.HAVE_CURRENT_DATA))try{let q=(await p.current.detect(C.current)).find(le=>le.rawValue);if(!q?.rawValue)return;let ee={rawValue:q.rawValue,format:q.format};k(ee),w(),Qm(ee,f,t,c);}catch(W){A(W instanceof Error?W.message:"Failed to detect barcode.");}},d);}catch(j){A(j instanceof Error?j.message:"Unable to start camera.");}}})(),()=>{D=true,w();}},[c,n,a,t,f,e,A,d,w]);let M=()=>{let D=S.trim();if(!D)return;let B={rawValue:D,format:"manual"};k(B),Qm(B,f,t,c);};return jsxRuntime.jsxs(material.Dialog,{open:e,onClose:t,fullWidth:true,maxWidth:"sm",children:[jsxRuntime.jsx(material.DialogTitle,{sx:{fontSize:"1rem",fontWeight:900},children:o}),jsxRuntime.jsx(material.DialogContent,{sx:{pt:"8px !important"},children:jsxRuntime.jsxs(material.Stack,{spacing:2,sx:b,children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.88rem",color:"text.secondary",lineHeight:1.55},children:r}),jsxRuntime.jsxs(material.Paper,{elevation:0,sx:D=>({position:"relative",overflow:"hidden",borderRadius:4,border:"1px solid",borderColor:"divider",minHeight:280,background:D.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:C,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(Bk__default.default,{}),label:h==="ready"?"Camera ready":h==="starting"?"Starting camera":h==="unsupported"?"Preview only":h==="error"?"Scanner error":"Idle",size:"small",color:h==="error"?"error":"primary",variant:"filled"}),P?jsxRuntime.jsx(material.Chip,{icon:jsxRuntime.jsx(Ek__default.default,{}),label:`${P.format||"barcode"}: ${P.rawValue}`,size:"small",color:"success",variant:"filled"}):null]})]}),R?jsxRuntime.jsx(material.Alert,{severity:h==="unsupported"?"info":"warning",children:R}):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:S,onChange:D=>E(D.target.value)}),jsxRuntime.jsx(material.Button,{variant:"contained",onClick:M,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 Vk={default:"#475569",primary:"#1d4ed8",success:"#047857",warning:"#b45309",error:"#b91c1c",info:"#0369a1"},HF=({title:e,description:t,kicker:o,icon:r,badges:a=[],metrics:n=[],footer:i,children:c,selected:d=false,draggable:l=false,isDragging:s=false,swipeThreshold:g=88,startAction:f,endAction:m,dragHandleProps:b,onClick:C,onSwipe:u,sx:v})=>{let[p,h]=Rt.useState(0),[y,S]=Rt.useState(false),E=Rt.useRef(null),P=Rt.useRef(0),k=Rt.useRef(0),R=!!(f||m),I=132,w=()=>{h(0),S(false),E.current=null,P.current=0,k.current=0;},A=W=>{(W==="start"?f:m)?.onTrigger?.(),u?.(W),w();},M=W=>{!R||W.target.closest('button, a, input, textarea, [data-no-swipe="true"]')||(E.current=W.pointerId,P.current=W.clientX,k.current=W.clientX,S(true),W.currentTarget.setPointerCapture(W.pointerId));},D=W=>{if(!y||E.current!==W.pointerId)return;k.current=W.clientX;let q=k.current-P.current,ee=Math.max(-I,Math.min(I,q));h(ee);},B=W=>{if(!y||E.current!==W.pointerId)return;let q=k.current-P.current;if(q>=g&&f){A("start");return}if(q<=-g&&m){A("end");return}Math.abs(q)<12&&C?.(),w();},j=(W,q)=>{if(!W)return null;let ee=W.backgroundColor||Vk[W.tone||"default"];return jsxRuntime.jsx(material.Box,{sx:{position:"absolute",top:0,bottom:0,[q]:0,width:I,px:2,display:"flex",alignItems:"center",justifyContent:q==="left"?"flex-start":"flex-end",color:"#fff",background:`linear-gradient(135deg, ${ee}, rgba(15,23,42,0.92))`},children:jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,alignItems:"center",children:[W.icon,jsxRuntime.jsx(material.Typography,{sx:{fontWeight:700,fontSize:"0.95rem"},children:W.label})]})})};return jsxRuntime.jsxs(material.Box,{sx:{position:"relative",overflow:"hidden",borderRadius:4,...v},children:[j(f,"left"),j(m,"right"),jsxRuntime.jsx(material.Paper,{elevation:0,onPointerDown:M,onPointerMove:D,onPointerUp:B,onPointerCancel:w,sx:W=>({position:"relative",zIndex:1,p:2,borderRadius:4,border:"1px solid",borderColor:d?"primary.main":"divider",background:W.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(${p}px, 0, 0) scale(${s?.985:1})`,transition:y?"none":"transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease",touchAction:"pan-y",cursor:C?"pointer":"default",opacity:s?.9:1}),children:jsxRuntime.jsxs(material.Stack,{spacing:1.5,children:[jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1.5,alignItems:"flex-start",children:[r?jsxRuntime.jsx(material.Box,{sx:{mt:.25},children:r}):null,jsxRuntime.jsxs(material.Box,{sx:{flex:1,minWidth:0},children:[o?jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",fontWeight:700,letterSpacing:"0.08em",color:"text.secondary"},children:o}):null,jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1.05rem",fontWeight:800,lineHeight:1.25},children:e}),t?jsxRuntime.jsx(material.Typography,{sx:{mt:.5,fontSize:"0.9rem",color:"text.secondary",lineHeight:1.45},children:t}):null]}),l?jsxRuntime.jsx(material.Box,{"data-no-swipe":"true",...b,sx:{alignSelf:"center",display:"inline-flex",touchAction:"none"},children:jsxRuntime.jsx(material.IconButton,{size:"small",children:jsxRuntime.jsx(Nk__default.default,{})})}):null]}),a.length>0?jsxRuntime.jsx(material.Stack,{direction:"row",spacing:1,useFlexGap:true,flexWrap:"wrap",children:a.map((W,q)=>jsxRuntime.jsx(material.Chip,{label:W,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(W=>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:W.label}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1rem",fontWeight:800,lineHeight:1.2},children:W.value})]},W.id))}):null,c,i]})})]})};var Ti=({label:e,onPress:t,emphasis:o="default"})=>jsxRuntime.jsx(material.Box,{component:"button",type:"button",onClick:t,sx:r=>({minHeight:72,borderRadius:3,border:"1px solid",borderColor:o==="primary"?"primary.main":"divider",background:o==="primary"?r.palette.primary.main:o==="danger"?r.palette.mode==="dark"?"rgba(239,68,68,0.18)":"rgba(239,68,68,0.10)":r.palette.mode==="dark"?"rgba(255,255,255,0.04)":"#fff",color:o==="primary"?"#fff":"text.primary",fontSize:"1.25rem",fontWeight:800,transition:"transform 120ms ease, box-shadow 160ms ease, background-color 160ms ease",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent","&:active":{transform:"scale(0.98)"}}),children:e}),ZF=({value:e,defaultValue:t="",title:o,subtitle:r,placeholder:a="0",allowDecimal:n=false,allowNegative:i=false,maxLength:c,confirmLabel:d,clearLabel:l,backspaceLabel:s,onChange:g,onSubmit:f,onClose:m,sx:b})=>{let{t:C}=te(),[u,v]=Rt.useState(t),p=e??u,h=w=>{e===void 0&&v(w),g?.(w);},y=w=>{c&&p.length>=c||h(`${p}${w}`);},S=w=>{if(w==="00"){if(!p){h("0");return}y("00");return}y(w);},E=()=>{!n||p.includes(".")||h(p?`${p}.`:"0.");},P=()=>{if(i){if(p.startsWith("-")){h(p.slice(1));return}h(p?`-${p}`:"-");}},k=()=>{h(p.slice(0,-1));},R=()=>{h("");},I=()=>{f?.(p);};return jsxRuntime.jsx(material.Paper,{elevation:0,sx:{p:2,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",...b},children:jsxRuntime.jsxs(material.Stack,{spacing:2,children:[jsxRuntime.jsxs(material.Stack,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[o?jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1rem",fontWeight:800},children:o}):null,r?jsxRuntime.jsx(material.Typography,{sx:{mt:.5,fontSize:"0.86rem",color:"text.secondary"},children:r}):null]}),m?jsxRuntime.jsx(material.IconButton,{onClick:m,size:"small",children:jsxRuntime.jsx($k__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:p?"1.9rem":"1.25rem",fontWeight:900,letterSpacing:"0.06em",color:p?"text.primary":"text.disabled"},children:p||a})}),jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:"repeat(3, minmax(0, 1fr))",gap:1.25},children:[["1","2","3","4","5","6","7","8","9"].map(w=>jsxRuntime.jsx(Ti,{label:w,onPress:()=>S(w)},w)),jsxRuntime.jsx(Ti,{label:i?"+/-":"00",onPress:i?P:()=>S("00")}),jsxRuntime.jsx(Ti,{label:"0",onPress:()=>S("0")}),jsxRuntime.jsx(Ti,{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(Wk__default.default,{}),jsxRuntime.jsx(material.Typography,{sx:{fontWeight:700},children:s||"DEL"})]})}),jsxRuntime.jsx(Ti,{label:String(l||"CLR"),onPress:R,emphasis:"danger"}),jsxRuntime.jsx(material.Box,{component:"button",type:"button",onClick:I,sx:w=>({minHeight:64,borderRadius:3,border:"1px solid",borderColor:"primary.main",background:w.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(Gk__default.default,{}),jsxRuntime.jsx(material.Typography,{sx:{fontWeight:800},children:d||C("common.ok")})]})})]})]})})};var rg=({touchMode:e="comfortable",sx:t,...o})=>{let r=e==="expanded";return jsxRuntime.jsx(material.Box,{sx:{"& .MuiPaper-root":{borderRadius:4},"& .MuiAutocomplete-root":{minWidth:{xs:"100%",md:260}},"& .MuiAutocomplete-root .MuiInputBase-root":{backgroundColor:"transparent !important"},"& .MuiInputBase-root":{minHeight:r?56:50,borderRadius:3,fontSize:r?"0.98rem":"0.92rem"},"& .MuiInputBase-input":{py:r?1.6:1.25,fontSize:r?"0.98rem":"0.92rem"},"& .MuiInputLabel-root":{fontSize:r?"0.95rem":"0.88rem"},"& .MuiButton-root":{minHeight:r?48:44,px:r?2.25:1.75,borderRadius:3,fontSize:r?"0.95rem":"0.88rem",fontWeight:700},"& .MuiIconButton-root":{width:r?40:36,height:r?40:36},"& .MuiMenuItem-root":{minHeight:r?44:38,fontSize:r?"0.95rem":"0.88rem"},"& .MuiListSubheader-root":{py:1},"& .MuiCheckbox-root":{p:r?1:.75},"& .MuiFormControlLabel-label":{fontSize:r?"0.95rem":"0.88rem"},"& .MuiDialog-paper":{borderRadius:4},"& .MuiDialogTitle-root":{fontSize:r?"1.05rem":"0.98rem",fontWeight:800},"& .MuiDialogContent-root .MuiInputBase-root":{minHeight:52},'& .MuiGrid-root > .MuiGrid-item, & .MuiGrid-root > .MuiGrid-sizeXs-1, & .MuiGrid-root > [class*="MuiGrid-grid-"]':{minWidth:0},...t},children:jsxRuntime.jsx(Cr,{...o})})};var Xk=(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);}},ig=({items:e,selectedId:t,orientation:o="auto",onItemSelect:r,sx:a})=>{let n=styles.useTheme(),[i,c]=Rt.useState(false);Rt.useEffect(()=>{c(true);},[]);let d=material.useMediaQuery("(orientation: portrait)",{noSsr:true}),l=material.useMediaQuery(n.breakpoints.down("md"),{noSsr:true}),s=o==="auto"?d||l?"portrait":"landscape":o,g=navigation.useRouter();return jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:!i||s==="portrait"?"repeat(2, minmax(0, 1fr))":"repeat(auto-fit, minmax(180px, 1fr))",gap:1.5,...a},children:e.map(f=>{let m=f.id===t,b=f.color||(m?n.palette.primary.main:n.palette.divider);return jsxRuntime.jsx(material.Paper,{elevation:0,sx:{overflow:"hidden",borderRadius:4,border:"1px solid",borderColor:m?"primary.main":"divider",boxShadow:m?"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:()=>Xk(g,f,r),sx:{width:"100%",p:2,minHeight:s==="portrait"?156:148,display:"block",border:0,background:"transparent",textAlign:"left",cursor:f.disabled?"not-allowed":"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent",color:"text.primary"},children:jsxRuntime.jsxs(material.Stack,{spacing:1.5,sx:{height:"100%"},children:[jsxRuntime.jsxs(material.Stack,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[jsxRuntime.jsx(material.Box,{sx:{width:44,height:44,borderRadius:3,display:"grid",placeItems:"center",color:m?"#fff":"text.primary",background:m?b:"action.hover"},children:f.icon||jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1rem",fontWeight:900},children:f.title.slice(0,1).toUpperCase()})}),f.badge!==void 0?jsxRuntime.jsx(material.Box,{sx:{minWidth:34,px:1,py:.4,borderRadius:999,bgcolor:m?"primary.main":"action.hover",color:m?"#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 dg=(e,t)=>t.trim()?e.reduce((o,r)=>{let a=r.title?.toLowerCase().includes(t.toLowerCase())||r.label?.toLowerCase().includes(t.toLowerCase())||r.description?.toLowerCase().includes(t.toLowerCase()),n=r.children?dg(r.children,t):[];return (a||n.length>0)&&o.push({...r,children:n.length>0?n:r.children}),o},[]):e,cS=e=>{let t=new Set,o=r=>{r.forEach(a=>{a.children?.length&&(t.add(a.id),o(a.children));});};return o(e),t},ug=({collapsed:e=false,onToggle:t,className:o="",maxHeight:r,menuData:a=[],colorMode:n="light",orientation:i="auto",headerSlot:c,footerSlot:d,activeHref:l,onItemSelect:s})=>{let{t:g}=te(),f=styles.useTheme(),m=material.useMediaQuery("(orientation: portrait)"),b=material.useMediaQuery(f.breakpoints.down("md")),C=i==="auto"?m||b?"portrait":"landscape":i,u=n==="dark",v=navigation.useRouter(),p=navigation.usePathname(),[h,y]=Rt.useState(""),[S,E]=Rt.useState(new Set),P=Rt.useMemo(()=>dg(a,h),[a,h]),k=Rt.useMemo(()=>h.trim()?cS(P):S,[S,P,h]);Rt.useEffect(()=>{e&&E(new Set);},[e]);let R=D=>D.appurl||D.href||"",I=D=>{s?.(D);let B=R(D);if(B){if(B.startsWith("http://")||B.startsWith("https://")){window.open(B,"_blank");return}v.push(B);}},w=D=>{let B=!!D.children?.length;if(e&&B){t?.();return}if(B){E(j=>{let W=new Set(j);return W.has(D.id)?W.delete(D.id):W.add(D.id),W});return}I(D);},A=D=>{let B=l||p,j=R(D);return !!(j&&B===j)},M=(D,B=0)=>{let j=!!D.children?.length,W=k.has(D.id),q=A(D);return jsxRuntime.jsx(material.Box,{sx:{pl:B===0?0:1.5},children:jsxRuntime.jsxs(material.Paper,{elevation:0,sx:{mb:1,overflow:"hidden",borderRadius:3,border:"1px solid",borderColor:q?"primary.main":"divider",bgcolor:q?"action.selected":"background.paper"},children:[jsxRuntime.jsxs(material.Box,{component:"button",type:"button",onClick:()=>w(D),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:D.icon||(D.title||D.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:D.title||D.label}),D.description?jsxRuntime.jsx(material.Typography,{sx:{mt:.4,fontSize:"0.78rem",color:"text.secondary",lineHeight:1.35},children:D.description}):null]}),j?jsxRuntime.jsx(lS__default.default,{sx:{transform:W?"rotate(180deg)":"rotate(0deg)",transition:"transform 180ms ease"}}):jsxRuntime.jsx(sS__default.default,{color:"action"})]}),j?jsxRuntime.jsx(material.Collapse,{in:W,children:jsxRuntime.jsx(material.Box,{sx:{px:1.25,pb:1.25},children:D.children?.map(ee=>M(ee,B+1))})}):null]})},D.id)};return e?jsxRuntime.jsx(material.Paper,{elevation:0,className:o,sx:{width:C==="portrait"?"100%":88,p:1,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:u?"#101828":"rgba(255,255,255,0.88)",maxHeight:r?`${r}px`:void 0,overflowY:"auto"},children:jsxRuntime.jsxs(material.Stack,{spacing:1,children:[jsxRuntime.jsx(material.IconButton,{onClick:t,sx:{width:48,height:48,alignSelf:"center",bgcolor:"action.hover"},title:g("navigation.expand"),children:jsxRuntime.jsx(iS__default.default,{})}),a.map(D=>jsxRuntime.jsx(material.IconButton,{onClick:()=>w(D),sx:{width:56,height:56,alignSelf:"center",borderRadius:3,bgcolor:A(D)?"primary.main":"action.hover",color:A(D)?"#fff":"text.primary"},children:D.icon||(D.title||D.label||"?").slice(0,1).toUpperCase()},D.id))]})}):jsxRuntime.jsx(material.Paper,{elevation:0,className:o,sx:{width:C==="portrait"?"100%":320,p:1.25,borderRadius:5,border:"1px solid",borderColor:"divider",bgcolor:u?"#101828":"rgba(255,255,255,0.88)",maxHeight:r?`${r}px`:void 0,overflow:"hidden",display:"flex",flexDirection:"column"},children:jsxRuntime.jsxs(material.Stack,{spacing:1.25,sx:{flex:1,minHeight:0},children:[jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,alignItems:"center",children:[jsxRuntime.jsx(material.TextField,{value:h,onChange:D=>y(D.target.value),placeholder:g("navigation.searchPlaceholder"),size:"small",fullWidth:true,InputProps:{startAdornment:jsxRuntime.jsx(aS__default.default,{fontSize:"small",color:"action"})}}),C==="landscape"&&!e?jsxRuntime.jsx(material.IconButton,{onClick:t,sx:{bgcolor:"action.hover"},children:jsxRuntime.jsx(nS__default.default,{})}):null]}),c,jsxRuntime.jsx(material.Box,{sx:{flex:1,minHeight:0,overflowY:"auto",pr:.25},children:P.length>0?P.map(D=>M(D)):jsxRuntime.jsx(material.Typography,{sx:{p:2,fontSize:"0.88rem",color:"text.secondary",textAlign:"center"},children:g("navigation.noMatch")})}),d]})})};var xg=(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)},fS=e=>Rt__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}),hS=(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)},bS=({summaryRow:e,visibleColumns:t,columns:o})=>{let r=o.filter(a=>t.includes(a.id)&&e[a.id]!=="");return r.length===0?null:jsxRuntime.jsx(material.Paper,{elevation:0,sx:{p:1.5,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:jsxRuntime.jsxs(material.Stack,{spacing:1,children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.82rem",fontWeight:800,color:"text.secondary"},children:"Summary"}),jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(132px, 1fr))",gap:1},children:r.map(a=>jsxRuntime.jsxs(material.Paper,{elevation:0,sx:{p:1.1,borderRadius:3,border:"1px solid",borderColor:"divider"},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:a.label}),jsxRuntime.jsx(material.Typography,{sx:{mt:.25,fontSize:"0.96rem",fontWeight:800},children:e[a.id]})]},`summary-${a.id}`))})]})})},yS=e=>{let{t}=te(),o=styles.useTheme(),{title:r,showToolbar:a=true,selectionMode:n,selected:i=[],onSelectionChange:c,actions:d,extraTools:l,fitContainer:s=false,fullWidth:g=false,maxHeight:f,loading:m=false,rowsPerPageOptions:b=[20,50,100,-1],onLayoutSave:C,filterConfig:u,rowKey:v,tableKey:p="default",graphReport:h,quickCreate:y,quickEdit:S,quickDelete:E,serviceUrl:P,orientation:k="auto",cardTitleField:R,cardSubtitleFields:I,toolbarSlot:w,emptyState:A,rowHeight:M="comfortable",cardActionSlot:D,renderCardFooter:B,onRowClick:j}=e,W=r||t("table.title.default"),q=material.useMediaQuery("(orientation: portrait)"),ee=material.useMediaQuery(o.breakpoints.down("md")),le=k==="auto"?q||ee?"portrait":"landscape":k,{columns:_,filterText:U,setFilterText:ge,visibleColumns:Me,showSummary:Ee,setShowSummary:ie,summaryColumns:Re,grouping:Be,setGrouping:lt,expandedGroups:Ze,groupAnchorEl:Oe,setGroupAnchorEl:qe,summaryAnchorEl:ot,setSummaryAnchorEl:Z,anchorEl:se,setAnchorEl:Ae,contextMenu:He,sortedAndFilteredRows:G,summaryRow:X,visibleRows:Ie,page:ke,setPage:Fe,rowsPerPage:rt,setRowsPerPage:Xe,totalDisplayCount:eo,setSelected:Zt,handleClick:Tt,toggleSummaryColumn:po,handleExport:Et,handleCloseContextMenu:Ne,toggleColumnVisibility:we,toggleGroupExpand:yt,toggleGroupField:_e,handleExpandGroupRecursively:Ft,handleCollapseGroupRecursively:mo,handleLayoutLoad:go,handleVariantLoad:Xt,handleLayoutSave:xt,effectiveAppId:fo,currentLayoutData:ho,currentLayoutId:bo,layoutIdToLoad:Uo,graphReportOpen:mt,handleOpenGraphReport:to,handleCloseGraphReport:vt}=cn(e),z=h?.enabled??false,V=z&&(h?.interaction?.enabled??true),O=ll(),ne=v||"id",ce=Rt__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]),Se=Rt__namespace.default.useMemo(()=>({...ce,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)}),[ce,o]),T=Rt__namespace.default.useMemo(()=>{let $=new Set(i);return G.filter(de=>$.has(de?.[ne]))},[ne,i,G]),N=T.length===1?T[0]:null,K=!!y?.enabled,J=!!S?.enabled,pe=!!E?.enabled,be=y?.fields,xe=y?.excludeFields||[],fe=y?.initialValues||{},ze=S?.fields,We=S?.excludeFields||[],st=S?.editableFields||[],Ke=S?.nonEditableFields||[],Ve=S?.primaryKeys?.length?S.primaryKeys:[ne],[Lt,Ot]=Rt__namespace.default.useState(false),[gt,oo]=Rt__namespace.default.useState(false),[ft,ro]=Rt__namespace.default.useState({}),[Ko,ao]=Rt__namespace.default.useState(false),[gr,Or]=Rt__namespace.default.useState(false),[no,qo]=Rt__namespace.default.useState({}),[fr,zo]=Rt__namespace.default.useState(false),[ar,sa]=Rt__namespace.default.useState(false),Oa=m||gt||gr||ar,Hr=Rt__namespace.default.useMemo(()=>{let $=[..._];if(Array.isArray(be)&&be.length>0){let de=new Set(be);$=$.filter(Q=>de.has(Q.id));}if(xe.length>0){let de=new Set(xe);$=$.filter(Q=>!de.has(Q.id));}return $.filter(de=>!!de?.id)},[_,xe,be]),ca=Rt__namespace.default.useMemo(()=>{let $=[..._];if(Array.isArray(ze)&&ze.length>0){let de=new Set(ze);$=$.filter(Q=>de.has(Q.id));}if(We.length>0){let de=new Set(We);$=$.filter(Q=>!de.has(Q.id));}return $.filter(de=>!!de?.id)},[_,We,ze]),hr=Rt__namespace.default.useMemo(()=>new Set(Ve),[Ve]),yo=Rt__namespace.default.useMemo(()=>new Set(st),[st]),_o=Rt__namespace.default.useMemo(()=>new Set(Ke),[Ke]),Ha=Rt__namespace.default.useCallback($=>yo.size>0?yo.has($):!(_o.has($)||hr.has($)),[yo,_o,hr]);Rt__namespace.default.useEffect(()=>{!mt&&O.hasActiveFilters&&O.clearAll();},[O,mt]);let da=()=>{let $={};Hr.forEach(de=>{$[de.id]=fe[de.id]??"";}),ro($),Ot(true);},Wa=($,de)=>{ro(Q=>({...Q,[$]:de}));},$a=async()=>{if(!y?.onSubmit){Ot(false);return}try{oo(!0),await y.onSubmit(ft),Ot(!1);}finally{oo(false);}},Ga=()=>{if(!N)return;let $={};ca.forEach(Q=>{$[Q.id]=N[Q.id]??"";});let de=S?.getInitialValues?{...$,...S.getInitialValues(N)}:$;qo(de),ao(true);},wo=($,de)=>{qo(Q=>({...Q,[$]:de}));},Ua=async()=>{if(N){if(!S?.onSubmit){ao(false);return}try{Or(!0),await S.onSubmit(no,N),ao(!1);}finally{Or(false);}}},Ka=()=>{T.length!==0&&zo(true);},ua=async()=>{if(T.length===0){zo(false);return}if(!E?.onConfirm){zo(false),Zt([]),c?.([]);return}try{sa(!0),await E.onConfirm(T),zo(!1),Zt([]),c?.([]);}finally{sa(false);}},br=G,{fieldMapping:Wr}=rn({rows:br,config:{...h,title:h?.title||`${W} ${t("graph.reportTitle")}`}}),$r=Rt__namespace.default.useMemo(()=>V?O.applyRows(br,Wr):br,[Wr,O,V,br]),{model:x}=rn({rows:$r,config:{...h,title:h?.title||`${W} ${t("graph.reportTitle")}`,fieldMapping:Wr}}),F=x.table.columns.map($=>({id:$.id,label:$.label,align:$.align||"left",minWidth:120,numeric:$.align==="right"})),L=fo?jsxRuntime.jsx(hl,{appId:fo,tableKey:p,currentLayoutData:ho,onLayoutLoad:go,targetLayoutId:Uo,activeLayoutId:bo,serviceUrl:P??u?.serviceUrl}):null,Y=_.filter($=>Me.includes($.id)),ue=Y.find($=>$.id===R)||Y[0],De=I?.map($=>Y.find(de=>de.id===$)).filter(Boolean)||Y.filter($=>$.id!==ue?.id).slice(0,le==="portrait"?2:3),H=Y.filter($=>$.id!==ue?.id&&!De.some(de=>de.id===$.id)),ae=[w,l].filter(Boolean),re=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(qa,{groupAnchorEl:Oe,setGroupAnchorEl:qe,grouping:Be,setGrouping:lt,columns:_,toggleGroupField:_e}),jsxRuntime.jsx(_a,{anchorEl:se,setAnchorEl:Ae,columns:_,visibleColumns:Me,toggleColumnVisibility:we}),jsxRuntime.jsx($i,{anchorEl:ot,setAnchorEl:Z,showSummary:Ee,setShowSummary:ie,columns:_,summaryColumns:Re,toggleSummaryColumn:po}),jsxRuntime.jsx(Gi,{contextMenu:He,handleCloseContextMenu:Ne,columns:_,visibleColumns:Me,toggleColumnVisibility:we})]}),at=($,de,Q)=>{let ve=i.includes(de),Ye=le==="portrait"?"repeat(2, minmax(0, 1fr))":"repeat(auto-fit, minmax(140px, 1fr))",nr=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),If=styles.alpha(o.palette.divider,.22);return jsxRuntime.jsx(material.Paper,{elevation:0,onClick:()=>{Tt({},$),j?.($);},sx:{p:M==="compact"?1.25:1.5,borderRadius:4,border:"0.5px solid",borderColor:ve?styles.alpha(o.palette.primary.main,.38):If,background:ve?`linear-gradient(135deg, ${styles.alpha(o.palette.primary.main,.13)}, ${styles.alpha(o.palette.primary.main,.06)})`:`linear-gradient(135deg, ${nr}, ${styles.alpha(o.palette.primary.main,.015)})`,boxShadow:ve?`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:ve?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:ve,onClick:To=>To.stopPropagation(),onChange:()=>Tt({},$),sx:{mt:-0.6,ml:-0.6}}):null,jsxRuntime.jsxs(material.Box,{sx:{flex:1,minWidth:0},children:[ue?jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1rem",fontWeight:900,lineHeight:1.25},children:xg(ue,$)}):null,De.length>0?jsxRuntime.jsx(material.Stack,{direction:"row",spacing:.75,useFlexGap:true,flexWrap:"wrap",sx:{mt:.75},children:De.map(To=>jsxRuntime.jsx(material.Chip,{label:`${To.label}: ${hS(To,$)}`,size:"small",variant:"outlined",sx:ce},`${de}-${To.id}`))}):null]}),D?jsxRuntime.jsx(material.Box,{onClick:To=>To.stopPropagation(),children:D($)}):null]}),H.length>0?jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:Ye,gap:1},children:H.map(To=>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:To.label}),fS(xg(To,$))]},`${de}-${To.id}-detail`))}):null,B?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsx(material.Box,{onClick:To=>To.stopPropagation(),children:B($)})]}):null]})},de)};return jsxRuntime.jsxs(material.Box,{sx:{width:g?"100%":"auto",mb:s?0:2,...s?{flex:1,display:"flex",flexDirection:"column",minHeight:0,height:"100%",overflow:"hidden"}:{}},children:[u?jsxRuntime.jsx(material.Box,{sx:{mb:2},children:jsxRuntime.jsx(rg,{...u,onVariantLoad:$=>{Xt($),u.onVariantLoad?.($);},appId:u.appId,tableKey:p,currentLayout:[{tableKey:p,layoutData:ho}],currentLayoutId:bo,layoutRefs:[{tableKey:p,layoutId:bo}],variantService:u.variantService,serviceUrl:P??u.serviceUrl,touchMode:le==="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":Oa?{content:'""',position:"absolute",top:0,left:0,width:"100%",height:"3px",background:"linear-gradient(90deg, rgba(25, 118, 210, 0) 0%, rgba(25, 118, 210, 0.25) 25%, rgba(25, 118, 210, 1) 50%, rgba(25, 118, 210, 0.25) 75%, rgba(25, 118, 210, 0) 100%)",backgroundSize:"220% 100%",animation:"cTableTopMarquee 1.2s linear infinite",zIndex:6,pointerEvents:"none"}:{},"@keyframes cTableTopMarquee":{"0%":{backgroundPosition:"220% 0"},"100%":{backgroundPosition:"-120% 0"}},...f?{height:f}:s?{flex:1,minHeight:0,height:"100%"}:{}},children:[a?jsxRuntime.jsx(material.Box,{sx:{"& .MuiToolbar-root":{minHeight:60,alignItems:{xs:"flex-start",md:"center"},flexWrap:"wrap",rowGap:1,columnGap:1},"& .MuiToolbar-root > :nth-of-type(1)":{width:{xs:"100%",md:"auto"},"& .MuiTextField-root":{width:{xs:"100%",md:300}}},"& .MuiToolbar-root > :nth-of-type(2)":{flexShrink:0},"& .MuiToolbar-root > :nth-of-type(3)":{display:{xs:"none",md:"block"}},"& .MuiToolbar-root > :nth-of-type(4)":{ml:"auto",justifyContent:"flex-end",flexWrap:"wrap"},"& .MuiInputBase-root":{minHeight:46},"& .MuiIconButton-root":{width:40,height:40},"& .MuiTypography-root":{fontSize:"0.9rem"},"& .MuiButtonBase-root":{borderRadius:2.5}},children:jsxRuntime.jsx(Ni,{filterText:U,setFilterText:ge,onRowsPerPageChange:Xe,rowsPerPage:rt,rowsPerPageOptions:b,page:ke,count:eo,onPageChange:Fe,actions:d,extraTools:ae,grouping:Be,setGroupAnchorEl:qe,showSummary:Ee,setShowSummary:ie,setAnchorEl:Ae,setSummaryAnchorEl:Z,handleExport:Et,showCreateButton:K,onOpenCreateDialog:da,showEditButton:J,onOpenEditDialog:Ga,editDisabled:T.length!==1,showDeleteButton:pe,onOpenDeleteConfirm:Ka,deleteDisabled:T.length===0,onLayoutSave:C||u?.variantService&&u?.appId?xt:void 0,loading:m,layoutManager:L,onOpenGraphReport:z?to: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:[Ie.length===0&&!m?A||jsxRuntime.jsx(material.Paper,{elevation:0,sx:{p:4,borderRadius:4,border:"1px dashed",borderColor:"divider",textAlign:"center"},children:jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.92rem",color:"text.secondary"},children:t("common.noData")})}):null,Ie.map(($,de)=>{if($.type==="group"){let Ye=Ze.has($.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:()=>yt($.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:[Ye?jsxRuntime.jsx(lS__default.default,{}):jsxRuntime.jsx(sS__default.default,{}),jsxRuntime.jsxs(material.Box,{sx:{flex:1,minWidth:0},children:[jsxRuntime.jsxs(material.Typography,{sx:{fontSize:"0.94rem",fontWeight:800},children:[$.field,": ",$.value]}),jsxRuntime.jsxs(material.Typography,{sx:{mt:.2,fontSize:"0.76rem",color:"text.secondary"},children:[$.count," records"]})]}),Be.length>1&&$.level<Be.length-1?jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:.5,children:[jsxRuntime.jsx(material.Chip,{size:"small",label:t("table.group.expandAll"),onClick:nr=>{nr.stopPropagation(),Ft($.id);},sx:Se}),jsxRuntime.jsx(material.Chip,{size:"small",label:t("table.group.collapseAll"),onClick:nr=>{nr.stopPropagation(),mo($.id);},sx:Se})]}):null]})},$.id)}let Q=$.data||$,ve=$.id||Q[ne]||de;return at(Q,ve,de)}),Ee?jsxRuntime.jsx(bS,{summaryRow:X,visibleColumns:Me,columns:_}):null,m?jsxRuntime.jsx(material.Typography,{sx:{py:1,fontSize:"0.84rem",color:"text.secondary",textAlign:"center"},children:t("common.loading")}):null]})})]}),K?jsxRuntime.jsxs(material.Dialog,{open:Lt,onClose:()=>!gt&&Ot(false),fullWidth:true,maxWidth:"sm",children:[jsxRuntime.jsx(material.DialogTitle,{sx:{fontSize:"1rem",fontWeight:800},children:y?.title||t("quickCreate.createWithTitle",{title:W})}),jsxRuntime.jsx(material.DialogContent,{sx:{pt:"8px !important"},children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Hr.map($=>{let de=$.type==="number"||$.numeric?"number":$.type==="date"?"date":"text";return jsxRuntime.jsx(material.TextField,{label:$.label||$.id,value:ft[$.id]??"",onChange:Q=>Wa($.id,Q.target.value),type:de,fullWidth:true,InputLabelProps:{shrink:de==="date"?true:void 0}},`quick-create-${$.id}`)}),y?.description?jsxRuntime.jsx(material.Alert,{severity:"info",children:y.description}):null]})}),jsxRuntime.jsxs(material.DialogActions,{sx:{px:3,pb:2},children:[jsxRuntime.jsx(material.Button,{onClick:()=>Ot(false),disabled:gt,children:y?.cancelLabel||t("common.cancel")}),jsxRuntime.jsx(material.Button,{onClick:$a,variant:"contained",disabled:gt,children:y?.submitLabel||t("common.save")})]})]}):null,J?jsxRuntime.jsxs(material.Dialog,{open:Ko,onClose:()=>!gr&&ao(false),fullWidth:true,maxWidth:"sm",children:[jsxRuntime.jsx(material.DialogTitle,{sx:{fontSize:"1rem",fontWeight:800},children:S?.title||t("quickEdit.editWithTitle",{title:W})}),jsxRuntime.jsx(material.DialogContent,{sx:{pt:"8px !important"},children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[ca.map($=>{let de=$.type==="number"||$.numeric?"number":$.type==="date"?"date":"text";return jsxRuntime.jsx(material.TextField,{label:$.label||$.id,value:no[$.id]??"",onChange:Q=>wo($.id,Q.target.value),type:de,disabled:!Ha($.id),fullWidth:true,InputLabelProps:{shrink:de==="date"?true:void 0}},`quick-edit-${$.id}`)}),S?.description?jsxRuntime.jsx(material.Alert,{severity:"info",children:S.description}):null]})}),jsxRuntime.jsxs(material.DialogActions,{sx:{px:3,pb:2},children:[jsxRuntime.jsx(material.Button,{onClick:()=>ao(false),disabled:gr,children:S?.cancelLabel||t("common.cancel")}),jsxRuntime.jsx(material.Button,{onClick:Ua,variant:"contained",disabled:gr||!N,children:S?.submitLabel||t("common.save")})]})]}):null,pe?jsxRuntime.jsx(Nn,{open:fr,type:"warning",title:E?.title||t("quickDelete.confirmTitle"),message:E?.message||(T.length>1?t("quickDelete.confirmMessageMultiple",{count:T.length}):t("quickDelete.confirmMessageSingle")),confirmText:E?.confirmText||t("common.delete"),cancelText:E?.cancelText||t("common.cancel"),onClose:()=>!ar&&zo(false),onConfirm:ua}):null,re,z?jsxRuntime.jsx(nl,{open:mt,onClose:vt,model:x,aiAssistant:h?.aiAssistant,interaction:V?{enabled:true,filters:O.filters,fieldMapping:Wr,onPrimaryDimensionClick:$=>O.setFilter("primaryDimension",$),onSecondaryDimensionClick:$=>O.setFilter("secondaryDimension",$),onStatusClick:$=>O.setFilter("status",$),onClearFilter:O.clearFilter,onClearAll:O.clearAll}:void 0,tableContent:jsxRuntime.jsx(yS,{appId:fo||"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 KL=({appTitle:e,children:t,menuData:o=[],workloadItems:r=[],workloadSelectedId:a,showNavigation:n=true,showWorkloadNav:i=true,orientation:c="auto",logo:d,headerSlot:l,actionSlot:s,portraitBottomSlot:g,contentSx:f,containerSx:m,user:b,onSearch:C,defaultNavigationOpen:u,navOpen:v,onNavOpenChange:p,onWorkloadSelect:h,locale:y="en",localeLabel:S,localeOptions:E,onLocaleChange:P,onUserSetting:k,onUserLogout:R,userMenuItems:I,leftHeaderSlot:w,rightHeaderSlot:A})=>{let M="orbcafe:page-layout-mode",[D,B]=Rt.useState("system"),[j,W]=Rt.useState("light"),[q,ee]=Rt.useState(false),[le,_]=Rt.useState(false),U=D==="system"?le?j:"light":D;Rt.useEffect(()=>{ee(true);},[]),Rt.useEffect(()=>{try{let He=window.localStorage.getItem(M);(He==="light"||He==="dark"||He==="system")&&B(He);}catch{}_(true);let se=window.matchMedia("(prefers-color-scheme: dark)"),Ae=()=>{W(se.matches?"dark":"light");};return Ae(),se.addEventListener("change",Ae),()=>se.removeEventListener("change",Ae)},[]),Rt.useEffect(()=>{if(le)try{window.localStorage.setItem(M,D);}catch{}},[le,D]),Rt.useEffect(()=>{U==="dark"?(document.documentElement.classList.add("dark"),document.documentElement.style.colorScheme="dark"):(document.documentElement.classList.remove("dark"),document.documentElement.style.colorScheme="light");},[U]);let ge=Rt.useMemo(()=>styles.createTheme({palette:U==="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:U==="dark"?"#060913":"#eef3f8"}}},MuiPaper:{styleOverrides:{root:{backgroundImage:"none"}}}}}),[U]),Me=material.useMediaQuery("(orientation: portrait)"),Ee=material.useMediaQuery(ge.breakpoints.down("md")),ie=c==="auto"?!q||Me||Ee?"portrait":"landscape":c,[Re,Be]=Rt.useState({landscape:u??true,portrait:false}),lt=Re[ie],Ze=v??lt,Oe=se=>{v===void 0&&Be(Ae=>({...Ae,[ie]:se})),p?.(se);},qe=jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,alignItems:"center",children:[!q||n&&ie==="portrait"?jsxRuntime.jsx(material.IconButton,{onClick:()=>Oe(!Ze),sx:{bgcolor:"action.hover"},children:jsxRuntime.jsx(iS__default.default,{})}):null,w]}),ot=jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,alignItems:"center",children:[s,A]}),Z=jsxRuntime.jsx(ug,{collapsed:ie==="landscape"?!Ze:false,onToggle:()=>Oe(!Ze),menuData:o,orientation:ie,colorMode:U,maxHeight:ie==="landscape"?900:void 0});return jsxRuntime.jsx(styles.ThemeProvider,{theme:ge,children:jsxRuntime.jsx(Li,{locale:y,children:jsxRuntime.jsxs(material.Box,{sx:[se=>({minHeight:"100vh",display:"flex",flexDirection:"column",background:se.palette.mode==="dark"?"linear-gradient(180deg, #0A0A0A 0%, #141414 55%, #1A1A1A 100%)":se.palette.background.default}),...Array.isArray(m)?m:[m]],children:[jsxRuntime.jsx(zl,{appTitle:e,logo:d===void 0?null:d,mode:D,onToggleMode:()=>B(se=>se==="system"?"dark":se==="dark"?"light":"system"),locale:y,localeLabel:S,localeOptions:E,onLocaleChange:P,user:b,onUserSetting:k,onUserLogout:R,userMenuItems:I,onSearch:C,leftSlot:qe,rightSlot:ot}),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:Z}):null,!q||n&&ie==="portrait"?jsxRuntime.jsx(material.Drawer,{open:Ze,onClose:()=>Oe(false),PaperProps:{sx:{width:"min(88vw, 360px)",p:1.25,bgcolor:"transparent",boxShadow:"none"}},children:Z}):null,jsxRuntime.jsx(material.Box,{sx:{flex:1,minWidth:0,minHeight:0,overflow:"auto",p:1.5,...f},children:jsxRuntime.jsxs(material.Stack,{spacing:1.5,children:[i&&r.length>0?jsxRuntime.jsx(ig,{items:r,selectedId:a,orientation:ie,onItemSelect:h}):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:ge.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 Tg=NS__default.default(()=>Promise.resolve().then(()=>(wg(),Sg)).then(e=>e.COrbCanvas),{ssr:false,loading:()=>jsxRuntime.jsx("div",{className:"h-full w-full bg-transparent"})});function pd({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(Tg,{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(Tg,{hue:10,hoverIntensity:.8,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})})]})})})}var JL=pd;function ss({onTextUpdate:e,onComplete:t,onError:o,wsUrl:r="ws://localhost:8765",silenceThresholdMs:a=2e3,minVolumeRms:n=.015}){let[i,c]=Rt.useState(false),d=Rt.useRef(null),l=Rt.useRef(null),s=Rt.useRef(null),g=Rt.useRef(null),f=Rt.useRef(null),m=Rt.useRef(0),b=Rt.useRef(false),C=Rt.useRef(false),u=Rt.useCallback(()=>{d.current&&(d.current.close(),d.current=null),g.current&&(g.current.disconnect(),g.current=null),f.current&&(f.current.disconnect(),f.current=null),l.current&&(l.current.getTracks().forEach(h=>h.stop()),l.current=null),s.current&&(s.current.close(),s.current=null),C.current=false,c(false);},[]),v=Rt.useCallback(()=>{b.current||(b.current=true,d.current?.readyState===WebSocket.OPEN&&d.current.send(JSON.stringify({type:"stop"})),setTimeout(u,500));},[u]),p=Rt.useCallback(async()=>{if(!(i||C.current)){C.current=true,b.current=false,m.current=Date.now();try{let h=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,sampleRate:16e3,echoCancellation:!0,noiseSuppression:!0}});l.current=h;let y=new WebSocket(r);d.current=y,y.onopen=()=>{c(!0),C.current=!1;},y.onmessage=R=>{try{let I=JSON.parse(R.data);if(I.type==="recognition")I.is_final?t(I.text):e?.(I.text);else if(I.type==="error"){let w=I.message||"Voice recognition error";o?.(w),v();}}catch{o?.("Failed to parse voice message");}},y.onerror=()=>{o?.("Voice service connection failed"),u();},y.onclose=()=>{u();};let S=window.AudioContext||window.webkitAudioContext;if(!S)throw new Error("AudioContext is not supported in this browser");let E=new S({sampleRate:16e3});s.current=E;let P=E.createMediaStreamSource(h);f.current=P;let k=E.createScriptProcessor(4096,1,1);g.current=k,k.onaudioprocess=R=>{if(d.current?.readyState!==WebSocket.OPEN)return;let I=R.inputBuffer.getChannelData(0),w=0;for(let D=0;D<I.length;D+=1)w+=I[D]*I[D];if(Math.sqrt(w/I.length)>n)m.current=Date.now();else if(Date.now()-m.current>a&&!b.current){v();return}let M=new Int16Array(I.length);for(let D=0;D<I.length;D+=1){let B=Math.max(-1,Math.min(1,I[D]));M[D]=B<0?B*32768:B*32767;}d.current.send(M.buffer);},P.connect(k),k.connect(E.destination);}catch{o?.("Cannot access microphone"),u();}}},[u,i,n,t,o,e,a,v,r]);return Rt.useEffect(()=>u,[u]),{isRecording:i,startRecording:p,stopRecording:v}}var Pg=Rt.createContext(null);function _S(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 jS({children:e,onVoiceSubmit:t,onVoicePartial:o,onVoiceError:r,longPressMs:a=200,disableSpaceTrigger:n=false,ignoreWhenFocusedInput:i=true,renderOverlay:c=true,wsUrl:d,silenceThresholdMs:l,minVolumeRms:s}){let[g,f]=Rt.useState(false),[m,b]=Rt.useState(false),C=Rt.useRef(null),u=Rt.useRef(false),v=Rt.useRef(false),p=Rt.useCallback(()=>{v.current=false,f(false);},[]),{isRecording:h,startRecording:y,stopRecording:S}=ss({wsUrl:d,silenceThresholdMs:l,minVolumeRms:s,onTextUpdate:R=>{o?.(R);},onComplete:async R=>{try{R.trim()&&(b(!0),await t(R.trim()));}catch(I){let w=I instanceof Error?I.message:"Failed to process voice command";r?.(w);}finally{b(!1),p();}},onError:R=>{r?.(R),b(!1),u.current||p();}}),E=Rt.useCallback(async()=>{v.current=false,await y();},[y]),P=Rt.useCallback(()=>{S();},[S]);Rt.useEffect(()=>{if(n)return;let R=w=>{w.isComposing||(w.code==="Space"||w.key===" ")&&(u.current||w.repeat||i&&_S(document.activeElement)||(u.current=true,w.preventDefault(),C.current=setTimeout(()=>{v.current=true,f(true),y();},a)));},I=w=>{(w.code==="Space"||w.key===" ")&&(C.current&&(clearTimeout(C.current),C.current=null),u.current=false,v.current&&(w.preventDefault(),f(false),S()));};return window.addEventListener("keydown",R),window.addEventListener("keyup",I),()=>{window.removeEventListener("keydown",R),window.removeEventListener("keyup",I),C.current&&(clearTimeout(C.current),C.current=null);}},[n,i,a,y,S]);let k=Rt.useMemo(()=>({isRecording:h,isHotkeyRecording:g,isSubmitting:m,startRecording:E,stopRecording:P}),[g,h,m,E,P]);return jsxRuntime.jsxs(Pg.Provider,{value:k,children:[c?jsxRuntime.jsx(pd,{isRecording:g}):null,e]})}function ZS(){let e=Rt.useContext(Pg);if(!e)throw new Error("useAINav must be used within CAINavProvider");return e}var lz=jS,sz=ZS;function Ge(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var ow=({content:e,theme:t="light",size:o="base",defaultExpanded:r=false})=>{let[a,n]=Rt.useState(r),i=Rt.useMemo(()=>`${(o==="sm"?14:o==="lg"?18:16)-2}px`,[o]);return jsxRuntime.jsxs("div",{className:`my-6 rounded-lg overflow-hidden transition-all duration-200 ${t==="dark"?"bg-gray-800":"bg-white"}`,style:{border:`0.5px solid ${t==="dark"?"#4b5563":"#d1d5db"}`},children:[jsxRuntime.jsxs("div",{className:`px-4 py-3 cursor-pointer flex items-center justify-between transition-colors duration-200 ${t==="dark"?"bg-gray-700 hover:bg-gray-650":"bg-gray-50 hover:bg-gray-100"}`,style:{borderBottom:`0.5px solid ${t==="dark"?"#4b5563":"#e5e7eb"}`},onClick:()=>n(!a),children:[jsxRuntime.jsxs("span",{className:"flex items-center",children:[jsxRuntime.jsx("span",{className:"mr-2",children:"\u{1F914}"}),jsxRuntime.jsx("span",{className:`font-medium ${t==="dark"?"text-gray-300":"text-gray-700"}`,style:{fontSize:o==="sm"?"14px":o==="lg"?"18px":"16px"},children:"\u601D\u8003\u8FC7\u7A0B"})]}),jsxRuntime.jsx("svg",{className:`w-4 h-4 transition-transform duration-200 ${a?"rotate-180":""} ${t==="dark"?"text-gray-400":"text-gray-500"}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),a&&jsxRuntime.jsx("div",{className:`p-4 whitespace-pre-wrap italic font-light ${t==="dark"?"text-gray-400":"text-gray-600"}`,style:{fontSize:i,lineHeight:"1.3 !important"},children:e})]})},Rg=ow;var dw=({content:e,language:t="text",isStreaming:o=false,className:r=""})=>{let{theme:a}=nextThemes.useTheme(),[n,i]=Rt.useState(false),c=async()=>{try{await navigator.clipboard.writeText(e),i(!0),setTimeout(()=>i(!1),2e3);}catch(l){console.error("\u590D\u5236\u5931\u8D25:",l);}},d=a==="dark"?prism.oneDark:prism.oneLight;return jsxRuntime.jsxs("div",{className:Ge("rounded-lg overflow-hidden border border-gray-200 dark:border-gray-700 my-4",r),children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-4 py-2 bg-gray-50 dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700",children:[jsxRuntime.jsx("span",{className:"text-xs font-medium text-gray-600 dark:text-gray-300 uppercase",children:t}),jsxRuntime.jsx("button",{onClick:c,className:"p-1 hover:bg-gray-200 dark:hover:bg-gray-700 rounded transition-colors",disabled:o,title:n?"Copied":"Copy code",children:n?jsxRuntime.jsx(lucideReact.Check,{size:14,className:"text-green-500"}):jsxRuntime.jsx(lucideReact.Clipboard,{size:14,className:"text-gray-500 dark:text-gray-400"})})]}),jsxRuntime.jsx("div",{className:"text-sm",children:jsxRuntime.jsx(reactSyntaxHighlighter.Prism,{language:t,style:d,customStyle:{margin:0,padding:"16px",fontSize:"14px",lineHeight:"1.5",backgroundColor:a==="dark"?"#1f2937":"#ffffff"},wrapLongLines:true,children:e})})]})},Mg=dw;var gw=({content:e,isLoading:t,className:o="",style:r})=>{let a=Rt.useRef(null),[n,i]=Rt.useState(false),[c,d]=Rt.useState(null),{theme:l}=nextThemes.useTheme();return Rt.useEffect(()=>{let s=async()=>{if(!(!e.trim()||!a.current)){i(true),d(null);try{Bg__default.default.initialize({startOnLoad:!1,theme:l==="dark"?"dark":"default",securityLevel:"loose",fontFamily:"inherit"});let f=`mermaid-${Math.random().toString(36).substr(2,9)}`,m=e.replace(/```mermaid\n?|\n?```/g,"").trim(),{svg:b}=await Bg__default.default.render(f,m);a.current&&(a.current.innerHTML=b);}catch(f){console.error("Mermaid render failed:",f),d(f instanceof Error?f.message:"Render failed"),a.current&&(a.current.innerText=e);}finally{i(false);}}},g=setTimeout(()=>{s();},100);return ()=>clearTimeout(g)},[e,l]),t||n?jsxRuntime.jsx("div",{className:`mermaid-block loading ${o}`,style:r,children:jsxRuntime.jsxs("div",{className:"flex items-center justify-center p-4 bg-gray-50 dark:bg-gray-800 rounded border border-gray-200 dark:border-gray-700",children:[jsxRuntime.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-blue-500 mr-2"}),jsxRuntime.jsx("span",{className:"text-sm text-gray-500",children:"Generating Diagram..."})]})}):c?jsxRuntime.jsxs("div",{className:"p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded text-red-600 dark:text-red-400 text-sm overflow-auto",children:[jsxRuntime.jsx("p",{className:"font-semibold mb-2",children:"Mermaid Error:"}),jsxRuntime.jsx("pre",{children:c}),jsxRuntime.jsx("pre",{className:"mt-4 text-xs text-gray-500",children:e})]}):jsxRuntime.jsx("div",{className:`mermaid-block overflow-x-auto ${o}`,style:r,ref:a})},Fg=gw;var vw=({title:e="\u53D1\u751F\u9519\u8BEF",content:t,errorCode:o,stack:r,icon:a,closable:n=true,onClose:i,onRetry:c,className:d="",...l})=>{let[s,g]=Rt.useState(false),[f,m]=Rt.useState(false),b=async()=>{if(c){m(true);try{await c();}catch(C){console.error("\u91CD\u8BD5\u5931\u8D25:",C);}finally{m(false);}}};return jsxRuntime.jsxs("div",{className:`relative w-full overflow-hidden rounded-lg border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 shadow-sm transition-all hover:shadow-md ${d}`,...l,children:[jsxRuntime.jsxs("div",{className:"flex p-4 border-l-4 border-l-red-500 bg-red-50 dark:bg-red-900/10",children:[jsxRuntime.jsx("div",{className:"flex-shrink-0 mr-3 text-red-500 mt-0.5",children:a||jsxRuntime.jsx(lucideReact.AlertCircle,{className:"w-5 h-5"})}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-2 mb-1",children:[jsxRuntime.jsx("h4",{className:"text-base font-semibold text-gray-900 dark:text-gray-100",children:e}),o&&jsxRuntime.jsx("span",{className:"text-xs font-mono px-1.5 py-0.5 rounded bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-300",children:o})]}),t&&jsxRuntime.jsx("div",{className:"text-sm text-gray-600 dark:text-gray-300 mb-3 leading-relaxed",children:typeof t=="string"?jsxRuntime.jsx("p",{className:"whitespace-pre-wrap",children:t}):t}),(c||r)&&jsxRuntime.jsxs("div",{className:"flex items-center space-x-4 mt-2",children:[c&&jsxRuntime.jsxs("button",{onClick:b,disabled:f,className:"flex items-center text-xs font-medium text-red-600 dark:text-red-400 hover:text-red-700 dark:hover:text-red-300 transition-colors disabled:opacity-50",children:[jsxRuntime.jsx(lucideReact.RotateCw,{className:`w-3.5 h-3.5 mr-1.5 ${f?"animate-spin":""}`}),f?"\u91CD\u8BD5\u4E2D...":"\u91CD\u8BD5"]}),r&&jsxRuntime.jsxs("button",{onClick:()=>g(!s),className:"flex items-center text-xs font-medium text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300 transition-colors",children:[s?jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3.5 h-3.5 mr-1"}):jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-3.5 h-3.5 mr-1"}),s?"\u9690\u85CF\u8BE6\u60C5":"\u67E5\u770B\u8BE6\u60C5"]})]})]}),n&&i&&jsxRuntime.jsx("button",{onClick:i,className:"flex-shrink-0 ml-3 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors self-start",children:jsxRuntime.jsx(lucideReact.X,{className:"w-4 h-4"})})]}),r&&s&&jsxRuntime.jsx("div",{className:"bg-gray-50 dark:bg-gray-950 p-3 border-t border-gray-100 dark:border-gray-800",children:jsxRuntime.jsx("pre",{className:"text-xs font-mono text-gray-600 dark:text-gray-400 overflow-x-auto whitespace-pre-wrap p-2 bg-white dark:bg-gray-900 rounded border border-gray-200 dark:border-gray-800",children:r})})]})},cs=vw;var Iw=({title:e="\u8B66\u544A",content:t,warningType:o,severity:r="warning",warnings:a=[],icon:n,closable:i=true,onClose:c,onConfirm:d,actionText:l,className:s="",...g})=>{let f=()=>{switch(r){case "info":return {borderLeftColor:"border-l-blue-500",iconColor:"text-blue-500",bgColor:"bg-blue-50 dark:bg-blue-900/10"};case "error":return {borderLeftColor:"border-l-red-500",iconColor:"text-red-500",bgColor:"bg-red-50 dark:bg-red-900/10"};case "success":return {borderLeftColor:"border-l-green-500",iconColor:"text-green-500",bgColor:"bg-green-50 dark:bg-green-900/10"};default:return {borderLeftColor:"border-l-yellow-500",iconColor:"text-yellow-500",bgColor:"bg-yellow-50 dark:bg-yellow-900/10"}}},m=()=>{switch(r){case "info":return jsxRuntime.jsx(lucideReact.Info,{className:"w-5 h-5"});case "error":return jsxRuntime.jsx(lucideReact.XCircle,{className:"w-5 h-5"});case "success":return jsxRuntime.jsx(lucideReact.CheckCircle,{className:"w-5 h-5"});default:return jsxRuntime.jsx(lucideReact.AlertTriangle,{className:"w-5 h-5"})}},b=f();return jsxRuntime.jsxs("div",{className:`relative w-full overflow-hidden rounded-lg border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 shadow-sm transition-all hover:shadow-md ${s}`,...g,children:[jsxRuntime.jsxs("div",{className:`flex p-4 border-l-4 ${b.borderLeftColor} ${b.bgColor}`,children:[jsxRuntime.jsx("div",{className:`flex-shrink-0 mr-3 ${b.iconColor}`,children:n||m()}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-1",children:[jsxRuntime.jsx("h4",{className:"text-base font-semibold text-gray-900 dark:text-gray-100",children:e}),o&&jsxRuntime.jsx("span",{className:"text-xs font-medium px-2 py-0.5 rounded-full bg-gray-100 dark:bg-gray-800 text-gray-600 dark:text-gray-400",children:o})]}),t&&jsxRuntime.jsx("div",{className:"text-sm text-gray-600 dark:text-gray-300 mb-2",children:t}),a&&a.length>0&&jsxRuntime.jsx("ul",{className:"mt-2 space-y-1",children:a.map((C,u)=>jsxRuntime.jsxs("li",{className:"flex items-start text-sm text-gray-600 dark:text-gray-300",children:[jsxRuntime.jsx("span",{className:"mr-2 mt-1.5 w-1 h-1 rounded-full bg-gray-400 dark:bg-gray-500 flex-shrink-0"}),jsxRuntime.jsx("span",{children:C})]},u))})]}),i&&c&&jsxRuntime.jsx("button",{onClick:c,className:"flex-shrink-0 ml-3 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors",children:jsxRuntime.jsx(lucideReact.X,{className:"w-4 h-4"})})]}),d&&jsxRuntime.jsx("div",{className:"bg-gray-50 dark:bg-gray-800/50 px-4 py-3 flex justify-end border-t border-gray-100 dark:border-gray-800",children:jsxRuntime.jsx("button",{onClick:d,className:"px-4 py-1.5 text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:focus:ring-offset-gray-900",children:l||"\u786E\u8BA4"})})]})},ds=Iw;var Mw=({title:e="\u76F8\u5173\u63A8\u8350",content:t,suggestions:o,onSuggestionClick:r,maxDisplay:a=5,icon:n,closable:i=false,onClose:c,className:d="",...l})=>{let[s,g]=Rt.useState(false),[f,m]=Rt.useState(""),[b,C]=Rt.useState(false),u=Rt.useMemo(()=>f.trim()?o.filter(h=>h.toLowerCase().includes(f.toLowerCase())):o,[o,f]),v=Rt.useMemo(()=>s?u:u.slice(0,a),[u,s,a]),p=h=>{r?.(h);};return !o||o.length===0?null:jsxRuntime.jsxs("div",{className:`w-full overflow-hidden rounded-lg border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 shadow-sm transition-all hover:shadow-md ${d}`,...l,children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-100 dark:border-gray-800 bg-blue-50/30 dark:bg-blue-900/10",children:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-2.5",children:[jsxRuntime.jsx("div",{className:"text-blue-500 flex-shrink-0",children:n||jsxRuntime.jsx(lucideReact.Lightbulb,{className:"w-5 h-5"})}),jsxRuntime.jsxs("div",{className:"flex flex-col",children:[jsxRuntime.jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100 leading-tight",children:e}),t&&jsxRuntime.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5",children:t})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-1",children:[o.length>3&&jsxRuntime.jsx("button",{onClick:()=>C(!b),className:`p-1.5 rounded-md transition-colors ${b?"bg-blue-100 dark:bg-blue-900/30 text-blue-600 dark:text-blue-400":"text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800"}`,title:b?"\u5173\u95ED\u641C\u7D22":"\u641C\u7D22\u95EE\u9898",children:jsxRuntime.jsx(lucideReact.Search,{className:"w-4 h-4"})}),i&&c&&jsxRuntime.jsx("button",{onClick:c,className:"text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 p-1.5 rounded-md hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors",title:"\u5173\u95ED",children:jsxRuntime.jsx(lucideReact.X,{className:"w-4 h-4"})})]})]}),b&&jsxRuntime.jsx("div",{className:"px-4 py-2 border-b border-gray-100 dark:border-gray-800 bg-gray-50 dark:bg-gray-900/50",children:jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("input",{type:"text",placeholder:"\u641C\u7D22\u76F8\u5173\u95EE\u9898...",value:f,onChange:h=>m(h.target.value),className:"w-full text-sm px-3 py-1.5 pl-8 rounded border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 focus:ring-1 focus:ring-blue-500 focus:border-blue-500 outline-none transition-shadow",autoFocus:true}),jsxRuntime.jsx(lucideReact.Search,{className:"absolute left-2.5 top-2 w-3.5 h-3.5 text-gray-400"})]})}),jsxRuntime.jsxs("div",{className:"p-2",children:[jsxRuntime.jsx("ul",{className:"space-y-1",children:v.map((h,y)=>jsxRuntime.jsx("li",{children:jsxRuntime.jsxs("button",{onClick:()=>p(h),className:"w-full text-left px-3 py-2 rounded-md text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 hover:text-blue-600 dark:hover:text-blue-400 transition-colors group flex items-start justify-between",children:[jsxRuntime.jsx("span",{children:h}),jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-4 h-4 text-gray-300 group-hover:text-blue-400 opacity-0 group-hover:opacity-100 transition-all transform group-hover:translate-x-0.5"})]})},y))}),u.length>a&&jsxRuntime.jsx("button",{onClick:()=>g(!s),className:"w-full text-center py-2 text-xs font-medium text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 transition-colors border-t border-gray-50 dark:border-gray-800/50 mt-1",children:s?"\u6536\u8D77":`\u67E5\u770B\u5168\u90E8 (${u.length})`}),u.length===0&&f&&jsxRuntime.jsx("div",{className:"text-center py-4 text-sm text-gray-500 dark:text-gray-400",children:"\u6CA1\u6709\u627E\u5230\u5339\u914D\u7684\u5EFA\u8BAE"})]})]})},us=Mw;var Nw=({title:e,content:t,toolName:o,parameters:r,result:a,status:n,duration:i,icon:c,closable:d=false,onClose:l,onAction:s,actionText:g,className:f="",...m})=>{let[b,C]=Rt.useState(false),[u,v]=Rt.useState(true),p=()=>{switch(n){case "pending":return {iconColor:"text-blue-500",badgeBg:"bg-blue-50 dark:bg-blue-900/30",badgeText:"text-blue-600 dark:text-blue-400",label:"\u6267\u884C\u4E2D"};case "error":return {iconColor:"text-red-500",badgeBg:"bg-red-50 dark:bg-red-900/30",badgeText:"text-red-600 dark:text-red-400",label:"\u5931\u8D25"};default:return {iconColor:"text-green-500",badgeBg:"bg-green-50 dark:bg-green-900/30",badgeText:"text-green-600 dark:text-green-400",label:"\u6210\u529F"}}},h=()=>{switch(n){case "pending":return jsxRuntime.jsx(lucideReact.Loader2,{className:"w-5 h-5 animate-spin"});case "error":return jsxRuntime.jsx(lucideReact.XCircle,{className:"w-5 h-5"});default:return jsxRuntime.jsx(lucideReact.CheckCircle,{className:"w-5 h-5"})}},y=P=>P?P<1e3?`${P}ms`:`${(P/1e3).toFixed(2)}s`:"",S=p(),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}`,...m,children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-100 dark:border-gray-800 bg-gray-50/50 dark:bg-gray-800/50",children:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-3",children:[jsxRuntime.jsx("div",{className:`flex-shrink-0 ${S.iconColor}`,children:c||h()}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100",children:E}),jsxRuntime.jsx("span",{className:`text-[10px] font-medium px-1.5 py-0.5 rounded ${S.badgeBg} ${S.badgeText}`,children:S.label})]}),o&&e&&jsxRuntime.jsxs("div",{className:"text-xs text-gray-500 dark:text-gray-400 flex items-center mt-0.5",children:[jsxRuntime.jsx(lucideReact.Terminal,{className:"w-3 h-3 mr-1"}),o]})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2 text-xs text-gray-500 dark:text-gray-400",children:[i&&jsxRuntime.jsxs("div",{className:"flex items-center bg-gray-100 dark:bg-gray-800 px-2 py-1 rounded",children:[jsxRuntime.jsx(lucideReact.Clock,{className:"w-3 h-3 mr-1"}),y(i)]}),d&&l&&jsxRuntime.jsx("button",{onClick:l,className:"text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors p-1 rounded",children:jsxRuntime.jsx(lucideReact.X,{className:"w-4 h-4"})})]})]}),jsxRuntime.jsxs("div",{className:"p-4",children:[t&&jsxRuntime.jsx("div",{className:"text-sm text-gray-600 dark:text-gray-300 mb-4 leading-relaxed",children:t}),r&&jsxRuntime.jsxs("div",{className:"mb-3",children:[jsxRuntime.jsxs("button",{onClick:()=>C(!b),className:"flex items-center text-xs font-medium text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300 mb-2",children:[b?jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3.5 h-3.5 mr-1"}):jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-3.5 h-3.5 mr-1"}),jsxRuntime.jsx(lucideReact.Box,{className:"w-3.5 h-3.5 mr-1.5"}),"\u8F93\u5165\u53C2\u6570"]}),b&&jsxRuntime.jsx("div",{className:"bg-gray-50 dark:bg-gray-950 rounded border border-gray-100 dark:border-gray-800 overflow-hidden",children:jsxRuntime.jsx("pre",{className:"p-3 text-xs font-mono text-gray-600 dark:text-gray-400 overflow-x-auto",children:JSON.stringify(r,null,2)})})]}),a&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("button",{onClick:()=>v(!u),className:"flex items-center text-xs font-medium text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300 mb-2",children:[u?jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3.5 h-3.5 mr-1"}):jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-3.5 h-3.5 mr-1"}),jsxRuntime.jsx(lucideReact.Terminal,{className:"w-3.5 h-3.5 mr-1.5"}),"\u6267\u884C\u7ED3\u679C"]}),u&&jsxRuntime.jsx("div",{className:"bg-gray-50 dark:bg-gray-950 rounded border border-gray-100 dark:border-gray-800 overflow-hidden",children:jsxRuntime.jsx("pre",{className:"p-3 text-xs font-mono text-gray-600 dark:text-gray-400 overflow-x-auto",children:typeof a=="string"?a:JSON.stringify(a,null,2)})})]}),s&&jsxRuntime.jsx("div",{className:"mt-3 pt-3 border-t border-gray-100 dark:border-gray-800 flex justify-end",children:jsxRuntime.jsx("button",{onClick:s,className:"px-4 py-1.5 text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:focus:ring-offset-gray-900",children:g||"\u6267\u884C\u64CD\u4F5C"})})]})]})},ps=Nw;var Ow=({data:e})=>{if(!e)return null;let t=Rt.useMemo(()=>{let o=[],r=[],a="\u6570\u636E\u8868\u683C";return Array.isArray(e)?(o=e,o.length>0&&(r=Object.keys(o[0]).map(n=>({id:n,label:n.charAt(0).toUpperCase()+n.slice(1),numeric:typeof o[0][n]=="number"})))):typeof e=="object"&&(a=e.title||a,o=Array.isArray(e.rows)?e.rows:Array.isArray(e.data)?e.data:[],Array.isArray(e.columns)?r=e.columns.map(i=>({id:i.key||i.id,label:i.title||i.label,numeric:i.dataType==="number"||i.numeric})):o.length>0&&(r=Object.keys(o[0]).map(i=>({id:i,label:i,numeric:typeof o[0][i]=="number"})))),o=o.map((n,i)=>({...n,id:n.id||`row_${i}`})),{title:a,columns:r,rows:o}},[e]);return t.rows.length===0?jsxRuntime.jsx("div",{className:"w-full my-4 p-4 border border-dashed border-gray-300 rounded text-center text-gray-500",children:"\u6682\u65E0\u8868\u683C\u6570\u636E"}):jsxRuntime.jsx("div",{className:"w-full my-4",children:jsxRuntime.jsx(Xr,{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]})})},ms=Ow;var jw=({title:e,subtitle:t,data:o,type:r,config:a={}})=>{let n=()=>{switch(r){case "bar-chart-card":return jsxRuntime.jsx(lucideReact.BarChart,{className:"w-4 h-4 text-blue-500"});case "line-chart-card":return jsxRuntime.jsx(lucideReact.LineChart,{className:"w-4 h-4 text-green-500"});case "pie-chart-card":return jsxRuntime.jsx(lucideReact.PieChart,{className:"w-4 h-4 text-purple-500"});case "combo-chart-card":return jsxRuntime.jsx(lucideReact.Activity,{className:"w-4 h-4 text-orange-500"});case "heatmap-chart-card":return jsxRuntime.jsx(lucideReact.Grid,{className:"w-4 h-4 text-red-500"});case "fishbone-chart-card":return jsxRuntime.jsx(lucideReact.GitBranch,{className:"w-4 h-4 text-indigo-500"});case "waterfall-chart-card":return jsxRuntime.jsx(lucideReact.TrendingDown,{className:"w-4 h-4 text-teal-500"});case "google-map-card":return jsxRuntime.jsx(lucideReact.Globe,{className:"w-4 h-4 text-blue-600"});case "amap-card":return jsxRuntime.jsx(lucideReact.MapPin,{className:"w-4 h-4 text-blue-600"});default:return jsxRuntime.jsx(lucideReact.BarChart,{className:"w-4 h-4"})}},i=()=>{if(!o&&r!=="google-map-card"&&r!=="amap-card")return jsxRuntime.jsx("div",{className:"text-gray-500 text-sm p-4 text-center",children:"No data available"});try{switch(r){case "bar-chart-card":return jsxRuntime.jsx(_n,{data:o,orientation:a.orientation||"horizontal",valueSuffix:a.valueSuffix||"",minHeight:a.minHeight});case "line-chart-card":return jsxRuntime.jsx(Iu,{data:o,color:a.color,valueSuffix:a.valueSuffix||"",height:a.height});case "pie-chart-card":let c=o.reduce((l,s)=>l+(Number(s.value)||0),0),d=o.map(l=>({name:l.name,value:Number(l.value)||0,percent:typeof l.percent=="number"?l.percent:c>0?(Number(l.value)||0)/c*100:0}));return jsxRuntime.jsx(Yi,{data:d,variant:a.variant||"donut",size:a.size,colors:a.colors});case "combo-chart-card":return jsxRuntime.jsx(Pu,{data:o,barColor:a.barColor,lineColor:a.lineColor});case "heatmap-chart-card":return jsxRuntime.jsx(Du,{data:o});case "fishbone-chart-card":return jsxRuntime.jsx(Au,{branches:o,effect:a.effect||e||"Problem"});case "waterfall-chart-card":return jsxRuntime.jsx(Eu,{data:o,height:a.height});case "google-map-card":return jsxRuntime.jsx(zu,{embedUrl:a.embedUrl||o&&o[0]?.embedUrl,apiKey:a.apiKey,query:a.query||o&&o[0]?.query||e,height:a.height});case "amap-card":return jsxRuntime.jsx(Hu,{embedUrl:a.embedUrl||o&&o[0]?.embedUrl,keyword:a.keyword||o&&o[0]?.keyword||e,height:a.height});default:return jsxRuntime.jsxs("div",{className:"text-gray-500 text-sm p-4 text-center",children:["Unsupported chart type: ",r]})}}catch(c){return console.error("Error rendering chart:",c),jsxRuntime.jsx("div",{className:"text-red-500 text-sm p-4 text-center",children:"Error rendering chart"})}};return jsxRuntime.jsxs("div",{className:"w-full overflow-hidden rounded-lg border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 shadow-sm transition-all hover:shadow-md",children:[jsxRuntime.jsxs("div",{className:"flex items-center px-4 py-3 border-b border-gray-100 dark:border-gray-800 bg-gray-50/50 dark:bg-gray-800/50",children:[jsxRuntime.jsx("div",{className:"mr-2 flex-shrink-0",children:n()}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100 truncate",children:e}),t&&jsxRuntime.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5 truncate",children:t})]})]}),jsxRuntime.jsxs("div",{className:"p-4",children:[jsxRuntime.jsx("div",{className:"overflow-x-auto",children:i()}),jsxRuntime.jsx("div",{className:"mt-3",children:jsxRuntime.jsxs("details",{className:"text-xs text-gray-500 dark:text-gray-400",children:[jsxRuntime.jsx("summary",{className:"cursor-pointer hover:text-gray-700 dark:hover:text-gray-300 transition-colors select-none font-medium opacity-60 hover:opacity-100",children:"View Raw Data"}),jsxRuntime.jsx("pre",{className:"mt-2 p-2 bg-gray-50 dark:bg-gray-950 rounded border border-gray-100 dark:border-gray-800 overflow-x-auto max-h-40",children:JSON.stringify(o,null,2)})]})})]})]})},gs=jw;var Xw=({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)})})})]}),hs=Xw;var bs=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 o1=({content:e,theme:t,size:o="base",className:r,enableCodeHighlight:a=true,enableMermaid:n=true,messageId:i,cardHooks:c})=>{let d=Rt.useMemo(()=>e?e.replace(/<think>([\s\S]*?)<\/think>/g,(f,m)=>`<div data-component="thinkbox" data-think-content="${encodeURIComponent(m.trim())}"></div>`):"",[e]),l=(f,m,b,C,u)=>{c?.onCardEvent?.({messageId:i,cardType:f,action:m,title:b,payload:C,rawData:u});},s=(f,m,b,C,u,v)=>{if(!(!u&&!c?.onCardEvent))return (...p)=>{let h=u?.(...p),y=v?v(...p):void 0;return l(f,m,b,y,C),h}},g=Rt.useMemo(()=>({div(f){let{"data-component":m,"data-think-content":b,...C}=f;return m==="thinkbox"&&b?jsxRuntime.jsx(Rg,{content:decodeURIComponent(b),theme:t,size:o,defaultExpanded:false}):jsxRuntime.jsx("div",{...C})},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:m}){return jsxRuntime.jsx("th",{className:`px-3 py-2 font-semibold text-gray-800 dark:text-gray-100 ${m==="center"?"text-center":m==="right"?"text-right":"text-left"}`,children:f})},td({children:f,align:m}){return jsxRuntime.jsx("td",{className:`px-3 py-2 text-gray-700 dark:text-gray-200 align-top ${m==="center"?"text-center":m==="right"?"text-right":"text-left"}`,children:f})},code({inline:f,className:m,children:b,...C}){let u=/language-([\w-]+)/.exec(m||""),v=u?u[1]:"";if(f)return jsxRuntime.jsx("code",{className:"font-mono text-sm bg-gray-100 dark:bg-gray-800 px-1 py-0.5 rounded text-red-600 dark:text-red-400",...C,children:b});let p=String(b).replace(/\n$/,"");if(n&&v==="mermaid")return jsxRuntime.jsx(Fg,{content:p});if(v==="json"){let h=bs(p);if(h)switch(h.type){case "table":return jsxRuntime.jsx(ms,{data:h.data});case "bar-chart-card":case "line-chart-card":case "pie-chart-card":case "combo-chart-card":case "heatmap-chart-card":case "fishbone-chart-card":case "waterfall-chart-card":case "google-map-card":case "amap-card":return jsxRuntime.jsx(gs,{...h});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return jsxRuntime.jsx(hs,{...h});case "error-card":{let y=h;return jsxRuntime.jsx(cs,{...y,onClose:s("error-card","close",y.title,y,y.onClose),onRetry:s("error-card","retry",y.title,y,y.onRetry)})}case "warning-card":{let y=h,S=y.onConfirm?s("warning-card","confirm",y.title,y,y.onConfirm):y.actionText&&c?.onCardEvent?s("warning-card","confirm",y.title,y):void 0;return jsxRuntime.jsx(ds,{...y,onClose:s("warning-card","close",y.title,y,y.onClose),onConfirm:S})}case "suggestions-card":{let y=h;return jsxRuntime.jsx(us,{...y,onClose:s("suggestions-card","close",y.title,y,y.onClose),onSuggestionClick:s("suggestions-card","suggestion-click",y.title,y,y.onSuggestionClick,S=>({suggestion:S}))})}case "tool-result-card":{let y=h;return jsxRuntime.jsx(ps,{...y,onClose:s("tool-result-card","close",y.title,y,y.onClose),onAction:s("tool-result-card","action",y.title,y,y.onAction)})}}}return a?jsxRuntime.jsx(Mg,{content:p,language:v,className:"not-prose"}):jsxRuntime.jsx("code",{className:m,...C,children:b})}}),[t,o,n,a,c,i]);return jsxRuntime.jsx("div",{className:Ge("markdown-body prose dark:prose-invert max-w-none",r),children:jsxRuntime.jsx(Yw__default.default,{remarkPlugins:[Qw__default.default,Jw__default.default],rehypePlugins:[e1__default.default,t1__default.default],components:g,children:d})})},ys=o1;var r1=({content:e,messageId:t,cardHooks:o})=>{let r=(i,c,d,l,s)=>{o?.onCardEvent?.({messageId:t,cardType:i,action:c,title:d,payload:l,rawData:s});},a=(i,c,d,l,s,g)=>{if(!(!s&&!o?.onCardEvent))return (...f)=>{let m=s?.(...f),b=g?g(...f):void 0;return r(i,c,d,b,l),m}},n=bs(e);if(n)switch(n.type){case "table":return jsxRuntime.jsx(ms,{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(gs,{...n});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return jsxRuntime.jsx(hs,{...n});case "error-card":{let i=n;return jsxRuntime.jsx(cs,{...i,onClose:a("error-card","close",i.title,i,i.onClose),onRetry:a("error-card","retry",i.title,i,i.onRetry)})}case "warning-card":{let i=n,c=i.onConfirm?a("warning-card","confirm",i.title,i,i.onConfirm):i.actionText&&o?.onCardEvent?a("warning-card","confirm",i.title,i):void 0;return jsxRuntime.jsx(ds,{...i,onClose:a("warning-card","close",i.title,i,i.onClose),onConfirm:c})}case "suggestions-card":{let i=n;return jsxRuntime.jsx(us,{...i,onClose:a("suggestions-card","close",i.title,i,i.onClose),onSuggestionClick:a("suggestions-card","suggestion-click",i.title,i,i.onSuggestionClick,c=>({suggestion:c}))})}case "tool-result-card":{let i=n;return jsxRuntime.jsx(ps,{...i,onClose:a("tool-result-card","close",i.title,i,i.onClose),onAction:a("tool-result-card","action",i.title,i,i.onAction)})}}return jsxRuntime.jsx("div",{className:"dynamic-card-fallback",children:jsxRuntime.jsx(ys,{content:e,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:t,cardHooks:o})})},Ug=r1;var Cd=class{static analyze(t){if(!t.trim())return {blocks:[],hasComplexContent:false,overallType:"simple"};let r=/```json\s*\{\s*"type":\s*"[^"]+"/g.test(t),a=/<[^>]+>[\s\S]*?<\/[^>]+>/.test(t),n=t.includes("NQ#")||t.includes("data-component");return r||a||n?{blocks:[{type:"mixed",content:t,startIndex:0,endIndex:t.length}],hasComplexContent:true,overallType:"complex"}:{blocks:[{type:"markdown",content:t,startIndex:0,endIndex:t.length}],hasComplexContent:false,overallType:"simple"}}},n1=({content:e,className:t="",messageId:o,cardHooks:r})=>{let a=Rt__namespace.default.useMemo(()=>Cd.analyze(e),[e]);return jsxRuntime.jsx("div",{className:`universal-content-renderer ${t}`,children:a.blocks.map((n,i)=>n.type==="mixed"||n.type==="json-card"?jsxRuntime.jsx(Ug,{content:n.content,messageId:o,cardHooks:r},`block-${i}`):jsxRuntime.jsx(ys,{content:n.content,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:o,cardHooks:r},`block-${i}`))})},Kg=n1;var i1=({content:e,isStreaming:t=true,onComplete:o,className:r="",streamIntervalMs:a=24,streamChunkSize:n=3,messageId:i,cardHooks:c})=>{let[d,l]=Rt.useState(t?0:e.length),[s,g]=Rt.useState(!t);Rt.useEffect(()=>{if(t){l(0),g(false);return}l(e.length),g(true);},[e,t]),Rt.useEffect(()=>{if(!t||s)return;if(d>=e.length){g(true),o?.();return}let u=window.setTimeout(()=>{l(v=>Math.min(v+n,e.length));},a);return ()=>{window.clearTimeout(u);}},[e.length,s,t,o,n,a,d]);let f=()=>{t&&!s&&(l(e.length),g(true),o?.());},m=t?e.slice(0,d):e,b=t&&!s,C=t&&!s;return jsxRuntime.jsxs("div",{className:`streaming-markdown ${r}`,onClick:f,style:{cursor:t?"pointer":"default"},children:[jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx(Kg,{content:m,messageId:i,cardHooks:c}),b&&jsxRuntime.jsx("span",{className:"inline-block w-0.5 h-5 bg-blue-500 ml-1 animate-pulse",style:{verticalAlign:"text-bottom"}})]}),C&&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"})]})},Zg=i1;var Xg=({buttons:e,className:t})=>{let o=r=>{switch(r){case "copy":return jsxRuntime.jsx(lucideReact.Copy,{size:14});case "refresh":return jsxRuntime.jsx(lucideReact.RefreshCw,{size:14});case "volume":return jsxRuntime.jsx(lucideReact.Volume2,{size:14});case "like":return jsxRuntime.jsx(lucideReact.ThumbsUp,{size:14});case "dislike":return jsxRuntime.jsx(lucideReact.ThumbsDown,{size:14});default:return null}};return jsxRuntime.jsx("div",{className:Ge("flex items-center gap-1",t),children:e.map((r,a)=>jsxRuntime.jsx("button",{onClick:r.onClick,disabled:r.disabled,className:Ge("p-1.5 rounded-md transition-colors","text-gray-500 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-100","hover:bg-gray-100 dark:hover:bg-gray-800","disabled:opacity-50 disabled:cursor-not-allowed",r.active&&"text-blue-600 bg-blue-50 dark:text-blue-400 dark:bg-blue-900/20",r.type==="refresh"&&r.disabled&&"animate-spin"),title:r.type,type:"button",children:o(r.type)},`${r.type}-${a}`))})};var xs=({message:e,onStreamingComplete:t,assistantActions:o,streamIntervalMs:r,streamChunkSize:a,cardHooks:n})=>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(Zg,{content:e.content,isStreaming:e.isStreaming??false,onComplete:t,streamIntervalMs:r,streamChunkSize:a,messageId:e.id,cardHooks:n}),e.content&&o?.isLatestAssistant&&jsxRuntime.jsx("div",{className:"flex flex-row justify-start gap-2 mt-3 pt-2 border-t border-gray-100 dark:border-gray-700",children:jsxRuntime.jsx(Xg,{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 Qg=({onTextUpdate:e,onComplete:t,onCancel:o,disabled:r,className:a})=>{let{isRecording:n,startRecording:i,stopRecording:c}=ss({onTextUpdate:e,onComplete:l=>{t?.(l);},onError:l=>{console.error("Voice input error:",l),o?.();}});return jsxRuntime.jsx("button",{onClick:async()=>{n?c():await i();},disabled:r,className:Ge("transition-all duration-200 flex items-center justify-center rounded-full",n?"bg-red-100 text-red-600 hover:bg-red-200 animate-pulse":"bg-transparent hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-500 dark:text-gray-400 active:scale-95",r&&"opacity-50 cursor-not-allowed",a),title:n?"Stop recording":"Start recording",type:"button",children:n?jsxRuntime.jsx(m1__default.default,{sx:{fontSize:24}}):jsxRuntime.jsx(p1__default.default,{sx:{fontSize:24}})})};var Dt={container:"w-full max-w-4xl mx-auto",inputContainer:Ge("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:Ge("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:Ge("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:Ge("bg-transparent hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-500 dark:text-gray-400","cursor-pointer active:scale-95"),sendButton:Ge("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:Ge("cursor-not-allowed opacity-40 bg-transparent text-gray-400"),stopButton:Ge("cursor-pointer bg-red-500 hover:bg-red-600 text-white shadow-sm active:scale-95")},C1={padding:0,lineHeight:"1.5",border:"none !important",boxShadow:"none !important",backgroundColor:"transparent",height:"auto",fontFeatureSettings:'"liga" 1, "kern" 1',WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},k1=({enabled:e,onClick:t})=>jsxRuntime.jsx("button",{className:Ge(Dt.buttonBase,Dt.buttonSmall,Dt.buttonNormal),onClick:t,disabled:!e,"aria-label":"Upload file",type:"button",children:jsxRuntime.jsx(x1__default.default,{sx:{fontSize:24}})}),S1=()=>jsxRuntime.jsxs("button",{className:Ge(Dt.buttonBase,"h-10 px-3 py-2 gap-1.5 rounded-full",Dt.buttonNormal),"aria-label":"Tools",type:"button",children:[jsxRuntime.jsx(v1__default.default,{sx:{fontSize:20}}),jsxRuntime.jsx("span",{className:"text-sm font-medium",children:"Tools"})]}),w1=({canSend:e,isResponding:t,onSend:o,onStop:r})=>t?jsxRuntime.jsx("button",{className:Ge(Dt.buttonBase,Dt.buttonSmall,Dt.stopButton),onClick:r,"aria-label":"Stop generating",type:"button",children:jsxRuntime.jsx(iconsMaterial.Stop,{sx:{fontSize:20}})}):jsxRuntime.jsx("button",{className:Ge(Dt.buttonBase,Dt.buttonSmall,e?Dt.sendButton:Dt.sendButtonDisabled),onClick:o,disabled:!e,"aria-label":"Send message",type:"button",children:jsxRuntime.jsx(y1__default.default,{sx:{fontSize:24},className:e?"text-gray-500 dark:text-gray-400":"text-gray-300 dark:text-gray-600"})}),Jg=({onSend:e,onStop:t,isResponding:o=false,placeholder:r,getText:a})=>{let[n,i]=Rt.useState(""),[c,d]=Rt.useState([]),[l,s]=Rt.useState(false),[g,f]=Rt.useState(false),m=Rt.useRef(null),b=r||(a?a("00019","Type a message..."):"Type a message..."),C=(n.trim().length>0||c.length>0)&&!o,u={enabled:true},v=Rt.useCallback(B=>{i(B.target.value),B.target.style.height="auto",B.target.style.height=`${Math.min(B.target.scrollHeight,200)}px`;},[]),p=Rt.useCallback(B=>{if(B.target.files&&B.target.files.length>0){let j=Array.from(B.target.files);d(W=>{let q=j.filter(le=>W.some(_=>_.name===le.name&&_.size===le.size));q.length>0&&console.warn("Duplicate files ignored:",q.map(le=>le.name));let ee=j.filter(le=>!W.some(_=>_.name===le.name&&_.size===le.size));return [...W,...ee]}),m.current&&(m.current.value="");}},[]),h=Rt.useCallback(B=>{d(j=>j.filter((W,q)=>q!==B));},[]),y=Rt.useCallback(()=>{m.current?.click();},[]),S=Rt.useCallback(async()=>{if(!C)return;let B=n,j=[...c];i(""),d([]),m.current&&(m.current.value="");try{await e(B,j);}catch(W){console.error("Failed to send message:",W),i(B),d(j);}},[n,C,e,c]),E=Rt.useCallback(B=>{B.key==="Enter"&&!B.shiftKey&&!l&&(B.preventDefault(),S());},[S,l]),P=Rt.useCallback(()=>{s(true);},[]),k=Rt.useCallback(()=>{s(false);},[]),R=Rt.useCallback(B=>{i(B);},[]),I=Rt.useCallback(B=>{i(B);},[]),w=Rt.useCallback(()=>{},[]),A=Rt.useCallback(B=>{B.preventDefault(),f(true);},[]),M=Rt.useCallback(B=>{B.preventDefault(),f(false);},[]),D=Rt.useCallback(B=>{if(B.preventDefault(),f(false),B.dataTransfer.files&&B.dataTransfer.files.length>0){let j=Array.from(B.dataTransfer.files);d(W=>[...W,...j]);}},[]);return jsxRuntime.jsx("div",{className:Dt.container,children:jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("input",{type:"file",multiple:true,className:"hidden",ref:m,onChange:p}),jsxRuntime.jsxs("div",{className:Ge(Dt.inputContainer,g&&Dt.dragActive),style:{borderRadius:"32px"},onDragOver:A,onDragLeave:M,onDrop:D,children:[c.length>0&&jsxRuntime.jsx("div",{className:Dt.filePreviewArea,children:c.map((B,j)=>jsxRuntime.jsxs("div",{className:Dt.fileTag,children:[jsxRuntime.jsx(iconsMaterial.InsertDriveFile,{sx:{fontSize:16},className:"text-blue-500"}),jsxRuntime.jsx("span",{className:"truncate max-w-[150px]",children:B.name}),jsxRuntime.jsx("button",{onClick:()=>h(j),className:"ml-1 hover:text-red-500 focus:outline-none",type:"button",children:jsxRuntime.jsx(iconsMaterial.Close,{sx:{fontSize:16}})})]},`${B.name}-${j}`))}),jsxRuntime.jsxs("div",{className:"flex flex-col w-full p-2",children:[jsxRuntime.jsx("div",{className:Ge(Dt.textareaWrapper,"px-3 pt-2 pb-3 min-h-[60px]"),children:jsxRuntime.jsx("textarea",{className:Ge(Dt.textarea,"min-h-[24px] py-0 px-0"),placeholder:b,value:n,onChange:v,onKeyDown:E,onCompositionStart:P,onCompositionEnd:k,style:C1,"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(k1,{enabled:u.enabled,onClick:y}),jsxRuntime.jsx(S1,{})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Qg,{onTextUpdate:R,onComplete:I,onCancel:w,disabled:o,className:Dt.buttonSmall}),jsxRuntime.jsx(w1,{canSend:C,isResponding:o,onSend:S,onStop:t})]})]})]})]})]})})};var of=({messages:e,onSend:t,onStop:o,onRegenerate:r,isResponding:a=false,className:n,placeholder:i,streamIntervalMs:c,streamChunkSize:d,onMessageStreamingComplete:l,cardHooks:s,showInput:g=true})=>{let f=Rt.useRef(null),m=Rt.useRef(e.length);return Rt.useEffect(()=>{e.length>m.current&&f.current?.scrollIntoView({behavior:"smooth"}),m.current=e.length;},[e]),jsxRuntime.jsxs("div",{className:Ge("flex flex-col h-full w-full relative",n),children:[jsxRuntime.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-4 space-y-6 scrollbar-thin scrollbar-thumb-gray-300 dark:scrollbar-thumb-gray-600",children:[e.map((b,C)=>{let u=b.type==="assistant"&&C===e.length-1,v=b.type==="assistant"?{isLatestAssistant:u,onRegenerate:r?()=>r(b.id):void 0}:void 0;return jsxRuntime.jsx(xs,{message:b,assistantActions:v,onStreamingComplete:()=>l?.(b.id),streamIntervalMs:c,streamChunkSize:d,cardHooks:s},b.id)}),jsxRuntime.jsx("div",{ref:f})]}),g&&jsxRuntime.jsx("div",{className:"p-4 bg-gradient-to-t from-white via-white to-transparent dark:from-gray-900 dark:via-gray-900 pb-8 z-10",children:jsxRuntime.jsx(Jg,{onSend:t||(async()=>{}),onStop:o||(()=>{}),isResponding:a,placeholder:i})})]})};var Fo={};var P1={idle:"Idle",running:"Running",success:"Success",error:"Error",pending:"Pending"},EV=({title:e="AI Agent",description:t,headerActions:o,className:r,agentStatus:a,showInput:n=false,...i})=>{let c=a??(i.isResponding?"running":"idle");return jsxRuntime.jsxs("div",{className:Ge("relative flex h-full w-full",Fo.agentPanel,r),"data-status":c,children:[jsxRuntime.jsx("div",{className:Fo.colorHalo,"data-status":c,"aria-hidden":"true"}),jsxRuntime.jsxs("div",{className:Fo.marqueeBorder,"data-status":c,"aria-hidden":"true",children:[jsxRuntime.jsx("span",{className:Ge(Fo.edge,Fo.top)}),jsxRuntime.jsx("span",{className:Ge(Fo.edge,Fo.right)}),jsxRuntime.jsx("span",{className:Ge(Fo.edge,Fo.bottom)}),jsxRuntime.jsx("span",{className:Ge(Fo.edge,Fo.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:Fo.statusDot,"data-status":c}),jsxRuntime.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-gray-600 dark:text-gray-300",children:P1[c]})]}),o]})]}),jsxRuntime.jsx("div",{className:"flex-1 min-h-0 relative z-10",children:jsxRuntime.jsx(of,{...i,showInput:n})})]})]})};var B1={"top-left":"bottom-right","top-right":"bottom-left","bottom-left":"top-right","bottom-right":"top-left"},WV=({messages:e,onSend:t,onRegenerate:o,isResponding:r=false,className:a,placeholder:n,title:i="Copilot",corner:c="bottom-right",onCollapse:d,onHeaderPointerDown:l,onPlusClick:s,onMicClick:g,streamIntervalMs:f,streamChunkSize:m,onMessageStreamingComplete:b,cardHooks:C})=>{let[u,v]=Rt.useState(""),[p,h]=Rt.useState(false),y=Rt.useRef(null),S=B1[c];Rt.useEffect(()=>{y.current?.scrollIntoView({behavior:"smooth"});},[e,r]);let E=Rt.useCallback(async()=>{let k=u.trim();!k||r||(v(""),await t(k));},[r,t,u]),P=Rt.useCallback(async k=>{k.key==="Enter"&&!p&&(k.preventDefault(),await E());},[E,p]);return jsxRuntime.jsxs("div",{className:Ge("relative flex h-full w-full min-h-[460px] min-w-[340px] flex-col overflow-hidden rounded-3xl border border-gray-200 bg-white shadow-none dark:border-gray-800 dark:bg-gray-900",a),children:[d&&jsxRuntime.jsx("button",{onClick:d,className:Ge("absolute z-20 flex h-10 w-10 items-center justify-center rounded-full transition-colors hover:bg-transparent dark:hover:bg-transparent",S==="top-left"&&"-left-2 -top-2",S==="top-right"&&"-right-2 -top-2",S==="bottom-left"&&"-bottom-2 -left-2",S==="bottom-right"&&"-bottom-2 -right-2"),type:"button","aria-label":"Collapse Copilot",children:jsxRuntime.jsx("span",{className:Ge("block h-4 w-4 border-[#21BCFF]",S==="top-left"&&"rounded-tl-full border-l-[3px] border-t-[3px]",S==="top-right"&&"rounded-tr-full border-r-[3px] border-t-[3px]",S==="bottom-left"&&"rounded-bl-full border-b-[3px] border-l-[3px]",S==="bottom-right"&&"rounded-br-full border-b-[3px] border-r-[3px]")})}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between border-b border-gray-100 px-4 py-3 dark:border-gray-800",onPointerDown:l,children:[jsxRuntime.jsx("div",{className:"flex items-center",children:jsxRuntime.jsx("h3",{className:"text-base font-semibold tracking-tight text-gray-900 dark:text-gray-100",children:i})}),jsxRuntime.jsx("div",{})]}),jsxRuntime.jsxs("div",{className:"flex-1 overflow-y-auto px-3 py-3 space-y-5 scrollbar-thin scrollbar-thumb-gray-300 dark:scrollbar-thumb-gray-600",children:[e.map((k,R)=>{let I=k.type==="assistant"&&R===e.length-1,w=k.type==="assistant"?{isLatestAssistant:I,onRegenerate:o?()=>o(k.id):void 0}:void 0;return jsxRuntime.jsx(xs,{message:k,assistantActions:w,onStreamingComplete:()=>b?.(k.id),streamIntervalMs:f,streamChunkSize:m,cardHooks:C},k.id)}),jsxRuntime.jsx("div",{ref:y})]}),jsxRuntime.jsx("div",{className:"border-t border-gray-100 px-3 py-3 dark:border-gray-800",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-2 rounded-xl border border-blue-300/80 bg-white px-2 py-1.5 dark:bg-gray-900",children:[jsxRuntime.jsx("button",{className:"flex h-8 w-8 items-center justify-center rounded-full text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-700 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-gray-200",onClick:s,type:"button","aria-label":"Add",children:jsxRuntime.jsx(lucideReact.Plus,{className:"h-4 w-4"})}),jsxRuntime.jsx("input",{className:"h-7 flex-1 border-none bg-transparent text-sm text-gray-800 outline-none placeholder:text-gray-400 dark:text-gray-100 dark:placeholder:text-gray-500",placeholder:n||"Ask Copilot...",value:u,onChange:k=>v(k.target.value),onCompositionStart:()=>h(true),onCompositionEnd:()=>h(false),onKeyDown:P,"aria-label":"Copilot input",spellCheck:false}),jsxRuntime.jsx("button",{className:"flex h-8 w-8 items-center justify-center rounded-full text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-700 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-gray-200",onClick:g,type:"button","aria-label":"Microphone",children:jsxRuntime.jsx(lucideReact.Mic,{className:"h-4 w-4"})})]})})]})};var E1=["#ff3860","#24e070","#3090ff"],F1=`
189
+ `),f={enableMath:a},p=0;for(;p<g.length;){let b=g[p],v=b.trim();if(!v){p+=1;continue}if(n&&$p(b)){if(v.startsWith("<think>")){let m=[],h=b;for(;;){let y=h.indexOf("<think>"),k=y>=0?h.slice(y+7):h,E=k.indexOf("</think>");if(E>=0){m.push(k.slice(0,E)),p+=1;break}if(m.push(k),p+=1,p>=g.length)break;h=g[p];}l.push(jsxRuntime.jsx(Dl,{content:m.join(`
190
+ `).trim()},`think-tag-${p}`));continue}p+=1;let w=[];for(;p<g.length&&g[p].trim()!==":::";)w.push(g[p]),p+=1;p<g.length&&g[p].trim()===":::"&&(p+=1),l.push(jsxRuntime.jsx(Dl,{content:w.join(`
191
+ `).trim()},`think-fence-${p}`));continue}if(Al(b)){let w=v.slice(3).trim().toLowerCase(),m=[];for(p+=1;p<g.length&&!Al(g[p]);)m.push(g[p]),p+=1;p<g.length&&Al(g[p])&&(p+=1);let h=m.join(`
192
+ `);if(r&&w==="mermaid"){l.push(jsxRuntime.jsx(Rc,{code:h},`mermaid-${p}`));continue}if(a&&["math","latex","katex"].includes(w)){l.push(jsxRuntime.jsx(ci,{expression:h,allowKatex:true},`math-fence-${p}`));continue}l.push(jsxRuntime.jsx(si,{code:h,language:w||"text",copyable:i,showLineNumbers:c,wrapLongLines:true},`code-${p}`));continue}if(a&&v.startsWith("$$")){let w=[];if(v.endsWith("$$")&&v!=="$$")w.push(v.slice(2,-2)),p+=1;else {let h=b.slice(b.indexOf("$$")+2);for(h.trim()&&w.push(h),p+=1;p<g.length;){let y=g[p],k=y.indexOf("$$");if(k>=0){w.push(y.slice(0,k)),p+=1;break}w.push(y),p+=1;}}l.push(jsxRuntime.jsx(ci,{expression:w.join(`
193
+ `).trim(),allowKatex:true},`math-${p}`));continue}if(Op(b)){let w=Math.min(6,b.match(/^#{1,6}/)?.[0]?.length||1),m=b.replace(/^#{1,6}\s+/,""),h=w===1?"h5":w===2?"h6":"subtitle1";l.push(jsxRuntime.jsx(material.Typography,{variant:h,sx:{mt:w===1?1.2:.8,mb:.5,fontWeight:700},children:pi(m,f,`h-${p}`)},`heading-${p}`)),p+=1;continue}if(Hp(b)){l.push(jsxRuntime.jsx(material.Divider,{sx:{my:1.2}},`hr-${p}`)),p+=1;continue}if(Wp(g,p)){let w=p+2;for(;w<g.length&&g[w].trim()&&g[w].includes("|");)w+=1;let m=g.slice(p,w).join(`
194
+ `),h=Rl(m);if(h){l.push(jsxRuntime.jsx(Dc,{table:h},`table-${p}`)),p=w;continue}}if(Lc(b)){let w=[];for(;p<g.length&&Lc(g[p]);)w.push(g[p].replace(/^\s*>\s?/,"")),p+=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:w.map((m,h)=>jsxRuntime.jsxs(Et.Fragment,{children:[h>0&&jsxRuntime.jsx("br",{}),pi(m,f,`q-${p}-${h}`)]},`quote-line-${h}`))})},`quote-${p}`));continue}if(Ec(b)){let w=[];for(;p<g.length&&Ec(g[p]);)w.push(g[p].trim().replace(/^[-*+]\s+/,"")),p+=1;l.push(jsxRuntime.jsx(material.Box,{component:"ul",sx:{my:.8,pl:2.5},children:w.map((m,h)=>jsxRuntime.jsx(material.Box,{component:"li",sx:{mb:.45},children:jsxRuntime.jsx(material.Typography,{variant:"body2",children:pi(m,f,`ul-${p}-${h}`)})},`ul-item-${h}`))},`ul-${p}`));continue}if(Fc(b)){let w=[];for(;p<g.length&&Fc(g[p]);)w.push(g[p].trim().replace(/^\d+\.\s+/,"")),p+=1;l.push(jsxRuntime.jsx(material.Box,{component:"ol",sx:{my:.8,pl:2.7},children:w.map((m,h)=>jsxRuntime.jsx(material.Box,{component:"li",sx:{mb:.45},children:jsxRuntime.jsx(material.Typography,{variant:"body2",children:pi(m,f,`ol-${p}-${h}`)})},`ol-item-${h}`))},`ol-${p}`));continue}let u=[];for(;p<g.length;){let w=g[p],m=w.trim();if(!m||Al(w)||Op(w)||Hp(w)||Ec(w)||Fc(w)||Lc(w)||Wp(g,p)||n&&$p(w)||a&&m.startsWith("$$"))break;u.push(w),p+=1;}u.length>0?l.push(jsxRuntime.jsx(material.Typography,{variant:"body2",sx:{my:.65,lineHeight:1.65},children:u.map((w,m)=>jsxRuntime.jsxs(Et.Fragment,{children:[m>0&&jsxRuntime.jsx("br",{}),pi(w,f,`p-${p}-${m}`)]},`p-line-${m}`))},`p-${p}`)):p+=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 lB=(e,t)=>jsxRuntime.jsx(mi,{markdown:e,...t});var Kp=({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(au__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(Ry__default.default,{sx:{fontSize:d?16:18}})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:o,disabled:c||!e.trim(),children:jsxRuntime.jsx(Dy__default.default,{sx:{fontSize:d?16:18}})})]}),s&&i&&jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",children:i})]});var qp=(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)]})},Bl=({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:qp(a.label,t)}),jsxRuntime.jsx(material.Typography,{component:"div",variant:"body2",sx:{mt:.2,fontWeight:500,wordBreak:"break-word"},children:r?qp(r,t):a.value})]},a.id)})})]})};var Hc=e=>e==null?"":typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):"",Fl=e=>e.trim().toLowerCase(),nv=(e,t)=>{let o=[];return e.forEach(a=>{a.fields.forEach(r=>{let n=r.searchableText||Hc(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:Fl(`${a.title} ${r.label} ${n}`)});});}),t.forEach(a=>{(a.fields||[]).forEach(r=>{let n=r.searchableText||Hc(r.value),i={source:"tab",sourceId:a.id,sourceTitle:a.label,fieldId:r.id,fieldLabel:r.label,fieldValue:n};o.push({hit:i,text:Fl(`${a.label} ${r.label} ${n}`)});}),(a.sections||[]).forEach(r=>{r.fields.forEach(n=>{let i=n.searchableText||Hc(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:Fl(`${a.label} ${r.title} ${n.label} ${i}`)});});});}),o},_p=({sections:e,tabs:t=[],defaultTabId:o,ai:a})=>{let{t:r}=re(),[n,i]=Et.useState(""),[c,d]=Et.useState(o||t[0]?.id),[s,l]=Et.useState("idle"),[g,f]=Et.useState([]),[p,b]=Et.useState(""),[v,u]=Et.useState(""),[w,m]=Et.useState(false),h=Et.useMemo(()=>nv(e,t),[e,t]);Et.useEffect(()=>{if(t.length===0){d(void 0);return}t.some(I=>I.id===c)||d(o||t[0]?.id);},[t,c,o]);let y=Et.useCallback(()=>{l("idle"),f([]),b(""),u("");},[]),k=Et.useCallback(C=>{i(C),C.trim()||(l("idle"),f([]),b(""),u(""));},[]),E=Et.useCallback(C=>{let I=Fl(C);return I?h.filter(T=>T.text.includes(I)).map(T=>T.hit):[]},[h]),R=Et.useCallback(async()=>{let C=n.trim();if(!C)return;m(true);let I=E(C);if(f(I),I.length>0){l("search"),u(""),b(r("detail.searchAi.matches",{count:I.length})),m(false);return}if(a?.enabled!==false&&a?.onSubmit){l("ai"),b(r("detail.searchAi.autoAiFallback"));try{let S=await a.onSubmit(C,{query:C,hits:I,activeTabId:c,sections:e,tabs:t});u(typeof S=="string"?S:"");}finally{m(false);}return}l("search"),u(""),b(r("detail.searchAi.noMatch")),m(false);},[n,E,r,a,c,e,t]);return {query:n,setQuery:k,activeTabId:c,setActiveTabId:d,searchMode:s,hits:g,statusText:p,aiResponse:v,searching:w,handleSubmit:R,clearResult:y}};var VB=({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}=re(),{query:f,setQuery:p,activeTabId:b,setActiveTabId:v,searchMode:u,hits:w,statusText:m,aiResponse:h,searching:y,handleSubmit:k,clearResult:E}=_p({sections:o,tabs:a,defaultTabId:r,ai:i}),R=Et.useMemo(()=>a.find(T=>T.id===b)||a[0],[a,b]),C=Et.useCallback(T=>{let S=A=>{let M=document.getElementById(T);if(M){M.scrollIntoView({behavior:"smooth",block:"center"});return}A<4&&setTimeout(()=>S(A+1),60);};requestAnimationFrame(()=>S(0));},[]),I=Et.useCallback((T,S)=>{if(a.some(A=>A.id===T)){v(T),C(S?`detail-tab-${T}-section-${S}`:`detail-tab-${T}`);return}C(`detail-section-${T}`);},[a,v,C]);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(Kp,{value:f,onChange:p,onSubmit:k,onVoiceInput:i?.onVoiceInput,onClear:()=>{p(""),E();},placeholder:i?.placeholder||g("detail.searchAi.placeholder"),statusText:m,loading:y,compact:true,showStatusText:false})}),s&&jsxRuntime.jsx(material.Tooltip,{title:l,children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:s,children:jsxRuntime.jsx(uv__default.default,{fontSize:"small"})})}),c]})]}),m&&jsxRuntime.jsx(material.Typography,{variant:"caption",color:"text.secondary",sx:{mt:-0.7},children:m}),u==="search"&&w.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:w.length})}),jsxRuntime.jsx(material.Stack,{spacing:.35,children:w.slice(0,8).map(T=>jsxRuntime.jsx(material.Box,{component:"button",type:"button",onClick:()=>I(T.sourceId,T.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:T.sourceTitle})," \xB7 ",jsxRuntime.jsx(material.Box,{component:"span",sx:{fontWeight:700},children:T.fieldLabel})," = ",jsxRuntime.jsx(material.Box,{component:"span",children:T.fieldValue||"-"})]})},`${T.source}|${T.sourceId}|${T.fieldId}`))})]}),u==="ai"&&h&&jsxRuntime.jsxs(material.Paper,{variant:"outlined",sx:{p:1.5,borderRadius:2},children:[jsxRuntime.jsx(material.Typography,{variant:"subtitle2",sx:{fontWeight:700,mb:.7},children:g("detail.searchAi.aiResultTitle")}),jsxRuntime.jsx(material.Box,{sx:{fontSize:"0.9rem",lineHeight:1.6,"& p":{m:0,mb:.8},"& h1, & h2, & h3, & h4":{mt:1.2,mb:.6,lineHeight:1.3},"& ul, & ol":{mt:.4,mb:.8,pl:2.6},"& code":{px:.5,py:.1,borderRadius:.8,bgcolor:"action.hover",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},"& pre":{m:0,mt:.8,mb:.8,p:1.1,borderRadius:1.2,bgcolor:"action.hover",overflowX:"auto"},"& pre code":{p:0,bgcolor:"transparent"}},children:jsxRuntime.jsx(mi,{markdown:h})})]}),jsxRuntime.jsx(material.Box,{sx:{display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",lg:"repeat(2, minmax(0, 1fr))"}},children:o.map(T=>jsxRuntime.jsx(material.Box,{id:`detail-section-${T.id}`,children:jsxRuntime.jsx(Bl,{section:T,highlightQuery:f})},T.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:(T,S)=>v(S),variant:"scrollable",scrollButtons:"auto",sx:{borderBottom:"1px solid",borderColor:"divider"},children:a.map(T=>jsxRuntime.jsx(material.Tab,{value:T.id,label:T.label,sx:{textTransform:"none"}},T.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(T=>jsxRuntime.jsx(material.Box,{id:`detail-tab-${R?.id}-section-${T.id}`,children:jsxRuntime.jsx(Bl,{section:T,highlightQuery:f})},T.id)),R?.fields&&R.fields.length>0&&jsxRuntime.jsx(Bl,{section:{id:`${R.id}-fields`,title:R.label,fields:R.fields,columns:2},highlightQuery:f})]})]})]}),n&&jsxRuntime.jsx(Qa,{title:n.title||g("detail.table.title"),...n.tableProps,filterConfig:void 0,fitContainer:false})]})};var Yp=({bucket:e,cardCount:t,highlighted:o=false,children:a,emptyLabel:r,maxHeight:n,sx:i})=>{let{t:c}=re();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 hv={success:"success",warning:"warning",info:"info",error:"error"},bv={critical:"error",high:"warning",medium:"info",low:"success"},yv=(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}},xv=e=>e?e.split(/\s+/).map(t=>t.charAt(0).toUpperCase()).slice(0,2).join(""):"NA",$c=({card:e,bucket:t,dragging:o=false,overlay:a=false,onClick:r,sx:n})=>{let{t:i}=re(),c=!!(r&&t),d=e.tone??(e.priority?bv[e.priority]:"default"),s=d==="default"?"primary":hv[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:yv(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??xv(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 Cv=(e,t)=>Number.isNaN(e)||e<0?0:e>t?t:e,em=({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}})}},ta=(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}}},Nl=(e,t)=>{let o=ta(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=Cv(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 Gc="kanban-card|",Uc="kanban-bucket|",rm=e=>`${Gc}${e}`,Fv=e=>`${Uc}${e}`,Vl=e=>e?.startsWith(Gc)?e.slice(Gc.length):void 0,am=e=>e?.startsWith(Uc)?e.slice(Uc.length):void 0,Lv=({card:e,bucket:t,onCardClick:o})=>{let{setNodeRef:a,attributes:r,listeners:n,transform:i,transition:c,isDragging:d}=sortable.useSortable({id:rm(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($c,{card:e,bucket:t,dragging:d,onClick:o})})},zv=({bucket:e,highlighted:t,bucketMaxHeight:o,emptyBucketLabel:a,onCardClick:r})=>{let{isOver:n,setNodeRef:i}=core.useDroppable({id:Fv(e.id)});return jsxRuntime.jsx(material.Box,{ref:i,sx:{minWidth:0},children:jsxRuntime.jsx(Yp,{bucket:e,cardCount:e.cards.length,highlighted:t||n,emptyLabel:a,maxHeight:o,children:jsxRuntime.jsx(sortable.SortableContext,{items:e.cards.map(c=>rm(c.id)),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:1,children:e.cards.map(c=>jsxRuntime.jsx(Lv,{card:c,bucket:e,onCardClick:r},c.id))})})})})},n5=({model:e,onCardMove:t,onCardClick:o,minBucketWidth:a=320,bucketMaxHeight:r,emptyBucketLabel:n,sx:i})=>{let[c,d]=Et.useState(null),[s,l]=Et.useState(),g=core.useSensors(core.useSensor(core.PointerSensor,{activationConstraint:{distance:6}}),core.useSensor(core.TouchSensor,{activationConstraint:{delay:120,tolerance:8}})),f=Et.useMemo(()=>c?ta(e,c):void 0,[c,e]),p=Et.useCallback(()=>{d(null),l(void 0);},[]),b=Et.useCallback(m=>{if(!m)return;let h=Vl(m);return h?ta(e,h)?.bucket.id:am(m)},[e]),v=Et.useCallback(m=>{d(Vl(String(m.active.id))??null);},[]),u=Et.useCallback(m=>{l(b(m.over?String(m.over.id):void 0));},[b]),w=Et.useCallback(m=>{let h=Vl(String(m.active.id)),y=m.over?String(m.over.id):void 0;if(!h||!y){p();return}let k=ta(e,h);if(!k){p();return}let E=k.bucket.id,R=k.cardIndex,C=Vl(y);if(C){let S=ta(e,C);if(!S){p();return}E=S.bucket.id,R=S.cardIndex;}else {let S=am(y),A=e.buckets.find(M=>M.id===S);if(!S||!A){p();return}E=S,R=A.cards.length;}if(k.bucket.id===E&&k.cardIndex===R){p();return}let I=Nl(e,{cardId:h,fromBucketId:k.bucket.id,toBucketId:E,targetIndex:R}),T=ta(I,h);T&&!(T.bucket.id===k.bucket.id&&T.cardIndex===k.cardIndex)&&t?.({cardId:h,fromBucketId:k.bucket.id,toBucketId:T.bucket.id,targetIndex:T.cardIndex,card:T.card,model:I}),p();},[e,t,p]);return jsxRuntime.jsxs(core.DndContext,{sensors:g,collisionDetection:core.closestCorners,onDragStart:v,onDragOver:u,onDragEnd:w,onDragCancel:p,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(zv,{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($c,{card:f.card,bucket:f.bucket,overlay:true})}):null})]})};var Hv=({initialModel:e,initialBuckets:t,initialCards:o})=>e||em({buckets:t??[],cards:o??[]}),d5=e=>{let{onCardMove:t,onCardClick:o}=e,[a,r]=Et.useState(()=>Hv(e)),n=Et.useCallback(l=>{r(g=>typeof l=="function"?l(g):l);},[]),i=Et.useCallback(l=>ta(a,l),[a]),c=Et.useCallback((l,g,f)=>{let p=ta(a,l);if(!p)return;let b=Nl(a,{cardId:l,fromBucketId:p.bucket.id,toBucketId:g,targetIndex:f}),v=ta(b,l);if(!v||v.bucket.id===p.bucket.id&&v.cardIndex===p.cardIndex)return;r(b);let u={cardId:l,fromBucketId:p.bucket.id,toBucketId:v.bucket.id,targetIndex:v.cardIndex,card:v.card,model:b};return t?.(u),u},[a,t]),d=Et.useCallback((l,g)=>{r(f=>({buckets:f.buckets.map(p=>({...p,cards:p.cards.map(b=>b.id!==l?b:typeof g=="function"?g(b):{...b,...g})}))}));},[]),s=Et.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 sm=64,tC="#E9EDF2",oC="linear-gradient(90deg, #F5F7FA 0%, #E9EDF2 50%, #F5F7FA 100%)",aC=["en","zh","fr","de","ja","ko"],cm={en:"EN",zh:"\u4E2D\u6587",fr:"FR",de:"DE",ja:"\u65E5\u672C\u8A9E",ko:"\uD55C\uAD6D\uC5B4"},$l=({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:p,leftSlot:b,rightSlot:v})=>{let{t:u,locale:w}=re(),h=material.useTheme().palette.mode==="dark",[y,k]=Et.useState(""),[E,R]=Et.useState(null),[C,I]=Et.useState(null),T=$=>{$.preventDefault(),s&&s(y.trim());},S=o==="system"?jsxRuntime.jsx(Xv__default.default,{fontSize:"small"}):o==="dark"?jsxRuntime.jsx(Yv__default.default,{fontSize:"small"}):jsxRuntime.jsx(Qv__default.default,{fontSize:"small"}),A=u(o==="system"?"header.theme.system":o==="dark"?"header.theme.dark":"header.theme.light"),M=r||w,D=i&&i.length>0?i:aC,B=n||cm[M]||M.toUpperCase(),Z=!!E,O=d||u("header.searchPlaceholder"),K=!!C,te=[{key:"setting",label:u("header.menu.setting"),icon:jsxRuntime.jsx(Tx__default.default,{sx:{fontSize:18}}),onClick:g},{key:"logout",label:u("header.menu.logout"),icon:jsxRuntime.jsx(eC__default.default,{sx:{fontSize:18}}),onClick:f}],se=p&&p.length>0?p:te,_=$=>{I(null),$?.();};return jsxRuntime.jsxs(material.AppBar,{position:"sticky",elevation:0,sx:$=>({top:0,zIndex:$.zIndex.drawer+10,height:sm,backgroundColor:$.palette.mode==="dark"?"#0D0D0D":tC,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%)",oC,"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:`${sm}px !important`,px:2,gap:2},children:[jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:1.5,sx:{minWidth:220},children:[b,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:h?"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:T,sx:{width:"100%",maxWidth:540},children:jsxRuntime.jsx(material.TextField,{size:"small",fullWidth:true,value:y,onChange:$=>k($.target.value),placeholder:O,InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(au__default.default,{sx:{color:h?"rgba(255,255,255,0.7)":"rgba(15,23,42,0.55)",fontSize:18}})}),sx:{color:h?"common.white":"rgba(17,24,39,0.9)",bgcolor:h?"rgba(255,255,255,0.08)":"#ffffff",borderRadius:999,"& .MuiOutlinedInput-notchedOutline":{borderColor:h?"rgba(255,255,255,0.15)":"rgba(15,23,42,0.2)"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:h?"rgba(255,255,255,0.35)":"rgba(15,23,42,0.35)"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:h?"rgba(255,255,255,0.5)":"rgba(15,23,42,0.55)"}}},inputProps:{style:{color:h?"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:h?"common.white":"#111827",borderRadius:1,px:.5},children:jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:.45,children:[jsxRuntime.jsx(lm__default.default,{sx:{fontSize:18}}),jsxRuntime.jsx(material.Typography,{variant:"caption",sx:{fontWeight:500},children:B})]})}),jsxRuntime.jsx(material.Menu,{anchorEl:E,open:Z,onClose:()=>R(null),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:D.map($=>jsxRuntime.jsx(material.MenuItem,{selected:$===M,onClick:()=>{c($),R(null);},sx:{fontSize:"0.82rem"},children:cm[$]},$))})]}):jsxRuntime.jsxs(material.Stack,{direction:"row",alignItems:"center",spacing:.5,children:[jsxRuntime.jsx(lm__default.default,{sx:{color:h?"common.white":"#111827",fontSize:18}}),jsxRuntime.jsx(material.Typography,{variant:"caption",sx:{color:h?"common.white":"#111827",fontWeight:500},children:B})]}),jsxRuntime.jsx(material.IconButton,{size:"small",sx:{color:h?"common.white":"#111827"},onClick:a,title:A,children:S}),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:h?"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:h?"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:$=>I($.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()})})]}),v]})]}),l&&jsxRuntime.jsx(material.Menu,{anchorEl:C,open:K,onClose:()=>I(null),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},slotProps:{paper:{sx:{minWidth:160,"& .MuiMenuItem-root":{minHeight:34,py:.5,px:1.25}}}},children:se.map($=>jsxRuntime.jsxs(material.MenuItem,{disabled:$.disabled,onClick:()=>_($.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 dm=({menuData:e=[],initialNavigationCollapsed:t=false,initialNavigationMode:o="fixed"}={})=>{let{navigationIslandProps:a}=Xd({initialCollapsed:t,initialDisplayMode:o,content:e}),[r,n]=Et.useState(900);Et.useEffect(()=>{let c=()=>n(window.innerHeight);return c(),window.addEventListener("resize",c),()=>window.removeEventListener("resize",c)},[]);let i=Et.useMemo(()=>Math.max(280,r-100),[r]);return {navigationIslandProps:a,navigationMaxHeight:i}};var $o=12,mm=56,gm=234,Gl=(e,t,o)=>Math.min(Math.max(e,t),Math.max(t,o)),dC=e=>e instanceof HTMLElement?!!e.closest('button,input,a,textarea,select,[role="button"],[contenteditable="true"]'):false,F5=({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:p,rightHeaderSlot:b,leftHeaderSlot:v,contentSx:u,navigationMode:w,defaultNavigationMode:m="fixed",onNavigationModeChange:h,showNavigationModeToggle:y=true})=>{let k="orbcafe:page-layout-mode",E="orbcafe:page-layout-navigation-mode",[R,C]=Et.useState("system"),[I,T]=Et.useState("light"),[S,A]=Et.useState(false),[M,D]=Et.useState(false),[B,Z]=Et.useState(m),[O,K]=Et.useState({x:$o,y:$o}),[te,se]=Et.useState("left"),[_,$]=Et.useState(false),ue=Et.useRef(null),Re=Et.useRef(null),Ae=w!==void 0,ae=w??B,ve=ae==="floating",Pe=R==="system"?S?I:"light":R;Et.useEffect(()=>{try{let pe=window.localStorage.getItem(k);(pe==="light"||pe==="dark"||pe==="system")&&C(pe);}catch{}A(true);let Y=window.matchMedia("(prefers-color-scheme: dark)"),J=()=>{T(Y.matches?"dark":"light");};return J(),Y.addEventListener("change",J),()=>Y.removeEventListener("change",J)},[]),Et.useEffect(()=>{if(S)try{window.localStorage.setItem(k,R);}catch{}},[S,R]),Et.useEffect(()=>{if(Ae){D(true);return}try{let Y=window.localStorage.getItem(E);(Y==="fixed"||Y==="floating")&&Z(Y);}catch{}finally{D(true);}},[Ae]),Et.useEffect(()=>{if(M)try{window.localStorage.setItem(E,ae);}catch{}},[ae,M]),Et.useEffect(()=>{Pe==="dark"?(document.documentElement.classList.add("dark"),document.documentElement.style.colorScheme="dark"):(document.documentElement.classList.remove("dark"),document.documentElement.style.colorScheme="light");},[Pe]);let lt=Et.useMemo(()=>material.createTheme({palette:{mode:Pe}}),[Pe]),Xe=Et.useCallback(Y=>{Ae||Z(Y),h?.(Y);},[Ae,h]),{navigationIslandProps:Le,navigationMaxHeight:$e}=dm({menuData:t,initialNavigationCollapsed:false,initialNavigationMode:ae}),Ne=Le.collapsed,j=Et.useCallback(Y=>{let J=ue.current,pe=J?.parentElement;if(!J||!pe)return Y;let qe=pe.getBoundingClientRect(),_e=J.getBoundingClientRect(),ut=$o,pt=$o,at=Math.max(ut,qe.width-_e.width-$o),Dt=Math.max(pt,qe.height-_e.height-$o);return {x:Gl(Y.x,ut,at),y:Gl(Y.y,pt,Dt)}},[]),de=Et.useCallback(Y=>{let J=ue.current,pe=J?.parentElement;if(!J||!pe)return Y;let qe=pe.getBoundingClientRect(),_e=J.getBoundingClientRect(),ut=$o,pt=$o,at=Math.max(ut,qe.width-_e.width-$o),Dt=Math.max(pt,qe.height-_e.height-$o),rt={x:Gl(Y.x,ut,at),y:Gl(Y.y,pt,Dt)},Ie=[{distance:Math.abs(rt.x-ut),position:{x:ut,y:rt.y}},{distance:Math.abs(rt.x-at),position:{x:at,y:rt.y}},{distance:Math.abs(rt.y-pt),position:{x:rt.x,y:pt}},{distance:Math.abs(rt.y-Dt),position:{x:rt.x,y:Dt}}].reduce((mt,je)=>je.distance<mt.distance?je:mt).position;return se(Ie.x>=(ut+at)/2?"right":"left"),Ie},[]),De=Et.useMemo(()=>{if(!ve||_)return O.x;if(te==="right"){let pe=ue.current?.parentElement?.getBoundingClientRect().width,qe=Ne?mm:gm;return pe?Math.max($o,pe-qe-$o):Ne?O.x:O.x-(gm-mm)}return O.x},[te,O.x,_,ve,Ne]),Ve=Et.useCallback(Y=>{if(!ve||!Ne||dC(Y.target))return;Y.preventDefault(),Y.currentTarget.setPointerCapture(Y.pointerId);let J=j({x:De,y:O.y});se("left"),K(J),Re.current={pointerId:Y.pointerId,startClientX:Y.clientX,startClientY:Y.clientY,startX:J.x,startY:J.y,currentX:J.x,currentY:J.y},$(true);},[j,De,O.y,ve,Ne]),G=Et.useCallback(Y=>{let J=Re.current;if(!J||J.pointerId!==Y.pointerId)return;let pe=j({x:J.startX+Y.clientX-J.startClientX,y:J.startY+Y.clientY-J.startClientY});J.currentX=pe.x,J.currentY=pe.y,K(pe);},[j]),X=Et.useCallback(Y=>{let J=Re.current;if(!(!J||J.pointerId!==Y.pointerId)){try{Y.currentTarget.releasePointerCapture(Y.pointerId);}catch{}Re.current=null,K(de({x:J.currentX,y:J.currentY})),$(false);}},[de]);return Et.useEffect(()=>{if(!ve)return;let Y=()=>{K(qe=>j(qe));},J=window.requestAnimationFrame(Y),pe=window.setTimeout(Y,430);return ()=>{window.cancelAnimationFrame(J),window.clearTimeout(pe);}},[j,ve,Ne,$e]),jsxRuntime.jsx(material.ThemeProvider,{theme:lt,children:jsxRuntime.jsx(Wi,{locale:r,children:jsxRuntime.jsxs(material.Box,{sx:Y=>({minHeight:"100vh",width:"100%",display:"flex",flexDirection:"column",overflowX:"hidden",background:Y.palette.mode==="dark"?"linear-gradient(180deg, #0A0A0A 0%, #141414 55%, #1A1A1A 100%)":Y.palette.background.default}),children:[jsxRuntime.jsx($l,{appTitle:e,logo:f,mode:R,onToggleMode:()=>C(Y=>Y==="system"?"dark":Y==="dark"?"light":"system"),locale:r,localeLabel:n,localeOptions:i,onLocaleChange:c,user:d,onUserSetting:s,onUserLogout:l,userMenuItems:g,onSearch:p,leftSlot:v,rightSlot:b}),jsxRuntime.jsxs(material.Box,{sx:{flex:1,minHeight:0,minWidth:0,display:"flex",overflowX:"hidden",position:"relative"},children:[a&&!ve&&jsxRuntime.jsx(material.Box,{sx:{pt:1.5,pb:1.5,pl:1.5,pr:Ne?.5:1.5,display:"flex",alignItems:"flex-start",flexShrink:0},children:jsxRuntime.jsx(Hs,{...Le,maxHeight:$e,colorMode:Pe,displayMode:ae,onDisplayModeChange:Xe,showDisplayModeToggle:y&&Ne})}),a&&ve&&jsxRuntime.jsx(material.Box,{ref:ue,onPointerDown:Ve,onPointerMove:G,onPointerUp:X,onPointerCancel:X,sx:Y=>({position:"absolute",top:O.y,left:De,zIndex:Y.zIndex.drawer+5,display:"flex",alignItems:"flex-start",cursor:Ne?_?"grabbing":"grab":"default",touchAction:Ne?"none":"auto",userSelect:_?"none":void 0,transition:_?"none":"left 180ms ease-out, top 180ms ease-out"}),children:jsxRuntime.jsx(Hs,{...Le,maxHeight:$e,colorMode:Pe,displayMode:ae,onDisplayModeChange:Xe,showDisplayModeToggle:y&&Ne})}),jsxRuntime.jsx(material.Box,{sx:{flex:1,minWidth:0,minHeight:0,overflow:"auto",pt:1.5,pb:1.5,pr:1.5,pl:a&&!ve&&Ne?.5:1.5,...u},children:o})]})]})})})};var Ul="(blank)",hm="Result",bm="Grand Total",ym={sum:"Sum",count:"Count",avg:"Average",min:"Min",max:"Max"},xm=["sum","count","avg","min","max"];var vm=["palette","rows","columns","filters","values"];var Cm=e=>vm.includes(e),km=e=>e==="rows"||e==="columns"||e==="filters",Kl=e=>{let t=e.split("|");return t.length===2&&t[0]==="container"&&Cm(t[1])?{kind:"container",zone:t[1]}:t.length===3&&t[0]==="item"&&Cm(t[1])&&t[2]?{kind:"item",zone:t[1],key:t[2]}:null},Ma=e=>e==null||e===""?Ul:e instanceof Date?e.toISOString().slice(0,10):String(e),Br=e=>JSON.stringify(e),Sm=(e,t)=>{let o=e.join(""),a=t.join("");return o.localeCompare(a,void 0,{sensitivity:"base"})},uC=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},yn=(e,t,o)=>{if(o==="count")return e.length;let a=e.map(r=>uC(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)},Ht=(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},Da=(e,t)=>e.length!==t.length?false:e.every((o,a)=>o===t[a]),wm=(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 Da(n,i)})},ql=(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}),_c=e=>!e?.aggregations||e.aggregations.length===0?xm:e.aggregations,so=(e,t)=>{let o=_c(t);return e&&o.includes(e)?e:t?.type==="number"&&o.includes("sum")?"sum":o.includes("count")?"count":o[0]},Ci=(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 Pm=({options:e,selectedValues:t,onChange:o,minWidth:a=96})=>{let{t:r}=re(),[n,i]=Et.useState(""),c=Et.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 Zc=({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(SC__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})]})]})}),Dm=({id:e,label:t,subtitle:o})=>{let{setNodeRef:a,listeners:r,attributes:n,isDragging:i}=core.useDraggable({id:e});return jsxRuntime.jsx(Zc,{label:t,subtitle:o,isDragging:i,dragRef:a,listeners:r,attributes:n})};var Cn=({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}=re();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(RC__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 Bm={xs:1.2,md:1.6},Sn=({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:Bm,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(Ix__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:Bm,py:{xs:1.2,md:1.6}},...Array.isArray(c)?c:c?[c]:[]],children:i})})]});var Yl=({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(SC__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}})})]})}),ki=({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(Yl,{label:t,caption:o,onRemove:a,trailing:r,isDragging:l,dragRef:n,listeners:c,attributes:i,style:g})};var es={rows:jsxRuntime.jsx($C__default.default,{fontSize:"small"}),columns:jsxRuntime.jsx(Xh__default.default,{fontSize:"small"}),filters:jsxRuntime.jsx(WC__default.default,{fontSize:"small"}),values:jsxRuntime.jsx(eb__default.default,{fontSize:"small"})},Lm=({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:p})=>{let{t:b}=re(),v=[`${b("pivot.zone.rows")} ${i.length}`,`${b("pivot.zone.columns")} ${n.length}`,`${b("pivot.zone.filters")} ${r.length}`,`${b("pivot.zone.values")} ${c.length}`].join(" \xB7 ");return jsxRuntime.jsx(Sn,{title:b("pivot.config.title"),subtitle:v,collapsed:e,onToggleCollapse:t,expandAriaLabel:b("pivot.collapse.ariaExpand"),collapseAriaLabel:b("pivot.collapse.ariaCollapse"),unmountOnExit:true,children:jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",lg:"260px 1fr"},gap:2},children:[jsxRuntime.jsx(Cn,{zone:"palette",title:b("pivot.fieldList"),hint:b("pivot.availableDimensions"),itemCount:o.length,icon:jsxRuntime.jsx(SC__default.default,{sx:{fontSize:16,color:"text.secondary"}}),children:jsxRuntime.jsxs(material.Stack,{spacing:.8,sx:{maxHeight:400,overflowY:"auto",pr:.5},children:[o.length===0&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.74rem",color:"text.secondary",py:1},children:b("pivot.allFieldsInUse")}),o.map(u=>jsxRuntime.jsx(Dm,{id:`item|palette|${u.id}`,label:u.label,subtitle:u.type??"string"},u.id))]})}),jsxRuntime.jsxs(material.Stack,{spacing:2,children:[jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[jsxRuntime.jsx(Cn,{zone:"filters",title:b("pivot.zone.filters"),hint:b("pivot.hint.filters"),icon:es.filters,itemCount:r.length,onClear:()=>d("filters"),children:jsxRuntime.jsx(sortable.SortableContext,{items:r.map(u=>`item|filters|${u}`),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:.7,children:r.map(u=>jsxRuntime.jsx(ki,{id:`item|filters|${u}`,label:a.get(u)?.label??u,caption:l(u),trailing:g(u),onRemove:()=>s("filters",u)},u))})})}),jsxRuntime.jsx(Cn,{zone:"columns",title:b("pivot.zone.columns"),hint:b("pivot.hint.columns"),icon:es.columns,itemCount:n.length,onClear:()=>d("columns"),children:jsxRuntime.jsx(sortable.SortableContext,{items:n.map(u=>`item|columns|${u}`),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:.7,children:n.map(u=>jsxRuntime.jsx(ki,{id:`item|columns|${u}`,label:a.get(u)?.label??u,caption:`${a.get(u)?.type??"dimension"} \u2022 ${l(u)}`,trailing:g(u),onRemove:()=>s("columns",u)},u))})})})]}),jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[jsxRuntime.jsx(Cn,{zone:"rows",title:b("pivot.zone.rows"),hint:b("pivot.hint.rows"),icon:es.rows,itemCount:i.length,onClear:()=>d("rows"),children:jsxRuntime.jsx(sortable.SortableContext,{items:i.map(u=>`item|rows|${u}`),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:.7,children:i.map(u=>jsxRuntime.jsx(ki,{id:`item|rows|${u}`,label:a.get(u)?.label??u,caption:`${a.get(u)?.type??"dimension"} \u2022 ${l(u)}`,trailing:g(u),onRemove:()=>s("rows",u)},u))})})}),jsxRuntime.jsx(Cn,{zone:"values",title:b("pivot.zone.values"),hint:b("pivot.hint.values"),icon:es.values,itemCount:c.length,onClear:()=>d("values"),children:jsxRuntime.jsx(sortable.SortableContext,{items:c.map(u=>`item|values|${u.tokenId}`),strategy:sortable.verticalListSortingStrategy,children:jsxRuntime.jsx(material.Stack,{spacing:.7,children:c.map(u=>{let w=a.get(u.fieldId)?.label??u.fieldId,m=`${p(u.aggregation)}(${w})`;return jsxRuntime.jsx(ki,{id:`item|values|${u.tokenId}`,label:w,caption:m,trailing:f(u),onRemove:()=>s("values",u.tokenId)},u.tokenId)})})})})]})]})]})})};var zm=e=>e.toLocaleString(void 0,{maximumFractionDigits:1}),Nm=({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(u=>u.primaryValue):e.map((u,w)=>w+1),l=o?e.map(u=>u.secondaryValue??0):e.map(u=>u.primaryValue),g=Math.max(...s,1),f=Math.max(...l,1),p=i-d.left-d.right,b=c-d.top-d.bottom,v=e.map((u,w)=>{let m=o?u.primaryValue:w+1,h=o?u.secondaryValue??0:u.primaryValue,y=d.left+m/g*p,k=c-d.bottom-h/f*b;return {...u,x:y,y:k,rawX:m,rawY:h}});return jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[jsxRuntime.jsx(material.Box,{sx:{overflowX:"auto"},children:jsxRuntime.jsxs(material.Box,{component:"svg",viewBox:`0 0 ${i} ${c}`,sx:{width:"100%",minWidth:i,height:c},children:[jsxRuntime.jsx("line",{x1:d.left,y1:c-d.bottom,x2:i-d.right,y2:c-d.bottom,stroke:styles.alpha(n.palette.text.secondary,.35)}),jsxRuntime.jsx("line",{x1:d.left,y1:d.top,x2:d.left,y2:c-d.bottom,stroke:styles.alpha(n.palette.text.secondary,.35)}),v.map(u=>jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("circle",{cx:u.x,cy:u.y,r:7,fill:styles.alpha(n.palette.primary.main,.18)}),jsxRuntime.jsx("circle",{cx:u.x,cy:u.y,r:4.5,fill:n.palette.primary.main,children:jsxRuntime.jsxs("title",{children:[u.name,`
195
+ `,o?`${t}: ${a(u.primaryValue)}`:`${t}: ${a(u.primaryValue)}`,o?`
196
+ ${o}: ${(r??a)(u.secondaryValue??0)}`:""]})}),jsxRuntime.jsx("text",{x:u.x,y:Math.max(u.y-12,d.top+8),textAnchor:"middle",fontSize:"10",fill:n.palette.text.secondary,children:u.name})]},u.name)),jsxRuntime.jsx("text",{x:i/2,y:c-10,textAnchor:"middle",fontSize:"11",fill:n.palette.text.secondary,children:o?t:"Index"}),jsxRuntime.jsx("text",{x:16,y:c/2,textAnchor:"middle",transform:`rotate(-90 16 ${c/2})`,fontSize:"11",fill:n.palette.text.secondary,children:o??t}),jsxRuntime.jsx("text",{x:d.left,y:d.top-4,fontSize:"10",fill:n.palette.text.secondary,children:zm(f)}),jsxRuntime.jsx("text",{x:i-d.right,y:c-d.bottom+16,textAnchor:"end",fontSize:"10",fill:n.palette.text.secondary,children:zm(g)})]})}),jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",lg:"repeat(3, minmax(0, 1fr))"},gap:1},children:e.map(u=>jsxRuntime.jsxs(material.Box,{sx:w=>({borderRadius:2,px:1.25,py:1,border:`1px solid ${styles.alpha(w.palette.divider,.7)}`,bgcolor:styles.alpha(w.palette.background.default,.35)}),children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.78rem",fontWeight:700},noWrap:true,title:u.name,children:u.name}),jsxRuntime.jsxs(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:[t,": ",a(u.primaryValue)]}),o&&jsxRuntime.jsxs(material.Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:[o,": ",(r??a)(u.secondaryValue??0)]})]},u.name))})]})};var td=e=>Math.max(...e,1),Om=({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=td(e.flatMap(h=>[h.primaryValue,h.secondaryValue??0]));return jsxRuntime.jsx(material.Stack,{spacing:1.1,children:e.map(h=>jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",md:"160px 1fr 128px"},gap:1.25,alignItems:"center"},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.78rem",fontWeight:700},noWrap:true,title:h.name,children:h.name}),jsxRuntime.jsxs(material.Stack,{spacing:.65,children:[jsxRuntime.jsx(material.Box,{sx:{height:10,borderRadius:999,overflow:"hidden",bgcolor:styles.alpha(i.palette.action.active,.08)},children:jsxRuntime.jsx(material.Box,{sx:{width:`${h.primaryValue/m*100}%`,height:"100%",bgcolor:c}})}),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:`${(h.secondaryValue??0)/m*100}%`,height:"100%",bgcolor:d}})})]}),jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",textAlign:{xs:"left",md:"right"},fontWeight:700},children:r(h.primaryValue)}),a&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.72rem",textAlign:{xs:"left",md:"right"},color:"text.secondary"},children:(n??r)(h.secondaryValue??0)})]})]},h.name))})}if(t==="bar-vertical"){let m=td(e.flatMap(y=>[y.primaryValue,y.secondaryValue??0])),h=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*h),display:"grid",gridTemplateColumns:`repeat(${e.length}, minmax(56px, 1fr))`,gap:1,alignItems:"end"},children:e.map(y=>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(y.primaryValue/m*188,8)}px`,borderRadius:"10px 10px 2px 2px",bgcolor:c},title:`${o}: ${r(y.primaryValue)}`}),a&&jsxRuntime.jsx(material.Box,{sx:{width:16,minHeight:8,height:`${Math.max((y.secondaryValue??0)/m*188,8)}px`,borderRadius:"10px 10px 2px 2px",bgcolor:d},title:`${a}: ${(n??r)(y.secondaryValue??0)}`})]}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.76rem",fontWeight:700},noWrap:true,title:y.name,children:y.name}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.7rem",color:"text.secondary"},noWrap:true,title:r(y.primaryValue),children:r(y.primaryValue)}),a&&jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.7rem",color:"text.secondary"},noWrap:true,title:(n??r)(y.secondaryValue??0),children:(n??r)(y.secondaryValue??0)})]},y.name))})})}let s=Math.max(680,e.length*74),l=240,g={top:20,right:18,bottom:36,left:18},f=td(e.flatMap(m=>[m.primaryValue,m.secondaryValue??0])),p=s-g.left-g.right,b=l-g.top-g.bottom,v=m=>e.map((h,y)=>{let k=g.left+y*p/Math.max(e.length-1,1),E=l-g.bottom-m(h)/f*b;return {x:k,y:E,item:h}}),u=v(m=>m.primaryValue),w=a?v(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:u.map(m=>`${m.x},${m.y}`).join(" ")}),u.map(m=>jsxRuntime.jsx("circle",{cx:m.x,cy:m.y,r:4,fill:c,children:jsxRuntime.jsxs("title",{children:[m.item.name,`
197
+ `,o,": ",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:w.map(m=>`${m.x},${m.y}`).join(" ")}),w.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:h=>({borderRadius:2,px:1.1,py:.9,border:`1px solid ${styles.alpha(h.palette.divider,.7)}`,bgcolor:styles.alpha(h.palette.background.default,.35)}),children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.76rem",fontWeight:700},noWrap:true,title:m.name,children:m.name}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.71rem",color:"text.secondary"},children: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},Wm=(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}}),$m=({rows:e,dimensionFieldId:t,primaryValue:o,secondaryValue:a})=>{if(!t)return [];let r=new Map;return e.forEach(n=>{let i=Ma(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:yn(i,o.fieldId,o.aggregation),secondaryValue:a?yn(i,a.fieldId,a.aggregation):void 0}))};var Gm=({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:p,onToggleCollapse:b,getAggregationLabel:v})=>{let{t:u}=re(),w=Et.useMemo(()=>Hm(o,a,t),[a,t,o]),m=Et.useMemo(()=>Wm(r,t,v),[t,v,r]),h=m.find(S=>S.fieldId===i)??m[0],y=m.find(S=>S.fieldId===c&&S.fieldId!==h?.fieldId)??null,k=w.find(S=>S.fieldId===n)??w[0],E=k&&h?u("pivot.chart.subtitleReady",{dimension:k.label,measure:y?`${h.label} / ${y.label}`:h.label}):u("pivot.chart.subtitle"),R=Et.useMemo(()=>!k||!h?[]:$m({rows:e,dimensionFieldId:k.fieldId,primaryValue:h.item,secondaryValue:y?.item}),[h,e,y,k]),C=S=>h?Ci(S,h.item,t):S.toLocaleString(),I=S=>y?Ci(S,y.item,t):S.toLocaleString(),T=w.length>1||m.length>1;return jsxRuntime.jsxs(Sn,{title:u("pivot.chart.title"),subtitle:E,collapsed:s,onToggleCollapse:b,expandAriaLabel:u("pivot.chart.collapse.ariaExpand"),collapseAriaLabel:u("pivot.chart.collapse.ariaCollapse"),bodySx:{display:"flex",flexDirection:"column",gap:1.1},children:[T&&jsxRuntime.jsxs(material.Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",xl:"repeat(4, minmax(0, 1fr))"},gap:1,alignItems:"start"},children:[jsxRuntime.jsxs(material.FormControl,{size:"small",sx:{minWidth:0,width:"100%"},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.68rem",color:"text.secondary",mb:.45},children:u("pivot.chart.dimension")}),jsxRuntime.jsx(material.Select,{value:k?.fieldId??"",onChange:S=>l(String(S.target.value)),sx:{fontSize:"0.75rem",height:32},children:w.map(S=>jsxRuntime.jsx(material.MenuItem,{value:S.fieldId,sx:{fontSize:"0.75rem"},children:S.label},S.fieldId))})]}),jsxRuntime.jsxs(material.FormControl,{size:"small",sx:{minWidth:0,width:"100%"},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.68rem",color:"text.secondary",mb:.45},children:u("pivot.chart.primaryMeasure")}),jsxRuntime.jsx(material.Select,{value:h?.fieldId??"",onChange:S=>g(String(S.target.value)),sx:{fontSize:"0.75rem",height:32},children:m.map(S=>jsxRuntime.jsx(material.MenuItem,{value:S.fieldId,sx:{fontSize:"0.75rem"},children:S.label},S.fieldId))})]}),jsxRuntime.jsxs(material.FormControl,{size:"small",sx:{minWidth:0,width:"100%"},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.68rem",color:"text.secondary",mb:.45},children:u("pivot.chart.secondaryMeasure")}),jsxRuntime.jsxs(material.Select,{value:y?.fieldId??"",onChange:S=>f(String(S.target.value)),sx:{fontSize:"0.75rem",height:32},children:[jsxRuntime.jsx(material.MenuItem,{value:"",sx:{fontSize:"0.75rem",color:"text.secondary"},children:u("common.none")}),m.filter(S=>S.fieldId!==h?.fieldId).map(S=>jsxRuntime.jsx(material.MenuItem,{value:S.fieldId,sx:{fontSize:"0.75rem"},children:S.label},S.fieldId))]})]}),jsxRuntime.jsxs(material.FormControl,{size:"small",sx:{minWidth:0,width:"100%"},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.68rem",color:"text.secondary",mb:.45},children:u("pivot.chart.chartType")}),jsxRuntime.jsxs(material.Select,{value:d,onChange:S=>p(S.target.value),sx:{fontSize:"0.75rem",height:32},children:[jsxRuntime.jsx(material.MenuItem,{value:"bar-vertical",sx:{fontSize:"0.75rem"},children:u("pivot.chart.style.barVertical")}),jsxRuntime.jsx(material.MenuItem,{value:"bar-horizontal",sx:{fontSize:"0.75rem"},children:u("pivot.chart.style.barHorizontal")}),jsxRuntime.jsx(material.MenuItem,{value:"line",sx:{fontSize:"0.75rem"},children:u("pivot.chart.style.line")}),jsxRuntime.jsx(material.MenuItem,{value:"scatter",sx:{fontSize:"0.75rem"},children:u("pivot.chart.style.scatter")})]})]})]}),jsxRuntime.jsx(material.Box,{children:k?h?R.length===0?jsxRuntime.jsx(material.Box,{sx:{py:5,textAlign:"center"},children:jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.86rem",color:"text.secondary"},children:u("pivot.chart.emptyNoData")})}):d==="scatter"?jsxRuntime.jsx(Nm,{data:R,primaryLabel:h.label,secondaryLabel:y?.label,formatPrimaryValue:C,formatSecondaryValue:I}):jsxRuntime.jsx(Om,{data:R,chartType:d,primaryLabel:h.label,secondaryLabel:y?.label,formatPrimaryValue:C,formatSecondaryValue:I}):jsxRuntime.jsx(material.Box,{sx:{py:5,textAlign:"center"},children:jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.86rem",color:"text.secondary"},children:u("pivot.chart.emptyNoValue")})}):jsxRuntime.jsx(material.Box,{sx:{py:5,textAlign:"center"},children:jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.86rem",color:"text.secondary"},children:u("pivot.chart.emptyNoDimension")})})})]})};var as=({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(Pb__default.default,{sx:{fontSize:16}}):jsxRuntime.jsx(If__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:Ci(i?i(e,l.id):e.aggregatedValues[l.id]??0,l.valueItem,o)},`${e.key}-${l.id}`))]}),c&&e.children.map(l=>jsxRuntime.jsx(as,{node:l,dataColumns:t,fieldMap:o,level:a+1,expandedKeys:r,onToggle:n,getValue:i},l.key))]})};var id=(e,t,o)=>{let a=[...e,...t];return o&&a.includes(o)?o:a[0]??""},is=(e,t)=>t&&e.some(o=>o.fieldId===t)?t:e[0]?.fieldId??"",ld=(e,t,o)=>o===""?"":o&&o!==t&&e.some(a=>a.fieldId===o)?o:e.find(a=>a.fieldId!==t)?.fieldId??"",Xm=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},Qm=(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,Qm(r.children,t,o+1)),o),wk=(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},kF=({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:p,initialPresetId:b,onPresetApplied:v})=>{let{t:u}=re(),w=core.useSensors(core.useSensor(core.PointerSensor,{activationConstraint:{distance:8}})),m=Et.useRef(0),h=Et.useRef(false),y=e??u("pivot.title.default"),k=n??u("pivot.empty"),E=Et.useMemo(()=>({sum:u("pivot.agg.sum"),count:u("pivot.agg.count"),avg:u("pivot.agg.avg"),min:u("pivot.agg.min"),max:u("pivot.agg.max")}),[u]),R=Et.useCallback(x=>E[x]??ym[x],[E]),C=Et.useMemo(()=>new Set(o.map(x=>x.id)),[o]),I=Et.useMemo(()=>new Map(o.map(x=>[x.id,x])),[o]),[T,S]=Et.useState(()=>Ht(a?.rows,C)),[A,M]=Et.useState(()=>Ht(a?.columns,C)),[D,B]=Et.useState(()=>Ht(a?.filters,C)),[Z,O]=Et.useState(()=>{let x=a?.values??[],F=new Set,L=[];return x.forEach(Q=>{if(!C.has(Q.fieldId)||F.has(Q.fieldId))return;F.add(Q.fieldId),m.current+=1;let fe=I.get(Q.fieldId);L.push({tokenId:`v${m.current}`,fieldId:Q.fieldId,aggregation:so(Q.aggregation,fe)});}),L}),[K,te]=Et.useState({}),[se,_]=Et.useState(true),[$,ue]=Et.useState(false),[Re,Ae]=Et.useState(()=>id(Ht(a?.rows,C),Ht(a?.columns,C),r?.dimensionFieldId)),[ae,ve]=Et.useState(()=>{let x=(a?.values??[]).filter((F,L,Q)=>C.has(F.fieldId)&&Q.findIndex(fe=>fe.fieldId===F.fieldId)===L).map(F=>({tokenId:F.fieldId,fieldId:F.fieldId,aggregation:so(F.aggregation,I.get(F.fieldId))}));return is(x,r?.primaryValueFieldId)}),[Pe,lt]=Et.useState(()=>{let x=(a?.values??[]).filter((L,Q,fe)=>C.has(L.fieldId)&&fe.findIndex(Fe=>Fe.fieldId===L.fieldId)===Q).map(L=>({tokenId:L.fieldId,fieldId:L.fieldId,aggregation:so(L.aggregation,I.get(L.fieldId))})),F=is(x,r?.primaryValueFieldId);return ld(x,F,r?.secondaryValueFieldId)}),[Xe,Le]=Et.useState(r?.chartType??"bar-vertical"),[$e,Ne]=Et.useState(c),[j,de]=Et.useState(d),[De,Ve]=Et.useState(()=>f??[]),[G,X]=Et.useState(""),[Y,J]=Et.useState(false),[pe,qe]=Et.useState(""),[_e,ut]=Et.useState(null),[pt,at]=Et.useState(new Set(["__grand_total__"])),[Dt,rt]=Et.useState(new Set),Oe=s?.rowFields??T,Ie=s?.columnFields??A,mt=s?.filterFields??D,je=s?.valueFields??Z,Vt=s?.filterSelections??K,mo=s?.showGrandTotal??se,go=s?.isConfiguratorCollapsed??$,Qt=s?.chartDimensionFieldId??Re,wt=s?.chartPrimaryValueFieldId??ae,fo=s?.chartSecondaryValueFieldId??Pe,ho=s?.chartType??Xe,bo=s?.isChartCollapsed??$e,Ko=s?.isTableCollapsed??j,xt=g??De,oo=l||xt.length>0||!!p,Tt=Et.useCallback(x=>{if(s?.setRowFields){s.setRowFields(x);return}S(x);},[s]),z=Et.useCallback(x=>{if(s?.setColumnFields){s.setColumnFields(x);return}M(x);},[s]),V=Et.useCallback(x=>{if(s?.setFilterFields){s.setFilterFields(x);return}B(x);},[s]),H=Et.useCallback(x=>{if(s?.setValueFields){s.setValueFields(x);return}O(x);},[s]),ce=Et.useCallback(x=>{if(s?.setFilterSelections){s.setFilterSelections(x);return}te(x);},[s]),me=Et.useCallback(x=>{if(s?.setShowGrandTotal){s.setShowGrandTotal(x);return}_(x);},[s]),Me=Et.useCallback(x=>{if(s?.setIsConfiguratorCollapsed){s.setIsConfiguratorCollapsed(x);return}ue(x);},[s]),P=Et.useCallback(x=>{if(s?.setChartDimensionFieldId){s.setChartDimensionFieldId(x);return}Ae(x);},[s]),N=Et.useCallback(x=>{if(s?.setChartPrimaryValueFieldId){s.setChartPrimaryValueFieldId(x);return}ve(x);},[s]),q=Et.useCallback(x=>{if(s?.setChartSecondaryValueFieldId){s.setChartSecondaryValueFieldId(x);return}lt(x);},[s]),oe=Et.useCallback(x=>{if(s?.setChartType){s.setChartType(x);return}Le(x);},[s]),he=Et.useCallback(x=>{if(s?.setIsChartCollapsed){s.setIsChartCollapsed(x);return}Ne(x);},[s]),Ce=Et.useCallback(x=>{if(s?.setIsTableCollapsed){s.setIsTableCollapsed(x);return}de(x);},[s]),Se=Et.useCallback(x=>{let F=typeof x=="function"?x(xt):x;g||Ve(F),p?.(F);},[p,xt,g]),ye=Et.useMemo(()=>new Set([...Oe,...Ie,...mt]),[Oe,Ie,mt]),He=Et.useMemo(()=>o.filter(x=>!ye.has(x.id)),[o,ye]),Ge=Et.useMemo(()=>{let x=[...Oe,...Ie,...mt],F=new Set,L=[];return x.forEach(Q=>{F.has(Q)||(F.add(Q),L.push(Q));}),L},[Ie,mt,Oe]);Et.useEffect(()=>{Tt(x=>{let F=x.filter(L=>C.has(L));return Da(x,F)?x:F}),z(x=>{let F=x.filter(L=>C.has(L));return Da(x,F)?x:F}),V(x=>{let F=x.filter(L=>C.has(L));return Da(x,F)?x:F}),H(x=>{let F=x.filter(L=>C.has(L.fieldId)).map(L=>({...L,aggregation:so(L.aggregation,I.get(L.fieldId))}));return ql(x,F)?x:F});},[I,C]);let gt=Et.useMemo(()=>{let x={};return Ge.forEach(F=>{let L=new Set;t.forEach(Q=>{L.add(Ma(Q[F]));}),x[F]=Array.from(L).sort((Q,fe)=>Q.localeCompare(fe));}),x},[Ge,t]);Et.useEffect(()=>{ce(x=>{let F={};return Ge.forEach(L=>{let Q=gt[L]??[],Fe=(x[L]??[]).filter(le=>Q.includes(le)),W=Object.prototype.hasOwnProperty.call(x,L);F[L]=W?Fe:Q;}),wm(x,F)?x:F});},[Ge,gt]),Et.useEffect(()=>{P(x=>id(Oe,Ie,x));},[Ie,Oe,P]),Et.useEffect(()=>{N(x=>is(je,x));},[N,je]),Et.useEffect(()=>{q(x=>ld(je,wt,x));},[wt,q,je]);let Ye=Et.useMemo(()=>t.filter(x=>Ge.every(F=>{let L=Vt[F]??[],Q=gt[F]??[];if(L.length===Q.length)return true;if(L.length===0)return false;let fe=Ma(x[F]);return L.includes(fe)})),[Ge,gt,Vt,t]),We=Et.useMemo(()=>{if(je.length===0)return null;let x=new Map;if(Ye.forEach(W=>{let le=Ie.length>0?Ie.map(st=>Ma(W[st])):[u("pivot.valueLabel")],ie=Br(le);x.set(ie,le);}),x.size===0){let W=Ie.length>0?Ie.map(()=>Ul):[u("pivot.valueLabel")];x.set(Br(W),W);}let F=Array.from(x.entries()).sort((W,le)=>Sm(W[1],le[1])),L=F.flatMap(([W,le])=>je.map(ie=>{let st=I.get(ie.fieldId),U=`${R(ie.aggregation)} ${st?.label??ie.fieldId}`,ge=Ie.length===0||je.length>1?`${le.join(" / ")} \u2022 ${U}`:le.join(" / ");return {id:`${W}::${ie.tokenId}`,colKey:W,valueItem:ie,label:ge}})),Q=[];Ie.length>0&&F.forEach(([W,le])=>{let ie=L.filter(ge=>ge.colKey===W),st=Q,U=[];le.forEach((ge,ee)=>{U.push(`d${ee}:${ge}`);let we=`col::${Br(U)}`,et=st.find(ia=>ia.key===we);et||(et={key:we,label:ge,children:[],leafColumnIds:[],path:le.slice(0,ee+1),depth:ee},st.push(et)),ie.forEach(ia=>{et.leafColumnIds.includes(ia.id)||et.leafColumnIds.push(ia.id);}),st=et.children;});});let fe=W=>{let le={};return L.forEach(ie=>{let st=W.filter(U=>{let ge=Ie.length>0?Ie.map(ee=>Ma(U[ee])):[u("pivot.valueLabel")];return Br(ge)===ie.colKey});le[ie.id]=yn(st,ie.valueItem.fieldId,ie.valueItem.aggregation);}),le},Fe=[];if(Oe.length===0)Fe.push({key:"root",value:u("pivot.resultLabel")||hm,children:[],isLeaf:true,aggregatedValues:fe(Ye),path:[],depth:0});else {let W=(le,ie,st)=>{if(ie>=Oe.length)return [];let U=Oe[ie],ge=new Map;return le.forEach(ee=>{let we=Ma(ee[U]);ge.has(we)||ge.set(we,[]),ge.get(we).push(ee);}),Array.from(ge.keys()).sort().map(ee=>{let we=ge.get(ee),et=[...st,ee];return {key:Br(et),value:ee,fieldId:U,aggregatedValues:fe(we),children:W(we,ie+1,et),isLeaf:ie===Oe.length-1,path:et,depth:ie}})};Fe.push(...W(Ye,0,[]));}return {dataColumns:L,columnTree:Q,rowTree:Fe}},[Ie,I,Ye,R,Oe,u,je]),Ot=Et.useCallback((x,F)=>(m.current+=1,{tokenId:`v${m.current}`,fieldId:x,aggregation:so(F,I.get(x))}),[I]),$t=Et.useCallback(x=>{if(x==="rows")return Tt([]);if(x==="columns")return z([]);if(x==="filters")return V([]);H([]);},[]),vt=Et.useCallback((x,F)=>{if(x==="rows")return Tt(L=>L.filter(Q=>Q!==F));if(x==="columns")return z(L=>L.filter(Q=>Q!==F));if(x==="filters")return V(L=>L.filter(Q=>Q!==F));H(L=>L.filter(Q=>Q.tokenId!==F));},[]),ao=Et.useCallback((x,F)=>{H(L=>L.map(Q=>Q.tokenId===x?{...Q,aggregation:so(F,I.get(Q.fieldId))}:Q));},[I]),Ct=Et.useCallback(x=>{ut(String(x.active.id));},[]),ro=Et.useCallback(x=>{if(ut(null),!x.over)return;let F=Kl(String(x.active.id)),L=Kl(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 ee=Oe.indexOf(F.key),we=Oe.indexOf(L.key??"");ee!==-1&&we!==-1&&ee!==we&&Tt(et=>sortable.arrayMove(et,ee,we));return}if(F.zone==="columns"){let ee=Ie.indexOf(F.key),we=Ie.indexOf(L.key??"");ee!==-1&&we!==-1&&ee!==we&&z(et=>sortable.arrayMove(et,ee,we));return}if(F.zone==="filters"){let ee=mt.indexOf(F.key),we=mt.indexOf(L.key??"");ee!==-1&&we!==-1&&ee!==we&&V(et=>sortable.arrayMove(et,ee,we));return}if(F.zone==="values"){let ee=je.findIndex(et=>et.tokenId===F.key),we=je.findIndex(et=>et.tokenId===(L.key??""));ee!==-1&&we!==-1&&ee!==we&&H(et=>sortable.arrayMove(et,ee,we));}return}let Q=L.zone,fe=[...Oe],Fe=[...Ie],W=[...mt],le=[...je],ie="",st=null;if(F.zone==="palette")ie=F.key;else if(F.zone==="values"){let ee=le.find(we=>we.tokenId===F.key);if(!ee)return;ie=ee.fieldId,st=ee,le=le.filter(we=>we.tokenId!==F.key);}else F.zone==="rows"?(ie=F.key,fe=fe.filter(ee=>ee!==ie)):F.zone==="columns"?(ie=F.key,Fe=Fe.filter(ee=>ee!==ie)):F.zone==="filters"&&(ie=F.key,W=W.filter(ee=>ee!==ie));if(!ie)return;let U=()=>{fe=fe.filter(ee=>ee!==ie),Fe=Fe.filter(ee=>ee!==ie),W=W.filter(ee=>ee!==ie);},ge=ee=>{if(L.kind!=="item"||!L.key)return ee==="rows"?fe.length:ee==="columns"?Fe.length:ee==="filters"?W.length:ee==="values"?le.length:0;if(ee==="rows"){let we=fe.indexOf(L.key);return we>=0?we:fe.length}if(ee==="columns"){let we=Fe.indexOf(L.key);return we>=0?we:Fe.length}if(ee==="filters"){let we=W.indexOf(L.key);return we>=0?we:W.length}if(ee==="values"){let we=le.findIndex(et=>et.tokenId===L.key);return we>=0?we:le.length}return 0};if(Q==="palette"){Tt(fe),z(Fe),V(W),H(le);return}if(Q==="values"){let ee=ge("values"),we=st??Ot(ie);le.splice(ee,0,we),Tt(fe),z(Fe),V(W),H(le);return}if(km(Q)){U();let ee=ge(Q);Q==="rows"?fe.splice(ee,0,ie):Q==="columns"?Fe.splice(ee,0,ie):W.splice(ee,0,ie),Tt(fe),z(Fe),V(W),H(le);}},[Ie,Ot,mt,Oe,je]),qo=Et.useCallback((x,F)=>{ce(L=>({...L,[x]:F}));},[]),no=Et.useCallback(x=>{at(F=>{let L=new Set(F);return L.has(x)?L.delete(x):L.add(x),L});},[]),fa=Et.useCallback(x=>{rt(F=>{let L=new Set(F);return L.has(x)?L.delete(x):L.add(x),L});},[]),Ha=Et.useCallback(x=>{let F=I.get(x.fieldId),L=_c(F);return jsxRuntime.jsx(material.FormControl,{size:"small",sx:{minWidth:98},children:jsxRuntime.jsx(material.Select,{value:x.aggregation,onChange:Q=>ao(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))})})},[I,R,ao]),io=Et.useCallback(x=>{let F=gt[x]??[],L=Vt[x]??F;return F.length===0?u("pivot.filter.noValues"):L.length===0?u("pivot.filter.noneSelected"):L.length===F.length?u("pivot.filter.allValues"):u("pivot.filter.selectedCount",{selected:L.length,total:F.length})},[gt,Vt,u]),_o=Et.useCallback(x=>{let F=gt[x]??[],L=Vt[x]??F;return jsxRuntime.jsx(Pm,{options:F,selectedValues:L,onChange:Q=>qo(x,Q)})},[gt,Vt,qo]),ha=Et.useCallback(()=>`pivot-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,[]),zo=Et.useCallback(()=>{let x={};return new Set([...Ge,...Object.keys(Vt)]).forEach(L=>{if(!C.has(L))return;let Q=Vt[L]??[];x[L]=[...Q];}),{layout:{rows:[...Oe],columns:[...Ie],filters:[...mt],values:je.map(L=>({fieldId:L.fieldId,aggregation:L.aggregation}))},filterSelections:x,showGrandTotal:mo,chart:{dimensionFieldId:Qt,primaryValueFieldId:wt,secondaryValueFieldId:fo,chartType:ho}}},[Ge,Qt,wt,fo,ho,Ie,mt,Vt,Oe,mo,C,je]),na=Et.useCallback(x=>{let F=Ht(x.layout.rows,C),L=Ht(x.layout.columns,C),Q=Ht(x.layout.filters,C),fe=new Set,Fe=(x.layout.values??[]).filter(ie=>!C.has(ie.fieldId)||fe.has(ie.fieldId)?false:(fe.add(ie.fieldId),true)).map(ie=>Ot(ie.fieldId,ie.aggregation)),W={};Object.entries(x.filterSelections??{}).forEach(([ie,st])=>{!C.has(ie)||!Array.isArray(st)||(W[ie]=Array.from(new Set(st.map(U=>String(U)))));}),Tt(F),z(L),V(Q),H(Fe),ce(W),typeof x.showGrandTotal=="boolean"&&me(x.showGrandTotal),P(id(F,L,x.chart?.dimensionFieldId));let le=is(Fe,x.chart?.primaryValueFieldId);N(le),q(ld(Fe,le,x.chart?.secondaryValueFieldId)),oe(x.chart?.chartType??"bar-vertical"),X(x.id),v?.(x);},[Ot,v,P,N,q,oe,z,V,ce,Tt,me,H,C]),pr=Et.useCallback(x=>{if(!x){X("");return}let F=xt.find(L=>L.id===x);if(!F){X("");return}na(F);},[na,xt]),Gr=Et.useCallback(()=>{let x=u("pivot.preset.defaultName",{index:xt.length+1});qe(x),J(true);},[xt.length,u]),Wa=Et.useCallback(()=>{let x=pe.trim();if(!x)return;let F={id:ha(),name:x,...zo()};Se(L=>[...L,F]),X(F.id),J(false);},[zo,ha,pe,Se]),mr=Et.useCallback(()=>{G&&(Se(x=>x.filter(F=>F.id!==G)),X(""));},[G,Se]);Et.useEffect(()=>{if(!b||h.current)return;let x=xt.find(F=>F.id===b);x&&(h.current=true,na(x));},[na,b,xt]),Et.useEffect(()=>{G&&(xt.some(x=>x.id===G)||X(""));},[G,xt]);let ba=Et.useMemo(()=>{if(!mo||!We||!Oe.length)return null;let x={};return We.dataColumns.forEach(F=>{let L=Ye.filter(Q=>{let fe=Ie.length>0?Ie.map(Fe=>Ma(Q[Fe])):[u("pivot.valueLabel")];return Br(fe)===F.colKey});x[F.id]=yn(L,F.valueItem.fieldId,F.valueItem.aggregation);}),{key:"__grand_total__",value:u("pivot.grandTotal")||bm,children:[],isLeaf:false,isGrandTotal:true,aggregatedValues:x,path:[],depth:-1}},[mo,We,Ye,Ie,Oe.length,u]),yo=Et.useMemo(()=>Xm(We?.rowTree??[]),[We]),jo=Et.useMemo(()=>Xm(We?.columnTree??[]),[We]);Et.useEffect(()=>{at(x=>{let F=new Set;return x.has("__grand_total__")&&F.add("__grand_total__"),yo.forEach(L=>{x.has(L)&&F.add(L);}),F});},[yo]),Et.useEffect(()=>{rt(x=>{let F=new Set;return jo.forEach(L=>{x.has(L)&&F.add(L);}),F});},[jo]);let Ur=Et.useCallback(()=>{at(x=>{let F=new Set(x);return yo.forEach(L=>F.add(L)),F});},[yo]),gr=Et.useCallback(()=>{at(x=>{let F=new Set;return x.has("__grand_total__")&&F.add("__grand_total__"),F});},[]),Kr=Et.useCallback(()=>{rt(new Set(jo));},[jo]),qr=Et.useCallback(()=>{rt(new Set);},[]),_r=Et.useMemo(()=>!We||Ie.length===0?[]:wk(We.columnTree,Dt),[Ie.length,Dt,We]),wo=Et.useMemo(()=>{if(!We)return [];if(Ie.length===0)return We.dataColumns.map(F=>({id:F.id,label:F.label,leafColumnIds:[F.id],valueItem:F.valueItem}));let x=new Map(We.dataColumns.map(F=>[F.id,F]));return _r.flatMap(F=>{let L=new Map;return F.leafColumnIds.forEach(Q=>{let fe=x.get(Q);if(!fe)return;let Fe=fe.valueItem.tokenId,W=`${R(fe.valueItem.aggregation)} ${I.get(fe.valueItem.fieldId)?.label??fe.valueItem.fieldId}`,le=L.get(Fe);if(le){le.leafColumnIds.push(Q);return}L.set(Fe,{id:`${F.key}::${Fe}`,label:je.length>1?W:F.label,leafColumnIds:[Q],valueItem:fe.valueItem});}),Array.from(L.values())})},[Ie.length,I,R,We,je.length,_r]),jr=Et.useMemo(()=>new Map(wo.map(x=>[x.id,x])),[wo]),Zr=Et.useMemo(()=>wo.map(x=>({id:x.id,colKey:x.id,valueItem:x.valueItem,label:x.label})),[wo]),fr=Et.useMemo(()=>{if(!We||Ie.length===0)return [];let x=[],F=Qm(We.columnTree,Dt),L=F+(je.length>1?1:0),Q=(fe,Fe)=>{x[Fe]??(x[Fe]=[]),fe.forEach(W=>{let le=W.children.length>0&&Dt.has(W.key),ie=wo.filter(U=>W.leafColumnIds.some(ge=>U.leafColumnIds.includes(ge))).length,st=le||je.length>1?1:L-Fe;x[Fe].push({key:W.key,label:W.label,colSpan:ie,rowSpan:st,expandable:W.children.length>0,expanded:le}),le&&Q(W.children,Fe+1);});};return Q(We.columnTree,0),je.length>1&&(x[F]=wo.map(fe=>({key:fe.id,label:fe.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))),x},[Ie.length,Dt,We,je.length,wo]),ya=Et.useCallback((x,F)=>F.leafColumnIds.reduce((L,Q)=>L+(x.aggregatedValues[Q]??0),0),[]),$a=Et.useMemo(()=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.Button,{size:"small",variant:"text",onClick:Ur,disabled:yo.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:u("pivot.table.expandRowsAll")}),jsxRuntime.jsx(material.Button,{size:"small",variant:"text",onClick:gr,disabled:yo.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:u("pivot.table.collapseRowsAll")}),jsxRuntime.jsx(material.Divider,{orientation:"vertical",flexItem:true}),jsxRuntime.jsx(material.Button,{size:"small",variant:"text",onClick:Kr,disabled:jo.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:u("pivot.table.expandColumnsAll")}),jsxRuntime.jsx(material.Button,{size:"small",variant:"text",onClick:qr,disabled:Ie.length===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:u("pivot.table.collapseColumnsAll")})]}),[Ie.length,jo.size,yo.size,qr,gr,Kr,Ur,u]),Ga=()=>{if(!_e)return null;let x=Kl(_e);if(!x||x.kind!=="item"||!x.key)return null;if(x.zone==="palette"){let fe=I.get(x.key);return fe?jsxRuntime.jsx(Zc,{label:fe.label,subtitle:fe.type}):null}if(x.zone==="values"){let fe=je.find(ie=>ie.tokenId===x.key);if(!fe)return null;let W=I.get(fe.fieldId)?.label??fe.fieldId,le=`${R(fe.aggregation)}(${W})`;return jsxRuntime.jsx(Yl,{label:W,caption:le})}let L=I.get(x.key)?.label??x.key,Q=io(x.key);return jsxRuntime.jsx(Yl,{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:y}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.78rem",color:"text.secondary"},children:u("pivot.subtitle.default")})]}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1.5,alignItems:"center",children:[oo&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.FormControl,{size:"small",sx:{minWidth:200},children:jsxRuntime.jsxs(material.Select,{value:G,displayEmpty:true,onChange:x=>pr(String(x.target.value)),sx:{fontSize:"0.75rem",height:32},children:[jsxRuntime.jsx(material.MenuItem,{value:"",sx:{fontSize:"0.75rem",color:"text.secondary"},children:u("pivot.preset.selectPlaceholder")}),xt.map(x=>jsxRuntime.jsx(material.MenuItem,{value:x.id,sx:{fontSize:"0.75rem"},children:x.name},x.id))]})}),jsxRuntime.jsx(material.Tooltip,{title:u("pivot.preset.save"),children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:Gr,"aria-label":u("pivot.preset.save"),children:jsxRuntime.jsx(yp__default.default,{sx:{fontSize:18}})})}),jsxRuntime.jsx(material.Tooltip,{title:u("pivot.preset.delete"),children:jsxRuntime.jsx("span",{children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:mr,disabled:!G,"aria-label":u("pivot.preset.delete"),children:jsxRuntime.jsx(Kb__default.default,{sx:{fontSize:18}})})})}),jsxRuntime.jsx(material.Divider,{flexItem:true,orientation:"vertical"})]}),jsxRuntime.jsxs(material.Typography,{sx:{fontSize:"0.74rem",color:"text.secondary"},children:[u("pivot.records"),": ",jsxRuntime.jsx("strong",{children:t.length.toLocaleString()})," / ",u("pivot.afterFilter"),":"," ",jsxRuntime.jsx("strong",{children:Ye.length.toLocaleString()})]}),jsxRuntime.jsx(material.Divider,{flexItem:true,orientation:"vertical"}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",gap:.6},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.74rem"},children:u("pivot.grandTotal")}),jsxRuntime.jsx(material.Switch,{size:"small",checked:mo,onChange:x=>me(x.target.checked)})]})]})]}),jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsxs(core.DndContext,{sensors:w,collisionDetection:core.closestCenter,onDragStart:Ct,onDragEnd:ro,children:[jsxRuntime.jsx(Lm,{isConfiguratorCollapsed:go,onToggleCollapse:()=>Me(x=>!x),availableFields:He,fieldMap:I,filterFields:mt,columnFields:Ie,rowFields:Oe,valueFields:je,clearZone:$t,removeFieldFromZone:vt,getFilterSelectionSummary:io,renderDimensionFilterSelect:_o,renderAggregationSelect:Ha,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:Ga()})})]}),jsxRuntime.jsx(Gm,{rows:Ye,fieldMap:I,rowFields:Oe,columnFields:Ie,valueFields:je,chartDimensionFieldId:Qt,chartPrimaryValueFieldId:wt,chartSecondaryValueFieldId:fo,chartType:ho,isCollapsed:bo,onChartDimensionFieldIdChange:x=>P(x),onChartPrimaryValueFieldIdChange:x=>N(x),onChartSecondaryValueFieldIdChange:x=>q(x),onChartTypeChange:x=>oe(x),onToggleCollapse:()=>he(x=>!x),getAggregationLabel:R}),jsxRuntime.jsx(Sn,{title:u("pivot.table.sectionTitle"),subtitle:Oe.length>0?Oe.map(x=>I.get(x)?.label??x).join(" > "):u("pivot.table.dimensions"),collapsed:Ko,onToggleCollapse:()=>Ce(x=>!x),expandAriaLabel:u("pivot.table.collapse.ariaExpand"),collapseAriaLabel:u("pivot.table.collapse.ariaCollapse"),bodySx:{p:0},headerActions:$a,children:We===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:k})}):jsxRuntime.jsx(material.TableContainer,{sx:{maxHeight:i},children:jsxRuntime.jsxs(material.Table,{size:"small",stickyHeader:true,children:[jsxRuntime.jsx(material.TableHead,{children:(fr.length>0?fr:[[]]).map((x,F)=>jsxRuntime.jsxs(material.TableRow,{children:[F===0&&jsxRuntime.jsx(material.TableCell,{rowSpan:Math.max(fr.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:Oe.length>0?Oe.map(L=>I.get(L)?.label).join(" > "):u("pivot.table.dimensions")}),(x.length>0?x:wo.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:()=>fa(L.key),sx:{p:.1,ml:-0.3},children:L.expanded?jsxRuntime.jsx(Pb__default.default,{sx:{fontSize:16}}):jsxRuntime.jsx(If__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:[We.rowTree.map(x=>jsxRuntime.jsx(as,{node:x,dataColumns:Zr,fieldMap:I,level:0,expandedKeys:pt,onToggle:no,getValue:(F,L)=>{let Q=jr.get(L);return Q?ya(F,Q):0}},x.key)),ba&&jsxRuntime.jsx(as,{node:ba,dataColumns:Zr,fieldMap:I,level:0,expandedKeys:pt,onToggle:no,getValue:(x,F)=>{let L=jr.get(F);return L?ya(x,L):0}})]})]})})}),jsxRuntime.jsxs(material.Dialog,{open:Y,onClose:()=>J(false),maxWidth:"xs",fullWidth:true,children:[jsxRuntime.jsx(material.DialogTitle,{children:u("pivot.preset.saveDialogTitle")}),jsxRuntime.jsx(material.DialogContent,{children:jsxRuntime.jsx(material.TextField,{autoFocus:true,fullWidth:true,margin:"dense",label:u("pivot.preset.nameLabel"),value:pe,onChange:x=>qe(x.target.value),onKeyDown:x=>{x.key==="Enter"&&(x.preventDefault(),Wa());}})}),jsxRuntime.jsxs(material.DialogActions,{children:[jsxRuntime.jsx(material.Button,{onClick:()=>J(false),children:u("common.cancel")}),jsxRuntime.jsx(material.Button,{variant:"contained",onClick:Wa,disabled:!pe.trim(),children:u("common.save")})]})]})]})};var Jm=(e,t,o)=>{let a=[...e,...t];return o&&a.includes(o)?o:a[0]??""},cd=(e,t)=>t&&e.some(o=>o.fieldId===t)?t:e[0]?.fieldId??"",eg=(e,t,o)=>o===""?"":o&&o!==t&&e.some(a=>a.fieldId===o)?o:e.find(a=>a.fieldId!==t)?.fieldId??"",PF=({fields:e,initialLayout:t,initialFilterSelections:o={},initialShowGrandTotal:a=true,initialConfiguratorCollapsed:r=false,initialChart:n,initialChartCollapsed:i=false,initialTableCollapsed:c=false})=>{let d=Et.useRef(0),s=Et.useMemo(()=>new Set(e.map(X=>X.id)),[e]),l=Et.useMemo(()=>new Map(e.map(X=>[X.id,X])),[e]),[g,f]=Et.useState(()=>Ht(t?.rows,s)),[p,b]=Et.useState(()=>Ht(t?.columns,s)),[v,u]=Et.useState(()=>Ht(t?.filters,s)),[w,m]=Et.useState(()=>{let X=t?.values??[],Y=new Set,J=[];return X.forEach(pe=>{!s.has(pe.fieldId)||Y.has(pe.fieldId)||(Y.add(pe.fieldId),d.current+=1,J.push({tokenId:`v${d.current}`,fieldId:pe.fieldId,aggregation:so(pe.aggregation,l.get(pe.fieldId))}));}),J}),[h,y]=Et.useState(o),[k,E]=Et.useState(a),[R,C]=Et.useState(r),[I,T]=Et.useState(()=>Jm(Ht(t?.rows,s),Ht(t?.columns,s),n?.dimensionFieldId)),[S,A]=Et.useState(()=>{let X=(()=>{let Y=t?.values??[],J=new Set,pe=[];return Y.forEach(qe=>{!s.has(qe.fieldId)||J.has(qe.fieldId)||(J.add(qe.fieldId),pe.push({tokenId:qe.fieldId,fieldId:qe.fieldId,aggregation:so(qe.aggregation,l.get(qe.fieldId))}));}),pe})();return cd(X,n?.primaryValueFieldId)}),[M,D]=Et.useState(()=>{let X=(()=>{let J=t?.values??[],pe=new Set,qe=[];return J.forEach(_e=>{!s.has(_e.fieldId)||pe.has(_e.fieldId)||(pe.add(_e.fieldId),qe.push({tokenId:_e.fieldId,fieldId:_e.fieldId,aggregation:so(_e.aggregation,l.get(_e.fieldId))}));}),qe})(),Y=cd(X,n?.primaryValueFieldId);return eg(X,Y,n?.secondaryValueFieldId)}),[B,Z]=Et.useState(n?.chartType??"bar-vertical"),[O,K]=Et.useState(i),[te,se]=Et.useState(c);Et.useEffect(()=>{f(X=>{let Y=X.filter(J=>s.has(J));return Da(X,Y)?X:Y}),b(X=>{let Y=X.filter(J=>s.has(J));return Da(X,Y)?X:Y}),u(X=>{let Y=X.filter(J=>s.has(J));return Da(X,Y)?X:Y}),m(X=>{let Y=X.filter(J=>s.has(J.fieldId)).map(J=>({...J,aggregation:so(J.aggregation,l.get(J.fieldId))}));return ql(X,Y)?X:Y});},[l,s]),Et.useEffect(()=>{T(X=>Jm(g,p,X));},[p,g]),Et.useEffect(()=>{A(X=>cd(w,X));},[w]),Et.useEffect(()=>{D(X=>eg(w,S,X));},[S,w]);let _=Et.useCallback(X=>{f(Ht(X,s));},[s]),$=Et.useCallback(X=>{b(Ht(X,s));},[s]),ue=Et.useCallback(X=>{u(Ht(X,s));},[s]),Re=Et.useCallback(X=>{m(Y=>{let J=X??[],pe=new Set,qe=[];return J.forEach(_e=>{if(!s.has(_e.fieldId)||pe.has(_e.fieldId))return;pe.add(_e.fieldId);let ut=Y.find(pt=>pt.fieldId===_e.fieldId);if(ut){qe.push({...ut,aggregation:so(_e.aggregation??ut.aggregation,l.get(_e.fieldId))});return}d.current+=1,qe.push({tokenId:`v${d.current}`,fieldId:_e.fieldId,aggregation:so(_e.aggregation,l.get(_e.fieldId))});}),qe});},[l,s]),Ae=Et.useCallback(X=>{_(X.rows??[]),$(X.columns??[]),ue(X.filters??[]),Re(X.values??[]);},[$,ue,_,Re]),ae=Et.useCallback(X=>{if(X==="rows")return f([]);if(X==="columns")return b([]);if(X==="filters")return u([]);m([]);},[]),ve=Et.useCallback((X,Y)=>{if(X==="rows")return f(J=>J.filter(pe=>pe!==Y));if(X==="columns")return b(J=>J.filter(pe=>pe!==Y));if(X==="filters")return u(J=>J.filter(pe=>pe!==Y));m(J=>J.filter(pe=>pe.tokenId!==Y));},[]),Pe=Et.useCallback((X,Y)=>{m(J=>J.map(pe=>pe.tokenId===X?{...pe,aggregation:so(Y,l.get(pe.fieldId))}:pe));},[l]),lt=Et.useCallback((X,Y)=>{y(J=>({...J,[X]:Y}));},[]),Xe=Et.useCallback(()=>{y({});},[]),Le=Et.useCallback(()=>{E(X=>!X);},[]),$e=Et.useCallback(()=>{C(X=>!X);},[]),Ne=Et.useCallback(X=>{T(X);},[]),j=Et.useCallback(X=>{A(X);},[]),de=Et.useCallback(X=>{D(X);},[]),De=Et.useCallback(()=>{K(X=>!X);},[]),Ve=Et.useCallback(()=>{se(X=>!X);},[]);return {model:Et.useMemo(()=>({rowFields:g,setRowFields:f,columnFields:p,setColumnFields:b,filterFields:v,setFilterFields:u,valueFields:w,setValueFields:m,filterSelections:h,setFilterSelections:y,showGrandTotal:k,setShowGrandTotal:E,isConfiguratorCollapsed:R,setIsConfiguratorCollapsed:C,chartDimensionFieldId:I,setChartDimensionFieldId:T,chartPrimaryValueFieldId:S,setChartPrimaryValueFieldId:A,chartSecondaryValueFieldId:M,setChartSecondaryValueFieldId:D,chartType:B,setChartType:Z,isChartCollapsed:O,setIsChartCollapsed:K,isTableCollapsed:te,setIsTableCollapsed:se}),[I,S,M,B,p,v,h,O,R,te,g,k,w]),actions:{setRows:_,setColumns:$,setFilters:ue,setValues:Re,setLayout:Ae,clearZone:ae,removeFieldFromZone:ve,setAggregationForValue:Pe,setFilterSelection:lt,resetFilterSelections:Xe,toggleGrandTotal:Le,toggleConfigurator:$e,setChartDimension:Ne,setChartPrimaryValue:j,setChartSecondaryValue:de,setChartType:Z,toggleChart:De,toggleTable:Ve}}};var BF=({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=Et.useMemo(()=>e==="auto"?r||n?"portrait":"landscape":e,[n,r,e]),[c,d]=Et.useState(t??i==="landscape");Et.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 Ak=e=>{let t=Number(e||0);return Number.isFinite(t)?t:0},LF=({rows:e,rowKey:t="id",numericField:o,defaultSelectedId:a})=>{let n=e[0]?.[t],[i,c]=Et.useState(a??n),d=Et.useMemo(()=>e.find(p=>p[t]===i)||e[0],[t,e,i]),[s,l]=Et.useState(()=>{let p=d?.[o];return p==null?"0":String(p)});return {selectedId:i,selectedRecord:d,editorValue:s,setEditorValue:l,selectRecord:p=>{let b=p[t];c(b);let v=p[o];l(v==null?"0":String(v));},applyEditorValue:p=>{if(i===void 0)return;let b=Ak(s),v=e.map(u=>u[t]===i?{...u,[o]:b}:u);p(v);}}};var $k=["code_128","ean_13","ean_8","qr_code","upc_a","upc_e"],ig=(e,t,o,a)=>{t?.(e),a&&o?.();},WF=({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=$k,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:p,sx:b})=>{let v=Et__namespace.default.useRef(null),u=Et__namespace.default.useRef(null),w=Et__namespace.default.useRef(null),m=Et__namespace.default.useRef(null),[h,y]=Et__namespace.default.useState("idle"),[k,E]=Et__namespace.default.useState(""),[R,C]=Et__namespace.default.useState(null),[I,T]=Et__namespace.default.useState(null),S=Et__namespace.default.useCallback(()=>{w.current!==null&&(window.clearInterval(w.current),w.current=null),u.current&&(u.current.getTracks().forEach(D=>D.stop()),u.current=null),v.current&&(v.current.srcObject=null);},[]),A=Et__namespace.default.useCallback(D=>{T(D),y("error"),p?.(D);},[p]);Et__namespace.default.useEffect(()=>{if(!e){S(),y("idle"),T(null),E("");return}let D=false;return (async()=>{if(!(typeof window>"u"||typeof navigator>"u")){if(!navigator.mediaDevices?.getUserMedia){y("unsupported"),T("Camera access is not supported in this browser.");return}y("starting"),T(null);try{let Z=await navigator.mediaDevices.getUserMedia({audio:!1,video:{facingMode:{ideal:n}}});if(D){Z.getTracks().forEach(O=>O.stop());return}if(u.current=Z,v.current&&(v.current.srcObject=Z,await v.current.play()),!window.BarcodeDetector){y("unsupported"),T("BarcodeDetector is not available. Camera preview is ready and manual entry is enabled.");return}m.current=new window.BarcodeDetector({formats:r}),y("ready"),w.current=window.setInterval(async()=>{if(!(!v.current||!m.current)&&!(v.current.readyState<HTMLMediaElement.HAVE_CURRENT_DATA))try{let K=(await m.current.detect(v.current)).find(se=>se.rawValue);if(!K?.rawValue)return;let te={rawValue:K.rawValue,format:K.format};C(te),S(),ig(te,f,t,c);}catch(O){A(O instanceof Error?O.message:"Failed to detect barcode.");}},d);}catch(Z){A(Z instanceof Error?Z.message:"Unable to start camera.");}}})(),()=>{D=true,S();}},[c,n,r,t,f,e,A,d,S]);let M=()=>{let D=k.trim();if(!D)return;let B={rawValue:D,format:"manual"};C(B),ig(B,f,t,c);};return jsxRuntime.jsxs(material.Dialog,{open:e,onClose:t,fullWidth:true,maxWidth:"sm",children:[jsxRuntime.jsx(material.DialogTitle,{sx:{fontSize:"1rem",fontWeight:900},children:o}),jsxRuntime.jsx(material.DialogContent,{sx:{pt:"8px !important"},children:jsxRuntime.jsxs(material.Stack,{spacing:2,sx:b,children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.88rem",color:"text.secondary",lineHeight:1.55},children:a}),jsxRuntime.jsxs(material.Paper,{elevation:0,sx:D=>({position:"relative",overflow:"hidden",borderRadius:4,border:"1px solid",borderColor:"divider",minHeight:280,background:D.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:v,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(Hk__default.default,{}),label:h==="ready"?"Camera ready":h==="starting"?"Starting camera":h==="unsupported"?"Preview only":h==="error"?"Scanner error":"Idle",size:"small",color:h==="error"?"error":"primary",variant:"filled"}),R?jsxRuntime.jsx(material.Chip,{icon:jsxRuntime.jsx(Wk__default.default,{}),label:`${R.format||"barcode"}: ${R.rawValue}`,size:"small",color:"success",variant:"filled"}):null]})]}),I?jsxRuntime.jsx(material.Alert,{severity:h==="unsupported"?"info":"warning",children:I}):null,i?jsxRuntime.jsxs(material.Stack,{direction:{xs:"column",sm:"row"},spacing:1.25,children:[jsxRuntime.jsx(material.TextField,{fullWidth:true,label:"Barcode",placeholder:g,value:k,onChange:D=>E(D.target.value)}),jsxRuntime.jsx(material.Button,{variant:"contained",onClick:M,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 qk={default:"#475569",primary:"#1d4ed8",success:"#047857",warning:"#b45309",error:"#b91c1c",info:"#0369a1"},_F=({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:p,dragHandleProps:b,onClick:v,onSwipe:u,sx:w})=>{let[m,h]=Et.useState(0),[y,k]=Et.useState(false),E=Et.useRef(null),R=Et.useRef(0),C=Et.useRef(0),I=!!(f||p),T=132,S=()=>{h(0),k(false),E.current=null,R.current=0,C.current=0;},A=O=>{(O==="start"?f:p)?.onTrigger?.(),u?.(O),S();},M=O=>{!I||O.target.closest('button, a, input, textarea, [data-no-swipe="true"]')||(E.current=O.pointerId,R.current=O.clientX,C.current=O.clientX,k(true),O.currentTarget.setPointerCapture(O.pointerId));},D=O=>{if(!y||E.current!==O.pointerId)return;C.current=O.clientX;let K=C.current-R.current,te=Math.max(-T,Math.min(T,K));h(te);},B=O=>{if(!y||E.current!==O.pointerId)return;let K=C.current-R.current;if(K>=g&&f){A("start");return}if(K<=-g&&p){A("end");return}Math.abs(K)<12&&v?.(),S();},Z=(O,K)=>{if(!O)return null;let te=O.backgroundColor||qk[O.tone||"default"];return jsxRuntime.jsx(material.Box,{sx:{position:"absolute",top:0,bottom:0,[K]:0,width:T,px:2,display:"flex",alignItems:"center",justifyContent:K==="left"?"flex-start":"flex-end",color:"#fff",background:`linear-gradient(135deg, ${te}, rgba(15,23,42,0.92))`},children:jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,alignItems:"center",children:[O.icon,jsxRuntime.jsx(material.Typography,{sx:{fontWeight:700,fontSize:"0.95rem"},children:O.label})]})})};return jsxRuntime.jsxs(material.Box,{sx:{position:"relative",overflow:"hidden",borderRadius:4,...w},children:[Z(f,"left"),Z(p,"right"),jsxRuntime.jsx(material.Paper,{elevation:0,onPointerDown:M,onPointerMove:D,onPointerUp:B,onPointerCancel:S,sx:O=>({position:"relative",zIndex:1,p:2,borderRadius:4,border:"1px solid",borderColor:d?"primary.main":"divider",background:O.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:y?"none":"transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease",touchAction:"pan-y",cursor:v?"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",...b,sx:{alignSelf:"center",display:"inline-flex",touchAction:"none"},children:jsxRuntime.jsx(material.IconButton,{size:"small",children:jsxRuntime.jsx(Kk__default.default,{})})}):null]}),r.length>0?jsxRuntime.jsx(material.Stack,{direction:"row",spacing:1,useFlexGap:true,flexWrap:"wrap",children:r.map((O,K)=>jsxRuntime.jsx(material.Chip,{label:O,size:"small",sx:{borderRadius:999,fontWeight:700,bgcolor:"action.hover",color:"text.primary"}},K))}):null,n.length>0?jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(110px, 1fr))",gap:1},children:n.map(O=>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:O.label}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1rem",fontWeight:800,lineHeight:1.2},children:O.value})]},O.id))}):null,c,i]})})]})};var Ai=({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}),oL=({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:p,sx:b})=>{let{t:v}=re(),[u,w]=Et.useState(t),m=e??u,h=S=>{e===void 0&&w(S),g?.(S);},y=S=>{c&&m.length>=c||h(`${m}${S}`);},k=S=>{if(S==="00"){if(!m){h("0");return}y("00");return}y(S);},E=()=>{!n||m.includes(".")||h(m?`${m}.`:"0.");},R=()=>{if(i){if(m.startsWith("-")){h(m.slice(1));return}h(m?`-${m}`:"-");}},C=()=>{h(m.slice(0,-1));},I=()=>{h("");},T=()=>{f?.(m);};return jsxRuntime.jsx(material.Paper,{elevation:0,sx:{p:2,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",...b},children:jsxRuntime.jsxs(material.Stack,{spacing:2,children:[jsxRuntime.jsxs(material.Stack,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[jsxRuntime.jsxs(material.Box,{sx:{minWidth:0},children:[o?jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1rem",fontWeight:800},children:o}):null,a?jsxRuntime.jsx(material.Typography,{sx:{mt:.5,fontSize:"0.86rem",color:"text.secondary"},children:a}):null]}),p?jsxRuntime.jsx(material.IconButton,{onClick:p,size:"small",children:jsxRuntime.jsx(Xk__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(S=>jsxRuntime.jsx(Ai,{label:S,onPress:()=>k(S)},S)),jsxRuntime.jsx(Ai,{label:i?"+/-":"00",onPress:i?R:()=>k("00")}),jsxRuntime.jsx(Ai,{label:"0",onPress:()=>k("0")}),jsxRuntime.jsx(Ai,{label:n?".":l?String(l):"DEL",onPress:n?E:C})]}),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:C,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(Zk__default.default,{}),jsxRuntime.jsx(material.Typography,{sx:{fontWeight:700},children:l||"DEL"})]})}),jsxRuntime.jsx(Ai,{label:String(s||"CLR"),onPress:I,emphasis:"danger"}),jsxRuntime.jsx(material.Box,{component:"button",type:"button",onClick:T,sx:S=>({minHeight:64,borderRadius:3,border:"1px solid",borderColor:"primary.main",background:S.palette.primary.main,color:"#fff",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent"}),children:jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,justifyContent:"center",alignItems:"center",children:[jsxRuntime.jsx(Yk__default.default,{}),jsxRuntime.jsx(material.Typography,{sx:{fontWeight:800},children:d||v("common.ok")})]})})]})]})})};var ug=({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(ka,{...o})})};var rS=(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);}},gg=({items:e,selectedId:t,orientation:o="auto",onItemSelect:a,sx:r})=>{let n=styles.useTheme(),[i,c]=Et.useState(false);Et.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 p=f.id===t,b=f.color||(p?n.palette.primary.main:n.palette.divider);return jsxRuntime.jsx(material.Paper,{elevation:0,sx:{overflow:"hidden",borderRadius:4,border:"1px solid",borderColor:p?"primary.main":"divider",boxShadow:p?"0 18px 40px rgba(37, 99, 235, 0.16)":"none",bgcolor:n.palette.mode==="dark"?"rgba(30,41,59,0.6)":"background.paper"},children:jsxRuntime.jsx(material.Box,{component:"button",type:"button",disabled:f.disabled,onClick:()=>rS(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:p?"#fff":"text.primary",background:p?b:"action.hover"},children:f.icon||jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1rem",fontWeight:900},children:f.title.slice(0,1).toUpperCase()})}),f.badge!==void 0?jsxRuntime.jsx(material.Box,{sx:{minWidth:34,px:1,py:.4,borderRadius:999,bgcolor:p?"primary.main":"action.hover",color:p?"#fff":"text.secondary",textAlign:"center",fontWeight:800,fontSize:"0.8rem"},children:f.badge}):null]}),jsxRuntime.jsxs(material.Box,{sx:{flex:1,minWidth:0},children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1rem",fontWeight:800,lineHeight:1.25},children:f.title}),f.caption?jsxRuntime.jsx(material.Typography,{sx:{mt:.5,fontSize:"0.74rem",fontWeight:700,color:"text.secondary"},children:f.caption}):null,f.description?jsxRuntime.jsx(material.Typography,{sx:{mt:.75,fontSize:"0.84rem",lineHeight:1.45,color:"text.secondary"},children:f.description}):null]})]})})},f.id)})})};var yg=(e,t)=>t.trim()?e.reduce((o,a)=>{let r=a.title?.toLowerCase().includes(t.toLowerCase())||a.label?.toLowerCase().includes(t.toLowerCase())||a.description?.toLowerCase().includes(t.toLowerCase()),n=a.children?yg(a.children,t):[];return (r||n.length>0)&&o.push({...a,children:n.length>0?n:a.children}),o},[]):e,bS=e=>{let t=new Set,o=a=>{a.forEach(r=>{r.children?.length&&(t.add(r.id),o(r.children));});};return o(e),t},xg=({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}=re(),f=styles.useTheme(),p=material.useMediaQuery("(orientation: portrait)"),b=material.useMediaQuery(f.breakpoints.down("md")),v=i==="auto"?p||b?"portrait":"landscape":i,u=n==="dark",w=navigation.useRouter(),m=navigation.usePathname(),[h,y]=Et.useState(""),[k,E]=Et.useState(new Set),R=Et.useMemo(()=>yg(r,h),[r,h]),C=Et.useMemo(()=>h.trim()?bS(R):k,[k,R,h]);Et.useEffect(()=>{e&&E(new Set);},[e]);let I=D=>D.appurl||D.href||"",T=D=>{l?.(D);let B=I(D);if(B){if(B.startsWith("http://")||B.startsWith("https://")){window.open(B,"_blank");return}w.push(B);}},S=D=>{let B=!!D.children?.length;if(e&&B){t?.();return}if(B){E(Z=>{let O=new Set(Z);return O.has(D.id)?O.delete(D.id):O.add(D.id),O});return}T(D);},A=D=>{let B=s||m,Z=I(D);return !!(Z&&B===Z)},M=(D,B=0)=>{let Z=!!D.children?.length,O=C.has(D.id),K=A(D);return jsxRuntime.jsx(material.Box,{sx:{pl:B===0?0:1.5},children:jsxRuntime.jsxs(material.Paper,{elevation:0,sx:{mb:1,overflow:"hidden",borderRadius:3,border:"1px solid",borderColor:K?"primary.main":"divider",bgcolor:K?"action.selected":"background.paper"},children:[jsxRuntime.jsxs(material.Box,{component:"button",type:"button",onClick:()=>S(D),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:K?"primary.main":"action.hover",color:K?"#fff":"text.primary"},children:D.icon||(D.title||D.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:D.title||D.label}),D.description?jsxRuntime.jsx(material.Typography,{sx:{mt:.4,fontSize:"0.78rem",color:"text.secondary",lineHeight:1.35},children:D.description}):null]}),Z?jsxRuntime.jsx(fS__default.default,{sx:{transform:O?"rotate(180deg)":"rotate(0deg)",transition:"transform 180ms ease"}}):jsxRuntime.jsx(hS__default.default,{color:"action"})]}),Z?jsxRuntime.jsx(material.Collapse,{in:O,children:jsxRuntime.jsx(material.Box,{sx:{px:1.25,pb:1.25},children:D.children?.map(te=>M(te,B+1))})}):null]})},D.id)};return e?jsxRuntime.jsx(material.Paper,{elevation:0,className:o,sx:{width:v==="portrait"?"100%":88,p:1,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:u?"#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(gS__default.default,{})}),r.map(D=>jsxRuntime.jsx(material.IconButton,{onClick:()=>S(D),sx:{width:56,height:56,alignSelf:"center",borderRadius:3,bgcolor:A(D)?"primary.main":"action.hover",color:A(D)?"#fff":"text.primary"},children:D.icon||(D.title||D.label||"?").slice(0,1).toUpperCase()},D.id))]})}):jsxRuntime.jsx(material.Paper,{elevation:0,className:o,sx:{width:v==="portrait"?"100%":320,p:1.25,borderRadius:5,border:"1px solid",borderColor:"divider",bgcolor:u?"#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:h,onChange:D=>y(D.target.value),placeholder:g("navigation.searchPlaceholder"),size:"small",fullWidth:true,InputProps:{startAdornment:jsxRuntime.jsx(pS__default.default,{fontSize:"small",color:"action"})}}),v==="landscape"&&!e?jsxRuntime.jsx(material.IconButton,{onClick:t,sx:{bgcolor:"action.hover"},children:jsxRuntime.jsx(mS__default.default,{})}):null]}),c,jsxRuntime.jsx(material.Box,{sx:{flex:1,minHeight:0,overflowY:"auto",pr:.25},children:R.length>0?R.map(D=>M(D)):jsxRuntime.jsx(material.Typography,{sx:{p:2,fontSize:"0.88rem",color:"text.secondary",textAlign:"center"},children:g("navigation.noMatch")})}),d]})})};var Pg=(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)},SS=e=>Et__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}),wS=(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)},TS=({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}`))})]})})},IS=e=>{let{t}=re(),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:p=false,rowsPerPageOptions:b=[20,50,100,-1],onLayoutSave:v,filterConfig:u,rowKey:w,tableKey:m="default",graphReport:h,quickCreate:y,quickEdit:k,quickDelete:E,serviceUrl:R,orientation:C="auto",cardTitleField:I,cardSubtitleFields:T,toolbarSlot:S,emptyState:A,rowHeight:M="comfortable",cardActionSlot:D,renderCardFooter:B,onRowClick:Z}=e,O=a||t("table.title.default"),K=material.useMediaQuery("(orientation: portrait)"),te=material.useMediaQuery(o.breakpoints.down("md")),se=C==="auto"?K||te?"portrait":"landscape":C,{columns:_,filterText:$,setFilterText:ue,visibleColumns:Re,showSummary:Ae,setShowSummary:ae,summaryColumns:ve,grouping:Pe,setGrouping:lt,expandedGroups:Xe,groupAnchorEl:Le,setGroupAnchorEl:$e,summaryAnchorEl:Ne,setSummaryAnchorEl:j,anchorEl:de,setAnchorEl:De,contextMenu:Ve,sortedAndFilteredRows:G,summaryRow:X,visibleRows:Y,page:J,setPage:pe,rowsPerPage:qe,setRowsPerPage:_e,totalDisplayCount:ut,setSelected:pt,handleClick:at,toggleSummaryColumn:Dt,handleExport:rt,handleCloseContextMenu:Oe,toggleColumnVisibility:Ie,toggleGroupExpand:mt,toggleGroupField:je,handleExpandGroupRecursively:Vt,handleCollapseGroupRecursively:mo,handleLayoutLoad:go,handleVariantLoad:Qt,handleLayoutSave:wt,effectiveAppId:fo,currentLayoutData:ho,currentLayoutId:bo,layoutIdToLoad:Ko,graphReportOpen:xt,handleOpenGraphReport:oo,handleCloseGraphReport:Tt}=mn(e),z=h?.enabled??false,V=z&&(h?.interaction?.enabled??true),H=ml(),ce=w||"id",me=Et__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]),Me=Et__namespace.default.useMemo(()=>({...me,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)}),[me,o]),P=Et__namespace.default.useMemo(()=>{let U=new Set(i);return G.filter(ge=>U.has(ge?.[ce]))},[ce,i,G]),N=P.length===1?P[0]:null,q=!!y?.enabled,oe=!!k?.enabled,he=!!E?.enabled,Ce=y?.fields,Se=y?.excludeFields||[],ye=y?.initialValues||{},He=k?.fields,Ge=k?.excludeFields||[],gt=k?.editableFields||[],Ye=k?.nonEditableFields||[],We=k?.primaryKeys?.length?k.primaryKeys:[ce],[Ot,$t]=Et__namespace.default.useState(false),[vt,ao]=Et__namespace.default.useState(false),[Ct,ro]=Et__namespace.default.useState({}),[qo,no]=Et__namespace.default.useState(false),[fa,Ha]=Et__namespace.default.useState(false),[io,_o]=Et__namespace.default.useState({}),[ha,zo]=Et__namespace.default.useState(false),[na,pr]=Et__namespace.default.useState(false),Gr=p||vt||fa||na,Wa=Et__namespace.default.useMemo(()=>{let U=[..._];if(Array.isArray(Ce)&&Ce.length>0){let ge=new Set(Ce);U=U.filter(ee=>ge.has(ee.id));}if(Se.length>0){let ge=new Set(Se);U=U.filter(ee=>!ge.has(ee.id));}return U.filter(ge=>!!ge?.id)},[_,Se,Ce]),mr=Et__namespace.default.useMemo(()=>{let U=[..._];if(Array.isArray(He)&&He.length>0){let ge=new Set(He);U=U.filter(ee=>ge.has(ee.id));}if(Ge.length>0){let ge=new Set(Ge);U=U.filter(ee=>!ge.has(ee.id));}return U.filter(ge=>!!ge?.id)},[_,Ge,He]),ba=Et__namespace.default.useMemo(()=>new Set(We),[We]),yo=Et__namespace.default.useMemo(()=>new Set(gt),[gt]),jo=Et__namespace.default.useMemo(()=>new Set(Ye),[Ye]),Ur=Et__namespace.default.useCallback(U=>yo.size>0?yo.has(U):!(jo.has(U)||ba.has(U)),[yo,jo,ba]);Et__namespace.default.useEffect(()=>{!xt&&H.hasActiveFilters&&H.clearAll();},[H,xt]);let gr=()=>{let U={};Wa.forEach(ge=>{U[ge.id]=ye[ge.id]??"";}),ro(U),$t(true);},Kr=(U,ge)=>{ro(ee=>({...ee,[U]:ge}));},qr=async()=>{if(!y?.onSubmit){$t(false);return}try{ao(!0),await y.onSubmit(Ct),$t(!1);}finally{ao(false);}},_r=()=>{if(!N)return;let U={};mr.forEach(ee=>{U[ee.id]=N[ee.id]??"";});let ge=k?.getInitialValues?{...U,...k.getInitialValues(N)}:U;_o(ge),no(true);},wo=(U,ge)=>{_o(ee=>({...ee,[U]:ge}));},jr=async()=>{if(N){if(!k?.onSubmit){no(false);return}try{Ha(!0),await k.onSubmit(io,N),no(!1);}finally{Ha(false);}}},Zr=()=>{P.length!==0&&zo(true);},fr=async()=>{if(P.length===0){zo(false);return}if(!E?.onConfirm){zo(false),pt([]),c?.([]);return}try{pr(!0),await E.onConfirm(P),zo(!1),pt([]),c?.([]);}finally{pr(false);}},ya=G,{fieldMapping:$a}=sn({rows:ya,config:{...h,title:h?.title||`${O} ${t("graph.reportTitle")}`}}),Ga=Et__namespace.default.useMemo(()=>V?H.applyRows(ya,$a):ya,[$a,H,V,ya]),{model:x}=sn({rows:Ga,config:{...h,title:h?.title||`${O} ${t("graph.reportTitle")}`,fieldMapping:$a}}),F=x.table.columns.map(U=>({id:U.id,label:U.label,align:U.align||"left",minWidth:120,numeric:U.align==="right"})),L=fo?jsxRuntime.jsx(kl,{appId:fo,tableKey:m,currentLayoutData:ho,onLayoutLoad:go,targetLayoutId:Ko,activeLayoutId:bo,serviceUrl:R??u?.serviceUrl}):null,Q=_.filter(U=>Re.includes(U.id)),fe=Q.find(U=>U.id===I)||Q[0],Fe=T?.map(U=>Q.find(ge=>ge.id===U)).filter(Boolean)||Q.filter(U=>U.id!==fe?.id).slice(0,se==="portrait"?2:3),W=Q.filter(U=>U.id!==fe?.id&&!Fe.some(ge=>ge.id===U.id)),le=[S,s].filter(Boolean),ie=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Xr,{groupAnchorEl:Le,setGroupAnchorEl:$e,grouping:Pe,setGrouping:lt,columns:_,toggleGroupField:je}),jsxRuntime.jsx(Yr,{anchorEl:de,setAnchorEl:De,columns:_,visibleColumns:Re,toggleColumnVisibility:Ie}),jsxRuntime.jsx(ji,{anchorEl:Ne,setAnchorEl:j,showSummary:Ae,setShowSummary:ae,columns:_,summaryColumns:ve,toggleSummaryColumn:Dt}),jsxRuntime.jsx(Zi,{contextMenu:Ve,handleCloseContextMenu:Oe,columns:_,visibleColumns:Re,toggleColumnVisibility:Ie})]}),st=(U,ge,ee)=>{let we=i.includes(ge),et=se==="portrait"?"repeat(2, minmax(0, 1fr))":"repeat(auto-fit, minmax(140px, 1fr))",ia=ee%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),Ff=styles.alpha(o.palette.divider,.22);return jsxRuntime.jsx(material.Paper,{elevation:0,onClick:()=>{at({},U),Z?.(U);},sx:{p:M==="compact"?1.25:1.5,borderRadius:4,border:"0.5px solid",borderColor:we?styles.alpha(o.palette.primary.main,.38):Ff,background:we?`linear-gradient(135deg, ${styles.alpha(o.palette.primary.main,.13)}, ${styles.alpha(o.palette.primary.main,.06)})`:`linear-gradient(135deg, ${ia}, ${styles.alpha(o.palette.primary.main,.015)})`,boxShadow:we?`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:we?o.palette.primary.main:ee%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:we,onClick:To=>To.stopPropagation(),onChange:()=>at({},U),sx:{mt:-0.6,ml:-0.6}}):null,jsxRuntime.jsxs(material.Box,{sx:{flex:1,minWidth:0},children:[fe?jsxRuntime.jsx(material.Typography,{sx:{fontSize:"1rem",fontWeight:900,lineHeight:1.25},children:Pg(fe,U)}):null,Fe.length>0?jsxRuntime.jsx(material.Stack,{direction:"row",spacing:.75,useFlexGap:true,flexWrap:"wrap",sx:{mt:.75},children:Fe.map(To=>jsxRuntime.jsx(material.Chip,{label:`${To.label}: ${wS(To,U)}`,size:"small",variant:"outlined",sx:me},`${ge}-${To.id}`))}):null]}),D?jsxRuntime.jsx(material.Box,{onClick:To=>To.stopPropagation(),children:D(U)}):null]}),W.length>0?jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:et,gap:1},children:W.map(To=>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:To.label}),SS(Pg(To,U))]},`${ge}-${To.id}-detail`))}):null,B?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsx(material.Box,{onClick:To=>To.stopPropagation(),children:B(U)})]}):null]})},ge)};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:[u?jsxRuntime.jsx(material.Box,{sx:{mb:2},children:jsxRuntime.jsx(ug,{...u,onVariantLoad:U=>{Qt(U),u.onVariantLoad?.(U);},appId:u.appId,tableKey:m,currentLayout:[{tableKey:m,layoutData:ho}],currentLayoutId:bo,layoutRefs:[{tableKey:m,layoutId:bo}],variantService:u.variantService,serviceUrl:R??u.serviceUrl,touchMode:se==="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":Gr?{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(Gi,{filterText:$,setFilterText:ue,onRowsPerPageChange:_e,rowsPerPage:qe,rowsPerPageOptions:b,page:J,count:ut,onPageChange:pe,actions:d,extraTools:le,grouping:Pe,setGroupAnchorEl:$e,showSummary:Ae,setShowSummary:ae,setAnchorEl:De,setSummaryAnchorEl:j,handleExport:rt,showCreateButton:q,onOpenCreateDialog:gr,showEditButton:oe,onOpenEditDialog:_r,editDisabled:P.length!==1,showDeleteButton:he,onOpenDeleteConfirm:Zr,deleteDisabled:P.length===0,onLayoutSave:v||u?.variantService&&u?.appId?wt:void 0,loading:p,layoutManager:L,onOpenGraphReport:z?oo: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:[Y.length===0&&!p?A||jsxRuntime.jsx(material.Paper,{elevation:0,sx:{p:4,borderRadius:4,border:"1px dashed",borderColor:"divider",textAlign:"center"},children:jsxRuntime.jsx(material.Typography,{sx:{fontSize:"0.92rem",color:"text.secondary"},children:t("common.noData")})}):null,Y.map((U,ge)=>{if(U.type==="group"){let et=Xe.has(U.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:()=>mt(U.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:[et?jsxRuntime.jsx(fS__default.default,{}):jsxRuntime.jsx(hS__default.default,{}),jsxRuntime.jsxs(material.Box,{sx:{flex:1,minWidth:0},children:[jsxRuntime.jsxs(material.Typography,{sx:{fontSize:"0.94rem",fontWeight:800},children:[U.field,": ",U.value]}),jsxRuntime.jsxs(material.Typography,{sx:{mt:.2,fontSize:"0.76rem",color:"text.secondary"},children:[U.count," records"]})]}),Pe.length>1&&U.level<Pe.length-1?jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:.5,children:[jsxRuntime.jsx(material.Chip,{size:"small",label:t("table.group.expandAll"),onClick:ia=>{ia.stopPropagation(),Vt(U.id);},sx:Me}),jsxRuntime.jsx(material.Chip,{size:"small",label:t("table.group.collapseAll"),onClick:ia=>{ia.stopPropagation(),mo(U.id);},sx:Me})]}):null]})},U.id)}let ee=U.data||U,we=U.id||ee[ce]||ge;return st(ee,we,ge)}),Ae?jsxRuntime.jsx(TS,{summaryRow:X,visibleColumns:Re,columns:_}):null,p?jsxRuntime.jsx(material.Typography,{sx:{py:1,fontSize:"0.84rem",color:"text.secondary",textAlign:"center"},children:t("common.loading")}):null]})})]}),q?jsxRuntime.jsxs(material.Dialog,{open:Ot,onClose:()=>!vt&&$t(false),fullWidth:true,maxWidth:"sm",children:[jsxRuntime.jsx(material.DialogTitle,{sx:{fontSize:"1rem",fontWeight:800},children:y?.title||t("quickCreate.createWithTitle",{title:O})}),jsxRuntime.jsx(material.DialogContent,{sx:{pt:"8px !important"},children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Wa.map(U=>{let ge=U.type==="number"||U.numeric?"number":U.type==="date"?"date":"text";return jsxRuntime.jsx(material.TextField,{label:U.label||U.id,value:Ct[U.id]??"",onChange:ee=>Kr(U.id,ee.target.value),type:ge,fullWidth:true,InputLabelProps:{shrink:ge==="date"?true:void 0}},`quick-create-${U.id}`)}),y?.description?jsxRuntime.jsx(material.Alert,{severity:"info",children:y.description}):null]})}),jsxRuntime.jsxs(material.DialogActions,{sx:{px:3,pb:2},children:[jsxRuntime.jsx(material.Button,{onClick:()=>$t(false),disabled:vt,children:y?.cancelLabel||t("common.cancel")}),jsxRuntime.jsx(material.Button,{onClick:qr,variant:"contained",disabled:vt,children:y?.submitLabel||t("common.save")})]})]}):null,oe?jsxRuntime.jsxs(material.Dialog,{open:qo,onClose:()=>!fa&&no(false),fullWidth:true,maxWidth:"sm",children:[jsxRuntime.jsx(material.DialogTitle,{sx:{fontSize:"1rem",fontWeight:800},children:k?.title||t("quickEdit.editWithTitle",{title:O})}),jsxRuntime.jsx(material.DialogContent,{sx:{pt:"8px !important"},children:jsxRuntime.jsxs(material.Box,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[mr.map(U=>{let ge=U.type==="number"||U.numeric?"number":U.type==="date"?"date":"text";return jsxRuntime.jsx(material.TextField,{label:U.label||U.id,value:io[U.id]??"",onChange:ee=>wo(U.id,ee.target.value),type:ge,disabled:!Ur(U.id),fullWidth:true,InputLabelProps:{shrink:ge==="date"?true:void 0}},`quick-edit-${U.id}`)}),k?.description?jsxRuntime.jsx(material.Alert,{severity:"info",children:k.description}):null]})}),jsxRuntime.jsxs(material.DialogActions,{sx:{px:3,pb:2},children:[jsxRuntime.jsx(material.Button,{onClick:()=>no(false),disabled:fa,children:k?.cancelLabel||t("common.cancel")}),jsxRuntime.jsx(material.Button,{onClick:jr,variant:"contained",disabled:fa||!N,children:k?.submitLabel||t("common.save")})]})]}):null,he?jsxRuntime.jsx($n,{open:ha,type:"warning",title:E?.title||t("quickDelete.confirmTitle"),message:E?.message||(P.length>1?t("quickDelete.confirmMessageMultiple",{count:P.length}):t("quickDelete.confirmMessageSingle")),confirmText:E?.confirmText||t("common.delete"),cancelText:E?.cancelText||t("common.cancel"),onClose:()=>!na&&zo(false),onConfirm:fr}):null,ie,z?jsxRuntime.jsx(ul,{open:xt,onClose:Tt,model:x,aiAssistant:h?.aiAssistant,interaction:V?{enabled:true,filters:H.filters,fieldMapping:$a,onPrimaryDimensionClick:U=>H.setFilter("primaryDimension",U),onSecondaryDimensionClick:U=>H.setFilter("secondaryDimension",U),onStatusClick:U=>H.setFilter("status",U),onClearFilter:H.clearFilter,onClearAll:H.clearAll}:void 0,tableContent:jsxRuntime.jsx(IS,{appId:fo||"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 QL=({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:p,user:b,onSearch:v,defaultNavigationOpen:u,navOpen:w,onNavOpenChange:m,onWorkloadSelect:h,locale:y="en",localeLabel:k,localeOptions:E,onLocaleChange:R,onUserSetting:C,onUserLogout:I,userMenuItems:T,leftHeaderSlot:S,rightHeaderSlot:A})=>{let M="orbcafe:page-layout-mode",[D,B]=Et.useState("system"),[Z,O]=Et.useState("light"),[K,te]=Et.useState(false),[se,_]=Et.useState(false),$=D==="system"?se?Z:"light":D;Et.useEffect(()=>{te(true);},[]),Et.useEffect(()=>{try{let Ve=window.localStorage.getItem(M);(Ve==="light"||Ve==="dark"||Ve==="system")&&B(Ve);}catch{}_(true);let de=window.matchMedia("(prefers-color-scheme: dark)"),De=()=>{O(de.matches?"dark":"light");};return De(),de.addEventListener("change",De),()=>de.removeEventListener("change",De)},[]),Et.useEffect(()=>{if(se)try{window.localStorage.setItem(M,D);}catch{}},[se,D]),Et.useEffect(()=>{$==="dark"?(document.documentElement.classList.add("dark"),document.documentElement.style.colorScheme="dark"):(document.documentElement.classList.remove("dark"),document.documentElement.style.colorScheme="light");},[$]);let ue=Et.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"}}}}}),[$]),Re=material.useMediaQuery("(orientation: portrait)"),Ae=material.useMediaQuery(ue.breakpoints.down("md")),ae=c==="auto"?!K||Re||Ae?"portrait":"landscape":c,[ve,Pe]=Et.useState({landscape:u??true,portrait:false}),lt=ve[ae],Xe=w??lt,Le=de=>{w===void 0&&Pe(De=>({...De,[ae]:de})),m?.(de);},$e=jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,alignItems:"center",children:[!K||n&&ae==="portrait"?jsxRuntime.jsx(material.IconButton,{onClick:()=>Le(!Xe),sx:{bgcolor:"action.hover"},children:jsxRuntime.jsx(gS__default.default,{})}):null,S]}),Ne=jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,alignItems:"center",children:[l,A]}),j=jsxRuntime.jsx(xg,{collapsed:ae==="landscape"?!Xe:false,onToggle:()=>Le(!Xe),menuData:o,orientation:ae,colorMode:$,maxHeight:ae==="landscape"?900:void 0});return jsxRuntime.jsx(styles.ThemeProvider,{theme:ue,children:jsxRuntime.jsx(Wi,{locale:y,children:jsxRuntime.jsxs(material.Box,{sx:[de=>({minHeight:"100vh",display:"flex",flexDirection:"column",background:de.palette.mode==="dark"?"linear-gradient(180deg, #0A0A0A 0%, #141414 55%, #1A1A1A 100%)":de.palette.background.default}),...Array.isArray(p)?p:[p]],children:[jsxRuntime.jsx($l,{appTitle:e,logo:d===void 0?null:d,mode:D,onToggleMode:()=>B(de=>de==="system"?"dark":de==="dark"?"light":"system"),locale:y,localeLabel:k,localeOptions:E,onLocaleChange:R,user:b,onUserSetting:C,onUserLogout:I,userMenuItems:T,onSearch:v,leftSlot:$e,rightSlot:Ne}),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:[K&&n&&ae==="landscape"?jsxRuntime.jsx(material.Box,{sx:{p:1.5,pr:0,flexShrink:0},children:j}):null,!K||n&&ae==="portrait"?jsxRuntime.jsx(material.Drawer,{open:Xe,onClose:()=>Le(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(gg,{items:a,selectedId:r,orientation:ae,onItemSelect:h}):null,jsxRuntime.jsx(material.Paper,{elevation:0,sx:{flex:1,minHeight:ae==="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})]})})]}),ae==="portrait"&&g?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(material.Divider,{}),jsxRuntime.jsx(material.Box,{sx:{p:1.5},children:g})]}):null]})})})};var Eg=KS__default.default(()=>Promise.resolve().then(()=>(Bg(),Ag)).then(e=>e.COrbCanvas),{ssr:false,loading:()=>jsxRuntime.jsx("div",{className:"h-full w-full bg-transparent"})});function yd({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(Eg,{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(Eg,{hue:10,hoverIntensity:.8,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})})]})})})}var iz=yd;function gs({onTextUpdate:e,onComplete:t,onError:o,wsUrl:a="ws://localhost:8765",silenceThresholdMs:r=2e3,minVolumeRms:n=.015}){let[i,c]=Et.useState(false),d=Et.useRef(null),s=Et.useRef(null),l=Et.useRef(null),g=Et.useRef(null),f=Et.useRef(null),p=Et.useRef(0),b=Et.useRef(false),v=Et.useRef(false),u=Et.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(h=>h.stop()),s.current=null),l.current&&(l.current.close(),l.current=null),v.current=false,c(false);},[]),w=Et.useCallback(()=>{b.current||(b.current=true,d.current?.readyState===WebSocket.OPEN&&d.current.send(JSON.stringify({type:"stop"})),setTimeout(u,500));},[u]),m=Et.useCallback(async()=>{if(!(i||v.current)){v.current=true,b.current=false,p.current=Date.now();try{let h=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,sampleRate:16e3,echoCancellation:!0,noiseSuppression:!0}});s.current=h;let y=new WebSocket(a);d.current=y,y.onopen=()=>{c(!0),v.current=!1;},y.onmessage=I=>{try{let T=JSON.parse(I.data);if(T.type==="recognition")T.is_final?t(T.text):e?.(T.text);else if(T.type==="error"){let S=T.message||"Voice recognition error";o?.(S),w();}}catch{o?.("Failed to parse voice message");}},y.onerror=()=>{o?.("Voice service connection failed"),u();},y.onclose=()=>{u();};let k=window.AudioContext||window.webkitAudioContext;if(!k)throw new Error("AudioContext is not supported in this browser");let E=new k({sampleRate:16e3});l.current=E;let R=E.createMediaStreamSource(h);f.current=R;let C=E.createScriptProcessor(4096,1,1);g.current=C,C.onaudioprocess=I=>{if(d.current?.readyState!==WebSocket.OPEN)return;let T=I.inputBuffer.getChannelData(0),S=0;for(let D=0;D<T.length;D+=1)S+=T[D]*T[D];if(Math.sqrt(S/T.length)>n)p.current=Date.now();else if(Date.now()-p.current>r&&!b.current){w();return}let M=new Int16Array(T.length);for(let D=0;D<T.length;D+=1){let B=Math.max(-1,Math.min(1,T[D]));M[D]=B<0?B*32768:B*32767;}d.current.send(M.buffer);},R.connect(C),C.connect(E.destination);}catch{o?.("Cannot access microphone"),u();}}},[u,i,n,t,o,e,r,w,a]);return Et.useEffect(()=>u,[u]),{isRecording:i,startRecording:m,stopRecording:w}}var Lg=Et.createContext(null);function tw(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 ow({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]=Et.useState(false),[p,b]=Et.useState(false),v=Et.useRef(null),u=Et.useRef(false),w=Et.useRef(false),m=Et.useCallback(()=>{w.current=false,f(false);},[]),{isRecording:h,startRecording:y,stopRecording:k}=gs({wsUrl:d,silenceThresholdMs:s,minVolumeRms:l,onTextUpdate:I=>{o?.(I);},onComplete:async I=>{try{I.trim()&&(b(!0),await t(I.trim()));}catch(T){let S=T instanceof Error?T.message:"Failed to process voice command";a?.(S);}finally{b(!1),m();}},onError:I=>{a?.(I),b(!1),u.current||m();}}),E=Et.useCallback(async()=>{w.current=false,await y();},[y]),R=Et.useCallback(()=>{k();},[k]);Et.useEffect(()=>{if(n)return;let I=S=>{S.isComposing||(S.code==="Space"||S.key===" ")&&(u.current||S.repeat||i&&tw(document.activeElement)||(u.current=true,S.preventDefault(),v.current=setTimeout(()=>{w.current=true,f(true),y();},r)));},T=S=>{(S.code==="Space"||S.key===" ")&&(v.current&&(clearTimeout(v.current),v.current=null),u.current=false,w.current&&(S.preventDefault(),f(false),k()));};return window.addEventListener("keydown",I),window.addEventListener("keyup",T),()=>{window.removeEventListener("keydown",I),window.removeEventListener("keyup",T),v.current&&(clearTimeout(v.current),v.current=null);}},[n,i,r,y,k]);let C=Et.useMemo(()=>({isRecording:h,isHotkeyRecording:g,isSubmitting:p,startRecording:E,stopRecording:R}),[g,h,p,E,R]);return jsxRuntime.jsxs(Lg.Provider,{value:C,children:[c?jsxRuntime.jsx(yd,{isRecording:g}):null,e]})}function aw(){let e=Et.useContext(Lg);if(!e)throw new Error("useAINav must be used within CAINavProvider");return e}var gz=ow,fz=aw;function Ke(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var dw=({content:e,theme:t="light",size:o="base",defaultExpanded:a=false})=>{let[r,n]=Et.useState(a),i=Et.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})]})},zg=dw;var yw=({content:e,language:t="text",isStreaming:o=false,className:a=""})=>{let{theme:r}=nextThemes.useTheme(),[n,i]=Et.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:Ke("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})})]})},Vg=yw;var kw=({content:e,isLoading:t,className:o="",style:a})=>{let r=Et.useRef(null),[n,i]=Et.useState(false),[c,d]=Et.useState(null),{theme:s}=nextThemes.useTheme();return Et.useEffect(()=>{let l=async()=>{if(!(!e.trim()||!r.current)){i(true),d(null);try{Hg__default.default.initialize({startOnLoad:!1,theme:s==="dark"?"dark":"default",securityLevel:"loose",fontFamily:"inherit"});let f=`mermaid-${Math.random().toString(36).substr(2,9)}`,p=e.replace(/```mermaid\n?|\n?```/g,"").trim(),{svg:b}=await Hg__default.default.render(f,p);r.current&&(r.current.innerHTML=b);}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})},$g=kw;var Rw=({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]=Et.useState(false),[f,p]=Et.useState(false),b=async()=>{if(c){p(true);try{await c();}catch(v){console.error("\u91CD\u8BD5\u5931\u8D25:",v);}finally{p(false);}}};return jsxRuntime.jsxs("div",{className:`relative w-full overflow-hidden rounded-lg border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 shadow-sm transition-all hover:shadow-md ${d}`,...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:b,disabled:f,className:"flex items-center text-xs font-medium text-red-600 dark:text-red-400 hover:text-red-700 dark:hover:text-red-300 transition-colors disabled:opacity-50",children:[jsxRuntime.jsx(lucideReact.RotateCw,{className:`w-3.5 h-3.5 mr-1.5 ${f?"animate-spin":""}`}),f?"\u91CD\u8BD5\u4E2D...":"\u91CD\u8BD5"]}),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})})]})},fs=Rw;var Fw=({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"}}},p=()=>{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"})}},b=f();return jsxRuntime.jsxs("div",{className:`relative w-full overflow-hidden rounded-lg border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 shadow-sm transition-all hover:shadow-md ${l}`,...g,children:[jsxRuntime.jsxs("div",{className:`flex p-4 border-l-4 ${b.borderLeftColor} ${b.bgColor}`,children:[jsxRuntime.jsx("div",{className:`flex-shrink-0 mr-3 ${b.iconColor}`,children:n||p()}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-1",children:[jsxRuntime.jsx("h4",{className:"text-base font-semibold text-gray-900 dark:text-gray-100",children:e}),o&&jsxRuntime.jsx("span",{className:"text-xs font-medium px-2 py-0.5 rounded-full bg-gray-100 dark:bg-gray-800 text-gray-600 dark:text-gray-400",children:o})]}),t&&jsxRuntime.jsx("div",{className:"text-sm text-gray-600 dark:text-gray-300 mb-2",children:t}),r&&r.length>0&&jsxRuntime.jsx("ul",{className:"mt-2 space-y-1",children:r.map((v,u)=>jsxRuntime.jsxs("li",{className:"flex items-start text-sm text-gray-600 dark:text-gray-300",children:[jsxRuntime.jsx("span",{className:"mr-2 mt-1.5 w-1 h-1 rounded-full bg-gray-400 dark:bg-gray-500 flex-shrink-0"}),jsxRuntime.jsx("span",{children:v})]},u))})]}),i&&c&&jsxRuntime.jsx("button",{onClick:c,className:"flex-shrink-0 ml-3 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors",children:jsxRuntime.jsx(lucideReact.X,{className:"w-4 h-4"})})]}),d&&jsxRuntime.jsx("div",{className:"bg-gray-50 dark:bg-gray-800/50 px-4 py-3 flex justify-end border-t border-gray-100 dark:border-gray-800",children:jsxRuntime.jsx("button",{onClick:d,className:"px-4 py-1.5 text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:focus:ring-offset-gray-900",children:s||"\u786E\u8BA4"})})]})},hs=Fw;var Vw=({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]=Et.useState(false),[f,p]=Et.useState(""),[b,v]=Et.useState(false),u=Et.useMemo(()=>f.trim()?o.filter(h=>h.toLowerCase().includes(f.toLowerCase())):o,[o,f]),w=Et.useMemo(()=>l?u:u.slice(0,r),[u,l,r]),m=h=>{a?.(h);};return !o||o.length===0?null:jsxRuntime.jsxs("div",{className:`w-full overflow-hidden rounded-lg border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 shadow-sm transition-all hover:shadow-md ${d}`,...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:()=>v(!b),className:`p-1.5 rounded-md transition-colors ${b?"bg-blue-100 dark:bg-blue-900/30 text-blue-600 dark:text-blue-400":"text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800"}`,title:b?"\u5173\u95ED\u641C\u7D22":"\u641C\u7D22\u95EE\u9898",children:jsxRuntime.jsx(lucideReact.Search,{className:"w-4 h-4"})}),i&&c&&jsxRuntime.jsx("button",{onClick:c,className:"text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 p-1.5 rounded-md hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors",title:"\u5173\u95ED",children:jsxRuntime.jsx(lucideReact.X,{className:"w-4 h-4"})})]})]}),b&&jsxRuntime.jsx("div",{className:"px-4 py-2 border-b border-gray-100 dark:border-gray-800 bg-gray-50 dark:bg-gray-900/50",children:jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("input",{type:"text",placeholder:"\u641C\u7D22\u76F8\u5173\u95EE\u9898...",value:f,onChange:h=>p(h.target.value),className:"w-full text-sm px-3 py-1.5 pl-8 rounded border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 focus:ring-1 focus:ring-blue-500 focus:border-blue-500 outline-none transition-shadow",autoFocus:true}),jsxRuntime.jsx(lucideReact.Search,{className:"absolute left-2.5 top-2 w-3.5 h-3.5 text-gray-400"})]})}),jsxRuntime.jsxs("div",{className:"p-2",children:[jsxRuntime.jsx("ul",{className:"space-y-1",children:w.map((h,y)=>jsxRuntime.jsx("li",{children:jsxRuntime.jsxs("button",{onClick:()=>m(h),className:"w-full text-left px-3 py-2 rounded-md text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 hover:text-blue-600 dark:hover:text-blue-400 transition-colors group flex items-start justify-between",children:[jsxRuntime.jsx("span",{children:h}),jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-4 h-4 text-gray-300 group-hover:text-blue-400 opacity-0 group-hover:opacity-100 transition-all transform group-hover:translate-x-0.5"})]})},y))}),u.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 (${u.length})`}),u.length===0&&f&&jsxRuntime.jsx("div",{className:"text-center py-4 text-sm text-gray-500 dark:text-gray-400",children:"\u6CA1\u6709\u627E\u5230\u5339\u914D\u7684\u5EFA\u8BAE"})]})]})},bs=Vw;var Kw=({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="",...p})=>{let[b,v]=Et.useState(false),[u,w]=Et.useState(true),m=()=>{switch(n){case "pending":return {iconColor:"text-blue-500",badgeBg:"bg-blue-50 dark:bg-blue-900/30",badgeText:"text-blue-600 dark:text-blue-400",label:"\u6267\u884C\u4E2D"};case "error":return {iconColor:"text-red-500",badgeBg:"bg-red-50 dark:bg-red-900/30",badgeText:"text-red-600 dark:text-red-400",label:"\u5931\u8D25"};default:return {iconColor:"text-green-500",badgeBg:"bg-green-50 dark:bg-green-900/30",badgeText:"text-green-600 dark:text-green-400",label:"\u6210\u529F"}}},h=()=>{switch(n){case "pending":return jsxRuntime.jsx(lucideReact.Loader2,{className:"w-5 h-5 animate-spin"});case "error":return jsxRuntime.jsx(lucideReact.XCircle,{className:"w-5 h-5"});default:return jsxRuntime.jsx(lucideReact.CheckCircle,{className:"w-5 h-5"})}},y=R=>R?R<1e3?`${R}ms`:`${(R/1e3).toFixed(2)}s`:"",k=m(),E=e||o||"\u5DE5\u5177\u8C03\u7528";return jsxRuntime.jsxs("div",{className:`w-full overflow-hidden rounded-lg border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 shadow-sm transition-all hover:shadow-md ${f}`,...p,children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-100 dark:border-gray-800 bg-gray-50/50 dark:bg-gray-800/50",children:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-3",children:[jsxRuntime.jsx("div",{className:`flex-shrink-0 ${k.iconColor}`,children:c||h()}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100",children:E}),jsxRuntime.jsx("span",{className:`text-[10px] font-medium px-1.5 py-0.5 rounded ${k.badgeBg} ${k.badgeText}`,children:k.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"}),y(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:()=>v(!b),className:"flex items-center text-xs font-medium text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300 mb-2",children:[b?jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3.5 h-3.5 mr-1"}):jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-3.5 h-3.5 mr-1"}),jsxRuntime.jsx(lucideReact.Box,{className:"w-3.5 h-3.5 mr-1.5"}),"\u8F93\u5165\u53C2\u6570"]}),b&&jsxRuntime.jsx("div",{className:"bg-gray-50 dark:bg-gray-950 rounded border border-gray-100 dark:border-gray-800 overflow-hidden",children:jsxRuntime.jsx("pre",{className:"p-3 text-xs font-mono text-gray-600 dark:text-gray-400 overflow-x-auto",children:JSON.stringify(a,null,2)})})]}),r&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("button",{onClick:()=>w(!u),className:"flex items-center text-xs font-medium text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300 mb-2",children:[u?jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3.5 h-3.5 mr-1"}):jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-3.5 h-3.5 mr-1"}),jsxRuntime.jsx(lucideReact.Terminal,{className:"w-3.5 h-3.5 mr-1.5"}),"\u6267\u884C\u7ED3\u679C"]}),u&&jsxRuntime.jsx("div",{className:"bg-gray-50 dark:bg-gray-950 rounded border border-gray-100 dark:border-gray-800 overflow-hidden",children:jsxRuntime.jsx("pre",{className:"p-3 text-xs font-mono text-gray-600 dark:text-gray-400 overflow-x-auto",children:typeof 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"})})]})]})},ys=Kw;var _w=({data:e})=>{if(!e)return null;let t=Et.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(Qa,{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]})})},xs=_w;var o1=({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(Qn,{data:o,orientation:r.orientation||"horizontal",valueSuffix:r.valueSuffix||"",minHeight:r.minHeight});case "line-chart-card":return jsxRuntime.jsx(Du,{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(al,{data:d,variant:r.variant||"donut",size:r.size,colors:r.colors});case "combo-chart-card":return jsxRuntime.jsx(Au,{data:o,barColor:r.barColor,lineColor:r.lineColor});case "heatmap-chart-card":return jsxRuntime.jsx(Eu,{data:o});case "fishbone-chart-card":return jsxRuntime.jsx(Lu,{branches:o,effect:r.effect||e||"Problem"});case "waterfall-chart-card":return jsxRuntime.jsx(Nu,{data:o,height:r.height});case "google-map-card":return jsxRuntime.jsx(Hu,{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(Uu,{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)})]})})]})]})},vs=o1;var r1=({type:e,manifest:t})=>jsxRuntime.jsxs("div",{className:"w-full overflow-hidden rounded-lg border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 shadow-sm transition-all hover:shadow-md",children:[jsxRuntime.jsxs("div",{className:"flex items-center px-4 py-3 border-b border-gray-100 dark:border-gray-800 bg-blue-50/50 dark:bg-blue-900/10",children:[jsxRuntime.jsx(lucideReact.Box,{className:"w-4 h-4 mr-2 text-blue-600 dark:text-blue-400"}),jsxRuntime.jsxs("h3",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100",children:["SAP Card: ",e]})]}),jsxRuntime.jsx("div",{className:"p-4",children:jsxRuntime.jsx("div",{className:"bg-gray-50 dark:bg-gray-950 p-3 rounded border border-gray-100 dark:border-gray-800 overflow-x-auto",children:jsxRuntime.jsx("pre",{className:"text-xs font-mono text-gray-600 dark:text-gray-400 whitespace-pre-wrap",children:JSON.stringify(t,null,2)})})})]}),ks=r1;var Ss=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 d1=({content:e,theme:t,size:o="base",className:a,enableCodeHighlight:r=true,enableMermaid:n=true,messageId:i,cardHooks:c})=>{let d=Et.useMemo(()=>e?e.replace(/<think>([\s\S]*?)<\/think>/g,(f,p)=>`<div data-component="thinkbox" data-think-content="${encodeURIComponent(p.trim())}"></div>`):"",[e]),s=(f,p,b,v,u)=>{c?.onCardEvent?.({messageId:i,cardType:f,action:p,title:b,payload:v,rawData:u});},l=(f,p,b,v,u,w)=>{if(!(!u&&!c?.onCardEvent))return (...m)=>{let h=u?.(...m),y=w?w(...m):void 0;return s(f,p,b,y,v),h}},g=Et.useMemo(()=>({div(f){let{"data-component":p,"data-think-content":b,...v}=f;return p==="thinkbox"&&b?jsxRuntime.jsx(zg,{content:decodeURIComponent(b),theme:t,size:o,defaultExpanded:false}):jsxRuntime.jsx("div",{...v})},table({children:f}){return jsxRuntime.jsx("div",{className:"my-4 w-full overflow-x-auto rounded-lg border border-gray-200 dark:border-gray-800",children:jsxRuntime.jsx("table",{className:"w-full min-w-[520px] border-collapse text-sm",children:f})})},thead({children:f}){return jsxRuntime.jsx("thead",{className:"bg-gray-50 dark:bg-gray-900/60",children:f})},tbody({children:f}){return jsxRuntime.jsx("tbody",{className:"bg-white dark:bg-gray-950",children:f})},tr({children:f}){return jsxRuntime.jsx("tr",{className:"border-b border-gray-200 dark:border-gray-800 last:border-b-0",children:f})},th({children:f,align:p}){return jsxRuntime.jsx("th",{className:`px-3 py-2 font-semibold text-gray-800 dark:text-gray-100 ${p==="center"?"text-center":p==="right"?"text-right":"text-left"}`,children:f})},td({children:f,align:p}){return jsxRuntime.jsx("td",{className:`px-3 py-2 text-gray-700 dark:text-gray-200 align-top ${p==="center"?"text-center":p==="right"?"text-right":"text-left"}`,children:f})},code({inline:f,className:p,children:b,...v}){let u=/language-([\w-]+)/.exec(p||""),w=u?u[1]:"";if(f)return jsxRuntime.jsx("code",{className:"font-mono text-sm bg-gray-100 dark:bg-gray-800 px-1 py-0.5 rounded text-red-600 dark:text-red-400",...v,children:b});let m=String(b).replace(/\n$/,"");if(n&&w==="mermaid")return jsxRuntime.jsx($g,{content:m});if(w==="json"){let h=Ss(m);if(h)switch(h.type){case "table":return jsxRuntime.jsx(xs,{data:h.data});case "bar-chart-card":case "line-chart-card":case "pie-chart-card":case "combo-chart-card":case "heatmap-chart-card":case "fishbone-chart-card":case "waterfall-chart-card":case "google-map-card":case "amap-card":return jsxRuntime.jsx(vs,{...h});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return jsxRuntime.jsx(ks,{...h});case "error-card":{let y=h;return jsxRuntime.jsx(fs,{...y,onClose:l("error-card","close",y.title,y,y.onClose),onRetry:l("error-card","retry",y.title,y,y.onRetry)})}case "warning-card":{let y=h,k=y.onConfirm?l("warning-card","confirm",y.title,y,y.onConfirm):y.actionText&&c?.onCardEvent?l("warning-card","confirm",y.title,y):void 0;return jsxRuntime.jsx(hs,{...y,onClose:l("warning-card","close",y.title,y,y.onClose),onConfirm:k})}case "suggestions-card":{let y=h;return jsxRuntime.jsx(bs,{...y,onClose:l("suggestions-card","close",y.title,y,y.onClose),onSuggestionClick:l("suggestions-card","suggestion-click",y.title,y,y.onSuggestionClick,k=>({suggestion:k}))})}case "tool-result-card":{let y=h;return jsxRuntime.jsx(ys,{...y,onClose:l("tool-result-card","close",y.title,y,y.onClose),onAction:l("tool-result-card","action",y.title,y,y.onAction)})}}}return r?jsxRuntime.jsx(Vg,{content:m,language:w,className:"not-prose"}):jsxRuntime.jsx("code",{className:p,...v,children:b})}}),[t,o,n,r,c,i]);return jsxRuntime.jsx("div",{className:Ke("markdown-body prose dark:prose-invert max-w-none",a),children:jsxRuntime.jsx(n1__default.default,{remarkPlugins:[i1__default.default,l1__default.default],rehypePlugins:[s1__default.default,c1__default.default],components:g,children:d})})},ws=d1;var u1=({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 p=l?.(...f),b=g?g(...f):void 0;return a(i,c,d,b,s),p}},n=Ss(e);if(n)switch(n.type){case "table":return jsxRuntime.jsx(xs,{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(vs,{...n});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return jsxRuntime.jsx(ks,{...n});case "error-card":{let i=n;return jsxRuntime.jsx(fs,{...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(hs,{...i,onClose:r("warning-card","close",i.title,i,i.onClose),onConfirm:c})}case "suggestions-card":{let i=n;return jsxRuntime.jsx(bs,{...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(ys,{...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(ws,{content:e,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:t,cardHooks:o})})},Qg=u1;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"}}},m1=({content:e,className:t="",messageId:o,cardHooks:a})=>{let r=Et__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(Qg,{content:n.content,messageId:o,cardHooks:a},`block-${i}`):jsxRuntime.jsx(ws,{content:n.content,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:o,cardHooks:a},`block-${i}`))})},Jg=m1;var g1=({content:e,isStreaming:t=true,onComplete:o,className:a="",streamIntervalMs:r=24,streamChunkSize:n=3,messageId:i,cardHooks:c})=>{let[d,s]=Et.useState(t?0:e.length),[l,g]=Et.useState(!t);Et.useEffect(()=>{if(t){s(0),g(false);return}s(e.length),g(true);},[e,t]),Et.useEffect(()=>{if(!t||l)return;if(d>=e.length){g(true),o?.();return}let u=window.setTimeout(()=>{s(w=>Math.min(w+n,e.length));},r);return ()=>{window.clearTimeout(u);}},[e.length,l,t,o,n,r,d]);let f=()=>{t&&!l&&(s(e.length),g(true),o?.());},p=t?e.slice(0,d):e,b=t&&!l,v=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(Jg,{content:p,messageId:i,cardHooks:c}),b&&jsxRuntime.jsx("span",{className:"inline-block w-0.5 h-5 bg-blue-500 ml-1 animate-pulse",style:{verticalAlign:"text-bottom"}})]}),v&&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"})]})},af=g1;var rf=({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:Ke("flex items-center gap-1",t),children:e.map((a,r)=>jsxRuntime.jsx("button",{onClick:a.onClick,disabled:a.disabled,className:Ke("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 Ts=({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(af,{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(rf,{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 lf=({onTextUpdate:e,onComplete:t,onCancel:o,disabled:a,className:r})=>{let{isRecording:n,startRecording:i,stopRecording:c}=gs({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:Ke("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(C1__default.default,{sx:{fontSize:24}}):jsxRuntime.jsx(v1__default.default,{sx:{fontSize:24}})})};var Ft={container:"w-full max-w-4xl mx-auto",inputContainer:Ke("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:Ke("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:Ke("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:Ke("bg-transparent hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-500 dark:text-gray-400","cursor-pointer active:scale-95"),sendButton:Ke("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:Ke("cursor-not-allowed opacity-40 bg-transparent text-gray-400"),stopButton:Ke("cursor-pointer bg-red-500 hover:bg-red-600 text-white shadow-sm active:scale-95")},M1={padding:0,lineHeight:"1.5",border:"none !important",boxShadow:"none !important",backgroundColor:"transparent",height:"auto",fontFeatureSettings:'"liga" 1, "kern" 1',WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},D1=({enabled:e,onClick:t})=>jsxRuntime.jsx("button",{className:Ke(Ft.buttonBase,Ft.buttonSmall,Ft.buttonNormal),onClick:t,disabled:!e,"aria-label":"Upload file",type:"button",children:jsxRuntime.jsx(P1__default.default,{sx:{fontSize:24}})}),A1=()=>jsxRuntime.jsxs("button",{className:Ke(Ft.buttonBase,"h-10 px-3 py-2 gap-1.5 rounded-full",Ft.buttonNormal),"aria-label":"Tools",type:"button",children:[jsxRuntime.jsx(R1__default.default,{sx:{fontSize:20}}),jsxRuntime.jsx("span",{className:"text-sm font-medium",children:"Tools"})]}),B1=({canSend:e,isResponding:t,onSend:o,onStop:a})=>t?jsxRuntime.jsx("button",{className:Ke(Ft.buttonBase,Ft.buttonSmall,Ft.stopButton),onClick:a,"aria-label":"Stop generating",type:"button",children:jsxRuntime.jsx(iconsMaterial.Stop,{sx:{fontSize:20}})}):jsxRuntime.jsx("button",{className:Ke(Ft.buttonBase,Ft.buttonSmall,e?Ft.sendButton:Ft.sendButtonDisabled),onClick:o,disabled:!e,"aria-label":"Send message",type:"button",children:jsxRuntime.jsx(I1__default.default,{sx:{fontSize:24},className:e?"text-gray-500 dark:text-gray-400":"text-gray-300 dark:text-gray-600"})}),sf=({onSend:e,onStop:t,isResponding:o=false,placeholder:a,getText:r})=>{let[n,i]=Et.useState(""),[c,d]=Et.useState([]),[s,l]=Et.useState(false),[g,f]=Et.useState(false),p=Et.useRef(null),b=a||(r?r("00019","Type a message..."):"Type a message..."),v=(n.trim().length>0||c.length>0)&&!o,u={enabled:true},w=Et.useCallback(B=>{i(B.target.value),B.target.style.height="auto",B.target.style.height=`${Math.min(B.target.scrollHeight,200)}px`;},[]),m=Et.useCallback(B=>{if(B.target.files&&B.target.files.length>0){let Z=Array.from(B.target.files);d(O=>{let K=Z.filter(se=>O.some(_=>_.name===se.name&&_.size===se.size));K.length>0&&console.warn("Duplicate files ignored:",K.map(se=>se.name));let te=Z.filter(se=>!O.some(_=>_.name===se.name&&_.size===se.size));return [...O,...te]}),p.current&&(p.current.value="");}},[]),h=Et.useCallback(B=>{d(Z=>Z.filter((O,K)=>K!==B));},[]),y=Et.useCallback(()=>{p.current?.click();},[]),k=Et.useCallback(async()=>{if(!v)return;let B=n,Z=[...c];i(""),d([]),p.current&&(p.current.value="");try{await e(B,Z);}catch(O){console.error("Failed to send message:",O),i(B),d(Z);}},[n,v,e,c]),E=Et.useCallback(B=>{B.key==="Enter"&&!B.shiftKey&&!s&&(B.preventDefault(),k());},[k,s]),R=Et.useCallback(()=>{l(true);},[]),C=Et.useCallback(()=>{l(false);},[]),I=Et.useCallback(B=>{i(B);},[]),T=Et.useCallback(B=>{i(B);},[]),S=Et.useCallback(()=>{},[]),A=Et.useCallback(B=>{B.preventDefault(),f(true);},[]),M=Et.useCallback(B=>{B.preventDefault(),f(false);},[]),D=Et.useCallback(B=>{if(B.preventDefault(),f(false),B.dataTransfer.files&&B.dataTransfer.files.length>0){let Z=Array.from(B.dataTransfer.files);d(O=>[...O,...Z]);}},[]);return jsxRuntime.jsx("div",{className:Ft.container,children:jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("input",{type:"file",multiple:true,className:"hidden",ref:p,onChange:m}),jsxRuntime.jsxs("div",{className:Ke(Ft.inputContainer,g&&Ft.dragActive),style:{borderRadius:"32px"},onDragOver:A,onDragLeave:M,onDrop:D,children:[c.length>0&&jsxRuntime.jsx("div",{className:Ft.filePreviewArea,children:c.map((B,Z)=>jsxRuntime.jsxs("div",{className:Ft.fileTag,children:[jsxRuntime.jsx(iconsMaterial.InsertDriveFile,{sx:{fontSize:16},className:"text-blue-500"}),jsxRuntime.jsx("span",{className:"truncate max-w-[150px]",children:B.name}),jsxRuntime.jsx("button",{onClick:()=>h(Z),className:"ml-1 hover:text-red-500 focus:outline-none",type:"button",children:jsxRuntime.jsx(iconsMaterial.Close,{sx:{fontSize:16}})})]},`${B.name}-${Z}`))}),jsxRuntime.jsxs("div",{className:"flex flex-col w-full p-2",children:[jsxRuntime.jsx("div",{className:Ke(Ft.textareaWrapper,"px-3 pt-2 pb-3 min-h-[60px]"),children:jsxRuntime.jsx("textarea",{className:Ke(Ft.textarea,"min-h-[24px] py-0 px-0"),placeholder:b,value:n,onChange:w,onKeyDown:E,onCompositionStart:R,onCompositionEnd:C,style:M1,"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(D1,{enabled:u.enabled,onClick:y}),jsxRuntime.jsx(A1,{})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lf,{onTextUpdate:I,onComplete:T,onCancel:S,disabled:o,className:Ft.buttonSmall}),jsxRuntime.jsx(B1,{canSend:v,isResponding:o,onSend:k,onStop:t})]})]})]})]})]})})};var uf=({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=Et.useRef(null),p=Et.useRef(e.length);return Et.useEffect(()=>{e.length>p.current&&f.current?.scrollIntoView({behavior:"smooth"}),p.current=e.length;},[e]),jsxRuntime.jsxs("div",{className:Ke("flex flex-col h-full w-full relative",n),children:[jsxRuntime.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-4 space-y-6 scrollbar-thin scrollbar-thumb-gray-300 dark:scrollbar-thumb-gray-600",children:[e.map((b,v)=>{let u=b.type==="assistant"&&v===e.length-1,w=b.type==="assistant"?{isLatestAssistant:u,onRegenerate:a?()=>a(b.id):void 0}:void 0;return jsxRuntime.jsx(Ts,{message:b,assistantActions:w,onStreamingComplete:()=>s?.(b.id),streamIntervalMs:c,streamChunkSize:d,cardHooks:l},b.id)}),jsxRuntime.jsx("div",{ref:f})]}),g&&jsxRuntime.jsx("div",{className:"p-4 bg-gradient-to-t from-white via-white to-transparent dark:from-gray-900 dark:via-gray-900 pb-8 z-10",children:jsxRuntime.jsx(sf,{onSend:t||(async()=>{}),onStop:o||(()=>{}),isResponding:r,placeholder:i})})]})};var Fo={};var L1={idle:"Idle",running:"Running",success:"Success",error:"Error",pending:"Pending"},HV=({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:Ke("relative flex h-full w-full",Fo.agentPanel,a),"data-status":c,children:[jsxRuntime.jsx("div",{className:Fo.colorHalo,"data-status":c,"aria-hidden":"true"}),jsxRuntime.jsxs("div",{className:Fo.marqueeBorder,"data-status":c,"aria-hidden":"true",children:[jsxRuntime.jsx("span",{className:Ke(Fo.edge,Fo.top)}),jsxRuntime.jsx("span",{className:Ke(Fo.edge,Fo.right)}),jsxRuntime.jsx("span",{className:Ke(Fo.edge,Fo.bottom)}),jsxRuntime.jsx("span",{className:Ke(Fo.edge,Fo.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:Fo.statusDot,"data-status":c}),jsxRuntime.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-gray-600 dark:text-gray-300",children:L1[c]})]}),o]})]}),jsxRuntime.jsx("div",{className:"flex-1 min-h-0 relative z-10",children:jsxRuntime.jsx(uf,{...i,showInput:n})})]})]})};var H1={"top-left":"bottom-right","top-right":"bottom-left","bottom-left":"top-right","bottom-right":"top-left"},jV=({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:p,onMessageStreamingComplete:b,cardHooks:v})=>{let[u,w]=Et.useState(""),[m,h]=Et.useState(false),y=Et.useRef(null),k=H1[c];Et.useEffect(()=>{y.current?.scrollIntoView({behavior:"smooth"});},[e,a]);let E=Et.useCallback(async()=>{let C=u.trim();!C||a||(w(""),await t(C));},[a,t,u]),R=Et.useCallback(async C=>{C.key==="Enter"&&!m&&(C.preventDefault(),await E());},[E,m]);return jsxRuntime.jsxs("div",{className:Ke("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:Ke("absolute z-20 flex h-10 w-10 items-center justify-center rounded-full transition-colors hover:bg-transparent dark:hover:bg-transparent",k==="top-left"&&"-left-2 -top-2",k==="top-right"&&"-right-2 -top-2",k==="bottom-left"&&"-bottom-2 -left-2",k==="bottom-right"&&"-bottom-2 -right-2"),type:"button","aria-label":"Collapse Copilot",children:jsxRuntime.jsx("span",{className:Ke("block h-4 w-4 border-[#21BCFF]",k==="top-left"&&"rounded-tl-full border-l-[3px] border-t-[3px]",k==="top-right"&&"rounded-tr-full border-r-[3px] border-t-[3px]",k==="bottom-left"&&"rounded-bl-full border-b-[3px] border-l-[3px]",k==="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((C,I)=>{let T=C.type==="assistant"&&I===e.length-1,S=C.type==="assistant"?{isLatestAssistant:T,onRegenerate:o?()=>o(C.id):void 0}:void 0;return jsxRuntime.jsx(Ts,{message:C,assistantActions:S,onStreamingComplete:()=>b?.(C.id),streamIntervalMs:f,streamChunkSize:p,cardHooks:v},C.id)}),jsxRuntime.jsx("div",{ref:y})]}),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:u,onChange:C=>w(C.target.value),onCompositionStart:()=>h(true),onCompositionEnd:()=>h(false),onKeyDown:R,"aria-label":"Copilot input",spellCheck:false}),jsxRuntime.jsx("button",{className:"flex h-8 w-8 items-center justify-center rounded-full text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-700 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-gray-200",onClick:g,type:"button","aria-label":"Microphone",children:jsxRuntime.jsx(lucideReact.Mic,{className:"h-4 w-4"})})]})})]})};var W1=["#ff3860","#24e070","#3090ff"],$1=`
199
199
  .orbcafe-ai-browser-glow {
200
200
  position: fixed;
201
201
  inset: 0;
@@ -249,4 +249,4 @@ ${o}: ${(a??r)(u.secondaryValue??0)}`:""]})}),jsxRuntime.jsx("text",{x:u.x,y:Mat
249
249
  0%, 100% { opacity: 0.68; }
250
250
  50% { opacity: 0.98; }
251
251
  }
252
- `,UV=({active:e=false,colors:t=E1,zIndex:o=2147483e3})=>{let r={"--orbcafe-ai-glow-a":t[0],"--orbcafe-ai-glow-b":t[1],"--orbcafe-ai-glow-c":t[2],"--orbcafe-ai-glow-z-index":o};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("style",{children:F1}),jsxRuntime.jsx("div",{className:"orbcafe-ai-browser-glow","data-active":e?"true":"false",style:r,"aria-hidden":"true"})]})};var jV=({defaultMode:e="login",onLogin:t,onRegister:o,onForgotPassword:r}={})=>{let[a,n]=Rt.useState(e),[i,c]=Rt.useState(false),d=Rt.useCallback(async m=>{c(true);try{await m?.();}finally{c(false);}},[]),l=Rt.useCallback(m=>d(()=>t?.(m)),[t,d]),s=Rt.useCallback(m=>d(()=>o?.(m)),[o,d]),g=Rt.useCallback(m=>d(()=>r?.(m)),[r,d]),f=Rt.useMemo(()=>({mode:a,loading:i,onModeChange:n,onLogin:l,onRegister:s,onForgotPassword:g}),[g,l,s,i,a]);return {mode:a,loading:i,setMode:n,authPageProps:f}};var wd=({label:e,...t})=>jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{...t}),label:e});var Ai=Rt.forwardRef((e,t)=>jsxRuntime.jsx(material.Paper,{ref:t,...e,elevation:e.elevation||1,sx:{p:2,mb:2,...e.sx}}));Ai.displayName="CPaper";var Z1={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."},gO=({mode:e,defaultMode:t="login",onModeChange:o,onLogin:r,onRegister:a,onForgotPassword:n,loading:i=false,logo:c,copy:d,sx:l})=>{let s=material.useTheme(),g=e!==void 0,[f,m]=Rt.useState(t),b=e??f,C=Rt.useMemo(()=>({...Z1,...d}),[d]),[u,v]=Rt.useState({username:"demo@orbcafe.local",password:"orbcafe-demo",remember:true}),[p,h]=Rt.useState({name:"",email:"",password:"",confirmPassword:"",acceptedTerms:false}),[y,S]=Rt.useState({email:""}),[E,P]=Rt.useState(""),k=D=>{g||m(D),P(""),o?.(D);},R=async D=>{D.preventDefault(),await r?.(u),P("Demo login accepted. No real authentication request was sent.");},I=async D=>{D.preventDefault(),await a?.(p),P("Demo registration saved locally for this screen.");},w=async D=>{D.preventDefault(),await n?.(y),P("Demo reset link request created. No email was sent.");},A=b==="login"?C.loginTitle:b==="register"?C.registerTitle:C.forgotTitle,M=b==="login"?C.loginSubtitle:b==="register"?C.registerSubtitle:C.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:C.productName}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:{md:34,lg:42},lineHeight:1.06,fontWeight:800},children:C.headline}),jsxRuntime.jsx(material.Typography,{sx:{maxWidth:460,color:"text.secondary",fontSize:16,lineHeight:1.7},children:C.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(Ai,{elevation:0,sx:{width:"100%",maxWidth:460,m:0,p:{xs:2.5,sm:4},borderRadius:3,border:`1px solid ${s.palette.divider}`,backgroundColor:s.palette.mode==="dark"?"rgba(15, 23, 42, 0.86)":"rgba(255, 255, 255, 0.88)",backdropFilter:"blur(18px)",boxShadow:s.palette.mode==="dark"?"0 24px 80px rgba(0,0,0,0.34)":"0 24px 80px rgba(15,23,42,0.10)"},children:jsxRuntime.jsxs(material.Stack,{spacing:3,children:[jsxRuntime.jsxs(material.Stack,{spacing:1,children:[jsxRuntime.jsx(material.Box,{sx:{display:{xs:"block",md:"none"},mb:1},children:c}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:28,fontWeight:800},children:A}),jsxRuntime.jsx(material.Typography,{sx:{color:"text.secondary"},children:M})]}),E&&jsxRuntime.jsx(material.Alert,{severity:"success",children:E}),b==="login"&&jsxRuntime.jsx(material.Box,{component:"form",onSubmit:R,children:jsxRuntime.jsxs(material.Stack,{spacing:2,children:[jsxRuntime.jsx(io,{label:"Email or user ID",value:u.username,onChange:D=>v(B=>({...B,username:D.target.value})),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(df__default.default,{fontSize:"small"})})}}),jsxRuntime.jsx(io,{label:"Password",type:"password",value:u.password,onChange:D=>v(B=>({...B,password:D.target.value})),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(_1__default.default,{fontSize:"small"})})}}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:2},children:[jsxRuntime.jsx(wd,{label:"Remember me",checked:u.remember,onChange:D=>v(B=>({...B,remember:D.target.checked}))}),jsxRuntime.jsx(jo,{type:"button",variant:"text",size:"small",onClick:()=>k("forgot"),children:"Forgot?"})]}),jsxRuntime.jsx(jo,{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(jo,{type:"button",variant:"text",size:"small",onClick:()=>k("register"),sx:{minWidth:0,p:0},children:"Register"})]})]})}),b==="register"&&jsxRuntime.jsx(material.Box,{component:"form",onSubmit:I,children:jsxRuntime.jsxs(material.Stack,{spacing:2,children:[jsxRuntime.jsx(io,{label:"Full name",value:p.name,onChange:D=>h(B=>({...B,name:D.target.value})),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(df__default.default,{fontSize:"small"})})}}),jsxRuntime.jsx(io,{label:"Work email",type:"email",value:p.email,onChange:D=>h(B=>({...B,email:D.target.value})),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(cf__default.default,{fontSize:"small"})})}}),jsxRuntime.jsx(io,{label:"Password",type:"password",value:p.password,onChange:D=>h(B=>({...B,password:D.target.value})),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(j1__default.default,{fontSize:"small"})})}}),jsxRuntime.jsx(io,{label:"Confirm password",type:"password",value:p.confirmPassword,onChange:D=>h(B=>({...B,confirmPassword:D.target.value}))}),jsxRuntime.jsx(wd,{label:"I accept the demo workspace terms",checked:p.acceptedTerms,onChange:D=>h(B=>({...B,acceptedTerms:D.target.checked}))}),jsxRuntime.jsx(jo,{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(jo,{type:"button",variant:"text",size:"small",onClick:()=>k("login"),sx:{minWidth:0,p:0},children:"Sign in"})]})]})}),b==="forgot"&&jsxRuntime.jsx(material.Box,{component:"form",onSubmit:w,children:jsxRuntime.jsxs(material.Stack,{spacing:2,children:[jsxRuntime.jsx(io,{label:"Work email",type:"email",value:y.email,onChange:D=>S({email:D.target.value}),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(cf__default.default,{fontSize:"small"})})}}),jsxRuntime.jsx(jo,{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(jo,{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 Q1={keyword:{value:"",operator:"contains"},status:{value:"",operator:"equals"},owner:{value:"",operator:"contains"},workCenter:{value:"",operator:"contains"}},J1=[{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"}],uf=({tasks:e,defaultScale:t="week",defaultSelectedTaskId:o,initialFilters:r,filterFields:a,filterAppId:n="planning-gantt-filter",filterTableKey:i="planning",columns:c,page:d,rowsPerPage:l,rowsPerPageOptions:s,count:g,onPageChange:f,onRowsPerPageChange:m,onFilterSearch:b,onFilterVariantLoad:C,enableRowReorder:u,onTaskReorder:v})=>{let[p,h]=Rt.useState(t),[y,S]=Rt.useState(o??e[0]?.id??""),[E,P]=Rt.useState({...Q1,...r}),k=Rt.useMemo(()=>{let A=String(E.keyword?.value??"").trim().toLowerCase(),M=String(E.status?.value??"").trim(),D=String(E.owner?.value??"").trim().toLowerCase(),B=String(E.workCenter?.value??"").trim().toLowerCase(),j=E.dateRange?.value,W=j?.[0]?mr__default.default(j[0]):null,q=j?.[1]?mr__default.default(j[1]):null;return e.filter(ee=>{if(A&&![ee.id,ee.code,ee.title,ee.project,ee.workCenter,ee.owner?.name].join(" ").toLowerCase().includes(A)||M&&ee.status!==M||D&&!String(ee.owner?.name??"").toLowerCase().includes(D)||B&&!String(ee.workCenter??"").toLowerCase().includes(B))return false;if(W||q){let le=mr__default.default(ee.startDate),_=mr__default.default(ee.endDate),U=W?_.isAfter(W)||_.isSame(W,"day"):true,ge=q?le.isBefore(q)||le.isSame(q,"day"):true;if(!U||!ge)return false}return true})},[E,e]);Rt.useEffect(()=>{k.length!==0&&(k.some(A=>A.id===y)||S(k[0].id));},[k,y]);let R=Rt.useCallback(A=>{S(A.id);},[]),I=Rt.useMemo(()=>({appId:n,tableKey:i,fields:a??J1,filters:E,onFilterChange:P,onVariantLoad:C??(()=>{}),onSearch:b??(()=>{})}),[n,a,i,E,b,C]),w=Rt.useMemo(()=>({tasks:k,columns:c,scale:p,onScaleChange:h,page:d,rowsPerPage:l,rowsPerPageOptions:s,count:g,onPageChange:f,onRowsPerPageChange:m,selectedTaskId:y,onTaskSelect:R,enableRowReorder:u,onTaskReorder:v}),[c,g,u,k,f,m,v,R,d,l,s,p,y]);return {scale:p,setScale:h,selectedTaskId:y,setSelectedTaskId:S,filters:E,setFilters:P,filteredTasks:k,smartFilterProps:I,planningGanttProps:w}};var kO=e=>{let t=uf(e),o=Rt.useMemo(()=>({filterProps:t.smartFilterProps,ganttProps:t.planningGanttProps}),[t.planningGanttProps,t.smartFilterProps]);return {...t,layoutProps:o}};var pf=e=>jsxRuntime.jsx(material.Chip,{...e,size:e.size||"small",variant:e.variant||"outlined"});var ia=Rt.forwardRef(({tooltip:e,...t},o)=>{let r=jsxRuntime.jsx(material.IconButton,{ref:o,...t,size:t.size||"small"});return e?jsxRuntime.jsx(material.Tooltip,{title:e,children:r}):r});ia.displayName="CIconButton";var gf=({label:e,options:t,minWidth:o=120,...r})=>jsxRuntime.jsxs(material.FormControl,{fullWidth:true,size:"small",sx:{minWidth:o},children:[e&&jsxRuntime.jsx(material.InputLabel,{children:e}),jsxRuntime.jsx(material.Select,{label:e,...r,children:t.map(a=>jsxRuntime.jsx(material.MenuItem,{value:a.value,children:a.label},a.value))})]});mr__default.default.extend(uT__default.default);var Dd=[{value:"hour",label:"Hour",width:56},{value:"day",label:"Day",width:46},{value:"week",label:"Week",width:78},{value:"month",label:"Month",width:104}],Md=56,Va=58,Is=8,Ad=260,FT=320,Ps="0.85rem",la="220ms cubic-bezier(0.2, 0, 0, 1)",xf={"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"}},LT=e=>e?xf[e]?.label??e:"Planned",zT=e=>e?xf[e]?.color??"default":"info",vf=e=>Math.min(100,Math.max(0,e??0)),Cf=(e,t=0)=>e.flatMap(o=>[{...o,level:t},...Cf(o.children??[],t+1)]),NT=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:LT(e.status),statusTone:e.status??"planned",progress:vf(e.progress),startDate:e.startDate,endDate:e.endDate,color:e.color,reorderable:e.reorderable!==false}),kf=(e,t)=>t==="month"?e.startOf("month"):t==="week"?e.startOf("week"):t==="day"?e.startOf("day"):e.startOf("hour"),Sf=(e,t)=>t==="month"?e.endOf("month"):t==="week"?e.endOf("week"):t==="day"?e.endOf("day"):e.endOf("hour"),VT=(e,t,o)=>{let r=[],a=kf(e,o),n=Sf(t,o);for(;a.isBefore(n)||a.isSame(n);){let i=o==="month"?a.add(1,"month"):o==="week"?a.add(1,"week"):o==="day"?a.add(1,"day"):a.add(1,"hour");r.push({key:`${o}-${a.valueOf()}`,label:o==="month"?a.format("MMM YYYY"):o==="week"?a.format("MMM D"):o==="day"?a.format("D"):a.format("HH:mm"),contextLabel:o==="hour"?a.format("MMM D"):o==="day"?a.format("MMM"):o==="week"?`W${a.isoWeek()}`:void 0,title:o==="hour"?a.format("MMM D, YYYY HH:mm"):o==="day"?a.format("MMM D, YYYY"):o==="week"?`${a.format("MMM D, YYYY")} - Week ${a.isoWeek()}`:void 0,start:a,end:i}),a=i;}return r},Bd=(e,t,o)=>{let r=0;for(let a of t){if(e.isBefore(a.start))return r;if(e.isBefore(a.end)){let n=Math.max(1,a.end.valueOf()-a.start.valueOf()),i=Math.max(0,e.valueOf()-a.start.valueOf());return r+i/n*o}r+=o;}return r},wf=({title:e="Project Plan",extraTools:t,bodyHeight:o=560,tasks:r,columns:a,scale:n="week",onScaleChange:i,page:c,rowsPerPage:d=20,rowsPerPageOptions:l=[20,50,100,-1],count:s,onPageChange:g,onRowsPerPageChange:f,timelineStart:m,timelineEnd:b,selectedTaskId:C,onTaskSelect:u,enableRowReorder:v=true,onTaskReorder:p,emptyLabel:h="No planning tasks available.",sx:y})=>{let S=material.useTheme(),{t:E}=te(),P=Rt.useRef(null),k=Rt.useRef(null),R=Rt.useRef(null),I=Rt.useRef(false),[w,A]=Rt.useState(null),[M,D]=Rt.useState("content"),[B,j]=Rt.useState(null),[W,q]=Rt.useState({}),[ee,le]=Rt.useState(Md),[_,U]=Rt.useState([]),[ge,Me]=Rt.useState({activeId:null,overId:null}),[Ee,ie]=Rt.useState(null),[Re,Be]=Rt.useState(false),lt=core.useSensors(core.useSensor(core.PointerSensor,{activationConstraint:{distance:4}})),Ze=Rt.useRef(null),Oe=Rt.useMemo(()=>Cf(r),[r]),qe=Rt.useMemo(()=>{if(_.length===0)return Oe;let T=new Map(Oe.map(J=>[J.id,J])),N=_.map(J=>T.get(J)).filter(J=>!!J),K=new Set(N.map(J=>J.id));return [...N,...Oe.filter(J=>!K.has(J.id))]},[Oe,_]),ot=Rt.useMemo(()=>new Map(qe.map(T=>[T.id,T])),[qe]),Z=Rt.useMemo(()=>qe.map(T=>NT(T)),[qe]),se=Rt.useMemo(()=>new Map(Z.map(T=>[T.id,T])),[Z]),Ae=Rt.useMemo(()=>[{id:"code",label:"ID",minWidth:90},{id:"title",label:"Task",minWidth:260,render:(T,N)=>jsxRuntime.jsxs(material.Stack,{spacing:.2,children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:15,fontWeight:700,lineHeight:1.2},children:N.title}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:13,color:"text.secondary"},children:N.titleSub})]})},{id:"owner",label:"Owner",minWidth:170},{id:"status",label:"Status",minWidth:130,render:(T,N)=>jsxRuntime.jsx(pf,{label:N.status,color:zT(N.statusTone),size:"small"})},{id:"progress",label:"Progress",minWidth:140,numeric:true,render:T=>jsxRuntime.jsxs(material.Stack,{spacing:.6,children:[jsxRuntime.jsxs(material.Typography,{variant:"caption",sx:{color:"text.secondary"},children:[T,"%"]}),jsxRuntime.jsx(material.LinearProgress,{variant:"determinate",value:T,sx:{height:6,borderRadius:999}})]})},{id:"startDate",label:"Start",minWidth:120},{id:"endDate",label:"End",minWidth:120}],[]),He=Rt.useMemo(()=>{if(!a||a.length===0)return Ae;let T=new Map(Ae.map(N=>[N.id,N]));return a.map(N=>{let K=T.get(N.id),J=N.width??K?.minWidth??120,pe={id:N.id,label:N.label,minWidth:J};if(K?.numeric&&(pe.numeric=true),N.render){let be=N.render;return pe.render=(xe,fe)=>{let ze=ot.get(fe.id);return be(ze||fe)},pe}return K?.render?(pe.render=K.render,pe):(pe.render=(be,xe)=>{let fe=xe[N.id];if(fe!=null&&String(fe).length>0)return String(fe);let We=ot.get(xe.id)?.[N.id];return We!=null&&String(We).length>0?String(We):"-"},pe)})},[a,Ae,ot]),G=cn({appId:"planning-gantt",title:e,columns:He,rows:Z,rowKey:"id",page:c,rowsPerPage:d,rowsPerPageOptions:l,count:s??Z.length,onPageChange:g,onRowsPerPageChange:f,showSummary:false}),X=G.visibleRows,Ie=G.rowsPerPage===-1?1:Math.max(1,Math.ceil(G.totalDisplayCount/G.rowsPerPage)),ke=Math.max(0,Math.min(G.page,Ie-1)),Fe=Math.min(ke+1,Ie),rt=ke>0,Xe=ke<Ie-1&&G.rowsPerPage!==-1;Rt.useEffect(()=>{let T=Oe.map(N=>N.id);U(N=>{let K=new Set(T),J=N.filter(fe=>K.has(fe)),pe=new Set(J),be=T.filter(fe=>!pe.has(fe)),xe=[...J,...be];return xe.length===N.length&&xe.every((fe,ze)=>fe===N[ze])?N:xe});},[Oe]);let eo=T=>T.type==="group"?`group-${T.id}`:`row-${(T.data||T)?.id}`,Zt=Rt.useMemo(()=>{let T=Z.map(ze=>mr__default.default(ze.startDate)),N=Z.map(ze=>mr__default.default(ze.endDate)),K=m?mr__default.default(m):T.reduce((ze,We)=>We.isBefore(ze)?We:ze,T[0]??mr__default.default()),J=b?mr__default.default(b):N.reduce((ze,We)=>We.isAfter(ze)?We:ze,N[0]??mr__default.default().add(30,"day")),pe=n==="month"?"month":n==="week"?"week":n==="day"?"day":"hour",be=n==="month"?"month":n==="week"?"week":n==="day"?"day":"hour",xe=n==="hour"?12:1,fe=n==="hour"?12:1;return {start:kf(K.subtract(xe,pe),n),end:Sf(J.add(fe,be),n)}},[Z,n,b,m]),Tt=Dd.find(T=>T.value===n)??Dd[1],po=Array.isArray(t)?t:t?[t]:[],Et=Rt.useMemo(()=>VT(Zt.start,Zt.end,n),[Zt.end,Zt.start,n]),Ne=Et.length*Tt.width,we=(G.columns||[]).filter(T=>G.visibleColumns.includes(T.id)).reduce((T,N)=>T+(G.columnWidths?.[N.id]||N.minWidth||100),0),yt=M==="manual"&&w!==null?w:we,_e=B==="table",Ft=B==="timeline",mo=Ft?0:_e||M==="even"?"100%":yt,go=B==="timeline",Xt=B==="table",xt=!go&&!Xt,fo=_e?"minmax(0, 1fr) 0px 0px":Ft?"0px 0px minmax(0, 1fr)":M==="even"?`minmax(0, 1fr) ${Is}px minmax(0, 1fr)`:`${yt}px ${Is}px minmax(0, 1fr)`,ho=()=>{let T=P.current?.clientWidth??0;return T>0?Math.max(Ad,T-Is-FT):Math.max(Ad,we)},bo=T=>Math.min(Math.max(T,Ad),ho());Rt.useEffect(()=>{M==="manual"&&A(T=>T===null?null:bo(T));},[M,we]);let Uo=T=>{T.preventDefault(),T.currentTarget.setPointerCapture(T.pointerId),j(null),D("manual"),Ze.current={startX:T.clientX,startWidth:k.current?.getBoundingClientRect().width??yt};let N=J=>{let pe=Ze.current;if(!pe)return;let be=bo(pe.startWidth+J.clientX-pe.startX);A(be);},K=()=>{Ze.current=null,window.removeEventListener("pointermove",N),window.removeEventListener("pointerup",K),document.body.style.cursor="",document.body.style.userSelect="";};document.body.style.cursor="col-resize",document.body.style.userSelect="none",window.addEventListener("pointermove",N),window.addEventListener("pointerup",K);},mt=()=>{j(null),D("even"),A(null);},to=T=>!v||!T?false:se.get(T)?.reorderable!==false,vt=(T,N)=>{if(!T||!N||T===N||!to(T)||!to(N))return false;if(G.grouping.length===0)return true;let K=se.get(T),J=se.get(N);return !K||!J?false:G.grouping.every(pe=>K[pe]===J[pe])},z=(T,N)=>{if(!vt(T,N))return;let K=X.filter(Ke=>Ke.type!=="group").map(Ke=>String((Ke.data||Ke)?.id)),J=K.indexOf(T),pe=K.indexOf(N);if(J<0||pe<0)return;let be=[...K];[be[J],be[pe]]=[be[pe],be[J]];let xe=new Set(K),fe=qe.map(Ke=>Ke.id),ze=[...be,...fe.filter(Ke=>!xe.has(Ke))],We=ot.get(T),st=ot.get(N);if(G.setOrder("asc"),G.setOrderBy(""),U(ze),We&&st){let{level:Ke,...Ve}=We,{level:Lt,...Ot}=st,gt=ze.reduce((oo,ft)=>{let ro=ot.get(ft);if(ro){let{level:Ko,...ao}=ro;oo.push(ao);}return oo},[]);p?.(gt,{activeTask:Ve,targetTask:Ot});}},V=(T,N)=>{if(!to(N.id)){T.preventDefault();return}T.stopPropagation(),T.dataTransfer.effectAllowed="move",T.dataTransfer.setData("text/plain",N.id),Me({activeId:N.id,overId:null}),u?.(ot.get(N.id)||N);},O=(T,N)=>{if(!vt(ge.activeId,N)){Me(K=>K.overId===null?K:{...K,overId:null});return}T.preventDefault(),T.stopPropagation(),T.dataTransfer.dropEffect="move",Me(K=>K.overId===N?K:{...K,overId:N});},ne=(T,N)=>{let K=ge.activeId||T.dataTransfer.getData("text/plain");if(!vt(K,N)){Me({activeId:null,overId:null});return}T.preventDefault(),T.stopPropagation(),z(K,N),Me({activeId:null,overId:null});},ce=()=>{Me({activeId:null,overId:null});},Se=T=>{if(I.current)return;let N=T==="table"?k.current:R.current,K=T==="table"?R.current:k.current;!N||!K||(I.current=true,K.scrollTop=N.scrollTop,window.requestAnimationFrame(()=>{I.current=false;}));};return Rt.useLayoutEffect(()=>{if(!C||Xt)return;let T=R.current,N=k.current;if(!T)return;let K=`row-${C}`,J=Array.from(T.querySelectorAll("[data-planning-timeline-row-key]")).find(xe=>xe.dataset.planningTimelineRowKey===K),pe=se.get(C);if(!J||!pe)return;let be=window.requestAnimationFrame(()=>{let xe=T.getBoundingClientRect(),fe=J.getBoundingClientRect(),ze=Math.max(1,T.clientHeight-ee),We=T.scrollTop+fe.top-xe.top-ee-(ze-fe.height)/2;I.current=true,T.scrollTop=Math.max(0,We),N&&!go&&(N.scrollTop=T.scrollTop);let st=Bd(mr__default.default(pe.startDate),Et,Tt.width),Ke=Math.max(0,st-Tt.width);T.scrollLeft=Math.min(Ke,Math.max(0,Ne-T.clientWidth)),window.requestAnimationFrame(()=>{I.current=false;});});return ()=>window.cancelAnimationFrame(be)},[Tt.width,ee,C,go,se,Xt,X,Ne,Et]),Rt.useLayoutEffect(()=>{let T=k.current;if(!T)return;let N=0,K=0,J=false,pe=()=>{if(J)return;let Lt=T.querySelector("thead"),Ot=Array.from(T.querySelectorAll("tbody tr[data-planning-row-key]"));if(Ot.length===0)return;let gt=Lt?.getBoundingClientRect().height||Md,oo={};Ot.forEach(ft=>{let ro=ft.dataset.planningRowKey;ro&&(oo[ro]=ft.getBoundingClientRect().height);}),le(ft=>Math.abs(ft-gt)<.01?ft:gt),q(ft=>{let ro=Object.keys(ft),Ko=Object.keys(oo);return ro.length===Ko.length&&Ko.every(ao=>Math.abs((ft[ao]??0)-oo[ao])<.01)?ft:oo});},be=()=>{window.cancelAnimationFrame(N),N=window.requestAnimationFrame(pe);};if(pe(),window.cancelAnimationFrame(K),K=window.requestAnimationFrame(()=>{K=window.requestAnimationFrame(pe);}),typeof document<"u"&&document.fonts?.ready&&document.fonts.ready.then(()=>{J||be();}).catch(()=>{}),typeof ResizeObserver>"u")return window.addEventListener("resize",be),()=>{J=true,window.cancelAnimationFrame(N),window.cancelAnimationFrame(K),window.removeEventListener("resize",be);};let xe=new ResizeObserver(be),fe=T.querySelector("table"),ze=T.querySelector("tbody"),We=T.querySelector("thead");fe&&xe.observe(fe),We&&xe.observe(We);let st=new WeakSet,Ke=()=>{T.querySelectorAll("tbody tr[data-planning-row-key]").forEach(Lt=>{st.has(Lt)||(xe.observe(Lt),st.add(Lt));});};Ke();let Ve=null;return ze&&typeof MutationObserver<"u"&&(Ve=new MutationObserver(()=>{Ke(),be();}),Ve.observe(ze,{childList:true,subtree:true,characterData:true})),window.addEventListener("resize",be),()=>{J=true,window.cancelAnimationFrame(N),window.cancelAnimationFrame(K),xe.disconnect(),Ve?.disconnect(),window.removeEventListener("resize",be);}},[X,G.visibleColumns,G.grouping,G.columnWidths]),jsxRuntime.jsxs(Ai,{elevation:0,sx:{m:0,p:0,display:"flex",flexDirection:"column",minHeight:0,overflow:"hidden",borderRadius:3,border:`1px solid ${S.palette.divider}`,backgroundColor:S.palette.background.paper,...y},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 ${S.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:Ps,color:"text.secondary",whiteSpace:"nowrap"},children:E("table.toolbar.itemsPerPage")}),jsxRuntime.jsx(material.Select,{size:"small",variant:"standard",value:G.rowsPerPage,disableUnderline:true,onChange:T=>G.setRowsPerPage(Number(T.target.value)),sx:{fontSize:Ps,fontWeight:600,color:"text.primary",minWidth:64,"& .MuiSelect-select":{py:.25,pr:"16px !important"},"& .MuiSvgIcon-root":{color:"text.primary"}},children:l.map(T=>jsxRuntime.jsx(material.MenuItem,{value:T,sx:{fontSize:Ps},children:T===-1?E("common.all"):T},`planning-rows-per-page-${T}`))}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>G.setPage(Math.max(ke-1,0)),disabled:!rt,sx:{p:.35,color:"text.primary"},children:jsxRuntime.jsx(Yh__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:Ps,fontWeight:600,minWidth:88,textAlign:"center",color:"text.primary"},children:E("table.toolbar.pageOf",{current:Fe,total:Ie})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>G.setPage(Math.min(ke+1,Ie-1)),disabled:!Xe,sx:{p:.35,color:"text.primary"},children:jsxRuntime.jsx(yf__default.default,{fontSize:"small"})})]}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,alignItems:"center",sx:{flexWrap:"wrap"},children:[po.length>0&&jsxRuntime.jsx(material.Stack,{direction:"row",spacing:.75,alignItems:"center",children:po.map((T,N)=>jsxRuntime.jsx(material.Box,{sx:{display:"flex",alignItems:"center"},children:T},`planning-extra-tool-${N}`))}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:.25,sx:{p:.5,borderRadius:2,backgroundColor:"action.hover"},children:[jsxRuntime.jsx(ia,{tooltip:"Column visibility",onClick:T=>G.setAnchorEl(T.currentTarget),color:"default",children:jsxRuntime.jsx($h__default.default,{fontSize:"small"})}),jsxRuntime.jsx(ia,{tooltip:"Group by",onClick:T=>G.setGroupAnchorEl(T.currentTarget),color:"default",children:jsxRuntime.jsx(Kh__default.default,{fontSize:"small"})}),jsxRuntime.jsx(ia,{tooltip:"Sort by...",onClick:()=>Be(true),color:G.sortBy.length>0||G.orderBy?"primary":"default",children:jsxRuntime.jsx(BT__default.default,{fontSize:"small"})})]}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:.25,sx:{p:.5,borderRadius:2,backgroundColor:"action.hover"},children:[jsxRuntime.jsx(ia,{tooltip:"Expand task table",onClick:()=>j("table"),color:B==="table"?"primary":"default",children:jsxRuntime.jsx(MT__default.default,{fontSize:"small"})}),jsxRuntime.jsx(ia,{tooltip:"Split evenly",onClick:mt,color:B===null&&M==="even"?"primary":"default",children:jsxRuntime.jsx(AT__default.default,{fontSize:"small"})}),jsxRuntime.jsx(ia,{tooltip:"Expand timeline",onClick:()=>j("timeline"),color:B==="timeline"?"primary":"default",children:jsxRuntime.jsx(DT__default.default,{fontSize:"small"})})]}),jsxRuntime.jsx(material.Box,{sx:{minWidth:120},children:jsxRuntime.jsx(gf,{label:"",value:n,options:Dd.map(T=>({value:T.value,label:T.label})),onChange:T=>i?.(T.target.value),sx:{"& .MuiSelect-select":{fontSize:"0.92rem",py:.65},"& .MuiSvgIcon-root":{fontSize:20}}})})]})]}),Z.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:P,sx:{height:"100%",display:"grid",gridTemplateColumns:fo,minWidth:0,transition:`grid-template-columns ${la}`},children:[jsxRuntime.jsx(material.TableContainer,{"data-planning-scroll-pane":"table",ref:k,onScroll:()=>Se("table"),sx:{width:mo,minWidth:0,maxWidth:"100%",height:o,overflowX:"auto",overflowY:"auto",opacity:go?0:1,transform:go?"translateX(-10px)":"translateX(0)",pointerEvents:go?"none":"auto",transition:`opacity ${la}, transform ${la}, width ${la}`},children:jsxRuntime.jsxs(material.Table,{size:"small",stickyHeader:true,sx:{tableLayout:"fixed",width:we,"& thead .MuiTableCell-root":{height:Md,py:0,lineHeight:1.15,boxSizing:"border-box"}},children:[jsxRuntime.jsx(core.DndContext,{sensors:lt,collisionDetection:core.closestCenter,modifiers:[modifiers.restrictToHorizontalAxis],onDragEnd:T=>{let N=T?.active?.id,K=T?.over?.id;typeof N=="string"&&typeof K=="string"&&G.handleColumnReorder(N,K);},children:jsxRuntime.jsx(Oi,{columns:G.columns,visibleColumns:G.visibleColumns,order:G.order,orderBy:G.orderBy,sortBy:G.sortBy,onRequestSort:G.handleRequestSort,onContextMenu:(T,N)=>{T.preventDefault(),T.stopPropagation(),ie({mouseX:T.clientX+2,mouseY:T.clientY-6,columnId:N});},grouping:G.grouping,isAllExpanded:G.isAllExpanded,handleToggleAll:G.handleToggleAll,columnWidths:G.columnWidths,onColumnResize:G.handleColumnResize,enableColumnReorder:true})}),jsxRuntime.jsx(material.TableBody,{children:X.map(T=>{let N=eo(T);if(T.type==="group")return jsxRuntime.jsxs(material.TableRow,{"data-planning-row-key":N,sx:{height:Va,backgroundColor:S.palette.action.hover},children:[G.grouping.length>0&&jsxRuntime.jsx(material.TableCell,{sx:{width:44,height:Va,py:0,borderBottom:`1px solid ${S.palette.divider}`},children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>G.toggleGroupExpand(T.id),children:T.isExpanded?jsxRuntime.jsx(xb__default.default,{fontSize:"small"}):jsxRuntime.jsx(yf__default.default,{fontSize:"small"})})}),jsxRuntime.jsx(material.TableCell,{colSpan:G.visibleColumns.length,sx:{height:Va,py:0,borderBottom:`1px solid ${S.palette.divider}`},children:jsxRuntime.jsxs(material.Typography,{sx:{fontSize:13,fontWeight:700},children:[T.field,": ",T.value," (",T.count,")"]})})]},T.id);let K=T.data||T,J=K.id===C,pe=to(K.id),be=ge.activeId===K.id,xe=ge.overId===K.id&&vt(ge.activeId,K.id);return jsxRuntime.jsxs(material.TableRow,{"data-planning-row-key":N,draggable:pe,hover:true,selected:J,onDragStart:fe=>V(fe,K),onDragOver:fe=>O(fe,K.id),onDragEnter:fe=>O(fe,K.id),onDrop:fe=>ne(fe,K.id),onDragEnd:ce,onClick:()=>u?.(ot.get(K.id)||K),sx:{cursor:be?"grabbing":pe?"grab":u?"pointer":"default",height:Va,opacity:be?.56:1,"& .MuiTableCell-root":xe?{borderTop:`2px solid ${S.palette.primary.main}`}:void 0,transition:"background-color 120ms ease, opacity 120ms ease"},children:[G.grouping.length>0&&jsxRuntime.jsx(material.TableCell,{sx:{width:44,height:Va,py:0,borderBottom:`1px solid ${S.palette.divider}`}}),(G.columns||[]).filter(fe=>G.visibleColumns.includes(fe.id)).map(fe=>jsxRuntime.jsx(material.TableCell,{sx:{width:G.columnWidths?.[fe.id]||fe.minWidth||100,height:Va,py:0,overflow:"hidden",borderBottom:`1px solid ${S.palette.divider}`},children:fe.render?fe.render(K[fe.id],K):String(K[fe.id]??"-")},`${K.id}-${fe.id}`))]},K.id)})})]})}),jsxRuntime.jsx(material.Box,{onPointerDown:xt?Uo:void 0,role:"separator","aria-orientation":"vertical",sx:{width:xt?Is:0,cursor:xt?"col-resize":"default",opacity:xt?1:0,pointerEvents:xt?"auto":"none",borderLeft:xt?`1px solid ${S.palette.divider}`:"0 solid transparent",borderRight:xt?`1px solid ${S.palette.divider}`:"0 solid transparent",backgroundColor:S.palette.mode==="dark"?"rgba(148,163,184,0.10)":"rgba(15,23,42,0.04)",transition:`width ${la}, opacity ${la}, background-color 120ms ease`,position:"relative","&:hover":{backgroundColor:S.palette.action.selected},"&::before":{content:'""',position:"absolute",top:0,bottom:0,left:-6,right:-6,cursor:xt?"col-resize":"default"}}}),jsxRuntime.jsx(material.Box,{sx:{minWidth:0,overflow:"hidden",opacity:Xt?0:1,transform:Xt?"translateX(10px)":"translateX(0)",pointerEvents:Xt?"none":"auto",transition:`opacity ${la}, transform ${la}`},children:jsxRuntime.jsx(material.Box,{"data-planning-scroll-pane":"timeline",ref:R,onScroll:()=>Se("timeline"),sx:{width:"100%",height:o,overflowX:"auto",overflowY:"auto"},children:jsxRuntime.jsxs(material.Box,{sx:{width:Ne},children:[jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${Et.length}, ${Tt.width}px)`,height:ee,boxSizing:"border-box",borderBottom:`1px solid ${S.palette.divider}`,position:"sticky",top:0,zIndex:2,backgroundColor:S.palette.background.paper},children:Et.map(T=>jsxRuntime.jsxs(material.Box,{title:T.title,sx:{px:.75,display:"flex",flexDirection:T.contextLabel?"column":"row",alignItems:"center",justifyContent:"center",gap:T.contextLabel?.15:0,borderRight:`1px solid ${S.palette.divider}`,color:T.contextLabel?"text.primary":"text.secondary",overflow:"hidden"},children:[T.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:T.contextLabel}),jsxRuntime.jsx(material.Typography,{component:"span",sx:{maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:12,fontWeight:700,lineHeight:1.15},children:T.label})]},T.key))}),jsxRuntime.jsx(material.Stack,{sx:{position:"relative"},children:X.map(T=>{let N=eo(T),K=W[N]??Va;if(T.type==="group")return jsxRuntime.jsx(material.Box,{"data-planning-timeline-row-key":N,sx:{position:"relative",height:K,boxSizing:"border-box",borderBottom:`1px solid ${S.palette.divider}`,backgroundColor:S.palette.action.hover}},T.id);let J=T.data||T,pe=mr__default.default(J.startDate),be=mr__default.default(J.endDate),xe=Bd(pe,Et,Tt.width),fe=Bd(be,Et,Tt.width),ze=Math.max(18,fe-xe),We=vf(J.progress),st=J.id===C,Ke=to(J.id),Ve=ge.activeId===J.id,Lt=ge.overId===J.id&&vt(ge.activeId,J.id),Ot=J.color??(J.statusTone==="blocked"?S.palette.error.main:S.palette.primary.main);return jsxRuntime.jsx(material.Box,{"data-planning-timeline-row-key":N,draggable:Ke,onDragStart:gt=>V(gt,J),onDragOver:gt=>O(gt,J.id),onDragEnter:gt=>O(gt,J.id),onDrop:gt=>ne(gt,J.id),onDragEnd:ce,onClick:()=>u?.(ot.get(J.id)||J),sx:{position:"relative",height:K,boxSizing:"border-box",borderBottom:`1px solid ${S.palette.divider}`,opacity:Ve?.56:1,"&::before":{content:'""',position:"absolute",top:0,left:0,right:0,height:2,backgroundColor:S.palette.primary.main,opacity:Lt?1:0,transition:"opacity 120ms ease",pointerEvents:"none",zIndex:3},backgroundImage:S.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:`${Tt.width}px 100%`,cursor:Ve?"grabbing":Ke?"grab":u?"pointer":"default",transition:"opacity 120ms ease"},children:jsxRuntime.jsx(material.Tooltip,{title:`${J.title}: ${pe.format("MMM D HH:mm")} - ${be.format("MMM D HH:mm")}`,children:jsxRuntime.jsxs(material.Box,{sx:{position:"absolute",left:xe,top:Math.max(8,(K-24)/2),width:ze,height:24,borderRadius:999,overflow:"hidden",backgroundColor:S.palette.mode==="dark"?"rgba(148,163,184,0.18)":"rgba(15,23,42,0.10)",outline:st?`2px solid ${S.palette.warning.main}`:"none",outlineOffset:2},children:[jsxRuntime.jsx(material.Box,{sx:{height:"100%",width:`${We}%`,backgroundColor:Ot}}),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:J.code})]})})},J.id)})})]})})})]})}),jsxRuntime.jsx(qa,{groupAnchorEl:G.groupAnchorEl,setGroupAnchorEl:G.setGroupAnchorEl,grouping:G.grouping,setGrouping:G.setGrouping,columns:G.columns,toggleGroupField:G.toggleGroupField}),jsxRuntime.jsx(_a,{anchorEl:G.anchorEl,setAnchorEl:G.setAnchorEl,columns:G.columns,visibleColumns:G.visibleColumns,toggleColumnVisibility:G.toggleColumnVisibility}),jsxRuntime.jsx(vu,{contextMenu:Ee,handleClose:()=>ie(null),columns:G.columns,visibleColumns:G.visibleColumns,grouping:G.grouping,summaryColumns:G.summaryColumns,showSummary:G.showSummary,sortBy:G.sortBy,orderBy:G.orderBy,order:G.order,onSortAsc:T=>{G.applyMultiSort([{field:T,direction:"asc"}]);},onSortDesc:T=>{G.applyMultiSort([{field:T,direction:"desc"}]);},onClearSort:T=>{let N=G.sortBy.filter(K=>K.field!==T);N.length>0?G.applyMultiSort(N):(G.clearMultiSort(),G.orderBy===T&&G.setOrderBy(""));},onHideColumn:T=>{G.visibleColumns.includes(T)&&G.toggleColumnVisibility(T);},onToggleGroup:T=>G.toggleGroupField(T),onToggleSummary:T=>G.toggleSummaryColumn(T),onOpenSortDialog:()=>Be(true)}),jsxRuntime.jsx(Cu,{open:Re,onClose:()=>Be(false),columns:G.columns,initialRules:G.sortBy.length>0?G.sortBy:G.orderBy?[{field:G.orderBy,direction:G.order}]:[],onApply:T=>G.applyMultiSort(T),onClear:()=>{G.clearMultiSort(),G.setOrderBy("");}})]})};var c4=({filterProps:e,ganttProps:t,spacing:o=2,sx:r,children:a})=>{let n=r?[{height:"100%",overflow:"hidden"},r]:{height:"100%",overflow:"hidden"},i=t.sx?[{height:"100%"},t.sx]:{height:"100%"};return jsxRuntime.jsxs(material.Stack,{spacing:o,sx:n,children:[jsxRuntime.jsx(material.Box,{sx:{flexShrink:0},children:jsxRuntime.jsx(Cr,{...e})}),jsxRuntime.jsx(material.Box,{sx:{flex:1,minHeight:0,overflow:"hidden"},children:jsxRuntime.jsx(wf,{...t,bodyHeight:t.bodyHeight??"100%",sx:i})}),a]})};var qT={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)"}}},g4=({children:e,transitionKey:t,variant:o="fade",durationMs:r=220,delayMs:a=0,easing:n="cubic-bezier(0.22, 1, 0.36, 1)",disabled:i=false,sx:c})=>{let d=material.useMediaQuery("(prefers-reduced-motion: reduce)"),[l,s]=Rt.useState("to"),g=!i&&!d&&o!=="none";Rt.useEffect(()=>{if(!g){s("to");return}s("from");let b=requestAnimationFrame(()=>{b=requestAnimationFrame(()=>{s("to");});});return ()=>cancelAnimationFrame(b)},[t,g]);let f=qT[o],m=Rt.useMemo(()=>g?l==="from"?f.from:f.to:{opacity:1,transform:"none"},[g,l,f.from,f.to]);return jsxRuntime.jsx(material.Box,{sx:{willChange:g?"opacity, transform":"auto",transition:g?`opacity ${r}ms ${n} ${a}ms, transform ${r}ms ${n} ${a}ms`:"none",backfaceVisibility:"hidden",...m,...c},children:e})},f4={subtle:{variant:"fade",durationMs:180},smooth:{variant:"slide-up",durationMs:220},snappy:{variant:"scale",durationMs:160}};exports.AIBrowserGlow=UV;exports.AgentPanel=EV;exports.Button=Ms;exports.CAINavProvider=jS;exports.CAmapChart=Hu;exports.CAppHeader=zl;exports.CAppPageLayout=P5;exports.CAuthPage=gO;exports.CBarChart=_n;exports.CChartCard=Ui;exports.CComboChart=Pu;exports.CCustomizeAgent=Uu;exports.CDetailInfoPage=AB;exports.CDetailSearchAiBar=Wp;exports.CDetailSectionCard=Il;exports.CFishboneChart=Au;exports.CGoogleMapChart=zu;exports.CGraphCharts=Wu;exports.CGraphKpiCards=Su;exports.CGraphReport=nl;exports.CHeatmapChart=Du;exports.CKanbanBoard=QB;exports.CKanbanBucket=_p;exports.CKanbanCard=Fc;exports.CLayoutManagement=fp;exports.CLayoutManager=hl;exports.CLineChart=Iu;exports.CMessageBox=Nn;exports.COrbCanvas=FS;exports.CPageLayout=au;exports.CPageTransition=g4;exports.CPieChart=Yi;exports.CPivotTable=fF;exports.CPlanningGantt=wf;exports.CPlanningLayout=c4;exports.CSmartFilter=Cr;exports.CSmartTable=XA;exports.CStandardPage=r2;exports.CTable=Xr;exports.CTableBody=KA;exports.CTableCell=qA;exports.CTableContainer=_A;exports.CTableHead=jA;exports.CTableRow=ZA;exports.CValueHelp=ru;exports.CVariantManagement=cl;exports.CVariantManager=ep;exports.CVoiceWaveOverlay=pd;exports.CWaterfallChart=Eu;exports.CodeBlock=ri;exports.CopilotChat=WV;exports.GlobalMessage=YI;exports.MarkdownRenderer=si;exports.MathBlock=ai;exports.MermaidBlock=vc;exports.NavigationIsland=Ud;exports.ORBCAFE_I18N_MESSAGES=zn;exports.OrbcafeI18nProvider=Li;exports.PAGE_TRANSITION_PRESETS=f4;exports.PAppPageLayout=KL;exports.PBarcodeScanner=FF;exports.PNavIsland=ug;exports.PNumericKeypad=ZF;exports.PSmartFilter=rg;exports.PTable=yS;exports.PTouchCard=HF;exports.PWorkloadNav=ig;exports.PivotChartPanel=Lm;exports.StdChat=of;exports.TableBlock=kc;exports.ThinkBlock=wl;exports.TreeMenu=Bs;exports.VoiceNavigatorProvider=lz;exports.VoiceWaveOverlay=JL;exports.buildAmapEmbedUrl=el;exports.buildGoogleMapEmbedUrl=Xn;exports.buildGoogleMapIframe=oD;exports.buttonVariants=Ff;exports.createKanbanBoardModel=Xp;exports.findKanbanCard=er;exports.message=FI;exports.messageManager=yr;exports.moveKanbanCard=Al;exports.parseMarkdownTable=kl;exports.renderMarkdown=eB;exports.resolveVariantFilters=bp;exports.resolveVariantLayout=bl;exports.useAINav=ZS;exports.useAmapEmbedUrl=y2;exports.useAuthPage=jV;exports.useDetailInfo=Gp;exports.useGoogleMapEmbedUrl=b2;exports.useGraphChartData=p2;exports.useGraphInteraction=ll;exports.useGraphReport=rn;exports.useKanbanBoard=r5;exports.useNavigationIsland=qd;exports.useOrbcafeI18n=te;exports.usePadLayout=TF;exports.usePadRecordEditor=RF;exports.usePageLayout=im;exports.usePivotTable=vF;exports.usePlanningGantt=uf;exports.usePlanningLayout=kO;exports.useStandardReport=c2;exports.useVoiceInput=ss;exports.useVoiceNavigator=sz;
252
+ `,YV=({active:e=false,colors:t=W1,zIndex:o=2147483e3})=>{let a={"--orbcafe-ai-glow-a":t[0],"--orbcafe-ai-glow-b":t[1],"--orbcafe-ai-glow-c":t[2],"--orbcafe-ai-glow-z-index":o};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("style",{children:$1}),jsxRuntime.jsx("div",{className:"orbcafe-ai-browser-glow","data-active":e?"true":"false",style:a,"aria-hidden":"true"})]})};var t4=({defaultMode:e="login",onLogin:t,onRegister:o,onForgotPassword:a}={})=>{let[r,n]=Et.useState(e),[i,c]=Et.useState(false),d=Et.useCallback(async p=>{c(true);try{await p?.();}finally{c(false);}},[]),s=Et.useCallback(p=>d(()=>t?.(p)),[t,d]),l=Et.useCallback(p=>d(()=>o?.(p)),[o,d]),g=Et.useCallback(p=>d(()=>a?.(p)),[a,d]),f=Et.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 Dd=({label:e,...t})=>jsxRuntime.jsx(material.FormControlLabel,{control:jsxRuntime.jsx(material.Checkbox,{...t}),label:e});var Ni=Et.forwardRef((e,t)=>jsxRuntime.jsx(material.Paper,{ref:t,...e,elevation:e.elevation||1,sx:{p:2,mb:2,...e.sx}}));Ni.displayName="CPaper";var aT={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."},C4=({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,p]=Et.useState(t),b=e??f,v=Et.useMemo(()=>({...aT,...d}),[d]),[u,w]=Et.useState({username:"demo@orbcafe.local",password:"orbcafe-demo",remember:true}),[m,h]=Et.useState({name:"",email:"",password:"",confirmPassword:"",acceptedTerms:false}),[y,k]=Et.useState({email:""}),[E,R]=Et.useState(""),C=D=>{g||p(D),R(""),o?.(D);},I=async D=>{D.preventDefault(),await a?.(u),R("Demo login accepted. No real authentication request was sent.");},T=async D=>{D.preventDefault(),await r?.(m),R("Demo registration saved locally for this screen.");},S=async D=>{D.preventDefault(),await n?.(y),R("Demo reset link request created. No email was sent.");},A=b==="login"?v.loginTitle:b==="register"?v.registerTitle:v.forgotTitle,M=b==="login"?v.loginSubtitle:b==="register"?v.registerSubtitle:v.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:v.productName}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:{md:34,lg:42},lineHeight:1.06,fontWeight:800},children:v.headline}),jsxRuntime.jsx(material.Typography,{sx:{maxWidth:460,color:"text.secondary",fontSize:16,lineHeight:1.7},children:v.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(Ni,{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:A}),jsxRuntime.jsx(material.Typography,{sx:{color:"text.secondary"},children:M})]}),E&&jsxRuntime.jsx(material.Alert,{severity:"success",children:E}),b==="login"&&jsxRuntime.jsx(material.Box,{component:"form",onSubmit:I,children:jsxRuntime.jsxs(material.Stack,{spacing:2,children:[jsxRuntime.jsx(lo,{label:"Email or user ID",value:u.username,onChange:D=>w(B=>({...B,username:D.target.value})),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(yf__default.default,{fontSize:"small"})})}}),jsxRuntime.jsx(lo,{label:"Password",type:"password",value:u.password,onChange:D=>w(B=>({...B,password:D.target.value})),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(tT__default.default,{fontSize:"small"})})}}),jsxRuntime.jsxs(material.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:2},children:[jsxRuntime.jsx(Dd,{label:"Remember me",checked:u.remember,onChange:D=>w(B=>({...B,remember:D.target.checked}))}),jsxRuntime.jsx(Zo,{type:"button",variant:"text",size:"small",onClick:()=>C("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:()=>C("register"),sx:{minWidth:0,p:0},children:"Register"})]})]})}),b==="register"&&jsxRuntime.jsx(material.Box,{component:"form",onSubmit:T,children:jsxRuntime.jsxs(material.Stack,{spacing:2,children:[jsxRuntime.jsx(lo,{label:"Full name",value:m.name,onChange:D=>h(B=>({...B,name:D.target.value})),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(yf__default.default,{fontSize:"small"})})}}),jsxRuntime.jsx(lo,{label:"Work email",type:"email",value:m.email,onChange:D=>h(B=>({...B,email:D.target.value})),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(bf__default.default,{fontSize:"small"})})}}),jsxRuntime.jsx(lo,{label:"Password",type:"password",value:m.password,onChange:D=>h(B=>({...B,password:D.target.value})),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(oT__default.default,{fontSize:"small"})})}}),jsxRuntime.jsx(lo,{label:"Confirm password",type:"password",value:m.confirmPassword,onChange:D=>h(B=>({...B,confirmPassword:D.target.value}))}),jsxRuntime.jsx(Dd,{label:"I accept the demo workspace terms",checked:m.acceptedTerms,onChange:D=>h(B=>({...B,acceptedTerms:D.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:()=>C("login"),sx:{minWidth:0,p:0},children:"Sign in"})]})]})}),b==="forgot"&&jsxRuntime.jsx(material.Box,{component:"form",onSubmit:S,children:jsxRuntime.jsxs(material.Stack,{spacing:2,children:[jsxRuntime.jsx(lo,{label:"Work email",type:"email",value:y.email,onChange:D=>k({email:D.target.value}),InputProps:{startAdornment:jsxRuntime.jsx(material.InputAdornment,{position:"start",children:jsxRuntime.jsx(bf__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:()=>C("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 iT={keyword:{value:"",operator:"contains"},status:{value:"",operator:"equals"},owner:{value:"",operator:"contains"},workCenter:{value:"",operator:"contains"}},lT=[{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"}],xf=({tasks:e,defaultScale:t="week",defaultSelectedTaskId:o,initialFilters:a,filterFields:r,filterAppId:n="planning-gantt-filter",filterTableKey:i="planning",columns:c,page:d,rowsPerPage:s,rowsPerPageOptions:l,count:g,onPageChange:f,onRowsPerPageChange:p,onFilterSearch:b,onFilterVariantLoad:v,enableRowReorder:u,onTaskReorder:w})=>{let[m,h]=Et.useState(t),[y,k]=Et.useState(o??e[0]?.id??""),[E,R]=Et.useState({...iT,...a}),C=Et.useMemo(()=>{let A=String(E.keyword?.value??"").trim().toLowerCase(),M=String(E.status?.value??"").trim(),D=String(E.owner?.value??"").trim().toLowerCase(),B=String(E.workCenter?.value??"").trim().toLowerCase(),Z=E.dateRange?.value,O=Z?.[0]?ga__default.default(Z[0]):null,K=Z?.[1]?ga__default.default(Z[1]):null;return e.filter(te=>{if(A&&![te.id,te.code,te.title,te.project,te.workCenter,te.owner?.name].join(" ").toLowerCase().includes(A)||M&&te.status!==M||D&&!String(te.owner?.name??"").toLowerCase().includes(D)||B&&!String(te.workCenter??"").toLowerCase().includes(B))return false;if(O||K){let se=ga__default.default(te.startDate),_=ga__default.default(te.endDate),$=O?_.isAfter(O)||_.isSame(O,"day"):true,ue=K?se.isBefore(K)||se.isSame(K,"day"):true;if(!$||!ue)return false}return true})},[E,e]);Et.useEffect(()=>{C.length!==0&&(C.some(A=>A.id===y)||k(C[0].id));},[C,y]);let I=Et.useCallback(A=>{k(A.id);},[]),T=Et.useMemo(()=>({appId:n,tableKey:i,fields:r??lT,filters:E,onFilterChange:R,onVariantLoad:v??(()=>{}),onSearch:b??(()=>{})}),[n,r,i,E,b,v]),S=Et.useMemo(()=>({tasks:C,columns:c,scale:m,onScaleChange:h,page:d,rowsPerPage:s,rowsPerPageOptions:l,count:g,onPageChange:f,onRowsPerPageChange:p,selectedTaskId:y,onTaskSelect:I,enableRowReorder:u,onTaskReorder:w}),[c,g,u,C,f,p,w,I,d,s,l,m,y]);return {scale:m,setScale:h,selectedTaskId:y,setSelectedTaskId:k,filters:E,setFilters:R,filteredTasks:C,smartFilterProps:T,planningGanttProps:S}};var M4=e=>{let t=xf(e),o=Et.useMemo(()=>({filterProps:t.smartFilterProps,ganttProps:t.planningGanttProps}),[t.planningGanttProps,t.smartFilterProps]);return {...t,layoutProps:o}};var vf=e=>jsxRuntime.jsx(material.Chip,{...e,size:e.size||"small",variant:e.variant||"outlined"});var dr=Et.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});dr.displayName="CIconButton";var kf=({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))})]});ga__default.default.extend(xT__default.default);var Ld=[{value:"hour",label:"Hour",width:56},{value:"day",label:"Day",width:46},{value:"week",label:"Week",width:78},{value:"month",label:"Month",width:104}],zd=56,$r=58,Bs=8,Nd=260,$T=320,Es="0.85rem",ur="220ms cubic-bezier(0.2, 0, 0, 1)",Pf={"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"}},GT=e=>e?Pf[e]?.label??e:"Planned",UT=e=>e?Pf[e]?.color??"default":"info",Rf=e=>Math.min(100,Math.max(0,e??0)),Mf=(e,t=0)=>e.flatMap(o=>[{...o,level:t},...Mf(o.children??[],t+1)]),KT=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:GT(e.status),statusTone:e.status??"planned",progress:Rf(e.progress),startDate:e.startDate,endDate:e.endDate,color:e.color,reorderable:e.reorderable!==false}),Df=(e,t)=>t==="month"?e.startOf("month"):t==="week"?e.startOf("week"):t==="day"?e.startOf("day"):e.startOf("hour"),Af=(e,t)=>t==="month"?e.endOf("month"):t==="week"?e.endOf("week"):t==="day"?e.endOf("day"):e.endOf("hour"),qT=(e,t,o)=>{let a=[],r=Df(e,o),n=Af(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},Vd=(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},Bf=({title:e="Project Plan",extraTools:t,bodyHeight:o=560,tasks:a,columns:r,scale:n="week",onScaleChange:i,page:c,rowsPerPage:d=20,rowsPerPageOptions:s=[20,50,100,-1],count:l,onPageChange:g,onRowsPerPageChange:f,timelineStart:p,timelineEnd:b,selectedTaskId:v,onTaskSelect:u,enableRowReorder:w=true,onTaskReorder:m,emptyLabel:h="No planning tasks available.",sx:y})=>{let k=material.useTheme(),{t:E}=re(),R=Et.useRef(null),C=Et.useRef(null),I=Et.useRef(null),T=Et.useRef(false),[S,A]=Et.useState(null),[M,D]=Et.useState("content"),[B,Z]=Et.useState(null),[O,K]=Et.useState({}),[te,se]=Et.useState(zd),[_,$]=Et.useState([]),[ue,Re]=Et.useState({activeId:null,overId:null}),[Ae,ae]=Et.useState(null),[ve,Pe]=Et.useState(false),lt=core.useSensors(core.useSensor(core.PointerSensor,{activationConstraint:{distance:4}})),Xe=Et.useRef(null),Le=Et.useMemo(()=>Mf(a),[a]),$e=Et.useMemo(()=>{if(_.length===0)return Le;let P=new Map(Le.map(oe=>[oe.id,oe])),N=_.map(oe=>P.get(oe)).filter(oe=>!!oe),q=new Set(N.map(oe=>oe.id));return [...N,...Le.filter(oe=>!q.has(oe.id))]},[Le,_]),Ne=Et.useMemo(()=>new Map($e.map(P=>[P.id,P])),[$e]),j=Et.useMemo(()=>$e.map(P=>KT(P)),[$e]),de=Et.useMemo(()=>new Map(j.map(P=>[P.id,P])),[j]),De=Et.useMemo(()=>[{id:"code",label:"ID",minWidth:90},{id:"title",label:"Task",minWidth:260,render:(P,N)=>jsxRuntime.jsxs(material.Stack,{spacing:.2,children:[jsxRuntime.jsx(material.Typography,{sx:{fontSize:15,fontWeight:700,lineHeight:1.2},children:N.title}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:13,color:"text.secondary"},children:N.titleSub})]})},{id:"owner",label:"Owner",minWidth:170},{id:"status",label:"Status",minWidth:130,render:(P,N)=>jsxRuntime.jsx(vf,{label:N.status,color:UT(N.statusTone),size:"small"})},{id:"progress",label:"Progress",minWidth:140,numeric:true,render:P=>jsxRuntime.jsxs(material.Stack,{spacing:.6,children:[jsxRuntime.jsxs(material.Typography,{variant:"caption",sx:{color:"text.secondary"},children:[P,"%"]}),jsxRuntime.jsx(material.LinearProgress,{variant:"determinate",value:P,sx:{height:6,borderRadius:999}})]})},{id:"startDate",label:"Start",minWidth:120},{id:"endDate",label:"End",minWidth:120}],[]),Ve=Et.useMemo(()=>{if(!r||r.length===0)return De;let P=new Map(De.map(N=>[N.id,N]));return r.map(N=>{let q=P.get(N.id),oe=N.width??q?.minWidth??120,he={id:N.id,label:N.label,minWidth:oe};if(q?.numeric&&(he.numeric=true),N.render){let Ce=N.render;return he.render=(Se,ye)=>{let He=Ne.get(ye.id);return Ce(He||ye)},he}return q?.render?(he.render=q.render,he):(he.render=(Ce,Se)=>{let ye=Se[N.id];if(ye!=null&&String(ye).length>0)return String(ye);let Ge=Ne.get(Se.id)?.[N.id];return Ge!=null&&String(Ge).length>0?String(Ge):"-"},he)})},[r,De,Ne]),G=mn({appId:"planning-gantt",title:e,columns:Ve,rows:j,rowKey:"id",page:c,rowsPerPage:d,rowsPerPageOptions:s,count:l??j.length,onPageChange:g,onRowsPerPageChange:f,showSummary:false}),X=G.visibleRows,Y=G.rowsPerPage===-1?1:Math.max(1,Math.ceil(G.totalDisplayCount/G.rowsPerPage)),J=Math.max(0,Math.min(G.page,Y-1)),pe=Math.min(J+1,Y),qe=J>0,_e=J<Y-1&&G.rowsPerPage!==-1;Et.useEffect(()=>{let P=Le.map(N=>N.id);$(N=>{let q=new Set(P),oe=N.filter(ye=>q.has(ye)),he=new Set(oe),Ce=P.filter(ye=>!he.has(ye)),Se=[...oe,...Ce];return Se.length===N.length&&Se.every((ye,He)=>ye===N[He])?N:Se});},[Le]);let ut=P=>P.type==="group"?`group-${P.id}`:`row-${(P.data||P)?.id}`,pt=Et.useMemo(()=>{let P=j.map(He=>ga__default.default(He.startDate)),N=j.map(He=>ga__default.default(He.endDate)),q=p?ga__default.default(p):P.reduce((He,Ge)=>Ge.isBefore(He)?Ge:He,P[0]??ga__default.default()),oe=b?ga__default.default(b):N.reduce((He,Ge)=>Ge.isAfter(He)?Ge:He,N[0]??ga__default.default().add(30,"day")),he=n==="month"?"month":n==="week"?"week":n==="day"?"day":"hour",Ce=n==="month"?"month":n==="week"?"week":n==="day"?"day":"hour",Se=n==="hour"?12:1,ye=n==="hour"?12:1;return {start:Df(q.subtract(Se,he),n),end:Af(oe.add(ye,Ce),n)}},[j,n,b,p]),at=Ld.find(P=>P.value===n)??Ld[1],Dt=Array.isArray(t)?t:t?[t]:[],rt=Et.useMemo(()=>qT(pt.start,pt.end,n),[pt.end,pt.start,n]),Oe=rt.length*at.width,Ie=(G.columns||[]).filter(P=>G.visibleColumns.includes(P.id)).reduce((P,N)=>P+(G.columnWidths?.[N.id]||N.minWidth||100),0),mt=M==="manual"&&S!==null?S:Ie,je=B==="table",Vt=B==="timeline",mo=Vt?0:je||M==="even"?"100%":mt,go=B==="timeline",Qt=B==="table",wt=!go&&!Qt,fo=je?"minmax(0, 1fr) 0px 0px":Vt?"0px 0px minmax(0, 1fr)":M==="even"?`minmax(0, 1fr) ${Bs}px minmax(0, 1fr)`:`${mt}px ${Bs}px minmax(0, 1fr)`,ho=()=>{let P=R.current?.clientWidth??0;return P>0?Math.max(Nd,P-Bs-$T):Math.max(Nd,Ie)},bo=P=>Math.min(Math.max(P,Nd),ho());Et.useEffect(()=>{M==="manual"&&A(P=>P===null?null:bo(P));},[M,Ie]);let Ko=P=>{P.preventDefault(),P.currentTarget.setPointerCapture(P.pointerId),Z(null),D("manual"),Xe.current={startX:P.clientX,startWidth:C.current?.getBoundingClientRect().width??mt};let N=oe=>{let he=Xe.current;if(!he)return;let Ce=bo(he.startWidth+oe.clientX-he.startX);A(Ce);},q=()=>{Xe.current=null,window.removeEventListener("pointermove",N),window.removeEventListener("pointerup",q),document.body.style.cursor="",document.body.style.userSelect="";};document.body.style.cursor="col-resize",document.body.style.userSelect="none",window.addEventListener("pointermove",N),window.addEventListener("pointerup",q);},xt=()=>{Z(null),D("even"),A(null);},oo=P=>!w||!P?false:de.get(P)?.reorderable!==false,Tt=(P,N)=>{if(!P||!N||P===N||!oo(P)||!oo(N))return false;if(G.grouping.length===0)return true;let q=de.get(P),oe=de.get(N);return !q||!oe?false:G.grouping.every(he=>q[he]===oe[he])},z=(P,N)=>{if(!Tt(P,N))return;let q=X.filter(Ye=>Ye.type!=="group").map(Ye=>String((Ye.data||Ye)?.id)),oe=q.indexOf(P),he=q.indexOf(N);if(oe<0||he<0)return;let Ce=[...q];[Ce[oe],Ce[he]]=[Ce[he],Ce[oe]];let Se=new Set(q),ye=$e.map(Ye=>Ye.id),He=[...Ce,...ye.filter(Ye=>!Se.has(Ye))],Ge=Ne.get(P),gt=Ne.get(N);if(G.setOrder("asc"),G.setOrderBy(""),$(He),Ge&&gt){let{level:Ye,...We}=Ge,{level:Ot,...$t}=gt,vt=He.reduce((ao,Ct)=>{let ro=Ne.get(Ct);if(ro){let{level:qo,...no}=ro;ao.push(no);}return ao},[]);m?.(vt,{activeTask:We,targetTask:$t});}},V=(P,N)=>{if(!oo(N.id)){P.preventDefault();return}P.stopPropagation(),P.dataTransfer.effectAllowed="move",P.dataTransfer.setData("text/plain",N.id),Re({activeId:N.id,overId:null}),u?.(Ne.get(N.id)||N);},H=(P,N)=>{if(!Tt(ue.activeId,N)){Re(q=>q.overId===null?q:{...q,overId:null});return}P.preventDefault(),P.stopPropagation(),P.dataTransfer.dropEffect="move",Re(q=>q.overId===N?q:{...q,overId:N});},ce=(P,N)=>{let q=ue.activeId||P.dataTransfer.getData("text/plain");if(!Tt(q,N)){Re({activeId:null,overId:null});return}P.preventDefault(),P.stopPropagation(),z(q,N),Re({activeId:null,overId:null});},me=()=>{Re({activeId:null,overId:null});},Me=P=>{if(T.current)return;let N=P==="table"?C.current:I.current,q=P==="table"?I.current:C.current;!N||!q||(T.current=true,q.scrollTop=N.scrollTop,window.requestAnimationFrame(()=>{T.current=false;}));};return Et.useLayoutEffect(()=>{if(!v||Qt)return;let P=I.current,N=C.current;if(!P)return;let q=`row-${v}`,oe=Array.from(P.querySelectorAll("[data-planning-timeline-row-key]")).find(Se=>Se.dataset.planningTimelineRowKey===q),he=de.get(v);if(!oe||!he)return;let Ce=window.requestAnimationFrame(()=>{let Se=P.getBoundingClientRect(),ye=oe.getBoundingClientRect(),He=Math.max(1,P.clientHeight-te),Ge=P.scrollTop+ye.top-Se.top-te-(He-ye.height)/2;T.current=true,P.scrollTop=Math.max(0,Ge),N&&!go&&(N.scrollTop=P.scrollTop);let gt=Vd(ga__default.default(he.startDate),rt,at.width),Ye=Math.max(0,gt-at.width);P.scrollLeft=Math.min(Ye,Math.max(0,Oe-P.clientWidth)),window.requestAnimationFrame(()=>{T.current=false;});});return ()=>window.cancelAnimationFrame(Ce)},[at.width,te,v,go,de,Qt,X,Oe,rt]),Et.useLayoutEffect(()=>{let P=C.current;if(!P)return;let N=0,q=0,oe=false,he=()=>{if(oe)return;let Ot=P.querySelector("thead"),$t=Array.from(P.querySelectorAll("tbody tr[data-planning-row-key]"));if($t.length===0)return;let vt=Ot?.getBoundingClientRect().height||zd,ao={};$t.forEach(Ct=>{let ro=Ct.dataset.planningRowKey;ro&&(ao[ro]=Ct.getBoundingClientRect().height);}),se(Ct=>Math.abs(Ct-vt)<.01?Ct:vt),K(Ct=>{let ro=Object.keys(Ct),qo=Object.keys(ao);return ro.length===qo.length&&qo.every(no=>Math.abs((Ct[no]??0)-ao[no])<.01)?Ct:ao});},Ce=()=>{window.cancelAnimationFrame(N),N=window.requestAnimationFrame(he);};if(he(),window.cancelAnimationFrame(q),q=window.requestAnimationFrame(()=>{q=window.requestAnimationFrame(he);}),typeof document<"u"&&document.fonts?.ready&&document.fonts.ready.then(()=>{oe||Ce();}).catch(()=>{}),typeof ResizeObserver>"u")return window.addEventListener("resize",Ce),()=>{oe=true,window.cancelAnimationFrame(N),window.cancelAnimationFrame(q),window.removeEventListener("resize",Ce);};let Se=new ResizeObserver(Ce),ye=P.querySelector("table"),He=P.querySelector("tbody"),Ge=P.querySelector("thead");ye&&Se.observe(ye),Ge&&Se.observe(Ge);let gt=new WeakSet,Ye=()=>{P.querySelectorAll("tbody tr[data-planning-row-key]").forEach(Ot=>{gt.has(Ot)||(Se.observe(Ot),gt.add(Ot));});};Ye();let We=null;return He&&typeof MutationObserver<"u"&&(We=new MutationObserver(()=>{Ye(),Ce();}),We.observe(He,{childList:true,subtree:true,characterData:true})),window.addEventListener("resize",Ce),()=>{oe=true,window.cancelAnimationFrame(N),window.cancelAnimationFrame(q),Se.disconnect(),We?.disconnect(),window.removeEventListener("resize",Ce);}},[X,G.visibleColumns,G.grouping,G.columnWidths]),jsxRuntime.jsxs(Ni,{elevation:0,sx:{m:0,p:0,display:"flex",flexDirection:"column",minHeight:0,overflow:"hidden",borderRadius:3,border:`1px solid ${k.palette.divider}`,backgroundColor:k.palette.background.paper,...y},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 ${k.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:Es,color:"text.secondary",whiteSpace:"nowrap"},children:E("table.toolbar.itemsPerPage")}),jsxRuntime.jsx(material.Select,{size:"small",variant:"standard",value:G.rowsPerPage,disableUnderline:true,onChange:P=>G.setRowsPerPage(Number(P.target.value)),sx:{fontSize:Es,fontWeight:600,color:"text.primary",minWidth:64,"& .MuiSelect-select":{py:.25,pr:"16px !important"},"& .MuiSvgIcon-root":{color:"text.primary"}},children:s.map(P=>jsxRuntime.jsx(material.MenuItem,{value:P,sx:{fontSize:Es},children:P===-1?E("common.all"):P},`planning-rows-per-page-${P}`))}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>G.setPage(Math.max(J-1,0)),disabled:!qe,sx:{p:.35,color:"text.primary"},children:jsxRuntime.jsx(nb__default.default,{fontSize:"small"})}),jsxRuntime.jsx(material.Typography,{sx:{fontSize:Es,fontWeight:600,minWidth:88,textAlign:"center",color:"text.primary"},children:E("table.toolbar.pageOf",{current:pe,total:Y})}),jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>G.setPage(Math.min(J+1,Y-1)),disabled:!_e,sx:{p:.35,color:"text.primary"},children:jsxRuntime.jsx(If__default.default,{fontSize:"small"})})]}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:1,alignItems:"center",sx:{flexWrap:"wrap"},children:[Dt.length>0&&jsxRuntime.jsx(material.Stack,{direction:"row",spacing:.75,alignItems:"center",children:Dt.map((P,N)=>jsxRuntime.jsx(material.Box,{sx:{display:"flex",alignItems:"center"},children:P},`planning-extra-tool-${N}`))}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:.25,sx:{p:.5,borderRadius:2,backgroundColor:"action.hover"},children:[jsxRuntime.jsx(dr,{tooltip:"Column visibility",onClick:P=>G.setAnchorEl(P.currentTarget),color:"default",children:jsxRuntime.jsx(Xh__default.default,{fontSize:"small"})}),jsxRuntime.jsx(dr,{tooltip:"Group by",onClick:P=>G.setGroupAnchorEl(P.currentTarget),color:"default",children:jsxRuntime.jsx(Jh__default.default,{fontSize:"small"})}),jsxRuntime.jsx(dr,{tooltip:"Sort by...",onClick:()=>Pe(true),color:G.sortBy.length>0||G.orderBy?"primary":"default",children:jsxRuntime.jsx(HT__default.default,{fontSize:"small"})})]}),jsxRuntime.jsxs(material.Stack,{direction:"row",spacing:.25,sx:{p:.5,borderRadius:2,backgroundColor:"action.hover"},children:[jsxRuntime.jsx(dr,{tooltip:"Expand task table",onClick:()=>Z("table"),color:B==="table"?"primary":"default",children:jsxRuntime.jsx(VT__default.default,{fontSize:"small"})}),jsxRuntime.jsx(dr,{tooltip:"Split evenly",onClick:xt,color:B===null&&M==="even"?"primary":"default",children:jsxRuntime.jsx(OT__default.default,{fontSize:"small"})}),jsxRuntime.jsx(dr,{tooltip:"Expand timeline",onClick:()=>Z("timeline"),color:B==="timeline"?"primary":"default",children:jsxRuntime.jsx(NT__default.default,{fontSize:"small"})})]}),jsxRuntime.jsx(material.Box,{sx:{minWidth:120},children:jsxRuntime.jsx(kf,{label:"",value:n,options:Ld.map(P=>({value:P.value,label:P.label})),onChange:P=>i?.(P.target.value),sx:{"& .MuiSelect-select":{fontSize:"0.92rem",py:.65},"& .MuiSvgIcon-root":{fontSize:20}}})})]})]}),j.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:R,sx:{height:"100%",display:"grid",gridTemplateColumns:fo,minWidth:0,transition:`grid-template-columns ${ur}`},children:[jsxRuntime.jsx(material.TableContainer,{"data-planning-scroll-pane":"table",ref:C,onScroll:()=>Me("table"),sx:{width:mo,minWidth:0,maxWidth:"100%",height:o,overflowX:"auto",overflowY:"auto",opacity:go?0:1,transform:go?"translateX(-10px)":"translateX(0)",pointerEvents:go?"none":"auto",transition:`opacity ${ur}, transform ${ur}, width ${ur}`},children:jsxRuntime.jsxs(material.Table,{size:"small",stickyHeader:true,sx:{tableLayout:"fixed",width:Ie,"& thead .MuiTableCell-root":{height:zd,py:0,lineHeight:1.15,boxSizing:"border-box"}},children:[jsxRuntime.jsx(core.DndContext,{sensors:lt,collisionDetection:core.closestCenter,modifiers:[modifiers.restrictToHorizontalAxis],onDragEnd:P=>{let N=P?.active?.id,q=P?.over?.id;typeof N=="string"&&typeof q=="string"&&G.handleColumnReorder(N,q);},children:jsxRuntime.jsx(Ki,{columns:G.columns,visibleColumns:G.visibleColumns,order:G.order,orderBy:G.orderBy,sortBy:G.sortBy,onRequestSort:G.handleRequestSort,onContextMenu:(P,N)=>{P.preventDefault(),P.stopPropagation(),ae({mouseX:P.clientX+2,mouseY:P.clientY-6,columnId:N});},grouping:G.grouping,isAllExpanded:G.isAllExpanded,handleToggleAll:G.handleToggleAll,columnWidths:G.columnWidths,onColumnResize:G.handleColumnResize,enableColumnReorder:true})}),jsxRuntime.jsx(material.TableBody,{children:X.map(P=>{let N=ut(P);if(P.type==="group")return jsxRuntime.jsxs(material.TableRow,{"data-planning-row-key":N,sx:{height:$r,backgroundColor:k.palette.action.hover},children:[G.grouping.length>0&&jsxRuntime.jsx(material.TableCell,{sx:{width:44,height:$r,py:0,borderBottom:`1px solid ${k.palette.divider}`},children:jsxRuntime.jsx(material.IconButton,{size:"small",onClick:()=>G.toggleGroupExpand(P.id),children:P.isExpanded?jsxRuntime.jsx(Pb__default.default,{fontSize:"small"}):jsxRuntime.jsx(If__default.default,{fontSize:"small"})})}),jsxRuntime.jsx(material.TableCell,{colSpan:G.visibleColumns.length,sx:{height:$r,py:0,borderBottom:`1px solid ${k.palette.divider}`},children:jsxRuntime.jsxs(material.Typography,{sx:{fontSize:13,fontWeight:700},children:[P.field,": ",P.value," (",P.count,")"]})})]},P.id);let q=P.data||P,oe=q.id===v,he=oo(q.id),Ce=ue.activeId===q.id,Se=ue.overId===q.id&&Tt(ue.activeId,q.id);return jsxRuntime.jsxs(material.TableRow,{"data-planning-row-key":N,draggable:he,hover:true,selected:oe,onDragStart:ye=>V(ye,q),onDragOver:ye=>H(ye,q.id),onDragEnter:ye=>H(ye,q.id),onDrop:ye=>ce(ye,q.id),onDragEnd:me,onClick:()=>u?.(Ne.get(q.id)||q),sx:{cursor:Ce?"grabbing":he?"grab":u?"pointer":"default",height:$r,opacity:Ce?.56:1,"& .MuiTableCell-root":Se?{borderTop:`2px solid ${k.palette.primary.main}`}:void 0,transition:"background-color 120ms ease, opacity 120ms ease"},children:[G.grouping.length>0&&jsxRuntime.jsx(material.TableCell,{sx:{width:44,height:$r,py:0,borderBottom:`1px solid ${k.palette.divider}`}}),(G.columns||[]).filter(ye=>G.visibleColumns.includes(ye.id)).map(ye=>jsxRuntime.jsx(material.TableCell,{sx:{width:G.columnWidths?.[ye.id]||ye.minWidth||100,height:$r,py:0,overflow:"hidden",borderBottom:`1px solid ${k.palette.divider}`},children:ye.render?ye.render(q[ye.id],q):String(q[ye.id]??"-")},`${q.id}-${ye.id}`))]},q.id)})})]})}),jsxRuntime.jsx(material.Box,{onPointerDown:wt?Ko:void 0,role:"separator","aria-orientation":"vertical",sx:{width:wt?Bs:0,cursor:wt?"col-resize":"default",opacity:wt?1:0,pointerEvents:wt?"auto":"none",borderLeft:wt?`1px solid ${k.palette.divider}`:"0 solid transparent",borderRight:wt?`1px solid ${k.palette.divider}`:"0 solid transparent",backgroundColor:k.palette.mode==="dark"?"rgba(148,163,184,0.10)":"rgba(15,23,42,0.04)",transition:`width ${ur}, opacity ${ur}, background-color 120ms ease`,position:"relative","&:hover":{backgroundColor:k.palette.action.selected},"&::before":{content:'""',position:"absolute",top:0,bottom:0,left:-6,right:-6,cursor:wt?"col-resize":"default"}}}),jsxRuntime.jsx(material.Box,{sx:{minWidth:0,overflow:"hidden",opacity:Qt?0:1,transform:Qt?"translateX(10px)":"translateX(0)",pointerEvents:Qt?"none":"auto",transition:`opacity ${ur}, transform ${ur}`},children:jsxRuntime.jsx(material.Box,{"data-planning-scroll-pane":"timeline",ref:I,onScroll:()=>Me("timeline"),sx:{width:"100%",height:o,overflowX:"auto",overflowY:"auto"},children:jsxRuntime.jsxs(material.Box,{sx:{width:Oe},children:[jsxRuntime.jsx(material.Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${rt.length}, ${at.width}px)`,height:te,boxSizing:"border-box",borderBottom:`1px solid ${k.palette.divider}`,position:"sticky",top:0,zIndex:2,backgroundColor:k.palette.background.paper},children:rt.map(P=>jsxRuntime.jsxs(material.Box,{title:P.title,sx:{px:.75,display:"flex",flexDirection:P.contextLabel?"column":"row",alignItems:"center",justifyContent:"center",gap:P.contextLabel?.15:0,borderRight:`1px solid ${k.palette.divider}`,color:P.contextLabel?"text.primary":"text.secondary",overflow:"hidden"},children:[P.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:P.contextLabel}),jsxRuntime.jsx(material.Typography,{component:"span",sx:{maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:12,fontWeight:700,lineHeight:1.15},children:P.label})]},P.key))}),jsxRuntime.jsx(material.Stack,{sx:{position:"relative"},children:X.map(P=>{let N=ut(P),q=O[N]??$r;if(P.type==="group")return jsxRuntime.jsx(material.Box,{"data-planning-timeline-row-key":N,sx:{position:"relative",height:q,boxSizing:"border-box",borderBottom:`1px solid ${k.palette.divider}`,backgroundColor:k.palette.action.hover}},P.id);let oe=P.data||P,he=ga__default.default(oe.startDate),Ce=ga__default.default(oe.endDate),Se=Vd(he,rt,at.width),ye=Vd(Ce,rt,at.width),He=Math.max(18,ye-Se),Ge=Rf(oe.progress),gt=oe.id===v,Ye=oo(oe.id),We=ue.activeId===oe.id,Ot=ue.overId===oe.id&&Tt(ue.activeId,oe.id),$t=oe.color??(oe.statusTone==="blocked"?k.palette.error.main:k.palette.primary.main);return jsxRuntime.jsx(material.Box,{"data-planning-timeline-row-key":N,draggable:Ye,onDragStart:vt=>V(vt,oe),onDragOver:vt=>H(vt,oe.id),onDragEnter:vt=>H(vt,oe.id),onDrop:vt=>ce(vt,oe.id),onDragEnd:me,onClick:()=>u?.(Ne.get(oe.id)||oe),sx:{position:"relative",height:q,boxSizing:"border-box",borderBottom:`1px solid ${k.palette.divider}`,opacity:We?.56:1,"&::before":{content:'""',position:"absolute",top:0,left:0,right:0,height:2,backgroundColor:k.palette.primary.main,opacity:Ot?1:0,transition:"opacity 120ms ease",pointerEvents:"none",zIndex:3},backgroundImage:k.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:`${at.width}px 100%`,cursor:We?"grabbing":Ye?"grab":u?"pointer":"default",transition:"opacity 120ms ease"},children:jsxRuntime.jsx(material.Tooltip,{title:`${oe.title}: ${he.format("MMM D HH:mm")} - ${Ce.format("MMM D HH:mm")}`,children:jsxRuntime.jsxs(material.Box,{sx:{position:"absolute",left:Se,top:Math.max(8,(q-24)/2),width:He,height:24,borderRadius:999,overflow:"hidden",backgroundColor:k.palette.mode==="dark"?"rgba(148,163,184,0.18)":"rgba(15,23,42,0.10)",outline:gt?`2px solid ${k.palette.warning.main}`:"none",outlineOffset:2},children:[jsxRuntime.jsx(material.Box,{sx:{height:"100%",width:`${Ge}%`,backgroundColor:$t}}),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:oe.code})]})})},oe.id)})})]})})})]})}),jsxRuntime.jsx(Xr,{groupAnchorEl:G.groupAnchorEl,setGroupAnchorEl:G.setGroupAnchorEl,grouping:G.grouping,setGrouping:G.setGrouping,columns:G.columns,toggleGroupField:G.toggleGroupField}),jsxRuntime.jsx(Yr,{anchorEl:G.anchorEl,setAnchorEl:G.setAnchorEl,columns:G.columns,visibleColumns:G.visibleColumns,toggleColumnVisibility:G.toggleColumnVisibility}),jsxRuntime.jsx(wu,{contextMenu:Ae,handleClose:()=>ae(null),columns:G.columns,visibleColumns:G.visibleColumns,grouping:G.grouping,summaryColumns:G.summaryColumns,showSummary:G.showSummary,sortBy:G.sortBy,orderBy:G.orderBy,order:G.order,onSortAsc:P=>{G.applyMultiSort([{field:P,direction:"asc"}]);},onSortDesc:P=>{G.applyMultiSort([{field:P,direction:"desc"}]);},onClearSort:P=>{let N=G.sortBy.filter(q=>q.field!==P);N.length>0?G.applyMultiSort(N):(G.clearMultiSort(),G.orderBy===P&&G.setOrderBy(""));},onHideColumn:P=>{G.visibleColumns.includes(P)&&G.toggleColumnVisibility(P);},onToggleGroup:P=>G.toggleGroupField(P),onToggleSummary:P=>G.toggleSummaryColumn(P),onOpenSortDialog:()=>Pe(true)}),jsxRuntime.jsx(Tu,{open:ve,onClose:()=>Pe(false),columns:G.columns,initialRules:G.sortBy.length>0?G.sortBy:G.orderBy?[{field:G.orderBy,direction:G.order}]:[],onApply:P=>G.applyMultiSort(P),onClear:()=>{G.clearMultiSort(),G.setOrderBy("");}})]})};var hO=({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(ka,{...e})}),jsxRuntime.jsx(material.Box,{sx:{flex:1,minHeight:0,overflow:"hidden"},children:jsxRuntime.jsx(Bf,{...t,bodyHeight:t.bodyHeight??"100%",sx:i})}),r]})};var eI={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)"),[s,l]=Et.useState("to"),g=!i&&!d&&o!=="none";Et.useEffect(()=>{if(!g){l("to");return}l("from");let b=requestAnimationFrame(()=>{b=requestAnimationFrame(()=>{l("to");});});return ()=>cancelAnimationFrame(b)},[t,g]);let f=eI[o],p=Et.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",...p,...c},children:e})},kO={subtle:{variant:"fade",durationMs:180},smooth:{variant:"slide-up",durationMs:220},snappy:{variant:"scale",durationMs:160}};exports.AIBrowserGlow=YV;exports.AgentPanel=HV;exports.Button=zs;exports.CAINavProvider=ow;exports.CAmapChart=Uu;exports.CAppHeader=$l;exports.CAppPageLayout=F5;exports.CAuthPage=C4;exports.CBarChart=Qn;exports.CChartCard=Xi;exports.CComboChart=Au;exports.CCustomizeAgent=ju;exports.CDetailInfoPage=VB;exports.CDetailSearchAiBar=Kp;exports.CDetailSectionCard=Bl;exports.CFishboneChart=Lu;exports.CGoogleMapChart=Hu;exports.CGraphCharts=Ku;exports.CGraphKpiCards=Pu;exports.CGraphReport=ul;exports.CHeatmapChart=Eu;exports.CKanbanBoard=n5;exports.CKanbanBucket=Yp;exports.CKanbanCard=$c;exports.CLayoutManagement=xp;exports.CLayoutManager=kl;exports.CLineChart=Du;exports.CMessageBox=$n;exports.COrbCanvas=$S;exports.CPageLayout=su;exports.CPageTransition=CO;exports.CPieChart=al;exports.CPivotTable=kF;exports.CPlanningGantt=Bf;exports.CPlanningLayout=hO;exports.CSmartFilter=ka;exports.CSmartTable=aA;exports.CStandardPage=dA;exports.CTable=Qa;exports.CTableBody=Q2;exports.CTableCell=J2;exports.CTableContainer=eA;exports.CTableHead=tA;exports.CTableRow=oA;exports.CValueHelp=lu;exports.CVariantManagement=fl;exports.CVariantManager=rp;exports.CVoiceWaveOverlay=yd;exports.CWaterfallChart=Nu;exports.CodeBlock=si;exports.CopilotChat=jV;exports.GlobalMessage=rP;exports.MarkdownRenderer=mi;exports.MathBlock=ci;exports.MermaidBlock=Rc;exports.NavigationIsland=Hs;exports.ORBCAFE_I18N_MESSAGES=Wn;exports.OrbcafeI18nProvider=Wi;exports.PAGE_TRANSITION_PRESETS=kO;exports.PAppPageLayout=QL;exports.PBarcodeScanner=WF;exports.PNavIsland=xg;exports.PNumericKeypad=oL;exports.PSmartFilter=ug;exports.PTable=IS;exports.PTouchCard=_F;exports.PWorkloadNav=gg;exports.PivotChartPanel=Gm;exports.StdChat=uf;exports.TableBlock=Dc;exports.ThinkBlock=Dl;exports.TreeMenu=Vs;exports.VoiceNavigatorProvider=gz;exports.VoiceWaveOverlay=iz;exports.buildAmapEmbedUrl=il;exports.buildGoogleMapEmbedUrl=ti;exports.buildGoogleMapIframe=cM;exports.buttonVariants=$f;exports.createKanbanBoardModel=em;exports.findKanbanCard=ta;exports.message=WI;exports.messageManager=xa;exports.moveKanbanCard=Nl;exports.parseMarkdownTable=Rl;exports.renderMarkdown=lB;exports.resolveVariantFilters=Cp;exports.resolveVariantLayout=Sl;exports.useAINav=aw;exports.useAmapEmbedUrl=TA;exports.useAuthPage=t4;exports.useDetailInfo=_p;exports.useGoogleMapEmbedUrl=wA;exports.useGraphChartData=xA;exports.useGraphInteraction=ml;exports.useGraphReport=sn;exports.useKanbanBoard=d5;exports.useNavigationIsland=Xd;exports.useOrbcafeI18n=re;exports.usePadLayout=BF;exports.usePadRecordEditor=LF;exports.usePageLayout=dm;exports.usePivotTable=PF;exports.usePlanningGantt=xf;exports.usePlanningLayout=M4;exports.useStandardReport=hA;exports.useVoiceInput=gs;exports.useVoiceNavigator=fz;