orbcafe-ui 1.1.2 → 1.1.3
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/README.md +95 -5
- package/dist/index.d.mts +105 -2
- package/dist/index.d.ts +105 -2
- package/dist/index.js +14 -14
- package/dist/index.mjs +12 -12
- package/package.json +14 -1
package/dist/index.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {a}from'./chunk-74Z76O3S.mjs';export{b as COrbCanvas}from'./chunk-74Z76O3S.mjs';import*as Ne from'react';import Ne__default,{createContext,useMemo,useContext,useState,useEffect,useCallback,Fragment as Fragment$1,useRef}from'react';import {usePathname,useRouter}from'next/navigation';import {ChevronRight,Search}from'lucide-react';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {Slot}from'@radix-ui/react-slot';import {cva}from'class-variance-authority';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import Nl from'@mui/material/Dialog';import Gl from'@mui/material/DialogTitle';import $l from'@mui/material/DialogContent';import Hc from'@mui/material/DialogContentText';import Wl from'@mui/material/DialogActions';import da from'@mui/material/Box';import _c from'@mui/icons-material/CheckCircle';import Kc from'@mui/icons-material/Warning';import Zc from'@mui/icons-material/Error';import jc from'@mui/icons-material/Info';import {styled,Box,Typography,Paper,Stack,Link,Dialog,DialogTitle,IconButton,DialogContent,MenuItem,DialogActions,Button,Chip,InputBase,useTheme,Autocomplete,TextField,Tooltip,FormControlLabel,Checkbox,Menu,ListItemText,Divider,Collapse,Grid,ListItemIcon,CircularProgress,Alert,TableContainer,Table,TableHead,TableRow,TableCell,TableBody,Tabs,Tab,AppBar,Toolbar,InputAdornment,Avatar,createTheme,ThemeProvider,FormControl,Select,Switch,Portal,useMediaQuery,Popover,ListSubheader,Badge,TableFooter}from'@mui/material';import Qd from'@mui/material/Paper';import Yd from'@mui/material/Table';import Xd from'@mui/material/TableBody';import Zr from'@mui/material/TableCell';import ql from'@mui/material/TableContainer';import Cu from'@mui/material/TableHead';import Su from'@mui/material/TableRow';import Hl from'@mui/material/TextField';import rr from'@mui/material/Button';import Ul from'@mui/material/Alert';import {DndContext,closestCenter,useSensors,useSensor,PointerSensor,DragOverlay,useDroppable,useDraggable}from'@dnd-kit/core';import {restrictToHorizontalAxis}from'@dnd-kit/modifiers';import wl from'@mui/icons-material/Search';import lu from'@mui/icons-material/ViewColumn';import Bl from'@mui/icons-material/Save';import cu from'@mui/icons-material/Download';import uu from'@mui/icons-material/AccountTree';import pu from'@mui/icons-material/Functions';import du from'@mui/icons-material/Insights';import mu from'@mui/icons-material/Add';import gu from'@mui/icons-material/Edit';import fu from'@mui/icons-material/Delete';import hu from'@mui/icons-material/KeyboardArrowLeft';import yu from'@mui/icons-material/KeyboardArrowRight';import ku from'@mui/material/Checkbox';import Tu from'@mui/material/TableSortLabel';import wu from'@mui/material/IconButton';import Iu from'@mui/material/Tooltip';import Pu from'@mui/icons-material/UnfoldMore';import Du from'@mui/icons-material/UnfoldLess';import Lu from'@mui/icons-material/KeyboardArrowDown';import Zu from'@mui/icons-material/Check';import ju from'@mui/icons-material/ClearAll';import Sp from'@mui/icons-material/Close';import Ap from'@mui/icons-material/MicNoneOutlined';import Mp from'@mui/icons-material/SettingsOutlined';import Fp from'@mui/icons-material/SendOutlined';import Dd from'@mui/icons-material/Settings';import Rd from'@mui/icons-material/KeyboardArrowUp';import Md from'@mui/icons-material/ArrowRightAlt';import Jp from'@mui/icons-material/Star';import {DateCalendar}from'@mui/x-date-pickers/DateCalendar';import {PickersDay}from'@mui/x-date-pickers/PickersDay';import {LocalizationProvider}from'@mui/x-date-pickers/LocalizationProvider';import {AdapterDayjs}from'@mui/x-date-pickers/AdapterDayjs';import gd from'@mui/icons-material/CalendarMonth';import fd from'@mui/icons-material/Clear';import hd from'@mui/icons-material/ArrowForward';import no from'dayjs';import yd from'dayjs/plugin/isBetween';import bd from'dayjs/plugin/localizedFormat';import'dayjs/locale/zh-cn';import'dayjs/locale/fr';import'dayjs/locale/de';import'dayjs/locale/ja';import'dayjs/locale/ko';import qd from'@mui/icons-material/StarBorder';import _d from'@mui/icons-material/ViewQuilt';import gg from'@mui/icons-material/CloseOutlined';import gm from'@mui/icons-material/ContentCopyOutlined';import fm from'@mui/icons-material/CheckOutlined';import Um from'@mui/icons-material/ExpandMore';import ms from'@mui/icons-material/Language';import Tg from'@mui/icons-material/DesktopWindows';import wg from'@mui/icons-material/DarkMode';import Ig from'@mui/icons-material/LightMode';import Dg from'@mui/icons-material/Logout';import $f from'@mui/icons-material/DeleteOutline';import {arrayMove,SortableContext,verticalListSortingStrategy,useSortable}from'@dnd-kit/sortable';import Yg from'@mui/icons-material/DragIndicator';import ff from'@mui/icons-material/FilterList';import hf from'@mui/icons-material/TableRows';import of from'@mui/icons-material/LayersClear';import Yf from'next/dynamic';import {AnimatePresence,motion}from'framer-motion';function ut(...e){return twMerge(clsx(e))}var zr={primary:"#000000",primaryHover:"#333333"},Ra={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"},jo={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",full:"rounded-full"},fi=()=>"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 yc=cva(fi(),{variants:{variant:{default:`${Ra.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:`${Ra.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:Ra.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-[${zr.primary}] hover:bg-[${zr.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:jo.none,sm:jo.sm,md:jo.md,full:jo.full}},defaultVariants:{variant:"default",size:"default",rounded:"md"}}),Or=Ne.forwardRef(({className:e,variant:t,size:i,asChild:o=false,...n},r)=>jsx(o?Slot:"button",{className:ut(yc({variant:t,size:i,className:e})),ref:r,...n}));Or.displayName="Button";var vc={"common.cancel":"Cancel","common.save":"Save","common.ok":"OK","common.done":"Done","common.search":"Search","common.none":"None","common.all":"All","common.noData":"No data","common.copy":"Copy","common.delete":"Delete","common.loading":"Loading...","header.searchPlaceholder":"Ask me...","header.theme.system":"Theme: System","header.theme.dark":"Theme: Dark","header.theme.light":"Theme: Light","header.menu.setting":"Setting","header.menu.logout":"Logout","navigation.expand":"Expand navigation","navigation.collapse":"Collapse navigation","navigation.searchPlaceholder":"Search menu...","navigation.noMatch":"No matching menu items","navigation.noAccessibleApp":"No accessible applications","navigation.noItems":"No items to display","navigation.expandView":"Expand {title}","table.toolbar.searchPlaceholder":"Search...","table.title.default":"Data Table","table.toolbar.groupBy":"Group By","table.toolbar.summary":"Summary","table.toolbar.columns":"Columns","table.toolbar.export":"Export","table.toolbar.itemsPerPage":"Items per page:","table.toolbar.pageOf":"Page {current} of {total}","table.toolbar.newItem":"New Item","table.toolbar.editItem":"Edit Item","table.toolbar.deleteItem":"Delete Item","table.toolbar.graphicReport":"Graphic Report","table.toolbar.saveLayout":"Save Layout","table.menu.groupBy":"Group By","table.menu.clearAll":"Clear All","table.menu.visibleColumns":"Visible Columns","table.menu.showSummaryRow":"Show Summary Row","table.menu.noNumericColumns":"No numeric columns","table.group.expandAll":"Expand All Groups","table.group.collapseAll":"Collapse All Groups","table.mobile.notImplemented":"Mobile View Not Implemented","pivot.title.default":"Pivot Table Builder","pivot.subtitle.default":"Drag fields to configure the pivot table.","pivot.empty":"Drag at least one field into Values to render the pivot result.","pivot.records":"Records","pivot.afterFilter":"After filter","pivot.grandTotal":"Grand Total","pivot.resultLabel":"Result","pivot.valueLabel":"Value","pivot.table.dimensions":"Dimensions","pivot.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}","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","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"},xc={"common.cancel":"\u53D6\u6D88","common.save":"\u4FDD\u5B58","common.ok":"\u786E\u5B9A","common.done":"\u5B8C\u6210","common.search":"\u641C\u7D22","common.none":"\u65E0","common.all":"\u5168\u90E8","common.noData":"\u6682\u65E0\u6570\u636E","common.copy":"\u590D\u5236","common.delete":"\u5220\u9664","common.loading":"\u52A0\u8F7D\u4E2D...","header.searchPlaceholder":"\u95EE\u6211\u70B9\u4EC0\u4E48...","header.theme.system":"\u4E3B\u9898\uFF1A\u8DDF\u968F\u7CFB\u7EDF","header.theme.dark":"\u4E3B\u9898\uFF1A\u6DF1\u8272","header.theme.light":"\u4E3B\u9898\uFF1A\u6D45\u8272","header.menu.setting":"\u8BBE\u7F6E","header.menu.logout":"\u6CE8\u9500","navigation.expand":"\u5C55\u5F00\u5BFC\u822A","navigation.collapse":"\u6298\u53E0\u5BFC\u822A","navigation.searchPlaceholder":"\u641C\u7D22\u83DC\u5355...","navigation.noMatch":"\u672A\u627E\u5230\u5339\u914D\u7684\u83DC\u5355\u9879","navigation.noAccessibleApp":"\u6682\u65E0\u53EF\u8BBF\u95EE\u7684\u5E94\u7528","navigation.noItems":"\u6682\u65E0\u53EF\u663E\u793A\u9879","navigation.expandView":"\u5C55\u5F00\u67E5\u770B {title}","table.toolbar.searchPlaceholder":"\u641C\u7D22...","table.title.default":"\u6570\u636E\u8868","table.toolbar.groupBy":"\u5206\u7EC4","table.toolbar.summary":"\u6C47\u603B","table.toolbar.columns":"\u5217","table.toolbar.export":"\u5BFC\u51FA","table.toolbar.itemsPerPage":"\u6BCF\u9875\u6761\u6570\uFF1A","table.toolbar.pageOf":"\u7B2C {current} / {total} \u9875","table.toolbar.newItem":"\u65B0\u5EFA\u6761\u76EE","table.toolbar.editItem":"\u7F16\u8F91\u6761\u76EE","table.toolbar.deleteItem":"\u5220\u9664\u6761\u76EE","table.toolbar.graphicReport":"\u56FE\u8868\u62A5\u8868","table.toolbar.saveLayout":"\u4FDD\u5B58\u5E03\u5C40","table.menu.groupBy":"\u5206\u7EC4","table.menu.clearAll":"\u6E05\u7A7A","table.menu.visibleColumns":"\u53EF\u89C1\u5217","table.menu.showSummaryRow":"\u663E\u793A\u6C47\u603B\u884C","table.menu.noNumericColumns":"\u6CA1\u6709\u6570\u503C\u5217","table.group.expandAll":"\u5C55\u5F00\u5168\u90E8\u5206\u7EC4","table.group.collapseAll":"\u6298\u53E0\u5168\u90E8\u5206\u7EC4","table.mobile.notImplemented":"\u79FB\u52A8\u7AEF\u89C6\u56FE\u6682\u672A\u5B9E\u73B0","pivot.title.default":"\u6570\u636E\u900F\u89C6\u8868","pivot.subtitle.default":"\u62D6\u62FD\u5B57\u6BB5\u4EE5\u914D\u7F6E\u900F\u89C6\u8868\u3002","pivot.empty":"\u8BF7\u81F3\u5C11\u62D6\u5165\u4E00\u4E2A\u503C\u5B57\u6BB5\u540E\u518D\u67E5\u770B\u900F\u89C6\u7ED3\u679C\u3002","pivot.records":"\u8BB0\u5F55\u6570","pivot.afterFilter":"\u7B5B\u9009\u540E","pivot.grandTotal":"\u603B\u8BA1","pivot.resultLabel":"\u7ED3\u679C","pivot.valueLabel":"\u503C","pivot.table.dimensions":"\u7EF4\u5EA6","pivot.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}","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","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"},Cc={"common.cancel":"Annuler","common.save":"Enregistrer","common.ok":"OK","common.done":"Terminer","common.search":"Rechercher","common.none":"Aucun","common.all":"Tout","common.noData":"Aucune donn\xE9e","common.copy":"Copier","common.delete":"Supprimer","common.loading":"Chargement...","header.searchPlaceholder":"Demandez-moi...","header.theme.system":"Th\xE8me : Syst\xE8me","header.theme.dark":"Th\xE8me : Sombre","header.theme.light":"Th\xE8me : Clair","header.menu.setting":"Param\xE8tres","header.menu.logout":"Se d\xE9connecter","navigation.expand":"D\xE9velopper la navigation","navigation.collapse":"R\xE9duire la navigation","navigation.searchPlaceholder":"Rechercher dans le menu...","navigation.noMatch":"Aucun \xE9l\xE9ment correspondant","navigation.noAccessibleApp":"Aucune application accessible","navigation.noItems":"Aucun \xE9l\xE9ment \xE0 afficher","navigation.expandView":"D\xE9velopper {title}","table.toolbar.searchPlaceholder":"Rechercher...","table.title.default":"Tableau de donn\xE9es","table.toolbar.groupBy":"Grouper","table.toolbar.summary":"R\xE9sum\xE9","table.toolbar.columns":"Colonnes","table.toolbar.export":"Exporter","table.toolbar.itemsPerPage":"Lignes par page :","table.toolbar.pageOf":"Page {current} sur {total}","table.toolbar.newItem":"Nouvel \xE9l\xE9ment","table.toolbar.editItem":"Modifier l'\xE9l\xE9ment","table.toolbar.deleteItem":"Supprimer l'\xE9l\xE9ment","table.toolbar.graphicReport":"Rapport graphique","table.toolbar.saveLayout":"Enregistrer la vue","table.menu.groupBy":"Grouper","table.menu.clearAll":"Tout effacer","table.menu.visibleColumns":"Colonnes visibles","table.menu.showSummaryRow":"Afficher la ligne de r\xE9sum\xE9","table.menu.noNumericColumns":"Aucune colonne num\xE9rique","table.group.expandAll":"D\xE9velopper tous les groupes","table.group.collapseAll":"R\xE9duire tous les groupes","table.mobile.notImplemented":"Vue mobile non impl\xE9ment\xE9e","pivot.title.default":"Tableau crois\xE9 dynamique","pivot.subtitle.default":"Faites glisser les champs pour configurer le tableau crois\xE9.","pivot.empty":"Ajoutez au moins un champ de valeur pour afficher le r\xE9sultat.","pivot.records":"Enregistrements","pivot.afterFilter":"Apr\xE8s filtre","pivot.grandTotal":"Total g\xE9n\xE9ral","pivot.resultLabel":"R\xE9sultat","pivot.valueLabel":"Valeur","pivot.table.dimensions":"Dimensions","pivot.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}","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","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"},Sc={"common.cancel":"Abbrechen","common.save":"Speichern","common.ok":"OK","common.done":"Fertig","common.search":"Suchen","common.none":"Keine","common.all":"Alle","common.noData":"Keine Daten","common.copy":"Kopieren","common.delete":"L\xF6schen","common.loading":"Wird geladen...","header.searchPlaceholder":"Frag mich...","header.theme.system":"Theme: System","header.theme.dark":"Theme: Dunkel","header.theme.light":"Theme: Hell","header.menu.setting":"Einstellungen","header.menu.logout":"Abmelden","navigation.expand":"Navigation erweitern","navigation.collapse":"Navigation einklappen","navigation.searchPlaceholder":"Men\xFC suchen...","navigation.noMatch":"Keine passenden Men\xFCeintr\xE4ge","navigation.noAccessibleApp":"Keine verf\xFCgbaren Anwendungen","navigation.noItems":"Keine Eintr\xE4ge vorhanden","navigation.expandView":"{title} aufklappen","table.toolbar.searchPlaceholder":"Suchen...","table.title.default":"Datentabelle","table.toolbar.groupBy":"Gruppieren","table.toolbar.summary":"Zusammenfassung","table.toolbar.columns":"Spalten","table.toolbar.export":"Export","table.toolbar.itemsPerPage":"Zeilen pro Seite:","table.toolbar.pageOf":"Seite {current} von {total}","table.toolbar.newItem":"Neuer Eintrag","table.toolbar.editItem":"Eintrag bearbeiten","table.toolbar.deleteItem":"Eintrag l\xF6schen","table.toolbar.graphicReport":"Grafikbericht","table.toolbar.saveLayout":"Layout speichern","table.menu.groupBy":"Gruppieren","table.menu.clearAll":"Alles l\xF6schen","table.menu.visibleColumns":"Sichtbare Spalten","table.menu.showSummaryRow":"Summenzeile anzeigen","table.menu.noNumericColumns":"Keine numerischen Spalten","table.group.expandAll":"Alle Gruppen aufklappen","table.group.collapseAll":"Alle Gruppen zuklappen","table.mobile.notImplemented":"Mobile Ansicht nicht implementiert","pivot.title.default":"Pivot-Tabelle","pivot.subtitle.default":"Ziehen Sie Felder, um die Pivot-Tabelle zu konfigurieren.","pivot.empty":"Ziehen Sie mindestens ein Wertefeld, um das Ergebnis anzuzeigen.","pivot.records":"Datens\xE4tze","pivot.afterFilter":"Nach Filter","pivot.grandTotal":"Gesamtsumme","pivot.resultLabel":"Ergebnis","pivot.valueLabel":"Wert","pivot.table.dimensions":"Dimensionen","pivot.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}","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","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"},kc={"common.cancel":"\u30AD\u30E3\u30F3\u30BB\u30EB","common.save":"\u4FDD\u5B58","common.ok":"OK","common.done":"\u5B8C\u4E86","common.search":"\u691C\u7D22","common.none":"\u306A\u3057","common.all":"\u3059\u3079\u3066","common.noData":"\u30C7\u30FC\u30BF\u306A\u3057","common.copy":"\u30B3\u30D4\u30FC","common.delete":"\u524A\u9664","common.loading":"\u8AAD\u307F\u8FBC\u307F\u4E2D...","header.searchPlaceholder":"\u4F55\u304B\u805E\u3044\u3066\u304F\u3060\u3055\u3044...","header.theme.system":"\u30C6\u30FC\u30DE\uFF1A\u30B7\u30B9\u30C6\u30E0","header.theme.dark":"\u30C6\u30FC\u30DE\uFF1A\u30C0\u30FC\u30AF","header.theme.light":"\u30C6\u30FC\u30DE\uFF1A\u30E9\u30A4\u30C8","header.menu.setting":"\u8A2D\u5B9A","header.menu.logout":"\u30ED\u30B0\u30A2\u30A6\u30C8","navigation.expand":"\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u3092\u5C55\u958B","navigation.collapse":"\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u3092\u6298\u308A\u305F\u305F\u3080","navigation.searchPlaceholder":"\u30E1\u30CB\u30E5\u30FC\u3092\u691C\u7D22...","navigation.noMatch":"\u4E00\u81F4\u3059\u308B\u30E1\u30CB\u30E5\u30FC\u304C\u3042\u308A\u307E\u305B\u3093","navigation.noAccessibleApp":"\u30A2\u30AF\u30BB\u30B9\u53EF\u80FD\u306A\u30A2\u30D7\u30EA\u304C\u3042\u308A\u307E\u305B\u3093","navigation.noItems":"\u8868\u793A\u3067\u304D\u308B\u9805\u76EE\u304C\u3042\u308A\u307E\u305B\u3093","navigation.expandView":"{title} \u3092\u5C55\u958B","table.toolbar.searchPlaceholder":"\u691C\u7D22...","table.title.default":"\u30C7\u30FC\u30BF\u30C6\u30FC\u30D6\u30EB","table.toolbar.groupBy":"\u30B0\u30EB\u30FC\u30D7\u5316","table.toolbar.summary":"\u96C6\u8A08","table.toolbar.columns":"\u5217","table.toolbar.export":"\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8","table.toolbar.itemsPerPage":"1\u30DA\u30FC\u30B8\u306E\u4EF6\u6570\uFF1A","table.toolbar.pageOf":"{current} / {total} \u30DA\u30FC\u30B8","table.toolbar.newItem":"\u65B0\u898F\u4F5C\u6210","table.toolbar.editItem":"\u7DE8\u96C6","table.toolbar.deleteItem":"\u524A\u9664","table.toolbar.graphicReport":"\u30B0\u30E9\u30D5\u30A3\u30C3\u30AF\u30EC\u30DD\u30FC\u30C8","table.toolbar.saveLayout":"\u30EC\u30A4\u30A2\u30A6\u30C8\u4FDD\u5B58","table.menu.groupBy":"\u30B0\u30EB\u30FC\u30D7\u5316","table.menu.clearAll":"\u3059\u3079\u3066\u30AF\u30EA\u30A2","table.menu.visibleColumns":"\u8868\u793A\u5217","table.menu.showSummaryRow":"\u96C6\u8A08\u884C\u3092\u8868\u793A","table.menu.noNumericColumns":"\u6570\u5024\u5217\u304C\u3042\u308A\u307E\u305B\u3093","table.group.expandAll":"\u3059\u3079\u3066\u306E\u30B0\u30EB\u30FC\u30D7\u3092\u5C55\u958B","table.group.collapseAll":"\u3059\u3079\u3066\u306E\u30B0\u30EB\u30FC\u30D7\u3092\u6298\u308A\u305F\u305F\u3080","table.mobile.notImplemented":"\u30E2\u30D0\u30A4\u30EB\u8868\u793A\u306F\u672A\u5B9F\u88C5\u3067\u3059","pivot.title.default":"\u30D4\u30DC\u30C3\u30C8\u30C6\u30FC\u30D6\u30EB","pivot.subtitle.default":"\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u30D4\u30DC\u30C3\u30C8\u30C6\u30FC\u30D6\u30EB\u3092\u8A2D\u5B9A\u3057\u307E\u3059\u3002","pivot.empty":"\u7D50\u679C\u3092\u8868\u793A\u3059\u308B\u306B\u306F\u3001\u5024\u30A8\u30EA\u30A2\u306B\u5C11\u306A\u304F\u3068\u30821\u3064\u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","pivot.records":"\u30EC\u30B3\u30FC\u30C9","pivot.afterFilter":"\u30D5\u30A3\u30EB\u30BF\u30FC\u5F8C","pivot.grandTotal":"\u7DCF\u8A08","pivot.resultLabel":"\u7D50\u679C","pivot.valueLabel":"\u5024","pivot.table.dimensions":"\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3","pivot.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}","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","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"},Tc={"common.cancel":"\uCDE8\uC18C","common.save":"\uC800\uC7A5","common.ok":"\uD655\uC778","common.done":"\uC644\uB8CC","common.search":"\uAC80\uC0C9","common.none":"\uC5C6\uC74C","common.all":"\uC804\uCCB4","common.noData":"\uB370\uC774\uD130 \uC5C6\uC74C","common.copy":"\uBCF5\uC0AC","common.delete":"\uC0AD\uC81C","common.loading":"\uB85C\uB529 \uC911...","header.searchPlaceholder":"\uBB34\uC5C7\uC774\uB4E0 \uBB3C\uC5B4\uBCF4\uC138\uC694...","header.theme.system":"\uD14C\uB9C8: \uC2DC\uC2A4\uD15C","header.theme.dark":"\uD14C\uB9C8: \uB2E4\uD06C","header.theme.light":"\uD14C\uB9C8: \uB77C\uC774\uD2B8","header.menu.setting":"\uC124\uC815","header.menu.logout":"\uB85C\uADF8\uC544\uC6C3","navigation.expand":"\uD0D0\uC0C9 \uD3BC\uCE58\uAE30","navigation.collapse":"\uD0D0\uC0C9 \uC811\uAE30","navigation.searchPlaceholder":"\uBA54\uB274 \uAC80\uC0C9...","navigation.noMatch":"\uC77C\uCE58\uD558\uB294 \uBA54\uB274\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4","navigation.noAccessibleApp":"\uC811\uADFC \uAC00\uB2A5\uD55C \uC571\uC774 \uC5C6\uC2B5\uB2C8\uB2E4","navigation.noItems":"\uD45C\uC2DC\uD560 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4","navigation.expandView":"{title} \uD3BC\uCE58\uAE30","table.toolbar.searchPlaceholder":"\uAC80\uC0C9...","table.title.default":"\uB370\uC774\uD130 \uD14C\uC774\uBE14","table.toolbar.groupBy":"\uADF8\uB8F9","table.toolbar.summary":"\uC694\uC57D","table.toolbar.columns":"\uC5F4","table.toolbar.export":"\uB0B4\uBCF4\uB0B4\uAE30","table.toolbar.itemsPerPage":"\uD398\uC774\uC9C0\uB2F9 \uD589 \uC218:","table.toolbar.pageOf":"{current} / {total} \uD398\uC774\uC9C0","table.toolbar.newItem":"\uC2E0\uADDC \uD56D\uBAA9","table.toolbar.editItem":"\uD56D\uBAA9 \uC218\uC815","table.toolbar.deleteItem":"\uD56D\uBAA9 \uC0AD\uC81C","table.toolbar.graphicReport":"\uADF8\uB798\uD504 \uB9AC\uD3EC\uD2B8","table.toolbar.saveLayout":"\uB808\uC774\uC544\uC6C3 \uC800\uC7A5","table.menu.groupBy":"\uADF8\uB8F9","table.menu.clearAll":"\uBAA8\uB450 \uC9C0\uC6B0\uAE30","table.menu.visibleColumns":"\uD45C\uC2DC \uC5F4","table.menu.showSummaryRow":"\uC694\uC57D \uD589 \uD45C\uC2DC","table.menu.noNumericColumns":"\uC22B\uC790 \uC5F4 \uC5C6\uC74C","table.group.expandAll":"\uBAA8\uB4E0 \uADF8\uB8F9 \uD3BC\uCE58\uAE30","table.group.collapseAll":"\uBAA8\uB4E0 \uADF8\uB8F9 \uC811\uAE30","table.mobile.notImplemented":"\uBAA8\uBC14\uC77C \uBDF0\uB294 \uC544\uC9C1 \uAD6C\uD604\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4","pivot.title.default":"\uD53C\uBC97 \uD14C\uC774\uBE14","pivot.subtitle.default":"\uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uD53C\uBC97 \uD14C\uC774\uBE14\uC744 \uAD6C\uC131\uD558\uC138\uC694.","pivot.empty":"\uACB0\uACFC\uB97C \uBCF4\uB824\uBA74 \uAC12 \uC601\uC5ED\uC5D0 \uCD5C\uC18C \uD55C \uAC1C\uC758 \uD544\uB4DC\uB97C \uCD94\uAC00\uD558\uC138\uC694.","pivot.records":"\uB808\uCF54\uB4DC","pivot.afterFilter":"\uD544\uD130 \uD6C4","pivot.grandTotal":"\uCD1D\uD569","pivot.resultLabel":"\uACB0\uACFC","pivot.valueLabel":"\uAC12","pivot.table.dimensions":"\uCC28\uC6D0","pivot.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}","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","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"},Qo={en:vc,zh:xc,fr:Cc,de:Sc,ja:kc,ko:Tc};var yi=(e,t)=>t?e.replace(/\{(\w+)\}/g,(i,o)=>{let n=t[o];return n==null?"":String(n)}):e,Dc={locale:"en",t:(e,t)=>yi(Qo.en[e]||e,t)},bi=createContext(Dc),vi=({locale:e="en",messages:t,children:i})=>{let o=useMemo(()=>{let n=Qo[e]||Qo.en,r=t?.[e]||{},a={...Qo.en,...n,...r};return {locale:e,t:(l,u)=>yi(a[l]||l,u)}},[e,t]);return jsx(bi.Provider,{value:o,children:i})},U=()=>useContext(bi);function Nr({items:e,onItemClick:t,className:i="",level:o=0,expandedIds:n,onToggleExpand:r,colorMode:a="light"}){let{t:l}=U(),u=a==="dark",s=usePathname(),[c,d]=useState(false),[b,p]=useState(new Set),h=n!==void 0&&r!==void 0,y=h?n:b;useEffect(()=>{d(true);},[]);let S=m=>{if(h)r(m);else {let x=new Set(b);x.has(m)?x.delete(m):x.add(m),p(x);}},v=m=>{m.children&&m.children.length>0&&S(m.id),t&&t(m);};return !e||!Array.isArray(e)?jsx("div",{className:ut("tree-menu",i),children:jsx("div",{className:"text-sm text-gray-500 p-2",children:l("navigation.noItems")})}):jsx("div",{className:ut("tree-menu",i),children:e.map(m=>{let x=y.has(m.id)||m.isExpanded,w=m.children&&m.children.length>0,I=m.appurl||m.href,R=c&&I?s===I:false;return jsxs("div",{className:"tree-menu-item relative",children:[R&&jsx("div",{className:ut("absolute left-0 top-2 bottom-2 w-[3px] rounded-r-full z-10",u?"bg-[#90caf9]":"bg-[#1976d2]")}),jsxs(Or,{variant:"ghost",className:ut("w-full justify-start gap-2 h-auto py-2 relative overflow-hidden group",`ml-${o*4}`,R?u?"bg-transparent text-[#90caf9] hover:bg-gray-800/35":"bg-transparent text-[#1976d2] hover:bg-gray-100/60":u?"hover:bg-gray-800/50 text-gray-300":"hover:bg-gray-100/50 text-gray-700"),onClick:()=>v(m),children:[w&&jsx("div",{className:ut("flex-shrink-0 transition-transform duration-200",x&&"rotate-90",R?u?"text-[#90caf9]":"text-[#1976d2]":u?"text-gray-500 group-hover:text-gray-300":"text-gray-400 group-hover:text-gray-600"),children:jsx(ChevronRight,{className:"h-4 w-4"})}),!w&&jsx("div",{className:"w-4 h-4 flex-shrink-0"}),m.icon&&jsx("div",{className:ut("flex-shrink-0 transition-colors duration-200",R?u?"text-[#90caf9]":"text-[#1976d2]":u?"text-gray-500 group-hover:text-gray-300":"text-gray-400 group-hover:text-gray-600"),children:m.icon}),jsxs("div",{className:"flex-1 text-left overflow-hidden z-10",children:[jsx("div",{className:ut("text-sm truncate transition-colors duration-200",R?"font-semibold":"font-medium"),children:m.title||m.label}),m.description&&jsx("div",{className:ut("text-xs truncate transition-colors duration-200",R?u?"text-[#90caf9]/70":"text-[#1976d2]/75":u?"text-gray-400":"text-gray-500"),title:m.description,children:m.description})]})]}),w&&jsx("div",{className:ut("grid transition-[grid-template-rows] duration-300 ease-in-out",x?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:jsx("div",{className:"overflow-hidden",children:jsx(Nr,{items:m.children,onItemClick:t,level:o+1,expandedIds:n,onToggleExpand:r,colorMode:a})})})]},m.id)})})}var wi=({collapsed:e,onToggle:t,className:i="",maxHeight:o,menuData:n=[],colorMode:r="light"})=>{let{t:a}=U(),l=r==="dark",u=useRouter(),[s,c]=useState(""),[d,b]=useState(new Set);useEffect(()=>{e&&b(new Set);},[e]);let p=useCallback(v=>{let m=[],x=w=>{w.forEach(I=>{m.push(I.id),I.children&&x(I.children);});};return x(v),m},[]),h=useMemo(()=>{if(!s.trim())return n;let v=m=>m.reduce((x,w)=>{let I=w.title?.toLowerCase().includes(s.toLowerCase())||w.description?.toLowerCase().includes(s.toLowerCase()),R=w.children?v(w.children):[];return (I||R.length>0)&&x.push({...w,children:R.length>0?R:w.children}),x},[]);return v(n)},[s,n]),y=useMemo(()=>s.trim()?new Set(p(n)):d,[s,n,d,p]),S=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{u.push("/chat?new=true");}catch(x){console.error("\u274C \u65E0\u6CD5\u8DF3\u8F6C\u5230\u65B0\u804A\u5929\u89C6\u56FE:",x),u.push("/chat");}return}let m=v.appurl||v.href;m&&(m.startsWith("http://")||m.startsWith("https://")?window.open(m,"_blank"):u.push(m));},[u]);return 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 ${i} ${l?"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:o?`${o}px`:void 0},children:[jsx("div",{className:`pt-4 pb-2 transition-all duration-500 ease-in-out ${e?"px-1":"px-2"}`,children:e?jsx("div",{className:"flex justify-center",children: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:a("navigation.expand"),children:jsx(Search,{className:"h-5 w-5"})})}):jsxs("div",{className:`relative transition-opacity duration-300 ${e?"opacity-0":"opacity-100 delay-200"}`,children:[jsx("input",{type:"text",placeholder:a("navigation.searchPlaceholder"),value:s,onChange:v=>c(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 ${l?"border-gray-700 bg-[#1A1A1A] text-white placeholder-gray-400":"border-gray-300 bg-white text-gray-900 placeholder-gray-500"}`}),jsx("div",{className:"absolute left-3 top-1/2 transform -translate-y-1/2 pointer-events-none",children:jsx(Search,{className:`h-4 w-4 ${l?"text-gray-500":"text-gray-400"}`})})]})}),jsx("nav",{className:`flex-1 pb-4 transition-all duration-500 ease-in-out overflow-y-auto min-h-0 ${e?"px-1":"px-2"}`,children:h.length===0?jsx("div",{className:"flex items-center justify-center py-8 text-gray-500 text-sm",children:e?"\u{1F4C2}":a(s?"navigation.noMatch":"navigation.noAccessibleApp")}):jsxs(Fragment,{children:[!e&&jsx("div",{className:`transition-opacity duration-300 ${e?"opacity-0":"opacity-100 delay-200"}`,children:jsx(Nr,{items:h,onItemClick:S,className:"space-y-1",expandedIds:y,colorMode:r,onToggleExpand:v=>{let m=new Set(d);h.some(w=>w.id===v)?m.has(v)?m.delete(v):(h.forEach(w=>{w.id!==v&&m.has(w.id)&&m.delete(w.id);}),m.add(v)):m.has(v)?m.delete(v):m.add(v),b(m);}})}),e&&jsx("div",{className:"space-y-2",children:n.map(v=>jsx("div",{className:"space-y-1",children:jsx("button",{onClick:()=>{t();let m=new Set([v.id]);b(m);},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:a("navigation.expandView",{title:v.title||""}),children:v.icon||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:v.title?.charAt(0)||"?"})})},v.id))})]})}),!e&&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:a("navigation.collapse"),children:jsx("div",{className:"absolute",style:{bottom:"0px",right:"0px",width:"16px",height:"16px",overflow:"hidden"},children: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"}})})})]})};var Pi=(e={})=>{let{initialCollapsed:t=false,content:i=[]}=e,[o,n]=useState(t),[r,a]=useState(i),l=useCallback(()=>{n(s=>!s);},[]),u=useMemo(()=>({collapsed:o,onToggle:l,menuData:r}),[o,l,r]);return {collapsed:o,setCollapsed:n,toggleCollapsed:l,menuData:r,setMenuData:a,navigationIslandProps:u}};var $r=e=>jsx(Button,{...e,variant:e.variant||"contained",size:e.size||"medium",sx:{textTransform:"none",...e.sx}});var Wr=class{constructor(){a(this,"listener",null);}register(t){this.listener=t;}unregister(){this.listener=null;}show(t,i,o){this.listener&&this.listener({type:t,content:i,options:o});}hide(){this.listener&&this.listener(null);}},At=new Wr,ny={success:(e,t)=>At.show("success",e,t),error:(e,t)=>At.show("error",e,t),warning:(e,t)=>At.show("warning",e,t),info:(e,t)=>At.show("info",e,t),show:(e,t,i)=>At.show(e,t,i),hide:()=>At.hide()};var Qc={success:{icon:jsx(_c,{sx:{fontSize:40}}),color:"#e8f5e9",iconColor:"#66bb6a",borderColor:"#a5d6a7"},warning:{icon:jsx(Kc,{sx:{fontSize:40}}),color:"#fff3e0",iconColor:"#ffa726",borderColor:"#ffcc80"},error:{icon:jsx(Zc,{sx:{fontSize:40}}),color:"#ffebee",iconColor:"#ef5350",borderColor:"#ef9a9a"},info:{icon:jsx(jc,{sx:{fontSize:40}}),color:"#e3f2fd",iconColor:"#42a5f5",borderColor:"#90caf9"},default:{icon:null,color:"transparent",iconColor:"inherit",borderColor:"transparent"}},Ur=({open:e,title:t,message:i,onClose:o,onConfirm:n,confirmText:r,cancelText:a,showCancel:l=true,maxWidth:u="xs",type:s="default"})=>{let{t:c}=U(),d=r||c("messageBox.confirm"),b=a||c("messageBox.cancel"),p=()=>{n?n():o();},h=Qc[s],y=s!=="default";return jsxs(Nl,{open:e,onClose:o,maxWidth:u,fullWidth:true,PaperProps:{sx:{borderRadius:3,...y&&{borderTop:`6px solid ${h.iconColor}`}}},children:[y&&jsx(da,{sx:{display:"flex",justifyContent:"center",pt:3,color:h.iconColor},children:h.icon}),t&&jsx(Gl,{sx:{textAlign:y?"center":"left",pt:y?1:2},children:t}),jsx($l,{sx:{textAlign:y?"center":"left"},children:typeof i=="string"?jsx(Hc,{children:i}):i}),jsxs(Wl,{sx:{justifyContent:y?"center":"flex-end",pb:3,px:3},children:[l&&jsx($r,{onClick:o,variant:"text",color:"inherit",children:b}),jsx($r,{onClick:p,variant:"contained",sx:{bgcolor:y?h.iconColor:void 0,"&:hover":{bgcolor:y?h.iconColor:void 0,filter:"brightness(0.9)"}},autoFocus:true,children:d})]})]})},Sy=()=>{let[e,t]=Ne__default.useState(null),[i,o]=Ne__default.useState(false);Ne__default.useEffect(()=>{let a=l=>{l?(t(l),o(true)):(o(false),t(null));};return At.register(a),()=>At.unregister()},[]);let n=()=>{o(false),e?.options?.onClose&&e.options.onClose(),t(null);},r=()=>{e?.options?.onConfirm&&e.options.onConfirm(),o(false),t(null);};return e?jsx(Ur,{open:i,type:e.type,message:e.content,title:e.options?.title,onClose:n,onConfirm:r,confirmText:e.options?.confirmText,cancelText:e.options?.cancelText,showCancel:e.options?.showCancel,maxWidth:e.options?.maxWidth}):null};var Ri=({title:e,hideHeader:t,children:i})=>jsxs(Box,{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[!t&&jsx(Box,{sx:{mb:2},children:jsx(Typography,{variant:"h4",children:e})}),jsx(Box,{sx:{flex:1,overflow:"hidden"},children:i})]});var Mi=e=>{let{t}=U(),i="0.85rem",o=Array.isArray(e.actions)?e.actions:e.actions?[e.actions]:[],n=Array.isArray(e.extraTools)?e.extraTools:e.extraTools?[e.extraTools]:[],r=[...o,...n],a=typeof e.rowsPerPage=="number"?e.rowsPerPage:20,l=Array.isArray(e.rowsPerPageOptions)&&e.rowsPerPageOptions.length>0?e.rowsPerPageOptions:[20,50,100,-1],u=typeof e.count=="number"?e.count:0,s=Math.max(0,typeof e.page=="number"?e.page:0),c=a===-1?1:Math.max(1,Math.ceil(u/a)),d=Math.min(s+1,c),b=s>0,p=s<c-1&&a!==-1;return jsxs(Toolbar,{sx:{pl:{sm:2},pr:{xs:1,sm:1},alignItems:"center",gap:1},children:[jsx(TextField,{size:"small",placeholder:t("table.toolbar.searchPlaceholder"),value:e.filterText,onChange:h=>e.setFilterText(h.target.value),InputProps:{sx:{fontSize:i,"& .MuiInputBase-input":{fontSize:i},"& .MuiInputBase-input::placeholder":{fontSize:i,opacity:1}},startAdornment:jsx(InputAdornment,{position:"start",children:jsx(wl,{fontSize:"small"})})},sx:{width:300}}),jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1,ml:1},children:[jsx(Typography,{sx:{fontSize:i,color:"text.secondary",whiteSpace:"nowrap"},children:t("table.toolbar.itemsPerPage")}),jsx(Select,{size:"small",variant:"standard",value:a,disableUnderline:true,onChange:h=>e.onRowsPerPageChange?.(Number(h.target.value)),sx:{fontSize:i,fontWeight:600,minWidth:64,"& .MuiSelect-select":{py:.25,pr:"16px !important"}},children:l.map(h=>jsx(MenuItem,{value:h,sx:{fontSize:i},children:h===-1?t("common.all"):h},`rows-per-page-${h}`))}),jsx(IconButton,{size:"small",onClick:()=>e.onPageChange?.(Math.max(s-1,0)),disabled:!b,sx:{p:.35},children:jsx(hu,{fontSize:"small"})}),jsx(Typography,{sx:{fontSize:i,fontWeight:600,minWidth:88,textAlign:"center"},children:t("table.toolbar.pageOf",{current:d,total:c})}),jsx(IconButton,{size:"small",onClick:()=>e.onPageChange?.(Math.min(s+1,c-1)),disabled:!p,sx:{p:.35},children:jsx(yu,{fontSize:"small"})})]}),jsx(Box,{sx:{flex:1}}),jsxs(Box,{sx:{display:"flex",gap:1,alignItems:"center"},children:[r.length>0&&jsx(Box,{sx:{display:"flex",gap:1,alignItems:"center"},children:r.map((h,y)=>jsx(Ne__default.Fragment,{children:h},`toolbar-custom-${y}`))}),jsx(Box,{sx:{width:"1px",height:20,bgcolor:"divider",mx:.5}}),jsx(Tooltip,{title:t("table.toolbar.groupBy"),children:jsx(IconButton,{onClick:h=>e.setGroupAnchorEl(h.currentTarget),children:jsx(Badge,{badgeContent:e.grouping?.length,color:"primary",children:jsx(uu,{})})})}),jsx(Tooltip,{title:t("table.toolbar.summary"),children:jsx(IconButton,{onClick:h=>e.setSummaryAnchorEl(h.currentTarget),color:e.showSummary?"primary":"default",children:jsx(pu,{})})}),jsx(Tooltip,{title:t("table.toolbar.columns"),children:jsx(IconButton,{onClick:h=>e.setAnchorEl(h.currentTarget),children:jsx(lu,{})})}),jsx(Tooltip,{title:t("table.toolbar.export"),children:jsx(IconButton,{onClick:e.handleExport,children:jsx(cu,{})})}),e.showCreateButton&&jsx(Tooltip,{title:t("table.toolbar.newItem"),children:jsx(IconButton,{onClick:e.onOpenCreateDialog,color:"primary",children:jsx(mu,{})})}),e.showEditButton&&jsx(Tooltip,{title:t("table.toolbar.editItem"),children:jsx("span",{children:jsx(IconButton,{onClick:e.onOpenEditDialog,color:"primary",disabled:!!e.editDisabled,children:jsx(gu,{})})})}),e.showDeleteButton&&jsx(Tooltip,{title:t("table.toolbar.deleteItem"),children:jsx("span",{children:jsx(IconButton,{onClick:e.onOpenDeleteConfirm,color:"error",disabled:!!e.deleteDisabled,children:jsx(fu,{})})})}),e.onOpenGraphReport&&jsx(Tooltip,{title:t("table.toolbar.graphicReport"),children:jsx(IconButton,{onClick:e.onOpenGraphReport,children:jsx(du,{})})}),e.onLayoutSave&&!e.layoutManager&&jsx(Tooltip,{title:t("table.toolbar.saveLayout"),children:jsx(IconButton,{onClick:h=>e.onLayoutSave(h),children:jsx(Bl,{})})}),e.layoutManager]})]})};var Li=e=>{let{t}=U(),{onSelectAllClick:i,order:o,orderBy:n,numSelected:r=0,rowCount:a=0,onRequestSort:l,columns:u,visibleColumns:s,selectionMode:c,grouping:d=[],isAllExpanded:b=false,handleToggleAll:p,onColumnResize:h,columnWidths:y}=e,[S,v]=useState(null),m=useRef(null),x=k=>T=>{S||l(k);},w=(k,T,f)=>{k.preventDefault(),k.stopPropagation(),v(T),m.current={startX:k.clientX,startWidth:f,colId:T},document.addEventListener("mousemove",I),document.addEventListener("mouseup",R),document.body.style.cursor="col-resize";},I=k=>{if(!m.current)return;let{startX:T,startWidth:f,colId:B}=m.current,E=k.clientX-T,Z=Math.max(50,f+E);h&&h(B,Z);},R=()=>{v(null),m.current=null,document.removeEventListener("mousemove",I),document.removeEventListener("mouseup",R),document.body.style.cursor="";};useEffect(()=>()=>{document.removeEventListener("mousemove",I),document.removeEventListener("mouseup",R);},[]);let A=c==="multiple"||c==="single",P=d.length>0&&!!p,F=t(b?"table.group.collapseAll":"table.group.expandAll"),C=u.filter(k=>s.includes(k.id));return jsx(Cu,{children:jsxs(Su,{children:[A&&jsx(Zr,{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:jsx(ku,{color:"primary",indeterminate:r>0&&r<a,checked:a>0&&r===a,onChange:i,disabled:c==="single"})}),P&&jsx(Zr,{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:jsx(Iu,{title:F,children:jsx(wu,{size:"small",onClick:k=>{k.stopPropagation(),p?.(!b);},sx:{p:.2},children:b?jsx(Du,{fontSize:"small"}):jsx(Pu,{fontSize:"small"})})})}),C.map(k=>{let T=y?.[k.id]||k.minWidth||100;return jsxs(Zr,{align:"left",padding:k.disablePadding?"none":"normal",sortDirection:n===k.id?o:false,style:{width:T,minWidth:T,maxWidth:T},sx:f=>({position:"sticky",top:0,zIndex:4,backgroundColor:f.palette.mode==="dark"?"#000000":"#f5f5f5",color:f.palette.mode==="dark"?"#ffffff":f.palette.text.primary,fontWeight:"bold",userSelect:"none"}),children:[jsx(Tu,{active:n===k.id,direction:n===k.id?o:"asc",onClick:x(k.id),sx:f=>({"&.MuiTableSortLabel-root":{width:"100%"},"& .MuiTableSortLabel-icon":{color:f.palette.mode==="dark"?"#ffffff":f.palette.text.primary,opacity:n===k.id?1:0,transition:"opacity 0.2s"},"&:hover .MuiTableSortLabel-icon":{opacity:.5},"&.Mui-active .MuiTableSortLabel-icon":{opacity:1,color:f.palette.mode==="dark"?"#ffffff":f.palette.text.primary},fontWeight:"bold",fontSize:"0.85rem",color:f.palette.mode==="dark"?"#ffffff":f.palette.text.primary}),children:jsx(da,{component:"span",sx:{overflow:"visible",textOverflow:"clip",whiteSpace:"normal",lineHeight:1.2,wordBreak:"break-word",pr:1},children:k.label})}),jsx(da,{onMouseDown:f=>w(f,k.id,typeof T=="number"?T:100),onClick:f=>f.stopPropagation(),sx:{position:"absolute",right:0,top:0,bottom:0,width:5,cursor:"col-resize","&:hover":{backgroundColor:"primary.main",opacity:.5},zIndex:1}})]},k.id)})]})})};var Oi=e=>{let{t}=U(),{visibleRows:i,visibleColumns:o,selected:n=[],handleClick:r,columns:a,toggleGroupExpand:l,expandedGroups:u=new Set,selectionMode:s,grouping:c=[],isGroupFullyExpanded:d,handleExpandGroupRecursively:b,handleCollapseGroupRecursively:p}=e,h=m=>n.indexOf(m)!==-1,y=s==="multiple"||s==="single",S=c.length>0,v=o.length+(y?1:0)+(S?1:0);return jsxs(TableBody,{children:[i.map((m,x)=>{if(m.type==="group"){let w=u.has(m.id),I=m.childIds||[],R=I.filter(C=>h(C)).length,A=I.length>0&&R===I.length,P=R>0&&R<I.length;return jsxs(TableRow,{sx:C=>({backgroundColor:C.palette.mode==="dark"?"#111111":"#f5f5f5","& .MuiTableCell-root":{color:C.palette.text.primary,borderBottomColor:C.palette.divider},"& .MuiIconButton-root":{color:C.palette.text.primary},"& .MuiCheckbox-root":{color:C.palette.text.secondary},"& .MuiCheckbox-root.Mui-checked, & .MuiCheckbox-root.MuiCheckbox-indeterminate":{color:C.palette.primary.main}}),children:[y&&jsx(TableCell,{padding:"checkbox",children:jsx(Checkbox,{size:"small",checked:A,indeterminate:P,onChange:C=>{if(C.stopPropagation(),!!e.onSelectionChange)if(A){let k=n.filter(T=>!I.includes(T));e.onSelectionChange(k);}else {let k=Array.from(new Set([...n,...I]));e.onSelectionChange(k);}},onClick:C=>C.stopPropagation(),sx:{p:.5}})}),S&&jsx(TableCell,{padding:"checkbox",sx:{width:44},children:jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:.25},children:[c.length>1&&m.level<c.length-1&&jsx(Tooltip,{title:d?.(m.id)?t("table.group.collapseAll"):t("table.group.expandAll"),children:jsx(IconButton,{size:"small",onClick:()=>{d?.(m.id)?p?.(m.id):b?.(m.id);},sx:{p:.25},children:d?.(m.id)?jsx(Du,{fontSize:"small"}):jsx(Pu,{fontSize:"small"})})}),jsx(IconButton,{size:"small",onClick:()=>l&&l(m.id),sx:{p:.25},children:w?jsx(Lu,{}):jsx(yu,{})})]})}),jsx(TableCell,{colSpan:o.length,sx:{py:1,pl:m.level*3+1},children:jsxs(Typography,{variant:"body2",fontWeight:"bold",color:"text.primary",sx:{fontSize:"0.85rem"},children:[m.field,": ",m.value," (",m.count,")"]})})]},m.id)}else {let w=m.data||m,I=m.id||w.id||x,R=h(I),A=`enhanced-table-checkbox-${x}`,F=(m.level!==void 0?m.level:0)*4;return jsxs(TableRow,{hover:true,onClick:C=>r&&r(C,w),role:"checkbox","aria-checked":R,tabIndex:-1,selected:R,sx:{cursor:"pointer"},children:[y&&jsx(TableCell,{padding:"checkbox",sx:{pl:F>0?F+1:void 0},children:jsx(Checkbox,{color:"primary",checked:R,inputProps:{"aria-labelledby":A}})}),S&&jsx(TableCell,{padding:"checkbox",sx:{width:44}}),a.filter(C=>o.includes(C.id)).map((C,k)=>{let f=!y&&k===0&&F>0?{pl:F+2}:{};return jsx(TableCell,{align:"left",sx:f,children:C.render?C.render(w[C.id],w):(function(){let E=w[C.id];if(C.numeric){if(typeof E=="number")return E.toLocaleString();if(typeof E=="string"&&E.trim()!==""&&!isNaN(Number(E)))return Number(E).toLocaleString()}return E})()},C.id)})]},I)}}),i.length===0&&jsx(TableRow,{children:jsx(TableCell,{colSpan:v,align:"center",children:t("common.noData")})})]})};var Vi=e=>{let{visibleColumns:t,summaryRow:i,selectionMode:o,grouping:n=[]}=e;if(!e.showSummary)return null;let r=o==="multiple"||o==="single",a=n.length>0;return jsx(TableFooter,{sx:{position:"sticky",bottom:0,zIndex:e.zIndex,bgcolor:"background.paper"},children:jsxs(TableRow,{children:[r&&jsx(TableCell,{padding:"checkbox",sx:{bgcolor:"background.paper"}}),a&&jsx(TableCell,{padding:"checkbox",sx:{bgcolor:"background.paper",width:44}}),t.map(l=>jsx(TableCell,{sx:{fontWeight:"bold",fontSize:"0.85rem",bgcolor:"background.paper",color:"text.primary"},children:(function(){let s=i[l];return s==null||s===""?"":typeof s=="number"?s.toLocaleString():typeof s=="string"&&s.trim()!==""&&!isNaN(Number(s))?Number(s).toLocaleString():s})()},l))]})})};var Gi=e=>{let{t}=U();return jsx(Box,{sx:{p:2},children:jsx(Typography,{children:t("table.mobile.notImplemented")})})};var Wi=({groupAnchorEl:e,setGroupAnchorEl:t,grouping:i,setGrouping:o,columns:n,toggleGroupField:r})=>{let{t:a}=U();return jsxs(Menu,{anchorEl:e,open:!!e,onClose:()=>t(null),children:[jsxs(Box,{sx:{p:1,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[jsx(Typography,{variant:"subtitle2",sx:{px:1},children:a("table.menu.groupBy")}),i.length>0&&jsx(Button,{size:"small",color:"error",onClick:()=>o([]),startIcon:jsx(ju,{}),children:a("table.menu.clearAll")})]}),jsx(Divider,{}),n.map(l=>{let u=i.includes(l.id),s=i.indexOf(l.id)+1;return jsx(MenuItem,{onClick:()=>r(l.id),children:jsxs(Box,{sx:{display:"flex",alignItems:"center",width:"100%"},children:[jsx(Checkbox,{checked:u,size:"small"}),jsx(ListItemText,{primary:l.label}),u&&jsx(Badge,{badgeContent:s,color:"primary",sx:{mr:2}})]})},l.id)})]})},Hi=({anchorEl:e,setAnchorEl:t,columns:i,visibleColumns:o,toggleColumnVisibility:n})=>{let{t:r}=U();return jsxs(Menu,{anchorEl:e,open:!!e,onClose:()=>t(null),children:[jsx(MenuItem,{disabled:true,children:jsx(ListItemText,{primary:r("table.menu.visibleColumns")})}),jsx(Divider,{}),i.map(a=>jsxs(MenuItem,{onClick:()=>n(a.id),children:[jsx(Checkbox,{checked:o.includes(a.id),size:"small"}),jsx(ListItemText,{primary:a.label})]},a.id))]})},Ui=({anchorEl:e,setAnchorEl:t,showSummary:i,setShowSummary:o,columns:n,summaryColumns:r,toggleSummaryColumn:a})=>{let{t:l}=U();return jsxs(Menu,{anchorEl:e,open:!!e,onClose:()=>t(null),children:[jsx(MenuItem,{children:jsx(FormControlLabel,{control:jsx(Switch,{checked:i,onChange:u=>o(u.target.checked),size:"small"}),label:l("table.menu.showSummaryRow")})}),jsx(Divider,{}),n.filter(u=>u.numeric).map(u=>jsxs(MenuItem,{onClick:()=>a(u.id),disabled:!i,children:[jsx(Checkbox,{checked:r.includes(u.id),size:"small"}),jsx(ListItemText,{primary:u.label})]},u.id)),n.filter(u=>u.numeric).length===0&&jsx(MenuItem,{disabled:true,children:jsx(ListItemText,{primary:l("table.menu.noNumericColumns")})})]})},qi=({contextMenu:e,handleCloseContextMenu:t,columns:i,visibleColumns:o,toggleColumnVisibility:n})=>{let{t:r}=U();return jsxs(Menu,{open:e!==null,onClose:t,anchorReference:"anchorPosition",anchorPosition:e!==null?{top:e.mouseY,left:e.mouseX}:void 0,children:[jsx(MenuItem,{onClick:t,children:r("common.copy")}),jsx(Divider,{}),jsx(MenuItem,{disabled:true,children:r("table.menu.visibleColumns")}),i.map(a=>jsxs(MenuItem,{onClick:()=>n(a.id),children:[jsx(ListItemIcon,{children:o.includes(a.id)&&jsx(Zu,{fontSize:"small"})}),jsx(ListItemText,{children:a.label})]},a.id))]})};var Jo=(e,t=2)=>e.toLocaleString(void 0,{maximumFractionDigits:t}),Ki=({kpis:e})=>{let{t}=U(),i=[{label:t("graph.kpi.totalRecords"),value:Jo(e.totalRecords,0),color:"text.primary"},{label:t("graph.kpi.totalReport"),value:Jo(e.totalReportHours),color:"text.primary"},{label:t("graph.kpi.totalBillable"),value:Jo(e.totalBillableHours),color:"success.main"},{label:t("graph.kpi.efficiency"),value:`${e.efficiency.toFixed(2)}%`,color:"warning.main"},{label:t("graph.kpi.amount"),value:Jo(e.totalAmount),color:"info.main"},{label:t("graph.kpi.flagged"),value:Jo(e.flaggedCount,0),color:"error.main"}];return jsx(Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",lg:"repeat(6, minmax(0, 1fr))"},gap:1.5},children:i.map(o=>jsxs(Paper,{variant:"outlined",sx:{p:1.5,borderRadius:2,minHeight:96,display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[jsx(Typography,{variant:"caption",color:"text.secondary",children:o.label}),jsx(Typography,{variant:"h4",fontWeight:800,sx:{color:o.color},children:o.value})]},o.label))})};var Ba=({title:e,subtitle:t,children:i})=>jsxs(Paper,{variant:"outlined",sx:{p:2,borderRadius:2},children:[jsx(Typography,{variant:"subtitle1",fontWeight:700,children:e}),t&&jsx(Typography,{variant:"body2",color:"text.secondary",sx:{mb:2},children:t}),i]});var Jr=({data:e,orientation:t="horizontal",valueSuffix:i="",minHeight:o=210,activeName:n,onItemClick:r})=>{if(e.length===0)return jsx(Typography,{variant:"body2",color:"text.secondary",children:"No data"});let a=Math.max(...e.map(l=>l.value),1);return t==="vertical"?jsx(Box,{sx:{display:"flex",gap:1,alignItems:"flex-end",minHeight:o},children:e.map(l=>jsxs(Box,{sx:{flex:1,minWidth:0},children:[jsx(Box,{onClick:()=>r?.(l),sx:{height:`${Math.max(l.value/a*180,6)}px`,bgcolor:l.name===n?"primary.dark":"primary.main",borderRadius:"8px 8px 0 0",cursor:r?"pointer":"default",opacity:n&&l.name!==n?.45:1}}),jsx(Typography,{variant:"caption",noWrap:true,title:l.name,sx:{display:"block",mt:.5},children:l.name}),jsxs(Typography,{variant:"caption",color:"text.secondary",children:[l.value.toFixed(1),i]})]},l.name))}):jsx(Stack,{spacing:1,children:e.map(l=>jsxs(Box,{sx:{display:"grid",gridTemplateColumns:"140px 1fr 64px",gap:1},children:[jsx(Typography,{variant:"caption",color:"text.secondary",noWrap:true,title:l.name,children:l.name}),jsx(Box,{onClick:()=>r?.(l),sx:{alignSelf:"center",bgcolor:"action.hover",height:10,borderRadius:999,overflow:"hidden",cursor:r?"pointer":"default",opacity:n&&l.name!==n?.45:1},children:jsx(Box,{sx:{width:`${l.value/a*100}%`,height:"100%",bgcolor:l.name===n?"primary.dark":"primary.main"}})}),jsxs(Typography,{variant:"caption",sx:{textAlign:"right",fontWeight:600},children:[l.value.toFixed(1),i]})]},l.name))})};var Vb=({data:e,color:t="#42A5F5",valueSuffix:i="",height:o=220})=>{if(e.length===0)return jsx(Typography,{variant:"body2",color:"text.secondary",children:"No data"});let n=640,r=28,a=e.map(b=>b.value),l=Math.min(...a,0),s=Math.max(...a,1)-l||1,c=e.map((b,p)=>{let h=r+p*(n-r*2)/Math.max(e.length-1,1),y=o-r-(b.value-l)/s*(o-r*2);return {x:h,y,...b}}),d=c.map(b=>`${b.x},${b.y}`).join(" ");return jsxs(Box,{children:[jsxs(Box,{component:"svg",viewBox:`0 0 ${n} ${o}`,sx:{width:"100%",height:o},children:[jsx("line",{x1:r,y1:o-r,x2:n-r,y2:o-r,stroke:"rgba(148,163,184,0.4)"}),jsx("polyline",{fill:"none",stroke:t,strokeWidth:3,points:d}),c.map(b=>jsx("circle",{cx:b.x,cy:b.y,r:4,fill:t},b.name))]}),jsx(Box,{sx:{mt:1,display:"grid",gridTemplateColumns:`repeat(${e.length}, minmax(0, 1fr))`,gap:1},children:e.map(b=>jsxs(Box,{sx:{minWidth:0},children:[jsx(Typography,{variant:"caption",noWrap:true,title:b.name,sx:{display:"block"},children:b.name}),jsxs(Typography,{variant:"caption",color:"text.secondary",children:[b.value.toFixed(1),i]})]},b.name))})]})};var Wb=({data:e,barColor:t="#64B5F6",lineColor:i="#FFB74D",height:o=220})=>{if(e.length===0)return jsx(Typography,{variant:"body2",color:"text.secondary",children:"No data"});let n=640,r=28,a=Math.max(...e.map(c=>c.barValue),1),l=Math.max(...e.map(c=>c.lineValue),1),u=e.map((c,d)=>{let b=(n-r*2)/e.length,p=Math.max(b*.5,8),h=r+d*b+(b-p)/2,y=c.barValue/a*(o-r*2),S=o-r-y;return {x:h,y:S,barHeight:y,barWidth:p,item:c}}),s=e.map((c,d)=>{let b=(n-r*2)/e.length,p=r+d*b+b/2,h=o-r-c.lineValue/l*(o-r*2);return {x:p,y:h,item:c}});return jsxs(Stack,{spacing:1.25,children:[jsxs(Box,{component:"svg",viewBox:`0 0 ${n} ${o}`,sx:{width:"100%",height:o},children:[jsx("line",{x1:r,y1:o-r,x2:n-r,y2:o-r,stroke:"rgba(148,163,184,0.4)"}),u.map(c=>jsx("rect",{x:c.x,y:c.y,width:c.barWidth,height:Math.max(c.barHeight,4),rx:6,fill:t},c.item.name)),jsx("polyline",{fill:"none",stroke:i,strokeWidth:3,points:s.map(c=>`${c.x},${c.y}`).join(" ")}),s.map(c=>jsx("circle",{cx:c.x,cy:c.y,r:3.5,fill:i},`${c.item.name}-line`))]}),jsx(Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${e.length}, minmax(0, 1fr))`,gap:1},children:e.map(c=>jsxs(Box,{sx:{minWidth:0},children:[jsx(Typography,{variant:"caption",noWrap:true,title:c.name,sx:{display:"block"},children:c.name}),jsxs(Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:["Bar: ",c.barValue.toFixed(1)]}),jsxs(Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:["Line: ",c.lineValue.toFixed(1)]})]},c.name))})]})};var ap=e=>`rgba(30, 136, 229, ${.2+Math.max(0,Math.min(1,e))*.8})`,_b=({data:e})=>{if(e.length===0)return jsx(Typography,{variant:"body2",color:"text.secondary",children:"No data"});let t=Array.from(new Set(e.map(r=>r.x))),i=Array.from(new Set(e.map(r=>r.y))),o=Math.max(...e.map(r=>r.value),1),n=new Map(e.map(r=>[`${r.y}__${r.x}`,r.value]));return jsx(Box,{sx:{overflowX:"auto"},children:jsxs(Box,{sx:{display:"grid",gridTemplateColumns:`120px repeat(${t.length}, minmax(64px, 1fr))`,gap:1,minWidth:120+t.length*64},children:[jsx(Box,{}),t.map(r=>jsx(Typography,{variant:"caption",sx:{textAlign:"center",fontWeight:600},children:r},r)),i.map(r=>jsxs(Box,{sx:{display:"contents"},children:[jsx(Typography,{variant:"caption",sx:{alignSelf:"center"},children:r}),t.map(a=>{let l=n.get(`${r}__${a}`)||0,u=l/o;return jsx(Box,{sx:{height:36,borderRadius:1,bgcolor:ap(u),border:"1px solid rgba(148,163,184,0.2)",display:"flex",alignItems:"center",justifyContent:"center"},children:jsx(Typography,{variant:"caption",fontWeight:700,children:l.toFixed(1)})},`${r}-${a}`)})]},r))]})})};var rp=["#1E88E5","#1ABC9C","#FBC02D","#EF5350","#7E57C2","#78909C"],Xi=({data:e,variant:t="donut",colors:i=rp,size:o=180,activeName:n,onItemClick:r})=>{if(e.length===0)return jsx(Typography,{variant:"body2",color:"text.secondary",children:"No data"});let a=0,l=e.map((u,s)=>{let c=a;return a+=u.percent,`${i[s%i.length]} ${c}% ${a}%`});return jsxs(Stack,{direction:{xs:"column",sm:"row"},spacing:2,alignItems:"center",children:[jsx(Box,{sx:{width:o,height:o,borderRadius:"50%",background:`conic-gradient(${l.join(", ")})`,position:"relative",flexShrink:0},children:t==="donut"&&jsx(Box,{sx:{position:"absolute",inset:Math.round(o*.18),bgcolor:"background.paper",borderRadius:"50%"}})}),jsx(Stack,{spacing:1,sx:{minWidth:180},children:e.map((u,s)=>jsxs(Box,{onClick:()=>r?.(u),sx:{display:"flex",alignItems:"center",gap:1,cursor:r?"pointer":"default",opacity:n&&u.name!==n?.45:1},children:[jsx(Box,{sx:{width:10,height:10,borderRadius:"50%",bgcolor:i[s%i.length]}}),jsx(Typography,{variant:"caption",sx:{flex:1},children:u.name}),jsxs(Typography,{variant:"caption",sx:{fontWeight:700},children:[u.percent.toFixed(0),"%"]})]},u.name))})]})};var Jb=({effect:e,branches:t})=>{if(t.length===0)return jsx(Typography,{variant:"body2",color:"text.secondary",children:"No data"});let i=t.filter((n,r)=>r%2===0),o=t.filter((n,r)=>r%2===1);return jsxs(Stack,{spacing:1.5,children:[jsx(Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${Math.max(i.length,1)}, minmax(0, 1fr))`,gap:1},children:i.map(n=>jsxs(Box,{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1},children:[jsx(Typography,{variant:"caption",fontWeight:700,children:n.title}),n.causes.map(r=>jsx(Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:r},r))]},n.title))}),jsxs(Box,{sx:{position:"relative",height:32},children:[jsx(Box,{sx:{position:"absolute",inset:"50% 0 auto 0",borderTop:"2px solid",borderColor:"primary.main"}}),jsx(Box,{sx:{position:"absolute",right:0,top:"calc(50% - 12px)",px:1,py:.25,borderRadius:1,bgcolor:"primary.main",color:"primary.contrastText"},children:jsx(Typography,{variant:"caption",fontWeight:700,children:e})})]}),jsx(Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${Math.max(o.length,1)}, minmax(0, 1fr))`,gap:1},children:o.map(n=>jsxs(Box,{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1},children:[jsx(Typography,{variant:"caption",fontWeight:700,children:n.title}),n.causes.map(r=>jsx(Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:r},r))]},n.title))})]})};var av=({data:e,height:t=240})=>{if(e.length===0)return jsx(Typography,{variant:"body2",color:"text.secondary",children:"No data"});let i=0,o=e.map(d=>{let b=d.type==="total"?0:i,p=d.type==="total"?d.value:i+d.value;return d.type!=="total"&&(i=p),{...d,start:b,end:p,delta:p-b}}),n=o.flatMap(d=>[d.start,d.end]),r=Math.min(...n,0),a=Math.max(...n,1),l=680,u=30,s=a-r||1,c=d=>t-u-(d-r)/s*(t-u*2);return jsxs(Box,{children:[jsxs(Box,{component:"svg",viewBox:`0 0 ${l} ${t}`,sx:{width:"100%",height:t},children:[jsx("line",{x1:u,y1:c(0),x2:l-u,y2:c(0),stroke:"rgba(148,163,184,0.4)"}),o.map((d,b)=>{let p=(l-u*2)/o.length,h=Math.max(p*.55,8),y=u+b*p+(p-h)/2,S=c(Math.max(d.start,d.end)),v=c(Math.min(d.start,d.end)),m=d.type==="total"?"#42A5F5":d.delta>=0?"#66BB6A":"#EF5350";return jsxs("g",{children:[jsx("rect",{x:y,y:S,width:h,height:Math.max(v-S,4),rx:6,fill:m}),jsx("text",{x:y+h/2,y:S-6,textAnchor:"middle",fill:"currentColor",fontSize:"11",children:d.end.toFixed(1)})]},d.name)})]}),jsx(Box,{sx:{mt:1,display:"grid",gridTemplateColumns:`repeat(${o.length}, minmax(0, 1fr))`,gap:1},children:o.map(d=>jsx(Typography,{variant:"caption",noWrap:true,title:d.name,children:d.name},d.name))})]})};var aa=({apiKey:e,query:t,zoom:i=14,mapType:o="roadmap"})=>{let n=encodeURIComponent(t);return `https://www.google.com/maps/embed/v1/place?key=${encodeURIComponent(e)}&q=${n}&zoom=${i}&maptype=${o}`},iv=(e,t=360)=>{let i=aa(e);return `<iframe width="100%" height="${t}" style="border:0" loading="lazy" allowfullscreen referrerpolicy="no-referrer-when-downgrade" src="${i}"></iframe>`};var uv=({apiKey:e,query:t,embedUrl:i,zoom:o=14,mapType:n="roadmap",height:r=320})=>{let a=i||(e&&t?aa({apiKey:e,query:t,zoom:o,mapType:n}):"");return a?jsxs(Box,{children:[jsx(Box,{component:"iframe",src:a,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",sx:{width:"100%",height:r,border:0,borderRadius:2}}),jsxs(Typography,{variant:"caption",color:"text.secondary",sx:{mt:.75,display:"block"},children:["If iframe is blocked, open directly: ",jsx(Link,{href:a,target:"_blank",rel:"noreferrer",children:"Google Maps"})]})]}):jsx(Box,{children:jsx(Typography,{variant:"body2",color:"text.secondary",children:"Google Map requires `embedUrl` or (`apiKey` + `query`)."})})};var Wa=({keyword:e,location:t,src:i="orbcafe-ui"})=>{if(t){let o=encodeURIComponent(t.name||e||"Location");return `https://uri.amap.com/marker?position=${t.lng},${t.lat}&name=${o}&src=${encodeURIComponent(i)}&coordinate=gaode&callnative=0`}return e?`https://uri.amap.com/search?keyword=${encodeURIComponent(e)}&src=${encodeURIComponent(i)}&callnative=0`:"https://uri.amap.com/search?keyword=%E5%8C%97%E4%BA%AC&src=orbcafe-ui&callnative=0"};var hv=({keyword:e,location:t,embedUrl:i,height:o=320})=>{let n=i||Wa({keyword:e,location:t?{lng:t.lng,lat:t.lat,name:t.name}:void 0});return jsxs(Box,{children:[jsx(Box,{component:"iframe",src:n,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",sx:{width:"100%",height:o,border:0,borderRadius:2}}),jsxs(Typography,{variant:"caption",color:"text.secondary",sx:{mt:.75,display:"block"},children:["If iframe is blocked, open directly: ",jsx(Link,{href:n,target:"_blank",rel:"noreferrer",children:"AMap"})]})]})};var nl=({billableByPrimary:e,efficiencyBySecondary:t,statusDistribution:i,interaction:o})=>{let{t:n}=U();return jsxs(Box,{sx:{display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",lg:"1.2fr 1.2fr 1fr"}},children:[jsx(Ba,{title:n("graph.chart.billable.title"),subtitle:n("graph.chart.billable.subtitle"),children:jsx(Jr,{data:e,orientation:"horizontal",activeName:o?.filters?.primaryDimension,onItemClick:r=>o?.onPrimaryDimensionClick?.(r.name)})}),jsx(Ba,{title:n("graph.chart.efficiency.title"),subtitle:n("graph.chart.efficiency.subtitle"),children:jsx(Jr,{data:t,orientation:"vertical",valueSuffix:"%",activeName:o?.filters?.secondaryDimension,onItemClick:r=>o?.onSecondaryDimensionClick?.(r.name)})}),jsx(Ba,{title:n("graph.chart.status.title"),subtitle:n("graph.chart.status.subtitle"),children:jsx(Xi,{data:i,variant:"donut",activeName:o?.filters?.status,onItemClick:r=>o?.onStatusClick?.(r.name)})})]})};var ao=e=>jsx(TextField,{...e,variant:e.variant||"outlined",size:e.size||"small",fullWidth:e.fullWidth!==void 0?e.fullWidth:true});var sn=e=>jsx(TextField,{...e,multiline:true,minRows:3,fullWidth:true,variant:"outlined"});var kp=["doubao-lite","gpt-4o-mini","gpt-4.1-mini","claude-3.5-sonnet"],Tp=["zh","en","de","fr","ja","ko"],sl=({open:e,onClose:t,value:i,onSaveAll:o,modelOptions:n=kp,promptLangOptions:r=Tp,analysisTemplateOptions:a=[],responseTemplateOptions:l=[],defaultAnalysisTemplateId:u,defaultResponseTemplateId:s})=>{let[c,d]=useState(i),[b,p]=useState(u||""),[h,y]=useState(s||""),[S,v]=useState(false);useEffect(()=>{e&&(d(i),p(u||""),y(s||""));},[e,i,u,s]);let m=(w,I)=>{d(R=>({...R,[w]:I}));},x=async()=>{if(o)try{v(!0),await o({settings:c,analysisTemplateId:b||void 0,responseTemplateId:h||void 0});}finally{v(false);}};return jsxs(Dialog,{open:e,onClose:t,fullWidth:true,maxWidth:"lg",children:[jsxs(DialogTitle,{sx:{pr:7,pb:2.2},children:[jsx(Typography,{variant:"h5",sx:{fontWeight:800},children:"AI Settings"}),jsx(Typography,{variant:"body2",color:"text.secondary",sx:{mt:.5},children:"Configure LLM settings and editable agent prompts by language."}),jsx(IconButton,{onClick:t,sx:{position:"absolute",right:12,top:12},children:jsx(Sp,{})})]}),jsx(DialogContent,{sx:{pt:"18px !important"},children:jsxs(Stack,{spacing:2.2,children:[jsxs(Box,{sx:{mt:.8,display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",md:"repeat(2, minmax(0, 1fr))"}},children:[jsx(Box,{children:jsx(ao,{size:"small",value:c.baseUrl,onChange:w=>m("baseUrl",w.target.value),fullWidth:true,label:"Base URL"})}),jsx(Box,{children:jsx(ao,{size:"small",type:"password",value:c.apiKey,onChange:w=>m("apiKey",w.target.value),fullWidth:true,label:"API Key"})}),jsx(Box,{children:jsx(ao,{size:"small",value:c.model,onChange:w=>m("model",w.target.value),fullWidth:true,select:true,label:"Model",children:n.map(w=>jsx(MenuItem,{value:w,children:w},w))})}),jsx(Box,{children:jsx(ao,{size:"small",value:c.promptLang,onChange:w=>m("promptLang",w.target.value),fullWidth:true,select:true,label:"Prompt Lang",children:r.map(w=>jsx(MenuItem,{value:w,children:w},w))})})]}),jsxs(Box,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[jsxs(ao,{size:"small",value:b,onChange:w=>p(w.target.value),fullWidth:true,select:true,label:"Analysis Template",children:[jsx(MenuItem,{value:"",children:"Default"}),a.map(w=>jsx(MenuItem,{value:w.id,children:w.label},w.id))]}),jsx(sn,{multiline:true,minRows:8,value:c.analysisPrompt,onChange:w=>m("analysisPrompt",w.target.value),fullWidth:true,label:"Analysis Prompt",sx:{"& .MuiInputBase-root":{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"}}}),jsxs(ao,{size:"small",value:h,onChange:w=>y(w.target.value),fullWidth:true,select:true,label:"Response Template",children:[jsx(MenuItem,{value:"",children:"Default"}),l.map(w=>jsx(MenuItem,{value:w.id,children:w.label},w.id))]}),jsx(sn,{multiline:true,minRows:8,value:c.responsePrompt,onChange:w=>m("responsePrompt",w.target.value),fullWidth:true,label:"Response Prompt",sx:{"& .MuiInputBase-root":{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"}}})]})]})}),jsxs(DialogActions,{sx:{px:3,pb:2.5,pt:1.2,gap:1},children:[jsx(Button,{variant:"outlined",onClick:t,children:"Cancel"}),jsx(Button,{variant:"contained",onClick:x,disabled:!o||S,children:"Save"})]})]})};var cl=({open:e,onClose:t,model:i,tableContent:o,extraCharts:n,interaction:r,aiAssistant:a})=>{let{t:l}=U(),[u,s]=useState(a?.defaultPrompt||""),[c,d]=useState(false),[b,p]=useState(false),h=r?.enabled!==false&&!!r,y=a?.enabled!==false,S=r?.filters||{},v=!!(S.primaryDimension||S.secondaryDimension||S.status),m=a?.placeholder||"Ask AI to analyze data, create charts, or find insights...";useEffect(()=>{e&&s(a?.defaultPrompt||"");},[e,a?.defaultPrompt]);let x=a?.settings||{baseUrl:"/llm-api",apiKey:"",model:"doubao-lite",promptLang:"zh",analysisPrompt:"",responsePrompt:""},w=async()=>{let I=u.trim();if(!(!I||!a?.onSubmit))try{d(!0),await a.onSubmit(I,{filters:S,model:i});}finally{d(false);}};return jsx(Dialog,{open:e,onClose:t,fullScreen:true,children:jsxs(Box,{sx:{height:"100%",display:"flex",flexDirection:"column",bgcolor:"background.default"},children:[jsx(Box,{sx:{p:2,borderBottom:1,borderColor:"divider"},children:jsxs(Stack,{direction:{xs:"column",lg:"row"},alignItems:{xs:"stretch",lg:"center"},justifyContent:"space-between",spacing:1.5,children:[jsxs(Stack,{direction:"row",spacing:1.25,alignItems:"center",sx:{flexWrap:"wrap"},children:[jsx(Typography,{variant:"h5",fontWeight:800,children:i.title}),jsx(Chip,{size:"small",label:l("graph.records",{count:i.kpis.totalRecords})}),h&&S.primaryDimension&&jsx(Chip,{size:"small",variant:"outlined",label:`${r?.fieldMapping.primaryDimension}: ${S.primaryDimension}`,onDelete:()=>r?.onClearFilter("primaryDimension")}),h&&S.secondaryDimension&&jsx(Chip,{size:"small",variant:"outlined",label:`${r?.fieldMapping.secondaryDimension}: ${S.secondaryDimension}`,onDelete:()=>r?.onClearFilter("secondaryDimension")}),h&&S.status&&jsx(Chip,{size:"small",variant:"outlined",label:`${r?.fieldMapping.status}: ${S.status}`,onDelete:()=>r?.onClearFilter("status")}),h&&v&&jsx(Button,{size:"small",onClick:()=>r?.onClearAll(),children:"Clear"})]}),jsxs(Stack,{direction:"row",spacing:1.25,alignItems:"center",sx:{width:{xs:"100%",lg:"auto"}},children:[y&&jsxs(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:[jsx(IconButton,{size:"small",onClick:a?.onVoiceInput,children:jsx(Ap,{sx:{fontSize:18,color:"text.secondary"}})}),jsx(InputBase,{fullWidth:true,value:u,onChange:I=>s(I.target.value),onKeyDown:I=>{I.key==="Enter"&&(I.preventDefault(),w());},placeholder:m,sx:{fontSize:"0.9rem"}}),jsx(IconButton,{size:"small",onClick:w,disabled:c||!u.trim(),children:jsx(Fp,{sx:{fontSize:18}})}),jsx(IconButton,{size:"small",onClick:()=>p(true),children:jsx(Mp,{sx:{fontSize:18}})})]}),jsx(IconButton,{onClick:t,children:jsx(Sp,{})})]})]})}),jsxs(Box,{sx:{p:2,display:"flex",flexDirection:"column",gap:1.5,overflow:"auto",minHeight:0},children:[jsx(Ki,{kpis:i.kpis}),jsx(nl,{billableByPrimary:i.charts.billableByPrimary,efficiencyBySecondary:i.charts.efficiencyBySecondary,statusDistribution:i.charts.statusDistribution,interaction:h?{filters:S,onPrimaryDimensionClick:I=>r?.onPrimaryDimensionClick(I),onSecondaryDimensionClick:I=>r?.onSecondaryDimensionClick(I),onStatusClick:I=>r?.onStatusClick(I)}:void 0}),n,o]}),jsx(sl,{open:b,onClose:()=>p(false),value:x,onSaveAll:a?.onSaveAll,modelOptions:a?.modelOptions,promptLangOptions:a?.promptLangOptions,analysisTemplateOptions:a?.analysisTemplateOptions,responseTemplateOptions:a?.responseTemplateOptions,defaultAnalysisTemplateId:a?.defaultAnalysisTemplateId,defaultResponseTemplateId:a?.defaultResponseTemplateId})]})})};var Ht={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"]},Lp=5,ul=e=>e.toLowerCase().replace(/[\s_-]/g,""),Ut=(e,t,i,o)=>{if(t)return t;if(e.length===0)return o;let n=Object.keys(e[0]),r=new Map(n.map(a=>[ul(a),a]));for(let a of i){let l=r.get(ul(a));if(l)return l}return n[0]||o},at=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},He=(e,t)=>e==null||e===""?t:String(e),Ep=(e,t,i,o,n)=>{let r=new Map;return e.forEach(a=>{let l=He(a[t],n);r.set(l,(r.get(l)||0)+at(a[i]));}),Array.from(r.entries()).map(([a,l])=>({name:a,value:l})).sort((a,l)=>l.value-a.value).slice(0,o)},zp=(e,t,i,o,n,r)=>{let a=new Map;return e.forEach(l=>{let u=He(l[t],r),s=a.get(u)||{report:0,billable:0};s.report+=at(l[i]),s.billable+=at(l[o]),a.set(u,s);}),Array.from(a.entries()).map(([l,u])=>({name:l,value:u.report>0?u.billable/u.report*100:0})).sort((l,u)=>l.value-u.value).slice(0,n)},Op=(e,t,i)=>{let o=e.length;if(o===0)return [];let n=new Map;return e.forEach(r=>{let a=He(r[t],i);n.set(a,(n.get(a)||0)+1);}),Array.from(n.entries()).map(([r,a])=>({name:r,value:a,percent:a/o*100}))},pl=(e,t,i)=>{let o=new Map;return e.forEach(n=>{let r=He(n[t],"N/A");o.set(r,(o.get(r)||0)+at(n[i]));}),Array.from(o.entries()).sort(([n],[r])=>n.localeCompare(r)).map(([n,r])=>({name:n,value:r}))},Vp=(e,t,i,o,n,r)=>{let a=new Map;return e.forEach(l=>{let u=He(l[t],r),s=a.get(u)||{report:0,billable:0};s.report+=at(l[i]),s.billable+=at(l[o]),a.set(u,s);}),Array.from(a.entries()).map(([l,u])=>({name:l,barValue:u.billable,lineValue:u.report>0?u.billable/u.report*100:0})).sort((l,u)=>u.barValue-l.barValue).slice(0,n)},Np=(e,t,i,o,n)=>{let r=new Map;return e.forEach(a=>{let l=He(a[t],n),u=He(a[i],n),s=`${l}__${u}`;r.set(s,(r.get(s)||0)+at(a[o]));}),Array.from(r.entries()).map(([a,l])=>{let[u,s]=a.split("__");return {x:u,y:s,value:l}})},Gp=(e,t,i)=>{let o=pl(e,t,i),n=o.map(a=>({name:a.name,value:a.value,type:"delta"})),r=o.reduce((a,l)=>a+l.value,0);return [...n,{name:"Total",value:r,type:"total"}]},$p=(e,t,i,o,n,r)=>{let a=new Map;return e.forEach(l=>{let u=He(l[t],r),s=`${He(l[i],r)} / ${He(l[o],r)}`,c=a.get(u)||new Map;c.set(s,(c.get(s)||0)+1),a.set(u,c);}),Array.from(a.entries()).map(([l,u])=>({title:l,causes:Array.from(u.entries()).sort((s,c)=>c[1]-s[1]).slice(0,n).map(([s,c])=>`${s} (${c})`)})).slice(0,6)},pn=({rows:e,config:t})=>{let{t:i}=U(),o=i("graph.unassigned"),n=useMemo(()=>{let c=t?.fieldMapping;return {primaryDimension:Ut(e,c?.primaryDimension,Ht.primaryDimension,"Category"),secondaryDimension:Ut(e,c?.secondaryDimension,Ht.secondaryDimension,"Owner"),status:Ut(e,c?.status,Ht.status,"Status"),date:Ut(e,c?.date,Ht.date,"Date"),description:Ut(e,c?.description,Ht.description,"Description"),reportHours:Ut(e,c?.reportHours,Ht.reportHours,"ReportHours"),billableHours:Ut(e,c?.billableHours,Ht.billableHours,"BillableHours"),amount:Ut(e,c?.amount,Ht.amount,"Amount")}},[e,t?.fieldMapping]),r=useMemo(()=>e.map((c,d)=>{let b=at(c[n.reportHours]),p=at(c[n.billableHours]),h=at(c[n.amount]),y=b>0?p/b*100:0;return {id:`graph-row-${d}`,Date:He(c[n.date],""),Primary:He(c[n.primaryDimension],o),Secondary:He(c[n.secondaryDimension],o),Description:He(c[n.description],""),ReportHours:b,BillableHours:p,Amount:h,Efficiency:y,Status:He(c[n.status],o)}}),[e,n,o]),a=useMemo(()=>{let c=r.length,d=r.reduce((v,m)=>v+at(m.ReportHours),0),b=r.reduce((v,m)=>v+at(m.BillableHours),0),p=r.reduce((v,m)=>v+at(m.Amount),0),h=d>0?b/d*100:0,y=t?.statusFlagValues||["flag","flagged","warning","risk"],S=r.filter(v=>y.includes(He(v.Status,"").toLowerCase())).length;return {totalRecords:c,totalReportHours:d,totalBillableHours:b,efficiency:h,totalAmount:p,flaggedCount:S}},[r,t?.statusFlagValues]),l=t?.topN||Lp,u=useMemo(()=>({billableByPrimary:Ep(r,"Primary","BillableHours",l,o),efficiencyBySecondary:zp(r,"Secondary","ReportHours","BillableHours",l,o),statusDistribution:Op(r,"Status",o),lineByDate:pl(r,"Date","BillableHours"),comboByPrimary:Vp(r,"Primary","ReportHours","BillableHours",l,o),heatmapPrimarySecondary:Np(r,"Primary","Secondary","BillableHours",o),waterfallBillable:Gp(r,"Date","BillableHours"),fishboneStatusCauses:$p(r,"Status","Primary","Secondary",3,o)}),[r,l,o]),s=useMemo(()=>({title:t?.title||i("graph.reportTitle"),kpis:a,charts:u,table:{columns:[{id:"Date",label:n.date},{id:"Primary",label:n.primaryDimension},{id:"Secondary",label:n.secondaryDimension},{id:"Description",label:n.description},{id:"ReportHours",label:i("graph.column.reportHours"),align:"right"},{id:"BillableHours",label:i("graph.column.billableHours"),align:"right"},{id:"Amount",label:"Amount",align:"right"},{id:"Efficiency",label:"Efficiency",align:"right"},{id:"Status",label:n.status}],rows:r}}),[u,t?.title,n,a,r,i]);return {fieldMapping:n,model:s}};var Bo=e=>String(e??"").trim(),dl=(e={})=>{let[t,i]=useState(e),o=useCallback((u,s)=>{i(c=>{let d=s?.trim();if(!d){let b={...c};return delete b[u],b}if(c[u]===d){let b={...c};return delete b[u],b}return {...c,[u]:d}});},[]),n=useCallback(u=>{i(s=>{if(!s[u])return s;let c={...s};return delete c[u],c});},[]),r=useCallback(()=>{i({});},[]),a=useMemo(()=>!!(t.primaryDimension||t.secondaryDimension||t.status),[t]),l=useCallback((u,s)=>u.filter(c=>!(t.primaryDimension&&Bo(c[s.primaryDimension])!==Bo(t.primaryDimension)||t.secondaryDimension&&Bo(c[s.secondaryDimension])!==Bo(t.secondaryDimension)||t.status&&Bo(c[s.status])!==Bo(t.status))),[t]);return {filters:t,setFilter:o,clearFilter:n,clearAll:r,hasActiveFilters:a,applyRows:l}};var ja=({variants:e,currentVariantId:t,onLoad:i,onSave:o,onDelete:n,onSetDefault:r})=>{let{t:a}=U(),u=useTheme().palette.mode==="dark",s="0.85rem",c={xs:"calc((100% - 1 * 16px) / 2)",sm:"calc((100% - 2 * 16px) / 3)",md:"calc((100% - 3 * 16px) / 4)",lg:"calc((100% - 5 * 16px) / 6)"},[d,b]=useState(false),[p,h]=useState(""),[y,S]=useState(false),[v,m]=useState(false),x=e.find(R=>R.id===t),w=()=>{h(x?.name||a("variant.newVariant")),S(x?.isDefault||false),m(x?.isPublic||false),b(true);},I=()=>{o({name:p,isDefault:y,isPublic:v,description:""}),b(false);};return jsxs(Box,{sx:{display:"flex",gap:1,alignItems:"center",width:"100%",maxWidth:"100%"},children:[jsx(Autocomplete,{size:"small",sx:{width:c,"& .MuiInputBase-root":{fontSize:s,bgcolor:u?"rgba(25, 118, 210, 0.2)":"#e7f1ff","& .MuiOutlinedInput-notchedOutline":{borderColor:u?"rgba(144,202,249,0.45)":"rgba(25,118,210,0.45)"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:u?"rgba(144,202,249,0.7)":"rgba(25,118,210,0.65)"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:u?"rgba(144,202,249,0.9)":"rgba(25,118,210,0.85)"}},"& .MuiInputBase-input":{fontSize:s},"& .MuiAutocomplete-noOptions":{fontSize:s}},noOptionsText:jsx(Typography,{sx:{fontSize:s},children:a("variant.noOptions")}),options:e,getOptionLabel:R=>R.name+(R.isDefault?` (${a("variant.defaultSuffix")})`:""),value:x||null,onChange:(R,A)=>{A&&i(A);},renderInput:R=>jsx(TextField,{...R,variant:"outlined",size:"small",InputProps:{...R.InputProps,sx:{fontSize:s,color:u?"#E3F2FD":"#0D47A1"}},placeholder:a("variant.selectVariant")}),renderOption:(R,A)=>jsx("li",{...R,children:jsxs(Box,{sx:{display:"flex",alignItems:"center",width:"100%"},children:[jsx(Typography,{sx:{flex:1,fontSize:s},children:A.name}),A.isDefault&&jsx(Jp,{fontSize:"small",color:"action"})]})})}),jsx(Tooltip,{title:a("variant.saveView"),children:jsx(IconButton,{onClick:w,size:"small",color:"primary",children:jsx(Bl,{fontSize:"small"})})}),jsxs(Dialog,{open:d,onClose:()=>b(false),children:[jsx(DialogTitle,{children:a("variant.saveView")}),jsxs(DialogContent,{children:[jsx(TextField,{autoFocus:true,margin:"dense",label:a("variant.viewName"),fullWidth:true,variant:"outlined",value:p,onChange:R=>h(R.target.value)}),jsx(FormControlLabel,{control:jsx(Checkbox,{checked:y,onChange:R=>S(R.target.checked)}),label:a("variant.setDefault")}),jsx(FormControlLabel,{control:jsx(Checkbox,{checked:v,onChange:R=>m(R.target.checked)}),label:a("variant.publicAllUsers")})]}),jsxs(DialogActions,{children:[jsx(Button,{onClick:()=>b(false),children:a("common.cancel")}),jsx(Button,{onClick:I,variant:"contained",children:a("common.save")})]})]})]})};var xl=({appId:e,tableKey:t="default",currentFilters:i,currentLayoutId:o,layoutRefs:n,onLoad:r,variantService:a,serviceUrl:l,onError:u,onSuccess:s,currentVariantId:c,onVariantChange:d})=>{let{t:b}=U(),[p,h]=useState([]),[y,S]=useState(""),v=`orbcafe.variants.${e}.${t}`,m=c!==void 0?c:y,x=T=>{c===void 0&&S(T),d&&d(T);},w=useCallback(()=>{try{let T=localStorage.getItem(v);if(!T)return [];let f=JSON.parse(T);return Array.isArray(f)?f:[]}catch{return []}},[v]),I=useCallback(T=>{try{localStorage.setItem(v,JSON.stringify(T));}catch{}},[v]),R=useCallback(T=>{h(T);let f=T.find(B=>B.isDefault);f&&!m&&(x(f.id),r(f));},[m,r,x]),A=useCallback(async()=>{if(!e)return [];try{let T=[];if(a)T=await a.getVariants(e,t);else if(l){let f=await fetch(`${l}/api/variants?appId=${encodeURIComponent(e)}&tableKey=${encodeURIComponent(t)}`);if(!f.ok)throw new Error(b("variant.toast.fetchFailed"));T=await f.json();}else T=w();return R(T),T}catch(T){console.error("Error fetching variants",T);let f=w();return R(f),u&&u(b("variant.toast.fetchFailed")),f}},[e,t,a,l,w,R,u,b]);return useEffect(()=>{A();},[e,t]),jsx(ja,{variants:p,currentVariantId:m,onLoad:T=>{x(T.id),r(T);},onSave:async T=>{let f=Date.now().toString(),B;try{let E=p.find(z=>z.name===T.name);f=E?E.id:Date.now().toString();let Z=[];if(E&&(Array.isArray(E.filters)?Z=[...E.filters]:E.filters&&(Z=[{scope:"default",filters:E.filters}])),T.scope==="Search"||T.scope==="Both"){let z=(Array.isArray(i),i);if(z)if(Array.isArray(z)&&z.length>0&&z[0].scope)z.forEach(O=>{let V=Z.findIndex(N=>N.scope===O.scope);V>=0?Z[V]=O:Z.push(O);});else {let O={scope:t,filters:z},V=Z.findIndex(N=>N.scope===t);V>=0?Z[V]=O:Z.push(O);}}let re=E?.layout||{},le=[];if(E&&Array.isArray(E.layoutRefs)&&(le=[...E.layoutRefs]),T.scope==="Layout"||T.scope==="Both")if(n&&n.length>0)n.forEach(z=>{let O=le.findIndex(V=>V.tableKey===z.tableKey);O>=0?le[O]=z:le.push(z);});else {let z={tableKey:t,layoutId:o||null},O=le.findIndex(V=>V.tableKey===t);O>=0?le[O]=z:le.push(z);}if(B={appId:e,tableKey:t,...T,id:f,createdAt:new Date().toISOString(),filters:Z,layout:re,layoutRefs:le},a)await a.saveVariant(B,e,t);else if(l){if(!(await fetch(`${l}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(B)})).ok)throw new Error(b("variant.toast.saveFailed"))}else {let O=p.some(V=>V.id===f)?p.map(V=>V.id===f?B:V):[...p,B];h(O),I(O);}s&&s(b("variant.toast.saveSuccess")),(a||l)&&await A(),x(f),r(B);}catch(E){console.error("Error saving variant",E);let re=p.some(le=>le.id===f)?p.map(le=>le.id===f?B:le):[...p,B];h(re),I(re),x(f),r(B),u&&u(b("variant.toast.saveFailed"));}},onDelete:async T=>{try{if(a)await a.deleteVariant(T);else if(l){if(!(await fetch(`${l}/api/variants/${T}`,{method:"DELETE"})).ok)throw new Error(b("variant.toast.deleteFailed"))}else {let f=p.filter(B=>B.id!==T);h(f),I(f);}m===T&&x(""),(a||l)&&A(),s&&s(b("variant.toast.deleteSuccess"));}catch(f){console.error("Error deleting variant",f);let B=p.filter(E=>E.id!==T);h(B),I(B),m===T&&x(""),u&&u(b("variant.toast.deleteFailed"));}},onSetDefault:async T=>{try{let f=p.find(E=>E.id===T);if(!f)return;let B={appId:e,tableKey:t,...f,isDefault:!0};if(a)await a.setDefaultVariant(T,e,t);else if(l){if(!(await fetch(`${l}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(B)})).ok)throw new Error(b("variant.toast.defaultFailed"))}else {let E=p.map(Z=>({...Z,isDefault:Z.id===T}));h(E),I(E);}(a||l)&&await A(),s&&s(b("variant.toast.defaultSuccess"));}catch(f){console.error("Error setting default variant",f);let B=p.map(E=>({...E,isDefault:E.id===T}));h(B),I(B),u&&u(b("variant.toast.defaultFailed"));}}})};no.extend(yd);no.extend(bd);var vd=[null,null],gn="0.85rem",xd={en:"en",zh:"zh-cn",fr:"fr",de:"de",ja:"ja",ko:"ko"},Cd=styled(PickersDay,{shouldForwardProp:e=>e!=="isInRange"&&e!=="isStart"&&e!=="isEnd"&&e!=="isHovered"})(({theme:e,isInRange:t,isStart:i,isEnd:o,isHovered:n})=>({...t&&{borderRadius:0,backgroundColor:e.palette.primary.light,color:e.palette.primary.contrastText,"&:hover":{backgroundColor:e.palette.primary.main}},...n&&!t&&!i&&!o&&{borderRadius:0,backgroundColor:e.palette.action.hover,border:`1px dashed ${e.palette.primary.main}`},...i&&{borderRadius:"50% 0 0 50%",backgroundColor:e.palette.primary.main,color:e.palette.primary.contrastText,"&:hover":{backgroundColor:e.palette.primary.dark}},...o&&{borderRadius:"0 50% 50% 0",backgroundColor:e.palette.primary.main,color:e.palette.primary.contrastText,"&:hover":{backgroundColor:e.palette.primary.dark}},...i&&o&&{borderRadius:"50%"}})),kl=({label:e,value:t=vd,onChange:i})=>{let{t:o,locale:n}=U(),r=xd[n]||"en",a=e||o("dateRange.label"),[l,u]=useState(null),[s,c]=useState(t),[d,b]=useState("start"),[p,h]=useState(null),[y,S]=useState((t[0]||no()).locale(r)),v=Ne__default.useRef(t);useEffect(()=>{let[f,B]=t,[E,Z]=v.current,re=O=>O&&typeof O.isSame=="function",le=!(f===null&&E===null||re(f)&&re(E)&&f.isSame(E,"day")),z=!(B===null&&Z===null||re(B)&&re(Z)&&B.isSame(Z,"day"));(le||z)&&(c(t),t[0]&&re(t[0])&&S(t[0].locale(r))),v.current=t;},[t,r]);let m=f=>{u(f.currentTarget);},x=()=>{u(null),b("start"),h(null);},w=!!l,I=f=>{if(!f)return;let B=[...s];if(d==="start")B=[f,null],b("end");else {let E=B[0];E&&f.isBefore(E)?(B=[f,null],b("end")):(B=[E,f],b("start"));}c(B);},R=f=>{let B=no().locale(r),E=[null,null];switch(f){case "today":E=[B,B];break;case "week":E=[B.startOf("week"),B.endOf("week")];break;case "month":E=[B.startOf("month"),B.endOf("month")];break}c(E),b("start"),S(B);},A=()=>{c([null,null]),b("start"),S(no().locale(r));},P=()=>{i&&i(s),x();},F=()=>{c(t),b("start"),x();},C=useCallback(f=>{let{day:B,...E}=f,[Z,re]=s,le=Z?B.isSame(Z,"day"):false,z=re?B.isSame(re,"day"):false,O=Z&&re?B.isBetween(Z,re,"day","()"):false,V=false;return d==="end"&&Z&&!re&&p&&B.isAfter(Z,"day")&&B.isBefore(p.add(1,"day"),"day")&&(V=true),jsx(Cd,{...E,day:B,disableMargin:true,isStart:le,isEnd:z,isInRange:O||V,onMouseEnter:()=>h(B)})},[s,d,p]),k=f=>f?f.locale(r).format("YYYY-MM-DD"):"",T=f=>f?f.locale(r).format("ll"):"";return jsxs(Box,{children:[jsx(TextField,{label:a,value:s[0]?`${k(s[0])} - ${k(s[1])}`:"",onClick:m,fullWidth:true,size:"small",InputLabelProps:{sx:{fontSize:gn}},InputProps:{readOnly:true,sx:{fontSize:gn,"& .MuiOutlinedInput-input":{fontSize:gn},paddingRight:"4px"},endAdornment:jsxs(InputAdornment,{position:"end",sx:{ml:0},children:[(s[0]||s[1])&&jsx(IconButton,{size:"small",onClick:f=>{f.stopPropagation(),A();},edge:"end",sx:{mr:.5,padding:"2px"},children:jsx(fd,{sx:{fontSize:"1rem"}})}),jsx(IconButton,{size:"small",edge:"end",onClick:m,sx:{padding:"2px"},children:jsx(gd,{sx:{fontSize:"1rem"},color:"action"})})]})}}),jsxs(Popover,{open:w,anchorEl:l,onClose:x,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{sx:{display:"flex",flexDirection:"column",p:0,minWidth:320}}},children:[jsx(Box,{sx:{p:2,bgcolor:"background.default",borderBottom:1,borderColor:"divider"},children:jsxs(Stack,{direction:"row",alignItems:"center",spacing:2,justifyContent:"space-between",children:[jsxs(Box,{sx:{p:1,border:1,borderColor:d==="start"?"primary.main":"divider",borderRadius:1,bgcolor:d==="start"?"action.hover":"transparent",flex:1,cursor:"pointer"},onClick:()=>b("start"),children:[jsx(Typography,{variant:"caption",color:"text.secondary",display:"block",children:o("dateRange.startDate")}),jsx(Typography,{variant:"body2",fontWeight:500,children:s[0]?T(s[0]):o("dateRange.select")})]}),jsx(hd,{color:"action",fontSize:"small"}),jsxs(Box,{sx:{p:1,border:1,borderColor:d==="end"?"primary.main":"divider",borderRadius:1,bgcolor:d==="end"?"action.hover":"transparent",flex:1,cursor:"pointer"},onClick:()=>{s[0]&&b("end");},children:[jsx(Typography,{variant:"caption",color:"text.secondary",display:"block",children:o("dateRange.endDate")}),jsx(Typography,{variant:"body2",fontWeight:500,children:s[1]?T(s[1]):o("dateRange.select")})]})]})}),jsx(Box,{sx:{p:2,pb:0},children:jsxs(Stack,{direction:"row",spacing:1,justifyContent:"center",children:[jsx(Chip,{label:o("dateRange.today"),onClick:()=>R("today"),clickable:true,size:"small",variant:"outlined"}),jsx(Chip,{label:o("dateRange.thisWeek"),onClick:()=>R("week"),clickable:true,size:"small",variant:"outlined"}),jsx(Chip,{label:o("dateRange.thisMonth"),onClick:()=>R("month"),clickable:true,size:"small",variant:"outlined"})]})}),jsx(LocalizationProvider,{dateAdapter:AdapterDayjs,adapterLocale:r,children:jsx(DateCalendar,{value:null,referenceDate:y,onMonthChange:S,onYearChange:S,onChange:I,slots:{day:C},views:["day"],showDaysOutsideCurrentMonth:true,sx:{m:0}})}),jsx(Divider,{}),jsxs(Stack,{direction:"row",justifyContent:"flex-end",spacing:1,sx:{p:2},children:[jsx(Button,{size:"small",onClick:F,color:"inherit",children:o("common.cancel")}),jsx(Button,{size:"small",variant:"contained",onClick:P,children:o("common.done")})]})]})]})};var Ja={equals:"=",contains:"\u2287",notContains:"\u2285",wildcard:"*","=":"=","!=":"!=",">":">","<":"<",">=":"\u2265","<=":"\u2264",between:"\u2194"},Fd={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"},Bd=["equals","contains","notContains","wildcard"],Il=["=","!=",">","<",">=","<=","between"],Ie="0.85rem",Ld=({field:e,value:t,onChange:i})=>{let{t:o}=U(),[n,r]=useState(null),[a,l]=useState(null),[u,s]=useState(""),[c,d]=useState(""),[b,p]=useState(false),[h,y]=useState(""),[S,v]=useState("");useEffect(()=>{let k=setTimeout(()=>{v(h);},1e3);return ()=>clearTimeout(k)},[h]);let m=t?.operator||(e.type==="number"?"=":"equals"),x=t?.value,w=k=>{let T=Fd[k];return T?o(T):k},I=k=>{r(k.currentTarget);},R=k=>{i({...t,operator:k,value:x}),r(null);},A={size:"small",fullWidth:true,variant:"outlined",InputLabelProps:{sx:{fontSize:Ie}},InputProps:{sx:{fontSize:Ie}},SelectProps:{MenuProps:{PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:Ie,paddingTop:"4px",paddingBottom:"4px",minHeight:"auto"}}}}}},P=e.type||"text";if(P==="date"){let T=(f=>{if(!f)return [null,null];if(Array.isArray(f)&&f.length===2){let B=f[0]?no.isDayjs(f[0])?f[0]:no(f[0]):null,E=f[1]?no.isDayjs(f[1])?f[1]:no(f[1]):null;return [B,E]}return no.isDayjs(f)||typeof f=="string"?[no.isDayjs(f)?f:no(f),null]:[null,null]})(x);return jsx(kl,{label:e.label,value:T,onChange:f=>i({value:f,operator:"between"})})}if(P==="number"&&m==="between"){let k=()=>{i({value:[u,c],operator:"between"}),l(null);},T=Array.isArray(x)?`${x[0]||""} - ${x[1]||""}`:"";return jsxs(Fragment,{children:[jsx(TextField,{...A,label:e.label,value:T,placeholder:o("smartFilter.minMaxPlaceholder"),InputProps:{...A.InputProps,startAdornment:jsx(InputAdornment,{position:"start",children:jsx(Tooltip,{title:w("between"),children:jsx(IconButton,{size:"small",onClick:I,sx:{width:24,height:24,fontSize:Ie},children:Ja.between})})}),readOnly:true},onClick:f=>l(f.currentTarget)}),jsx(Menu,{anchorEl:n,open:!!n,onClose:()=>r(null),PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:Ie,minHeight:"auto",py:.5}}},children:Il.map(f=>jsxs(MenuItem,{selected:f===m,onClick:()=>R(f),children:[jsx(Box,{sx:{width:24,display:"inline-block",fontWeight:"bold"},children:Ja[f]}),jsx(ListItemText,{primary:w(f),primaryTypographyProps:{fontSize:Ie}})]},f))}),jsx(Popover,{open:!!a,anchorEl:a,onClose:()=>l(null),anchorOrigin:{vertical:"bottom",horizontal:"left"},children:jsxs(Box,{sx:{p:2,display:"flex",gap:1,alignItems:"center"},children:[jsx(TextField,{size:"small",label:o("smartFilter.min"),type:"number",value:u,onChange:f=>s(f.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:Ie}},InputProps:{sx:{fontSize:Ie}}}),jsx(Md,{color:"action"}),jsx(TextField,{size:"small",label:o("smartFilter.max"),type:"number",value:c,onChange:f=>d(f.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:Ie}},InputProps:{sx:{fontSize:Ie}}}),jsx(Button,{variant:"contained",size:"small",onClick:k,children:o("common.ok")})]})})]})}if(P==="select")return jsxs(TextField,{...A,select:true,label:e.label,value:x||"",onChange:k=>i({...t,value:k.target.value,operator:"equals"}),children:[jsx(MenuItem,{value:"",children:jsx("em",{children:o("common.none")})}),e.options?.map(k=>jsx(MenuItem,{value:k.value,children:k.label},k.value))]});if(P==="multi-select"){let k=Array.isArray(x)?x:[],T=e.options?.filter(f=>f.label.toLowerCase().includes(S.toLowerCase()))||[];return jsxs(TextField,{...A,select:true,label:e.label,value:k,onChange:f=>i({...t,value:f.target.value,operator:"anyOf"}),SelectProps:{...A.SelectProps,multiple:true,onClose:()=>{y(""),v("");},renderValue:f=>{if(!Array.isArray(f)||f.length===0)return jsx("em",{children:o("common.none")});let B=Z=>e.options?.find(re=>re.value===Z)?.label||Z,E=f.map(B);return E.length>2?`${E.slice(0,2).join(", ")} +${E.length-2}`:E.join(", ")}},children:[jsx(ListSubheader,{children:jsx(TextField,{size:"small",autoFocus:true,placeholder:o("smartFilter.searchPlaceholder"),fullWidth:true,InputProps:{startAdornment:jsx(InputAdornment,{position:"start",children:jsx(wl,{fontSize:"small"})}),sx:{fontSize:Ie}},value:h,onChange:f=>y(f.target.value),onKeyDown:f=>{f.key!=="Escape"&&f.stopPropagation();},onClick:f=>f.stopPropagation()})}),T.length>0?T.map(f=>jsxs(MenuItem,{value:f.value,children:[jsx(Checkbox,{checked:k.indexOf(f.value)>-1,size:"small"}),jsx(ListItemText,{primary:f.label,primaryTypographyProps:{fontSize:Ie}})]},f.value)):jsx(MenuItem,{disabled:true,children:jsx(ListItemText,{primary:o("smartFilter.noOptionsFound"),primaryTypographyProps:{fontSize:Ie}})})]})}let F=P==="number"?Il:Bd,C=b||x!==void 0&&x!==""&&x!==null||!!n;return jsxs(Fragment,{children:[jsx(TextField,{...A,label:e.label,sx:{minWidth:"120px"},value:x||"",type:P==="number"?"number":"text",onChange:k=>i({...t,value:k.target.value,operator:m}),onFocus:()=>p(true),onBlur:()=>p(false),InputProps:{...A.InputProps,startAdornment:C?jsx(InputAdornment,{position:"start",children:jsx(Tooltip,{title:w(m),children:jsx(IconButton,{size:"small",onClick:I,onMouseDown:k=>k.preventDefault(),sx:{width:24,height:24,fontSize:Ie,fontWeight:"bold",color:"primary.main",bgcolor:"action.hover"},children:Ja[m]})})}):null,endAdornment:e.hasSearchIcon?jsx(InputAdornment,{position:"end",children:jsx(wl,{color:"action"})}):void 0}}),jsx(Menu,{anchorEl:n,open:!!n,onClose:()=>r(null),PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:Ie,minHeight:"auto",py:.5}}},children:F.map(k=>jsxs(MenuItem,{selected:k===m,onClick:()=>R(k),children:[jsx(Box,{sx:{width:24,display:"inline-block",fontWeight:"bold"},children:Ja[k]}),jsx(ListItemText,{primary:w(k),primaryTypographyProps:{fontSize:Ie}})]},k))})]})},ca=({fields:e,filters:t,onFilterChange:i,variants:o=[],currentVariantId:n,onVariantLoad:r,onVariantSave:a,onVariantDelete:l,onVariantSetDefault:u,onSearch:s,loading:c=false,appId:d,tableKey:b,currentLayout:p,currentLayoutId:h,layoutRefs:y,variantService:S,serviceUrl:v})=>{let{t:m}=U(),[x,w]=useState(true),[I,R]=useState(null),[A,P]=useState(e.filter(T=>!T.hidden).map(T=>T.id)),F=(T,f)=>{i({...t,[T]:f});},C=T=>{A.includes(T)?P(A.filter(f=>f!==T)):P([...A,T]);};return jsxs(Paper,{sx:{mb:0,display:"flex",flexDirection:"column",overflow:"visible",position:"relative"},children:[jsxs(Box,{sx:{p:2,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[d?jsx(xl,{appId:d,tableKey:b,currentFilters:{values:t,visibleFields:A},currentLayout:p,currentLayoutId:h,layoutRefs:y,onLoad:T=>{if(!T.filters)return;let f=null;if(Array.isArray(T.filters)){let B=b||"default",E=T.filters.find(Z=>Z.scope===B);f=E?E.filters:null;}else f=T.filters;f&&(f.values||f.visibleFields?(f.visibleFields&&Array.isArray(f.visibleFields)&&P(f.visibleFields),f.values&&i(f.values)):i(f)),r&&r(T);},variantService:S,serviceUrl:v,currentVariantId:n}):jsx(ja,{variants:o,currentVariantId:n,onLoad:r,onSave:T=>{a&&a({...T,filters:{values:t,visibleFields:A}});},onDelete:l,onSetDefault:u}),jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[jsx(Tooltip,{title:m("smartFilter.addFilters"),children:jsx(Button,{onClick:T=>R(T.currentTarget),size:"small",color:"primary",startIcon:jsx(Dd,{fontSize:"small"}),sx:{textTransform:"none",fontSize:Ie,whiteSpace:"nowrap",minWidth:"fit-content"},children:m("smartFilter.adaptFilters")})}),jsx(Button,{variant:"contained",size:"small",onClick:s,disabled:c,sx:{minWidth:"40px",fontWeight:"bold",fontSize:Ie},children:m(c?"common.loading":"smartFilter.go")}),jsxs(Menu,{anchorEl:I,open:!!I,onClose:()=>R(null),slotProps:{paper:{style:{maxHeight:400,width:"25ch"},sx:{"& .MuiMenuItem-root":{fontSize:Ie,minHeight:32}}}},children:[jsx(MenuItem,{disabled:true,children:jsx(ListItemText,{primary:m("smartFilter.visibleFilters"),primaryTypographyProps:{fontSize:Ie}})}),jsx(Divider,{}),e.map(T=>jsxs(MenuItem,{onClick:()=>C(T.id),children:[jsx(Checkbox,{checked:A.includes(T.id),size:"small"}),jsx(ListItemText,{primary:T.label,primaryTypographyProps:{fontSize:Ie}})]},T.id))]})]})]}),jsx(Collapse,{in:x,children:jsx(Box,{sx:{px:2,pb:2},children:jsx(Grid,{container:true,spacing:2,columns:{xs:2,sm:3,md:4,lg:6},children:e.filter(T=>A.includes(T.id)).map(T=>jsx(Grid,{size:1,children:jsx(Ld,{field:T,value:t[T.id]||{value:"",operator:T.type==="number"?"=":"equals"},onChange:f=>F(T.id,f)})},T.id))})})}),jsx(Box,{sx:{position:"absolute",bottom:0,left:"50%",transform:"translate(-50%, 50%)",zIndex:10},children:jsx(IconButton,{size:"small",onClick:()=>w(!x),sx:{bgcolor:"background.paper",boxShadow:2,border:"1px solid",borderColor:"divider",width:20,height:20,minHeight:0,p:0,"&:hover":{bgcolor:"background.paper"}},children:x?jsx(Rd,{sx:{fontSize:16},color:"action"}):jsx(Lu,{sx:{fontSize:16},color:"action"})})})]})};var Ll=({layouts:e,currentLayoutId:t,onLoad:i,onSave:o,onDelete:n,onSetDefault:r})=>{let{t:a}=U(),[l,u]=useState(null),[s,c]=useState(false),[d,b]=useState(""),[p,h]=useState(""),[y,S]=useState({isDefault:false,isPublic:false}),v=e.find(A=>A.id===t),m=A=>{u(A.currentTarget);},x=()=>{u(null);},w=A=>{i(A),x();},I=()=>{b(""),h(""),S({isDefault:false,isPublic:false}),c(true),x();},R=()=>{d.trim()&&(o({name:d,description:p,...y}),c(false));};return jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[jsx(Tooltip,{title:a("layout.saveLayout"),children:jsx(IconButton,{onClick:I,color:"primary",size:"small",children:jsx(Bl,{})})}),jsx(Tooltip,{title:a("layout.layoutOptions"),children:jsx(IconButton,{onClick:m,color:v?"primary":"default",children:jsx(_d,{})})}),jsxs(Menu,{anchorEl:l,open:!!l,onClose:x,PaperProps:{sx:{width:320,maxHeight:400}},children:[jsx(MenuItem,{disabled:true,children:jsx(Typography,{variant:"caption",children:a("layout.selectLayout")})}),jsxs(MenuItem,{onClick:I,children:[jsx(ListItemIcon,{children:jsx(Bl,{fontSize:"small"})}),jsx(ListItemText,{children:a("layout.saveCurrentLayout")})]}),jsx(Divider,{}),e.length===0&&jsx(MenuItem,{disabled:true,children:jsx(Typography,{variant:"body2",color:"text.secondary",children:a("layout.noSavedLayouts")})}),e.map((A,P)=>jsx(MenuItem,{onClick:()=>w(A),selected:A.id===t,children:jsxs(Box,{sx:{display:"flex",alignItems:"center",width:"100%",justifyContent:"space-between"},children:[jsxs(Box,{sx:{display:"flex",flexDirection:"column",overflow:"hidden",mr:1},children:[jsx(Box,{sx:{display:"flex",alignItems:"center",gap:1},children:jsx(Typography,{variant:"body2",fontWeight:A.id===t?"bold":"normal",noWrap:true,children:A.name})}),A.description&&jsx(Typography,{variant:"caption",color:"text.secondary",noWrap:true,children:A.description})]}),jsxs(Box,{sx:{display:"flex",alignItems:"center"},onClick:F=>F.stopPropagation(),children:[jsx(Tooltip,{title:A.isDefault?a("layout.removeDefault"):a("layout.setAsDefault"),children:jsx(IconButton,{size:"small",onClick:F=>{F.stopPropagation(),r(A.id);},children:A.isDefault?jsx(Jp,{fontSize:"small",color:"warning"}):jsx(qd,{fontSize:"small"})})}),jsx(Tooltip,{title:a("common.delete"),children:jsx(IconButton,{size:"small",color:"error",onClick:F=>{F.stopPropagation(),n(A.id);},children:jsx(fu,{fontSize:"small"})})})]})]})},A.id||P))]}),jsxs(Dialog,{open:s,onClose:()=>c(false),maxWidth:"xs",fullWidth:true,children:[jsx(DialogTitle,{children:a("layout.saveLayout")}),jsx(DialogContent,{children:jsxs(Box,{sx:{display:"flex",flexDirection:"column",gap:2,mt:1},children:[jsx(TextField,{label:a("layout.layoutName"),value:d,onChange:A=>b(A.target.value),fullWidth:true,autoFocus:true,size:"small",helperText:a("layout.layoutNameHelper")}),e.some(A=>A.name===d)&&jsx(Typography,{variant:"caption",color:"warning.main",sx:{ml:1},children:a("layout.warningOverwrite")}),jsx(TextField,{label:a("layout.layoutDescription"),value:p,onChange:A=>h(A.target.value),fullWidth:true,size:"small"}),jsx(FormControlLabel,{control:jsx(Checkbox,{checked:y.isDefault,onChange:A=>S({...y,isDefault:A.target.checked})}),label:a("layout.useAsDefault")}),jsx(FormControlLabel,{control:jsx(Checkbox,{checked:y.isPublic,onChange:A=>S({...y,isPublic:A.target.checked})}),label:a("layout.publicAllUsers")})]})}),jsxs(DialogActions,{children:[jsx(Button,{onClick:()=>c(false),children:a("common.cancel")}),jsx(Button,{onClick:R,variant:"contained",disabled:!d,children:a("common.save")})]})]})]})};var zl=({appId:e,tableKey:t="default",currentLayoutData:i,onLayoutLoad:o,targetLayoutId:n,activeLayoutId:r,serviceUrl:a,onError:l,onSuccess:u})=>{let{t:s}=U(),[c,d]=useState([]),[b,p]=useState(""),h=`orbcafe.layouts.${e}.${t}`,y=P=>({id:P.layoutId,name:P.name,description:P.description??"",isDefault:!!P.isDefault,isPublic:!!P.isPublic,createdAt:P.createdAt??new Date().toISOString(),layoutData:P.layout??{}}),S=P=>({appId:e,tableKey:t,layoutId:P.id,name:P.name,description:P.description??"",isDefault:!!P.isDefault,isPublic:!!P.isPublic,createdAt:P.createdAt,layout:P.layoutData}),v=useCallback(()=>{try{let P=localStorage.getItem(h);if(!P)return [];let F=JSON.parse(P);return Array.isArray(F)?F:[]}catch{return []}},[h]),m=useCallback(P=>{try{localStorage.setItem(h,JSON.stringify(P));}catch{}},[h]);useEffect(()=>{r!==void 0&&p(r);},[r]),useEffect(()=>{if(n&&c.length>0){let P=c.find(F=>F.id===n);P&&(p(P.id),o(P));}},[n,c,o]);let x=useCallback(async()=>{if(e){if(!a){let P=v();d(P);let F=P.find(C=>C.isDefault);F&&!b&&!n&&(p(F.id),o(F));return}try{let P=await fetch(`${a}/api/layouts?appId=${encodeURIComponent(e)}&tableKey=${encodeURIComponent(t)}`);if(!P.ok)throw new Error("LAYOUT_FETCH_FAILED");let C=(await P.json()).map(y);d(C);let k=C.find(T=>T.isDefault);k&&!b&&!n&&(p(k.id),o(k));}catch(P){console.error("Error fetching layouts",P);let F=v();d(F);let C=F.find(k=>k.isDefault);C&&!b&&!n&&(p(C.id),o(C)),l&&l(s("layout.toast.loadFallback"));}}},[e,t,a,l,b,o,n,v,s]);return useEffect(()=>{x();},[e,t]),jsx(Ll,{layouts:c,currentLayoutId:b,onLoad:P=>{p(P.id),o(P);},onSave:async P=>{let F=c.find(T=>T.name===P.name),C=F?F.id:Date.now().toString(),k={id:C,...P,createdAt:new Date().toISOString(),layoutData:i,isDefault:P.isDefault??false,isPublic:P.isPublic??false};if(!a){let f=c.some(B=>B.id===C)?c.map(B=>B.id===C?k:B):[...c,k];d(f),m(f),p(C),o(k),u&&u(s("layout.toast.saveLocalSuccess"));return}try{if(!(await fetch(`${a}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(S(k))})).ok)throw new Error("LAYOUT_SAVE_FAILED");u&&u(s("layout.toast.saveSuccess")),await x(),p(C),o(k);}catch(T){console.error("Error saving layout",T);let B=c.some(E=>E.id===C)?c.map(E=>E.id===C?k:E):[...c,k];d(B),m(B),p(C),o(k),u&&u(s("layout.toast.saveLocalSuccess")),l&&l(s("layout.toast.backendUnavailableSavedLocal"));}},onDelete:async P=>{if(!a){let F=c.filter(C=>C.id!==P);d(F),m(F),b===P&&p(""),u&&u(s("layout.toast.deleteLocalSuccess"));return}try{if(!(await fetch(`${a}/api/layouts/${encodeURIComponent(P)}`,{method:"DELETE"})).ok)throw new Error("LAYOUT_DELETE_FAILED");b===P&&p(""),u&&u(s("layout.toast.deleteSuccess")),await x();}catch(F){console.error("Error deleting layout",F);let C=c.filter(k=>k.id!==P);d(C),m(C),b===P&&p(""),u&&u(s("layout.toast.deleteLocalSuccess")),l&&l(s("layout.toast.backendUnavailableDeletedLocal"));}},onSetDefault:async P=>{if(!a){let F=c.map(C=>({...C,isDefault:C.id===P}));d(F),m(F),u&&u(s("layout.toast.defaultLocalSuccess"));return}try{let F=c.find(k=>k.id===P);if(!F)return;if(!(await fetch(`${a}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(S({...F,isDefault:!0}))})).ok)throw new Error("LAYOUT_DEFAULT_FAILED");u&&u(s("layout.toast.defaultSuccess")),await x();}catch(F){console.error("Error setting default",F);let C=c.map(k=>({...k,isDefault:k.id===P}));d(C),m(C),u&&u(s("layout.toast.defaultLocalSuccess")),l&&l(s("layout.toast.backendUnavailableDefaultLocal"));}}})};function Ol(e,t,i){return t[i]<e[i]?-1:t[i]>e[i]?1:0}function Zd(e,t){return e==="desc"?(i,o)=>Ol(i,o,t):(i,o)=>-Ol(i,o,t)}function jd(e,t){let i=e.map((o,n)=>[o,n]);return i.sort((o,n)=>{let r=t(o[0],n[0]);return r!==0?r:o[1]-n[1]}),i.map(o=>o[0])}var Vl=e=>{let t=useCallback(D=>{let $=String(D?.label??D?.id??"").length*9+64,ie=typeof D?.minWidth=="number"?D.minWidth:0;return Math.max(100,ie,$)},[]),i=useCallback(()=>(e.columns||[]).filter(D=>!!D?.numeric).map(D=>D.id),[e.columns]),[o,n]=useState(""),[r,a]=useState(e.order||"asc"),[l,u]=useState(e.orderBy||""),[s,c]=useState(e.page||0),[d,b]=useState(e.rowsPerPage||20),[p,h]=useState(e.selected||[]),[y,S]=useState(e.columns?e.columns.map(D=>D.id):[]),[v,m]=useState(e.showSummary||false),[x,w]=useState(()=>i()),[I,R]=useState([]),[A,P]=useState(new Set),[F,C]=useState(()=>{let D={};return (e.columns||[]).forEach(G=>{D[G.id]=t(G);}),D}),[k,T]=useState(null),[f,B]=useState(null),[E,Z]=useState(null),[re,le]=useState(null),[z,O]=useState(false),[V,N]=useState("");useEffect(()=>{e.layout&&vo(e.layout);},[e.layout]),useEffect(()=>{e.order!==void 0&&a(e.order),e.orderBy!==void 0&&u(e.orderBy);},[e.order,e.orderBy]),useEffect(()=>{e.selected!==void 0&&h(e.selected);},[e.selected]),useEffect(()=>{e.page!==void 0&&c(e.page);},[e.page]),useEffect(()=>{e.rowsPerPage!==void 0&&b(e.rowsPerPage);},[e.rowsPerPage]),useEffect(()=>{let D=i();w(G=>G.filter(ie=>D.includes(ie)));},[i]),useEffect(()=>{C(D=>{let G={...D};return (e.columns||[]).forEach($=>{G[$.id]===void 0&&(G[$.id]=t($));}),G});},[e.columns,t]);let ge=useMemo(()=>{let D=e.rows||[];return o&&(D=D.filter(G=>Object.keys(G).some($=>String(G[$]).toLowerCase().includes(o.toLowerCase())))),D},[e.rows,o]),ve=useMemo(()=>e.onSortChange||!l?ge:jd(ge,Zd(r,l)),[ge,r,l,e.onSortChange]),Me=useCallback(D=>{if(I.length===0)return D.map(se=>({type:"row",data:se,id:se[e.rowKey||"id"]}));let G=[...D].sort((se,ce)=>{for(let ue of I){if(se[ue]<ce[ue])return -1;if(se[ue]>ce[ue])return 1}return 0}),$=(se,ce=0)=>{if(ce>=I.length)return se;let ue=I[ce],fe={},Re=[];return se.forEach(Ae=>{let je=Ae[ue],Fe=`${ue}:${je}`;fe[Fe]||(fe[Fe]={key:Fe,field:ue,value:je,children:[],count:0,level:ce},Re.push(fe[Fe])),fe[Fe].children.push(Ae),fe[Fe].count++;}),Re.forEach(Ae=>{Ae.children&&(Ae.children=$(Ae.children,ce+1));}),Re},ie=$(G),ne=(se,ce="")=>{let ue=[];return se.forEach(fe=>{if(fe.children){let Re=ce?`${ce}>${fe.key}`:fe.key,Ae=A.has(Re);ue.push({type:"group",id:Re,field:fe.field,value:fe.value,level:fe.level,count:fe.count,isExpanded:Ae,childIds:(function je(Fe){let mt=[];return Fe.children.forEach(Te=>{Te.children?mt=mt.concat(je(Te)):mt.push(Te[e.rowKey||"id"]);}),mt})(fe)}),Ae&&(ue=ue.concat(ne(fe.children,Re)));}else ue.push({type:"row",data:fe,id:fe[e.rowKey||"id"],level:I.length});}),ue};return ne(ie)},[I,A,e.rowKey]),Pe=useCallback(D=>{if(I.length===0)return [];let G=[...D].sort((ne,se)=>{for(let ce of I){if(ne[ce]<se[ce])return -1;if(ne[ce]>se[ce])return 1}return 0}),$=[],ie=(ne,se,ce)=>{if(se>=I.length)return;let ue=I[se],fe=new Map;ne.forEach(Re=>{let Ae=Re[ue],je=fe.get(Ae);je?je.push(Re):fe.set(Ae,[Re]);}),fe.forEach((Re,Ae)=>{let je=`${ue}:${Ae}`,Fe=ce?`${ce}>${je}`:je;$.push(Fe),ie(Re,se+1,Fe);});};return ie(G,0,""),$},[I]),Ue=useMemo(()=>Me(ve),[ve,Me]),lt=useMemo(()=>Pe(ve),[ve,Pe]),Pt=useMemo(()=>{let D=(e.rows||[]).length;return typeof e.count=="number"&&e.count>D},[e.count,e.rows]),ho=useMemo(()=>Pt?Ue:d>0?Ue.slice(s*d,s*d+d):Ue,[Ue,s,d,Pt]),Ct=useMemo(()=>Pt&&typeof e.count=="number"?e.count:Ue.length,[Ue.length,Pt,e.count]),yo=D=>{P(G=>{let $=new Set(G);return $.has(D)?$.delete(D):$.add(D),$});},Se=D=>{let G=lt.filter($=>$===D||$.startsWith(`${D}>`));P($=>{let ie=new Set($);return G.forEach(ne=>ie.add(ne)),ie});},xe=D=>{P(G=>{let $=new Set(G);return Array.from($).forEach(ie=>{(ie===D||ie.startsWith(`${D}>`))&&$.delete(ie);}),$});},Ge=D=>{if(!D){P(new Set);return}P(new Set(lt));},$e=D=>{let G=lt.filter($=>$.startsWith(`${D}>`));return G.length===0?A.has(D):A.has(D)&&G.every($=>A.has($))},qe=D=>{let G=l===D&&r==="asc",$=l===D&&r==="desc";if(e.onSortChange){G?e.onSortChange(D,"desc"):$?e.onSortChange("","asc"):e.onSortChange(D,"asc");return}G?(a("desc"),u(D)):$?(a("asc"),u("")):(a("asc"),u(D));},Dt=(D,G)=>{C($=>({...$,[D]:G}));},_o=D=>{if(D.target.checked){let G=ge.map($=>$[e.rowKey||"id"]);h(G),e.onSelectionChange&&e.onSelectionChange(G);return}h([]),e.onSelectionChange&&e.onSelectionChange([]);},ze=(D,G)=>{let $=G[e.rowKey||"id"],ie=p.indexOf($),ne=[];ie===-1?ne=ne.concat(p,$):ie===0?ne=ne.concat(p.slice(1)):ie===p.length-1?ne=ne.concat(p.slice(0,-1)):ie>0&&(ne=ne.concat(p.slice(0,ie),p.slice(ie+1))),h(ne),e.onSelectionChange&&e.onSelectionChange(ne);},bo=D=>{c(D),e.onPageChange&&e.onPageChange(D);},_e=D=>{b(D),c(0),e.onPageChange&&e.onPageChange(0),e.onRowsPerPageChange&&e.onRowsPerPageChange(D);},tt=D=>{let G=y.indexOf(D),$=[...y];G===-1?$.push(D):$.splice(G,1),S($);},Ke=D=>{let G=I.indexOf(D),$=[...I];G===-1?$.push(D):$.splice(G,1),R($);},Ze=D=>{i().includes(D)&&w($=>$.includes(D)?$.filter(ie=>ie!==D):[...$,D]);},Vt=D=>{e.onLayoutSave&&e.onLayoutSave({visibleColumns:y,order:r,orderBy:l,grouping:I,columnWidths:F,showSummary:v,summaryColumns:x});},Nt=D=>{D.layout&&(D.layout.visibleColumns&&S(D.layout.visibleColumns),D.layout.order&&a(D.layout.order),D.layout.orderBy&&u(D.layout.orderBy),D.layout.grouping&&R(D.layout.grouping),D.layout.columnWidths&&C(D.layout.columnWidths),D.layout.showSummary!==void 0&&m(!!D.layout.showSummary),Array.isArray(D.layout.summaryColumns)&&w(D.layout.summaryColumns));},vo=D=>{let G=D?.layoutData||D?.layout||D||{};G.visibleColumns&&S(G.visibleColumns),G.order&&a(G.order),G.orderBy!==void 0&&u(G.orderBy),G.grouping&&R(G.grouping),G.columnWidths&&C(G.columnWidths),G.showSummary!==void 0&&m(!!G.showSummary),Array.isArray(G.summaryColumns)&&w(G.summaryColumns),P(new Set),c(0),D?.id&&N(D.id);};useEffect(()=>{e.layout&&Nt({layout:e.layout});},[e.layout]);let Gt=D=>{D.preventDefault(),le(re===null?{mouseX:D.clientX+2,mouseY:D.clientY-6}:null);},Xt=()=>{le(null);},Ko=useMemo(()=>{if(!v)return {};let D={};e.columns.forEach($=>{if($.numeric&&x.includes($.id)){let ie=ge.reduce((ne,se)=>{let ce=parseFloat(se[$.id]);return ne+(isNaN(ce)?0:ce)},0);D[$.id]=ie.toFixed(2);}else D[$.id]="";});let G=e.columns.find($=>y.includes($.id));return G&&!G.numeric&&(D[G.id]="Total"),D},[ge,e.columns,v,x,y]),st=()=>{if(!e.columns||!ge)return;let D=e.columns.map(se=>se.label).join(","),G=ge.map(se=>e.columns.map(ce=>{let ue=se[ce.id];return `"${(ue==null?"":String(ue)).replace(/"/g,'""')}"`}).join(",")).join(`
|
|
2
|
-
`)
|
|
3
|
-
${G}`,ie=encodeURI($),ne=document.createElement("a");ne.setAttribute("href",ie),ne.setAttribute("download",`${e.title||"export"}.csv`),document.body.appendChild(ne),ne.click(),document.body.removeChild(ne);},ct=()=>{O(true);},dt=()=>{O(false);};return {isMobile:false,columns:e.columns,order:r,orderBy:l,filterText:o,setFilterText:n,visibleColumns:y,setVisibleColumns:S,showSummary:v,setShowSummary:m,summaryColumns:x,grouping:I,setGrouping:R,expandedGroups:A,setExpandedGroups:P,groupAnchorEl:f,setGroupAnchorEl:B,summaryAnchorEl:E,setSummaryAnchorEl:Z,columnWidths:F,setColumnWidths:C,anchorEl:k,setAnchorEl:T,contextMenu:re,setContextMenu:le,sensors:void 0,sortedAndFilteredRows:ve,visibleRows:ho,summaryRow:Ko,page:s,setPage:bo,rowsPerPage:d,setRowsPerPage:_e,totalDisplayCount:Ct,selected:p,setSelected:h,isAllExpanded:lt.length>0&<.every(D=>A.has(D)),handleColumnResize:Dt,handleRequestSort:qe,handleSelectAllClick:_o,handleClick:ze,toggleSummaryColumn:Ze,handleDragEnd:()=>{},handleExport:st,handleContextMenu:Gt,handleCloseContextMenu:Xt,toggleColumnVisibility:tt,toggleGroupExpand:yo,toggleGroupField:Ke,handleToggleAll:Ge,handleExpandGroupRecursively:Se,handleCollapseGroupRecursively:xe,isGroupFullyExpanded:$e,handleLayoutLoad:vo,handleVariantLoad:Nt,handleLayoutSave:Vt,effectiveAppId:e.appId||"",currentLayoutData:{visibleColumns:y,order:r,orderBy:l,grouping:I,columnWidths:F,showSummary:v,summaryColumns:x},currentLayoutId:V,layoutIdToLoad:"",onPageChange:bo,onRowsPerPageChange:_e,graphReportOpen:z,handleOpenGraphReport:ct,handleCloseGraphReport:dt}};var KC=e=>jsx(Xd,{...e}),ZC=e=>jsx(Zr,{...e}),jC=e=>jsx(ql,{...e}),QC=e=>jsx(Cu,{...e}),YC=e=>jsx(Su,{...e}),zo=e=>{let{t}=U(),i="0.85rem",{title:o,showToolbar:n=true,selectionMode:r,selected:a=[],onSelectionChange:l,actions:u,extraTools:s,fitContainer:c=false,fullWidth:d=false,maxHeight:b,loading:p=false,rowsPerPageOptions:h=[20,50,100,-1],onLayoutSave:y,filterConfig:S,rowKey:v,tableKey:m="default",graphReport:x,quickCreate:w,quickEdit:I,quickDelete:R,serviceUrl:A}=e,P=o||t("table.title.default"),{isMobile:F,columns:C,order:k,orderBy:T,filterText:f,setFilterText:B,visibleColumns:E,showSummary:Z,setShowSummary:re,summaryColumns:le,grouping:z,setGrouping:O,expandedGroups:V,groupAnchorEl:N,setGroupAnchorEl:ge,summaryAnchorEl:ve,setSummaryAnchorEl:Me,columnWidths:Pe,anchorEl:Ue,setAnchorEl:lt,contextMenu:Pt,sensors:ho,sortedAndFilteredRows:Ct,summaryRow:yo,visibleRows:Se,isAllExpanded:xe,page:Ge,setPage:$e,rowsPerPage:qe,setRowsPerPage:Dt,totalDisplayCount:_o,setSelected:ze,handleColumnResize:bo,handleRequestSort:_e,handleSelectAllClick:tt,handleClick:Ke,toggleSummaryColumn:Ze,handleDragEnd:Vt,handleExport:Nt,handleContextMenu:vo,handleCloseContextMenu:Gt,toggleColumnVisibility:Xt,toggleGroupExpand:Ko,toggleGroupField:st,handleToggleAll:ct,handleExpandGroupRecursively:dt,handleCollapseGroupRecursively:D,isGroupFullyExpanded:G,handleLayoutLoad:$,handleVariantLoad:ie,handleLayoutSave:ne,effectiveAppId:se,currentLayoutData:ce,currentLayoutId:ue,layoutIdToLoad:fe,graphReportOpen:Re,handleOpenGraphReport:Ae,handleCloseGraphReport:je}=Vl(e),Fe=x?.enabled??false,mt=Fe&&(x?.interaction?.enabled??true),Te=dl(),Ta=!!w?.enabled,wa=!!I?.enabled,Zo=!!R?.enabled,xo=w?.fields,Co=w?.excludeFields||[],Ar=w?.initialValues||{},[g,M]=Ne__default.useState(false),[L,W]=Ne__default.useState(false),[X,J]=Ne__default.useState({}),[oe,K]=Ne__default.useState(false),[ae,Qe]=Ne__default.useState(false),[Ye,Xe]=Ne__default.useState({}),[q,Q]=Ne__default.useState(false),[We,ai]=Ne__default.useState(false),Xs=p||L||ae||We,ri=Ne__default.useMemo(()=>{let H=[...C];if(Array.isArray(xo)&&xo.length>0){let pe=new Set(xo);H=H.filter(Be=>pe.has(Be.id));}if(Co.length>0){let pe=new Set(Co);H=H.filter(Be=>!pe.has(Be.id));}return H.filter(pe=>!!pe?.id)},[C,Co,xo]),Mr=v||"id",Rt=Ne__default.useMemo(()=>{let H=new Set(a);return Ct.filter(pe=>H.has(pe?.[Mr]))},[a,Ct,Mr]),So=Rt.length===1?Rt[0]:null,Ia=I?.fields,Fr=I?.excludeFields||[],ni=I?.editableFields||[],ii=I?.nonEditableFields||[],li=I?.primaryKeys?.length?I.primaryKeys:[Mr],si=Ne__default.useMemo(()=>{let H=[...C];if(Array.isArray(Ia)&&Ia.length>0){let pe=new Set(Ia);H=H.filter(Be=>pe.has(Be.id));}if(Fr.length>0){let pe=new Set(Fr);H=H.filter(Be=>!pe.has(Be.id));}return H.filter(pe=>!!pe?.id)},[C,Fr,Ia]),ci=Ne__default.useMemo(()=>new Set(li),[li]),Br=Ne__default.useMemo(()=>new Set(ni),[ni]),ui=Ne__default.useMemo(()=>new Set(ii),[ii]),Js=Ne__default.useCallback(H=>Br.size>0?Br.has(H):!(ui.has(H)||ci.has(H)),[Br,ui,ci]);Ne__default.useEffect(()=>{!Re&&Te.hasActiveFilters&&Te.clearAll();},[Re,Te.hasActiveFilters,Te.clearAll]);let ec=()=>{let H={};ri.forEach(pe=>{H[pe.id]=Ar[pe.id]??"";}),J(H),M(true);},pi=()=>{L||M(false);},tc=(H,pe)=>{J(Be=>({...Be,[H]:pe}));},oc=async()=>{if(!w?.onSubmit){M(false);return}try{W(!0),await w.onSubmit(X),M(!1);}finally{W(false);}},ac=()=>{if(!So)return;let H={};si.forEach(Be=>{H[Be.id]=So[Be.id]??"";});let pe=I?.getInitialValues?{...H,...I.getInitialValues(So)}:H;Xe(pe),K(true);},di=()=>{ae||K(false);},rc=(H,pe)=>{Xe(Be=>({...Be,[H]:pe}));},nc=async()=>{if(So){if(!I?.onSubmit){K(false);return}try{Qe(!0),await I.onSubmit(Ye,So),K(!1);}finally{Qe(false);}}},ic=()=>{Rt.length!==0&&Q(true);},lc=()=>{We||Q(false);},sc=async()=>{if(Rt.length===0){Q(false);return}if(!R?.onConfirm){Q(false),ze([]),l?.([]);return}try{ai(!0),await R.onConfirm(Rt),Q(!1),ze([]),l?.([]);}finally{ai(false);}},Pa=Ct,{fieldMapping:Da}=pn({rows:Pa,config:{...x,title:x?.title||`${P} ${t("graph.reportTitle")}`}}),cc=Ne__default.useMemo(()=>mt?Te.applyRows(Pa,Da):Pa,[mt,Te.applyRows,Pa,Da]),{model:Lr}=pn({rows:cc,config:{...x,title:x?.title||`${P} ${t("graph.reportTitle")}`,fieldMapping:Da}}),uc=Lr.table.columns.map(H=>({id:H.id,label:H.label,align:H.align||"left",minWidth:120,numeric:H.align==="right"})),pc=se?jsx(zl,{appId:se,tableKey:m,currentLayoutData:ce,onLayoutLoad:$,targetLayoutId:fe,activeLayoutId:ue,serviceUrl:A??S?.serviceUrl}):null,mi=jsxs(Fragment,{children:[jsx(Wi,{groupAnchorEl:N,setGroupAnchorEl:ge,grouping:z,setGrouping:O,columns:C,toggleGroupField:st}),jsx(Hi,{anchorEl:Ue,setAnchorEl:lt,columns:C,visibleColumns:E,toggleColumnVisibility:Xt}),jsx(Ui,{anchorEl:ve,setAnchorEl:Me,showSummary:Z,setShowSummary:re,columns:C,summaryColumns:le,toggleSummaryColumn:Ze}),jsx(qi,{contextMenu:Pt,handleCloseContextMenu:Gt,columns:C,visibleColumns:E,toggleColumnVisibility:Xt})]});return F?jsxs(da,{sx:{display:"flex",flexDirection:"column",gap:2,height:"100%"},children:[S&&jsx(ca,{fields:S.fields,filters:S.filters,onFilterChange:S.onFilterChange,onSearch:S.onSearch,variants:S.variants||[],currentVariantId:S.currentVariantId,onVariantLoad:S.onVariantLoad,onVariantSave:S.onVariantSave,onVariantDelete:S.onVariantDelete,onVariantSetDefault:S.onVariantSetDefault,appId:S.appId,tableKey:m,currentLayout:[{tableKey:m,layoutData:ce}],variantService:S.variantService,serviceUrl:A??S.serviceUrl}),jsx(Gi,{title:P,loading:p,showSummary:Z,setShowSummary:re,setAnchorEl:lt,setSummaryAnchorEl:Me,filterText:f,setFilterText:B,sortedAndFilteredRows:Ct,selected:a,columns:C,visibleColumns:E,summaryRow:yo,handleClick:Ke,selectionMode:r}),mi]}):jsxs(da,{sx:{width:d?"100%":"auto",mb:c?0:2,...c?{flex:1,display:"flex",flexDirection:"column",minHeight:0,height:"100%",overflow:"hidden"}:{}},children:[S&&jsx(da,{sx:{mb:2},children:jsx(ca,{fields:S.fields,filters:S.filters,onFilterChange:S.onFilterChange,onSearch:S.onSearch,variants:S.variants||[],currentVariantId:S.currentVariantId,onVariantLoad:H=>{ie(H),S.onVariantLoad&&S.onVariantLoad(H);},onVariantSave:S.onVariantSave,onVariantDelete:S.onVariantDelete,onVariantSetDefault:S.onVariantSetDefault,loading:p,appId:S.appId,tableKey:m,currentLayout:[{tableKey:m,layoutData:ce}],currentLayoutId:ue,layoutRefs:[{tableKey:m,layoutId:ue}],variantService:S.variantService,serviceUrl:A??S.serviceUrl})}),jsxs(Qd,{sx:{width:d?"100%":"auto",mb:c?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative","&::before":Xs?{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"}},...b?{height:b}:c?{flex:1,minHeight:0,height:"100%"}:{}},children:[n&&jsx(Mi,{filterText:f,setFilterText:B,onRowsPerPageChange:Dt,rowsPerPage:qe,rowsPerPageOptions:h,page:Ge,count:_o,onPageChange:$e,actions:u,extraTools:s,grouping:z,setGroupAnchorEl:ge,showSummary:Z,setShowSummary:re,setAnchorEl:lt,setSummaryAnchorEl:Me,handleExport:Nt,showCreateButton:Ta,onOpenCreateDialog:ec,showEditButton:wa,onOpenEditDialog:ac,editDisabled:Rt.length!==1,showDeleteButton:Zo,onOpenDeleteConfirm:ic,deleteDisabled:Rt.length===0,onLayoutSave:y||S?.variantService&&S?.appId?ne:void 0,loading:p,layoutManager:pc,onOpenGraphReport:Fe?Ae:void 0}),jsx(ql,{sx:{flex:1,...b?{maxHeight:b,height:b}:c?{height:0,maxHeight:"none"}:{maxHeight:"calc(100vh - 320px)"},overflowY:"auto",overflowX:"auto",position:"relative",minHeight:0},children:jsx(DndContext,{sensors:ho,collisionDetection:closestCenter,onDragEnd:Vt,modifiers:[restrictToHorizontalAxis],children:jsxs(Yd,{sx:{minWidth:d?750:"auto",width:d?"100%":"auto",tableLayout:Object.keys(Pe).length>0?"fixed":"auto",borderCollapse:"separate",borderSpacing:0,"& .MuiTableCell-root":{fontSize:i}},"aria-labelledby":"tableTitle",size:"small",stickyHeader:true,children:[jsx(Li,{columns:C,visibleColumns:E,order:k,orderBy:T,onRequestSort:_e,onContextMenu:vo,selectionMode:r,grouping:z,isAllExpanded:xe,handleToggleAll:ct,rowCount:Ct.length,numSelected:a.length,onSelectAllClick:tt,columnWidths:Pe,onColumnResize:bo}),jsx(Oi,{visibleRows:Se,columns:C,visibleColumns:E,selectionMode:r,selected:a,orderBy:T,loading:p,expandedGroups:V,toggleGroupExpand:Ko,handleExpandGroupRecursively:dt,handleCollapseGroupRecursively:D,isGroupFullyExpanded:G,handleClick:Ke,onSelectionChange:l,grouping:z,rowKeyProp:v,page:Ge,rowsPerPage:qe}),Z&&jsx(Vi,{showSummary:Z,columns:C,visibleColumns:E,summaryRow:yo,selectionMode:r?.toString(),grouping:z,orderBy:T,zIndex:3})]})})})]}),Ta&&jsxs(Nl,{open:g,onClose:pi,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:H=>`1px solid ${H.palette.divider}`,bgcolor:"background.paper"}}},children:[jsx(Gl,{sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:w?.title||t("quickCreate.createWithTitle",{title:P})}),jsx($l,{sx:{pt:"8px !important"},children:jsxs(da,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[ri.map(H=>{let pe=H.type==="number"||H.numeric?"number":H.type==="date"?"date":"text",Be=H.label||H.id;return jsx(Hl,{label:Be,value:X[H.id]??"",onChange:Er=>tc(H.id,Er.target.value),type:pe,size:"small",fullWidth:true,InputLabelProps:{shrink:pe==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-create-${H.id}`)}),w?.description&&jsx(Ul,{severity:"info",sx:{fontSize:"0.85rem","& .MuiAlert-message":{fontSize:"0.85rem"}},children:w.description})]})}),jsxs(Wl,{sx:{px:3,pb:2},children:[jsx(rr,{onClick:pi,sx:{fontSize:"0.85rem"},disabled:L,children:w?.cancelLabel||t("common.cancel")}),jsx(rr,{onClick:oc,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:L,children:w?.submitLabel||t("common.save")})]})]}),wa&&jsxs(Nl,{open:oe,onClose:di,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:H=>`1px solid ${H.palette.divider}`,bgcolor:"background.paper"}}},children:[jsx(Gl,{sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:I?.title||t("quickEdit.editWithTitle",{title:P})}),jsx($l,{sx:{pt:"8px !important"},children:jsxs(da,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[si.map(H=>{let pe=H.type==="number"||H.numeric?"number":H.type==="date"?"date":"text",Be=H.label||H.id,Er=Js(H.id);return jsx(Hl,{label:Be,value:Ye[H.id]??"",onChange:dc=>rc(H.id,dc.target.value),type:pe,size:"small",fullWidth:true,disabled:!Er,InputLabelProps:{shrink:pe==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-edit-${H.id}`)}),I?.description&&jsx(Ul,{severity:"info",sx:{fontSize:"0.85rem","& .MuiAlert-message":{fontSize:"0.85rem"}},children:I.description})]})}),jsxs(Wl,{sx:{px:3,pb:2},children:[jsx(rr,{onClick:di,sx:{fontSize:"0.85rem"},disabled:ae,children:I?.cancelLabel||t("common.cancel")}),jsx(rr,{onClick:nc,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:ae||!So,children:I?.submitLabel||t("common.save")})]})]}),Zo&&jsx(Ur,{open:q,type:"warning",title:R?.title||t("quickDelete.confirmTitle"),message:R?.message||(Rt.length>1?t("quickDelete.confirmMessageMultiple",{count:Rt.length}):t("quickDelete.confirmMessageSingle")),confirmText:R?.confirmText||t("common.delete"),cancelText:R?.cancelText||t("common.cancel"),onClose:lc,onConfirm:sc}),mi,Fe&&jsx(cl,{open:Re,onClose:je,model:Lr,aiAssistant:x?.aiAssistant,interaction:mt?{enabled:true,filters:Te.filters,fieldMapping:Da,onPrimaryDimensionClick:H=>Te.setFilter("primaryDimension",H),onSecondaryDimensionClick:H=>Te.setFilter("secondaryDimension",H),onStatusClick:H=>Te.setFilter("status",H),onClearFilter:Te.clearFilter,onClearAll:Te.clearAll}:void 0,tableContent:jsx(zo,{appId:se||"graph-report-internal",title:t("graph.dataBody"),columns:uc,rows:Lr.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false}})})]})},XC=zo;var n0=({id:e,title:t,hideHeader:i=true,filterConfig:o,tableProps:n,children:r,spacing:a=1,mode:l="separated"})=>{let u=o?{...o,appId:o.appId||e}:void 0,s={...n,appId:n.appId||e};return jsxs(Ri,{title:t,hideHeader:i,children:[jsxs(Stack,{spacing:a,sx:{height:"100%",overflow:"hidden"},children:[l==="separated"&&u&&jsx(Box,{sx:{flexShrink:0},children:jsx(ca,{...u})}),jsx(Box,{sx:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:jsx(zo,{...s,fitContainer:true,filterConfig:l==="integrated"?u:void 0})})]}),r]})};var u0=({metadata:e,fetchData:t,initialRowsPerPage:i=20,rowsPerPageOptions:o=[20,50,100,-1]})=>{let{t:n}=U(),[r,a]=useState(false),[l,u]=useState([]),[s,c]=useState({}),[d,b]=useState(e.variants||[]),[p,h]=useState(e.layout||null),[y,S]=useState(0),[v,m]=useState(0),[x,w]=useState(i),[I,R]=useState([]),[A,P]=useState("asc"),[F,C]=useState("");useEffect(()=>{let O={};e.filters.forEach(V=>{V.defaultValue!==void 0&&(O[V.id]=V.defaultValue);}),c(O);},[e.filters]);let k=useCallback(async(O,V,N,ge,ve)=>{a(true);try{let Me={...O,page:V+1,limit:N,sort:ve,order:ge},Pe;t?Pe=await t(Me):typeof e.api=="function"?Pe=await e.api(Me):e.api&&typeof e.api=="object"?(console.log("Fetching from URL:",e.api.url,Me),Pe={rows:[],total:0}):(console.warn("No API configured for report"),Pe={rows:[],total:0}),Pe&&(u(Pe.rows||[]),S(Pe.total||0));}catch(Me){console.error("Failed to fetch report data",Me);}finally{a(false);}},[e.api,t]);useEffect(()=>{k(s,v,x,A,F);},[k,v,x,A,F]);let T=()=>{m(0),k(s,0,x,A,F);},f=O=>{m(0),w(O);},B=(O,V)=>{P(V),C(O);},E=O=>{c(O);},Z=O=>{if(O.filters){let V=O.filters.find(N=>N.scope==="default"||N.scope===e.id);V&&(c(V.filters),k(V.filters,0,x));}O.layout&&h(O.layout);},re=O=>{let V={...O,id:Date.now().toString(),createdAt:new Date().toISOString()};b(N=>[...N,V]);},le=O=>{h(O);};return {pageProps:{id:e.id,title:e.title,filterConfig:{appId:e.id,fields:e.filters,filters:s,onFilterChange:E,onSearch:T,onVariantLoad:Z,onVariantSave:re,onVariantDelete:O=>b(V=>V.filter(N=>N.id!==O)),onVariantSetDefault:O=>{b(V=>V.map(N=>({...N,isDefault:N.id===O})));},variants:d},tableProps:{appId:e.id,columns:e.columns,rows:l,loading:r,rowKey:"id",count:y,page:v,rowsPerPage:x,rowsPerPageOptions:o,onPageChange:m,onRowsPerPageChange:f,selectionMode:"multiple",selected:I,onSelectionChange:R,onLayoutSave:le,layout:p,title:e.title,showSummary:true,order:A,orderBy:F,onSortChange:B,graphReport:e.graphReport||{enabled:true,title:`${e.title} ${n("graph.reportTitle")}`}}},filters:s,rows:l,loading:r,refresh:T}};var d0=(e,t)=>{if(!e||!e.filters)return null;if(Array.isArray(e.filters)){let i=e.filters.find(n=>n.scope===t);if(i)return i.filters;let o=e.filters.find(n=>n.scope==="default");return o?o.filters:null}return typeof e.filters=="object"?e.filters:null},m0=(e,t)=>{if(!e)return {layout:null,layoutId:null};let i=null,o=null;if(Array.isArray(e.layoutRefs)){let n=e.layoutRefs.find(r=>r.tableKey===t);n&&(i=n.layoutId);}return !i&&e.layoutId&&(i=e.layoutId),e.layout&&typeof e.layout=="object"&&!Array.isArray(e.layout)&&(o=e.layout),{layoutId:i,layout:o}};var sm=e=>[...e].sort((t,i)=>i.value-t.value),h0=({bars:e=[],lines:t=[],combos:i=[],heatmap:o=[],pies:n=[],waterfalls:r=[]})=>{let a=useMemo(()=>sm(e),[e]),l=useMemo(()=>[...t],[t]),u=useMemo(()=>[...i],[i]),s=useMemo(()=>[...o],[o]),c=useMemo(()=>{let b=n.reduce((p,h)=>p+h.value,0);return n.map(p=>({...p,percent:b>0?p.value/b*100:p.percent}))},[n]),d=useMemo(()=>[...r],[r]);return {bars:a,lines:l,combos:u,heatmap:s,pies:c,waterfalls:d}};var C0=({apiKey:e,query:t,zoom:i=14,mapType:o="roadmap"})=>useMemo(()=>!e||!t?"":aa({apiKey:e,query:t,zoom:i,mapType:o}),[e,t,i,o]),S0=({keyword:e,location:t})=>useMemo(()=>Wa({keyword:e,location:t?{lng:t.lng,lat:t.lat,name:t.name}:void 0}),[e,t]);var ma=({code:e,language:t="text",copyable:i=true,showLineNumbers:o=false,wrapLongLines:n=false,maxHeight:r})=>{let[a,l]=useState(false),u=useMemo(()=>e.replace(/\n$/,"").split(`
|
|
4
|
-
`),[e]);return jsxs(Box,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1.5,overflow:"hidden",bgcolor:"background.paper"},children:[jsxs(Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:1,py:.6,bgcolor:"action.hover",borderBottom:"1px solid",borderColor:"divider"},children:[jsx(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}),
|
|
5
|
-
`).map(a=>a.trim()).filter(Boolean);if(t.length<2)return null;let
|
|
1
|
+
import {a}from'./chunk-74Z76O3S.mjs';export{b as COrbCanvas}from'./chunk-74Z76O3S.mjs';import*as je from'react';import je__default,{createContext,useMemo,useContext,useState,useEffect,useCallback,Fragment as Fragment$1,useRef}from'react';import {usePathname,useRouter}from'next/navigation';import {ChevronRight,Search,Plus,Mic,ThumbsDown,ThumbsUp,Volume2,RefreshCw,Copy,Terminal,Clock,X,ChevronDown,Box as Box$1,Lightbulb,AlertCircle,RotateCw,Check,Clipboard,CheckCircle,XCircle,Loader2,AlertTriangle,Info,BarChart,MapPin,Globe,TrendingDown,GitBranch,Grid as Grid$1,Activity,PieChart,LineChart}from'lucide-react';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {Slot}from'@radix-ui/react-slot';import {cva}from'class-variance-authority';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import Hl from'@mui/material/Dialog';import Wl from'@mui/material/DialogTitle';import Ul from'@mui/material/DialogContent';import Cu from'@mui/material/DialogContentText';import ql from'@mui/material/DialogActions';import Na from'@mui/material/Box';import wu from'@mui/icons-material/CheckCircle';import Tu from'@mui/icons-material/Warning';import Iu from'@mui/icons-material/Error';import Pu from'@mui/icons-material/Info';import {styled,Box,Typography,Paper,Stack,Link,Dialog,DialogTitle,IconButton,DialogContent,MenuItem,DialogActions,Button,Chip,InputBase,useTheme,Autocomplete,TextField,Tooltip,FormControlLabel,Checkbox,Menu,ListItemText,Divider,Collapse,Grid,ListItemIcon,CircularProgress,Alert,TableContainer,Table,TableHead,TableRow,TableCell,TableBody,Tabs,Tab,AppBar,Toolbar,InputAdornment,Avatar,createTheme,ThemeProvider,FormControl,Select,Switch,Portal,useMediaQuery,Popover,ListSubheader,Badge,TableFooter}from'@mui/material';import Rg from'@mui/material/Paper';import Dg from'@mui/material/Table';import Ag from'@mui/material/TableBody';import zn from'@mui/material/TableCell';import Zl from'@mui/material/TableContainer';import Ju from'@mui/material/TableHead';import ep from'@mui/material/TableRow';import _l from'@mui/material/TextField';import Mr from'@mui/material/Button';import Kl from'@mui/material/Alert';import {DndContext,closestCenter,useSensors,useSensor,PointerSensor,DragOverlay,useDroppable,useDraggable}from'@dnd-kit/core';import {restrictToHorizontalAxis}from'@dnd-kit/modifiers';import Pl from'@mui/icons-material/Search';import Vu from'@mui/icons-material/ViewColumn';import El from'@mui/icons-material/Save';import Gu from'@mui/icons-material/Download';import Hu from'@mui/icons-material/AccountTree';import Wu from'@mui/icons-material/Functions';import Uu from'@mui/icons-material/Insights';import qu from'@mui/icons-material/Add';import _u from'@mui/icons-material/Edit';import Ku from'@mui/icons-material/Delete';import Zu from'@mui/icons-material/KeyboardArrowLeft';import ju from'@mui/icons-material/KeyboardArrowRight';import tp from'@mui/material/Checkbox';import op from'@mui/material/TableSortLabel';import ap from'@mui/material/IconButton';import rp from'@mui/material/Tooltip';import np from'@mui/icons-material/UnfoldMore';import ip from'@mui/icons-material/UnfoldLess';import pp from'@mui/icons-material/KeyboardArrowDown';import Ip from'@mui/icons-material/Check';import Pp from'@mui/icons-material/ClearAll';import em from'@mui/icons-material/Close';import lm from'@mui/icons-material/MicNoneOutlined';import cm from'@mui/icons-material/SettingsOutlined';import dm from'@mui/icons-material/SendOutlined';import ig from'@mui/icons-material/Settings';import sg from'@mui/icons-material/KeyboardArrowUp';import cg from'@mui/icons-material/ArrowRightAlt';import Mm from'@mui/icons-material/Star';import {DateCalendar}from'@mui/x-date-pickers/DateCalendar';import {PickersDay}from'@mui/x-date-pickers/PickersDay';import {LocalizationProvider}from'@mui/x-date-pickers/LocalizationProvider';import {AdapterDayjs}from'@mui/x-date-pickers/AdapterDayjs';import _m from'@mui/icons-material/CalendarMonth';import Km from'@mui/icons-material/Clear';import Zm from'@mui/icons-material/ArrowForward';import Po from'dayjs';import jm from'dayjs/plugin/isBetween';import Qm from'dayjs/plugin/localizedFormat';import'dayjs/locale/zh-cn';import'dayjs/locale/fr';import'dayjs/locale/de';import'dayjs/locale/ja';import'dayjs/locale/ko';import Sg from'@mui/icons-material/StarBorder';import wg from'@mui/icons-material/ViewQuilt';import Kf from'@mui/icons-material/CloseOutlined';import _g from'@mui/icons-material/ContentCopyOutlined';import Kg from'@mui/icons-material/CheckOutlined';import Sf from'@mui/icons-material/ExpandMore';import hc from'@mui/icons-material/Language';import ah from'@mui/icons-material/DesktopWindows';import rh from'@mui/icons-material/DarkMode';import nh from'@mui/icons-material/LightMode';import sh from'@mui/icons-material/Logout';import xy from'@mui/icons-material/DeleteOutline';import {arrayMove,SortableContext,verticalListSortingStrategy,useSortable}from'@dnd-kit/sortable';import Ah from'@mui/icons-material/DragIndicator';import Kh from'@mui/icons-material/FilterList';import Zh from'@mui/icons-material/TableRows';import Eh from'@mui/icons-material/LayersClear';import Dy from'next/dynamic';import {AnimatePresence,motion}from'framer-motion';import Wb from'react-markdown';import Ub from'remark-gfm';import qb from'remark-math';import _b from'rehype-katex';import Kb from'rehype-raw';import {Prism}from'react-syntax-highlighter';import {oneDark,oneLight}from'react-syntax-highlighter/dist/esm/styles/prism';import {useTheme as useTheme$1}from'next-themes';import rd from'mermaid';import rx from'@mui/icons-material/MicRounded';import nx from'@mui/icons-material/MicOffRounded';import {InsertDriveFile,Close,Stop}from'@mui/icons-material';import dx from'@mui/icons-material/SendRounded';import ux from'@mui/icons-material/AddRounded';import px from'@mui/icons-material/HardwareRounded';function It(...e){return twMerge(clsx(e))}var Tn={primary:"#000000",primaryHover:"#333333"},er={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"},ba={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",full:"rounded-full"},us=()=>"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 jd=cva(us(),{variants:{variant:{default:`${er.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:`${er.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:er.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-[${Tn.primary}] hover:bg-[${Tn.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:ba.none,sm:ba.sm,md:ba.md,full:ba.full}},defaultVariants:{variant:"default",size:"default",rounded:"md"}}),In=je.forwardRef(({className:e,variant:t,size:r,asChild:o=false,...n},i)=>jsx(o?Slot:"button",{className:It(jd({variant:t,size:r,className:e})),ref:i,...n}));In.displayName="Button";var Xd={"common.cancel":"Cancel","common.save":"Save","common.ok":"OK","common.done":"Done","common.search":"Search","common.none":"None","common.all":"All","common.noData":"No data","common.copy":"Copy","common.delete":"Delete","common.loading":"Loading...","header.searchPlaceholder":"Ask me...","header.theme.system":"Theme: System","header.theme.dark":"Theme: Dark","header.theme.light":"Theme: Light","header.menu.setting":"Setting","header.menu.logout":"Logout","navigation.expand":"Expand navigation","navigation.collapse":"Collapse navigation","navigation.searchPlaceholder":"Search menu...","navigation.noMatch":"No matching menu items","navigation.noAccessibleApp":"No accessible applications","navigation.noItems":"No items to display","navigation.expandView":"Expand {title}","table.toolbar.searchPlaceholder":"Search...","table.title.default":"Data Table","table.toolbar.groupBy":"Group By","table.toolbar.summary":"Summary","table.toolbar.columns":"Columns","table.toolbar.export":"Export","table.toolbar.itemsPerPage":"Items per page:","table.toolbar.pageOf":"Page {current} of {total}","table.toolbar.newItem":"New Item","table.toolbar.editItem":"Edit Item","table.toolbar.deleteItem":"Delete Item","table.toolbar.graphicReport":"Graphic Report","table.toolbar.saveLayout":"Save Layout","table.menu.groupBy":"Group By","table.menu.clearAll":"Clear All","table.menu.visibleColumns":"Visible Columns","table.menu.showSummaryRow":"Show Summary Row","table.menu.noNumericColumns":"No numeric columns","table.group.expandAll":"Expand All Groups","table.group.collapseAll":"Collapse All Groups","table.mobile.notImplemented":"Mobile View Not Implemented","pivot.title.default":"Pivot Table Builder","pivot.subtitle.default":"Drag fields to configure the pivot table.","pivot.empty":"Drag at least one field into Values to render the pivot result.","pivot.records":"Records","pivot.afterFilter":"After filter","pivot.grandTotal":"Grand Total","pivot.resultLabel":"Result","pivot.valueLabel":"Value","pivot.table.dimensions":"Dimensions","pivot.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}","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","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"},Yd={"common.cancel":"\u53D6\u6D88","common.save":"\u4FDD\u5B58","common.ok":"\u786E\u5B9A","common.done":"\u5B8C\u6210","common.search":"\u641C\u7D22","common.none":"\u65E0","common.all":"\u5168\u90E8","common.noData":"\u6682\u65E0\u6570\u636E","common.copy":"\u590D\u5236","common.delete":"\u5220\u9664","common.loading":"\u52A0\u8F7D\u4E2D...","header.searchPlaceholder":"\u95EE\u6211\u70B9\u4EC0\u4E48...","header.theme.system":"\u4E3B\u9898\uFF1A\u8DDF\u968F\u7CFB\u7EDF","header.theme.dark":"\u4E3B\u9898\uFF1A\u6DF1\u8272","header.theme.light":"\u4E3B\u9898\uFF1A\u6D45\u8272","header.menu.setting":"\u8BBE\u7F6E","header.menu.logout":"\u6CE8\u9500","navigation.expand":"\u5C55\u5F00\u5BFC\u822A","navigation.collapse":"\u6298\u53E0\u5BFC\u822A","navigation.searchPlaceholder":"\u641C\u7D22\u83DC\u5355...","navigation.noMatch":"\u672A\u627E\u5230\u5339\u914D\u7684\u83DC\u5355\u9879","navigation.noAccessibleApp":"\u6682\u65E0\u53EF\u8BBF\u95EE\u7684\u5E94\u7528","navigation.noItems":"\u6682\u65E0\u53EF\u663E\u793A\u9879","navigation.expandView":"\u5C55\u5F00\u67E5\u770B {title}","table.toolbar.searchPlaceholder":"\u641C\u7D22...","table.title.default":"\u6570\u636E\u8868","table.toolbar.groupBy":"\u5206\u7EC4","table.toolbar.summary":"\u6C47\u603B","table.toolbar.columns":"\u5217","table.toolbar.export":"\u5BFC\u51FA","table.toolbar.itemsPerPage":"\u6BCF\u9875\u6761\u6570\uFF1A","table.toolbar.pageOf":"\u7B2C {current} / {total} \u9875","table.toolbar.newItem":"\u65B0\u5EFA\u6761\u76EE","table.toolbar.editItem":"\u7F16\u8F91\u6761\u76EE","table.toolbar.deleteItem":"\u5220\u9664\u6761\u76EE","table.toolbar.graphicReport":"\u56FE\u8868\u62A5\u8868","table.toolbar.saveLayout":"\u4FDD\u5B58\u5E03\u5C40","table.menu.groupBy":"\u5206\u7EC4","table.menu.clearAll":"\u6E05\u7A7A","table.menu.visibleColumns":"\u53EF\u89C1\u5217","table.menu.showSummaryRow":"\u663E\u793A\u6C47\u603B\u884C","table.menu.noNumericColumns":"\u6CA1\u6709\u6570\u503C\u5217","table.group.expandAll":"\u5C55\u5F00\u5168\u90E8\u5206\u7EC4","table.group.collapseAll":"\u6298\u53E0\u5168\u90E8\u5206\u7EC4","table.mobile.notImplemented":"\u79FB\u52A8\u7AEF\u89C6\u56FE\u6682\u672A\u5B9E\u73B0","pivot.title.default":"\u6570\u636E\u900F\u89C6\u8868","pivot.subtitle.default":"\u62D6\u62FD\u5B57\u6BB5\u4EE5\u914D\u7F6E\u900F\u89C6\u8868\u3002","pivot.empty":"\u8BF7\u81F3\u5C11\u62D6\u5165\u4E00\u4E2A\u503C\u5B57\u6BB5\u540E\u518D\u67E5\u770B\u900F\u89C6\u7ED3\u679C\u3002","pivot.records":"\u8BB0\u5F55\u6570","pivot.afterFilter":"\u7B5B\u9009\u540E","pivot.grandTotal":"\u603B\u8BA1","pivot.resultLabel":"\u7ED3\u679C","pivot.valueLabel":"\u503C","pivot.table.dimensions":"\u7EF4\u5EA6","pivot.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}","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","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"},Jd={"common.cancel":"Annuler","common.save":"Enregistrer","common.ok":"OK","common.done":"Terminer","common.search":"Rechercher","common.none":"Aucun","common.all":"Tout","common.noData":"Aucune donn\xE9e","common.copy":"Copier","common.delete":"Supprimer","common.loading":"Chargement...","header.searchPlaceholder":"Demandez-moi...","header.theme.system":"Th\xE8me : Syst\xE8me","header.theme.dark":"Th\xE8me : Sombre","header.theme.light":"Th\xE8me : Clair","header.menu.setting":"Param\xE8tres","header.menu.logout":"Se d\xE9connecter","navigation.expand":"D\xE9velopper la navigation","navigation.collapse":"R\xE9duire la navigation","navigation.searchPlaceholder":"Rechercher dans le menu...","navigation.noMatch":"Aucun \xE9l\xE9ment correspondant","navigation.noAccessibleApp":"Aucune application accessible","navigation.noItems":"Aucun \xE9l\xE9ment \xE0 afficher","navigation.expandView":"D\xE9velopper {title}","table.toolbar.searchPlaceholder":"Rechercher...","table.title.default":"Tableau de donn\xE9es","table.toolbar.groupBy":"Grouper","table.toolbar.summary":"R\xE9sum\xE9","table.toolbar.columns":"Colonnes","table.toolbar.export":"Exporter","table.toolbar.itemsPerPage":"Lignes par page :","table.toolbar.pageOf":"Page {current} sur {total}","table.toolbar.newItem":"Nouvel \xE9l\xE9ment","table.toolbar.editItem":"Modifier l'\xE9l\xE9ment","table.toolbar.deleteItem":"Supprimer l'\xE9l\xE9ment","table.toolbar.graphicReport":"Rapport graphique","table.toolbar.saveLayout":"Enregistrer la vue","table.menu.groupBy":"Grouper","table.menu.clearAll":"Tout effacer","table.menu.visibleColumns":"Colonnes visibles","table.menu.showSummaryRow":"Afficher la ligne de r\xE9sum\xE9","table.menu.noNumericColumns":"Aucune colonne num\xE9rique","table.group.expandAll":"D\xE9velopper tous les groupes","table.group.collapseAll":"R\xE9duire tous les groupes","table.mobile.notImplemented":"Vue mobile non impl\xE9ment\xE9e","pivot.title.default":"Tableau crois\xE9 dynamique","pivot.subtitle.default":"Faites glisser les champs pour configurer le tableau crois\xE9.","pivot.empty":"Ajoutez au moins un champ de valeur pour afficher le r\xE9sultat.","pivot.records":"Enregistrements","pivot.afterFilter":"Apr\xE8s filtre","pivot.grandTotal":"Total g\xE9n\xE9ral","pivot.resultLabel":"R\xE9sultat","pivot.valueLabel":"Valeur","pivot.table.dimensions":"Dimensions","pivot.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}","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","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"},eu={"common.cancel":"Abbrechen","common.save":"Speichern","common.ok":"OK","common.done":"Fertig","common.search":"Suchen","common.none":"Keine","common.all":"Alle","common.noData":"Keine Daten","common.copy":"Kopieren","common.delete":"L\xF6schen","common.loading":"Wird geladen...","header.searchPlaceholder":"Frag mich...","header.theme.system":"Theme: System","header.theme.dark":"Theme: Dunkel","header.theme.light":"Theme: Hell","header.menu.setting":"Einstellungen","header.menu.logout":"Abmelden","navigation.expand":"Navigation erweitern","navigation.collapse":"Navigation einklappen","navigation.searchPlaceholder":"Men\xFC suchen...","navigation.noMatch":"Keine passenden Men\xFCeintr\xE4ge","navigation.noAccessibleApp":"Keine verf\xFCgbaren Anwendungen","navigation.noItems":"Keine Eintr\xE4ge vorhanden","navigation.expandView":"{title} aufklappen","table.toolbar.searchPlaceholder":"Suchen...","table.title.default":"Datentabelle","table.toolbar.groupBy":"Gruppieren","table.toolbar.summary":"Zusammenfassung","table.toolbar.columns":"Spalten","table.toolbar.export":"Export","table.toolbar.itemsPerPage":"Zeilen pro Seite:","table.toolbar.pageOf":"Seite {current} von {total}","table.toolbar.newItem":"Neuer Eintrag","table.toolbar.editItem":"Eintrag bearbeiten","table.toolbar.deleteItem":"Eintrag l\xF6schen","table.toolbar.graphicReport":"Grafikbericht","table.toolbar.saveLayout":"Layout speichern","table.menu.groupBy":"Gruppieren","table.menu.clearAll":"Alles l\xF6schen","table.menu.visibleColumns":"Sichtbare Spalten","table.menu.showSummaryRow":"Summenzeile anzeigen","table.menu.noNumericColumns":"Keine numerischen Spalten","table.group.expandAll":"Alle Gruppen aufklappen","table.group.collapseAll":"Alle Gruppen zuklappen","table.mobile.notImplemented":"Mobile Ansicht nicht implementiert","pivot.title.default":"Pivot-Tabelle","pivot.subtitle.default":"Ziehen Sie Felder, um die Pivot-Tabelle zu konfigurieren.","pivot.empty":"Ziehen Sie mindestens ein Wertefeld, um das Ergebnis anzuzeigen.","pivot.records":"Datens\xE4tze","pivot.afterFilter":"Nach Filter","pivot.grandTotal":"Gesamtsumme","pivot.resultLabel":"Ergebnis","pivot.valueLabel":"Wert","pivot.table.dimensions":"Dimensionen","pivot.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}","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","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"},tu={"common.cancel":"\u30AD\u30E3\u30F3\u30BB\u30EB","common.save":"\u4FDD\u5B58","common.ok":"OK","common.done":"\u5B8C\u4E86","common.search":"\u691C\u7D22","common.none":"\u306A\u3057","common.all":"\u3059\u3079\u3066","common.noData":"\u30C7\u30FC\u30BF\u306A\u3057","common.copy":"\u30B3\u30D4\u30FC","common.delete":"\u524A\u9664","common.loading":"\u8AAD\u307F\u8FBC\u307F\u4E2D...","header.searchPlaceholder":"\u4F55\u304B\u805E\u3044\u3066\u304F\u3060\u3055\u3044...","header.theme.system":"\u30C6\u30FC\u30DE\uFF1A\u30B7\u30B9\u30C6\u30E0","header.theme.dark":"\u30C6\u30FC\u30DE\uFF1A\u30C0\u30FC\u30AF","header.theme.light":"\u30C6\u30FC\u30DE\uFF1A\u30E9\u30A4\u30C8","header.menu.setting":"\u8A2D\u5B9A","header.menu.logout":"\u30ED\u30B0\u30A2\u30A6\u30C8","navigation.expand":"\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u3092\u5C55\u958B","navigation.collapse":"\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u3092\u6298\u308A\u305F\u305F\u3080","navigation.searchPlaceholder":"\u30E1\u30CB\u30E5\u30FC\u3092\u691C\u7D22...","navigation.noMatch":"\u4E00\u81F4\u3059\u308B\u30E1\u30CB\u30E5\u30FC\u304C\u3042\u308A\u307E\u305B\u3093","navigation.noAccessibleApp":"\u30A2\u30AF\u30BB\u30B9\u53EF\u80FD\u306A\u30A2\u30D7\u30EA\u304C\u3042\u308A\u307E\u305B\u3093","navigation.noItems":"\u8868\u793A\u3067\u304D\u308B\u9805\u76EE\u304C\u3042\u308A\u307E\u305B\u3093","navigation.expandView":"{title} \u3092\u5C55\u958B","table.toolbar.searchPlaceholder":"\u691C\u7D22...","table.title.default":"\u30C7\u30FC\u30BF\u30C6\u30FC\u30D6\u30EB","table.toolbar.groupBy":"\u30B0\u30EB\u30FC\u30D7\u5316","table.toolbar.summary":"\u96C6\u8A08","table.toolbar.columns":"\u5217","table.toolbar.export":"\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8","table.toolbar.itemsPerPage":"1\u30DA\u30FC\u30B8\u306E\u4EF6\u6570\uFF1A","table.toolbar.pageOf":"{current} / {total} \u30DA\u30FC\u30B8","table.toolbar.newItem":"\u65B0\u898F\u4F5C\u6210","table.toolbar.editItem":"\u7DE8\u96C6","table.toolbar.deleteItem":"\u524A\u9664","table.toolbar.graphicReport":"\u30B0\u30E9\u30D5\u30A3\u30C3\u30AF\u30EC\u30DD\u30FC\u30C8","table.toolbar.saveLayout":"\u30EC\u30A4\u30A2\u30A6\u30C8\u4FDD\u5B58","table.menu.groupBy":"\u30B0\u30EB\u30FC\u30D7\u5316","table.menu.clearAll":"\u3059\u3079\u3066\u30AF\u30EA\u30A2","table.menu.visibleColumns":"\u8868\u793A\u5217","table.menu.showSummaryRow":"\u96C6\u8A08\u884C\u3092\u8868\u793A","table.menu.noNumericColumns":"\u6570\u5024\u5217\u304C\u3042\u308A\u307E\u305B\u3093","table.group.expandAll":"\u3059\u3079\u3066\u306E\u30B0\u30EB\u30FC\u30D7\u3092\u5C55\u958B","table.group.collapseAll":"\u3059\u3079\u3066\u306E\u30B0\u30EB\u30FC\u30D7\u3092\u6298\u308A\u305F\u305F\u3080","table.mobile.notImplemented":"\u30E2\u30D0\u30A4\u30EB\u8868\u793A\u306F\u672A\u5B9F\u88C5\u3067\u3059","pivot.title.default":"\u30D4\u30DC\u30C3\u30C8\u30C6\u30FC\u30D6\u30EB","pivot.subtitle.default":"\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u30D4\u30DC\u30C3\u30C8\u30C6\u30FC\u30D6\u30EB\u3092\u8A2D\u5B9A\u3057\u307E\u3059\u3002","pivot.empty":"\u7D50\u679C\u3092\u8868\u793A\u3059\u308B\u306B\u306F\u3001\u5024\u30A8\u30EA\u30A2\u306B\u5C11\u306A\u304F\u3068\u30821\u3064\u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","pivot.records":"\u30EC\u30B3\u30FC\u30C9","pivot.afterFilter":"\u30D5\u30A3\u30EB\u30BF\u30FC\u5F8C","pivot.grandTotal":"\u7DCF\u8A08","pivot.resultLabel":"\u7D50\u679C","pivot.valueLabel":"\u5024","pivot.table.dimensions":"\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3","pivot.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}","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","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"},ou={"common.cancel":"\uCDE8\uC18C","common.save":"\uC800\uC7A5","common.ok":"\uD655\uC778","common.done":"\uC644\uB8CC","common.search":"\uAC80\uC0C9","common.none":"\uC5C6\uC74C","common.all":"\uC804\uCCB4","common.noData":"\uB370\uC774\uD130 \uC5C6\uC74C","common.copy":"\uBCF5\uC0AC","common.delete":"\uC0AD\uC81C","common.loading":"\uB85C\uB529 \uC911...","header.searchPlaceholder":"\uBB34\uC5C7\uC774\uB4E0 \uBB3C\uC5B4\uBCF4\uC138\uC694...","header.theme.system":"\uD14C\uB9C8: \uC2DC\uC2A4\uD15C","header.theme.dark":"\uD14C\uB9C8: \uB2E4\uD06C","header.theme.light":"\uD14C\uB9C8: \uB77C\uC774\uD2B8","header.menu.setting":"\uC124\uC815","header.menu.logout":"\uB85C\uADF8\uC544\uC6C3","navigation.expand":"\uD0D0\uC0C9 \uD3BC\uCE58\uAE30","navigation.collapse":"\uD0D0\uC0C9 \uC811\uAE30","navigation.searchPlaceholder":"\uBA54\uB274 \uAC80\uC0C9...","navigation.noMatch":"\uC77C\uCE58\uD558\uB294 \uBA54\uB274\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4","navigation.noAccessibleApp":"\uC811\uADFC \uAC00\uB2A5\uD55C \uC571\uC774 \uC5C6\uC2B5\uB2C8\uB2E4","navigation.noItems":"\uD45C\uC2DC\uD560 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4","navigation.expandView":"{title} \uD3BC\uCE58\uAE30","table.toolbar.searchPlaceholder":"\uAC80\uC0C9...","table.title.default":"\uB370\uC774\uD130 \uD14C\uC774\uBE14","table.toolbar.groupBy":"\uADF8\uB8F9","table.toolbar.summary":"\uC694\uC57D","table.toolbar.columns":"\uC5F4","table.toolbar.export":"\uB0B4\uBCF4\uB0B4\uAE30","table.toolbar.itemsPerPage":"\uD398\uC774\uC9C0\uB2F9 \uD589 \uC218:","table.toolbar.pageOf":"{current} / {total} \uD398\uC774\uC9C0","table.toolbar.newItem":"\uC2E0\uADDC \uD56D\uBAA9","table.toolbar.editItem":"\uD56D\uBAA9 \uC218\uC815","table.toolbar.deleteItem":"\uD56D\uBAA9 \uC0AD\uC81C","table.toolbar.graphicReport":"\uADF8\uB798\uD504 \uB9AC\uD3EC\uD2B8","table.toolbar.saveLayout":"\uB808\uC774\uC544\uC6C3 \uC800\uC7A5","table.menu.groupBy":"\uADF8\uB8F9","table.menu.clearAll":"\uBAA8\uB450 \uC9C0\uC6B0\uAE30","table.menu.visibleColumns":"\uD45C\uC2DC \uC5F4","table.menu.showSummaryRow":"\uC694\uC57D \uD589 \uD45C\uC2DC","table.menu.noNumericColumns":"\uC22B\uC790 \uC5F4 \uC5C6\uC74C","table.group.expandAll":"\uBAA8\uB4E0 \uADF8\uB8F9 \uD3BC\uCE58\uAE30","table.group.collapseAll":"\uBAA8\uB4E0 \uADF8\uB8F9 \uC811\uAE30","table.mobile.notImplemented":"\uBAA8\uBC14\uC77C \uBDF0\uB294 \uC544\uC9C1 \uAD6C\uD604\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4","pivot.title.default":"\uD53C\uBC97 \uD14C\uC774\uBE14","pivot.subtitle.default":"\uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uD53C\uBC97 \uD14C\uC774\uBE14\uC744 \uAD6C\uC131\uD558\uC138\uC694.","pivot.empty":"\uACB0\uACFC\uB97C \uBCF4\uB824\uBA74 \uAC12 \uC601\uC5ED\uC5D0 \uCD5C\uC18C \uD55C \uAC1C\uC758 \uD544\uB4DC\uB97C \uCD94\uAC00\uD558\uC138\uC694.","pivot.records":"\uB808\uCF54\uB4DC","pivot.afterFilter":"\uD544\uD130 \uD6C4","pivot.grandTotal":"\uCD1D\uD569","pivot.resultLabel":"\uACB0\uACFC","pivot.valueLabel":"\uAC12","pivot.table.dimensions":"\uCC28\uC6D0","pivot.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}","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","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"},xa={en:Xd,zh:Yd,fr:Jd,de:eu,ja:tu,ko:ou};var ms=(e,t)=>t?e.replace(/\{(\w+)\}/g,(r,o)=>{let n=t[o];return n==null?"":String(n)}):e,iu={locale:"en",t:(e,t)=>ms(xa.en[e]||e,t)},gs=createContext(iu),fs=({locale:e="en",messages:t,children:r})=>{let o=useMemo(()=>{let n=xa[e]||xa.en,i=t?.[e]||{},a={...xa.en,...n,...i};return {locale:e,t:(s,u)=>ms(a[s]||s,u)}},[e,t]);return jsx(gs.Provider,{value:o,children:r})},q=()=>useContext(gs);function Rn({items:e,onItemClick:t,className:r="",level:o=0,expandedIds:n,onToggleExpand:i,colorMode:a="light"}){let{t:s}=q(),u=a==="dark",c=usePathname(),[l,p]=useState(false),[m,d]=useState(new Set),g=n!==void 0&&i!==void 0,h=g?n:m;useEffect(()=>{p(true);},[]);let k=f=>{if(g)i(f);else {let v=new Set(m);v.has(f)?v.delete(f):v.add(f),d(v);}},C=f=>{f.children&&f.children.length>0&&k(f.id),t&&t(f);};return !e||!Array.isArray(e)?jsx("div",{className:It("tree-menu",r),children:jsx("div",{className:"text-sm text-gray-500 p-2",children:s("navigation.noItems")})}):jsx("div",{className:It("tree-menu",r),children:e.map(f=>{let v=h.has(f.id)||f.isExpanded,y=f.children&&f.children.length>0,S=f.appurl||f.href,R=l&&S?c===S:false;return jsxs("div",{className:"tree-menu-item relative",children:[R&&jsx("div",{className:It("absolute left-0 top-2 bottom-2 w-[3px] rounded-r-full z-10",u?"bg-[#90caf9]":"bg-[#1976d2]")}),jsxs(In,{variant:"ghost",className:It("w-full justify-start gap-2 h-auto py-2 relative overflow-hidden group",`ml-${o*4}`,R?u?"bg-transparent text-[#90caf9] hover:bg-gray-800/35":"bg-transparent text-[#1976d2] hover:bg-gray-100/60":u?"hover:bg-gray-800/50 text-gray-300":"hover:bg-gray-100/50 text-gray-700"),onClick:()=>C(f),children:[y&&jsx("div",{className:It("flex-shrink-0 transition-transform duration-200",v&&"rotate-90",R?u?"text-[#90caf9]":"text-[#1976d2]":u?"text-gray-500 group-hover:text-gray-300":"text-gray-400 group-hover:text-gray-600"),children:jsx(ChevronRight,{className:"h-4 w-4"})}),!y&&jsx("div",{className:"w-4 h-4 flex-shrink-0"}),f.icon&&jsx("div",{className:It("flex-shrink-0 transition-colors duration-200",R?u?"text-[#90caf9]":"text-[#1976d2]":u?"text-gray-500 group-hover:text-gray-300":"text-gray-400 group-hover:text-gray-600"),children:f.icon}),jsxs("div",{className:"flex-1 text-left overflow-hidden z-10",children:[jsx("div",{className:It("text-sm truncate transition-colors duration-200",R?"font-semibold":"font-medium"),children:f.title||f.label}),f.description&&jsx("div",{className:It("text-xs truncate transition-colors duration-200",R?u?"text-[#90caf9]/70":"text-[#1976d2]/75":u?"text-gray-400":"text-gray-500"),title:f.description,children:f.description})]})]}),y&&jsx("div",{className:It("grid transition-[grid-template-rows] duration-300 ease-in-out",v?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:jsx("div",{className:"overflow-hidden",children:jsx(Rn,{items:f.children,onItemClick:t,level:o+1,expandedIds:n,onToggleExpand:i,colorMode:a})})})]},f.id)})})}var Cs=({collapsed:e,onToggle:t,className:r="",maxHeight:o,menuData:n=[],colorMode:i="light"})=>{let{t:a}=q(),s=i==="dark",u=useRouter(),[c,l]=useState(""),[p,m]=useState(new Set);useEffect(()=>{e&&m(new Set);},[e]);let d=useCallback(C=>{let f=[],v=y=>{y.forEach(S=>{f.push(S.id),S.children&&v(S.children);});};return v(C),f},[]),g=useMemo(()=>{if(!c.trim())return n;let C=f=>f.reduce((v,y)=>{let S=y.title?.toLowerCase().includes(c.toLowerCase())||y.description?.toLowerCase().includes(c.toLowerCase()),R=y.children?C(y.children):[];return (S||R.length>0)&&v.push({...y,children:R.length>0?R:y.children}),v},[]);return C(n)},[c,n]),h=useMemo(()=>c.trim()?new Set(d(n)):p,[c,n,p,d]),k=useCallback(async C=>{if(console.log("\u{1F5B1}\uFE0F \u5BFC\u822A\u83DC\u5355\u9879\u70B9\u51FB:",C),C.id==="chat"||C.appurl==="/chat"){console.log("\u{1F4AC} \u68C0\u6D4B\u5230chat\u83DC\u5355\u70B9\u51FB\uFF0C\u8DF3\u8F6C\u5230\u65B0\u7684\u804A\u5929\u89C6\u56FE");try{u.push("/chat?new=true");}catch(v){console.error("\u274C \u65E0\u6CD5\u8DF3\u8F6C\u5230\u65B0\u804A\u5929\u89C6\u56FE:",v),u.push("/chat");}return}let f=C.appurl||C.href;f&&(f.startsWith("http://")||f.startsWith("https://")?window.open(f,"_blank"):u.push(f));},[u]);return 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 ${r} ${s?"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:o?`${o}px`:void 0},children:[jsx("div",{className:`pt-4 pb-2 transition-all duration-500 ease-in-out ${e?"px-1":"px-2"}`,children:e?jsx("div",{className:"flex justify-center",children:jsx("button",{onClick:t,className:`w-10 h-10 flex items-center justify-center rounded-lg transition-colors duration-200 ${s?"text-gray-300 hover:bg-gray-800":"text-gray-500 hover:bg-gray-50"}`,title:a("navigation.expand"),children:jsx(Search,{className:"h-5 w-5"})})}):jsxs("div",{className:`relative transition-opacity duration-300 ${e?"opacity-0":"opacity-100 delay-200"}`,children:[jsx("input",{type:"text",placeholder:a("navigation.searchPlaceholder"),value:c,onChange:C=>l(C.target.value),className:`w-full pl-10 pr-4 py-2 text-sm border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent ${s?"border-gray-700 bg-[#1A1A1A] text-white placeholder-gray-400":"border-gray-300 bg-white text-gray-900 placeholder-gray-500"}`}),jsx("div",{className:"absolute left-3 top-1/2 transform -translate-y-1/2 pointer-events-none",children:jsx(Search,{className:`h-4 w-4 ${s?"text-gray-500":"text-gray-400"}`})})]})}),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:g.length===0?jsx("div",{className:"flex items-center justify-center py-8 text-gray-500 text-sm",children:e?"\u{1F4C2}":a(c?"navigation.noMatch":"navigation.noAccessibleApp")}):jsxs(Fragment,{children:[!e&&jsx("div",{className:`transition-opacity duration-300 ${e?"opacity-0":"opacity-100 delay-200"}`,children:jsx(Rn,{items:g,onItemClick:k,className:"space-y-1",expandedIds:h,colorMode:i,onToggleExpand:C=>{let f=new Set(p);g.some(y=>y.id===C)?f.has(C)?f.delete(C):(g.forEach(y=>{y.id!==C&&f.has(y.id)&&f.delete(y.id);}),f.add(C)):f.has(C)?f.delete(C):f.add(C),m(f);}})}),e&&jsx("div",{className:"space-y-2",children:n.map(C=>jsx("div",{className:"space-y-1",children:jsx("button",{onClick:()=>{t();let f=new Set([C.id]);m(f);},className:`w-full flex items-center justify-center p-2 rounded-lg cursor-pointer transition-colors duration-200 ${s?"text-gray-400 hover:bg-gray-800":"text-gray-600 hover:bg-gray-50"}`,title:a("navigation.expandView",{title:C.title||""}),children:C.icon||jsx("div",{className:`w-6 h-6 rounded text-xs flex items-center justify-center font-medium ${s?"bg-[#90caf9] text-[#0b0b0b]":"bg-[#1976d2] text-white"}`,children:C.title?.charAt(0)||"?"})})},C.id))})]})}),!e&&jsx("button",{onClick:t,className:`absolute -bottom-1 -right-1 w-6 h-6 bg-transparent rounded-full flex items-center justify-center transition-all duration-300 ease-in-out z-20 ${s?"hover:bg-gray-800/50":"hover:bg-white/20"}`,title:a("navigation.collapse"),children:jsx("div",{className:"absolute",style:{bottom:"0px",right:"0px",width:"16px",height:"16px",overflow:"hidden"},children:jsx("div",{className:s?"border-yellow-400":"",style:{width:"32px",height:"32px",borderRadius:"16px",border:"3px solid #21BCFF",backgroundColor:"transparent",position:"absolute",top:"-16px",left:"-16px"}})})})]})};var Ss=(e={})=>{let{initialCollapsed:t=false,content:r=[]}=e,[o,n]=useState(t),[i,a]=useState(r),s=useCallback(()=>{n(c=>!c);},[]),u=useMemo(()=>({collapsed:o,onToggle:s,menuData:i}),[o,s,i]);return {collapsed:o,setCollapsed:n,toggleCollapsed:s,menuData:i,setMenuData:a,navigationIslandProps:u}};var An=e=>jsx(Button,{...e,variant:e.variant||"contained",size:e.size||"medium",sx:{textTransform:"none",...e.sx}});var Mn=class{constructor(){a(this,"listener",null);}register(t){this.listener=t;}unregister(){this.listener=null;}show(t,r,o){this.listener&&this.listener({type:t,content:r,options:o});}hide(){this.listener&&this.listener(null);}},qt=new Mn,yv={success:(e,t)=>qt.show("success",e,t),error:(e,t)=>qt.show("error",e,t),warning:(e,t)=>qt.show("warning",e,t),info:(e,t)=>qt.show("info",e,t),show:(e,t,r)=>qt.show(e,t,r),hide:()=>qt.hide()};var Ru={success:{icon:jsx(wu,{sx:{fontSize:40}}),color:"#e8f5e9",iconColor:"#66bb6a",borderColor:"#a5d6a7"},warning:{icon:jsx(Tu,{sx:{fontSize:40}}),color:"#fff3e0",iconColor:"#ffa726",borderColor:"#ffcc80"},error:{icon:jsx(Iu,{sx:{fontSize:40}}),color:"#ffebee",iconColor:"#ef5350",borderColor:"#ef9a9a"},info:{icon:jsx(Pu,{sx:{fontSize:40}}),color:"#e3f2fd",iconColor:"#42a5f5",borderColor:"#90caf9"},default:{icon:null,color:"transparent",iconColor:"inherit",borderColor:"transparent"}},Bn=({open:e,title:t,message:r,onClose:o,onConfirm:n,confirmText:i,cancelText:a,showCancel:s=true,maxWidth:u="xs",type:c="default"})=>{let{t:l}=q(),p=i||l("messageBox.confirm"),m=a||l("messageBox.cancel"),d=()=>{n?n():o();},g=Ru[c],h=c!=="default";return jsxs(Hl,{open:e,onClose:o,maxWidth:u,fullWidth:true,PaperProps:{sx:{borderRadius:3,...h&&{borderTop:`6px solid ${g.iconColor}`}}},children:[h&&jsx(Na,{sx:{display:"flex",justifyContent:"center",pt:3,color:g.iconColor},children:g.icon}),t&&jsx(Wl,{sx:{textAlign:h?"center":"left",pt:h?1:2},children:t}),jsx(Ul,{sx:{textAlign:h?"center":"left"},children:typeof r=="string"?jsx(Cu,{children:r}):r}),jsxs(ql,{sx:{justifyContent:h?"center":"flex-end",pb:3,px:3},children:[s&&jsx(An,{onClick:o,variant:"text",color:"inherit",children:m}),jsx(An,{onClick:d,variant:"contained",sx:{bgcolor:h?g.iconColor:void 0,"&:hover":{bgcolor:h?g.iconColor:void 0,filter:"brightness(0.9)"}},autoFocus:true,children:p})]})]})},Lv=()=>{let[e,t]=je__default.useState(null),[r,o]=je__default.useState(false);je__default.useEffect(()=>{let a=s=>{s?(t(s),o(true)):(o(false),t(null));};return qt.register(a),()=>qt.unregister()},[]);let n=()=>{o(false),e?.options?.onClose&&e.options.onClose(),t(null);},i=()=>{e?.options?.onConfirm&&e.options.onConfirm(),o(false),t(null);};return e?jsx(Bn,{open:r,type:e.type,message:e.content,title:e.options?.title,onClose:n,onConfirm:i,confirmText:e.options?.confirmText,cancelText:e.options?.cancelText,showCancel:e.options?.showCancel,maxWidth:e.options?.maxWidth}):null};var Ts=({title:e,hideHeader:t,children:r})=>jsxs(Box,{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[!t&&jsx(Box,{sx:{mb:2},children:jsx(Typography,{variant:"h4",children:e})}),jsx(Box,{sx:{flex:1,overflow:"hidden"},children:r})]});var Ps=e=>{let{t}=q(),r="0.85rem",o=Array.isArray(e.actions)?e.actions:e.actions?[e.actions]:[],n=Array.isArray(e.extraTools)?e.extraTools:e.extraTools?[e.extraTools]:[],i=[...o,...n],a=typeof e.rowsPerPage=="number"?e.rowsPerPage:20,s=Array.isArray(e.rowsPerPageOptions)&&e.rowsPerPageOptions.length>0?e.rowsPerPageOptions:[20,50,100,-1],u=typeof e.count=="number"?e.count:0,c=Math.max(0,typeof e.page=="number"?e.page:0),l=a===-1?1:Math.max(1,Math.ceil(u/a)),p=Math.min(c+1,l),m=c>0,d=c<l-1&&a!==-1;return jsxs(Toolbar,{sx:{pl:{sm:2},pr:{xs:1,sm:1},alignItems:"center",gap:1},children:[jsx(TextField,{size:"small",placeholder:t("table.toolbar.searchPlaceholder"),value:e.filterText,onChange:g=>e.setFilterText(g.target.value),InputProps:{sx:{fontSize:r,"& .MuiInputBase-input":{fontSize:r},"& .MuiInputBase-input::placeholder":{fontSize:r,opacity:1}},startAdornment:jsx(InputAdornment,{position:"start",children:jsx(Pl,{fontSize:"small"})})},sx:{width:300}}),jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1,ml:1},children:[jsx(Typography,{sx:{fontSize:r,color:"text.secondary",whiteSpace:"nowrap"},children:t("table.toolbar.itemsPerPage")}),jsx(Select,{size:"small",variant:"standard",value:a,disableUnderline:true,onChange:g=>e.onRowsPerPageChange?.(Number(g.target.value)),sx:{fontSize:r,fontWeight:600,minWidth:64,"& .MuiSelect-select":{py:.25,pr:"16px !important"}},children:s.map(g=>jsx(MenuItem,{value:g,sx:{fontSize:r},children:g===-1?t("common.all"):g},`rows-per-page-${g}`))}),jsx(IconButton,{size:"small",onClick:()=>e.onPageChange?.(Math.max(c-1,0)),disabled:!m,sx:{p:.35},children:jsx(Zu,{fontSize:"small"})}),jsx(Typography,{sx:{fontSize:r,fontWeight:600,minWidth:88,textAlign:"center"},children:t("table.toolbar.pageOf",{current:p,total:l})}),jsx(IconButton,{size:"small",onClick:()=>e.onPageChange?.(Math.min(c+1,l-1)),disabled:!d,sx:{p:.35},children:jsx(ju,{fontSize:"small"})})]}),jsx(Box,{sx:{flex:1}}),jsxs(Box,{sx:{display:"flex",gap:1,alignItems:"center"},children:[i.length>0&&jsx(Box,{sx:{display:"flex",gap:1,alignItems:"center"},children:i.map((g,h)=>jsx(je__default.Fragment,{children:g},`toolbar-custom-${h}`))}),jsx(Box,{sx:{width:"1px",height:20,bgcolor:"divider",mx:.5}}),jsx(Tooltip,{title:t("table.toolbar.groupBy"),children:jsx(IconButton,{onClick:g=>e.setGroupAnchorEl(g.currentTarget),children:jsx(Badge,{badgeContent:e.grouping?.length,color:"primary",children:jsx(Hu,{})})})}),jsx(Tooltip,{title:t("table.toolbar.summary"),children:jsx(IconButton,{onClick:g=>e.setSummaryAnchorEl(g.currentTarget),color:e.showSummary?"primary":"default",children:jsx(Wu,{})})}),jsx(Tooltip,{title:t("table.toolbar.columns"),children:jsx(IconButton,{onClick:g=>e.setAnchorEl(g.currentTarget),children:jsx(Vu,{})})}),jsx(Tooltip,{title:t("table.toolbar.export"),children:jsx(IconButton,{onClick:e.handleExport,children:jsx(Gu,{})})}),e.showCreateButton&&jsx(Tooltip,{title:t("table.toolbar.newItem"),children:jsx(IconButton,{onClick:e.onOpenCreateDialog,color:"primary",children:jsx(qu,{})})}),e.showEditButton&&jsx(Tooltip,{title:t("table.toolbar.editItem"),children:jsx("span",{children:jsx(IconButton,{onClick:e.onOpenEditDialog,color:"primary",disabled:!!e.editDisabled,children:jsx(_u,{})})})}),e.showDeleteButton&&jsx(Tooltip,{title:t("table.toolbar.deleteItem"),children:jsx("span",{children:jsx(IconButton,{onClick:e.onOpenDeleteConfirm,color:"error",disabled:!!e.deleteDisabled,children:jsx(Ku,{})})})}),e.onOpenGraphReport&&jsx(Tooltip,{title:t("table.toolbar.graphicReport"),children:jsx(IconButton,{onClick:e.onOpenGraphReport,children:jsx(Uu,{})})}),e.onLayoutSave&&!e.layoutManager&&jsx(Tooltip,{title:t("table.toolbar.saveLayout"),children:jsx(IconButton,{onClick:g=>e.onLayoutSave(g),children:jsx(El,{})})}),e.layoutManager]})]})};var As=e=>{let{t}=q(),{onSelectAllClick:r,order:o,orderBy:n,numSelected:i=0,rowCount:a=0,onRequestSort:s,columns:u,visibleColumns:c,selectionMode:l,grouping:p=[],isAllExpanded:m=false,handleToggleAll:d,onColumnResize:g,columnWidths:h}=e,[k,C]=useState(null),f=useRef(null),v=I=>P=>{k||s(I);},y=(I,P,b)=>{I.preventDefault(),I.stopPropagation(),C(P),f.current={startX:I.clientX,startWidth:b,colId:P},document.addEventListener("mousemove",S),document.addEventListener("mouseup",R),document.body.style.cursor="col-resize";},S=I=>{if(!f.current)return;let{startX:P,startWidth:b,colId:L}=f.current,D=I.clientX-P,U=Math.max(50,b+D);g&&g(L,U);},R=()=>{C(null),f.current=null,document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",R),document.body.style.cursor="";};useEffect(()=>()=>{document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",R);},[]);let A=l==="multiple"||l==="single",T=p.length>0&&!!d,F=t(m?"table.group.collapseAll":"table.group.expandAll"),w=u.filter(I=>c.includes(I.id));return jsx(Ju,{children:jsxs(ep,{children:[A&&jsx(zn,{padding:"checkbox",sx:I=>({width:48,position:"sticky",top:0,zIndex:4,backgroundColor:I.palette.mode==="dark"?"#000000":"#f5f5f5",color:I.palette.mode==="dark"?"#ffffff":I.palette.text.primary}),children:jsx(tp,{color:"primary",indeterminate:i>0&&i<a,checked:a>0&&i===a,onChange:r,disabled:l==="single"})}),T&&jsx(zn,{align:"center",padding:"checkbox",sx:I=>({width:44,position:"sticky",top:0,zIndex:4,backgroundColor:I.palette.mode==="dark"?"#000000":"#f5f5f5",color:I.palette.mode==="dark"?"#ffffff":I.palette.text.primary}),children:jsx(rp,{title:F,children:jsx(ap,{size:"small",onClick:I=>{I.stopPropagation(),d?.(!m);},sx:{p:.2},children:m?jsx(ip,{fontSize:"small"}):jsx(np,{fontSize:"small"})})})}),w.map(I=>{let P=h?.[I.id]||I.minWidth||100;return jsxs(zn,{align:"left",padding:I.disablePadding?"none":"normal",sortDirection:n===I.id?o:false,style:{width:P,minWidth:P,maxWidth:P},sx:b=>({position:"sticky",top:0,zIndex:4,backgroundColor:b.palette.mode==="dark"?"#000000":"#f5f5f5",color:b.palette.mode==="dark"?"#ffffff":b.palette.text.primary,fontWeight:"bold",userSelect:"none"}),children:[jsx(op,{active:n===I.id,direction:n===I.id?o:"asc",onClick:v(I.id),sx:b=>({"&.MuiTableSortLabel-root":{width:"100%"},"& .MuiTableSortLabel-icon":{color:b.palette.mode==="dark"?"#ffffff":b.palette.text.primary,opacity:n===I.id?1:0,transition:"opacity 0.2s"},"&:hover .MuiTableSortLabel-icon":{opacity:.5},"&.Mui-active .MuiTableSortLabel-icon":{opacity:1,color:b.palette.mode==="dark"?"#ffffff":b.palette.text.primary},fontWeight:"bold",fontSize:"0.85rem",color:b.palette.mode==="dark"?"#ffffff":b.palette.text.primary}),children:jsx(Na,{component:"span",sx:{overflow:"visible",textOverflow:"clip",whiteSpace:"normal",lineHeight:1.2,wordBreak:"break-word",pr:1},children:I.label})}),jsx(Na,{onMouseDown:b=>y(b,I.id,typeof P=="number"?P:100),onClick:b=>b.stopPropagation(),sx:{position:"absolute",right:0,top:0,bottom:0,width:5,cursor:"col-resize","&:hover":{backgroundColor:"primary.main",opacity:.5},zIndex:1}})]},I.id)})]})})};var Bs=e=>{let{t}=q(),{visibleRows:r,visibleColumns:o,selected:n=[],handleClick:i,columns:a,toggleGroupExpand:s,expandedGroups:u=new Set,selectionMode:c,grouping:l=[],isGroupFullyExpanded:p,handleExpandGroupRecursively:m,handleCollapseGroupRecursively:d}=e,g=f=>n.indexOf(f)!==-1,h=c==="multiple"||c==="single",k=l.length>0,C=o.length+(h?1:0)+(k?1:0);return jsxs(TableBody,{children:[r.map((f,v)=>{if(f.type==="group"){let y=u.has(f.id),S=f.childIds||[],R=S.filter(w=>g(w)).length,A=S.length>0&&R===S.length,T=R>0&&R<S.length;return jsxs(TableRow,{sx:w=>({backgroundColor:w.palette.mode==="dark"?"#111111":"#f5f5f5","& .MuiTableCell-root":{color:w.palette.text.primary,borderBottomColor:w.palette.divider},"& .MuiIconButton-root":{color:w.palette.text.primary},"& .MuiCheckbox-root":{color:w.palette.text.secondary},"& .MuiCheckbox-root.Mui-checked, & .MuiCheckbox-root.MuiCheckbox-indeterminate":{color:w.palette.primary.main}}),children:[h&&jsx(TableCell,{padding:"checkbox",children:jsx(Checkbox,{size:"small",checked:A,indeterminate:T,onChange:w=>{if(w.stopPropagation(),!!e.onSelectionChange)if(A){let I=n.filter(P=>!S.includes(P));e.onSelectionChange(I);}else {let I=Array.from(new Set([...n,...S]));e.onSelectionChange(I);}},onClick:w=>w.stopPropagation(),sx:{p:.5}})}),k&&jsx(TableCell,{padding:"checkbox",sx:{width:44},children:jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:.25},children:[l.length>1&&f.level<l.length-1&&jsx(Tooltip,{title:p?.(f.id)?t("table.group.collapseAll"):t("table.group.expandAll"),children:jsx(IconButton,{size:"small",onClick:()=>{p?.(f.id)?d?.(f.id):m?.(f.id);},sx:{p:.25},children:p?.(f.id)?jsx(ip,{fontSize:"small"}):jsx(np,{fontSize:"small"})})}),jsx(IconButton,{size:"small",onClick:()=>s&&s(f.id),sx:{p:.25},children:y?jsx(pp,{}):jsx(ju,{})})]})}),jsx(TableCell,{colSpan:o.length,sx:{py:1,pl:f.level*3+1},children:jsxs(Typography,{variant:"body2",fontWeight:"bold",color:"text.primary",sx:{fontSize:"0.85rem"},children:[f.field,": ",f.value," (",f.count,")"]})})]},f.id)}else {let y=f.data||f,S=f.id||y.id||v,R=g(S),A=`enhanced-table-checkbox-${v}`,F=(f.level!==void 0?f.level:0)*4;return jsxs(TableRow,{hover:true,onClick:w=>i&&i(w,y),role:"checkbox","aria-checked":R,tabIndex:-1,selected:R,sx:{cursor:"pointer"},children:[h&&jsx(TableCell,{padding:"checkbox",sx:{pl:F>0?F+1:void 0},children:jsx(Checkbox,{color:"primary",checked:R,inputProps:{"aria-labelledby":A}})}),k&&jsx(TableCell,{padding:"checkbox",sx:{width:44}}),a.filter(w=>o.includes(w.id)).map((w,I)=>{let b=!h&&I===0&&F>0?{pl:F+2}:{};return jsx(TableCell,{align:"left",sx:b,children:w.render?w.render(y[w.id],y):(function(){let D=y[w.id];if(w.numeric){if(typeof D=="number")return D.toLocaleString();if(typeof D=="string"&&D.trim()!==""&&!isNaN(Number(D)))return Number(D).toLocaleString()}return D})()},w.id)})]},S)}}),r.length===0&&jsx(TableRow,{children:jsx(TableCell,{colSpan:C,align:"center",children:t("common.noData")})})]})};var Ls=e=>{let{visibleColumns:t,summaryRow:r,selectionMode:o,grouping:n=[]}=e;if(!e.showSummary)return null;let i=o==="multiple"||o==="single",a=n.length>0;return jsx(TableFooter,{sx:{position:"sticky",bottom:0,zIndex:e.zIndex,bgcolor:"background.paper"},children:jsxs(TableRow,{children:[i&&jsx(TableCell,{padding:"checkbox",sx:{bgcolor:"background.paper"}}),a&&jsx(TableCell,{padding:"checkbox",sx:{bgcolor:"background.paper",width:44}}),t.map(s=>jsx(TableCell,{sx:{fontWeight:"bold",fontSize:"0.85rem",bgcolor:"background.paper",color:"text.primary"},children:(function(){let c=r[s];return c==null||c===""?"":typeof c=="number"?c.toLocaleString():typeof c=="string"&&c.trim()!==""&&!isNaN(Number(c))?Number(c).toLocaleString():c})()},s))]})})};var Ns=e=>{let{t}=q();return jsx(Box,{sx:{p:2},children:jsx(Typography,{children:t("table.mobile.notImplemented")})})};var Os=({groupAnchorEl:e,setGroupAnchorEl:t,grouping:r,setGrouping:o,columns:n,toggleGroupField:i})=>{let{t:a}=q();return jsxs(Menu,{anchorEl:e,open:!!e,onClose:()=>t(null),children:[jsxs(Box,{sx:{p:1,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[jsx(Typography,{variant:"subtitle2",sx:{px:1},children:a("table.menu.groupBy")}),r.length>0&&jsx(Button,{size:"small",color:"error",onClick:()=>o([]),startIcon:jsx(Pp,{}),children:a("table.menu.clearAll")})]}),jsx(Divider,{}),n.map(s=>{let u=r.includes(s.id),c=r.indexOf(s.id)+1;return jsx(MenuItem,{onClick:()=>i(s.id),children:jsxs(Box,{sx:{display:"flex",alignItems:"center",width:"100%"},children:[jsx(Checkbox,{checked:u,size:"small"}),jsx(ListItemText,{primary:s.label}),u&&jsx(Badge,{badgeContent:c,color:"primary",sx:{mr:2}})]})},s.id)})]})},Vs=({anchorEl:e,setAnchorEl:t,columns:r,visibleColumns:o,toggleColumnVisibility:n})=>{let{t:i}=q();return jsxs(Menu,{anchorEl:e,open:!!e,onClose:()=>t(null),children:[jsx(MenuItem,{disabled:true,children:jsx(ListItemText,{primary:i("table.menu.visibleColumns")})}),jsx(Divider,{}),r.map(a=>jsxs(MenuItem,{onClick:()=>n(a.id),children:[jsx(Checkbox,{checked:o.includes(a.id),size:"small"}),jsx(ListItemText,{primary:a.label})]},a.id))]})},$s=({anchorEl:e,setAnchorEl:t,showSummary:r,setShowSummary:o,columns:n,summaryColumns:i,toggleSummaryColumn:a})=>{let{t:s}=q();return jsxs(Menu,{anchorEl:e,open:!!e,onClose:()=>t(null),children:[jsx(MenuItem,{children:jsx(FormControlLabel,{control:jsx(Switch,{checked:r,onChange:u=>o(u.target.checked),size:"small"}),label:s("table.menu.showSummaryRow")})}),jsx(Divider,{}),n.filter(u=>u.numeric).map(u=>jsxs(MenuItem,{onClick:()=>a(u.id),disabled:!r,children:[jsx(Checkbox,{checked:i.includes(u.id),size:"small"}),jsx(ListItemText,{primary:u.label})]},u.id)),n.filter(u=>u.numeric).length===0&&jsx(MenuItem,{disabled:true,children:jsx(ListItemText,{primary:s("table.menu.noNumericColumns")})})]})},Gs=({contextMenu:e,handleCloseContextMenu:t,columns:r,visibleColumns:o,toggleColumnVisibility:n})=>{let{t:i}=q();return jsxs(Menu,{open:e!==null,onClose:t,anchorReference:"anchorPosition",anchorPosition:e!==null?{top:e.mouseY,left:e.mouseX}:void 0,children:[jsx(MenuItem,{onClick:t,children:i("common.copy")}),jsx(Divider,{}),jsx(MenuItem,{disabled:true,children:i("table.menu.visibleColumns")}),r.map(a=>jsxs(MenuItem,{onClick:()=>n(a.id),children:[jsx(ListItemIcon,{children:o.includes(a.id)&&jsx(Ip,{fontSize:"small"})}),jsx(ListItemText,{children:a.label})]},a.id))]})};var ka=(e,t=2)=>e.toLocaleString(void 0,{maximumFractionDigits:t}),Ws=({kpis:e})=>{let{t}=q(),r=[{label:t("graph.kpi.totalRecords"),value:ka(e.totalRecords,0),color:"text.primary"},{label:t("graph.kpi.totalReport"),value:ka(e.totalReportHours),color:"text.primary"},{label:t("graph.kpi.totalBillable"),value:ka(e.totalBillableHours),color:"success.main"},{label:t("graph.kpi.efficiency"),value:`${e.efficiency.toFixed(2)}%`,color:"warning.main"},{label:t("graph.kpi.amount"),value:ka(e.totalAmount),color:"info.main"},{label:t("graph.kpi.flagged"),value:ka(e.flaggedCount,0),color:"error.main"}];return jsx(Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",lg:"repeat(6, minmax(0, 1fr))"},gap:1.5},children:r.map(o=>jsxs(Paper,{variant:"outlined",sx:{p:1.5,borderRadius:2,minHeight:96,display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[jsx(Typography,{variant:"caption",color:"text.secondary",children:o.label}),jsx(Typography,{variant:"h4",fontWeight:800,sx:{color:o.color},children:o.value})]},o.label))})};var rr=({title:e,subtitle:t,children:r})=>jsxs(Paper,{variant:"outlined",sx:{p:2,borderRadius:2},children:[jsx(Typography,{variant:"subtitle1",fontWeight:700,children:e}),t&&jsx(Typography,{variant:"body2",color:"text.secondary",sx:{mb:2},children:t}),r]});var wa=({data:e,orientation:t="horizontal",valueSuffix:r="",minHeight:o=210,activeName:n,onItemClick:i})=>{if(e.length===0)return jsx(Typography,{variant:"body2",color:"text.secondary",children:"No data"});let a=Math.max(...e.map(s=>s.value),1);return t==="vertical"?jsx(Box,{sx:{display:"flex",gap:1,alignItems:"flex-end",minHeight:o},children:e.map(s=>jsxs(Box,{sx:{flex:1,minWidth:0},children:[jsx(Box,{onClick:()=>i?.(s),sx:{height:`${Math.max(s.value/a*180,6)}px`,bgcolor:s.name===n?"primary.dark":"primary.main",borderRadius:"8px 8px 0 0",cursor:i?"pointer":"default",opacity:n&&s.name!==n?.45:1}}),jsx(Typography,{variant:"caption",noWrap:true,title:s.name,sx:{display:"block",mt:.5},children:s.name}),jsxs(Typography,{variant:"caption",color:"text.secondary",children:[s.value.toFixed(1),r]})]},s.name))}):jsx(Stack,{spacing:1,children:e.map(s=>jsxs(Box,{sx:{display:"grid",gridTemplateColumns:"140px 1fr 64px",gap:1},children:[jsx(Typography,{variant:"caption",color:"text.secondary",noWrap:true,title:s.name,children:s.name}),jsx(Box,{onClick:()=>i?.(s),sx:{alignSelf:"center",bgcolor:"action.hover",height:10,borderRadius:999,overflow:"hidden",cursor:i?"pointer":"default",opacity:n&&s.name!==n?.45:1},children:jsx(Box,{sx:{width:`${s.value/a*100}%`,height:"100%",bgcolor:s.name===n?"primary.dark":"primary.main"}})}),jsxs(Typography,{variant:"caption",sx:{textAlign:"right",fontWeight:600},children:[s.value.toFixed(1),r]})]},s.name))})};var _s=({data:e,color:t="#42A5F5",valueSuffix:r="",height:o=220})=>{if(e.length===0)return jsx(Typography,{variant:"body2",color:"text.secondary",children:"No data"});let n=640,i=28,a=e.map(m=>m.value),s=Math.min(...a,0),c=Math.max(...a,1)-s||1,l=e.map((m,d)=>{let g=i+d*(n-i*2)/Math.max(e.length-1,1),h=o-i-(m.value-s)/c*(o-i*2);return {x:g,y:h,...m}}),p=l.map(m=>`${m.x},${m.y}`).join(" ");return jsxs(Box,{children:[jsxs(Box,{component:"svg",viewBox:`0 0 ${n} ${o}`,sx:{width:"100%",height:o},children:[jsx("line",{x1:i,y1:o-i,x2:n-i,y2:o-i,stroke:"rgba(148,163,184,0.4)"}),jsx("polyline",{fill:"none",stroke:t,strokeWidth:3,points:p}),l.map(m=>jsx("circle",{cx:m.x,cy:m.y,r:4,fill:t},m.name))]}),jsx(Box,{sx:{mt:1,display:"grid",gridTemplateColumns:`repeat(${e.length}, minmax(0, 1fr))`,gap:1},children:e.map(m=>jsxs(Box,{sx:{minWidth:0},children:[jsx(Typography,{variant:"caption",noWrap:true,title:m.name,sx:{display:"block"},children:m.name}),jsxs(Typography,{variant:"caption",color:"text.secondary",children:[m.value.toFixed(1),r]})]},m.name))})]})};var Ks=({data:e,barColor:t="#64B5F6",lineColor:r="#FFB74D",height:o=220})=>{if(e.length===0)return jsx(Typography,{variant:"body2",color:"text.secondary",children:"No data"});let n=640,i=28,a=Math.max(...e.map(l=>l.barValue),1),s=Math.max(...e.map(l=>l.lineValue),1),u=e.map((l,p)=>{let m=(n-i*2)/e.length,d=Math.max(m*.5,8),g=i+p*m+(m-d)/2,h=l.barValue/a*(o-i*2),k=o-i-h;return {x:g,y:k,barHeight:h,barWidth:d,item:l}}),c=e.map((l,p)=>{let m=(n-i*2)/e.length,d=i+p*m+m/2,g=o-i-l.lineValue/s*(o-i*2);return {x:d,y:g,item:l}});return jsxs(Stack,{spacing:1.25,children:[jsxs(Box,{component:"svg",viewBox:`0 0 ${n} ${o}`,sx:{width:"100%",height:o},children:[jsx("line",{x1:i,y1:o-i,x2:n-i,y2:o-i,stroke:"rgba(148,163,184,0.4)"}),u.map(l=>jsx("rect",{x:l.x,y:l.y,width:l.barWidth,height:Math.max(l.barHeight,4),rx:6,fill:t},l.item.name)),jsx("polyline",{fill:"none",stroke:r,strokeWidth:3,points:c.map(l=>`${l.x},${l.y}`).join(" ")}),c.map(l=>jsx("circle",{cx:l.x,cy:l.y,r:3.5,fill:r},`${l.item.name}-line`))]}),jsx(Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${e.length}, minmax(0, 1fr))`,gap:1},children:e.map(l=>jsxs(Box,{sx:{minWidth:0},children:[jsx(Typography,{variant:"caption",noWrap:true,title:l.name,sx:{display:"block"},children:l.name}),jsxs(Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:["Bar: ",l.barValue.toFixed(1)]}),jsxs(Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:["Line: ",l.lineValue.toFixed(1)]})]},l.name))})]})};var Ep=e=>`rgba(30, 136, 229, ${.2+Math.max(0,Math.min(1,e))*.8})`,js=({data:e})=>{if(e.length===0)return jsx(Typography,{variant:"body2",color:"text.secondary",children:"No data"});let t=Array.from(new Set(e.map(i=>i.x))),r=Array.from(new Set(e.map(i=>i.y))),o=Math.max(...e.map(i=>i.value),1),n=new Map(e.map(i=>[`${i.y}__${i.x}`,i.value]));return jsx(Box,{sx:{overflowX:"auto"},children:jsxs(Box,{sx:{display:"grid",gridTemplateColumns:`120px repeat(${t.length}, minmax(64px, 1fr))`,gap:1,minWidth:120+t.length*64},children:[jsx(Box,{}),t.map(i=>jsx(Typography,{variant:"caption",sx:{textAlign:"center",fontWeight:600},children:i},i)),r.map(i=>jsxs(Box,{sx:{display:"contents"},children:[jsx(Typography,{variant:"caption",sx:{alignSelf:"center"},children:i}),t.map(a=>{let s=n.get(`${i}__${a}`)||0,u=s/o;return jsx(Box,{sx:{height:36,borderRadius:1,bgcolor:Ep(u),border:"1px solid rgba(148,163,184,0.2)",display:"flex",alignItems:"center",justifyContent:"center"},children:jsx(Typography,{variant:"caption",fontWeight:700,children:s.toFixed(1)})},`${i}-${a}`)})]},i))]})})};var Np=["#1E88E5","#1ABC9C","#FBC02D","#EF5350","#7E57C2","#78909C"],ur=({data:e,variant:t="donut",colors:r=Np,size:o=180,activeName:n,onItemClick:i})=>{if(e.length===0)return jsx(Typography,{variant:"body2",color:"text.secondary",children:"No data"});let a=0,s=e.map((u,c)=>{let l=a;return a+=u.percent,`${r[c%r.length]} ${l}% ${a}%`});return jsxs(Stack,{direction:{xs:"column",sm:"row"},spacing:2,alignItems:"center",children:[jsx(Box,{sx:{width:o,height:o,borderRadius:"50%",background:`conic-gradient(${s.join(", ")})`,position:"relative",flexShrink:0},children:t==="donut"&&jsx(Box,{sx:{position:"absolute",inset:Math.round(o*.18),bgcolor:"background.paper",borderRadius:"50%"}})}),jsx(Stack,{spacing:1,sx:{minWidth:180},children:e.map((u,c)=>jsxs(Box,{onClick:()=>i?.(u),sx:{display:"flex",alignItems:"center",gap:1,cursor:i?"pointer":"default",opacity:n&&u.name!==n?.45:1},children:[jsx(Box,{sx:{width:10,height:10,borderRadius:"50%",bgcolor:r[c%r.length]}}),jsx(Typography,{variant:"caption",sx:{flex:1},children:u.name}),jsxs(Typography,{variant:"caption",sx:{fontWeight:700},children:[u.percent.toFixed(0),"%"]})]},u.name))})]})};var Xs=({effect:e,branches:t})=>{if(t.length===0)return jsx(Typography,{variant:"body2",color:"text.secondary",children:"No data"});let r=t.filter((n,i)=>i%2===0),o=t.filter((n,i)=>i%2===1);return jsxs(Stack,{spacing:1.5,children:[jsx(Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${Math.max(r.length,1)}, minmax(0, 1fr))`,gap:1},children:r.map(n=>jsxs(Box,{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1},children:[jsx(Typography,{variant:"caption",fontWeight:700,children:n.title}),n.causes.map(i=>jsx(Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:i},i))]},n.title))}),jsxs(Box,{sx:{position:"relative",height:32},children:[jsx(Box,{sx:{position:"absolute",inset:"50% 0 auto 0",borderTop:"2px solid",borderColor:"primary.main"}}),jsx(Box,{sx:{position:"absolute",right:0,top:"calc(50% - 12px)",px:1,py:.25,borderRadius:1,bgcolor:"primary.main",color:"primary.contrastText"},children:jsx(Typography,{variant:"caption",fontWeight:700,children:e})})]}),jsx(Box,{sx:{display:"grid",gridTemplateColumns:`repeat(${Math.max(o.length,1)}, minmax(0, 1fr))`,gap:1},children:o.map(n=>jsxs(Box,{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1},children:[jsx(Typography,{variant:"caption",fontWeight:700,children:n.title}),n.causes.map(i=>jsx(Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:i},i))]},n.title))})]})};var Js=({data:e,height:t=240})=>{if(e.length===0)return jsx(Typography,{variant:"body2",color:"text.secondary",children:"No data"});let r=0,o=e.map(p=>{let m=p.type==="total"?0:r,d=p.type==="total"?p.value:r+p.value;return p.type!=="total"&&(r=d),{...p,start:m,end:d,delta:d-m}}),n=o.flatMap(p=>[p.start,p.end]),i=Math.min(...n,0),a=Math.max(...n,1),s=680,u=30,c=a-i||1,l=p=>t-u-(p-i)/c*(t-u*2);return jsxs(Box,{children:[jsxs(Box,{component:"svg",viewBox:`0 0 ${s} ${t}`,sx:{width:"100%",height:t},children:[jsx("line",{x1:u,y1:l(0),x2:s-u,y2:l(0),stroke:"rgba(148,163,184,0.4)"}),o.map((p,m)=>{let d=(s-u*2)/o.length,g=Math.max(d*.55,8),h=u+m*d+(d-g)/2,k=l(Math.max(p.start,p.end)),C=l(Math.min(p.start,p.end)),f=p.type==="total"?"#42A5F5":p.delta>=0?"#66BB6A":"#EF5350";return jsxs("g",{children:[jsx("rect",{x:h,y:k,width:g,height:Math.max(C-k,4),rx:6,fill:f}),jsx("text",{x:h+g/2,y:k-6,textAnchor:"middle",fill:"currentColor",fontSize:"11",children:p.end.toFixed(1)})]},p.name)})]}),jsx(Box,{sx:{mt:1,display:"grid",gridTemplateColumns:`repeat(${o.length}, minmax(0, 1fr))`,gap:1},children:o.map(p=>jsx(Typography,{variant:"caption",noWrap:true,title:p.name,children:p.name},p.name))})]})};var Pa=({apiKey:e,query:t,zoom:r=14,mapType:o="roadmap"})=>{let n=encodeURIComponent(t);return `https://www.google.com/maps/embed/v1/place?key=${encodeURIComponent(e)}&q=${n}&zoom=${r}&maptype=${o}`},mC=(e,t=360)=>{let r=Pa(e);return `<iframe width="100%" height="${t}" style="border:0" loading="lazy" allowfullscreen referrerpolicy="no-referrer-when-downgrade" src="${r}"></iframe>`};var ol=({apiKey:e,query:t,embedUrl:r,zoom:o=14,mapType:n="roadmap",height:i=320})=>{let a=r||(e&&t?Pa({apiKey:e,query:t,zoom:o,mapType:n}):"");return a?jsxs(Box,{children:[jsx(Box,{component:"iframe",src:a,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",sx:{width:"100%",height:i,border:0,borderRadius:2}}),jsxs(Typography,{variant:"caption",color:"text.secondary",sx:{mt:.75,display:"block"},children:["If iframe is blocked, open directly: ",jsx(Link,{href:a,target:"_blank",rel:"noreferrer",children:"Google Maps"})]})]}):jsx(Box,{children:jsx(Typography,{variant:"body2",color:"text.secondary",children:"Google Map requires `embedUrl` or (`apiKey` + `query`)."})})};var gr=({keyword:e,location:t,src:r="orbcafe-ui"})=>{if(t){let o=encodeURIComponent(t.name||e||"Location");return `https://uri.amap.com/marker?position=${t.lng},${t.lat}&name=${o}&src=${encodeURIComponent(r)}&coordinate=gaode&callnative=0`}return e?`https://uri.amap.com/search?keyword=${encodeURIComponent(e)}&src=${encodeURIComponent(r)}&callnative=0`:"https://uri.amap.com/search?keyword=%E5%8C%97%E4%BA%AC&src=orbcafe-ui&callnative=0"};var il=({keyword:e,location:t,embedUrl:r,height:o=320})=>{let n=r||gr({keyword:e,location:t?{lng:t.lng,lat:t.lat,name:t.name}:void 0});return jsxs(Box,{children:[jsx(Box,{component:"iframe",src:n,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",sx:{width:"100%",height:o,border:0,borderRadius:2}}),jsxs(Typography,{variant:"caption",color:"text.secondary",sx:{mt:.75,display:"block"},children:["If iframe is blocked, open directly: ",jsx(Link,{href:n,target:"_blank",rel:"noreferrer",children:"AMap"})]})]})};var sl=({billableByPrimary:e,efficiencyBySecondary:t,statusDistribution:r,interaction:o})=>{let{t:n}=q();return jsxs(Box,{sx:{display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",lg:"1.2fr 1.2fr 1fr"}},children:[jsx(rr,{title:n("graph.chart.billable.title"),subtitle:n("graph.chart.billable.subtitle"),children:jsx(wa,{data:e,orientation:"horizontal",activeName:o?.filters?.primaryDimension,onItemClick:i=>o?.onPrimaryDimensionClick?.(i.name)})}),jsx(rr,{title:n("graph.chart.efficiency.title"),subtitle:n("graph.chart.efficiency.subtitle"),children:jsx(wa,{data:t,orientation:"vertical",valueSuffix:"%",activeName:o?.filters?.secondaryDimension,onItemClick:i=>o?.onSecondaryDimensionClick?.(i.name)})}),jsx(rr,{title:n("graph.chart.status.title"),subtitle:n("graph.chart.status.subtitle"),children:jsx(ur,{data:r,variant:"donut",activeName:o?.filters?.status,onItemClick:i=>o?.onStatusClick?.(i.name)})})]})};var To=e=>jsx(TextField,{...e,variant:e.variant||"outlined",size:e.size||"small",fullWidth:e.fullWidth!==void 0?e.fullWidth:true});var jn=e=>jsx(TextField,{...e,multiline:true,minRows:3,fullWidth:true,variant:"outlined"});var tm=["doubao-lite","gpt-4o-mini","gpt-4.1-mini","claude-3.5-sonnet"],om=["zh","en","de","fr","ja","ko"],dl=({open:e,onClose:t,value:r,onSaveAll:o,modelOptions:n=tm,promptLangOptions:i=om,analysisTemplateOptions:a=[],responseTemplateOptions:s=[],defaultAnalysisTemplateId:u,defaultResponseTemplateId:c})=>{let[l,p]=useState(r),[m,d]=useState(u||""),[g,h]=useState(c||""),[k,C]=useState(false);useEffect(()=>{e&&(p(r),d(u||""),h(c||""));},[e,r,u,c]);let f=(y,S)=>{p(R=>({...R,[y]:S}));},v=async()=>{if(o)try{C(!0),await o({settings:l,analysisTemplateId:m||void 0,responseTemplateId:g||void 0});}finally{C(false);}};return jsxs(Dialog,{open:e,onClose:t,fullWidth:true,maxWidth:"lg",children:[jsxs(DialogTitle,{sx:{pr:7,pb:2.2},children:[jsx(Typography,{variant:"h5",sx:{fontWeight:800},children:"AI Settings"}),jsx(Typography,{variant:"body2",color:"text.secondary",sx:{mt:.5},children:"Configure LLM settings and editable agent prompts by language."}),jsx(IconButton,{onClick:t,sx:{position:"absolute",right:12,top:12},children:jsx(em,{})})]}),jsx(DialogContent,{sx:{pt:"18px !important"},children:jsxs(Stack,{spacing:2.2,children:[jsxs(Box,{sx:{mt:.8,display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",md:"repeat(2, minmax(0, 1fr))"}},children:[jsx(Box,{children:jsx(To,{size:"small",value:l.baseUrl,onChange:y=>f("baseUrl",y.target.value),fullWidth:true,label:"Base URL"})}),jsx(Box,{children:jsx(To,{size:"small",type:"password",value:l.apiKey,onChange:y=>f("apiKey",y.target.value),fullWidth:true,label:"API Key"})}),jsx(Box,{children:jsx(To,{size:"small",value:l.model,onChange:y=>f("model",y.target.value),fullWidth:true,select:true,label:"Model",children:n.map(y=>jsx(MenuItem,{value:y,children:y},y))})}),jsx(Box,{children:jsx(To,{size:"small",value:l.promptLang,onChange:y=>f("promptLang",y.target.value),fullWidth:true,select:true,label:"Prompt Lang",children:i.map(y=>jsx(MenuItem,{value:y,children:y},y))})})]}),jsxs(Box,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[jsxs(To,{size:"small",value:m,onChange:y=>d(y.target.value),fullWidth:true,select:true,label:"Analysis Template",children:[jsx(MenuItem,{value:"",children:"Default"}),a.map(y=>jsx(MenuItem,{value:y.id,children:y.label},y.id))]}),jsx(jn,{multiline:true,minRows:8,value:l.analysisPrompt,onChange:y=>f("analysisPrompt",y.target.value),fullWidth:true,label:"Analysis Prompt",sx:{"& .MuiInputBase-root":{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"}}}),jsxs(To,{size:"small",value:g,onChange:y=>h(y.target.value),fullWidth:true,select:true,label:"Response Template",children:[jsx(MenuItem,{value:"",children:"Default"}),s.map(y=>jsx(MenuItem,{value:y.id,children:y.label},y.id))]}),jsx(jn,{multiline:true,minRows:8,value:l.responsePrompt,onChange:y=>f("responsePrompt",y.target.value),fullWidth:true,label:"Response Prompt",sx:{"& .MuiInputBase-root":{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"}}})]})]})}),jsxs(DialogActions,{sx:{px:3,pb:2.5,pt:1.2,gap:1},children:[jsx(Button,{variant:"outlined",onClick:t,children:"Cancel"}),jsx(Button,{variant:"contained",onClick:v,disabled:!o||k,children:"Save"})]})]})};var ul=({open:e,onClose:t,model:r,tableContent:o,extraCharts:n,interaction:i,aiAssistant:a})=>{let{t:s}=q(),[u,c]=useState(a?.defaultPrompt||""),[l,p]=useState(false),[m,d]=useState(false),g=i?.enabled!==false&&!!i,h=a?.enabled!==false,k=i?.filters||{},C=!!(k.primaryDimension||k.secondaryDimension||k.status),f=a?.placeholder||"Ask AI to analyze data, create charts, or find insights...";useEffect(()=>{e&&c(a?.defaultPrompt||"");},[e,a?.defaultPrompt]);let v=a?.settings||{baseUrl:"/llm-api",apiKey:"",model:"doubao-lite",promptLang:"zh",analysisPrompt:"",responsePrompt:""},y=async()=>{let S=u.trim();if(!(!S||!a?.onSubmit))try{p(!0),await a.onSubmit(S,{filters:k,model:r});}finally{p(false);}};return jsx(Dialog,{open:e,onClose:t,fullScreen:true,children:jsxs(Box,{sx:{height:"100%",display:"flex",flexDirection:"column",bgcolor:"background.default"},children:[jsx(Box,{sx:{p:2,borderBottom:1,borderColor:"divider"},children:jsxs(Stack,{direction:{xs:"column",lg:"row"},alignItems:{xs:"stretch",lg:"center"},justifyContent:"space-between",spacing:1.5,children:[jsxs(Stack,{direction:"row",spacing:1.25,alignItems:"center",sx:{flexWrap:"wrap"},children:[jsx(Typography,{variant:"h5",fontWeight:800,children:r.title}),jsx(Chip,{size:"small",label:s("graph.records",{count:r.kpis.totalRecords})}),g&&k.primaryDimension&&jsx(Chip,{size:"small",variant:"outlined",label:`${i?.fieldMapping.primaryDimension}: ${k.primaryDimension}`,onDelete:()=>i?.onClearFilter("primaryDimension")}),g&&k.secondaryDimension&&jsx(Chip,{size:"small",variant:"outlined",label:`${i?.fieldMapping.secondaryDimension}: ${k.secondaryDimension}`,onDelete:()=>i?.onClearFilter("secondaryDimension")}),g&&k.status&&jsx(Chip,{size:"small",variant:"outlined",label:`${i?.fieldMapping.status}: ${k.status}`,onDelete:()=>i?.onClearFilter("status")}),g&&C&&jsx(Button,{size:"small",onClick:()=>i?.onClearAll(),children:"Clear"})]}),jsxs(Stack,{direction:"row",spacing:1.25,alignItems:"center",sx:{width:{xs:"100%",lg:"auto"}},children:[h&&jsxs(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:[jsx(IconButton,{size:"small",onClick:a?.onVoiceInput,children:jsx(lm,{sx:{fontSize:18,color:"text.secondary"}})}),jsx(InputBase,{fullWidth:true,value:u,onChange:S=>c(S.target.value),onKeyDown:S=>{S.key==="Enter"&&(S.preventDefault(),y());},placeholder:f,sx:{fontSize:"0.9rem"}}),jsx(IconButton,{size:"small",onClick:y,disabled:l||!u.trim(),children:jsx(dm,{sx:{fontSize:18}})}),jsx(IconButton,{size:"small",onClick:()=>d(true),children:jsx(cm,{sx:{fontSize:18}})})]}),jsx(IconButton,{onClick:t,children:jsx(em,{})})]})]})}),jsxs(Box,{sx:{p:2,display:"flex",flexDirection:"column",gap:1.5,overflow:"auto",minHeight:0},children:[jsx(Ws,{kpis:r.kpis}),jsx(sl,{billableByPrimary:r.charts.billableByPrimary,efficiencyBySecondary:r.charts.efficiencyBySecondary,statusDistribution:r.charts.statusDistribution,interaction:g?{filters:k,onPrimaryDimensionClick:S=>i?.onPrimaryDimensionClick(S),onSecondaryDimensionClick:S=>i?.onSecondaryDimensionClick(S),onStatusClick:S=>i?.onStatusClick(S)}:void 0}),n,o]}),jsx(dl,{open:m,onClose:()=>d(false),value:v,onSaveAll:a?.onSaveAll,modelOptions:a?.modelOptions,promptLangOptions:a?.promptLangOptions,analysisTemplateOptions:a?.analysisTemplateOptions,responseTemplateOptions:a?.responseTemplateOptions,defaultAnalysisTemplateId:a?.defaultAnalysisTemplateId,defaultResponseTemplateId:a?.defaultResponseTemplateId})]})})};var io={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"]},pm=5,pl=e=>e.toLowerCase().replace(/[\s_-]/g,""),so=(e,t,r,o)=>{if(t)return t;if(e.length===0)return o;let n=Object.keys(e[0]),i=new Map(n.map(a=>[pl(a),a]));for(let a of r){let s=i.get(pl(a));if(s)return s}return n[0]||o},ft=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},et=(e,t)=>e==null||e===""?t:String(e),mm=(e,t,r,o,n)=>{let i=new Map;return e.forEach(a=>{let s=et(a[t],n);i.set(s,(i.get(s)||0)+ft(a[r]));}),Array.from(i.entries()).map(([a,s])=>({name:a,value:s})).sort((a,s)=>s.value-a.value).slice(0,o)},gm=(e,t,r,o,n,i)=>{let a=new Map;return e.forEach(s=>{let u=et(s[t],i),c=a.get(u)||{report:0,billable:0};c.report+=ft(s[r]),c.billable+=ft(s[o]),a.set(u,c);}),Array.from(a.entries()).map(([s,u])=>({name:s,value:u.report>0?u.billable/u.report*100:0})).sort((s,u)=>s.value-u.value).slice(0,n)},fm=(e,t,r)=>{let o=e.length;if(o===0)return [];let n=new Map;return e.forEach(i=>{let a=et(i[t],r);n.set(a,(n.get(a)||0)+1);}),Array.from(n.entries()).map(([i,a])=>({name:i,value:a,percent:a/o*100}))},ml=(e,t,r)=>{let o=new Map;return e.forEach(n=>{let i=et(n[t],"N/A");o.set(i,(o.get(i)||0)+ft(n[r]));}),Array.from(o.entries()).sort(([n],[i])=>n.localeCompare(i)).map(([n,i])=>({name:n,value:i}))},hm=(e,t,r,o,n,i)=>{let a=new Map;return e.forEach(s=>{let u=et(s[t],i),c=a.get(u)||{report:0,billable:0};c.report+=ft(s[r]),c.billable+=ft(s[o]),a.set(u,c);}),Array.from(a.entries()).map(([s,u])=>({name:s,barValue:u.billable,lineValue:u.report>0?u.billable/u.report*100:0})).sort((s,u)=>u.barValue-s.barValue).slice(0,n)},ym=(e,t,r,o,n)=>{let i=new Map;return e.forEach(a=>{let s=et(a[t],n),u=et(a[r],n),c=`${s}__${u}`;i.set(c,(i.get(c)||0)+ft(a[o]));}),Array.from(i.entries()).map(([a,s])=>{let[u,c]=a.split("__");return {x:u,y:c,value:s}})},bm=(e,t,r)=>{let o=ml(e,t,r),n=o.map(a=>({name:a.name,value:a.value,type:"delta"})),i=o.reduce((a,s)=>a+s.value,0);return [...n,{name:"Total",value:i,type:"total"}]},xm=(e,t,r,o,n,i)=>{let a=new Map;return e.forEach(s=>{let u=et(s[t],i),c=`${et(s[r],i)} / ${et(s[o],i)}`,l=a.get(u)||new Map;l.set(c,(l.get(c)||0)+1),a.set(u,l);}),Array.from(a.entries()).map(([s,u])=>({title:s,causes:Array.from(u.entries()).sort((c,l)=>l[1]-c[1]).slice(0,n).map(([c,l])=>`${c} (${l})`)})).slice(0,6)},Yn=({rows:e,config:t})=>{let{t:r}=q(),o=r("graph.unassigned"),n=useMemo(()=>{let l=t?.fieldMapping;return {primaryDimension:so(e,l?.primaryDimension,io.primaryDimension,"Category"),secondaryDimension:so(e,l?.secondaryDimension,io.secondaryDimension,"Owner"),status:so(e,l?.status,io.status,"Status"),date:so(e,l?.date,io.date,"Date"),description:so(e,l?.description,io.description,"Description"),reportHours:so(e,l?.reportHours,io.reportHours,"ReportHours"),billableHours:so(e,l?.billableHours,io.billableHours,"BillableHours"),amount:so(e,l?.amount,io.amount,"Amount")}},[e,t?.fieldMapping]),i=useMemo(()=>e.map((l,p)=>{let m=ft(l[n.reportHours]),d=ft(l[n.billableHours]),g=ft(l[n.amount]),h=m>0?d/m*100:0;return {id:`graph-row-${p}`,Date:et(l[n.date],""),Primary:et(l[n.primaryDimension],o),Secondary:et(l[n.secondaryDimension],o),Description:et(l[n.description],""),ReportHours:m,BillableHours:d,Amount:g,Efficiency:h,Status:et(l[n.status],o)}}),[e,n,o]),a=useMemo(()=>{let l=i.length,p=i.reduce((C,f)=>C+ft(f.ReportHours),0),m=i.reduce((C,f)=>C+ft(f.BillableHours),0),d=i.reduce((C,f)=>C+ft(f.Amount),0),g=p>0?m/p*100:0,h=t?.statusFlagValues||["flag","flagged","warning","risk"],k=i.filter(C=>h.includes(et(C.Status,"").toLowerCase())).length;return {totalRecords:l,totalReportHours:p,totalBillableHours:m,efficiency:g,totalAmount:d,flaggedCount:k}},[i,t?.statusFlagValues]),s=t?.topN||pm,u=useMemo(()=>({billableByPrimary:mm(i,"Primary","BillableHours",s,o),efficiencyBySecondary:gm(i,"Secondary","ReportHours","BillableHours",s,o),statusDistribution:fm(i,"Status",o),lineByDate:ml(i,"Date","BillableHours"),comboByPrimary:hm(i,"Primary","ReportHours","BillableHours",s,o),heatmapPrimarySecondary:ym(i,"Primary","Secondary","BillableHours",o),waterfallBillable:bm(i,"Date","BillableHours"),fishboneStatusCauses:xm(i,"Status","Primary","Secondary",3,o)}),[i,s,o]),c=useMemo(()=>({title:t?.title||r("graph.reportTitle"),kpis:a,charts:u,table:{columns:[{id:"Date",label:n.date},{id:"Primary",label:n.primaryDimension},{id:"Secondary",label:n.secondaryDimension},{id:"Description",label:n.description},{id:"ReportHours",label:r("graph.column.reportHours"),align:"right"},{id:"BillableHours",label:r("graph.column.billableHours"),align:"right"},{id:"Amount",label:"Amount",align:"right"},{id:"Efficiency",label:"Efficiency",align:"right"},{id:"Status",label:n.status}],rows:i}}),[u,t?.title,n,a,i,r]);return {fieldMapping:n,model:c}};var Jo=e=>String(e??"").trim(),gl=(e={})=>{let[t,r]=useState(e),o=useCallback((u,c)=>{r(l=>{let p=c?.trim();if(!p){let m={...l};return delete m[u],m}if(l[u]===p){let m={...l};return delete m[u],m}return {...l,[u]:p}});},[]),n=useCallback(u=>{r(c=>{if(!c[u])return c;let l={...c};return delete l[u],l});},[]),i=useCallback(()=>{r({});},[]),a=useMemo(()=>!!(t.primaryDimension||t.secondaryDimension||t.status),[t]),s=useCallback((u,c)=>u.filter(l=>!(t.primaryDimension&&Jo(l[c.primaryDimension])!==Jo(t.primaryDimension)||t.secondaryDimension&&Jo(l[c.secondaryDimension])!==Jo(t.secondaryDimension)||t.status&&Jo(l[c.status])!==Jo(t.status))),[t]);return {filters:t,setFilter:o,clearFilter:n,clearAll:i,hasActiveFilters:a,applyRows:s}};var Cr=({variants:e,currentVariantId:t,onLoad:r,onSave:o,onDelete:n,onSetDefault:i})=>{let{t:a}=q(),u=useTheme().palette.mode==="dark",c="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)"},[p,m]=useState(false),[d,g]=useState(""),[h,k]=useState(false),[C,f]=useState(false),v=e.find(R=>R.id===t),y=()=>{g(v?.name||a("variant.newVariant")),k(v?.isDefault||false),f(v?.isPublic||false),m(true);},S=()=>{o({name:d,isDefault:h,isPublic:C,description:""}),m(false);};return jsxs(Box,{sx:{display:"flex",gap:1,alignItems:"center",width:"100%",maxWidth:"100%"},children:[jsx(Autocomplete,{size:"small",sx:{width:l,"& .MuiInputBase-root":{fontSize:c,bgcolor:u?"rgba(25, 118, 210, 0.2)":"#e7f1ff","& .MuiOutlinedInput-notchedOutline":{borderColor:u?"rgba(144,202,249,0.45)":"rgba(25,118,210,0.45)"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:u?"rgba(144,202,249,0.7)":"rgba(25,118,210,0.65)"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:u?"rgba(144,202,249,0.9)":"rgba(25,118,210,0.85)"}},"& .MuiInputBase-input":{fontSize:c},"& .MuiAutocomplete-noOptions":{fontSize:c}},noOptionsText:jsx(Typography,{sx:{fontSize:c},children:a("variant.noOptions")}),options:e,getOptionLabel:R=>R.name+(R.isDefault?` (${a("variant.defaultSuffix")})`:""),value:v||null,onChange:(R,A)=>{A&&r(A);},renderInput:R=>jsx(TextField,{...R,variant:"outlined",size:"small",InputProps:{...R.InputProps,sx:{fontSize:c,color:u?"#E3F2FD":"#0D47A1"}},placeholder:a("variant.selectVariant")}),renderOption:(R,A)=>jsx("li",{...R,children:jsxs(Box,{sx:{display:"flex",alignItems:"center",width:"100%"},children:[jsx(Typography,{sx:{flex:1,fontSize:c},children:A.name}),A.isDefault&&jsx(Mm,{fontSize:"small",color:"action"})]})})}),jsx(Tooltip,{title:a("variant.saveView"),children:jsx(IconButton,{onClick:y,size:"small",color:"primary",children:jsx(El,{fontSize:"small"})})}),jsxs(Dialog,{open:p,onClose:()=>m(false),children:[jsx(DialogTitle,{children:a("variant.saveView")}),jsxs(DialogContent,{children:[jsx(TextField,{autoFocus:true,margin:"dense",label:a("variant.viewName"),fullWidth:true,variant:"outlined",value:d,onChange:R=>g(R.target.value)}),jsx(FormControlLabel,{control:jsx(Checkbox,{checked:h,onChange:R=>k(R.target.checked)}),label:a("variant.setDefault")}),jsx(FormControlLabel,{control:jsx(Checkbox,{checked:C,onChange:R=>f(R.target.checked)}),label:a("variant.publicAllUsers")})]}),jsxs(DialogActions,{children:[jsx(Button,{onClick:()=>m(false),children:a("common.cancel")}),jsx(Button,{onClick:S,variant:"contained",children:a("common.save")})]})]})]})};var kl=({appId:e,tableKey:t="default",currentFilters:r,currentLayoutId:o,layoutRefs:n,onLoad:i,variantService:a,serviceUrl:s,onError:u,onSuccess:c,currentVariantId:l,onVariantChange:p})=>{let{t:m}=q(),[d,g]=useState([]),[h,k]=useState(""),C=`orbcafe.variants.${e}.${t}`,f=l!==void 0?l:h,v=P=>{l===void 0&&k(P),p&&p(P);},y=useCallback(()=>{try{let P=localStorage.getItem(C);if(!P)return [];let b=JSON.parse(P);return Array.isArray(b)?b:[]}catch{return []}},[C]),S=useCallback(P=>{try{localStorage.setItem(C,JSON.stringify(P));}catch{}},[C]),R=useCallback(P=>{g(P);let b=P.find(L=>L.isDefault);b&&!f&&(v(b.id),i(b));},[f,i,v]),A=useCallback(async()=>{if(!e)return [];try{let P=[];if(a)P=await a.getVariants(e,t);else if(s){let b=await fetch(`${s}/api/variants?appId=${encodeURIComponent(e)}&tableKey=${encodeURIComponent(t)}`);if(!b.ok)throw new Error(m("variant.toast.fetchFailed"));P=await b.json();}else P=y();return R(P),P}catch(P){console.error("Error fetching variants",P);let b=y();return R(b),u&&u(m("variant.toast.fetchFailed")),b}},[e,t,a,s,y,R,u,m]);return useEffect(()=>{A();},[e,t]),jsx(Cr,{variants:d,currentVariantId:f,onLoad:P=>{v(P.id),i(P);},onSave:async P=>{let b=Date.now().toString(),L;try{let D=d.find(N=>N.name===P.name);b=D?D.id:Date.now().toString();let U=[];if(D&&(Array.isArray(D.filters)?U=[...D.filters]:D.filters&&(U=[{scope:"default",filters:D.filters}])),P.scope==="Search"||P.scope==="Both"){let N=(Array.isArray(r),r);if(N)if(Array.isArray(N)&&N.length>0&&N[0].scope)N.forEach(V=>{let W=U.findIndex(H=>H.scope===V.scope);W>=0?U[W]=V:U.push(V);});else {let V={scope:t,filters:N},W=U.findIndex(H=>H.scope===t);W>=0?U[W]=V:U.push(V);}}let j=D?.layout||{},te=[];if(D&&Array.isArray(D.layoutRefs)&&(te=[...D.layoutRefs]),P.scope==="Layout"||P.scope==="Both")if(n&&n.length>0)n.forEach(N=>{let V=te.findIndex(W=>W.tableKey===N.tableKey);V>=0?te[V]=N:te.push(N);});else {let N={tableKey:t,layoutId:o||null},V=te.findIndex(W=>W.tableKey===t);V>=0?te[V]=N:te.push(N);}if(L={appId:e,tableKey:t,...P,id:b,createdAt:new Date().toISOString(),filters:U,layout:j,layoutRefs:te},a)await a.saveVariant(L,e,t);else if(s){if(!(await fetch(`${s}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(L)})).ok)throw new Error(m("variant.toast.saveFailed"))}else {let V=d.some(W=>W.id===b)?d.map(W=>W.id===b?L:W):[...d,L];g(V),S(V);}c&&c(m("variant.toast.saveSuccess")),(a||s)&&await A(),v(b),i(L);}catch(D){console.error("Error saving variant",D);let j=d.some(te=>te.id===b)?d.map(te=>te.id===b?L:te):[...d,L];g(j),S(j),v(b),i(L),u&&u(m("variant.toast.saveFailed"));}},onDelete:async P=>{try{if(a)await a.deleteVariant(P);else if(s){if(!(await fetch(`${s}/api/variants/${P}`,{method:"DELETE"})).ok)throw new Error(m("variant.toast.deleteFailed"))}else {let b=d.filter(L=>L.id!==P);g(b),S(b);}f===P&&v(""),(a||s)&&A(),c&&c(m("variant.toast.deleteSuccess"));}catch(b){console.error("Error deleting variant",b);let L=d.filter(D=>D.id!==P);g(L),S(L),f===P&&v(""),u&&u(m("variant.toast.deleteFailed"));}},onSetDefault:async P=>{try{let b=d.find(D=>D.id===P);if(!b)return;let L={appId:e,tableKey:t,...b,isDefault:!0};if(a)await a.setDefaultVariant(P,e,t);else if(s){if(!(await fetch(`${s}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(L)})).ok)throw new Error(m("variant.toast.defaultFailed"))}else {let D=d.map(U=>({...U,isDefault:U.id===P}));g(D),S(D);}(a||s)&&await A(),c&&c(m("variant.toast.defaultSuccess"));}catch(b){console.error("Error setting default variant",b);let L=d.map(D=>({...D,isDefault:D.id===P}));g(L),S(L),u&&u(m("variant.toast.defaultFailed"));}}})};Po.extend(jm);Po.extend(Qm);var Xm=[null,null],ti="0.85rem",Ym={en:"en",zh:"zh-cn",fr:"fr",de:"de",ja:"ja",ko:"ko"},Jm=styled(PickersDay,{shouldForwardProp:e=>e!=="isInRange"&&e!=="isStart"&&e!=="isEnd"&&e!=="isHovered"})(({theme:e,isInRange:t,isStart:r,isEnd:o,isHovered:n})=>({...t&&{borderRadius:0,backgroundColor:e.palette.primary.light,color:e.palette.primary.contrastText,"&:hover":{backgroundColor:e.palette.primary.main}},...n&&!t&&!r&&!o&&{borderRadius:0,backgroundColor:e.palette.action.hover,border:`1px dashed ${e.palette.primary.main}`},...r&&{borderRadius:"50% 0 0 50%",backgroundColor:e.palette.primary.main,color:e.palette.primary.contrastText,"&:hover":{backgroundColor:e.palette.primary.dark}},...o&&{borderRadius:"0 50% 50% 0",backgroundColor:e.palette.primary.main,color:e.palette.primary.contrastText,"&:hover":{backgroundColor:e.palette.primary.dark}},...r&&o&&{borderRadius:"50%"}})),Tl=({label:e,value:t=Xm,onChange:r})=>{let{t:o,locale:n}=q(),i=Ym[n]||"en",a=e||o("dateRange.label"),[s,u]=useState(null),[c,l]=useState(t),[p,m]=useState("start"),[d,g]=useState(null),[h,k]=useState((t[0]||Po()).locale(i)),C=je__default.useRef(t);useEffect(()=>{let[b,L]=t,[D,U]=C.current,j=V=>V&&typeof V.isSame=="function",te=!(b===null&&D===null||j(b)&&j(D)&&b.isSame(D,"day")),N=!(L===null&&U===null||j(L)&&j(U)&&L.isSame(U,"day"));(te||N)&&(l(t),t[0]&&j(t[0])&&k(t[0].locale(i))),C.current=t;},[t,i]);let f=b=>{u(b.currentTarget);},v=()=>{u(null),m("start"),g(null);},y=!!s,S=b=>{if(!b)return;let L=[...c];if(p==="start")L=[b,null],m("end");else {let D=L[0];D&&b.isBefore(D)?(L=[b,null],m("end")):(L=[D,b],m("start"));}l(L);},R=b=>{let L=Po().locale(i),D=[null,null];switch(b){case "today":D=[L,L];break;case "week":D=[L.startOf("week"),L.endOf("week")];break;case "month":D=[L.startOf("month"),L.endOf("month")];break}l(D),m("start"),k(L);},A=()=>{l([null,null]),m("start"),k(Po().locale(i));},T=()=>{r&&r(c),v();},F=()=>{l(t),m("start"),v();},w=useCallback(b=>{let{day:L,...D}=b,[U,j]=c,te=U?L.isSame(U,"day"):false,N=j?L.isSame(j,"day"):false,V=U&&j?L.isBetween(U,j,"day","()"):false,W=false;return p==="end"&&U&&!j&&d&&L.isAfter(U,"day")&&L.isBefore(d.add(1,"day"),"day")&&(W=true),jsx(Jm,{...D,day:L,disableMargin:true,isStart:te,isEnd:N,isInRange:V||W,onMouseEnter:()=>g(L)})},[c,p,d]),I=b=>b?b.locale(i).format("YYYY-MM-DD"):"",P=b=>b?b.locale(i).format("ll"):"";return jsxs(Box,{children:[jsx(TextField,{label:a,value:c[0]?`${I(c[0])} - ${I(c[1])}`:"",onClick:f,fullWidth:true,size:"small",InputLabelProps:{sx:{fontSize:ti}},InputProps:{readOnly:true,sx:{fontSize:ti,"& .MuiOutlinedInput-input":{fontSize:ti},paddingRight:"4px"},endAdornment:jsxs(InputAdornment,{position:"end",sx:{ml:0},children:[(c[0]||c[1])&&jsx(IconButton,{size:"small",onClick:b=>{b.stopPropagation(),A();},edge:"end",sx:{mr:.5,padding:"2px"},children:jsx(Km,{sx:{fontSize:"1rem"}})}),jsx(IconButton,{size:"small",edge:"end",onClick:f,sx:{padding:"2px"},children:jsx(_m,{sx:{fontSize:"1rem"},color:"action"})})]})}}),jsxs(Popover,{open:y,anchorEl:s,onClose:v,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{sx:{display:"flex",flexDirection:"column",p:0,minWidth:320}}},children:[jsx(Box,{sx:{p:2,bgcolor:"background.default",borderBottom:1,borderColor:"divider"},children:jsxs(Stack,{direction:"row",alignItems:"center",spacing:2,justifyContent:"space-between",children:[jsxs(Box,{sx:{p:1,border:1,borderColor:p==="start"?"primary.main":"divider",borderRadius:1,bgcolor:p==="start"?"action.hover":"transparent",flex:1,cursor:"pointer"},onClick:()=>m("start"),children:[jsx(Typography,{variant:"caption",color:"text.secondary",display:"block",children:o("dateRange.startDate")}),jsx(Typography,{variant:"body2",fontWeight:500,children:c[0]?P(c[0]):o("dateRange.select")})]}),jsx(Zm,{color:"action",fontSize:"small"}),jsxs(Box,{sx:{p:1,border:1,borderColor:p==="end"?"primary.main":"divider",borderRadius:1,bgcolor:p==="end"?"action.hover":"transparent",flex:1,cursor:"pointer"},onClick:()=>{c[0]&&m("end");},children:[jsx(Typography,{variant:"caption",color:"text.secondary",display:"block",children:o("dateRange.endDate")}),jsx(Typography,{variant:"body2",fontWeight:500,children:c[1]?P(c[1]):o("dateRange.select")})]})]})}),jsx(Box,{sx:{p:2,pb:0},children:jsxs(Stack,{direction:"row",spacing:1,justifyContent:"center",children:[jsx(Chip,{label:o("dateRange.today"),onClick:()=>R("today"),clickable:true,size:"small",variant:"outlined"}),jsx(Chip,{label:o("dateRange.thisWeek"),onClick:()=>R("week"),clickable:true,size:"small",variant:"outlined"}),jsx(Chip,{label:o("dateRange.thisMonth"),onClick:()=>R("month"),clickable:true,size:"small",variant:"outlined"})]})}),jsx(LocalizationProvider,{dateAdapter:AdapterDayjs,adapterLocale:i,children:jsx(DateCalendar,{value:null,referenceDate:h,onMonthChange:k,onYearChange:k,onChange:S,slots:{day:w},views:["day"],showDaysOutsideCurrentMonth:true,sx:{m:0}})}),jsx(Divider,{}),jsxs(Stack,{direction:"row",justifyContent:"flex-end",spacing:1,sx:{p:2},children:[jsx(Button,{size:"small",onClick:F,color:"inherit",children:o("common.cancel")}),jsx(Button,{size:"small",variant:"contained",onClick:T,children:o("common.done")})]})]})]})};var Tr={equals:"=",contains:"\u2287",notContains:"\u2285",wildcard:"*","=":"=","!=":"!=",">":">","<":"<",">=":"\u2265","<=":"\u2264",between:"\u2194"},dg={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"},ug=["equals","contains","notContains","wildcard"],Rl=["=","!=",">","<",">=","<=","between"],Be="0.85rem",pg=({field:e,value:t,onChange:r})=>{let{t:o}=q(),[n,i]=useState(null),[a,s]=useState(null),[u,c]=useState(""),[l,p]=useState(""),[m,d]=useState(false),[g,h]=useState(""),[k,C]=useState("");useEffect(()=>{let I=setTimeout(()=>{C(g);},1e3);return ()=>clearTimeout(I)},[g]);let f=t?.operator||(e.type==="number"?"=":"equals"),v=t?.value,y=I=>{let P=dg[I];return P?o(P):I},S=I=>{i(I.currentTarget);},R=I=>{r({...t,operator:I,value:v}),i(null);},A={size:"small",fullWidth:true,variant:"outlined",InputLabelProps:{sx:{fontSize:Be}},InputProps:{sx:{fontSize:Be}},SelectProps:{MenuProps:{PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:Be,paddingTop:"4px",paddingBottom:"4px",minHeight:"auto"}}}}}},T=e.type||"text";if(T==="date"){let P=(b=>{if(!b)return [null,null];if(Array.isArray(b)&&b.length===2){let L=b[0]?Po.isDayjs(b[0])?b[0]:Po(b[0]):null,D=b[1]?Po.isDayjs(b[1])?b[1]:Po(b[1]):null;return [L,D]}return Po.isDayjs(b)||typeof b=="string"?[Po.isDayjs(b)?b:Po(b),null]:[null,null]})(v);return jsx(Tl,{label:e.label,value:P,onChange:b=>r({value:b,operator:"between"})})}if(T==="number"&&f==="between"){let I=()=>{r({value:[u,l],operator:"between"}),s(null);},P=Array.isArray(v)?`${v[0]||""} - ${v[1]||""}`:"";return jsxs(Fragment,{children:[jsx(TextField,{...A,label:e.label,value:P,placeholder:o("smartFilter.minMaxPlaceholder"),InputProps:{...A.InputProps,startAdornment:jsx(InputAdornment,{position:"start",children:jsx(Tooltip,{title:y("between"),children:jsx(IconButton,{size:"small",onClick:S,sx:{width:24,height:24,fontSize:Be},children:Tr.between})})}),readOnly:true},onClick:b=>s(b.currentTarget)}),jsx(Menu,{anchorEl:n,open:!!n,onClose:()=>i(null),PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:Be,minHeight:"auto",py:.5}}},children:Rl.map(b=>jsxs(MenuItem,{selected:b===f,onClick:()=>R(b),children:[jsx(Box,{sx:{width:24,display:"inline-block",fontWeight:"bold"},children:Tr[b]}),jsx(ListItemText,{primary:y(b),primaryTypographyProps:{fontSize:Be}})]},b))}),jsx(Popover,{open:!!a,anchorEl:a,onClose:()=>s(null),anchorOrigin:{vertical:"bottom",horizontal:"left"},children:jsxs(Box,{sx:{p:2,display:"flex",gap:1,alignItems:"center"},children:[jsx(TextField,{size:"small",label:o("smartFilter.min"),type:"number",value:u,onChange:b=>c(b.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:Be}},InputProps:{sx:{fontSize:Be}}}),jsx(cg,{color:"action"}),jsx(TextField,{size:"small",label:o("smartFilter.max"),type:"number",value:l,onChange:b=>p(b.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:Be}},InputProps:{sx:{fontSize:Be}}}),jsx(Button,{variant:"contained",size:"small",onClick:I,children:o("common.ok")})]})})]})}if(T==="select")return jsxs(TextField,{...A,select:true,label:e.label,value:v||"",onChange:I=>r({...t,value:I.target.value,operator:"equals"}),children:[jsx(MenuItem,{value:"",children:jsx("em",{children:o("common.none")})}),e.options?.map(I=>jsx(MenuItem,{value:I.value,children:I.label},I.value))]});if(T==="multi-select"){let I=Array.isArray(v)?v:[],P=e.options?.filter(b=>b.label.toLowerCase().includes(k.toLowerCase()))||[];return jsxs(TextField,{...A,select:true,label:e.label,value:I,onChange:b=>r({...t,value:b.target.value,operator:"anyOf"}),SelectProps:{...A.SelectProps,multiple:true,onClose:()=>{h(""),C("");},renderValue:b=>{if(!Array.isArray(b)||b.length===0)return jsx("em",{children:o("common.none")});let L=U=>e.options?.find(j=>j.value===U)?.label||U,D=b.map(L);return D.length>2?`${D.slice(0,2).join(", ")} +${D.length-2}`:D.join(", ")}},children:[jsx(ListSubheader,{children:jsx(TextField,{size:"small",autoFocus:true,placeholder:o("smartFilter.searchPlaceholder"),fullWidth:true,InputProps:{startAdornment:jsx(InputAdornment,{position:"start",children:jsx(Pl,{fontSize:"small"})}),sx:{fontSize:Be}},value:g,onChange:b=>h(b.target.value),onKeyDown:b=>{b.key!=="Escape"&&b.stopPropagation();},onClick:b=>b.stopPropagation()})}),P.length>0?P.map(b=>jsxs(MenuItem,{value:b.value,children:[jsx(Checkbox,{checked:I.indexOf(b.value)>-1,size:"small"}),jsx(ListItemText,{primary:b.label,primaryTypographyProps:{fontSize:Be}})]},b.value)):jsx(MenuItem,{disabled:true,children:jsx(ListItemText,{primary:o("smartFilter.noOptionsFound"),primaryTypographyProps:{fontSize:Be}})})]})}let F=T==="number"?Rl:ug,w=m||v!==void 0&&v!==""&&v!==null||!!n;return jsxs(Fragment,{children:[jsx(TextField,{...A,label:e.label,sx:{minWidth:"120px"},value:v||"",type:T==="number"?"number":"text",onChange:I=>r({...t,value:I.target.value,operator:f}),onFocus:()=>d(true),onBlur:()=>d(false),InputProps:{...A.InputProps,startAdornment:w?jsx(InputAdornment,{position:"start",children:jsx(Tooltip,{title:y(f),children:jsx(IconButton,{size:"small",onClick:S,onMouseDown:I=>I.preventDefault(),sx:{width:24,height:24,fontSize:Be,fontWeight:"bold",color:"primary.main",bgcolor:"action.hover"},children:Tr[f]})})}):null,endAdornment:e.hasSearchIcon?jsx(InputAdornment,{position:"end",children:jsx(Pl,{color:"action"})}):void 0}}),jsx(Menu,{anchorEl:n,open:!!n,onClose:()=>i(null),PaperProps:{sx:{"& .MuiMenuItem-root":{fontSize:Be,minHeight:"auto",py:.5}}},children:F.map(I=>jsxs(MenuItem,{selected:I===f,onClick:()=>R(I),children:[jsx(Box,{sx:{width:24,display:"inline-block",fontWeight:"bold"},children:Tr[I]}),jsx(ListItemText,{primary:y(I),primaryTypographyProps:{fontSize:Be}})]},I))})]})},Ba=({fields:e,filters:t,onFilterChange:r,variants:o=[],currentVariantId:n,onVariantLoad:i,onVariantSave:a,onVariantDelete:s,onVariantSetDefault:u,onSearch:c,loading:l=false,appId:p,tableKey:m,currentLayout:d,currentLayoutId:g,layoutRefs:h,variantService:k,serviceUrl:C})=>{let{t:f}=q(),[v,y]=useState(true),[S,R]=useState(null),[A,T]=useState(e.filter(P=>!P.hidden).map(P=>P.id)),F=(P,b)=>{r({...t,[P]:b});},w=P=>{A.includes(P)?T(A.filter(b=>b!==P)):T([...A,P]);};return jsxs(Paper,{sx:{mb:0,display:"flex",flexDirection:"column",overflow:"visible",position:"relative"},children:[jsxs(Box,{sx:{p:2,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[p?jsx(kl,{appId:p,tableKey:m,currentFilters:{values:t,visibleFields:A},currentLayout:d,currentLayoutId:g,layoutRefs:h,onLoad:P=>{if(!P.filters)return;let b=null;if(Array.isArray(P.filters)){let L=m||"default",D=P.filters.find(U=>U.scope===L);b=D?D.filters:null;}else b=P.filters;b&&(b.values||b.visibleFields?(b.visibleFields&&Array.isArray(b.visibleFields)&&T(b.visibleFields),b.values&&r(b.values)):r(b)),i&&i(P);},variantService:k,serviceUrl:C,currentVariantId:n}):jsx(Cr,{variants:o,currentVariantId:n,onLoad:i,onSave:P=>{a&&a({...P,filters:{values:t,visibleFields:A}});},onDelete:s,onSetDefault:u}),jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[jsx(Tooltip,{title:f("smartFilter.addFilters"),children:jsx(Button,{onClick:P=>R(P.currentTarget),size:"small",color:"primary",startIcon:jsx(ig,{fontSize:"small"}),sx:{textTransform:"none",fontSize:Be,whiteSpace:"nowrap",minWidth:"fit-content"},children:f("smartFilter.adaptFilters")})}),jsx(Button,{variant:"contained",size:"small",onClick:c,disabled:l,sx:{minWidth:"40px",fontWeight:"bold",fontSize:Be},children:f(l?"common.loading":"smartFilter.go")}),jsxs(Menu,{anchorEl:S,open:!!S,onClose:()=>R(null),slotProps:{paper:{style:{maxHeight:400,width:"25ch"},sx:{"& .MuiMenuItem-root":{fontSize:Be,minHeight:32}}}},children:[jsx(MenuItem,{disabled:true,children:jsx(ListItemText,{primary:f("smartFilter.visibleFilters"),primaryTypographyProps:{fontSize:Be}})}),jsx(Divider,{}),e.map(P=>jsxs(MenuItem,{onClick:()=>w(P.id),children:[jsx(Checkbox,{checked:A.includes(P.id),size:"small"}),jsx(ListItemText,{primary:P.label,primaryTypographyProps:{fontSize:Be}})]},P.id))]})]})]}),jsx(Collapse,{in:v,children:jsx(Box,{sx:{px:2,pb:2},children:jsx(Grid,{container:true,spacing:2,columns:{xs:2,sm:3,md:4,lg:6},children:e.filter(P=>A.includes(P.id)).map(P=>jsx(Grid,{size:1,children:jsx(pg,{field:P,value:t[P.id]||{value:"",operator:P.type==="number"?"=":"equals"},onChange:b=>F(P.id,b)})},P.id))})})}),jsx(Box,{sx:{position:"absolute",bottom:0,left:"50%",transform:"translate(-50%, 50%)",zIndex:10},children:jsx(IconButton,{size:"small",onClick:()=>y(!v),sx:{bgcolor:"background.paper",boxShadow:2,border:"1px solid",borderColor:"divider",width:20,height:20,minHeight:0,p:0,"&:hover":{bgcolor:"background.paper"}},children:v?jsx(sg,{sx:{fontSize:16},color:"action"}):jsx(pp,{sx:{fontSize:16},color:"action"})})})]})};var Nl=({layouts:e,currentLayoutId:t,onLoad:r,onSave:o,onDelete:n,onSetDefault:i})=>{let{t:a}=q(),[s,u]=useState(null),[c,l]=useState(false),[p,m]=useState(""),[d,g]=useState(""),[h,k]=useState({isDefault:false,isPublic:false}),C=e.find(A=>A.id===t),f=A=>{u(A.currentTarget);},v=()=>{u(null);},y=A=>{r(A),v();},S=()=>{m(""),g(""),k({isDefault:false,isPublic:false}),l(true),v();},R=()=>{p.trim()&&(o({name:p,description:d,...h}),l(false));};return jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[jsx(Tooltip,{title:a("layout.saveLayout"),children:jsx(IconButton,{onClick:S,color:"primary",size:"small",children:jsx(El,{})})}),jsx(Tooltip,{title:a("layout.layoutOptions"),children:jsx(IconButton,{onClick:f,color:C?"primary":"default",children:jsx(wg,{})})}),jsxs(Menu,{anchorEl:s,open:!!s,onClose:v,PaperProps:{sx:{width:320,maxHeight:400}},children:[jsx(MenuItem,{disabled:true,children:jsx(Typography,{variant:"caption",children:a("layout.selectLayout")})}),jsxs(MenuItem,{onClick:S,children:[jsx(ListItemIcon,{children:jsx(El,{fontSize:"small"})}),jsx(ListItemText,{children:a("layout.saveCurrentLayout")})]}),jsx(Divider,{}),e.length===0&&jsx(MenuItem,{disabled:true,children:jsx(Typography,{variant:"body2",color:"text.secondary",children:a("layout.noSavedLayouts")})}),e.map((A,T)=>jsx(MenuItem,{onClick:()=>y(A),selected:A.id===t,children:jsxs(Box,{sx:{display:"flex",alignItems:"center",width:"100%",justifyContent:"space-between"},children:[jsxs(Box,{sx:{display:"flex",flexDirection:"column",overflow:"hidden",mr:1},children:[jsx(Box,{sx:{display:"flex",alignItems:"center",gap:1},children:jsx(Typography,{variant:"body2",fontWeight:A.id===t?"bold":"normal",noWrap:true,children:A.name})}),A.description&&jsx(Typography,{variant:"caption",color:"text.secondary",noWrap:true,children:A.description})]}),jsxs(Box,{sx:{display:"flex",alignItems:"center"},onClick:F=>F.stopPropagation(),children:[jsx(Tooltip,{title:A.isDefault?a("layout.removeDefault"):a("layout.setAsDefault"),children:jsx(IconButton,{size:"small",onClick:F=>{F.stopPropagation(),i(A.id);},children:A.isDefault?jsx(Mm,{fontSize:"small",color:"warning"}):jsx(Sg,{fontSize:"small"})})}),jsx(Tooltip,{title:a("common.delete"),children:jsx(IconButton,{size:"small",color:"error",onClick:F=>{F.stopPropagation(),n(A.id);},children:jsx(Ku,{fontSize:"small"})})})]})]})},A.id||T))]}),jsxs(Dialog,{open:c,onClose:()=>l(false),maxWidth:"xs",fullWidth:true,children:[jsx(DialogTitle,{children:a("layout.saveLayout")}),jsx(DialogContent,{children:jsxs(Box,{sx:{display:"flex",flexDirection:"column",gap:2,mt:1},children:[jsx(TextField,{label:a("layout.layoutName"),value:p,onChange:A=>m(A.target.value),fullWidth:true,autoFocus:true,size:"small",helperText:a("layout.layoutNameHelper")}),e.some(A=>A.name===p)&&jsx(Typography,{variant:"caption",color:"warning.main",sx:{ml:1},children:a("layout.warningOverwrite")}),jsx(TextField,{label:a("layout.layoutDescription"),value:d,onChange:A=>g(A.target.value),fullWidth:true,size:"small"}),jsx(FormControlLabel,{control:jsx(Checkbox,{checked:h.isDefault,onChange:A=>k({...h,isDefault:A.target.checked})}),label:a("layout.useAsDefault")}),jsx(FormControlLabel,{control:jsx(Checkbox,{checked:h.isPublic,onChange:A=>k({...h,isPublic:A.target.checked})}),label:a("layout.publicAllUsers")})]})}),jsxs(DialogActions,{children:[jsx(Button,{onClick:()=>l(false),children:a("common.cancel")}),jsx(Button,{onClick:R,variant:"contained",disabled:!p,children:a("common.save")})]})]})]})};var Ol=({appId:e,tableKey:t="default",currentLayoutData:r,onLayoutLoad:o,targetLayoutId:n,activeLayoutId:i,serviceUrl:a,onError:s,onSuccess:u})=>{let{t:c}=q(),[l,p]=useState([]),[m,d]=useState(""),g=`orbcafe.layouts.${e}.${t}`,h=T=>({id:T.layoutId,name:T.name,description:T.description??"",isDefault:!!T.isDefault,isPublic:!!T.isPublic,createdAt:T.createdAt??new Date().toISOString(),layoutData:T.layout??{}}),k=T=>({appId:e,tableKey:t,layoutId:T.id,name:T.name,description:T.description??"",isDefault:!!T.isDefault,isPublic:!!T.isPublic,createdAt:T.createdAt,layout:T.layoutData}),C=useCallback(()=>{try{let T=localStorage.getItem(g);if(!T)return [];let F=JSON.parse(T);return Array.isArray(F)?F:[]}catch{return []}},[g]),f=useCallback(T=>{try{localStorage.setItem(g,JSON.stringify(T));}catch{}},[g]);useEffect(()=>{i!==void 0&&d(i);},[i]),useEffect(()=>{if(n&&l.length>0){let T=l.find(F=>F.id===n);T&&(d(T.id),o(T));}},[n,l,o]);let v=useCallback(async()=>{if(e){if(!a){let T=C();p(T);let F=T.find(w=>w.isDefault);F&&!m&&!n&&(d(F.id),o(F));return}try{let T=await fetch(`${a}/api/layouts?appId=${encodeURIComponent(e)}&tableKey=${encodeURIComponent(t)}`);if(!T.ok)throw new Error("LAYOUT_FETCH_FAILED");let w=(await T.json()).map(h);p(w);let I=w.find(P=>P.isDefault);I&&!m&&!n&&(d(I.id),o(I));}catch(T){console.error("Error fetching layouts",T);let F=C();p(F);let w=F.find(I=>I.isDefault);w&&!m&&!n&&(d(w.id),o(w)),s&&s(c("layout.toast.loadFallback"));}}},[e,t,a,s,m,o,n,C,c]);return useEffect(()=>{v();},[e,t]),jsx(Nl,{layouts:l,currentLayoutId:m,onLoad:T=>{d(T.id),o(T);},onSave:async T=>{let F=l.find(P=>P.name===T.name),w=F?F.id:Date.now().toString(),I={id:w,...T,createdAt:new Date().toISOString(),layoutData:r,isDefault:T.isDefault??false,isPublic:T.isPublic??false};if(!a){let b=l.some(L=>L.id===w)?l.map(L=>L.id===w?I:L):[...l,I];p(b),f(b),d(w),o(I),u&&u(c("layout.toast.saveLocalSuccess"));return}try{if(!(await fetch(`${a}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(k(I))})).ok)throw new Error("LAYOUT_SAVE_FAILED");u&&u(c("layout.toast.saveSuccess")),await v(),d(w),o(I);}catch(P){console.error("Error saving layout",P);let L=l.some(D=>D.id===w)?l.map(D=>D.id===w?I:D):[...l,I];p(L),f(L),d(w),o(I),u&&u(c("layout.toast.saveLocalSuccess")),s&&s(c("layout.toast.backendUnavailableSavedLocal"));}},onDelete:async T=>{if(!a){let F=l.filter(w=>w.id!==T);p(F),f(F),m===T&&d(""),u&&u(c("layout.toast.deleteLocalSuccess"));return}try{if(!(await fetch(`${a}/api/layouts/${encodeURIComponent(T)}`,{method:"DELETE"})).ok)throw new Error("LAYOUT_DELETE_FAILED");m===T&&d(""),u&&u(c("layout.toast.deleteSuccess")),await v();}catch(F){console.error("Error deleting layout",F);let w=l.filter(I=>I.id!==T);p(w),f(w),m===T&&d(""),u&&u(c("layout.toast.deleteLocalSuccess")),s&&s(c("layout.toast.backendUnavailableDeletedLocal"));}},onSetDefault:async T=>{if(!a){let F=l.map(w=>({...w,isDefault:w.id===T}));p(F),f(F),u&&u(c("layout.toast.defaultLocalSuccess"));return}try{let F=l.find(I=>I.id===T);if(!F)return;if(!(await fetch(`${a}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(k({...F,isDefault:!0}))})).ok)throw new Error("LAYOUT_DEFAULT_FAILED");u&&u(c("layout.toast.defaultSuccess")),await v();}catch(F){console.error("Error setting default",F);let w=l.map(I=>({...I,isDefault:I.id===T}));p(w),f(w),u&&u(c("layout.toast.defaultLocalSuccess")),s&&s(c("layout.toast.backendUnavailableDefaultLocal"));}}})};var Vl=(e,t)=>{if(!e||!e.filters)return null;if(Array.isArray(e.filters)){let r=e.filters.find(n=>n.scope===t);if(r)return r.filters;let o=e.filters.find(n=>n.scope==="default");return o?o.filters:null}return typeof e.filters=="object"?e.filters:null},Dr=(e,t)=>{if(!e)return {layout:null,layoutId:null};let r=null,o=null;if(Array.isArray(e.layoutRefs)){let n=e.layoutRefs.find(i=>i.tableKey===t);n&&(r=n.layoutId);}return !r&&e.layoutId&&(r=e.layoutId),e.layout&&typeof e.layout=="object"&&!Array.isArray(e.layout)&&(o=e.layout),{layoutId:r,layout:o}};function $l(e,t,r){return t[r]<e[r]?-1:t[r]>e[r]?1:0}function Ig(e,t){return e==="desc"?(r,o)=>$l(r,o,t):(r,o)=>-$l(r,o,t)}function Pg(e,t){let r=e.map((o,n)=>[o,n]);return r.sort((o,n)=>{let i=t(o[0],n[0]);return i!==0?i:o[1]-n[1]}),r.map(o=>o[0])}var Gl=e=>{let t=useCallback(B=>{let O=String(B?.label??B?.id??"").length*9+64,ne=typeof B?.minWidth=="number"?B.minWidth:0;return Math.max(100,ne,O)},[]),r=useCallback(()=>(e.columns||[]).filter(B=>!!B?.numeric).map(B=>B.id),[e.columns]),[o,n]=useState(""),[i,a]=useState(e.order||"asc"),[s,u]=useState(e.orderBy||""),[c,l]=useState(e.page||0),[p,m]=useState(e.rowsPerPage||20),[d,g]=useState(e.selected||[]),[h,k]=useState(e.columns?e.columns.map(B=>B.id):[]),[C,f]=useState(e.showSummary||false),[v,y]=useState(()=>r()),[S,R]=useState([]),[A,T]=useState(new Set),[F,w]=useState(()=>{let B={};return (e.columns||[]).forEach(z=>{B[z.id]=t(z);}),B}),[I,P]=useState(null),[b,L]=useState(null),[D,U]=useState(null),[j,te]=useState(null),[N,V]=useState(false),[W,H]=useState(""),[Oe,Te]=useState("");useEffect(()=>{e.layout&&to(e.layout);},[e.layout]),useEffect(()=>{e.order!==void 0&&a(e.order),e.orderBy!==void 0&&u(e.orderBy);},[e.order,e.orderBy]),useEffect(()=>{e.selected!==void 0&&g(e.selected);},[e.selected]),useEffect(()=>{e.page!==void 0&&l(e.page);},[e.page]),useEffect(()=>{e.rowsPerPage!==void 0&&m(e.rowsPerPage);},[e.rowsPerPage]),useEffect(()=>{let B=r();y(z=>z.filter(ne=>B.includes(ne)));},[r]),useEffect(()=>{w(B=>{let z={...B};return (e.columns||[]).forEach(O=>{z[O.id]===void 0&&(z[O.id]=t(O));}),z});},[e.columns,t]);let Ee=useMemo(()=>{let B=e.rows||[];return o&&(B=B.filter(z=>Object.keys(z).some(O=>String(z[O]).toLowerCase().includes(o.toLowerCase())))),B},[e.rows,o]),ee=useMemo(()=>e.onSortChange||!s?Ee:Pg(Ee,Ig(i,s)),[Ee,i,s,e.onSortChange]),ye=useCallback(B=>{if(S.length===0)return B.map(de=>({type:"row",data:de,id:de[e.rowKey||"id"]}));let z=[...B].sort((de,pe)=>{for(let be of S){if(de[be]<pe[be])return -1;if(de[be]>pe[be])return 1}return 0}),O=(de,pe=0)=>{if(pe>=S.length)return de;let be=S[pe],xe={},qe=[];return de.forEach(Me=>{let _e=Me[be],ue=`${be}:${_e}`;xe[ue]||(xe[ue]={key:ue,field:be,value:_e,children:[],count:0,level:pe},qe.push(xe[ue])),xe[ue].children.push(Me),xe[ue].count++;}),qe.forEach(Me=>{Me.children&&(Me.children=O(Me.children,pe+1));}),qe},ne=O(z),ie=(de,pe="")=>{let be=[];return de.forEach(xe=>{if(xe.children){let qe=pe?`${pe}>${xe.key}`:xe.key,Me=A.has(qe);be.push({type:"group",id:qe,field:xe.field,value:xe.value,level:xe.level,count:xe.count,isExpanded:Me,childIds:(function _e(ue){let Wt=[];return ue.children.forEach(ao=>{ao.children?Wt=Wt.concat(_e(ao)):Wt.push(ao[e.rowKey||"id"]);}),Wt})(xe)}),Me&&(be=be.concat(ie(xe.children,qe)));}else be.push({type:"row",data:xe,id:xe[e.rowKey||"id"],level:S.length});}),be};return ie(ne)},[S,A,e.rowKey]),Ae=useCallback(B=>{if(S.length===0)return [];let z=[...B].sort((ie,de)=>{for(let pe of S){if(ie[pe]<de[pe])return -1;if(ie[pe]>de[pe])return 1}return 0}),O=[],ne=(ie,de,pe)=>{if(de>=S.length)return;let be=S[de],xe=new Map;ie.forEach(qe=>{let Me=qe[be],_e=xe.get(Me);_e?_e.push(qe):xe.set(Me,[qe]);}),xe.forEach((qe,Me)=>{let _e=`${be}:${Me}`,ue=pe?`${pe}>${_e}`:_e;O.push(ue),ne(qe,de+1,ue);});};return ne(z,0,""),O},[S]),We=useMemo(()=>ye(ee),[ee,ye]),kt=useMemo(()=>Ae(ee),[ee,Ae]),Ve=useMemo(()=>{let B=(e.rows||[]).length;return typeof e.count=="number"&&e.count>B},[e.count,e.rows]),at=useMemo(()=>Ve?We:p>0?We.slice(c*p,c*p+p):We,[We,c,p,Ve]),Ie=useMemo(()=>Ve&&typeof e.count=="number"?e.count:We.length,[We.length,Ve,e.count]),Se=B=>{T(z=>{let O=new Set(z);return O.has(B)?O.delete(B):O.add(B),O});},Xe=B=>{let z=kt.filter(O=>O===B||O.startsWith(`${B}>`));T(O=>{let ne=new Set(O);return z.forEach(ie=>ne.add(ie)),ne});},Ye=B=>{T(z=>{let O=new Set(z);return Array.from(O).forEach(ne=>{(ne===B||ne.startsWith(`${B}>`))&&O.delete(ne);}),O});},rt=B=>{if(!B){T(new Set);return}T(new Set(kt));},Gt=B=>{let z=kt.filter(O=>O.startsWith(`${B}>`));return z.length===0?A.has(B):A.has(B)&&z.every(O=>A.has(O))},ma=B=>{let z=s===B&&i==="asc",O=s===B&&i==="desc";if(e.onSortChange){z?e.onSortChange(B,"desc"):O?e.onSortChange("","asc"):e.onSortChange(B,"asc");return}z?(a("desc"),u(B)):O?(a("asc"),u("")):(a("asc"),u(B));},Ue=(B,z)=>{w(O=>({...O,[B]:z}));},ga=B=>{if(B.target.checked){let z=Ee.map(O=>O[e.rowKey||"id"]);g(z),e.onSelectionChange&&e.onSelectionChange(z);return}g([]),e.onSelectionChange&&e.onSelectionChange([]);},mt=(B,z)=>{let O=z[e.rowKey||"id"],ne=d.indexOf(O),ie=[];ne===-1?ie=ie.concat(d,O):ne===0?ie=ie.concat(d.slice(1)):ne===d.length-1?ie=ie.concat(d.slice(0,-1)):ne>0&&(ie=ie.concat(d.slice(0,ne),d.slice(ne+1))),g(ie),e.onSelectionChange&&e.onSelectionChange(ie);},nt=B=>{l(B),e.onPageChange&&e.onPageChange(B);},tt=B=>{m(B),l(0),e.onPageChange&&e.onPageChange(0),e.onRowsPerPageChange&&e.onRowsPerPageChange(B);},it=B=>{let z=h.indexOf(B),O=[...h];z===-1?O.push(B):O.splice(z,1),k(O);},eo=B=>{let z=S.indexOf(B),O=[...S];z===-1?O.push(B):O.splice(z,1),R(O);},vo=B=>{r().includes(B)&&y(O=>O.includes(B)?O.filter(ne=>ne!==B):[...O,B]);},fa=B=>{e.onLayoutSave&&e.onLayoutSave({visibleColumns:h,order:i,orderBy:s,grouping:S,columnWidths:F,showSummary:C,summaryColumns:v});},Ht=B=>{let{layout:z,layoutId:O}=Dr(B,e.tableKey||"default");O?(Te(O),H(O)):(Te(""),H("")),z&&(z.visibleColumns&&k(z.visibleColumns),z.order&&a(z.order),z.orderBy&&u(z.orderBy),z.grouping&&R(z.grouping),z.columnWidths&&w(z.columnWidths),z.showSummary!==void 0&&f(!!z.showSummary),Array.isArray(z.summaryColumns)&&y(z.summaryColumns));},to=B=>{let z=B?.layoutData||B?.layout||B||{};z.visibleColumns&&k(z.visibleColumns),z.order&&a(z.order),z.orderBy!==void 0&&u(z.orderBy),z.grouping&&R(z.grouping),z.columnWidths&&w(z.columnWidths),z.showSummary!==void 0&&f(!!z.showSummary),Array.isArray(z.summaryColumns)&&y(z.summaryColumns),T(new Set),l(0),B?.id&&H(B.id),Te("");};useEffect(()=>{e.layout&&Ht({layout:e.layout});},[e.layout]);let ha=B=>{B.preventDefault(),te(j===null?{mouseX:B.clientX+2,mouseY:B.clientY-6}:null);},St=()=>{te(null);},wt=useMemo(()=>{if(!C)return {};let B={};e.columns.forEach(O=>{if(O.numeric&&v.includes(O.id)){let ne=Ee.reduce((ie,de)=>{let pe=parseFloat(de[O.id]);return ie+(isNaN(pe)?0:pe)},0);B[O.id]=ne.toFixed(2);}else B[O.id]="";});let z=e.columns.find(O=>h.includes(O.id));return z&&!z.numeric&&(B[z.id]="Total"),B},[Ee,e.columns,C,v,h]),Dt=()=>{if(!e.columns||!Ee)return;let B=e.columns.map(de=>de.label).join(","),z=Ee.map(de=>e.columns.map(pe=>{let be=de[pe.id];return `"${(be==null?"":String(be)).replace(/"/g,'""')}"`}).join(",")).join(`
|
|
2
|
+
`),O=`data:text/csv;charset=utf-8,${B}
|
|
3
|
+
${z}`,ne=encodeURI(O),ie=document.createElement("a");ie.setAttribute("href",ne),ie.setAttribute("download",`${e.title||"export"}.csv`),document.body.appendChild(ie),ie.click(),document.body.removeChild(ie);},Tt=()=>{V(true);},oo=()=>{V(false);};return {isMobile:false,columns:e.columns,order:i,orderBy:s,filterText:o,setFilterText:n,visibleColumns:h,setVisibleColumns:k,showSummary:C,setShowSummary:f,summaryColumns:v,grouping:S,setGrouping:R,expandedGroups:A,setExpandedGroups:T,groupAnchorEl:b,setGroupAnchorEl:L,summaryAnchorEl:D,setSummaryAnchorEl:U,columnWidths:F,setColumnWidths:w,anchorEl:I,setAnchorEl:P,contextMenu:j,setContextMenu:te,sensors:void 0,sortedAndFilteredRows:ee,visibleRows:at,summaryRow:wt,page:c,setPage:nt,rowsPerPage:p,setRowsPerPage:tt,totalDisplayCount:Ie,selected:d,setSelected:g,isAllExpanded:kt.length>0&&kt.every(B=>A.has(B)),handleColumnResize:Ue,handleRequestSort:ma,handleSelectAllClick:ga,handleClick:mt,toggleSummaryColumn:vo,handleDragEnd:()=>{},handleExport:Dt,handleContextMenu:ha,handleCloseContextMenu:St,toggleColumnVisibility:it,toggleGroupExpand:Se,toggleGroupField:eo,handleToggleAll:rt,handleExpandGroupRecursively:Xe,handleCollapseGroupRecursively:Ye,isGroupFullyExpanded:Gt,handleLayoutLoad:to,handleVariantLoad:Ht,handleLayoutSave:fa,effectiveAppId:e.appId||"",currentLayoutData:{visibleColumns:h,order:i,orderBy:s,grouping:S,columnWidths:F,showSummary:C,summaryColumns:v},currentLayoutId:W,layoutIdToLoad:Oe,onPageChange:nt,onRowsPerPageChange:tt,graphReportOpen:N,handleOpenGraphReport:Tt,handleCloseGraphReport:oo}};var ew=e=>jsx(Ag,{...e}),tw=e=>jsx(zn,{...e}),ow=e=>jsx(Zl,{...e}),aw=e=>jsx(Ju,{...e}),rw=e=>jsx(ep,{...e}),mo=e=>{let{t}=q(),r="0.85rem",{title:o,showToolbar:n=true,selectionMode:i,selected:a=[],onSelectionChange:s,actions:u,extraTools:c,fitContainer:l=false,fullWidth:p=false,maxHeight:m,loading:d=false,rowsPerPageOptions:g=[20,50,100,-1],onLayoutSave:h,filterConfig:k,rowKey:C,tableKey:f="default",graphReport:v,quickCreate:y,quickEdit:S,quickDelete:R,serviceUrl:A}=e,T=o||t("table.title.default"),{isMobile:F,columns:w,order:I,orderBy:P,filterText:b,setFilterText:L,visibleColumns:D,showSummary:U,setShowSummary:j,summaryColumns:te,grouping:N,setGrouping:V,expandedGroups:W,groupAnchorEl:H,setGroupAnchorEl:Oe,summaryAnchorEl:Te,setSummaryAnchorEl:Ee,columnWidths:ee,anchorEl:ye,setAnchorEl:Ae,contextMenu:We,sensors:kt,sortedAndFilteredRows:Ve,summaryRow:at,visibleRows:Ie,isAllExpanded:Se,page:Xe,setPage:Ye,rowsPerPage:rt,setRowsPerPage:Gt,totalDisplayCount:ma,setSelected:Ue,handleColumnResize:ga,handleRequestSort:mt,handleSelectAllClick:nt,handleClick:tt,toggleSummaryColumn:it,handleDragEnd:eo,handleExport:vo,handleContextMenu:fa,handleCloseContextMenu:Ht,toggleColumnVisibility:to,toggleGroupExpand:ha,toggleGroupField:St,handleToggleAll:wt,handleExpandGroupRecursively:Dt,handleCollapseGroupRecursively:Tt,isGroupFullyExpanded:oo,handleLayoutLoad:B,handleVariantLoad:z,handleLayoutSave:O,effectiveAppId:ne,currentLayoutData:ie,currentLayoutId:de,layoutIdToLoad:pe,graphReportOpen:be,handleOpenGraphReport:xe,handleCloseGraphReport:qe}=Gl(e),Me=v?.enabled??false,_e=Me&&(v?.interaction?.enabled??true),ue=gl(),Wt=!!y?.enabled,ao=!!S?.enabled,ya=!!R?.enabled,$o=y?.fields,Go=y?.excludeFields||[],xn=y?.initialValues||{},[x,M]=je__default.useState(false),[E,$]=je__default.useState(false),[J,oe]=je__default.useState({}),[se,Z]=je__default.useState(false),[le,st]=je__default.useState(false),[lt,ct]=je__default.useState({}),[_,X]=je__default.useState(false),[Je,Ji]=je__default.useState(false),Ad=d||E||le||Je,es=je__default.useMemo(()=>{let G=[...w];if(Array.isArray($o)&&$o.length>0){let me=new Set($o);G=G.filter(Ge=>me.has(Ge.id));}if(Go.length>0){let me=new Set(Go);G=G.filter(Ge=>!me.has(Ge.id));}return G.filter(me=>!!me?.id)},[w,Go,$o]),vn=C||"id",Ut=je__default.useMemo(()=>{let G=new Set(a);return Ve.filter(me=>G.has(me?.[vn]))},[a,Ve,vn]),Ho=Ut.length===1?Ut[0]:null,Xa=S?.fields,Cn=S?.excludeFields||[],ts=S?.editableFields||[],os=S?.nonEditableFields||[],as=S?.primaryKeys?.length?S.primaryKeys:[vn],rs=je__default.useMemo(()=>{let G=[...w];if(Array.isArray(Xa)&&Xa.length>0){let me=new Set(Xa);G=G.filter(Ge=>me.has(Ge.id));}if(Cn.length>0){let me=new Set(Cn);G=G.filter(Ge=>!me.has(Ge.id));}return G.filter(me=>!!me?.id)},[w,Cn,Xa]),ns=je__default.useMemo(()=>new Set(as),[as]),kn=je__default.useMemo(()=>new Set(ts),[ts]),is=je__default.useMemo(()=>new Set(os),[os]),Md=je__default.useCallback(G=>kn.size>0?kn.has(G):!(is.has(G)||ns.has(G)),[kn,is,ns]);je__default.useEffect(()=>{!be&&ue.hasActiveFilters&&ue.clearAll();},[be,ue.hasActiveFilters,ue.clearAll]);let Fd=()=>{let G={};es.forEach(me=>{G[me.id]=xn[me.id]??"";}),oe(G),M(true);},ss=()=>{E||M(false);},Bd=(G,me)=>{oe(Ge=>({...Ge,[G]:me}));},Ld=async()=>{if(!y?.onSubmit){M(false);return}try{$(!0),await y.onSubmit(J),M(!1);}finally{$(false);}},Ed=()=>{if(!Ho)return;let G={};rs.forEach(Ge=>{G[Ge.id]=Ho[Ge.id]??"";});let me=S?.getInitialValues?{...G,...S.getInitialValues(Ho)}:G;ct(me),Z(true);},ls=()=>{le||Z(false);},Nd=(G,me)=>{ct(Ge=>({...Ge,[G]:me}));},zd=async()=>{if(Ho){if(!S?.onSubmit){Z(false);return}try{st(!0),await S.onSubmit(lt,Ho),Z(!1);}finally{st(false);}}},Od=()=>{Ut.length!==0&&X(true);},Vd=()=>{Je||X(false);},$d=async()=>{if(Ut.length===0){X(false);return}if(!R?.onConfirm){X(false),Ue([]),s?.([]);return}try{Ji(!0),await R.onConfirm(Ut),X(!1),Ue([]),s?.([]);}finally{Ji(false);}},Ya=Ve,{fieldMapping:Ja}=Yn({rows:Ya,config:{...v,title:v?.title||`${T} ${t("graph.reportTitle")}`}}),Gd=je__default.useMemo(()=>_e?ue.applyRows(Ya,Ja):Ya,[_e,ue.applyRows,Ya,Ja]),{model:Sn}=Yn({rows:Gd,config:{...v,title:v?.title||`${T} ${t("graph.reportTitle")}`,fieldMapping:Ja}}),Hd=Sn.table.columns.map(G=>({id:G.id,label:G.label,align:G.align||"left",minWidth:120,numeric:G.align==="right"})),Wd=ne?jsx(Ol,{appId:ne,tableKey:f,currentLayoutData:ie,onLayoutLoad:B,targetLayoutId:pe,activeLayoutId:de,serviceUrl:A??k?.serviceUrl}):null,cs=jsxs(Fragment,{children:[jsx(Os,{groupAnchorEl:H,setGroupAnchorEl:Oe,grouping:N,setGrouping:V,columns:w,toggleGroupField:St}),jsx(Vs,{anchorEl:ye,setAnchorEl:Ae,columns:w,visibleColumns:D,toggleColumnVisibility:to}),jsx($s,{anchorEl:Te,setAnchorEl:Ee,showSummary:U,setShowSummary:j,columns:w,summaryColumns:te,toggleSummaryColumn:it}),jsx(Gs,{contextMenu:We,handleCloseContextMenu:Ht,columns:w,visibleColumns:D,toggleColumnVisibility:to})]});return F?jsxs(Na,{sx:{display:"flex",flexDirection:"column",gap:2,height:"100%"},children:[k&&jsx(Ba,{fields:k.fields,filters:k.filters,onFilterChange:k.onFilterChange,onSearch:k.onSearch,variants:k.variants||[],currentVariantId:k.currentVariantId,onVariantLoad:k.onVariantLoad,onVariantSave:k.onVariantSave,onVariantDelete:k.onVariantDelete,onVariantSetDefault:k.onVariantSetDefault,appId:k.appId,tableKey:f,currentLayout:[{tableKey:f,layoutData:ie}],variantService:k.variantService,serviceUrl:A??k.serviceUrl}),jsx(Ns,{title:T,loading:d,showSummary:U,setShowSummary:j,setAnchorEl:Ae,setSummaryAnchorEl:Ee,filterText:b,setFilterText:L,sortedAndFilteredRows:Ve,selected:a,columns:w,visibleColumns:D,summaryRow:at,handleClick:tt,selectionMode:i}),cs]}):jsxs(Na,{sx:{width:p?"100%":"auto",mb:l?0:2,...l?{flex:1,display:"flex",flexDirection:"column",minHeight:0,height:"100%",overflow:"hidden"}:{}},children:[k&&jsx(Na,{sx:{mb:2},children:jsx(Ba,{fields:k.fields,filters:k.filters,onFilterChange:k.onFilterChange,onSearch:k.onSearch,variants:k.variants||[],currentVariantId:k.currentVariantId,onVariantLoad:G=>{z(G),k.onVariantLoad&&k.onVariantLoad(G);},onVariantSave:k.onVariantSave,onVariantDelete:k.onVariantDelete,onVariantSetDefault:k.onVariantSetDefault,loading:d,appId:k.appId,tableKey:f,currentLayout:[{tableKey:f,layoutData:ie}],currentLayoutId:de,layoutRefs:[{tableKey:f,layoutId:de}],variantService:k.variantService,serviceUrl:A??k.serviceUrl})}),jsxs(Rg,{sx:{width:p?"100%":"auto",mb:l?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative","&::before":Ad?{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"}},...m?{height:m}:l?{flex:1,minHeight:0,height:"100%"}:{}},children:[n&&jsx(Ps,{filterText:b,setFilterText:L,onRowsPerPageChange:Gt,rowsPerPage:rt,rowsPerPageOptions:g,page:Xe,count:ma,onPageChange:Ye,actions:u,extraTools:c,grouping:N,setGroupAnchorEl:Oe,showSummary:U,setShowSummary:j,setAnchorEl:Ae,setSummaryAnchorEl:Ee,handleExport:vo,showCreateButton:Wt,onOpenCreateDialog:Fd,showEditButton:ao,onOpenEditDialog:Ed,editDisabled:Ut.length!==1,showDeleteButton:ya,onOpenDeleteConfirm:Od,deleteDisabled:Ut.length===0,onLayoutSave:h||k?.variantService&&k?.appId?O:void 0,loading:d,layoutManager:Wd,onOpenGraphReport:Me?xe:void 0}),jsx(Zl,{sx:{flex:1,...m?{maxHeight:m,height:m}:l?{height:0,maxHeight:"none"}:{maxHeight:"calc(100vh - 320px)"},overflowY:"auto",overflowX:"auto",position:"relative",minHeight:0},children:jsx(DndContext,{sensors:kt,collisionDetection:closestCenter,onDragEnd:eo,modifiers:[restrictToHorizontalAxis],children:jsxs(Dg,{sx:{minWidth:p?750:"auto",width:p?"100%":"auto",tableLayout:Object.keys(ee).length>0?"fixed":"auto",borderCollapse:"separate",borderSpacing:0,"& .MuiTableCell-root":{fontSize:r}},"aria-labelledby":"tableTitle",size:"small",stickyHeader:true,children:[jsx(As,{columns:w,visibleColumns:D,order:I,orderBy:P,onRequestSort:mt,onContextMenu:fa,selectionMode:i,grouping:N,isAllExpanded:Se,handleToggleAll:wt,rowCount:Ve.length,numSelected:a.length,onSelectAllClick:nt,columnWidths:ee,onColumnResize:ga}),jsx(Bs,{visibleRows:Ie,columns:w,visibleColumns:D,selectionMode:i,selected:a,orderBy:P,loading:d,expandedGroups:W,toggleGroupExpand:ha,handleExpandGroupRecursively:Dt,handleCollapseGroupRecursively:Tt,isGroupFullyExpanded:oo,handleClick:tt,onSelectionChange:s,grouping:N,rowKeyProp:C,page:Xe,rowsPerPage:rt}),U&&jsx(Ls,{showSummary:U,columns:w,visibleColumns:D,summaryRow:at,selectionMode:i?.toString(),grouping:N,orderBy:P,zIndex:3})]})})})]}),Wt&&jsxs(Hl,{open:x,onClose:ss,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:G=>`1px solid ${G.palette.divider}`,bgcolor:"background.paper"}}},children:[jsx(Wl,{sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:y?.title||t("quickCreate.createWithTitle",{title:T})}),jsx(Ul,{sx:{pt:"8px !important"},children:jsxs(Na,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[es.map(G=>{let me=G.type==="number"||G.numeric?"number":G.type==="date"?"date":"text",Ge=G.label||G.id;return jsx(_l,{label:Ge,value:J[G.id]??"",onChange:wn=>Bd(G.id,wn.target.value),type:me,size:"small",fullWidth:true,InputLabelProps:{shrink:me==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-create-${G.id}`)}),y?.description&&jsx(Kl,{severity:"info",sx:{fontSize:"0.85rem","& .MuiAlert-message":{fontSize:"0.85rem"}},children:y.description})]})}),jsxs(ql,{sx:{px:3,pb:2},children:[jsx(Mr,{onClick:ss,sx:{fontSize:"0.85rem"},disabled:E,children:y?.cancelLabel||t("common.cancel")}),jsx(Mr,{onClick:Ld,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:E,children:y?.submitLabel||t("common.save")})]})]}),ao&&jsxs(Hl,{open:se,onClose:ls,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:G=>`1px solid ${G.palette.divider}`,bgcolor:"background.paper"}}},children:[jsx(Wl,{sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:S?.title||t("quickEdit.editWithTitle",{title:T})}),jsx(Ul,{sx:{pt:"8px !important"},children:jsxs(Na,{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[rs.map(G=>{let me=G.type==="number"||G.numeric?"number":G.type==="date"?"date":"text",Ge=G.label||G.id,wn=Md(G.id);return jsx(_l,{label:Ge,value:lt[G.id]??"",onChange:Ud=>Nd(G.id,Ud.target.value),type:me,size:"small",fullWidth:true,disabled:!wn,InputLabelProps:{shrink:me==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-edit-${G.id}`)}),S?.description&&jsx(Kl,{severity:"info",sx:{fontSize:"0.85rem","& .MuiAlert-message":{fontSize:"0.85rem"}},children:S.description})]})}),jsxs(ql,{sx:{px:3,pb:2},children:[jsx(Mr,{onClick:ls,sx:{fontSize:"0.85rem"},disabled:le,children:S?.cancelLabel||t("common.cancel")}),jsx(Mr,{onClick:zd,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:le||!Ho,children:S?.submitLabel||t("common.save")})]})]}),ya&&jsx(Bn,{open:_,type:"warning",title:R?.title||t("quickDelete.confirmTitle"),message:R?.message||(Ut.length>1?t("quickDelete.confirmMessageMultiple",{count:Ut.length}):t("quickDelete.confirmMessageSingle")),confirmText:R?.confirmText||t("common.delete"),cancelText:R?.cancelText||t("common.cancel"),onClose:Vd,onConfirm:$d}),cs,Me&&jsx(ul,{open:be,onClose:qe,model:Sn,aiAssistant:v?.aiAssistant,interaction:_e?{enabled:true,filters:ue.filters,fieldMapping:Ja,onPrimaryDimensionClick:G=>ue.setFilter("primaryDimension",G),onSecondaryDimensionClick:G=>ue.setFilter("secondaryDimension",G),onStatusClick:G=>ue.setFilter("status",G),onClearFilter:ue.clearFilter,onClearAll:ue.clearAll}:void 0,tableContent:jsx(mo,{appId:ne||"graph-report-internal",title:t("graph.dataBody"),columns:Hd,rows:Sn.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false}})})]})},nw=mo;var pw=({id:e,title:t,hideHeader:r=true,filterConfig:o,tableProps:n,children:i,spacing:a=1,mode:s="separated"})=>{let u=o?{...o,appId:o.appId||e}:void 0,c={...n,appId:n.appId||e};return jsxs(Ts,{title:t,hideHeader:r,children:[jsxs(Stack,{spacing:a,sx:{height:"100%",overflow:"hidden"},children:[s==="separated"&&u&&jsx(Box,{sx:{flexShrink:0},children:jsx(Ba,{...u})}),jsx(Box,{sx:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:jsx(mo,{...c,fitContainer:true,filterConfig:s==="integrated"?u:void 0})})]}),i]})};var bw=({metadata:e,fetchData:t,initialRowsPerPage:r=20,rowsPerPageOptions:o=[20,50,100,-1],tableKey:n="default",mode:i="integrated",serviceUrl:a,variantService:s})=>{let{t:u}=q(),[c,l]=useState(false),[p,m]=useState([]),[d,g]=useState({}),[h,k]=useState(e.variants||[]),[C,f]=useState(e.layout||null),[v,y]=useState(""),[S,R]=useState(0),[A,T]=useState(0),[F,w]=useState(r),[I,P]=useState([]),[b,L]=useState("asc"),[D,U]=useState("");useEffect(()=>{let ee={};e.filters.forEach(ye=>{ye.defaultValue!==void 0&&(ee[ye.id]=ye.defaultValue);}),g(ee);},[e.filters]);let j=useCallback(async(ee,ye,Ae,We,kt)=>{l(true);try{let Ve={...ee,page:ye+1,limit:Ae,sort:kt,order:We},at;t?at=await t(Ve):typeof e.api=="function"?at=await e.api(Ve):e.api&&typeof e.api=="object"?(console.log("Fetching from URL:",e.api.url,Ve),at={rows:[],total:0}):(console.warn("No API configured for report"),at={rows:[],total:0}),at&&(m(at.rows||[]),R(at.total||0));}catch(Ve){console.error("Failed to fetch report data",Ve);}finally{l(false);}},[e.api,t]);useEffect(()=>{j(d,A,F,b,D);},[j,A,F,b,D]);let te=()=>{T(0),j(d,0,F,b,D);},N=ee=>{T(0),w(ee);},V=(ee,ye)=>{L(ye),U(ee);},W=ee=>{g(ee);},H=ee=>{y(ee?.id||"");let ye=Vl(ee,n);if(ye){let We=ye.values??ye;g(We),j(We,0,F,b,D),T(0);}let{layout:Ae}=Dr(ee,n);Ae&&f(Ae);},Oe=ee=>{let ye={...ee,id:Date.now().toString(),createdAt:new Date().toISOString()};k(Ae=>[...Ae,ye]);},Te=ee=>{f(ee);};return {pageProps:{id:e.id,title:e.title,mode:i,filterConfig:{appId:e.id,tableKey:n,fields:e.filters,filters:d,onFilterChange:W,onSearch:te,onVariantLoad:H,onVariantSave:Oe,onVariantDelete:ee=>k(ye=>ye.filter(Ae=>Ae.id!==ee)),onVariantSetDefault:ee=>{k(ye=>ye.map(Ae=>({...Ae,isDefault:Ae.id===ee})));},variants:h,currentVariantId:v,variantService:s,serviceUrl:a},tableProps:{appId:e.id,tableKey:n,columns:e.columns,rows:p,loading:c,rowKey:"id",count:S,page:A,rowsPerPage:F,rowsPerPageOptions:o,onPageChange:T,onRowsPerPageChange:N,selectionMode:"multiple",selected:I,onSelectionChange:P,onLayoutSave:Te,layout:C,title:e.title,showSummary:true,order:b,orderBy:D,serviceUrl:a,onSortChange:V,graphReport:e.graphReport||{enabled:true,title:`${e.title} ${u("graph.reportTitle")}`}}},filters:d,rows:p,loading:c,refresh:te}};var $g=e=>[...e].sort((t,r)=>r.value-t.value),Cw=({bars:e=[],lines:t=[],combos:r=[],heatmap:o=[],pies:n=[],waterfalls:i=[]})=>{let a=useMemo(()=>$g(e),[e]),s=useMemo(()=>[...t],[t]),u=useMemo(()=>[...r],[r]),c=useMemo(()=>[...o],[o]),l=useMemo(()=>{let m=n.reduce((d,g)=>d+g.value,0);return n.map(d=>({...d,percent:m>0?d.value/m*100:d.percent}))},[n]),p=useMemo(()=>[...i],[i]);return {bars:a,lines:s,combos:u,heatmap:c,pies:l,waterfalls:p}};var Iw=({apiKey:e,query:t,zoom:r=14,mapType:o="roadmap"})=>useMemo(()=>!e||!t?"":Pa({apiKey:e,query:t,zoom:r,mapType:o}),[e,t,r,o]),Pw=({keyword:e,location:t})=>useMemo(()=>gr({keyword:e,location:t?{lng:t.lng,lat:t.lat,name:t.name}:void 0}),[e,t]);var za=({code:e,language:t="text",copyable:r=true,showLineNumbers:o=false,wrapLongLines:n=false,maxHeight:i})=>{let[a,s]=useState(false),u=useMemo(()=>e.replace(/\n$/,"").split(`
|
|
4
|
+
`),[e]);return jsxs(Box,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1.5,overflow:"hidden",bgcolor:"background.paper"},children:[jsxs(Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:1,py:.6,bgcolor:"action.hover",borderBottom:"1px solid",borderColor:"divider"},children:[jsx(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}),r&&jsx(Tooltip,{title:a?"Copied":"Copy",children:jsx(IconButton,{size:"small",onClick:async()=>{try{await navigator.clipboard.writeText(e),s(!0),window.setTimeout(()=>s(!1),1400);}catch{s(false);}},children:a?jsx(Kg,{fontSize:"inherit"}):jsx(_g,{fontSize:"inherit"})})})]}),jsx(Box,{component:"pre",sx:{m:0,p:1.25,fontSize:"0.82rem",lineHeight:1.55,overflow:"auto",maxHeight:i,bgcolor:"background.default",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:o?u.map((l,p)=>jsxs(Box,{sx:{display:"flex"},children:[jsx(Box,{component:"span",sx:{width:34,flexShrink:0,textAlign:"right",pr:1,color:"text.disabled",userSelect:"none"},children:p+1}),jsx(Box,{component:"span",sx:{whiteSpace:n?"pre-wrap":"pre",wordBreak:n?"break-word":"normal"},children:l})]},`${p}-${l}`)):jsx(Box,{component:"code",sx:{display:"block",whiteSpace:n?"pre-wrap":"pre",wordBreak:n?"break-word":"normal"},children:e})})]})};var Yg=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},Jg=async e=>new Function("m","return import(m)")(e),Oa=({expression:e,inline:t=false,allowKatex:r=false})=>{let o=useMemo(()=>Yg(e),[e]),[n,i]=useState("");return useEffect(()=>{let a=true;return (async()=>{if(!r||!o){i("");return}try{let u=await Jg("katex"),l=(u?.default||u)?.renderToString?.(o,{displayMode:!t,throwOnError:!1,strict:"warn"});a&&typeof l=="string"&&i(l);}catch{a&&i("");}})(),()=>{a=false;}},[r,o,t]),o?n?jsx(Box,{component:t?"span":"div",sx:{display:t?"inline-flex":"block",my:t?0:.5,overflowX:"auto"},dangerouslySetInnerHTML:{__html:n}}):t?jsx(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:o}):jsx(Box,{sx:{my:1,p:1,borderRadius:1.2,border:"1px dashed",borderColor:"divider",bgcolor:"background.paper"},children:jsx(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:o})}):null};var sf=async e=>new Function("m","return import(m)")(e),pi=({code:e,title:t="Mermaid Diagram",height:r=320,enabled:o=true})=>{let[n,i]=useState(""),[a,s]=useState(""),[u,c]=useState(false),l=useMemo(()=>e.trim(),[e]);return useEffect(()=>{let p=true;return (async()=>{if(!o||!l){i(""),s("");return}c(true),s(""),i("");try{let d=await sf("mermaid"),g=d?.default||d;if(!g||typeof g.render!="function")throw new Error("Mermaid runtime is not available");g.initialize?.({startOnLoad:!1,securityLevel:"loose",theme:"default"});let h=await g.render(`orbcafe-mermaid-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,l),k=typeof h=="string"?h:h?.svg;p&&typeof k=="string"&&i(k);}catch(d){if(p){let g=d instanceof Error?d.message:"Failed to render Mermaid diagram";s(g);}}finally{p&&c(false);}})(),()=>{p=false;}},[o,l]),jsxs(Paper,{variant:"outlined",sx:{borderRadius:1.5,overflow:"hidden",my:1},children:[jsx(Box,{sx:{px:1,py:.6,borderBottom:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:jsx(Typography,{variant:"caption",color:"text.secondary",sx:{letterSpacing:.4,textTransform:"uppercase"},children:t})}),jsxs(Box,{sx:{p:1},children:[u&&jsx(Box,{sx:{minHeight:120,display:"flex",alignItems:"center",justifyContent:"center"},children:jsx(CircularProgress,{size:20})}),!u&&n&&jsx(Box,{sx:{maxHeight:r,overflow:"auto","& svg":{display:"block",mx:"auto",maxWidth:"100%",height:"auto"}},dangerouslySetInnerHTML:{__html:n}}),!u&&!n&&jsxs(Box,{children:[a&&jsx(Alert,{severity:"info",sx:{mb:1},children:a}),jsx(za,{code:l,language:"mermaid",copyable:true,showLineNumbers:true,wrapLongLines:true})]})]})]})};var mi=e=>e.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(r=>r.trim()),ff=e=>/^:?-{3,}:?$/.test(e.trim()),hf=e=>{let t=e.trim(),r=t.startsWith(":"),o=t.endsWith(":");return r&&o?"center":o?"right":"left"},Lr=e=>{let t=e.split(`
|
|
5
|
+
`).map(a=>a.trim()).filter(Boolean);if(t.length<2)return null;let r=mi(t[0]),o=mi(t[1]);if(r.length===0||o.length!==r.length||!o.every(ff))return null;let n=o.map(hf),i=t.slice(2).filter(a=>a.includes("|")).map(a=>{let s=mi(a);return s.length<r.length?[...s,...Array.from({length:r.length-s.length},()=>"")]:s.slice(0,r.length)});return {headers:r,aligns:n,rows:i}},gi=({markdown:e,table:t,maxHeight:r=360})=>{let o=useMemo(()=>t||(e?Lr(e):null),[t,e]);return !o||o.headers.length===0?jsx(Paper,{variant:"outlined",sx:{p:1.2,borderRadius:1.5},children:jsx(Typography,{variant:"body2",color:"text.secondary",children:"Invalid table block"})}):jsx(Paper,{variant:"outlined",sx:{borderRadius:1.5,overflow:"hidden",my:1},children:jsx(TableContainer,{sx:{maxHeight:r},children:jsxs(Table,{size:"small",stickyHeader:true,children:[jsx(TableHead,{children:jsx(TableRow,{children:o.headers.map((n,i)=>jsx(TableCell,{align:o.aligns[i],sx:{fontWeight:700,bgcolor:"background.paper"},children:n},`${n}-${i}`))})}),jsx(TableBody,{children:o.rows.map((n,i)=>jsx(TableRow,{hover:true,children:n.map((a,s)=>jsx(TableCell,{align:o.aligns[s],sx:{whiteSpace:"pre-wrap",wordBreak:"break-word"},children:a||jsx(Box,{component:"span",sx:{color:"text.disabled"},children:"-"})},`cell-${i}-${s}`))},`row-${i}`))})]})})})};var Nr=({content:e,title:t="Thinking",defaultExpanded:r=false,isStreaming:o=false})=>{let[n,i]=useState(r);return jsxs(Box,{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1,my:.8},children:[jsxs(Stack,{direction:"row",alignItems:"center",spacing:.6,children:[jsx(IconButton,{size:"small",onClick:()=>i(a=>!a),sx:{transform:n?"rotate(180deg)":"rotate(0deg)",transition:"transform .15s ease"},children:jsx(Sf,{fontSize:"inherit"})}),jsxs(Typography,{variant:"caption",color:"text.secondary",sx:{fontStyle:"italic"},children:[t,o?" ...":""]})]}),jsx(Collapse,{in:n,children:jsx(Typography,{variant:"body2",sx:{pl:4,pt:.4,whiteSpace:"pre-wrap",color:"text.secondary",fontStyle:"italic",lineHeight:1.55},children:e})})]})};var hi=/(\*\*[^*]+\*\*|`[^`]+`|\[[^\]]+\]\([^)]+\)|\*[^*]+\*|\$[^$\n]+\$)/g,zr=e=>e.trim().startsWith("```"),rc=e=>/^#{1,6}\s+/.test(e.trim()),yi=e=>/^[-*+]\s+/.test(e.trim()),bi=e=>/^\d+\.\s+/.test(e.trim()),nc=e=>/^(?:-{3,}|\*{3,}|_{3,})$/.test(e.trim()),xi=e=>e.trim().startsWith(">"),ic=(e,t)=>{if(t+1>=e.length)return false;let r=e[t],o=e[t+1];return !r.includes("|")||!o.includes("|")?false:/^\s*\|?\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)+\|?\s*$/.test(o.trim())},sc=e=>e.trim().startsWith("<think>")||e.trim()===":::think",Ga=(e,t,r)=>{let o=[],n=0,i=0;hi.lastIndex=0;let a=hi.exec(e);for(;a;){a.index>n&&o.push(e.slice(n,a.index));let s=a[0],u=`${r}-${i}`;if(s.startsWith("**")&&s.endsWith("**"))o.push(jsx("strong",{children:s.slice(2,-2)},u));else if(s.startsWith("*")&&s.endsWith("*"))o.push(jsx("em",{children:s.slice(1,-1)},u));else if(s.startsWith("`")&&s.endsWith("`"))o.push(jsx(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:s.slice(1,-1)},u));else if(s.startsWith("[")&&s.includes("](")&&s.endsWith(")")){let c=s.match(/^\[([^\]]+)\]\(([^)]+)\)$/);c?o.push(jsx(Link,{href:c[2],target:"_blank",rel:"noreferrer",underline:"hover",children:c[1]},u)):o.push(s);}else s.startsWith("$")&&s.endsWith("$")&&t.enableMath?o.push(jsx(Oa,{expression:s,inline:true,allowKatex:true},u)):o.push(s);n=a.index+s.length,i+=1,a=hi.exec(e);}return n<e.length&&o.push(e.slice(n)),o.length>0?o:[e]},Ha=({markdown:e,content:t,className:r,enableMath:o=true,enableMermaid:n=true,enableThinkBlock:i=true,codeCopyable:a=true,codeLineNumbers:s=false})=>{let u=e??t??"",c=useMemo(()=>{let l=[],p=u.replace(/\r\n/g,`
|
|
6
6
|
`).split(`
|
|
7
|
-
`),
|
|
8
|
-
`).trim()},`think-tag-${
|
|
9
|
-
`).trim()},`think-fence-${
|
|
10
|
-
`);if(n&&
|
|
11
|
-
`).trim(),allowKatex:true},`math-${
|
|
12
|
-
`),x=lr(m);if(x){c.push(jsx(Pn,{table:x},`table-${p}`)),p=v;continue}}if(Fn(h)){let v=[];for(;p<d.length&&Fn(d[p]);)v.push(d[p].replace(/^\s*>\s?/,"")),p+=1;c.push(jsx(Paper,{variant:"outlined",sx:{px:1,py:.8,my:.9,borderLeftWidth:3,borderLeftStyle:"solid",borderLeftColor:"primary.main",bgcolor:"action.hover"},children:jsx(Typography,{variant:"body2",sx:{whiteSpace:"pre-wrap"},children:v.map((m,x)=>jsxs(Fragment$1,{children:[x>0&&jsx("br",{}),ya(m,b,`q-${p}-${x}`)]},`quote-line-${x}`))})},`quote-${p}`));continue}if(An(h)){let v=[];for(;p<d.length&&An(d[p]);)v.push(d[p].trim().replace(/^[-*+]\s+/,"")),p+=1;c.push(jsx(Box,{component:"ul",sx:{my:.8,pl:2.5},children:v.map((m,x)=>jsx(Box,{component:"li",sx:{mb:.45},children:jsx(Typography,{variant:"body2",children:ya(m,b,`ul-${p}-${x}`)})},`ul-item-${x}`))},`ul-${p}`));continue}if(Mn(h)){let v=[];for(;p<d.length&&Mn(d[p]);)v.push(d[p].trim().replace(/^\d+\.\s+/,"")),p+=1;c.push(jsx(Box,{component:"ol",sx:{my:.8,pl:2.7},children:v.map((m,x)=>jsx(Box,{component:"li",sx:{mb:.45},children:jsx(Typography,{variant:"body2",children:ya(m,b,`ol-${p}-${x}`)})},`ol-item-${x}`))},`ol-${p}`));continue}let S=[];for(;p<d.length;){let v=d[p],m=v.trim();if(!m||ur(v)||ts(v)||os(v)||An(v)||Mn(v)||Fn(v)||as(d,p)||r&&rs(v)||o&&m.startsWith("$$"))break;S.push(v),p+=1;}S.length>0?c.push(jsx(Typography,{variant:"body2",sx:{my:.65,lineHeight:1.65},children:S.map((v,m)=>jsxs(Fragment$1,{children:[m>0&&jsx("br",{}),ya(v,b,`p-${p}-${m}`)]},`p-line-${m}`))},`p-${p}`)):p+=1;}return c},[u,o,n,r,a,l]);return jsx(Box,{className:i,sx:{"& strong":{fontWeight:700},"& em":{fontStyle:"italic"},"& a":{wordBreak:"break-all"}},children:s})};var rS=(e,t)=>jsx(ba,{markdown:e,...t});var ls=({value:e,onChange:t,onSubmit:i,onVoiceInput:o,onClear:n,placeholder:r,statusText:a,loading:l=false,compact:u=false,showStatusText:s=true})=>jsxs(Stack,{spacing:.75,children:[jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1,px:1.2,py:u?.25:.4,borderRadius:999,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",minHeight:u?38:44},children:[jsx(wl,{sx:{fontSize:u?16:18,color:"text.secondary"}}),jsx(InputBase,{fullWidth:true,value:e,onChange:c=>t(c.target.value),onKeyDown:c=>{c.key==="Enter"&&(c.preventDefault(),i());},placeholder:r,sx:{fontSize:u?"0.84rem":"0.9rem"}}),e&&n&&jsx(IconButton,{size:"small",onClick:n,children:jsx(Sp,{sx:{fontSize:u?16:18}})}),o&&jsx(IconButton,{size:"small",onClick:o,children:jsx(Ap,{sx:{fontSize:u?16:18}})}),jsx(IconButton,{size:"small",onClick:i,disabled:l||!e.trim(),children:jsx(Fp,{sx:{fontSize:u?16:18}})})]}),s&&a&&jsx(Typography,{variant:"caption",color:"text.secondary",children:a})]});var ss=(e,t)=>{let i=t.trim();if(!i)return e;let o=e.toLowerCase(),n=i.toLowerCase(),r=o.indexOf(n);return r<0?e:jsxs(Fragment,{children:[e.slice(0,r),jsx(Box,{component:"mark",sx:{bgcolor:"warning.light",color:"warning.contrastText",px:.15,borderRadius:.4},children:e.slice(r,r+i.length)}),e.slice(r+i.length)]})},pr=({section:e,highlightQuery:t=""})=>{let i=e.columns||2;return jsxs(Paper,{variant:"outlined",sx:{p:1.8,borderRadius:2},children:[jsx(Typography,{variant:"subtitle1",sx:{fontWeight:700,mb:1.4},children:e.title}),jsx(Box,{sx:{display:"grid",gap:1.15,gridTemplateColumns:{xs:"1fr",md:i===3?"repeat(3, minmax(0, 1fr))":i===1?"1fr":"repeat(2, minmax(0, 1fr))"}},children:e.fields.map(o=>{let n=typeof o.value=="string"||typeof o.value=="number"?String(o.value):null;return jsxs(Box,{sx:{minWidth:0},children:[jsx(Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:ss(o.label,t)}),jsx(Typography,{component:"div",variant:"body2",sx:{mt:.2,fontWeight:500,wordBreak:"break-word"},children:n?ss(n,t):o.value})]},o.id)})})]})};var On=e=>e==null?"":typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):"",mr=e=>e.trim().toLowerCase(),sg=(e,t)=>{let i=[];return e.forEach(o=>{o.fields.forEach(n=>{let r=n.searchableText||On(n.value),a={source:"section",sourceId:o.id,sourceSectionId:o.id,sourceTitle:o.title,fieldId:n.id,fieldLabel:n.label,fieldValue:r};i.push({hit:a,text:mr(`${o.title} ${n.label} ${r}`)});});}),t.forEach(o=>{(o.fields||[]).forEach(n=>{let r=n.searchableText||On(n.value),a={source:"tab",sourceId:o.id,sourceTitle:o.label,fieldId:n.id,fieldLabel:n.label,fieldValue:r};i.push({hit:a,text:mr(`${o.label} ${n.label} ${r}`)});}),(o.sections||[]).forEach(n=>{n.fields.forEach(r=>{let a=r.searchableText||On(r.value),l={source:"tab",sourceId:o.id,sourceSectionId:n.id,sourceTitle:`${o.label} / ${n.title}`,fieldId:r.id,fieldLabel:r.label,fieldValue:a};i.push({hit:l,text:mr(`${o.label} ${n.title} ${r.label} ${a}`)});});});}),i},cs=({sections:e,tabs:t=[],defaultTabId:i,ai:o})=>{let{t:n}=U(),[r,a]=useState(""),[l,u]=useState(i||t[0]?.id),[s,c]=useState("idle"),[d,b]=useState([]),[p,h]=useState(""),[y,S]=useState(""),[v,m]=useState(false),x=useMemo(()=>sg(e,t),[e,t]);useEffect(()=>{if(t.length===0){u(void 0);return}t.some(F=>F.id===l)||u(i||t[0]?.id);},[t,l,i]);let w=useCallback(()=>{c("idle"),b([]),h(""),S("");},[]),I=useCallback(P=>{a(P),P.trim()||(c("idle"),b([]),h(""),S(""));},[]),R=useCallback(P=>{let F=mr(P);return F?x.filter(C=>C.text.includes(F)).map(C=>C.hit):[]},[x]),A=useCallback(async()=>{let P=r.trim();if(!P)return;m(true);let F=R(P);if(b(F),F.length>0){c("search"),S(""),h(n("detail.searchAi.matches",{count:F.length})),m(false);return}if(o?.enabled!==false&&o?.onSubmit){c("ai"),h(n("detail.searchAi.autoAiFallback"));try{let k=await o.onSubmit(P,{query:P,hits:F,activeTabId:l,sections:e,tabs:t});S(typeof k=="string"?k:"");}finally{m(false);}return}c("search"),S(""),h(n("detail.searchAi.noMatch")),m(false);},[r,R,n,o,l,e,t]);return {query:r,setQuery:I,activeTabId:l,setActiveTabId:u,searchMode:s,hits:d,statusText:p,aiResponse:y,searching:v,handleSubmit:A,clearResult:w}};var ES=({title:e,subtitle:t,sections:i,tabs:o=[],defaultTabId:n,table:r,ai:a,rightHeaderSlot:l,searchBarWidth:u=460,onClose:s,closeLabel:c="Close"})=>{let{t:d}=U(),{query:b,setQuery:p,activeTabId:h,setActiveTabId:y,searchMode:S,hits:v,statusText:m,aiResponse:x,searching:w,handleSubmit:I,clearResult:R}=cs({sections:i,tabs:o,defaultTabId:n,ai:a}),A=useMemo(()=>o.find(C=>C.id===h)||o[0],[o,h]),P=useCallback(C=>{let k=T=>{let f=document.getElementById(C);if(f){f.scrollIntoView({behavior:"smooth",block:"center"});return}T<4&&setTimeout(()=>k(T+1),60);};requestAnimationFrame(()=>k(0));},[]),F=useCallback((C,k)=>{if(o.some(T=>T.id===C)){y(C),P(k?`detail-tab-${C}-section-${k}`:`detail-tab-${C}`);return}P(`detail-section-${C}`);},[o,y,P]);return jsxs(Box,{sx:{display:"flex",flexDirection:"column",gap:1.5,minHeight:"100%"},children:[jsxs(Stack,{direction:{xs:"column",md:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",md:"center"},spacing:1,children:[jsxs(Box,{sx:{minWidth:0},children:[jsx(Typography,{variant:"h5",sx:{fontWeight:800,color:"text.primary"},children:e}),t&&jsx(Typography,{variant:"body2",color:"text.secondary",sx:{mt:.35},children:t})]}),jsxs(Stack,{direction:"row",spacing:.6,alignItems:"center",sx:{width:{xs:"100%",md:"auto"},ml:{xs:0,md:"auto"}},children:[jsx(Box,{sx:{width:{xs:"100%",md:u},maxWidth:"100%",minWidth:{md:320}},children:jsx(ls,{value:b,onChange:p,onSubmit:I,onVoiceInput:a?.onVoiceInput,onClear:()=>{p(""),R();},placeholder:a?.placeholder||d("detail.searchAi.placeholder"),statusText:m,loading:w,compact:true,showStatusText:false})}),s&&jsx(Tooltip,{title:c,children:jsx(IconButton,{size:"small",onClick:s,children:jsx(gg,{fontSize:"small"})})}),l]})]}),m&&jsx(Typography,{variant:"caption",color:"text.secondary",sx:{mt:-0.7},children:m}),S==="search"&&v.length>0&&jsxs(Paper,{variant:"outlined",sx:{p:1.5,borderRadius:2},children:[jsx(Typography,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.6},children:d("detail.searchAi.matches",{count:v.length})}),jsx(Stack,{spacing:.35,children:v.slice(0,8).map(C=>jsx(Box,{component:"button",type:"button",onClick:()=>F(C.sourceId,C.sourceSectionId),sx:{textAlign:"left",border:0,bgcolor:"transparent",p:.2,cursor:"pointer",color:"text.primary",borderRadius:1,"&:hover":{bgcolor:"action.hover"}},children:jsxs(Typography,{variant:"body2",sx:{fontSize:"0.84rem"},children:[jsx(Box,{component:"span",sx:{color:"text.secondary"},children:C.sourceTitle})," \xB7 ",jsx(Box,{component:"span",sx:{fontWeight:700},children:C.fieldLabel})," = ",jsx(Box,{component:"span",children:C.fieldValue||"-"})]})},`${C.source}|${C.sourceId}|${C.fieldId}`))})]}),S==="ai"&&x&&jsxs(Paper,{variant:"outlined",sx:{p:1.5,borderRadius:2},children:[jsx(Typography,{variant:"subtitle2",sx:{fontWeight:700,mb:.7},children:d("detail.searchAi.aiResultTitle")}),jsx(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:jsx(ba,{markdown:x})})]}),jsx(Box,{sx:{display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",lg:"repeat(2, minmax(0, 1fr))"}},children:i.map(C=>jsx(Box,{id:`detail-section-${C.id}`,children:jsx(pr,{section:C,highlightQuery:b})},C.id))}),o.length>0&&jsxs(Paper,{variant:"outlined",sx:{borderRadius:2,overflow:"hidden"},children:[jsx(Tabs,{value:A?.id||false,onChange:(C,k)=>y(k),variant:"scrollable",scrollButtons:"auto",sx:{borderBottom:"1px solid",borderColor:"divider"},children:o.map(C=>jsx(Tab,{value:C.id,label:C.label,sx:{textTransform:"none"}},C.id))}),jsxs(Box,{sx:{p:1.5},children:[jsx(Box,{id:`detail-tab-${A?.id||""}`}),A?.description&&jsx(Typography,{variant:"body2",color:"text.secondary",sx:{mb:1.2},children:A.description}),A?.content?A.content:jsxs(Stack,{spacing:1.5,children:[(A?.sections||[]).map(C=>jsx(Box,{id:`detail-tab-${A?.id}-section-${C.id}`,children:jsx(pr,{section:C,highlightQuery:b})},C.id)),A?.fields&&A.fields.length>0&&jsx(pr,{section:{id:`${A.id}-fields`,title:A.label,fields:A.fields,columns:2},highlightQuery:b})]})]})]}),r&&jsx(zo,{title:r.title||d("detail.table.title"),...r.tableProps,filterConfig:void 0,fitContainer:false})]})};var gs=64,Rg="#E9EDF2",Ag="linear-gradient(90deg, #F5F7FA 0%, #E9EDF2 50%, #F5F7FA 100%)",Mg=["en","zh","fr","de","ja","ko"],fs={en:"EN",zh:"\u4E2D\u6587",fr:"FR",de:"DE",ja:"\u65E5\u672C\u8A9E",ko:"\uD55C\uAD6D\uC5B4"},hs=({appTitle:e,logo:t,mode:i="dark",onToggleMode:o,locale:n,localeLabel:r,localeOptions:a,onLocaleChange:l,searchPlaceholder:u,onSearch:s,user:c,onUserSetting:d,onUserLogout:b,userMenuItems:p,leftSlot:h,rightSlot:y})=>{let{t:S,locale:v}=U(),x=useTheme().palette.mode==="dark",[w,I]=useState(""),[R,A]=useState(null),[P,F]=useState(null),C=N=>{N.preventDefault(),s&&s(w.trim());},k=i==="system"?jsx(Tg,{fontSize:"small"}):i==="dark"?jsx(wg,{fontSize:"small"}):jsx(Ig,{fontSize:"small"}),T=S(i==="system"?"header.theme.system":i==="dark"?"header.theme.dark":"header.theme.light"),f=n||v,B=a&&a.length>0?a:Mg,E=r||fs[f]||f.toUpperCase(),Z=!!R,re=u||S("header.searchPlaceholder"),le=!!P,z=[{key:"setting",label:S("header.menu.setting"),icon:jsx(Dd,{sx:{fontSize:18}}),onClick:d},{key:"logout",label:S("header.menu.logout"),icon:jsx(Dg,{sx:{fontSize:18}}),onClick:b}],O=p&&p.length>0?p:z,V=N=>{F(null),N?.();};return jsxs(AppBar,{position:"sticky",elevation:0,sx:N=>({top:0,zIndex:N.zIndex.drawer+10,height:gs,backgroundColor:N.palette.mode==="dark"?"#0D0D0D":Rg,backgroundImage:N.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%)",Ag,"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:N.palette.mode==="dark"?"rgba(255,255,255,0.12)":"rgba(15,23,42,0.12)"}),children:[jsxs(Toolbar,{sx:{minHeight:`${gs}px !important`,px:2,gap:2},children:[jsxs(Stack,{direction:"row",alignItems:"center",spacing:1.5,sx:{minWidth:220},children:[t||jsx(Box,{component:"img",src:"/orbcafe.png",alt:"ORBCAFE Logo",sx:{width:44,height:44,display:"block",objectFit:"contain",flexShrink:0}}),e&&jsx(Typography,{variant:"h6",sx:{fontWeight:700,color:x?"common.white":"#111827"},children:e}),h]}),jsx(Box,{sx:{flex:1,display:"flex",justifyContent:"center",minWidth:0},children:jsx(Box,{component:"form",onSubmit:C,sx:{width:"100%",maxWidth:540},children:jsx(TextField,{size:"small",fullWidth:true,value:w,onChange:N=>I(N.target.value),placeholder:re,InputProps:{startAdornment:jsx(InputAdornment,{position:"start",children:jsx(wl,{sx:{color:x?"rgba(255,255,255,0.7)":"rgba(15,23,42,0.55)",fontSize:18}})}),sx:{color:x?"common.white":"rgba(17,24,39,0.9)",bgcolor:x?"rgba(255,255,255,0.08)":"#ffffff",borderRadius:999,"& .MuiOutlinedInput-notchedOutline":{borderColor:x?"rgba(255,255,255,0.15)":"rgba(15,23,42,0.2)"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:x?"rgba(255,255,255,0.35)":"rgba(15,23,42,0.35)"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:x?"rgba(255,255,255,0.5)":"rgba(15,23,42,0.55)"}}},inputProps:{style:{color:x?"white":"#111827"}}})})}),jsxs(Stack,{direction:"row",alignItems:"center",spacing:1.5,children:[l?jsxs(Fragment,{children:[jsx(IconButton,{size:"small",onClick:N=>A(N.currentTarget),sx:{color:x?"common.white":"#111827",borderRadius:1,px:.5},children:jsxs(Stack,{direction:"row",alignItems:"center",spacing:.45,children:[jsx(ms,{sx:{fontSize:18}}),jsx(Typography,{variant:"caption",sx:{fontWeight:500},children:E})]})}),jsx(Menu,{anchorEl:R,open:Z,onClose:()=>A(null),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:B.map(N=>jsx(MenuItem,{selected:N===f,onClick:()=>{l(N),A(null);},sx:{fontSize:"0.82rem"},children:fs[N]},N))})]}):jsxs(Stack,{direction:"row",alignItems:"center",spacing:.5,children:[jsx(ms,{sx:{color:x?"common.white":"#111827",fontSize:18}}),jsx(Typography,{variant:"caption",sx:{color:x?"common.white":"#111827",fontWeight:500},children:E})]}),jsx(IconButton,{size:"small",sx:{color:x?"common.white":"#111827"},onClick:o,title:T,children:k}),c&&jsxs(Stack,{direction:"row",alignItems:"center",spacing:1,children:[jsxs(Box,{sx:{textAlign:"right",minWidth:0},children:[jsx(Typography,{variant:"body2",sx:{color:x?"common.white":"#111827",fontWeight:700,lineHeight:1.15},children:c.name}),c.subtitle&&jsx(Typography,{variant:"caption",sx:{display:"block",mt:.25,color:x?"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:c.subtitle,children:c.subtitle})]}),jsx(IconButton,{size:"small",onClick:N=>F(N.currentTarget),sx:{p:0},children:jsx(Avatar,{src:c.avatarSrc,imgProps:{style:{objectFit:"cover"}},sx:{width:34,height:34,bgcolor:"grey.100",color:"grey.700",fontSize:"0.85rem"},children:c.avatarText||c.name.slice(0,1).toUpperCase()})})]}),y]})]}),c&&jsx(Menu,{anchorEl:P,open:le,onClose:()=>F(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:O.map(N=>jsxs(MenuItem,{disabled:N.disabled,onClick:()=>V(N.onClick),children:[N.icon&&jsx(ListItemIcon,{children:N.icon}),jsx(ListItemText,{primary:N.label,slotProps:{primary:{sx:{fontSize:"0.86rem",fontWeight:500}}}})]},N.key))})]})};var ys=({menuData:e=[],initialNavigationCollapsed:t=false}={})=>{let{navigationIslandProps:i}=Pi({initialCollapsed:t,content:e}),[o,n]=useState(900);useEffect(()=>{let a=()=>n(window.innerHeight);return a(),window.addEventListener("resize",a),()=>window.removeEventListener("resize",a)},[]);let r=useMemo(()=>Math.max(280,o-100),[o]);return {navigationIslandProps:i,navigationMaxHeight:r}};var ik=({appTitle:e,menuData:t=[],children:i,showNavigation:o=true,locale:n="en",localeLabel:r,localeOptions:a,onLocaleChange:l,user:u,onUserSetting:s,onUserLogout:c,userMenuItems:d,logo:b,onSearch:p,rightHeaderSlot:h,leftHeaderSlot:y,contentSx:S})=>{let v="orbcafe:page-layout-mode",[m,x]=useState("system"),[w,I]=useState("light"),[R,A]=useState(false),P=m==="system"?R?w:"light":m;useEffect(()=>{try{let B=window.localStorage.getItem(v);(B==="light"||B==="dark"||B==="system")&&x(B);}catch{}A(true);let T=window.matchMedia("(prefers-color-scheme: dark)"),f=()=>{I(T.matches?"dark":"light");};return f(),T.addEventListener("change",f),()=>T.removeEventListener("change",f)},[]),useEffect(()=>{if(R)try{window.localStorage.setItem(v,m);}catch{}},[R,m]);let F=useMemo(()=>createTheme({palette:{mode:P}}),[P]),{navigationIslandProps:C,navigationMaxHeight:k}=ys({menuData:t,initialNavigationCollapsed:false});return jsx(ThemeProvider,{theme:F,children:jsx(vi,{locale:n,children:jsxs(Box,{sx:T=>({minHeight:"100vh",display:"flex",flexDirection:"column",background:T.palette.mode==="dark"?"linear-gradient(180deg, #0A0A0A 0%, #141414 55%, #1A1A1A 100%)":T.palette.background.default}),children:[jsx(hs,{appTitle:e,logo:b,mode:m,onToggleMode:()=>x(T=>T==="system"?"dark":T==="dark"?"light":"system"),locale:n,localeLabel:r,localeOptions:a,onLocaleChange:l,user:u,onUserSetting:s,onUserLogout:c,userMenuItems:d,onSearch:p,leftSlot:y,rightSlot:h}),jsxs(Box,{sx:{flex:1,minHeight:0,display:"flex"},children:[o&&jsx(Box,{sx:{p:1.5,display:"flex",alignItems:"flex-start",flexShrink:0},children:jsx(wi,{...C,maxHeight:k,colorMode:P})}),jsx(Box,{sx:{flex:1,minWidth:0,minHeight:0,overflow:"auto",p:1.5,...S},children:i})]})]})})})};var yr="(blank)",xs="Result",Cs="Grand Total",Ss={sum:"Sum",count:"Count",avg:"Average",min:"Min",max:"Max"},ks=["sum","count","avg","min","max"];var Ts=["palette","rows","columns","filters","values"];var ws=e=>Ts.includes(e),Is=e=>e==="rows"||e==="columns"||e==="filters",br=e=>{let t=e.split("|");return t.length===2&&t[0]==="container"&&ws(t[1])?{kind:"container",zone:t[1]}:t.length===3&&t[0]==="item"&&ws(t[1])&&t[2]?{kind:"item",zone:t[1],key:t[2]}:null},po=e=>e==null||e===""?yr:e instanceof Date?e.toISOString().slice(0,10):String(e),Go=e=>JSON.stringify(e),Ps=(e,t)=>{let i=e.join(""),o=t.join("");return i.localeCompare(o,void 0,{sensitivity:"base"})},Ng=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},Wn=(e,t,i)=>{if(i==="count")return e.length;let o=e.map(n=>Ng(n[t])).filter(n=>n!==null);return o.length===0?0:i==="sum"?o.reduce((n,r)=>n+r,0):i==="avg"?o.reduce((n,r)=>n+r,0)/o.length:i==="min"?Math.min(...o):Math.max(...o)},Je=(e,t)=>{if(!e||e.length===0)return [];let i=new Set,o=[];return e.forEach(n=>{!t.has(n)||i.has(n)||(i.add(n),o.push(n));}),o},Ot=(e,t)=>e.length!==t.length?false:e.every((i,o)=>i===t[o]),Ds=(e,t)=>{let i=Object.keys(e),o=Object.keys(t);return i.length!==o.length?false:i.every(n=>{let r=e[n]??[],a=t[n]??[];return Ot(r,a)})},vr=(e,t)=>e.length!==t.length?false:e.every((i,o)=>{let n=t[o];return i.tokenId===n.tokenId&&i.fieldId===n.fieldId&&i.aggregation===n.aggregation}),Hn=e=>!e?.aggregations||e.aggregations.length===0?ks:e.aggregations,xt=(e,t)=>{let i=Hn(t);return e&&i.includes(e)?e:t?.type==="number"&&i.includes("sum")?"sum":i.includes("count")?"count":i[0]},Rs=(e,t,i)=>{let o=i.get(t.fieldId);return o?.formatValue?o.formatValue(e):t.aggregation==="count"?Math.round(e).toLocaleString():e.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:2})};var Fs=({options:e,selectedValues:t,onChange:i,minWidth:o=96})=>{let{t:n}=U(),[r,a]=useState(""),l=useMemo(()=>{let s=r.trim().toLowerCase();return s?e.filter(c=>c.toLowerCase().includes(s)):e},[e,r]),u=e.length>0&&t.length===e.length;return jsx(FormControl,{size:"small",sx:{minWidth:o},children:jsxs(Select,{multiple:true,value:t,onChange:s=>{let c=s.target.value,d=typeof c=="string"?c.split(","):c;i(d);},onClick:s=>s.stopPropagation(),onMouseDown:s=>s.stopPropagation(),renderValue:s=>{let c=s;return e.length===0?n("pivot.filter.na"):c.length===0?n("common.none"):c.length===e.length?n("common.all"):`${c.length}/${e.length}`},MenuProps:{PaperProps:{sx:{maxHeight:320,bgcolor:"background.paper"}}},sx:{fontSize:"0.72rem",height:26,"& .MuiSelect-select":{py:.35}},children:[jsx(ListSubheader,{disableSticky:true,sx:s=>({bgcolor:"background.paper",py:.8,lineHeight:"normal",borderBottom:`1px solid ${s.palette.divider}`}),children:jsx(TextField,{size:"small",placeholder:`${n("common.search")}...`,fullWidth:true,value:r,onChange:s=>a(s.target.value),onKeyDown:s=>s.stopPropagation(),onClick:s=>s.stopPropagation(),sx:{m:0,"& .MuiInputBase-input":{fontSize:"0.75rem",py:.7}}})}),jsx(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:jsx(Button,{variant:"text",size:"small",onClick:s=>{s.preventDefault(),s.stopPropagation(),i(u?[]:e);},sx:{minWidth:"auto",px:0,py:.2,fontSize:"0.76rem",fontWeight:700,textTransform:"none"},children:n(u?"pivot.filter.deselectAll":"pivot.filter.selectAll")})}),l.length===0&&jsx(MenuItem,{disabled:true,sx:{fontSize:"0.75rem"},children:n("pivot.filter.noResults")}),l.map(s=>{let c=t.includes(s);return jsxs(MenuItem,{value:s,sx:{fontSize:"0.75rem",py:.25},children:[jsx(Checkbox,{size:"small",checked:c,sx:{p:.5,mr:.5}}),jsx(ListItemText,{primary:s,primaryTypographyProps:{sx:{fontSize:"0.75rem",lineHeight:1.2}}})]},s)})]})})};var qn=({label:e,subtitle:t,isDragging:i,dragRef:o,listeners:n,attributes:r,style:a})=>jsx(Paper,{ref:o,...n,...r,sx:l=>({p:1,borderRadius:2,border:"1px solid",borderColor:"divider",bgcolor:l.palette.mode==="dark"?"#111111":"background.paper",touchAction:"none"}),style:{...a,opacity:i?.3:1,cursor:i?"grabbing":"grab"},children:jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:.8},children:[jsx(Box,{sx:l=>({display:"inline-flex",alignItems:"center",justifyContent:"center",p:.3,borderRadius:1,bgcolor:l.palette.mode==="dark"?"rgba(255,255,255,0.12)":"rgba(17, 24, 39, 0.08)"}),children:jsx(Yg,{sx:{fontSize:16,color:"text.secondary"}})}),jsxs(Box,{sx:{minWidth:0},children:[jsx(Typography,{sx:{fontSize:"0.82rem",fontWeight:700,lineHeight:1.2},children:e}),t&&jsx(Typography,{sx:{fontSize:"0.72rem",color:"text.secondary",lineHeight:1.2},children:t})]})]})}),Es=({id:e,label:t,subtitle:i})=>{let{setNodeRef:o,listeners:n,attributes:r,isDragging:a}=useDraggable({id:e});return jsx(qn,{label:t,subtitle:i,isDragging:a,dragRef:o,listeners:n,attributes:r})};var Ho=({zone:e,title:t,hint:i,icon:o,children:n,itemCount:r,onClear:a})=>{let l=`container|${e}`,{isOver:u,setNodeRef:s}=useDroppable({id:l}),{t:c}=U();return jsxs(Paper,{ref:s,sx:d=>({p:1.1,borderRadius:3,border:"1px dashed",borderColor:u?"primary.main":d.palette.divider,bgcolor:u?d.palette.mode==="dark"?"rgba(25, 118, 210, 0.16)":"rgba(47, 91, 255, 0.06)":d.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:[jsxs(Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1},children:[jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:.8},children:[o,jsx(Typography,{sx:{fontSize:"0.79rem",fontWeight:800,letterSpacing:.2},children:t}),jsxs(Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:["(",r,")"]})]}),r>0&&a&&jsx(Tooltip,{title:c("pivot.clearArea"),children:jsx(IconButton,{size:"small",onClick:a,sx:{p:.25},children:jsx(of,{sx:{fontSize:16}})})})]}),jsx(Typography,{sx:{mt:.5,mb:.9,fontSize:"0.7rem",color:"text.secondary"},children:i}),jsx(Box,{sx:{flex:1},children:n})]})};var Cr=({label:e,caption:t,onRemove:i,trailing:o,isDragging:n,dragRef:r,listeners:a,attributes:l,style:u})=>jsx(Paper,{ref:r,style:u,sx:s=>({p:1,borderRadius:2,border:"1px solid",borderColor:"divider",bgcolor:s.palette.mode==="dark"?"#111111":"background.paper",touchAction:"none",opacity:n?0:1}),children:jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:.8},children:[jsx(Box,{...l,...a,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:jsx(Yg,{sx:{fontSize:15,color:"text.secondary"}})}),jsxs(Box,{sx:{minWidth:0,flex:1},children:[jsx(Typography,{sx:{fontSize:"0.8rem",fontWeight:700,lineHeight:1.2},children:e}),t&&jsx(Typography,{sx:{fontSize:"0.7rem",color:"text.secondary",lineHeight:1.2},children:t})]}),o,i&&jsx(IconButton,{size:"small",onClick:s=>{s.stopPropagation(),i();},sx:{p:.2},children:jsx(Sp,{sx:{fontSize:16}})})]})}),Sa=({id:e,label:t,caption:i,onRemove:o,trailing:n})=>{let{setNodeRef:r,attributes:a,listeners:l,transform:u,transition:s,isDragging:c}=useSortable({id:e}),d={transform:u?`translate3d(${u.x}px, ${u.y}px, 0)`:void 0,transition:s,zIndex:c?999:"auto"};return jsx(Cr,{label:t,caption:i,onRemove:o,trailing:n,isDragging:c,dragRef:r,listeners:l,attributes:a,style:d})};var wr={rows:jsx(hf,{fontSize:"small"}),columns:jsx(lu,{fontSize:"small"}),filters:jsx(ff,{fontSize:"small"}),values:jsx(pu,{fontSize:"small"})},Vs=({isConfiguratorCollapsed:e,onToggleCollapse:t,availableFields:i,fieldMap:o,filterFields:n,columnFields:r,rowFields:a,valueFields:l,clearZone:u,removeFieldFromZone:s,getFilterSelectionSummary:c,renderDimensionFilterSelect:d,renderAggregationSelect:b,getAggregationLabel:p})=>{let{t:h}=U();return jsxs(Fragment,{children:[jsx(Collapse,{in:!e,timeout:260,easing:"cubic-bezier(0.2, 0, 0, 1)",unmountOnExit:true,children:jsxs(Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",lg:"260px 1fr"},gap:2},children:[jsx(Ho,{zone:"palette",title:h("pivot.fieldList"),hint:h("pivot.availableDimensions"),itemCount:i.length,icon:jsx(Yg,{sx:{fontSize:16,color:"text.secondary"}}),children:jsxs(Stack,{spacing:.8,sx:{maxHeight:400,overflowY:"auto",pr:.5},children:[i.length===0&&jsx(Typography,{sx:{fontSize:"0.74rem",color:"text.secondary",py:1},children:h("pivot.allFieldsInUse")}),i.map(y=>jsx(Es,{id:`item|palette|${y.id}`,label:y.label,subtitle:y.type??"string"},y.id))]})}),jsxs(Stack,{spacing:2,children:[jsxs(Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[jsx(Ho,{zone:"filters",title:h("pivot.zone.filters"),hint:h("pivot.hint.filters"),icon:wr.filters,itemCount:n.length,onClear:()=>u("filters"),children:jsx(SortableContext,{items:n.map(y=>`item|filters|${y}`),strategy:verticalListSortingStrategy,children:jsx(Stack,{spacing:.7,children:n.map(y=>jsx(Sa,{id:`item|filters|${y}`,label:o.get(y)?.label??y,caption:c(y),trailing:d(y),onRemove:()=>s("filters",y)},y))})})}),jsx(Ho,{zone:"columns",title:h("pivot.zone.columns"),hint:h("pivot.hint.columns"),icon:wr.columns,itemCount:r.length,onClear:()=>u("columns"),children:jsx(SortableContext,{items:r.map(y=>`item|columns|${y}`),strategy:verticalListSortingStrategy,children:jsx(Stack,{spacing:.7,children:r.map(y=>jsx(Sa,{id:`item|columns|${y}`,label:o.get(y)?.label??y,caption:`${o.get(y)?.type??"dimension"} \u2022 ${c(y)}`,trailing:d(y),onRemove:()=>s("columns",y)},y))})})})]}),jsxs(Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[jsx(Ho,{zone:"rows",title:h("pivot.zone.rows"),hint:h("pivot.hint.rows"),icon:wr.rows,itemCount:a.length,onClear:()=>u("rows"),children:jsx(SortableContext,{items:a.map(y=>`item|rows|${y}`),strategy:verticalListSortingStrategy,children:jsx(Stack,{spacing:.7,children:a.map(y=>jsx(Sa,{id:`item|rows|${y}`,label:o.get(y)?.label??y,caption:`${o.get(y)?.type??"dimension"} \u2022 ${c(y)}`,trailing:d(y),onRemove:()=>s("rows",y)},y))})})}),jsx(Ho,{zone:"values",title:h("pivot.zone.values"),hint:h("pivot.hint.values"),icon:wr.values,itemCount:l.length,onClear:()=>u("values"),children:jsx(SortableContext,{items:l.map(y=>`item|values|${y.tokenId}`),strategy:verticalListSortingStrategy,children:jsx(Stack,{spacing:.7,children:l.map(y=>{let S=o.get(y.fieldId)?.label??y.fieldId,v=`${p(y.aggregation)}(${S})`;return jsx(Sa,{id:`item|values|${y.tokenId}`,label:S,caption:v,trailing:b(y),onRemove:()=>s("values",y.tokenId)},y.tokenId)})})})})]})]})]})}),jsxs(Box,{sx:{position:"relative",my:.8},children:[jsx(Divider,{}),jsx(IconButton,{size:"small","aria-label":h(e?"pivot.collapse.ariaExpand":"pivot.collapse.ariaCollapse"),onClick:t,sx:y=>({position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",border:`1px solid ${y.palette.divider}`,bgcolor:"background.paper",width:26,height:26,borderRadius:999,"&:hover":{bgcolor:y.palette.mode==="dark"?"rgba(25,118,210,0.2)":"rgba(47, 91, 255, 0.08)"}}),children:jsx(Rd,{sx:{fontSize:16,transition:"transform 220ms cubic-bezier(0.2, 0, 0, 1)",transform:e?"rotate(180deg)":"rotate(0deg)"}})})]})]})};var Ir=({node:e,dataColumns:t,fieldMap:i,level:o,expandedKeys:n,onToggle:r})=>{let a=n.has(e.key),l=e.children.length>0,u=e.isGrandTotal;return jsxs(Fragment,{children:[jsxs(TableRow,{sx:s=>({bgcolor:u?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:u?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:[jsxs(TableCell,{sx:s=>({fontSize:"0.76rem",fontWeight:u?800:600,borderBottom:`1px solid ${s.palette.divider}`,whiteSpace:"nowrap",pl:o*2+1,display:"flex",alignItems:"center",height:40}),children:[l&&!u&&jsx(IconButton,{size:"small",onClick:()=>r(e.key),sx:{p:.2,mr:.5,ml:-1},children:a?jsx(Lu,{sx:{fontSize:16}}):jsx(yu,{sx:{fontSize:16}})}),!l&&!u&&o>0&&jsx(Box,{sx:{width:20}}),e.value]}),t.map(s=>jsx(TableCell,{align:"right",sx:{fontSize:"0.76rem",fontWeight:u?800:500,borderBottom:c=>`1px solid ${c.palette.divider}`,whiteSpace:"nowrap"},children:Rs(e.aggregatedValues[s.id]??0,s.valueItem,i)},`${e.key}-${s.id}`))]}),a&&e.children.map(s=>jsx(Ir,{node:s,dataColumns:t,fieldMap:i,level:o+1,expandedKeys:n,onToggle:r},s.key))]})};var bT=({title:e,rows:t,fields:i,initialLayout:o,emptyText:n,maxPreviewHeight:r=520,model:a,enablePresetManagement:l=false,presets:u,defaultPresets:s,onPresetsChange:c,initialPresetId:d,onPresetApplied:b})=>{let{t:p}=U(),h=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:8}})),y=useRef(0),S=useRef(false),v=e??p("pivot.title.default"),m=n??p("pivot.empty"),x=useMemo(()=>({sum:p("pivot.agg.sum"),count:p("pivot.agg.count"),avg:p("pivot.agg.avg"),min:p("pivot.agg.min"),max:p("pivot.agg.max")}),[p]),w=useCallback(g=>x[g]??Ss[g],[x]),I=useMemo(()=>new Set(i.map(g=>g.id)),[i]),R=useMemo(()=>new Map(i.map(g=>[g.id,g])),[i]),[A,P]=useState(()=>Je(o?.rows,I)),[F,C]=useState(()=>Je(o?.columns,I)),[k,T]=useState(()=>Je(o?.filters,I)),[f,B]=useState(()=>{let g=o?.values??[],M=new Set,L=[];return g.forEach(W=>{if(!I.has(W.fieldId)||M.has(W.fieldId))return;M.add(W.fieldId),y.current+=1;let X=R.get(W.fieldId);L.push({tokenId:`v${y.current}`,fieldId:W.fieldId,aggregation:xt(W.aggregation,X)});}),L}),[E,Z]=useState({}),[re,le]=useState(true),[z,O]=useState(false),[V,N]=useState(()=>s??[]),[ge,ve]=useState(""),[Me,Pe]=useState(false),[Ue,lt]=useState(""),[Pt,ho]=useState(null),[Ct,yo]=useState(new Set(["__grand_total__"])),Se=a?.rowFields??A,xe=a?.columnFields??F,Ge=a?.filterFields??k,$e=a?.valueFields??f,qe=a?.filterSelections??E,Dt=a?.showGrandTotal??re,_o=a?.isConfiguratorCollapsed??z,ze=u??V,bo=l||ze.length>0||!!c,_e=useCallback(g=>{if(a?.setRowFields){a.setRowFields(g);return}P(g);},[a]),tt=useCallback(g=>{if(a?.setColumnFields){a.setColumnFields(g);return}C(g);},[a]),Ke=useCallback(g=>{if(a?.setFilterFields){a.setFilterFields(g);return}T(g);},[a]),Ze=useCallback(g=>{if(a?.setValueFields){a.setValueFields(g);return}B(g);},[a]),Vt=useCallback(g=>{if(a?.setFilterSelections){a.setFilterSelections(g);return}Z(g);},[a]),Nt=useCallback(g=>{if(a?.setShowGrandTotal){a.setShowGrandTotal(g);return}le(g);},[a]),vo=useCallback(g=>{if(a?.setIsConfiguratorCollapsed){a.setIsConfiguratorCollapsed(g);return}O(g);},[a]),Gt=useCallback(g=>{let M=typeof g=="function"?g(ze):g;u||N(M),c?.(M);},[c,ze,u]),Xt=useMemo(()=>new Set([...Se,...xe,...Ge]),[Se,xe,Ge]),Ko=useMemo(()=>i.filter(g=>!Xt.has(g.id)),[i,Xt]),st=useMemo(()=>{let g=[...Se,...xe,...Ge],M=new Set,L=[];return g.forEach(W=>{M.has(W)||(M.add(W),L.push(W));}),L},[xe,Ge,Se]);useEffect(()=>{_e(g=>{let M=g.filter(L=>I.has(L));return Ot(g,M)?g:M}),tt(g=>{let M=g.filter(L=>I.has(L));return Ot(g,M)?g:M}),Ke(g=>{let M=g.filter(L=>I.has(L));return Ot(g,M)?g:M}),Ze(g=>{let M=g.filter(L=>I.has(L.fieldId)).map(L=>({...L,aggregation:xt(L.aggregation,R.get(L.fieldId))}));return vr(g,M)?g:M});},[R,I]);let ct=useMemo(()=>{let g={};return st.forEach(M=>{let L=new Set;t.forEach(W=>{L.add(po(W[M]));}),g[M]=Array.from(L).sort((W,X)=>W.localeCompare(X));}),g},[st,t]);useEffect(()=>{Vt(g=>{let M={};return st.forEach(L=>{let W=ct[L]??[],J=(g[L]??[]).filter(K=>W.includes(K)),oe=Object.prototype.hasOwnProperty.call(g,L);M[L]=oe?J:W;}),Ds(g,M)?g:M});},[st,ct]);let dt=useMemo(()=>t.filter(g=>st.every(M=>{let L=qe[M]??[],W=ct[M]??[];if(L.length===W.length)return true;if(L.length===0)return false;let X=po(g[M]);return L.includes(X)})),[st,ct,qe,t]),D=useMemo(()=>{if($e.length===0)return null;let g=new Map;if(dt.forEach(J=>{let oe=xe.length>0?xe.map(ae=>po(J[ae])):[p("pivot.valueLabel")],K=Go(oe);g.set(K,oe);}),g.size===0){let J=xe.length>0?xe.map(()=>yr):[p("pivot.valueLabel")];g.set(Go(J),J);}let L=Array.from(g.entries()).sort((J,oe)=>Ps(J[1],oe[1])).flatMap(([J,oe])=>$e.map(K=>{let ae=R.get(K.fieldId),Qe=`${w(K.aggregation)} ${ae?.label??K.fieldId}`,Ye=xe.length===0||$e.length>1?`${oe.join(" / ")} \u2022 ${Qe}`:oe.join(" / ");return {id:`${J}::${K.tokenId}`,colKey:J,valueItem:K,label:Ye}})),W=J=>{let oe={};return L.forEach(K=>{let ae=J.filter(Qe=>{let Ye=xe.length>0?xe.map(Xe=>po(Qe[Xe])):[p("pivot.valueLabel")];return Go(Ye)===K.colKey});oe[K.id]=Wn(ae,K.valueItem.fieldId,K.valueItem.aggregation);}),oe},X=[];if(Se.length===0)X.push({key:"root",value:p("pivot.resultLabel")||xs,children:[],isLeaf:true,aggregatedValues:W(dt),path:[],depth:0});else {let J=(oe,K,ae)=>{if(K>=Se.length)return [];let Qe=Se[K],Ye=new Map;return oe.forEach(Xe=>{let q=po(Xe[Qe]);Ye.has(q)||Ye.set(q,[]),Ye.get(q).push(Xe);}),Array.from(Ye.keys()).sort().map(Xe=>{let q=Ye.get(Xe),Q=[...ae,Xe];return {key:Go(Q),value:Xe,fieldId:Qe,aggregatedValues:W(q),children:J(q,K+1,Q),isLeaf:K===Se.length-1,path:Q,depth:K}})};X.push(...J(dt,0,[]));}return {dataColumns:L,rowTree:X}},[xe,R,dt,w,Se,p,$e]),G=useCallback((g,M)=>(y.current+=1,{tokenId:`v${y.current}`,fieldId:g,aggregation:xt(M,R.get(g))}),[R]),$=useCallback(g=>{if(g==="rows")return _e([]);if(g==="columns")return tt([]);if(g==="filters")return Ke([]);Ze([]);},[]),ie=useCallback((g,M)=>{if(g==="rows")return _e(L=>L.filter(W=>W!==M));if(g==="columns")return tt(L=>L.filter(W=>W!==M));if(g==="filters")return Ke(L=>L.filter(W=>W!==M));Ze(L=>L.filter(W=>W.tokenId!==M));},[]),ne=useCallback((g,M)=>{Ze(L=>L.map(W=>W.tokenId===g?{...W,aggregation:xt(M,R.get(W.fieldId))}:W));},[R]),se=useCallback(g=>{ho(String(g.active.id));},[]),ce=useCallback(g=>{if(ho(null),!g.over)return;let M=br(String(g.active.id)),L=br(String(g.over.id));if(!M||!L||M.kind!=="item"||!M.key)return;if(M.zone===L.zone&&L.kind==="item"){if(M.zone==="rows"){let q=Se.indexOf(M.key),Q=Se.indexOf(L.key??"");q!==-1&&Q!==-1&&q!==Q&&_e(We=>arrayMove(We,q,Q));return}if(M.zone==="columns"){let q=xe.indexOf(M.key),Q=xe.indexOf(L.key??"");q!==-1&&Q!==-1&&q!==Q&&tt(We=>arrayMove(We,q,Q));return}if(M.zone==="filters"){let q=Ge.indexOf(M.key),Q=Ge.indexOf(L.key??"");q!==-1&&Q!==-1&&q!==Q&&Ke(We=>arrayMove(We,q,Q));return}if(M.zone==="values"){let q=$e.findIndex(We=>We.tokenId===M.key),Q=$e.findIndex(We=>We.tokenId===(L.key??""));q!==-1&&Q!==-1&&q!==Q&&Ze(We=>arrayMove(We,q,Q));}return}let W=L.zone,X=[...Se],J=[...xe],oe=[...Ge],K=[...$e],ae="",Qe=null;if(M.zone==="palette")ae=M.key;else if(M.zone==="values"){let q=K.find(Q=>Q.tokenId===M.key);if(!q)return;ae=q.fieldId,Qe=q,K=K.filter(Q=>Q.tokenId!==M.key);}else M.zone==="rows"?(ae=M.key,X=X.filter(q=>q!==ae)):M.zone==="columns"?(ae=M.key,J=J.filter(q=>q!==ae)):M.zone==="filters"&&(ae=M.key,oe=oe.filter(q=>q!==ae));if(!ae)return;let Ye=()=>{X=X.filter(q=>q!==ae),J=J.filter(q=>q!==ae),oe=oe.filter(q=>q!==ae);},Xe=q=>{if(L.kind!=="item"||!L.key)return q==="rows"?X.length:q==="columns"?J.length:q==="filters"?oe.length:q==="values"?K.length:0;if(q==="rows"){let Q=X.indexOf(L.key);return Q>=0?Q:X.length}if(q==="columns"){let Q=J.indexOf(L.key);return Q>=0?Q:J.length}if(q==="filters"){let Q=oe.indexOf(L.key);return Q>=0?Q:oe.length}if(q==="values"){let Q=K.findIndex(We=>We.tokenId===L.key);return Q>=0?Q:K.length}return 0};if(W==="palette"){_e(X),tt(J),Ke(oe),Ze(K);return}if(W==="values"){let q=Xe("values"),Q=Qe??G(ae);K.splice(q,0,Q),_e(X),tt(J),Ke(oe),Ze(K);return}if(Is(W)){Ye();let q=Xe(W);W==="rows"?X.splice(q,0,ae):W==="columns"?J.splice(q,0,ae):oe.splice(q,0,ae),_e(X),tt(J),Ke(oe),Ze(K);}},[xe,G,Ge,Se,$e]),ue=useCallback((g,M)=>{Vt(L=>({...L,[g]:M}));},[]),fe=useCallback(g=>{yo(M=>{let L=new Set(M);return L.has(g)?L.delete(g):L.add(g),L});},[]),Re=useCallback(g=>{let M=R.get(g.fieldId),L=Hn(M);return jsx(FormControl,{size:"small",sx:{minWidth:98},children:jsx(Select,{value:g.aggregation,onChange:W=>ne(g.tokenId,W.target.value),onClick:W=>W.stopPropagation(),onMouseDown:W=>W.stopPropagation(),sx:{fontSize:"0.72rem",height:26,"& .MuiSelect-select":{py:.35}},children:L.map(W=>jsx(MenuItem,{value:W,sx:{fontSize:"0.75rem"},children:w(W)},W))})})},[R,w,ne]),Ae=useCallback(g=>{let M=ct[g]??[],L=qe[g]??M;return M.length===0?p("pivot.filter.noValues"):L.length===0?p("pivot.filter.noneSelected"):L.length===M.length?p("pivot.filter.allValues"):p("pivot.filter.selectedCount",{selected:L.length,total:M.length})},[ct,qe,p]),je=useCallback(g=>{let M=ct[g]??[],L=qe[g]??M;return jsx(Fs,{options:M,selectedValues:L,onChange:W=>ue(g,W)})},[ct,qe,ue]),Fe=useCallback(()=>`pivot-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,[]),mt=useCallback(()=>{let g={};return new Set([...st,...Object.keys(qe)]).forEach(L=>{if(!I.has(L))return;let W=qe[L]??[];g[L]=[...W];}),{layout:{rows:[...Se],columns:[...xe],filters:[...Ge],values:$e.map(L=>({fieldId:L.fieldId,aggregation:L.aggregation}))},filterSelections:g,showGrandTotal:Dt}},[st,xe,Ge,qe,Se,Dt,I,$e]),Te=useCallback(g=>{let M=Je(g.layout.rows,I),L=Je(g.layout.columns,I),W=Je(g.layout.filters,I),X=new Set,J=(g.layout.values??[]).filter(K=>!I.has(K.fieldId)||X.has(K.fieldId)?false:(X.add(K.fieldId),true)).map(K=>G(K.fieldId,K.aggregation)),oe={};Object.entries(g.filterSelections??{}).forEach(([K,ae])=>{!I.has(K)||!Array.isArray(ae)||(oe[K]=Array.from(new Set(ae.map(Qe=>String(Qe)))));}),_e(M),tt(L),Ke(W),Ze(J),Vt(oe),typeof g.showGrandTotal=="boolean"&&Nt(g.showGrandTotal),ve(g.id),b?.(g);},[G,b,tt,Ke,Vt,_e,Nt,Ze,I]),Ta=useCallback(g=>{if(!g){ve("");return}let M=ze.find(L=>L.id===g);if(!M){ve("");return}Te(M);},[Te,ze]),wa=useCallback(()=>{let g=p("pivot.preset.defaultName",{index:ze.length+1});lt(g),Pe(true);},[ze.length,p]),Zo=useCallback(()=>{let g=Ue.trim();if(!g)return;let M={id:Fe(),name:g,...mt()};Gt(L=>[...L,M]),ve(M.id),Pe(false);},[mt,Fe,Ue,Gt]),xo=useCallback(()=>{ge&&(Gt(g=>g.filter(M=>M.id!==ge)),ve(""));},[ge,Gt]);useEffect(()=>{if(!d||S.current)return;let g=ze.find(M=>M.id===d);g&&(S.current=true,Te(g));},[Te,d,ze]),useEffect(()=>{ge&&(ze.some(g=>g.id===ge)||ve(""));},[ge,ze]);let Co=useMemo(()=>{if(!Dt||!D||!Se.length)return null;let g={};return D.dataColumns.forEach(M=>{let L=dt.filter(W=>{let X=xe.length>0?xe.map(J=>po(W[J])):[p("pivot.valueLabel")];return Go(X)===M.colKey});g[M.id]=Wn(L,M.valueItem.fieldId,M.valueItem.aggregation);}),{key:"__grand_total__",value:p("pivot.grandTotal")||Cs,children:[],isLeaf:false,isGrandTotal:true,aggregatedValues:g,path:[],depth:-1}},[Dt,D,dt,xe,Se.length,p]),Ar=()=>{if(!Pt)return null;let g=br(Pt);if(!g||g.kind!=="item"||!g.key)return null;if(g.zone==="palette"){let X=R.get(g.key);return X?jsx(qn,{label:X.label,subtitle:X.type}):null}if(g.zone==="values"){let X=$e.find(ae=>ae.tokenId===g.key);if(!X)return null;let oe=R.get(X.fieldId)?.label??X.fieldId,K=`${w(X.aggregation)}(${oe})`;return jsx(Cr,{label:oe,caption:K})}let L=R.get(g.key)?.label??g.key,W=Ae(g.key);return jsx(Cr,{label:L,caption:W})};return jsxs(Paper,{sx:g=>({p:{xs:1.2,md:2},borderRadius:4,border:`1px solid ${g.palette.divider}`,bgcolor:"background.paper",boxShadow:g.palette.mode==="dark"?"none":"0 12px 28px rgba(15, 23, 42, 0.08)",display:"flex",flexDirection:"column",gap:2}),children:[jsxs(Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1.5,flexWrap:"wrap"},children:[jsxs(Box,{children:[jsx(Typography,{sx:{fontSize:"1.05rem",fontWeight:800},children:v}),jsx(Typography,{sx:{fontSize:"0.78rem",color:"text.secondary"},children:p("pivot.subtitle.default")})]}),jsxs(Stack,{direction:"row",spacing:1.5,alignItems:"center",children:[bo&&jsxs(Fragment,{children:[jsx(FormControl,{size:"small",sx:{minWidth:200},children:jsxs(Select,{value:ge,displayEmpty:true,onChange:g=>Ta(String(g.target.value)),sx:{fontSize:"0.75rem",height:32},children:[jsx(MenuItem,{value:"",sx:{fontSize:"0.75rem",color:"text.secondary"},children:p("pivot.preset.selectPlaceholder")}),ze.map(g=>jsx(MenuItem,{value:g.id,sx:{fontSize:"0.75rem"},children:g.name},g.id))]})}),jsx(Tooltip,{title:p("pivot.preset.save"),children:jsx(IconButton,{size:"small",onClick:wa,"aria-label":p("pivot.preset.save"),children:jsx(Bl,{sx:{fontSize:18}})})}),jsx(Tooltip,{title:p("pivot.preset.delete"),children:jsx("span",{children:jsx(IconButton,{size:"small",onClick:xo,disabled:!ge,"aria-label":p("pivot.preset.delete"),children:jsx($f,{sx:{fontSize:18}})})})}),jsx(Divider,{flexItem:true,orientation:"vertical"})]}),jsxs(Typography,{sx:{fontSize:"0.74rem",color:"text.secondary"},children:[p("pivot.records"),": ",jsx("strong",{children:t.length.toLocaleString()})," / ",p("pivot.afterFilter"),":"," ",jsx("strong",{children:dt.length.toLocaleString()})]}),jsx(Divider,{flexItem:true,orientation:"vertical"}),jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:.6},children:[jsx(Typography,{sx:{fontSize:"0.74rem"},children:p("pivot.grandTotal")}),jsx(Switch,{size:"small",checked:Dt,onChange:g=>Nt(g.target.checked)})]})]})]}),jsx(Divider,{}),jsxs(DndContext,{sensors:h,collisionDetection:closestCenter,onDragStart:se,onDragEnd:ce,children:[jsx(Vs,{isConfiguratorCollapsed:_o,onToggleCollapse:()=>vo(g=>!g),availableFields:Ko,fieldMap:R,filterFields:Ge,columnFields:xe,rowFields:Se,valueFields:$e,clearZone:$,removeFieldFromZone:ie,getFilterSelectionSummary:Ae,renderDimensionFilterSelect:je,renderAggregationSelect:Re,getAggregationLabel:w}),jsx(Portal,{children:jsx(DragOverlay,{dropAnimation:{duration:250,easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)"},children:Ar()})})]}),jsx(Paper,{sx:g=>({borderRadius:3,border:`1px solid ${g.palette.divider}`,overflow:"hidden",bgcolor:"background.paper",flex:1,minHeight:0}),children:D===null?jsx(Box,{sx:{py:5,textAlign:"center"},children:jsx(Typography,{sx:{fontSize:"0.86rem",color:"text.secondary"},children:m})}):jsx(TableContainer,{sx:{maxHeight:r},children:jsxs(Table,{size:"small",stickyHeader:true,children:[jsx(TableHead,{children:jsxs(TableRow,{children:[jsx(TableCell,{sx:g=>({fontWeight:800,fontSize:"0.76rem",color:"text.primary",bgcolor:g.palette.mode==="dark"?"#000000":"#f5f5f5",borderBottom:`1px solid ${g.palette.divider}`,pl:2}),children:Se.length>0?Se.map(g=>R.get(g)?.label).join(" > "):p("pivot.table.dimensions")}),D.dataColumns.map(g=>jsx(TableCell,{align:"right",sx:M=>({fontWeight:800,fontSize:"0.75rem",color:"text.primary",bgcolor:M.palette.mode==="dark"?"#000000":"#f5f5f5",borderBottom:`1px solid ${M.palette.divider}`,minWidth:148}),children:g.label},g.id))]})}),jsxs(TableBody,{children:[D.rowTree.map(g=>jsx(Ir,{node:g,dataColumns:D.dataColumns,fieldMap:R,level:0,expandedKeys:Ct,onToggle:fe},g.key)),Co&&jsx(Ir,{node:Co,dataColumns:D.dataColumns,fieldMap:R,level:0,expandedKeys:Ct,onToggle:fe})]})]})})}),jsxs(Dialog,{open:Me,onClose:()=>Pe(false),maxWidth:"xs",fullWidth:true,children:[jsx(DialogTitle,{children:p("pivot.preset.saveDialogTitle")}),jsx(DialogContent,{children:jsx(TextField,{autoFocus:true,fullWidth:true,margin:"dense",label:p("pivot.preset.nameLabel"),value:Ue,onChange:g=>lt(g.target.value),onKeyDown:g=>{g.key==="Enter"&&(g.preventDefault(),Zo());}})}),jsxs(DialogActions,{children:[jsx(Button,{onClick:()=>Pe(false),children:p("common.cancel")}),jsx(Button,{variant:"contained",onClick:Zo,disabled:!Ue.trim(),children:p("common.save")})]})]})]})};var kT=({fields:e,initialLayout:t,initialFilterSelections:i={},initialShowGrandTotal:o=true,initialConfiguratorCollapsed:n=false})=>{let r=useRef(0),a=useMemo(()=>new Set(e.map(z=>z.id)),[e]),l=useMemo(()=>new Map(e.map(z=>[z.id,z])),[e]),[u,s]=useState(()=>Je(t?.rows,a)),[c,d]=useState(()=>Je(t?.columns,a)),[b,p]=useState(()=>Je(t?.filters,a)),[h,y]=useState(()=>{let z=t?.values??[],O=new Set,V=[];return z.forEach(N=>{!a.has(N.fieldId)||O.has(N.fieldId)||(O.add(N.fieldId),r.current+=1,V.push({tokenId:`v${r.current}`,fieldId:N.fieldId,aggregation:xt(N.aggregation,l.get(N.fieldId))}));}),V}),[S,v]=useState(i),[m,x]=useState(o),[w,I]=useState(n);useEffect(()=>{s(z=>{let O=z.filter(V=>a.has(V));return Ot(z,O)?z:O}),d(z=>{let O=z.filter(V=>a.has(V));return Ot(z,O)?z:O}),p(z=>{let O=z.filter(V=>a.has(V));return Ot(z,O)?z:O}),y(z=>{let O=z.filter(V=>a.has(V.fieldId)).map(V=>({...V,aggregation:xt(V.aggregation,l.get(V.fieldId))}));return vr(z,O)?z:O});},[l,a]);let R=useCallback(z=>{s(Je(z,a));},[a]),A=useCallback(z=>{d(Je(z,a));},[a]),P=useCallback(z=>{p(Je(z,a));},[a]),F=useCallback(z=>{y(O=>{let V=z??[],N=new Set,ge=[];return V.forEach(ve=>{if(!a.has(ve.fieldId)||N.has(ve.fieldId))return;N.add(ve.fieldId);let Me=O.find(Pe=>Pe.fieldId===ve.fieldId);if(Me){ge.push({...Me,aggregation:xt(ve.aggregation??Me.aggregation,l.get(ve.fieldId))});return}r.current+=1,ge.push({tokenId:`v${r.current}`,fieldId:ve.fieldId,aggregation:xt(ve.aggregation,l.get(ve.fieldId))});}),ge});},[l,a]),C=useCallback(z=>{R(z.rows??[]),A(z.columns??[]),P(z.filters??[]),F(z.values??[]);},[A,P,R,F]),k=useCallback(z=>{if(z==="rows")return s([]);if(z==="columns")return d([]);if(z==="filters")return p([]);y([]);},[]),T=useCallback((z,O)=>{if(z==="rows")return s(V=>V.filter(N=>N!==O));if(z==="columns")return d(V=>V.filter(N=>N!==O));if(z==="filters")return p(V=>V.filter(N=>N!==O));y(V=>V.filter(N=>N.tokenId!==O));},[]),f=useCallback((z,O)=>{y(V=>V.map(N=>N.tokenId===z?{...N,aggregation:xt(O,l.get(N.fieldId))}:N));},[l]),B=useCallback((z,O)=>{v(V=>({...V,[z]:O}));},[]),E=useCallback(()=>{v({});},[]),Z=useCallback(()=>{x(z=>!z);},[]),re=useCallback(()=>{I(z=>!z);},[]);return {model:useMemo(()=>({rowFields:u,setRowFields:s,columnFields:c,setColumnFields:d,filterFields:b,setFilterFields:p,valueFields:h,setValueFields:y,filterSelections:S,setFilterSelections:v,showGrandTotal:m,setShowGrandTotal:x,isConfiguratorCollapsed:w,setIsConfiguratorCollapsed:I}),[c,b,S,w,u,m,h]),actions:{setRows:R,setColumns:A,setFilters:P,setValues:F,setLayout:C,clearZone:k,removeFieldFromZone:T,setAggregationForValue:f,setFilterSelection:B,resetFilterSelections:E,toggleGrandTotal:Z,toggleConfigurator:re}}};var Zs=Yf(()=>import('./COrbCanvas-EGX5NO3Y.mjs').then(e=>e.COrbCanvas),{ssr:false,loading:()=>jsx("div",{className:"h-full w-full bg-transparent"})});function Jn({isRecording:e}){return jsx(AnimatePresence,{children:e&&jsx(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:jsxs("div",{className:"relative flex h-full w-full items-center justify-center",children:[jsx("div",{className:"absolute inset-0",children:jsx(Zs,{hue:0,hoverIntensity:.5,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})}),jsx("div",{className:"relative z-10 h-full w-1/3 mix-blend-overlay opacity-80",children:jsx(Zs,{hue:10,hoverIntensity:.8,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})})]})})})}var PT=Jn;function js({onTextUpdate:e,onComplete:t,onError:i,wsUrl:o="ws://localhost:8765",silenceThresholdMs:n=2e3,minVolumeRms:r=.015}){let[a,l]=useState(false),u=useRef(null),s=useRef(null),c=useRef(null),d=useRef(null),b=useRef(null),p=useRef(0),h=useRef(false),y=useRef(false),S=useCallback(()=>{u.current&&(u.current.close(),u.current=null),d.current&&(d.current.disconnect(),d.current=null),b.current&&(b.current.disconnect(),b.current=null),s.current&&(s.current.getTracks().forEach(x=>x.stop()),s.current=null),c.current&&(c.current.close(),c.current=null),y.current=false,l(false);},[]),v=useCallback(()=>{h.current||(h.current=true,u.current?.readyState===WebSocket.OPEN&&u.current.send(JSON.stringify({type:"stop"})),setTimeout(S,500));},[S]),m=useCallback(async()=>{if(!(a||y.current)){y.current=true,h.current=false,p.current=Date.now();try{let x=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,sampleRate:16e3,echoCancellation:!0,noiseSuppression:!0}});s.current=x;let w=new WebSocket(o);u.current=w,w.onopen=()=>{l(!0),y.current=!1;},w.onmessage=F=>{try{let C=JSON.parse(F.data);if(C.type==="recognition")C.is_final?t(C.text):e?.(C.text);else if(C.type==="error"){let k=C.message||"Voice recognition error";i?.(k),v();}}catch{i?.("Failed to parse voice message");}},w.onerror=()=>{i?.("Voice service connection failed"),S();},w.onclose=()=>{S();};let I=window.AudioContext||window.webkitAudioContext;if(!I)throw new Error("AudioContext is not supported in this browser");let R=new I({sampleRate:16e3});c.current=R;let A=R.createMediaStreamSource(x);b.current=A;let P=R.createScriptProcessor(4096,1,1);d.current=P,P.onaudioprocess=F=>{if(u.current?.readyState!==WebSocket.OPEN)return;let C=F.inputBuffer.getChannelData(0),k=0;for(let B=0;B<C.length;B+=1)k+=C[B]*C[B];if(Math.sqrt(k/C.length)>r)p.current=Date.now();else if(Date.now()-p.current>n&&!h.current){v();return}let f=new Int16Array(C.length);for(let B=0;B<C.length;B+=1){let E=Math.max(-1,Math.min(1,C[B]));f[B]=E<0?E*32768:E*32767;}u.current.send(f.buffer);},A.connect(P),P.connect(R.destination);}catch{i?.("Cannot access microphone"),S();}}},[S,a,r,t,i,e,n,v,o]);return useEffect(()=>S,[S]),{isRecording:a,startRecording:m,stopRecording:v}}var Ys=createContext(null);function lh(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 sh({children:e,onVoiceSubmit:t,onVoicePartial:i,onVoiceError:o,longPressMs:n=200,disableSpaceTrigger:r=false,ignoreWhenFocusedInput:a=true,renderOverlay:l=true,wsUrl:u,silenceThresholdMs:s,minVolumeRms:c}){let[d,b]=useState(false),[p,h]=useState(false),y=useRef(null),S=useRef(false),v=useRef(false),m=useCallback(()=>{v.current=false,b(false);},[]),{isRecording:x,startRecording:w,stopRecording:I}=js({wsUrl:u,silenceThresholdMs:s,minVolumeRms:c,onTextUpdate:F=>{i?.(F);},onComplete:async F=>{try{F.trim()&&(h(!0),await t(F.trim()));}catch(C){let k=C instanceof Error?C.message:"Failed to process voice command";o?.(k);}finally{h(!1),m();}},onError:F=>{o?.(F),h(!1),S.current||m();}}),R=useCallback(async()=>{v.current=false,await w();},[w]),A=useCallback(()=>{I();},[I]);useEffect(()=>{if(r)return;let F=k=>{k.isComposing||(k.code==="Space"||k.key===" ")&&(S.current||k.repeat||a&&lh(document.activeElement)||(S.current=true,k.preventDefault(),y.current=setTimeout(()=>{v.current=true,b(true),w();},n)));},C=k=>{(k.code==="Space"||k.key===" ")&&(y.current&&(clearTimeout(y.current),y.current=null),S.current=false,v.current&&(k.preventDefault(),b(false),I()));};return window.addEventListener("keydown",F),window.addEventListener("keyup",C),()=>{window.removeEventListener("keydown",F),window.removeEventListener("keyup",C),y.current&&(clearTimeout(y.current),y.current=null);}},[r,a,n,w,I]);let P=useMemo(()=>({isRecording:x,isHotkeyRecording:d,isSubmitting:p,startRecording:R,stopRecording:A}),[d,x,p,R,A]);return jsxs(Ys.Provider,{value:P,children:[l?jsx(Jn,{isRecording:d}):null,e]})}function ch(){let e=useContext(Ys);if(!e)throw new Error("useAINav must be used within CAINavProvider");return e}var ET=sh,zT=ch;var yh={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)"}}},$T=({children:e,transitionKey:t,variant:i="fade",durationMs:o=220,delayMs:n=0,easing:r="cubic-bezier(0.22, 1, 0.36, 1)",disabled:a=false,sx:l})=>{let u=useMediaQuery("(prefers-reduced-motion: reduce)"),[s,c]=useState("to"),d=!a&&!u&&i!=="none";useEffect(()=>{if(!d){c("to");return}c("from");let h=requestAnimationFrame(()=>{h=requestAnimationFrame(()=>{c("to");});});return ()=>cancelAnimationFrame(h)},[t,d]);let b=yh[i],p=useMemo(()=>d?s==="from"?b.from:b.to:{opacity:1,transform:"none"},[d,s,b.from,b.to]);return jsx(Box,{sx:{willChange:d?"opacity, transform":"auto",transition:d?`opacity ${o}ms ${r} ${n}ms, transform ${o}ms ${r} ${n}ms`:"none",backfaceVisibility:"hidden",...p,...l},children:e})},WT={subtle:{variant:"fade",durationMs:180},smooth:{variant:"slide-up",durationMs:220},snappy:{variant:"scale",durationMs:160}};
|
|
13
|
-
export{
|
|
7
|
+
`),m={enableMath:o},d=0;for(;d<p.length;){let g=p[d],h=g.trim();if(!h){d+=1;continue}if(i&&sc(g)){if(h.startsWith("<think>")){let f=[],v=g;for(;;){let y=v.indexOf("<think>"),S=y>=0?v.slice(y+7):v,R=S.indexOf("</think>");if(R>=0){f.push(S.slice(0,R)),d+=1;break}if(f.push(S),d+=1,d>=p.length)break;v=p[d];}l.push(jsx(Nr,{content:f.join(`
|
|
8
|
+
`).trim()},`think-tag-${d}`));continue}d+=1;let C=[];for(;d<p.length&&p[d].trim()!==":::";)C.push(p[d]),d+=1;d<p.length&&p[d].trim()===":::"&&(d+=1),l.push(jsx(Nr,{content:C.join(`
|
|
9
|
+
`).trim()},`think-fence-${d}`));continue}if(zr(g)){let C=h.slice(3).trim().toLowerCase(),f=[];for(d+=1;d<p.length&&!zr(p[d]);)f.push(p[d]),d+=1;d<p.length&&zr(p[d])&&(d+=1);let v=f.join(`
|
|
10
|
+
`);if(n&&C==="mermaid"){l.push(jsx(pi,{code:v},`mermaid-${d}`));continue}if(o&&["math","latex","katex"].includes(C)){l.push(jsx(Oa,{expression:v,allowKatex:true},`math-fence-${d}`));continue}l.push(jsx(za,{code:v,language:C||"text",copyable:a,showLineNumbers:s,wrapLongLines:true},`code-${d}`));continue}if(o&&h.startsWith("$$")){let C=[];if(h.endsWith("$$")&&h!=="$$")C.push(h.slice(2,-2)),d+=1;else {let v=g.slice(g.indexOf("$$")+2);for(v.trim()&&C.push(v),d+=1;d<p.length;){let y=p[d],S=y.indexOf("$$");if(S>=0){C.push(y.slice(0,S)),d+=1;break}C.push(y),d+=1;}}l.push(jsx(Oa,{expression:C.join(`
|
|
11
|
+
`).trim(),allowKatex:true},`math-${d}`));continue}if(rc(g)){let C=Math.min(6,g.match(/^#{1,6}/)?.[0]?.length||1),f=g.replace(/^#{1,6}\s+/,""),v=C===1?"h5":C===2?"h6":"subtitle1";l.push(jsx(Typography,{variant:v,sx:{mt:C===1?1.2:.8,mb:.5,fontWeight:700},children:Ga(f,m,`h-${d}`)},`heading-${d}`)),d+=1;continue}if(nc(g)){l.push(jsx(Divider,{sx:{my:1.2}},`hr-${d}`)),d+=1;continue}if(ic(p,d)){let C=d+2;for(;C<p.length&&p[C].trim()&&p[C].includes("|");)C+=1;let f=p.slice(d,C).join(`
|
|
12
|
+
`),v=Lr(f);if(v){l.push(jsx(gi,{table:v},`table-${d}`)),d=C;continue}}if(xi(g)){let C=[];for(;d<p.length&&xi(p[d]);)C.push(p[d].replace(/^\s*>\s?/,"")),d+=1;l.push(jsx(Paper,{variant:"outlined",sx:{px:1,py:.8,my:.9,borderLeftWidth:3,borderLeftStyle:"solid",borderLeftColor:"primary.main",bgcolor:"action.hover"},children:jsx(Typography,{variant:"body2",sx:{whiteSpace:"pre-wrap"},children:C.map((f,v)=>jsxs(Fragment$1,{children:[v>0&&jsx("br",{}),Ga(f,m,`q-${d}-${v}`)]},`quote-line-${v}`))})},`quote-${d}`));continue}if(yi(g)){let C=[];for(;d<p.length&&yi(p[d]);)C.push(p[d].trim().replace(/^[-*+]\s+/,"")),d+=1;l.push(jsx(Box,{component:"ul",sx:{my:.8,pl:2.5},children:C.map((f,v)=>jsx(Box,{component:"li",sx:{mb:.45},children:jsx(Typography,{variant:"body2",children:Ga(f,m,`ul-${d}-${v}`)})},`ul-item-${v}`))},`ul-${d}`));continue}if(bi(g)){let C=[];for(;d<p.length&&bi(p[d]);)C.push(p[d].trim().replace(/^\d+\.\s+/,"")),d+=1;l.push(jsx(Box,{component:"ol",sx:{my:.8,pl:2.7},children:C.map((f,v)=>jsx(Box,{component:"li",sx:{mb:.45},children:jsx(Typography,{variant:"body2",children:Ga(f,m,`ol-${d}-${v}`)})},`ol-item-${v}`))},`ol-${d}`));continue}let k=[];for(;d<p.length;){let C=p[d],f=C.trim();if(!f||zr(C)||rc(C)||nc(C)||yi(C)||bi(C)||xi(C)||ic(p,d)||i&&sc(C)||o&&f.startsWith("$$"))break;k.push(C),d+=1;}k.length>0?l.push(jsx(Typography,{variant:"body2",sx:{my:.65,lineHeight:1.65},children:k.map((C,f)=>jsxs(Fragment$1,{children:[f>0&&jsx("br",{}),Ga(C,m,`p-${d}-${f}`)]},`p-line-${f}`))},`p-${d}`)):d+=1;}return l},[u,o,n,i,a,s]);return jsx(Box,{className:r,sx:{"& strong":{fontWeight:700},"& em":{fontStyle:"italic"},"& a":{wordBreak:"break-all"}},children:c})};var cT=(e,t)=>jsx(Ha,{markdown:e,...t});var dc=({value:e,onChange:t,onSubmit:r,onVoiceInput:o,onClear:n,placeholder:i,statusText:a,loading:s=false,compact:u=false,showStatusText:c=true})=>jsxs(Stack,{spacing:.75,children:[jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1,px:1.2,py:u?.25:.4,borderRadius:999,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",minHeight:u?38:44},children:[jsx(Pl,{sx:{fontSize:u?16:18,color:"text.secondary"}}),jsx(InputBase,{fullWidth:true,value:e,onChange:l=>t(l.target.value),onKeyDown:l=>{l.key==="Enter"&&(l.preventDefault(),r());},placeholder:i,sx:{fontSize:u?"0.84rem":"0.9rem"}}),e&&n&&jsx(IconButton,{size:"small",onClick:n,children:jsx(em,{sx:{fontSize:u?16:18}})}),o&&jsx(IconButton,{size:"small",onClick:o,children:jsx(lm,{sx:{fontSize:u?16:18}})}),jsx(IconButton,{size:"small",onClick:r,disabled:s||!e.trim(),children:jsx(dm,{sx:{fontSize:u?16:18}})})]}),c&&a&&jsx(Typography,{variant:"caption",color:"text.secondary",children:a})]});var uc=(e,t)=>{let r=t.trim();if(!r)return e;let o=e.toLowerCase(),n=r.toLowerCase(),i=o.indexOf(n);return i<0?e:jsxs(Fragment,{children:[e.slice(0,i),jsx(Box,{component:"mark",sx:{bgcolor:"warning.light",color:"warning.contrastText",px:.15,borderRadius:.4},children:e.slice(i,i+r.length)}),e.slice(i+r.length)]})},Or=({section:e,highlightQuery:t=""})=>{let r=e.columns||2;return jsxs(Paper,{variant:"outlined",sx:{p:1.8,borderRadius:2},children:[jsx(Typography,{variant:"subtitle1",sx:{fontWeight:700,mb:1.4},children:e.title}),jsx(Box,{sx:{display:"grid",gap:1.15,gridTemplateColumns:{xs:"1fr",md:r===3?"repeat(3, minmax(0, 1fr))":r===1?"1fr":"repeat(2, minmax(0, 1fr))"}},children:e.fields.map(o=>{let n=typeof o.value=="string"||typeof o.value=="number"?String(o.value):null;return jsxs(Box,{sx:{minWidth:0},children:[jsx(Typography,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:uc(o.label,t)}),jsx(Typography,{component:"div",variant:"body2",sx:{mt:.2,fontWeight:500,wordBreak:"break-word"},children:n?uc(n,t):o.value})]},o.id)})})]})};var wi=e=>e==null?"":typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):"",$r=e=>e.trim().toLowerCase(),Gf=(e,t)=>{let r=[];return e.forEach(o=>{o.fields.forEach(n=>{let i=n.searchableText||wi(n.value),a={source:"section",sourceId:o.id,sourceSectionId:o.id,sourceTitle:o.title,fieldId:n.id,fieldLabel:n.label,fieldValue:i};r.push({hit:a,text:$r(`${o.title} ${n.label} ${i}`)});});}),t.forEach(o=>{(o.fields||[]).forEach(n=>{let i=n.searchableText||wi(n.value),a={source:"tab",sourceId:o.id,sourceTitle:o.label,fieldId:n.id,fieldLabel:n.label,fieldValue:i};r.push({hit:a,text:$r(`${o.label} ${n.label} ${i}`)});}),(o.sections||[]).forEach(n=>{n.fields.forEach(i=>{let a=i.searchableText||wi(i.value),s={source:"tab",sourceId:o.id,sourceSectionId:n.id,sourceTitle:`${o.label} / ${n.title}`,fieldId:i.id,fieldLabel:i.label,fieldValue:a};r.push({hit:s,text:$r(`${o.label} ${n.title} ${i.label} ${a}`)});});});}),r},pc=({sections:e,tabs:t=[],defaultTabId:r,ai:o})=>{let{t:n}=q(),[i,a]=useState(""),[s,u]=useState(r||t[0]?.id),[c,l]=useState("idle"),[p,m]=useState([]),[d,g]=useState(""),[h,k]=useState(""),[C,f]=useState(false),v=useMemo(()=>Gf(e,t),[e,t]);useEffect(()=>{if(t.length===0){u(void 0);return}t.some(F=>F.id===s)||u(r||t[0]?.id);},[t,s,r]);let y=useCallback(()=>{l("idle"),m([]),g(""),k("");},[]),S=useCallback(T=>{a(T),T.trim()||(l("idle"),m([]),g(""),k(""));},[]),R=useCallback(T=>{let F=$r(T);return F?v.filter(w=>w.text.includes(F)).map(w=>w.hit):[]},[v]),A=useCallback(async()=>{let T=i.trim();if(!T)return;f(true);let F=R(T);if(m(F),F.length>0){l("search"),k(""),g(n("detail.searchAi.matches",{count:F.length})),f(false);return}if(o?.enabled!==false&&o?.onSubmit){l("ai"),g(n("detail.searchAi.autoAiFallback"));try{let I=await o.onSubmit(T,{query:T,hits:F,activeTabId:s,sections:e,tabs:t});k(typeof I=="string"?I:"");}finally{f(false);}return}l("search"),k(""),g(n("detail.searchAi.noMatch")),f(false);},[i,R,n,o,s,e,t]);return {query:i,setQuery:S,activeTabId:s,setActiveTabId:u,searchMode:c,hits:p,statusText:d,aiResponse:h,searching:C,handleSubmit:A,clearResult:y}};var $T=({title:e,subtitle:t,sections:r,tabs:o=[],defaultTabId:n,table:i,ai:a,rightHeaderSlot:s,searchBarWidth:u=460,onClose:c,closeLabel:l="Close"})=>{let{t:p}=q(),{query:m,setQuery:d,activeTabId:g,setActiveTabId:h,searchMode:k,hits:C,statusText:f,aiResponse:v,searching:y,handleSubmit:S,clearResult:R}=pc({sections:r,tabs:o,defaultTabId:n,ai:a}),A=useMemo(()=>o.find(w=>w.id===g)||o[0],[o,g]),T=useCallback(w=>{let I=P=>{let b=document.getElementById(w);if(b){b.scrollIntoView({behavior:"smooth",block:"center"});return}P<4&&setTimeout(()=>I(P+1),60);};requestAnimationFrame(()=>I(0));},[]),F=useCallback((w,I)=>{if(o.some(P=>P.id===w)){h(w),T(I?`detail-tab-${w}-section-${I}`:`detail-tab-${w}`);return}T(`detail-section-${w}`);},[o,h,T]);return jsxs(Box,{sx:{display:"flex",flexDirection:"column",gap:1.5,minHeight:"100%"},children:[jsxs(Stack,{direction:{xs:"column",md:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",md:"center"},spacing:1,children:[jsxs(Box,{sx:{minWidth:0},children:[jsx(Typography,{variant:"h5",sx:{fontWeight:800,color:"text.primary"},children:e}),t&&jsx(Typography,{variant:"body2",color:"text.secondary",sx:{mt:.35},children:t})]}),jsxs(Stack,{direction:"row",spacing:.6,alignItems:"center",sx:{width:{xs:"100%",md:"auto"},ml:{xs:0,md:"auto"}},children:[jsx(Box,{sx:{width:{xs:"100%",md:u},maxWidth:"100%",minWidth:{md:320}},children:jsx(dc,{value:m,onChange:d,onSubmit:S,onVoiceInput:a?.onVoiceInput,onClear:()=>{d(""),R();},placeholder:a?.placeholder||p("detail.searchAi.placeholder"),statusText:f,loading:y,compact:true,showStatusText:false})}),c&&jsx(Tooltip,{title:l,children:jsx(IconButton,{size:"small",onClick:c,children:jsx(Kf,{fontSize:"small"})})}),s]})]}),f&&jsx(Typography,{variant:"caption",color:"text.secondary",sx:{mt:-0.7},children:f}),k==="search"&&C.length>0&&jsxs(Paper,{variant:"outlined",sx:{p:1.5,borderRadius:2},children:[jsx(Typography,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.6},children:p("detail.searchAi.matches",{count:C.length})}),jsx(Stack,{spacing:.35,children:C.slice(0,8).map(w=>jsx(Box,{component:"button",type:"button",onClick:()=>F(w.sourceId,w.sourceSectionId),sx:{textAlign:"left",border:0,bgcolor:"transparent",p:.2,cursor:"pointer",color:"text.primary",borderRadius:1,"&:hover":{bgcolor:"action.hover"}},children:jsxs(Typography,{variant:"body2",sx:{fontSize:"0.84rem"},children:[jsx(Box,{component:"span",sx:{color:"text.secondary"},children:w.sourceTitle})," \xB7 ",jsx(Box,{component:"span",sx:{fontWeight:700},children:w.fieldLabel})," = ",jsx(Box,{component:"span",children:w.fieldValue||"-"})]})},`${w.source}|${w.sourceId}|${w.fieldId}`))})]}),k==="ai"&&v&&jsxs(Paper,{variant:"outlined",sx:{p:1.5,borderRadius:2},children:[jsx(Typography,{variant:"subtitle2",sx:{fontWeight:700,mb:.7},children:p("detail.searchAi.aiResultTitle")}),jsx(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:jsx(Ha,{markdown:v})})]}),jsx(Box,{sx:{display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",lg:"repeat(2, minmax(0, 1fr))"}},children:r.map(w=>jsx(Box,{id:`detail-section-${w.id}`,children:jsx(Or,{section:w,highlightQuery:m})},w.id))}),o.length>0&&jsxs(Paper,{variant:"outlined",sx:{borderRadius:2,overflow:"hidden"},children:[jsx(Tabs,{value:A?.id||false,onChange:(w,I)=>h(I),variant:"scrollable",scrollButtons:"auto",sx:{borderBottom:"1px solid",borderColor:"divider"},children:o.map(w=>jsx(Tab,{value:w.id,label:w.label,sx:{textTransform:"none"}},w.id))}),jsxs(Box,{sx:{p:1.5},children:[jsx(Box,{id:`detail-tab-${A?.id||""}`}),A?.description&&jsx(Typography,{variant:"body2",color:"text.secondary",sx:{mb:1.2},children:A.description}),A?.content?A.content:jsxs(Stack,{spacing:1.5,children:[(A?.sections||[]).map(w=>jsx(Box,{id:`detail-tab-${A?.id}-section-${w.id}`,children:jsx(Or,{section:w,highlightQuery:m})},w.id)),A?.fields&&A.fields.length>0&&jsx(Or,{section:{id:`${A.id}-fields`,title:A.label,fields:A.fields,columns:2},highlightQuery:m})]})]})]}),i&&jsx(mo,{title:i.title||p("detail.table.title"),...i.tableProps,filterConfig:void 0,fitContainer:false})]})};var yc=64,lh="#E9EDF2",ch="linear-gradient(90deg, #F5F7FA 0%, #E9EDF2 50%, #F5F7FA 100%)",dh=["en","zh","fr","de","ja","ko"],bc={en:"EN",zh:"\u4E2D\u6587",fr:"FR",de:"DE",ja:"\u65E5\u672C\u8A9E",ko:"\uD55C\uAD6D\uC5B4"},xc=({appTitle:e,logo:t,mode:r="dark",onToggleMode:o,locale:n,localeLabel:i,localeOptions:a,onLocaleChange:s,searchPlaceholder:u,onSearch:c,user:l,onUserSetting:p,onUserLogout:m,userMenuItems:d,leftSlot:g,rightSlot:h})=>{let{t:k,locale:C}=q(),v=useTheme().palette.mode==="dark",[y,S]=useState(""),[R,A]=useState(null),[T,F]=useState(null),w=H=>{H.preventDefault(),c&&c(y.trim());},I=r==="system"?jsx(ah,{fontSize:"small"}):r==="dark"?jsx(rh,{fontSize:"small"}):jsx(nh,{fontSize:"small"}),P=k(r==="system"?"header.theme.system":r==="dark"?"header.theme.dark":"header.theme.light"),b=n||C,L=a&&a.length>0?a:dh,D=i||bc[b]||b.toUpperCase(),U=!!R,j=u||k("header.searchPlaceholder"),te=!!T,N=[{key:"setting",label:k("header.menu.setting"),icon:jsx(ig,{sx:{fontSize:18}}),onClick:p},{key:"logout",label:k("header.menu.logout"),icon:jsx(sh,{sx:{fontSize:18}}),onClick:m}],V=d&&d.length>0?d:N,W=H=>{F(null),H?.();};return jsxs(AppBar,{position:"sticky",elevation:0,sx:H=>({top:0,zIndex:H.zIndex.drawer+10,height:yc,backgroundColor:H.palette.mode==="dark"?"#0D0D0D":lh,backgroundImage:H.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%)",ch,"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:H.palette.mode==="dark"?"rgba(255,255,255,0.12)":"rgba(15,23,42,0.12)"}),children:[jsxs(Toolbar,{sx:{minHeight:`${yc}px !important`,px:2,gap:2},children:[jsxs(Stack,{direction:"row",alignItems:"center",spacing:1.5,sx:{minWidth:220},children:[t||jsx(Box,{component:"img",src:"/orbcafe.png",alt:"ORBCAFE Logo",sx:{width:44,height:44,display:"block",objectFit:"contain",flexShrink:0}}),e&&jsx(Typography,{variant:"h6",sx:{fontWeight:700,color:v?"common.white":"#111827"},children:e}),g]}),jsx(Box,{sx:{flex:1,display:"flex",justifyContent:"center",minWidth:0},children:jsx(Box,{component:"form",onSubmit:w,sx:{width:"100%",maxWidth:540},children:jsx(TextField,{size:"small",fullWidth:true,value:y,onChange:H=>S(H.target.value),placeholder:j,InputProps:{startAdornment:jsx(InputAdornment,{position:"start",children:jsx(Pl,{sx:{color:v?"rgba(255,255,255,0.7)":"rgba(15,23,42,0.55)",fontSize:18}})}),sx:{color:v?"common.white":"rgba(17,24,39,0.9)",bgcolor:v?"rgba(255,255,255,0.08)":"#ffffff",borderRadius:999,"& .MuiOutlinedInput-notchedOutline":{borderColor:v?"rgba(255,255,255,0.15)":"rgba(15,23,42,0.2)"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:v?"rgba(255,255,255,0.35)":"rgba(15,23,42,0.35)"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:v?"rgba(255,255,255,0.5)":"rgba(15,23,42,0.55)"}}},inputProps:{style:{color:v?"white":"#111827"}}})})}),jsxs(Stack,{direction:"row",alignItems:"center",spacing:1.5,children:[s?jsxs(Fragment,{children:[jsx(IconButton,{size:"small",onClick:H=>A(H.currentTarget),sx:{color:v?"common.white":"#111827",borderRadius:1,px:.5},children:jsxs(Stack,{direction:"row",alignItems:"center",spacing:.45,children:[jsx(hc,{sx:{fontSize:18}}),jsx(Typography,{variant:"caption",sx:{fontWeight:500},children:D})]})}),jsx(Menu,{anchorEl:R,open:U,onClose:()=>A(null),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:L.map(H=>jsx(MenuItem,{selected:H===b,onClick:()=>{s(H),A(null);},sx:{fontSize:"0.82rem"},children:bc[H]},H))})]}):jsxs(Stack,{direction:"row",alignItems:"center",spacing:.5,children:[jsx(hc,{sx:{color:v?"common.white":"#111827",fontSize:18}}),jsx(Typography,{variant:"caption",sx:{color:v?"common.white":"#111827",fontWeight:500},children:D})]}),jsx(IconButton,{size:"small",sx:{color:v?"common.white":"#111827"},onClick:o,title:P,children:I}),l&&jsxs(Stack,{direction:"row",alignItems:"center",spacing:1,children:[jsxs(Box,{sx:{textAlign:"right",minWidth:0},children:[jsx(Typography,{variant:"body2",sx:{color:v?"common.white":"#111827",fontWeight:700,lineHeight:1.15},children:l.name}),l.subtitle&&jsx(Typography,{variant:"caption",sx:{display:"block",mt:.25,color:v?"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})]}),jsx(IconButton,{size:"small",onClick:H=>F(H.currentTarget),sx:{p:0},children:jsx(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()})})]}),h]})]}),l&&jsx(Menu,{anchorEl:T,open:te,onClose:()=>F(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:V.map(H=>jsxs(MenuItem,{disabled:H.disabled,onClick:()=>W(H.onClick),children:[H.icon&&jsx(ListItemIcon,{children:H.icon}),jsx(ListItemText,{primary:H.label,slotProps:{primary:{sx:{fontSize:"0.86rem",fontWeight:500}}}})]},H.key))})]})};var vc=({menuData:e=[],initialNavigationCollapsed:t=false}={})=>{let{navigationIslandProps:r}=Ss({initialCollapsed:t,content:e}),[o,n]=useState(900);useEffect(()=>{let a=()=>n(window.innerHeight);return a(),window.addEventListener("resize",a),()=>window.removeEventListener("resize",a)},[]);let i=useMemo(()=>Math.max(280,o-100),[o]);return {navigationIslandProps:r,navigationMaxHeight:i}};var u1=({appTitle:e,menuData:t=[],children:r,showNavigation:o=true,locale:n="en",localeLabel:i,localeOptions:a,onLocaleChange:s,user:u,onUserSetting:c,onUserLogout:l,userMenuItems:p,logo:m,onSearch:d,rightHeaderSlot:g,leftHeaderSlot:h,contentSx:k})=>{let C="orbcafe:page-layout-mode",[f,v]=useState("system"),[y,S]=useState("light"),[R,A]=useState(false),T=f==="system"?R?y:"light":f;useEffect(()=>{try{let L=window.localStorage.getItem(C);(L==="light"||L==="dark"||L==="system")&&v(L);}catch{}A(true);let P=window.matchMedia("(prefers-color-scheme: dark)"),b=()=>{S(P.matches?"dark":"light");};return b(),P.addEventListener("change",b),()=>P.removeEventListener("change",b)},[]),useEffect(()=>{if(R)try{window.localStorage.setItem(C,f);}catch{}},[R,f]);let F=useMemo(()=>createTheme({palette:{mode:T}}),[T]),{navigationIslandProps:w,navigationMaxHeight:I}=vc({menuData:t,initialNavigationCollapsed:false});return jsx(ThemeProvider,{theme:F,children:jsx(fs,{locale:n,children:jsxs(Box,{sx:P=>({minHeight:"100vh",display:"flex",flexDirection:"column",background:P.palette.mode==="dark"?"linear-gradient(180deg, #0A0A0A 0%, #141414 55%, #1A1A1A 100%)":P.palette.background.default}),children:[jsx(xc,{appTitle:e,logo:m,mode:f,onToggleMode:()=>v(P=>P==="system"?"dark":P==="dark"?"light":"system"),locale:n,localeLabel:i,localeOptions:a,onLocaleChange:s,user:u,onUserSetting:c,onUserLogout:l,userMenuItems:p,onSearch:d,leftSlot:h,rightSlot:g}),jsxs(Box,{sx:{flex:1,minHeight:0,display:"flex"},children:[o&&jsx(Box,{sx:{p:1.5,display:"flex",alignItems:"flex-start",flexShrink:0},children:jsx(Cs,{...w,maxHeight:I,colorMode:T})}),jsx(Box,{sx:{flex:1,minWidth:0,minHeight:0,overflow:"auto",p:1.5,...k},children:r})]})]})})})};var Ur="(blank)",Sc="Result",wc="Grand Total",Tc={sum:"Sum",count:"Count",avg:"Average",min:"Min",max:"Max"},Ic=["sum","count","avg","min","max"];var Pc=["palette","rows","columns","filters","values"];var Rc=e=>Pc.includes(e),Dc=e=>e==="rows"||e==="columns"||e==="filters",qr=e=>{let t=e.split("|");return t.length===2&&t[0]==="container"&&Rc(t[1])?{kind:"container",zone:t[1]}:t.length===3&&t[0]==="item"&&Rc(t[1])&&t[2]?{kind:"item",zone:t[1],key:t[2]}:null},Bo=e=>e==null||e===""?Ur:e instanceof Date?e.toISOString().slice(0,10):String(e),na=e=>JSON.stringify(e),Ac=(e,t)=>{let r=e.join(""),o=t.join("");return r.localeCompare(o,void 0,{sensitivity:"base"})},bh=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},Di=(e,t,r)=>{if(r==="count")return e.length;let o=e.map(n=>bh(n[t])).filter(n=>n!==null);return o.length===0?0:r==="sum"?o.reduce((n,i)=>n+i,0):r==="avg"?o.reduce((n,i)=>n+i,0)/o.length:r==="min"?Math.min(...o):Math.max(...o)},dt=(e,t)=>{if(!e||e.length===0)return [];let r=new Set,o=[];return e.forEach(n=>{!t.has(n)||r.has(n)||(r.add(n),o.push(n));}),o},Yt=(e,t)=>e.length!==t.length?false:e.every((r,o)=>r===t[o]),Mc=(e,t)=>{let r=Object.keys(e),o=Object.keys(t);return r.length!==o.length?false:r.every(n=>{let i=e[n]??[],a=t[n]??[];return Yt(i,a)})},_r=(e,t)=>e.length!==t.length?false:e.every((r,o)=>{let n=t[o];return r.tokenId===n.tokenId&&r.fieldId===n.fieldId&&r.aggregation===n.aggregation}),Ai=e=>!e?.aggregations||e.aggregations.length===0?Ic:e.aggregations,Et=(e,t)=>{let r=Ai(t);return e&&r.includes(e)?e:t?.type==="number"&&r.includes("sum")?"sum":r.includes("count")?"count":r[0]},Fc=(e,t,r)=>{let o=r.get(t.fieldId);return o?.formatValue?o.formatValue(e):t.aggregation==="count"?Math.round(e).toLocaleString():e.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:2})};var Ec=({options:e,selectedValues:t,onChange:r,minWidth:o=96})=>{let{t:n}=q(),[i,a]=useState(""),s=useMemo(()=>{let c=i.trim().toLowerCase();return c?e.filter(l=>l.toLowerCase().includes(c)):e},[e,i]),u=e.length>0&&t.length===e.length;return jsx(FormControl,{size:"small",sx:{minWidth:o},children:jsxs(Select,{multiple:true,value:t,onChange:c=>{let l=c.target.value,p=typeof l=="string"?l.split(","):l;r(p);},onClick:c=>c.stopPropagation(),onMouseDown:c=>c.stopPropagation(),renderValue:c=>{let l=c;return e.length===0?n("pivot.filter.na"):l.length===0?n("common.none"):l.length===e.length?n("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:[jsx(ListSubheader,{disableSticky:true,sx:c=>({bgcolor:"background.paper",py:.8,lineHeight:"normal",borderBottom:`1px solid ${c.palette.divider}`}),children:jsx(TextField,{size:"small",placeholder:`${n("common.search")}...`,fullWidth:true,value:i,onChange:c=>a(c.target.value),onKeyDown:c=>c.stopPropagation(),onClick:c=>c.stopPropagation(),sx:{m:0,"& .MuiInputBase-input":{fontSize:"0.75rem",py:.7}}})}),jsx(Box,{sx:c=>({px:1.5,py:.5,borderBottom:`1px solid ${c.palette.divider}`,bgcolor:"background.paper"}),onMouseDown:c=>{c.preventDefault(),c.stopPropagation();},onClick:c=>{c.preventDefault(),c.stopPropagation();},children:jsx(Button,{variant:"text",size:"small",onClick:c=>{c.preventDefault(),c.stopPropagation(),r(u?[]:e);},sx:{minWidth:"auto",px:0,py:.2,fontSize:"0.76rem",fontWeight:700,textTransform:"none"},children:n(u?"pivot.filter.deselectAll":"pivot.filter.selectAll")})}),s.length===0&&jsx(MenuItem,{disabled:true,sx:{fontSize:"0.75rem"},children:n("pivot.filter.noResults")}),s.map(c=>{let l=t.includes(c);return jsxs(MenuItem,{value:c,sx:{fontSize:"0.75rem",py:.25},children:[jsx(Checkbox,{size:"small",checked:l,sx:{p:.5,mr:.5}}),jsx(ListItemText,{primary:c,primaryTypographyProps:{sx:{fontSize:"0.75rem",lineHeight:1.2}}})]},c)})]})})};var Fi=({label:e,subtitle:t,isDragging:r,dragRef:o,listeners:n,attributes:i,style:a})=>jsx(Paper,{ref:o,...n,...i,sx:s=>({p:1,borderRadius:2,border:"1px solid",borderColor:"divider",bgcolor:s.palette.mode==="dark"?"#111111":"background.paper",touchAction:"none"}),style:{...a,opacity:r?.3:1,cursor:r?"grabbing":"grab"},children:jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:.8},children:[jsx(Box,{sx:s=>({display:"inline-flex",alignItems:"center",justifyContent:"center",p:.3,borderRadius:1,bgcolor:s.palette.mode==="dark"?"rgba(255,255,255,0.12)":"rgba(17, 24, 39, 0.08)"}),children:jsx(Ah,{sx:{fontSize:16,color:"text.secondary"}})}),jsxs(Box,{sx:{minWidth:0},children:[jsx(Typography,{sx:{fontSize:"0.82rem",fontWeight:700,lineHeight:1.2},children:e}),t&&jsx(Typography,{sx:{fontSize:"0.72rem",color:"text.secondary",lineHeight:1.2},children:t})]})]})}),Oc=({id:e,label:t,subtitle:r})=>{let{setNodeRef:o,listeners:n,attributes:i,isDragging:a}=useDraggable({id:e});return jsx(Fi,{label:t,subtitle:r,isDragging:a,dragRef:o,listeners:n,attributes:i})};var la=({zone:e,title:t,hint:r,icon:o,children:n,itemCount:i,onClear:a})=>{let s=`container|${e}`,{isOver:u,setNodeRef:c}=useDroppable({id:s}),{t:l}=q();return jsxs(Paper,{ref:c,sx:p=>({p:1.1,borderRadius:3,border:"1px dashed",borderColor:u?"primary.main":p.palette.divider,bgcolor:u?p.palette.mode==="dark"?"rgba(25, 118, 210, 0.16)":"rgba(47, 91, 255, 0.06)":p.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:[jsxs(Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1},children:[jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:.8},children:[o,jsx(Typography,{sx:{fontSize:"0.79rem",fontWeight:800,letterSpacing:.2},children:t}),jsxs(Typography,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:["(",i,")"]})]}),i>0&&a&&jsx(Tooltip,{title:l("pivot.clearArea"),children:jsx(IconButton,{size:"small",onClick:a,sx:{p:.25},children:jsx(Eh,{sx:{fontSize:16}})})})]}),jsx(Typography,{sx:{mt:.5,mb:.9,fontSize:"0.7rem",color:"text.secondary"},children:r}),jsx(Box,{sx:{flex:1},children:n})]})};var Zr=({label:e,caption:t,onRemove:r,trailing:o,isDragging:n,dragRef:i,listeners:a,attributes:s,style:u})=>jsx(Paper,{ref:i,style:u,sx:c=>({p:1,borderRadius:2,border:"1px solid",borderColor:"divider",bgcolor:c.palette.mode==="dark"?"#111111":"background.paper",touchAction:"none",opacity:n?0:1}),children:jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:.8},children:[jsx(Box,{...s,...a,sx:c=>({display:"inline-flex",alignItems:"center",justifyContent:"center",p:.25,borderRadius:1,bgcolor:c.palette.mode==="dark"?"rgba(255,255,255,0.12)":"rgba(17, 24, 39, 0.08)",cursor:"grab"}),children:jsx(Ah,{sx:{fontSize:15,color:"text.secondary"}})}),jsxs(Box,{sx:{minWidth:0,flex:1},children:[jsx(Typography,{sx:{fontSize:"0.8rem",fontWeight:700,lineHeight:1.2},children:e}),t&&jsx(Typography,{sx:{fontSize:"0.7rem",color:"text.secondary",lineHeight:1.2},children:t})]}),o,r&&jsx(IconButton,{size:"small",onClick:c=>{c.stopPropagation(),r();},sx:{p:.2},children:jsx(em,{sx:{fontSize:16}})})]})}),_a=({id:e,label:t,caption:r,onRemove:o,trailing:n})=>{let{setNodeRef:i,attributes:a,listeners:s,transform:u,transition:c,isDragging:l}=useSortable({id:e}),p={transform:u?`translate3d(${u.x}px, ${u.y}px, 0)`:void 0,transition:c,zIndex:l?999:"auto"};return jsx(Zr,{label:t,caption:r,onRemove:o,trailing:n,isDragging:l,dragRef:i,listeners:s,attributes:a,style:p})};var Yr={rows:jsx(Zh,{fontSize:"small"}),columns:jsx(Vu,{fontSize:"small"}),filters:jsx(Kh,{fontSize:"small"}),values:jsx(Wu,{fontSize:"small"})},Gc=({isConfiguratorCollapsed:e,onToggleCollapse:t,availableFields:r,fieldMap:o,filterFields:n,columnFields:i,rowFields:a,valueFields:s,clearZone:u,removeFieldFromZone:c,getFilterSelectionSummary:l,renderDimensionFilterSelect:p,renderAggregationSelect:m,getAggregationLabel:d})=>{let{t:g}=q();return jsxs(Fragment,{children:[jsx(Collapse,{in:!e,timeout:260,easing:"cubic-bezier(0.2, 0, 0, 1)",unmountOnExit:true,children:jsxs(Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",lg:"260px 1fr"},gap:2},children:[jsx(la,{zone:"palette",title:g("pivot.fieldList"),hint:g("pivot.availableDimensions"),itemCount:r.length,icon:jsx(Ah,{sx:{fontSize:16,color:"text.secondary"}}),children:jsxs(Stack,{spacing:.8,sx:{maxHeight:400,overflowY:"auto",pr:.5},children:[r.length===0&&jsx(Typography,{sx:{fontSize:"0.74rem",color:"text.secondary",py:1},children:g("pivot.allFieldsInUse")}),r.map(h=>jsx(Oc,{id:`item|palette|${h.id}`,label:h.label,subtitle:h.type??"string"},h.id))]})}),jsxs(Stack,{spacing:2,children:[jsxs(Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[jsx(la,{zone:"filters",title:g("pivot.zone.filters"),hint:g("pivot.hint.filters"),icon:Yr.filters,itemCount:n.length,onClear:()=>u("filters"),children:jsx(SortableContext,{items:n.map(h=>`item|filters|${h}`),strategy:verticalListSortingStrategy,children:jsx(Stack,{spacing:.7,children:n.map(h=>jsx(_a,{id:`item|filters|${h}`,label:o.get(h)?.label??h,caption:l(h),trailing:p(h),onRemove:()=>c("filters",h)},h))})})}),jsx(la,{zone:"columns",title:g("pivot.zone.columns"),hint:g("pivot.hint.columns"),icon:Yr.columns,itemCount:i.length,onClear:()=>u("columns"),children:jsx(SortableContext,{items:i.map(h=>`item|columns|${h}`),strategy:verticalListSortingStrategy,children:jsx(Stack,{spacing:.7,children:i.map(h=>jsx(_a,{id:`item|columns|${h}`,label:o.get(h)?.label??h,caption:`${o.get(h)?.type??"dimension"} \u2022 ${l(h)}`,trailing:p(h),onRemove:()=>c("columns",h)},h))})})})]}),jsxs(Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[jsx(la,{zone:"rows",title:g("pivot.zone.rows"),hint:g("pivot.hint.rows"),icon:Yr.rows,itemCount:a.length,onClear:()=>u("rows"),children:jsx(SortableContext,{items:a.map(h=>`item|rows|${h}`),strategy:verticalListSortingStrategy,children:jsx(Stack,{spacing:.7,children:a.map(h=>jsx(_a,{id:`item|rows|${h}`,label:o.get(h)?.label??h,caption:`${o.get(h)?.type??"dimension"} \u2022 ${l(h)}`,trailing:p(h),onRemove:()=>c("rows",h)},h))})})}),jsx(la,{zone:"values",title:g("pivot.zone.values"),hint:g("pivot.hint.values"),icon:Yr.values,itemCount:s.length,onClear:()=>u("values"),children:jsx(SortableContext,{items:s.map(h=>`item|values|${h.tokenId}`),strategy:verticalListSortingStrategy,children:jsx(Stack,{spacing:.7,children:s.map(h=>{let k=o.get(h.fieldId)?.label??h.fieldId,C=`${d(h.aggregation)}(${k})`;return jsx(_a,{id:`item|values|${h.tokenId}`,label:k,caption:C,trailing:m(h),onRemove:()=>c("values",h.tokenId)},h.tokenId)})})})})]})]})]})}),jsxs(Box,{sx:{position:"relative",my:.8},children:[jsx(Divider,{}),jsx(IconButton,{size:"small","aria-label":g(e?"pivot.collapse.ariaExpand":"pivot.collapse.ariaCollapse"),onClick:t,sx:h=>({position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",border:`1px solid ${h.palette.divider}`,bgcolor:"background.paper",width:26,height:26,borderRadius:999,"&:hover":{bgcolor:h.palette.mode==="dark"?"rgba(25,118,210,0.2)":"rgba(47, 91, 255, 0.08)"}}),children:jsx(sg,{sx:{fontSize:16,transition:"transform 220ms cubic-bezier(0.2, 0, 0, 1)",transform:e?"rotate(180deg)":"rotate(0deg)"}})})]})]})};var Jr=({node:e,dataColumns:t,fieldMap:r,level:o,expandedKeys:n,onToggle:i})=>{let a=n.has(e.key),s=e.children.length>0,u=e.isGrandTotal;return jsxs(Fragment,{children:[jsxs(TableRow,{sx:c=>({bgcolor:u?c.palette.mode==="dark"?"rgba(25, 118, 210, 0.22)":"rgba(47, 91, 255, 0.08)":c.palette.mode==="dark"?"#111111":"background.paper","&:hover":{bgcolor:u?c.palette.mode==="dark"?"rgba(25, 118, 210, 0.28)":"rgba(47, 91, 255, 0.12)":c.palette.mode==="dark"?"#181818":"rgba(0, 0, 0, 0.02)"}}),children:[jsxs(TableCell,{sx:c=>({fontSize:"0.76rem",fontWeight:u?800:600,borderBottom:`1px solid ${c.palette.divider}`,whiteSpace:"nowrap",pl:o*2+1,display:"flex",alignItems:"center",height:40}),children:[s&&!u&&jsx(IconButton,{size:"small",onClick:()=>i(e.key),sx:{p:.2,mr:.5,ml:-1},children:a?jsx(pp,{sx:{fontSize:16}}):jsx(ju,{sx:{fontSize:16}})}),!s&&!u&&o>0&&jsx(Box,{sx:{width:20}}),e.value]}),t.map(c=>jsx(TableCell,{align:"right",sx:{fontSize:"0.76rem",fontWeight:u?800:500,borderBottom:l=>`1px solid ${l.palette.divider}`,whiteSpace:"nowrap"},children:Fc(e.aggregatedValues[c.id]??0,c.valueItem,r)},`${e.key}-${c.id}`))]}),a&&e.children.map(c=>jsx(Jr,{node:c,dataColumns:t,fieldMap:r,level:o+1,expandedKeys:n,onToggle:i},c.key))]})};var SI=({title:e,rows:t,fields:r,initialLayout:o,emptyText:n,maxPreviewHeight:i=520,model:a,enablePresetManagement:s=false,presets:u,defaultPresets:c,onPresetsChange:l,initialPresetId:p,onPresetApplied:m})=>{let{t:d}=q(),g=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:8}})),h=useRef(0),k=useRef(false),C=e??d("pivot.title.default"),f=n??d("pivot.empty"),v=useMemo(()=>({sum:d("pivot.agg.sum"),count:d("pivot.agg.count"),avg:d("pivot.agg.avg"),min:d("pivot.agg.min"),max:d("pivot.agg.max")}),[d]),y=useCallback(x=>v[x]??Tc[x],[v]),S=useMemo(()=>new Set(r.map(x=>x.id)),[r]),R=useMemo(()=>new Map(r.map(x=>[x.id,x])),[r]),[A,T]=useState(()=>dt(o?.rows,S)),[F,w]=useState(()=>dt(o?.columns,S)),[I,P]=useState(()=>dt(o?.filters,S)),[b,L]=useState(()=>{let x=o?.values??[],M=new Set,E=[];return x.forEach($=>{if(!S.has($.fieldId)||M.has($.fieldId))return;M.add($.fieldId),h.current+=1;let J=R.get($.fieldId);E.push({tokenId:`v${h.current}`,fieldId:$.fieldId,aggregation:Et($.aggregation,J)});}),E}),[D,U]=useState({}),[j,te]=useState(true),[N,V]=useState(false),[W,H]=useState(()=>c??[]),[Oe,Te]=useState(""),[Ee,ee]=useState(false),[ye,Ae]=useState(""),[We,kt]=useState(null),[Ve,at]=useState(new Set(["__grand_total__"])),Ie=a?.rowFields??A,Se=a?.columnFields??F,Xe=a?.filterFields??I,Ye=a?.valueFields??b,rt=a?.filterSelections??D,Gt=a?.showGrandTotal??j,ma=a?.isConfiguratorCollapsed??N,Ue=u??W,ga=s||Ue.length>0||!!l,mt=useCallback(x=>{if(a?.setRowFields){a.setRowFields(x);return}T(x);},[a]),nt=useCallback(x=>{if(a?.setColumnFields){a.setColumnFields(x);return}w(x);},[a]),tt=useCallback(x=>{if(a?.setFilterFields){a.setFilterFields(x);return}P(x);},[a]),it=useCallback(x=>{if(a?.setValueFields){a.setValueFields(x);return}L(x);},[a]),eo=useCallback(x=>{if(a?.setFilterSelections){a.setFilterSelections(x);return}U(x);},[a]),vo=useCallback(x=>{if(a?.setShowGrandTotal){a.setShowGrandTotal(x);return}te(x);},[a]),fa=useCallback(x=>{if(a?.setIsConfiguratorCollapsed){a.setIsConfiguratorCollapsed(x);return}V(x);},[a]),Ht=useCallback(x=>{let M=typeof x=="function"?x(Ue):x;u||H(M),l?.(M);},[l,Ue,u]),to=useMemo(()=>new Set([...Ie,...Se,...Xe]),[Ie,Se,Xe]),ha=useMemo(()=>r.filter(x=>!to.has(x.id)),[r,to]),St=useMemo(()=>{let x=[...Ie,...Se,...Xe],M=new Set,E=[];return x.forEach($=>{M.has($)||(M.add($),E.push($));}),E},[Se,Xe,Ie]);useEffect(()=>{mt(x=>{let M=x.filter(E=>S.has(E));return Yt(x,M)?x:M}),nt(x=>{let M=x.filter(E=>S.has(E));return Yt(x,M)?x:M}),tt(x=>{let M=x.filter(E=>S.has(E));return Yt(x,M)?x:M}),it(x=>{let M=x.filter(E=>S.has(E.fieldId)).map(E=>({...E,aggregation:Et(E.aggregation,R.get(E.fieldId))}));return _r(x,M)?x:M});},[R,S]);let wt=useMemo(()=>{let x={};return St.forEach(M=>{let E=new Set;t.forEach($=>{E.add(Bo($[M]));}),x[M]=Array.from(E).sort(($,J)=>$.localeCompare(J));}),x},[St,t]);useEffect(()=>{eo(x=>{let M={};return St.forEach(E=>{let $=wt[E]??[],oe=(x[E]??[]).filter(Z=>$.includes(Z)),se=Object.prototype.hasOwnProperty.call(x,E);M[E]=se?oe:$;}),Mc(x,M)?x:M});},[St,wt]);let Dt=useMemo(()=>t.filter(x=>St.every(M=>{let E=rt[M]??[],$=wt[M]??[];if(E.length===$.length)return true;if(E.length===0)return false;let J=Bo(x[M]);return E.includes(J)})),[St,wt,rt,t]),Tt=useMemo(()=>{if(Ye.length===0)return null;let x=new Map;if(Dt.forEach(oe=>{let se=Se.length>0?Se.map(le=>Bo(oe[le])):[d("pivot.valueLabel")],Z=na(se);x.set(Z,se);}),x.size===0){let oe=Se.length>0?Se.map(()=>Ur):[d("pivot.valueLabel")];x.set(na(oe),oe);}let E=Array.from(x.entries()).sort((oe,se)=>Ac(oe[1],se[1])).flatMap(([oe,se])=>Ye.map(Z=>{let le=R.get(Z.fieldId),st=`${y(Z.aggregation)} ${le?.label??Z.fieldId}`,lt=Se.length===0||Ye.length>1?`${se.join(" / ")} \u2022 ${st}`:se.join(" / ");return {id:`${oe}::${Z.tokenId}`,colKey:oe,valueItem:Z,label:lt}})),$=oe=>{let se={};return E.forEach(Z=>{let le=oe.filter(st=>{let lt=Se.length>0?Se.map(ct=>Bo(st[ct])):[d("pivot.valueLabel")];return na(lt)===Z.colKey});se[Z.id]=Di(le,Z.valueItem.fieldId,Z.valueItem.aggregation);}),se},J=[];if(Ie.length===0)J.push({key:"root",value:d("pivot.resultLabel")||Sc,children:[],isLeaf:true,aggregatedValues:$(Dt),path:[],depth:0});else {let oe=(se,Z,le)=>{if(Z>=Ie.length)return [];let st=Ie[Z],lt=new Map;return se.forEach(ct=>{let _=Bo(ct[st]);lt.has(_)||lt.set(_,[]),lt.get(_).push(ct);}),Array.from(lt.keys()).sort().map(ct=>{let _=lt.get(ct),X=[...le,ct];return {key:na(X),value:ct,fieldId:st,aggregatedValues:$(_),children:oe(_,Z+1,X),isLeaf:Z===Ie.length-1,path:X,depth:Z}})};J.push(...oe(Dt,0,[]));}return {dataColumns:E,rowTree:J}},[Se,R,Dt,y,Ie,d,Ye]),oo=useCallback((x,M)=>(h.current+=1,{tokenId:`v${h.current}`,fieldId:x,aggregation:Et(M,R.get(x))}),[R]),B=useCallback(x=>{if(x==="rows")return mt([]);if(x==="columns")return nt([]);if(x==="filters")return tt([]);it([]);},[]),z=useCallback((x,M)=>{if(x==="rows")return mt(E=>E.filter($=>$!==M));if(x==="columns")return nt(E=>E.filter($=>$!==M));if(x==="filters")return tt(E=>E.filter($=>$!==M));it(E=>E.filter($=>$.tokenId!==M));},[]),O=useCallback((x,M)=>{it(E=>E.map($=>$.tokenId===x?{...$,aggregation:Et(M,R.get($.fieldId))}:$));},[R]),ne=useCallback(x=>{kt(String(x.active.id));},[]),ie=useCallback(x=>{if(kt(null),!x.over)return;let M=qr(String(x.active.id)),E=qr(String(x.over.id));if(!M||!E||M.kind!=="item"||!M.key)return;if(M.zone===E.zone&&E.kind==="item"){if(M.zone==="rows"){let _=Ie.indexOf(M.key),X=Ie.indexOf(E.key??"");_!==-1&&X!==-1&&_!==X&&mt(Je=>arrayMove(Je,_,X));return}if(M.zone==="columns"){let _=Se.indexOf(M.key),X=Se.indexOf(E.key??"");_!==-1&&X!==-1&&_!==X&&nt(Je=>arrayMove(Je,_,X));return}if(M.zone==="filters"){let _=Xe.indexOf(M.key),X=Xe.indexOf(E.key??"");_!==-1&&X!==-1&&_!==X&&tt(Je=>arrayMove(Je,_,X));return}if(M.zone==="values"){let _=Ye.findIndex(Je=>Je.tokenId===M.key),X=Ye.findIndex(Je=>Je.tokenId===(E.key??""));_!==-1&&X!==-1&&_!==X&&it(Je=>arrayMove(Je,_,X));}return}let $=E.zone,J=[...Ie],oe=[...Se],se=[...Xe],Z=[...Ye],le="",st=null;if(M.zone==="palette")le=M.key;else if(M.zone==="values"){let _=Z.find(X=>X.tokenId===M.key);if(!_)return;le=_.fieldId,st=_,Z=Z.filter(X=>X.tokenId!==M.key);}else M.zone==="rows"?(le=M.key,J=J.filter(_=>_!==le)):M.zone==="columns"?(le=M.key,oe=oe.filter(_=>_!==le)):M.zone==="filters"&&(le=M.key,se=se.filter(_=>_!==le));if(!le)return;let lt=()=>{J=J.filter(_=>_!==le),oe=oe.filter(_=>_!==le),se=se.filter(_=>_!==le);},ct=_=>{if(E.kind!=="item"||!E.key)return _==="rows"?J.length:_==="columns"?oe.length:_==="filters"?se.length:_==="values"?Z.length:0;if(_==="rows"){let X=J.indexOf(E.key);return X>=0?X:J.length}if(_==="columns"){let X=oe.indexOf(E.key);return X>=0?X:oe.length}if(_==="filters"){let X=se.indexOf(E.key);return X>=0?X:se.length}if(_==="values"){let X=Z.findIndex(Je=>Je.tokenId===E.key);return X>=0?X:Z.length}return 0};if($==="palette"){mt(J),nt(oe),tt(se),it(Z);return}if($==="values"){let _=ct("values"),X=st??oo(le);Z.splice(_,0,X),mt(J),nt(oe),tt(se),it(Z);return}if(Dc($)){lt();let _=ct($);$==="rows"?J.splice(_,0,le):$==="columns"?oe.splice(_,0,le):se.splice(_,0,le),mt(J),nt(oe),tt(se),it(Z);}},[Se,oo,Xe,Ie,Ye]),de=useCallback((x,M)=>{eo(E=>({...E,[x]:M}));},[]),pe=useCallback(x=>{at(M=>{let E=new Set(M);return E.has(x)?E.delete(x):E.add(x),E});},[]),be=useCallback(x=>{let M=R.get(x.fieldId),E=Ai(M);return jsx(FormControl,{size:"small",sx:{minWidth:98},children:jsx(Select,{value:x.aggregation,onChange:$=>O(x.tokenId,$.target.value),onClick:$=>$.stopPropagation(),onMouseDown:$=>$.stopPropagation(),sx:{fontSize:"0.72rem",height:26,"& .MuiSelect-select":{py:.35}},children:E.map($=>jsx(MenuItem,{value:$,sx:{fontSize:"0.75rem"},children:y($)},$))})})},[R,y,O]),xe=useCallback(x=>{let M=wt[x]??[],E=rt[x]??M;return M.length===0?d("pivot.filter.noValues"):E.length===0?d("pivot.filter.noneSelected"):E.length===M.length?d("pivot.filter.allValues"):d("pivot.filter.selectedCount",{selected:E.length,total:M.length})},[wt,rt,d]),qe=useCallback(x=>{let M=wt[x]??[],E=rt[x]??M;return jsx(Ec,{options:M,selectedValues:E,onChange:$=>de(x,$)})},[wt,rt,de]),Me=useCallback(()=>`pivot-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,[]),_e=useCallback(()=>{let x={};return new Set([...St,...Object.keys(rt)]).forEach(E=>{if(!S.has(E))return;let $=rt[E]??[];x[E]=[...$];}),{layout:{rows:[...Ie],columns:[...Se],filters:[...Xe],values:Ye.map(E=>({fieldId:E.fieldId,aggregation:E.aggregation}))},filterSelections:x,showGrandTotal:Gt}},[St,Se,Xe,rt,Ie,Gt,S,Ye]),ue=useCallback(x=>{let M=dt(x.layout.rows,S),E=dt(x.layout.columns,S),$=dt(x.layout.filters,S),J=new Set,oe=(x.layout.values??[]).filter(Z=>!S.has(Z.fieldId)||J.has(Z.fieldId)?false:(J.add(Z.fieldId),true)).map(Z=>oo(Z.fieldId,Z.aggregation)),se={};Object.entries(x.filterSelections??{}).forEach(([Z,le])=>{!S.has(Z)||!Array.isArray(le)||(se[Z]=Array.from(new Set(le.map(st=>String(st)))));}),mt(M),nt(E),tt($),it(oe),eo(se),typeof x.showGrandTotal=="boolean"&&vo(x.showGrandTotal),Te(x.id),m?.(x);},[oo,m,nt,tt,eo,mt,vo,it,S]),Wt=useCallback(x=>{if(!x){Te("");return}let M=Ue.find(E=>E.id===x);if(!M){Te("");return}ue(M);},[ue,Ue]),ao=useCallback(()=>{let x=d("pivot.preset.defaultName",{index:Ue.length+1});Ae(x),ee(true);},[Ue.length,d]),ya=useCallback(()=>{let x=ye.trim();if(!x)return;let M={id:Me(),name:x,..._e()};Ht(E=>[...E,M]),Te(M.id),ee(false);},[_e,Me,ye,Ht]),$o=useCallback(()=>{Oe&&(Ht(x=>x.filter(M=>M.id!==Oe)),Te(""));},[Oe,Ht]);useEffect(()=>{if(!p||k.current)return;let x=Ue.find(M=>M.id===p);x&&(k.current=true,ue(x));},[ue,p,Ue]),useEffect(()=>{Oe&&(Ue.some(x=>x.id===Oe)||Te(""));},[Oe,Ue]);let Go=useMemo(()=>{if(!Gt||!Tt||!Ie.length)return null;let x={};return Tt.dataColumns.forEach(M=>{let E=Dt.filter($=>{let J=Se.length>0?Se.map(oe=>Bo($[oe])):[d("pivot.valueLabel")];return na(J)===M.colKey});x[M.id]=Di(E,M.valueItem.fieldId,M.valueItem.aggregation);}),{key:"__grand_total__",value:d("pivot.grandTotal")||wc,children:[],isLeaf:false,isGrandTotal:true,aggregatedValues:x,path:[],depth:-1}},[Gt,Tt,Dt,Se,Ie.length,d]),xn=()=>{if(!We)return null;let x=qr(We);if(!x||x.kind!=="item"||!x.key)return null;if(x.zone==="palette"){let J=R.get(x.key);return J?jsx(Fi,{label:J.label,subtitle:J.type}):null}if(x.zone==="values"){let J=Ye.find(le=>le.tokenId===x.key);if(!J)return null;let se=R.get(J.fieldId)?.label??J.fieldId,Z=`${y(J.aggregation)}(${se})`;return jsx(Zr,{label:se,caption:Z})}let E=R.get(x.key)?.label??x.key,$=xe(x.key);return jsx(Zr,{label:E,caption:$})};return jsxs(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:[jsxs(Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1.5,flexWrap:"wrap"},children:[jsxs(Box,{children:[jsx(Typography,{sx:{fontSize:"1.05rem",fontWeight:800},children:C}),jsx(Typography,{sx:{fontSize:"0.78rem",color:"text.secondary"},children:d("pivot.subtitle.default")})]}),jsxs(Stack,{direction:"row",spacing:1.5,alignItems:"center",children:[ga&&jsxs(Fragment,{children:[jsx(FormControl,{size:"small",sx:{minWidth:200},children:jsxs(Select,{value:Oe,displayEmpty:true,onChange:x=>Wt(String(x.target.value)),sx:{fontSize:"0.75rem",height:32},children:[jsx(MenuItem,{value:"",sx:{fontSize:"0.75rem",color:"text.secondary"},children:d("pivot.preset.selectPlaceholder")}),Ue.map(x=>jsx(MenuItem,{value:x.id,sx:{fontSize:"0.75rem"},children:x.name},x.id))]})}),jsx(Tooltip,{title:d("pivot.preset.save"),children:jsx(IconButton,{size:"small",onClick:ao,"aria-label":d("pivot.preset.save"),children:jsx(El,{sx:{fontSize:18}})})}),jsx(Tooltip,{title:d("pivot.preset.delete"),children:jsx("span",{children:jsx(IconButton,{size:"small",onClick:$o,disabled:!Oe,"aria-label":d("pivot.preset.delete"),children:jsx(xy,{sx:{fontSize:18}})})})}),jsx(Divider,{flexItem:true,orientation:"vertical"})]}),jsxs(Typography,{sx:{fontSize:"0.74rem",color:"text.secondary"},children:[d("pivot.records"),": ",jsx("strong",{children:t.length.toLocaleString()})," / ",d("pivot.afterFilter"),":"," ",jsx("strong",{children:Dt.length.toLocaleString()})]}),jsx(Divider,{flexItem:true,orientation:"vertical"}),jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:.6},children:[jsx(Typography,{sx:{fontSize:"0.74rem"},children:d("pivot.grandTotal")}),jsx(Switch,{size:"small",checked:Gt,onChange:x=>vo(x.target.checked)})]})]})]}),jsx(Divider,{}),jsxs(DndContext,{sensors:g,collisionDetection:closestCenter,onDragStart:ne,onDragEnd:ie,children:[jsx(Gc,{isConfiguratorCollapsed:ma,onToggleCollapse:()=>fa(x=>!x),availableFields:ha,fieldMap:R,filterFields:Xe,columnFields:Se,rowFields:Ie,valueFields:Ye,clearZone:B,removeFieldFromZone:z,getFilterSelectionSummary:xe,renderDimensionFilterSelect:qe,renderAggregationSelect:be,getAggregationLabel:y}),jsx(Portal,{children:jsx(DragOverlay,{dropAnimation:{duration:250,easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)"},children:xn()})})]}),jsx(Paper,{sx:x=>({borderRadius:3,border:`1px solid ${x.palette.divider}`,overflow:"hidden",bgcolor:"background.paper",flex:1,minHeight:0}),children:Tt===null?jsx(Box,{sx:{py:5,textAlign:"center"},children:jsx(Typography,{sx:{fontSize:"0.86rem",color:"text.secondary"},children:f})}):jsx(TableContainer,{sx:{maxHeight:i},children:jsxs(Table,{size:"small",stickyHeader:true,children:[jsx(TableHead,{children:jsxs(TableRow,{children:[jsx(TableCell,{sx:x=>({fontWeight:800,fontSize:"0.76rem",color:"text.primary",bgcolor:x.palette.mode==="dark"?"#000000":"#f5f5f5",borderBottom:`1px solid ${x.palette.divider}`,pl:2}),children:Ie.length>0?Ie.map(x=>R.get(x)?.label).join(" > "):d("pivot.table.dimensions")}),Tt.dataColumns.map(x=>jsx(TableCell,{align:"right",sx:M=>({fontWeight:800,fontSize:"0.75rem",color:"text.primary",bgcolor:M.palette.mode==="dark"?"#000000":"#f5f5f5",borderBottom:`1px solid ${M.palette.divider}`,minWidth:148}),children:x.label},x.id))]})}),jsxs(TableBody,{children:[Tt.rowTree.map(x=>jsx(Jr,{node:x,dataColumns:Tt.dataColumns,fieldMap:R,level:0,expandedKeys:Ve,onToggle:pe},x.key)),Go&&jsx(Jr,{node:Go,dataColumns:Tt.dataColumns,fieldMap:R,level:0,expandedKeys:Ve,onToggle:pe})]})]})})}),jsxs(Dialog,{open:Ee,onClose:()=>ee(false),maxWidth:"xs",fullWidth:true,children:[jsx(DialogTitle,{children:d("pivot.preset.saveDialogTitle")}),jsx(DialogContent,{children:jsx(TextField,{autoFocus:true,fullWidth:true,margin:"dense",label:d("pivot.preset.nameLabel"),value:ye,onChange:x=>Ae(x.target.value),onKeyDown:x=>{x.key==="Enter"&&(x.preventDefault(),ya());}})}),jsxs(DialogActions,{children:[jsx(Button,{onClick:()=>ee(false),children:d("common.cancel")}),jsx(Button,{variant:"contained",onClick:ya,disabled:!ye.trim(),children:d("common.save")})]})]})]})};var RI=({fields:e,initialLayout:t,initialFilterSelections:r={},initialShowGrandTotal:o=true,initialConfiguratorCollapsed:n=false})=>{let i=useRef(0),a=useMemo(()=>new Set(e.map(N=>N.id)),[e]),s=useMemo(()=>new Map(e.map(N=>[N.id,N])),[e]),[u,c]=useState(()=>dt(t?.rows,a)),[l,p]=useState(()=>dt(t?.columns,a)),[m,d]=useState(()=>dt(t?.filters,a)),[g,h]=useState(()=>{let N=t?.values??[],V=new Set,W=[];return N.forEach(H=>{!a.has(H.fieldId)||V.has(H.fieldId)||(V.add(H.fieldId),i.current+=1,W.push({tokenId:`v${i.current}`,fieldId:H.fieldId,aggregation:Et(H.aggregation,s.get(H.fieldId))}));}),W}),[k,C]=useState(r),[f,v]=useState(o),[y,S]=useState(n);useEffect(()=>{c(N=>{let V=N.filter(W=>a.has(W));return Yt(N,V)?N:V}),p(N=>{let V=N.filter(W=>a.has(W));return Yt(N,V)?N:V}),d(N=>{let V=N.filter(W=>a.has(W));return Yt(N,V)?N:V}),h(N=>{let V=N.filter(W=>a.has(W.fieldId)).map(W=>({...W,aggregation:Et(W.aggregation,s.get(W.fieldId))}));return _r(N,V)?N:V});},[s,a]);let R=useCallback(N=>{c(dt(N,a));},[a]),A=useCallback(N=>{p(dt(N,a));},[a]),T=useCallback(N=>{d(dt(N,a));},[a]),F=useCallback(N=>{h(V=>{let W=N??[],H=new Set,Oe=[];return W.forEach(Te=>{if(!a.has(Te.fieldId)||H.has(Te.fieldId))return;H.add(Te.fieldId);let Ee=V.find(ee=>ee.fieldId===Te.fieldId);if(Ee){Oe.push({...Ee,aggregation:Et(Te.aggregation??Ee.aggregation,s.get(Te.fieldId))});return}i.current+=1,Oe.push({tokenId:`v${i.current}`,fieldId:Te.fieldId,aggregation:Et(Te.aggregation,s.get(Te.fieldId))});}),Oe});},[s,a]),w=useCallback(N=>{R(N.rows??[]),A(N.columns??[]),T(N.filters??[]),F(N.values??[]);},[A,T,R,F]),I=useCallback(N=>{if(N==="rows")return c([]);if(N==="columns")return p([]);if(N==="filters")return d([]);h([]);},[]),P=useCallback((N,V)=>{if(N==="rows")return c(W=>W.filter(H=>H!==V));if(N==="columns")return p(W=>W.filter(H=>H!==V));if(N==="filters")return d(W=>W.filter(H=>H!==V));h(W=>W.filter(H=>H.tokenId!==V));},[]),b=useCallback((N,V)=>{h(W=>W.map(H=>H.tokenId===N?{...H,aggregation:Et(V,s.get(H.fieldId))}:H));},[s]),L=useCallback((N,V)=>{C(W=>({...W,[N]:V}));},[]),D=useCallback(()=>{C({});},[]),U=useCallback(()=>{v(N=>!N);},[]),j=useCallback(()=>{S(N=>!N);},[]);return {model:useMemo(()=>({rowFields:u,setRowFields:c,columnFields:l,setColumnFields:p,filterFields:m,setFilterFields:d,valueFields:g,setValueFields:h,filterSelections:k,setFilterSelections:C,showGrandTotal:f,setShowGrandTotal:v,isConfiguratorCollapsed:y,setIsConfiguratorCollapsed:S}),[l,m,k,y,u,f,g]),actions:{setRows:R,setColumns:A,setFilters:T,setValues:F,setLayout:w,clearZone:I,removeFieldFromZone:P,setAggregationForValue:b,setFilterSelection:L,resetFilterSelections:D,toggleGrandTotal:U,toggleConfigurator:j}}};var Xc=Dy(()=>import('./COrbCanvas-EGX5NO3Y.mjs').then(e=>e.COrbCanvas),{ssr:false,loading:()=>jsx("div",{className:"h-full w-full bg-transparent"})});function $i({isRecording:e}){return jsx(AnimatePresence,{children:e&&jsx(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:jsxs("div",{className:"relative flex h-full w-full items-center justify-center",children:[jsx("div",{className:"absolute inset-0",children:jsx(Xc,{hue:0,hoverIntensity:.5,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})}),jsx("div",{className:"relative z-10 h-full w-1/3 mix-blend-overlay opacity-80",children:jsx(Xc,{hue:10,hoverIntensity:.8,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})})]})})})}var FI=$i;function an({onTextUpdate:e,onComplete:t,onError:r,wsUrl:o="ws://localhost:8765",silenceThresholdMs:n=2e3,minVolumeRms:i=.015}){let[a,s]=useState(false),u=useRef(null),c=useRef(null),l=useRef(null),p=useRef(null),m=useRef(null),d=useRef(0),g=useRef(false),h=useRef(false),k=useCallback(()=>{u.current&&(u.current.close(),u.current=null),p.current&&(p.current.disconnect(),p.current=null),m.current&&(m.current.disconnect(),m.current=null),c.current&&(c.current.getTracks().forEach(v=>v.stop()),c.current=null),l.current&&(l.current.close(),l.current=null),h.current=false,s(false);},[]),C=useCallback(()=>{g.current||(g.current=true,u.current?.readyState===WebSocket.OPEN&&u.current.send(JSON.stringify({type:"stop"})),setTimeout(k,500));},[k]),f=useCallback(async()=>{if(!(a||h.current)){h.current=true,g.current=false,d.current=Date.now();try{let v=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,sampleRate:16e3,echoCancellation:!0,noiseSuppression:!0}});c.current=v;let y=new WebSocket(o);u.current=y,y.onopen=()=>{s(!0),h.current=!1;},y.onmessage=F=>{try{let w=JSON.parse(F.data);if(w.type==="recognition")w.is_final?t(w.text):e?.(w.text);else if(w.type==="error"){let I=w.message||"Voice recognition error";r?.(I),C();}}catch{r?.("Failed to parse voice message");}},y.onerror=()=>{r?.("Voice service connection failed"),k();},y.onclose=()=>{k();};let S=window.AudioContext||window.webkitAudioContext;if(!S)throw new Error("AudioContext is not supported in this browser");let R=new S({sampleRate:16e3});l.current=R;let A=R.createMediaStreamSource(v);m.current=A;let T=R.createScriptProcessor(4096,1,1);p.current=T,T.onaudioprocess=F=>{if(u.current?.readyState!==WebSocket.OPEN)return;let w=F.inputBuffer.getChannelData(0),I=0;for(let L=0;L<w.length;L+=1)I+=w[L]*w[L];if(Math.sqrt(I/w.length)>i)d.current=Date.now();else if(Date.now()-d.current>n&&!g.current){C();return}let b=new Int16Array(w.length);for(let L=0;L<w.length;L+=1){let D=Math.max(-1,Math.min(1,w[L]));b[L]=D<0?D*32768:D*32767;}u.current.send(b.buffer);},A.connect(T),T.connect(R.destination);}catch{r?.("Cannot access microphone"),k();}}},[k,a,i,t,r,e,n,C,o]);return useEffect(()=>k,[k]),{isRecording:a,startRecording:f,stopRecording:C}}var Jc=createContext(null);function Vy(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 $y({children:e,onVoiceSubmit:t,onVoicePartial:r,onVoiceError:o,longPressMs:n=200,disableSpaceTrigger:i=false,ignoreWhenFocusedInput:a=true,renderOverlay:s=true,wsUrl:u,silenceThresholdMs:c,minVolumeRms:l}){let[p,m]=useState(false),[d,g]=useState(false),h=useRef(null),k=useRef(false),C=useRef(false),f=useCallback(()=>{C.current=false,m(false);},[]),{isRecording:v,startRecording:y,stopRecording:S}=an({wsUrl:u,silenceThresholdMs:c,minVolumeRms:l,onTextUpdate:F=>{r?.(F);},onComplete:async F=>{try{F.trim()&&(g(!0),await t(F.trim()));}catch(w){let I=w instanceof Error?w.message:"Failed to process voice command";o?.(I);}finally{g(!1),f();}},onError:F=>{o?.(F),g(!1),k.current||f();}}),R=useCallback(async()=>{C.current=false,await y();},[y]),A=useCallback(()=>{S();},[S]);useEffect(()=>{if(i)return;let F=I=>{I.isComposing||(I.code==="Space"||I.key===" ")&&(k.current||I.repeat||a&&Vy(document.activeElement)||(k.current=true,I.preventDefault(),h.current=setTimeout(()=>{C.current=true,m(true),y();},n)));},w=I=>{(I.code==="Space"||I.key===" ")&&(h.current&&(clearTimeout(h.current),h.current=null),k.current=false,C.current&&(I.preventDefault(),m(false),S()));};return window.addEventListener("keydown",F),window.addEventListener("keyup",w),()=>{window.removeEventListener("keydown",F),window.removeEventListener("keyup",w),h.current&&(clearTimeout(h.current),h.current=null);}},[i,a,n,y,S]);let T=useMemo(()=>({isRecording:v,isHotkeyRecording:p,isSubmitting:d,startRecording:R,stopRecording:A}),[p,v,d,R,A]);return jsxs(Jc.Provider,{value:T,children:[s?jsx($i,{isRecording:p}):null,e]})}function Gy(){let e=useContext(Jc);if(!e)throw new Error("useAINav must be used within CAINavProvider");return e}var $I=$y,GI=Gy;function ce(...e){return twMerge(clsx(e))}var Zy=({content:e,theme:t="light",size:r="base",defaultExpanded:o=false})=>{let[n,i]=useState(o),a=useMemo(()=>`${(r==="sm"?14:r==="lg"?18:16)-2}px`,[r]);return 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:[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:()=>i(!n),children:[jsxs("span",{className:"flex items-center",children:[jsx("span",{className:"mr-2",children:"\u{1F914}"}),jsx("span",{className:`font-medium ${t==="dark"?"text-gray-300":"text-gray-700"}`,style:{fontSize:r==="sm"?"14px":r==="lg"?"18px":"16px"},children:"\u601D\u8003\u8FC7\u7A0B"})]}),jsx("svg",{className:`w-4 h-4 transition-transform duration-200 ${n?"rotate-180":""} ${t==="dark"?"text-gray-400":"text-gray-500"}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),n&&jsx("div",{className:`p-4 whitespace-pre-wrap italic font-light ${t==="dark"?"text-gray-400":"text-gray-600"}`,style:{fontSize:a,lineHeight:"1.3 !important"},children:e})]})},ed=Zy;var ob=({content:e,language:t="text",isStreaming:r=false,className:o=""})=>{let{theme:n}=useTheme$1(),[i,a]=useState(false),s=async()=>{try{await navigator.clipboard.writeText(e),a(!0),setTimeout(()=>a(!1),2e3);}catch(c){console.error("\u590D\u5236\u5931\u8D25:",c);}},u=n==="dark"?oneDark:oneLight;return jsxs("div",{className:ce("rounded-lg overflow-hidden border border-gray-200 dark:border-gray-700 my-4",o),children:[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:[jsx("span",{className:"text-xs font-medium text-gray-600 dark:text-gray-300 uppercase",children:t}),jsx("button",{onClick:s,className:"p-1 hover:bg-gray-200 dark:hover:bg-gray-700 rounded transition-colors",disabled:r,title:i?"Copied":"Copy code",children:i?jsx(Check,{size:14,className:"text-green-500"}):jsx(Clipboard,{size:14,className:"text-gray-500 dark:text-gray-400"})})]}),jsx("div",{className:"text-sm",children:jsx(Prism,{language:t,style:u,customStyle:{margin:0,padding:"16px",fontSize:"14px",lineHeight:"1.5",backgroundColor:n==="dark"?"#1f2937":"#ffffff"},wrapLongLines:true,children:e})})]})},od=ob;var ib=({content:e,isLoading:t,className:r="",style:o})=>{let n=useRef(null),[i,a]=useState(false),[s,u]=useState(null),{theme:c}=useTheme$1();return useEffect(()=>{let l=async()=>{if(!(!e.trim()||!n.current)){a(true),u(null);try{rd.initialize({startOnLoad:!1,theme:c==="dark"?"dark":"default",securityLevel:"loose",fontFamily:"inherit"});let m=`mermaid-${Math.random().toString(36).substr(2,9)}`,d=e.replace(/```mermaid\n?|\n?```/g,"").trim(),{svg:g}=await rd.render(m,d);n.current&&(n.current.innerHTML=g);}catch(m){console.error("Mermaid render failed:",m),u(m instanceof Error?m.message:"Render failed"),n.current&&(n.current.innerText=e);}finally{a(false);}}},p=setTimeout(()=>{l();},100);return ()=>clearTimeout(p)},[e,c]),t||i?jsx("div",{className:`mermaid-block loading ${r}`,style:o,children: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:[jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-blue-500 mr-2"}),jsx("span",{className:"text-sm text-gray-500",children:"Generating Diagram..."})]})}):s?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:[jsx("p",{className:"font-semibold mb-2",children:"Mermaid Error:"}),jsx("pre",{children:s}),jsx("pre",{className:"mt-4 text-xs text-gray-500",children:e})]}):jsx("div",{className:`mermaid-block overflow-x-auto ${r}`,style:o,ref:n})},id=ib;var pb=({title:e="\u53D1\u751F\u9519\u8BEF",content:t,errorCode:r,stack:o,icon:n,closable:i=true,onClose:a,onRetry:s,className:u="",...c})=>{let[l,p]=useState(false),[m,d]=useState(false),g=async()=>{if(s){d(true);try{await s();}catch(h){console.error("\u91CD\u8BD5\u5931\u8D25:",h);}finally{d(false);}}};return 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 ${u}`,...c,children:[jsxs("div",{className:"flex p-4 border-l-4 border-l-red-500 bg-red-50 dark:bg-red-900/10",children:[jsx("div",{className:"flex-shrink-0 mr-3 text-red-500 mt-0.5",children:n||jsx(AlertCircle,{className:"w-5 h-5"})}),jsxs("div",{className:"flex-1 min-w-0",children:[jsxs("div",{className:"flex items-center space-x-2 mb-1",children:[jsx("h4",{className:"text-base font-semibold text-gray-900 dark:text-gray-100",children:e}),r&&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:r})]}),t&&jsx("div",{className:"text-sm text-gray-600 dark:text-gray-300 mb-3 leading-relaxed",children:typeof t=="string"?jsx("p",{className:"whitespace-pre-wrap",children:t}):t}),(s||o)&&jsxs("div",{className:"flex items-center space-x-4 mt-2",children:[s&&jsxs("button",{onClick:g,disabled:m,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:[jsx(RotateCw,{className:`w-3.5 h-3.5 mr-1.5 ${m?"animate-spin":""}`}),m?"\u91CD\u8BD5\u4E2D...":"\u91CD\u8BD5"]}),o&&jsxs("button",{onClick:()=>p(!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?jsx(ChevronDown,{className:"w-3.5 h-3.5 mr-1"}):jsx(ChevronRight,{className:"w-3.5 h-3.5 mr-1"}),l?"\u9690\u85CF\u8BE6\u60C5":"\u67E5\u770B\u8BE6\u60C5"]})]})]}),i&&a&&jsx("button",{onClick:a,className:"flex-shrink-0 ml-3 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors self-start",children:jsx(X,{className:"w-4 h-4"})})]}),o&&l&&jsx("div",{className:"bg-gray-50 dark:bg-gray-950 p-3 border-t border-gray-100 dark:border-gray-800",children: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:o})})]})},rn=pb;var bb=({title:e="\u8B66\u544A",content:t,warningType:r,severity:o="warning",warnings:n=[],icon:i,closable:a=true,onClose:s,onConfirm:u,actionText:c,className:l="",...p})=>{let m=()=>{switch(o){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"}}},d=()=>{switch(o){case "info":return jsx(Info,{className:"w-5 h-5"});case "error":return jsx(XCircle,{className:"w-5 h-5"});case "success":return jsx(CheckCircle,{className:"w-5 h-5"});default:return jsx(AlertTriangle,{className:"w-5 h-5"})}},g=m();return 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}`,...p,children:[jsxs("div",{className:`flex p-4 border-l-4 ${g.borderLeftColor} ${g.bgColor}`,children:[jsx("div",{className:`flex-shrink-0 mr-3 ${g.iconColor}`,children:i||d()}),jsxs("div",{className:"flex-1 min-w-0",children:[jsxs("div",{className:"flex items-center justify-between mb-1",children:[jsx("h4",{className:"text-base font-semibold text-gray-900 dark:text-gray-100",children:e}),r&&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:r})]}),t&&jsx("div",{className:"text-sm text-gray-600 dark:text-gray-300 mb-2",children:t}),n&&n.length>0&&jsx("ul",{className:"mt-2 space-y-1",children:n.map((h,k)=>jsxs("li",{className:"flex items-start text-sm text-gray-600 dark:text-gray-300",children:[jsx("span",{className:"mr-2 mt-1.5 w-1 h-1 rounded-full bg-gray-400 dark:bg-gray-500 flex-shrink-0"}),jsx("span",{children:h})]},k))})]}),a&&s&&jsx("button",{onClick:s,className:"flex-shrink-0 ml-3 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors",children:jsx(X,{className:"w-4 h-4"})})]}),u&&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:jsx("button",{onClick:u,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:c||"\u786E\u8BA4"})})]})},nn=bb;var kb=({title:e="\u76F8\u5173\u63A8\u8350",content:t,suggestions:r,onSuggestionClick:o,maxDisplay:n=5,icon:i,closable:a=false,onClose:s,className:u="",...c})=>{let[l,p]=useState(false),[m,d]=useState(""),[g,h]=useState(false),k=useMemo(()=>m.trim()?r.filter(v=>v.toLowerCase().includes(m.toLowerCase())):r,[r,m]),C=useMemo(()=>l?k:k.slice(0,n),[k,l,n]),f=v=>{o?.(v);};return !r||r.length===0?null: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 ${u}`,...c,children:[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:[jsxs("div",{className:"flex items-center space-x-2.5",children:[jsx("div",{className:"text-blue-500 flex-shrink-0",children:i||jsx(Lightbulb,{className:"w-5 h-5"})}),jsxs("div",{className:"flex flex-col",children:[jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100 leading-tight",children:e}),t&&jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5",children:t})]})]}),jsxs("div",{className:"flex items-center space-x-1",children:[r.length>3&&jsx("button",{onClick:()=>h(!g),className:`p-1.5 rounded-md transition-colors ${g?"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:g?"\u5173\u95ED\u641C\u7D22":"\u641C\u7D22\u95EE\u9898",children:jsx(Search,{className:"w-4 h-4"})}),a&&s&&jsx("button",{onClick:s,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:jsx(X,{className:"w-4 h-4"})})]})]}),g&&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:jsxs("div",{className:"relative",children:[jsx("input",{type:"text",placeholder:"\u641C\u7D22\u76F8\u5173\u95EE\u9898...",value:m,onChange:v=>d(v.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}),jsx(Search,{className:"absolute left-2.5 top-2 w-3.5 h-3.5 text-gray-400"})]})}),jsxs("div",{className:"p-2",children:[jsx("ul",{className:"space-y-1",children:C.map((v,y)=>jsx("li",{children:jsxs("button",{onClick:()=>f(v),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:[jsx("span",{children:v}),jsx(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))}),k.length>n&&jsx("button",{onClick:()=>p(!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 (${k.length})`}),k.length===0&&m&&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"})]})]})},sn=kb;var Db=({title:e,content:t,toolName:r,parameters:o,result:n,status:i,duration:a,icon:s,closable:u=false,onClose:c,onAction:l,actionText:p,className:m="",...d})=>{let[g,h]=useState(false),[k,C]=useState(true),f=()=>{switch(i){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"}}},v=()=>{switch(i){case "pending":return jsx(Loader2,{className:"w-5 h-5 animate-spin"});case "error":return jsx(XCircle,{className:"w-5 h-5"});default:return jsx(CheckCircle,{className:"w-5 h-5"})}},y=A=>A?A<1e3?`${A}ms`:`${(A/1e3).toFixed(2)}s`:"",S=f(),R=e||r||"\u5DE5\u5177\u8C03\u7528";return 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 ${m}`,...d,children:[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:[jsxs("div",{className:"flex items-center space-x-3",children:[jsx("div",{className:`flex-shrink-0 ${S.iconColor}`,children:s||v()}),jsxs("div",{children:[jsxs("div",{className:"flex items-center space-x-2",children:[jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100",children:R}),jsx("span",{className:`text-[10px] font-medium px-1.5 py-0.5 rounded ${S.badgeBg} ${S.badgeText}`,children:S.label})]}),r&&e&&jsxs("div",{className:"text-xs text-gray-500 dark:text-gray-400 flex items-center mt-0.5",children:[jsx(Terminal,{className:"w-3 h-3 mr-1"}),r]})]})]}),jsxs("div",{className:"flex items-center space-x-2 text-xs text-gray-500 dark:text-gray-400",children:[a&&jsxs("div",{className:"flex items-center bg-gray-100 dark:bg-gray-800 px-2 py-1 rounded",children:[jsx(Clock,{className:"w-3 h-3 mr-1"}),y(a)]}),u&&c&&jsx("button",{onClick:c,className:"text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors p-1 rounded",children:jsx(X,{className:"w-4 h-4"})})]})]}),jsxs("div",{className:"p-4",children:[t&&jsx("div",{className:"text-sm text-gray-600 dark:text-gray-300 mb-4 leading-relaxed",children:t}),o&&jsxs("div",{className:"mb-3",children:[jsxs("button",{onClick:()=>h(!g),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:[g?jsx(ChevronDown,{className:"w-3.5 h-3.5 mr-1"}):jsx(ChevronRight,{className:"w-3.5 h-3.5 mr-1"}),jsx(Box$1,{className:"w-3.5 h-3.5 mr-1.5"}),"\u8F93\u5165\u53C2\u6570"]}),g&&jsx("div",{className:"bg-gray-50 dark:bg-gray-950 rounded border border-gray-100 dark:border-gray-800 overflow-hidden",children:jsx("pre",{className:"p-3 text-xs font-mono text-gray-600 dark:text-gray-400 overflow-x-auto",children:JSON.stringify(o,null,2)})})]}),n&&jsxs("div",{children:[jsxs("button",{onClick:()=>C(!k),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:[k?jsx(ChevronDown,{className:"w-3.5 h-3.5 mr-1"}):jsx(ChevronRight,{className:"w-3.5 h-3.5 mr-1"}),jsx(Terminal,{className:"w-3.5 h-3.5 mr-1.5"}),"\u6267\u884C\u7ED3\u679C"]}),k&&jsx("div",{className:"bg-gray-50 dark:bg-gray-950 rounded border border-gray-100 dark:border-gray-800 overflow-hidden",children:jsx("pre",{className:"p-3 text-xs font-mono text-gray-600 dark:text-gray-400 overflow-x-auto",children:typeof n=="string"?n:JSON.stringify(n,null,2)})})]}),l&&jsx("div",{className:"mt-3 pt-3 border-t border-gray-100 dark:border-gray-800 flex justify-end",children: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:p||"\u6267\u884C\u64CD\u4F5C"})})]})]})},ln=Db;var Mb=({data:e})=>{if(!e)return null;let t=useMemo(()=>{let r=[],o=[],n="\u6570\u636E\u8868\u683C";return Array.isArray(e)?(r=e,r.length>0&&(o=Object.keys(r[0]).map(i=>({id:i,label:i.charAt(0).toUpperCase()+i.slice(1),numeric:typeof r[0][i]=="number"})))):typeof e=="object"&&(n=e.title||n,r=Array.isArray(e.rows)?e.rows:Array.isArray(e.data)?e.data:[],Array.isArray(e.columns)?o=e.columns.map(a=>({id:a.key||a.id,label:a.title||a.label,numeric:a.dataType==="number"||a.numeric})):r.length>0&&(o=Object.keys(r[0]).map(a=>({id:a,label:a,numeric:typeof r[0][a]=="number"})))),r=r.map((i,a)=>({...i,id:i.id||`row_${a}`})),{title:n,columns:o,rows:r}},[e]);return t.rows.length===0?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"}):jsx("div",{className:"w-full my-4",children:jsx(mo,{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]})})},cn=Mb;var $b=({title:e,subtitle:t,data:r,type:o,config:n={}})=>{let i=()=>{switch(o){case "bar-chart-card":return jsx(BarChart,{className:"w-4 h-4 text-blue-500"});case "line-chart-card":return jsx(LineChart,{className:"w-4 h-4 text-green-500"});case "pie-chart-card":return jsx(PieChart,{className:"w-4 h-4 text-purple-500"});case "combo-chart-card":return jsx(Activity,{className:"w-4 h-4 text-orange-500"});case "heatmap-chart-card":return jsx(Grid$1,{className:"w-4 h-4 text-red-500"});case "fishbone-chart-card":return jsx(GitBranch,{className:"w-4 h-4 text-indigo-500"});case "waterfall-chart-card":return jsx(TrendingDown,{className:"w-4 h-4 text-teal-500"});case "google-map-card":return jsx(Globe,{className:"w-4 h-4 text-blue-600"});case "amap-card":return jsx(MapPin,{className:"w-4 h-4 text-blue-600"});default:return jsx(BarChart,{className:"w-4 h-4"})}},a=()=>{if(!r&&o!=="google-map-card"&&o!=="amap-card")return jsx("div",{className:"text-gray-500 text-sm p-4 text-center",children:"No data available"});try{switch(o){case "bar-chart-card":return jsx(wa,{data:r,orientation:n.orientation||"horizontal",valueSuffix:n.valueSuffix||"",minHeight:n.minHeight});case "line-chart-card":return jsx(_s,{data:r,color:n.color,valueSuffix:n.valueSuffix||"",height:n.height});case "pie-chart-card":let s=r.reduce((c,l)=>c+(Number(l.value)||0),0),u=r.map(c=>({name:c.name,value:Number(c.value)||0,percent:typeof c.percent=="number"?c.percent:s>0?(Number(c.value)||0)/s*100:0}));return jsx(ur,{data:u,variant:n.variant||"donut",size:n.size,colors:n.colors});case "combo-chart-card":return jsx(Ks,{data:r,barColor:n.barColor,lineColor:n.lineColor});case "heatmap-chart-card":return jsx(js,{data:r});case "fishbone-chart-card":return jsx(Xs,{branches:r,effect:n.effect||e||"Problem"});case "waterfall-chart-card":return jsx(Js,{data:r,height:n.height});case "google-map-card":return jsx(ol,{embedUrl:n.embedUrl||r&&r[0]?.embedUrl,apiKey:n.apiKey,query:n.query||r&&r[0]?.query||e,height:n.height});case "amap-card":return jsx(il,{embedUrl:n.embedUrl||r&&r[0]?.embedUrl,keyword:n.keyword||r&&r[0]?.keyword||e,height:n.height});default:return jsxs("div",{className:"text-gray-500 text-sm p-4 text-center",children:["Unsupported chart type: ",o]})}}catch(s){return console.error("Error rendering chart:",s),jsx("div",{className:"text-red-500 text-sm p-4 text-center",children:"Error rendering chart"})}};return 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:[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:[jsx("div",{className:"mr-2 flex-shrink-0",children:i()}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("h3",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100 truncate",children:e}),t&&jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5 truncate",children:t})]})]}),jsxs("div",{className:"p-4",children:[jsx("div",{className:"overflow-x-auto",children:a()}),jsx("div",{className:"mt-3",children:jsxs("details",{className:"text-xs text-gray-500 dark:text-gray-400",children:[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"}),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(r,null,2)})]})})]})]})},dn=$b;var Hb=({type:e,manifest:t})=>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:[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:[jsx(Box$1,{className:"w-4 h-4 mr-2 text-blue-600 dark:text-blue-400"}),jsxs("h3",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100",children:["SAP Card: ",e]})]}),jsx("div",{className:"p-4",children: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:jsx("pre",{className:"text-xs font-mono text-gray-600 dark:text-gray-400 whitespace-pre-wrap",children:JSON.stringify(t,null,2)})})})]}),pn=Hb;var mn=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 Zb=({content:e,theme:t,size:r="base",className:o,enableCodeHighlight:n=true,enableMermaid:i=true,messageId:a,cardHooks:s})=>{let u=useMemo(()=>e?e.replace(/<think>([\s\S]*?)<\/think>/g,(m,d)=>`<div data-component="thinkbox" data-think-content="${encodeURIComponent(d.trim())}"></div>`):"",[e]),c=(m,d,g,h,k)=>{s?.onCardEvent?.({messageId:a,cardType:m,action:d,title:g,payload:h,rawData:k});},l=(m,d,g,h,k,C)=>{if(!(!k&&!s?.onCardEvent))return (...f)=>{let v=k?.(...f),y=C?C(...f):void 0;return c(m,d,g,y,h),v}},p=useMemo(()=>({div(m){let{"data-component":d,"data-think-content":g,...h}=m;return d==="thinkbox"&&g?jsx(ed,{content:decodeURIComponent(g),theme:t,size:r,defaultExpanded:false}):jsx("div",{...h})},table({children:m}){return jsx("div",{className:"my-4 w-full overflow-x-auto rounded-lg border border-gray-200 dark:border-gray-800",children:jsx("table",{className:"w-full min-w-[520px] border-collapse text-sm",children:m})})},thead({children:m}){return jsx("thead",{className:"bg-gray-50 dark:bg-gray-900/60",children:m})},tbody({children:m}){return jsx("tbody",{className:"bg-white dark:bg-gray-950",children:m})},tr({children:m}){return jsx("tr",{className:"border-b border-gray-200 dark:border-gray-800 last:border-b-0",children:m})},th({children:m,align:d}){return jsx("th",{className:`px-3 py-2 font-semibold text-gray-800 dark:text-gray-100 ${d==="center"?"text-center":d==="right"?"text-right":"text-left"}`,children:m})},td({children:m,align:d}){return jsx("td",{className:`px-3 py-2 text-gray-700 dark:text-gray-200 align-top ${d==="center"?"text-center":d==="right"?"text-right":"text-left"}`,children:m})},code({inline:m,className:d,children:g,...h}){let k=/language-([\w-]+)/.exec(d||""),C=k?k[1]:"";if(m)return 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",...h,children:g});let f=String(g).replace(/\n$/,"");if(i&&C==="mermaid")return jsx(id,{content:f});if(C==="json"){let v=mn(f);if(v)switch(v.type){case "table":return jsx(cn,{data:v.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 jsx(dn,{...v});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return jsx(pn,{...v});case "error-card":{let y=v;return jsx(rn,{...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=v,S=y.onConfirm?l("warning-card","confirm",y.title,y,y.onConfirm):y.actionText&&s?.onCardEvent?l("warning-card","confirm",y.title,y):void 0;return jsx(nn,{...y,onClose:l("warning-card","close",y.title,y,y.onClose),onConfirm:S})}case "suggestions-card":{let y=v;return jsx(sn,{...y,onClose:l("suggestions-card","close",y.title,y,y.onClose),onSuggestionClick:l("suggestions-card","suggestion-click",y.title,y,y.onSuggestionClick,S=>({suggestion:S}))})}case "tool-result-card":{let y=v;return jsx(ln,{...y,onClose:l("tool-result-card","close",y.title,y,y.onClose),onAction:l("tool-result-card","action",y.title,y,y.onAction)})}}}return n?jsx(od,{content:f,language:C,className:"not-prose"}):jsx("code",{className:d,...h,children:g})}}),[t,r,i,n,s,a]);return jsx("div",{className:ce("markdown-body prose dark:prose-invert max-w-none",o),children:jsx(Wb,{remarkPlugins:[Ub,qb],rehypePlugins:[_b,Kb],components:p,children:u})})},gn=Zb;var jb=({content:e,messageId:t,cardHooks:r})=>{let o=(a,s,u,c,l)=>{r?.onCardEvent?.({messageId:t,cardType:a,action:s,title:u,payload:c,rawData:l});},n=(a,s,u,c,l,p)=>{if(!(!l&&!r?.onCardEvent))return (...m)=>{let d=l?.(...m),g=p?p(...m):void 0;return o(a,s,u,g,c),d}},i=mn(e);if(i)switch(i.type){case "table":return jsx(cn,{data:i.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 jsx(dn,{...i});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return jsx(pn,{...i});case "error-card":{let a=i;return jsx(rn,{...a,onClose:n("error-card","close",a.title,a,a.onClose),onRetry:n("error-card","retry",a.title,a,a.onRetry)})}case "warning-card":{let a=i,s=a.onConfirm?n("warning-card","confirm",a.title,a,a.onConfirm):a.actionText&&r?.onCardEvent?n("warning-card","confirm",a.title,a):void 0;return jsx(nn,{...a,onClose:n("warning-card","close",a.title,a,a.onClose),onConfirm:s})}case "suggestions-card":{let a=i;return jsx(sn,{...a,onClose:n("suggestions-card","close",a.title,a,a.onClose),onSuggestionClick:n("suggestions-card","suggestion-click",a.title,a,a.onSuggestionClick,s=>({suggestion:s}))})}case "tool-result-card":{let a=i;return jsx(ln,{...a,onClose:n("tool-result-card","close",a.title,a,a.onClose),onAction:n("tool-result-card","action",a.title,a,a.onAction)})}}return jsx("div",{className:"dynamic-card-fallback",children:jsx(gn,{content:e,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:t,cardHooks:r})})},hd=jb;var ji=class{static analyze(t){if(!t.trim())return {blocks:[],hasComplexContent:false,overallType:"simple"};let o=/```json\s*\{\s*"type":\s*"[^"]+"/g.test(t),n=/<[^>]+>[\s\S]*?<\/[^>]+>/.test(t),i=t.includes("NQ#")||t.includes("data-component");return o||n||i?{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"}}},Xb=({content:e,className:t="",messageId:r,cardHooks:o})=>{let n=je__default.useMemo(()=>ji.analyze(e),[e]);return jsx("div",{className:`universal-content-renderer ${t}`,children:n.blocks.map((i,a)=>i.type==="mixed"||i.type==="json-card"?jsx(hd,{content:i.content,messageId:r,cardHooks:o},`block-${a}`):jsx(gn,{content:i.content,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:r,cardHooks:o},`block-${a}`))})},yd=Xb;var Yb=({content:e,isStreaming:t=true,onComplete:r,className:o="",streamIntervalMs:n=24,streamChunkSize:i=3,messageId:a,cardHooks:s})=>{let[u,c]=useState(t?0:e.length),[l,p]=useState(!t);useEffect(()=>{if(t){c(0),p(false);return}c(e.length),p(true);},[e,t]),useEffect(()=>{if(!t||l)return;if(u>=e.length){p(true),r?.();return}let k=window.setTimeout(()=>{c(C=>Math.min(C+i,e.length));},n);return ()=>{window.clearTimeout(k);}},[e.length,l,t,r,i,n,u]);let m=()=>{t&&!l&&(c(e.length),p(true),r?.());},d=t?e.slice(0,u):e,g=t&&!l,h=t&&!l;return jsxs("div",{className:`streaming-markdown ${o}`,onClick:m,style:{cursor:t?"pointer":"default"},children:[jsxs("div",{className:"relative",children:[jsx(yd,{content:d,messageId:a,cardHooks:s}),g&&jsx("span",{className:"inline-block w-0.5 h-5 bg-blue-500 ml-1 animate-pulse",style:{verticalAlign:"text-bottom"}})]}),h&&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"})]})},Cd=Yb;var kd=({buttons:e,className:t})=>{let r=o=>{switch(o){case "copy":return jsx(Copy,{size:14});case "refresh":return jsx(RefreshCw,{size:14});case "volume":return jsx(Volume2,{size:14});case "like":return jsx(ThumbsUp,{size:14});case "dislike":return jsx(ThumbsDown,{size:14});default:return null}};return jsx("div",{className:ce("flex items-center gap-1",t),children:e.map((o,n)=>jsx("button",{onClick:o.onClick,disabled:o.disabled,className:ce("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",o.active&&"text-blue-600 bg-blue-50 dark:text-blue-400 dark:bg-blue-900/20",o.type==="refresh"&&o.disabled&&"animate-spin"),title:o.type,type:"button",children:r(o.type)},`${o.type}-${n}`))})};var fn=({message:e,onStreamingComplete:t,assistantActions:r,streamIntervalMs:o,streamChunkSize:n,cardHooks:i})=>e.type==="assistant"?jsx("div",{className:"flex justify-start mb-4",children: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:[jsx(Cd,{content:e.content,isStreaming:e.isStreaming??false,onComplete:t,streamIntervalMs:o,streamChunkSize:n,messageId:e.id,cardHooks:i}),e.content&&r?.isLatestAssistant&&jsx("div",{className:"flex flex-row justify-start gap-2 mt-3 pt-2 border-t border-gray-100 dark:border-gray-700",children:jsx(kd,{buttons:[{type:"refresh",onClick:()=>r?.onRegenerate?.(),disabled:!r?.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"})}),jsx("div",{className:"text-xs mt-2 text-gray-500 dark:text-gray-400",children:e.timestamp.toLocaleTimeString()})]})}):jsx("div",{className:"flex justify-end",children: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:[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}),jsx("div",{className:"text-xs mt-2 text-gray-500 dark:text-gray-400",children:e.timestamp.toLocaleTimeString()})]})});var wd=({onTextUpdate:e,onComplete:t,onCancel:r,disabled:o,className:n})=>{let{isRecording:i,startRecording:a,stopRecording:s}=an({onTextUpdate:e,onComplete:c=>{t?.(c);},onError:c=>{console.error("Voice input error:",c),r?.();}});return jsx("button",{onClick:async()=>{i?s():await a();},disabled:o,className:ce("transition-all duration-200 flex items-center justify-center rounded-full",i?"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",o&&"opacity-50 cursor-not-allowed",n),title:i?"Stop recording":"Start recording",type:"button",children:i?jsx(nx,{sx:{fontSize:24}}):jsx(rx,{sx:{fontSize:24}})})};var ze={container:"w-full max-w-4xl mx-auto",inputContainer:ce("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:ce("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:ce("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:ce("bg-transparent hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-500 dark:text-gray-400","cursor-pointer active:scale-95"),sendButton:ce("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:ce("cursor-not-allowed opacity-40 bg-transparent text-gray-400"),stopButton:ce("cursor-pointer bg-red-500 hover:bg-red-600 text-white shadow-sm active:scale-95")},mx={padding:0,lineHeight:"1.5",border:"none !important",boxShadow:"none !important",backgroundColor:"transparent",height:"auto",fontFeatureSettings:'"liga" 1, "kern" 1',WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},gx=({enabled:e,onClick:t})=>jsx("button",{className:ce(ze.buttonBase,ze.buttonSmall,ze.buttonNormal),onClick:t,disabled:!e,"aria-label":"Upload file",type:"button",children:jsx(ux,{sx:{fontSize:24}})}),fx=()=>jsxs("button",{className:ce(ze.buttonBase,"h-10 px-3 py-2 gap-1.5 rounded-full",ze.buttonNormal),"aria-label":"Tools",type:"button",children:[jsx(px,{sx:{fontSize:20}}),jsx("span",{className:"text-sm font-medium",children:"Tools"})]}),hx=({canSend:e,isResponding:t,onSend:r,onStop:o})=>t?jsx("button",{className:ce(ze.buttonBase,ze.buttonSmall,ze.stopButton),onClick:o,"aria-label":"Stop generating",type:"button",children:jsx(Stop,{sx:{fontSize:20}})}):jsx("button",{className:ce(ze.buttonBase,ze.buttonSmall,e?ze.sendButton:ze.sendButtonDisabled),onClick:r,disabled:!e,"aria-label":"Send message",type:"button",children:jsx(dx,{sx:{fontSize:24},className:e?"text-gray-500 dark:text-gray-400":"text-gray-300 dark:text-gray-600"})}),Td=({onSend:e,onStop:t,isResponding:r=false,placeholder:o,getText:n})=>{let[i,a]=useState(""),[s,u]=useState([]),[c,l]=useState(false),[p,m]=useState(false),d=useRef(null),g=o||(n?n("00019","Type a message..."):"Type a message..."),h=(i.trim().length>0||s.length>0)&&!r,k={enabled:true},C=useCallback(D=>{a(D.target.value),D.target.style.height="auto",D.target.style.height=`${Math.min(D.target.scrollHeight,200)}px`;},[]),f=useCallback(D=>{if(D.target.files&&D.target.files.length>0){let U=Array.from(D.target.files);u(j=>{let te=U.filter(V=>j.some(W=>W.name===V.name&&W.size===V.size));te.length>0&&console.warn("Duplicate files ignored:",te.map(V=>V.name));let N=U.filter(V=>!j.some(W=>W.name===V.name&&W.size===V.size));return [...j,...N]}),d.current&&(d.current.value="");}},[]),v=useCallback(D=>{u(U=>U.filter((j,te)=>te!==D));},[]),y=useCallback(()=>{d.current?.click();},[]),S=useCallback(async()=>{if(!h)return;let D=i,U=[...s];a(""),u([]),d.current&&(d.current.value="");try{await e(D,U);}catch(j){console.error("Failed to send message:",j),a(D),u(U);}},[i,h,e,s]),R=useCallback(D=>{D.key==="Enter"&&!D.shiftKey&&!c&&(D.preventDefault(),S());},[S,c]),A=useCallback(()=>{l(true);},[]),T=useCallback(()=>{l(false);},[]),F=useCallback(D=>{a(D);},[]),w=useCallback(D=>{a(D);},[]),I=useCallback(()=>{},[]),P=useCallback(D=>{D.preventDefault(),m(true);},[]),b=useCallback(D=>{D.preventDefault(),m(false);},[]),L=useCallback(D=>{if(D.preventDefault(),m(false),D.dataTransfer.files&&D.dataTransfer.files.length>0){let U=Array.from(D.dataTransfer.files);u(j=>[...j,...U]);}},[]);return jsx("div",{className:ze.container,children:jsxs("div",{className:"relative",children:[jsx("input",{type:"file",multiple:true,className:"hidden",ref:d,onChange:f}),jsxs("div",{className:ce(ze.inputContainer,p&&ze.dragActive),style:{borderRadius:"32px"},onDragOver:P,onDragLeave:b,onDrop:L,children:[s.length>0&&jsx("div",{className:ze.filePreviewArea,children:s.map((D,U)=>jsxs("div",{className:ze.fileTag,children:[jsx(InsertDriveFile,{sx:{fontSize:16},className:"text-blue-500"}),jsx("span",{className:"truncate max-w-[150px]",children:D.name}),jsx("button",{onClick:()=>v(U),className:"ml-1 hover:text-red-500 focus:outline-none",type:"button",children:jsx(Close,{sx:{fontSize:16}})})]},`${D.name}-${U}`))}),jsxs("div",{className:"flex flex-col w-full p-2",children:[jsx("div",{className:ce(ze.textareaWrapper,"px-3 pt-2 pb-3 min-h-[60px]"),children:jsx("textarea",{className:ce(ze.textarea,"min-h-[24px] py-0 px-0"),placeholder:g,value:i,onChange:C,onKeyDown:R,onCompositionStart:A,onCompositionEnd:T,style:mx,"aria-label":"Message input",spellCheck:false,rows:1})}),jsxs("div",{className:"flex items-center justify-between px-1 pb-1",children:[jsxs("div",{className:"flex items-center gap-1",role:"toolbar","aria-label":"Input tools",children:[jsx(gx,{enabled:k.enabled,onClick:y}),jsx(fx,{})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsx(wd,{onTextUpdate:F,onComplete:w,onCancel:I,disabled:r,className:ze.buttonSmall}),jsx(hx,{canSend:h,isResponding:r,onSend:S,onStop:t})]})]})]})]})]})})};var Pd=({messages:e,onSend:t,onStop:r,onRegenerate:o,isResponding:n=false,className:i,placeholder:a,streamIntervalMs:s,streamChunkSize:u,onMessageStreamingComplete:c,cardHooks:l})=>{let p=useRef(null);return useEffect(()=>{p.current?.scrollIntoView({behavior:"smooth"});},[e,n]),jsxs("div",{className:ce("flex flex-col h-full w-full relative",i),children:[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((m,d)=>{let g=m.type==="assistant"&&d===e.length-1,h=m.type==="assistant"?{isLatestAssistant:g,onRegenerate:o?()=>o(m.id):void 0}:void 0;return jsx(fn,{message:m,assistantActions:h,onStreamingComplete:()=>c?.(m.id),streamIntervalMs:s,streamChunkSize:u,cardHooks:l},m.id)}),jsx("div",{ref:p})]}),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:jsx(Td,{onSend:t,onStop:r||(()=>{}),isResponding:n,placeholder:a})})]})};var dD=({title:e="AI Agent",description:t,headerActions:r,className:o,...n})=>jsxs("div",{className:ce("flex flex-col h-full w-full bg-white dark:bg-gray-950 rounded-xl overflow-hidden shadow-sm border border-gray-200 dark:border-gray-800",o),children:[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:[jsxs("div",{children:[jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100",children:e}),t&&jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5",children:t})]}),jsx("div",{className:"flex items-center gap-2",children:r})]}),jsx("div",{className:"flex-1 min-h-0 relative",children:jsx(Pd,{...n})})]});var Sx={"top-left":"bottom-right","top-right":"bottom-left","bottom-left":"top-right","bottom-right":"top-left"},bD=({messages:e,onSend:t,onRegenerate:r,isResponding:o=false,className:n,placeholder:i,title:a="Copilot",corner:s="bottom-right",onCollapse:u,onHeaderPointerDown:c,onPlusClick:l,onMicClick:p,streamIntervalMs:m,streamChunkSize:d,onMessageStreamingComplete:g,cardHooks:h})=>{let[k,C]=useState(""),[f,v]=useState(false),y=useRef(null),S=Sx[s];useEffect(()=>{y.current?.scrollIntoView({behavior:"smooth"});},[e,o]);let R=useCallback(async()=>{let T=k.trim();!T||o||(C(""),await t(T));},[o,t,k]),A=useCallback(async T=>{T.key==="Enter"&&!f&&(T.preventDefault(),await R());},[R,f]);return jsxs("div",{className:ce("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",n),children:[u&&jsx("button",{onClick:u,className:ce("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:jsx("span",{className:ce("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]")})}),jsxs("div",{className:"flex items-center justify-between border-b border-gray-100 px-4 py-3 dark:border-gray-800",onPointerDown:c,children:[jsx("div",{className:"flex items-center",children:jsx("h3",{className:"text-base font-semibold tracking-tight text-gray-900 dark:text-gray-100",children:a})}),jsx("div",{})]}),jsxs("div",{className:"flex-1 overflow-y-auto px-3 py-3 space-y-5 scrollbar-thin scrollbar-thumb-gray-300 dark:scrollbar-thumb-gray-600",children:[e.map((T,F)=>{let w=T.type==="assistant"&&F===e.length-1,I=T.type==="assistant"?{isLatestAssistant:w,onRegenerate:r?()=>r(T.id):void 0}:void 0;return jsx(fn,{message:T,assistantActions:I,onStreamingComplete:()=>g?.(T.id),streamIntervalMs:m,streamChunkSize:d,cardHooks:h},T.id)}),jsx("div",{ref:y})]}),jsx("div",{className:"border-t border-gray-100 px-3 py-3 dark:border-gray-800",children: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:[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:jsx(Plus,{className:"h-4 w-4"})}),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:i||"Ask Copilot...",value:k,onChange:T=>C(T.target.value),onCompositionStart:()=>v(true),onCompositionEnd:()=>v(false),onKeyDown:A,"aria-label":"Copilot input",spellCheck:false}),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:p,type:"button","aria-label":"Microphone",children:jsx(Mic,{className:"h-4 w-4"})})]})})]})};var Dx={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)"}}},SD=({children:e,transitionKey:t,variant:r="fade",durationMs:o=220,delayMs:n=0,easing:i="cubic-bezier(0.22, 1, 0.36, 1)",disabled:a=false,sx:s})=>{let u=useMediaQuery("(prefers-reduced-motion: reduce)"),[c,l]=useState("to"),p=!a&&!u&&r!=="none";useEffect(()=>{if(!p){l("to");return}l("from");let g=requestAnimationFrame(()=>{g=requestAnimationFrame(()=>{l("to");});});return ()=>cancelAnimationFrame(g)},[t,p]);let m=Dx[r],d=useMemo(()=>p?c==="from"?m.from:m.to:{opacity:1,transform:"none"},[p,c,m.from,m.to]);return jsx(Box,{sx:{willChange:p?"opacity, transform":"auto",transition:p?`opacity ${o}ms ${i} ${n}ms, transform ${o}ms ${i} ${n}ms`:"none",backfaceVisibility:"hidden",...d,...s},children:e})},wD={subtle:{variant:"fade",durationMs:180},smooth:{variant:"slide-up",durationMs:220},snappy:{variant:"scale",durationMs:160}};
|
|
13
|
+
export{dD as AgentPanel,In as Button,$y as CAINavProvider,il as CAmapChart,xc as CAppHeader,u1 as CAppPageLayout,wa as CBarChart,rr as CChartCard,Ks as CComboChart,dl as CCustomizeAgent,$T as CDetailInfoPage,dc as CDetailSearchAiBar,Or as CDetailSectionCard,Xs as CFishboneChart,ol as CGoogleMapChart,sl as CGraphCharts,Ws as CGraphKpiCards,ul as CGraphReport,js as CHeatmapChart,Nl as CLayoutManagement,Ol as CLayoutManager,_s as CLineChart,Bn as CMessageBox,Ts as CPageLayout,SD as CPageTransition,ur as CPieChart,SI as CPivotTable,Ba as CSmartFilter,nw as CSmartTable,pw as CStandardPage,mo as CTable,ew as CTableBody,tw as CTableCell,ow as CTableContainer,aw as CTableHead,rw as CTableRow,Cr as CVariantManagement,kl as CVariantManager,$i as CVoiceWaveOverlay,Js as CWaterfallChart,za as CodeBlock,bD as CopilotChat,Lv as GlobalMessage,Ha as MarkdownRenderer,Oa as MathBlock,pi as MermaidBlock,Cs as NavigationIsland,xa as ORBCAFE_I18N_MESSAGES,fs as OrbcafeI18nProvider,wD as PAGE_TRANSITION_PRESETS,Pd as StdChat,gi as TableBlock,Nr as ThinkBlock,Rn as TreeMenu,$I as VoiceNavigatorProvider,FI as VoiceWaveOverlay,gr as buildAmapEmbedUrl,Pa as buildGoogleMapEmbedUrl,mC as buildGoogleMapIframe,jd as buttonVariants,yv as message,qt as messageManager,Lr as parseMarkdownTable,cT as renderMarkdown,Vl as resolveVariantFilters,Dr as resolveVariantLayout,Gy as useAINav,Pw as useAmapEmbedUrl,pc as useDetailInfo,Iw as useGoogleMapEmbedUrl,Cw as useGraphChartData,gl as useGraphInteraction,Yn as useGraphReport,Ss as useNavigationIsland,q as useOrbcafeI18n,vc as usePageLayout,RI as usePivotTable,bw as useStandardReport,an as useVoiceInput,GI as useVoiceNavigator};
|