orbcafe-ui 3.0.0 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,20 +1,23 @@
1
- import {f,d,g,e,a,b,c}from'./chunk-7TUSE6H4.mjs';export{h as COrbCanvas}from'./chunk-7TUSE6H4.mjs';import*as Yt from'react';import Yt__default,{createContext,forwardRef,useId,useRef,useState,useImperativeHandle,useMemo,Children,isValidElement,useEffect,useContext,useCallback,Fragment,useLayoutEffect,cloneElement}from'react';import*as Ro from'@radix-ui/react-dropdown-menu';import*as Go from'@radix-ui/react-tooltip';import {createPortal}from'react-dom';import*as Co from'@radix-ui/react-dialog';import*as sr from'@radix-ui/react-popover';import Zo from'dayjs';import Um from'dayjs/plugin/customParseFormat';import {usePathname,useRouter}from'next/navigation';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {Slot}from'@radix-ui/react-slot';import {cva}from'class-variance-authority';import {DndContext,closestCenter,useSensors,useSensor,PointerSensor,TouchSensor,closestCorners,DragOverlay,useDroppable,useDraggable}from'@dnd-kit/core';import {restrictToHorizontalAxis}from'@dnd-kit/modifiers';import {arrayMove,SortableContext,horizontalListSortingStrategy,verticalListSortingStrategy,useSortable}from'@dnd-kit/sortable';import nf from'dayjs/plugin/isBetween';import sf 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 ub from'next/dynamic';import {AnimatePresence,motion}from'framer-motion';import Gb from'react-markdown';import _b from'remark-gfm';import Ub from'remark-math';import Kb from'rehype-katex';import qb from'rehype-raw';import {Prism}from'react-syntax-highlighter';import {oneDark,oneLight}from'react-syntax-highlighter/dist/esm/styles/prism';import nu from'mermaid';import wv from'dayjs/plugin/isoWeek';var $u={canvas:"#ffffff",surface:"#f5f5f5",surface2:"#f5f5f5",surface3:"#f5f5f5",fg:"#555555",muted:"#8c8c8c",border:"#dbdbdb",primary:"#154194",onPrimary:"#ffffff",link:"#154194",p50:"#f0f3f9",p100:"#dce4f1",p200:"#bac9e3",p300:"#91a8d1",p600:"#0f3276",p700:"#08255a",accent:"#fc4c02",err:"#ac3101",errBg:"#fff4f0",warnBg:"#fff2ee",hover:"rgba(21, 65, 148, 0.06)",selected:"rgba(21, 65, 148, 0.10)",focusRing:"rgba(21, 65, 148, 0.18)",focusSolid:"#154194",disabledFg:"#aeaeae",disabledBg:"#f0f0f0",chartGrid:"#dbdbdb",chartText:"#8c8c8c",track:"#f5f5f5",shadow1:"0 1px 2px rgba(1,9,26,.05),0 2px 6px rgba(1,9,26,.06)",shadow2:"0 4px 14px rgba(1,9,26,.10)",shadow3:"0 12px 32px rgba(1,9,26,.16)",fontBrand:"Montserrat",inverseSurface:"#01091a",inverseFg:"#ffffff",inverseLink:"#91a8d1",aiAccent:"#21bcff",statusFg:"#475569",statusPrimary:"#1d4ed8",statusSuccess:"#047857",statusWarning:"#b45309",statusError:"#b91c1c",statusInfo:"#0369a1",chart1:"#154194",chart2:"#91a8d1",chart3:"#8c8c8c",chart4:"#08255a",chart5:"#fc4c02",chart6:"#bac9e3",chartPositive:"#66bb6a",chartNegative:"#ef5350"},Gu={canvas:"#01091a",surface:"#0a1526",surface2:"#061324",surface3:"#0e1b2b",fg:"#ffffff",muted:"rgba(255,255,255,0.7)",border:"rgba(255,255,255,0.12)",primary:"#154194",onPrimary:"#ffffff",link:"#91a8d1",p50:"#021432",p100:"#021a3d",p200:"#bac9e3",p300:"#91a8d1",p600:"#375ea5",p700:"#6e8cc1",accent:"#fc4c02",err:"#d53f01",errBg:"#16163b",warnBg:"#19173f",hover:"rgba(255,255,255,0.08)",selected:"rgba(21, 65, 148, 0.45)",focusRing:"rgba(145, 168, 209, 0.45)",focusSolid:"#91a8d1",disabledFg:"rgba(255,255,255,0.38)",disabledBg:"rgba(255,255,255,0.07)",chartGrid:"rgba(255,255,255,0.12)",chartText:"rgba(255,255,255,0.7)",track:"rgba(255,255,255,0.1)",shadow1:"0 1px 2px rgba(0,0,0,.4),0 2px 8px rgba(0,0,0,.35)",shadow2:"0 4px 16px rgba(0,0,0,.5)",shadow3:"0 12px 32px rgba(0,0,0,.55)",fontBrand:"Montserrat",inverseSurface:"#01091a",inverseFg:"#ffffff",inverseLink:"#91a8d1",aiAccent:"#21bcff",statusFg:"#94a3b8",statusPrimary:"#60a5fa",statusSuccess:"#34d399",statusWarning:"#fbbf24",statusError:"#f87171",statusInfo:"#38bdf8",chart1:"#154194",chart2:"#91a8d1",chart3:"rgba(255,255,255,0.7)",chart4:"#a4b8dd",chart5:"#fc4c02",chart6:"#bac9e3",chartPositive:"#66bb6a",chartNegative:"#ef5350"},Xi={light:$u,dark:Gu},$v='"Montserrat", system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif',Gv=t=>{let o=Xi[t];return [o.primary,o.p300,o.muted,o.p700]},_v=10,Uv="0.2s ease";var gl=createContext({mode:"light",setting:"light"}),qu=t=>{if(typeof document>"u")return;let o=document.documentElement;o.classList.toggle("orb-dark",t==="dark"),o.dataset.orbMode=t,o.style.colorScheme=t;},ba=({mode:t,defaultMode:o="light",children:r})=>{let a=t??o,[n,i]=useState("light"),[s,c]=useState(false);useEffect(()=>{c(true);let p=window.matchMedia("(prefers-color-scheme: dark)"),f=()=>i(p.matches?"dark":"light");return f(),p.addEventListener("change",f),()=>p.removeEventListener("change",f)},[]);let d=a==="system"?s?n:"light":a;useEffect(()=>{qu(d);},[d]);let m=useMemo(()=>({mode:d,setting:a}),[d,a]);return f(gl.Provider,{value:m,children:r})},ho=()=>useContext(gl).mode,Xu=()=>Xi[ho()];var et=(t,o)=>{let r=Math.min(1,Math.max(0,o)),a=t.trim(),n=d=>d.split("").map(m=>m+m).join(""),i=a.startsWith("#")?a.slice(1):"",s=i.length===3?n(i):i;if(/^[0-9a-fA-F]{6}$/.test(s)){let d=parseInt(s.slice(0,2),16),m=parseInt(s.slice(2,4),16),p=parseInt(s.slice(4,6),16);return `rgba(${d}, ${m}, ${p}, ${r})`}let c=`${Math.round(r*100)}%`;return `color-mix(in oklch, ${t} ${c}, transparent)`};var Io=t=>{let o=t.startsWith("up:")?`(min-width:${t.slice(3)}px)`:t.startsWith("down:")?`(max-width:${t.slice(5)}px)`:t,[r,a]=useState(()=>typeof window>"u"||typeof window.matchMedia!="function"?false:window.matchMedia(o).matches);return useEffect(()=>{if(typeof window.matchMedia!="function")return;let n=window.matchMedia(o),i=()=>a(n.matches);return i(),n.addEventListener("change",i),()=>n.removeEventListener("change",i)},[o]),r};var Qu={accept:57435,activate:57864,activity:57769,add:57432,barChart:57417,calendar:57414,camera:57413,checklist:57952,collapseAll:57988,command:57997,copy:57925,darkMode:58122,decline:57406,delete:57405,dimension:57718,document:57780,down:57827,download:57402,duplicate:57401,edit:57400,email:57399,employee:57398,error:57836,expandAll:57987,factory:57464,favorite:57445,filter:57462,fullScreen:57702,grid:57457,hide:57834,home:57456,information:57993,inventory:57693,ipad:57491,lightMode:58121,lightbulb:57380,lineChart:57740,locked:57683,log:57378,map:57377,menu:57822,message:57884,microphone:57586,move:57832,navigationLeft:57447,navigationRight:57446,overflow:57842,overview:57551,paperPlane:57548,picture:57366,pieChart:57365,play:57499,process:57543,product:57361,pushpin:57503,qrCode:57999,receipt:57541,refresh:57360,save:57498,search:57357,show:57833,shipping:57523,slimDown:57839,slimUp:57840,sort:57853,sound:57895,splitOne:57919,splitTwo:57920,stop:57861,sum:57998,synchronize:57354,table:57530,tableColumn:57983,tableRow:57982,thumbDown:57891,thumbUp:57890,time:57508,translate:57995,tree:57588,trendDown:57931,up:57828,upload:57881,warning:57492,world:57489,wrench:57346},ju=t=>typeof t=="number"?`${t}px`:t,Ju={"2.5":10,3:12,"3.5":14,4:16,5:20,6:24,7:28,8:32,10:40,12:48},em=t=>{if(!t)return;let o=t.match(/(?:^|\s)(?:h|w)-(2\.5|3(?:\.5)?|4|5|6|7|8|10|12)(?:\s|$)/);return o?Ju[o[1]]:void 0},Rt=forwardRef(({name:t,size:o,title:r,className:a,style:n,strokeWidth:i,fill:s,...c},d)=>{let m=c["aria-label"]??r,p=ju(o??em(a)??"1em"),f$1={fontFamily:"SAP-icons",fontSize:p,fontStyle:"normal",fontWeight:"normal",lineHeight:1,width:p,height:p,display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto",WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",...n};return f("span",{ref:d,role:m?"img":void 0,"aria-hidden":m?void 0:true,title:r,className:a,"data-sap-icon":t,style:f$1,...c,children:String.fromCodePoint(Qu[t])})});Rt.displayName="SapIcon";var re=(t,o)=>{let r=forwardRef((a,n)=>f(Rt,{ref:n,name:t,...a}));return r.displayName=o??`SapIcon(${t})`,r};var hl=re("activity","Activity"),bl=re("error","AlertCircle"),vl=re("warning","AlertTriangle"),cy=re("down","ArrowDown"),dy=re("navigationRight","ArrowRight"),py=re("up","ArrowUp"),Yi=re("barChart","BarChart"),uy=re("activate","Bot"),Zi=re("calendar","Calendar"),my=Zi,gy=re("camera","Camera"),fy=re("lineChart","ChartNoAxesCombined"),Wr=re("accept","Check"),en=re("accept","CheckCircle"),Pr=re("slimDown","ChevronDown"),yl=re("navigationLeft","ChevronLeft"),Eo=re("navigationRight","ChevronRight"),hy=re("slimUp","ChevronUp"),by=re("expandAll","ChevronsDown"),vy=re("collapseAll","ChevronsUp"),tn=re("error","CircleAlert"),va=re("accept","CircleCheck"),yy=va,Cy=re("stop","CircleStop"),Cl=re("copy","Clipboard"),xy=re("checklist","ClipboardCheck"),Sy=re("checklist","ClipboardList"),xl=re("time","Clock"),wy=re("tableColumn","Columns3"),on=re("copy","Copy"),ky=re("duplicate","CopyPlus"),Py=re("delete","Delete"),Ty=re("download","Download"),Sl=re("edit","Edit"),Iy=re("fullScreen","Expand"),Ry=re("show","Eye"),My=re("hide","EyeOff"),Dy=re("document","File"),wl=re("document","FileText"),Ay=re("filter","Filter"),ya=re("tree","FolderTree"),kl=re("process","GitBranch"),Ca=re("world","Globe"),Pl=re("grid","Grid"),Ny=re("move","GripVertical"),Ey=re("wrench","Hammer"),Ly=re("picture","Image"),rn=re("information","Info"),Fy=re("translate","Languages"),By=re("dimension","Layers"),Oy=re("home","LayoutDashboard"),an=re("lightbulb","Lightbulb"),Tl=re("lineChart","LineChart"),Il=re("synchronize","Loader2"),nn=re("locked","Lock"),zy=nn,Rl=re("log","LogOut"),Qi=re("email","Mail"),Ml=re("map","MapPin"),Vy=re("menu","Menu"),tm=re("message","MessageCircle"),Hy=tm,sn=re("microphone","Mic"),Wy=re("microphone","MicOff"),Dl=re("darkMode","Moon"),$y=re("overflow","MoreHorizontal"),Gy=re("accept","PackageCheck"),_y=re("product","PackageSearch"),ln=re("splitOne","PanelLeftOpen"),cn=re("splitTwo","PanelRight"),Uy=re("overview","PanelsTopLeft"),Al=re("pieChart","PieChart"),$r=re("pushpin","Pin"),Ky=re("play","Play"),dn=re("add","Plus"),qy=re("qrCode","QrCode"),Xy=re("receipt","ReceiptText"),pn=re("refresh","RefreshCw"),Yy=re("activate","Rocket"),Zy=re("refresh","RotateCcw"),Nl=re("refresh","RotateCw"),Qy=re("tableRow","Rows3"),jy=re("save","Save"),Jy=re("qrCode","ScanLine"),Lo=re("search","Search"),om=re("paperPlane","Send"),El=om,un=re("wrench","Settings"),eC=re("accept","ShieldCheck"),tC=re("sum","Sigma"),oC=re("sort","SortAsc"),rC=re("splitTwo","SquareSplitHorizontal"),aC=re("favorite","Star"),Ll=re("lightMode","Sun"),nC=re("table","Table2"),iC=re("ipad","TabletSmartphone"),ji=re("command","Terminal"),Fl=re("thumbDown","ThumbsDown"),Bl=re("thumbUp","ThumbsUp"),Ol=re("delete","Trash2"),sC=re("tree","TreePine"),zl=re("trendDown","TrendingDown"),mn=re("warning","TriangleAlert"),lC=re("shipping","Truck"),Vl=re("upload","UploadCloud"),Ji=re("employee","User"),Hl=re("sound","Volume2"),cC=re("factory","Warehouse"),dC=re("process","Workflow"),to=re("decline","X"),gn=re("error","XCircle");var am={contained:"primary",outlined:"secondary",text:"ghost"},nm={small:"orb-btn-sm",medium:void 0,large:"orb-btn-lg"},be=forwardRef(({variant:t="primary",size:o="medium",block:r=false,loading:a=false,startIcon:n,endIcon:i,component:s,href:c,sx:d$1,className:m,children:p,disabled:f$1,type:h="button",...u},v)=>{let y=am[t]??t,g$1=["orb-btn",`orb-btn-${y}`,nm[o],r?"orb-btn-block":void 0,a?"orb-is-loading":void 0,m].filter(Boolean).join(" "),C=d(d$1,g$1),b=s??(c?"a":"button");return g(b,{ref:v,type:b==="button"?h:void 0,href:c,className:C.className,style:C.style,disabled:b==="button"?f$1||a:void 0,"aria-disabled":b!=="button"&&(f$1||a)?true:void 0,...u,children:[a&&f("span",{className:`orb-spin ${y==="primary"?"orb-spin-light":""}`,"aria-hidden":true}),!a&&n,p,!a&&i]})});be.displayName="CButton";var Be=forwardRef(({label:t,value:o,defaultValue:r,onChange:a,onFocus:n,onBlur:i,onKeyDown:s,type:c="text",placeholder:d$1,disabled:m,readOnly:p,required:f$1,autoFocus:h,autoComplete:u,name:v,id:y,error:g$1,helperText:C,dense:b=false,size:S,fullWidth:k=true,select:x=false,multiline:E=false,rows:D,children:T,variant:N,margin:R,onClick:w,startAdornment:M,endAdornment:I,InputProps:L,inputProps:O,InputLabelProps:U,SelectProps:z,sx:K,className:W},q)=>{let H=useId(),V=y??`orb-tf-${H}`,Z=M??L?.startAdornment,j=I??L?.endAdornment,ie=(typeof g$1=="string"?g$1:void 0)??C,ye={id:V,className:`orb-inp ${b||S==="small"?"orb-inp-dense":""}`,style:k?void 0:{width:"auto"},value:o,defaultValue:r,onChange:a,onFocus:n,onBlur:i,onKeyDown:s,placeholder:d$1,disabled:m,required:f$1,autoFocus:h,autoComplete:u,name:v,onClick:w,"aria-invalid":!!g$1},Ue=x?f("select",{...ye,ref:q,onChange:a,children:T}):E?f("textarea",{...ye,ref:q,onChange:a,rows:D,readOnly:p||L?.readOnly}):f("input",{...ye,ref:q,onChange:a,type:c,readOnly:p||L?.readOnly,...O}),Oe=d(K,`orb-fld ${g$1?"orb-is-error":""} ${W??""}`,{width:k?"100%":void 0});return g("div",{className:Oe.className,style:Oe.style,children:[t&&f("label",{htmlFor:V,children:t}),Z||j?g("div",{className:"orb-inp-adornment-wrap",children:[Z&&f("span",{className:"orb-inp-adornment",children:Z}),j&&f("span",{className:"orb-inp-adornment orb-inp-adornment-end",children:j}),Ue]}):Ue,ie&&f("span",{className:"orb-fld-msg",children:ie})]})});Be.displayName="CTextField";var xa=forwardRef(({label:t,value:o,defaultValue:r,onChange:a,placeholder:n,disabled:i,readOnly:s,rows:c,minRows:d$1=3,multiline:m,error:p,helperText:f$1,fullWidth:h=true,name:u,id:v,inputProps:y,sx:g$1,className:C},b)=>{let S=useId(),k=v??`orb-ta-${S}`,E=(typeof p=="string"?p:void 0)??f$1,D=d(g$1,`orb-fld ${p?"orb-is-error":""} ${C??""}`,{width:h?"100%":void 0});return g("div",{className:D.className,style:D.style,children:[t&&f("label",{htmlFor:k,children:t}),f("textarea",{ref:b,id:k,className:"orb-inp",value:o,defaultValue:r,onChange:a,placeholder:n,disabled:i,readOnly:s,rows:c??d$1,name:u,"aria-invalid":!!p,...y}),E&&f("span",{className:"orb-fld-msg",children:E})]})});xa.displayName="CTextArea";var _t=forwardRef(({label:t,options:o,children:r,value:a,defaultValue:n,onChange:i,disabled:s,size:c,dense:d$1=true,fullWidth:m=true,minWidth:p,placeholder:f$1,displayEmpty:h,renderValue:u,multiple:v,MenuProps:y,variant:g$1,disableUnderline:C,onClick:b,onMouseDown:S,error:k,helperText:x,name:E,id:D,"aria-label":T,sx:N,className:R},w)=>{let M=useId(),I=D??`orb-sel-${M}`,O=(typeof k=="string"?k:void 0)??x,U=useRef(null),z=useRef(null),[K,W]=useState(false),[q,H]=useState(180),[V,Z]=useState(n??"");useImperativeHandle(w,()=>U.current);let j=useMemo(()=>Children.toArray(r).flatMap(Re=>{if(!isValidElement(Re)||Re.type!=="option")return [];let Ce=Re;return [{value:Array.isArray(Ce.props.value)?Ce.props.value[0]??"":Ce.props.value??"",label:Ce.props.children,disabled:Ce.props.disabled}]}),[r]),me=o??j,ie=a??V,ge=Array.isArray(ie)?ie[0]??"":ie,ye=String(ge??""),Ue=me.find(Re=>String(Re.value)===ye),Oe=u?u(ie):Ue?.label??(ye||(f$1??"")),Ie=d(N,`orb-fld ${k?"orb-is-error":""} ${R??""}`,{width:m?"100%":void 0,minWidth:typeof p=="number"?`${p}px`:p});if(v)return g("div",{className:Ie.className,style:Ie.style,children:[t&&f("label",{htmlFor:I,children:t}),g("select",{ref:w,id:I,className:`orb-inp ${d$1||c==="small"?"orb-inp-dense":""}`,value:a,defaultValue:n,onChange:i,disabled:s,name:E,multiple:true,onClick:b,onMouseDown:S,"aria-invalid":!!k,"aria-label":T,children:[f$1!==void 0&&f("option",{value:"",children:f$1}),o?o.map(Re=>f("option",{value:Re.value,disabled:Re.disabled,children:Re.label},Re.value)):r]}),O&&f("span",{className:"orb-fld-msg",children:O})]});let ze=Re=>{a===void 0&&Z(Re);let Ce=U.current;Ce&&(Object.getOwnPropertyDescriptor(HTMLSelectElement.prototype,"value")?.set?.call(Ce,Re),i?.({target:Ce,currentTarget:Ce}));};return g("div",{className:Ie.className,style:Ie.style,children:[t&&f("label",{htmlFor:I,children:t}),f("select",{ref:U,className:"orb-visually-hidden",tabIndex:-1,"aria-hidden":"true",name:E,value:ye,disabled:s,onChange:()=>{},children:me.map(Re=>f("option",{value:Re.value,disabled:Re.disabled,children:Re.label},String(Re.value)))}),g(Ro.Root,{open:K,onOpenChange:Re=>{Re&&H(z.current?.getBoundingClientRect().width??180),W(Re);},children:[f(Ro.Trigger,{asChild:true,children:g("button",{ref:z,id:I,type:"button",className:`orb-inp orb-select-trigger ${d$1||c==="small"?"orb-inp-dense":""}`,disabled:s,"aria-invalid":!!k,"aria-label":T,"aria-haspopup":"listbox","data-placeholder":!Ue&&!ye?"":void 0,onClick:b,onMouseDown:S,children:[f("span",{className:"orb-select-value",children:Oe}),f(Rt,{className:"orb-select-chevron",name:"slimDown",size:12})]})}),f(Ro.Portal,{children:f(Ro.Content,{className:"orb-pop orb-select-menu",align:"start",sideOffset:5,collisionPadding:8,style:{minWidth:q},children:f(Ro.RadioGroup,{value:ye,onValueChange:ze,children:me.map(Re=>g(Ro.RadioItem,{className:"orb-select-option",value:String(Re.value),disabled:Re.disabled,children:[f("span",{className:"orb-select-check","aria-hidden":"true",children:String(Re.value)===ye?f(Rt,{name:"accept",size:13}):null}),f("span",{children:Re.label})]},String(Re.value)))})})})]}),O&&f("span",{className:"orb-fld-msg",children:O})]})});_t.displayName="CSelect";var Mt=forwardRef(({label:t,checked:o,defaultChecked:r,onChange:a,disabled:n,indeterminate:i,name:s,value:c,id:d$1,size:m,color:p,onClick:f$1,inputProps:h,sx:u,className:v},y)=>{let g$1=d([{...m==="small"?{fontSize:13}:void 0,...p?{color:p}:void 0},...Array.isArray(u)?u:u?[u]:[]],`orb-chk ${v??""}`),C=f("input",{ref:b=>{b&&(b.indeterminate=!!i),typeof y=="function"?y(b):y&&(y.current=b);},type:"checkbox",id:d$1,checked:o,defaultChecked:r,onChange:a,readOnly:o!==void 0&&a===void 0,disabled:n,name:s,value:c,onClick:f$1,...h});return t==null?f("span",{className:g$1.className,style:g$1.style,children:C}):g("label",{className:g$1.className,style:g$1.style,children:[C,f("span",{children:t})]})});Mt.displayName="CCheckbox";var vm=({label:t,options:o,value:r,defaultValue:a,onChange:n,name:i,row:s=false,disabled:c,sx:d,className:m})=>{let p=useId(),f$1=i??`orb-rdo-${p}`;return g("div",{className:`orb-fld ${m??""}`,style:d,role:"radiogroup",children:[t&&f("span",{className:"orb-fld-label",children:t}),f("div",{style:{display:"flex",flexDirection:s?"row":"column",gap:s?24:8,flexWrap:"wrap"},children:o.map(h=>g("label",{className:"orb-rdo",children:[f("input",{type:"radio",name:f$1,value:h.value,checked:r!==void 0?r===h.value:void 0,defaultChecked:a!==void 0?a===h.value:void 0,onChange:n?u=>n(u,h.value):void 0,disabled:c||h.disabled}),f("span",{children:h.label})]},h.value))})]})};var fn=forwardRef(({label:t,checked:o,defaultChecked:r,onChange:a,disabled:n,name:i,id:s,size:c,sx:d$1,className:m},p)=>{let f$1=d([{...c==="small"?{transform:"scale(.86)",transformOrigin:"center"}:void 0},...Array.isArray(d$1)?d$1:d$1?[d$1]:[]],`orb-sw ${m??""}`),h=f("input",{ref:p,type:"checkbox",role:"switch",id:s,checked:o,defaultChecked:r,onChange:a?u=>a(u,u.target.checked):void 0,disabled:n,name:i});return t==null?f("span",{className:f$1.className,style:f$1.style,children:h}):g("label",{className:f$1.className,style:f$1.style,children:[h,f("span",{children:t})]})});fn.displayName="CSwitch";var xm={default:"gray",primary:"blue",success:"blue",info:"blue",warning:"orange",error:"orange"},kt=forwardRef(({label:t,children:o,tone:r,color:a="default",variant:n,size:i="medium",clickable:s,avatar:c,icon:d$1,onDelete:m,onClick:p,sx:f$1,className:h},u)=>{let v=r??(n==="outlined"&&a==="default"?"outline":xm[a]??"gray"),y=s??!!p,g$1=d([{cursor:y?"pointer":void 0,...i==="small"?{height:24,fontSize:11,px:1}:void 0},...Array.isArray(f$1)?f$1:f$1?[f$1]:[]],`orb-chip orb-chip-${v} ${h??""}`);return g("span",{ref:u,className:g$1.className,style:g$1.style,onClick:p,role:y?"button":void 0,tabIndex:y?0:void 0,onKeyDown:y?C=>{(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),p?.(C));}:void 0,children:[c??d$1,f("span",{className:"orb-chip-label",children:o??t}),m&&f("button",{type:"button","aria-label":"Remove",onClick:C=>{C.stopPropagation(),m(C);},style:{background:"none",border:"none",padding:0,display:"inline-flex",cursor:"pointer",color:"inherit"},children:f(to,{size:13,strokeWidth:2})})]})});kt.displayName="CChip";var hn=forwardRef(({badgeContent:t,color:o="primary",children:r,invisible:a=false,sx:n,className:i},s)=>{let c=d(n,i,{display:"inline-flex",position:r?"relative":void 0}),d$1=!a&&t!==void 0&&t!==null&&f("span",{className:`orb-badge ${o==="error"?"orb-badge-err":o==="muted"?"orb-badge-muted":""}`,style:r?{position:"absolute",top:-6,right:-6,zIndex:1}:void 0,children:t});return r?g("span",{ref:s,className:c.className,style:c.style,children:[r,d$1]}):f("span",{ref:s,className:c.className,style:c.style,children:d$1})});hn.displayName="CBadge";var Gr=forwardRef(({children:t,src:o,alt:r,size:a=28,sx:n,className:i},s)=>{let c=d([{width:a,height:a,fontSize:a*.4},...Array.isArray(n)?n:n?[n]:[]],`orb-avatar ${i??""}`);return f("span",{ref:s,className:c.className,style:c.style,children:o?f("img",{src:o,alt:r??"",style:{width:"100%",height:"100%",borderRadius:"50%",objectFit:"cover"}}):t})});Gr.displayName="CAvatar";var _r=forwardRef(({severity:t="info",title:o,children:r,onClose:a,sx:n,className:i},s)=>{let c=d(n,`orb-alert orb-alert-${t} ${i??""}`);return g("div",{ref:s,role:"alert",className:c.className,style:c.style,children:[g("div",{style:{flex:1,minWidth:0},children:[o&&f("b",{children:o}),r&&f("span",{children:r})]}),a&&f("button",{type:"button","aria-label":"Close",onClick:a,style:{background:"none",border:"none",padding:0,cursor:"pointer",color:"inherit",font:"500 14px/1 var(--orb-font)",opacity:.7},children:"\u2715"})]})});_r.displayName="CAlert";var Sa=({value:t,variant:o,color:r,sx:a,className:n})=>{let i=o==="indeterminate"||t===void 0,s=d(a,`orb-prog ${n??""}`);return g("div",{className:s.className,role:"progressbar","aria-valuenow":i?void 0:Math.round(t),"aria-valuemin":i?void 0:0,"aria-valuemax":i?void 0:100,style:s.style,children:[f("i",{style:i?{width:"40%",animation:"orb-prog-ind 1.2s ease-in-out infinite"}:{width:`${Math.min(100,Math.max(0,t))}%`,background:r}}),i&&f("style",{children:"@keyframes orb-prog-ind { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }"})]})},Pm=({width:t,height:o=14,variant:r="rectangular",sx:a,className:n})=>f("div",{className:`orb-skel ${n??""}`,style:{width:t,height:o,borderRadius:r==="circular"?"50%":r==="text"?6:"var(--orb-r)",...a}}),$o=({size:t=12,onPrimary:o=false,sx:r,className:a})=>f("span",{className:`orb-spin ${o?"orb-spin-light":""} ${a??""}`,style:{width:t,height:t,...r},role:"status","aria-label":"Loading"});var nt=({title:t,children:o,enterDelay:r=300,side:a="top",align:n="center",disabled:i})=>!t||i?f(e,{children:o}):f(Go.Provider,{delayDuration:r,skipDelayDuration:200,children:g(Go.Root,{children:[f(Go.Trigger,{asChild:true,children:o}),f(Go.Portal,{children:f(Go.Content,{className:"orb-tooltip",side:a,align:n,sideOffset:6,children:t})})]})});var ae=forwardRef(({tooltip:t,size:o="small",active:r=false,edge:a,color:n,sx:i,className:s,children:c,type:d$1="button",...m},p)=>{let f$1=d([{color:r?"var(--orb-primary)":n,...a==="start"?{marginLeft:-8}:a==="end"?{marginRight:-8}:void 0},...Array.isArray(i)?i:i?[i]:[]],`orb-icon-btn ${o==="small"?"orb-icon-btn-sm":""} ${s??""}`),h=f("button",{ref:p,type:d$1,className:f$1.className,style:f$1.style,...m,children:c});return t?f(nt,{title:t,children:h}):h});ae.displayName="CIconButton";var wa=({value:t,options:o,onValueChange:r,size:a="medium",sx:n,className:i,...s})=>{let c=useRef([]),d$1=o.findIndex(u=>!u.disabled),m=o.findIndex(u=>u.value===t),p=(u,v)=>{let y=o.map((b,S)=>b.disabled?-1:S).filter(b=>b>=0);if(y.length===0)return;let g=y.indexOf(v),C;u.key==="Home"&&(C=y[0]),u.key==="End"&&(C=y[y.length-1]),(u.key==="ArrowRight"||u.key==="ArrowDown")&&(C=y[(g+1+y.length)%y.length]),(u.key==="ArrowLeft"||u.key==="ArrowUp")&&(C=y[(g-1+y.length)%y.length]),C!==void 0&&(u.preventDefault(),c.current[C]?.focus(),r(o[C].value));},f$1=d(n,["orb-segmented-control",a==="small"?"orb-segmented-control-sm":"",i].filter(Boolean).join(" ")),h={...f$1.style,"--orb-segmented-count":Math.max(o.length,1),"--orb-segmented-index":Math.max(m,0)};return g("div",{role:"radiogroup",className:f$1.className,style:h,"data-has-selection":m>=0?"true":"false",...s,children:[f("span",{className:"orb-segmented-control-thumb","aria-hidden":"true"}),o.map((u,v)=>{let y=u.value===t;return f(ae,{ref:g=>{c.current[v]=g;},className:["orb-segmented-control-item",u.icon?"":"orb-segmented-control-item-label"].filter(Boolean).join(" "),size:a,tooltip:u.label,role:"radio","aria-label":u.label,"aria-checked":y,"data-selected":y?"true":void 0,disabled:u.disabled,tabIndex:y||t==null&&v===d$1?0:-1,onClick:()=>r(u.value),onKeyDown:g=>p(g,v),children:u.icon??f("span",{className:"orb-segmented-control-label",children:u.label})},u.value)})]})};var qt=({triggerLabel:t,items:o=[],trigger:r,align:a="start",anchorEl:n,open:i,onClose:s,children:c,slotProps:d$1,PaperProps:m,anchorPosition:p,sx:f$1})=>{let h=useRef(null);if(useEffect(()=>{if(i!==true)return;let u=y=>{let g=y.composedPath();h.current&&g.includes(h.current)||n&&g.includes(n)||s?.();},v=y=>{y.key==="Escape"&&s?.();};return document.addEventListener("pointerdown",u,true),document.addEventListener("keydown",v,true),()=>{document.removeEventListener("pointerdown",u,true),document.removeEventListener("keydown",v,true);}},[n,s,i]),i!==void 0){if(!i||typeof document>"u")return null;let u=n?.getBoundingClientRect(),v=window.innerWidth,y=u?.left??16,g=u?.right??y,C=d$1?.paper?.sx??m?.sx,b=d([...Array.isArray(C)?C:C?[C]:[],...Array.isArray(f$1)?f$1:f$1?[f$1]:[]],"orb-pop orb-menu",d$1?.paper?.style??m?.style),S=Children.map(c,k=>{if(!isValidElement(k)||k.type!=="option")return k;let x=k.props,{children:E,disabled:D,selected:T}=x,N=d(x.sx,`orb-menu-item ${T?"orb-selected":""} ${x.className??""}`,x.style);return f("div",{role:"menuitem","aria-disabled":D||void 0,"aria-selected":T||void 0,tabIndex:D?-1:0,id:x.id,title:x.title,className:N.className,style:N.style,onClick:D?void 0:x.onClick,onKeyDown:R=>{!D&&(R.key==="Enter"||R.key===" ")&&(R.preventDefault(),x.onClick?.(R));},children:E})});return createPortal(f("div",{ref:h,role:"menu",className:b.className,style:{...b.style,position:"fixed",left:a==="end"&&!p?void 0:p?.left??y,right:a==="end"&&!p?Math.max(16,v-g):void 0,top:p?.top??(u?.bottom??16)+6,maxWidth:"calc(100vw - 32px)",zIndex:1301},children:S}),document.body)}return g(Ro.Root,{children:[f(Ro.Trigger,{asChild:true,children:r??f(be,{variant:"primary",children:t})}),f(Ro.Portal,{children:f(Ro.Content,{className:"orb-pop orb-menu",align:a,sideOffset:6,children:o.map((u,v)=>g(Ro.Item,{className:"orb-menu-item",disabled:u.disabled,onSelect:()=>u.onClick?.(),children:[u.icon,u.label]},v))})})]})};var Ae=forwardRef(({elevation:t=1,variant:o,component:r,sx:a,style:n,className:i,children:s,...c},d$1)=>{let m=r??"div",p=d(a,`orb-card ${t>0&&o!=="outlined"?"orb-card-raised":""} ${i??""}`,n);return f(m,{ref:d$1,className:p.className,style:p.style,...c,children:s})});Ae.displayName="CPaper";var At=forwardRef(({orientation:t="horizontal",flexItem:o,sx:r,className:a},n)=>{let i=d([{...t==="vertical"?{alignSelf:"stretch",height:"auto"}:{width:"100%"},...o?{alignSelf:"stretch"}:void 0},...Array.isArray(r)?r:r?[r]:[]],`${t==="vertical"?"orb-divider-v":"orb-divider"} ${a??""}`);return f("hr",{ref:n,"aria-orientation":t,className:i.className,style:i.style})});At.displayName="CDivider";var Bm={h1:"orb-h1",h2:"orb-h2",h3:"orb-h3",h4:"orb-h3",h5:"orb-subtitle",h6:"orb-subtitle",subtitle1:"orb-subtitle",subtitle2:"orb-label",body1:"orb-body",body2:"orb-body-dense",label:"orb-label",caption:"orb-meta",overline:"orb-overline"},Om={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6"},A=forwardRef(({variant:t="body1",component:o,muted:r=false,numeric:a=false,color:n,noWrap:i=false,fontWeight:s,sx:c,className:d$1,children:m,...p},f$1)=>{let h=o??Om[t]??"span",v=[t==="inherit"?void 0:Bm[t],d$1].filter(Boolean).join(" "),y=d([{...r?{color:"var(--orb-muted)"}:void 0,...n?{color:n}:void 0,...a?{fontVariantNumeric:"tabular-nums"}:void 0,...s?{fontWeight:s}:void 0,...i?{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}:void 0},...Array.isArray(c)?c:c?[c]:[]],v);return f(h,{ref:f$1,className:y.className,style:y.style,...p,children:m})});A.displayName="CTypography";var Vm=t=>{if(t!==void 0)return typeof t=="number"?`${t*8}px`:t},ne=forwardRef(({direction:t="column",spacing:o,alignItems:r,justifyContent:a,flexWrap:n,flex:i,useFlexGap:s,sx:c,className:d$1,children:m,...p},f$1)=>{let h=d([{display:"flex",flexDirection:t,gap:Vm(o),alignItems:r,justifyContent:a,flexWrap:n,flex:i},...Array.isArray(c)?c:c?[c]:[]],d$1);return f("div",{ref:f$1,className:h.className,style:h.style,...p,children:m})});ne.displayName="CStack";var zt=({open:t,onClose:o,title:r,children:a,actions:n,maxWidth:i=560,fullWidth:s=false,fullScreen:c=false,PaperProps:d$1,slotProps:m,disableRestoreFocus:p,keepMounted:f$1,hideCloseButton:h=false,sx:u,className:v})=>{let y=d([{width:c?"100vw":s?"min(920px, calc(100vw - 32px))":void 0,height:c?"100vh":void 0,maxWidth:c?"none":typeof i=="number"?`${i}px`:i},...Array.isArray(d$1?.sx??m?.paper?.sx)?d$1?.sx??m?.paper?.sx:d$1?.sx??m?.paper?.sx?[d$1?.sx??m?.paper?.sx]:[],...Array.isArray(u)?u:u?[u]:[]],`orb-dialog ${v??""}`);return f(Co.Root,{open:t,onOpenChange:g=>{g||o?.();},children:g(Co.Portal,{children:[f(Co.Overlay,{className:"orb-overlay"}),g(Co.Content,{className:y.className,style:y.style,children:[(r||!h)&&g("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:16},children:[r?f(Co.Title,{className:"orb-dialog-title",children:r}):f(Co.Title,{className:"orb-visually-hidden",children:"Dialog"}),!h&&f(Co.Close,{asChild:true,children:f("button",{type:"button",className:"orb-icon-btn orb-icon-btn-sm","aria-label":"Close",style:{marginTop:-4,marginRight:-4},children:f(to,{size:16,strokeWidth:2})})})]}),f("div",{style:{minWidth:0},children:a}),n&&f("div",{className:"orb-dialog-actions",children:n})]})]})})};var ts=({open:t,defaultOpen:o,onOpenChange:r,trigger:a,children:n,align:i="start",side:s="bottom",sideOffset:c=6,matchTriggerWidth:d=false,sx:m,className:p})=>g(sr.Root,{open:t,defaultOpen:o,onOpenChange:r,children:[f(sr.Trigger,{asChild:true,children:a}),f(sr.Portal,{children:f(sr.Content,{className:`orb-pop ${p??""}`,align:i,side:s,sideOffset:c,style:{minWidth:d?"var(--radix-popover-trigger-width)":void 0,...m},onOpenAutoFocus:f=>f.preventDefault(),children:n})})]});var $m=({items:t,value:o,defaultValue:r,onChange:a,sx:n,className:i})=>{let s=o!==void 0,[c,d]=useState(r??t[0]?.value),m=s?o:c,p=useRef([]),f$1=u=>{s||d(u),a?.(u);},h=u=>{if(u.key!=="ArrowRight"&&u.key!=="ArrowLeft")return;u.preventDefault();let v=t.filter(b=>!b.disabled),y=v.findIndex(b=>b.value===m),g=u.key==="ArrowRight"?1:-1,C=v[(y+g+v.length)%v.length];if(C){f$1(C.value);let b=t.findIndex(S=>S.value===C.value);p.current[b]?.focus();}};return f("div",{className:`orb-tabs ${i??""}`,role:"tablist",style:n,onKeyDown:h,children:t.map((u,v)=>{let y=u.value===m;return g("button",{ref:g=>{p.current[v]=g;},type:"button",role:"tab","aria-selected":y,disabled:u.disabled,className:`orb-tab ${y?"orb-is-active":""}`,style:{display:"inline-flex",alignItems:"center",gap:6},onClick:()=>f$1(u.value),children:[u.icon,u.label]},u.value)})})};var _m=["su","mo","tu","we","th","fr","sa"],ka=(t,o)=>!!(t&&o&&t.isSame(o,"day")),Pa=({value:t,rangeStart:o,rangeEnd:r,onChange:a,month:n,defaultMonth:i,onMonthChange:s,minDate:c,maxDate:d,locale:m,renderDay:p})=>{let f$1=n!==void 0,[h,u]=useState(()=>i??t??o??Zo()),v=(f$1?n:h).startOf("month"),y=x=>{f$1||u(x),s?.(x);},g$1=useMemo(()=>m?v.locale(m):v,[v,m]),C=useMemo(()=>{let E=v.startOf("month").startOf("week"),D=[],T=E;for(let N=0;N<6;N+=1){let R=[];for(let w=0;w<7;w+=1)R.push(T),T=T.add(1,"day");if(D.push(R),T.isAfter(v.endOf("month"))&&N>=3)break}return D},[v]),b=useMemo(()=>{let x=m?Zo().locale(m):Zo();return _m.map((E,D)=>x.startOf("week").add(D,"day").format("dd"))},[m]),S=x=>!!(c&&x.isBefore(c.startOf("day"))||d&&x.isAfter(d.startOf("day"))),k=o!==void 0||r!==void 0;return g("div",{className:"orb-cal",children:[g("div",{className:"orb-cal-head",children:[f("button",{type:"button",className:"orb-icon-btn orb-icon-btn-sm","aria-label":"Previous month",onClick:()=>y(v.subtract(1,"month")),children:f(yl,{size:16,strokeWidth:2})}),f("span",{className:"orb-cal-title","aria-live":"polite",children:g$1.format("MMMM YYYY")}),f("button",{type:"button",className:"orb-icon-btn orb-icon-btn-sm","aria-label":"Next month",onClick:()=>y(v.add(1,"month")),children:f(Eo,{size:16,strokeWidth:2})})]}),g("div",{className:"orb-cal-grid",role:"grid",children:[b.map((x,E)=>f("span",{className:"orb-cal-dow",children:x},`${x}-${E}`)),C.flat().map(x=>{let E=!x.isSame(v,"month"),D=S(x),T=k?ka(x,o)||ka(x,r):ka(x,t),N=x.isSame(Zo(),"day"),R=k&&o&&r&&x.isAfter(o.startOf("day"))&&x.isBefore(r.startOf("day")),w=k&&ka(x,o)&&!!r,M=k&&ka(x,r)&&!!o,I=["orb-cal-day",E?"orb-is-outside":void 0,N?"orb-is-today":void 0,T?"orb-is-selected":void 0,R?"orb-is-in-range":void 0,w?"orb-is-range-start":void 0,M?"orb-is-range-end":void 0].filter(Boolean).join(" ");return p?f("span",{className:"orb-cal-day-slot",children:p(x,{outsideCurrentMonth:E,selected:T,today:N,disabled:D})},x.format("YYYY-MM-DD")):f("button",{type:"button",role:"gridcell","aria-selected":T,"aria-current":N?"date":void 0,className:I,disabled:D,onClick:()=>a?.(x),children:x.date()},x.format("YYYY-MM-DD"))})]})]})};Zo.extend(Um);var Km=({label:t,value:o,defaultValue:r,onChange:a,minDate:n,maxDate:i,disabled:s,format:c="YYYY-MM-DD",placeholder:d,locale:m,dense:p=false,error:f$1,helperText:h,sx:u,className:v})=>{let y=o!==void 0,[g$1,C]=useState(r??null),b=y?o:g$1,[S,k]=useState(false),[x,E]=useState(null),D=M=>{y||C(M),a?.(M);},T=x??(b?(m?b.locale(m):b).format(c):""),N=()=>{if(x===null)return;let M=x.trim();if(!M)D(null);else {let I=Zo(M,c,true);I.isValid()&&!(n&&I.isBefore(n.startOf("day")))&&!(i&&I.isAfter(i.startOf("day")))&&D(I);}E(null);},w=(typeof f$1=="string"?f$1:void 0)??h;return g("div",{className:`orb-fld ${f$1?"orb-is-error":""} ${v??""}`,style:u,children:[t&&f("label",{children:t}),f(ts,{open:S,onOpenChange:k,trigger:g("div",{className:"orb-inp-adornment-wrap",style:{width:"100%"},children:[f("span",{className:"orb-inp-adornment",children:f(Zi,{size:15,strokeWidth:1.8})}),f("input",{className:`orb-inp ${p?"orb-inp-dense":""}`,value:T,placeholder:d??c,disabled:s,onFocus:()=>k(true),onChange:M=>E(M.target.value),onBlur:N,onKeyDown:M=>{M.key==="Enter"&&(N(),k(false)),M.key==="Escape"&&k(false);}})]}),children:f(Pa,{value:b,onChange:M=>{D(M),E(null),k(false);},minDate:n,maxDate:i,locale:m,defaultMonth:b??void 0})}),w&&f("span",{className:"orb-fld-msg",children:w})]})};var Xm=({onFilesSelected:t,multiple:o=false,accept:r="*",maxSize:a,title:n="Drag and drop files here or click to upload",subtitle:i="Support for bulk upload",sx:s})=>{let[c,d]=useState(false),[m,p]=useState([]),f$1=useRef(null),h=b=>{b.preventDefault(),d(true);},u=b=>{b.preventDefault(),d(false);},v=b=>{b.preventDefault(),d(false),g$1(Array.from(b.dataTransfer.files));},y=b=>{b.target.files&&g$1(Array.from(b.target.files));},g$1=b=>{let S=a?b.filter(x=>x.size<=a):b;S.length<b.length&&console.warn(`Some files were rejected because they exceed the maximum size of ${a} bytes.`);let k=o?[...m,...S]:S;o&&(k=k.filter((x,E,D)=>E===D.findIndex(T=>T.name===x.name&&T.size===x.size&&T.lastModified===x.lastModified))),p(k),t?.(k),f$1.current&&(f$1.current.value="");},C=b=>{let S=m.filter((k,x)=>x!==b);p(S),t?.(S);};return g("div",{style:{width:"100%",...s},children:[g("div",{onClick:()=>f$1.current?.click(),onDragOver:h,onDragLeave:u,onDrop:v,role:"button",tabIndex:0,onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),f$1.current?.click());},style:{border:`2px dashed ${c?"var(--orb-primary)":"var(--orb-border)"}`,borderRadius:"var(--orb-r)",padding:32,textAlign:"center",cursor:"pointer",backgroundColor:c?"var(--orb-hover)":"var(--orb-canvas)",transition:"border-color var(--orb-t-fast), background-color var(--orb-t-fast)"},children:[f("input",{type:"file",ref:f$1,style:{display:"none"},multiple:o,accept:r,onChange:y}),g("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"center"},children:[f(Vl,{size:40,strokeWidth:1.5,color:c?"var(--orb-primary)":"var(--orb-muted)"}),f("span",{className:"orb-subtitle",children:n}),f("span",{className:"orb-meta",children:i})]})]}),m.length>0&&f("div",{style:{display:"flex",flexDirection:"column",gap:8,marginTop:16},children:m.map((b,S)=>g("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",border:"1px solid var(--orb-border)",borderRadius:"var(--orb-r)",backgroundColor:"var(--orb-surface)"},children:[g("div",{style:{display:"flex",alignItems:"center",gap:8,overflow:"hidden"},children:[f(wl,{size:16,strokeWidth:1.8,color:"var(--orb-muted)"}),f("span",{className:"orb-body-dense",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:b.name}),g("span",{className:"orb-meta",children:["(",(b.size/1024).toFixed(1)," KB)"]})]}),f(ae,{"aria-label":`Remove ${b.name}`,onClick:()=>C(S),children:f(Ol,{size:15,strokeWidth:1.8})})]},`${b.name}-${S}`))})]})};function uo(...t){return twMerge(clsx(t))}var vn={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"},Ta={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",full:"rounded-full"},_l=()=>"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 Jm=cva(_l(),{variants:{variant:{default:`${vn.primary} shadow-sm`,destructive:"bg-[var(--orb-status-error)] text-[var(--orb-on-primary)] hover:opacity-90 active:opacity-80 shadow-sm",outline:`${vn.outline} shadow-sm`,secondary:"bg-[var(--orb-surface-2)] text-[var(--orb-fg)] hover:bg-[var(--orb-hover)] active:bg-[var(--orb-selected)] shadow-sm",ghost:vn.ghost,link:"text-[var(--orb-status-primary)] underline-offset-4 hover:underline hover:text-[var(--orb-status-primary)] active:text-[var(--orb-p700)]","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-[var(--orb-primary)] hover:bg-[var(--orb-p600)] text-[var(--orb-on-primary)] 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-[var(--orb-status-error)] hover:opacity-90 border border-[var(--orbai-border-strong)] shadow-[var(--orbai-shadow-soft-sm)] hover:shadow-[var(--orbai-shadow-soft-md)] active:scale-95 text-[var(--orb-on-primary)] 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:Ta.none,sm:Ta.sm,md:Ta.md,full:Ta.full}},defaultVariants:{variant:"default",size:"default",rounded:"md"}}),as=Yt.forwardRef(({className:t,variant:o,size:r,asChild:a=false,...n},i)=>f(a?Slot:"button",{className:uo(Jm({variant:o,size:r,className:t})),ref:i,...n}));as.displayName="Button";var eg={"common.cancel":"Cancel","common.save":"Save","common.ok":"OK","common.done":"Done","common.search":"Search","common.none":"None","common.all":"All","common.noData":"No data","common.copy":"Copy","common.delete":"Delete","common.loading":"Loading...","header.searchPlaceholder":"Ask me...","header.searchAddFeature":"Add feature","header.searchSend":"Send","header.searchStartVoice":"Start voice input","header.searchStopVoice":"Stop voice input","header.theme.system":"Theme: System","header.theme.dark":"Theme: Dark","header.theme.light":"Theme: Light","header.menu.setting":"Setting","header.menu.refresh":"Refresh","header.menu.logout":"Logout","navigation.expand":"Expand navigation","navigation.collapse":"Collapse navigation","navigation.searchPlaceholder":"Search menu...","navigation.noMatch":"No matching menu items","navigation.noAccessibleApp":"No accessible applications","navigation.noItems":"No items to display","navigation.expandView":"Expand {title}","navigation.mode.switchToFixed":"Switch to fixed navigation","navigation.mode.switchToFloating":"Switch to floating navigation","navigation.pinned":"Pinned","navigation.pin.add":"Pin to top","navigation.pin.remove":"Unpin","table.toolbar.searchPlaceholder":"Search...","table.title.default":"Data Table","table.toolbar.groupBy":"Group By","table.toolbar.summary":"Summary","table.toolbar.columns":"Columns","table.toolbar.export":"Export","table.toolbar.itemsPerPage":"Items per page:","table.toolbar.pageOf":"Page {current} of {total}","table.toolbar.newItem":"New Item","table.toolbar.editItem":"Edit Item","table.toolbar.deleteItem":"Delete Item","table.toolbar.graphicReport":"Graphic Report","table.toolbar.saveLayout":"Save Layout","table.menu.groupBy":"Group By","table.menu.clearAll":"Clear All","table.menu.visibleColumns":"Visible Columns","table.menu.showSummaryRow":"Show Summary Row","table.menu.noNumericColumns":"No numeric columns","table.group.expandAll":"Expand All Groups","table.group.collapseAll":"Collapse All Groups","table.mobile.notImplemented":"Mobile View Not Implemented","table.headerMenu.sortAsc":"Sort Ascending","table.headerMenu.sortDesc":"Sort Descending","table.headerMenu.clearSort":"Clear Sort","table.headerMenu.configureSort":"Configure Sort...","table.headerMenu.group":"Group by this column","table.headerMenu.ungroup":"Remove from grouping","table.headerMenu.addSummary":"Include in Summary","table.headerMenu.removeSummary":"Remove from Summary","table.headerMenu.hideColumn":"Hide Column","table.sortDialog.title":"Sort Settings","table.sortDialog.empty":"No sort rules. Add one to start ordering rows.","table.sortDialog.addRule":"Add Sort Rule","table.sortDialog.clearAll":"Clear All","table.sortDialog.asc":"Ascending","table.sortDialog.desc":"Descending","pivot.title.default":"Pivot Table Builder","pivot.subtitle.default":"Drag fields to configure the pivot table.","pivot.empty":"Drag at least one field into Values to render the pivot result.","pivot.records":"Records","pivot.afterFilter":"After filter","pivot.grandTotal":"Grand Total","pivot.resultLabel":"Result","pivot.valueLabel":"Value","pivot.table.dimensions":"Dimensions","pivot.config.title":"Configuration","pivot.fieldList":"Field List","pivot.availableDimensions":"Available dimensions","pivot.allFieldsInUse":"All fields are in use.","pivot.zone.rows":"Rows","pivot.zone.columns":"Columns","pivot.zone.filters":"Filters","pivot.zone.values":"Values","pivot.hint.rows":"Drag fields here to build row hierarchy","pivot.hint.columns":"Drag fields here to build column hierarchy","pivot.hint.filters":"Drag fields here for report filters","pivot.hint.values":"Drag numeric fields here for aggregation","pivot.clearArea":"Clear area","pivot.filter.na":"N/A","pivot.filter.noValues":"No values","pivot.filter.noneSelected":"None selected","pivot.filter.allValues":"All values","pivot.filter.selectedCount":"{selected} / {total} selected","pivot.filter.selectAll":"Select All","pivot.filter.deselectAll":"Deselect All","pivot.filter.noResults":"No results","pivot.collapse.ariaExpand":"Expand configuration area","pivot.collapse.ariaCollapse":"Collapse configuration area","pivot.agg.sum":"Sum","pivot.agg.count":"Count","pivot.agg.avg":"Average","pivot.agg.min":"Min","pivot.agg.max":"Max","pivot.preset.selectPlaceholder":"Select preset","pivot.preset.save":"Save preset","pivot.preset.delete":"Delete preset","pivot.preset.saveDialogTitle":"Save current preset","pivot.preset.nameLabel":"Preset name","pivot.preset.defaultName":"Preset {index}","pivot.table.sectionTitle":"Pivot Result","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"Expand pivot result","pivot.table.collapse.ariaCollapse":"Collapse pivot result","pivot.chart.title":"Pivot Chart","pivot.chart.subtitle":"Map one dimension and up to two measures into a compact chart.","pivot.chart.subtitleReady":"{dimension} by {measure}","pivot.chart.emptyNoDimension":"Add at least one row or column field to render the chart.","pivot.chart.emptyNoValue":"Add at least one value field to render the chart.","pivot.chart.emptyNoData":"No data available for the current chart selection.","pivot.chart.dimension":"Dimension","pivot.chart.primaryMeasure":"Measure","pivot.chart.secondaryMeasure":"Compare measure","pivot.chart.chartType":"Chart type","pivot.chart.style.barVertical":"Vertical bars","pivot.chart.style.barHorizontal":"Horizontal bars","pivot.chart.style.line":"Line","pivot.chart.style.scatter":"Scatter","pivot.chart.collapse.ariaExpand":"Expand chart area","pivot.chart.collapse.ariaCollapse":"Collapse chart area","smartFilter.adaptFilters":"Adapt Filters","smartFilter.addFilters":"Add Filters","smartFilter.go":"Go","smartFilter.visibleFilters":"Visible Filters","smartFilter.searchPlaceholder":"Search...","smartFilter.noOptionsFound":"No options found","smartFilter.min":"Min","smartFilter.max":"Max","smartFilter.minMaxPlaceholder":"Min - Max","smartFilter.operator.equals":"Equals","smartFilter.operator.contains":"Contains","smartFilter.operator.notContains":"Does Not Contain","smartFilter.operator.wildcard":"Wildcard Search","smartFilter.operator.notEquals":"Not Equals","smartFilter.operator.greaterThan":"Greater Than","smartFilter.operator.lessThan":"Less Than","smartFilter.operator.greaterOrEqual":"Greater Than or Equal","smartFilter.operator.lessOrEqual":"Less Than or Equal","smartFilter.operator.between":"Between","variant.noOptions":"No options","variant.defaultSuffix":"Default","variant.selectVariant":"Select Variant","variant.saveView":"Save View","variant.newVariant":"New Variant","variant.viewName":"View Name","variant.setDefault":"Set as Default","variant.publicAllUsers":"Public (All Users)","variant.toast.fetchFailed":"Failed to load variants","variant.toast.saveFailed":"Failed to save variant","variant.toast.saveSuccess":"Variant saved successfully","variant.toast.deleteFailed":"Failed to delete variant","variant.toast.deleteSuccess":"Variant deleted successfully","variant.toast.defaultFailed":"Failed to update default variant","variant.toast.defaultSuccess":"Default variant updated","layout.saveLayout":"Save Layout","layout.layoutOptions":"Layout Options","layout.selectLayout":"Select Layout","layout.saveCurrentLayout":"Save Current Layout...","layout.noSavedLayouts":"No saved layouts","layout.removeDefault":"Remove Default","layout.setAsDefault":"Set as Default","layout.layoutName":"Layout Name","layout.layoutDescription":"Description","layout.layoutNameHelper":"e.g., 'Compact View'","layout.warningOverwrite":"Warning: Existing layout will be overwritten","layout.useAsDefault":"Use as Default Layout","layout.publicAllUsers":"Public (Visible to all users)","layout.toast.loadFallback":"Failed to load layouts from backend, fallback to local storage","layout.toast.saveSuccess":"Layout saved successfully","layout.toast.saveLocalSuccess":"Layout saved to local storage","layout.toast.backendUnavailableSavedLocal":"Backend unavailable, saved to local storage","layout.toast.deleteSuccess":"Layout deleted successfully","layout.toast.deleteLocalSuccess":"Layout deleted from local storage","layout.toast.backendUnavailableDeletedLocal":"Backend unavailable, deleted from local storage","layout.toast.defaultSuccess":"Default layout set","layout.toast.defaultLocalSuccess":"Default layout set in local storage","layout.toast.backendUnavailableDefaultLocal":"Backend unavailable, default saved to local storage","dateRange.label":"Date Range","dateRange.startDate":"Start Date","dateRange.endDate":"End Date","dateRange.select":"Select...","dateRange.today":"Today","dateRange.thisWeek":"This Week","dateRange.thisMonth":"This Month","graph.records":"{count} records","graph.kpi.totalRecords":"Total Records","graph.kpi.totalReport":"Total Report","graph.kpi.totalBillable":"Total Billable","graph.kpi.efficiency":"Efficiency","graph.kpi.amount":"Amount","graph.kpi.flagged":"Flagged","graph.chart.billable.title":"Billable by Dimension","graph.chart.billable.subtitle":"Top values by billable hours","graph.chart.efficiency.title":"Efficiency by Person","graph.chart.efficiency.subtitle":"Lowest efficiency first","graph.chart.status.title":"Status Distribution","graph.chart.status.subtitle":"Record ratio by status","graph.dataBody":"Data Body","graph.reportTitle":"Graphic Report","graph.unassigned":"Unassigned","graph.column.reportHours":"Report Hours","graph.column.billableHours":"Billable Hours","detail.searchAi.placeholder":"Search fields, or ask AI if no match...","detail.searchAi.matches":"{count} matches found","detail.searchAi.noMatch":"No matching field found.","detail.searchAi.autoAiFallback":"No direct match. Triggering AI analysis...","detail.searchAi.aiResultTitle":"AI Insight","detail.table.title":"Related Records","kanban.empty":"Drop cards here","kanban.bucket.limit":"Limit","kanban.bucket.dropHere":"Release to move into this bucket","kanban.bucket.add":"Add bucket","kanban.bucket.rename":"Rename bucket","kanban.bucket.saveRename":"Save bucket name","kanban.bucket.cancelRename":"Cancel renaming","kanban.search.placeholder":"Search cards and buckets","kanban.search.clear":"Clear search","kanban.search.results":"{count} matching cards","kanban.search.noMatch":"No matching cards","kanban.card.progress":"Progress","kanban.card.openDetail":"Open Detail","kanban.priority.critical":"Critical","kanban.priority.high":"High","kanban.priority.medium":"Medium","kanban.priority.low":"Low","quickCreate.newItem":"New Item","quickCreate.createWithTitle":"Create {title}","quickEdit.editWithTitle":"Edit {title}","quickDelete.confirmTitle":"Confirm Delete","quickDelete.confirmMessageSingle":"Are you sure you want to delete the selected record?","quickDelete.confirmMessageMultiple":"Are you sure you want to delete {count} selected records?","cardPage.viewDetails":"View Details","cardPage.download":"Download","cardPage.close":"Close","cardPage.empty":"No items found","messageBox.confirm":"OK","messageBox.cancel":"Cancel"},tg={"common.cancel":"\u53D6\u6D88","common.save":"\u4FDD\u5B58","common.ok":"\u786E\u5B9A","common.done":"\u5B8C\u6210","common.search":"\u641C\u7D22","common.none":"\u65E0","common.all":"\u5168\u90E8","common.noData":"\u6682\u65E0\u6570\u636E","common.copy":"\u590D\u5236","common.delete":"\u5220\u9664","common.loading":"\u52A0\u8F7D\u4E2D...","header.searchPlaceholder":"\u95EE\u6211\u70B9\u4EC0\u4E48...","header.searchAddFeature":"\u589E\u52A0\u529F\u80FD","header.searchSend":"\u53D1\u9001","header.searchStartVoice":"\u5F00\u59CB\u8BED\u97F3\u8F93\u5165","header.searchStopVoice":"\u505C\u6B62\u8BED\u97F3\u8F93\u5165","header.theme.system":"\u4E3B\u9898\uFF1A\u8DDF\u968F\u7CFB\u7EDF","header.theme.dark":"\u4E3B\u9898\uFF1A\u6DF1\u8272","header.theme.light":"\u4E3B\u9898\uFF1A\u6D45\u8272","header.menu.setting":"\u8BBE\u7F6E","header.menu.refresh":"\u5237\u65B0","header.menu.logout":"\u6CE8\u9500","navigation.expand":"\u5C55\u5F00\u5BFC\u822A","navigation.collapse":"\u6298\u53E0\u5BFC\u822A","navigation.searchPlaceholder":"\u641C\u7D22\u83DC\u5355...","navigation.noMatch":"\u672A\u627E\u5230\u5339\u914D\u7684\u83DC\u5355\u9879","navigation.noAccessibleApp":"\u6682\u65E0\u53EF\u8BBF\u95EE\u7684\u5E94\u7528","navigation.noItems":"\u6682\u65E0\u53EF\u663E\u793A\u9879","navigation.expandView":"\u5C55\u5F00\u67E5\u770B {title}","navigation.mode.switchToFixed":"\u5207\u6362\u4E3A\u56FA\u5B9A\u5BFC\u822A","navigation.mode.switchToFloating":"\u5207\u6362\u4E3A\u60AC\u6D6E\u5BFC\u822A","navigation.pinned":"\u5DF2\u56FA\u5B9A","navigation.pin.add":"\u56FA\u5B9A\u5230\u9876\u90E8","navigation.pin.remove":"\u53D6\u6D88\u56FA\u5B9A","table.toolbar.searchPlaceholder":"\u641C\u7D22...","table.title.default":"\u6570\u636E\u8868","table.toolbar.groupBy":"\u5206\u7EC4","table.toolbar.summary":"\u6C47\u603B","table.toolbar.columns":"\u5217","table.toolbar.export":"\u5BFC\u51FA","table.toolbar.itemsPerPage":"\u6BCF\u9875\u6761\u6570\uFF1A","table.toolbar.pageOf":"\u7B2C {current} / {total} \u9875","table.toolbar.newItem":"\u65B0\u5EFA\u6761\u76EE","table.toolbar.editItem":"\u7F16\u8F91\u6761\u76EE","table.toolbar.deleteItem":"\u5220\u9664\u6761\u76EE","table.toolbar.graphicReport":"\u56FE\u8868\u62A5\u8868","table.toolbar.saveLayout":"\u4FDD\u5B58\u5E03\u5C40","table.menu.groupBy":"\u5206\u7EC4","table.menu.clearAll":"\u6E05\u7A7A","table.menu.visibleColumns":"\u53EF\u89C1\u5217","table.menu.showSummaryRow":"\u663E\u793A\u6C47\u603B\u884C","table.menu.noNumericColumns":"\u6CA1\u6709\u6570\u503C\u5217","table.group.expandAll":"\u5C55\u5F00\u5168\u90E8\u5206\u7EC4","table.group.collapseAll":"\u6298\u53E0\u5168\u90E8\u5206\u7EC4","table.mobile.notImplemented":"\u79FB\u52A8\u7AEF\u89C6\u56FE\u6682\u672A\u5B9E\u73B0","table.headerMenu.sortAsc":"\u5347\u5E8F\u6392\u5217","table.headerMenu.sortDesc":"\u964D\u5E8F\u6392\u5217","table.headerMenu.clearSort":"\u6E05\u9664\u6392\u5E8F","table.headerMenu.configureSort":"\u6392\u5E8F\u8BBE\u7F6E...","table.headerMenu.group":"\u6309\u6B64\u5217\u5206\u7EC4","table.headerMenu.ungroup":"\u53D6\u6D88\u5206\u7EC4","table.headerMenu.addSummary":"\u52A0\u5165\u6C47\u603B","table.headerMenu.removeSummary":"\u4ECE\u6C47\u603B\u4E2D\u79FB\u9664","table.headerMenu.hideColumn":"\u9690\u85CF\u8BE5\u5217","table.sortDialog.title":"\u6392\u5E8F\u8BBE\u7F6E","table.sortDialog.empty":"\u6682\u65E0\u6392\u5E8F\u89C4\u5219\uFF0C\u8BF7\u6DFB\u52A0\u89C4\u5219\u8FDB\u884C\u6392\u5E8F\u3002","table.sortDialog.addRule":"\u6DFB\u52A0\u6392\u5E8F\u89C4\u5219","table.sortDialog.clearAll":"\u6E05\u7A7A\u89C4\u5219","table.sortDialog.asc":"\u5347\u5E8F","table.sortDialog.desc":"\u964D\u5E8F","pivot.title.default":"\u6570\u636E\u900F\u89C6\u8868","pivot.subtitle.default":"\u62D6\u62FD\u5B57\u6BB5\u4EE5\u914D\u7F6E\u900F\u89C6\u8868\u3002","pivot.empty":"\u8BF7\u81F3\u5C11\u62D6\u5165\u4E00\u4E2A\u503C\u5B57\u6BB5\u540E\u518D\u67E5\u770B\u900F\u89C6\u7ED3\u679C\u3002","pivot.records":"\u8BB0\u5F55\u6570","pivot.afterFilter":"\u7B5B\u9009\u540E","pivot.grandTotal":"\u603B\u8BA1","pivot.resultLabel":"\u7ED3\u679C","pivot.valueLabel":"\u503C","pivot.table.dimensions":"\u7EF4\u5EA6","pivot.config.title":"\u5E03\u5C40\u914D\u7F6E","pivot.fieldList":"\u5B57\u6BB5\u5217\u8868","pivot.availableDimensions":"\u53EF\u7528\u7EF4\u5EA6","pivot.allFieldsInUse":"\u6240\u6709\u5B57\u6BB5\u90FD\u5DF2\u4F7F\u7528\u3002","pivot.zone.rows":"\u884C","pivot.zone.columns":"\u5217","pivot.zone.filters":"\u7B5B\u9009","pivot.zone.values":"\u503C","pivot.hint.rows":"\u5C06\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u6784\u5EFA\u884C\u5C42\u7EA7","pivot.hint.columns":"\u5C06\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u6784\u5EFA\u5217\u5C42\u7EA7","pivot.hint.filters":"\u5C06\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u4F5C\u4E3A\u62A5\u8868\u7B5B\u9009","pivot.hint.values":"\u5C06\u6570\u503C\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u8FDB\u884C\u805A\u5408","pivot.clearArea":"\u6E05\u7A7A\u533A\u57DF","pivot.filter.na":"\u4E0D\u53EF\u7528","pivot.filter.noValues":"\u65E0\u53EF\u9009\u503C","pivot.filter.noneSelected":"\u672A\u9009\u62E9","pivot.filter.allValues":"\u5168\u90E8\u503C","pivot.filter.selectedCount":"\u5DF2\u9009 {selected} / {total}","pivot.filter.selectAll":"\u5168\u9009","pivot.filter.deselectAll":"\u53D6\u6D88\u5168\u9009","pivot.filter.noResults":"\u65E0\u5339\u914D\u7ED3\u679C","pivot.collapse.ariaExpand":"\u5C55\u5F00\u914D\u7F6E\u533A\u57DF","pivot.collapse.ariaCollapse":"\u6298\u53E0\u914D\u7F6E\u533A\u57DF","pivot.agg.sum":"\u6C42\u548C","pivot.agg.count":"\u8BA1\u6570","pivot.agg.avg":"\u5E73\u5747\u503C","pivot.agg.min":"\u6700\u5C0F\u503C","pivot.agg.max":"\u6700\u5927\u503C","pivot.preset.selectPlaceholder":"\u9009\u62E9\u65B9\u6848","pivot.preset.save":"\u4FDD\u5B58\u65B9\u6848","pivot.preset.delete":"\u5220\u9664\u65B9\u6848","pivot.preset.saveDialogTitle":"\u4FDD\u5B58\u5F53\u524D\u65B9\u6848","pivot.preset.nameLabel":"\u65B9\u6848\u540D\u79F0","pivot.preset.defaultName":"\u65B9\u6848 {index}","pivot.table.sectionTitle":"\u900F\u89C6\u7ED3\u679C","pivot.table.expandRowsAll":"\u884C\u5168\u90E8\u6253\u5F00","pivot.table.collapseRowsAll":"\u884C\u5168\u90E8\u6298\u53E0","pivot.table.expandColumnsAll":"\u5217\u5168\u90E8\u6253\u5F00","pivot.table.collapseColumnsAll":"\u5217\u5168\u90E8\u6298\u53E0","pivot.table.collapse.ariaExpand":"\u5C55\u5F00\u900F\u89C6\u7ED3\u679C","pivot.table.collapse.ariaCollapse":"\u6298\u53E0\u900F\u89C6\u7ED3\u679C","pivot.chart.title":"\u900F\u89C6\u56FE\u8868","pivot.chart.subtitle":"\u5C06\u4E00\u4E2A\u7EF4\u5EA6\u4E0E\u6700\u591A\u4E24\u4E2A\u5EA6\u91CF\u6620\u5C04\u4E3A\u7D27\u51D1\u56FE\u8868\u3002","pivot.chart.subtitleReady":"{dimension} \xB7 {measure}","pivot.chart.emptyNoDimension":"\u8BF7\u81F3\u5C11\u653E\u5165\u4E00\u4E2A\u884C\u6216\u5217\u5B57\u6BB5\u540E\u518D\u67E5\u770B\u56FE\u8868\u3002","pivot.chart.emptyNoValue":"\u8BF7\u81F3\u5C11\u653E\u5165\u4E00\u4E2A\u503C\u5B57\u6BB5\u540E\u518D\u67E5\u770B\u56FE\u8868\u3002","pivot.chart.emptyNoData":"\u5F53\u524D\u56FE\u8868\u9009\u62E9\u4E0B\u6682\u65E0\u53EF\u5C55\u793A\u6570\u636E\u3002","pivot.chart.dimension":"\u56FE\u8868\u7EF4\u5EA6","pivot.chart.primaryMeasure":"\u4E3B\u5EA6\u91CF","pivot.chart.secondaryMeasure":"\u5BF9\u6BD4\u5EA6\u91CF","pivot.chart.chartType":"\u56FE\u8868\u7C7B\u578B","pivot.chart.style.barVertical":"\u7EB5\u5411\u67F1\u72B6\u56FE","pivot.chart.style.barHorizontal":"\u6A2A\u5411\u67F1\u72B6\u56FE","pivot.chart.style.line":"\u6298\u7EBF\u56FE","pivot.chart.style.scatter":"\u6563\u70B9\u56FE","pivot.chart.collapse.ariaExpand":"\u5C55\u5F00\u56FE\u8868\u533A\u57DF","pivot.chart.collapse.ariaCollapse":"\u6298\u53E0\u56FE\u8868\u533A\u57DF","smartFilter.adaptFilters":"\u7B5B\u9009\u8BBE\u7F6E","smartFilter.addFilters":"\u6DFB\u52A0\u7B5B\u9009","smartFilter.go":"\u6267\u884C","smartFilter.visibleFilters":"\u53EF\u89C1\u7B5B\u9009\u9879","smartFilter.searchPlaceholder":"\u641C\u7D22...","smartFilter.noOptionsFound":"\u672A\u627E\u5230\u9009\u9879","smartFilter.min":"\u6700\u5C0F\u503C","smartFilter.max":"\u6700\u5927\u503C","smartFilter.minMaxPlaceholder":"\u6700\u5C0F\u503C - \u6700\u5927\u503C","smartFilter.operator.equals":"\u7B49\u4E8E","smartFilter.operator.contains":"\u5305\u542B","smartFilter.operator.notContains":"\u4E0D\u5305\u542B","smartFilter.operator.wildcard":"\u901A\u914D\u7B26\u641C\u7D22","smartFilter.operator.notEquals":"\u4E0D\u7B49\u4E8E","smartFilter.operator.greaterThan":"\u5927\u4E8E","smartFilter.operator.lessThan":"\u5C0F\u4E8E","smartFilter.operator.greaterOrEqual":"\u5927\u4E8E\u7B49\u4E8E","smartFilter.operator.lessOrEqual":"\u5C0F\u4E8E\u7B49\u4E8E","smartFilter.operator.between":"\u533A\u95F4","variant.noOptions":"\u65E0\u9009\u9879","variant.defaultSuffix":"\u9ED8\u8BA4","variant.selectVariant":"\u9009\u62E9\u89C6\u56FE","variant.saveView":"\u4FDD\u5B58\u89C6\u56FE","variant.newVariant":"\u65B0\u89C6\u56FE","variant.viewName":"\u89C6\u56FE\u540D\u79F0","variant.setDefault":"\u8BBE\u4E3A\u9ED8\u8BA4","variant.publicAllUsers":"\u516C\u5F00\uFF08\u6240\u6709\u7528\u6237\uFF09","variant.toast.fetchFailed":"\u52A0\u8F7D\u89C6\u56FE\u5931\u8D25","variant.toast.saveFailed":"\u4FDD\u5B58\u89C6\u56FE\u5931\u8D25","variant.toast.saveSuccess":"\u89C6\u56FE\u4FDD\u5B58\u6210\u529F","variant.toast.deleteFailed":"\u5220\u9664\u89C6\u56FE\u5931\u8D25","variant.toast.deleteSuccess":"\u89C6\u56FE\u5220\u9664\u6210\u529F","variant.toast.defaultFailed":"\u66F4\u65B0\u9ED8\u8BA4\u89C6\u56FE\u5931\u8D25","variant.toast.defaultSuccess":"\u9ED8\u8BA4\u89C6\u56FE\u5DF2\u66F4\u65B0","layout.saveLayout":"\u4FDD\u5B58\u5E03\u5C40","layout.layoutOptions":"\u5E03\u5C40\u9009\u9879","layout.selectLayout":"\u9009\u62E9\u5E03\u5C40","layout.saveCurrentLayout":"\u4FDD\u5B58\u5F53\u524D\u5E03\u5C40...","layout.noSavedLayouts":"\u6682\u65E0\u5DF2\u4FDD\u5B58\u5E03\u5C40","layout.removeDefault":"\u53D6\u6D88\u9ED8\u8BA4","layout.setAsDefault":"\u8BBE\u4E3A\u9ED8\u8BA4","layout.layoutName":"\u5E03\u5C40\u540D\u79F0","layout.layoutDescription":"\u63CF\u8FF0","layout.layoutNameHelper":"\u4F8B\u5982\uFF1A\u7D27\u51D1\u89C6\u56FE","layout.warningOverwrite":"\u8B66\u544A\uFF1A\u5C06\u8986\u76D6\u540C\u540D\u5E03\u5C40","layout.useAsDefault":"\u7528\u4F5C\u9ED8\u8BA4\u5E03\u5C40","layout.publicAllUsers":"\u516C\u5F00\uFF08\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09","layout.toast.loadFallback":"\u540E\u7AEF\u52A0\u8F7D\u5E03\u5C40\u5931\u8D25\uFF0C\u5DF2\u56DE\u9000\u5230\u672C\u5730\u5B58\u50A8","layout.toast.saveSuccess":"\u5E03\u5C40\u4FDD\u5B58\u6210\u529F","layout.toast.saveLocalSuccess":"\u5E03\u5C40\u5DF2\u4FDD\u5B58\u5230\u672C\u5730\u5B58\u50A8","layout.toast.backendUnavailableSavedLocal":"\u540E\u7AEF\u4E0D\u53EF\u7528\uFF0C\u5DF2\u4FDD\u5B58\u5230\u672C\u5730\u5B58\u50A8","layout.toast.deleteSuccess":"\u5E03\u5C40\u5220\u9664\u6210\u529F","layout.toast.deleteLocalSuccess":"\u5E03\u5C40\u5DF2\u4ECE\u672C\u5730\u5B58\u50A8\u5220\u9664","layout.toast.backendUnavailableDeletedLocal":"\u540E\u7AEF\u4E0D\u53EF\u7528\uFF0C\u5DF2\u4ECE\u672C\u5730\u5B58\u50A8\u5220\u9664","layout.toast.defaultSuccess":"\u9ED8\u8BA4\u5E03\u5C40\u5DF2\u8BBE\u7F6E","layout.toast.defaultLocalSuccess":"\u9ED8\u8BA4\u5E03\u5C40\u5DF2\u5728\u672C\u5730\u5B58\u50A8\u8BBE\u7F6E","layout.toast.backendUnavailableDefaultLocal":"\u540E\u7AEF\u4E0D\u53EF\u7528\uFF0C\u9ED8\u8BA4\u5E03\u5C40\u5DF2\u4FDD\u5B58\u5230\u672C\u5730\u5B58\u50A8","dateRange.label":"\u65E5\u671F\u8303\u56F4","dateRange.startDate":"\u5F00\u59CB\u65E5\u671F","dateRange.endDate":"\u7ED3\u675F\u65E5\u671F","dateRange.select":"\u8BF7\u9009\u62E9...","dateRange.today":"\u4ECA\u5929","dateRange.thisWeek":"\u672C\u5468","dateRange.thisMonth":"\u672C\u6708","graph.records":"{count} \u6761\u8BB0\u5F55","graph.kpi.totalRecords":"\u603B\u8BB0\u5F55\u6570","graph.kpi.totalReport":"\u603B\u7533\u62A5\u5DE5\u65F6","graph.kpi.totalBillable":"\u603B\u53EF\u8BA1\u8D39\u5DE5\u65F6","graph.kpi.efficiency":"\u6548\u7387","graph.kpi.amount":"\u91D1\u989D","graph.kpi.flagged":"\u6807\u8BB0","graph.chart.billable.title":"\u7EF4\u5EA6\u8BA1\u8D39\u5DE5\u65F6","graph.chart.billable.subtitle":"\u6309\u53EF\u8BA1\u8D39\u5DE5\u65F6\u6392\u5E8F\u524D\u5217","graph.chart.efficiency.title":"\u4EBA\u5458\u6548\u7387","graph.chart.efficiency.subtitle":"\u6309\u6700\u4F4E\u6548\u7387\u4F18\u5148","graph.chart.status.title":"\u72B6\u6001\u5206\u5E03","graph.chart.status.subtitle":"\u6309\u72B6\u6001\u8BB0\u5F55\u5360\u6BD4","graph.dataBody":"\u6570\u636E\u660E\u7EC6","graph.reportTitle":"\u56FE\u8868\u62A5\u8868","graph.unassigned":"\u672A\u5206\u914D","graph.column.reportHours":"\u7533\u62A5\u5DE5\u65F6","graph.column.billableHours":"\u53EF\u8BA1\u8D39\u5DE5\u65F6","detail.searchAi.placeholder":"\u641C\u7D22\u5B57\u6BB5\uFF1B\u5982\u65E0\u7ED3\u679C\u5219\u81EA\u52A8\u89E6\u53D1 AI...","detail.searchAi.matches":"{count} \u6761\u5339\u914D\u7ED3\u679C","detail.searchAi.noMatch":"\u672A\u627E\u5230\u5339\u914D\u5B57\u6BB5\u3002","detail.searchAi.autoAiFallback":"\u672A\u547D\u4E2D\u5B57\u6BB5\uFF0C\u6B63\u5728\u89E6\u53D1 AI \u5206\u6790...","detail.searchAi.aiResultTitle":"AI \u5206\u6790\u7ED3\u679C","detail.table.title":"\u5173\u8054\u8BB0\u5F55","kanban.empty":"\u5C06\u5361\u7247\u62D6\u5230\u8FD9\u91CC","kanban.bucket.limit":"\u4E0A\u9650","kanban.bucket.dropHere":"\u91CA\u653E\u540E\u79FB\u52A8\u5230\u8BE5 bucket","kanban.bucket.add":"\u65B0\u589E bucket","kanban.bucket.rename":"\u91CD\u547D\u540D bucket","kanban.bucket.saveRename":"\u4FDD\u5B58 bucket \u540D\u79F0","kanban.bucket.cancelRename":"\u53D6\u6D88\u91CD\u547D\u540D","kanban.search.placeholder":"\u641C\u7D22\u5361\u7247\u548C bucket","kanban.search.clear":"\u6E05\u9664\u641C\u7D22","kanban.search.results":"{count} \u5F20\u5339\u914D\u5361\u7247","kanban.search.noMatch":"\u6CA1\u6709\u5339\u914D\u7684\u5361\u7247","kanban.card.progress":"\u8FDB\u5EA6","kanban.card.openDetail":"\u6253\u5F00\u8BE6\u60C5","kanban.priority.critical":"\u7D27\u6025","kanban.priority.high":"\u9AD8","kanban.priority.medium":"\u4E2D","kanban.priority.low":"\u4F4E","quickCreate.newItem":"\u65B0\u5EFA\u6761\u76EE","quickCreate.createWithTitle":"\u521B\u5EFA{title}","quickEdit.editWithTitle":"\u7F16\u8F91{title}","quickDelete.confirmTitle":"\u786E\u8BA4\u5220\u9664","quickDelete.confirmMessageSingle":"\u786E\u8BA4\u5220\u9664\u5F53\u524D\u9009\u4E2D\u8BB0\u5F55\u5417\uFF1F","quickDelete.confirmMessageMultiple":"\u786E\u8BA4\u5220\u9664\u5DF2\u9009\u4E2D\u7684 {count} \u6761\u8BB0\u5F55\u5417\uFF1F","cardPage.viewDetails":"\u67E5\u770B\u8BE6\u60C5","cardPage.download":"\u4E0B\u8F7D","cardPage.close":"\u5173\u95ED","cardPage.empty":"\u672A\u627E\u5230\u6761\u76EE","messageBox.confirm":"\u786E\u5B9A","messageBox.cancel":"\u53D6\u6D88"},og={"common.cancel":"Annuler","common.save":"Enregistrer","common.ok":"OK","common.done":"Terminer","common.search":"Rechercher","common.none":"Aucun","common.all":"Tout","common.noData":"Aucune donn\xE9e","common.copy":"Copier","common.delete":"Supprimer","common.loading":"Chargement...","header.searchPlaceholder":"Demandez-moi...","header.searchAddFeature":"Ajouter une fonction","header.searchSend":"Envoyer","header.searchStartVoice":"D\xE9marrer la saisie vocale","header.searchStopVoice":"Arr\xEAter la saisie vocale","header.theme.system":"Th\xE8me : Syst\xE8me","header.theme.dark":"Th\xE8me : Sombre","header.theme.light":"Th\xE8me : Clair","header.menu.setting":"Param\xE8tres","header.menu.refresh":"Actualiser","header.menu.logout":"Se d\xE9connecter","navigation.expand":"D\xE9velopper la navigation","navigation.collapse":"R\xE9duire la navigation","navigation.searchPlaceholder":"Rechercher dans le menu...","navigation.noMatch":"Aucun \xE9l\xE9ment correspondant","navigation.noAccessibleApp":"Aucune application accessible","navigation.noItems":"Aucun \xE9l\xE9ment \xE0 afficher","navigation.expandView":"D\xE9velopper {title}","navigation.mode.switchToFixed":"Basculer vers la navigation fixe","navigation.mode.switchToFloating":"Basculer vers la navigation flottante","navigation.pinned":"\xC9pingl\xE9s","navigation.pin.add":"\xC9pingler en haut","navigation.pin.remove":"D\xE9s\xE9pingler","table.toolbar.searchPlaceholder":"Rechercher...","table.title.default":"Tableau de donn\xE9es","table.toolbar.groupBy":"Grouper","table.toolbar.summary":"R\xE9sum\xE9","table.toolbar.columns":"Colonnes","table.toolbar.export":"Exporter","table.toolbar.itemsPerPage":"Lignes par page :","table.toolbar.pageOf":"Page {current} sur {total}","table.toolbar.newItem":"Nouvel \xE9l\xE9ment","table.toolbar.editItem":"Modifier l'\xE9l\xE9ment","table.toolbar.deleteItem":"Supprimer l'\xE9l\xE9ment","table.toolbar.graphicReport":"Rapport graphique","table.toolbar.saveLayout":"Enregistrer la vue","table.menu.groupBy":"Grouper","table.menu.clearAll":"Tout effacer","table.menu.visibleColumns":"Colonnes visibles","table.menu.showSummaryRow":"Afficher la ligne de r\xE9sum\xE9","table.menu.noNumericColumns":"Aucune colonne num\xE9rique","table.group.expandAll":"D\xE9velopper tous les groupes","table.group.collapseAll":"R\xE9duire tous les groupes","table.mobile.notImplemented":"Vue mobile non impl\xE9ment\xE9e","table.headerMenu.sortAsc":"Trier ascendant","table.headerMenu.sortDesc":"Trier descendant","table.headerMenu.clearSort":"Effacer le tri","table.headerMenu.configureSort":"Configurer le tri...","table.headerMenu.group":"Grouper par cette colonne","table.headerMenu.ungroup":"Retirer du groupement","table.headerMenu.addSummary":"Inclure dans le r\xE9sum\xE9","table.headerMenu.removeSummary":"Retirer du r\xE9sum\xE9","table.headerMenu.hideColumn":"Masquer la colonne","table.sortDialog.title":"Param\xE8tres de tri","table.sortDialog.empty":"Aucune r\xE8gle de tri. Ajoutez-en une pour commencer.","table.sortDialog.addRule":"Ajouter une r\xE8gle","table.sortDialog.clearAll":"Tout effacer","table.sortDialog.asc":"Ascendant","table.sortDialog.desc":"Descendant","pivot.title.default":"Tableau crois\xE9 dynamique","pivot.subtitle.default":"Faites glisser les champs pour configurer le tableau crois\xE9.","pivot.empty":"Ajoutez au moins un champ de valeur pour afficher le r\xE9sultat.","pivot.records":"Enregistrements","pivot.afterFilter":"Apr\xE8s filtre","pivot.grandTotal":"Total g\xE9n\xE9ral","pivot.resultLabel":"R\xE9sultat","pivot.valueLabel":"Valeur","pivot.table.dimensions":"Dimensions","pivot.config.title":"Configuration","pivot.fieldList":"Liste des champs","pivot.availableDimensions":"Dimensions disponibles","pivot.allFieldsInUse":"Tous les champs sont d\xE9j\xE0 utilis\xE9s.","pivot.zone.rows":"Lignes","pivot.zone.columns":"Colonnes","pivot.zone.filters":"Filtres","pivot.zone.values":"Valeurs","pivot.hint.rows":"D\xE9posez les champs ici pour construire la hi\xE9rarchie des lignes","pivot.hint.columns":"D\xE9posez les champs ici pour construire la hi\xE9rarchie des colonnes","pivot.hint.filters":"D\xE9posez les champs ici pour les filtres du rapport","pivot.hint.values":"D\xE9posez les champs num\xE9riques ici pour les agr\xE9gations","pivot.clearArea":"Vider la zone","pivot.filter.na":"N/A","pivot.filter.noValues":"Aucune valeur","pivot.filter.noneSelected":"Aucune s\xE9lection","pivot.filter.allValues":"Toutes les valeurs","pivot.filter.selectedCount":"{selected} / {total} s\xE9lectionn\xE9es","pivot.filter.selectAll":"Tout s\xE9lectionner","pivot.filter.deselectAll":"Tout d\xE9s\xE9lectionner","pivot.filter.noResults":"Aucun r\xE9sultat","pivot.collapse.ariaExpand":"D\xE9velopper la zone de configuration","pivot.collapse.ariaCollapse":"R\xE9duire la zone de configuration","pivot.agg.sum":"Somme","pivot.agg.count":"Compte","pivot.agg.avg":"Moyenne","pivot.agg.min":"Min","pivot.agg.max":"Max","pivot.preset.selectPlaceholder":"S\xE9lectionner un preset","pivot.preset.save":"Enregistrer le preset","pivot.preset.delete":"Supprimer le preset","pivot.preset.saveDialogTitle":"Enregistrer le preset actuel","pivot.preset.nameLabel":"Nom du preset","pivot.preset.defaultName":"Preset {index}","pivot.table.sectionTitle":"R\xE9sultat du pivot","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"D\xE9velopper le r\xE9sultat du pivot","pivot.table.collapse.ariaCollapse":"R\xE9duire le r\xE9sultat du pivot","pivot.chart.title":"Graphique pivot","pivot.chart.subtitle":"Associez une dimension et jusqu\u2019\xE0 deux mesures dans un graphique compact.","pivot.chart.subtitleReady":"{dimension} par {measure}","pivot.chart.emptyNoDimension":"Ajoutez au moins un champ de ligne ou de colonne pour afficher le graphique.","pivot.chart.emptyNoValue":"Ajoutez au moins un champ de valeur pour afficher le graphique.","pivot.chart.emptyNoData":"Aucune donn\xE9e disponible pour la s\xE9lection actuelle du graphique.","pivot.chart.dimension":"Dimension","pivot.chart.primaryMeasure":"Mesure","pivot.chart.secondaryMeasure":"Mesure de comparaison","pivot.chart.chartType":"Type de graphique","pivot.chart.style.barVertical":"Barres verticales","pivot.chart.style.barHorizontal":"Barres horizontales","pivot.chart.style.line":"Ligne","pivot.chart.style.scatter":"Nuage de points","pivot.chart.collapse.ariaExpand":"D\xE9velopper la zone du graphique","pivot.chart.collapse.ariaCollapse":"R\xE9duire la zone du graphique","smartFilter.adaptFilters":"Adapter les filtres","smartFilter.addFilters":"Ajouter des filtres","smartFilter.go":"Ex\xE9cuter","smartFilter.visibleFilters":"Filtres visibles","smartFilter.searchPlaceholder":"Rechercher...","smartFilter.noOptionsFound":"Aucune option trouv\xE9e","smartFilter.min":"Min","smartFilter.max":"Max","smartFilter.minMaxPlaceholder":"Min - Max","smartFilter.operator.equals":"\xC9gal \xE0","smartFilter.operator.contains":"Contient","smartFilter.operator.notContains":"Ne contient pas","smartFilter.operator.wildcard":"Recherche g\xE9n\xE9rique","smartFilter.operator.notEquals":"Diff\xE9rent de","smartFilter.operator.greaterThan":"Sup\xE9rieur \xE0","smartFilter.operator.lessThan":"Inf\xE9rieur \xE0","smartFilter.operator.greaterOrEqual":"Sup\xE9rieur ou \xE9gal","smartFilter.operator.lessOrEqual":"Inf\xE9rieur ou \xE9gal","smartFilter.operator.between":"Entre","variant.noOptions":"Aucune option","variant.defaultSuffix":"Par d\xE9faut","variant.selectVariant":"S\xE9lectionner une vue","variant.saveView":"Enregistrer la vue","variant.newVariant":"Nouvelle vue","variant.viewName":"Nom de la vue","variant.setDefault":"D\xE9finir par d\xE9faut","variant.publicAllUsers":"Public (tous les utilisateurs)","variant.toast.fetchFailed":"\xC9chec du chargement des vues","variant.toast.saveFailed":"\xC9chec de l'enregistrement de la vue","variant.toast.saveSuccess":"Vue enregistr\xE9e avec succ\xE8s","variant.toast.deleteFailed":"\xC9chec de la suppression de la vue","variant.toast.deleteSuccess":"Vue supprim\xE9e avec succ\xE8s","variant.toast.defaultFailed":"\xC9chec de la mise \xE0 jour de la vue par d\xE9faut","variant.toast.defaultSuccess":"Vue par d\xE9faut mise \xE0 jour","layout.saveLayout":"Enregistrer la vue","layout.layoutOptions":"Options de vue","layout.selectLayout":"S\xE9lectionner une vue","layout.saveCurrentLayout":"Enregistrer la vue actuelle...","layout.noSavedLayouts":"Aucune vue enregistr\xE9e","layout.removeDefault":"Retirer le d\xE9faut","layout.setAsDefault":"D\xE9finir par d\xE9faut","layout.layoutName":"Nom de la vue","layout.layoutDescription":"Description","layout.layoutNameHelper":"ex. : Vue compacte","layout.warningOverwrite":"Attention : la vue existante sera \xE9cras\xE9e","layout.useAsDefault":"Utiliser comme vue par d\xE9faut","layout.publicAllUsers":"Public (visible par tous les utilisateurs)","layout.toast.loadFallback":"\xC9chec du chargement depuis le backend, bascule vers le stockage local","layout.toast.saveSuccess":"Vue enregistr\xE9e avec succ\xE8s","layout.toast.saveLocalSuccess":"Vue enregistr\xE9e dans le stockage local","layout.toast.backendUnavailableSavedLocal":"Backend indisponible, enregistr\xE9 en local","layout.toast.deleteSuccess":"Vue supprim\xE9e avec succ\xE8s","layout.toast.deleteLocalSuccess":"Vue supprim\xE9e du stockage local","layout.toast.backendUnavailableDeletedLocal":"Backend indisponible, supprim\xE9 en local","layout.toast.defaultSuccess":"Vue par d\xE9faut d\xE9finie","layout.toast.defaultLocalSuccess":"Vue par d\xE9faut d\xE9finie en local","layout.toast.backendUnavailableDefaultLocal":"Backend indisponible, d\xE9faut enregistr\xE9 en local","dateRange.label":"Plage de dates","dateRange.startDate":"Date de d\xE9but","dateRange.endDate":"Date de fin","dateRange.select":"S\xE9lectionner...","dateRange.today":"Aujourd'hui","dateRange.thisWeek":"Cette semaine","dateRange.thisMonth":"Ce mois-ci","graph.records":"{count} enregistrements","graph.kpi.totalRecords":"Total des enregistrements","graph.kpi.totalReport":"Total d\xE9clar\xE9","graph.kpi.totalBillable":"Total facturable","graph.kpi.efficiency":"Efficacit\xE9","graph.kpi.amount":"Montant","graph.kpi.flagged":"Signal\xE9","graph.chart.billable.title":"Facturable par dimension","graph.chart.billable.subtitle":"Top valeurs par heures facturables","graph.chart.efficiency.title":"Efficacit\xE9 par personne","graph.chart.efficiency.subtitle":"Efficacit\xE9 la plus faible en premier","graph.chart.status.title":"R\xE9partition des statuts","graph.chart.status.subtitle":"Ratio des enregistrements par statut","graph.dataBody":"Donn\xE9es","graph.reportTitle":"Rapport graphique","graph.unassigned":"Non attribu\xE9","graph.column.reportHours":"Heures d\xE9clar\xE9es","graph.column.billableHours":"Heures facturables","detail.searchAi.placeholder":"Rechercher des champs, ou interroger l\u2019IA en cas d\u2019absence de r\xE9sultat...","detail.searchAi.matches":"{count} correspondances trouv\xE9es","detail.searchAi.noMatch":"Aucun champ correspondant trouv\xE9.","detail.searchAi.autoAiFallback":"Aucune correspondance directe. Analyse IA en cours...","detail.searchAi.aiResultTitle":"Analyse IA","detail.table.title":"Enregistrements li\xE9s","kanban.empty":"D\xE9posez les cartes ici","kanban.bucket.limit":"Limite","kanban.bucket.dropHere":"Rel\xE2chez pour d\xE9placer dans cette colonne","kanban.bucket.add":"Ajouter une colonne","kanban.bucket.rename":"Renommer la colonne","kanban.bucket.saveRename":"Enregistrer le nom","kanban.bucket.cancelRename":"Annuler le renommage","kanban.search.placeholder":"Rechercher des cartes et colonnes","kanban.search.clear":"Effacer la recherche","kanban.search.results":"{count} cartes correspondantes","kanban.search.noMatch":"Aucune carte correspondante","kanban.card.progress":"Progression","kanban.card.openDetail":"Ouvrir le d\xE9tail","kanban.priority.critical":"Critique","kanban.priority.high":"\xC9lev\xE9e","kanban.priority.medium":"Moyenne","kanban.priority.low":"Faible","quickCreate.newItem":"Nouvel \xE9l\xE9ment","quickCreate.createWithTitle":"Cr\xE9er {title}","quickEdit.editWithTitle":"Modifier {title}","quickDelete.confirmTitle":"Confirmer la suppression","quickDelete.confirmMessageSingle":"Voulez-vous vraiment supprimer l\u2019enregistrement s\xE9lectionn\xE9 ?","quickDelete.confirmMessageMultiple":"Voulez-vous vraiment supprimer les {count} enregistrements s\xE9lectionn\xE9s ?","cardPage.viewDetails":"Voir les d\xE9tails","cardPage.download":"T\xE9l\xE9charger","cardPage.close":"Fermer","cardPage.empty":"Aucun \xE9l\xE9ment trouv\xE9","messageBox.confirm":"OK","messageBox.cancel":"Annuler"},rg={"common.cancel":"Abbrechen","common.save":"Speichern","common.ok":"OK","common.done":"Fertig","common.search":"Suchen","common.none":"Keine","common.all":"Alle","common.noData":"Keine Daten","common.copy":"Kopieren","common.delete":"L\xF6schen","common.loading":"Wird geladen...","header.searchPlaceholder":"Frag mich...","header.searchAddFeature":"Funktion hinzuf\xFCgen","header.searchSend":"Senden","header.searchStartVoice":"Spracheingabe starten","header.searchStopVoice":"Spracheingabe stoppen","header.theme.system":"Theme: System","header.theme.dark":"Theme: Dunkel","header.theme.light":"Theme: Hell","header.menu.setting":"Einstellungen","header.menu.refresh":"Aktualisieren","header.menu.logout":"Abmelden","navigation.expand":"Navigation erweitern","navigation.collapse":"Navigation einklappen","navigation.searchPlaceholder":"Men\xFC suchen...","navigation.noMatch":"Keine passenden Men\xFCeintr\xE4ge","navigation.noAccessibleApp":"Keine verf\xFCgbaren Anwendungen","navigation.noItems":"Keine Eintr\xE4ge vorhanden","navigation.expandView":"{title} aufklappen","navigation.mode.switchToFixed":"Zu fester Navigation wechseln","navigation.mode.switchToFloating":"Zu schwebender Navigation wechseln","navigation.pinned":"Angeheftet","navigation.pin.add":"Oben anheften","navigation.pin.remove":"L\xF6sen","table.toolbar.searchPlaceholder":"Suchen...","table.title.default":"Datentabelle","table.toolbar.groupBy":"Gruppieren","table.toolbar.summary":"Zusammenfassung","table.toolbar.columns":"Spalten","table.toolbar.export":"Export","table.toolbar.itemsPerPage":"Zeilen pro Seite:","table.toolbar.pageOf":"Seite {current} von {total}","table.toolbar.newItem":"Neuer Eintrag","table.toolbar.editItem":"Eintrag bearbeiten","table.toolbar.deleteItem":"Eintrag l\xF6schen","table.toolbar.graphicReport":"Grafikbericht","table.toolbar.saveLayout":"Layout speichern","table.menu.groupBy":"Gruppieren","table.menu.clearAll":"Alles l\xF6schen","table.menu.visibleColumns":"Sichtbare Spalten","table.menu.showSummaryRow":"Summenzeile anzeigen","table.menu.noNumericColumns":"Keine numerischen Spalten","table.group.expandAll":"Alle Gruppen aufklappen","table.group.collapseAll":"Alle Gruppen zuklappen","table.mobile.notImplemented":"Mobile Ansicht nicht implementiert","table.headerMenu.sortAsc":"Aufsteigend sortieren","table.headerMenu.sortDesc":"Absteigend sortieren","table.headerMenu.clearSort":"Sortierung entfernen","table.headerMenu.configureSort":"Sortierung konfigurieren...","table.headerMenu.group":"Nach dieser Spalte gruppieren","table.headerMenu.ungroup":"Aus Gruppierung entfernen","table.headerMenu.addSummary":"In Summe einbeziehen","table.headerMenu.removeSummary":"Aus Summe entfernen","table.headerMenu.hideColumn":"Spalte ausblenden","table.sortDialog.title":"Sortiereinstellungen","table.sortDialog.empty":"Keine Sortierregeln. F\xFCgen Sie eine hinzu, um zu sortieren.","table.sortDialog.addRule":"Regel hinzuf\xFCgen","table.sortDialog.clearAll":"Alle l\xF6schen","table.sortDialog.asc":"Aufsteigend","table.sortDialog.desc":"Absteigend","pivot.title.default":"Pivot-Tabelle","pivot.subtitle.default":"Ziehen Sie Felder, um die Pivot-Tabelle zu konfigurieren.","pivot.empty":"Ziehen Sie mindestens ein Wertefeld, um das Ergebnis anzuzeigen.","pivot.records":"Datens\xE4tze","pivot.afterFilter":"Nach Filter","pivot.grandTotal":"Gesamtsumme","pivot.resultLabel":"Ergebnis","pivot.valueLabel":"Wert","pivot.table.dimensions":"Dimensionen","pivot.config.title":"Konfiguration","pivot.fieldList":"Feldliste","pivot.availableDimensions":"Verf\xFCgbare Dimensionen","pivot.allFieldsInUse":"Alle Felder sind bereits verwendet.","pivot.zone.rows":"Zeilen","pivot.zone.columns":"Spalten","pivot.zone.filters":"Filter","pivot.zone.values":"Werte","pivot.hint.rows":"Felder hierhin ziehen, um die Zeilenhierarchie zu erstellen","pivot.hint.columns":"Felder hierhin ziehen, um die Spaltenhierarchie zu erstellen","pivot.hint.filters":"Felder hierhin ziehen f\xFCr Berichtsfilter","pivot.hint.values":"Numerische Felder hierhin ziehen f\xFCr Aggregation","pivot.clearArea":"Bereich leeren","pivot.filter.na":"N/V","pivot.filter.noValues":"Keine Werte","pivot.filter.noneSelected":"Nichts ausgew\xE4hlt","pivot.filter.allValues":"Alle Werte","pivot.filter.selectedCount":"{selected} / {total} ausgew\xE4hlt","pivot.filter.selectAll":"Alle ausw\xE4hlen","pivot.filter.deselectAll":"Alle abw\xE4hlen","pivot.filter.noResults":"Keine Ergebnisse","pivot.collapse.ariaExpand":"Konfigurationsbereich erweitern","pivot.collapse.ariaCollapse":"Konfigurationsbereich reduzieren","pivot.agg.sum":"Summe","pivot.agg.count":"Anzahl","pivot.agg.avg":"Durchschnitt","pivot.agg.min":"Min","pivot.agg.max":"Max","pivot.preset.selectPlaceholder":"Preset w\xE4hlen","pivot.preset.save":"Preset speichern","pivot.preset.delete":"Preset l\xF6schen","pivot.preset.saveDialogTitle":"Aktuelles Preset speichern","pivot.preset.nameLabel":"Preset-Name","pivot.preset.defaultName":"Preset {index}","pivot.table.sectionTitle":"Pivot-Ergebnis","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"Pivot-Ergebnis erweitern","pivot.table.collapse.ariaCollapse":"Pivot-Ergebnis reduzieren","pivot.chart.title":"Pivot-Diagramm","pivot.chart.subtitle":"Eine Dimension und bis zu zwei Kennzahlen in einem kompakten Diagramm abbilden.","pivot.chart.subtitleReady":"{dimension} nach {measure}","pivot.chart.emptyNoDimension":"F\xFCgen Sie mindestens ein Zeilen- oder Spaltenfeld hinzu, um das Diagramm anzuzeigen.","pivot.chart.emptyNoValue":"F\xFCgen Sie mindestens ein Wertefeld hinzu, um das Diagramm anzuzeigen.","pivot.chart.emptyNoData":"F\xFCr die aktuelle Diagrammauswahl sind keine Daten verf\xFCgbar.","pivot.chart.dimension":"Dimension","pivot.chart.primaryMeasure":"Kennzahl","pivot.chart.secondaryMeasure":"Vergleichskennzahl","pivot.chart.chartType":"Diagrammtyp","pivot.chart.style.barVertical":"Vertikale Balken","pivot.chart.style.barHorizontal":"Horizontale Balken","pivot.chart.style.line":"Linie","pivot.chart.style.scatter":"Streudiagramm","pivot.chart.collapse.ariaExpand":"Diagrammbereich erweitern","pivot.chart.collapse.ariaCollapse":"Diagrammbereich reduzieren","smartFilter.adaptFilters":"Filter anpassen","smartFilter.addFilters":"Filter hinzuf\xFCgen","smartFilter.go":"Los","smartFilter.visibleFilters":"Sichtbare Filter","smartFilter.searchPlaceholder":"Suchen...","smartFilter.noOptionsFound":"Keine Optionen gefunden","smartFilter.min":"Min","smartFilter.max":"Max","smartFilter.minMaxPlaceholder":"Min - Max","smartFilter.operator.equals":"Gleich","smartFilter.operator.contains":"Enth\xE4lt","smartFilter.operator.notContains":"Enth\xE4lt nicht","smartFilter.operator.wildcard":"Wildcard-Suche","smartFilter.operator.notEquals":"Ungleich","smartFilter.operator.greaterThan":"Gr\xF6\xDFer als","smartFilter.operator.lessThan":"Kleiner als","smartFilter.operator.greaterOrEqual":"Gr\xF6\xDFer gleich","smartFilter.operator.lessOrEqual":"Kleiner gleich","smartFilter.operator.between":"Zwischen","variant.noOptions":"Keine Optionen","variant.defaultSuffix":"Standard","variant.selectVariant":"Variante w\xE4hlen","variant.saveView":"Ansicht speichern","variant.newVariant":"Neue Variante","variant.viewName":"Ansichtsname","variant.setDefault":"Als Standard setzen","variant.publicAllUsers":"\xD6ffentlich (alle Benutzer)","variant.toast.fetchFailed":"Varianten konnten nicht geladen werden","variant.toast.saveFailed":"Variante konnte nicht gespeichert werden","variant.toast.saveSuccess":"Variante erfolgreich gespeichert","variant.toast.deleteFailed":"Variante konnte nicht gel\xF6scht werden","variant.toast.deleteSuccess":"Variante erfolgreich gel\xF6scht","variant.toast.defaultFailed":"Standardvariante konnte nicht aktualisiert werden","variant.toast.defaultSuccess":"Standardvariante aktualisiert","layout.saveLayout":"Layout speichern","layout.layoutOptions":"Layout-Optionen","layout.selectLayout":"Layout w\xE4hlen","layout.saveCurrentLayout":"Aktuelles Layout speichern...","layout.noSavedLayouts":"Keine gespeicherten Layouts","layout.removeDefault":"Standard entfernen","layout.setAsDefault":"Als Standard setzen","layout.layoutName":"Layoutname","layout.layoutDescription":"Beschreibung","layout.layoutNameHelper":"z. B. Kompaktansicht","layout.warningOverwrite":"Warnung: Vorhandenes Layout wird \xFCberschrieben","layout.useAsDefault":"Als Standardlayout verwenden","layout.publicAllUsers":"\xD6ffentlich (f\xFCr alle sichtbar)","layout.toast.loadFallback":"Layouts konnten nicht vom Backend geladen werden, Wechsel zu lokalem Speicher","layout.toast.saveSuccess":"Layout erfolgreich gespeichert","layout.toast.saveLocalSuccess":"Layout im lokalen Speicher gespeichert","layout.toast.backendUnavailableSavedLocal":"Backend nicht verf\xFCgbar, lokal gespeichert","layout.toast.deleteSuccess":"Layout erfolgreich gel\xF6scht","layout.toast.deleteLocalSuccess":"Layout aus lokalem Speicher gel\xF6scht","layout.toast.backendUnavailableDeletedLocal":"Backend nicht verf\xFCgbar, lokal gel\xF6scht","layout.toast.defaultSuccess":"Standardlayout gesetzt","layout.toast.defaultLocalSuccess":"Standardlayout lokal gesetzt","layout.toast.backendUnavailableDefaultLocal":"Backend nicht verf\xFCgbar, Standard lokal gespeichert","dateRange.label":"Datumsbereich","dateRange.startDate":"Startdatum","dateRange.endDate":"Enddatum","dateRange.select":"Ausw\xE4hlen...","dateRange.today":"Heute","dateRange.thisWeek":"Diese Woche","dateRange.thisMonth":"Diesen Monat","graph.records":"{count} Datens\xE4tze","graph.kpi.totalRecords":"Gesamt Datens\xE4tze","graph.kpi.totalReport":"Gesamt Report","graph.kpi.totalBillable":"Gesamt abrechenbar","graph.kpi.efficiency":"Effizienz","graph.kpi.amount":"Betrag","graph.kpi.flagged":"Markiert","graph.chart.billable.title":"Abrechenbar nach Dimension","graph.chart.billable.subtitle":"Top-Werte nach abrechenbaren Stunden","graph.chart.efficiency.title":"Effizienz pro Person","graph.chart.efficiency.subtitle":"Niedrigste Effizienz zuerst","graph.chart.status.title":"Statusverteilung","graph.chart.status.subtitle":"Anteil je Status","graph.dataBody":"Datentabelle","graph.reportTitle":"Grafikbericht","graph.unassigned":"Nicht zugewiesen","graph.column.reportHours":"Melde-Stunden","graph.column.billableHours":"Abrechenbare Stunden","detail.searchAi.placeholder":"Felder suchen, oder bei keinem Treffer die KI fragen...","detail.searchAi.matches":"{count} Treffer gefunden","detail.searchAi.noMatch":"Kein passendes Feld gefunden.","detail.searchAi.autoAiFallback":"Keine direkte \xDCbereinstimmung. KI-Analyse wird gestartet...","detail.searchAi.aiResultTitle":"KI-Ergebnis","detail.table.title":"Verkn\xFCpfte Eintr\xE4ge","kanban.empty":"Karten hier ablegen","kanban.bucket.limit":"Limit","kanban.bucket.dropHere":"Loslassen, um in diese Spalte zu verschieben","kanban.bucket.add":"Spalte hinzuf\xFCgen","kanban.bucket.rename":"Spalte umbenennen","kanban.bucket.saveRename":"Spaltennamen speichern","kanban.bucket.cancelRename":"Umbenennen abbrechen","kanban.search.placeholder":"Karten und Spalten durchsuchen","kanban.search.clear":"Suche l\xF6schen","kanban.search.results":"{count} passende Karten","kanban.search.noMatch":"Keine passenden Karten","kanban.card.progress":"Fortschritt","kanban.card.openDetail":"Detail \xF6ffnen","kanban.priority.critical":"Kritisch","kanban.priority.high":"Hoch","kanban.priority.medium":"Mittel","kanban.priority.low":"Niedrig","quickCreate.newItem":"Neuer Eintrag","quickCreate.createWithTitle":"{title} erstellen","quickEdit.editWithTitle":"{title} bearbeiten","quickDelete.confirmTitle":"L\xF6schen best\xE4tigen","quickDelete.confirmMessageSingle":"M\xF6chten Sie den ausgew\xE4hlten Datensatz wirklich l\xF6schen?","quickDelete.confirmMessageMultiple":"M\xF6chten Sie die {count} ausgew\xE4hlten Datens\xE4tze wirklich l\xF6schen?","cardPage.viewDetails":"Details anzeigen","cardPage.download":"Herunterladen","cardPage.close":"Schlie\xDFen","cardPage.empty":"Keine Eintr\xE4ge gefunden","messageBox.confirm":"OK","messageBox.cancel":"Abbrechen"},ag={"common.cancel":"\u30AD\u30E3\u30F3\u30BB\u30EB","common.save":"\u4FDD\u5B58","common.ok":"OK","common.done":"\u5B8C\u4E86","common.search":"\u691C\u7D22","common.none":"\u306A\u3057","common.all":"\u3059\u3079\u3066","common.noData":"\u30C7\u30FC\u30BF\u306A\u3057","common.copy":"\u30B3\u30D4\u30FC","common.delete":"\u524A\u9664","common.loading":"\u8AAD\u307F\u8FBC\u307F\u4E2D...","header.searchPlaceholder":"\u4F55\u304B\u805E\u3044\u3066\u304F\u3060\u3055\u3044...","header.searchAddFeature":"\u6A5F\u80FD\u3092\u8FFD\u52A0","header.searchSend":"\u9001\u4FE1","header.searchStartVoice":"\u97F3\u58F0\u5165\u529B\u3092\u958B\u59CB","header.searchStopVoice":"\u97F3\u58F0\u5165\u529B\u3092\u505C\u6B62","header.theme.system":"\u30C6\u30FC\u30DE\uFF1A\u30B7\u30B9\u30C6\u30E0","header.theme.dark":"\u30C6\u30FC\u30DE\uFF1A\u30C0\u30FC\u30AF","header.theme.light":"\u30C6\u30FC\u30DE\uFF1A\u30E9\u30A4\u30C8","header.menu.setting":"\u8A2D\u5B9A","header.menu.refresh":"\u518D\u8AAD\u307F\u8FBC\u307F","header.menu.logout":"\u30ED\u30B0\u30A2\u30A6\u30C8","navigation.expand":"\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u3092\u5C55\u958B","navigation.collapse":"\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u3092\u6298\u308A\u305F\u305F\u3080","navigation.searchPlaceholder":"\u30E1\u30CB\u30E5\u30FC\u3092\u691C\u7D22...","navigation.noMatch":"\u4E00\u81F4\u3059\u308B\u30E1\u30CB\u30E5\u30FC\u304C\u3042\u308A\u307E\u305B\u3093","navigation.noAccessibleApp":"\u30A2\u30AF\u30BB\u30B9\u53EF\u80FD\u306A\u30A2\u30D7\u30EA\u304C\u3042\u308A\u307E\u305B\u3093","navigation.noItems":"\u8868\u793A\u3067\u304D\u308B\u9805\u76EE\u304C\u3042\u308A\u307E\u305B\u3093","navigation.expandView":"{title} \u3092\u5C55\u958B","navigation.mode.switchToFixed":"\u56FA\u5B9A\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u306B\u5207\u308A\u66FF\u3048","navigation.mode.switchToFloating":"\u30D5\u30ED\u30FC\u30C6\u30A3\u30F3\u30B0\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u306B\u5207\u308A\u66FF\u3048","navigation.pinned":"\u30D4\u30F3\u7559\u3081","navigation.pin.add":"\u4E0A\u90E8\u306B\u30D4\u30F3\u7559\u3081","navigation.pin.remove":"\u30D4\u30F3\u7559\u3081\u3092\u89E3\u9664","table.toolbar.searchPlaceholder":"\u691C\u7D22...","table.title.default":"\u30C7\u30FC\u30BF\u30C6\u30FC\u30D6\u30EB","table.toolbar.groupBy":"\u30B0\u30EB\u30FC\u30D7\u5316","table.toolbar.summary":"\u96C6\u8A08","table.toolbar.columns":"\u5217","table.toolbar.export":"\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8","table.toolbar.itemsPerPage":"1\u30DA\u30FC\u30B8\u306E\u4EF6\u6570\uFF1A","table.toolbar.pageOf":"{current} / {total} \u30DA\u30FC\u30B8","table.toolbar.newItem":"\u65B0\u898F\u4F5C\u6210","table.toolbar.editItem":"\u7DE8\u96C6","table.toolbar.deleteItem":"\u524A\u9664","table.toolbar.graphicReport":"\u30B0\u30E9\u30D5\u30A3\u30C3\u30AF\u30EC\u30DD\u30FC\u30C8","table.toolbar.saveLayout":"\u30EC\u30A4\u30A2\u30A6\u30C8\u4FDD\u5B58","table.menu.groupBy":"\u30B0\u30EB\u30FC\u30D7\u5316","table.menu.clearAll":"\u3059\u3079\u3066\u30AF\u30EA\u30A2","table.menu.visibleColumns":"\u8868\u793A\u5217","table.menu.showSummaryRow":"\u96C6\u8A08\u884C\u3092\u8868\u793A","table.menu.noNumericColumns":"\u6570\u5024\u5217\u304C\u3042\u308A\u307E\u305B\u3093","table.group.expandAll":"\u3059\u3079\u3066\u306E\u30B0\u30EB\u30FC\u30D7\u3092\u5C55\u958B","table.group.collapseAll":"\u3059\u3079\u3066\u306E\u30B0\u30EB\u30FC\u30D7\u3092\u6298\u308A\u305F\u305F\u3080","table.mobile.notImplemented":"\u30E2\u30D0\u30A4\u30EB\u8868\u793A\u306F\u672A\u5B9F\u88C5\u3067\u3059","table.headerMenu.sortAsc":"\u6607\u9806\u3067\u4E26\u3079\u66FF\u3048","table.headerMenu.sortDesc":"\u964D\u9806\u3067\u4E26\u3079\u66FF\u3048","table.headerMenu.clearSort":"\u4E26\u3079\u66FF\u3048\u3092\u89E3\u9664","table.headerMenu.configureSort":"\u4E26\u3079\u66FF\u3048\u3092\u8A2D\u5B9A...","table.headerMenu.group":"\u3053\u306E\u5217\u3067\u30B0\u30EB\u30FC\u30D7\u5316","table.headerMenu.ungroup":"\u30B0\u30EB\u30FC\u30D7\u304B\u3089\u5916\u3059","table.headerMenu.addSummary":"\u96C6\u8A08\u306B\u8FFD\u52A0","table.headerMenu.removeSummary":"\u96C6\u8A08\u304B\u3089\u524A\u9664","table.headerMenu.hideColumn":"\u5217\u3092\u975E\u8868\u793A","table.sortDialog.title":"\u4E26\u3079\u66FF\u3048\u8A2D\u5B9A","table.sortDialog.empty":"\u4E26\u3079\u66FF\u3048\u30EB\u30FC\u30EB\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","table.sortDialog.addRule":"\u30EB\u30FC\u30EB\u3092\u8FFD\u52A0","table.sortDialog.clearAll":"\u3059\u3079\u3066\u30AF\u30EA\u30A2","table.sortDialog.asc":"\u6607\u9806","table.sortDialog.desc":"\u964D\u9806","pivot.title.default":"\u30D4\u30DC\u30C3\u30C8\u30C6\u30FC\u30D6\u30EB","pivot.subtitle.default":"\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u30D4\u30DC\u30C3\u30C8\u30C6\u30FC\u30D6\u30EB\u3092\u8A2D\u5B9A\u3057\u307E\u3059\u3002","pivot.empty":"\u7D50\u679C\u3092\u8868\u793A\u3059\u308B\u306B\u306F\u3001\u5024\u30A8\u30EA\u30A2\u306B\u5C11\u306A\u304F\u3068\u30821\u3064\u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","pivot.records":"\u30EC\u30B3\u30FC\u30C9","pivot.afterFilter":"\u30D5\u30A3\u30EB\u30BF\u30FC\u5F8C","pivot.grandTotal":"\u7DCF\u8A08","pivot.resultLabel":"\u7D50\u679C","pivot.valueLabel":"\u5024","pivot.table.dimensions":"\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3","pivot.config.title":"\u8A2D\u5B9A","pivot.fieldList":"\u30D5\u30A3\u30FC\u30EB\u30C9\u4E00\u89A7","pivot.availableDimensions":"\u5229\u7528\u53EF\u80FD\u306A\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3","pivot.allFieldsInUse":"\u3059\u3079\u3066\u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u304C\u4F7F\u7528\u4E2D\u3067\u3059\u3002","pivot.zone.rows":"\u884C","pivot.zone.columns":"\u5217","pivot.zone.filters":"\u30D5\u30A3\u30EB\u30BF\u30FC","pivot.zone.values":"\u5024","pivot.hint.rows":"\u3053\u3053\u306B\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u884C\u968E\u5C64\u3092\u4F5C\u6210","pivot.hint.columns":"\u3053\u3053\u306B\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u5217\u968E\u5C64\u3092\u4F5C\u6210","pivot.hint.filters":"\u3053\u3053\u306B\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u30EC\u30DD\u30FC\u30C8\u30D5\u30A3\u30EB\u30BF\u30FC\u3092\u8A2D\u5B9A","pivot.hint.values":"\u3053\u3053\u306B\u6570\u5024\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u96C6\u8A08","pivot.clearArea":"\u30A8\u30EA\u30A2\u3092\u30AF\u30EA\u30A2","pivot.filter.na":"N/A","pivot.filter.noValues":"\u5024\u304C\u3042\u308A\u307E\u305B\u3093","pivot.filter.noneSelected":"\u672A\u9078\u629E","pivot.filter.allValues":"\u3059\u3079\u3066\u306E\u5024","pivot.filter.selectedCount":"{selected} / {total} \u3092\u9078\u629E","pivot.filter.selectAll":"\u3059\u3079\u3066\u9078\u629E","pivot.filter.deselectAll":"\u3059\u3079\u3066\u89E3\u9664","pivot.filter.noResults":"\u7D50\u679C\u304C\u3042\u308A\u307E\u305B\u3093","pivot.collapse.ariaExpand":"\u8A2D\u5B9A\u30A8\u30EA\u30A2\u3092\u5C55\u958B","pivot.collapse.ariaCollapse":"\u8A2D\u5B9A\u30A8\u30EA\u30A2\u3092\u6298\u308A\u305F\u305F\u3080","pivot.agg.sum":"\u5408\u8A08","pivot.agg.count":"\u4EF6\u6570","pivot.agg.avg":"\u5E73\u5747","pivot.agg.min":"\u6700\u5C0F","pivot.agg.max":"\u6700\u5927","pivot.preset.selectPlaceholder":"\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u9078\u629E","pivot.preset.save":"\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u4FDD\u5B58","pivot.preset.delete":"\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u524A\u9664","pivot.preset.saveDialogTitle":"\u73FE\u5728\u306E\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u4FDD\u5B58","pivot.preset.nameLabel":"\u30D7\u30EA\u30BB\u30C3\u30C8\u540D","pivot.preset.defaultName":"\u30D7\u30EA\u30BB\u30C3\u30C8 {index}","pivot.table.sectionTitle":"\u30D4\u30DC\u30C3\u30C8\u7D50\u679C","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"\u30D4\u30DC\u30C3\u30C8\u7D50\u679C\u3092\u5C55\u958B","pivot.table.collapse.ariaCollapse":"\u30D4\u30DC\u30C3\u30C8\u7D50\u679C\u3092\u6298\u308A\u305F\u305F\u3080","pivot.chart.title":"\u30D4\u30DC\u30C3\u30C8\u30C1\u30E3\u30FC\u30C8","pivot.chart.subtitle":"1\u3064\u306E\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3\u3068\u6700\u59272\u3064\u306E\u6307\u6A19\u3092\u30B3\u30F3\u30D1\u30AF\u30C8\u306A\u30C1\u30E3\u30FC\u30C8\u306B\u307E\u3068\u3081\u307E\u3059\u3002","pivot.chart.subtitleReady":"{dimension} \u3054\u3068\u306E {measure}","pivot.chart.emptyNoDimension":"\u30C1\u30E3\u30FC\u30C8\u3092\u8868\u793A\u3059\u308B\u306B\u306F\u3001\u5C11\u306A\u304F\u3068\u30821\u3064\u306E\u884C\u307E\u305F\u306F\u5217\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","pivot.chart.emptyNoValue":"\u30C1\u30E3\u30FC\u30C8\u3092\u8868\u793A\u3059\u308B\u306B\u306F\u3001\u5C11\u306A\u304F\u3068\u30821\u3064\u306E\u5024\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","pivot.chart.emptyNoData":"\u73FE\u5728\u306E\u30C1\u30E3\u30FC\u30C8\u9078\u629E\u3067\u306F\u8868\u793A\u3067\u304D\u308B\u30C7\u30FC\u30BF\u304C\u3042\u308A\u307E\u305B\u3093\u3002","pivot.chart.dimension":"\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3","pivot.chart.primaryMeasure":"\u6307\u6A19","pivot.chart.secondaryMeasure":"\u6BD4\u8F03\u6307\u6A19","pivot.chart.chartType":"\u30C1\u30E3\u30FC\u30C8\u7A2E\u5225","pivot.chart.style.barVertical":"\u7E26\u68D2\u30B0\u30E9\u30D5","pivot.chart.style.barHorizontal":"\u6A2A\u68D2\u30B0\u30E9\u30D5","pivot.chart.style.line":"\u6298\u308C\u7DDA\u30B0\u30E9\u30D5","pivot.chart.style.scatter":"\u6563\u5E03\u56F3","pivot.chart.collapse.ariaExpand":"\u30C1\u30E3\u30FC\u30C8\u9818\u57DF\u3092\u5C55\u958B","pivot.chart.collapse.ariaCollapse":"\u30C1\u30E3\u30FC\u30C8\u9818\u57DF\u3092\u6298\u308A\u305F\u305F\u3080","smartFilter.adaptFilters":"\u30D5\u30A3\u30EB\u30BF\u30FC\u8ABF\u6574","smartFilter.addFilters":"\u30D5\u30A3\u30EB\u30BF\u30FC\u8FFD\u52A0","smartFilter.go":"\u5B9F\u884C","smartFilter.visibleFilters":"\u8868\u793A\u30D5\u30A3\u30EB\u30BF\u30FC","smartFilter.searchPlaceholder":"\u691C\u7D22...","smartFilter.noOptionsFound":"\u30AA\u30D7\u30B7\u30E7\u30F3\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093","smartFilter.min":"\u6700\u5C0F","smartFilter.max":"\u6700\u5927","smartFilter.minMaxPlaceholder":"\u6700\u5C0F - \u6700\u5927","smartFilter.operator.equals":"\u7B49\u3057\u3044","smartFilter.operator.contains":"\u542B\u3080","smartFilter.operator.notContains":"\u542B\u307E\u306A\u3044","smartFilter.operator.wildcard":"\u30EF\u30A4\u30EB\u30C9\u30AB\u30FC\u30C9\u691C\u7D22","smartFilter.operator.notEquals":"\u7B49\u3057\u304F\u306A\u3044","smartFilter.operator.greaterThan":"\u3088\u308A\u5927\u304D\u3044","smartFilter.operator.lessThan":"\u3088\u308A\u5C0F\u3055\u3044","smartFilter.operator.greaterOrEqual":"\u4EE5\u4E0A","smartFilter.operator.lessOrEqual":"\u4EE5\u4E0B","smartFilter.operator.between":"\u7BC4\u56F2","variant.noOptions":"\u30AA\u30D7\u30B7\u30E7\u30F3\u306A\u3057","variant.defaultSuffix":"\u30C7\u30D5\u30A9\u30EB\u30C8","variant.selectVariant":"\u30D3\u30E5\u30FC\u3092\u9078\u629E","variant.saveView":"\u30D3\u30E5\u30FC\u4FDD\u5B58","variant.newVariant":"\u65B0\u3057\u3044\u30D3\u30E5\u30FC","variant.viewName":"\u30D3\u30E5\u30FC\u540D","variant.setDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u306B\u8A2D\u5B9A","variant.publicAllUsers":"\u516C\u958B\uFF08\u5168\u30E6\u30FC\u30B6\u30FC\uFF09","variant.toast.fetchFailed":"\u30D3\u30E5\u30FC\u306E\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.saveFailed":"\u30D3\u30E5\u30FC\u306E\u4FDD\u5B58\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.saveSuccess":"\u30D3\u30E5\u30FC\u3092\u4FDD\u5B58\u3057\u307E\u3057\u305F","variant.toast.deleteFailed":"\u30D3\u30E5\u30FC\u306E\u524A\u9664\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.deleteSuccess":"\u30D3\u30E5\u30FC\u3092\u524A\u9664\u3057\u307E\u3057\u305F","variant.toast.defaultFailed":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30D3\u30E5\u30FC\u306E\u66F4\u65B0\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.defaultSuccess":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30D3\u30E5\u30FC\u3092\u66F4\u65B0\u3057\u307E\u3057\u305F","layout.saveLayout":"\u30EC\u30A4\u30A2\u30A6\u30C8\u4FDD\u5B58","layout.layoutOptions":"\u30EC\u30A4\u30A2\u30A6\u30C8\u30AA\u30D7\u30B7\u30E7\u30F3","layout.selectLayout":"\u30EC\u30A4\u30A2\u30A6\u30C8\u9078\u629E","layout.saveCurrentLayout":"\u73FE\u5728\u306E\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u4FDD\u5B58...","layout.noSavedLayouts":"\u4FDD\u5B58\u6E08\u307F\u30EC\u30A4\u30A2\u30A6\u30C8\u306A\u3057","layout.removeDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u89E3\u9664","layout.setAsDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u306B\u8A2D\u5B9A","layout.layoutName":"\u30EC\u30A4\u30A2\u30A6\u30C8\u540D","layout.layoutDescription":"\u8AAC\u660E","layout.layoutNameHelper":"\u4F8B\uFF1A\u30B3\u30F3\u30D1\u30AF\u30C8\u8868\u793A","layout.warningOverwrite":"\u8B66\u544A\uFF1A\u65E2\u5B58\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u4E0A\u66F8\u304D\u3057\u307E\u3059","layout.useAsDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30EC\u30A4\u30A2\u30A6\u30C8\u3068\u3057\u3066\u4F7F\u7528","layout.publicAllUsers":"\u516C\u958B\uFF08\u5168\u30E6\u30FC\u30B6\u30FC\u306B\u8868\u793A\uFF09","layout.toast.loadFallback":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u304B\u3089\u306E\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u3001\u30ED\u30FC\u30AB\u30EB\u4FDD\u5B58\u306B\u5207\u308A\u66FF\u3048\u307E\u3057\u305F","layout.toast.saveSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u4FDD\u5B58\u3057\u307E\u3057\u305F","layout.toast.saveLocalSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u4FDD\u5B58\u3057\u307E\u3057\u305F","layout.toast.backendUnavailableSavedLocal":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u672A\u63A5\u7D9A\u306E\u305F\u3081\u30ED\u30FC\u30AB\u30EB\u306B\u4FDD\u5B58\u3057\u307E\u3057\u305F","layout.toast.deleteSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u524A\u9664\u3057\u307E\u3057\u305F","layout.toast.deleteLocalSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u304B\u3089\u524A\u9664\u3057\u307E\u3057\u305F","layout.toast.backendUnavailableDeletedLocal":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u672A\u63A5\u7D9A\u306E\u305F\u3081\u30ED\u30FC\u30AB\u30EB\u304B\u3089\u524A\u9664\u3057\u307E\u3057\u305F","layout.toast.defaultSuccess":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u8A2D\u5B9A\u3057\u307E\u3057\u305F","layout.toast.defaultLocalSuccess":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u306B\u8A2D\u5B9A\u3057\u307E\u3057\u305F","layout.toast.backendUnavailableDefaultLocal":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u672A\u63A5\u7D9A\u306E\u305F\u3081\u30C7\u30D5\u30A9\u30EB\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u4FDD\u5B58\u3057\u307E\u3057\u305F","dateRange.label":"\u65E5\u4ED8\u7BC4\u56F2","dateRange.startDate":"\u958B\u59CB\u65E5","dateRange.endDate":"\u7D42\u4E86\u65E5","dateRange.select":"\u9078\u629E...","dateRange.today":"\u4ECA\u65E5","dateRange.thisWeek":"\u4ECA\u9031","dateRange.thisMonth":"\u4ECA\u6708","graph.records":"{count} \u4EF6","graph.kpi.totalRecords":"\u7DCF\u30EC\u30B3\u30FC\u30C9","graph.kpi.totalReport":"\u7DCF\u5831\u544A\u6642\u9593","graph.kpi.totalBillable":"\u7DCF\u8ACB\u6C42\u53EF\u80FD\u6642\u9593","graph.kpi.efficiency":"\u52B9\u7387","graph.kpi.amount":"\u91D1\u984D","graph.kpi.flagged":"\u8981\u78BA\u8A8D","graph.chart.billable.title":"\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3\u5225\u8ACB\u6C42\u53EF\u80FD\u6642\u9593","graph.chart.billable.subtitle":"\u8ACB\u6C42\u53EF\u80FD\u6642\u9593\u306E\u4E0A\u4F4D","graph.chart.efficiency.title":"\u62C5\u5F53\u8005\u5225\u52B9\u7387","graph.chart.efficiency.subtitle":"\u52B9\u7387\u306E\u4F4E\u3044\u9806","graph.chart.status.title":"\u30B9\u30C6\u30FC\u30BF\u30B9\u5206\u5E03","graph.chart.status.subtitle":"\u30B9\u30C6\u30FC\u30BF\u30B9\u5225\u6BD4\u7387","graph.dataBody":"\u30C7\u30FC\u30BF\u672C\u4F53","graph.reportTitle":"\u30B0\u30E9\u30D5\u30A3\u30C3\u30AF\u30EC\u30DD\u30FC\u30C8","graph.unassigned":"\u672A\u5272\u308A\u5F53\u3066","graph.column.reportHours":"\u5831\u544A\u6642\u9593","graph.column.billableHours":"\u8ACB\u6C42\u53EF\u80FD\u6642\u9593","detail.searchAi.placeholder":"\u9805\u76EE\u3092\u691C\u7D22\u3002\u898B\u3064\u304B\u3089\u306A\u3044\u5834\u5408\u306FAI\u306B\u8CEA\u554F\u3057\u307E\u3059...","detail.searchAi.matches":"{count} \u4EF6\u306E\u4E00\u81F4","detail.searchAi.noMatch":"\u4E00\u81F4\u3059\u308B\u9805\u76EE\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002","detail.searchAi.autoAiFallback":"\u4E00\u81F4\u306A\u3057\u3002AI\u5206\u6790\u3092\u5B9F\u884C\u3057\u307E\u3059...","detail.searchAi.aiResultTitle":"AI\u5206\u6790\u7D50\u679C","detail.table.title":"\u95A2\u9023\u30EC\u30B3\u30FC\u30C9","kanban.empty":"\u3053\u3053\u306B\u30AB\u30FC\u30C9\u3092\u30C9\u30ED\u30C3\u30D7","kanban.bucket.limit":"\u4E0A\u9650","kanban.bucket.dropHere":"\u96E2\u3059\u3068\u3053\u306E bucket \u306B\u79FB\u52D5\u3057\u307E\u3059","kanban.bucket.add":"bucket \u3092\u8FFD\u52A0","kanban.bucket.rename":"bucket \u540D\u3092\u5909\u66F4","kanban.bucket.saveRename":"bucket \u540D\u3092\u4FDD\u5B58","kanban.bucket.cancelRename":"\u540D\u524D\u5909\u66F4\u3092\u30AD\u30E3\u30F3\u30BB\u30EB","kanban.search.placeholder":"\u30AB\u30FC\u30C9\u3068 bucket \u3092\u691C\u7D22","kanban.search.clear":"\u691C\u7D22\u3092\u30AF\u30EA\u30A2","kanban.search.results":"{count} \u4EF6\u306E\u30AB\u30FC\u30C9\u304C\u4E00\u81F4","kanban.search.noMatch":"\u4E00\u81F4\u3059\u308B\u30AB\u30FC\u30C9\u306F\u3042\u308A\u307E\u305B\u3093","kanban.card.progress":"\u9032\u6357","kanban.card.openDetail":"\u8A73\u7D30\u3092\u958B\u304F","kanban.priority.critical":"\u7DCA\u6025","kanban.priority.high":"\u9AD8","kanban.priority.medium":"\u4E2D","kanban.priority.low":"\u4F4E","quickCreate.newItem":"\u65B0\u898F\u4F5C\u6210","quickCreate.createWithTitle":"{title} \u3092\u4F5C\u6210","quickEdit.editWithTitle":"{title} \u3092\u7DE8\u96C6","quickDelete.confirmTitle":"\u524A\u9664\u306E\u78BA\u8A8D","quickDelete.confirmMessageSingle":"\u9078\u629E\u3057\u305F\u30EC\u30B3\u30FC\u30C9\u3092\u524A\u9664\u3057\u3066\u3082\u3088\u308D\u3057\u3044\u3067\u3059\u304B\uFF1F","quickDelete.confirmMessageMultiple":"\u9078\u629E\u3057\u305F {count} \u4EF6\u306E\u30EC\u30B3\u30FC\u30C9\u3092\u524A\u9664\u3057\u3066\u3082\u3088\u308D\u3057\u3044\u3067\u3059\u304B\uFF1F","cardPage.viewDetails":"\u8A73\u7D30\u3092\u8868\u793A","cardPage.download":"\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9","cardPage.close":"\u9589\u3058\u308B","cardPage.empty":"\u9805\u76EE\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093","messageBox.confirm":"OK","messageBox.cancel":"\u30AD\u30E3\u30F3\u30BB\u30EB"},ng={"common.cancel":"\uCDE8\uC18C","common.save":"\uC800\uC7A5","common.ok":"\uD655\uC778","common.done":"\uC644\uB8CC","common.search":"\uAC80\uC0C9","common.none":"\uC5C6\uC74C","common.all":"\uC804\uCCB4","common.noData":"\uB370\uC774\uD130 \uC5C6\uC74C","common.copy":"\uBCF5\uC0AC","common.delete":"\uC0AD\uC81C","common.loading":"\uB85C\uB529 \uC911...","header.searchPlaceholder":"\uBB34\uC5C7\uC774\uB4E0 \uBB3C\uC5B4\uBCF4\uC138\uC694...","header.searchAddFeature":"\uAE30\uB2A5 \uCD94\uAC00","header.searchSend":"\uBCF4\uB0B4\uAE30","header.searchStartVoice":"\uC74C\uC131 \uC785\uB825 \uC2DC\uC791","header.searchStopVoice":"\uC74C\uC131 \uC785\uB825 \uC911\uC9C0","header.theme.system":"\uD14C\uB9C8: \uC2DC\uC2A4\uD15C","header.theme.dark":"\uD14C\uB9C8: \uB2E4\uD06C","header.theme.light":"\uD14C\uB9C8: \uB77C\uC774\uD2B8","header.menu.setting":"\uC124\uC815","header.menu.refresh":"\uC0C8\uB85C \uACE0\uCE68","header.menu.logout":"\uB85C\uADF8\uC544\uC6C3","navigation.expand":"\uD0D0\uC0C9 \uD3BC\uCE58\uAE30","navigation.collapse":"\uD0D0\uC0C9 \uC811\uAE30","navigation.searchPlaceholder":"\uBA54\uB274 \uAC80\uC0C9...","navigation.noMatch":"\uC77C\uCE58\uD558\uB294 \uBA54\uB274\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4","navigation.noAccessibleApp":"\uC811\uADFC \uAC00\uB2A5\uD55C \uC571\uC774 \uC5C6\uC2B5\uB2C8\uB2E4","navigation.noItems":"\uD45C\uC2DC\uD560 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4","navigation.expandView":"{title} \uD3BC\uCE58\uAE30","navigation.mode.switchToFixed":"\uACE0\uC815 \uD0D0\uC0C9\uC73C\uB85C \uC804\uD658","navigation.mode.switchToFloating":"\uD50C\uB85C\uD305 \uD0D0\uC0C9\uC73C\uB85C \uC804\uD658","navigation.pinned":"\uACE0\uC815\uB428","navigation.pin.add":"\uC0C1\uB2E8\uC5D0 \uACE0\uC815","navigation.pin.remove":"\uACE0\uC815 \uD574\uC81C","table.toolbar.searchPlaceholder":"\uAC80\uC0C9...","table.title.default":"\uB370\uC774\uD130 \uD14C\uC774\uBE14","table.toolbar.groupBy":"\uADF8\uB8F9","table.toolbar.summary":"\uC694\uC57D","table.toolbar.columns":"\uC5F4","table.toolbar.export":"\uB0B4\uBCF4\uB0B4\uAE30","table.toolbar.itemsPerPage":"\uD398\uC774\uC9C0\uB2F9 \uD589 \uC218:","table.toolbar.pageOf":"{current} / {total} \uD398\uC774\uC9C0","table.toolbar.newItem":"\uC2E0\uADDC \uD56D\uBAA9","table.toolbar.editItem":"\uD56D\uBAA9 \uC218\uC815","table.toolbar.deleteItem":"\uD56D\uBAA9 \uC0AD\uC81C","table.toolbar.graphicReport":"\uADF8\uB798\uD504 \uB9AC\uD3EC\uD2B8","table.toolbar.saveLayout":"\uB808\uC774\uC544\uC6C3 \uC800\uC7A5","table.menu.groupBy":"\uADF8\uB8F9","table.menu.clearAll":"\uBAA8\uB450 \uC9C0\uC6B0\uAE30","table.menu.visibleColumns":"\uD45C\uC2DC \uC5F4","table.menu.showSummaryRow":"\uC694\uC57D \uD589 \uD45C\uC2DC","table.menu.noNumericColumns":"\uC22B\uC790 \uC5F4 \uC5C6\uC74C","table.group.expandAll":"\uBAA8\uB4E0 \uADF8\uB8F9 \uD3BC\uCE58\uAE30","table.group.collapseAll":"\uBAA8\uB4E0 \uADF8\uB8F9 \uC811\uAE30","table.mobile.notImplemented":"\uBAA8\uBC14\uC77C \uBDF0\uB294 \uC544\uC9C1 \uAD6C\uD604\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4","table.headerMenu.sortAsc":"\uC624\uB984\uCC28\uC21C \uC815\uB82C","table.headerMenu.sortDesc":"\uB0B4\uB9BC\uCC28\uC21C \uC815\uB82C","table.headerMenu.clearSort":"\uC815\uB82C \uD574\uC81C","table.headerMenu.configureSort":"\uC815\uB82C \uC124\uC815...","table.headerMenu.group":"\uC774 \uC5F4\uB85C \uADF8\uB8F9\uD654","table.headerMenu.ungroup":"\uADF8\uB8F9\uC5D0\uC11C \uC81C\uAC70","table.headerMenu.addSummary":"\uC694\uC57D\uC5D0 \uCD94\uAC00","table.headerMenu.removeSummary":"\uC694\uC57D\uC5D0\uC11C \uC81C\uAC70","table.headerMenu.hideColumn":"\uC5F4 \uC228\uAE30\uAE30","table.sortDialog.title":"\uC815\uB82C \uC124\uC815","table.sortDialog.empty":"\uC815\uB82C \uADDC\uCE59\uC774 \uC5C6\uC2B5\uB2C8\uB2E4. \uCD94\uAC00\uD558\uC138\uC694.","table.sortDialog.addRule":"\uADDC\uCE59 \uCD94\uAC00","table.sortDialog.clearAll":"\uBAA8\uB450 \uC9C0\uC6B0\uAE30","table.sortDialog.asc":"\uC624\uB984\uCC28\uC21C","table.sortDialog.desc":"\uB0B4\uB9BC\uCC28\uC21C","pivot.title.default":"\uD53C\uBC97 \uD14C\uC774\uBE14","pivot.subtitle.default":"\uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uD53C\uBC97 \uD14C\uC774\uBE14\uC744 \uAD6C\uC131\uD558\uC138\uC694.","pivot.empty":"\uACB0\uACFC\uB97C \uBCF4\uB824\uBA74 \uAC12 \uC601\uC5ED\uC5D0 \uCD5C\uC18C \uD55C \uAC1C\uC758 \uD544\uB4DC\uB97C \uCD94\uAC00\uD558\uC138\uC694.","pivot.records":"\uB808\uCF54\uB4DC","pivot.afterFilter":"\uD544\uD130 \uD6C4","pivot.grandTotal":"\uCD1D\uD569","pivot.resultLabel":"\uACB0\uACFC","pivot.valueLabel":"\uAC12","pivot.table.dimensions":"\uCC28\uC6D0","pivot.config.title":"\uAD6C\uC131","pivot.fieldList":"\uD544\uB4DC \uBAA9\uB85D","pivot.availableDimensions":"\uC0AC\uC6A9 \uAC00\uB2A5\uD55C \uCC28\uC6D0","pivot.allFieldsInUse":"\uBAA8\uB4E0 \uD544\uB4DC\uAC00 \uC774\uBBF8 \uC0AC\uC6A9 \uC911\uC785\uB2C8\uB2E4.","pivot.zone.rows":"\uD589","pivot.zone.columns":"\uC5F4","pivot.zone.filters":"\uD544\uD130","pivot.zone.values":"\uAC12","pivot.hint.rows":"\uC5EC\uAE30\uC5D0 \uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uD589 \uACC4\uCE35\uC744 \uAD6C\uC131","pivot.hint.columns":"\uC5EC\uAE30\uC5D0 \uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uC5F4 \uACC4\uCE35\uC744 \uAD6C\uC131","pivot.hint.filters":"\uC5EC\uAE30\uC5D0 \uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uBCF4\uACE0\uC11C \uD544\uD130\uB85C \uC0AC\uC6A9","pivot.hint.values":"\uC22B\uC790 \uD544\uB4DC\uB97C \uC5EC\uAE30\uC5D0 \uB4DC\uB798\uADF8\uD558\uC5EC \uC9D1\uACC4","pivot.clearArea":"\uC601\uC5ED \uBE44\uC6B0\uAE30","pivot.filter.na":"\uD574\uB2F9 \uC5C6\uC74C","pivot.filter.noValues":"\uAC12 \uC5C6\uC74C","pivot.filter.noneSelected":"\uC120\uD0DD \uC5C6\uC74C","pivot.filter.allValues":"\uBAA8\uB4E0 \uAC12","pivot.filter.selectedCount":"{selected} / {total} \uC120\uD0DD\uB428","pivot.filter.selectAll":"\uC804\uCCB4 \uC120\uD0DD","pivot.filter.deselectAll":"\uC804\uCCB4 \uD574\uC81C","pivot.filter.noResults":"\uAC80\uC0C9 \uACB0\uACFC \uC5C6\uC74C","pivot.collapse.ariaExpand":"\uAD6C\uC131 \uC601\uC5ED \uD3BC\uCE58\uAE30","pivot.collapse.ariaCollapse":"\uAD6C\uC131 \uC601\uC5ED \uC811\uAE30","pivot.agg.sum":"\uD569\uACC4","pivot.agg.count":"\uAC1C\uC218","pivot.agg.avg":"\uD3C9\uADE0","pivot.agg.min":"\uCD5C\uC18C","pivot.agg.max":"\uCD5C\uB300","pivot.preset.selectPlaceholder":"\uD504\uB9AC\uC14B \uC120\uD0DD","pivot.preset.save":"\uD504\uB9AC\uC14B \uC800\uC7A5","pivot.preset.delete":"\uD504\uB9AC\uC14B \uC0AD\uC81C","pivot.preset.saveDialogTitle":"\uD604\uC7AC \uD504\uB9AC\uC14B \uC800\uC7A5","pivot.preset.nameLabel":"\uD504\uB9AC\uC14B \uC774\uB984","pivot.preset.defaultName":"\uD504\uB9AC\uC14B {index}","pivot.table.sectionTitle":"\uD53C\uBC97 \uACB0\uACFC","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"\uD53C\uBC97 \uACB0\uACFC \uD3BC\uCE58\uAE30","pivot.table.collapse.ariaCollapse":"\uD53C\uBC97 \uACB0\uACFC \uC811\uAE30","pivot.chart.title":"\uD53C\uBC97 \uCC28\uD2B8","pivot.chart.subtitle":"\uD558\uB098\uC758 \uCC28\uC6D0\uACFC \uCD5C\uB300 \uB450 \uAC1C\uC758 \uCE21\uC815\uAC12\uC744 \uAC04\uACB0\uD55C \uCC28\uD2B8\uB85C \uD45C\uC2DC\uD569\uB2C8\uB2E4.","pivot.chart.subtitleReady":"{dimension}\uBCC4 {measure}","pivot.chart.emptyNoDimension":"\uCC28\uD2B8\uB97C \uBCF4\uB824\uBA74 \uCD5C\uC18C \uD55C \uAC1C\uC758 \uD589 \uB610\uB294 \uC5F4 \uD544\uB4DC\uB97C \uCD94\uAC00\uD558\uC138\uC694.","pivot.chart.emptyNoValue":"\uCC28\uD2B8\uB97C \uBCF4\uB824\uBA74 \uCD5C\uC18C \uD55C \uAC1C\uC758 \uAC12 \uD544\uB4DC\uB97C \uCD94\uAC00\uD558\uC138\uC694.","pivot.chart.emptyNoData":"\uD604\uC7AC \uCC28\uD2B8 \uC120\uD0DD\uC5D0 \uD45C\uC2DC\uD560 \uB370\uC774\uD130\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.","pivot.chart.dimension":"\uCC28\uD2B8 \uCC28\uC6D0","pivot.chart.primaryMeasure":"\uC8FC \uCE21\uC815\uAC12","pivot.chart.secondaryMeasure":"\uBE44\uAD50 \uCE21\uC815\uAC12","pivot.chart.chartType":"\uCC28\uD2B8 \uC720\uD615","pivot.chart.style.barVertical":"\uC138\uB85C \uB9C9\uB300","pivot.chart.style.barHorizontal":"\uAC00\uB85C \uB9C9\uB300","pivot.chart.style.line":"\uC120\uD615 \uCC28\uD2B8","pivot.chart.style.scatter":"\uC0B0\uC810\uB3C4","pivot.chart.collapse.ariaExpand":"\uCC28\uD2B8 \uC601\uC5ED \uD3BC\uCE58\uAE30","pivot.chart.collapse.ariaCollapse":"\uCC28\uD2B8 \uC601\uC5ED \uC811\uAE30","smartFilter.adaptFilters":"\uD544\uD130 \uC870\uC815","smartFilter.addFilters":"\uD544\uD130 \uCD94\uAC00","smartFilter.go":"\uC2E4\uD589","smartFilter.visibleFilters":"\uD45C\uC2DC \uD544\uD130","smartFilter.searchPlaceholder":"\uAC80\uC0C9...","smartFilter.noOptionsFound":"\uC635\uC158\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4","smartFilter.min":"\uCD5C\uC18C","smartFilter.max":"\uCD5C\uB300","smartFilter.minMaxPlaceholder":"\uCD5C\uC18C - \uCD5C\uB300","smartFilter.operator.equals":"\uAC19\uC74C","smartFilter.operator.contains":"\uD3EC\uD568","smartFilter.operator.notContains":"\uBBF8\uD3EC\uD568","smartFilter.operator.wildcard":"\uC640\uC77C\uB4DC\uCE74\uB4DC \uAC80\uC0C9","smartFilter.operator.notEquals":"\uAC19\uC9C0 \uC54A\uC74C","smartFilter.operator.greaterThan":"\uBCF4\uB2E4 \uD07C","smartFilter.operator.lessThan":"\uBCF4\uB2E4 \uC791\uC74C","smartFilter.operator.greaterOrEqual":"\uC774\uC0C1","smartFilter.operator.lessOrEqual":"\uC774\uD558","smartFilter.operator.between":"\uBC94\uC704","variant.noOptions":"\uC635\uC158 \uC5C6\uC74C","variant.defaultSuffix":"\uAE30\uBCF8","variant.selectVariant":"\uBDF0 \uC120\uD0DD","variant.saveView":"\uBDF0 \uC800\uC7A5","variant.newVariant":"\uC0C8 \uBDF0","variant.viewName":"\uBDF0 \uC774\uB984","variant.setDefault":"\uAE30\uBCF8\uC73C\uB85C \uC124\uC815","variant.publicAllUsers":"\uACF5\uAC1C(\uC804\uCCB4 \uC0AC\uC6A9\uC790)","variant.toast.fetchFailed":"\uBDF0\uB97C \uBD88\uB7EC\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.saveFailed":"\uBDF0\uB97C \uC800\uC7A5\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.saveSuccess":"\uBDF0\uAC00 \uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4","variant.toast.deleteFailed":"\uBDF0\uB97C \uC0AD\uC81C\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.deleteSuccess":"\uBDF0\uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4","variant.toast.defaultFailed":"\uAE30\uBCF8 \uBDF0\uB97C \uC5C5\uB370\uC774\uD2B8\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.defaultSuccess":"\uAE30\uBCF8 \uBDF0\uAC00 \uC5C5\uB370\uC774\uD2B8\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.saveLayout":"\uB808\uC774\uC544\uC6C3 \uC800\uC7A5","layout.layoutOptions":"\uB808\uC774\uC544\uC6C3 \uC635\uC158","layout.selectLayout":"\uB808\uC774\uC544\uC6C3 \uC120\uD0DD","layout.saveCurrentLayout":"\uD604\uC7AC \uB808\uC774\uC544\uC6C3 \uC800\uC7A5...","layout.noSavedLayouts":"\uC800\uC7A5\uB41C \uB808\uC774\uC544\uC6C3 \uC5C6\uC74C","layout.removeDefault":"\uAE30\uBCF8 \uD574\uC81C","layout.setAsDefault":"\uAE30\uBCF8\uC73C\uB85C \uC124\uC815","layout.layoutName":"\uB808\uC774\uC544\uC6C3 \uC774\uB984","layout.layoutDescription":"\uC124\uBA85","layout.layoutNameHelper":"\uC608: \uCEF4\uD329\uD2B8 \uBDF0","layout.warningOverwrite":"\uACBD\uACE0: \uAE30\uC874 \uB808\uC774\uC544\uC6C3\uC774 \uB36E\uC5B4\uC4F0\uAE30 \uB429\uB2C8\uB2E4","layout.useAsDefault":"\uAE30\uBCF8 \uB808\uC774\uC544\uC6C3\uC73C\uB85C \uC0AC\uC6A9","layout.publicAllUsers":"\uACF5\uAC1C(\uBAA8\uB4E0 \uC0AC\uC6A9\uC790\uC5D0\uAC8C \uD45C\uC2DC)","layout.toast.loadFallback":"\uBC31\uC5D4\uB4DC\uC5D0\uC11C \uB808\uC774\uC544\uC6C3\uC744 \uBD88\uB7EC\uC624\uC9C0 \uBABB\uD574 \uB85C\uCEEC \uC800\uC7A5\uC18C\uB85C \uC804\uD658\uD588\uC2B5\uB2C8\uB2E4","layout.toast.saveSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.saveLocalSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uB85C\uCEEC \uC800\uC7A5\uC18C\uC5D0 \uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.backendUnavailableSavedLocal":"\uBC31\uC5D4\uB4DC\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC5B4 \uB85C\uCEEC\uC5D0 \uC800\uC7A5\uD588\uC2B5\uB2C8\uB2E4","layout.toast.deleteSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.deleteLocalSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uB85C\uCEEC \uC800\uC7A5\uC18C\uC5D0\uC11C \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.backendUnavailableDeletedLocal":"\uBC31\uC5D4\uB4DC\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC5B4 \uB85C\uCEEC\uC5D0\uC11C \uC0AD\uC81C\uD588\uC2B5\uB2C8\uB2E4","layout.toast.defaultSuccess":"\uAE30\uBCF8 \uB808\uC774\uC544\uC6C3\uC774 \uC124\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.defaultLocalSuccess":"\uAE30\uBCF8 \uB808\uC774\uC544\uC6C3\uC774 \uB85C\uCEEC\uC5D0 \uC124\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.backendUnavailableDefaultLocal":"\uBC31\uC5D4\uB4DC\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC5B4 \uAE30\uBCF8\uAC12\uC744 \uB85C\uCEEC\uC5D0 \uC800\uC7A5\uD588\uC2B5\uB2C8\uB2E4","dateRange.label":"\uB0A0\uC9DC \uBC94\uC704","dateRange.startDate":"\uC2DC\uC791\uC77C","dateRange.endDate":"\uC885\uB8CC\uC77C","dateRange.select":"\uC120\uD0DD...","dateRange.today":"\uC624\uB298","dateRange.thisWeek":"\uC774\uBC88 \uC8FC","dateRange.thisMonth":"\uC774\uBC88 \uB2EC","graph.records":"{count}\uAC74","graph.kpi.totalRecords":"\uCD1D \uB808\uCF54\uB4DC","graph.kpi.totalReport":"\uCD1D \uBCF4\uACE0 \uC2DC\uAC04","graph.kpi.totalBillable":"\uCD1D \uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04","graph.kpi.efficiency":"\uD6A8\uC728","graph.kpi.amount":"\uAE08\uC561","graph.kpi.flagged":"\uD50C\uB798\uADF8","graph.chart.billable.title":"\uCC28\uC6D0\uBCC4 \uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04","graph.chart.billable.subtitle":"\uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04 \uC0C1\uC704 \uAC12","graph.chart.efficiency.title":"\uB2F4\uB2F9\uC790\uBCC4 \uD6A8\uC728","graph.chart.efficiency.subtitle":"\uB0AE\uC740 \uD6A8\uC728 \uC6B0\uC120","graph.chart.status.title":"\uC0C1\uD0DC \uBD84\uD3EC","graph.chart.status.subtitle":"\uC0C1\uD0DC\uBCC4 \uBE44\uC728","graph.dataBody":"\uB370\uC774\uD130 \uBCF8\uBB38","graph.reportTitle":"\uADF8\uB798\uD504 \uB9AC\uD3EC\uD2B8","graph.unassigned":"\uBBF8\uC9C0\uC815","graph.column.reportHours":"\uBCF4\uACE0 \uC2DC\uAC04","graph.column.billableHours":"\uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04","detail.searchAi.placeholder":"\uD544\uB4DC\uB97C \uAC80\uC0C9\uD558\uACE0, \uACB0\uACFC\uAC00 \uC5C6\uC73C\uBA74 AI\uC5D0 \uC9C8\uBB38\uD558\uC138\uC694...","detail.searchAi.matches":"{count}\uAC1C \uC77C\uCE58 \uD56D\uBAA9","detail.searchAi.noMatch":"\uC77C\uCE58\uD558\uB294 \uD544\uB4DC\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.","detail.searchAi.autoAiFallback":"\uC77C\uCE58 \uD56D\uBAA9\uC774 \uC5C6\uC5B4 AI \uBD84\uC11D\uC744 \uC2E4\uD589\uD569\uB2C8\uB2E4...","detail.searchAi.aiResultTitle":"AI \uBD84\uC11D \uACB0\uACFC","detail.table.title":"\uAD00\uB828 \uB808\uCF54\uB4DC","kanban.empty":"\uC5EC\uAE30\uC5D0 \uCE74\uB4DC\uB97C \uB193\uC73C\uC138\uC694","kanban.bucket.limit":"\uD55C\uB3C4","kanban.bucket.dropHere":"\uB193\uC73C\uBA74 \uC774 \uBC84\uD0B7\uC73C\uB85C \uC774\uB3D9\uD569\uB2C8\uB2E4","kanban.bucket.add":"\uBC84\uD0B7 \uCD94\uAC00","kanban.bucket.rename":"\uBC84\uD0B7 \uC774\uB984 \uBCC0\uACBD","kanban.bucket.saveRename":"\uBC84\uD0B7 \uC774\uB984 \uC800\uC7A5","kanban.bucket.cancelRename":"\uC774\uB984 \uBCC0\uACBD \uCDE8\uC18C","kanban.search.placeholder":"\uCE74\uB4DC \uBC0F \uBC84\uD0B7 \uAC80\uC0C9","kanban.search.clear":"\uAC80\uC0C9 \uC9C0\uC6B0\uAE30","kanban.search.results":"\uC77C\uCE58\uD558\uB294 \uCE74\uB4DC {count}\uAC1C","kanban.search.noMatch":"\uC77C\uCE58\uD558\uB294 \uCE74\uB4DC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4","kanban.card.progress":"\uC9C4\uD589\uB960","kanban.card.openDetail":"\uC0C1\uC138 \uC5F4\uAE30","kanban.priority.critical":"\uAE34\uAE09","kanban.priority.high":"\uB192\uC74C","kanban.priority.medium":"\uBCF4\uD1B5","kanban.priority.low":"\uB0AE\uC74C","quickCreate.newItem":"\uC2E0\uADDC \uD56D\uBAA9","quickCreate.createWithTitle":"{title} \uC0DD\uC131","quickEdit.editWithTitle":"{title} \uC218\uC815","quickDelete.confirmTitle":"\uC0AD\uC81C \uD655\uC778","quickDelete.confirmMessageSingle":"\uC120\uD0DD\uD55C \uD56D\uBAA9\uC744 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?","quickDelete.confirmMessageMultiple":"\uC120\uD0DD\uD55C {count}\uAC1C \uD56D\uBAA9\uC744 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?","cardPage.viewDetails":"\uC0C1\uC138 \uBCF4\uAE30","cardPage.download":"\uB2E4\uC6B4\uB85C\uB4DC","cardPage.close":"\uB2EB\uAE30","cardPage.empty":"\uD56D\uBAA9\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4","messageBox.confirm":"\uD655\uC778","messageBox.cancel":"\uCDE8\uC18C"},Ia={en:eg,zh:tg,fr:og,de:rg,ja:ag,ko:ng};var Kl=(t,o)=>o?t.replace(/\{(\w+)\}/g,(r,a)=>{let n=o[a];return n==null?"":String(n)}):t,cg={locale:"en",t:(t,o)=>Kl(Ia.en[t]||t,o)},ql=createContext(cg),yn=({locale:t="en",messages:o,children:r})=>{let a=useMemo(()=>{let n=Ia[t]||Ia.en,i=o?.[t]||{},s={...Ia.en,...n,...i};return {locale:t,t:(c,d)=>Kl(s[c]||c,d)}},[t,o]);return f(ql.Provider,{value:a,children:r})},ce=()=>useContext(ql);function Ra({items:t,onItemClick:o,className:r="",level:a=0,expandedIds:n,onToggleExpand:i,colorMode:s="light",enablePinning:c=false,pinnedIds:d,onTogglePin:m}){let{t:p}=ce(),f$1=s==="dark",h=usePathname(),[u,v]=useState(false),[y,g$1]=useState(new Set),C=n!==void 0&&i!==void 0,b=C?n:y;useEffect(()=>{v(true);},[]);let S=x=>{if(C)i(x);else {let E=new Set(y);E.has(x)?E.delete(x):E.add(x),g$1(E);}},k=x=>{x.children&&x.children.length>0&&S(x.id),o&&o(x);};return !t||!Array.isArray(t)?f("div",{className:uo("tree-menu",r),children:f("div",{className:"text-sm text-[var(--orb-muted)] p-2",children:p("navigation.noItems")})}):f("div",{className:uo("tree-menu",r),children:t.map(x=>{let E=b.has(x.id)||x.isExpanded,D=x.children&&x.children.length>0,N=56+Math.max(0,a-1)*8,R=a===0?12:D?N-24:N,w=x.appurl||x.href,M=u&&w?h===w:false,I=d?.has(x.id)??false,L=c&&x.pinnable!==false&&!!w&&!D;return g("div",{className:"tree-menu-item relative",children:[M&&f("div",{className:uo("absolute left-0 top-2 bottom-2 w-[3px] rounded-r-full z-10","bg-[var(--orb-nav-active-fg)]")}),g(as,{variant:"ghost",className:uo("w-full justify-start h-auto py-2 relative overflow-hidden group",a>0?"gap-1":"gap-2",D&&E&&!M?f$1?"bg-[color-mix(in_oklch,var(--orb-inverse-fg)_5%,transparent)] text-[var(--orb-fg)] hover:bg-[color-mix(in_oklch,var(--orb-inverse-fg)_8%,transparent)]":"bg-[color-mix(in_oklch,var(--orb-surface)_70%,transparent)] text-[var(--orb-fg)] hover:bg-[var(--orb-surface)]":"",a>=2?"min-h-9 py-1.5 rounded-md":a>0?"min-h-10 rounded-lg":"rounded-lg",M?f$1?"bg-transparent text-[var(--orb-nav-active-fg)] hover:bg-[color-mix(in_oklch,var(--orb-surface-2)_35%,transparent)]":"bg-transparent text-[var(--orb-nav-active-fg)] hover:bg-[color-mix(in_oklch,var(--orb-surface)_60%,transparent)]":f$1?"hover:bg-[color-mix(in_oklch,var(--orb-surface-2)_50%,transparent)] text-[var(--orb-fg)]":"hover:bg-[color-mix(in_oklch,var(--orb-surface)_50%,transparent)] text-[var(--orb-fg)]"),style:{paddingLeft:`${R}px`,paddingRight:L?"34px":"10px"},onClick:()=>k(x),children:[D&&f("div",{className:uo("flex-shrink-0 transition-transform duration-200",E&&"rotate-90",M?"text-[var(--orb-nav-active-fg)]":f$1?"text-[var(--orb-muted)] group-hover:text-[var(--orb-fg)]":"text-[var(--orb-muted)] group-hover:text-[var(--orb-muted)]"),children:f(Eo,{className:"h-4 w-4"})}),x.icon&&f("div",{className:uo("flex h-4 w-4 flex-shrink-0 items-center justify-center transition-colors duration-200",M?"text-[var(--orb-nav-active-fg)]":f$1?"text-[var(--orb-muted)] group-hover:text-[var(--orb-fg)]":"text-[var(--orb-muted)] group-hover:text-[var(--orb-muted)]"),children:x.icon}),g("div",{className:"flex-1 text-left overflow-hidden z-10",children:[f("div",{className:uo("text-sm truncate transition-colors duration-200",M?"font-semibold":"font-medium"),children:x.title||x.label}),x.description&&f("div",{className:uo("text-xs truncate transition-colors duration-200",M?f$1?"text-[color-mix(in_oklch,var(--orb-nav-active-fg)_70%,transparent)]":"text-[color-mix(in_oklch,var(--orb-nav-active-fg)_75%,transparent)]":"text-[var(--orb-muted)]"),title:x.description,children:x.description})]})]}),L&&m&&f("button",{type:"button","aria-label":p(I?"navigation.pin.remove":"navigation.pin.add"),"aria-pressed":I,title:p(I?"navigation.pin.remove":"navigation.pin.add"),onClick:O=>{O.preventDefault(),O.stopPropagation(),m(x);},className:uo("orb-navigation-pin-button absolute right-1 top-1/2 z-20 flex h-7 w-7 -translate-y-1/2 items-center justify-center rounded-md transition-colors duration-150",I&&"orb-is-pinned"),children:f($r,{className:uo("h-3.5 w-3.5",I&&"fill-current")})}),D&&f("div",{className:uo("grid transition-[grid-template-rows] duration-300 ease-in-out",E?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:f("div",{className:uo("overflow-hidden",E&&"pt-1"),children:f(Ra,{items:x.children,onItemClick:o,level:a+1,expandedIds:n,onToggleExpand:i,colorMode:s,enablePinning:c,pinnedIds:d,onTogglePin:m})})})]},x.id)})})}var mg="orbcafe:navigation-island:pinned-items",ns="orbcafe-navigation-pinned",gg=t=>t.appurl||t.href,Yl=t=>{let o=[];return t.forEach(r=>{let a=!!r.children?.length;r.pinnable!==false&&gg(r)&&!a&&o.push({...r,children:void 0}),r.children?.length&&o.push(...Yl(r.children));}),o},Zl=({collapsed:t,onToggle:o,className:r="",maxHeight:a,menuData:n=[],colorMode:i="light",displayMode:s="fixed",onDisplayModeChange:c,showDisplayModeToggle:d=true,enablePinning:m=true,pinStorageKey:p=mg,pinnedItemIds:f$1,defaultPinnedItemIds:h=[],onPinnedItemIdsChange:u,pinnedSectionTitle:v})=>{let{t:y}=ce(),g$1=i==="dark",C=s==="floating",b=useRouter(),[S,k]=useState(""),[x,E]=useState(new Set),[D,T]=useState(h),[N,R]=useState(false),w=f$1!==void 0,M=useMemo(()=>f$1??D,[f$1,D]),I=useMemo(()=>new Set(M),[M]);useEffect(()=>{t&&E(new Set);},[t]),useEffect(()=>{if(!m||w){R(true);return}try{let V=window.localStorage.getItem(p);if(V){let Z=JSON.parse(V);Array.isArray(Z)&&T(Z.filter(j=>typeof j=="string"));}}catch{}finally{R(true);}},[m,w,p]),useEffect(()=>{if(!(!m||w||!N))try{window.localStorage.setItem(p,JSON.stringify(M));}catch{}},[M,m,w,p,N]),useEffect(()=>{!m||t||M.length===0||E(V=>{if(V.has(ns))return V;let Z=new Set(V);return Z.add(ns),Z});},[t,M.length,m]);let L=useCallback(V=>{let Z=Array.from(new Set(V));w||T(Z),u?.(Z);},[w,u]),O=useCallback(V=>{let Z=V.id,j=I.has(Z)?M.filter(me=>me!==Z):[...M,Z];L(j);},[M,I,L]),U=useMemo(()=>{if(!m||M.length===0)return n;let V=new Map(Yl(n).map(j=>[j.id,j])),Z=M.map(j=>V.get(j)).filter(j=>!!j);return Z.length===0?n:[{id:ns,title:v||y("navigation.pinned"),icon:f($r,{className:"w-4 h-4"}),children:Z,pinnable:false},...n]},[M,m,n,v,y]),z=useCallback(V=>{let Z=[],j=me=>{me.forEach(ie=>{Z.push(ie.id),ie.children&&j(ie.children);});};return j(V),Z},[]),K=useMemo(()=>{if(!S.trim())return U;let V=Z=>Z.reduce((j,me)=>{let ie=me.title?.toLowerCase().includes(S.toLowerCase())||me.description?.toLowerCase().includes(S.toLowerCase()),ge=me.children?V(me.children):[];return (ie||ge.length>0)&&j.push({...me,children:ge.length>0?ge:me.children}),j},[]);return V(U)},[S,U]),W=useMemo(()=>S.trim()?new Set(z(U)):x,[S,U,x,z]),q=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{b.push("/chat?new=true");}catch(j){console.error("\u274C \u65E0\u6CD5\u8DF3\u8F6C\u5230\u65B0\u804A\u5929\u89C6\u56FE:",j),b.push("/chat");}return}let Z=V.appurl||V.href;Z&&(Z.startsWith("http://")||Z.startsWith("https://")?window.open(Z,"_blank"):b.push(Z));},[b]),H=useCallback(()=>{c?.(s==="fixed"?"floating":"fixed");},[s,c]);return g("div",{className:`flex flex-col backdrop-blur-xl border ${C?"shadow-[0_28px_80px_rgba(15,23,42,0.34)]":"shadow-[0_4px_8px_0_rgba(31,38,135,0.1)]"} ${t?"w-14 rounded-full":"w-[234px] rounded-2xl"} relative ${r} ${g$1?C?"border-white/25":"bg-[var(--orb-nav-bg)] border-white/10":C?"border-white/70":"bg-[color-mix(in_oklch,var(--orb-canvas)_70%,transparent)] border-white/30"}`,style:{backdropFilter:C?"blur(34px) saturate(230%) contrast(1.12)":"blur(16px) saturate(180%)",WebkitBackdropFilter:C?"blur(34px) saturate(230%) contrast(1.12)":"blur(16px) saturate(180%)",backgroundColor:C?g$1?"rgba(8, 12, 18, 0.34)":"rgba(255, 255, 255, 0.24)":void 0,backgroundImage:C?g$1?"radial-gradient(circle at 28% 8%, rgba(255,255,255,0.14), rgba(255,255,255,0) 44%), linear-gradient(145deg, rgba(255,255,255,0.08), rgba(255,255,255,0.015) 50%, color-mix(in oklch, var(--orb-ai-accent) 5%, transparent))":"radial-gradient(circle at 28% 8%, rgba(255,255,255,0.42), rgba(255,255,255,0) 46%), linear-gradient(145deg, rgba(255,255,255,0.22), rgba(255,255,255,0.07) 50%, color-mix(in oklch, var(--orb-ai-accent) 8%, transparent))":void 0,boxShadow:C?g$1?"inset 0 1px 0 rgba(255,255,255,0.20), inset 0 -1px 0 rgba(255,255,255,0.08), 0 26px 90px rgba(0,0,0,0.52), 0 0 0 1px rgba(255,255,255,0.06)":"inset 0 1px 0 rgba(255,255,255,0.88), inset 0 -1px 0 rgba(255,255,255,0.34), 0 26px 90px rgba(15,23,42,0.24), 0 0 0 1px rgba(255,255,255,0.35)":void 0,transition:"width 400ms cubic-bezier(0.4, 0.0, 0.2, 1), border-radius 0ms cubic-bezier(0.4, 0.0, 0.2, 1), box-shadow 400ms ease-out, background-color 220ms ease-out, backdrop-filter 220ms ease-out",maxHeight:a?`${a}px`:void 0},children:[f("div",{className:`pt-4 pb-2 transition-all duration-500 ease-in-out ${t?"px-1":"px-2"}`,children:t?f("div",{className:"flex justify-center",children:f("button",{onClick:o,className:`w-10 h-10 flex items-center justify-center rounded-lg transition-colors duration-200 ${g$1?"text-[var(--orb-fg)] hover:bg-[var(--orb-surface-2)]":"text-[var(--orb-muted)] hover:bg-[var(--orb-surface)]"}`,title:y("navigation.expand"),children:f(Lo,{className:"h-5 w-5"})})}):g("div",{className:`relative transition-opacity duration-300 ${t?"opacity-0":"opacity-100 delay-200"}`,children:[f("input",{type:"text",placeholder:y("navigation.searchPlaceholder"),value:S,onChange:V=>k(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-[var(--orb-primary)] focus:border-transparent ${g$1?"border-[var(--orb-border)] bg-[var(--orb-surface-2)] text-[var(--orb-fg)] placeholder-[var(--orb-muted)]":"border-[var(--orb-border)] bg-[var(--orb-canvas)] text-[var(--orb-fg)] placeholder-[var(--orb-muted)]"}`}),f("div",{className:"absolute left-3 top-1/2 transform -translate-y-1/2 pointer-events-none",children:f(Lo,{className:"h-4 w-4 text-[var(--orb-muted)]"})})]})}),f("nav",{className:`flex-1 pb-4 transition-all duration-500 ease-in-out overflow-y-auto min-h-0 ${t?"px-1":"px-2"}`,children:K.length===0?f("div",{className:"flex items-center justify-center py-8 text-[var(--orb-muted)] text-sm",children:t?f(ya,{className:"h-5 w-5"}):y(S?"navigation.noMatch":"navigation.noAccessibleApp")}):g(e,{children:[!t&&f("div",{className:`transition-opacity duration-300 ${t?"opacity-0":"opacity-100 delay-200"}`,children:f(Ra,{items:K,onItemClick:q,className:"space-y-1",expandedIds:W,colorMode:i,enablePinning:m,pinnedIds:I,onTogglePin:O,onToggleExpand:V=>{let Z=new Set(x);K.some(me=>me.id===V)?Z.has(V)?Z.delete(V):(K.forEach(me=>{me.id!==V&&Z.has(me.id)&&Z.delete(me.id);}),Z.add(V)):Z.has(V)?Z.delete(V):Z.add(V),E(Z);}})}),t&&f("div",{className:"space-y-2",children:U.map(V=>f("div",{className:"space-y-1",children:f("button",{onClick:()=>{o();let Z=new Set([V.id]);E(Z);},className:`w-full flex items-center justify-center p-2 rounded-lg cursor-pointer transition-colors duration-200 ${g$1?"text-[var(--orb-muted)] hover:bg-[var(--orb-surface-2)]":"text-[var(--orb-muted)] hover:bg-[var(--orb-surface)]"}`,title:y("navigation.expandView",{title:V.title||""}),children:V.icon||f("div",{className:`w-6 h-6 rounded text-xs flex items-center justify-center font-medium ${g$1?"bg-[var(--orb-nav-active-fg)] text-[#0b0b0b]":"bg-[var(--orb-primary)] text-[var(--orb-on-primary)]"}`,children:V.title?.charAt(0)||"?"})})},V.id))})]})}),!t&&f("button",{onClick:o,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 ${g$1?"hover:bg-[color-mix(in_oklch,var(--orb-surface-2)_50%,transparent)]":"hover:bg-[color-mix(in_oklch,var(--orb-canvas)_20%,transparent)]"}`,title:y("navigation.collapse"),children:f("div",{className:"absolute",style:{bottom:"0px",right:"0px",width:"16px",height:"16px",overflow:"hidden"},children:f("div",{className:g$1?"border-[var(--orb-status-warning)]":"",style:{width:"32px",height:"32px",borderRadius:"16px",border:"3px solid var(--orb-ai-accent)",backgroundColor:"transparent",position:"absolute",top:"-16px",left:"-16px"}})})}),d&&t&&f("button",{type:"button",onClick:H,className:`absolute -bottom-4 left-1/2 z-30 flex h-9 w-9 -translate-x-1/2 items-center justify-center rounded-full border shadow-md transition-colors focus:outline-none focus:ring-2 focus:ring-[color-mix(in_oklch,var(--orb-primary)_45%,transparent)] ${g$1?"border-[var(--orb-border)] bg-[var(--orb-surface-2)] text-[var(--orb-fg)] hover:bg-[var(--orb-hover)]":"border-[var(--orb-border)] bg-[var(--orb-canvas)] text-[var(--orb-status-fg)] hover:bg-[var(--orb-p50)] hover:text-[var(--orb-status-primary)]"}`,style:{touchAction:"manipulation"},title:y(C?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),"aria-label":y(C?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),children:C?f(ln,{className:"h-4 w-4"}):f(cn,{className:"h-4 w-4"})})]})};var hg="orbcafe:navigation-island:pinned-items",is="orbcafe-navigation-pinned",Ql=t=>t.appurl||t.href,jl=t=>t.flatMap(o=>{let r=!!o.children?.length,a=o.pinnable!==false&&Ql(o)&&!r?[{...o,children:void 0}]:[];return o.children?.length?[...a,...jl(o.children)]:a}),Jl=t=>t.flatMap(o=>[o.id,...o.children?Jl(o.children):[]]),ec=(t,o)=>t.reduce((r,a)=>{let n=a.children?ec(a.children,o):[];return ([a.title,a.label,a.description].some(s=>s?.toLocaleLowerCase().includes(o))||n.length>0)&&r.push({...a,children:n.length>0?n:a.children}),r},[]),ss=({collapsed:t,onToggle:o,className:r="",maxHeight:a,menuData:n=[],colorMode:i="light",displayMode:s="fixed",onDisplayModeChange:c,showDisplayModeToggle:d=true,enablePinning:m=true,pinStorageKey:p=hg,pinnedItemIds:f$1,defaultPinnedItemIds:h=[],onPinnedItemIdsChange:u,pinnedSectionTitle:v})=>{let{t:y}=ce(),g$1=useRouter(),C=s==="floating",[b,S]=useState(""),[k,x]=useState(new Set),[E,D]=useState(h),[T,N]=useState(false),R=f$1!==void 0,w=f$1??E,M=useMemo(()=>new Set(w),[w]);useEffect(()=>{t&&x(new Set);},[t]),useEffect(()=>{if(!m||R){N(true);return}try{let V=window.localStorage.getItem(p);if(V){let Z=JSON.parse(V);Array.isArray(Z)&&D(Z.filter(j=>typeof j=="string"));}}catch{}finally{N(true);}},[m,R,p]),useEffect(()=>{if(!(!m||R||!T))try{window.localStorage.setItem(p,JSON.stringify(w));}catch{}},[w,m,R,p,T]),useEffect(()=>{!m||t||w.length===0||x(V=>{if(V.has(is))return V;let Z=new Set(V);return Z.add(is),Z});},[t,w.length,m]);let I=useCallback(V=>{let Z=Array.from(new Set(V));R||D(Z),u?.(Z);},[R,u]),L=useCallback(V=>{I(M.has(V.id)?w.filter(Z=>Z!==V.id):[...w,V.id]);},[w,M,I]),O=useMemo(()=>{if(!m||w.length===0)return n;let V=new Map(jl(n).map(j=>[j.id,j])),Z=w.map(j=>V.get(j)).filter(j=>!!j);return Z.length===0?n:[{id:is,title:v||y("navigation.pinned"),icon:f($r,{className:"h-4 w-4"}),children:Z,pinnable:false},...n]},[w,m,n,v,y]),U=b.trim().toLocaleLowerCase(),z=useMemo(()=>U?ec(O,U):O,[O,U]),K=useMemo(()=>U?new Set(Jl(z)):k,[k,z,U]),W=useCallback(V=>{x(Z=>{let j=new Set(Z),me=z.some(ie=>ie.id===V);return j.has(V)?j.delete(V):(me&&z.forEach(ie=>j.delete(ie.id)),j.add(V)),j});},[z]),q=useCallback(V=>{let Z=Ql(V);Z&&(V.id==="chat"||V.appurl==="/chat"?g$1.push("/chat?new=true"):/^https?:\/\//.test(Z)?window.open(Z,"_blank","noopener,noreferrer"):g$1.push(Z));},[g$1]),H=V=>{o(),x(new Set([V.id]));};return g("aside",{"data-navigation-island":"v2","data-collapsed":t||void 0,className:`orb-navigation-island-v2 relative flex flex-col border ${t?"w-14":"w-[234px]"} ${r}`,style:{maxHeight:a?`${a}px`:void 0,transition:"width 320ms cubic-bezier(0.4, 0, 0.2, 1), border-radius 220ms ease, box-shadow 220ms ease"},"aria-label":"Navigation",children:[f("div",{className:`orb-navigation-island-v2-search ${t?"px-1":"px-2"}`,children:t?f("button",{type:"button",onClick:o,className:"mx-auto flex h-10 w-10 items-center justify-center rounded-lg text-[var(--orb-muted)] transition-colors hover:bg-[var(--orb-p50)] hover:text-[var(--orb-status-primary)]",title:y("navigation.expand"),"aria-label":y("navigation.expand"),children:f(Lo,{className:"h-5 w-5"})}):g("label",{className:"relative block",children:[f("span",{className:"orb-visually-hidden",children:y("navigation.searchPlaceholder")}),f(Lo,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-[var(--orb-muted)]"}),f("input",{type:"search",value:b,onChange:V=>S(V.target.value),placeholder:y("navigation.searchPlaceholder"),className:"w-full py-2 pl-10 pr-3 text-sm outline-none"})]})}),f("nav",{className:`min-h-0 flex-1 overflow-y-auto pb-2 ${t?"px-1":"px-2"}`,children:z.length===0?f("div",{className:"flex items-center justify-center py-8 text-sm text-[var(--orb-muted)]",children:t?f(ya,{className:"h-5 w-5"}):y(U?"navigation.noMatch":"navigation.noAccessibleApp")}):t?f("div",{className:"space-y-1",children:O.map(V=>f("button",{type:"button",onClick:()=>H(V),className:"flex h-10 w-full items-center justify-center rounded-lg text-[var(--orb-muted)] transition-colors hover:bg-[var(--orb-p50)] hover:text-[var(--orb-status-primary)]",title:y("navigation.expandView",{title:V.title||V.label||""}),children:V.icon||f(ya,{className:"h-5 w-5"})},V.id))}):f(Ra,{items:z,onItemClick:q,className:"space-y-1",expandedIds:K,onToggleExpand:W,colorMode:i,enablePinning:m,pinnedIds:M,onTogglePin:L})}),d&&t&&f("div",{className:"orb-navigation-island-v2-footer flex flex-col items-center gap-1 border-t px-1 py-2",children:f("button",{type:"button",onClick:()=>c?.(C?"fixed":"floating"),className:"flex h-9 w-9 items-center justify-center rounded-lg text-[var(--orb-muted)] transition-colors hover:bg-[var(--orb-p50)] hover:text-[var(--orb-status-primary)]",title:y(C?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),"aria-label":y(C?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),children:C?f(ln,{className:"h-4 w-4"}):f(cn,{className:"h-4 w-4"})})}),!t&&f("button",{type:"button",onClick:o,className:"absolute -bottom-1 -right-1 z-20 flex h-6 w-6 items-center justify-center rounded-full bg-transparent transition-all duration-300 ease-in-out",title:y("navigation.collapse"),"aria-label":y("navigation.collapse"),children:f("span",{"aria-hidden":"true",className:"absolute overflow-hidden",style:{bottom:0,right:0,width:16,height:16},children:f("span",{className:"absolute rounded-full border-[3px] border-[var(--orb-ai-accent)]",style:{width:32,height:32,top:-16,left:-16}})})})]})};ss.displayName="NavigationIsland2";var oc=(t={})=>{let{initialCollapsed:o=false,initialDisplayMode:r="fixed",content:a=[],enablePinning:n,pinStorageKey:i,pinnedItemIds:s,defaultPinnedItemIds:c,onPinnedItemIdsChange:d,pinnedSectionTitle:m}=t,[p,f]=useState(o),[h,u]=useState(r),[v,y]=useState(a),g=useCallback(()=>{f(S=>!S);},[]),C=useCallback(()=>{u(S=>S==="fixed"?"floating":"fixed");},[]),b=useMemo(()=>({collapsed:p,onToggle:g,menuData:v,displayMode:h,onDisplayModeChange:u,enablePinning:n,pinStorageKey:i,pinnedItemIds:s,defaultPinnedItemIds:c,onPinnedItemIdsChange:d,pinnedSectionTitle:m}),[p,g,v,h,u,n,i,s,c,d,m]);return {collapsed:p,setCollapsed:f,toggleCollapsed:g,displayMode:h,setDisplayMode:u,toggleDisplayMode:C,menuData:v,setMenuData:y,navigationIslandProps:b}};var cs=class{constructor(){a(this,"listener",null);}register(o){this.listener=o;}unregister(){this.listener=null;}show(o,r,a){this.listener&&this.listener({type:o,content:r,options:a});}hide(){this.listener&&this.listener(null);}},Jo=new cs,AS={success:(t,o)=>Jo.show("success",t,o),error:(t,o)=>Jo.show("error",t,o),warning:(t,o)=>Jo.show("warning",t,o),info:(t,o)=>Jo.show("info",t,o),show:(t,o,r)=>Jo.show(t,o,r),hide:()=>Jo.hide()};var vg={success:{icon:f(va,{size:40}),color:"var(--orb-success-bg)",iconColor:"var(--orb-success)"},warning:{icon:f(mn,{size:40}),color:"var(--orb-warn-bg)",iconColor:"var(--orb-warn)"},error:{icon:f(tn,{size:40}),color:"var(--orb-err-bg)",iconColor:"var(--orb-err)"},info:{icon:f(rn,{size:40}),color:"var(--orb-info-bg)",iconColor:"var(--orb-info)"},default:{icon:null,color:"transparent",iconColor:"inherit"}},Aa=({open:t,title:o,message:r,onClose:a,onConfirm:n,confirmText:i,cancelText:s,showCancel:c=true,maxWidth:d="xs",type:m="default"})=>{let{t:p}=ce(),f$1=i||p("messageBox.confirm"),h=s||p("messageBox.cancel"),u=()=>{n?n():a();},v=vg[m],y=m!=="default";return g(zt,{open:t,onClose:a,maxWidth:d,sx:y?{borderTop:`6px solid ${v.iconColor}`}:void 0,children:[y&&f("div",{style:{display:"flex",justifyContent:"center",paddingTop:24,color:v.iconColor},children:v.icon}),o&&f("div",{className:"orb-dialog-title",style:{textAlign:y?"center":"left",paddingTop:y?8:16},children:o}),f("div",{className:"orb-dialog-content",style:{textAlign:y?"center":"left"},children:typeof r=="string"?f("p",{style:{margin:0,color:"var(--orb-muted)"},children:r}):r}),g("div",{className:"orb-dialog-actions",style:{display:"flex",justifyContent:y?"center":"flex-end",gap:8,paddingBottom:24,paddingLeft:24,paddingRight:24},children:[c&&f(be,{onClick:a,variant:"text",children:h}),f(be,{onClick:u,variant:"contained",color:y&&m==="error"?"error":"primary",autoFocus:true,children:f$1})]})]})},VS=()=>{let[t,o]=Yt__default.useState(null),[r,a]=Yt__default.useState(false);Yt__default.useEffect(()=>{let s=c=>{c?(o(c),a(true)):(a(false),o(null));};return Jo.register(s),()=>Jo.unregister()},[]);let n=()=>{a(false),t?.options?.onClose&&t.options.onClose(),o(null);},i=()=>{t?.options?.onConfirm&&t.options.onConfirm(),a(false),o(null);};return t?f(Aa,{open:r,type:t.type,message:t.content,title:t.options?.title,onClose:n,onConfirm:i,confirmText:t.options?.confirmText,cancelText:t.options?.cancelText,showCancel:t.options?.showCancel,maxWidth:t.options?.maxWidth}):null};var _S=({status:t,showIcon:o=true})=>{let r="gray",a,n=t;return t==="OK"?(r="blue",a=f(va,{size:14,strokeWidth:2}),n="Success"):t==="Error"?(r="orange",a=f(tn,{size:14,strokeWidth:2}),n="Error"):t==="Warning"&&(r="orange",a=f(mn,{size:14,strokeWidth:2}),n="Warning"),f(kt,{label:n,tone:r,icon:o&&a?a:void 0})};var qS=({dense:t,sx:o,className:r,children:a,...n})=>f("ul",{...n,className:r,style:{listStyle:"none",margin:0,padding:0,...o},children:a}),XS=({button:t,divider:o,sx:r,className:a,children:n,...i})=>f("li",{...i,className:a,style:{display:"flex",alignItems:"center",padding:"8px 16px",minHeight:40,borderBottom:o?"1px solid var(--orb-border)":void 0,cursor:t?"pointer":void 0,transition:"var(--orb-t-fast)",...r},onMouseEnter:t?s=>{s.currentTarget.style.background="var(--orb-hover)";}:void 0,onMouseLeave:t?s=>{s.currentTarget.style.background="";}:void 0,children:n}),YS=({sx:t,className:o,children:r,...a})=>f("button",{...a,type:"button",className:o,style:{width:"100%",display:"flex",alignItems:"center",padding:"8px 16px",border:"none",background:"transparent",textAlign:"left",cursor:"pointer",transition:"var(--orb-t-fast)",...t},children:r}),ZS=({children:t,sx:o})=>f("div",{style:{marginRight:16,display:"flex",alignItems:"center",minWidth:40,...o},children:t}),QS=({primary:t,secondary:o,sx:r})=>g("div",{style:{flex:1,minWidth:0,...r},children:[f("div",{className:"orb-body",style:{fontWeight:500},children:t}),o&&f("div",{className:"orb-meta",style:{marginTop:2},children:o})]}),jS=({sx:t,className:o,children:r,...a})=>f("li",{...a,className:o,style:{padding:"8px 16px",fontSize:11,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--orb-muted)",...t},children:r}),JS=({children:t,sx:o})=>f("div",{style:{marginRight:12,display:"flex",alignItems:"center",...o},children:t});var ow=({xs:t,md:o,lg:r,sx:a,children:n,className:i,...s})=>{let c=r?`span ${r}`:o?`span ${o}`:t?`span ${t}`:"span 12";return f("div",{...s,className:i,style:{gridColumn:c,minWidth:0,...a},children:n})};var Mo=et,oo=(t,o)=>forwardRef(({component:r,sx:a,className:n,style:i,children:s,...c},d$1)=>{let m=r??t,p=d(a,[o,n].filter(Boolean).join(" "),i);return f(m,{ref:d$1,className:p.className,style:p.style,...c,children:s})}),Se=oo("div"),ac=oo("a","orb-link"),Tr=Ae,nc=ne,mo=A;var ic=ae;var sc=At,Uo=_r,In=Gr,Rn=hn;var Mn=fn,lc=$o,cc=({value:t,variant:o,color:r,sx:a})=>f(Sa,{value:o==="determinate"?t:void 0,color:r,sx:a}),dc=oo("table","orb-tbl"),pc=oo("tbody"),us=oo("td"),uc=oo("div","orb-table-container"),mc=oo("thead"),ms=oo("tr");oo("tfoot");oo("div","orb-dialog-title");oo("div","orb-dialog-content");oo("div","orb-dialog-actions");oo("p","orb-body-dense");var er=oo("span","orb-input-adornment"),gc=forwardRef(({sx:t,fullWidth:o,className:r,style:a,...n},i)=>{let s=d(t,["orb-input-base",r].filter(Boolean).join(" "),a);return f("input",{ref:i,className:s.className,style:{width:o?"100%":void 0,...s.style},...n})});var lr=oo("div","orb-form-control"),Na=({control:t,label:o,...r})=>g("label",{className:"orb-form-control-label",...r,children:[t,f("span",{children:o})]}),kg=({primary:t,secondary:o,children:r,primaryTypographyProps:a,secondaryTypographyProps:n,...i})=>g("span",{className:"orb-list-item-text",...i,children:[t??r,o?f("small",{children:o}):null]}),Pg=oo("span","orb-list-item-icon"),Wt=kg,Fo=Pg;oo("div","orb-list-subheader");var gs=({container:t,item:o,spacing:r,xs:a,sm:n,md:i,lg:s,xl:c,sx:d,...m})=>{let p={},f$1=h=>typeof h=="number"?`${h/12*100}%`:h?"100%":void 0;return a!==void 0&&(p.xs=f$1(a)),n!==void 0&&(p.sm=f$1(n)),i!==void 0&&(p.md=f$1(i)),s!==void 0&&(p.lg=f$1(s)),c!==void 0&&(p.xl=f$1(c)),f(Se,{...m,sx:{display:t?"flex":void 0,flexWrap:t?"wrap":void 0,gap:t&&r?r:void 0,width:o?p:void 0,...d??{}}})},Ur=({in:t,children:o,unmountOnExit:r,...a})=>!t&&r?null:f("div",{hidden:!t,...a,children:o}),fc=({children:t,container:o})=>typeof document>"u"?null:createPortal(t,o??document.body),hc=oo("div","orb-toolbar"),bc=({active:t,direction:o="asc",children:r,sx:a,className:n,style:i,...s})=>{let c=d(a,["orb-table-sort-label",t?"orb-is-active":"",n].filter(Boolean).join(" "),i);return g("button",{type:"button",className:c.className,style:c.style,"data-direction":o,...s,children:[f("span",{className:"orb-table-sort-content",children:r}),f(Rt,{className:"orb-table-sort-icon",name:o==="desc"?"down":"up",size:11})]})},Dn=({open:t,anchorEl:o,onClose:r,children:a,anchorOrigin:n,transformOrigin:i,slotProps:s,PaperProps:c,sx:d$1,className:m,style:p,...f$1})=>{let h=useRef(null);if(useEffect(()=>{if(!t)return;let C=S=>{let k=S.composedPath();h.current&&k.includes(h.current)||o&&k.includes(o)||r?.();},b=S=>{S.key==="Escape"&&r?.();};return document.addEventListener("pointerdown",C,true),document.addEventListener("keydown",b,true),()=>{document.removeEventListener("pointerdown",C,true),document.removeEventListener("keydown",b,true);}},[o,r,t]),!t||typeof document>"u")return null;let u=o?.getBoundingClientRect(),v=s?.paper??c,y=[...Array.isArray(v?.sx)?v.sx:v?.sx?[v.sx]:[],...Array.isArray(d$1)?d$1:d$1?[d$1]:[]],g=d(y,["orb-pop",v?.className,m].filter(Boolean).join(" "),{...v?.style,...p});return createPortal(f("div",{...f$1,ref:h,className:g.className,style:{position:"fixed",left:u?.left??16,top:(u?.bottom??16)+6,zIndex:1301,...g.style},children:a}),document.body)},vc=({open:t,onClose:o,anchor:r="left",children:a,PaperProps:n})=>{if(!t||typeof document>"u")return null;let i=r==="right"?{right:0,top:0,bottom:0}:r==="top"?{left:0,right:0,top:0}:r==="bottom"?{left:0,right:0,bottom:0}:{left:0,top:0,bottom:0},s=d(n?.sx,"orb-drawer");return createPortal(g(e,{children:[f("button",{type:"button",className:"orb-overlay","aria-label":"Close drawer",onClick:o}),f("aside",{className:s.className,style:{position:"fixed",zIndex:1201,...i},children:a})]}),document.body)},yc=({value:t,onChange:o,children:r,variant:a,scrollButtons:n,...i})=>f("div",{role:"tablist",className:"orb-tabs",...i,children:Children.map(r,s=>isValidElement(s)?cloneElement(s,{selected:s.props.value===t,onSelect:c=>o?.(null,c)}):s)}),Cc=({value:t,label:o,children:r,selected:a,onSelect:n,...i})=>f("button",{type:"button",role:"tab","aria-selected":a,className:`orb-tab ${a?"orb-is-active":""}`,onClick:()=>n?.(t),...i,children:o??r});var ro=()=>c(),cr=(t,o)=>Io(t);var xc=({day:t,onDaySelect:o,selected:r,outsideCurrentMonth:a,disableMargin:n,sx:i,className:s,...c})=>{let d$1=d(i,`orb-cal-day ${r?"orb-is-selected":""} ${a?"orb-is-outside":""} ${s??""}`);return f("button",{type:"button",className:d$1.className,style:d$1.style,onClick:()=>o?.(t),...c,children:t.date()})},Sc=({value:t,referenceDate:o,onChange:r,onMonthChange:a,onYearChange:n,minDate:i,maxDate:s,slots:c,...d})=>f(Pa,{value:t,month:o,onChange:m=>r?.(m),onMonthChange:m=>{a?.(m),n?.(m);},minDate:i,maxDate:s,renderDay:c?.day?(m,p)=>c.day?.({day:m,selected:p.selected,outsideCurrentMonth:p.outsideCurrentMonth,onDaySelect:f=>r?.(f)}):void 0,...d}),wc=({children:t})=>f(e,{children:t}),Tn=class{};var Tg=(t,o)=>o!==void 0?o:typeof t=="number"?t:t==="small"?18:t==="large"?30:t==="inherit"?"1em":22,he=t=>({fontSize:r,size:a,sx:n,className:i,style:s,titleAccess:c,...d$1})=>{let m=d(n,i,s);return f(Rt,{name:t,size:Tg(r,a),className:m.className,style:m.style,"aria-label":d$1["aria-label"]??c,...d$1})},dr=he("tree"),Ir=he("add"),kc=he("duplicate"),fs=he("down"),Pc=he("navigationRight"),Tc=he("navigationRight"),hs=he("up"),Ic=he("delete"),Rc=he("camera"),Mc=he("accept"),Dc=he("accept"),An=he("navigationRight"),Ac=he("dimension"),Nc=he("decline"),pr=he("decline"),Ec=he("decline"),Lc=he("decline"),Nn=he("delete"),En=he("delete"),Fc=he("download"),Bc=he("move"),Oc=he("edit"),Kr=he("slimDown"),zc=he("filter"),qr=he("sum"),Vc=he("wrench"),Hc=he("lineChart"),Wc=he("document"),Bo=he("slimDown"),$c=he("navigationLeft"),ur=he("navigationRight"),Ln=he("slimUp"),Fn=he("navigationLeft"),Bn=he("navigationRight"),Gc=he("dimension"),_c=he("splitOne"),On=he("menu"),Uc=he("microphone"),Kc=he("microphone"),qc=he("microphone"),Xc=he("qrCode"),mr=he("save"),Rr=he("search"),Yc=he("search"),Zc=he("paperPlane"),Qc=he("paperPlane"),jc=he("wrench"),Jc=he("sort"),zn=he("splitTwo"),ed=he("favorite"),td=he("favorite"),od=he("stop"),rd=he("tableRow"),Vn=he("collapseAll"),Hn=he("expandAll"),Xr=he("tableColumn"),ad=he("overview"),nd=he("hide");var Rg=[{field:"value",label:"Value",minWidth:120},{field:"label",label:"Description",minWidth:180}],sd=t=>Array.isArray(t)?t:t==null||t===""?[]:[t],xo=t=>String(t),ld=(t,o)=>t[o],cd=t=>{let o=t.value??t.id??t.key??t.code;return typeof o=="number"||typeof o=="string"?o:""},Mg=t=>{let o=t.label??t.description??t.name??t.title;return String(typeof o=="number"||typeof o=="string"?o:cd(t))},Dg=t=>{let o=t.description??t.subtitle;return typeof o=="number"||typeof o=="string"?String(o):void 0},dd=({value:t=null,items:o=[],columns:r,mode:a="single",dialogTitle:n="Value Help",searchPlaceholder:i="Search values...",selectLabel:s="Select",clearLabel:c="Clear",cancelLabel:d="Cancel",valueHelpLabel:m="Open value help",noResultsText:p="No matching values",loading:f$1=false,clearable:h=true,allowManualInput:u=true,validateManualInput:v=true,manualInputErrorText:y="Enter a valid value.",selectedItems:g$1=[],displayValue:C,getOptionValue:b=cd,getOptionLabel:S=Mg,getOptionDescription:k=Dg,onChange:x,onSearch:E,disabled:D,InputProps:T,onFocus:N,onBlur:R,onKeyDown:w,error:M,helperText:I,...L})=>{let O=ho(),U=a==="multiple",[z,K]=useState(false),[W,q]=useState(false),[H,V]=useState(""),[Z,j]=useState(null),[me,ie]=useState(false),[ge,ye]=useState(()=>sd(t)),[Ue,Oe]=useState(""),[Ie,ze]=useState(""),Re=useMemo(()=>r&&r.length>0?r:Rg,[r]),Ce=Z??o,Ve=useMemo(()=>{let Q=[...g$1,...o,...Z??[]],we=new Map;return Q.forEach(ke=>{we.set(xo(b(ke)),ke);}),we},[b,o,Z,g$1]),at=useMemo(()=>sd(t),[t]),gt=useMemo(()=>at.map(String).join(", "),[at]);useEffect(()=>{z||ye(at);},[z,at]),useEffect(()=>{!W&&!Ie&&Oe(gt);},[W,gt,Ie]);let Je=useMemo(()=>{let Q=H.trim().toLowerCase();if(!Q||E)return Ce;let we=Re.filter(ke=>ke.searchable!==false);return Ce.filter(ke=>[b(ke),S(ke),k(ke),...we.map(dt=>ld(ke,dt.field))].some(dt=>String(dt??"").toLowerCase().includes(Q)))},[Ce,k,S,b,E,H,Re]),te=useMemo(()=>{if(C!==void 0)return C;if(at.length===0)return "";let Q=we=>{let ke=Ve.get(xo(we));if(!ke)return String(we);let Xe=S(ke);return Xe&&Xe!==String(we)?`${we} - ${Xe}`:String(we)};return U?at.length>2?`${at.length} selected`:at.map(Q).join(", "):Q(at[0])},[C,S,U,Ve,at]),We=useCallback(async()=>{if(E){ie(true);try{let Q=await E(H);Array.isArray(Q)&&j(Q);}finally{ie(false);}}},[E,H]),Ne=()=>{D||(ye(at),K(true));},Ee=()=>{K(false);},st=()=>{x?.(U?[]:null,U?[]:null),ye([]),Oe(""),ze("");},Ze=Q=>{let we=b(Q);if(U){ye(ke=>ke.some(dt=>xo(dt)===xo(we))?ke.filter(dt=>xo(dt)!==xo(we)):[...ke,we]);return}ye([we]);},ht=()=>{let Q=ge.map(we=>Ve.get(xo(we))).filter(we=>!!we);U?x?.(ge,Q):x?.(ge[0]??null,Q[0]??null),ze(""),K(false);},xt=Q=>{if(Q.key==="F4"){Q.preventDefault(),Ne();return}if(Q.key==="Enter"&&u&&!Et(Ue,true)){Q.preventDefault();return}w?.(Q);},Nt=Q=>v?Q.every(we=>Ve.has(xo(we))):true,Et=(Q,we)=>{if(U){let Xe=Q.split(/[,;\n]/).map(lt=>lt.trim()).filter(Boolean);if(Xe.length===0)return ze(""),x?.([],[]),true;if(!Nt(Xe))return we&&ze(y),false;ze("");let dt=Xe.map(lt=>Ve.get(xo(lt))).filter(lt=>!!lt);return x?.(Xe,dt),true}let ke=Q.trim();return ke?Nt([ke])?(ze(""),x?.(ke,Ve.get(xo(ke))??null),true):(we&&ze(y),false):(ze(""),x?.(null,null),true)},ee=Q=>{if(!u)return;let we=Q.target.value;Oe(we),ze(""),Et(we,false);},tt=f$1||me,Le=at.length>0,ue=u&&(W||!!Ie)?Ue:te;return g(e,{children:[f(Be,{...L,className:["orb-value-help-field",h&&Le&&!D?"orb-value-help-has-clear":"",L.className??""].filter(Boolean).join(" "),disabled:D,value:ue,error:!!Ie||M,helperText:Ie||I,onChange:ee,onFocus:Q=>{q(true),Oe(gt),N?.(Q);},onBlur:Q=>{u&&Et(Ue,true),q(false),R?.(Q);},onKeyDown:xt,InputProps:{...T,readOnly:!u,endAdornment:g("span",{className:"orb-value-help-actions",children:[tt?f($o,{size:18}):null,h&&Le&&!D?f(ae,{className:"orb-value-help-clear-trigger",size:"small",tooltip:c,"aria-label":c,onMouseDown:Q=>Q.preventDefault(),onClick:Q=>{Q.stopPropagation(),st();},children:f(Rt,{name:"decline",size:14})}):null,f(ae,{className:"orb-value-help-search-trigger",size:"small",tooltip:m,"aria-label":m,onMouseDown:Q=>Q.preventDefault(),onClick:Q=>{Q.stopPropagation(),Ne();},disabled:D,children:f(Rt,{name:"search",size:16})})]})}}),g(zt,{open:z,onClose:Ee,fullWidth:true,maxWidth:820,hideCloseButton:true,PaperProps:{sx:Q=>({borderRadius:2,overflow:"hidden",border:`1px solid ${Q.palette.divider}`,boxShadow:O==="dark"?`0 24px 80px ${et(Q.palette.common.black,.72)}`:`0 24px 80px ${et(Q.palette.common.black,.18)}`})},children:[g("div",{className:"orb-dialog-title",sx:Q=>({display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,px:2.5,py:2,pr:1.5,borderBottom:`1px solid ${Q.palette.divider}`,bgcolor:Q.palette.background.paper}),children:[g("div",{children:[f(A,{sx:{fontSize:"1.05rem",fontWeight:800,lineHeight:1.25},children:n}),U?f(A,{variant:"body2",color:"text.secondary",sx:{mt:.25},children:`${ge.length} selected`}):null]}),f(ae,{"aria-label":"Close",onClick:Ee,size:"small",children:f(pr,{fontSize:"small"})})]}),g("div",{className:"orb-dialog-content",sx:{p:0},children:[g(ne,{direction:{xs:"column",sm:"row"},spacing:1,sx:Q=>({px:2.5,py:1.5,borderBottom:`1px solid ${Q.palette.divider}`,bgcolor:O==="dark"?et(Q.palette.common.white,.025):et(Q.palette.primary.main,.035)}),children:[f(Be,{size:"small",fullWidth:true,autoFocus:true,value:H,placeholder:i,onChange:Q=>V(Q.target.value),onKeyDown:Q=>{Q.key==="Enter"&&(Q.preventDefault(),We());},InputProps:{startAdornment:f(er,{position:"start",children:f(Rt,{name:"search",size:16})}),sx:Q=>({borderRadius:1,bgcolor:Q.palette.background.paper,"& fieldset":{borderColor:et(Q.palette.text.primary,O==="dark"?.2:.16)},"&:hover fieldset":{borderColor:et(Q.palette.primary.main,.52)},"&:focus-within fieldset":{borderColor:Q.palette.primary.main}})}}),E?f(be,{variant:"outlined",onClick:()=>{We();},disabled:tt,sx:{minWidth:96,textTransform:"none",fontWeight:700},children:tt?f($o,{size:18}):"Search"}):null]}),f("div",{sx:{maxHeight:420},children:g("table",{className:"orb-tbl",stickyHeader:true,size:"small",children:[f("thead",{children:g("tr",{children:[f("td",{padding:"checkbox",sx:Q=>({bgcolor:O==="dark"?"var(--orb-canvas)":Q.palette.background.paper,borderBottom:`1px solid ${Q.palette.divider}`})}),Re.map(Q=>f("td",{align:Q.align==="inherit"?void 0:Q.align,sx:we=>({minWidth:Q.minWidth,width:Q.width,fontSize:"0.78rem",fontWeight:800,bgcolor:O==="dark"?"var(--orb-canvas)":we.palette.background.paper,borderBottom:`1px solid ${we.palette.divider}`}),children:Q.label},String(Q.field)))]})}),g("tbody",{children:[Je.map(Q=>{let we=b(Q),ke=ge.some(Xe=>xo(Xe)===xo(we));return g("tr",{hover:true,selected:ke,onClick:()=>Ze(Q),onDoubleClick:()=>{U||(ye([we]),x?.(we,Q),K(false));},sx:Xe=>({cursor:"pointer","&.orb-selected":{bgcolor:et(Xe.palette.primary.main,O==="dark"?.22:.12)},"&.orb-selected:hover":{bgcolor:et(Xe.palette.primary.main,O==="dark"?.28:.18)}}),children:[f("td",{padding:"checkbox",children:f(Mt,{size:"small",checked:ke})}),Re.map(Xe=>{let dt=ld(Q,Xe.field);return f("td",{align:Xe.align==="inherit"?void 0:Xe.align,sx:{fontSize:"0.82rem",py:1},children:Xe.render?Xe.render(dt,Q):String(dt??"")},String(Xe.field))})]},xo(we))}),Je.length===0?f("tr",{children:f("td",{colSpan:Re.length+1,children:f("div",{sx:{py:5,textAlign:"center",color:"text.secondary"},children:p})})}):null]})]})})]}),g("div",{className:"orb-dialog-actions",sx:Q=>({px:2.5,py:1.5,borderTop:`1px solid ${Q.palette.divider}`,bgcolor:Q.palette.background.paper,"& .orb-btn":{textTransform:"none",fontWeight:700}}),children:[h&&(Le||ge.length>0)?f(be,{onClick:st,children:c}):null,f("div",{sx:{flex:1}}),f(be,{onClick:Ee,children:d}),f(be,{variant:"contained",onClick:ht,disabled:!U&&ge.length===0,children:s})]})]})]})};var Wn=({title:t,hideHeader:o,children:r})=>g("div",{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[!o&&f("div",{sx:{mb:2},children:f(A,{variant:"h4",children:t})}),f("div",{sx:{flex:1,overflow:"hidden"},children:r})]});var bs={width:56,minWidth:56,maxWidth:56,paddingLeft:"4px !important",paddingRight:"4px !important",paddingTop:"0 !important",paddingBottom:"0 !important",textAlign:"center",verticalAlign:"middle",boxSizing:"border-box"},vs={width:72,minWidth:72,maxWidth:72,paddingLeft:"4px !important",paddingRight:"4px !important",paddingTop:"0 !important",paddingBottom:"0 !important",textAlign:"center",verticalAlign:"middle",boxSizing:"border-box"},Ea={width:30,height:30,p:.25,flex:"0 0 auto","& svg":{fontSize:20}},La={width:30,height:30,minWidth:30,minHeight:30,p:.25,flex:"0 0 auto","& svg":{fontSize:20}},pd={display:"flex",alignItems:"center",justifyContent:"center",gap:.25,width:"100%",minWidth:0},io={width:32,height:32,minWidth:32,minHeight:32,p:0,flex:"0 0 auto",borderRadius:1,color:"text.secondary","& svg, & [data-sap-icon]":{width:16,height:16,fontSize:16,strokeWidth:1.8}};var Ag={fontSize:"0.85rem",width:62,minWidth:62,"& .orb-select-trigger":{minHeight:"32px !important",height:"32px !important",padding:"0 8px !important"},"& .orb-select-chevron":{width:"11px !important",height:"11px !important",fontSize:"11px !important"}},$n=({rowsPerPage:t=20,rowsPerPageOptions:o=[20,50,100,-1],page:r=0,count:a=0,onRowsPerPageChange:n,onPageChange:i})=>{let{t:s}=ce(),c=o.length>0?o:[20,50,100,-1],d=Math.max(0,r),m=t===-1?1:Math.max(1,Math.ceil(a/t)),p=Math.min(d+1,m),f$1=d>0,h=d<m-1&&t!==-1;return g("div",{className:"orb-table-pager",children:[f(A,{className:"orb-table-pager-label",children:s("table.toolbar.itemsPerPage")}),f(nt,{title:s("table.toolbar.itemsPerPage"),children:f(_t,{size:"small",variant:"standard",value:t,"aria-label":s("table.toolbar.itemsPerPage"),fullWidth:false,disableUnderline:true,onChange:u=>n?.(Number(u.target.value)),sx:Ag,children:c.map(u=>f("option",{value:u,children:u===-1?s("common.all"):u},`rows-per-page-${u}`))})}),f("span",{className:"orb-table-pager-divider"}),f(ae,{className:"orb-table-pager-button","aria-label":"Previous page",size:"small",onClick:()=>i?.(Math.max(d-1,0)),disabled:!f$1,sx:io,children:f($c,{})}),g(A,{className:"orb-table-pager-page",title:s("table.toolbar.pageOf",{current:p,total:m}),children:[p," / ",m]}),f(ae,{className:"orb-table-pager-button","aria-label":"Next page",size:"small",onClick:()=>i?.(Math.min(d+1,m-1)),disabled:!h,sx:io,children:f(ur,{})})]})};var Gn=({value:t="",onChange:o})=>{let{t:r}=ce();return f("div",{className:"orb-table-toolbar-search",children:f(Be,{className:"orb-table-toolbar-search-field",size:"small",placeholder:r("table.toolbar.searchPlaceholder"),value:t,onChange:a=>o?.(a.target.value),InputProps:{startAdornment:f(er,{position:"start",children:f(Rr,{size:16})})}})})};var _n=t=>{let{t:o}=ce(),r=Array.isArray(t.actions)?t.actions:t.actions?[t.actions]:[],a=Array.isArray(t.extraTools)?t.extraTools:t.extraTools?[t.extraTools]:[],n=[...r,...a],i=!!(t.showCreateButton||t.showEditButton||t.showDeleteButton),s=!!(t.onOpenGraphReport||t.onLayoutSave&&!t.layoutManager||t.layoutManager);return f(hc,{className:"orb-table-toolbar",role:"toolbar","aria-label":o("table.title.default"),children:g("div",{className:"orb-table-toolbar-primary",children:[f(Gn,{value:t.filterText,onChange:c=>{t.setFilterText(c),t.onPageChange?.(0);}}),f($n,{rowsPerPage:t.rowsPerPage,rowsPerPageOptions:t.rowsPerPageOptions,page:t.page,count:t.count,onRowsPerPageChange:t.onRowsPerPageChange,onPageChange:t.onPageChange}),n.length>0?f("div",{className:"orb-table-toolbar-custom",children:n.map((c,d)=>f(Yt__default.Fragment,{children:c},`toolbar-custom-${d}`))}):null,f("span",{className:"orb-table-toolbar-spacer"}),g("div",{className:"orb-table-toolbar-actions",children:[g("div",{className:"orb-table-tool-group",children:[!t.disableGrouping&&f(nt,{title:o("table.toolbar.groupBy"),children:f(ae,{className:"orb-table-tool-button",sx:io,onClick:c=>t.setGroupAnchorEl(t.groupAnchorEl?null:c.currentTarget),children:f(Rn,{badgeContent:t.grouping?.length,color:"primary",invisible:!t.grouping?.length,children:f(dr,{})})})}),f(nt,{title:o("table.toolbar.summary"),children:f(ae,{className:`orb-table-tool-button ${t.showSummary?"orb-is-active":""}`,active:!!t.showSummary,sx:io,onClick:c=>t.setSummaryAnchorEl(t.summaryAnchorEl?null:c.currentTarget),children:f(qr,{})})}),f(nt,{title:o("table.toolbar.columns"),children:f(ae,{className:"orb-table-tool-button",sx:io,onClick:c=>t.setAnchorEl(t.anchorEl?null:c.currentTarget),children:f(Xr,{})})}),f(nt,{title:o("table.toolbar.export"),children:f(ae,{className:"orb-table-tool-button",sx:io,onClick:t.handleExport,children:f(Fc,{})})})]}),i&&g("div",{className:"orb-table-tool-group",children:[t.showCreateButton&&f(nt,{title:o("table.toolbar.newItem"),children:f(ae,{className:"orb-table-tool-button",onClick:t.onOpenCreateDialog,color:"primary.main",sx:io,children:f(Ir,{})})}),t.showEditButton&&f(nt,{title:o("table.toolbar.editItem"),children:f("span",{children:f(ae,{className:"orb-table-tool-button",onClick:t.onOpenEditDialog,color:"primary.main",disabled:!!t.editDisabled,sx:io,children:f(Oc,{})})})}),t.showDeleteButton&&f(nt,{title:o("table.toolbar.deleteItem"),children:f("span",{children:f(ae,{className:"orb-table-tool-button",onClick:t.onOpenDeleteConfirm,disabled:!!t.deleteDisabled,sx:{...io,color:"error.main"},children:f(Nn,{})})})})]}),s&&g("div",{className:"orb-table-tool-group",children:[t.onOpenGraphReport&&f(nt,{title:o("table.toolbar.graphicReport"),children:f(ae,{className:"orb-table-tool-button",sx:io,onClick:t.onOpenGraphReport,children:f(Hc,{})})}),t.onLayoutSave&&!t.layoutManager&&f(nt,{title:o("table.toolbar.saveLayout"),children:f(ae,{className:"orb-table-tool-button",sx:io,onClick:c=>t.onLayoutSave(c),children:f(mr,{})})}),t.layoutManager]})]})]})})};var Un=Object.freeze({Translate:{toString(t){if(!t)return;let{x:o,y:r}=t;return "translate3d("+(o?Math.round(o):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;let{scaleX:o,scaleY:r}=t;return "scaleX("+o+") scaleY("+r+")"}},Transform:{toString(t){if(t)return [Un.Translate.toString(t),Un.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:o,duration:r,easing:a}=t;return o+" "+r+"ms "+a}}});var Kn=t=>{let{t:o}=ce(),{onSelectAllClick:r,order:a,orderBy:n,sortBy:i=[],numSelected:s=0,rowCount:c=0,onRequestSort:d,onContextMenu:m,columns:p,visibleColumns:f$1,selectionMode:h,grouping:u=[],isAllExpanded:v=false,handleToggleAll:y,onColumnResize:g$1,columnWidths:C,enableColumnReorder:b=false,disableSorting:S=false}=t,[k,x]=useState(null),E=useRef(null),D=W=>q=>{S||k||d(W);},T=(W,q,H)=>{W.preventDefault(),W.stopPropagation(),x(q),E.current={startX:W.clientX,startWidth:H,colId:q},document.addEventListener("mousemove",N),document.addEventListener("mouseup",R),document.body.style.cursor="col-resize";},N=W=>{if(!E.current)return;let{startX:q,startWidth:H,colId:V}=E.current,Z=W.clientX-q,j=Math.max(50,H+Z);g$1&&g$1(V,j);},R=()=>{x(null),E.current=null,document.removeEventListener("mousemove",N),document.removeEventListener("mouseup",R),document.body.style.cursor="";};useEffect(()=>()=>{document.removeEventListener("mousemove",N),document.removeEventListener("mouseup",R);},[]);let w=h==="multiple"||h==="single",M=u.length>0&&!!y,I=o(v?"table.group.collapseAll":"table.group.expandAll"),L=p.filter(W=>f$1.includes(W.id)),O=new Map(i.map((W,q)=>[W.field,{...W,priority:q+1}])),U=L.map(W=>{let q=C?.[W.id]||W.minWidth||100,H=O.get(W.id);return f(Vg,{headCell:W,width:typeof q=="number"?q:100,order:a,orderBy:n,multiSortInfo:S?void 0:H,onRequestSort:D(W.id),onContextMenu:m,onResizeMouseDown:V=>T(V,W.id,typeof q=="number"?q:100),enableColumnReorder:b,disableSorting:S},W.id)}),z=L.map(W=>W.id),K=g("tr",{children:[w&&f("th",{className:"orb-table-control-head",style:{width:56,minWidth:56,maxWidth:56},children:f(Mt,{color:"primary",indeterminate:s>0&&s<c,checked:c>0&&s===c,onChange:r,disabled:h==="single",sx:Ea})}),M&&f("th",{className:"orb-table-control-head",style:{width:72,minWidth:72,maxWidth:72},children:f(nt,{title:I,children:f(ae,{size:"small",onClick:W=>{W.stopPropagation(),y?.(!v);},sx:La,children:v?f(Vn,{}):f(Hn,{})})})}),b?f(SortableContext,{items:z,strategy:horizontalListSortingStrategy,children:U}):U]});return f("thead",{children:K})},Vg=({headCell:t,width:o,order:r,orderBy:a,multiSortInfo:n,onRequestSort:i,onContextMenu:s,onResizeMouseDown:c,enableColumnReorder:d,disableSorting:m})=>{let{setNodeRef:p,attributes:f$1,listeners:h,transform:u,transition:v,isDragging:y}=useSortable({id:t.id,disabled:!d}),g$1=d?{transform:Un.Transform.toString(u),transition:v,opacity:y?.6:1}:{},C=m?"asc":n?.direction??(a===t.id?r:"asc"),b=!m&&(!!n||a===t.id);return g("th",{ref:d?p:void 0,className:`orb-table-head-cell ${t.numeric?"orb-num":""} ${d?"orb-is-reorderable":""} ${y?"orb-is-dragging":""}`,"aria-sort":b?C==="asc"?"ascending":"descending":"none",onContextMenu:s?S=>s(S,t.id):void 0,style:{width:o,minWidth:o,maxWidth:o,...g$1},...d?f$1:{},...d?h:{},children:[m?f("span",{className:"orb-table-head-label",children:t.label}):f(bc,{className:"orb-table-head-sort",active:b,direction:C,onClick:i,children:g("span",{className:"orb-table-head-label",children:[t.label,n&&f("span",{className:"orb-table-sort-priority",children:n.priority})]})}),f("div",{className:"orb-table-resize-handle",onMouseDown:c,onPointerDown:S=>S.stopPropagation(),onClick:S=>S.stopPropagation()})]})};var qn=t=>{let{t:o}=ce(),{visibleRows:r,visibleColumns:a,selected:n=[],handleClick:i,columns:s,toggleGroupExpand:c,expandedGroups:d=new Set,selectionMode:m,grouping:p=[],isGroupFullyExpanded:f$1,handleExpandGroupRecursively:h,handleCollapseGroupRecursively:u,emptyLabel:v,getRowDataKey:y,getRowProps:g$1,getGroupRowProps:C}=t,b=E=>n.indexOf(E)!==-1,S=m==="multiple"||m==="single",k=p.length>0,x=a.length+(S?1:0)+(k?1:0);return g("tbody",{children:[r.map((E,D)=>{if(E.type==="group"){let T=d.has(E.id),N=E.childIds||[],R=N.filter(W=>b(W)).length,w=N.length>0&&R===N.length,M=R>0&&R<N.length,I={entry:E,data:E,id:E.id,index:D,selected:w,group:true},L=C?.(I)||{},{className:O,onClick:U,...z}=L,K=W=>{if(W.stopPropagation(),!!t.onSelectionChange)if(w){let q=n.filter(H=>!N.includes(H));t.onSelectionChange(q);}else {let q=Array.from(new Set([...n,...N]));t.onSelectionChange(q);}};return g("tr",{...z,"data-ctable-row-key":y?.(I),className:["orb-table-group-row",O].filter(Boolean).join(" "),onClick:U,sx:W=>({backgroundColor:"var(--orb-surface)","& th, & td":{color:W.palette.text.primary,borderBottomColor:W.palette.divider},"& .orb-icon-btn":{color:W.palette.text.primary},"& .orb-chk":{color:W.palette.text.secondary},"& .orb-chk:has(input:checked), & .orb-chk:has(input:indeterminate)":{color:W.palette.primary.main}}),children:[S&&f("td",{padding:"checkbox",sx:bs,children:f(Mt,{size:"small",checked:w,indeterminate:M,onChange:K,onClick:W=>W.stopPropagation(),sx:Ea})}),k&&f("td",{padding:"checkbox",sx:vs,children:g("div",{sx:pd,children:[p.length>1&&E.level<p.length-1&&f(nt,{title:f$1?.(E.id)?o("table.group.collapseAll"):o("table.group.expandAll"),children:f(ae,{size:"small",onClick:()=>{f$1?.(E.id)?u?.(E.id):h?.(E.id);},sx:La,children:f$1?.(E.id)?f(Vn,{}):f(Hn,{})})}),f(ae,{size:"small",onClick:()=>c&&c(E.id),sx:La,children:T?f(Bo,{}):f(ur,{})})]})}),f("td",{colSpan:a.length,sx:{py:1,pl:E.level*3+1},children:g(A,{variant:"body2",fontWeight:"bold",color:"text.primary",sx:{fontSize:"0.85rem"},children:[E.field,": ",E.value," (",E.count,")"]})})]},E.id)}else {let T=E.data||E,N=E.id||T.id||D,R=b(N),w=`enhanced-table-checkbox-${D}`,M={entry:E,data:T,id:N,index:D,selected:R,group:false},I=g$1?.(M)||{},{className:L,onClick:O,...U}=I,K=(E.level!==void 0?E.level:0)*4;return g("tr",{...U,"data-ctable-row-key":y?.(M),className:[R?"orb-is-selected":"",L].filter(Boolean).join(" "),onClick:W=>{O?.(W),W.defaultPrevented||i?.(W,T);},role:S?"checkbox":U.role,"aria-checked":S?R:U["aria-checked"],tabIndex:U.tabIndex??-1,children:[S&&f("td",{padding:"checkbox",sx:bs,children:f(Mt,{color:"primary",checked:R,inputProps:{"aria-labelledby":w},sx:Ea})}),k&&f("td",{padding:"checkbox",sx:vs}),s.filter(W=>a.includes(W.id)).map((W,q)=>{let V=q===0&&K>0?{pl:K+2}:{};return f("td",{className:W.numeric?"orb-num":void 0,align:W.numeric?"right":"left",sx:V,children:W.render?W.render(T[W.id],T):(function(){let j=T[W.id];if(W.numeric){if(typeof j=="number")return j.toLocaleString();if(typeof j=="string"&&j.trim()!==""&&!isNaN(Number(j)))return Number(j).toLocaleString()}return j})()},W.id)})]},N)}}),r.length===0&&f("tr",{children:f("td",{colSpan:x,align:"center",children:v??o("common.noData")})})]})};var ud=t=>{let{columns:o=[],visibleColumns:r,summaryRow:a,selectionMode:n,grouping:i=[],columnWidths:s={}}=t;if(!t.showSummary)return null;let c=n==="multiple"||n==="single",d=i.length>0,m=o.filter(p=>r.includes(p.id));return f("tfoot",{className:"orb-table-footer",style:{zIndex:t.zIndex},children:g("tr",{children:[c&&f("td",{className:"orb-table-footer-control",style:{width:56,minWidth:56,maxWidth:56}}),d&&f("td",{className:"orb-table-footer-control",style:{width:72,minWidth:72,maxWidth:72}}),m.map(p=>f("td",{className:`orb-table-footer-cell ${p.numeric?"orb-num":""}`,style:{width:s[p.id]||p.minWidth||100,minWidth:s[p.id]||p.minWidth||100,maxWidth:s[p.id]||p.minWidth||100},children:(function(){let h=a[p.id];return h==null||h===""?"":typeof h=="number"?h.toLocaleString():typeof h=="string"&&h.trim()!==""&&!isNaN(Number(h))?Number(h).toLocaleString():h})()},p.id))]})})};var md=t=>{let{t:o}=ce();return f("div",{sx:{p:2},children:f(A,{children:o("table.mobile.notImplemented")})})};var Qr=({groupAnchorEl:t,setGroupAnchorEl:o,grouping:r,setGrouping:a,columns:n})=>{let{t:i}=ce(),[s,c]=useState(r);useEffect(()=>{t&&c(r);},[t,r]);let d=()=>{c(r),o(null);},m=f=>{c(h=>h.includes(f)?h.filter(u=>u!==f):[...h,f]);},p=()=>{a(s),o(null);};return g(qt,{anchorEl:t,open:!!t,onClose:d,sx:{width:224,minWidth:224,maxHeight:360,overflowY:"auto"},children:[g("div",{className:"orb-table-group-menu-header",onClick:f=>f.stopPropagation(),children:[f(A,{className:"orb-table-group-menu-title",variant:"subtitle2",children:i("table.menu.groupBy")}),s.length>0&&f(be,{className:"orb-table-group-menu-clear",size:"small",color:"error",onClick:f=>{f.stopPropagation(),c([]);},children:i("table.menu.clearAll")})]}),f(At,{className:"orb-table-group-menu-divider"}),n.map(f$1=>{let h=s.includes(f$1.id),u=s.indexOf(f$1.id)+1;return f("option",{className:"orb-table-group-menu-option",selected:h,onClick:v=>{v.stopPropagation(),m(f$1.id);},children:g("div",{className:"orb-table-group-menu-option-content",children:[f(Mt,{className:"orb-table-group-menu-checkbox",checked:h,size:"small"}),f(Wt,{className:"orb-table-group-menu-label",primary:f$1.label}),h&&f("span",{className:"orb-table-group-menu-order","aria-label":`${i("table.menu.groupBy")} ${u}`,children:u})]})},f$1.id)}),g("div",{className:"orb-table-group-menu-footer",children:[f(be,{size:"small",variant:"ghost",onClick:d,children:i("common.cancel")}),f(be,{size:"small",variant:"primary",onClick:p,children:i("common.ok")})]})]})},jr=({anchorEl:t,setAnchorEl:o,columns:r,visibleColumns:a,toggleColumnVisibility:n})=>{let{t:i}=ce();return g(qt,{anchorEl:t,open:!!t,onClose:()=>o(null),children:[f("option",{disabled:true,children:f(Wt,{primary:i("table.menu.visibleColumns")})}),f(At,{}),r.map(s=>g("option",{onClick:()=>n(s.id),children:[f(Mt,{checked:a.includes(s.id),size:"small"}),f(Wt,{primary:s.label})]},s.id))]})},Xn=({anchorEl:t,setAnchorEl:o,showSummary:r,setShowSummary:a,columns:n,summaryColumns:i,toggleSummaryColumn:s})=>{let{t:c}=ce();return g(qt,{anchorEl:t,open:!!t,onClose:()=>o(null),children:[f("option",{children:f(Na,{control:f(Mn,{checked:r,onChange:d=>a(d.target.checked),size:"small"}),label:c("table.menu.showSummaryRow")})}),f(At,{}),n.filter(d=>d.numeric).map(d=>g("option",{onClick:()=>s(d.id),disabled:!r,children:[f(Mt,{checked:i.includes(d.id),size:"small"}),f(Wt,{primary:d.label})]},d.id)),n.filter(d=>d.numeric).length===0&&f("option",{disabled:true,children:f(Wt,{primary:c("table.menu.noNumericColumns")})})]})},Yn=({contextMenu:t,handleCloseContextMenu:o,columns:r,visibleColumns:a,toggleColumnVisibility:n})=>{let{t:i}=ce();return g(qt,{open:t!==null,onClose:o,anchorReference:"anchorPosition",anchorPosition:t!==null?{top:t.mouseY,left:t.mouseX}:void 0,children:[f("option",{onClick:o,children:i("common.copy")}),f(At,{}),f("option",{disabled:true,children:i("table.menu.visibleColumns")}),r.map(s=>g("option",{onClick:()=>n(s.id),children:[f(Fo,{children:a.includes(s.id)&&f(Mc,{fontSize:"small"})}),f(Wt,{children:s.label})]},s.id))]})},bd=({contextMenu:t,handleClose:o,columns:r,visibleColumns:a,grouping:n,summaryColumns:i,showSummary:s,sortBy:c,orderBy:d,order:m,onSortAsc:p,onSortDesc:f$1,onClearSort:h,onHideColumn:u,onToggleGroup:v,onToggleSummary:y,onOpenSortDialog:g$1})=>{let{t:C}=ce(),b=t?.columnId??"",S=r.find(w=>w.id===b),k=n.includes(b),x=i.includes(b),E=!!S?.numeric,D=c.find(w=>w.field===b),T=D?D.direction==="asc":d===b&&m==="asc",N=D?D.direction==="desc":d===b&&m==="desc",R=T||N;return g(qt,{open:t!==null,onClose:o,anchorReference:"anchorPosition",anchorPosition:t!==null?{top:t.mouseY,left:t.mouseX}:void 0,children:[f("option",{disabled:true,sx:{opacity:"1 !important",fontWeight:700},children:f(Wt,{primary:S?.label??b})}),f(At,{}),g("option",{onClick:()=>{p(b),o();},selected:T,children:[f(Fo,{children:f(hs,{fontSize:"small"})}),f(Wt,{primary:C("table.headerMenu.sortAsc")})]}),g("option",{onClick:()=>{f$1(b),o();},selected:N,children:[f(Fo,{children:f(fs,{fontSize:"small"})}),f(Wt,{primary:C("table.headerMenu.sortDesc")})]}),R&&g("option",{onClick:()=>{h(b),o();},children:[f(Fo,{children:f(Ac,{fontSize:"small"})}),f(Wt,{primary:C("table.headerMenu.clearSort")})]}),g("option",{onClick:()=>{g$1(),o();},children:[f(Fo,{children:f(Ir,{fontSize:"small"})}),f(Wt,{primary:C("table.headerMenu.configureSort")})]}),f(At,{}),g("option",{onClick:()=>{v(b),o();},selected:k,children:[f(Fo,{children:f(dr,{fontSize:"small"})}),f(Wt,{primary:C(k?"table.headerMenu.ungroup":"table.headerMenu.group")})]}),E&&s&&g("option",{onClick:()=>{y(b),o();},selected:x,children:[f(Fo,{children:f(qr,{fontSize:"small"})}),f(Wt,{primary:C(x?"table.headerMenu.removeSummary":"table.headerMenu.addSummary")})]}),f(At,{}),g("option",{onClick:()=>{u(b),o();},children:[f(Fo,{children:f(nd,{fontSize:"small"})}),f(Wt,{primary:C("table.headerMenu.hideColumn")})]})]})},vd=({open:t,onClose:o,columns:r,initialRules:a,onApply:n,onClear:i})=>{let{t:s}=ce(),[c,d]=useState([]);useEffect(()=>{t&&d(a.length>0?a.map(y=>({...y})):[]);},[t,a]);let m=useMemo(()=>new Set(c.map(y=>y.field)),[c]),p=useMemo(()=>r.filter(y=>!m.has(y.id)),[r,m]),f$1=()=>{let y=p[0];y&&d(g=>[...g,{field:y.id,direction:"asc"}]);},h=y=>{d(g=>g.filter((C,b)=>b!==y));},u=(y,g)=>{d(C=>C.map((b,S)=>S===y?{...b,...g}:b));},v=(y,g)=>{d(C=>{let b=y+g;if(b<0||b>=C.length)return C;let S=[...C],[k]=S.splice(y,1);return S.splice(b,0,k),S});};return f(zt,{open:t,onClose:o,maxWidth:620,fullWidth:true,className:"orb-table-sort-dialog",title:s("table.sortDialog.title"),actions:g(e,{children:[f(be,{className:"orb-table-sort-clear",variant:"neutral",disabled:c.length===0&&a.length===0,onClick:()=>{i(),o();},children:s("table.sortDialog.clearAll")}),f("span",{className:"orb-table-sort-action-spacer"}),f(be,{variant:"neutral",onClick:o,children:s("common.cancel")}),f(be,{variant:"primary",onClick:()=>{n(c),o();},children:s("common.ok")})]}),children:g("div",{className:"orb-table-sort-dialog-content",children:[c.length===0?f(A,{className:"orb-table-sort-empty",variant:"body2",children:s("table.sortDialog.empty")}):f(ne,{className:"orb-table-sort-rules",spacing:1,children:c.map((y,g$1)=>{let C=new Set(c.filter((S,k)=>k!==g$1).map(S=>S.field)),b=r.filter(S=>!C.has(S.id));return g("div",{className:"orb-table-sort-rule",children:[f(Rn,{className:"orb-table-sort-order",badgeContent:g$1+1,color:"primary"}),f(_t,{size:"small",value:y.field,onChange:S=>u(g$1,{field:S.target.value}),options:b.map(S=>({value:S.id,label:S.label}))}),f(_t,{size:"small",value:y.direction,onChange:S=>u(g$1,{direction:S.target.value}),options:[{value:"asc",label:s("table.sortDialog.asc")},{value:"desc",label:s("table.sortDialog.desc")}]}),f(ae,{className:"orb-table-sort-icon-button",size:"small",onClick:()=>v(g$1,-1),disabled:g$1===0,children:f(hs,{fontSize:"small"})}),f(ae,{className:"orb-table-sort-icon-button",size:"small",onClick:()=>v(g$1,1),disabled:g$1===c.length-1,children:f(fs,{fontSize:"small"})}),f(ae,{className:"orb-table-sort-icon-button orb-table-sort-delete",size:"small",onClick:()=>h(g$1),children:f(En,{fontSize:"small"})})]},`sort-rule-${g$1}`)})}),f(be,{size:"small",onClick:f$1,disabled:p.length===0,startIcon:f(Ir,{}),variant:"secondary",className:"orb-table-sort-add",children:s("table.sortDialog.addRule")})]})})};var Fa=(t,o=2)=>t.toLocaleString(void 0,{maximumFractionDigits:o}),yd=({kpis:t})=>{let{t:o}=ce(),r=[{label:o("graph.kpi.totalRecords"),value:Fa(t.totalRecords,0),color:"var(--orb-fg)"},{label:o("graph.kpi.totalReport"),value:Fa(t.totalReportHours),color:"var(--orb-fg)"},{label:o("graph.kpi.totalBillable"),value:Fa(t.totalBillableHours),color:"var(--orb-primary)"},{label:o("graph.kpi.efficiency"),value:`${t.efficiency.toFixed(2)}%`,color:"var(--orb-accent)"},{label:o("graph.kpi.amount"),value:Fa(t.totalAmount),color:"var(--orb-primary)"},{label:o("graph.kpi.flagged"),value:Fa(t.flaggedCount,0),color:"var(--orb-err)"}];return f("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(140px, 1fr))",gap:12},children:r.map(a=>g(Ae,{elevation:0,sx:{padding:12,minHeight:96,display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[f(A,{variant:"caption",muted:true,children:a.label}),f(A,{variant:"h3",sx:{fontWeight:800,color:a.color,fontVariantNumeric:"tabular-nums"},children:a.value})]},a.label))})};var Zn=({title:t,subtitle:o,children:r})=>g(Ae,{elevation:0,sx:{padding:16},children:[f(A,{variant:"h4",sx:{fontWeight:700},children:t}),o&&f(A,{variant:"body2",muted:true,sx:{marginBottom:16},children:o}),r]});var Ba=({data:t,orientation:o="horizontal",valueSuffix:r="",minHeight:a=210,activeName:n,onItemClick:i})=>{if(t.length===0)return f(A,{variant:"body2",muted:true,children:"No data"});let s=Math.max(...t.map(c=>c.value),1);return o==="vertical"?f("div",{style:{display:"flex",gap:1,alignItems:"flex-end",minHeight:a},children:t.map(c=>g("div",{style:{flex:1,minWidth:0},children:[f("div",{onClick:()=>i?.(c),sx:{height:`${Math.max(c.value/s*180,6)}px`,background:c.name===n?"primary.dark":"primary.main",borderRadius:"8px 8px 0 0",cursor:i?"pointer":"default",opacity:n&&c.name!==n?.45:1}}),f(A,{variant:"caption",title:c.name,sx:{display:"block",mt:.5},children:c.name}),g(A,{variant:"caption",muted:true,children:[c.value.toFixed(1),r]})]},c.name))}):f(ne,{spacing:1,children:t.map(c=>g("div",{style:{display:"grid",gridTemplateColumns:"140px 1fr 64px",gap:1},children:[f(A,{variant:"caption",muted:true,title:c.name,children:c.name}),f("div",{onClick:()=>i?.(c),sx:{alignSelf:"center",background:"action.hover",height:10,borderRadius:999,overflow:"hidden",cursor:i?"pointer":"default",opacity:n&&c.name!==n?.45:1},children:f("div",{style:{width:`${c.value/s*100}%`,height:"100%",background:c.name===n?"primary.dark":"primary.main"}})}),g(A,{variant:"caption",sx:{textAlign:"right",fontWeight:600},children:[c.value.toFixed(1),r]})]},c.name))})};var Cd=({data:t,color:o="var(--orb-chart-1)",valueSuffix:r="",height:a=220})=>{if(t.length===0)return f(A,{variant:"body2",muted:true,children:"No data"});let n=640,i=28,s=t.map(h=>h.value),c=Math.min(...s,0),m=Math.max(...s,1)-c||1,p=t.map((h,u)=>{let v=i+u*(n-i*2)/Math.max(t.length-1,1),y=a-i-(h.value-c)/m*(a-i*2);return {x:v,y,...h}}),f$1=p.map(h=>`${h.x},${h.y}`).join(" ");return g("div",{children:[g("div",{component:"svg",viewBox:`0 0 ${n} ${a}`,style:{width:"100%",height:a},children:[f("line",{x1:i,y1:a-i,x2:n-i,y2:a-i,style:{stroke:"var(--orb-chart-grid)"}}),f("polyline",{fill:"none",style:{stroke:o},strokeWidth:3,points:f$1}),p.map(h=>f("circle",{cx:h.x,cy:h.y,r:4,style:{fill:o}},h.name))]}),f("div",{sx:{mt:1,display:"grid",gridTemplateColumns:`repeat(${t.length}, minmax(0, 1fr))`,gap:1},children:t.map(h=>g("div",{style:{minWidth:0},children:[f(A,{variant:"caption",title:h.name,sx:{display:"block"},children:h.name}),g(A,{variant:"caption",muted:true,children:[h.value.toFixed(1),r]})]},h.name))})]})};var xd=({data:t,barColor:o="var(--orb-chart-1)",lineColor:r="var(--orb-chart-5)",height:a=220})=>{if(t.length===0)return f(A,{variant:"body2",muted:true,children:"No data"});let n=640,i=28,s=Math.max(...t.map(p=>p.barValue),1),c=Math.max(...t.map(p=>p.lineValue),1),d=t.map((p,f)=>{let h=(n-i*2)/t.length,u=Math.max(h*.5,8),v=i+f*h+(h-u)/2,y=p.barValue/s*(a-i*2),g=a-i-y;return {x:v,y:g,barHeight:y,barWidth:u,item:p}}),m=t.map((p,f)=>{let h=(n-i*2)/t.length,u=i+f*h+h/2,v=a-i-p.lineValue/c*(a-i*2);return {x:u,y:v,item:p}});return g(ne,{spacing:1.25,children:[g("div",{component:"svg",viewBox:`0 0 ${n} ${a}`,style:{width:"100%",height:a},children:[f("line",{x1:i,y1:a-i,x2:n-i,y2:a-i,style:{stroke:"var(--orb-chart-grid)"}}),d.map(p=>f("rect",{x:p.x,y:p.y,width:p.barWidth,height:Math.max(p.barHeight,4),rx:6,style:{fill:o}},p.item.name)),f("polyline",{fill:"none",style:{stroke:r},strokeWidth:3,points:m.map(p=>`${p.x},${p.y}`).join(" ")}),m.map(p=>f("circle",{cx:p.x,cy:p.y,r:3.5,style:{fill:r}},`${p.item.name}-line`))]}),f("div",{style:{display:"grid",gridTemplateColumns:`repeat(${t.length}, minmax(0, 1fr))`,gap:1},children:t.map(p=>g("div",{style:{minWidth:0},children:[f(A,{variant:"caption",title:p.name,sx:{display:"block"},children:p.name}),g(A,{variant:"caption",muted:true,sx:{display:"block"},children:["Bar: ",p.barValue.toFixed(1)]}),g(A,{variant:"caption",muted:true,sx:{display:"block"},children:["Line: ",p.lineValue.toFixed(1)]})]},p.name))})]})};var Hg=t=>{let r=.2+Math.max(0,Math.min(1,t))*.8;return `color-mix(in oklch, var(--orb-chart-1) ${Math.round(r*100)}%, transparent)`},Sd=({data:t})=>{if(t.length===0)return f(A,{variant:"body2",muted:true,children:"No data"});let o=Array.from(new Set(t.map(i=>i.x))),r=Array.from(new Set(t.map(i=>i.y))),a=Math.max(...t.map(i=>i.value),1),n=new Map(t.map(i=>[`${i.y}__${i.x}`,i.value]));return f("div",{style:{overflowX:"auto"},children:g("div",{style:{display:"grid",gridTemplateColumns:`120px repeat(${o.length}, minmax(64px, 1fr))`,gap:1,minWidth:120+o.length*64},children:[f("div",{}),o.map(i=>f(A,{variant:"caption",sx:{textAlign:"center",fontWeight:600},children:i},i)),r.map(i=>g("div",{style:{display:"contents"},children:[f(A,{variant:"caption",sx:{alignSelf:"center"},children:i}),o.map(s=>{let c=n.get(`${i}__${s}`)||0,d=c/a;return f("div",{sx:{height:36,borderRadius:1,background:Hg(d),border:"1px solid color-mix(in oklch, var(--orb-muted) 20%, transparent)",display:"flex",alignItems:"center",justifyContent:"center"},children:f(A,{variant:"caption",sx:{fontWeight:700},children:c.toFixed(1)})},`${i}-${s}`)})]},i))]})})};var Wg=["var(--orb-chart-1)","var(--orb-chart-2)","var(--orb-chart-5)","var(--orb-chart-negative)","var(--orb-chart-4)","var(--orb-chart-3)"],Qn=({data:t,variant:o="donut",colors:r=Wg,size:a=180,activeName:n,onItemClick:i})=>{if(t.length===0)return f(A,{variant:"body2",muted:true,children:"No data"});let s=0,c=t.map((d,m)=>{let p=s;return s+=d.percent,`${r[m%r.length]} ${p}% ${s}%`});return g(ne,{direction:{xs:"column",sm:"row"},spacing:2,alignItems:"center",children:[f("div",{style:{width:a,height:a,borderRadius:"50%",background:`conic-gradient(${c.join(", ")})`,position:"relative",flexShrink:0},children:o==="donut"&&f("div",{style:{position:"absolute",inset:Math.round(a*.18),background:"background.paper",borderRadius:"50%"}})}),f(ne,{spacing:1,sx:{minWidth:180},children:t.map((d,m)=>g("div",{onClick:()=>i?.(d),sx:{display:"flex",alignItems:"center",gap:1,cursor:i?"pointer":"default",opacity:n&&d.name!==n?.45:1},children:[f("div",{style:{width:10,height:10,borderRadius:"50%",background:r[m%r.length]}}),f(A,{variant:"caption",sx:{flex:1},children:d.name}),g(A,{variant:"caption",sx:{fontWeight:700},children:[d.percent.toFixed(0),"%"]})]},d.name))})]})};var wd=({effect:t,branches:o})=>{if(o.length===0)return f(A,{variant:"body2",muted:true,children:"No data"});let r=o.filter((n,i)=>i%2===0),a=o.filter((n,i)=>i%2===1);return g(ne,{spacing:1.5,children:[f("div",{style:{display:"grid",gridTemplateColumns:`repeat(${Math.max(r.length,1)}, minmax(0, 1fr))`,gap:1},children:r.map(n=>g("div",{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1},children:[f(A,{variant:"caption",sx:{fontWeight:700},children:n.title}),n.causes.map(i=>f(A,{variant:"caption",muted:true,sx:{display:"block"},children:i},i))]},n.title))}),g("div",{style:{position:"relative",height:32},children:[f("div",{style:{position:"absolute",inset:"50% 0 auto 0",borderTop:"2px solid",borderColor:"primary.main"}}),f("div",{sx:{position:"absolute",right:0,top:"calc(50% - 12px)",px:1,py:.25,borderRadius:1,background:"primary.main",color:"primary.contrastText"},children:f(A,{variant:"caption",sx:{fontWeight:700},children:t})})]}),f("div",{style:{display:"grid",gridTemplateColumns:`repeat(${Math.max(a.length,1)}, minmax(0, 1fr))`,gap:1},children:a.map(n=>g("div",{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1},children:[f(A,{variant:"caption",sx:{fontWeight:700},children:n.title}),n.causes.map(i=>f(A,{variant:"caption",muted:true,sx:{display:"block"},children:i},i))]},n.title))})]})};var kd=({data:t,height:o=240})=>{if(t.length===0)return f(A,{variant:"body2",muted:true,children:"No data"});let r=0,a=t.map(f=>{let h=f.type==="total"?0:r,u=f.type==="total"?f.value:r+f.value;return f.type!=="total"&&(r=u),{...f,start:h,end:u,delta:u-h}}),n=a.flatMap(f=>[f.start,f.end]),i=Math.min(...n,0),s=Math.max(...n,1),c=680,d=30,m=s-i||1,p=f=>o-d-(f-i)/m*(o-d*2);return g("div",{children:[g("div",{component:"svg",viewBox:`0 0 ${c} ${o}`,style:{width:"100%",height:o},children:[f("line",{x1:d,y1:p(0),x2:c-d,y2:p(0),style:{stroke:"var(--orb-chart-grid)"}}),a.map((f$1,h)=>{let u=(c-d*2)/a.length,v=Math.max(u*.55,8),y=d+h*u+(u-v)/2,g$1=p(Math.max(f$1.start,f$1.end)),C=p(Math.min(f$1.start,f$1.end)),b=f$1.type==="total"?"var(--orb-chart-1)":f$1.delta>=0?"var(--orb-chart-positive)":"var(--orb-chart-negative)";return g("g",{children:[f("rect",{x:y,y:g$1,width:v,height:Math.max(C-g$1,4),rx:6,style:{fill:b}}),f("text",{x:y+v/2,y:g$1-6,textAnchor:"middle",fill:"currentColor",fontSize:"11",children:f$1.end.toFixed(1)})]},f$1.name)})]}),f("div",{sx:{mt:1,display:"grid",gridTemplateColumns:`repeat(${a.length}, minmax(0, 1fr))`,gap:1},children:a.map(f$1=>f(A,{variant:"caption",title:f$1.name,children:f$1.name},f$1.name))})]})};var Oa=({apiKey:t,query:o,zoom:r=14,mapType:a="roadmap"})=>{let n=encodeURIComponent(o);return `https://www.google.com/maps/embed/v1/place?key=${encodeURIComponent(t)}&q=${n}&zoom=${r}&maptype=${a}`},DP=(t,o=360)=>{let r=Oa(t);return `<iframe width="100%" height="${o}" style="border:0" loading="lazy" allowfullscreen referrerpolicy="no-referrer-when-downgrade" src="${r}"></iframe>`};var Pd=({apiKey:t,query:o,embedUrl:r,zoom:a=14,mapType:n="roadmap",height:i=320})=>{let s=r||(t&&o?Oa({apiKey:t,query:o,zoom:a,mapType:n}):"");return s?g("div",{children:[f("div",{component:"iframe",src:s,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",sx:{width:"100%",height:i,border:0,borderRadius:2}}),g(A,{variant:"caption",muted:true,sx:{mt:.75,display:"block"},children:["If iframe is blocked, open directly: ",f("a",{href:s,target:"_blank",rel:"noreferrer",children:"Google Maps"})]})]}):f("div",{children:f(A,{variant:"body2",muted:true,children:"Google Map requires `embedUrl` or (`apiKey` + `query`)."})})};var jn=({keyword:t,location:o,src:r="orbcafe-ui"})=>{if(o){let a=encodeURIComponent(o.name||t||"Location");return `https://uri.amap.com/marker?position=${o.lng},${o.lat}&name=${a}&src=${encodeURIComponent(r)}&coordinate=gaode&callnative=0`}return t?`https://uri.amap.com/search?keyword=${encodeURIComponent(t)}&src=${encodeURIComponent(r)}&callnative=0`:"https://uri.amap.com/search?keyword=%E5%8C%97%E4%BA%AC&src=orbcafe-ui&callnative=0"};var Td=({keyword:t,location:o,embedUrl:r,height:a=320})=>{let n=r||jn({keyword:t,location:o?{lng:o.lng,lat:o.lat,name:o.name}:void 0});return g("div",{children:[f("div",{component:"iframe",src:n,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",sx:{width:"100%",height:a,border:0,borderRadius:2}}),g(A,{variant:"caption",muted:true,sx:{mt:.75,display:"block"},children:["If iframe is blocked, open directly: ",f("a",{href:n,target:"_blank",rel:"noreferrer",children:"AMap"})]})]})};var Id=({billableByPrimary:t,efficiencyBySecondary:o,statusDistribution:r,interaction:a})=>{let{t:n}=ce();return g("div",{style:{display:"grid",gap:12,gridTemplateColumns:"repeat(auto-fit, minmax(320px, 1fr))"},children:[f(Zn,{title:n("graph.chart.billable.title"),subtitle:n("graph.chart.billable.subtitle"),children:f(Ba,{data:t,orientation:"horizontal",activeName:a?.filters?.primaryDimension,onItemClick:i=>a?.onPrimaryDimensionClick?.(i.name)})}),f(Zn,{title:n("graph.chart.efficiency.title"),subtitle:n("graph.chart.efficiency.subtitle"),children:f(Ba,{data:o,orientation:"vertical",valueSuffix:"%",activeName:a?.filters?.secondaryDimension,onItemClick:i=>a?.onSecondaryDimensionClick?.(i.name)})}),f(Zn,{title:n("graph.chart.status.title"),subtitle:n("graph.chart.status.subtitle"),children:f(Qn,{data:r,variant:"donut",activeName:a?.filters?.status,onItemClick:i=>a?.onStatusClick?.(i.name)})})]})};var Gg=["doubao-lite","gpt-4o-mini","gpt-4.1-mini","claude-3.5-sonnet"],_g=["zh","en","de","fr","ja","ko"],Rd=({open:t,onClose:o,value:r,onSaveAll:a,modelOptions:n=Gg,promptLangOptions:i=_g,analysisTemplateOptions:s=[],responseTemplateOptions:c=[],defaultAnalysisTemplateId:d,defaultResponseTemplateId:m})=>{let[p,f$1]=useState(r),[h,u]=useState(d||""),[v,y]=useState(m||""),[g$1,C]=useState(false);useEffect(()=>{t&&(f$1(r),u(d||""),y(m||""));},[t,r,d,m]);let b=(k,x)=>{f$1(E=>({...E,[k]:x}));},S=async()=>{if(a)try{C(!0),await a({settings:p,analysisTemplateId:h||void 0,responseTemplateId:v||void 0});}finally{C(false);}};return g(zt,{open:t,onClose:o,fullWidth:true,maxWidth:"lg",children:[g("div",{className:"orb-dialog-title",sx:{pr:7,pb:2.2},children:[f(A,{variant:"h5",sx:{fontWeight:800},children:"AI Settings"}),f(A,{variant:"body2",color:"text.secondary",sx:{mt:.5},children:"Configure LLM settings and editable agent prompts by language."}),f(ae,{onClick:o,sx:{position:"absolute",right:12,top:12},children:f(pr,{})})]}),f("div",{className:"orb-dialog-content",sx:{pt:"18px !important"},children:g(ne,{spacing:2.2,children:[g("div",{sx:{mt:.8,display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",md:"repeat(2, minmax(0, 1fr))"}},children:[f("div",{children:f(Be,{size:"small",value:p.baseUrl,onChange:k=>b("baseUrl",k.target.value),fullWidth:true,label:"Base URL"})}),f("div",{children:f(Be,{size:"small",type:"password",value:p.apiKey,onChange:k=>b("apiKey",k.target.value),fullWidth:true,label:"API Key"})}),f("div",{children:f(Be,{size:"small",value:p.model,onChange:k=>b("model",k.target.value),fullWidth:true,select:true,label:"Model",children:n.map(k=>f("option",{value:k,children:k},k))})}),f("div",{children:f(Be,{size:"small",value:p.promptLang,onChange:k=>b("promptLang",k.target.value),fullWidth:true,select:true,label:"Prompt Lang",children:i.map(k=>f("option",{value:k,children:k},k))})})]}),g("div",{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[g(Be,{size:"small",value:h,onChange:k=>u(k.target.value),fullWidth:true,select:true,label:"Analysis Template",children:[f("option",{value:"",children:"Default"}),s.map(k=>f("option",{value:k.id,children:k.label},k.id))]}),f(xa,{multiline:true,minRows:8,value:p.analysisPrompt,onChange:k=>b("analysisPrompt",k.target.value),fullWidth:true,label:"Analysis Prompt",sx:{"& textarea":{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"}}}),g(Be,{size:"small",value:v,onChange:k=>y(k.target.value),fullWidth:true,select:true,label:"Response Template",children:[f("option",{value:"",children:"Default"}),c.map(k=>f("option",{value:k.id,children:k.label},k.id))]}),f(xa,{multiline:true,minRows:8,value:p.responsePrompt,onChange:k=>b("responsePrompt",k.target.value),fullWidth:true,label:"Response Prompt",sx:{"& textarea":{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"}}})]})]})}),g("div",{className:"orb-dialog-actions",sx:{px:3,pb:2.5,pt:1.2,gap:1},children:[f(be,{variant:"outlined",onClick:o,children:"Cancel"}),f(be,{variant:"contained",onClick:S,disabled:!a||g$1,children:"Save"})]})]})};var ei=({open:t,onClose:o,model:r,tableContent:a,extraCharts:n,interaction:i,aiAssistant:s})=>{let{t:c}=ce(),[d,m]=useState(s?.defaultPrompt||""),[p,f$1]=useState(false),[h,u]=useState(false),v=i?.enabled!==false&&!!i,y=s?.enabled!==false,g$1=i?.filters||{},C=!!(g$1.primaryDimension||g$1.secondaryDimension||g$1.status),b=s?.placeholder||"Ask AI to analyze data, create charts, or find insights...";useEffect(()=>{t&&m(s?.defaultPrompt||"");},[t,s?.defaultPrompt]);let S=s?.settings||{baseUrl:"/llm-api",apiKey:"",model:"doubao-lite",promptLang:"zh",analysisPrompt:"",responsePrompt:""},k=async()=>{let x=d.trim();if(!(!x||!s?.onSubmit))try{f$1(!0),await s.onSubmit(x,{filters:g$1,model:r});}finally{f$1(false);}};return f(zt,{open:t,onClose:o,fullWidth:true,maxWidth:1400,hideCloseButton:true,children:g("div",{style:{height:"80vh",display:"flex",flexDirection:"column",background:"var(--orb-canvas)"},children:[f("div",{style:{padding:16,borderBottom:"1px solid var(--orb-border)"},children:g(ne,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:12,children:[g(ne,{direction:"row",spacing:10,alignItems:"center",sx:{flexWrap:"wrap"},children:[f(A,{variant:"h3",sx:{fontWeight:800},children:r.title}),f(kt,{label:c("graph.records",{count:r.kpis.totalRecords})}),v&&g$1.primaryDimension&&f(kt,{tone:"outline",label:`${i?.fieldMapping.primaryDimension}: ${g$1.primaryDimension}`,onDelete:()=>i?.onClearFilter("primaryDimension")}),v&&g$1.secondaryDimension&&f(kt,{tone:"outline",label:`${i?.fieldMapping.secondaryDimension}: ${g$1.secondaryDimension}`,onDelete:()=>i?.onClearFilter("secondaryDimension")}),v&&g$1.status&&f(kt,{tone:"outline",label:`${i?.fieldMapping.status}: ${g$1.status}`,onDelete:()=>i?.onClearFilter("status")}),v&&C&&f(be,{size:"small",variant:"ghost",onClick:()=>i?.onClearAll(),children:"Clear"})]}),g(ne,{direction:"row",spacing:10,alignItems:"center",children:[y&&g("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"6px 10px",borderRadius:999,border:"1px solid var(--orb-border)",background:"var(--orb-surface)",minWidth:320},children:[f(ae,{size:"small",onClick:s?.onVoiceInput,children:f(sn,{size:16,strokeWidth:1.8})}),f("input",{className:"orb-inp orb-inp-dense",value:d,onChange:x=>m(x.target.value),onKeyDown:x=>{x.key==="Enter"&&(x.preventDefault(),k());},placeholder:b,style:{fontSize:14,border:"none",background:"transparent",flex:1,minWidth:0}}),f(ae,{size:"small",onClick:k,disabled:p||!d.trim(),children:f(El,{size:16,strokeWidth:1.8})}),f(ae,{size:"small",onClick:()=>u(true),children:f(un,{size:16,strokeWidth:1.8})})]}),f(ae,{onClick:o,children:f(to,{size:18,strokeWidth:2})})]})]})}),g("div",{style:{padding:16,display:"flex",flexDirection:"column",gap:12,overflow:"auto",minHeight:0},children:[f(yd,{kpis:r.kpis}),f(Id,{billableByPrimary:r.charts.billableByPrimary,efficiencyBySecondary:r.charts.efficiencyBySecondary,statusDistribution:r.charts.statusDistribution,interaction:v?{filters:g$1,onPrimaryDimensionClick:x=>i?.onPrimaryDimensionClick(x),onSecondaryDimensionClick:x=>i?.onSecondaryDimensionClick(x),onStatusClick:x=>i?.onStatusClick(x)}:void 0}),n,a]}),f(Rd,{open:h,onClose:()=>u(false),value:S,onSaveAll:s?.onSaveAll,modelOptions:s?.modelOptions,promptLangOptions:s?.promptLangOptions,analysisTemplateOptions:s?.analysisTemplateOptions,responseTemplateOptions:s?.responseTemplateOptions,defaultAnalysisTemplateId:s?.defaultAnalysisTemplateId,defaultResponseTemplateId:s?.defaultResponseTemplateId})]})})};var hr={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"]},Kg=5,Md=t=>t.toLowerCase().replace(/[\s_-]/g,""),br=(t,o,r,a)=>{if(o)return o;if(t.length===0)return a;let n=Object.keys(t[0]),i=new Map(n.map(s=>[Md(s),s]));for(let s of r){let c=i.get(Md(s));if(c)return c}return n[0]||a},So=t=>{if(typeof t=="number")return Number.isFinite(t)?t:0;if(typeof t=="string"){let o=Number(t.replace(/,/g,"").trim());return Number.isFinite(o)?o:0}return 0},co=(t,o)=>t==null||t===""?o:String(t),qg=(t,o,r,a,n)=>{let i=new Map;return t.forEach(s=>{let c=co(s[o],n);i.set(c,(i.get(c)||0)+So(s[r]));}),Array.from(i.entries()).map(([s,c])=>({name:s,value:c})).sort((s,c)=>c.value-s.value).slice(0,a)},Xg=(t,o,r,a,n,i)=>{let s=new Map;return t.forEach(c=>{let d=co(c[o],i),m=s.get(d)||{report:0,billable:0};m.report+=So(c[r]),m.billable+=So(c[a]),s.set(d,m);}),Array.from(s.entries()).map(([c,d])=>({name:c,value:d.report>0?d.billable/d.report*100:0})).sort((c,d)=>c.value-d.value).slice(0,n)},Yg=(t,o,r)=>{let a=t.length;if(a===0)return [];let n=new Map;return t.forEach(i=>{let s=co(i[o],r);n.set(s,(n.get(s)||0)+1);}),Array.from(n.entries()).map(([i,s])=>({name:i,value:s,percent:s/a*100}))},Dd=(t,o,r)=>{let a=new Map;return t.forEach(n=>{let i=co(n[o],"N/A");a.set(i,(a.get(i)||0)+So(n[r]));}),Array.from(a.entries()).sort(([n],[i])=>n.localeCompare(i)).map(([n,i])=>({name:n,value:i}))},Zg=(t,o,r,a,n,i)=>{let s=new Map;return t.forEach(c=>{let d=co(c[o],i),m=s.get(d)||{report:0,billable:0};m.report+=So(c[r]),m.billable+=So(c[a]),s.set(d,m);}),Array.from(s.entries()).map(([c,d])=>({name:c,barValue:d.billable,lineValue:d.report>0?d.billable/d.report*100:0})).sort((c,d)=>d.barValue-c.barValue).slice(0,n)},Qg=(t,o,r,a,n)=>{let i=new Map;return t.forEach(s=>{let c=co(s[o],n),d=co(s[r],n),m=`${c}__${d}`;i.set(m,(i.get(m)||0)+So(s[a]));}),Array.from(i.entries()).map(([s,c])=>{let[d,m]=s.split("__");return {x:d,y:m,value:c}})},jg=(t,o,r)=>{let a=Dd(t,o,r),n=a.map(s=>({name:s.name,value:s.value,type:"delta"})),i=a.reduce((s,c)=>s+c.value,0);return [...n,{name:"Total",value:i,type:"total"}]},Jg=(t,o,r,a,n,i)=>{let s=new Map;return t.forEach(c=>{let d=co(c[o],i),m=`${co(c[r],i)} / ${co(c[a],i)}`,p=s.get(d)||new Map;p.set(m,(p.get(m)||0)+1),s.set(d,p);}),Array.from(s.entries()).map(([c,d])=>({title:c,causes:Array.from(d.entries()).sort((m,p)=>p[1]-m[1]).slice(0,n).map(([m,p])=>`${m} (${p})`)})).slice(0,6)},Jr=({rows:t,config:o})=>{let{t:r}=ce(),a=r("graph.unassigned"),n=useMemo(()=>{let p=o?.fieldMapping;return {primaryDimension:br(t,p?.primaryDimension,hr.primaryDimension,"Category"),secondaryDimension:br(t,p?.secondaryDimension,hr.secondaryDimension,"Owner"),status:br(t,p?.status,hr.status,"Status"),date:br(t,p?.date,hr.date,"Date"),description:br(t,p?.description,hr.description,"Description"),reportHours:br(t,p?.reportHours,hr.reportHours,"ReportHours"),billableHours:br(t,p?.billableHours,hr.billableHours,"BillableHours"),amount:br(t,p?.amount,hr.amount,"Amount")}},[t,o?.fieldMapping]),i=useMemo(()=>t.map((p,f)=>{let h=So(p[n.reportHours]),u=So(p[n.billableHours]),v=So(p[n.amount]),y=h>0?u/h*100:0;return {id:`graph-row-${f}`,Date:co(p[n.date],""),Primary:co(p[n.primaryDimension],a),Secondary:co(p[n.secondaryDimension],a),Description:co(p[n.description],""),ReportHours:h,BillableHours:u,Amount:v,Efficiency:y,Status:co(p[n.status],a)}}),[t,n,a]),s=useMemo(()=>{let p=i.length,f=i.reduce((C,b)=>C+So(b.ReportHours),0),h=i.reduce((C,b)=>C+So(b.BillableHours),0),u=i.reduce((C,b)=>C+So(b.Amount),0),v=f>0?h/f*100:0,y=o?.statusFlagValues||["flag","flagged","warning","risk"],g=i.filter(C=>y.includes(co(C.Status,"").toLowerCase())).length;return {totalRecords:p,totalReportHours:f,totalBillableHours:h,efficiency:v,totalAmount:u,flaggedCount:g}},[i,o?.statusFlagValues]),c=o?.topN||Kg,d=useMemo(()=>({billableByPrimary:qg(i,"Primary","BillableHours",c,a),efficiencyBySecondary:Xg(i,"Secondary","ReportHours","BillableHours",c,a),statusDistribution:Yg(i,"Status",a),lineByDate:Dd(i,"Date","BillableHours"),comboByPrimary:Zg(i,"Primary","ReportHours","BillableHours",c,a),heatmapPrimarySecondary:Qg(i,"Primary","Secondary","BillableHours",a),waterfallBillable:jg(i,"Date","BillableHours"),fishboneStatusCauses:Jg(i,"Status","Primary","Secondary",3,a)}),[i,c,a]),m=useMemo(()=>({title:o?.title||r("graph.reportTitle"),kpis:s,charts:d,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}}),[d,o?.title,n,s,i,r]);return {fieldMapping:n,model:m}};var ea=t=>String(t??"").trim(),oi=(t={})=>{let[o,r]=useState(t),a=useCallback((d,m)=>{r(p=>{let f=m?.trim();if(!f){let h={...p};return delete h[d],h}if(p[d]===f){let h={...p};return delete h[d],h}return {...p,[d]:f}});},[]),n=useCallback(d=>{r(m=>{if(!m[d])return m;let p={...m};return delete p[d],p});},[]),i=useCallback(()=>{r({});},[]),s=useMemo(()=>!!(o.primaryDimension||o.secondaryDimension||o.status),[o]),c=useCallback((d,m)=>d.filter(p=>!(o.primaryDimension&&ea(p[m.primaryDimension])!==ea(o.primaryDimension)||o.secondaryDimension&&ea(p[m.secondaryDimension])!==ea(o.secondaryDimension)||o.status&&ea(p[m.status])!==ea(o.status))),[o]);return {filters:o,setFilter:a,clearFilter:n,clearAll:i,hasActiveFilters:s,applyRows:c}};var ai=({variants:t,currentVariantId:o,onLoad:r,onSave:a,onDelete:n,onSetDefault:i})=>{let{t:s}=ce(),[c,d]=useState(false),[m,p]=useState(""),[f$1,h]=useState(false),[u,v]=useState(false),y=t.find(b=>b.id===o),g$1=()=>{p(y?.name||s("variant.newVariant")),h(y?.isDefault||false),v(y?.isPublic||false),d(true);},C=()=>{a({name:m,isDefault:f$1,isPublic:u,description:""}),d(false);};return g("div",{className:"orb-variant-management",children:[f(_t,{size:"small",fullWidth:false,sx:{width:"min(240px, 100%)","& .orb-inp":{fontSize:"0.85rem",backgroundColor:"var(--orb-p50)",borderColor:"color-mix(in oklch, var(--orb-primary) 30%, var(--orb-border))"}},value:o||"",options:[{value:"",label:s("variant.selectVariant"),disabled:true},...t.map(b=>({value:b.id,label:b.name+(b.isDefault?` (${s("variant.defaultSuffix")})`:"")}))],onChange:b=>{let S=t.find(k=>k.id===b.target.value);S&&r(S);}}),f(nt,{title:s("variant.saveView"),children:f(ae,{className:"orb-variant-save-button",onClick:g$1,size:"small",color:"primary",children:f(mr,{fontSize:"small"})})}),g(zt,{open:c,onClose:()=>d(false),children:[f("div",{className:"orb-dialog-title",children:s("variant.saveView")}),g("div",{className:"orb-dialog-content",children:[f(Be,{autoFocus:true,margin:"dense",label:s("variant.viewName"),fullWidth:true,variant:"outlined",value:m,onChange:b=>p(b.target.value)}),f(Na,{control:f(Mt,{checked:f$1,onChange:b=>h(b.target.checked)}),label:s("variant.setDefault")}),f(Na,{control:f(Mt,{checked:u,onChange:b=>v(b.target.checked)}),label:s("variant.publicAllUsers")})]}),g("div",{className:"orb-dialog-actions",children:[f(be,{onClick:()=>d(false),children:s("common.cancel")}),f(be,{onClick:C,variant:"contained",children:s("common.save")})]})]})]})};var Nd=({appId:t,tableKey:o="default",currentFilters:r,currentLayoutId:a,layoutRefs:n,onLoad:i,variantService:s,serviceUrl:c,onError:d,onSuccess:m,currentVariantId:p,onVariantChange:f$1})=>{let{t:h}=ce(),[u,v]=useState([]),[y,g]=useState(""),C=`orbcafe.variants.${t}.${o}`,b=p!==void 0?p:y,S=M=>{p===void 0&&g(M),f$1&&f$1(M);},k=useCallback(()=>{try{let M=localStorage.getItem(C);if(!M)return [];let I=JSON.parse(M);return Array.isArray(I)?I:[]}catch{return []}},[C]),x=useCallback(M=>{try{localStorage.setItem(C,JSON.stringify(M));}catch{}},[C]),E=useCallback(M=>{v(M);let I=M.find(L=>L.isDefault);I&&!b&&(S(I.id),i(I));},[b,i,S]),D=useCallback(async()=>{if(!t)return [];try{let M=[];if(s)M=await s.getVariants(t,o);else if(c){let I=await fetch(`${c}/api/variants?appId=${encodeURIComponent(t)}&tableKey=${encodeURIComponent(o)}`);if(!I.ok)throw new Error(h("variant.toast.fetchFailed"));M=await I.json();}else M=k();return E(M),M}catch(M){console.error("Error fetching variants",M);let I=k();return E(I),d&&d(h("variant.toast.fetchFailed")),I}},[t,o,s,c,k,E,d,h]);return useEffect(()=>{D();},[t,o]),f(ai,{variants:u,currentVariantId:b,onLoad:M=>{S(M.id),i(M);},onSave:async M=>{let I=Date.now().toString(),L;try{let O=M.scope||"Both",U=u.find(q=>q.name===M.name);I=U?U.id:Date.now().toString();let z=[];if(U&&(Array.isArray(U.filters)?z=[...U.filters]:U.filters&&(z=[{scope:"default",filters:U.filters}])),O==="Search"||O==="Both"){let q=(Array.isArray(r),r);if(q)if(Array.isArray(q)&&q.length>0&&q[0].scope)q.forEach(H=>{let V=z.findIndex(Z=>Z.scope===H.scope);V>=0?z[V]=H:z.push(H);});else {let H={scope:o,filters:q},V=z.findIndex(Z=>Z.scope===o);V>=0?z[V]=H:z.push(H);}}let K=U?.layout||{},W=[];if(U&&Array.isArray(U.layoutRefs)&&(W=[...U.layoutRefs]),O==="Layout"||O==="Both")if(n&&n.length>0)n.forEach(q=>{let H=W.findIndex(V=>V.tableKey===q.tableKey);H>=0?W[H]=q:W.push(q);});else {let q={tableKey:o,layoutId:a||null},H=W.findIndex(V=>V.tableKey===o);H>=0?W[H]=q:W.push(q);}if(L={appId:t,tableKey:o,...M,scope:O,id:I,createdAt:new Date().toISOString(),filters:z,layout:K,layoutRefs:W},s)await s.saveVariant(L,t,o);else if(c){if(!(await fetch(`${c}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(L)})).ok)throw new Error(h("variant.toast.saveFailed"))}else {let H=u.some(V=>V.id===I)?u.map(V=>V.id===I?L:V):[...u,L];v(H),x(H);}m&&m(h("variant.toast.saveSuccess")),(s||c)&&await D(),S(I),i(L);}catch(O){console.error("Error saving variant",O);let z=u.some(K=>K.id===I)?u.map(K=>K.id===I?L:K):[...u,L];v(z),x(z),S(I),i(L),d&&d(h("variant.toast.saveFailed"));}},onDelete:async M=>{try{if(s)await s.deleteVariant(M);else if(c){if(!(await fetch(`${c}/api/variants/${M}`,{method:"DELETE"})).ok)throw new Error(h("variant.toast.deleteFailed"))}else {let I=u.filter(L=>L.id!==M);v(I),x(I);}b===M&&S(""),(s||c)&&D(),m&&m(h("variant.toast.deleteSuccess"));}catch(I){console.error("Error deleting variant",I);let L=u.filter(O=>O.id!==M);v(L),x(L),b===M&&S(""),d&&d(h("variant.toast.deleteFailed"));}},onSetDefault:async M=>{try{let I=u.find(O=>O.id===M);if(!I)return;let L={appId:t,tableKey:o,...I,isDefault:!0};if(s)await s.setDefaultVariant(M,t,o);else if(c){if(!(await fetch(`${c}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(L)})).ok)throw new Error(h("variant.toast.defaultFailed"))}else {let O=u.map(U=>({...U,isDefault:U.id===M}));v(O),x(O);}(s||c)&&await D(),m&&m(h("variant.toast.defaultSuccess"));}catch(I){console.error("Error setting default variant",I);let L=u.map(O=>({...O,isDefault:O.id===M}));v(L),x(L),d&&d(h("variant.toast.defaultFailed"));}}})};Zo.extend(nf);Zo.extend(sf);Zo.extend(Um);var Va="YYYY-MM-DD",cf=[null,null],Mr="0.85rem",df={en:"en",zh:"zh-cn",fr:"fr",de:"de",ja:"ja",ko:"ko"},pf=({isInRange:t,isStart:o,isEnd:r,isHovered:a,disableMargin:n,sx:i,...s})=>{let c=ro();return f(xc,{...s,sx:[...Array.isArray(i)?i:i?[i]:[],t?{borderRadius:0,backgroundColor:c.palette.primary.light,color:c.palette.primary.contrastText}:{},a&&!t&&!o&&!r?{borderRadius:0,backgroundColor:c.palette.action.hover,border:`1px dashed ${c.palette.primary.main}`}:{},o?{borderRadius:"50% 0 0 50%",backgroundColor:c.palette.primary.main,color:c.palette.primary.contrastText}:{},r?{borderRadius:"0 50% 50% 0",backgroundColor:c.palette.primary.main,color:c.palette.primary.contrastText}:{},o&&r?{borderRadius:"50%"}:{}]})},Ld=({label:t,value:o=cf,onChange:r})=>{let{t:a,locale:n}=ce(),i=df[n]||"en",s=t||a("dateRange.label"),[c,d]=useState(null),[m,p]=useState(o),[f$1,h]=useState("start"),[u,v]=useState(null),[y,g$1]=useState((o[0]||Zo()).locale(i)),[C,b]=useState(""),[S,k]=useState(""),[x,E]=useState(false),[D,T]=useState(false),N=Yt__default.useRef(o);useEffect(()=>{let[q,H]=o,[V,Z]=N.current,j=ge=>ge&&typeof ge.isSame=="function",me=!(q===null&&V===null||j(q)&&j(V)&&q.isSame(V,"day")),ie=!(H===null&&Z===null||j(H)&&j(Z)&&H.isSame(Z,"day"));(me||ie)&&(p(o),o[0]&&j(o[0])&&g$1(o[0].locale(i))),N.current=o;},[o,i]),useEffect(()=>{b(m[0]?m[0].locale(i).format(Va):""),k(m[1]?m[1].locale(i).format(Va):""),E(false),T(false);},[m,i]);let R=(q,H)=>{let V=H.trim(),Z=q==="start"?E:T;if(!V){let ie=q==="start"?[null,m[1]]:[m[0],null];Z(false),p(ie);return}let j=Zo(V,Va,true).locale(i);if(!j.isValid()){Z(true);return}Z(false);let me=[...m];if(q==="start")me[0]=j,me[1]&&j.isAfter(me[1],"day")&&(me[1]=null),h(me[1]?"start":"end");else {let ie=me[0];ie&&j.isBefore(ie,"day")?(me=[j,null],h("end")):(me[1]=j,h("start"));}p(me),g$1(j);},w=q=>{d(q.currentTarget);},M=()=>{d(null),h("start"),v(null);},I=!!c,L=q=>{if(!q)return;let H=[...m];if(f$1==="start")H=[q,null],h("end");else {let V=H[0];V&&q.isBefore(V)?(H=[q,null],h("end")):(H=[V,q],h("start"));}p(H);},O=q=>{let H=Zo().locale(i),V=[null,null];switch(q){case "today":V=[H,H];break;case "week":V=[H.startOf("week"),H.endOf("week")];break;case "month":V=[H.startOf("month"),H.endOf("month")];break}p(V),h("start"),g$1(H);},U=()=>{r&&r(m),M();},z=()=>{p(o),h("start"),M();},K=useCallback(q=>{let{day:H,...V}=q,[Z,j]=m,me=Z?H.isSame(Z,"day"):false,ie=j?H.isSame(j,"day"):false,ge=Z&&j?H.isBetween(Z,j,"day","()"):false,ye=false;return f$1==="end"&&Z&&!j&&u&&H.isAfter(Z,"day")&&H.isBefore(u.add(1,"day"),"day")&&(ye=true),f(pf,{...V,day:H,disableMargin:true,isStart:me,isEnd:ie,isInRange:ge||ye,onMouseEnter:()=>v(H)})},[m,f$1,u]),W=q=>q?q.locale(i).format("YYYY-MM-DD"):"";return g("div",{className:"orb-date-range-picker",children:[f(Be,{className:"orb-date-range-field",label:s,value:m[0]?`${W(m[0])} - ${W(m[1])}`:"",onClick:w,fullWidth:true,size:"small",InputLabelProps:{sx:{fontSize:Mr}},InputProps:{readOnly:true,sx:{fontSize:Mr,"& .orb-inp":{fontSize:Mr},paddingRight:"4px"},endAdornment:f(ae,{className:"orb-date-range-calendar-trigger",size:"small",onClick:w,tooltip:s,children:f(Rt,{name:"calendar",size:16})})}}),g(Dn,{open:I,anchorEl:c,onClose:M,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},className:"orb-date-range-popover",children:[f("div",{className:"orb-date-range-inputs",children:g(ne,{className:"orb-date-range-input-row",direction:"row",alignItems:"center",spacing:1.5,justifyContent:"space-between",children:[f(Be,{className:"orb-date-range-manual-field",label:a("dateRange.startDate"),placeholder:Va,value:C,error:x,size:"small",onFocus:()=>h("start"),onChange:q=>{b(q.target.value),x&&E(false);},onBlur:()=>R("start",C),onKeyDown:q=>{q.key==="Enter"&&(q.preventDefault(),R("start",C));},sx:{"& .orb-inp":{fontSize:Mr,py:.75},"& label":{fontSize:Mr}}}),f(Pc,{color:"action",fontSize:"small"}),f(Be,{className:"orb-date-range-manual-field",label:a("dateRange.endDate"),placeholder:Va,value:S,error:D,size:"small",onFocus:()=>{m[0]&&h("end");},onChange:q=>{k(q.target.value),D&&T(false);},onBlur:()=>R("end",S),onKeyDown:q=>{q.key==="Enter"&&(q.preventDefault(),R("end",S));},sx:{"& .orb-inp":{fontSize:Mr,py:.75},"& label":{fontSize:Mr}}})]})}),f("div",{className:"orb-date-range-shortcuts",children:g(ne,{direction:"row",spacing:1,justifyContent:"center",children:[f(kt,{label:a("dateRange.today"),onClick:()=>O("today"),clickable:true,size:"small",variant:"outlined"}),f(kt,{label:a("dateRange.thisWeek"),onClick:()=>O("week"),clickable:true,size:"small",variant:"outlined"}),f(kt,{label:a("dateRange.thisMonth"),onClick:()=>O("month"),clickable:true,size:"small",variant:"outlined"})]})}),f("div",{className:"orb-date-range-calendar",children:f(wc,{dateAdapter:Tn,adapterLocale:i,children:f(Sc,{value:null,referenceDate:y,onMonthChange:g$1,onYearChange:g$1,onChange:L,slots:{day:K},views:["year","month","day"],openTo:"day",showDaysOutsideCurrentMonth:true})})}),f(At,{}),g(ne,{direction:"row",justifyContent:"flex-end",spacing:1,sx:{p:2},children:[f(be,{size:"small",onClick:z,color:"inherit",children:a("common.cancel")}),f(be,{size:"small",variant:"contained",onClick:U,children:a("common.done")})]})]})]})};var ii={equals:"=",contains:"\u2287",notContains:"\u2285",wildcard:"*","=":"=","!=":"!=",">":">","<":"<",">=":"\u2265","<=":"\u2264",between:"\u2194"},gf={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"},ff=["contains","notContains",">",">=","<","<=","equals"],Bd=["=","!=",">","<",">=","<=","between"],jt="0.85rem",hf=({field:t,value:o,onChange:r})=>{let{t:a}=ce(),[n,i]=useState(null),[s,c]=useState(null),[d,m]=useState(null),[p,f$1]=useState(""),[h,u]=useState(""),[v,y]=useState(""),[g$1,C]=useState("");useEffect(()=>{let w=setTimeout(()=>{C(v);},1e3);return ()=>clearTimeout(w)},[v]);let b=o?.operator||(t.type==="number"?"=":"equals"),S=o?.value,k=w=>{let M=gf[w];return M?a(M):w},x=w=>{i(n?null:w.currentTarget);},E=w=>{r({...o,operator:w,value:S}),i(null);},D={size:"small",fullWidth:true,variant:"outlined",InputLabelProps:{sx:{fontSize:jt}},InputProps:{sx:{fontSize:jt}},SelectProps:{MenuProps:{PaperProps:{sx:{"& .orb-menu-item, & option":{fontSize:jt,paddingTop:"4px",paddingBottom:"4px",minHeight:"auto"}}}}}},T=t.type||"text";if(T==="date"){let M=(I=>{if(!I)return [null,null];if(Array.isArray(I)&&I.length===2){let L=I[0]?Zo.isDayjs(I[0])?I[0]:Zo(I[0]):null,O=I[1]?Zo.isDayjs(I[1])?I[1]:Zo(I[1]):null;return [L,O]}return Zo.isDayjs(I)||typeof I=="string"?[Zo.isDayjs(I)?I:Zo(I),null]:[null,null]})(S);return f(Ld,{label:t.label,value:M,onChange:I=>r({value:I,operator:"between"})})}if(T==="number"&&b==="between"){let w=()=>{r({value:[p,h],operator:"between"}),c(null);},M=Array.isArray(S)?`${S[0]||""} - ${S[1]||""}`:"";return g(e,{children:[f(Be,{...D,label:t.label,value:M,placeholder:a("smartFilter.minMaxPlaceholder"),InputProps:{...D.InputProps,startAdornment:f(er,{position:"start",children:f(nt,{title:k("between"),children:f(ae,{size:"small",onClick:x,sx:{width:24,height:24,fontSize:jt},children:ii.between})})}),readOnly:true},onClick:I=>c(s?null:I.currentTarget)}),f(qt,{anchorEl:n,open:!!n,onClose:()=>i(null),PaperProps:{sx:{"& .orb-menu-item, & option":{fontSize:jt,minHeight:"auto",py:.5}}},children:Bd.map(I=>g("option",{selected:I===b,onClick:()=>E(I),children:[f("div",{sx:{width:24,display:"inline-block",fontWeight:"bold"},children:ii[I]}),f(Wt,{primary:k(I),primaryTypographyProps:{fontSize:jt}})]},I))}),f(Dn,{open:!!s,anchorEl:s,onClose:()=>c(null),anchorOrigin:{vertical:"bottom",horizontal:"left"},children:g("div",{sx:{p:2,display:"flex",gap:1,alignItems:"center"},children:[f(Be,{size:"small",label:a("smartFilter.min"),type:"number",value:p,onChange:I=>f$1(I.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:jt}},InputProps:{sx:{fontSize:jt}}}),f(Tc,{color:"action"}),f(Be,{size:"small",label:a("smartFilter.max"),type:"number",value:h,onChange:I=>u(I.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:jt}},InputProps:{sx:{fontSize:jt}}}),f(be,{variant:"contained",size:"small",onClick:w,children:a("common.ok")})]})})]})}if(t.isValueHelp||T==="value-help"){let w=t.valueHelp?.mode||"single";return f(dd,{...D,...t.valueHelp,label:t.label,placeholder:t.placeholder||t.valueHelp?.placeholder,value:S??(w==="multiple"?[]:null),mode:w,onChange:M=>r({value:M,operator:w==="multiple"?"anyOf":"equals"})})}if(T==="select")return g(_t,{size:"small",fullWidth:true,label:t.label,value:S||"",onChange:w=>r({...o,value:w.target.value,operator:"equals"}),children:[f("option",{value:"",children:a("common.none")}),t.options?.map(w=>f("option",{value:w.value,children:w.label},w.value))]});if(T==="multi-select"){let w=Array.isArray(S)?S:[],M=t.options?.filter(K=>K.label.toLowerCase().includes(g$1.toLowerCase()))||[],I=K=>t.options?.find(W=>W.value===K)?.label||K,L=w.map(I),O=L.length===0?a("common.none"):L.length>2?`${L.slice(0,2).join(", ")} +${L.length-2}`:L.join(", "),U=()=>{m(null),y(""),C("");},z=K=>{let W=w.includes(K)?w.filter(q=>q!==K):[...w,K];r({...o,value:W,operator:"anyOf"});};return g("div",{className:"orb-fld",children:[f("label",{children:t.label}),g(be,{variant:"outlined",size:"small",onClick:K=>m(d?null:K.currentTarget),sx:{width:"100%",minHeight:36,justifyContent:"space-between",fontSize:jt,fontWeight:400},children:[f("span",{sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:O}),f(Bo,{fontSize:"small"})]}),f(qt,{anchorEl:d,open:!!d,onClose:U,PaperProps:{sx:{width:280,maxHeight:340,overflowY:"auto",p:.5}},children:g("div",{onClick:K=>K.stopPropagation(),sx:{display:"grid",gap:.35},children:[f(Be,{size:"small",autoFocus:true,placeholder:a("smartFilter.searchPlaceholder"),fullWidth:true,InputProps:{startAdornment:f(er,{position:"start",children:f(Rr,{fontSize:"small"})}),sx:{fontSize:jt}},value:v,onChange:K=>y(K.target.value),onKeyDown:K=>K.stopPropagation()}),M.length>0?M.map(K=>{let W=w.includes(K.value);return g("div",{role:"option","aria-selected":W,tabIndex:0,className:`orb-menu-item ${W?"orb-selected":""}`,onClick:()=>z(K.value),onKeyDown:q=>{(q.key==="Enter"||q.key===" ")&&(q.preventDefault(),z(K.value));},children:[f(Mt,{checked:W,size:"small",inputProps:{tabIndex:-1},sx:{pointerEvents:"none"}}),f(Wt,{primary:K.label})]},String(K.value))}):f("div",{className:"orb-menu-item","aria-disabled":"true",children:a("smartFilter.noOptionsFound")})]})})]})}let N=T==="number"?Bd:ff;return g(e,{children:[f(Be,{...D,className:"orb-filter-operator-field",label:t.label,sx:{minWidth:"120px"},value:S||"",type:T==="number"?"number":"text",onChange:w=>r({...o,value:w.target.value,operator:b}),InputProps:{...D.InputProps,startAdornment:f(er,{position:"start",children:f(nt,{title:k(b),children:f(ae,{className:"orb-filter-operator-trigger",size:"small",onClick:x,onMouseDown:w=>w.preventDefault(),sx:{width:24,height:24,fontSize:jt,fontWeight:"bold",color:"primary.main",bgcolor:"action.hover"},children:ii[b]})})}),endAdornment:t.hasSearchIcon?f(er,{position:"end",children:f(Rr,{color:"action"})}):void 0}}),f(qt,{anchorEl:n,open:!!n,onClose:()=>i(null),PaperProps:{sx:{"& .orb-menu-item, & option":{fontSize:jt,minHeight:"auto",py:.5}}},children:N.map(w=>g("option",{selected:w===b,onClick:()=>E(w),children:[f("span",{className:"orb-filter-operator-symbol",children:ii[w]}),f(Wt,{primary:k(w),primaryTypographyProps:{fontSize:jt}})]},w))})]})},Oo=({fields:t,filters:o,onFilterChange:r,variants:a=[],currentVariantId:n,onVariantLoad:i,onVariantSave:s,onVariantDelete:c,onVariantSetDefault:d,onSearch:m,loading:p=false,appId:f$1,tableKey:h,currentLayout:u,currentLayoutId:v,layoutRefs:y,variantService:g$1,serviceUrl:C})=>{let{t:b}=ce(),[S,k]=useState(true),[x,E]=useState(null),[D,T]=useState(t.filter(M=>!M.hidden).map(M=>M.id)),N=(M,I)=>{r({...o,[M]:I});},R=M=>{D.includes(M)?T(D.filter(I=>I!==M)):T([...D,M]);};return g(Ae,{className:`orb-smart-filter ${S?"orb-smart-filter-expanded":"orb-smart-filter-collapsed"}`,sx:{mb:0,display:"flex",flexDirection:"column",overflow:"visible",position:"relative"},children:[S?g(e,{children:[g("div",{className:"orb-smart-filter-header",children:[f$1?f(Nd,{appId:f$1,tableKey:h,currentFilters:{values:o,visibleFields:D},currentLayout:u,currentLayoutId:v,layoutRefs:y,onLoad:M=>{if(!M.filters)return;let I=null;if(Array.isArray(M.filters)){let L=h||"default",O=M.filters.find(U=>U.scope===L);I=O?O.filters:null;}else I=M.filters;I&&(I.values||I.visibleFields?(I.visibleFields&&Array.isArray(I.visibleFields)&&T(I.visibleFields),I.values&&r(I.values)):r(I)),i&&i(M);},variantService:g$1,serviceUrl:C,currentVariantId:n}):f(ai,{variants:a,currentVariantId:n,onLoad:i,onSave:M=>{s&&s({...M,filters:{values:o,visibleFields:D}});},onDelete:c,onSetDefault:d}),g("div",{className:"orb-smart-filter-actions",children:[f(nt,{title:b("smartFilter.addFilters"),children:f(be,{className:"orb-smart-filter-adapt",onClick:M=>E(x?null:M.currentTarget),size:"small",color:"primary",startIcon:f(jc,{fontSize:"small"}),sx:{textTransform:"none",fontSize:jt,whiteSpace:"nowrap",minWidth:"fit-content"},children:b("smartFilter.adaptFilters")})}),f(ae,{className:"orb-smart-filter-go",tooltip:b("smartFilter.go"),"aria-label":b("smartFilter.go"),onClick:m,disabled:p,children:p?f($o,{size:16}):f(Rt,{name:"play",size:16})}),g(qt,{anchorEl:x,open:!!x,onClose:()=>E(null),slotProps:{paper:{style:{maxHeight:400,width:"25ch"},sx:{"& .orb-menu-item, & option":{fontSize:jt,minHeight:32}}}},children:[f("option",{disabled:true,children:f(Wt,{primary:b("smartFilter.visibleFilters"),primaryTypographyProps:{fontSize:jt}})}),f(At,{}),t.map(M=>g("option",{onClick:()=>R(M.id),children:[f(Mt,{checked:D.includes(M.id),size:"small"}),f(Wt,{primary:M.label,primaryTypographyProps:{fontSize:jt}})]},M.id))]})]})]}),f("div",{className:"orb-smart-filter-grid",children:f(gs,{container:true,spacing:2,columns:{xs:2,sm:3,md:4,lg:6},children:t.filter(M=>D.includes(M.id)).map(M=>f(gs,{size:1,children:f(hf,{field:M,value:o[M.id]||{value:"",operator:M.type==="number"?"=":"equals"},onChange:I=>N(M.id,I)})},M.id))})})]}):null,f("div",{className:"orb-smart-filter-toggle",children:f(ae,{className:"orb-smart-filter-toggle-button",size:"small",onClick:()=>k(!S),sx:{bgcolor:"background.paper",boxShadow:2,border:"1px solid",borderColor:"divider",width:30,height:30,minWidth:30,minHeight:0,p:0,"&:hover":{bgcolor:"background.paper"}},children:S?f(Ln,{className:"orb-smart-filter-toggle-icon",sx:{fontSize:20},color:"action"}):f(Bo,{className:"orb-smart-filter-toggle-icon",sx:{fontSize:20},color:"action"})})})]})};var Od=({layouts:t,currentLayoutId:o,onLoad:r,onSave:a,onDelete:n,onSetDefault:i})=>{let{t:s}=ce(),[c,d]=useState(null),[m,p]=useState(false),[f$1,h]=useState(""),[u,v]=useState(""),[y,g$1]=useState({isDefault:false,isPublic:false}),C=t.find(D=>D.id===o),b=D=>{d(D.currentTarget);},S=()=>{d(null);},k=D=>{r(D),S();},x=()=>{h(""),v(""),g$1({isDefault:false,isPublic:false}),p(true),S();},E=()=>{f$1.trim()&&(a({name:f$1,description:u,...y}),p(false));};return g("div",{className:"orb-layout-actions",sx:{display:"flex",alignItems:"center",gap:.25},children:[f(nt,{title:s("layout.layoutOptions"),children:f(ae,{onClick:b,color:C?"primary":"default",size:"small",children:f(ad,{fontSize:"small"})})}),g(qt,{anchorEl:c,open:!!c,onClose:S,align:"end",PaperProps:{sx:{width:320,maxHeight:400}},children:[f("option",{disabled:true,children:f(A,{variant:"caption",children:s("layout.selectLayout")})}),g("option",{onClick:x,children:[f(Fo,{children:f(mr,{fontSize:"small"})}),f(Wt,{children:s("layout.saveCurrentLayout")})]}),f(At,{}),t.length===0&&f("option",{disabled:true,children:f(A,{variant:"body2",color:"text.secondary",children:s("layout.noSavedLayouts")})}),t.map((D,T)=>f("option",{onClick:()=>k(D),selected:D.id===o,children:g("div",{sx:{display:"flex",alignItems:"center",width:"100%",justifyContent:"space-between"},children:[g("div",{sx:{display:"flex",flexDirection:"column",overflow:"hidden",mr:1},children:[f("div",{sx:{display:"flex",alignItems:"center",gap:1},children:f(A,{variant:"body2",fontWeight:D.id===o?"bold":"normal",noWrap:true,children:D.name})}),D.description&&f(A,{variant:"caption",color:"text.secondary",noWrap:true,children:D.description})]}),g("div",{sx:{display:"flex",alignItems:"center"},onClick:N=>N.stopPropagation(),children:[f(nt,{title:D.isDefault?s("layout.removeDefault"):s("layout.setAsDefault"),children:f(ae,{size:"small",onClick:N=>{N.stopPropagation(),i(D.id);},children:D.isDefault?f(td,{fontSize:"small",color:"warning"}):f(ed,{fontSize:"small"})})}),f(nt,{title:s("common.delete"),children:f(ae,{size:"small",color:"error",onClick:N=>{N.stopPropagation(),n(D.id);},children:f(Nn,{fontSize:"small"})})})]})]})},D.id||T))]}),f(zt,{open:m,onClose:()=>p(false),maxWidth:"xs",fullWidth:true,className:"orb-layout-save-dialog",title:s("layout.saveLayout"),actions:g(e,{children:[f(be,{variant:"ghost",onClick:()=>p(false),children:s("common.cancel")}),f(be,{onClick:E,variant:"primary",disabled:!f$1.trim(),children:s("common.save")})]}),children:g("div",{className:"orb-layout-save-form",children:[f(Be,{label:s("layout.layoutName"),value:f$1,onChange:D=>h(D.target.value),fullWidth:true,autoFocus:true,size:"small",helperText:s("layout.layoutNameHelper")}),t.some(D=>D.name===f$1)&&f(A,{className:"orb-layout-save-warning",variant:"caption",color:"warning.main",children:s("layout.warningOverwrite")}),f(Be,{label:s("layout.layoutDescription"),value:u,onChange:D=>v(D.target.value),fullWidth:true,size:"small"}),f(Mt,{className:"orb-layout-save-option",checked:y.isDefault,onChange:D=>g$1({...y,isDefault:D.target.checked}),label:s("layout.useAsDefault")}),f(Mt,{className:"orb-layout-save-option",checked:y.isPublic,onChange:D=>g$1({...y,isPublic:D.target.checked}),label:s("layout.publicAllUsers")})]})})]})};var oa=({appId:t,tableKey:o="default",currentLayoutData:r,onLayoutLoad:a,targetLayoutId:n,activeLayoutId:i,serviceUrl:s,onError:c,onSuccess:d})=>{let{t:m}=ce(),[p,f$1]=useState([]),[h,u]=useState(""),v=`orbcafe.layouts.${t}.${o}`,y=T=>({id:T.layoutId,name:T.name,description:T.description??"",isDefault:!!T.isDefault,isPublic:!!T.isPublic,createdAt:T.createdAt??new Date().toISOString(),layoutData:T.layout??{}}),g=T=>({appId:t,tableKey:o,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(v);if(!T)return [];let N=JSON.parse(T);return Array.isArray(N)?N:[]}catch{return []}},[v]),b=useCallback(T=>{try{localStorage.setItem(v,JSON.stringify(T));}catch{}},[v]);useEffect(()=>{i!==void 0&&u(i);},[i]),useEffect(()=>{if(n&&p.length>0){let T=p.find(N=>N.id===n);T&&(u(T.id),a(T));}},[n,p,a]);let S=useCallback(async()=>{if(t){if(!s){let T=C();f$1(T);let N=T.find(R=>R.isDefault);N&&!h&&!n&&(u(N.id),a(N));return}try{let T=await fetch(`${s}/api/layouts?appId=${encodeURIComponent(t)}&tableKey=${encodeURIComponent(o)}`);if(!T.ok)throw new Error("LAYOUT_FETCH_FAILED");let R=(await T.json()).map(y);f$1(R);let w=R.find(M=>M.isDefault);w&&!h&&!n&&(u(w.id),a(w));}catch(T){console.error("Error fetching layouts",T);let N=C();f$1(N);let R=N.find(w=>w.isDefault);R&&!h&&!n&&(u(R.id),a(R)),c&&c(m("layout.toast.loadFallback"));}}},[t,o,s,c,h,a,n,C,m]);return useEffect(()=>{S();},[t,o]),f(Od,{layouts:p,currentLayoutId:h,onLoad:T=>{u(T.id),a(T);},onSave:async T=>{let N=p.find(M=>M.name===T.name),R=N?N.id:Date.now().toString(),w={id:R,...T,createdAt:new Date().toISOString(),layoutData:r,isDefault:T.isDefault??false,isPublic:T.isPublic??false};if(!s){let I=p.some(L=>L.id===R)?p.map(L=>L.id===R?w:L):[...p,w];f$1(I),b(I),u(R),a(w),d&&d(m("layout.toast.saveLocalSuccess"));return}try{if(!(await fetch(`${s}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(g(w))})).ok)throw new Error("LAYOUT_SAVE_FAILED");d&&d(m("layout.toast.saveSuccess")),await S(),u(R),a(w);}catch(M){console.error("Error saving layout",M);let L=p.some(O=>O.id===R)?p.map(O=>O.id===R?w:O):[...p,w];f$1(L),b(L),u(R),a(w),d&&d(m("layout.toast.saveLocalSuccess")),c&&c(m("layout.toast.backendUnavailableSavedLocal"));}},onDelete:async T=>{if(!s){let N=p.filter(R=>R.id!==T);f$1(N),b(N),h===T&&u(""),d&&d(m("layout.toast.deleteLocalSuccess"));return}try{if(!(await fetch(`${s}/api/layouts/${encodeURIComponent(T)}`,{method:"DELETE"})).ok)throw new Error("LAYOUT_DELETE_FAILED");h===T&&u(""),d&&d(m("layout.toast.deleteSuccess")),await S();}catch(N){console.error("Error deleting layout",N);let R=p.filter(w=>w.id!==T);f$1(R),b(R),h===T&&u(""),d&&d(m("layout.toast.deleteLocalSuccess")),c&&c(m("layout.toast.backendUnavailableDeletedLocal"));}},onSetDefault:async T=>{if(!s){let N=p.map(R=>({...R,isDefault:R.id===T}));f$1(N),b(N),d&&d(m("layout.toast.defaultLocalSuccess"));return}try{let N=p.find(w=>w.id===T);if(!N)return;if(!(await fetch(`${s}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(g({...N,isDefault:!0}))})).ok)throw new Error("LAYOUT_DEFAULT_FAILED");d&&d(m("layout.toast.defaultSuccess")),await S();}catch(N){console.error("Error setting default",N);let R=p.map(w=>({...w,isDefault:w.id===T}));f$1(R),b(R),d&&d(m("layout.toast.defaultLocalSuccess")),c&&c(m("layout.toast.backendUnavailableDefaultLocal"));}}})};var si=(t,o)=>{if(!t||!t.filters)return null;if(Array.isArray(t.filters)){let r=t.filters.find(n=>n.scope===o);if(r)return r.filters;let a=t.filters.find(n=>n.scope==="default");return a?a.filters:null}return typeof t.filters=="object"?t.filters:null},li=(t,o)=>{if(!t)return {layout:null,layoutId:null};let r=null,a=null;if(Array.isArray(t.layoutRefs)){let n=t.layoutRefs.find(i=>i.tableKey===o);n&&(r=n.layoutId);}return !r&&t.layoutId&&(r=t.layoutId),t.layout&&typeof t.layout=="object"&&!Array.isArray(t.layout)&&(a=t.layout),{layoutId:r,layout:a}};function Vd(t,o,r){return o[r]<t[r]?-1:o[r]>t[r]?1:0}function bf(t,o){return t==="desc"?(r,a)=>Vd(r,a,o):(r,a)=>-Vd(r,a,o)}function vf(t,o){let r=t.map((a,n)=>[a,n]);return r.sort((a,n)=>{let i=o(a[0],n[0]);return i!==0?i:a[1]-n[1]}),r.map(a=>a[0])}var ra=t=>{let o=!!t.disableGrouping,r=!!t.disableSorting,a=useCallback(B=>{let J=String(B?.label??B?.id??"").length*9+64,Te=typeof B?.minWidth=="number"?B.minWidth:0;return Math.max(100,Te,J)},[]),n=useCallback(()=>(t.columns||[]).filter(B=>!!B?.numeric).map(B=>B.id),[t.columns]),[i,s]=useState(""),[c,d]=useState(t.order||"asc"),[m,p]=useState(t.orderBy||""),[f,h]=useState([]),[u,v]=useState(t.page||0),[y,g]=useState(t.rowsPerPage||20),[C,b]=useState(t.selected||[]),[S,k]=useState(t.columns?t.columns.map(B=>B.id):[]),[x,E]=useState(t.columns?t.columns.map(B=>B.id):[]),[D,T]=useState(t.showSummary||false),[N,R]=useState(()=>n()),[w,M]=useState([]),[I,L]=useState(new Set),[O,U]=useState(()=>{let B={};return (t.columns||[]).forEach(_=>{B[_.id]=a(_);}),B}),[z,K]=useState(null),[W,q]=useState(null),[H,V]=useState(null),[Z,j]=useState(null),[me,ie]=useState(false),[ge,ye]=useState(""),[Ue,Oe]=useState(""),Ie=o?[]:w,ze=useCallback(B=>{if(o){M([]),L(new Set),q(null);return}M(B);},[o]);useEffect(()=>{o&&(M([]),L(new Set),q(null));},[o]),useEffect(()=>{r&&(d("asc"),p(""),h([]));},[r]),useEffect(()=>{t.layout&&ft(t.layout);},[t.layout]),useEffect(()=>{if(r){d("asc"),p("");return}t.order!==void 0&&d(t.order),t.orderBy!==void 0&&p(t.orderBy);},[t.order,t.orderBy,r]),useEffect(()=>{t.selected!==void 0&&b(t.selected);},[t.selected]),useEffect(()=>{t.page!==void 0&&v(t.page);},[t.page]),useEffect(()=>{t.rowsPerPage!==void 0&&g(t.rowsPerPage);},[t.rowsPerPage]),useEffect(()=>{let B=n();R(_=>_.filter(Te=>B.includes(Te)));},[n]),useEffect(()=>{U(B=>{let _={...B};return (t.columns||[]).forEach(J=>{_[J.id]===void 0&&(_[J.id]=a(J));}),_});},[t.columns,a]),useEffect(()=>{E(B=>{let _=(t.columns||[]).map(Qe=>Qe.id),J=new Set(_),Te=B.filter(Qe=>J.has(Qe)),fe=new Set(Te),Me=_.filter(Qe=>!fe.has(Qe)),$e=[...Te,...Me];return $e.length===B.length&&$e.every((Qe,Ge)=>Qe===B[Ge])?B:$e});},[t.columns]);let Re=useMemo(()=>{let B=t.columns||[];if(x.length===0)return B;let _=new Map(B.map(fe=>[fe.id,fe])),J=[],Te=new Set;return x.forEach(fe=>{let Me=_.get(fe);Me&&(J.push(Me),Te.add(fe));}),B.forEach(fe=>{Te.has(fe.id)||J.push(fe);}),J},[t.columns,x]),Ce=useMemo(()=>{let B=t.rows||[];return i&&(B=B.filter(_=>Object.keys(_).some(J=>String(_[J]).toLowerCase().includes(i.toLowerCase())))),B},[t.rows,i]),Ve=useMemo(()=>{if(r||t.onSortChange)return Ce;if(f.length>0){let B=[...Ce];return B.sort((_,J)=>{for(let Te of f){let fe=_?.[Te.field],Me=J?.[Te.field];if(!(fe==null&&Me==null)){if(fe==null)return Te.direction==="asc"?-1:1;if(Me==null)return Te.direction==="asc"?1:-1;if(fe<Me)return Te.direction==="asc"?-1:1;if(fe>Me)return Te.direction==="asc"?1:-1}}return 0}),B}return m?vf(Ce,bf(c,m)):Ce},[Ce,c,m,f,t.onSortChange,r]),at=useCallback(B=>{if(Ie.length===0)return B.map(Me=>({type:"row",data:Me,id:Me[t.rowKey||"id"]}));let _=[...B].sort((Me,$e)=>{for(let Qe of Ie){if(Me[Qe]<$e[Qe])return -1;if(Me[Qe]>$e[Qe])return 1}return 0}),J=(Me,$e=0)=>{if($e>=Ie.length)return Me;let Qe=Ie[$e],Ge={},vt=[];return Me.forEach(Dt=>{let St=Dt[Qe],yt=`${Qe}:${St}`;Ge[yt]||(Ge[yt]={key:yt,field:Qe,value:St,children:[],count:0,level:$e},vt.push(Ge[yt])),Ge[yt].children.push(Dt),Ge[yt].count++;}),vt.forEach(Dt=>{Dt.children&&(Dt.children=J(Dt.children,$e+1));}),vt},Te=J(_),fe=(Me,$e="")=>{let Qe=[];return Me.forEach(Ge=>{if(Ge.children){let vt=$e?`${$e}>${Ge.key}`:Ge.key,Dt=I.has(vt);Qe.push({type:"group",id:vt,field:Ge.field,value:Ge.value,level:Ge.level,count:Ge.count,isExpanded:Dt,childIds:(function St(yt){let F=[];return yt.children.forEach(X=>{X.children?F=F.concat(St(X)):F.push(X[t.rowKey||"id"]);}),F})(Ge)}),Dt&&(Qe=Qe.concat(fe(Ge.children,vt)));}else Qe.push({type:"row",data:Ge,id:Ge[t.rowKey||"id"],level:Ie.length});}),Qe};return fe(Te)},[Ie,I,t.rowKey]),gt=useCallback(B=>{if(Ie.length===0)return [];let _=[...B].sort((fe,Me)=>{for(let $e of Ie){if(fe[$e]<Me[$e])return -1;if(fe[$e]>Me[$e])return 1}return 0}),J=[],Te=(fe,Me,$e)=>{if(Me>=Ie.length)return;let Qe=Ie[Me],Ge=new Map;fe.forEach(vt=>{let Dt=vt[Qe],St=Ge.get(Dt);St?St.push(vt):Ge.set(Dt,[vt]);}),Ge.forEach((vt,Dt)=>{let St=`${Qe}:${Dt}`,yt=$e?`${$e}>${St}`:St;J.push(yt),Te(vt,Me+1,yt);});};return Te(_,0,""),J},[Ie]),Je=useMemo(()=>at(Ve),[Ve,at]),te=useMemo(()=>gt(Ve),[Ve,gt]),We=useMemo(()=>{let B=(t.rows||[]).length;return typeof t.count=="number"&&t.count>B},[t.count,t.rows]),Ne=useMemo(()=>We?Je:y>0?Je.slice(u*y,u*y+y):Je,[Je,u,y,We]),Ee=useMemo(()=>We&&typeof t.count=="number"?t.count:Je.length,[Je.length,We,t.count]),st=B=>{L(_=>{let J=new Set(_);return J.has(B)?J.delete(B):J.add(B),J});},Ze=B=>{let _=te.filter(J=>J===B||J.startsWith(`${B}>`));L(J=>{let Te=new Set(J);return _.forEach(fe=>Te.add(fe)),Te});},ht=B=>{L(_=>{let J=new Set(_);return Array.from(J).forEach(Te=>{(Te===B||Te.startsWith(`${B}>`))&&J.delete(Te);}),J});},xt=B=>{if(!B){L(new Set);return}L(new Set(te));},Nt=B=>{let _=te.filter(J=>J.startsWith(`${B}>`));return _.length===0?I.has(B):I.has(B)&&_.every(J=>I.has(J))},Et=B=>{if(r)return;f.length>0&&h([]);let _=m===B&&c==="asc",J=m===B&&c==="desc";if(t.onSortChange){_?t.onSortChange(B,"desc"):J?t.onSortChange("","asc"):t.onSortChange(B,"asc");return}_?(d("desc"),p(B)):J?(d("asc"),p("")):(d("asc"),p(B));},ee=B=>{if(r){d("asc"),p(""),h([]);return}let _=B.filter(J=>J&&J.field);h(_),_.length>0&&p("");},tt=()=>{h([]);},Le=(B,_)=>{U(J=>({...J,[B]:_}));},se=B=>{if(B.target.checked){let _=Ce.map(J=>J[t.rowKey||"id"]);b(_),t.onSelectionChange&&t.onSelectionChange(_);return}b([]),t.onSelectionChange&&t.onSelectionChange([]);},ue=(B,_)=>{let J=_[t.rowKey||"id"],Te=C.indexOf(J),fe=[];Te===-1?fe=fe.concat(C,J):Te===0?fe=fe.concat(C.slice(1)):Te===C.length-1?fe=fe.concat(C.slice(0,-1)):Te>0&&(fe=fe.concat(C.slice(0,Te),C.slice(Te+1))),b(fe),t.onSelectionChange&&t.onSelectionChange(fe);},Q=B=>{v(B),t.onPageChange&&t.onPageChange(B);},we=B=>{g(B),v(0),t.onPageChange&&t.onPageChange(0),t.onRowsPerPageChange&&t.onRowsPerPageChange(B);},ke=B=>{let _=S.indexOf(B),J=[...S];_===-1?J.push(B):J.splice(_,1),k(J);},Xe=B=>{if(o)return;let _=Ie.indexOf(B),J=[...Ie];_===-1?J.push(B):J.splice(_,1),ze(J);},dt=B=>{n().includes(B)&&R(J=>J.includes(B)?J.filter(Te=>Te!==B):[...J,B]);},lt=(B,_)=>{!B||!_||B===_||E(J=>{let Te=J.indexOf(B),fe=J.indexOf(_);if(Te===-1||fe===-1)return J;let Me=[...J];return Me.splice(Te,1),Me.splice(fe,0,B),Me});},Lt=B=>{let _=B?.active?.id,J=B?.over?.id;typeof _=="string"&&typeof J=="string"&&lt(_,J);},$t=B=>{t.onLayoutSave&&t.onLayoutSave({visibleColumns:S,columnOrder:x,order:r?"asc":c,orderBy:r?"":m,sortBy:r?[]:f,grouping:Ie,columnWidths:O,showSummary:D,summaryColumns:N});},bt=B=>{let{layout:_,layoutId:J}=li(B,t.tableKey||"default");J?(Oe(J),ye(J)):(Oe(""),ye("")),_&&(_.visibleColumns&&k(_.visibleColumns),Array.isArray(_.columnOrder)&&E(_.columnOrder),r?(d("asc"),p(""),h([])):(_.order&&d(_.order),_.orderBy&&p(_.orderBy),Array.isArray(_.sortBy)&&h(_.sortBy)),_.grouping&&ze(_.grouping),_.columnWidths&&U(_.columnWidths),_.showSummary!==void 0&&T(!!_.showSummary),Array.isArray(_.summaryColumns)&&R(_.summaryColumns));},ft=B=>{let _=B?.layoutData||B?.layout||B||{};_.visibleColumns&&k(_.visibleColumns),Array.isArray(_.columnOrder)&&E(_.columnOrder),r?(d("asc"),p(""),h([])):(_.order&&d(_.order),_.orderBy!==void 0&&p(_.orderBy),Array.isArray(_.sortBy)&&h(_.sortBy)),_.grouping&&ze(_.grouping),_.columnWidths&&U(_.columnWidths),_.showSummary!==void 0&&T(!!_.showSummary),Array.isArray(_.summaryColumns)&&R(_.summaryColumns),L(new Set),v(0),B?.id&&ye(B.id),Oe("");};useEffect(()=>{t.layout&&bt({layout:t.layout});},[t.layout]);let vo=B=>{B.preventDefault(),j(Z===null?{mouseX:B.clientX+2,mouseY:B.clientY-6}:null);},Pt=()=>{j(null);},Ft=useMemo(()=>{if(!D)return {};let B={};t.columns.forEach(J=>{if(J.numeric&&N.includes(J.id)){let Te=Ce.reduce((fe,Me)=>{let $e=parseFloat(Me[J.id]);return fe+(isNaN($e)?0:$e)},0);B[J.id]=Te.toFixed(2);}else B[J.id]="";});let _=t.columns.find(J=>S.includes(J.id)&&!J.numeric);return _&&!_.numeric&&(B[_.id]="Total"),B},[Ce,t.columns,D,N,S]),ct=()=>{if(!t.columns||!Ce)return;let B=t.columns.map(Me=>Me.label).join(","),_=Ce.map(Me=>t.columns.map($e=>{let Qe=Me[$e.id];return `"${(Qe==null?"":String(Qe)).replace(/"/g,'""')}"`}).join(",")).join(`
2
- `),J=`data:text/csv;charset=utf-8,${B}
3
- ${_}`,Te=encodeURI(J),fe=document.createElement("a");fe.setAttribute("href",Te),fe.setAttribute("download",`${t.title||"export"}.csv`),document.body.appendChild(fe),fe.click(),document.body.removeChild(fe);},Bt=()=>{ie(true);},xe=()=>{ie(false);};return {isMobile:false,columns:Re,order:c,setOrder:d,orderBy:m,setOrderBy:p,sortBy:f,setSortBy:h,applyMultiSort:ee,clearMultiSort:tt,columnOrder:x,setColumnOrder:E,filterText:i,setFilterText:s,visibleColumns:S,setVisibleColumns:k,showSummary:D,setShowSummary:T,summaryColumns:N,grouping:Ie,setGrouping:ze,expandedGroups:I,setExpandedGroups:L,groupAnchorEl:W,setGroupAnchorEl:q,summaryAnchorEl:H,setSummaryAnchorEl:V,columnWidths:O,setColumnWidths:U,anchorEl:z,setAnchorEl:K,contextMenu:Z,setContextMenu:j,sensors:void 0,sortedAndFilteredRows:Ve,visibleRows:Ne,summaryRow:Ft,page:u,setPage:Q,rowsPerPage:y,setRowsPerPage:we,totalDisplayCount:Ee,selected:C,setSelected:b,isAllExpanded:te.length>0&&te.every(B=>I.has(B)),handleColumnResize:Le,handleRequestSort:Et,handleSelectAllClick:se,handleClick:ue,toggleSummaryColumn:dt,handleDragEnd:Lt,handleColumnReorder:lt,handleExport:ct,handleContextMenu:vo,handleCloseContextMenu:Pt,toggleColumnVisibility:ke,toggleGroupExpand:st,toggleGroupField:Xe,handleToggleAll:xt,handleExpandGroupRecursively:Ze,handleCollapseGroupRecursively:ht,isGroupFullyExpanded:Nt,handleLayoutLoad:ft,handleVariantLoad:bt,handleLayoutSave:$t,effectiveAppId:t.appId||"",currentLayoutData:{visibleColumns:S,order:r?"asc":c,orderBy:r?"":m,sortBy:r?[]:f,columnOrder:x,grouping:Ie,columnWidths:O,showSummary:D,summaryColumns:N},currentLayoutId:ge,layoutIdToLoad:Ue,onPageChange:Q,onRowsPerPageChange:we,graphReportOpen:me,handleOpenGraphReport:Bt,handleCloseGraphReport:xe}};var LI=t=>f("tbody",{...t}),FI=({align:t,...o})=>f("td",{align:t==="inherit"?void 0:t,...o}),BI=t=>f("div",{...t}),OI=t=>f("thead",{...t}),zI=t=>f("tr",{...t}),qo=t=>{let{t:o}=ce(),r="0.85rem",{title:a,showToolbar:n=true,selectionMode:i,selected:s=[],onSelectionChange:c,actions:d,extraTools:m,fitContainer:p=false,fullWidth:f$1=false,maxHeight:h,loading:u=false,rowsPerPageOptions:v=[20,50,100,-1],onLayoutSave:y,filterConfig:g$1,rowKey:C,tableKey:b="default",graphReport:S,quickCreate:k,quickEdit:x,quickDelete:E,serviceUrl:D,disableGrouping:T=false,disableSorting:N=false}=t,R=a||o("table.title.default"),{isMobile:w,columns:M,order:I,orderBy:L,filterText:O,setFilterText:U,visibleColumns:z,showSummary:K,setShowSummary:W,summaryColumns:q,grouping:H,setGrouping:V,expandedGroups:Z,groupAnchorEl:j,setGroupAnchorEl:me,summaryAnchorEl:ie,setSummaryAnchorEl:ge,columnWidths:ye,anchorEl:Ue,setAnchorEl:Oe,contextMenu:Ie,sensors:ze,sortedAndFilteredRows:Re,summaryRow:Ce,visibleRows:Ve,isAllExpanded:at,page:gt,setPage:Je,rowsPerPage:te,setRowsPerPage:We,totalDisplayCount:Ne,setSelected:Ee,handleColumnResize:st,handleRequestSort:Ze,handleSelectAllClick:ht,handleClick:xt,toggleSummaryColumn:Nt,handleDragEnd:Et,handleExport:ee,handleContextMenu:tt,handleCloseContextMenu:Le,toggleColumnVisibility:se,toggleGroupExpand:ue,handleToggleAll:Q,handleExpandGroupRecursively:we,handleCollapseGroupRecursively:ke,isGroupFullyExpanded:Xe,handleLayoutLoad:dt,handleVariantLoad:lt,handleLayoutSave:Lt,effectiveAppId:$t,currentLayoutData:bt,currentLayoutId:ft,layoutIdToLoad:vo,graphReportOpen:Pt,handleOpenGraphReport:Ft,handleCloseGraphReport:ct}=ra(t),Bt=S?.enabled??false,xe=Bt&&(S?.interaction?.enabled??true),B=oi(),_=!!k?.enabled,J=!!x?.enabled,Te=!!E?.enabled,fe=k?.fields,Me=k?.excludeFields||[],$e=k?.initialValues||{},[Qe,Ge]=Yt__default.useState(false),[vt,Dt]=Yt__default.useState(false),[St,yt]=Yt__default.useState({}),[F,X]=Yt__default.useState(false),[pe,ve]=Yt__default.useState(false),[je,Ke]=Yt__default.useState({}),[Tt,mt]=Yt__default.useState(false),[pt,wt]=Yt__default.useState(false),Jt=u||vt||pe||pt,Ot=Yt__default.useMemo(()=>{let oe=[...M];if(Array.isArray(fe)&&fe.length>0){let de=new Set(fe);oe=oe.filter(Y=>de.has(Y.id));}if(Me.length>0){let de=new Set(Me);oe=oe.filter(Y=>!de.has(Y.id));}return oe.filter(de=>!!de?.id)},[M,Me,fe]),Kt=C||"id",Vt=Yt__default.useMemo(()=>{let oe=new Set(s);return Re.filter(de=>oe.has(de?.[Kt]))},[s,Re,Kt]),Gt=Vt.length===1?Vt[0]:null,Ht=x?.fields,Qt=x?.excludeFields||[],eo=x?.editableFields||[],po=x?.nonEditableFields||[],ko=x?.primaryKeys?.length?x.primaryKeys:[Kt],Po=Yt__default.useMemo(()=>{let oe=[...M];if(Array.isArray(Ht)&&Ht.length>0){let de=new Set(Ht);oe=oe.filter(Y=>de.has(Y.id));}if(Qt.length>0){let de=new Set(Qt);oe=oe.filter(Y=>!de.has(Y.id));}return oe.filter(de=>!!de?.id)},[M,Qt,Ht]),Qo=Yt__default.useMemo(()=>new Set(ko),[ko]),fo=Yt__default.useMemo(()=>new Set(eo),[eo]),No=Yt__default.useMemo(()=>new Set(po),[po]),Fr=Yt__default.useCallback(oe=>fo.size>0?fo.has(oe):!(No.has(oe)||Qo.has(oe)),[fo,No,Qo]);Yt__default.useEffect(()=>{!Pt&&B.hasActiveFilters&&B.clearAll();},[Pt,B.hasActiveFilters,B.clearAll]);let Br=()=>{let oe={};Ot.forEach(de=>{oe[de.id]=$e[de.id]??"";}),yt(oe),Ge(true);},Sr=()=>{vt||Ge(false);},Or=(oe,de)=>{yt(Y=>({...Y,[oe]:de}));},zr=async()=>{if(!k?.onSubmit){Ge(false);return}try{Dt(!0),await k.onSubmit(St),Ge(!1);}finally{Dt(false);}},To=()=>{if(!Gt)return;let oe={};Po.forEach(Y=>{oe[Y.id]=Gt[Y.id]??"";});let de=x?.getInitialValues?{...oe,...x.getInitialValues(Gt)}:oe;Ke(de),X(true);},wr=()=>{pe||X(false);},Vr=(oe,de)=>{Ke(Y=>({...Y,[oe]:de}));},Wo=async()=>{if(Gt){if(!x?.onSubmit){X(false);return}try{ve(!0),await x.onSubmit(je,Gt),X(!1);}finally{ve(false);}}},jo=()=>{Vt.length!==0&&mt(true);},ha=()=>{pt||mt(false);},kr=async()=>{if(Vt.length===0){mt(false);return}if(!E?.onConfirm){mt(false),Ee([]),c?.([]);return}try{wt(!0),await E.onConfirm(Vt),mt(!1),Ee([]),c?.([]);}finally{wt(false);}},P=Re,{fieldMapping:$}=Jr({rows:P,config:{...S,title:S?.title||`${R} ${o("graph.reportTitle")}`}}),G=Yt__default.useMemo(()=>xe?B.applyRows(P,$):P,[xe,B.applyRows,P,$]),{model:le}=Jr({rows:G,config:{...S,title:S?.title||`${R} ${o("graph.reportTitle")}`,fieldMapping:$}}),Fe=le.table.columns.map(oe=>({id:oe.id,label:oe.label,align:oe.align||"left",minWidth:120,numeric:oe.align==="right"})),ot=$t?f(oa,{appId:$t,tableKey:b,currentLayoutData:bt,onLayoutLoad:dt,targetLayoutId:vo,activeLayoutId:ft,serviceUrl:D??g$1?.serviceUrl}):null,He=g(e,{children:[!T&&f(Qr,{groupAnchorEl:j,setGroupAnchorEl:me,grouping:H,setGrouping:V,columns:M}),f(jr,{anchorEl:Ue,setAnchorEl:Oe,columns:M,visibleColumns:z,toggleColumnVisibility:se}),f(Xn,{anchorEl:ie,setAnchorEl:ge,showSummary:K,setShowSummary:W,columns:M,summaryColumns:q,toggleSummaryColumn:Nt}),f(Yn,{contextMenu:Ie,handleCloseContextMenu:Le,columns:M,visibleColumns:z,toggleColumnVisibility:se})]});return w?g("div",{sx:{display:"flex",flexDirection:"column",gap:2,height:"100%"},children:[g$1&&f(Oo,{fields:g$1.fields,filters:g$1.filters,onFilterChange:g$1.onFilterChange,onSearch:g$1.onSearch,variants:g$1.variants||[],currentVariantId:g$1.currentVariantId,onVariantLoad:g$1.onVariantLoad,onVariantSave:g$1.onVariantSave,onVariantDelete:g$1.onVariantDelete,onVariantSetDefault:g$1.onVariantSetDefault,appId:g$1.appId,tableKey:b,currentLayout:[{tableKey:b,layoutData:bt}],variantService:g$1.variantService,serviceUrl:D??g$1.serviceUrl}),f(md,{title:R,loading:u,showSummary:K,setShowSummary:W,setAnchorEl:Oe,setSummaryAnchorEl:ge,filterText:O,setFilterText:U,sortedAndFilteredRows:Re,selected:s,columns:M,visibleColumns:z,summaryRow:Ce,handleClick:xt,selectionMode:i}),He]}):g("div",{sx:{width:f$1?"100%":"auto",mb:p?0:2,...p?{flex:1,display:"flex",flexDirection:"column",minHeight:0,height:"100%",overflow:"hidden"}:{}},children:[g$1&&f("div",{sx:{mb:2},children:f(Oo,{fields:g$1.fields,filters:g$1.filters,onFilterChange:g$1.onFilterChange,onSearch:g$1.onSearch,variants:g$1.variants||[],currentVariantId:g$1.currentVariantId,onVariantLoad:oe=>{lt(oe),g$1.onVariantLoad&&g$1.onVariantLoad(oe);},onVariantSave:g$1.onVariantSave,onVariantDelete:g$1.onVariantDelete,onVariantSetDefault:g$1.onVariantSetDefault,loading:u,appId:g$1.appId,tableKey:b,currentLayout:[{tableKey:b,layoutData:bt}],currentLayoutId:ft,layoutRefs:[{tableKey:b,layoutId:ft}],variantService:g$1.variantService,serviceUrl:D??g$1.serviceUrl})}),g(Ae,{className:"orb-ctable-surface",sx:{width:f$1?"100%":"auto",mb:p?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative","&::before":Jt?{content:'""',position:"absolute",top:0,left:0,width:"100%",height:"3px",background:"linear-gradient(90deg, color-mix(in oklch, var(--orb-primary) 0%, transparent) 0%, color-mix(in oklch, var(--orb-primary) 25%, transparent) 25%, var(--orb-primary) 50%, color-mix(in oklch, var(--orb-primary) 25%, transparent) 75%, color-mix(in oklch, var(--orb-primary) 0%, transparent) 100%)",backgroundSize:"220% 100%",animation:"cTableTopMarquee 1.2s linear infinite",zIndex:6,pointerEvents:"none"}:{},"@keyframes cTableTopMarquee":{"0%":{backgroundPosition:"220% 0"},"100%":{backgroundPosition:"-120% 0"}},...h?{height:h}:p?{flex:1,minHeight:0,height:"100%"}:{}},children:[n&&f(_n,{filterText:O,setFilterText:U,onRowsPerPageChange:We,rowsPerPage:te,rowsPerPageOptions:v,page:gt,count:Ne,onPageChange:Je,actions:d,extraTools:m,grouping:H,disableGrouping:T,groupAnchorEl:j,setGroupAnchorEl:me,showSummary:K,setShowSummary:W,anchorEl:Ue,setAnchorEl:Oe,summaryAnchorEl:ie,setSummaryAnchorEl:ge,handleExport:ee,showCreateButton:_,onOpenCreateDialog:Br,showEditButton:J,onOpenEditDialog:To,editDisabled:Vt.length!==1,showDeleteButton:Te,onOpenDeleteConfirm:jo,deleteDisabled:Vt.length===0,onLayoutSave:y||g$1?.variantService&&g$1?.appId?Lt:void 0,loading:u,layoutManager:ot,onOpenGraphReport:Bt?Ft:void 0}),f("div",{sx:{flex:1,...h?{maxHeight:h,height:h}:p?{height:0,maxHeight:"none"}:{maxHeight:"calc(100vh - 320px)"},overflowY:"auto",overflowX:"auto",position:"relative",minHeight:0},children:f(DndContext,{sensors:ze,collisionDetection:closestCenter,onDragEnd:Et,modifiers:[restrictToHorizontalAxis],children:g("table",{className:"orb-tbl orb-ctable",style:{minWidth:f$1?750:void 0,width:f$1?"100%":"auto",tableLayout:Object.keys(ye).length>0?"fixed":"auto",borderCollapse:"separate",borderSpacing:0,fontSize:r},"aria-labelledby":"tableTitle",children:[f(Kn,{columns:M,visibleColumns:z,order:I,orderBy:L,onRequestSort:Ze,disableSorting:N,onContextMenu:tt,selectionMode:i,grouping:H,isAllExpanded:at,handleToggleAll:Q,rowCount:Re.length,numSelected:s.length,onSelectAllClick:ht,columnWidths:ye,onColumnResize:st}),f(qn,{visibleRows:Ve,columns:M,visibleColumns:z,selectionMode:i,selected:s,orderBy:L,loading:u,expandedGroups:Z,toggleGroupExpand:ue,handleExpandGroupRecursively:we,handleCollapseGroupRecursively:ke,isGroupFullyExpanded:Xe,handleClick:xt,onSelectionChange:c,grouping:H,rowKeyProp:C,page:gt,rowsPerPage:te}),K&&f(ud,{showSummary:K,columns:M,visibleColumns:z,summaryRow:Ce,selectionMode:i?.toString(),grouping:H,columnWidths:ye,orderBy:L,zIndex:3})]})})})]}),_&&g(zt,{open:Qe,onClose:Sr,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:oe=>`1px solid ${oe.palette.divider}`,bgcolor:"background.paper"}}},children:[f("div",{className:"orb-dialog-title",sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:k?.title||o("quickCreate.createWithTitle",{title:R})}),f("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:g("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Ot.map(oe=>{let de=oe.type==="number"||oe.numeric?"number":oe.type==="date"?"date":"text",Y=oe.label||oe.id;return f(Be,{label:Y,value:St[oe.id]??"",onChange:De=>Or(oe.id,De.target.value),type:de,size:"small",fullWidth:true,InputLabelProps:{shrink:de==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-create-${oe.id}`)}),k?.description&&f(Uo,{severity:"info",sx:{fontSize:"0.85rem","& span":{fontSize:"0.85rem"}},children:k.description})]})}),g("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[f(be,{onClick:Sr,sx:{fontSize:"0.85rem"},disabled:vt,children:k?.cancelLabel||o("common.cancel")}),f(be,{onClick:zr,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:vt,children:k?.submitLabel||o("common.save")})]})]}),J&&g(zt,{open:F,onClose:wr,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:oe=>`1px solid ${oe.palette.divider}`,bgcolor:"background.paper"}}},children:[f("div",{className:"orb-dialog-title",sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:x?.title||o("quickEdit.editWithTitle",{title:R})}),f("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:g("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Po.map(oe=>{let de=oe.type==="number"||oe.numeric?"number":oe.type==="date"?"date":"text",Y=oe.label||oe.id,De=Fr(oe.id);return f(Be,{label:Y,value:je[oe.id]??"",onChange:Ye=>Vr(oe.id,Ye.target.value),type:de,size:"small",fullWidth:true,disabled:!De,InputLabelProps:{shrink:de==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-edit-${oe.id}`)}),x?.description&&f(Uo,{severity:"info",sx:{fontSize:"0.85rem","& span":{fontSize:"0.85rem"}},children:x.description})]})}),g("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[f(be,{onClick:wr,sx:{fontSize:"0.85rem"},disabled:pe,children:x?.cancelLabel||o("common.cancel")}),f(be,{onClick:Wo,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:pe||!Gt,children:x?.submitLabel||o("common.save")})]})]}),Te&&f(Aa,{open:Tt,type:"warning",title:E?.title||o("quickDelete.confirmTitle"),message:E?.message||(Vt.length>1?o("quickDelete.confirmMessageMultiple",{count:Vt.length}):o("quickDelete.confirmMessageSingle")),confirmText:E?.confirmText||o("common.delete"),cancelText:E?.cancelText||o("common.cancel"),onClose:ha,onConfirm:kr}),He,Bt&&f(ei,{open:Pt,onClose:ct,model:le,aiAssistant:S?.aiAssistant,interaction:xe?{enabled:true,filters:B.filters,fieldMapping:$,onPrimaryDimensionClick:oe=>B.setFilter("primaryDimension",oe),onSecondaryDimensionClick:oe=>B.setFilter("secondaryDimension",oe),onStatusClick:oe=>B.setFilter("status",oe),onClearFilter:B.clearFilter,onClearAll:B.clearAll}:void 0,tableContent:f(qo,{appId:$t||"graph-report-internal",title:o("graph.dataBody"),columns:Fe,rows:le.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false}})})]})},VI=qo;var KI=({id:t,title:o,hideHeader:r=true,filterConfig:a,tableProps:n,children:i,spacing:s=1,mode:c="separated"})=>{let d=a?{...a,appId:a.appId||t}:void 0,m={...n,appId:n.appId||t};return g(Wn,{title:o,hideHeader:r,children:[g(ne,{spacing:s,sx:{height:"100%",overflow:"hidden"},children:[c==="separated"&&d&&f("div",{sx:{flexShrink:0},children:f(Oo,{...d})}),f("div",{sx:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:f(qo,{...m,fitContainer:true,filterConfig:c==="integrated"?d:void 0})})]}),i]})};var jI=({metadata:t,fetchData:o,initialRowsPerPage:r=20,rowsPerPageOptions:a=[20,50,100,-1],tableKey:n="default",mode:i="integrated",serviceUrl:s,variantService:c})=>{let{t:d}=ce(),[m,p]=useState(false),[f,h]=useState([]),[u,v]=useState({}),[y,g]=useState(t.variants||[]),[C,b]=useState(t.layout||null),[S,k]=useState(""),[x,E]=useState(0),[D,T]=useState(0),[N,R]=useState(r),[w,M]=useState([]),[I,L]=useState("asc"),[O,U]=useState("");useEffect(()=>{let ie={};t.filters.forEach(ge=>{ge.defaultValue!==void 0&&(ie[ge.id]=ge.defaultValue);}),v(ie);},[t.filters]);let z=useCallback(async(ie,ge,ye,Ue,Oe)=>{p(true);try{let Ie={...ie,page:ge+1,limit:ye,sort:Oe,order:Ue},ze;o?ze=await o(Ie):typeof t.api=="function"?ze=await t.api(Ie):t.api&&typeof t.api=="object"?(console.log("Fetching from URL:",t.api.url,Ie),ze={rows:[],total:0}):(console.warn("No API configured for report"),ze={rows:[],total:0}),ze&&(h(ze.rows||[]),E(ze.total||0));}catch(Ie){console.error("Failed to fetch report data",Ie);}finally{p(false);}},[t.api,o]);useEffect(()=>{z(u,D,N,I,O);},[z,D,N,I,O]);let K=()=>{T(0),z(u,0,N,I,O);},W=ie=>{T(0),R(ie);},q=(ie,ge)=>{L(ge),U(ie);},H=ie=>{v(ie);},V=ie=>{k(ie?.id||"");let ge=si(ie,n);if(ge){let Ue=ge.values??ge;v(Ue),z(Ue,0,N,I,O),T(0);}let{layout:ye}=li(ie,n);ye&&b(ye);},Z=ie=>{let ge={...ie,id:Date.now().toString(),createdAt:new Date().toISOString()};g(ye=>[...ye,ge]);},j=ie=>{b(ie);};return {pageProps:{id:t.id,title:t.title,mode:i,filterConfig:{appId:t.id,tableKey:n,fields:t.filters,filters:u,onFilterChange:H,onSearch:K,onVariantLoad:V,onVariantSave:Z,onVariantDelete:ie=>g(ge=>ge.filter(ye=>ye.id!==ie)),onVariantSetDefault:ie=>{g(ge=>ge.map(ye=>({...ye,isDefault:ye.id===ie})));},variants:y,currentVariantId:S,variantService:c,serviceUrl:s},tableProps:{appId:t.id,tableKey:n,columns:t.columns,rows:f,loading:m,rowKey:"id",count:x,page:D,rowsPerPage:N,rowsPerPageOptions:a,onPageChange:T,onRowsPerPageChange:W,selectionMode:"multiple",selected:w,onSelectionChange:M,onLayoutSave:j,layout:C,title:t.title,showSummary:true,order:I,orderBy:O,serviceUrl:s,onSortChange:q,graphReport:t.graphReport||{enabled:true,title:`${t.title} ${d("graph.reportTitle")}`}}},filters:u,rows:f,loading:m,refresh:K}};var Pf=new Set(["id","title","description","icon","iconNode","meta"]),Tf=t=>t.replace(/([A-Z])/g," $1").replace(/[._-]+/g," ").replace(/^\w/,o=>o.toUpperCase()).trim(),If=t=>Object.entries(t).filter(([o,r])=>!Pf.has(o)&&r!==null&&r!==void 0&&["string","number","boolean"].includes(typeof r)).map(([o,r])=>({key:o,label:Tf(o),value:String(r)})),Wd=({item:t,open:o,onClose:r,onDownloadClick:a,renderContent:n,downloadTooltip:i,closeTooltip:s})=>{let{t:c}=ce(),m=ho()==="dark"?"var(--orb-p300)":"var(--orb-primary)";Yt__default.useEffect(()=>{if(!o)return;let f=h=>{h.key==="Escape"&&r();};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[o,r]);let p=If(t);return typeof document>"u"?null:createPortal(g(e,{children:[f("div",{"aria-hidden":"true",onClick:r,sx:{position:"fixed",inset:0,zIndex:1299,backgroundColor:"rgba(1, 9, 26, 0.4)",opacity:o?1:0,pointerEvents:o?"auto":"none",transition:"opacity 200ms ease"}}),g("div",{role:"dialog","aria-modal":"true","aria-label":t.title,sx:{position:"fixed",top:"50%",left:"50%",zIndex:1300,width:"min(520px, 92vw)",maxHeight:"82vh",display:"flex",flexDirection:"column",bgcolor:"background.paper",border:"1px solid",borderColor:"divider",borderRadius:3,boxShadow:"0 24px 64px rgba(1, 9, 26, 0.3)",transform:o?"translate(-50%, -50%) scale(1)":"translate(-50%, -47%) scale(0.96)",opacity:o?1:0,transition:"transform 200ms ease, opacity 180ms ease"},children:[g(ne,{direction:"row",spacing:1.5,alignItems:"center",sx:{p:2.5,pb:2,borderBottom:"1px solid",borderColor:"divider",flexShrink:0},children:[f("div",{sx:{width:56,height:56,flex:"0 0 auto",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:3,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:t.iconNode??f(Rt,{name:t.icon??"product",size:30,style:{color:m}})}),g("div",{sx:{flex:1,minWidth:0},children:[f(A,{component:"div",sx:{fontWeight:700,fontSize:"1.1rem",lineHeight:1.3,wordBreak:"break-word"},children:t.title}),t.meta?f(A,{component:"div",sx:{fontSize:"0.8rem",color:"text.secondary"},children:t.meta}):null]}),f(ae,{tooltip:s??c("cardPage.close"),"aria-label":s??c("cardPage.close"),onClick:r,children:f(Rt,{name:"decline",size:18})})]}),f("div",{sx:{flex:1,minHeight:0,overflowY:"auto",p:2.5},children:n?n(t):g(e,{children:[t.description?f(A,{component:"div",sx:{fontSize:"0.9rem",lineHeight:1.6,color:"text.primary"},children:t.description}):null,p.length>0?f("div",{sx:{mt:t.description?2.5:0,display:"grid",gap:1.5},children:p.map(f$1=>g("div",{children:[f(A,{component:"div",sx:{fontSize:"0.72rem",fontWeight:600,color:"text.secondary",textTransform:"uppercase",letterSpacing:"0.04em"},children:f$1.label}),f(A,{component:"div",sx:{fontSize:"0.88rem",color:"text.primary",wordBreak:"break-word"},children:f$1.value})]},f$1.key))}):null]})}),a?f("div",{sx:{p:2.5,pt:2,borderTop:"1px solid",borderColor:"divider",flexShrink:0},children:f(be,{variant:"contained",sx:{width:"100%"},startIcon:f(Rt,{name:"download",size:16}),onClick:()=>a(t),children:i??c("cardPage.download")})}):null]})]}),document.body)};var Rf={display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"3",overflow:"hidden"},Mf=({item:t,onDetailClick:o,onDownloadClick:r,detailTooltip:a,downloadTooltip:n})=>{let{t:i}=ce(),c=ho()==="dark"?"var(--orb-p300)":"var(--orb-primary)",d=t.iconNode??f(Rt,{name:t.icon??"product",size:26,style:{color:c}});return g(Ae,{elevation:0,sx:{p:2,height:"100%",display:"flex",flexDirection:"column",borderRadius:3,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",boxShadow:"0 8px 20px rgba(15, 23, 42, 0.06)",transition:"transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease","&:hover":{transform:"translateY(-2px)",borderColor:"primary.main",boxShadow:"0 14px 32px rgba(15, 23, 42, 0.12)"}},children:[g(ne,{direction:"row",spacing:1.5,alignItems:"center",children:[f("div",{sx:{width:48,height:48,flex:"0 0 auto",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:2.5,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:d}),g("div",{sx:{flex:1,minWidth:0},children:[f(A,{component:"div",noWrap:true,sx:{fontWeight:700,fontSize:"0.98rem",lineHeight:1.3},children:t.title}),t.meta?f(A,{component:"div",noWrap:true,sx:{fontSize:"0.75rem",color:"text.secondary"},children:t.meta}):null]})]}),f("div",{sx:{mt:1.5,flex:1,minHeight:0},children:f(A,{component:"div",sx:{fontSize:"0.84rem",lineHeight:1.45,color:"text.primary",...Rf},children:t.description||"\xA0"})}),g(ne,{direction:"row",spacing:.5,justifyContent:"flex-end",sx:{mt:1.5},children:[f(ae,{tooltip:a??i("cardPage.viewDetails"),"aria-label":a??i("cardPage.viewDetails"),onClick:()=>o?.(t),children:f(Rt,{name:"show",size:18})}),f(ae,{tooltip:n??i("cardPage.download"),"aria-label":n??i("cardPage.download"),onClick:()=>r?.(t),children:f(Rt,{name:"download",size:18})})]})]})},Gd=({items:t,loading:o=false,onDetailClick:r,onDownloadClick:a,minCardWidth:n=260,detailTooltip:i,downloadTooltip:s,emptyText:c,detailPanel:d=true,renderDetailContent:m})=>{let{t:p}=ce(),[f$1,h]=Yt__default.useState(null),[u,v]=Yt__default.useState(false),y=C=>{r?.(C),d&&(h(C),requestAnimationFrame(()=>requestAnimationFrame(()=>v(true))));},g$1=()=>{v(false),setTimeout(()=>h(null),260);};return o?f("div",{sx:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",minHeight:240},children:f($o,{})}):t.length?g(e,{children:[f("div",{sx:{flex:1,minHeight:0,overflowY:"auto",display:"grid",gridTemplateColumns:`repeat(auto-fill, minmax(${n}px, 1fr))`,gap:2,alignContent:"start",p:.5},children:t.map(C=>f(Mf,{item:C,onDetailClick:y,onDownloadClick:a,detailTooltip:i,downloadTooltip:s},C.id))}),d&&f$1?f(Wd,{item:f$1,open:u,onClose:g$1,onDownloadClick:a,renderContent:m,downloadTooltip:s}):null]}):f("div",{sx:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",minHeight:240},children:f(A,{sx:{color:"text.secondary"},children:c??p("cardPage.empty")})})};var CR=({id:t,title:o,hideHeader:r=true,filterConfig:a,gridProps:n,children:i,spacing:s=1})=>{let c=a?{...a,appId:a.appId||t}:void 0;return g(Wn,{title:o,hideHeader:r,children:[g(ne,{spacing:s,sx:{height:"100%",overflow:"hidden"},children:[c&&f("div",{sx:{flexShrink:0},children:f(Oo,{...c})}),f("div",{sx:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:f(Gd,{...n})})]}),i]})};var PR=({metadata:t,fetchData:o,tableKey:r="default",variantService:a,serviceUrl:n,onDetailClick:i,onDownloadClick:s,minCardWidth:c})=>{let[d,m]=useState(false),[p,f]=useState([]),[h,u]=useState(0),[v,y]=useState({}),[g,C]=useState(t.variants||[]),[b,S]=useState("");useEffect(()=>{let R={};t.filters.forEach(w=>{w.defaultValue!==void 0&&(R[w.id]=w.defaultValue);}),y(R);},[t.filters]);let k=useCallback(async R=>{m(true);try{let w=o?await o({...R}):{rows:[],total:0};f(w?.rows||[]),u(w?.total||0);}catch(w){console.error("Failed to fetch card page data",w);}finally{m(false);}},[o]);useEffect(()=>{k(v);},[k]);let x=()=>{k(v);},E=R=>{y(R);},D=R=>{S(R?.id||"");let w=si(R,r);if(w){let M=w.values??w;y(M),k(M);}},T=R=>{let w={...R,id:Date.now().toString(),createdAt:new Date().toISOString()};C(M=>[...M,w]);};return {pageProps:{id:t.id,title:t.title,filterConfig:{appId:t.id,tableKey:r,fields:t.filters,filters:v,onFilterChange:E,onSearch:x,onVariantLoad:D,onVariantSave:T,onVariantDelete:R=>C(w=>w.filter(M=>M.id!==R)),onVariantSetDefault:R=>{C(w=>w.map(M=>({...M,isDefault:M.id===R})));},variants:g,currentVariantId:b,variantService:a,serviceUrl:n},gridProps:{items:p,loading:d,onDetailClick:i,onDownloadClick:s,minCardWidth:c}},items:p,total:h,filters:v,loading:d,refresh:x}};var Af=t=>[...t].sort((o,r)=>r.value-o.value),RR=({bars:t=[],lines:o=[],combos:r=[],heatmap:a=[],pies:n=[],waterfalls:i=[]})=>{let s=useMemo(()=>Af(t),[t]),c=useMemo(()=>[...o],[o]),d=useMemo(()=>[...r],[r]),m=useMemo(()=>[...a],[a]),p=useMemo(()=>{let h=n.reduce((u,v)=>u+v.value,0);return n.map(u=>({...u,percent:h>0?u.value/h*100:u.percent}))},[n]),f=useMemo(()=>[...i],[i]);return {bars:s,lines:c,combos:d,heatmap:m,pies:p,waterfalls:f}};var ER=({apiKey:t,query:o,zoom:r=14,mapType:a="roadmap"})=>useMemo(()=>!t||!o?"":Oa({apiKey:t,query:o,zoom:r,mapType:a}),[t,o,r,a]),LR=({keyword:t,location:o})=>useMemo(()=>jn({keyword:t,location:o?{lng:o.lng,lat:o.lat,name:o.name}:void 0}),[t,o]);var $a=({code:t,language:o="text",copyable:r=true,showLineNumbers:a=false,wrapLongLines:n=false,maxHeight:i})=>{let[s,c]=useState(false),d=useMemo(()=>t.replace(/\n$/,"").split(`
4
- `),[t]);return g("div",{style:{border:"1px solid var(--orb-border)",borderRadius:12,overflow:"hidden",background:"var(--orb-canvas)"},children:[g("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"4.8px 8px",background:"var(--orb-hover)",borderBottom:"1px solid var(--orb-border)"},children:[f("span",{style:{fontSize:12,fontWeight:500,textTransform:"uppercase",letterSpacing:.5,color:"var(--orb-muted)",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:o}),r&&f(ae,{size:"small",tooltip:s?"Copied":"Copy",onClick:async()=>{try{await navigator.clipboard.writeText(t),c(!0),window.setTimeout(()=>c(!1),1400);}catch{c(false);}},children:s?f(Wr,{size:14,strokeWidth:1.8}):f(on,{size:14,strokeWidth:1.8})})]}),f("pre",{style:{margin:0,padding:10,fontSize:"0.82rem",lineHeight:1.55,overflow:"auto",maxHeight:i,background:"var(--orb-surface)",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:a?d.map((p,f$1)=>g("div",{style:{display:"flex"},children:[f("span",{style:{width:34,flexShrink:0,textAlign:"right",paddingRight:8,color:"var(--orb-disabled-fg)",userSelect:"none"},children:f$1+1}),f("span",{style:{whiteSpace:n?"pre-wrap":"pre",wordBreak:n?"break-word":"normal"},children:p})]},`${f$1}-${p}`)):f("code",{style:{display:"block",whiteSpace:n?"pre-wrap":"pre",wordBreak:n?"break-word":"normal"},children:t})})]})};var Of=t=>{let o=t.trim();return o.startsWith("$$")&&o.endsWith("$$")&&o.length>=4&&(o=o.slice(2,-2).trim()),o.startsWith("$")&&o.endsWith("$")&&o.length>=2&&(o=o.slice(1,-1).trim()),o},zf=async t=>new Function("m","return import(m)")(t),Ga=({expression:t,inline:o=false,allowKatex:r=false})=>{let a=useMemo(()=>Of(t),[t]),[n,i]=useState("");return useEffect(()=>{let s=true;return (async()=>{if(!r||!a){i("");return}try{let d=await zf("katex"),p=(d?.default||d)?.renderToString?.(a,{displayMode:!o,throwOnError:!1,strict:"warn"});s&&typeof p=="string"&&i(p);}catch{s&&i("");}})(),()=>{s=false;}},[r,a,o]),a?n?f(Se,{component:o?"span":"div",sx:{display:o?"inline-flex":"block",my:o?0:.5,overflowX:"auto"},dangerouslySetInnerHTML:{__html:n}}):o?f(Se,{component:"code",sx:{px:.4,py:.05,borderRadius:.8,bgcolor:"action.hover",fontSize:"0.82em",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:a}):f(Se,{sx:{my:1,p:1,borderRadius:1.2,border:"1px dashed",borderColor:"divider",bgcolor:"background.paper"},children:f(mo,{component:"pre",sx:{m:0,whiteSpace:"pre-wrap",fontSize:"0.9rem",lineHeight:1.5,fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:a})}):null};var Wf=async t=>new Function("m","return import(m)")(t),ws=({code:t,title:o="Mermaid Diagram",height:r=320,enabled:a=true})=>{let[n,i]=useState(""),[s,c]=useState(""),[d,m]=useState(false),p=useMemo(()=>t.trim(),[t]);return useEffect(()=>{let f=true;return (async()=>{if(!a||!p){i(""),c("");return}m(true),c(""),i("");try{let u=await Wf("mermaid"),v=u?.default||u;if(!v||typeof v.render!="function")throw new Error("Mermaid runtime is not available");v.initialize?.({startOnLoad:!1,securityLevel:"loose",theme:"default"});let y=await v.render(`orbcafe-mermaid-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,p),g=typeof y=="string"?y:y?.svg;f&&typeof g=="string"&&i(g);}catch(u){if(f){let v=u instanceof Error?u.message:"Failed to render Mermaid diagram";c(v);}}finally{f&&m(false);}})(),()=>{f=false;}},[a,p]),g(Tr,{variant:"outlined",sx:{borderRadius:1.5,overflow:"hidden",my:1},children:[f(Se,{sx:{px:1,py:.6,borderBottom:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:f(mo,{variant:"caption",color:"text.secondary",sx:{letterSpacing:.4,textTransform:"uppercase"},children:o})}),g(Se,{sx:{p:1},children:[d&&f(Se,{sx:{minHeight:120,display:"flex",alignItems:"center",justifyContent:"center"},children:f(lc,{size:20})}),!d&&n&&f(Se,{sx:{maxHeight:r,overflow:"auto","& svg":{display:"block",mx:"auto",maxWidth:"100%",height:"auto"}},dangerouslySetInnerHTML:{__html:n}}),!d&&!n&&g(Se,{children:[s&&f(Uo,{severity:"info",sx:{mb:1},children:s}),f($a,{code:p,language:"mermaid",copyable:true,showLineNumbers:true,wrapLongLines:true})]})]})]})};var ks=t=>t.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(r=>r.trim()),Gf=t=>/^:?-{3,}:?$/.test(t.trim()),_f=t=>{let o=t.trim(),r=o.startsWith(":"),a=o.endsWith(":");return r&&a?"center":a?"right":"left"},ci=t=>{let o=t.split(`
5
- `).map(s=>s.trim()).filter(Boolean);if(o.length<2)return null;let r=ks(o[0]),a=ks(o[1]);if(r.length===0||a.length!==r.length||!a.every(Gf))return null;let n=a.map(_f),i=o.slice(2).filter(s=>s.includes("|")).map(s=>{let c=ks(s);return c.length<r.length?[...c,...Array.from({length:r.length-c.length},()=>"")]:c.slice(0,r.length)});return {headers:r,aligns:n,rows:i}},Ps=({markdown:t,table:o,maxHeight:r=360})=>{let a=useMemo(()=>o||(t?ci(t):null),[o,t]);return !a||a.headers.length===0?f(Tr,{variant:"outlined",sx:{p:1.2,borderRadius:1.5},children:f(mo,{variant:"body2",color:"text.secondary",children:"Invalid table block"})}):f(Tr,{variant:"outlined",sx:{borderRadius:1.5,overflow:"hidden",my:1},children:f(uc,{sx:{maxHeight:r},children:g(dc,{size:"small",stickyHeader:true,children:[f(mc,{children:f(ms,{children:a.headers.map((n,i)=>f(us,{align:a.aligns[i],sx:{fontWeight:700,bgcolor:"background.paper"},children:n},`${n}-${i}`))})}),f(pc,{children:a.rows.map((n,i)=>f(ms,{hover:true,children:n.map((s,c)=>f(us,{align:a.aligns[c],sx:{whiteSpace:"pre-wrap",wordBreak:"break-word"},children:s||f(Se,{component:"span",sx:{color:"text.disabled"},children:"-"})},`cell-${i}-${c}`))},`row-${i}`))})]})})})};var di=({content:t,title:o="Thinking",defaultExpanded:r=false,isStreaming:a=false})=>{let[n,i]=useState(r);return g(Se,{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1,my:.8},children:[g(nc,{direction:"row",alignItems:"center",spacing:.6,children:[f(ic,{size:"small",onClick:()=>i(s=>!s),sx:{transform:n?"rotate(180deg)":"rotate(0deg)",transition:"transform .15s ease"},children:f(Kr,{fontSize:"inherit"})}),g(mo,{variant:"caption",color:"text.secondary",sx:{fontStyle:"italic"},children:[o,a?" ...":""]})]}),f(Ur,{in:n,children:f(mo,{variant:"body2",sx:{pl:4,pt:.4,whiteSpace:"pre-wrap",color:"text.secondary",fontStyle:"italic",lineHeight:1.55},children:t})})]})};var Ts=/(\*\*[^*]+\*\*|`[^`]+`|\[[^\]]+\]\([^)]+\)|\*[^*]+\*|\$[^$\n]+\$)/g,pi=t=>t.trim().startsWith("```"),qd=t=>/^#{1,6}\s+/.test(t.trim()),Is=t=>/^[-*+]\s+/.test(t.trim()),Rs=t=>/^\d+\.\s+/.test(t.trim()),Xd=t=>/^(?:-{3,}|\*{3,}|_{3,})$/.test(t.trim()),Ms=t=>t.trim().startsWith(">"),Yd=(t,o)=>{if(o+1>=t.length)return false;let r=t[o],a=t[o+1];return !r.includes("|")||!a.includes("|")?false:/^\s*\|?\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)+\|?\s*$/.test(a.trim())},Zd=t=>t.trim().startsWith("<think>")||t.trim()===":::think",_a=(t,o,r)=>{let a=[],n=0,i=0;Ts.lastIndex=0;let s=Ts.exec(t);for(;s;){s.index>n&&a.push(t.slice(n,s.index));let c=s[0],d=`${r}-${i}`;if(c.startsWith("**")&&c.endsWith("**"))a.push(f("strong",{children:c.slice(2,-2)},d));else if(c.startsWith("*")&&c.endsWith("*"))a.push(f("em",{children:c.slice(1,-1)},d));else if(c.startsWith("`")&&c.endsWith("`"))a.push(f(Se,{component:"code",sx:{px:.45,py:.08,borderRadius:.8,bgcolor:"action.hover",fontSize:"0.82em",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:c.slice(1,-1)},d));else if(c.startsWith("[")&&c.includes("](")&&c.endsWith(")")){let m=c.match(/^\[([^\]]+)\]\(([^)]+)\)$/);m?a.push(f(ac,{href:m[2],target:"_blank",rel:"noreferrer",children:m[1]},d)):a.push(c);}else c.startsWith("$")&&c.endsWith("$")&&o.enableMath?a.push(f(Ga,{expression:c,inline:true,allowKatex:true},d)):a.push(c);n=s.index+c.length,i+=1,s=Ts.exec(t);}return n<t.length&&a.push(t.slice(n)),a.length>0?a:[t]},Ua=({markdown:t,content:o,className:r,enableMath:a=true,enableMermaid:n=true,enableThinkBlock:i=true,codeCopyable:s=true,codeLineNumbers:c=false})=>{let d=t??o??"",m=useMemo(()=>{let p=[],f$1=d.replace(/\r\n/g,`
1
+ import {f,d,g,e,a,b,c}from'./chunk-7TUSE6H4.mjs';export{h as COrbCanvas}from'./chunk-7TUSE6H4.mjs';import*as Qt from'react';import Qt__default,{createContext,forwardRef,useId,useRef,useState,useImperativeHandle,useMemo,Children,isValidElement,useEffect,useContext,useCallback,Fragment,useLayoutEffect,cloneElement}from'react';import*as Rr from'@radix-ui/react-dropdown-menu';import*as qr from'@radix-ui/react-tooltip';import {createPortal}from'react-dom';import*as xr from'@radix-ui/react-dialog';import*as ho from'@radix-ui/react-popover';import eo from'dayjs';import bf from'dayjs/plugin/customParseFormat';import {usePathname,useRouter}from'next/navigation';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {Slot}from'@radix-ui/react-slot';import {cva}from'class-variance-authority';import {DndContext,closestCenter,useSensors,useSensor,PointerSensor,TouchSensor,closestCorners,DragOverlay,useDroppable,useDraggable}from'@dnd-kit/core';import {restrictToHorizontalAxis}from'@dnd-kit/modifiers';import {arrayMove,SortableContext,horizontalListSortingStrategy,verticalListSortingStrategy,useSortable}from'@dnd-kit/sortable';import Nh from'dayjs/plugin/isBetween';import Ah 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 Bv from'next/dynamic';import {AnimatePresence,motion}from'framer-motion';import My from'react-markdown';import Ry from'remark-gfm';import Dy from'remark-math';import Ny from'rehype-katex';import Ay from'rehype-raw';import {Prism}from'react-syntax-highlighter';import {oneDark,oneLight}from'react-syntax-highlighter/dist/esm/styles/prism';import Ju from'mermaid';import QC from'dayjs/plugin/isoWeek';var gg={canvas:"#ffffff",surface:"#f5f5f5",surface2:"#f5f5f5",surface3:"#f5f5f5",fg:"#555555",muted:"#8c8c8c",border:"#dbdbdb",primary:"#154194",onPrimary:"#ffffff",link:"#154194",p50:"#f0f3f9",p100:"#dce4f1",p200:"#bac9e3",p300:"#91a8d1",p600:"#0f3276",p700:"#08255a",accent:"#fc4c02",err:"#ac3101",errBg:"#fff4f0",warnBg:"#fff2ee",hover:"rgba(21, 65, 148, 0.06)",selected:"rgba(21, 65, 148, 0.10)",focusRing:"rgba(21, 65, 148, 0.18)",focusSolid:"#154194",disabledFg:"#aeaeae",disabledBg:"#f0f0f0",chartGrid:"#dbdbdb",chartText:"#8c8c8c",track:"#f5f5f5",shadow1:"0 1px 2px rgba(1,9,26,.05),0 2px 6px rgba(1,9,26,.06)",shadow2:"0 4px 14px rgba(1,9,26,.10)",shadow3:"0 12px 32px rgba(1,9,26,.16)",fontBrand:"Montserrat",inverseSurface:"#01091a",inverseFg:"#ffffff",inverseLink:"#91a8d1",aiAccent:"#21bcff",statusFg:"#475569",statusPrimary:"#1d4ed8",statusSuccess:"#047857",statusWarning:"#b45309",statusError:"#b91c1c",statusInfo:"#0369a1",chart1:"#154194",chart2:"#91a8d1",chart3:"#8c8c8c",chart4:"#08255a",chart5:"#fc4c02",chart6:"#bac9e3",chartPositive:"#66bb6a",chartNegative:"#ef5350"},fg={canvas:"#01091a",surface:"#0a1526",surface2:"#061324",surface3:"#0e1b2b",fg:"#ffffff",muted:"rgba(255,255,255,0.7)",border:"rgba(255,255,255,0.12)",primary:"#154194",onPrimary:"#ffffff",link:"#91a8d1",p50:"#021432",p100:"#021a3d",p200:"#bac9e3",p300:"#91a8d1",p600:"#375ea5",p700:"#6e8cc1",accent:"#fc4c02",err:"#d53f01",errBg:"#16163b",warnBg:"#19173f",hover:"rgba(255,255,255,0.08)",selected:"rgba(21, 65, 148, 0.45)",focusRing:"rgba(145, 168, 209, 0.45)",focusSolid:"#91a8d1",disabledFg:"rgba(255,255,255,0.38)",disabledBg:"rgba(255,255,255,0.07)",chartGrid:"rgba(255,255,255,0.12)",chartText:"rgba(255,255,255,0.7)",track:"rgba(255,255,255,0.1)",shadow1:"0 1px 2px rgba(0,0,0,.4),0 2px 8px rgba(0,0,0,.35)",shadow2:"0 4px 16px rgba(0,0,0,.5)",shadow3:"0 12px 32px rgba(0,0,0,.55)",fontBrand:"Montserrat",inverseSurface:"#01091a",inverseFg:"#ffffff",inverseLink:"#91a8d1",aiAccent:"#21bcff",statusFg:"#94a3b8",statusPrimary:"#60a5fa",statusSuccess:"#34d399",statusWarning:"#fbbf24",statusError:"#f87171",statusInfo:"#38bdf8",chart1:"#154194",chart2:"#91a8d1",chart3:"rgba(255,255,255,0.7)",chart4:"#a4b8dd",chart5:"#fc4c02",chart6:"#bac9e3",chartPositive:"#66bb6a",chartNegative:"#ef5350"},ks={light:gg,dark:fg},hx='"Montserrat", system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif',bx=t=>{let r=ks[t];return [r.primary,r.p300,r.muted,r.p700]},vx=10,yx="0.2s ease";var ac=createContext({mode:"light",setting:"light"}),yg=t=>{if(typeof document>"u")return;let r=document.documentElement;r.classList.toggle("orb-dark",t==="dark"),r.dataset.orbMode=t,r.style.colorScheme=t;},Dn=({mode:t,defaultMode:r="light",children:o})=>{let n=t??r,[a,i]=useState("light"),[s,l]=useState(false);useEffect(()=>{l(true);let u=window.matchMedia("(prefers-color-scheme: dark)"),f=()=>i(u.matches?"dark":"light");return f(),u.addEventListener("change",f),()=>u.removeEventListener("change",f)},[]);let d=n==="system"?s?a:"light":n;useEffect(()=>{yg(d);},[d]);let p=useMemo(()=>({mode:d,setting:n}),[d,n]);return f(ac.Provider,{value:p,children:o})},br=()=>useContext(ac).mode,Ps=()=>ks[br()];var tt=(t,r)=>{let o=Math.min(1,Math.max(0,r)),n=t.trim(),a=d=>d.split("").map(p=>p+p).join(""),i=n.startsWith("#")?n.slice(1):"",s=i.length===3?a(i):i;if(/^[0-9a-fA-F]{6}$/.test(s)){let d=parseInt(s.slice(0,2),16),p=parseInt(s.slice(2,4),16),u=parseInt(s.slice(4,6),16);return `rgba(${d}, ${p}, ${u}, ${o})`}let l=`${Math.round(o*100)}%`;return `color-mix(in oklch, ${t} ${l}, transparent)`};var Mr=t=>{let r=t.startsWith("up:")?`(min-width:${t.slice(3)}px)`:t.startsWith("down:")?`(max-width:${t.slice(5)}px)`:t,[o,n]=useState(()=>typeof window>"u"||typeof window.matchMedia!="function"?false:window.matchMedia(r).matches);return useEffect(()=>{if(typeof window.matchMedia!="function")return;let a=window.matchMedia(r),i=()=>n(a.matches);return i(),a.addEventListener("change",i),()=>a.removeEventListener("change",i)},[r]),o};var Sg={accept:57435,activate:57864,activity:57769,add:57432,barChart:57417,calendar:57414,camera:57413,checklist:57952,collapseAll:57988,command:57997,copy:57925,darkMode:58122,decline:57406,delete:57405,dimension:57718,document:57780,down:57827,download:57402,duplicate:57401,edit:57400,email:57399,employee:57398,error:57836,expandAll:57987,factory:57464,favorite:57445,filter:57462,fullScreen:57702,grid:57457,hide:57834,home:57456,information:57993,inventory:57693,ipad:57491,lightMode:58121,lightbulb:57380,lineChart:57740,locked:57683,log:57378,map:57377,menu:57822,message:57884,microphone:57586,move:57832,navigationLeft:57447,navigationRight:57446,overflow:57842,overview:57551,paperPlane:57548,picture:57366,pieChart:57365,play:57499,process:57543,product:57361,pushpin:57503,qrCode:57999,receipt:57541,refresh:57360,save:57498,search:57357,show:57833,shipping:57523,slimDown:57839,slimUp:57840,sort:57853,sound:57895,splitOne:57919,splitTwo:57920,stop:57861,sum:57998,synchronize:57354,table:57530,tableColumn:57983,tableRow:57982,thumbDown:57891,thumbUp:57890,time:57508,translate:57995,tree:57588,trendDown:57931,up:57828,upload:57881,warning:57492,world:57489,wrench:57346},wg=t=>typeof t=="number"?`${t}px`:t,kg={"2.5":10,3:12,"3.5":14,4:16,5:20,6:24,7:28,8:32,10:40,12:48},Pg=t=>{if(!t)return;let r=t.match(/(?:^|\s)(?:h|w)-(2\.5|3(?:\.5)?|4|5|6|7|8|10|12)(?:\s|$)/);return r?kg[r[1]]:void 0},Mt=forwardRef(({name:t,size:r,title:o,className:n,style:a,strokeWidth:i,fill:s,...l},d)=>{let p=l["aria-label"]??o,u=wg(r??Pg(n)??"1em"),f$1={fontFamily:"SAP-icons",fontSize:u,fontStyle:"normal",fontWeight:"normal",lineHeight:1,width:u,height:u,display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto",WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",...a};return f("span",{ref:d,role:p?"img":void 0,"aria-hidden":p?void 0:true,title:o,className:n,"data-sap-icon":t,style:f$1,...l,children:String.fromCodePoint(Sg[t])})});Mt.displayName="SapIcon";var oe=(t,r)=>{let o=forwardRef((n,a)=>f(Mt,{ref:a,name:t,...n}));return o.displayName=r??`SapIcon(${t})`,o};var sc=oe("activity","Activity"),va=oe("error","AlertCircle"),lc=oe("warning","AlertTriangle"),Bx=oe("down","ArrowDown"),Hx=oe("navigationRight","ArrowRight"),cc=oe("up","ArrowUp"),Ts=oe("barChart","BarChart"),zx=oe("activate","Bot"),Is=oe("calendar","Calendar"),Vx=Is,Wx=oe("camera","Camera"),$x=oe("lineChart","ChartNoAxesCombined"),Ur=oe("accept","Check"),ya=oe("accept","CheckCircle"),Lr=oe("slimDown","ChevronDown"),Ca=oe("navigationLeft","ChevronLeft"),Or=oe("navigationRight","ChevronRight"),Gx=oe("slimUp","ChevronUp"),_x=oe("expandAll","ChevronsDown"),Ux=oe("collapseAll","ChevronsUp"),xa=oe("error","CircleAlert"),Nn=oe("accept","CircleCheck"),Kx=Nn,dc=oe("stop","CircleStop"),pc=oe("copy","Clipboard"),qx=oe("checklist","ClipboardCheck"),Xx=oe("checklist","ClipboardList"),uc=oe("time","Clock"),Yx=oe("tableColumn","Columns3"),fo=oe("copy","Copy"),Zx=oe("duplicate","CopyPlus"),Qx=oe("delete","Delete"),jx=oe("download","Download"),mc=oe("edit","Edit"),gc=oe("fullScreen","Expand"),Jx=oe("show","Eye"),e0=oe("hide","EyeOff"),Sa=oe("document","File"),fc=oe("document","FileText"),t0=oe("filter","Filter"),An=oe("tree","FolderTree"),hc=oe("process","GitBranch"),En=oe("world","Globe"),bc=oe("grid","Grid"),r0=oe("move","GripVertical"),o0=oe("wrench","Hammer"),vc=oe("picture","Image"),wa=oe("information","Info"),n0=oe("translate","Languages"),a0=oe("dimension","Layers"),i0=oe("home","LayoutDashboard"),ka=oe("lightbulb","Lightbulb"),yc=oe("lineChart","LineChart"),Cc=oe("synchronize","Loader2"),Pa=oe("locked","Lock"),s0=Pa,xc=oe("log","LogOut"),Ms=oe("email","Mail"),Sc=oe("map","MapPin"),l0=oe("menu","Menu"),Tg=oe("message","MessageCircle"),wc=Tg,Ta=oe("microphone","Mic"),c0=oe("microphone","MicOff"),kc=oe("darkMode","Moon"),d0=oe("overflow","MoreHorizontal"),p0=oe("accept","PackageCheck"),u0=oe("product","PackageSearch"),Ia=oe("splitOne","PanelLeftOpen"),Ma=oe("splitTwo","PanelRight"),m0=oe("overview","PanelsTopLeft"),Pc=oe("pieChart","PieChart"),Zo=oe("pushpin","Pin"),g0=oe("play","Play"),Ra=oe("add","Plus"),f0=oe("qrCode","QrCode"),h0=oe("receipt","ReceiptText"),Da=oe("refresh","RefreshCw"),b0=oe("activate","Rocket"),v0=oe("refresh","RotateCcw"),Tc=oe("refresh","RotateCw"),y0=oe("tableRow","Rows3"),C0=oe("save","Save"),x0=oe("qrCode","ScanLine"),Fr=oe("search","Search"),Ig=oe("paperPlane","Send"),Ic=Ig,Qo=oe("wrench","Settings"),S0=oe("accept","ShieldCheck"),w0=oe("sum","Sigma"),k0=oe("sort","SortAsc"),P0=oe("splitTwo","SquareSplitHorizontal"),T0=oe("favorite","Star"),Mc=oe("lightMode","Sun"),I0=oe("table","Table2"),M0=oe("ipad","TabletSmartphone"),Ln=oe("command","Terminal"),Rc=oe("thumbDown","ThumbsDown"),Dc=oe("thumbUp","ThumbsUp"),Nc=oe("delete","Trash2"),R0=oe("tree","TreePine"),Ac=oe("trendDown","TrendingDown"),Na=oe("warning","TriangleAlert"),D0=oe("shipping","Truck"),Ec=oe("upload","UploadCloud"),Rs=oe("employee","User"),Lc=oe("sound","Volume2"),N0=oe("factory","Warehouse"),A0=oe("process","Workflow"),Xt=oe("decline","X"),Aa=oe("error","XCircle");var Rg={contained:"primary",outlined:"secondary",text:"ghost"},Dg={small:"orb-btn-sm",medium:void 0,large:"orb-btn-lg"},ye=forwardRef(({variant:t="primary",size:r="medium",block:o=false,loading:n=false,startIcon:a,endIcon:i,component:s,href:l,sx:d$1,className:p,children:u,disabled:f$1,type:h="button",...m},v)=>{let y=Rg[t]??t,g$1=["orb-btn",`orb-btn-${y}`,Dg[r],o?"orb-btn-block":void 0,n?"orb-is-loading":void 0,p].filter(Boolean).join(" "),x=d(d$1,g$1),b=s??(l?"a":"button");return g(b,{ref:v,type:b==="button"?h:void 0,href:l,className:x.className,style:x.style,disabled:b==="button"?f$1||n:void 0,"aria-disabled":b!=="button"&&(f$1||n)?true:void 0,...m,children:[n&&f("span",{className:`orb-spin ${y==="primary"?"orb-spin-light":""}`,"aria-hidden":true}),!n&&a,u,!n&&i]})});ye.displayName="CButton";var He=forwardRef(({label:t,value:r,defaultValue:o,onChange:n,onFocus:a,onBlur:i,onKeyDown:s,type:l="text",placeholder:d$1,disabled:p,readOnly:u,required:f$1,autoFocus:h,autoComplete:m,name:v,id:y,error:g$1,helperText:x,dense:b=false,size:C,fullWidth:P=true,select:S=false,multiline:k=false,rows:I,children:w,variant:A,margin:R,onClick:T,startAdornment:N,endAdornment:D,InputProps:L,inputProps:B,InputLabelProps:X,SelectProps:H,sx:K,className:W},G)=>{let z=useId(),O=y??`orb-tf-${z}`,Y=N??L?.startAdornment,Q=D??L?.endAdornment,ie=(typeof g$1=="string"?g$1:void 0)??x,fe={id:O,className:`orb-inp ${b||C==="small"?"orb-inp-dense":""}`,style:P?void 0:{width:"auto"},value:r,defaultValue:o,onChange:n,onFocus:a,onBlur:i,onKeyDown:s,placeholder:d$1,disabled:p,required:f$1,autoFocus:h,autoComplete:m,name:v,onClick:T,"aria-invalid":!!g$1},Ge=S?f("select",{...fe,ref:G,onChange:n,children:w}):k?f("textarea",{...fe,ref:G,onChange:n,rows:I,readOnly:u||L?.readOnly}):f("input",{...fe,ref:G,onChange:n,type:l,readOnly:u||L?.readOnly,...B}),Re=d(K,`orb-fld ${g$1?"orb-is-error":""} ${W??""}`,{width:P?"100%":void 0});return g("div",{className:Re.className,style:Re.style,children:[t&&f("label",{htmlFor:O,children:t}),Y||Q?g("div",{className:"orb-inp-adornment-wrap",children:[Y&&f("span",{className:"orb-inp-adornment",children:Y}),Q&&f("span",{className:"orb-inp-adornment orb-inp-adornment-end",children:Q}),Ge]}):Ge,ie&&f("span",{className:"orb-fld-msg",children:ie})]})});He.displayName="CTextField";var On=forwardRef(({label:t,value:r,defaultValue:o,onChange:n,placeholder:a,disabled:i,readOnly:s,rows:l,minRows:d$1=3,multiline:p,error:u,helperText:f$1,fullWidth:h=true,name:m,id:v,inputProps:y,sx:g$1,className:x},b)=>{let C=useId(),P=v??`orb-ta-${C}`,k=(typeof u=="string"?u:void 0)??f$1,I=d(g$1,`orb-fld ${u?"orb-is-error":""} ${x??""}`,{width:h?"100%":void 0});return g("div",{className:I.className,style:I.style,children:[t&&f("label",{htmlFor:P,children:t}),f("textarea",{ref:b,id:P,className:"orb-inp",value:r,defaultValue:o,onChange:n,placeholder:a,disabled:i,readOnly:s,rows:l??d$1,name:m,"aria-invalid":!!u,...y}),k&&f("span",{className:"orb-fld-msg",children:k})]})});On.displayName="CTextArea";var Vt=forwardRef(({label:t,options:r,children:o,value:n,defaultValue:a,onChange:i,disabled:s,size:l,dense:d$1=true,fullWidth:p=true,minWidth:u,placeholder:f$1,displayEmpty:h,renderValue:m,multiple:v,MenuProps:y,variant:g$1,disableUnderline:x,onClick:b,onMouseDown:C,error:P,helperText:S,name:k,id:I,"aria-label":w,sx:A,className:R},T)=>{let N=useId(),D=I??`orb-sel-${N}`,B=(typeof P=="string"?P:void 0)??S,X=useRef(null),H=useRef(null),[K,W]=useState(false),[G,z]=useState(180),[O,Y]=useState(a??"");useImperativeHandle(T,()=>X.current);let Q=useMemo(()=>Children.toArray(o).flatMap(Pe=>{if(!isValidElement(Pe)||Pe.type!=="option")return [];let Ce=Pe;return [{value:Array.isArray(Ce.props.value)?Ce.props.value[0]??"":Ce.props.value??"",label:Ce.props.children,disabled:Ce.props.disabled}]}),[o]),me=r??Q,ie=n??O,se=Array.isArray(ie)?ie[0]??"":ie,fe=String(se??""),Ge=me.find(Pe=>String(Pe.value)===fe),Re=m?m(ie):Ge?.label??(fe||(f$1??"")),ke=d(A,`orb-fld ${P?"orb-is-error":""} ${R??""}`,{width:p?"100%":void 0,minWidth:typeof u=="number"?`${u}px`:u});if(v)return g("div",{className:ke.className,style:ke.style,children:[t&&f("label",{htmlFor:D,children:t}),g("select",{ref:T,id:D,className:`orb-inp ${d$1||l==="small"?"orb-inp-dense":""}`,value:n,defaultValue:a,onChange:i,disabled:s,name:k,multiple:true,onClick:b,onMouseDown:C,"aria-invalid":!!P,"aria-label":w,children:[f$1!==void 0&&f("option",{value:"",children:f$1}),r?r.map(Pe=>f("option",{value:Pe.value,disabled:Pe.disabled,children:Pe.label},Pe.value)):o]}),B&&f("span",{className:"orb-fld-msg",children:B})]});let ze=Pe=>{n===void 0&&Y(Pe);let Ce=X.current;Ce&&(Object.getOwnPropertyDescriptor(HTMLSelectElement.prototype,"value")?.set?.call(Ce,Pe),i?.({target:Ce,currentTarget:Ce}));};return g("div",{className:ke.className,style:ke.style,children:[t&&f("label",{htmlFor:D,children:t}),f("select",{ref:X,className:"orb-visually-hidden",tabIndex:-1,"aria-hidden":"true",name:k,value:fe,disabled:s,onChange:()=>{},children:me.map(Pe=>f("option",{value:Pe.value,disabled:Pe.disabled,children:Pe.label},String(Pe.value)))}),g(Rr.Root,{open:K,onOpenChange:Pe=>{Pe&&z(H.current?.getBoundingClientRect().width??180),W(Pe);},children:[f(Rr.Trigger,{asChild:true,children:g("button",{ref:H,id:D,type:"button",className:`orb-inp orb-select-trigger ${d$1||l==="small"?"orb-inp-dense":""}`,disabled:s,"aria-invalid":!!P,"aria-label":w,"aria-haspopup":"listbox","data-placeholder":!Ge&&!fe?"":void 0,onClick:b,onMouseDown:C,children:[f("span",{className:"orb-select-value",children:Re}),f(Mt,{className:"orb-select-chevron",name:"slimDown",size:12})]})}),f(Rr.Portal,{children:f(Rr.Content,{className:"orb-pop orb-select-menu",align:"start",sideOffset:5,collisionPadding:8,style:{minWidth:G},children:f(Rr.RadioGroup,{value:fe,onValueChange:ze,children:me.map(Pe=>g(Rr.RadioItem,{className:"orb-select-option",value:String(Pe.value),disabled:Pe.disabled,children:[f("span",{className:"orb-select-check","aria-hidden":"true",children:String(Pe.value)===fe?f(Mt,{name:"accept",size:13}):null}),f("span",{children:Pe.label})]},String(Pe.value)))})})})]}),B&&f("span",{className:"orb-fld-msg",children:B})]})});Vt.displayName="CSelect";var Rt=forwardRef(({label:t,checked:r,defaultChecked:o,onChange:n,disabled:a,indeterminate:i,name:s,value:l,id:d$1,size:p,color:u,onClick:f$1,inputProps:h,sx:m,className:v},y)=>{let g$1=d([{...p==="small"?{fontSize:13}:void 0,...u?{color:u}:void 0},...Array.isArray(m)?m:m?[m]:[]],`orb-chk ${v??""}`),x=f("input",{ref:b=>{b&&(b.indeterminate=!!i),typeof y=="function"?y(b):y&&(y.current=b);},type:"checkbox",id:d$1,checked:r,defaultChecked:o,onChange:n,readOnly:r!==void 0&&n===void 0,disabled:a,name:s,value:l,onClick:f$1,...h});return t==null?f("span",{className:g$1.className,style:g$1.style,children:x}):g("label",{className:g$1.className,style:g$1.style,children:[x,f("span",{children:t})]})});Rt.displayName="CCheckbox";var Gg=({label:t,options:r,value:o,defaultValue:n,onChange:a,name:i,row:s=false,disabled:l,sx:d,className:p})=>{let u=useId(),f$1=i??`orb-rdo-${u}`;return g("div",{className:`orb-fld ${p??""}`,style:d,role:"radiogroup",children:[t&&f("span",{className:"orb-fld-label",children:t}),f("div",{style:{display:"flex",flexDirection:s?"row":"column",gap:s?24:8,flexWrap:"wrap"},children:r.map(h=>g("label",{className:"orb-rdo",children:[f("input",{type:"radio",name:f$1,value:h.value,checked:o!==void 0?o===h.value:void 0,defaultChecked:n!==void 0?n===h.value:void 0,onChange:a?m=>a(m,h.value):void 0,disabled:l||h.disabled}),f("span",{children:h.label})]},h.value))})]})};var Ea=forwardRef(({label:t,checked:r,defaultChecked:o,onChange:n,disabled:a,name:i,id:s,size:l,sx:d$1,className:p},u)=>{let f$1=d([{...l==="small"?{transform:"scale(.86)",transformOrigin:"center"}:void 0},...Array.isArray(d$1)?d$1:d$1?[d$1]:[]],`orb-sw ${p??""}`),h=f("input",{ref:u,type:"checkbox",role:"switch",id:s,checked:r,defaultChecked:o,onChange:n?m=>n(m,m.target.checked):void 0,disabled:a,name:i});return t==null?f("span",{className:f$1.className,style:f$1.style,children:h}):g("label",{className:f$1.className,style:f$1.style,children:[h,f("span",{children:t})]})});Ea.displayName="CSwitch";var Kg={default:"gray",primary:"blue",success:"blue",info:"blue",warning:"orange",error:"orange"},kt=forwardRef(({label:t,children:r,tone:o,color:n="default",variant:a,size:i="medium",clickable:s,avatar:l,icon:d$1,onDelete:p,onClick:u,sx:f$1,className:h},m)=>{let v=o??(a==="outlined"&&n==="default"?"outline":Kg[n]??"gray"),y=s??!!u,g$1=d([{cursor:y?"pointer":void 0,...i==="small"?{height:24,fontSize:11,px:1}:void 0},...Array.isArray(f$1)?f$1:f$1?[f$1]:[]],`orb-chip orb-chip-${v} ${h??""}`);return g("span",{ref:m,className:g$1.className,style:g$1.style,onClick:u,role:y?"button":void 0,tabIndex:y?0:void 0,onKeyDown:y?x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),u?.(x));}:void 0,children:[l??d$1,f("span",{className:"orb-chip-label",children:r??t}),p&&f("button",{type:"button","aria-label":"Remove",onClick:x=>{x.stopPropagation(),p(x);},style:{background:"none",border:"none",padding:0,display:"inline-flex",cursor:"pointer",color:"inherit"},children:f(Xt,{size:13,strokeWidth:2})})]})});kt.displayName="CChip";var La=forwardRef(({badgeContent:t,color:r="primary",children:o,invisible:n=false,sx:a,className:i},s)=>{let l=d(a,i,{display:"inline-flex",position:o?"relative":void 0}),d$1=!n&&t!==void 0&&t!==null&&f("span",{className:`orb-badge ${r==="error"?"orb-badge-err":r==="muted"?"orb-badge-muted":""}`,style:o?{position:"absolute",top:-6,right:-6,zIndex:1}:void 0,children:t});return o?g("span",{ref:s,className:l.className,style:l.style,children:[o,d$1]}):f("span",{ref:s,className:l.className,style:l.style,children:d$1})});La.displayName="CBadge";var jo=forwardRef(({children:t,src:r,alt:o,size:n=28,sx:a,className:i},s)=>{let l=d([{width:n,height:n,fontSize:n*.4},...Array.isArray(a)?a:a?[a]:[]],`orb-avatar ${i??""}`);return f("span",{ref:s,className:l.className,style:l.style,children:r?f("img",{src:r,alt:o??"",style:{width:"100%",height:"100%",borderRadius:"50%",objectFit:"cover"}}):t})});jo.displayName="CAvatar";var Jo=forwardRef(({severity:t="info",title:r,children:o,onClose:n,sx:a,className:i},s)=>{let l=d(a,`orb-alert orb-alert-${t} ${i??""}`);return g("div",{ref:s,role:"alert",className:l.className,style:l.style,children:[g("div",{style:{flex:1,minWidth:0},children:[r&&f("b",{children:r}),o&&f("span",{children:o})]}),n&&f("button",{type:"button","aria-label":"Close",onClick:n,style:{background:"none",border:"none",padding:0,cursor:"pointer",color:"inherit",font:"500 14px/1 var(--orb-font)",opacity:.7},children:"\u2715"})]})});Jo.displayName="CAlert";var Fn=({value:t,variant:r,color:o,sx:n,className:a})=>{let i=r==="indeterminate"||t===void 0,s=d(n,`orb-prog ${a??""}`);return g("div",{className:s.className,role:"progressbar","aria-valuenow":i?void 0:Math.round(t),"aria-valuemin":i?void 0:0,"aria-valuemax":i?void 0:100,style:s.style,children:[f("i",{style:i?{width:"40%",animation:"orb-prog-ind 1.2s ease-in-out infinite"}:{width:`${Math.min(100,Math.max(0,t))}%`,background:o}}),i&&f("style",{children:"@keyframes orb-prog-ind { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }"})]})},Zg=({width:t,height:r=14,variant:o="rectangular",sx:n,className:a})=>f("div",{className:`orb-skel ${a??""}`,style:{width:t,height:r,borderRadius:o==="circular"?"50%":o==="text"?6:"var(--orb-r)",...n}}),Kr=({size:t=12,onPrimary:r=false,sx:o,className:n})=>f("span",{className:`orb-spin ${r?"orb-spin-light":""} ${n??""}`,style:{width:t,height:t,...o},role:"status","aria-label":"Loading"});var st=({title:t,children:r,enterDelay:o=300,side:n="top",align:a="center",disabled:i})=>!t||i?f(e,{children:r}):f(qr.Provider,{delayDuration:o,skipDelayDuration:200,children:g(qr.Root,{children:[f(qr.Trigger,{asChild:true,children:r}),f(qr.Portal,{children:f(qr.Content,{className:"orb-tooltip",side:n,align:a,sideOffset:6,children:t})})]})});var ne=forwardRef(({tooltip:t,size:r="small",active:o=false,edge:n,color:a,sx:i,className:s,children:l,type:d$1="button",...p},u)=>{let f$1=d([{color:o?"var(--orb-primary)":a,...n==="start"?{marginLeft:-8}:n==="end"?{marginRight:-8}:void 0},...Array.isArray(i)?i:i?[i]:[]],`orb-icon-btn ${r==="small"?"orb-icon-btn-sm":""} ${s??""}`),h=f("button",{ref:u,type:d$1,className:f$1.className,style:f$1.style,...p,children:l});return t?f(st,{title:t,children:h}):h});ne.displayName="CIconButton";var Bn=({value:t,options:r,onValueChange:o,size:n="medium",sx:a,className:i,...s})=>{let l=useRef([]),d$1=r.findIndex(m=>!m.disabled),p=r.findIndex(m=>m.value===t),u=(m,v)=>{let y=r.map((b,C)=>b.disabled?-1:C).filter(b=>b>=0);if(y.length===0)return;let g=y.indexOf(v),x;m.key==="Home"&&(x=y[0]),m.key==="End"&&(x=y[y.length-1]),(m.key==="ArrowRight"||m.key==="ArrowDown")&&(x=y[(g+1+y.length)%y.length]),(m.key==="ArrowLeft"||m.key==="ArrowUp")&&(x=y[(g-1+y.length)%y.length]),x!==void 0&&(m.preventDefault(),l.current[x]?.focus(),o(r[x].value));},f$1=d(a,["orb-segmented-control",n==="small"?"orb-segmented-control-sm":"",i].filter(Boolean).join(" ")),h={...f$1.style,"--orb-segmented-count":Math.max(r.length,1),"--orb-segmented-index":Math.max(p,0)};return g("div",{role:"radiogroup",className:f$1.className,style:h,"data-has-selection":p>=0?"true":"false",...s,children:[f("span",{className:"orb-segmented-control-thumb","aria-hidden":"true"}),r.map((m,v)=>{let y=m.value===t;return f(ne,{ref:g=>{l.current[v]=g;},className:["orb-segmented-control-item",m.icon?"":"orb-segmented-control-item-label"].filter(Boolean).join(" "),size:n,tooltip:m.label,role:"radio","aria-label":m.label,"aria-checked":y,"data-selected":y?"true":void 0,disabled:m.disabled,tabIndex:y||t==null&&v===d$1?0:-1,onClick:()=>o(m.value),onKeyDown:g=>u(g,v),children:m.icon??f("span",{className:"orb-segmented-control-label",children:m.label})},m.value)})]})};var Yt=({triggerLabel:t,items:r=[],trigger:o,align:n="start",anchorEl:a,open:i,onClose:s,children:l,slotProps:d$1,PaperProps:p,anchorPosition:u,sx:f$1})=>{let h=useRef(null);if(useEffect(()=>{if(i!==true)return;let m=y=>{let g=y.composedPath();h.current&&g.includes(h.current)||a&&g.includes(a)||s?.();},v=y=>{y.key==="Escape"&&s?.();};return document.addEventListener("pointerdown",m,true),document.addEventListener("keydown",v,true),()=>{document.removeEventListener("pointerdown",m,true),document.removeEventListener("keydown",v,true);}},[a,s,i]),i!==void 0){if(!i||typeof document>"u")return null;let m=a?.getBoundingClientRect(),v=window.innerWidth,y=m?.left??16,g=m?.right??y,x=d$1?.paper?.sx??p?.sx,b=d([...Array.isArray(x)?x:x?[x]:[],...Array.isArray(f$1)?f$1:f$1?[f$1]:[]],"orb-pop orb-menu",d$1?.paper?.style??p?.style),C=Children.map(l,P=>{if(!isValidElement(P)||P.type!=="option")return P;let S=P.props,{children:k,disabled:I,selected:w}=S,A=d(S.sx,`orb-menu-item ${w?"orb-selected":""} ${S.className??""}`,S.style);return f("div",{role:"menuitem","aria-disabled":I||void 0,"aria-selected":w||void 0,tabIndex:I?-1:0,id:S.id,title:S.title,className:A.className,style:A.style,onClick:I?void 0:S.onClick,onKeyDown:R=>{!I&&(R.key==="Enter"||R.key===" ")&&(R.preventDefault(),S.onClick?.(R));},children:k})});return createPortal(f("div",{ref:h,role:"menu",className:b.className,style:{...b.style,position:"fixed",left:n==="end"&&!u?void 0:u?.left??y,right:n==="end"&&!u?Math.max(16,v-g):void 0,top:u?.top??(m?.bottom??16)+6,maxWidth:"calc(100vw - 32px)",zIndex:1301},children:C}),document.body)}return g(Rr.Root,{children:[f(Rr.Trigger,{asChild:true,children:o??f(ye,{variant:"primary",children:t})}),f(Rr.Portal,{children:f(Rr.Content,{className:"orb-pop orb-menu",align:n,sideOffset:6,children:r.map((m,v)=>g(Rr.Item,{className:"orb-menu-item",disabled:m.disabled,onSelect:()=>m.onClick?.(),children:[m.icon,m.label]},v))})})]})};var Ae=forwardRef(({elevation:t=1,variant:r,component:o,sx:n,style:a,className:i,children:s,...l},d$1)=>{let p=o??"div",u=d(n,`orb-card ${t>0&&r!=="outlined"?"orb-card-raised":""} ${i??""}`,a);return f(p,{ref:d$1,className:u.className,style:u.style,...l,children:s})});Ae.displayName="CPaper";var Nt=forwardRef(({orientation:t="horizontal",flexItem:r,sx:o,className:n},a)=>{let i=d([{...t==="vertical"?{alignSelf:"stretch",height:"auto"}:{width:"100%"},...r?{alignSelf:"stretch"}:void 0},...Array.isArray(o)?o:o?[o]:[]],`${t==="vertical"?"orb-divider-v":"orb-divider"} ${n??""}`);return f("hr",{ref:a,"aria-orientation":t,className:i.className,style:i.style})});Nt.displayName="CDivider";var lf={h1:"orb-h1",h2:"orb-h2",h3:"orb-h3",h4:"orb-h3",h5:"orb-subtitle",h6:"orb-subtitle",subtitle1:"orb-subtitle",subtitle2:"orb-label",body1:"orb-body",body2:"orb-body-dense",label:"orb-label",caption:"orb-meta",overline:"orb-overline"},cf={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6"},E=forwardRef(({variant:t="body1",component:r,muted:o=false,numeric:n=false,color:a,noWrap:i=false,fontWeight:s,sx:l,className:d$1,children:p,...u},f$1)=>{let h=r??cf[t]??"span",v=[t==="inherit"?void 0:lf[t],d$1].filter(Boolean).join(" "),y=d([{...o?{color:"var(--orb-muted)"}:void 0,...a?{color:a}:void 0,...n?{fontVariantNumeric:"tabular-nums"}:void 0,...s?{fontWeight:s}:void 0,...i?{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}:void 0},...Array.isArray(l)?l:l?[l]:[]],v);return f(h,{ref:f$1,className:y.className,style:y.style,...u,children:p})});E.displayName="CTypography";var pf=t=>{if(t!==void 0)return typeof t=="number"?`${t*8}px`:t},ae=forwardRef(({direction:t="column",spacing:r,alignItems:o,justifyContent:n,flexWrap:a,flex:i,useFlexGap:s,sx:l,className:d$1,children:p,...u},f$1)=>{let h=d([{display:"flex",flexDirection:t,gap:pf(r),alignItems:o,justifyContent:n,flexWrap:a,flex:i},...Array.isArray(l)?l:l?[l]:[]],d$1);return f("div",{ref:f$1,className:h.className,style:h.style,...u,children:p})});ae.displayName="CStack";var Ht=({open:t,onClose:r,title:o,children:n,actions:a,maxWidth:i=560,fullWidth:s=false,fullScreen:l=false,PaperProps:d$1,slotProps:p,disableRestoreFocus:u,keepMounted:f$1,hideCloseButton:h=false,sx:m,className:v})=>{let y=d([{width:l?"100vw":s?"min(920px, calc(100vw - 32px))":void 0,height:l?"100vh":void 0,maxWidth:l?"none":typeof i=="number"?`${i}px`:i},...Array.isArray(d$1?.sx??p?.paper?.sx)?d$1?.sx??p?.paper?.sx:d$1?.sx??p?.paper?.sx?[d$1?.sx??p?.paper?.sx]:[],...Array.isArray(m)?m:m?[m]:[]],`orb-dialog ${v??""}`);return f(xr.Root,{open:t,onOpenChange:g=>{g||r?.();},children:g(xr.Portal,{children:[f(xr.Overlay,{className:"orb-overlay"}),g(xr.Content,{className:y.className,style:y.style,children:[(o||!h)&&g("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:16},children:[o?f(xr.Title,{className:"orb-dialog-title",children:o}):f(xr.Title,{className:"orb-visually-hidden",children:"Dialog"}),!h&&f(xr.Close,{asChild:true,children:f("button",{type:"button",className:"orb-icon-btn orb-icon-btn-sm","aria-label":"Close",style:{marginTop:-4,marginRight:-4},children:f(Xt,{size:16,strokeWidth:2})})})]}),f("div",{style:{minWidth:0},children:n}),a&&f("div",{className:"orb-dialog-actions",children:a})]})]})})};var Ns=({open:t,defaultOpen:r,onOpenChange:o,trigger:n,children:a,align:i="start",side:s="bottom",sideOffset:l=6,matchTriggerWidth:d=false,sx:p,className:u})=>g(ho.Root,{open:t,defaultOpen:r,onOpenChange:o,children:[f(ho.Trigger,{asChild:true,children:n}),f(ho.Portal,{children:f(ho.Content,{className:`orb-pop ${u??""}`,align:i,side:s,sideOffset:l,style:{minWidth:d?"var(--radix-popover-trigger-width)":void 0,...p},onOpenAutoFocus:f=>f.preventDefault(),children:a})})]});var gf=({items:t,value:r,defaultValue:o,onChange:n,sx:a,className:i})=>{let s=r!==void 0,[l,d]=useState(o??t[0]?.value),p=s?r:l,u=useRef([]),f$1=m=>{s||d(m),n?.(m);},h=m=>{if(m.key!=="ArrowRight"&&m.key!=="ArrowLeft")return;m.preventDefault();let v=t.filter(b=>!b.disabled),y=v.findIndex(b=>b.value===p),g=m.key==="ArrowRight"?1:-1,x=v[(y+g+v.length)%v.length];if(x){f$1(x.value);let b=t.findIndex(C=>C.value===x.value);u.current[b]?.focus();}};return f("div",{className:`orb-tabs ${i??""}`,role:"tablist",style:a,onKeyDown:h,children:t.map((m,v)=>{let y=m.value===p;return g("button",{ref:g=>{u.current[v]=g;},type:"button",role:"tab","aria-selected":y,disabled:m.disabled,className:`orb-tab ${y?"orb-is-active":""}`,style:{display:"inline-flex",alignItems:"center",gap:6},onClick:()=>f$1(m.value),children:[m.icon,m.label]},m.value)})})};var hf=["su","mo","tu","we","th","fr","sa"],Hn=(t,r)=>!!(t&&r&&t.isSame(r,"day")),zn=({value:t,rangeStart:r,rangeEnd:o,onChange:n,month:a,defaultMonth:i,onMonthChange:s,minDate:l,maxDate:d,locale:p,renderDay:u})=>{let f$1=a!==void 0,[h,m]=useState(()=>i??t??r??eo()),v=(f$1?a:h).startOf("month"),y=S=>{f$1||m(S),s?.(S);},g$1=useMemo(()=>p?v.locale(p):v,[v,p]),x=useMemo(()=>{let k=v.startOf("month").startOf("week"),I=[],w=k;for(let A=0;A<6;A+=1){let R=[];for(let T=0;T<7;T+=1)R.push(w),w=w.add(1,"day");if(I.push(R),w.isAfter(v.endOf("month"))&&A>=3)break}return I},[v]),b=useMemo(()=>{let S=p?eo().locale(p):eo();return hf.map((k,I)=>S.startOf("week").add(I,"day").format("dd"))},[p]),C=S=>!!(l&&S.isBefore(l.startOf("day"))||d&&S.isAfter(d.startOf("day"))),P=r!==void 0||o!==void 0;return g("div",{className:"orb-cal",children:[g("div",{className:"orb-cal-head",children:[f("button",{type:"button",className:"orb-icon-btn orb-icon-btn-sm","aria-label":"Previous month",onClick:()=>y(v.subtract(1,"month")),children:f(Ca,{size:16,strokeWidth:2})}),f("span",{className:"orb-cal-title","aria-live":"polite",children:g$1.format("MMMM YYYY")}),f("button",{type:"button",className:"orb-icon-btn orb-icon-btn-sm","aria-label":"Next month",onClick:()=>y(v.add(1,"month")),children:f(Or,{size:16,strokeWidth:2})})]}),g("div",{className:"orb-cal-grid",role:"grid",children:[b.map((S,k)=>f("span",{className:"orb-cal-dow",children:S},`${S}-${k}`)),x.flat().map(S=>{let k=!S.isSame(v,"month"),I=C(S),w=P?Hn(S,r)||Hn(S,o):Hn(S,t),A=S.isSame(eo(),"day"),R=P&&r&&o&&S.isAfter(r.startOf("day"))&&S.isBefore(o.startOf("day")),T=P&&Hn(S,r)&&!!o,N=P&&Hn(S,o)&&!!r,D=["orb-cal-day",k?"orb-is-outside":void 0,A?"orb-is-today":void 0,w?"orb-is-selected":void 0,R?"orb-is-in-range":void 0,T?"orb-is-range-start":void 0,N?"orb-is-range-end":void 0].filter(Boolean).join(" ");return u?f("span",{className:"orb-cal-day-slot",children:u(S,{outsideCurrentMonth:k,selected:w,today:A,disabled:I})},S.format("YYYY-MM-DD")):f("button",{type:"button",role:"gridcell","aria-selected":w,"aria-current":A?"date":void 0,className:D,disabled:I,onClick:()=>n?.(S),children:S.date()},S.format("YYYY-MM-DD"))})]})]})};eo.extend(bf);var vf=({label:t,value:r,defaultValue:o,onChange:n,minDate:a,maxDate:i,disabled:s,format:l="YYYY-MM-DD",placeholder:d,locale:p,dense:u=false,error:f$1,helperText:h,sx:m,className:v})=>{let y=r!==void 0,[g$1,x]=useState(o??null),b=y?r:g$1,[C,P]=useState(false),[S,k]=useState(null),I=N=>{y||x(N),n?.(N);},w=S??(b?(p?b.locale(p):b).format(l):""),A=()=>{if(S===null)return;let N=S.trim();if(!N)I(null);else {let D=eo(N,l,true);D.isValid()&&!(a&&D.isBefore(a.startOf("day")))&&!(i&&D.isAfter(i.startOf("day")))&&I(D);}k(null);},T=(typeof f$1=="string"?f$1:void 0)??h;return g("div",{className:`orb-fld ${f$1?"orb-is-error":""} ${v??""}`,style:m,children:[t&&f("label",{children:t}),f(Ns,{open:C,onOpenChange:P,trigger:g("div",{className:"orb-inp-adornment-wrap",style:{width:"100%"},children:[f("span",{className:"orb-inp-adornment",children:f(Is,{size:15,strokeWidth:1.8})}),f("input",{className:`orb-inp ${u?"orb-inp-dense":""}`,value:w,placeholder:d??l,disabled:s,onFocus:()=>P(true),onChange:N=>k(N.target.value),onBlur:A,onKeyDown:N=>{N.key==="Enter"&&(A(),P(false)),N.key==="Escape"&&P(false);}})]}),children:f(zn,{value:b,onChange:N=>{I(N),k(null),P(false);},minDate:a,maxDate:i,locale:p,defaultMonth:b??void 0})}),T&&f("span",{className:"orb-fld-msg",children:T})]})};var Cf=({onFilesSelected:t,multiple:r=false,accept:o="*",maxSize:n,title:a="Drag and drop files here or click to upload",subtitle:i="Support for bulk upload",sx:s})=>{let[l,d]=useState(false),[p,u]=useState([]),f$1=useRef(null),h=b=>{b.preventDefault(),d(true);},m=b=>{b.preventDefault(),d(false);},v=b=>{b.preventDefault(),d(false),g$1(Array.from(b.dataTransfer.files));},y=b=>{b.target.files&&g$1(Array.from(b.target.files));},g$1=b=>{let C=n?b.filter(S=>S.size<=n):b;C.length<b.length&&console.warn(`Some files were rejected because they exceed the maximum size of ${n} bytes.`);let P=r?[...p,...C]:C;r&&(P=P.filter((S,k,I)=>k===I.findIndex(w=>w.name===S.name&&w.size===S.size&&w.lastModified===S.lastModified))),u(P),t?.(P),f$1.current&&(f$1.current.value="");},x=b=>{let C=p.filter((P,S)=>S!==b);u(C),t?.(C);};return g("div",{style:{width:"100%",...s},children:[g("div",{onClick:()=>f$1.current?.click(),onDragOver:h,onDragLeave:m,onDrop:v,role:"button",tabIndex:0,onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),f$1.current?.click());},style:{border:`2px dashed ${l?"var(--orb-primary)":"var(--orb-border)"}`,borderRadius:"var(--orb-r)",padding:32,textAlign:"center",cursor:"pointer",backgroundColor:l?"var(--orb-hover)":"var(--orb-canvas)",transition:"border-color var(--orb-t-fast), background-color var(--orb-t-fast)"},children:[f("input",{type:"file",ref:f$1,style:{display:"none"},multiple:r,accept:o,onChange:y}),g("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"center"},children:[f(Ec,{size:40,strokeWidth:1.5,color:l?"var(--orb-primary)":"var(--orb-muted)"}),f("span",{className:"orb-subtitle",children:a}),f("span",{className:"orb-meta",children:i})]})]}),p.length>0&&f("div",{style:{display:"flex",flexDirection:"column",gap:8,marginTop:16},children:p.map((b,C)=>g("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",border:"1px solid var(--orb-border)",borderRadius:"var(--orb-r)",backgroundColor:"var(--orb-surface)"},children:[g("div",{style:{display:"flex",alignItems:"center",gap:8,overflow:"hidden"},children:[f(fc,{size:16,strokeWidth:1.8,color:"var(--orb-muted)"}),f("span",{className:"orb-body-dense",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:b.name}),g("span",{className:"orb-meta",children:["(",(b.size/1024).toFixed(1)," KB)"]})]}),f(ne,{"aria-label":`Remove ${b.name}`,onClick:()=>x(C),children:f(Nc,{size:15,strokeWidth:1.8})})]},`${b.name}-${C}`))})]})};function mr(...t){return twMerge(clsx(t))}var Fa={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"},Vn={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",full:"rounded-full"},Hc=()=>"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 Pf=cva(Hc(),{variants:{variant:{default:`${Fa.primary} shadow-sm`,destructive:"bg-[var(--orb-status-error)] text-[var(--orb-on-primary)] hover:opacity-90 active:opacity-80 shadow-sm",outline:`${Fa.outline} shadow-sm`,secondary:"bg-[var(--orb-surface-2)] text-[var(--orb-fg)] hover:bg-[var(--orb-hover)] active:bg-[var(--orb-selected)] shadow-sm",ghost:Fa.ghost,link:"text-[var(--orb-status-primary)] underline-offset-4 hover:underline hover:text-[var(--orb-status-primary)] active:text-[var(--orb-p700)]","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-[var(--orb-primary)] hover:bg-[var(--orb-p600)] text-[var(--orb-on-primary)] 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-[var(--orb-status-error)] hover:opacity-90 border border-[var(--orbai-border-strong)] shadow-[var(--orbai-shadow-soft-sm)] hover:shadow-[var(--orbai-shadow-soft-md)] active:scale-95 text-[var(--orb-on-primary)] 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:Vn.none,sm:Vn.sm,md:Vn.md,full:Vn.full}},defaultVariants:{variant:"default",size:"default",rounded:"md"}}),Ls=Qt.forwardRef(({className:t,variant:r,size:o,asChild:n=false,...a},i)=>f(n?Slot:"button",{className:mr(Pf({variant:r,size:o,className:t})),ref:i,...a}));Ls.displayName="Button";var Tf={"common.cancel":"Cancel","common.save":"Save","common.ok":"OK","common.done":"Done","common.search":"Search","common.none":"None","common.all":"All","common.noData":"No data","common.copy":"Copy","common.delete":"Delete","common.loading":"Loading...","header.searchPlaceholder":"Ask me...","header.searchAddFeature":"Add feature","header.searchSend":"Send","header.searchStartVoice":"Start voice input","header.searchStopVoice":"Stop voice input","header.theme.system":"Theme: System","header.theme.dark":"Theme: Dark","header.theme.light":"Theme: Light","header.menu.setting":"Setting","header.menu.refresh":"Refresh","header.menu.logout":"Logout","navigation.expand":"Expand navigation","navigation.collapse":"Collapse navigation","navigation.searchPlaceholder":"Search menu...","navigation.noMatch":"No matching menu items","navigation.noAccessibleApp":"No accessible applications","navigation.noItems":"No items to display","navigation.expandView":"Expand {title}","navigation.mode.switchToFixed":"Switch to fixed navigation","navigation.mode.switchToFloating":"Switch to floating navigation","navigation.pinned":"Pinned","navigation.pin.add":"Pin to top","navigation.pin.remove":"Unpin","table.toolbar.searchPlaceholder":"Search...","table.title.default":"Data Table","table.toolbar.groupBy":"Group By","table.toolbar.summary":"Summary","table.toolbar.columns":"Columns","table.toolbar.export":"Export","table.toolbar.itemsPerPage":"Items per page:","table.toolbar.pageOf":"Page {current} of {total}","table.toolbar.newItem":"New Item","table.toolbar.editItem":"Edit Item","table.toolbar.deleteItem":"Delete Item","table.toolbar.graphicReport":"Graphic Report","table.toolbar.saveLayout":"Save Layout","table.menu.groupBy":"Group By","table.menu.clearAll":"Clear All","table.menu.visibleColumns":"Visible Columns","table.menu.showSummaryRow":"Show Summary Row","table.menu.noNumericColumns":"No numeric columns","table.group.expandAll":"Expand All Groups","table.group.collapseAll":"Collapse All Groups","table.mobile.notImplemented":"Mobile View Not Implemented","table.headerMenu.sortAsc":"Sort Ascending","table.headerMenu.sortDesc":"Sort Descending","table.headerMenu.clearSort":"Clear Sort","table.headerMenu.configureSort":"Configure Sort...","table.headerMenu.group":"Group by this column","table.headerMenu.ungroup":"Remove from grouping","table.headerMenu.addSummary":"Include in Summary","table.headerMenu.removeSummary":"Remove from Summary","table.headerMenu.hideColumn":"Hide Column","table.sortDialog.title":"Sort Settings","table.sortDialog.empty":"No sort rules. Add one to start ordering rows.","table.sortDialog.addRule":"Add Sort Rule","table.sortDialog.clearAll":"Clear All","table.sortDialog.asc":"Ascending","table.sortDialog.desc":"Descending","pivot.title.default":"Pivot Table Builder","pivot.subtitle.default":"Drag fields to configure the pivot table.","pivot.empty":"Drag at least one field into Values to render the pivot result.","pivot.records":"Records","pivot.afterFilter":"After filter","pivot.grandTotal":"Grand Total","pivot.resultLabel":"Result","pivot.valueLabel":"Value","pivot.table.dimensions":"Dimensions","pivot.config.title":"Configuration","pivot.fieldList":"Field List","pivot.availableDimensions":"Available dimensions","pivot.allFieldsInUse":"All fields are in use.","pivot.zone.rows":"Rows","pivot.zone.columns":"Columns","pivot.zone.filters":"Filters","pivot.zone.values":"Values","pivot.hint.rows":"Drag fields here to build row hierarchy","pivot.hint.columns":"Drag fields here to build column hierarchy","pivot.hint.filters":"Drag fields here for report filters","pivot.hint.values":"Drag numeric fields here for aggregation","pivot.clearArea":"Clear area","pivot.filter.na":"N/A","pivot.filter.noValues":"No values","pivot.filter.noneSelected":"None selected","pivot.filter.allValues":"All values","pivot.filter.selectedCount":"{selected} / {total} selected","pivot.filter.selectAll":"Select All","pivot.filter.deselectAll":"Deselect All","pivot.filter.noResults":"No results","pivot.collapse.ariaExpand":"Expand configuration area","pivot.collapse.ariaCollapse":"Collapse configuration area","pivot.agg.sum":"Sum","pivot.agg.count":"Count","pivot.agg.avg":"Average","pivot.agg.min":"Min","pivot.agg.max":"Max","pivot.preset.selectPlaceholder":"Select preset","pivot.preset.save":"Save preset","pivot.preset.delete":"Delete preset","pivot.preset.saveDialogTitle":"Save current preset","pivot.preset.nameLabel":"Preset name","pivot.preset.defaultName":"Preset {index}","pivot.table.sectionTitle":"Pivot Result","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"Expand pivot result","pivot.table.collapse.ariaCollapse":"Collapse pivot result","pivot.chart.title":"Pivot Chart","pivot.chart.subtitle":"Map one dimension and up to two measures into a compact chart.","pivot.chart.subtitleReady":"{dimension} by {measure}","pivot.chart.emptyNoDimension":"Add at least one row or column field to render the chart.","pivot.chart.emptyNoValue":"Add at least one value field to render the chart.","pivot.chart.emptyNoData":"No data available for the current chart selection.","pivot.chart.dimension":"Dimension","pivot.chart.primaryMeasure":"Measure","pivot.chart.secondaryMeasure":"Compare measure","pivot.chart.chartType":"Chart type","pivot.chart.style.barVertical":"Vertical bars","pivot.chart.style.barHorizontal":"Horizontal bars","pivot.chart.style.line":"Line","pivot.chart.style.scatter":"Scatter","pivot.chart.collapse.ariaExpand":"Expand chart area","pivot.chart.collapse.ariaCollapse":"Collapse chart area","smartFilter.adaptFilters":"Adapt Filters","smartFilter.addFilters":"Add Filters","smartFilter.go":"Go","smartFilter.visibleFilters":"Visible Filters","smartFilter.searchPlaceholder":"Search...","smartFilter.noOptionsFound":"No options found","smartFilter.min":"Min","smartFilter.max":"Max","smartFilter.minMaxPlaceholder":"Min - Max","smartFilter.operator.equals":"Equals","smartFilter.operator.contains":"Contains","smartFilter.operator.notContains":"Does Not Contain","smartFilter.operator.wildcard":"Wildcard Search","smartFilter.operator.notEquals":"Not Equals","smartFilter.operator.greaterThan":"Greater Than","smartFilter.operator.lessThan":"Less Than","smartFilter.operator.greaterOrEqual":"Greater Than or Equal","smartFilter.operator.lessOrEqual":"Less Than or Equal","smartFilter.operator.between":"Between","variant.noOptions":"No options","variant.defaultSuffix":"Default","variant.selectVariant":"Select Variant","variant.saveView":"Save View","variant.newVariant":"New Variant","variant.viewName":"View Name","variant.setDefault":"Set as Default","variant.publicAllUsers":"Public (All Users)","variant.toast.fetchFailed":"Failed to load variants","variant.toast.saveFailed":"Failed to save variant","variant.toast.saveSuccess":"Variant saved successfully","variant.toast.deleteFailed":"Failed to delete variant","variant.toast.deleteSuccess":"Variant deleted successfully","variant.toast.defaultFailed":"Failed to update default variant","variant.toast.defaultSuccess":"Default variant updated","layout.saveLayout":"Save Layout","layout.layoutOptions":"Layout Options","layout.selectLayout":"Select Layout","layout.saveCurrentLayout":"Save Current Layout...","layout.noSavedLayouts":"No saved layouts","layout.removeDefault":"Remove Default","layout.setAsDefault":"Set as Default","layout.layoutName":"Layout Name","layout.layoutDescription":"Description","layout.layoutNameHelper":"e.g., 'Compact View'","layout.warningOverwrite":"Warning: Existing layout will be overwritten","layout.useAsDefault":"Use as Default Layout","layout.publicAllUsers":"Public (Visible to all users)","layout.toast.loadFallback":"Failed to load layouts from backend, fallback to local storage","layout.toast.saveSuccess":"Layout saved successfully","layout.toast.saveLocalSuccess":"Layout saved to local storage","layout.toast.backendUnavailableSavedLocal":"Backend unavailable, saved to local storage","layout.toast.deleteSuccess":"Layout deleted successfully","layout.toast.deleteLocalSuccess":"Layout deleted from local storage","layout.toast.backendUnavailableDeletedLocal":"Backend unavailable, deleted from local storage","layout.toast.defaultSuccess":"Default layout set","layout.toast.defaultLocalSuccess":"Default layout set in local storage","layout.toast.backendUnavailableDefaultLocal":"Backend unavailable, default saved to local storage","dateRange.label":"Date Range","dateRange.startDate":"Start Date","dateRange.endDate":"End Date","dateRange.select":"Select...","dateRange.today":"Today","dateRange.thisWeek":"This Week","dateRange.thisMonth":"This Month","graph.records":"{count} records","graph.kpi.totalRecords":"Total Records","graph.kpi.totalReport":"Total Report","graph.kpi.totalBillable":"Total Billable","graph.kpi.efficiency":"Efficiency","graph.kpi.amount":"Amount","graph.kpi.flagged":"Flagged","graph.chart.billable.title":"Billable by Dimension","graph.chart.billable.subtitle":"Top values by billable hours","graph.chart.efficiency.title":"Efficiency by Person","graph.chart.efficiency.subtitle":"Lowest efficiency first","graph.chart.status.title":"Status Distribution","graph.chart.status.subtitle":"Record ratio by status","graph.dataBody":"Data Body","graph.reportTitle":"Graphic Report","graph.unassigned":"Unassigned","graph.column.reportHours":"Report Hours","graph.column.billableHours":"Billable Hours","detail.searchAi.placeholder":"Search fields, or ask AI if no match...","detail.searchAi.matches":"{count} matches found","detail.searchAi.noMatch":"No matching field found.","detail.searchAi.autoAiFallback":"No direct match. Triggering AI analysis...","detail.searchAi.aiResultTitle":"AI Insight","detail.table.title":"Related Records","kanban.empty":"Drop cards here","kanban.bucket.limit":"Limit","kanban.bucket.dropHere":"Release to move into this bucket","kanban.bucket.add":"Add bucket","kanban.bucket.rename":"Rename bucket","kanban.bucket.saveRename":"Save bucket name","kanban.bucket.cancelRename":"Cancel renaming","kanban.search.placeholder":"Search cards and buckets","kanban.search.clear":"Clear search","kanban.search.results":"{count} matching cards","kanban.search.noMatch":"No matching cards","kanban.card.progress":"Progress","kanban.card.openDetail":"Open Detail","kanban.priority.critical":"Critical","kanban.priority.high":"High","kanban.priority.medium":"Medium","kanban.priority.low":"Low","quickCreate.newItem":"New Item","quickCreate.createWithTitle":"Create {title}","quickEdit.editWithTitle":"Edit {title}","quickDelete.confirmTitle":"Confirm Delete","quickDelete.confirmMessageSingle":"Are you sure you want to delete the selected record?","quickDelete.confirmMessageMultiple":"Are you sure you want to delete {count} selected records?","cardPage.viewDetails":"View Details","cardPage.download":"Download","cardPage.close":"Close","cardPage.empty":"No items found","messageBox.confirm":"OK","messageBox.cancel":"Cancel"},If={"common.cancel":"\u53D6\u6D88","common.save":"\u4FDD\u5B58","common.ok":"\u786E\u5B9A","common.done":"\u5B8C\u6210","common.search":"\u641C\u7D22","common.none":"\u65E0","common.all":"\u5168\u90E8","common.noData":"\u6682\u65E0\u6570\u636E","common.copy":"\u590D\u5236","common.delete":"\u5220\u9664","common.loading":"\u52A0\u8F7D\u4E2D...","header.searchPlaceholder":"\u95EE\u6211\u70B9\u4EC0\u4E48...","header.searchAddFeature":"\u589E\u52A0\u529F\u80FD","header.searchSend":"\u53D1\u9001","header.searchStartVoice":"\u5F00\u59CB\u8BED\u97F3\u8F93\u5165","header.searchStopVoice":"\u505C\u6B62\u8BED\u97F3\u8F93\u5165","header.theme.system":"\u4E3B\u9898\uFF1A\u8DDF\u968F\u7CFB\u7EDF","header.theme.dark":"\u4E3B\u9898\uFF1A\u6DF1\u8272","header.theme.light":"\u4E3B\u9898\uFF1A\u6D45\u8272","header.menu.setting":"\u8BBE\u7F6E","header.menu.refresh":"\u5237\u65B0","header.menu.logout":"\u6CE8\u9500","navigation.expand":"\u5C55\u5F00\u5BFC\u822A","navigation.collapse":"\u6298\u53E0\u5BFC\u822A","navigation.searchPlaceholder":"\u641C\u7D22\u83DC\u5355...","navigation.noMatch":"\u672A\u627E\u5230\u5339\u914D\u7684\u83DC\u5355\u9879","navigation.noAccessibleApp":"\u6682\u65E0\u53EF\u8BBF\u95EE\u7684\u5E94\u7528","navigation.noItems":"\u6682\u65E0\u53EF\u663E\u793A\u9879","navigation.expandView":"\u5C55\u5F00\u67E5\u770B {title}","navigation.mode.switchToFixed":"\u5207\u6362\u4E3A\u56FA\u5B9A\u5BFC\u822A","navigation.mode.switchToFloating":"\u5207\u6362\u4E3A\u60AC\u6D6E\u5BFC\u822A","navigation.pinned":"\u5DF2\u56FA\u5B9A","navigation.pin.add":"\u56FA\u5B9A\u5230\u9876\u90E8","navigation.pin.remove":"\u53D6\u6D88\u56FA\u5B9A","table.toolbar.searchPlaceholder":"\u641C\u7D22...","table.title.default":"\u6570\u636E\u8868","table.toolbar.groupBy":"\u5206\u7EC4","table.toolbar.summary":"\u6C47\u603B","table.toolbar.columns":"\u5217","table.toolbar.export":"\u5BFC\u51FA","table.toolbar.itemsPerPage":"\u6BCF\u9875\u6761\u6570\uFF1A","table.toolbar.pageOf":"\u7B2C {current} / {total} \u9875","table.toolbar.newItem":"\u65B0\u5EFA\u6761\u76EE","table.toolbar.editItem":"\u7F16\u8F91\u6761\u76EE","table.toolbar.deleteItem":"\u5220\u9664\u6761\u76EE","table.toolbar.graphicReport":"\u56FE\u8868\u62A5\u8868","table.toolbar.saveLayout":"\u4FDD\u5B58\u5E03\u5C40","table.menu.groupBy":"\u5206\u7EC4","table.menu.clearAll":"\u6E05\u7A7A","table.menu.visibleColumns":"\u53EF\u89C1\u5217","table.menu.showSummaryRow":"\u663E\u793A\u6C47\u603B\u884C","table.menu.noNumericColumns":"\u6CA1\u6709\u6570\u503C\u5217","table.group.expandAll":"\u5C55\u5F00\u5168\u90E8\u5206\u7EC4","table.group.collapseAll":"\u6298\u53E0\u5168\u90E8\u5206\u7EC4","table.mobile.notImplemented":"\u79FB\u52A8\u7AEF\u89C6\u56FE\u6682\u672A\u5B9E\u73B0","table.headerMenu.sortAsc":"\u5347\u5E8F\u6392\u5217","table.headerMenu.sortDesc":"\u964D\u5E8F\u6392\u5217","table.headerMenu.clearSort":"\u6E05\u9664\u6392\u5E8F","table.headerMenu.configureSort":"\u6392\u5E8F\u8BBE\u7F6E...","table.headerMenu.group":"\u6309\u6B64\u5217\u5206\u7EC4","table.headerMenu.ungroup":"\u53D6\u6D88\u5206\u7EC4","table.headerMenu.addSummary":"\u52A0\u5165\u6C47\u603B","table.headerMenu.removeSummary":"\u4ECE\u6C47\u603B\u4E2D\u79FB\u9664","table.headerMenu.hideColumn":"\u9690\u85CF\u8BE5\u5217","table.sortDialog.title":"\u6392\u5E8F\u8BBE\u7F6E","table.sortDialog.empty":"\u6682\u65E0\u6392\u5E8F\u89C4\u5219\uFF0C\u8BF7\u6DFB\u52A0\u89C4\u5219\u8FDB\u884C\u6392\u5E8F\u3002","table.sortDialog.addRule":"\u6DFB\u52A0\u6392\u5E8F\u89C4\u5219","table.sortDialog.clearAll":"\u6E05\u7A7A\u89C4\u5219","table.sortDialog.asc":"\u5347\u5E8F","table.sortDialog.desc":"\u964D\u5E8F","pivot.title.default":"\u6570\u636E\u900F\u89C6\u8868","pivot.subtitle.default":"\u62D6\u62FD\u5B57\u6BB5\u4EE5\u914D\u7F6E\u900F\u89C6\u8868\u3002","pivot.empty":"\u8BF7\u81F3\u5C11\u62D6\u5165\u4E00\u4E2A\u503C\u5B57\u6BB5\u540E\u518D\u67E5\u770B\u900F\u89C6\u7ED3\u679C\u3002","pivot.records":"\u8BB0\u5F55\u6570","pivot.afterFilter":"\u7B5B\u9009\u540E","pivot.grandTotal":"\u603B\u8BA1","pivot.resultLabel":"\u7ED3\u679C","pivot.valueLabel":"\u503C","pivot.table.dimensions":"\u7EF4\u5EA6","pivot.config.title":"\u5E03\u5C40\u914D\u7F6E","pivot.fieldList":"\u5B57\u6BB5\u5217\u8868","pivot.availableDimensions":"\u53EF\u7528\u7EF4\u5EA6","pivot.allFieldsInUse":"\u6240\u6709\u5B57\u6BB5\u90FD\u5DF2\u4F7F\u7528\u3002","pivot.zone.rows":"\u884C","pivot.zone.columns":"\u5217","pivot.zone.filters":"\u7B5B\u9009","pivot.zone.values":"\u503C","pivot.hint.rows":"\u5C06\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u6784\u5EFA\u884C\u5C42\u7EA7","pivot.hint.columns":"\u5C06\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u6784\u5EFA\u5217\u5C42\u7EA7","pivot.hint.filters":"\u5C06\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u4F5C\u4E3A\u62A5\u8868\u7B5B\u9009","pivot.hint.values":"\u5C06\u6570\u503C\u5B57\u6BB5\u62D6\u5230\u8FD9\u91CC\u8FDB\u884C\u805A\u5408","pivot.clearArea":"\u6E05\u7A7A\u533A\u57DF","pivot.filter.na":"\u4E0D\u53EF\u7528","pivot.filter.noValues":"\u65E0\u53EF\u9009\u503C","pivot.filter.noneSelected":"\u672A\u9009\u62E9","pivot.filter.allValues":"\u5168\u90E8\u503C","pivot.filter.selectedCount":"\u5DF2\u9009 {selected} / {total}","pivot.filter.selectAll":"\u5168\u9009","pivot.filter.deselectAll":"\u53D6\u6D88\u5168\u9009","pivot.filter.noResults":"\u65E0\u5339\u914D\u7ED3\u679C","pivot.collapse.ariaExpand":"\u5C55\u5F00\u914D\u7F6E\u533A\u57DF","pivot.collapse.ariaCollapse":"\u6298\u53E0\u914D\u7F6E\u533A\u57DF","pivot.agg.sum":"\u6C42\u548C","pivot.agg.count":"\u8BA1\u6570","pivot.agg.avg":"\u5E73\u5747\u503C","pivot.agg.min":"\u6700\u5C0F\u503C","pivot.agg.max":"\u6700\u5927\u503C","pivot.preset.selectPlaceholder":"\u9009\u62E9\u65B9\u6848","pivot.preset.save":"\u4FDD\u5B58\u65B9\u6848","pivot.preset.delete":"\u5220\u9664\u65B9\u6848","pivot.preset.saveDialogTitle":"\u4FDD\u5B58\u5F53\u524D\u65B9\u6848","pivot.preset.nameLabel":"\u65B9\u6848\u540D\u79F0","pivot.preset.defaultName":"\u65B9\u6848 {index}","pivot.table.sectionTitle":"\u900F\u89C6\u7ED3\u679C","pivot.table.expandRowsAll":"\u884C\u5168\u90E8\u6253\u5F00","pivot.table.collapseRowsAll":"\u884C\u5168\u90E8\u6298\u53E0","pivot.table.expandColumnsAll":"\u5217\u5168\u90E8\u6253\u5F00","pivot.table.collapseColumnsAll":"\u5217\u5168\u90E8\u6298\u53E0","pivot.table.collapse.ariaExpand":"\u5C55\u5F00\u900F\u89C6\u7ED3\u679C","pivot.table.collapse.ariaCollapse":"\u6298\u53E0\u900F\u89C6\u7ED3\u679C","pivot.chart.title":"\u900F\u89C6\u56FE\u8868","pivot.chart.subtitle":"\u5C06\u4E00\u4E2A\u7EF4\u5EA6\u4E0E\u6700\u591A\u4E24\u4E2A\u5EA6\u91CF\u6620\u5C04\u4E3A\u7D27\u51D1\u56FE\u8868\u3002","pivot.chart.subtitleReady":"{dimension} \xB7 {measure}","pivot.chart.emptyNoDimension":"\u8BF7\u81F3\u5C11\u653E\u5165\u4E00\u4E2A\u884C\u6216\u5217\u5B57\u6BB5\u540E\u518D\u67E5\u770B\u56FE\u8868\u3002","pivot.chart.emptyNoValue":"\u8BF7\u81F3\u5C11\u653E\u5165\u4E00\u4E2A\u503C\u5B57\u6BB5\u540E\u518D\u67E5\u770B\u56FE\u8868\u3002","pivot.chart.emptyNoData":"\u5F53\u524D\u56FE\u8868\u9009\u62E9\u4E0B\u6682\u65E0\u53EF\u5C55\u793A\u6570\u636E\u3002","pivot.chart.dimension":"\u56FE\u8868\u7EF4\u5EA6","pivot.chart.primaryMeasure":"\u4E3B\u5EA6\u91CF","pivot.chart.secondaryMeasure":"\u5BF9\u6BD4\u5EA6\u91CF","pivot.chart.chartType":"\u56FE\u8868\u7C7B\u578B","pivot.chart.style.barVertical":"\u7EB5\u5411\u67F1\u72B6\u56FE","pivot.chart.style.barHorizontal":"\u6A2A\u5411\u67F1\u72B6\u56FE","pivot.chart.style.line":"\u6298\u7EBF\u56FE","pivot.chart.style.scatter":"\u6563\u70B9\u56FE","pivot.chart.collapse.ariaExpand":"\u5C55\u5F00\u56FE\u8868\u533A\u57DF","pivot.chart.collapse.ariaCollapse":"\u6298\u53E0\u56FE\u8868\u533A\u57DF","smartFilter.adaptFilters":"\u7B5B\u9009\u8BBE\u7F6E","smartFilter.addFilters":"\u6DFB\u52A0\u7B5B\u9009","smartFilter.go":"\u6267\u884C","smartFilter.visibleFilters":"\u53EF\u89C1\u7B5B\u9009\u9879","smartFilter.searchPlaceholder":"\u641C\u7D22...","smartFilter.noOptionsFound":"\u672A\u627E\u5230\u9009\u9879","smartFilter.min":"\u6700\u5C0F\u503C","smartFilter.max":"\u6700\u5927\u503C","smartFilter.minMaxPlaceholder":"\u6700\u5C0F\u503C - \u6700\u5927\u503C","smartFilter.operator.equals":"\u7B49\u4E8E","smartFilter.operator.contains":"\u5305\u542B","smartFilter.operator.notContains":"\u4E0D\u5305\u542B","smartFilter.operator.wildcard":"\u901A\u914D\u7B26\u641C\u7D22","smartFilter.operator.notEquals":"\u4E0D\u7B49\u4E8E","smartFilter.operator.greaterThan":"\u5927\u4E8E","smartFilter.operator.lessThan":"\u5C0F\u4E8E","smartFilter.operator.greaterOrEqual":"\u5927\u4E8E\u7B49\u4E8E","smartFilter.operator.lessOrEqual":"\u5C0F\u4E8E\u7B49\u4E8E","smartFilter.operator.between":"\u533A\u95F4","variant.noOptions":"\u65E0\u9009\u9879","variant.defaultSuffix":"\u9ED8\u8BA4","variant.selectVariant":"\u9009\u62E9\u89C6\u56FE","variant.saveView":"\u4FDD\u5B58\u89C6\u56FE","variant.newVariant":"\u65B0\u89C6\u56FE","variant.viewName":"\u89C6\u56FE\u540D\u79F0","variant.setDefault":"\u8BBE\u4E3A\u9ED8\u8BA4","variant.publicAllUsers":"\u516C\u5F00\uFF08\u6240\u6709\u7528\u6237\uFF09","variant.toast.fetchFailed":"\u52A0\u8F7D\u89C6\u56FE\u5931\u8D25","variant.toast.saveFailed":"\u4FDD\u5B58\u89C6\u56FE\u5931\u8D25","variant.toast.saveSuccess":"\u89C6\u56FE\u4FDD\u5B58\u6210\u529F","variant.toast.deleteFailed":"\u5220\u9664\u89C6\u56FE\u5931\u8D25","variant.toast.deleteSuccess":"\u89C6\u56FE\u5220\u9664\u6210\u529F","variant.toast.defaultFailed":"\u66F4\u65B0\u9ED8\u8BA4\u89C6\u56FE\u5931\u8D25","variant.toast.defaultSuccess":"\u9ED8\u8BA4\u89C6\u56FE\u5DF2\u66F4\u65B0","layout.saveLayout":"\u4FDD\u5B58\u5E03\u5C40","layout.layoutOptions":"\u5E03\u5C40\u9009\u9879","layout.selectLayout":"\u9009\u62E9\u5E03\u5C40","layout.saveCurrentLayout":"\u4FDD\u5B58\u5F53\u524D\u5E03\u5C40...","layout.noSavedLayouts":"\u6682\u65E0\u5DF2\u4FDD\u5B58\u5E03\u5C40","layout.removeDefault":"\u53D6\u6D88\u9ED8\u8BA4","layout.setAsDefault":"\u8BBE\u4E3A\u9ED8\u8BA4","layout.layoutName":"\u5E03\u5C40\u540D\u79F0","layout.layoutDescription":"\u63CF\u8FF0","layout.layoutNameHelper":"\u4F8B\u5982\uFF1A\u7D27\u51D1\u89C6\u56FE","layout.warningOverwrite":"\u8B66\u544A\uFF1A\u5C06\u8986\u76D6\u540C\u540D\u5E03\u5C40","layout.useAsDefault":"\u7528\u4F5C\u9ED8\u8BA4\u5E03\u5C40","layout.publicAllUsers":"\u516C\u5F00\uFF08\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09","layout.toast.loadFallback":"\u540E\u7AEF\u52A0\u8F7D\u5E03\u5C40\u5931\u8D25\uFF0C\u5DF2\u56DE\u9000\u5230\u672C\u5730\u5B58\u50A8","layout.toast.saveSuccess":"\u5E03\u5C40\u4FDD\u5B58\u6210\u529F","layout.toast.saveLocalSuccess":"\u5E03\u5C40\u5DF2\u4FDD\u5B58\u5230\u672C\u5730\u5B58\u50A8","layout.toast.backendUnavailableSavedLocal":"\u540E\u7AEF\u4E0D\u53EF\u7528\uFF0C\u5DF2\u4FDD\u5B58\u5230\u672C\u5730\u5B58\u50A8","layout.toast.deleteSuccess":"\u5E03\u5C40\u5220\u9664\u6210\u529F","layout.toast.deleteLocalSuccess":"\u5E03\u5C40\u5DF2\u4ECE\u672C\u5730\u5B58\u50A8\u5220\u9664","layout.toast.backendUnavailableDeletedLocal":"\u540E\u7AEF\u4E0D\u53EF\u7528\uFF0C\u5DF2\u4ECE\u672C\u5730\u5B58\u50A8\u5220\u9664","layout.toast.defaultSuccess":"\u9ED8\u8BA4\u5E03\u5C40\u5DF2\u8BBE\u7F6E","layout.toast.defaultLocalSuccess":"\u9ED8\u8BA4\u5E03\u5C40\u5DF2\u5728\u672C\u5730\u5B58\u50A8\u8BBE\u7F6E","layout.toast.backendUnavailableDefaultLocal":"\u540E\u7AEF\u4E0D\u53EF\u7528\uFF0C\u9ED8\u8BA4\u5E03\u5C40\u5DF2\u4FDD\u5B58\u5230\u672C\u5730\u5B58\u50A8","dateRange.label":"\u65E5\u671F\u8303\u56F4","dateRange.startDate":"\u5F00\u59CB\u65E5\u671F","dateRange.endDate":"\u7ED3\u675F\u65E5\u671F","dateRange.select":"\u8BF7\u9009\u62E9...","dateRange.today":"\u4ECA\u5929","dateRange.thisWeek":"\u672C\u5468","dateRange.thisMonth":"\u672C\u6708","graph.records":"{count} \u6761\u8BB0\u5F55","graph.kpi.totalRecords":"\u603B\u8BB0\u5F55\u6570","graph.kpi.totalReport":"\u603B\u7533\u62A5\u5DE5\u65F6","graph.kpi.totalBillable":"\u603B\u53EF\u8BA1\u8D39\u5DE5\u65F6","graph.kpi.efficiency":"\u6548\u7387","graph.kpi.amount":"\u91D1\u989D","graph.kpi.flagged":"\u6807\u8BB0","graph.chart.billable.title":"\u7EF4\u5EA6\u8BA1\u8D39\u5DE5\u65F6","graph.chart.billable.subtitle":"\u6309\u53EF\u8BA1\u8D39\u5DE5\u65F6\u6392\u5E8F\u524D\u5217","graph.chart.efficiency.title":"\u4EBA\u5458\u6548\u7387","graph.chart.efficiency.subtitle":"\u6309\u6700\u4F4E\u6548\u7387\u4F18\u5148","graph.chart.status.title":"\u72B6\u6001\u5206\u5E03","graph.chart.status.subtitle":"\u6309\u72B6\u6001\u8BB0\u5F55\u5360\u6BD4","graph.dataBody":"\u6570\u636E\u660E\u7EC6","graph.reportTitle":"\u56FE\u8868\u62A5\u8868","graph.unassigned":"\u672A\u5206\u914D","graph.column.reportHours":"\u7533\u62A5\u5DE5\u65F6","graph.column.billableHours":"\u53EF\u8BA1\u8D39\u5DE5\u65F6","detail.searchAi.placeholder":"\u641C\u7D22\u5B57\u6BB5\uFF1B\u5982\u65E0\u7ED3\u679C\u5219\u81EA\u52A8\u89E6\u53D1 AI...","detail.searchAi.matches":"{count} \u6761\u5339\u914D\u7ED3\u679C","detail.searchAi.noMatch":"\u672A\u627E\u5230\u5339\u914D\u5B57\u6BB5\u3002","detail.searchAi.autoAiFallback":"\u672A\u547D\u4E2D\u5B57\u6BB5\uFF0C\u6B63\u5728\u89E6\u53D1 AI \u5206\u6790...","detail.searchAi.aiResultTitle":"AI \u5206\u6790\u7ED3\u679C","detail.table.title":"\u5173\u8054\u8BB0\u5F55","kanban.empty":"\u5C06\u5361\u7247\u62D6\u5230\u8FD9\u91CC","kanban.bucket.limit":"\u4E0A\u9650","kanban.bucket.dropHere":"\u91CA\u653E\u540E\u79FB\u52A8\u5230\u8BE5 bucket","kanban.bucket.add":"\u65B0\u589E bucket","kanban.bucket.rename":"\u91CD\u547D\u540D bucket","kanban.bucket.saveRename":"\u4FDD\u5B58 bucket \u540D\u79F0","kanban.bucket.cancelRename":"\u53D6\u6D88\u91CD\u547D\u540D","kanban.search.placeholder":"\u641C\u7D22\u5361\u7247\u548C bucket","kanban.search.clear":"\u6E05\u9664\u641C\u7D22","kanban.search.results":"{count} \u5F20\u5339\u914D\u5361\u7247","kanban.search.noMatch":"\u6CA1\u6709\u5339\u914D\u7684\u5361\u7247","kanban.card.progress":"\u8FDB\u5EA6","kanban.card.openDetail":"\u6253\u5F00\u8BE6\u60C5","kanban.priority.critical":"\u7D27\u6025","kanban.priority.high":"\u9AD8","kanban.priority.medium":"\u4E2D","kanban.priority.low":"\u4F4E","quickCreate.newItem":"\u65B0\u5EFA\u6761\u76EE","quickCreate.createWithTitle":"\u521B\u5EFA{title}","quickEdit.editWithTitle":"\u7F16\u8F91{title}","quickDelete.confirmTitle":"\u786E\u8BA4\u5220\u9664","quickDelete.confirmMessageSingle":"\u786E\u8BA4\u5220\u9664\u5F53\u524D\u9009\u4E2D\u8BB0\u5F55\u5417\uFF1F","quickDelete.confirmMessageMultiple":"\u786E\u8BA4\u5220\u9664\u5DF2\u9009\u4E2D\u7684 {count} \u6761\u8BB0\u5F55\u5417\uFF1F","cardPage.viewDetails":"\u67E5\u770B\u8BE6\u60C5","cardPage.download":"\u4E0B\u8F7D","cardPage.close":"\u5173\u95ED","cardPage.empty":"\u672A\u627E\u5230\u6761\u76EE","messageBox.confirm":"\u786E\u5B9A","messageBox.cancel":"\u53D6\u6D88"},Mf={"common.cancel":"Annuler","common.save":"Enregistrer","common.ok":"OK","common.done":"Terminer","common.search":"Rechercher","common.none":"Aucun","common.all":"Tout","common.noData":"Aucune donn\xE9e","common.copy":"Copier","common.delete":"Supprimer","common.loading":"Chargement...","header.searchPlaceholder":"Demandez-moi...","header.searchAddFeature":"Ajouter une fonction","header.searchSend":"Envoyer","header.searchStartVoice":"D\xE9marrer la saisie vocale","header.searchStopVoice":"Arr\xEAter la saisie vocale","header.theme.system":"Th\xE8me : Syst\xE8me","header.theme.dark":"Th\xE8me : Sombre","header.theme.light":"Th\xE8me : Clair","header.menu.setting":"Param\xE8tres","header.menu.refresh":"Actualiser","header.menu.logout":"Se d\xE9connecter","navigation.expand":"D\xE9velopper la navigation","navigation.collapse":"R\xE9duire la navigation","navigation.searchPlaceholder":"Rechercher dans le menu...","navigation.noMatch":"Aucun \xE9l\xE9ment correspondant","navigation.noAccessibleApp":"Aucune application accessible","navigation.noItems":"Aucun \xE9l\xE9ment \xE0 afficher","navigation.expandView":"D\xE9velopper {title}","navigation.mode.switchToFixed":"Basculer vers la navigation fixe","navigation.mode.switchToFloating":"Basculer vers la navigation flottante","navigation.pinned":"\xC9pingl\xE9s","navigation.pin.add":"\xC9pingler en haut","navigation.pin.remove":"D\xE9s\xE9pingler","table.toolbar.searchPlaceholder":"Rechercher...","table.title.default":"Tableau de donn\xE9es","table.toolbar.groupBy":"Grouper","table.toolbar.summary":"R\xE9sum\xE9","table.toolbar.columns":"Colonnes","table.toolbar.export":"Exporter","table.toolbar.itemsPerPage":"Lignes par page :","table.toolbar.pageOf":"Page {current} sur {total}","table.toolbar.newItem":"Nouvel \xE9l\xE9ment","table.toolbar.editItem":"Modifier l'\xE9l\xE9ment","table.toolbar.deleteItem":"Supprimer l'\xE9l\xE9ment","table.toolbar.graphicReport":"Rapport graphique","table.toolbar.saveLayout":"Enregistrer la vue","table.menu.groupBy":"Grouper","table.menu.clearAll":"Tout effacer","table.menu.visibleColumns":"Colonnes visibles","table.menu.showSummaryRow":"Afficher la ligne de r\xE9sum\xE9","table.menu.noNumericColumns":"Aucune colonne num\xE9rique","table.group.expandAll":"D\xE9velopper tous les groupes","table.group.collapseAll":"R\xE9duire tous les groupes","table.mobile.notImplemented":"Vue mobile non impl\xE9ment\xE9e","table.headerMenu.sortAsc":"Trier ascendant","table.headerMenu.sortDesc":"Trier descendant","table.headerMenu.clearSort":"Effacer le tri","table.headerMenu.configureSort":"Configurer le tri...","table.headerMenu.group":"Grouper par cette colonne","table.headerMenu.ungroup":"Retirer du groupement","table.headerMenu.addSummary":"Inclure dans le r\xE9sum\xE9","table.headerMenu.removeSummary":"Retirer du r\xE9sum\xE9","table.headerMenu.hideColumn":"Masquer la colonne","table.sortDialog.title":"Param\xE8tres de tri","table.sortDialog.empty":"Aucune r\xE8gle de tri. Ajoutez-en une pour commencer.","table.sortDialog.addRule":"Ajouter une r\xE8gle","table.sortDialog.clearAll":"Tout effacer","table.sortDialog.asc":"Ascendant","table.sortDialog.desc":"Descendant","pivot.title.default":"Tableau crois\xE9 dynamique","pivot.subtitle.default":"Faites glisser les champs pour configurer le tableau crois\xE9.","pivot.empty":"Ajoutez au moins un champ de valeur pour afficher le r\xE9sultat.","pivot.records":"Enregistrements","pivot.afterFilter":"Apr\xE8s filtre","pivot.grandTotal":"Total g\xE9n\xE9ral","pivot.resultLabel":"R\xE9sultat","pivot.valueLabel":"Valeur","pivot.table.dimensions":"Dimensions","pivot.config.title":"Configuration","pivot.fieldList":"Liste des champs","pivot.availableDimensions":"Dimensions disponibles","pivot.allFieldsInUse":"Tous les champs sont d\xE9j\xE0 utilis\xE9s.","pivot.zone.rows":"Lignes","pivot.zone.columns":"Colonnes","pivot.zone.filters":"Filtres","pivot.zone.values":"Valeurs","pivot.hint.rows":"D\xE9posez les champs ici pour construire la hi\xE9rarchie des lignes","pivot.hint.columns":"D\xE9posez les champs ici pour construire la hi\xE9rarchie des colonnes","pivot.hint.filters":"D\xE9posez les champs ici pour les filtres du rapport","pivot.hint.values":"D\xE9posez les champs num\xE9riques ici pour les agr\xE9gations","pivot.clearArea":"Vider la zone","pivot.filter.na":"N/A","pivot.filter.noValues":"Aucune valeur","pivot.filter.noneSelected":"Aucune s\xE9lection","pivot.filter.allValues":"Toutes les valeurs","pivot.filter.selectedCount":"{selected} / {total} s\xE9lectionn\xE9es","pivot.filter.selectAll":"Tout s\xE9lectionner","pivot.filter.deselectAll":"Tout d\xE9s\xE9lectionner","pivot.filter.noResults":"Aucun r\xE9sultat","pivot.collapse.ariaExpand":"D\xE9velopper la zone de configuration","pivot.collapse.ariaCollapse":"R\xE9duire la zone de configuration","pivot.agg.sum":"Somme","pivot.agg.count":"Compte","pivot.agg.avg":"Moyenne","pivot.agg.min":"Min","pivot.agg.max":"Max","pivot.preset.selectPlaceholder":"S\xE9lectionner un preset","pivot.preset.save":"Enregistrer le preset","pivot.preset.delete":"Supprimer le preset","pivot.preset.saveDialogTitle":"Enregistrer le preset actuel","pivot.preset.nameLabel":"Nom du preset","pivot.preset.defaultName":"Preset {index}","pivot.table.sectionTitle":"R\xE9sultat du pivot","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"D\xE9velopper le r\xE9sultat du pivot","pivot.table.collapse.ariaCollapse":"R\xE9duire le r\xE9sultat du pivot","pivot.chart.title":"Graphique pivot","pivot.chart.subtitle":"Associez une dimension et jusqu\u2019\xE0 deux mesures dans un graphique compact.","pivot.chart.subtitleReady":"{dimension} par {measure}","pivot.chart.emptyNoDimension":"Ajoutez au moins un champ de ligne ou de colonne pour afficher le graphique.","pivot.chart.emptyNoValue":"Ajoutez au moins un champ de valeur pour afficher le graphique.","pivot.chart.emptyNoData":"Aucune donn\xE9e disponible pour la s\xE9lection actuelle du graphique.","pivot.chart.dimension":"Dimension","pivot.chart.primaryMeasure":"Mesure","pivot.chart.secondaryMeasure":"Mesure de comparaison","pivot.chart.chartType":"Type de graphique","pivot.chart.style.barVertical":"Barres verticales","pivot.chart.style.barHorizontal":"Barres horizontales","pivot.chart.style.line":"Ligne","pivot.chart.style.scatter":"Nuage de points","pivot.chart.collapse.ariaExpand":"D\xE9velopper la zone du graphique","pivot.chart.collapse.ariaCollapse":"R\xE9duire la zone du graphique","smartFilter.adaptFilters":"Adapter les filtres","smartFilter.addFilters":"Ajouter des filtres","smartFilter.go":"Ex\xE9cuter","smartFilter.visibleFilters":"Filtres visibles","smartFilter.searchPlaceholder":"Rechercher...","smartFilter.noOptionsFound":"Aucune option trouv\xE9e","smartFilter.min":"Min","smartFilter.max":"Max","smartFilter.minMaxPlaceholder":"Min - Max","smartFilter.operator.equals":"\xC9gal \xE0","smartFilter.operator.contains":"Contient","smartFilter.operator.notContains":"Ne contient pas","smartFilter.operator.wildcard":"Recherche g\xE9n\xE9rique","smartFilter.operator.notEquals":"Diff\xE9rent de","smartFilter.operator.greaterThan":"Sup\xE9rieur \xE0","smartFilter.operator.lessThan":"Inf\xE9rieur \xE0","smartFilter.operator.greaterOrEqual":"Sup\xE9rieur ou \xE9gal","smartFilter.operator.lessOrEqual":"Inf\xE9rieur ou \xE9gal","smartFilter.operator.between":"Entre","variant.noOptions":"Aucune option","variant.defaultSuffix":"Par d\xE9faut","variant.selectVariant":"S\xE9lectionner une vue","variant.saveView":"Enregistrer la vue","variant.newVariant":"Nouvelle vue","variant.viewName":"Nom de la vue","variant.setDefault":"D\xE9finir par d\xE9faut","variant.publicAllUsers":"Public (tous les utilisateurs)","variant.toast.fetchFailed":"\xC9chec du chargement des vues","variant.toast.saveFailed":"\xC9chec de l'enregistrement de la vue","variant.toast.saveSuccess":"Vue enregistr\xE9e avec succ\xE8s","variant.toast.deleteFailed":"\xC9chec de la suppression de la vue","variant.toast.deleteSuccess":"Vue supprim\xE9e avec succ\xE8s","variant.toast.defaultFailed":"\xC9chec de la mise \xE0 jour de la vue par d\xE9faut","variant.toast.defaultSuccess":"Vue par d\xE9faut mise \xE0 jour","layout.saveLayout":"Enregistrer la vue","layout.layoutOptions":"Options de vue","layout.selectLayout":"S\xE9lectionner une vue","layout.saveCurrentLayout":"Enregistrer la vue actuelle...","layout.noSavedLayouts":"Aucune vue enregistr\xE9e","layout.removeDefault":"Retirer le d\xE9faut","layout.setAsDefault":"D\xE9finir par d\xE9faut","layout.layoutName":"Nom de la vue","layout.layoutDescription":"Description","layout.layoutNameHelper":"ex. : Vue compacte","layout.warningOverwrite":"Attention : la vue existante sera \xE9cras\xE9e","layout.useAsDefault":"Utiliser comme vue par d\xE9faut","layout.publicAllUsers":"Public (visible par tous les utilisateurs)","layout.toast.loadFallback":"\xC9chec du chargement depuis le backend, bascule vers le stockage local","layout.toast.saveSuccess":"Vue enregistr\xE9e avec succ\xE8s","layout.toast.saveLocalSuccess":"Vue enregistr\xE9e dans le stockage local","layout.toast.backendUnavailableSavedLocal":"Backend indisponible, enregistr\xE9 en local","layout.toast.deleteSuccess":"Vue supprim\xE9e avec succ\xE8s","layout.toast.deleteLocalSuccess":"Vue supprim\xE9e du stockage local","layout.toast.backendUnavailableDeletedLocal":"Backend indisponible, supprim\xE9 en local","layout.toast.defaultSuccess":"Vue par d\xE9faut d\xE9finie","layout.toast.defaultLocalSuccess":"Vue par d\xE9faut d\xE9finie en local","layout.toast.backendUnavailableDefaultLocal":"Backend indisponible, d\xE9faut enregistr\xE9 en local","dateRange.label":"Plage de dates","dateRange.startDate":"Date de d\xE9but","dateRange.endDate":"Date de fin","dateRange.select":"S\xE9lectionner...","dateRange.today":"Aujourd'hui","dateRange.thisWeek":"Cette semaine","dateRange.thisMonth":"Ce mois-ci","graph.records":"{count} enregistrements","graph.kpi.totalRecords":"Total des enregistrements","graph.kpi.totalReport":"Total d\xE9clar\xE9","graph.kpi.totalBillable":"Total facturable","graph.kpi.efficiency":"Efficacit\xE9","graph.kpi.amount":"Montant","graph.kpi.flagged":"Signal\xE9","graph.chart.billable.title":"Facturable par dimension","graph.chart.billable.subtitle":"Top valeurs par heures facturables","graph.chart.efficiency.title":"Efficacit\xE9 par personne","graph.chart.efficiency.subtitle":"Efficacit\xE9 la plus faible en premier","graph.chart.status.title":"R\xE9partition des statuts","graph.chart.status.subtitle":"Ratio des enregistrements par statut","graph.dataBody":"Donn\xE9es","graph.reportTitle":"Rapport graphique","graph.unassigned":"Non attribu\xE9","graph.column.reportHours":"Heures d\xE9clar\xE9es","graph.column.billableHours":"Heures facturables","detail.searchAi.placeholder":"Rechercher des champs, ou interroger l\u2019IA en cas d\u2019absence de r\xE9sultat...","detail.searchAi.matches":"{count} correspondances trouv\xE9es","detail.searchAi.noMatch":"Aucun champ correspondant trouv\xE9.","detail.searchAi.autoAiFallback":"Aucune correspondance directe. Analyse IA en cours...","detail.searchAi.aiResultTitle":"Analyse IA","detail.table.title":"Enregistrements li\xE9s","kanban.empty":"D\xE9posez les cartes ici","kanban.bucket.limit":"Limite","kanban.bucket.dropHere":"Rel\xE2chez pour d\xE9placer dans cette colonne","kanban.bucket.add":"Ajouter une colonne","kanban.bucket.rename":"Renommer la colonne","kanban.bucket.saveRename":"Enregistrer le nom","kanban.bucket.cancelRename":"Annuler le renommage","kanban.search.placeholder":"Rechercher des cartes et colonnes","kanban.search.clear":"Effacer la recherche","kanban.search.results":"{count} cartes correspondantes","kanban.search.noMatch":"Aucune carte correspondante","kanban.card.progress":"Progression","kanban.card.openDetail":"Ouvrir le d\xE9tail","kanban.priority.critical":"Critique","kanban.priority.high":"\xC9lev\xE9e","kanban.priority.medium":"Moyenne","kanban.priority.low":"Faible","quickCreate.newItem":"Nouvel \xE9l\xE9ment","quickCreate.createWithTitle":"Cr\xE9er {title}","quickEdit.editWithTitle":"Modifier {title}","quickDelete.confirmTitle":"Confirmer la suppression","quickDelete.confirmMessageSingle":"Voulez-vous vraiment supprimer l\u2019enregistrement s\xE9lectionn\xE9 ?","quickDelete.confirmMessageMultiple":"Voulez-vous vraiment supprimer les {count} enregistrements s\xE9lectionn\xE9s ?","cardPage.viewDetails":"Voir les d\xE9tails","cardPage.download":"T\xE9l\xE9charger","cardPage.close":"Fermer","cardPage.empty":"Aucun \xE9l\xE9ment trouv\xE9","messageBox.confirm":"OK","messageBox.cancel":"Annuler"},Rf={"common.cancel":"Abbrechen","common.save":"Speichern","common.ok":"OK","common.done":"Fertig","common.search":"Suchen","common.none":"Keine","common.all":"Alle","common.noData":"Keine Daten","common.copy":"Kopieren","common.delete":"L\xF6schen","common.loading":"Wird geladen...","header.searchPlaceholder":"Frag mich...","header.searchAddFeature":"Funktion hinzuf\xFCgen","header.searchSend":"Senden","header.searchStartVoice":"Spracheingabe starten","header.searchStopVoice":"Spracheingabe stoppen","header.theme.system":"Theme: System","header.theme.dark":"Theme: Dunkel","header.theme.light":"Theme: Hell","header.menu.setting":"Einstellungen","header.menu.refresh":"Aktualisieren","header.menu.logout":"Abmelden","navigation.expand":"Navigation erweitern","navigation.collapse":"Navigation einklappen","navigation.searchPlaceholder":"Men\xFC suchen...","navigation.noMatch":"Keine passenden Men\xFCeintr\xE4ge","navigation.noAccessibleApp":"Keine verf\xFCgbaren Anwendungen","navigation.noItems":"Keine Eintr\xE4ge vorhanden","navigation.expandView":"{title} aufklappen","navigation.mode.switchToFixed":"Zu fester Navigation wechseln","navigation.mode.switchToFloating":"Zu schwebender Navigation wechseln","navigation.pinned":"Angeheftet","navigation.pin.add":"Oben anheften","navigation.pin.remove":"L\xF6sen","table.toolbar.searchPlaceholder":"Suchen...","table.title.default":"Datentabelle","table.toolbar.groupBy":"Gruppieren","table.toolbar.summary":"Zusammenfassung","table.toolbar.columns":"Spalten","table.toolbar.export":"Export","table.toolbar.itemsPerPage":"Zeilen pro Seite:","table.toolbar.pageOf":"Seite {current} von {total}","table.toolbar.newItem":"Neuer Eintrag","table.toolbar.editItem":"Eintrag bearbeiten","table.toolbar.deleteItem":"Eintrag l\xF6schen","table.toolbar.graphicReport":"Grafikbericht","table.toolbar.saveLayout":"Layout speichern","table.menu.groupBy":"Gruppieren","table.menu.clearAll":"Alles l\xF6schen","table.menu.visibleColumns":"Sichtbare Spalten","table.menu.showSummaryRow":"Summenzeile anzeigen","table.menu.noNumericColumns":"Keine numerischen Spalten","table.group.expandAll":"Alle Gruppen aufklappen","table.group.collapseAll":"Alle Gruppen zuklappen","table.mobile.notImplemented":"Mobile Ansicht nicht implementiert","table.headerMenu.sortAsc":"Aufsteigend sortieren","table.headerMenu.sortDesc":"Absteigend sortieren","table.headerMenu.clearSort":"Sortierung entfernen","table.headerMenu.configureSort":"Sortierung konfigurieren...","table.headerMenu.group":"Nach dieser Spalte gruppieren","table.headerMenu.ungroup":"Aus Gruppierung entfernen","table.headerMenu.addSummary":"In Summe einbeziehen","table.headerMenu.removeSummary":"Aus Summe entfernen","table.headerMenu.hideColumn":"Spalte ausblenden","table.sortDialog.title":"Sortiereinstellungen","table.sortDialog.empty":"Keine Sortierregeln. F\xFCgen Sie eine hinzu, um zu sortieren.","table.sortDialog.addRule":"Regel hinzuf\xFCgen","table.sortDialog.clearAll":"Alle l\xF6schen","table.sortDialog.asc":"Aufsteigend","table.sortDialog.desc":"Absteigend","pivot.title.default":"Pivot-Tabelle","pivot.subtitle.default":"Ziehen Sie Felder, um die Pivot-Tabelle zu konfigurieren.","pivot.empty":"Ziehen Sie mindestens ein Wertefeld, um das Ergebnis anzuzeigen.","pivot.records":"Datens\xE4tze","pivot.afterFilter":"Nach Filter","pivot.grandTotal":"Gesamtsumme","pivot.resultLabel":"Ergebnis","pivot.valueLabel":"Wert","pivot.table.dimensions":"Dimensionen","pivot.config.title":"Konfiguration","pivot.fieldList":"Feldliste","pivot.availableDimensions":"Verf\xFCgbare Dimensionen","pivot.allFieldsInUse":"Alle Felder sind bereits verwendet.","pivot.zone.rows":"Zeilen","pivot.zone.columns":"Spalten","pivot.zone.filters":"Filter","pivot.zone.values":"Werte","pivot.hint.rows":"Felder hierhin ziehen, um die Zeilenhierarchie zu erstellen","pivot.hint.columns":"Felder hierhin ziehen, um die Spaltenhierarchie zu erstellen","pivot.hint.filters":"Felder hierhin ziehen f\xFCr Berichtsfilter","pivot.hint.values":"Numerische Felder hierhin ziehen f\xFCr Aggregation","pivot.clearArea":"Bereich leeren","pivot.filter.na":"N/V","pivot.filter.noValues":"Keine Werte","pivot.filter.noneSelected":"Nichts ausgew\xE4hlt","pivot.filter.allValues":"Alle Werte","pivot.filter.selectedCount":"{selected} / {total} ausgew\xE4hlt","pivot.filter.selectAll":"Alle ausw\xE4hlen","pivot.filter.deselectAll":"Alle abw\xE4hlen","pivot.filter.noResults":"Keine Ergebnisse","pivot.collapse.ariaExpand":"Konfigurationsbereich erweitern","pivot.collapse.ariaCollapse":"Konfigurationsbereich reduzieren","pivot.agg.sum":"Summe","pivot.agg.count":"Anzahl","pivot.agg.avg":"Durchschnitt","pivot.agg.min":"Min","pivot.agg.max":"Max","pivot.preset.selectPlaceholder":"Preset w\xE4hlen","pivot.preset.save":"Preset speichern","pivot.preset.delete":"Preset l\xF6schen","pivot.preset.saveDialogTitle":"Aktuelles Preset speichern","pivot.preset.nameLabel":"Preset-Name","pivot.preset.defaultName":"Preset {index}","pivot.table.sectionTitle":"Pivot-Ergebnis","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"Pivot-Ergebnis erweitern","pivot.table.collapse.ariaCollapse":"Pivot-Ergebnis reduzieren","pivot.chart.title":"Pivot-Diagramm","pivot.chart.subtitle":"Eine Dimension und bis zu zwei Kennzahlen in einem kompakten Diagramm abbilden.","pivot.chart.subtitleReady":"{dimension} nach {measure}","pivot.chart.emptyNoDimension":"F\xFCgen Sie mindestens ein Zeilen- oder Spaltenfeld hinzu, um das Diagramm anzuzeigen.","pivot.chart.emptyNoValue":"F\xFCgen Sie mindestens ein Wertefeld hinzu, um das Diagramm anzuzeigen.","pivot.chart.emptyNoData":"F\xFCr die aktuelle Diagrammauswahl sind keine Daten verf\xFCgbar.","pivot.chart.dimension":"Dimension","pivot.chart.primaryMeasure":"Kennzahl","pivot.chart.secondaryMeasure":"Vergleichskennzahl","pivot.chart.chartType":"Diagrammtyp","pivot.chart.style.barVertical":"Vertikale Balken","pivot.chart.style.barHorizontal":"Horizontale Balken","pivot.chart.style.line":"Linie","pivot.chart.style.scatter":"Streudiagramm","pivot.chart.collapse.ariaExpand":"Diagrammbereich erweitern","pivot.chart.collapse.ariaCollapse":"Diagrammbereich reduzieren","smartFilter.adaptFilters":"Filter anpassen","smartFilter.addFilters":"Filter hinzuf\xFCgen","smartFilter.go":"Los","smartFilter.visibleFilters":"Sichtbare Filter","smartFilter.searchPlaceholder":"Suchen...","smartFilter.noOptionsFound":"Keine Optionen gefunden","smartFilter.min":"Min","smartFilter.max":"Max","smartFilter.minMaxPlaceholder":"Min - Max","smartFilter.operator.equals":"Gleich","smartFilter.operator.contains":"Enth\xE4lt","smartFilter.operator.notContains":"Enth\xE4lt nicht","smartFilter.operator.wildcard":"Wildcard-Suche","smartFilter.operator.notEquals":"Ungleich","smartFilter.operator.greaterThan":"Gr\xF6\xDFer als","smartFilter.operator.lessThan":"Kleiner als","smartFilter.operator.greaterOrEqual":"Gr\xF6\xDFer gleich","smartFilter.operator.lessOrEqual":"Kleiner gleich","smartFilter.operator.between":"Zwischen","variant.noOptions":"Keine Optionen","variant.defaultSuffix":"Standard","variant.selectVariant":"Variante w\xE4hlen","variant.saveView":"Ansicht speichern","variant.newVariant":"Neue Variante","variant.viewName":"Ansichtsname","variant.setDefault":"Als Standard setzen","variant.publicAllUsers":"\xD6ffentlich (alle Benutzer)","variant.toast.fetchFailed":"Varianten konnten nicht geladen werden","variant.toast.saveFailed":"Variante konnte nicht gespeichert werden","variant.toast.saveSuccess":"Variante erfolgreich gespeichert","variant.toast.deleteFailed":"Variante konnte nicht gel\xF6scht werden","variant.toast.deleteSuccess":"Variante erfolgreich gel\xF6scht","variant.toast.defaultFailed":"Standardvariante konnte nicht aktualisiert werden","variant.toast.defaultSuccess":"Standardvariante aktualisiert","layout.saveLayout":"Layout speichern","layout.layoutOptions":"Layout-Optionen","layout.selectLayout":"Layout w\xE4hlen","layout.saveCurrentLayout":"Aktuelles Layout speichern...","layout.noSavedLayouts":"Keine gespeicherten Layouts","layout.removeDefault":"Standard entfernen","layout.setAsDefault":"Als Standard setzen","layout.layoutName":"Layoutname","layout.layoutDescription":"Beschreibung","layout.layoutNameHelper":"z. B. Kompaktansicht","layout.warningOverwrite":"Warnung: Vorhandenes Layout wird \xFCberschrieben","layout.useAsDefault":"Als Standardlayout verwenden","layout.publicAllUsers":"\xD6ffentlich (f\xFCr alle sichtbar)","layout.toast.loadFallback":"Layouts konnten nicht vom Backend geladen werden, Wechsel zu lokalem Speicher","layout.toast.saveSuccess":"Layout erfolgreich gespeichert","layout.toast.saveLocalSuccess":"Layout im lokalen Speicher gespeichert","layout.toast.backendUnavailableSavedLocal":"Backend nicht verf\xFCgbar, lokal gespeichert","layout.toast.deleteSuccess":"Layout erfolgreich gel\xF6scht","layout.toast.deleteLocalSuccess":"Layout aus lokalem Speicher gel\xF6scht","layout.toast.backendUnavailableDeletedLocal":"Backend nicht verf\xFCgbar, lokal gel\xF6scht","layout.toast.defaultSuccess":"Standardlayout gesetzt","layout.toast.defaultLocalSuccess":"Standardlayout lokal gesetzt","layout.toast.backendUnavailableDefaultLocal":"Backend nicht verf\xFCgbar, Standard lokal gespeichert","dateRange.label":"Datumsbereich","dateRange.startDate":"Startdatum","dateRange.endDate":"Enddatum","dateRange.select":"Ausw\xE4hlen...","dateRange.today":"Heute","dateRange.thisWeek":"Diese Woche","dateRange.thisMonth":"Diesen Monat","graph.records":"{count} Datens\xE4tze","graph.kpi.totalRecords":"Gesamt Datens\xE4tze","graph.kpi.totalReport":"Gesamt Report","graph.kpi.totalBillable":"Gesamt abrechenbar","graph.kpi.efficiency":"Effizienz","graph.kpi.amount":"Betrag","graph.kpi.flagged":"Markiert","graph.chart.billable.title":"Abrechenbar nach Dimension","graph.chart.billable.subtitle":"Top-Werte nach abrechenbaren Stunden","graph.chart.efficiency.title":"Effizienz pro Person","graph.chart.efficiency.subtitle":"Niedrigste Effizienz zuerst","graph.chart.status.title":"Statusverteilung","graph.chart.status.subtitle":"Anteil je Status","graph.dataBody":"Datentabelle","graph.reportTitle":"Grafikbericht","graph.unassigned":"Nicht zugewiesen","graph.column.reportHours":"Melde-Stunden","graph.column.billableHours":"Abrechenbare Stunden","detail.searchAi.placeholder":"Felder suchen, oder bei keinem Treffer die KI fragen...","detail.searchAi.matches":"{count} Treffer gefunden","detail.searchAi.noMatch":"Kein passendes Feld gefunden.","detail.searchAi.autoAiFallback":"Keine direkte \xDCbereinstimmung. KI-Analyse wird gestartet...","detail.searchAi.aiResultTitle":"KI-Ergebnis","detail.table.title":"Verkn\xFCpfte Eintr\xE4ge","kanban.empty":"Karten hier ablegen","kanban.bucket.limit":"Limit","kanban.bucket.dropHere":"Loslassen, um in diese Spalte zu verschieben","kanban.bucket.add":"Spalte hinzuf\xFCgen","kanban.bucket.rename":"Spalte umbenennen","kanban.bucket.saveRename":"Spaltennamen speichern","kanban.bucket.cancelRename":"Umbenennen abbrechen","kanban.search.placeholder":"Karten und Spalten durchsuchen","kanban.search.clear":"Suche l\xF6schen","kanban.search.results":"{count} passende Karten","kanban.search.noMatch":"Keine passenden Karten","kanban.card.progress":"Fortschritt","kanban.card.openDetail":"Detail \xF6ffnen","kanban.priority.critical":"Kritisch","kanban.priority.high":"Hoch","kanban.priority.medium":"Mittel","kanban.priority.low":"Niedrig","quickCreate.newItem":"Neuer Eintrag","quickCreate.createWithTitle":"{title} erstellen","quickEdit.editWithTitle":"{title} bearbeiten","quickDelete.confirmTitle":"L\xF6schen best\xE4tigen","quickDelete.confirmMessageSingle":"M\xF6chten Sie den ausgew\xE4hlten Datensatz wirklich l\xF6schen?","quickDelete.confirmMessageMultiple":"M\xF6chten Sie die {count} ausgew\xE4hlten Datens\xE4tze wirklich l\xF6schen?","cardPage.viewDetails":"Details anzeigen","cardPage.download":"Herunterladen","cardPage.close":"Schlie\xDFen","cardPage.empty":"Keine Eintr\xE4ge gefunden","messageBox.confirm":"OK","messageBox.cancel":"Abbrechen"},Df={"common.cancel":"\u30AD\u30E3\u30F3\u30BB\u30EB","common.save":"\u4FDD\u5B58","common.ok":"OK","common.done":"\u5B8C\u4E86","common.search":"\u691C\u7D22","common.none":"\u306A\u3057","common.all":"\u3059\u3079\u3066","common.noData":"\u30C7\u30FC\u30BF\u306A\u3057","common.copy":"\u30B3\u30D4\u30FC","common.delete":"\u524A\u9664","common.loading":"\u8AAD\u307F\u8FBC\u307F\u4E2D...","header.searchPlaceholder":"\u4F55\u304B\u805E\u3044\u3066\u304F\u3060\u3055\u3044...","header.searchAddFeature":"\u6A5F\u80FD\u3092\u8FFD\u52A0","header.searchSend":"\u9001\u4FE1","header.searchStartVoice":"\u97F3\u58F0\u5165\u529B\u3092\u958B\u59CB","header.searchStopVoice":"\u97F3\u58F0\u5165\u529B\u3092\u505C\u6B62","header.theme.system":"\u30C6\u30FC\u30DE\uFF1A\u30B7\u30B9\u30C6\u30E0","header.theme.dark":"\u30C6\u30FC\u30DE\uFF1A\u30C0\u30FC\u30AF","header.theme.light":"\u30C6\u30FC\u30DE\uFF1A\u30E9\u30A4\u30C8","header.menu.setting":"\u8A2D\u5B9A","header.menu.refresh":"\u518D\u8AAD\u307F\u8FBC\u307F","header.menu.logout":"\u30ED\u30B0\u30A2\u30A6\u30C8","navigation.expand":"\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u3092\u5C55\u958B","navigation.collapse":"\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u3092\u6298\u308A\u305F\u305F\u3080","navigation.searchPlaceholder":"\u30E1\u30CB\u30E5\u30FC\u3092\u691C\u7D22...","navigation.noMatch":"\u4E00\u81F4\u3059\u308B\u30E1\u30CB\u30E5\u30FC\u304C\u3042\u308A\u307E\u305B\u3093","navigation.noAccessibleApp":"\u30A2\u30AF\u30BB\u30B9\u53EF\u80FD\u306A\u30A2\u30D7\u30EA\u304C\u3042\u308A\u307E\u305B\u3093","navigation.noItems":"\u8868\u793A\u3067\u304D\u308B\u9805\u76EE\u304C\u3042\u308A\u307E\u305B\u3093","navigation.expandView":"{title} \u3092\u5C55\u958B","navigation.mode.switchToFixed":"\u56FA\u5B9A\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u306B\u5207\u308A\u66FF\u3048","navigation.mode.switchToFloating":"\u30D5\u30ED\u30FC\u30C6\u30A3\u30F3\u30B0\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u306B\u5207\u308A\u66FF\u3048","navigation.pinned":"\u30D4\u30F3\u7559\u3081","navigation.pin.add":"\u4E0A\u90E8\u306B\u30D4\u30F3\u7559\u3081","navigation.pin.remove":"\u30D4\u30F3\u7559\u3081\u3092\u89E3\u9664","table.toolbar.searchPlaceholder":"\u691C\u7D22...","table.title.default":"\u30C7\u30FC\u30BF\u30C6\u30FC\u30D6\u30EB","table.toolbar.groupBy":"\u30B0\u30EB\u30FC\u30D7\u5316","table.toolbar.summary":"\u96C6\u8A08","table.toolbar.columns":"\u5217","table.toolbar.export":"\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8","table.toolbar.itemsPerPage":"1\u30DA\u30FC\u30B8\u306E\u4EF6\u6570\uFF1A","table.toolbar.pageOf":"{current} / {total} \u30DA\u30FC\u30B8","table.toolbar.newItem":"\u65B0\u898F\u4F5C\u6210","table.toolbar.editItem":"\u7DE8\u96C6","table.toolbar.deleteItem":"\u524A\u9664","table.toolbar.graphicReport":"\u30B0\u30E9\u30D5\u30A3\u30C3\u30AF\u30EC\u30DD\u30FC\u30C8","table.toolbar.saveLayout":"\u30EC\u30A4\u30A2\u30A6\u30C8\u4FDD\u5B58","table.menu.groupBy":"\u30B0\u30EB\u30FC\u30D7\u5316","table.menu.clearAll":"\u3059\u3079\u3066\u30AF\u30EA\u30A2","table.menu.visibleColumns":"\u8868\u793A\u5217","table.menu.showSummaryRow":"\u96C6\u8A08\u884C\u3092\u8868\u793A","table.menu.noNumericColumns":"\u6570\u5024\u5217\u304C\u3042\u308A\u307E\u305B\u3093","table.group.expandAll":"\u3059\u3079\u3066\u306E\u30B0\u30EB\u30FC\u30D7\u3092\u5C55\u958B","table.group.collapseAll":"\u3059\u3079\u3066\u306E\u30B0\u30EB\u30FC\u30D7\u3092\u6298\u308A\u305F\u305F\u3080","table.mobile.notImplemented":"\u30E2\u30D0\u30A4\u30EB\u8868\u793A\u306F\u672A\u5B9F\u88C5\u3067\u3059","table.headerMenu.sortAsc":"\u6607\u9806\u3067\u4E26\u3079\u66FF\u3048","table.headerMenu.sortDesc":"\u964D\u9806\u3067\u4E26\u3079\u66FF\u3048","table.headerMenu.clearSort":"\u4E26\u3079\u66FF\u3048\u3092\u89E3\u9664","table.headerMenu.configureSort":"\u4E26\u3079\u66FF\u3048\u3092\u8A2D\u5B9A...","table.headerMenu.group":"\u3053\u306E\u5217\u3067\u30B0\u30EB\u30FC\u30D7\u5316","table.headerMenu.ungroup":"\u30B0\u30EB\u30FC\u30D7\u304B\u3089\u5916\u3059","table.headerMenu.addSummary":"\u96C6\u8A08\u306B\u8FFD\u52A0","table.headerMenu.removeSummary":"\u96C6\u8A08\u304B\u3089\u524A\u9664","table.headerMenu.hideColumn":"\u5217\u3092\u975E\u8868\u793A","table.sortDialog.title":"\u4E26\u3079\u66FF\u3048\u8A2D\u5B9A","table.sortDialog.empty":"\u4E26\u3079\u66FF\u3048\u30EB\u30FC\u30EB\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","table.sortDialog.addRule":"\u30EB\u30FC\u30EB\u3092\u8FFD\u52A0","table.sortDialog.clearAll":"\u3059\u3079\u3066\u30AF\u30EA\u30A2","table.sortDialog.asc":"\u6607\u9806","table.sortDialog.desc":"\u964D\u9806","pivot.title.default":"\u30D4\u30DC\u30C3\u30C8\u30C6\u30FC\u30D6\u30EB","pivot.subtitle.default":"\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u30D4\u30DC\u30C3\u30C8\u30C6\u30FC\u30D6\u30EB\u3092\u8A2D\u5B9A\u3057\u307E\u3059\u3002","pivot.empty":"\u7D50\u679C\u3092\u8868\u793A\u3059\u308B\u306B\u306F\u3001\u5024\u30A8\u30EA\u30A2\u306B\u5C11\u306A\u304F\u3068\u30821\u3064\u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","pivot.records":"\u30EC\u30B3\u30FC\u30C9","pivot.afterFilter":"\u30D5\u30A3\u30EB\u30BF\u30FC\u5F8C","pivot.grandTotal":"\u7DCF\u8A08","pivot.resultLabel":"\u7D50\u679C","pivot.valueLabel":"\u5024","pivot.table.dimensions":"\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3","pivot.config.title":"\u8A2D\u5B9A","pivot.fieldList":"\u30D5\u30A3\u30FC\u30EB\u30C9\u4E00\u89A7","pivot.availableDimensions":"\u5229\u7528\u53EF\u80FD\u306A\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3","pivot.allFieldsInUse":"\u3059\u3079\u3066\u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u304C\u4F7F\u7528\u4E2D\u3067\u3059\u3002","pivot.zone.rows":"\u884C","pivot.zone.columns":"\u5217","pivot.zone.filters":"\u30D5\u30A3\u30EB\u30BF\u30FC","pivot.zone.values":"\u5024","pivot.hint.rows":"\u3053\u3053\u306B\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u884C\u968E\u5C64\u3092\u4F5C\u6210","pivot.hint.columns":"\u3053\u3053\u306B\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u5217\u968E\u5C64\u3092\u4F5C\u6210","pivot.hint.filters":"\u3053\u3053\u306B\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u30EC\u30DD\u30FC\u30C8\u30D5\u30A3\u30EB\u30BF\u30FC\u3092\u8A2D\u5B9A","pivot.hint.values":"\u3053\u3053\u306B\u6570\u5024\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u96C6\u8A08","pivot.clearArea":"\u30A8\u30EA\u30A2\u3092\u30AF\u30EA\u30A2","pivot.filter.na":"N/A","pivot.filter.noValues":"\u5024\u304C\u3042\u308A\u307E\u305B\u3093","pivot.filter.noneSelected":"\u672A\u9078\u629E","pivot.filter.allValues":"\u3059\u3079\u3066\u306E\u5024","pivot.filter.selectedCount":"{selected} / {total} \u3092\u9078\u629E","pivot.filter.selectAll":"\u3059\u3079\u3066\u9078\u629E","pivot.filter.deselectAll":"\u3059\u3079\u3066\u89E3\u9664","pivot.filter.noResults":"\u7D50\u679C\u304C\u3042\u308A\u307E\u305B\u3093","pivot.collapse.ariaExpand":"\u8A2D\u5B9A\u30A8\u30EA\u30A2\u3092\u5C55\u958B","pivot.collapse.ariaCollapse":"\u8A2D\u5B9A\u30A8\u30EA\u30A2\u3092\u6298\u308A\u305F\u305F\u3080","pivot.agg.sum":"\u5408\u8A08","pivot.agg.count":"\u4EF6\u6570","pivot.agg.avg":"\u5E73\u5747","pivot.agg.min":"\u6700\u5C0F","pivot.agg.max":"\u6700\u5927","pivot.preset.selectPlaceholder":"\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u9078\u629E","pivot.preset.save":"\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u4FDD\u5B58","pivot.preset.delete":"\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u524A\u9664","pivot.preset.saveDialogTitle":"\u73FE\u5728\u306E\u30D7\u30EA\u30BB\u30C3\u30C8\u3092\u4FDD\u5B58","pivot.preset.nameLabel":"\u30D7\u30EA\u30BB\u30C3\u30C8\u540D","pivot.preset.defaultName":"\u30D7\u30EA\u30BB\u30C3\u30C8 {index}","pivot.table.sectionTitle":"\u30D4\u30DC\u30C3\u30C8\u7D50\u679C","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"\u30D4\u30DC\u30C3\u30C8\u7D50\u679C\u3092\u5C55\u958B","pivot.table.collapse.ariaCollapse":"\u30D4\u30DC\u30C3\u30C8\u7D50\u679C\u3092\u6298\u308A\u305F\u305F\u3080","pivot.chart.title":"\u30D4\u30DC\u30C3\u30C8\u30C1\u30E3\u30FC\u30C8","pivot.chart.subtitle":"1\u3064\u306E\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3\u3068\u6700\u59272\u3064\u306E\u6307\u6A19\u3092\u30B3\u30F3\u30D1\u30AF\u30C8\u306A\u30C1\u30E3\u30FC\u30C8\u306B\u307E\u3068\u3081\u307E\u3059\u3002","pivot.chart.subtitleReady":"{dimension} \u3054\u3068\u306E {measure}","pivot.chart.emptyNoDimension":"\u30C1\u30E3\u30FC\u30C8\u3092\u8868\u793A\u3059\u308B\u306B\u306F\u3001\u5C11\u306A\u304F\u3068\u30821\u3064\u306E\u884C\u307E\u305F\u306F\u5217\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","pivot.chart.emptyNoValue":"\u30C1\u30E3\u30FC\u30C8\u3092\u8868\u793A\u3059\u308B\u306B\u306F\u3001\u5C11\u306A\u304F\u3068\u30821\u3064\u306E\u5024\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002","pivot.chart.emptyNoData":"\u73FE\u5728\u306E\u30C1\u30E3\u30FC\u30C8\u9078\u629E\u3067\u306F\u8868\u793A\u3067\u304D\u308B\u30C7\u30FC\u30BF\u304C\u3042\u308A\u307E\u305B\u3093\u3002","pivot.chart.dimension":"\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3","pivot.chart.primaryMeasure":"\u6307\u6A19","pivot.chart.secondaryMeasure":"\u6BD4\u8F03\u6307\u6A19","pivot.chart.chartType":"\u30C1\u30E3\u30FC\u30C8\u7A2E\u5225","pivot.chart.style.barVertical":"\u7E26\u68D2\u30B0\u30E9\u30D5","pivot.chart.style.barHorizontal":"\u6A2A\u68D2\u30B0\u30E9\u30D5","pivot.chart.style.line":"\u6298\u308C\u7DDA\u30B0\u30E9\u30D5","pivot.chart.style.scatter":"\u6563\u5E03\u56F3","pivot.chart.collapse.ariaExpand":"\u30C1\u30E3\u30FC\u30C8\u9818\u57DF\u3092\u5C55\u958B","pivot.chart.collapse.ariaCollapse":"\u30C1\u30E3\u30FC\u30C8\u9818\u57DF\u3092\u6298\u308A\u305F\u305F\u3080","smartFilter.adaptFilters":"\u30D5\u30A3\u30EB\u30BF\u30FC\u8ABF\u6574","smartFilter.addFilters":"\u30D5\u30A3\u30EB\u30BF\u30FC\u8FFD\u52A0","smartFilter.go":"\u5B9F\u884C","smartFilter.visibleFilters":"\u8868\u793A\u30D5\u30A3\u30EB\u30BF\u30FC","smartFilter.searchPlaceholder":"\u691C\u7D22...","smartFilter.noOptionsFound":"\u30AA\u30D7\u30B7\u30E7\u30F3\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093","smartFilter.min":"\u6700\u5C0F","smartFilter.max":"\u6700\u5927","smartFilter.minMaxPlaceholder":"\u6700\u5C0F - \u6700\u5927","smartFilter.operator.equals":"\u7B49\u3057\u3044","smartFilter.operator.contains":"\u542B\u3080","smartFilter.operator.notContains":"\u542B\u307E\u306A\u3044","smartFilter.operator.wildcard":"\u30EF\u30A4\u30EB\u30C9\u30AB\u30FC\u30C9\u691C\u7D22","smartFilter.operator.notEquals":"\u7B49\u3057\u304F\u306A\u3044","smartFilter.operator.greaterThan":"\u3088\u308A\u5927\u304D\u3044","smartFilter.operator.lessThan":"\u3088\u308A\u5C0F\u3055\u3044","smartFilter.operator.greaterOrEqual":"\u4EE5\u4E0A","smartFilter.operator.lessOrEqual":"\u4EE5\u4E0B","smartFilter.operator.between":"\u7BC4\u56F2","variant.noOptions":"\u30AA\u30D7\u30B7\u30E7\u30F3\u306A\u3057","variant.defaultSuffix":"\u30C7\u30D5\u30A9\u30EB\u30C8","variant.selectVariant":"\u30D3\u30E5\u30FC\u3092\u9078\u629E","variant.saveView":"\u30D3\u30E5\u30FC\u4FDD\u5B58","variant.newVariant":"\u65B0\u3057\u3044\u30D3\u30E5\u30FC","variant.viewName":"\u30D3\u30E5\u30FC\u540D","variant.setDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u306B\u8A2D\u5B9A","variant.publicAllUsers":"\u516C\u958B\uFF08\u5168\u30E6\u30FC\u30B6\u30FC\uFF09","variant.toast.fetchFailed":"\u30D3\u30E5\u30FC\u306E\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.saveFailed":"\u30D3\u30E5\u30FC\u306E\u4FDD\u5B58\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.saveSuccess":"\u30D3\u30E5\u30FC\u3092\u4FDD\u5B58\u3057\u307E\u3057\u305F","variant.toast.deleteFailed":"\u30D3\u30E5\u30FC\u306E\u524A\u9664\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.deleteSuccess":"\u30D3\u30E5\u30FC\u3092\u524A\u9664\u3057\u307E\u3057\u305F","variant.toast.defaultFailed":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30D3\u30E5\u30FC\u306E\u66F4\u65B0\u306B\u5931\u6557\u3057\u307E\u3057\u305F","variant.toast.defaultSuccess":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30D3\u30E5\u30FC\u3092\u66F4\u65B0\u3057\u307E\u3057\u305F","layout.saveLayout":"\u30EC\u30A4\u30A2\u30A6\u30C8\u4FDD\u5B58","layout.layoutOptions":"\u30EC\u30A4\u30A2\u30A6\u30C8\u30AA\u30D7\u30B7\u30E7\u30F3","layout.selectLayout":"\u30EC\u30A4\u30A2\u30A6\u30C8\u9078\u629E","layout.saveCurrentLayout":"\u73FE\u5728\u306E\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u4FDD\u5B58...","layout.noSavedLayouts":"\u4FDD\u5B58\u6E08\u307F\u30EC\u30A4\u30A2\u30A6\u30C8\u306A\u3057","layout.removeDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u89E3\u9664","layout.setAsDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u306B\u8A2D\u5B9A","layout.layoutName":"\u30EC\u30A4\u30A2\u30A6\u30C8\u540D","layout.layoutDescription":"\u8AAC\u660E","layout.layoutNameHelper":"\u4F8B\uFF1A\u30B3\u30F3\u30D1\u30AF\u30C8\u8868\u793A","layout.warningOverwrite":"\u8B66\u544A\uFF1A\u65E2\u5B58\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u4E0A\u66F8\u304D\u3057\u307E\u3059","layout.useAsDefault":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30EC\u30A4\u30A2\u30A6\u30C8\u3068\u3057\u3066\u4F7F\u7528","layout.publicAllUsers":"\u516C\u958B\uFF08\u5168\u30E6\u30FC\u30B6\u30FC\u306B\u8868\u793A\uFF09","layout.toast.loadFallback":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u304B\u3089\u306E\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u3001\u30ED\u30FC\u30AB\u30EB\u4FDD\u5B58\u306B\u5207\u308A\u66FF\u3048\u307E\u3057\u305F","layout.toast.saveSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u4FDD\u5B58\u3057\u307E\u3057\u305F","layout.toast.saveLocalSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u4FDD\u5B58\u3057\u307E\u3057\u305F","layout.toast.backendUnavailableSavedLocal":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u672A\u63A5\u7D9A\u306E\u305F\u3081\u30ED\u30FC\u30AB\u30EB\u306B\u4FDD\u5B58\u3057\u307E\u3057\u305F","layout.toast.deleteSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u524A\u9664\u3057\u307E\u3057\u305F","layout.toast.deleteLocalSuccess":"\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u304B\u3089\u524A\u9664\u3057\u307E\u3057\u305F","layout.toast.backendUnavailableDeletedLocal":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u672A\u63A5\u7D9A\u306E\u305F\u3081\u30ED\u30FC\u30AB\u30EB\u304B\u3089\u524A\u9664\u3057\u307E\u3057\u305F","layout.toast.defaultSuccess":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u8A2D\u5B9A\u3057\u307E\u3057\u305F","layout.toast.defaultLocalSuccess":"\u30C7\u30D5\u30A9\u30EB\u30C8\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u306B\u8A2D\u5B9A\u3057\u307E\u3057\u305F","layout.toast.backendUnavailableDefaultLocal":"\u30D0\u30C3\u30AF\u30A8\u30F3\u30C9\u672A\u63A5\u7D9A\u306E\u305F\u3081\u30C7\u30D5\u30A9\u30EB\u30C8\u3092\u30ED\u30FC\u30AB\u30EB\u4FDD\u5B58\u3057\u307E\u3057\u305F","dateRange.label":"\u65E5\u4ED8\u7BC4\u56F2","dateRange.startDate":"\u958B\u59CB\u65E5","dateRange.endDate":"\u7D42\u4E86\u65E5","dateRange.select":"\u9078\u629E...","dateRange.today":"\u4ECA\u65E5","dateRange.thisWeek":"\u4ECA\u9031","dateRange.thisMonth":"\u4ECA\u6708","graph.records":"{count} \u4EF6","graph.kpi.totalRecords":"\u7DCF\u30EC\u30B3\u30FC\u30C9","graph.kpi.totalReport":"\u7DCF\u5831\u544A\u6642\u9593","graph.kpi.totalBillable":"\u7DCF\u8ACB\u6C42\u53EF\u80FD\u6642\u9593","graph.kpi.efficiency":"\u52B9\u7387","graph.kpi.amount":"\u91D1\u984D","graph.kpi.flagged":"\u8981\u78BA\u8A8D","graph.chart.billable.title":"\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3\u5225\u8ACB\u6C42\u53EF\u80FD\u6642\u9593","graph.chart.billable.subtitle":"\u8ACB\u6C42\u53EF\u80FD\u6642\u9593\u306E\u4E0A\u4F4D","graph.chart.efficiency.title":"\u62C5\u5F53\u8005\u5225\u52B9\u7387","graph.chart.efficiency.subtitle":"\u52B9\u7387\u306E\u4F4E\u3044\u9806","graph.chart.status.title":"\u30B9\u30C6\u30FC\u30BF\u30B9\u5206\u5E03","graph.chart.status.subtitle":"\u30B9\u30C6\u30FC\u30BF\u30B9\u5225\u6BD4\u7387","graph.dataBody":"\u30C7\u30FC\u30BF\u672C\u4F53","graph.reportTitle":"\u30B0\u30E9\u30D5\u30A3\u30C3\u30AF\u30EC\u30DD\u30FC\u30C8","graph.unassigned":"\u672A\u5272\u308A\u5F53\u3066","graph.column.reportHours":"\u5831\u544A\u6642\u9593","graph.column.billableHours":"\u8ACB\u6C42\u53EF\u80FD\u6642\u9593","detail.searchAi.placeholder":"\u9805\u76EE\u3092\u691C\u7D22\u3002\u898B\u3064\u304B\u3089\u306A\u3044\u5834\u5408\u306FAI\u306B\u8CEA\u554F\u3057\u307E\u3059...","detail.searchAi.matches":"{count} \u4EF6\u306E\u4E00\u81F4","detail.searchAi.noMatch":"\u4E00\u81F4\u3059\u308B\u9805\u76EE\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002","detail.searchAi.autoAiFallback":"\u4E00\u81F4\u306A\u3057\u3002AI\u5206\u6790\u3092\u5B9F\u884C\u3057\u307E\u3059...","detail.searchAi.aiResultTitle":"AI\u5206\u6790\u7D50\u679C","detail.table.title":"\u95A2\u9023\u30EC\u30B3\u30FC\u30C9","kanban.empty":"\u3053\u3053\u306B\u30AB\u30FC\u30C9\u3092\u30C9\u30ED\u30C3\u30D7","kanban.bucket.limit":"\u4E0A\u9650","kanban.bucket.dropHere":"\u96E2\u3059\u3068\u3053\u306E bucket \u306B\u79FB\u52D5\u3057\u307E\u3059","kanban.bucket.add":"bucket \u3092\u8FFD\u52A0","kanban.bucket.rename":"bucket \u540D\u3092\u5909\u66F4","kanban.bucket.saveRename":"bucket \u540D\u3092\u4FDD\u5B58","kanban.bucket.cancelRename":"\u540D\u524D\u5909\u66F4\u3092\u30AD\u30E3\u30F3\u30BB\u30EB","kanban.search.placeholder":"\u30AB\u30FC\u30C9\u3068 bucket \u3092\u691C\u7D22","kanban.search.clear":"\u691C\u7D22\u3092\u30AF\u30EA\u30A2","kanban.search.results":"{count} \u4EF6\u306E\u30AB\u30FC\u30C9\u304C\u4E00\u81F4","kanban.search.noMatch":"\u4E00\u81F4\u3059\u308B\u30AB\u30FC\u30C9\u306F\u3042\u308A\u307E\u305B\u3093","kanban.card.progress":"\u9032\u6357","kanban.card.openDetail":"\u8A73\u7D30\u3092\u958B\u304F","kanban.priority.critical":"\u7DCA\u6025","kanban.priority.high":"\u9AD8","kanban.priority.medium":"\u4E2D","kanban.priority.low":"\u4F4E","quickCreate.newItem":"\u65B0\u898F\u4F5C\u6210","quickCreate.createWithTitle":"{title} \u3092\u4F5C\u6210","quickEdit.editWithTitle":"{title} \u3092\u7DE8\u96C6","quickDelete.confirmTitle":"\u524A\u9664\u306E\u78BA\u8A8D","quickDelete.confirmMessageSingle":"\u9078\u629E\u3057\u305F\u30EC\u30B3\u30FC\u30C9\u3092\u524A\u9664\u3057\u3066\u3082\u3088\u308D\u3057\u3044\u3067\u3059\u304B\uFF1F","quickDelete.confirmMessageMultiple":"\u9078\u629E\u3057\u305F {count} \u4EF6\u306E\u30EC\u30B3\u30FC\u30C9\u3092\u524A\u9664\u3057\u3066\u3082\u3088\u308D\u3057\u3044\u3067\u3059\u304B\uFF1F","cardPage.viewDetails":"\u8A73\u7D30\u3092\u8868\u793A","cardPage.download":"\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9","cardPage.close":"\u9589\u3058\u308B","cardPage.empty":"\u9805\u76EE\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093","messageBox.confirm":"OK","messageBox.cancel":"\u30AD\u30E3\u30F3\u30BB\u30EB"},Nf={"common.cancel":"\uCDE8\uC18C","common.save":"\uC800\uC7A5","common.ok":"\uD655\uC778","common.done":"\uC644\uB8CC","common.search":"\uAC80\uC0C9","common.none":"\uC5C6\uC74C","common.all":"\uC804\uCCB4","common.noData":"\uB370\uC774\uD130 \uC5C6\uC74C","common.copy":"\uBCF5\uC0AC","common.delete":"\uC0AD\uC81C","common.loading":"\uB85C\uB529 \uC911...","header.searchPlaceholder":"\uBB34\uC5C7\uC774\uB4E0 \uBB3C\uC5B4\uBCF4\uC138\uC694...","header.searchAddFeature":"\uAE30\uB2A5 \uCD94\uAC00","header.searchSend":"\uBCF4\uB0B4\uAE30","header.searchStartVoice":"\uC74C\uC131 \uC785\uB825 \uC2DC\uC791","header.searchStopVoice":"\uC74C\uC131 \uC785\uB825 \uC911\uC9C0","header.theme.system":"\uD14C\uB9C8: \uC2DC\uC2A4\uD15C","header.theme.dark":"\uD14C\uB9C8: \uB2E4\uD06C","header.theme.light":"\uD14C\uB9C8: \uB77C\uC774\uD2B8","header.menu.setting":"\uC124\uC815","header.menu.refresh":"\uC0C8\uB85C \uACE0\uCE68","header.menu.logout":"\uB85C\uADF8\uC544\uC6C3","navigation.expand":"\uD0D0\uC0C9 \uD3BC\uCE58\uAE30","navigation.collapse":"\uD0D0\uC0C9 \uC811\uAE30","navigation.searchPlaceholder":"\uBA54\uB274 \uAC80\uC0C9...","navigation.noMatch":"\uC77C\uCE58\uD558\uB294 \uBA54\uB274\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4","navigation.noAccessibleApp":"\uC811\uADFC \uAC00\uB2A5\uD55C \uC571\uC774 \uC5C6\uC2B5\uB2C8\uB2E4","navigation.noItems":"\uD45C\uC2DC\uD560 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4","navigation.expandView":"{title} \uD3BC\uCE58\uAE30","navigation.mode.switchToFixed":"\uACE0\uC815 \uD0D0\uC0C9\uC73C\uB85C \uC804\uD658","navigation.mode.switchToFloating":"\uD50C\uB85C\uD305 \uD0D0\uC0C9\uC73C\uB85C \uC804\uD658","navigation.pinned":"\uACE0\uC815\uB428","navigation.pin.add":"\uC0C1\uB2E8\uC5D0 \uACE0\uC815","navigation.pin.remove":"\uACE0\uC815 \uD574\uC81C","table.toolbar.searchPlaceholder":"\uAC80\uC0C9...","table.title.default":"\uB370\uC774\uD130 \uD14C\uC774\uBE14","table.toolbar.groupBy":"\uADF8\uB8F9","table.toolbar.summary":"\uC694\uC57D","table.toolbar.columns":"\uC5F4","table.toolbar.export":"\uB0B4\uBCF4\uB0B4\uAE30","table.toolbar.itemsPerPage":"\uD398\uC774\uC9C0\uB2F9 \uD589 \uC218:","table.toolbar.pageOf":"{current} / {total} \uD398\uC774\uC9C0","table.toolbar.newItem":"\uC2E0\uADDC \uD56D\uBAA9","table.toolbar.editItem":"\uD56D\uBAA9 \uC218\uC815","table.toolbar.deleteItem":"\uD56D\uBAA9 \uC0AD\uC81C","table.toolbar.graphicReport":"\uADF8\uB798\uD504 \uB9AC\uD3EC\uD2B8","table.toolbar.saveLayout":"\uB808\uC774\uC544\uC6C3 \uC800\uC7A5","table.menu.groupBy":"\uADF8\uB8F9","table.menu.clearAll":"\uBAA8\uB450 \uC9C0\uC6B0\uAE30","table.menu.visibleColumns":"\uD45C\uC2DC \uC5F4","table.menu.showSummaryRow":"\uC694\uC57D \uD589 \uD45C\uC2DC","table.menu.noNumericColumns":"\uC22B\uC790 \uC5F4 \uC5C6\uC74C","table.group.expandAll":"\uBAA8\uB4E0 \uADF8\uB8F9 \uD3BC\uCE58\uAE30","table.group.collapseAll":"\uBAA8\uB4E0 \uADF8\uB8F9 \uC811\uAE30","table.mobile.notImplemented":"\uBAA8\uBC14\uC77C \uBDF0\uB294 \uC544\uC9C1 \uAD6C\uD604\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4","table.headerMenu.sortAsc":"\uC624\uB984\uCC28\uC21C \uC815\uB82C","table.headerMenu.sortDesc":"\uB0B4\uB9BC\uCC28\uC21C \uC815\uB82C","table.headerMenu.clearSort":"\uC815\uB82C \uD574\uC81C","table.headerMenu.configureSort":"\uC815\uB82C \uC124\uC815...","table.headerMenu.group":"\uC774 \uC5F4\uB85C \uADF8\uB8F9\uD654","table.headerMenu.ungroup":"\uADF8\uB8F9\uC5D0\uC11C \uC81C\uAC70","table.headerMenu.addSummary":"\uC694\uC57D\uC5D0 \uCD94\uAC00","table.headerMenu.removeSummary":"\uC694\uC57D\uC5D0\uC11C \uC81C\uAC70","table.headerMenu.hideColumn":"\uC5F4 \uC228\uAE30\uAE30","table.sortDialog.title":"\uC815\uB82C \uC124\uC815","table.sortDialog.empty":"\uC815\uB82C \uADDC\uCE59\uC774 \uC5C6\uC2B5\uB2C8\uB2E4. \uCD94\uAC00\uD558\uC138\uC694.","table.sortDialog.addRule":"\uADDC\uCE59 \uCD94\uAC00","table.sortDialog.clearAll":"\uBAA8\uB450 \uC9C0\uC6B0\uAE30","table.sortDialog.asc":"\uC624\uB984\uCC28\uC21C","table.sortDialog.desc":"\uB0B4\uB9BC\uCC28\uC21C","pivot.title.default":"\uD53C\uBC97 \uD14C\uC774\uBE14","pivot.subtitle.default":"\uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uD53C\uBC97 \uD14C\uC774\uBE14\uC744 \uAD6C\uC131\uD558\uC138\uC694.","pivot.empty":"\uACB0\uACFC\uB97C \uBCF4\uB824\uBA74 \uAC12 \uC601\uC5ED\uC5D0 \uCD5C\uC18C \uD55C \uAC1C\uC758 \uD544\uB4DC\uB97C \uCD94\uAC00\uD558\uC138\uC694.","pivot.records":"\uB808\uCF54\uB4DC","pivot.afterFilter":"\uD544\uD130 \uD6C4","pivot.grandTotal":"\uCD1D\uD569","pivot.resultLabel":"\uACB0\uACFC","pivot.valueLabel":"\uAC12","pivot.table.dimensions":"\uCC28\uC6D0","pivot.config.title":"\uAD6C\uC131","pivot.fieldList":"\uD544\uB4DC \uBAA9\uB85D","pivot.availableDimensions":"\uC0AC\uC6A9 \uAC00\uB2A5\uD55C \uCC28\uC6D0","pivot.allFieldsInUse":"\uBAA8\uB4E0 \uD544\uB4DC\uAC00 \uC774\uBBF8 \uC0AC\uC6A9 \uC911\uC785\uB2C8\uB2E4.","pivot.zone.rows":"\uD589","pivot.zone.columns":"\uC5F4","pivot.zone.filters":"\uD544\uD130","pivot.zone.values":"\uAC12","pivot.hint.rows":"\uC5EC\uAE30\uC5D0 \uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uD589 \uACC4\uCE35\uC744 \uAD6C\uC131","pivot.hint.columns":"\uC5EC\uAE30\uC5D0 \uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uC5F4 \uACC4\uCE35\uC744 \uAD6C\uC131","pivot.hint.filters":"\uC5EC\uAE30\uC5D0 \uD544\uB4DC\uB97C \uB4DC\uB798\uADF8\uD558\uC5EC \uBCF4\uACE0\uC11C \uD544\uD130\uB85C \uC0AC\uC6A9","pivot.hint.values":"\uC22B\uC790 \uD544\uB4DC\uB97C \uC5EC\uAE30\uC5D0 \uB4DC\uB798\uADF8\uD558\uC5EC \uC9D1\uACC4","pivot.clearArea":"\uC601\uC5ED \uBE44\uC6B0\uAE30","pivot.filter.na":"\uD574\uB2F9 \uC5C6\uC74C","pivot.filter.noValues":"\uAC12 \uC5C6\uC74C","pivot.filter.noneSelected":"\uC120\uD0DD \uC5C6\uC74C","pivot.filter.allValues":"\uBAA8\uB4E0 \uAC12","pivot.filter.selectedCount":"{selected} / {total} \uC120\uD0DD\uB428","pivot.filter.selectAll":"\uC804\uCCB4 \uC120\uD0DD","pivot.filter.deselectAll":"\uC804\uCCB4 \uD574\uC81C","pivot.filter.noResults":"\uAC80\uC0C9 \uACB0\uACFC \uC5C6\uC74C","pivot.collapse.ariaExpand":"\uAD6C\uC131 \uC601\uC5ED \uD3BC\uCE58\uAE30","pivot.collapse.ariaCollapse":"\uAD6C\uC131 \uC601\uC5ED \uC811\uAE30","pivot.agg.sum":"\uD569\uACC4","pivot.agg.count":"\uAC1C\uC218","pivot.agg.avg":"\uD3C9\uADE0","pivot.agg.min":"\uCD5C\uC18C","pivot.agg.max":"\uCD5C\uB300","pivot.preset.selectPlaceholder":"\uD504\uB9AC\uC14B \uC120\uD0DD","pivot.preset.save":"\uD504\uB9AC\uC14B \uC800\uC7A5","pivot.preset.delete":"\uD504\uB9AC\uC14B \uC0AD\uC81C","pivot.preset.saveDialogTitle":"\uD604\uC7AC \uD504\uB9AC\uC14B \uC800\uC7A5","pivot.preset.nameLabel":"\uD504\uB9AC\uC14B \uC774\uB984","pivot.preset.defaultName":"\uD504\uB9AC\uC14B {index}","pivot.table.sectionTitle":"\uD53C\uBC97 \uACB0\uACFC","pivot.table.expandRowsAll":"Expand rows","pivot.table.collapseRowsAll":"Collapse rows","pivot.table.expandColumnsAll":"Expand columns","pivot.table.collapseColumnsAll":"Collapse columns","pivot.table.collapse.ariaExpand":"\uD53C\uBC97 \uACB0\uACFC \uD3BC\uCE58\uAE30","pivot.table.collapse.ariaCollapse":"\uD53C\uBC97 \uACB0\uACFC \uC811\uAE30","pivot.chart.title":"\uD53C\uBC97 \uCC28\uD2B8","pivot.chart.subtitle":"\uD558\uB098\uC758 \uCC28\uC6D0\uACFC \uCD5C\uB300 \uB450 \uAC1C\uC758 \uCE21\uC815\uAC12\uC744 \uAC04\uACB0\uD55C \uCC28\uD2B8\uB85C \uD45C\uC2DC\uD569\uB2C8\uB2E4.","pivot.chart.subtitleReady":"{dimension}\uBCC4 {measure}","pivot.chart.emptyNoDimension":"\uCC28\uD2B8\uB97C \uBCF4\uB824\uBA74 \uCD5C\uC18C \uD55C \uAC1C\uC758 \uD589 \uB610\uB294 \uC5F4 \uD544\uB4DC\uB97C \uCD94\uAC00\uD558\uC138\uC694.","pivot.chart.emptyNoValue":"\uCC28\uD2B8\uB97C \uBCF4\uB824\uBA74 \uCD5C\uC18C \uD55C \uAC1C\uC758 \uAC12 \uD544\uB4DC\uB97C \uCD94\uAC00\uD558\uC138\uC694.","pivot.chart.emptyNoData":"\uD604\uC7AC \uCC28\uD2B8 \uC120\uD0DD\uC5D0 \uD45C\uC2DC\uD560 \uB370\uC774\uD130\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.","pivot.chart.dimension":"\uCC28\uD2B8 \uCC28\uC6D0","pivot.chart.primaryMeasure":"\uC8FC \uCE21\uC815\uAC12","pivot.chart.secondaryMeasure":"\uBE44\uAD50 \uCE21\uC815\uAC12","pivot.chart.chartType":"\uCC28\uD2B8 \uC720\uD615","pivot.chart.style.barVertical":"\uC138\uB85C \uB9C9\uB300","pivot.chart.style.barHorizontal":"\uAC00\uB85C \uB9C9\uB300","pivot.chart.style.line":"\uC120\uD615 \uCC28\uD2B8","pivot.chart.style.scatter":"\uC0B0\uC810\uB3C4","pivot.chart.collapse.ariaExpand":"\uCC28\uD2B8 \uC601\uC5ED \uD3BC\uCE58\uAE30","pivot.chart.collapse.ariaCollapse":"\uCC28\uD2B8 \uC601\uC5ED \uC811\uAE30","smartFilter.adaptFilters":"\uD544\uD130 \uC870\uC815","smartFilter.addFilters":"\uD544\uD130 \uCD94\uAC00","smartFilter.go":"\uC2E4\uD589","smartFilter.visibleFilters":"\uD45C\uC2DC \uD544\uD130","smartFilter.searchPlaceholder":"\uAC80\uC0C9...","smartFilter.noOptionsFound":"\uC635\uC158\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4","smartFilter.min":"\uCD5C\uC18C","smartFilter.max":"\uCD5C\uB300","smartFilter.minMaxPlaceholder":"\uCD5C\uC18C - \uCD5C\uB300","smartFilter.operator.equals":"\uAC19\uC74C","smartFilter.operator.contains":"\uD3EC\uD568","smartFilter.operator.notContains":"\uBBF8\uD3EC\uD568","smartFilter.operator.wildcard":"\uC640\uC77C\uB4DC\uCE74\uB4DC \uAC80\uC0C9","smartFilter.operator.notEquals":"\uAC19\uC9C0 \uC54A\uC74C","smartFilter.operator.greaterThan":"\uBCF4\uB2E4 \uD07C","smartFilter.operator.lessThan":"\uBCF4\uB2E4 \uC791\uC74C","smartFilter.operator.greaterOrEqual":"\uC774\uC0C1","smartFilter.operator.lessOrEqual":"\uC774\uD558","smartFilter.operator.between":"\uBC94\uC704","variant.noOptions":"\uC635\uC158 \uC5C6\uC74C","variant.defaultSuffix":"\uAE30\uBCF8","variant.selectVariant":"\uBDF0 \uC120\uD0DD","variant.saveView":"\uBDF0 \uC800\uC7A5","variant.newVariant":"\uC0C8 \uBDF0","variant.viewName":"\uBDF0 \uC774\uB984","variant.setDefault":"\uAE30\uBCF8\uC73C\uB85C \uC124\uC815","variant.publicAllUsers":"\uACF5\uAC1C(\uC804\uCCB4 \uC0AC\uC6A9\uC790)","variant.toast.fetchFailed":"\uBDF0\uB97C \uBD88\uB7EC\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.saveFailed":"\uBDF0\uB97C \uC800\uC7A5\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.saveSuccess":"\uBDF0\uAC00 \uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4","variant.toast.deleteFailed":"\uBDF0\uB97C \uC0AD\uC81C\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.deleteSuccess":"\uBDF0\uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4","variant.toast.defaultFailed":"\uAE30\uBCF8 \uBDF0\uB97C \uC5C5\uB370\uC774\uD2B8\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4","variant.toast.defaultSuccess":"\uAE30\uBCF8 \uBDF0\uAC00 \uC5C5\uB370\uC774\uD2B8\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.saveLayout":"\uB808\uC774\uC544\uC6C3 \uC800\uC7A5","layout.layoutOptions":"\uB808\uC774\uC544\uC6C3 \uC635\uC158","layout.selectLayout":"\uB808\uC774\uC544\uC6C3 \uC120\uD0DD","layout.saveCurrentLayout":"\uD604\uC7AC \uB808\uC774\uC544\uC6C3 \uC800\uC7A5...","layout.noSavedLayouts":"\uC800\uC7A5\uB41C \uB808\uC774\uC544\uC6C3 \uC5C6\uC74C","layout.removeDefault":"\uAE30\uBCF8 \uD574\uC81C","layout.setAsDefault":"\uAE30\uBCF8\uC73C\uB85C \uC124\uC815","layout.layoutName":"\uB808\uC774\uC544\uC6C3 \uC774\uB984","layout.layoutDescription":"\uC124\uBA85","layout.layoutNameHelper":"\uC608: \uCEF4\uD329\uD2B8 \uBDF0","layout.warningOverwrite":"\uACBD\uACE0: \uAE30\uC874 \uB808\uC774\uC544\uC6C3\uC774 \uB36E\uC5B4\uC4F0\uAE30 \uB429\uB2C8\uB2E4","layout.useAsDefault":"\uAE30\uBCF8 \uB808\uC774\uC544\uC6C3\uC73C\uB85C \uC0AC\uC6A9","layout.publicAllUsers":"\uACF5\uAC1C(\uBAA8\uB4E0 \uC0AC\uC6A9\uC790\uC5D0\uAC8C \uD45C\uC2DC)","layout.toast.loadFallback":"\uBC31\uC5D4\uB4DC\uC5D0\uC11C \uB808\uC774\uC544\uC6C3\uC744 \uBD88\uB7EC\uC624\uC9C0 \uBABB\uD574 \uB85C\uCEEC \uC800\uC7A5\uC18C\uB85C \uC804\uD658\uD588\uC2B5\uB2C8\uB2E4","layout.toast.saveSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.saveLocalSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uB85C\uCEEC \uC800\uC7A5\uC18C\uC5D0 \uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.backendUnavailableSavedLocal":"\uBC31\uC5D4\uB4DC\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC5B4 \uB85C\uCEEC\uC5D0 \uC800\uC7A5\uD588\uC2B5\uB2C8\uB2E4","layout.toast.deleteSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.deleteLocalSuccess":"\uB808\uC774\uC544\uC6C3\uC774 \uB85C\uCEEC \uC800\uC7A5\uC18C\uC5D0\uC11C \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.backendUnavailableDeletedLocal":"\uBC31\uC5D4\uB4DC\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC5B4 \uB85C\uCEEC\uC5D0\uC11C \uC0AD\uC81C\uD588\uC2B5\uB2C8\uB2E4","layout.toast.defaultSuccess":"\uAE30\uBCF8 \uB808\uC774\uC544\uC6C3\uC774 \uC124\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.defaultLocalSuccess":"\uAE30\uBCF8 \uB808\uC774\uC544\uC6C3\uC774 \uB85C\uCEEC\uC5D0 \uC124\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4","layout.toast.backendUnavailableDefaultLocal":"\uBC31\uC5D4\uB4DC\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC5B4 \uAE30\uBCF8\uAC12\uC744 \uB85C\uCEEC\uC5D0 \uC800\uC7A5\uD588\uC2B5\uB2C8\uB2E4","dateRange.label":"\uB0A0\uC9DC \uBC94\uC704","dateRange.startDate":"\uC2DC\uC791\uC77C","dateRange.endDate":"\uC885\uB8CC\uC77C","dateRange.select":"\uC120\uD0DD...","dateRange.today":"\uC624\uB298","dateRange.thisWeek":"\uC774\uBC88 \uC8FC","dateRange.thisMonth":"\uC774\uBC88 \uB2EC","graph.records":"{count}\uAC74","graph.kpi.totalRecords":"\uCD1D \uB808\uCF54\uB4DC","graph.kpi.totalReport":"\uCD1D \uBCF4\uACE0 \uC2DC\uAC04","graph.kpi.totalBillable":"\uCD1D \uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04","graph.kpi.efficiency":"\uD6A8\uC728","graph.kpi.amount":"\uAE08\uC561","graph.kpi.flagged":"\uD50C\uB798\uADF8","graph.chart.billable.title":"\uCC28\uC6D0\uBCC4 \uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04","graph.chart.billable.subtitle":"\uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04 \uC0C1\uC704 \uAC12","graph.chart.efficiency.title":"\uB2F4\uB2F9\uC790\uBCC4 \uD6A8\uC728","graph.chart.efficiency.subtitle":"\uB0AE\uC740 \uD6A8\uC728 \uC6B0\uC120","graph.chart.status.title":"\uC0C1\uD0DC \uBD84\uD3EC","graph.chart.status.subtitle":"\uC0C1\uD0DC\uBCC4 \uBE44\uC728","graph.dataBody":"\uB370\uC774\uD130 \uBCF8\uBB38","graph.reportTitle":"\uADF8\uB798\uD504 \uB9AC\uD3EC\uD2B8","graph.unassigned":"\uBBF8\uC9C0\uC815","graph.column.reportHours":"\uBCF4\uACE0 \uC2DC\uAC04","graph.column.billableHours":"\uCCAD\uAD6C \uAC00\uB2A5 \uC2DC\uAC04","detail.searchAi.placeholder":"\uD544\uB4DC\uB97C \uAC80\uC0C9\uD558\uACE0, \uACB0\uACFC\uAC00 \uC5C6\uC73C\uBA74 AI\uC5D0 \uC9C8\uBB38\uD558\uC138\uC694...","detail.searchAi.matches":"{count}\uAC1C \uC77C\uCE58 \uD56D\uBAA9","detail.searchAi.noMatch":"\uC77C\uCE58\uD558\uB294 \uD544\uB4DC\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.","detail.searchAi.autoAiFallback":"\uC77C\uCE58 \uD56D\uBAA9\uC774 \uC5C6\uC5B4 AI \uBD84\uC11D\uC744 \uC2E4\uD589\uD569\uB2C8\uB2E4...","detail.searchAi.aiResultTitle":"AI \uBD84\uC11D \uACB0\uACFC","detail.table.title":"\uAD00\uB828 \uB808\uCF54\uB4DC","kanban.empty":"\uC5EC\uAE30\uC5D0 \uCE74\uB4DC\uB97C \uB193\uC73C\uC138\uC694","kanban.bucket.limit":"\uD55C\uB3C4","kanban.bucket.dropHere":"\uB193\uC73C\uBA74 \uC774 \uBC84\uD0B7\uC73C\uB85C \uC774\uB3D9\uD569\uB2C8\uB2E4","kanban.bucket.add":"\uBC84\uD0B7 \uCD94\uAC00","kanban.bucket.rename":"\uBC84\uD0B7 \uC774\uB984 \uBCC0\uACBD","kanban.bucket.saveRename":"\uBC84\uD0B7 \uC774\uB984 \uC800\uC7A5","kanban.bucket.cancelRename":"\uC774\uB984 \uBCC0\uACBD \uCDE8\uC18C","kanban.search.placeholder":"\uCE74\uB4DC \uBC0F \uBC84\uD0B7 \uAC80\uC0C9","kanban.search.clear":"\uAC80\uC0C9 \uC9C0\uC6B0\uAE30","kanban.search.results":"\uC77C\uCE58\uD558\uB294 \uCE74\uB4DC {count}\uAC1C","kanban.search.noMatch":"\uC77C\uCE58\uD558\uB294 \uCE74\uB4DC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4","kanban.card.progress":"\uC9C4\uD589\uB960","kanban.card.openDetail":"\uC0C1\uC138 \uC5F4\uAE30","kanban.priority.critical":"\uAE34\uAE09","kanban.priority.high":"\uB192\uC74C","kanban.priority.medium":"\uBCF4\uD1B5","kanban.priority.low":"\uB0AE\uC74C","quickCreate.newItem":"\uC2E0\uADDC \uD56D\uBAA9","quickCreate.createWithTitle":"{title} \uC0DD\uC131","quickEdit.editWithTitle":"{title} \uC218\uC815","quickDelete.confirmTitle":"\uC0AD\uC81C \uD655\uC778","quickDelete.confirmMessageSingle":"\uC120\uD0DD\uD55C \uD56D\uBAA9\uC744 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?","quickDelete.confirmMessageMultiple":"\uC120\uD0DD\uD55C {count}\uAC1C \uD56D\uBAA9\uC744 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?","cardPage.viewDetails":"\uC0C1\uC138 \uBCF4\uAE30","cardPage.download":"\uB2E4\uC6B4\uB85C\uB4DC","cardPage.close":"\uB2EB\uAE30","cardPage.empty":"\uD56D\uBAA9\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4","messageBox.confirm":"\uD655\uC778","messageBox.cancel":"\uCDE8\uC18C"},Wn={en:Tf,zh:If,fr:Mf,de:Rf,ja:Df,ko:Nf};var Vc=(t,r)=>r?t.replace(/\{(\w+)\}/g,(o,n)=>{let a=r[n];return a==null?"":String(a)}):t,Of={locale:"en",t:(t,r)=>Vc(Wn.en[t]||t,r)},Wc=createContext(Of),Ba=({locale:t="en",messages:r,children:o})=>{let n=useMemo(()=>{let a=Wn[t]||Wn.en,i=r?.[t]||{},s={...Wn.en,...a,...i};return {locale:t,t:(l,d)=>Vc(s[l]||l,d)}},[t,r]);return f(Wc.Provider,{value:n,children:o})},de=()=>useContext(Wc);function $n({items:t,onItemClick:r,className:o="",level:n=0,expandedIds:a,onToggleExpand:i,colorMode:s="light",enablePinning:l=false,pinnedIds:d,onTogglePin:p}){let{t:u}=de(),f$1=s==="dark",h=usePathname(),[m,v]=useState(false),[y,g$1]=useState(new Set),x=a!==void 0&&i!==void 0,b=x?a:y;useEffect(()=>{v(true);},[]);let C=S=>{if(x)i(S);else {let k=new Set(y);k.has(S)?k.delete(S):k.add(S),g$1(k);}},P=S=>{S.children&&S.children.length>0&&C(S.id),r&&r(S);};return !t||!Array.isArray(t)?f("div",{className:mr("tree-menu",o),children:f("div",{className:"text-sm text-[var(--orb-muted)] p-2",children:u("navigation.noItems")})}):f("div",{className:mr("tree-menu",o),children:t.map(S=>{let k=b.has(S.id)||S.isExpanded,I=S.children&&S.children.length>0,A=56+Math.max(0,n-1)*8,R=n===0?12:I?A-24:A,T=S.appurl||S.href,N=m&&T?h===T:false,D=d?.has(S.id)??false,L=l&&S.pinnable!==false&&!!T&&!I;return g("div",{className:"tree-menu-item relative",children:[N&&f("div",{className:mr("absolute left-0 top-2 bottom-2 w-[3px] rounded-r-full z-10","bg-[var(--orb-nav-active-fg)]")}),g(Ls,{variant:"ghost",className:mr("w-full justify-start h-auto py-2 relative overflow-hidden group",n>0?"gap-1":"gap-2",I&&k&&!N?f$1?"bg-[color-mix(in_oklch,var(--orb-inverse-fg)_5%,transparent)] text-[var(--orb-fg)] hover:bg-[color-mix(in_oklch,var(--orb-inverse-fg)_8%,transparent)]":"bg-[color-mix(in_oklch,var(--orb-surface)_70%,transparent)] text-[var(--orb-fg)] hover:bg-[var(--orb-surface)]":"",n>=2?"min-h-9 py-1.5 rounded-md":n>0?"min-h-10 rounded-lg":"rounded-lg",N?f$1?"bg-transparent text-[var(--orb-nav-active-fg)] hover:bg-[color-mix(in_oklch,var(--orb-surface-2)_35%,transparent)]":"bg-transparent text-[var(--orb-nav-active-fg)] hover:bg-[color-mix(in_oklch,var(--orb-surface)_60%,transparent)]":f$1?"hover:bg-[color-mix(in_oklch,var(--orb-surface-2)_50%,transparent)] text-[var(--orb-fg)]":"hover:bg-[color-mix(in_oklch,var(--orb-surface)_50%,transparent)] text-[var(--orb-fg)]"),style:{paddingLeft:`${R}px`,paddingRight:L?"34px":"10px"},onClick:()=>P(S),children:[I&&f("div",{className:mr("flex-shrink-0 transition-transform duration-200",k&&"rotate-90",N?"text-[var(--orb-nav-active-fg)]":f$1?"text-[var(--orb-muted)] group-hover:text-[var(--orb-fg)]":"text-[var(--orb-muted)] group-hover:text-[var(--orb-muted)]"),children:f(Or,{className:"h-4 w-4"})}),S.icon&&f("div",{className:mr("flex h-4 w-4 flex-shrink-0 items-center justify-center transition-colors duration-200",N?"text-[var(--orb-nav-active-fg)]":f$1?"text-[var(--orb-muted)] group-hover:text-[var(--orb-fg)]":"text-[var(--orb-muted)] group-hover:text-[var(--orb-muted)]"),children:S.icon}),g("div",{className:"flex-1 text-left overflow-hidden z-10",children:[f("div",{className:mr("text-sm truncate transition-colors duration-200",N?"font-semibold":"font-medium"),children:S.title||S.label}),S.description&&f("div",{className:mr("text-xs truncate transition-colors duration-200",N?f$1?"text-[color-mix(in_oklch,var(--orb-nav-active-fg)_70%,transparent)]":"text-[color-mix(in_oklch,var(--orb-nav-active-fg)_75%,transparent)]":"text-[var(--orb-muted)]"),title:S.description,children:S.description})]})]}),L&&p&&f("button",{type:"button","aria-label":u(D?"navigation.pin.remove":"navigation.pin.add"),"aria-pressed":D,title:u(D?"navigation.pin.remove":"navigation.pin.add"),onClick:B=>{B.preventDefault(),B.stopPropagation(),p(S);},className:mr("orb-navigation-pin-button absolute right-1 top-1/2 z-20 flex h-7 w-7 -translate-y-1/2 items-center justify-center rounded-md transition-colors duration-150",D&&"orb-is-pinned"),children:f(Zo,{className:mr("h-3.5 w-3.5",D&&"fill-current")})}),I&&f("div",{className:mr("grid transition-[grid-template-rows] duration-300 ease-in-out",k?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:f("div",{className:mr("overflow-hidden",k&&"pt-1"),children:f($n,{items:S.children,onItemClick:r,level:n+1,expandedIds:a,onToggleExpand:i,colorMode:s,enablePinning:l,pinnedIds:d,onTogglePin:p})})})]},S.id)})})}var zf="orbcafe:navigation-island:pinned-items",Os="orbcafe-navigation-pinned",Vf=t=>t.appurl||t.href,Gc=t=>{let r=[];return t.forEach(o=>{let n=!!o.children?.length;o.pinnable!==false&&Vf(o)&&!n&&r.push({...o,children:void 0}),o.children?.length&&r.push(...Gc(o.children));}),r},_c=({collapsed:t,onToggle:r,className:o="",maxHeight:n,menuData:a=[],colorMode:i="light",displayMode:s="fixed",onDisplayModeChange:l,showDisplayModeToggle:d=true,enablePinning:p=true,pinStorageKey:u=zf,pinnedItemIds:f$1,defaultPinnedItemIds:h=[],onPinnedItemIdsChange:m,pinnedSectionTitle:v})=>{let{t:y}=de(),g$1=i==="dark",x=s==="floating",b=useRouter(),[C,P]=useState(""),[S,k]=useState(new Set),[I,w]=useState(h),[A,R]=useState(false),T=f$1!==void 0,N=useMemo(()=>f$1??I,[f$1,I]),D=useMemo(()=>new Set(N),[N]);useEffect(()=>{t&&k(new Set);},[t]),useEffect(()=>{if(!p||T){R(true);return}try{let O=window.localStorage.getItem(u);if(O){let Y=JSON.parse(O);Array.isArray(Y)&&w(Y.filter(Q=>typeof Q=="string"));}}catch{}finally{R(true);}},[p,T,u]),useEffect(()=>{if(!(!p||T||!A))try{window.localStorage.setItem(u,JSON.stringify(N));}catch{}},[N,p,T,u,A]),useEffect(()=>{!p||t||N.length===0||k(O=>{if(O.has(Os))return O;let Y=new Set(O);return Y.add(Os),Y});},[t,N.length,p]);let L=useCallback(O=>{let Y=Array.from(new Set(O));T||w(Y),m?.(Y);},[T,m]),B=useCallback(O=>{let Y=O.id,Q=D.has(Y)?N.filter(me=>me!==Y):[...N,Y];L(Q);},[N,D,L]),X=useMemo(()=>{if(!p||N.length===0)return a;let O=new Map(Gc(a).map(Q=>[Q.id,Q])),Y=N.map(Q=>O.get(Q)).filter(Q=>!!Q);return Y.length===0?a:[{id:Os,title:v||y("navigation.pinned"),icon:f(Zo,{className:"w-4 h-4"}),children:Y,pinnable:false},...a]},[N,p,a,v,y]),H=useCallback(O=>{let Y=[],Q=me=>{me.forEach(ie=>{Y.push(ie.id),ie.children&&Q(ie.children);});};return Q(O),Y},[]),K=useMemo(()=>{if(!C.trim())return X;let O=Y=>Y.reduce((Q,me)=>{let ie=me.title?.toLowerCase().includes(C.toLowerCase())||me.description?.toLowerCase().includes(C.toLowerCase()),se=me.children?O(me.children):[];return (ie||se.length>0)&&Q.push({...me,children:se.length>0?se:me.children}),Q},[]);return O(X)},[C,X]),W=useMemo(()=>C.trim()?new Set(H(X)):S,[C,X,S,H]),G=useCallback(async O=>{if(console.log("\u{1F5B1}\uFE0F \u5BFC\u822A\u83DC\u5355\u9879\u70B9\u51FB:",O),O.id==="chat"||O.appurl==="/chat"){console.log("\u{1F4AC} \u68C0\u6D4B\u5230chat\u83DC\u5355\u70B9\u51FB\uFF0C\u8DF3\u8F6C\u5230\u65B0\u7684\u804A\u5929\u89C6\u56FE");try{b.push("/chat?new=true");}catch(Q){console.error("\u274C \u65E0\u6CD5\u8DF3\u8F6C\u5230\u65B0\u804A\u5929\u89C6\u56FE:",Q),b.push("/chat");}return}let Y=O.appurl||O.href;Y&&(Y.startsWith("http://")||Y.startsWith("https://")?window.open(Y,"_blank"):b.push(Y));},[b]),z=useCallback(()=>{l?.(s==="fixed"?"floating":"fixed");},[s,l]);return g("div",{className:`flex flex-col backdrop-blur-xl border ${x?"shadow-[0_28px_80px_rgba(15,23,42,0.34)]":"shadow-[0_4px_8px_0_rgba(31,38,135,0.1)]"} ${t?"w-14 rounded-full":"w-[234px] rounded-2xl"} relative ${o} ${g$1?x?"border-white/25":"bg-[var(--orb-nav-bg)] border-white/10":x?"border-white/70":"bg-[color-mix(in_oklch,var(--orb-canvas)_70%,transparent)] border-white/30"}`,style:{backdropFilter:x?"blur(34px) saturate(230%) contrast(1.12)":"blur(16px) saturate(180%)",WebkitBackdropFilter:x?"blur(34px) saturate(230%) contrast(1.12)":"blur(16px) saturate(180%)",backgroundColor:x?g$1?"rgba(8, 12, 18, 0.34)":"rgba(255, 255, 255, 0.24)":void 0,backgroundImage:x?g$1?"radial-gradient(circle at 28% 8%, rgba(255,255,255,0.14), rgba(255,255,255,0) 44%), linear-gradient(145deg, rgba(255,255,255,0.08), rgba(255,255,255,0.015) 50%, color-mix(in oklch, var(--orb-ai-accent) 5%, transparent))":"radial-gradient(circle at 28% 8%, rgba(255,255,255,0.42), rgba(255,255,255,0) 46%), linear-gradient(145deg, rgba(255,255,255,0.22), rgba(255,255,255,0.07) 50%, color-mix(in oklch, var(--orb-ai-accent) 8%, transparent))":void 0,boxShadow:x?g$1?"inset 0 1px 0 rgba(255,255,255,0.20), inset 0 -1px 0 rgba(255,255,255,0.08), 0 26px 90px rgba(0,0,0,0.52), 0 0 0 1px rgba(255,255,255,0.06)":"inset 0 1px 0 rgba(255,255,255,0.88), inset 0 -1px 0 rgba(255,255,255,0.34), 0 26px 90px rgba(15,23,42,0.24), 0 0 0 1px rgba(255,255,255,0.35)":void 0,transition:"width 400ms cubic-bezier(0.4, 0.0, 0.2, 1), border-radius 0ms cubic-bezier(0.4, 0.0, 0.2, 1), box-shadow 400ms ease-out, background-color 220ms ease-out, backdrop-filter 220ms ease-out",maxHeight:n?`${n}px`:void 0},children:[f("div",{className:`pt-4 pb-2 transition-all duration-500 ease-in-out ${t?"px-1":"px-2"}`,children:t?f("div",{className:"flex justify-center",children:f("button",{onClick:r,className:`w-10 h-10 flex items-center justify-center rounded-lg transition-colors duration-200 ${g$1?"text-[var(--orb-fg)] hover:bg-[var(--orb-surface-2)]":"text-[var(--orb-muted)] hover:bg-[var(--orb-surface)]"}`,title:y("navigation.expand"),children:f(Fr,{className:"h-5 w-5"})})}):g("div",{className:`relative transition-opacity duration-300 ${t?"opacity-0":"opacity-100 delay-200"}`,children:[f("input",{type:"text",placeholder:y("navigation.searchPlaceholder"),value:C,onChange:O=>P(O.target.value),className:`w-full pl-10 pr-4 py-2 text-sm border rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--orb-primary)] focus:border-transparent ${g$1?"border-[var(--orb-border)] bg-[var(--orb-surface-2)] text-[var(--orb-fg)] placeholder-[var(--orb-muted)]":"border-[var(--orb-border)] bg-[var(--orb-canvas)] text-[var(--orb-fg)] placeholder-[var(--orb-muted)]"}`}),f("div",{className:"absolute left-3 top-1/2 transform -translate-y-1/2 pointer-events-none",children:f(Fr,{className:"h-4 w-4 text-[var(--orb-muted)]"})})]})}),f("nav",{className:`flex-1 pb-4 transition-all duration-500 ease-in-out overflow-y-auto min-h-0 ${t?"px-1":"px-2"}`,children:K.length===0?f("div",{className:"flex items-center justify-center py-8 text-[var(--orb-muted)] text-sm",children:t?f(An,{className:"h-5 w-5"}):y(C?"navigation.noMatch":"navigation.noAccessibleApp")}):g(e,{children:[!t&&f("div",{className:`transition-opacity duration-300 ${t?"opacity-0":"opacity-100 delay-200"}`,children:f($n,{items:K,onItemClick:G,className:"space-y-1",expandedIds:W,colorMode:i,enablePinning:p,pinnedIds:D,onTogglePin:B,onToggleExpand:O=>{let Y=new Set(S);K.some(me=>me.id===O)?Y.has(O)?Y.delete(O):(K.forEach(me=>{me.id!==O&&Y.has(me.id)&&Y.delete(me.id);}),Y.add(O)):Y.has(O)?Y.delete(O):Y.add(O),k(Y);}})}),t&&f("div",{className:"space-y-2",children:X.map(O=>f("div",{className:"space-y-1",children:f("button",{onClick:()=>{r();let Y=new Set([O.id]);k(Y);},className:`w-full flex items-center justify-center p-2 rounded-lg cursor-pointer transition-colors duration-200 ${g$1?"text-[var(--orb-muted)] hover:bg-[var(--orb-surface-2)]":"text-[var(--orb-muted)] hover:bg-[var(--orb-surface)]"}`,title:y("navigation.expandView",{title:O.title||""}),children:O.icon||f("div",{className:`w-6 h-6 rounded text-xs flex items-center justify-center font-medium ${g$1?"bg-[var(--orb-nav-active-fg)] text-[#0b0b0b]":"bg-[var(--orb-primary)] text-[var(--orb-on-primary)]"}`,children:O.title?.charAt(0)||"?"})})},O.id))})]})}),!t&&f("button",{onClick:r,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 ${g$1?"hover:bg-[color-mix(in_oklch,var(--orb-surface-2)_50%,transparent)]":"hover:bg-[color-mix(in_oklch,var(--orb-canvas)_20%,transparent)]"}`,title:y("navigation.collapse"),children:f("div",{className:"absolute",style:{bottom:"0px",right:"0px",width:"16px",height:"16px",overflow:"hidden"},children:f("div",{className:g$1?"border-[var(--orb-status-warning)]":"",style:{width:"32px",height:"32px",borderRadius:"16px",border:"3px solid var(--orb-ai-accent)",backgroundColor:"transparent",position:"absolute",top:"-16px",left:"-16px"}})})}),d&&t&&f("button",{type:"button",onClick:z,className:`absolute -bottom-4 left-1/2 z-30 flex h-9 w-9 -translate-x-1/2 items-center justify-center rounded-full border shadow-md transition-colors focus:outline-none focus:ring-2 focus:ring-[color-mix(in_oklch,var(--orb-primary)_45%,transparent)] ${g$1?"border-[var(--orb-border)] bg-[var(--orb-surface-2)] text-[var(--orb-fg)] hover:bg-[var(--orb-hover)]":"border-[var(--orb-border)] bg-[var(--orb-canvas)] text-[var(--orb-status-fg)] hover:bg-[var(--orb-p50)] hover:text-[var(--orb-status-primary)]"}`,style:{touchAction:"manipulation"},title:y(x?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),"aria-label":y(x?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),children:x?f(Ia,{className:"h-4 w-4"}):f(Ma,{className:"h-4 w-4"})})]})};var $f="orbcafe:navigation-island:pinned-items",Fs="orbcafe-navigation-pinned",Uc=t=>t.appurl||t.href,Kc=t=>t.flatMap(r=>{let o=!!r.children?.length,n=r.pinnable!==false&&Uc(r)&&!o?[{...r,children:void 0}]:[];return r.children?.length?[...n,...Kc(r.children)]:n}),qc=t=>t.flatMap(r=>[r.id,...r.children?qc(r.children):[]]),Xc=(t,r)=>t.reduce((o,n)=>{let a=n.children?Xc(n.children,r):[];return ([n.title,n.label,n.description].some(s=>s?.toLocaleLowerCase().includes(r))||a.length>0)&&o.push({...n,children:a.length>0?a:n.children}),o},[]),Bs=({collapsed:t,onToggle:r,className:o="",maxHeight:n,menuData:a=[],colorMode:i="light",displayMode:s="fixed",onDisplayModeChange:l,showDisplayModeToggle:d=true,enablePinning:p=true,pinStorageKey:u=$f,pinnedItemIds:f$1,defaultPinnedItemIds:h=[],onPinnedItemIdsChange:m,pinnedSectionTitle:v})=>{let{t:y}=de(),g$1=useRouter(),x=s==="floating",[b,C]=useState(""),[P,S]=useState(new Set),[k,I]=useState(h),[w,A]=useState(false),R=f$1!==void 0,T=f$1??k,N=useMemo(()=>new Set(T),[T]);useEffect(()=>{t&&S(new Set);},[t]),useEffect(()=>{if(!p||R){A(true);return}try{let O=window.localStorage.getItem(u);if(O){let Y=JSON.parse(O);Array.isArray(Y)&&I(Y.filter(Q=>typeof Q=="string"));}}catch{}finally{A(true);}},[p,R,u]),useEffect(()=>{if(!(!p||R||!w))try{window.localStorage.setItem(u,JSON.stringify(T));}catch{}},[T,p,R,u,w]),useEffect(()=>{!p||t||T.length===0||S(O=>{if(O.has(Fs))return O;let Y=new Set(O);return Y.add(Fs),Y});},[t,T.length,p]);let D=useCallback(O=>{let Y=Array.from(new Set(O));R||I(Y),m?.(Y);},[R,m]),L=useCallback(O=>{D(N.has(O.id)?T.filter(Y=>Y!==O.id):[...T,O.id]);},[T,N,D]),B=useMemo(()=>{if(!p||T.length===0)return a;let O=new Map(Kc(a).map(Q=>[Q.id,Q])),Y=T.map(Q=>O.get(Q)).filter(Q=>!!Q);return Y.length===0?a:[{id:Fs,title:v||y("navigation.pinned"),icon:f(Zo,{className:"h-4 w-4"}),children:Y,pinnable:false},...a]},[T,p,a,v,y]),X=b.trim().toLocaleLowerCase(),H=useMemo(()=>X?Xc(B,X):B,[B,X]),K=useMemo(()=>X?new Set(qc(H)):P,[P,H,X]),W=useCallback(O=>{S(Y=>{let Q=new Set(Y),me=H.some(ie=>ie.id===O);return Q.has(O)?Q.delete(O):(me&&H.forEach(ie=>Q.delete(ie.id)),Q.add(O)),Q});},[H]),G=useCallback(O=>{let Y=Uc(O);Y&&(O.id==="chat"||O.appurl==="/chat"?g$1.push("/chat?new=true"):/^https?:\/\//.test(Y)?window.open(Y,"_blank","noopener,noreferrer"):g$1.push(Y));},[g$1]),z=O=>{r(),S(new Set([O.id]));};return g("aside",{"data-navigation-island":"v2","data-collapsed":t||void 0,className:`orb-navigation-island-v2 relative flex flex-col border ${t?"w-14":"w-[234px]"} ${o}`,style:{maxHeight:n?`${n}px`:void 0,transition:"width 320ms cubic-bezier(0.4, 0, 0.2, 1), border-radius 220ms ease, box-shadow 220ms ease"},"aria-label":"Navigation",children:[f("div",{className:`orb-navigation-island-v2-search ${t?"px-1":"px-2"}`,children:t?f("button",{type:"button",onClick:r,className:"mx-auto flex h-10 w-10 items-center justify-center rounded-lg text-[var(--orb-muted)] transition-colors hover:bg-[var(--orb-p50)] hover:text-[var(--orb-status-primary)]",title:y("navigation.expand"),"aria-label":y("navigation.expand"),children:f(Fr,{className:"h-5 w-5"})}):g("label",{className:"relative block",children:[f("span",{className:"orb-visually-hidden",children:y("navigation.searchPlaceholder")}),f(Fr,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-[var(--orb-muted)]"}),f("input",{type:"search",value:b,onChange:O=>C(O.target.value),placeholder:y("navigation.searchPlaceholder"),className:"w-full py-2 pl-10 pr-3 text-sm outline-none"})]})}),f("nav",{className:`min-h-0 flex-1 overflow-y-auto pb-2 ${t?"px-1":"px-2"}`,children:H.length===0?f("div",{className:"flex items-center justify-center py-8 text-sm text-[var(--orb-muted)]",children:t?f(An,{className:"h-5 w-5"}):y(X?"navigation.noMatch":"navigation.noAccessibleApp")}):t?f("div",{className:"space-y-1",children:B.map(O=>f("button",{type:"button",onClick:()=>z(O),className:"flex h-10 w-full items-center justify-center rounded-lg text-[var(--orb-muted)] transition-colors hover:bg-[var(--orb-p50)] hover:text-[var(--orb-status-primary)]",title:y("navigation.expandView",{title:O.title||O.label||""}),children:O.icon||f(An,{className:"h-5 w-5"})},O.id))}):f($n,{items:H,onItemClick:G,className:"space-y-1",expandedIds:K,onToggleExpand:W,colorMode:i,enablePinning:p,pinnedIds:N,onTogglePin:L})}),d&&t&&f("div",{className:"orb-navigation-island-v2-footer flex flex-col items-center gap-1 border-t px-1 py-2",children:f("button",{type:"button",onClick:()=>l?.(x?"fixed":"floating"),className:"flex h-9 w-9 items-center justify-center rounded-lg text-[var(--orb-muted)] transition-colors hover:bg-[var(--orb-p50)] hover:text-[var(--orb-status-primary)]",title:y(x?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),"aria-label":y(x?"navigation.mode.switchToFixed":"navigation.mode.switchToFloating"),children:x?f(Ia,{className:"h-4 w-4"}):f(Ma,{className:"h-4 w-4"})})}),!t&&f("button",{type:"button",onClick:r,className:"absolute -bottom-1 -right-1 z-20 flex h-6 w-6 items-center justify-center rounded-full bg-transparent transition-all duration-300 ease-in-out",title:y("navigation.collapse"),"aria-label":y("navigation.collapse"),children:f("span",{"aria-hidden":"true",className:"absolute overflow-hidden",style:{bottom:0,right:0,width:16,height:16},children:f("span",{className:"absolute rounded-full border-[3px] border-[var(--orb-ai-accent)]",style:{width:32,height:32,top:-16,left:-16}})})})]})};Bs.displayName="NavigationIsland2";var Zc=(t={})=>{let{initialCollapsed:r=false,initialDisplayMode:o="fixed",content:n=[],enablePinning:a,pinStorageKey:i,pinnedItemIds:s,defaultPinnedItemIds:l,onPinnedItemIdsChange:d,pinnedSectionTitle:p}=t,[u,f]=useState(r),[h,m]=useState(o),[v,y]=useState(n),g=useCallback(()=>{f(C=>!C);},[]),x=useCallback(()=>{m(C=>C==="fixed"?"floating":"fixed");},[]),b=useMemo(()=>({collapsed:u,onToggle:g,menuData:v,displayMode:h,onDisplayModeChange:m,enablePinning:a,pinStorageKey:i,pinnedItemIds:s,defaultPinnedItemIds:l,onPinnedItemIdsChange:d,pinnedSectionTitle:p}),[u,g,v,h,m,a,i,s,l,d,p]);return {collapsed:u,setCollapsed:f,toggleCollapsed:g,displayMode:h,setDisplayMode:m,toggleDisplayMode:x,menuData:v,setMenuData:y,navigationIslandProps:b}};var zs=class{constructor(){a(this,"listener",null);}register(r){this.listener=r;}unregister(){this.listener=null;}show(r,o,n){this.listener&&this.listener({type:r,content:o,options:n});}hide(){this.listener&&this.listener(null);}},oo=new zs,Jk={success:(t,r)=>oo.show("success",t,r),error:(t,r)=>oo.show("error",t,r),warning:(t,r)=>oo.show("warning",t,r),info:(t,r)=>oo.show("info",t,r),show:(t,r,o)=>oo.show(t,r,o),hide:()=>oo.hide()};var _f={success:{icon:f(Nn,{size:40}),color:"var(--orb-success-bg)",iconColor:"var(--orb-success)"},warning:{icon:f(Na,{size:40}),color:"var(--orb-warn-bg)",iconColor:"var(--orb-warn)"},error:{icon:f(xa,{size:40}),color:"var(--orb-err-bg)",iconColor:"var(--orb-err)"},info:{icon:f(wa,{size:40}),color:"var(--orb-info-bg)",iconColor:"var(--orb-info)"},default:{icon:null,color:"transparent",iconColor:"inherit"}},Un=({open:t,title:r,message:o,onClose:n,onConfirm:a,confirmText:i,cancelText:s,showCancel:l=true,maxWidth:d="xs",type:p="default"})=>{let{t:u}=de(),f$1=i||u("messageBox.confirm"),h=s||u("messageBox.cancel"),m=()=>{a?a():n();},v=_f[p],y=p!=="default";return g(Ht,{open:t,onClose:n,maxWidth:d,sx:y?{borderTop:`6px solid ${v.iconColor}`}:void 0,children:[y&&f("div",{style:{display:"flex",justifyContent:"center",paddingTop:24,color:v.iconColor},children:v.icon}),r&&f("div",{className:"orb-dialog-title",style:{textAlign:y?"center":"left",paddingTop:y?8:16},children:r}),f("div",{className:"orb-dialog-content",style:{textAlign:y?"center":"left"},children:typeof o=="string"?f("p",{style:{margin:0,color:"var(--orb-muted)"},children:o}):o}),g("div",{className:"orb-dialog-actions",style:{display:"flex",justifyContent:y?"center":"flex-end",gap:8,paddingBottom:24,paddingLeft:24,paddingRight:24},children:[l&&f(ye,{onClick:n,variant:"text",children:h}),f(ye,{onClick:m,variant:"contained",color:y&&p==="error"?"error":"primary",autoFocus:true,children:f$1})]})]})},sP=()=>{let[t,r]=Qt__default.useState(null),[o,n]=Qt__default.useState(false);Qt__default.useEffect(()=>{let s=l=>{l?(r(l),n(true)):(n(false),r(null));};return oo.register(s),()=>oo.unregister()},[]);let a=()=>{n(false),t?.options?.onClose&&t.options.onClose(),r(null);},i=()=>{t?.options?.onConfirm&&t.options.onConfirm(),n(false),r(null);};return t?f(Un,{open:o,type:t.type,message:t.content,title:t.options?.title,onClose:a,onConfirm:i,confirmText:t.options?.confirmText,cancelText:t.options?.cancelText,showCancel:t.options?.showCancel,maxWidth:t.options?.maxWidth}):null};var uP=({status:t,showIcon:r=true})=>{let o="gray",n,a=t;return t==="OK"?(o="blue",n=f(Nn,{size:14,strokeWidth:2}),a="Success"):t==="Error"?(o="orange",n=f(xa,{size:14,strokeWidth:2}),a="Error"):t==="Warning"&&(o="orange",n=f(Na,{size:14,strokeWidth:2}),a="Warning"),f(kt,{label:a,tone:o,icon:r&&n?n:void 0})};var fP=({dense:t,sx:r,className:o,children:n,...a})=>f("ul",{...a,className:o,style:{listStyle:"none",margin:0,padding:0,...r},children:n}),hP=({button:t,divider:r,sx:o,className:n,children:a,...i})=>f("li",{...i,className:n,style:{display:"flex",alignItems:"center",padding:"8px 16px",minHeight:40,borderBottom:r?"1px solid var(--orb-border)":void 0,cursor:t?"pointer":void 0,transition:"var(--orb-t-fast)",...o},onMouseEnter:t?s=>{s.currentTarget.style.background="var(--orb-hover)";}:void 0,onMouseLeave:t?s=>{s.currentTarget.style.background="";}:void 0,children:a}),bP=({sx:t,className:r,children:o,...n})=>f("button",{...n,type:"button",className:r,style:{width:"100%",display:"flex",alignItems:"center",padding:"8px 16px",border:"none",background:"transparent",textAlign:"left",cursor:"pointer",transition:"var(--orb-t-fast)",...t},children:o}),vP=({children:t,sx:r})=>f("div",{style:{marginRight:16,display:"flex",alignItems:"center",minWidth:40,...r},children:t}),yP=({primary:t,secondary:r,sx:o})=>g("div",{style:{flex:1,minWidth:0,...o},children:[f("div",{className:"orb-body",style:{fontWeight:500},children:t}),r&&f("div",{className:"orb-meta",style:{marginTop:2},children:r})]}),CP=({sx:t,className:r,children:o,...n})=>f("li",{...n,className:r,style:{padding:"8px 16px",fontSize:11,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.06em",color:"var(--orb-muted)",...t},children:o}),xP=({children:t,sx:r})=>f("div",{style:{marginRight:12,display:"flex",alignItems:"center",...r},children:t});var kP=({xs:t,md:r,lg:o,sx:n,children:a,className:i,...s})=>{let l=o?`span ${o}`:r?`span ${r}`:t?`span ${t}`:"span 12";return f("div",{...s,className:i,style:{gridColumn:l,minWidth:0,...n},children:a})};var Dr=tt,nr=(t,r)=>forwardRef(({component:o,sx:n,className:a,style:i,children:s,...l},d$1)=>{let p=o??t,u=d(n,[r,a].filter(Boolean).join(" "),i);return f(p,{ref:d$1,className:u.className,style:u.style,...l,children:s})}),we=nr("div"),jc=nr("a","orb-link"),Lo=Ae,Jc=ae,gr=E;var ed=ne;var td=Nt,Yr=Jo,Ua=jo,Ka=La;var qa=Ea,rd=Kr,od=({value:t,variant:r,color:o,sx:n})=>f(Fn,{value:r==="determinate"?t:void 0,color:o,sx:n}),nd=nr("table","orb-tbl"),ad=nr("tbody"),$s=nr("td"),id=nr("div","orb-table-container"),sd=nr("thead"),Gs=nr("tr");nr("tfoot");nr("div","orb-dialog-title");nr("div","orb-dialog-content");nr("div","orb-dialog-actions");nr("p","orb-body-dense");var no=nr("span","orb-input-adornment"),ld=forwardRef(({sx:t,fullWidth:r,className:o,style:n,...a},i)=>{let s=d(t,["orb-input-base",o].filter(Boolean).join(" "),n);return f("input",{ref:i,className:s.className,style:{width:r?"100%":void 0,...s.style},...a})});var bo=nr("div","orb-form-control"),Kn=({control:t,label:r,...o})=>g("label",{className:"orb-form-control-label",...o,children:[t,f("span",{children:r})]}),Zf=({primary:t,secondary:r,children:o,primaryTypographyProps:n,secondaryTypographyProps:a,...i})=>g("span",{className:"orb-list-item-text",...i,children:[t??o,r?f("small",{children:r}):null]}),Qf=nr("span","orb-list-item-icon"),$t=Zf,Br=Qf;nr("div","orb-list-subheader");var _s=({container:t,item:r,spacing:o,xs:n,sm:a,md:i,lg:s,xl:l,sx:d,...p})=>{let u={},f$1=h=>typeof h=="number"?`${h/12*100}%`:h?"100%":void 0;return n!==void 0&&(u.xs=f$1(n)),a!==void 0&&(u.sm=f$1(a)),i!==void 0&&(u.md=f$1(i)),s!==void 0&&(u.lg=f$1(s)),l!==void 0&&(u.xl=f$1(l)),f(we,{...p,sx:{display:t?"flex":void 0,flexWrap:t?"wrap":void 0,gap:t&&o?o:void 0,width:r?u:void 0,...d??{}}})},en=({in:t,children:r,unmountOnExit:o,...n})=>!t&&o?null:f("div",{hidden:!t,...n,children:r}),cd=({children:t,container:r})=>typeof document>"u"?null:createPortal(t,r??document.body),dd=nr("div","orb-toolbar"),pd=({active:t,direction:r="asc",children:o,sx:n,className:a,style:i,...s})=>{let l=d(n,["orb-table-sort-label",t?"orb-is-active":"",a].filter(Boolean).join(" "),i);return g("button",{type:"button",className:l.className,style:l.style,"data-direction":r,...s,children:[f("span",{className:"orb-table-sort-content",children:o}),f(Mt,{className:"orb-table-sort-icon",name:r==="desc"?"down":"up",size:11})]})},Xa=({open:t,anchorEl:r,onClose:o,children:n,anchorOrigin:a,transformOrigin:i,slotProps:s,PaperProps:l,sx:d$1,className:p,style:u,...f$1})=>{let h=useRef(null);if(useEffect(()=>{if(!t)return;let x=C=>{let P=C.composedPath();h.current&&P.includes(h.current)||r&&P.includes(r)||o?.();},b=C=>{C.key==="Escape"&&o?.();};return document.addEventListener("pointerdown",x,true),document.addEventListener("keydown",b,true),()=>{document.removeEventListener("pointerdown",x,true),document.removeEventListener("keydown",b,true);}},[r,o,t]),!t||typeof document>"u")return null;let m=r?.getBoundingClientRect(),v=s?.paper??l,y=[...Array.isArray(v?.sx)?v.sx:v?.sx?[v.sx]:[],...Array.isArray(d$1)?d$1:d$1?[d$1]:[]],g=d(y,["orb-pop",v?.className,p].filter(Boolean).join(" "),{...v?.style,...u});return createPortal(f("div",{...f$1,ref:h,className:g.className,style:{position:"fixed",left:m?.left??16,top:(m?.bottom??16)+6,zIndex:1301,...g.style},children:n}),document.body)},ud=({open:t,onClose:r,anchor:o="left",children:n,PaperProps:a})=>{if(!t||typeof document>"u")return null;let i=o==="right"?{right:0,top:0,bottom:0}:o==="top"?{left:0,right:0,top:0}:o==="bottom"?{left:0,right:0,bottom:0}:{left:0,top:0,bottom:0},s=d(a?.sx,"orb-drawer");return createPortal(g(e,{children:[f("button",{type:"button",className:"orb-overlay","aria-label":"Close drawer",onClick:r}),f("aside",{className:s.className,style:{position:"fixed",zIndex:1201,...i},children:n})]}),document.body)},md=({value:t,onChange:r,children:o,variant:n,scrollButtons:a,...i})=>f("div",{role:"tablist",className:"orb-tabs",...i,children:Children.map(o,s=>isValidElement(s)?cloneElement(s,{selected:s.props.value===t,onSelect:l=>r?.(null,l)}):s)}),gd=({value:t,label:r,children:o,selected:n,onSelect:a,...i})=>f("button",{type:"button",role:"tab","aria-selected":n,className:`orb-tab ${n?"orb-is-active":""}`,onClick:()=>a?.(t),...i,children:r??o});var ar=()=>c(),vo=(t,r)=>Mr(t);var fd=({day:t,onDaySelect:r,selected:o,outsideCurrentMonth:n,disableMargin:a,sx:i,className:s,...l})=>{let d$1=d(i,`orb-cal-day ${o?"orb-is-selected":""} ${n?"orb-is-outside":""} ${s??""}`);return f("button",{type:"button",className:d$1.className,style:d$1.style,onClick:()=>r?.(t),...l,children:t.date()})},hd=({value:t,referenceDate:r,onChange:o,onMonthChange:n,onYearChange:a,minDate:i,maxDate:s,slots:l,...d})=>f(zn,{value:t,month:r,onChange:p=>o?.(p),onMonthChange:p=>{n?.(p),a?.(p);},minDate:i,maxDate:s,renderDay:l?.day?(p,u)=>l.day?.({day:p,selected:u.selected,outsideCurrentMonth:u.outsideCurrentMonth,onDaySelect:f=>o?.(f)}):void 0,...d}),bd=({children:t})=>f(e,{children:t}),_a=class{};var jf=(t,r)=>r!==void 0?r:typeof t=="number"?t:t==="small"?18:t==="large"?30:t==="inherit"?"1em":22,be=t=>({fontSize:o,size:n,sx:a,className:i,style:s,titleAccess:l,...d$1})=>{let p=d(a,i,s);return f(Mt,{name:t,size:jf(o,n),className:p.className,style:p.style,"aria-label":d$1["aria-label"]??l,...d$1})},yo=be("tree"),Oo=be("add"),vd=be("duplicate"),Us=be("down"),yd=be("navigationRight"),Cd=be("navigationRight"),Ks=be("up"),xd=be("delete"),Sd=be("camera"),wd=be("accept"),kd=be("accept"),Ya=be("navigationRight"),Pd=be("dimension"),Td=be("decline"),Co=be("decline"),Id=be("decline"),Md=be("decline"),Za=be("delete"),Qa=be("delete"),Rd=be("download"),Dd=be("move"),Nd=be("edit"),tn=be("slimDown"),Ad=be("filter"),rn=be("sum"),Ed=be("wrench"),Ld=be("lineChart"),Od=be("document"),Hr=be("slimDown"),Fd=be("navigationLeft"),xo=be("navigationRight"),ja=be("slimUp"),Ja=be("navigationLeft"),ei=be("navigationRight"),Bd=be("dimension"),Hd=be("splitOne"),ti=be("menu"),zd=be("microphone"),Vd=be("microphone"),Wd=be("microphone"),$d=be("qrCode"),So=be("save"),Fo=be("search"),Gd=be("search"),_d=be("paperPlane"),Ud=be("paperPlane"),Kd=be("wrench"),qd=be("sort"),ri=be("splitTwo"),Xd=be("favorite"),Yd=be("favorite"),Zd=be("stop"),Qd=be("tableRow"),oi=be("collapseAll"),ni=be("expandAll"),on=be("tableColumn"),jd=be("overview"),Jd=be("hide");var eh=[{field:"value",label:"Value",minWidth:120},{field:"label",label:"Description",minWidth:180}],tp=t=>Array.isArray(t)?t:t==null||t===""?[]:[t],Sr=t=>String(t),rp=(t,r)=>t[r],op=t=>{let r=t.value??t.id??t.key??t.code;return typeof r=="number"||typeof r=="string"?r:""},th=t=>{let r=t.label??t.description??t.name??t.title;return String(typeof r=="number"||typeof r=="string"?r:op(t))},rh=t=>{let r=t.description??t.subtitle;return typeof r=="number"||typeof r=="string"?String(r):void 0},np=({value:t=null,items:r=[],columns:o,mode:n="single",dialogTitle:a="Value Help",searchPlaceholder:i="Search values...",selectLabel:s="Select",clearLabel:l="Clear",cancelLabel:d="Cancel",valueHelpLabel:p="Open value help",noResultsText:u="No matching values",loading:f$1=false,clearable:h=true,allowManualInput:m=true,validateManualInput:v=true,manualInputErrorText:y="Enter a valid value.",selectedItems:g$1=[],displayValue:x,getOptionValue:b=op,getOptionLabel:C=th,getOptionDescription:P=rh,onChange:S,onSearch:k,disabled:I,InputProps:w,onFocus:A,onBlur:R,onKeyDown:T,error:N,helperText:D,...L})=>{let B=br(),X=n==="multiple",[H,K]=useState(false),[W,G]=useState(false),[z,O]=useState(""),[Y,Q]=useState(null),[me,ie]=useState(false),[se,fe]=useState(()=>tp(t)),[Ge,Re]=useState(""),[ke,ze]=useState(""),Pe=useMemo(()=>o&&o.length>0?o:eh,[o]),Ce=Y??r,Ve=useMemo(()=>{let J=[...g$1,...r,...Y??[]],Te=new Map;return J.forEach(Ie=>{Te.set(Sr(b(Ie)),Ie);}),Te},[b,r,Y,g$1]),rt=useMemo(()=>tp(t),[t]),at=useMemo(()=>rt.map(String).join(", "),[rt]);useEffect(()=>{H||fe(rt);},[H,rt]),useEffect(()=>{!W&&!ke&&Re(at);},[W,at,ke]);let Ye=useMemo(()=>{let J=z.trim().toLowerCase();if(!J||k)return Ce;let Te=Pe.filter(Ie=>Ie.searchable!==false);return Ce.filter(Ie=>[b(Ie),C(Ie),P(Ie),...Te.map(ut=>rp(Ie,ut.field))].some(ut=>String(ut??"").toLowerCase().includes(J)))},[Ce,P,C,b,k,z,Pe]),_=useMemo(()=>{if(x!==void 0)return x;if(rt.length===0)return "";let J=Te=>{let Ie=Ve.get(Sr(Te));if(!Ie)return String(Te);let Ze=C(Ie);return Ze&&Ze!==String(Te)?`${Te} - ${Ze}`:String(Te)};return X?rt.length>2?`${rt.length} selected`:rt.map(J).join(", "):J(rt[0])},[x,C,X,Ve,rt]),Oe=useCallback(async()=>{if(k){ie(true);try{let J=await k(z);Array.isArray(J)&&Q(J);}finally{ie(false);}}},[k,z]),ve=()=>{I||(fe(rt),K(true));},Ee=()=>{K(false);},it=()=>{S?.(X?[]:null,X?[]:null),fe([]),Re(""),ze("");},je=J=>{let Te=b(J);if(X){fe(Ie=>Ie.some(ut=>Sr(ut)===Sr(Te))?Ie.filter(ut=>Sr(ut)!==Sr(Te)):[...Ie,Te]);return}fe([Te]);},ht=()=>{let J=se.map(Te=>Ve.get(Sr(Te))).filter(Te=>!!Te);X?S?.(se,J):S?.(se[0]??null,J[0]??null),ze(""),K(false);},xt=J=>{if(J.key==="F4"){J.preventDefault(),ve();return}if(J.key==="Enter"&&m&&!Et(Ge,true)){J.preventDefault();return}T?.(J);},At=J=>v?J.every(Te=>Ve.has(Sr(Te))):true,Et=(J,Te)=>{if(X){let Ze=J.split(/[,;\n]/).map(dt=>dt.trim()).filter(Boolean);if(Ze.length===0)return ze(""),S?.([],[]),true;if(!At(Ze))return Te&&ze(y),false;ze("");let ut=Ze.map(dt=>Ve.get(Sr(dt))).filter(dt=>!!dt);return S?.(Ze,ut),true}let Ie=J.trim();return Ie?At([Ie])?(ze(""),S?.(Ie,Ve.get(Sr(Ie))??null),true):(Te&&ze(y),false):(ze(""),S?.(null,null),true)},te=J=>{if(!m)return;let Te=J.target.value;Re(Te),ze(""),Et(Te,false);},ot=f$1||me,Fe=rt.length>0,ge=m&&(W||!!ke)?Ge:_;return g(e,{children:[f(He,{...L,className:["orb-value-help-field",h&&Fe&&!I?"orb-value-help-has-clear":"",L.className??""].filter(Boolean).join(" "),disabled:I,value:ge,error:!!ke||N,helperText:ke||D,onChange:te,onFocus:J=>{G(true),Re(at),A?.(J);},onBlur:J=>{m&&Et(Ge,true),G(false),R?.(J);},onKeyDown:xt,InputProps:{...w,readOnly:!m,endAdornment:g("span",{className:"orb-value-help-actions",children:[ot?f(Kr,{size:18}):null,h&&Fe&&!I?f(ne,{className:"orb-value-help-clear-trigger",size:"small",tooltip:l,"aria-label":l,onMouseDown:J=>J.preventDefault(),onClick:J=>{J.stopPropagation(),it();},children:f(Mt,{name:"decline",size:14})}):null,f(ne,{className:"orb-value-help-search-trigger",size:"small",tooltip:p,"aria-label":p,onMouseDown:J=>J.preventDefault(),onClick:J=>{J.stopPropagation(),ve();},disabled:I,children:f(Mt,{name:"search",size:16})})]})}}),g(Ht,{open:H,onClose:Ee,fullWidth:true,maxWidth:820,hideCloseButton:true,PaperProps:{sx:J=>({borderRadius:2,overflow:"hidden",border:`1px solid ${J.palette.divider}`,boxShadow:B==="dark"?`0 24px 80px ${tt(J.palette.common.black,.72)}`:`0 24px 80px ${tt(J.palette.common.black,.18)}`})},children:[g("div",{className:"orb-dialog-title",sx:J=>({display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,px:2.5,py:2,pr:1.5,borderBottom:`1px solid ${J.palette.divider}`,bgcolor:J.palette.background.paper}),children:[g("div",{children:[f(E,{sx:{fontSize:"1.05rem",fontWeight:800,lineHeight:1.25},children:a}),X?f(E,{variant:"body2",color:"text.secondary",sx:{mt:.25},children:`${se.length} selected`}):null]}),f(ne,{"aria-label":"Close",onClick:Ee,size:"small",children:f(Co,{fontSize:"small"})})]}),g("div",{className:"orb-dialog-content",sx:{p:0},children:[g(ae,{direction:{xs:"column",sm:"row"},spacing:1,sx:J=>({px:2.5,py:1.5,borderBottom:`1px solid ${J.palette.divider}`,bgcolor:B==="dark"?tt(J.palette.common.white,.025):tt(J.palette.primary.main,.035)}),children:[f(He,{size:"small",fullWidth:true,autoFocus:true,value:z,placeholder:i,onChange:J=>O(J.target.value),onKeyDown:J=>{J.key==="Enter"&&(J.preventDefault(),Oe());},InputProps:{startAdornment:f(no,{position:"start",children:f(Mt,{name:"search",size:16})}),sx:J=>({borderRadius:1,bgcolor:J.palette.background.paper,"& fieldset":{borderColor:tt(J.palette.text.primary,B==="dark"?.2:.16)},"&:hover fieldset":{borderColor:tt(J.palette.primary.main,.52)},"&:focus-within fieldset":{borderColor:J.palette.primary.main}})}}),k?f(ye,{variant:"outlined",onClick:()=>{Oe();},disabled:ot,sx:{minWidth:96,textTransform:"none",fontWeight:700},children:ot?f(Kr,{size:18}):"Search"}):null]}),f("div",{sx:{maxHeight:420},children:g("table",{className:"orb-tbl",stickyHeader:true,size:"small",children:[f("thead",{children:g("tr",{children:[f("td",{padding:"checkbox",sx:J=>({bgcolor:B==="dark"?"var(--orb-canvas)":J.palette.background.paper,borderBottom:`1px solid ${J.palette.divider}`})}),Pe.map(J=>f("td",{align:J.align==="inherit"?void 0:J.align,sx:Te=>({minWidth:J.minWidth,width:J.width,fontSize:"0.78rem",fontWeight:800,bgcolor:B==="dark"?"var(--orb-canvas)":Te.palette.background.paper,borderBottom:`1px solid ${Te.palette.divider}`}),children:J.label},String(J.field)))]})}),g("tbody",{children:[Ye.map(J=>{let Te=b(J),Ie=se.some(Ze=>Sr(Ze)===Sr(Te));return g("tr",{hover:true,selected:Ie,onClick:()=>je(J),onDoubleClick:()=>{X||(fe([Te]),S?.(Te,J),K(false));},sx:Ze=>({cursor:"pointer","&.orb-selected":{bgcolor:tt(Ze.palette.primary.main,B==="dark"?.22:.12)},"&.orb-selected:hover":{bgcolor:tt(Ze.palette.primary.main,B==="dark"?.28:.18)}}),children:[f("td",{padding:"checkbox",children:f(Rt,{size:"small",checked:Ie})}),Pe.map(Ze=>{let ut=rp(J,Ze.field);return f("td",{align:Ze.align==="inherit"?void 0:Ze.align,sx:{fontSize:"0.82rem",py:1},children:Ze.render?Ze.render(ut,J):String(ut??"")},String(Ze.field))})]},Sr(Te))}),Ye.length===0?f("tr",{children:f("td",{colSpan:Pe.length+1,children:f("div",{sx:{py:5,textAlign:"center",color:"text.secondary"},children:u})})}):null]})]})})]}),g("div",{className:"orb-dialog-actions",sx:J=>({px:2.5,py:1.5,borderTop:`1px solid ${J.palette.divider}`,bgcolor:J.palette.background.paper,"& .orb-btn":{textTransform:"none",fontWeight:700}}),children:[h&&(Fe||se.length>0)?f(ye,{onClick:it,children:l}):null,f("div",{sx:{flex:1}}),f(ye,{onClick:Ee,children:d}),f(ye,{variant:"contained",onClick:ht,disabled:!X&&se.length===0,children:s})]})]})]})};var ai=({title:t,hideHeader:r,children:o})=>g("div",{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[!r&&f("div",{sx:{mb:2},children:f(E,{variant:"h4",children:t})}),f("div",{sx:{flex:1,overflow:"hidden"},children:o})]});var qs={width:56,minWidth:56,maxWidth:56,paddingLeft:"4px !important",paddingRight:"4px !important",paddingTop:"0 !important",paddingBottom:"0 !important",textAlign:"center",verticalAlign:"middle",boxSizing:"border-box"},Xs={width:72,minWidth:72,maxWidth:72,paddingLeft:"4px !important",paddingRight:"4px !important",paddingTop:"0 !important",paddingBottom:"0 !important",textAlign:"center",verticalAlign:"middle",boxSizing:"border-box"},qn={width:30,height:30,p:.25,flex:"0 0 auto","& svg":{fontSize:20}},Xn={width:30,height:30,minWidth:30,minHeight:30,p:.25,flex:"0 0 auto","& svg":{fontSize:20}},ap={display:"flex",alignItems:"center",justifyContent:"center",gap:.25,width:"100%",minWidth:0},lr={width:32,height:32,minWidth:32,minHeight:32,p:0,flex:"0 0 auto",borderRadius:1,color:"text.secondary","& svg, & [data-sap-icon]":{width:16,height:16,fontSize:16,strokeWidth:1.8}};var oh={fontSize:"0.85rem",width:62,minWidth:62,"& .orb-select-trigger":{minHeight:"32px !important",height:"32px !important",padding:"0 8px !important"},"& .orb-select-chevron":{width:"11px !important",height:"11px !important",fontSize:"11px !important"}},ii=({rowsPerPage:t=20,rowsPerPageOptions:r=[20,50,100,-1],page:o=0,count:n=0,onRowsPerPageChange:a,onPageChange:i})=>{let{t:s}=de(),l=r.length>0?r:[20,50,100,-1],d=Math.max(0,o),p=t===-1?1:Math.max(1,Math.ceil(n/t)),u=Math.min(d+1,p),f$1=d>0,h=d<p-1&&t!==-1;return g("div",{className:"orb-table-pager",children:[f(E,{className:"orb-table-pager-label",children:s("table.toolbar.itemsPerPage")}),f(st,{title:s("table.toolbar.itemsPerPage"),children:f(Vt,{size:"small",variant:"standard",value:t,"aria-label":s("table.toolbar.itemsPerPage"),fullWidth:false,disableUnderline:true,onChange:m=>a?.(Number(m.target.value)),sx:oh,children:l.map(m=>f("option",{value:m,children:m===-1?s("common.all"):m},`rows-per-page-${m}`))})}),f("span",{className:"orb-table-pager-divider"}),f(ne,{className:"orb-table-pager-button","aria-label":"Previous page",size:"small",onClick:()=>i?.(Math.max(d-1,0)),disabled:!f$1,sx:lr,children:f(Fd,{})}),g(E,{className:"orb-table-pager-page",title:s("table.toolbar.pageOf",{current:u,total:p}),children:[u," / ",p]}),f(ne,{className:"orb-table-pager-button","aria-label":"Next page",size:"small",onClick:()=>i?.(Math.min(d+1,p-1)),disabled:!h,sx:lr,children:f(xo,{})})]})};var si=({value:t="",onChange:r})=>{let{t:o}=de();return f("div",{className:"orb-table-toolbar-search",children:f(He,{className:"orb-table-toolbar-search-field",size:"small",placeholder:o("table.toolbar.searchPlaceholder"),value:t,onChange:n=>r?.(n.target.value),InputProps:{startAdornment:f(no,{position:"start",children:f(Fo,{size:16})})}})})};var li=t=>{let{t:r}=de(),o=Array.isArray(t.actions)?t.actions:t.actions?[t.actions]:[],n=Array.isArray(t.extraTools)?t.extraTools:t.extraTools?[t.extraTools]:[],a=[...o,...n],i=!!(t.showCreateButton||t.showEditButton||t.showDeleteButton),s=!!(t.onOpenGraphReport||t.onLayoutSave&&!t.layoutManager||t.layoutManager);return f(dd,{className:"orb-table-toolbar",role:"toolbar","aria-label":r("table.title.default"),children:g("div",{className:"orb-table-toolbar-primary",children:[f(si,{value:t.filterText,onChange:l=>{t.setFilterText(l),t.onPageChange?.(0);}}),f(ii,{rowsPerPage:t.rowsPerPage,rowsPerPageOptions:t.rowsPerPageOptions,page:t.page,count:t.count,onRowsPerPageChange:t.onRowsPerPageChange,onPageChange:t.onPageChange}),a.length>0?f("div",{className:"orb-table-toolbar-custom",children:a.map((l,d)=>f(Qt__default.Fragment,{children:l},`toolbar-custom-${d}`))}):null,f("span",{className:"orb-table-toolbar-spacer"}),g("div",{className:"orb-table-toolbar-actions",children:[g("div",{className:"orb-table-tool-group",children:[!t.disableGrouping&&f(st,{title:r("table.toolbar.groupBy"),children:f(ne,{className:"orb-table-tool-button",sx:lr,onClick:l=>t.setGroupAnchorEl(t.groupAnchorEl?null:l.currentTarget),children:f(Ka,{badgeContent:t.grouping?.length,color:"primary",invisible:!t.grouping?.length,children:f(yo,{})})})}),f(st,{title:r("table.toolbar.summary"),children:f(ne,{className:`orb-table-tool-button ${t.showSummary?"orb-is-active":""}`,active:!!t.showSummary,sx:lr,onClick:l=>t.setSummaryAnchorEl(t.summaryAnchorEl?null:l.currentTarget),children:f(rn,{})})}),f(st,{title:r("table.toolbar.columns"),children:f(ne,{className:"orb-table-tool-button",sx:lr,onClick:l=>t.setAnchorEl(t.anchorEl?null:l.currentTarget),children:f(on,{})})}),f(st,{title:r("table.toolbar.export"),children:f(ne,{className:"orb-table-tool-button",sx:lr,onClick:t.handleExport,children:f(Rd,{})})})]}),i&&g("div",{className:"orb-table-tool-group",children:[t.showCreateButton&&f(st,{title:r("table.toolbar.newItem"),children:f(ne,{className:"orb-table-tool-button",onClick:t.onOpenCreateDialog,color:"primary.main",sx:lr,children:f(Oo,{})})}),t.showEditButton&&f(st,{title:r("table.toolbar.editItem"),children:f("span",{children:f(ne,{className:"orb-table-tool-button",onClick:t.onOpenEditDialog,color:"primary.main",disabled:!!t.editDisabled,sx:lr,children:f(Nd,{})})})}),t.showDeleteButton&&f(st,{title:r("table.toolbar.deleteItem"),children:f("span",{children:f(ne,{className:"orb-table-tool-button",onClick:t.onOpenDeleteConfirm,disabled:!!t.deleteDisabled,sx:{...lr,color:"error.main"},children:f(Za,{})})})})]}),s&&g("div",{className:"orb-table-tool-group",children:[t.onOpenGraphReport&&f(st,{title:r("table.toolbar.graphicReport"),children:f(ne,{className:"orb-table-tool-button",sx:lr,onClick:t.onOpenGraphReport,children:f(Ld,{})})}),t.onLayoutSave&&!t.layoutManager&&f(st,{title:r("table.toolbar.saveLayout"),children:f(ne,{className:"orb-table-tool-button",sx:lr,onClick:l=>t.onLayoutSave(l),children:f(So,{})})}),t.layoutManager]})]})]})})};var ci=Object.freeze({Translate:{toString(t){if(!t)return;let{x:r,y:o}=t;return "translate3d("+(r?Math.round(r):0)+"px, "+(o?Math.round(o):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;let{scaleX:r,scaleY:o}=t;return "scaleX("+r+") scaleY("+o+")"}},Transform:{toString(t){if(t)return [ci.Translate.toString(t),ci.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:r,duration:o,easing:n}=t;return r+" "+o+"ms "+n}}});var di=t=>{let{t:r}=de(),{onSelectAllClick:o,order:n,orderBy:a,sortBy:i=[],numSelected:s=0,rowCount:l=0,onRequestSort:d,onContextMenu:p,columns:u,visibleColumns:f$1,selectionMode:h,grouping:m=[],isAllExpanded:v=false,handleToggleAll:y,onColumnResize:g$1,columnWidths:x,enableColumnReorder:b=false,disableSorting:C=false}=t,[P,S]=useState(null),k=useRef(null),I=W=>G=>{C||P||d(W);},w=(W,G,z)=>{W.preventDefault(),W.stopPropagation(),S(G),k.current={startX:W.clientX,startWidth:z,colId:G},document.addEventListener("mousemove",A),document.addEventListener("mouseup",R),document.body.style.cursor="col-resize";},A=W=>{if(!k.current)return;let{startX:G,startWidth:z,colId:O}=k.current,Y=W.clientX-G,Q=Math.max(50,z+Y);g$1&&g$1(O,Q);},R=()=>{S(null),k.current=null,document.removeEventListener("mousemove",A),document.removeEventListener("mouseup",R),document.body.style.cursor="";};useEffect(()=>()=>{document.removeEventListener("mousemove",A),document.removeEventListener("mouseup",R);},[]);let T=h==="multiple"||h==="single",N=m.length>0&&!!y,D=r(v?"table.group.collapseAll":"table.group.expandAll"),L=u.filter(W=>f$1.includes(W.id)),B=new Map(i.map((W,G)=>[W.field,{...W,priority:G+1}])),X=L.map(W=>{let G=x?.[W.id]||W.minWidth||100,z=B.get(W.id);return f(ph,{headCell:W,width:typeof G=="number"?G:100,order:n,orderBy:a,multiSortInfo:C?void 0:z,onRequestSort:I(W.id),onContextMenu:p,onResizeMouseDown:O=>w(O,W.id,typeof G=="number"?G:100),enableColumnReorder:b,disableSorting:C},W.id)}),H=L.map(W=>W.id),K=g("tr",{children:[T&&f("th",{className:"orb-table-control-head",style:{width:56,minWidth:56,maxWidth:56},children:f(Rt,{color:"primary",indeterminate:s>0&&s<l,checked:l>0&&s===l,onChange:o,disabled:h==="single",sx:qn})}),N&&f("th",{className:"orb-table-control-head",style:{width:72,minWidth:72,maxWidth:72},children:f(st,{title:D,children:f(ne,{size:"small",onClick:W=>{W.stopPropagation(),y?.(!v);},sx:Xn,children:v?f(oi,{}):f(ni,{})})})}),b?f(SortableContext,{items:H,strategy:horizontalListSortingStrategy,children:X}):X]});return f("thead",{children:K})},ph=({headCell:t,width:r,order:o,orderBy:n,multiSortInfo:a,onRequestSort:i,onContextMenu:s,onResizeMouseDown:l,enableColumnReorder:d,disableSorting:p})=>{let{setNodeRef:u,attributes:f$1,listeners:h,transform:m,transition:v,isDragging:y}=useSortable({id:t.id,disabled:!d}),g$1=d?{transform:ci.Transform.toString(m),transition:v,opacity:y?.6:1}:{},x=p?"asc":a?.direction??(n===t.id?o:"asc"),b=!p&&(!!a||n===t.id);return g("th",{ref:d?u:void 0,className:`orb-table-head-cell ${t.numeric?"orb-num":""} ${d?"orb-is-reorderable":""} ${y?"orb-is-dragging":""}`,"aria-sort":b?x==="asc"?"ascending":"descending":"none",onContextMenu:s?C=>s(C,t.id):void 0,style:{width:r,minWidth:r,maxWidth:r,...g$1},...d?f$1:{},...d?h:{},children:[p?f("span",{className:"orb-table-head-label",children:t.label}):f(pd,{className:"orb-table-head-sort",active:b,direction:x,onClick:i,children:g("span",{className:"orb-table-head-label",children:[t.label,a&&f("span",{className:"orb-table-sort-priority",children:a.priority})]})}),f("div",{className:"orb-table-resize-handle",onMouseDown:l,onPointerDown:C=>C.stopPropagation(),onClick:C=>C.stopPropagation()})]})};var pi=t=>{let{t:r}=de(),{visibleRows:o,visibleColumns:n,selected:a=[],handleClick:i,columns:s,toggleGroupExpand:l,expandedGroups:d=new Set,selectionMode:p,grouping:u=[],isGroupFullyExpanded:f$1,handleExpandGroupRecursively:h,handleCollapseGroupRecursively:m,emptyLabel:v,getRowDataKey:y,getRowProps:g$1,getGroupRowProps:x}=t,b=k=>a.indexOf(k)!==-1,C=p==="multiple"||p==="single",P=u.length>0,S=n.length+(C?1:0)+(P?1:0);return g("tbody",{children:[o.map((k,I)=>{if(k.type==="group"){let w=d.has(k.id),A=k.childIds||[],R=A.filter(W=>b(W)).length,T=A.length>0&&R===A.length,N=R>0&&R<A.length,D={entry:k,data:k,id:k.id,index:I,selected:T,group:true},L=x?.(D)||{},{className:B,onClick:X,...H}=L,K=W=>{if(W.stopPropagation(),!!t.onSelectionChange)if(T){let G=a.filter(z=>!A.includes(z));t.onSelectionChange(G);}else {let G=Array.from(new Set([...a,...A]));t.onSelectionChange(G);}};return g("tr",{...H,"data-ctable-row-key":y?.(D),className:["orb-table-group-row",B].filter(Boolean).join(" "),onClick:X,sx:W=>({backgroundColor:"var(--orb-surface)","& th, & td":{color:W.palette.text.primary,borderBottomColor:W.palette.divider},"& .orb-icon-btn":{color:W.palette.text.primary},"& .orb-chk":{color:W.palette.text.secondary},"& .orb-chk:has(input:checked), & .orb-chk:has(input:indeterminate)":{color:W.palette.primary.main}}),children:[C&&f("td",{padding:"checkbox",sx:qs,children:f(Rt,{size:"small",checked:T,indeterminate:N,onChange:K,onClick:W=>W.stopPropagation(),sx:qn})}),P&&f("td",{padding:"checkbox",sx:Xs,children:g("div",{sx:ap,children:[u.length>1&&k.level<u.length-1&&f(st,{title:f$1?.(k.id)?r("table.group.collapseAll"):r("table.group.expandAll"),children:f(ne,{size:"small",onClick:()=>{f$1?.(k.id)?m?.(k.id):h?.(k.id);},sx:Xn,children:f$1?.(k.id)?f(oi,{}):f(ni,{})})}),f(ne,{size:"small",onClick:()=>l&&l(k.id),sx:Xn,children:w?f(Hr,{}):f(xo,{})})]})}),f("td",{colSpan:n.length,sx:{py:1,pl:k.level*3+1},children:g(E,{variant:"body2",fontWeight:"bold",color:"text.primary",sx:{fontSize:"0.85rem"},children:[k.field,": ",k.value," (",k.count,")"]})})]},k.id)}else {let w=k.data||k,A=k.id||w.id||I,R=b(A),T=`enhanced-table-checkbox-${I}`,N={entry:k,data:w,id:A,index:I,selected:R,group:false},D=g$1?.(N)||{},{className:L,onClick:B,...X}=D,K=(k.level!==void 0?k.level:0)*4;return g("tr",{...X,"data-ctable-row-key":y?.(N),className:[R?"orb-is-selected":"",L].filter(Boolean).join(" "),onClick:W=>{B?.(W),W.defaultPrevented||i?.(W,w);},role:C?"checkbox":X.role,"aria-checked":C?R:X["aria-checked"],tabIndex:X.tabIndex??-1,children:[C&&f("td",{padding:"checkbox",sx:qs,children:f(Rt,{color:"primary",checked:R,inputProps:{"aria-labelledby":T},sx:qn})}),P&&f("td",{padding:"checkbox",sx:Xs}),s.filter(W=>n.includes(W.id)).map((W,G)=>{let O=G===0&&K>0?{pl:K+2}:{};return f("td",{className:W.numeric?"orb-num":void 0,align:W.numeric?"right":"left",sx:O,children:W.render?W.render(w[W.id],w):(function(){let Q=w[W.id];if(W.numeric){if(typeof Q=="number")return Q.toLocaleString();if(typeof Q=="string"&&Q.trim()!==""&&!isNaN(Number(Q)))return Number(Q).toLocaleString()}return Q})()},W.id)})]},A)}}),o.length===0&&f("tr",{children:f("td",{colSpan:S,align:"center",children:v??r("common.noData")})})]})};var ip=t=>{let{columns:r=[],visibleColumns:o,summaryRow:n,selectionMode:a,grouping:i=[],columnWidths:s={}}=t;if(!t.showSummary)return null;let l=a==="multiple"||a==="single",d=i.length>0,p=r.filter(u=>o.includes(u.id));return f("tfoot",{className:"orb-table-footer",style:{zIndex:t.zIndex},children:g("tr",{children:[l&&f("td",{className:"orb-table-footer-control",style:{width:56,minWidth:56,maxWidth:56}}),d&&f("td",{className:"orb-table-footer-control",style:{width:72,minWidth:72,maxWidth:72}}),p.map(u=>f("td",{className:`orb-table-footer-cell ${u.numeric?"orb-num":""}`,style:{width:s[u.id]||u.minWidth||100,minWidth:s[u.id]||u.minWidth||100,maxWidth:s[u.id]||u.minWidth||100},children:(function(){let h=n[u.id];return h==null||h===""?"":typeof h=="number"?h.toLocaleString():typeof h=="string"&&h.trim()!==""&&!isNaN(Number(h))?Number(h).toLocaleString():h})()},u.id))]})})};var sp=t=>{let{t:r}=de();return f("div",{sx:{p:2},children:f(E,{children:r("table.mobile.notImplemented")})})};var sn=({groupAnchorEl:t,setGroupAnchorEl:r,grouping:o,setGrouping:n,columns:a})=>{let{t:i}=de(),[s,l]=useState(o);useEffect(()=>{t&&l(o);},[t,o]);let d=()=>{l(o),r(null);},p=f=>{l(h=>h.includes(f)?h.filter(m=>m!==f):[...h,f]);},u=()=>{n(s),r(null);};return g(Yt,{anchorEl:t,open:!!t,onClose:d,sx:{width:224,minWidth:224,maxHeight:360,overflowY:"auto"},children:[g("div",{className:"orb-table-group-menu-header",onClick:f=>f.stopPropagation(),children:[f(E,{className:"orb-table-group-menu-title",variant:"subtitle2",children:i("table.menu.groupBy")}),s.length>0&&f(ye,{className:"orb-table-group-menu-clear",size:"small",color:"error",onClick:f=>{f.stopPropagation(),l([]);},children:i("table.menu.clearAll")})]}),f(Nt,{className:"orb-table-group-menu-divider"}),a.map(f$1=>{let h=s.includes(f$1.id),m=s.indexOf(f$1.id)+1;return f("option",{className:"orb-table-group-menu-option",selected:h,onClick:v=>{v.stopPropagation(),p(f$1.id);},children:g("div",{className:"orb-table-group-menu-option-content",children:[f(Rt,{className:"orb-table-group-menu-checkbox",checked:h,size:"small"}),f($t,{className:"orb-table-group-menu-label",primary:f$1.label}),h&&f("span",{className:"orb-table-group-menu-order","aria-label":`${i("table.menu.groupBy")} ${m}`,children:m})]})},f$1.id)}),g("div",{className:"orb-table-group-menu-footer",children:[f(ye,{size:"small",variant:"ghost",onClick:d,children:i("common.cancel")}),f(ye,{size:"small",variant:"primary",onClick:u,children:i("common.ok")})]})]})},ln=({anchorEl:t,setAnchorEl:r,columns:o,visibleColumns:n,toggleColumnVisibility:a})=>{let{t:i}=de();return g(Yt,{anchorEl:t,open:!!t,onClose:()=>r(null),children:[f("option",{disabled:true,children:f($t,{primary:i("table.menu.visibleColumns")})}),f(Nt,{}),o.map(s=>g("option",{onClick:()=>a(s.id),children:[f(Rt,{checked:n.includes(s.id),size:"small"}),f($t,{primary:s.label})]},s.id))]})},ui=({anchorEl:t,setAnchorEl:r,showSummary:o,setShowSummary:n,columns:a,summaryColumns:i,toggleSummaryColumn:s})=>{let{t:l}=de();return g(Yt,{anchorEl:t,open:!!t,onClose:()=>r(null),children:[f("option",{children:f(Kn,{control:f(qa,{checked:o,onChange:d=>n(d.target.checked),size:"small"}),label:l("table.menu.showSummaryRow")})}),f(Nt,{}),a.filter(d=>d.numeric).map(d=>g("option",{onClick:()=>s(d.id),disabled:!o,children:[f(Rt,{checked:i.includes(d.id),size:"small"}),f($t,{primary:d.label})]},d.id)),a.filter(d=>d.numeric).length===0&&f("option",{disabled:true,children:f($t,{primary:l("table.menu.noNumericColumns")})})]})},mi=({contextMenu:t,handleCloseContextMenu:r,columns:o,visibleColumns:n,toggleColumnVisibility:a})=>{let{t:i}=de();return g(Yt,{open:t!==null,onClose:r,anchorReference:"anchorPosition",anchorPosition:t!==null?{top:t.mouseY,left:t.mouseX}:void 0,children:[f("option",{onClick:r,children:i("common.copy")}),f(Nt,{}),f("option",{disabled:true,children:i("table.menu.visibleColumns")}),o.map(s=>g("option",{onClick:()=>a(s.id),children:[f(Br,{children:n.includes(s.id)&&f(wd,{fontSize:"small"})}),f($t,{children:s.label})]},s.id))]})},pp=({contextMenu:t,handleClose:r,columns:o,visibleColumns:n,grouping:a,summaryColumns:i,showSummary:s,sortBy:l,orderBy:d,order:p,onSortAsc:u,onSortDesc:f$1,onClearSort:h,onHideColumn:m,onToggleGroup:v,onToggleSummary:y,onOpenSortDialog:g$1})=>{let{t:x}=de(),b=t?.columnId??"",C=o.find(T=>T.id===b),P=a.includes(b),S=i.includes(b),k=!!C?.numeric,I=l.find(T=>T.field===b),w=I?I.direction==="asc":d===b&&p==="asc",A=I?I.direction==="desc":d===b&&p==="desc",R=w||A;return g(Yt,{open:t!==null,onClose:r,anchorReference:"anchorPosition",anchorPosition:t!==null?{top:t.mouseY,left:t.mouseX}:void 0,children:[f("option",{disabled:true,sx:{opacity:"1 !important",fontWeight:700},children:f($t,{primary:C?.label??b})}),f(Nt,{}),g("option",{onClick:()=>{u(b),r();},selected:w,children:[f(Br,{children:f(Ks,{fontSize:"small"})}),f($t,{primary:x("table.headerMenu.sortAsc")})]}),g("option",{onClick:()=>{f$1(b),r();},selected:A,children:[f(Br,{children:f(Us,{fontSize:"small"})}),f($t,{primary:x("table.headerMenu.sortDesc")})]}),R&&g("option",{onClick:()=>{h(b),r();},children:[f(Br,{children:f(Pd,{fontSize:"small"})}),f($t,{primary:x("table.headerMenu.clearSort")})]}),g("option",{onClick:()=>{g$1(),r();},children:[f(Br,{children:f(Oo,{fontSize:"small"})}),f($t,{primary:x("table.headerMenu.configureSort")})]}),f(Nt,{}),g("option",{onClick:()=>{v(b),r();},selected:P,children:[f(Br,{children:f(yo,{fontSize:"small"})}),f($t,{primary:x(P?"table.headerMenu.ungroup":"table.headerMenu.group")})]}),k&&s&&g("option",{onClick:()=>{y(b),r();},selected:S,children:[f(Br,{children:f(rn,{fontSize:"small"})}),f($t,{primary:x(S?"table.headerMenu.removeSummary":"table.headerMenu.addSummary")})]}),f(Nt,{}),g("option",{onClick:()=>{m(b),r();},children:[f(Br,{children:f(Jd,{fontSize:"small"})}),f($t,{primary:x("table.headerMenu.hideColumn")})]})]})},up=({open:t,onClose:r,columns:o,initialRules:n,onApply:a,onClear:i})=>{let{t:s}=de(),[l,d]=useState([]);useEffect(()=>{t&&d(n.length>0?n.map(y=>({...y})):[]);},[t,n]);let p=useMemo(()=>new Set(l.map(y=>y.field)),[l]),u=useMemo(()=>o.filter(y=>!p.has(y.id)),[o,p]),f$1=()=>{let y=u[0];y&&d(g=>[...g,{field:y.id,direction:"asc"}]);},h=y=>{d(g=>g.filter((x,b)=>b!==y));},m=(y,g)=>{d(x=>x.map((b,C)=>C===y?{...b,...g}:b));},v=(y,g)=>{d(x=>{let b=y+g;if(b<0||b>=x.length)return x;let C=[...x],[P]=C.splice(y,1);return C.splice(b,0,P),C});};return f(Ht,{open:t,onClose:r,maxWidth:620,fullWidth:true,className:"orb-table-sort-dialog",title:s("table.sortDialog.title"),actions:g(e,{children:[f(ye,{className:"orb-table-sort-clear",variant:"neutral",disabled:l.length===0&&n.length===0,onClick:()=>{i(),r();},children:s("table.sortDialog.clearAll")}),f("span",{className:"orb-table-sort-action-spacer"}),f(ye,{variant:"neutral",onClick:r,children:s("common.cancel")}),f(ye,{variant:"primary",onClick:()=>{a(l),r();},children:s("common.ok")})]}),children:g("div",{className:"orb-table-sort-dialog-content",children:[l.length===0?f(E,{className:"orb-table-sort-empty",variant:"body2",children:s("table.sortDialog.empty")}):f(ae,{className:"orb-table-sort-rules",spacing:1,children:l.map((y,g$1)=>{let x=new Set(l.filter((C,P)=>P!==g$1).map(C=>C.field)),b=o.filter(C=>!x.has(C.id));return g("div",{className:"orb-table-sort-rule",children:[f(Ka,{className:"orb-table-sort-order",badgeContent:g$1+1,color:"primary"}),f(Vt,{size:"small",value:y.field,onChange:C=>m(g$1,{field:C.target.value}),options:b.map(C=>({value:C.id,label:C.label}))}),f(Vt,{size:"small",value:y.direction,onChange:C=>m(g$1,{direction:C.target.value}),options:[{value:"asc",label:s("table.sortDialog.asc")},{value:"desc",label:s("table.sortDialog.desc")}]}),f(ne,{className:"orb-table-sort-icon-button",size:"small",onClick:()=>v(g$1,-1),disabled:g$1===0,children:f(Ks,{fontSize:"small"})}),f(ne,{className:"orb-table-sort-icon-button",size:"small",onClick:()=>v(g$1,1),disabled:g$1===l.length-1,children:f(Us,{fontSize:"small"})}),f(ne,{className:"orb-table-sort-icon-button orb-table-sort-delete",size:"small",onClick:()=>h(g$1),children:f(Qa,{fontSize:"small"})})]},`sort-rule-${g$1}`)})}),f(ye,{size:"small",onClick:f$1,disabled:u.length===0,startIcon:f(Oo,{}),variant:"secondary",className:"orb-table-sort-add",children:s("table.sortDialog.addRule")})]})})};var Yn=(t,r=2)=>t.toLocaleString(void 0,{maximumFractionDigits:r}),mp=({kpis:t})=>{let{t:r}=de(),o=[{label:r("graph.kpi.totalRecords"),value:Yn(t.totalRecords,0),color:"var(--orb-fg)"},{label:r("graph.kpi.totalReport"),value:Yn(t.totalReportHours),color:"var(--orb-fg)"},{label:r("graph.kpi.totalBillable"),value:Yn(t.totalBillableHours),color:"var(--orb-primary)"},{label:r("graph.kpi.efficiency"),value:`${t.efficiency.toFixed(2)}%`,color:"var(--orb-accent)"},{label:r("graph.kpi.amount"),value:Yn(t.totalAmount),color:"var(--orb-primary)"},{label:r("graph.kpi.flagged"),value:Yn(t.flaggedCount,0),color:"var(--orb-err)"}];return f("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(140px, 1fr))",gap:12},children:o.map(n=>g(Ae,{elevation:0,sx:{padding:12,minHeight:96,display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[f(E,{variant:"caption",muted:true,children:n.label}),f(E,{variant:"h3",sx:{fontWeight:800,color:n.color,fontVariantNumeric:"tabular-nums"},children:n.value})]},n.label))})};var gi=({title:t,subtitle:r,children:o})=>g(Ae,{elevation:0,sx:{padding:16},children:[f(E,{variant:"h4",sx:{fontWeight:700},children:t}),r&&f(E,{variant:"body2",muted:true,sx:{marginBottom:16},children:r}),o]});var Zn=({data:t,orientation:r="horizontal",valueSuffix:o="",minHeight:n=210,activeName:a,onItemClick:i})=>{if(t.length===0)return f(E,{variant:"body2",muted:true,children:"No data"});let s=Math.max(...t.map(l=>l.value),1);return r==="vertical"?f("div",{style:{display:"flex",gap:1,alignItems:"flex-end",minHeight:n},children:t.map(l=>g("div",{style:{flex:1,minWidth:0},children:[f("div",{onClick:()=>i?.(l),sx:{height:`${Math.max(l.value/s*180,6)}px`,background:l.name===a?"primary.dark":"primary.main",borderRadius:"8px 8px 0 0",cursor:i?"pointer":"default",opacity:a&&l.name!==a?.45:1}}),f(E,{variant:"caption",title:l.name,sx:{display:"block",mt:.5},children:l.name}),g(E,{variant:"caption",muted:true,children:[l.value.toFixed(1),o]})]},l.name))}):f(ae,{spacing:1,children:t.map(l=>g("div",{style:{display:"grid",gridTemplateColumns:"140px 1fr 64px",gap:1},children:[f(E,{variant:"caption",muted:true,title:l.name,children:l.name}),f("div",{onClick:()=>i?.(l),sx:{alignSelf:"center",background:"action.hover",height:10,borderRadius:999,overflow:"hidden",cursor:i?"pointer":"default",opacity:a&&l.name!==a?.45:1},children:f("div",{style:{width:`${l.value/s*100}%`,height:"100%",background:l.name===a?"primary.dark":"primary.main"}})}),g(E,{variant:"caption",sx:{textAlign:"right",fontWeight:600},children:[l.value.toFixed(1),o]})]},l.name))})};var gp=({data:t,color:r="var(--orb-chart-1)",valueSuffix:o="",height:n=220})=>{if(t.length===0)return f(E,{variant:"body2",muted:true,children:"No data"});let a=640,i=28,s=t.map(h=>h.value),l=Math.min(...s,0),p=Math.max(...s,1)-l||1,u=t.map((h,m)=>{let v=i+m*(a-i*2)/Math.max(t.length-1,1),y=n-i-(h.value-l)/p*(n-i*2);return {x:v,y,...h}}),f$1=u.map(h=>`${h.x},${h.y}`).join(" ");return g("div",{children:[g("div",{component:"svg",viewBox:`0 0 ${a} ${n}`,style:{width:"100%",height:n},children:[f("line",{x1:i,y1:n-i,x2:a-i,y2:n-i,style:{stroke:"var(--orb-chart-grid)"}}),f("polyline",{fill:"none",style:{stroke:r},strokeWidth:3,points:f$1}),u.map(h=>f("circle",{cx:h.x,cy:h.y,r:4,style:{fill:r}},h.name))]}),f("div",{sx:{mt:1,display:"grid",gridTemplateColumns:`repeat(${t.length}, minmax(0, 1fr))`,gap:1},children:t.map(h=>g("div",{style:{minWidth:0},children:[f(E,{variant:"caption",title:h.name,sx:{display:"block"},children:h.name}),g(E,{variant:"caption",muted:true,children:[h.value.toFixed(1),o]})]},h.name))})]})};var fp=({data:t,barColor:r="var(--orb-chart-1)",lineColor:o="var(--orb-chart-5)",height:n=220})=>{if(t.length===0)return f(E,{variant:"body2",muted:true,children:"No data"});let a=640,i=28,s=Math.max(...t.map(u=>u.barValue),1),l=Math.max(...t.map(u=>u.lineValue),1),d=t.map((u,f)=>{let h=(a-i*2)/t.length,m=Math.max(h*.5,8),v=i+f*h+(h-m)/2,y=u.barValue/s*(n-i*2),g=n-i-y;return {x:v,y:g,barHeight:y,barWidth:m,item:u}}),p=t.map((u,f)=>{let h=(a-i*2)/t.length,m=i+f*h+h/2,v=n-i-u.lineValue/l*(n-i*2);return {x:m,y:v,item:u}});return g(ae,{spacing:1.25,children:[g("div",{component:"svg",viewBox:`0 0 ${a} ${n}`,style:{width:"100%",height:n},children:[f("line",{x1:i,y1:n-i,x2:a-i,y2:n-i,style:{stroke:"var(--orb-chart-grid)"}}),d.map(u=>f("rect",{x:u.x,y:u.y,width:u.barWidth,height:Math.max(u.barHeight,4),rx:6,style:{fill:r}},u.item.name)),f("polyline",{fill:"none",style:{stroke:o},strokeWidth:3,points:p.map(u=>`${u.x},${u.y}`).join(" ")}),p.map(u=>f("circle",{cx:u.x,cy:u.y,r:3.5,style:{fill:o}},`${u.item.name}-line`))]}),f("div",{style:{display:"grid",gridTemplateColumns:`repeat(${t.length}, minmax(0, 1fr))`,gap:1},children:t.map(u=>g("div",{style:{minWidth:0},children:[f(E,{variant:"caption",title:u.name,sx:{display:"block"},children:u.name}),g(E,{variant:"caption",muted:true,sx:{display:"block"},children:["Bar: ",u.barValue.toFixed(1)]}),g(E,{variant:"caption",muted:true,sx:{display:"block"},children:["Line: ",u.lineValue.toFixed(1)]})]},u.name))})]})};var uh=t=>{let o=.2+Math.max(0,Math.min(1,t))*.8;return `color-mix(in oklch, var(--orb-chart-1) ${Math.round(o*100)}%, transparent)`},hp=({data:t})=>{if(t.length===0)return f(E,{variant:"body2",muted:true,children:"No data"});let r=Array.from(new Set(t.map(i=>i.x))),o=Array.from(new Set(t.map(i=>i.y))),n=Math.max(...t.map(i=>i.value),1),a=new Map(t.map(i=>[`${i.y}__${i.x}`,i.value]));return f("div",{style:{overflowX:"auto"},children:g("div",{style:{display:"grid",gridTemplateColumns:`120px repeat(${r.length}, minmax(64px, 1fr))`,gap:1,minWidth:120+r.length*64},children:[f("div",{}),r.map(i=>f(E,{variant:"caption",sx:{textAlign:"center",fontWeight:600},children:i},i)),o.map(i=>g("div",{style:{display:"contents"},children:[f(E,{variant:"caption",sx:{alignSelf:"center"},children:i}),r.map(s=>{let l=a.get(`${i}__${s}`)||0,d=l/n;return f("div",{sx:{height:36,borderRadius:1,background:uh(d),border:"1px solid color-mix(in oklch, var(--orb-muted) 20%, transparent)",display:"flex",alignItems:"center",justifyContent:"center"},children:f(E,{variant:"caption",sx:{fontWeight:700},children:l.toFixed(1)})},`${i}-${s}`)})]},i))]})})};var mh=["var(--orb-chart-1)","var(--orb-chart-2)","var(--orb-chart-5)","var(--orb-chart-negative)","var(--orb-chart-4)","var(--orb-chart-3)"],fi=({data:t,variant:r="donut",colors:o=mh,size:n=180,activeName:a,onItemClick:i})=>{if(t.length===0)return f(E,{variant:"body2",muted:true,children:"No data"});let s=0,l=t.map((d,p)=>{let u=s;return s+=d.percent,`${o[p%o.length]} ${u}% ${s}%`});return g(ae,{direction:{xs:"column",sm:"row"},spacing:2,alignItems:"center",children:[f("div",{style:{width:n,height:n,borderRadius:"50%",background:`conic-gradient(${l.join(", ")})`,position:"relative",flexShrink:0},children:r==="donut"&&f("div",{style:{position:"absolute",inset:Math.round(n*.18),background:"background.paper",borderRadius:"50%"}})}),f(ae,{spacing:1,sx:{minWidth:180},children:t.map((d,p)=>g("div",{onClick:()=>i?.(d),sx:{display:"flex",alignItems:"center",gap:1,cursor:i?"pointer":"default",opacity:a&&d.name!==a?.45:1},children:[f("div",{style:{width:10,height:10,borderRadius:"50%",background:o[p%o.length]}}),f(E,{variant:"caption",sx:{flex:1},children:d.name}),g(E,{variant:"caption",sx:{fontWeight:700},children:[d.percent.toFixed(0),"%"]})]},d.name))})]})};var bp=({effect:t,branches:r})=>{if(r.length===0)return f(E,{variant:"body2",muted:true,children:"No data"});let o=r.filter((a,i)=>i%2===0),n=r.filter((a,i)=>i%2===1);return g(ae,{spacing:1.5,children:[f("div",{style:{display:"grid",gridTemplateColumns:`repeat(${Math.max(o.length,1)}, minmax(0, 1fr))`,gap:1},children:o.map(a=>g("div",{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1},children:[f(E,{variant:"caption",sx:{fontWeight:700},children:a.title}),a.causes.map(i=>f(E,{variant:"caption",muted:true,sx:{display:"block"},children:i},i))]},a.title))}),g("div",{style:{position:"relative",height:32},children:[f("div",{style:{position:"absolute",inset:"50% 0 auto 0",borderTop:"2px solid",borderColor:"primary.main"}}),f("div",{sx:{position:"absolute",right:0,top:"calc(50% - 12px)",px:1,py:.25,borderRadius:1,background:"primary.main",color:"primary.contrastText"},children:f(E,{variant:"caption",sx:{fontWeight:700},children:t})})]}),f("div",{style:{display:"grid",gridTemplateColumns:`repeat(${Math.max(n.length,1)}, minmax(0, 1fr))`,gap:1},children:n.map(a=>g("div",{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1},children:[f(E,{variant:"caption",sx:{fontWeight:700},children:a.title}),a.causes.map(i=>f(E,{variant:"caption",muted:true,sx:{display:"block"},children:i},i))]},a.title))})]})};var vp=({data:t,height:r=240})=>{if(t.length===0)return f(E,{variant:"body2",muted:true,children:"No data"});let o=0,n=t.map(f=>{let h=f.type==="total"?0:o,m=f.type==="total"?f.value:o+f.value;return f.type!=="total"&&(o=m),{...f,start:h,end:m,delta:m-h}}),a=n.flatMap(f=>[f.start,f.end]),i=Math.min(...a,0),s=Math.max(...a,1),l=680,d=30,p=s-i||1,u=f=>r-d-(f-i)/p*(r-d*2);return g("div",{children:[g("div",{component:"svg",viewBox:`0 0 ${l} ${r}`,style:{width:"100%",height:r},children:[f("line",{x1:d,y1:u(0),x2:l-d,y2:u(0),style:{stroke:"var(--orb-chart-grid)"}}),n.map((f$1,h)=>{let m=(l-d*2)/n.length,v=Math.max(m*.55,8),y=d+h*m+(m-v)/2,g$1=u(Math.max(f$1.start,f$1.end)),x=u(Math.min(f$1.start,f$1.end)),b=f$1.type==="total"?"var(--orb-chart-1)":f$1.delta>=0?"var(--orb-chart-positive)":"var(--orb-chart-negative)";return g("g",{children:[f("rect",{x:y,y:g$1,width:v,height:Math.max(x-g$1,4),rx:6,style:{fill:b}}),f("text",{x:y+v/2,y:g$1-6,textAnchor:"middle",fill:"currentColor",fontSize:"11",children:f$1.end.toFixed(1)})]},f$1.name)})]}),f("div",{sx:{mt:1,display:"grid",gridTemplateColumns:`repeat(${n.length}, minmax(0, 1fr))`,gap:1},children:n.map(f$1=>f(E,{variant:"caption",title:f$1.name,children:f$1.name},f$1.name))})]})};var Qn=({apiKey:t,query:r,zoom:o=14,mapType:n="roadmap"})=>{let a=encodeURIComponent(r);return `https://www.google.com/maps/embed/v1/place?key=${encodeURIComponent(t)}&q=${a}&zoom=${o}&maptype=${n}`},jI=(t,r=360)=>{let o=Qn(t);return `<iframe width="100%" height="${r}" style="border:0" loading="lazy" allowfullscreen referrerpolicy="no-referrer-when-downgrade" src="${o}"></iframe>`};var yp=({apiKey:t,query:r,embedUrl:o,zoom:n=14,mapType:a="roadmap",height:i=320})=>{let s=o||(t&&r?Qn({apiKey:t,query:r,zoom:n,mapType:a}):"");return s?g("div",{children:[f("div",{component:"iframe",src:s,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",sx:{width:"100%",height:i,border:0,borderRadius:2}}),g(E,{variant:"caption",muted:true,sx:{mt:.75,display:"block"},children:["If iframe is blocked, open directly: ",f("a",{href:s,target:"_blank",rel:"noreferrer",children:"Google Maps"})]})]}):f("div",{children:f(E,{variant:"body2",muted:true,children:"Google Map requires `embedUrl` or (`apiKey` + `query`)."})})};var hi=({keyword:t,location:r,src:o="orbcafe-ui"})=>{if(r){let n=encodeURIComponent(r.name||t||"Location");return `https://uri.amap.com/marker?position=${r.lng},${r.lat}&name=${n}&src=${encodeURIComponent(o)}&coordinate=gaode&callnative=0`}return t?`https://uri.amap.com/search?keyword=${encodeURIComponent(t)}&src=${encodeURIComponent(o)}&callnative=0`:"https://uri.amap.com/search?keyword=%E5%8C%97%E4%BA%AC&src=orbcafe-ui&callnative=0"};var Cp=({keyword:t,location:r,embedUrl:o,height:n=320})=>{let a=o||hi({keyword:t,location:r?{lng:r.lng,lat:r.lat,name:r.name}:void 0});return g("div",{children:[f("div",{component:"iframe",src:a,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",sx:{width:"100%",height:n,border:0,borderRadius:2}}),g(E,{variant:"caption",muted:true,sx:{mt:.75,display:"block"},children:["If iframe is blocked, open directly: ",f("a",{href:a,target:"_blank",rel:"noreferrer",children:"AMap"})]})]})};var xp=({billableByPrimary:t,efficiencyBySecondary:r,statusDistribution:o,interaction:n})=>{let{t:a}=de();return g("div",{style:{display:"grid",gap:12,gridTemplateColumns:"repeat(auto-fit, minmax(320px, 1fr))"},children:[f(gi,{title:a("graph.chart.billable.title"),subtitle:a("graph.chart.billable.subtitle"),children:f(Zn,{data:t,orientation:"horizontal",activeName:n?.filters?.primaryDimension,onItemClick:i=>n?.onPrimaryDimensionClick?.(i.name)})}),f(gi,{title:a("graph.chart.efficiency.title"),subtitle:a("graph.chart.efficiency.subtitle"),children:f(Zn,{data:r,orientation:"vertical",valueSuffix:"%",activeName:n?.filters?.secondaryDimension,onItemClick:i=>n?.onSecondaryDimensionClick?.(i.name)})}),f(gi,{title:a("graph.chart.status.title"),subtitle:a("graph.chart.status.subtitle"),children:f(fi,{data:o,variant:"donut",activeName:n?.filters?.status,onItemClick:i=>n?.onStatusClick?.(i.name)})})]})};var fh=["doubao-lite","gpt-4o-mini","gpt-4.1-mini","claude-3.5-sonnet"],hh=["zh","en","de","fr","ja","ko"],Sp=({open:t,onClose:r,value:o,onSaveAll:n,modelOptions:a=fh,promptLangOptions:i=hh,analysisTemplateOptions:s=[],responseTemplateOptions:l=[],defaultAnalysisTemplateId:d,defaultResponseTemplateId:p})=>{let[u,f$1]=useState(o),[h,m]=useState(d||""),[v,y]=useState(p||""),[g$1,x]=useState(false);useEffect(()=>{t&&(f$1(o),m(d||""),y(p||""));},[t,o,d,p]);let b=(P,S)=>{f$1(k=>({...k,[P]:S}));},C=async()=>{if(n)try{x(!0),await n({settings:u,analysisTemplateId:h||void 0,responseTemplateId:v||void 0});}finally{x(false);}};return g(Ht,{open:t,onClose:r,fullWidth:true,maxWidth:"lg",children:[g("div",{className:"orb-dialog-title",sx:{pr:7,pb:2.2},children:[f(E,{variant:"h5",sx:{fontWeight:800},children:"AI Settings"}),f(E,{variant:"body2",color:"text.secondary",sx:{mt:.5},children:"Configure LLM settings and editable agent prompts by language."}),f(ne,{onClick:r,sx:{position:"absolute",right:12,top:12},children:f(Co,{})})]}),f("div",{className:"orb-dialog-content",sx:{pt:"18px !important"},children:g(ae,{spacing:2.2,children:[g("div",{sx:{mt:.8,display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",md:"repeat(2, minmax(0, 1fr))"}},children:[f("div",{children:f(He,{size:"small",value:u.baseUrl,onChange:P=>b("baseUrl",P.target.value),fullWidth:true,label:"Base URL"})}),f("div",{children:f(He,{size:"small",type:"password",value:u.apiKey,onChange:P=>b("apiKey",P.target.value),fullWidth:true,label:"API Key"})}),f("div",{children:f(He,{size:"small",value:u.model,onChange:P=>b("model",P.target.value),fullWidth:true,select:true,label:"Model",children:a.map(P=>f("option",{value:P,children:P},P))})}),f("div",{children:f(He,{size:"small",value:u.promptLang,onChange:P=>b("promptLang",P.target.value),fullWidth:true,select:true,label:"Prompt Lang",children:i.map(P=>f("option",{value:P,children:P},P))})})]}),g("div",{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[g(He,{size:"small",value:h,onChange:P=>m(P.target.value),fullWidth:true,select:true,label:"Analysis Template",children:[f("option",{value:"",children:"Default"}),s.map(P=>f("option",{value:P.id,children:P.label},P.id))]}),f(On,{multiline:true,minRows:8,value:u.analysisPrompt,onChange:P=>b("analysisPrompt",P.target.value),fullWidth:true,label:"Analysis Prompt",sx:{"& textarea":{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"}}}),g(He,{size:"small",value:v,onChange:P=>y(P.target.value),fullWidth:true,select:true,label:"Response Template",children:[f("option",{value:"",children:"Default"}),l.map(P=>f("option",{value:P.id,children:P.label},P.id))]}),f(On,{multiline:true,minRows:8,value:u.responsePrompt,onChange:P=>b("responsePrompt",P.target.value),fullWidth:true,label:"Response Prompt",sx:{"& textarea":{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"}}})]})]})}),g("div",{className:"orb-dialog-actions",sx:{px:3,pb:2.5,pt:1.2,gap:1},children:[f(ye,{variant:"outlined",onClick:r,children:"Cancel"}),f(ye,{variant:"contained",onClick:C,disabled:!n||g$1,children:"Save"})]})]})};var vi=({open:t,onClose:r,model:o,tableContent:n,extraCharts:a,interaction:i,aiAssistant:s})=>{let{t:l}=de(),[d,p]=useState(s?.defaultPrompt||""),[u,f$1]=useState(false),[h,m]=useState(false),v=i?.enabled!==false&&!!i,y=s?.enabled!==false,g$1=i?.filters||{},x=!!(g$1.primaryDimension||g$1.secondaryDimension||g$1.status),b=s?.placeholder||"Ask AI to analyze data, create charts, or find insights...";useEffect(()=>{t&&p(s?.defaultPrompt||"");},[t,s?.defaultPrompt]);let C=s?.settings||{baseUrl:"/llm-api",apiKey:"",model:"doubao-lite",promptLang:"zh",analysisPrompt:"",responsePrompt:""},P=async()=>{let S=d.trim();if(!(!S||!s?.onSubmit))try{f$1(!0),await s.onSubmit(S,{filters:g$1,model:o});}finally{f$1(false);}};return f(Ht,{open:t,onClose:r,fullWidth:true,maxWidth:1400,hideCloseButton:true,children:g("div",{style:{height:"80vh",display:"flex",flexDirection:"column",background:"var(--orb-canvas)"},children:[f("div",{style:{padding:16,borderBottom:"1px solid var(--orb-border)"},children:g(ae,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:12,children:[g(ae,{direction:"row",spacing:10,alignItems:"center",sx:{flexWrap:"wrap"},children:[f(E,{variant:"h3",sx:{fontWeight:800},children:o.title}),f(kt,{label:l("graph.records",{count:o.kpis.totalRecords})}),v&&g$1.primaryDimension&&f(kt,{tone:"outline",label:`${i?.fieldMapping.primaryDimension}: ${g$1.primaryDimension}`,onDelete:()=>i?.onClearFilter("primaryDimension")}),v&&g$1.secondaryDimension&&f(kt,{tone:"outline",label:`${i?.fieldMapping.secondaryDimension}: ${g$1.secondaryDimension}`,onDelete:()=>i?.onClearFilter("secondaryDimension")}),v&&g$1.status&&f(kt,{tone:"outline",label:`${i?.fieldMapping.status}: ${g$1.status}`,onDelete:()=>i?.onClearFilter("status")}),v&&x&&f(ye,{size:"small",variant:"ghost",onClick:()=>i?.onClearAll(),children:"Clear"})]}),g(ae,{direction:"row",spacing:10,alignItems:"center",children:[y&&g("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"6px 10px",borderRadius:999,border:"1px solid var(--orb-border)",background:"var(--orb-surface)",minWidth:320},children:[f(ne,{size:"small",onClick:s?.onVoiceInput,children:f(Ta,{size:16,strokeWidth:1.8})}),f("input",{className:"orb-inp orb-inp-dense",value:d,onChange:S=>p(S.target.value),onKeyDown:S=>{S.key==="Enter"&&(S.preventDefault(),P());},placeholder:b,style:{fontSize:14,border:"none",background:"transparent",flex:1,minWidth:0}}),f(ne,{size:"small",onClick:P,disabled:u||!d.trim(),children:f(Ic,{size:16,strokeWidth:1.8})}),f(ne,{size:"small",onClick:()=>m(true),children:f(Qo,{size:16,strokeWidth:1.8})})]}),f(ne,{onClick:r,children:f(Xt,{size:18,strokeWidth:2})})]})]})}),g("div",{style:{padding:16,display:"flex",flexDirection:"column",gap:12,overflow:"auto",minHeight:0},children:[f(mp,{kpis:o.kpis}),f(xp,{billableByPrimary:o.charts.billableByPrimary,efficiencyBySecondary:o.charts.efficiencyBySecondary,statusDistribution:o.charts.statusDistribution,interaction:v?{filters:g$1,onPrimaryDimensionClick:S=>i?.onPrimaryDimensionClick(S),onSecondaryDimensionClick:S=>i?.onSecondaryDimensionClick(S),onStatusClick:S=>i?.onStatusClick(S)}:void 0}),a,n]}),f(Sp,{open:h,onClose:()=>m(false),value:C,onSaveAll:s?.onSaveAll,modelOptions:s?.modelOptions,promptLangOptions:s?.promptLangOptions,analysisTemplateOptions:s?.analysisTemplateOptions,responseTemplateOptions:s?.responseTemplateOptions,defaultAnalysisTemplateId:s?.defaultAnalysisTemplateId,defaultResponseTemplateId:s?.defaultResponseTemplateId})]})})};var Po={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"]},vh=5,wp=t=>t.toLowerCase().replace(/[\s_-]/g,""),To=(t,r,o,n)=>{if(r)return r;if(t.length===0)return n;let a=Object.keys(t[0]),i=new Map(a.map(s=>[wp(s),s]));for(let s of o){let l=i.get(wp(s));if(l)return l}return a[0]||n},wr=t=>{if(typeof t=="number")return Number.isFinite(t)?t:0;if(typeof t=="string"){let r=Number(t.replace(/,/g,"").trim());return Number.isFinite(r)?r:0}return 0},pr=(t,r)=>t==null||t===""?r:String(t),yh=(t,r,o,n,a)=>{let i=new Map;return t.forEach(s=>{let l=pr(s[r],a);i.set(l,(i.get(l)||0)+wr(s[o]));}),Array.from(i.entries()).map(([s,l])=>({name:s,value:l})).sort((s,l)=>l.value-s.value).slice(0,n)},Ch=(t,r,o,n,a,i)=>{let s=new Map;return t.forEach(l=>{let d=pr(l[r],i),p=s.get(d)||{report:0,billable:0};p.report+=wr(l[o]),p.billable+=wr(l[n]),s.set(d,p);}),Array.from(s.entries()).map(([l,d])=>({name:l,value:d.report>0?d.billable/d.report*100:0})).sort((l,d)=>l.value-d.value).slice(0,a)},xh=(t,r,o)=>{let n=t.length;if(n===0)return [];let a=new Map;return t.forEach(i=>{let s=pr(i[r],o);a.set(s,(a.get(s)||0)+1);}),Array.from(a.entries()).map(([i,s])=>({name:i,value:s,percent:s/n*100}))},kp=(t,r,o)=>{let n=new Map;return t.forEach(a=>{let i=pr(a[r],"N/A");n.set(i,(n.get(i)||0)+wr(a[o]));}),Array.from(n.entries()).sort(([a],[i])=>a.localeCompare(i)).map(([a,i])=>({name:a,value:i}))},Sh=(t,r,o,n,a,i)=>{let s=new Map;return t.forEach(l=>{let d=pr(l[r],i),p=s.get(d)||{report:0,billable:0};p.report+=wr(l[o]),p.billable+=wr(l[n]),s.set(d,p);}),Array.from(s.entries()).map(([l,d])=>({name:l,barValue:d.billable,lineValue:d.report>0?d.billable/d.report*100:0})).sort((l,d)=>d.barValue-l.barValue).slice(0,a)},wh=(t,r,o,n,a)=>{let i=new Map;return t.forEach(s=>{let l=pr(s[r],a),d=pr(s[o],a),p=`${l}__${d}`;i.set(p,(i.get(p)||0)+wr(s[n]));}),Array.from(i.entries()).map(([s,l])=>{let[d,p]=s.split("__");return {x:d,y:p,value:l}})},kh=(t,r,o)=>{let n=kp(t,r,o),a=n.map(s=>({name:s.name,value:s.value,type:"delta"})),i=n.reduce((s,l)=>s+l.value,0);return [...a,{name:"Total",value:i,type:"total"}]},Ph=(t,r,o,n,a,i)=>{let s=new Map;return t.forEach(l=>{let d=pr(l[r],i),p=`${pr(l[o],i)} / ${pr(l[n],i)}`,u=s.get(d)||new Map;u.set(p,(u.get(p)||0)+1),s.set(d,u);}),Array.from(s.entries()).map(([l,d])=>({title:l,causes:Array.from(d.entries()).sort((p,u)=>u[1]-p[1]).slice(0,a).map(([p,u])=>`${p} (${u})`)})).slice(0,6)},cn=({rows:t,config:r})=>{let{t:o}=de(),n=o("graph.unassigned"),a=useMemo(()=>{let u=r?.fieldMapping;return {primaryDimension:To(t,u?.primaryDimension,Po.primaryDimension,"Category"),secondaryDimension:To(t,u?.secondaryDimension,Po.secondaryDimension,"Owner"),status:To(t,u?.status,Po.status,"Status"),date:To(t,u?.date,Po.date,"Date"),description:To(t,u?.description,Po.description,"Description"),reportHours:To(t,u?.reportHours,Po.reportHours,"ReportHours"),billableHours:To(t,u?.billableHours,Po.billableHours,"BillableHours"),amount:To(t,u?.amount,Po.amount,"Amount")}},[t,r?.fieldMapping]),i=useMemo(()=>t.map((u,f)=>{let h=wr(u[a.reportHours]),m=wr(u[a.billableHours]),v=wr(u[a.amount]),y=h>0?m/h*100:0;return {id:`graph-row-${f}`,Date:pr(u[a.date],""),Primary:pr(u[a.primaryDimension],n),Secondary:pr(u[a.secondaryDimension],n),Description:pr(u[a.description],""),ReportHours:h,BillableHours:m,Amount:v,Efficiency:y,Status:pr(u[a.status],n)}}),[t,a,n]),s=useMemo(()=>{let u=i.length,f=i.reduce((x,b)=>x+wr(b.ReportHours),0),h=i.reduce((x,b)=>x+wr(b.BillableHours),0),m=i.reduce((x,b)=>x+wr(b.Amount),0),v=f>0?h/f*100:0,y=r?.statusFlagValues||["flag","flagged","warning","risk"],g=i.filter(x=>y.includes(pr(x.Status,"").toLowerCase())).length;return {totalRecords:u,totalReportHours:f,totalBillableHours:h,efficiency:v,totalAmount:m,flaggedCount:g}},[i,r?.statusFlagValues]),l=r?.topN||vh,d=useMemo(()=>({billableByPrimary:yh(i,"Primary","BillableHours",l,n),efficiencyBySecondary:Ch(i,"Secondary","ReportHours","BillableHours",l,n),statusDistribution:xh(i,"Status",n),lineByDate:kp(i,"Date","BillableHours"),comboByPrimary:Sh(i,"Primary","ReportHours","BillableHours",l,n),heatmapPrimarySecondary:wh(i,"Primary","Secondary","BillableHours",n),waterfallBillable:kh(i,"Date","BillableHours"),fishboneStatusCauses:Ph(i,"Status","Primary","Secondary",3,n)}),[i,l,n]),p=useMemo(()=>({title:r?.title||o("graph.reportTitle"),kpis:s,charts:d,table:{columns:[{id:"Date",label:a.date},{id:"Primary",label:a.primaryDimension},{id:"Secondary",label:a.secondaryDimension},{id:"Description",label:a.description},{id:"ReportHours",label:o("graph.column.reportHours"),align:"right"},{id:"BillableHours",label:o("graph.column.billableHours"),align:"right"},{id:"Amount",label:"Amount",align:"right"},{id:"Efficiency",label:"Efficiency",align:"right"},{id:"Status",label:a.status}],rows:i}}),[d,r?.title,a,s,i,o]);return {fieldMapping:a,model:p}};var dn=t=>String(t??"").trim(),Ci=(t={})=>{let[r,o]=useState(t),n=useCallback((d,p)=>{o(u=>{let f=p?.trim();if(!f){let h={...u};return delete h[d],h}if(u[d]===f){let h={...u};return delete h[d],h}return {...u,[d]:f}});},[]),a=useCallback(d=>{o(p=>{if(!p[d])return p;let u={...p};return delete u[d],u});},[]),i=useCallback(()=>{o({});},[]),s=useMemo(()=>!!(r.primaryDimension||r.secondaryDimension||r.status),[r]),l=useCallback((d,p)=>d.filter(u=>!(r.primaryDimension&&dn(u[p.primaryDimension])!==dn(r.primaryDimension)||r.secondaryDimension&&dn(u[p.secondaryDimension])!==dn(r.secondaryDimension)||r.status&&dn(u[p.status])!==dn(r.status))),[r]);return {filters:r,setFilter:n,clearFilter:a,clearAll:i,hasActiveFilters:s,applyRows:l}};var Si=({variants:t,currentVariantId:r,onLoad:o,onSave:n,onDelete:a,onSetDefault:i})=>{let{t:s}=de(),[l,d]=useState(false),[p,u]=useState(""),[f$1,h]=useState(false),[m,v]=useState(false),y=t.find(b=>b.id===r),g$1=()=>{u(y?.name||s("variant.newVariant")),h(y?.isDefault||false),v(y?.isPublic||false),d(true);},x=()=>{n({name:p,isDefault:f$1,isPublic:m,description:""}),d(false);};return g("div",{className:"orb-variant-management",children:[f(Vt,{size:"small",fullWidth:false,sx:{width:"min(240px, 100%)","& .orb-inp":{fontSize:"0.85rem",backgroundColor:"var(--orb-p50)",borderColor:"color-mix(in oklch, var(--orb-primary) 30%, var(--orb-border))"}},value:r||"",options:[{value:"",label:s("variant.selectVariant"),disabled:true},...t.map(b=>({value:b.id,label:b.name+(b.isDefault?` (${s("variant.defaultSuffix")})`:"")}))],onChange:b=>{let C=t.find(P=>P.id===b.target.value);C&&o(C);}}),f(st,{title:s("variant.saveView"),children:f(ne,{className:"orb-variant-save-button",onClick:g$1,size:"small",color:"primary",children:f(So,{fontSize:"small"})})}),g(Ht,{open:l,onClose:()=>d(false),children:[f("div",{className:"orb-dialog-title",children:s("variant.saveView")}),g("div",{className:"orb-dialog-content",children:[f(He,{autoFocus:true,margin:"dense",label:s("variant.viewName"),fullWidth:true,variant:"outlined",value:p,onChange:b=>u(b.target.value)}),f(Kn,{control:f(Rt,{checked:f$1,onChange:b=>h(b.target.checked)}),label:s("variant.setDefault")}),f(Kn,{control:f(Rt,{checked:m,onChange:b=>v(b.target.checked)}),label:s("variant.publicAllUsers")})]}),g("div",{className:"orb-dialog-actions",children:[f(ye,{onClick:()=>d(false),children:s("common.cancel")}),f(ye,{onClick:x,variant:"contained",children:s("common.save")})]})]})]})};var Tp=({appId:t,tableKey:r="default",currentFilters:o,currentLayoutId:n,layoutRefs:a,onLoad:i,variantService:s,serviceUrl:l,onError:d,onSuccess:p,currentVariantId:u,onVariantChange:f$1})=>{let{t:h}=de(),[m,v]=useState([]),[y,g]=useState(""),x=`orbcafe.variants.${t}.${r}`,b=u!==void 0?u:y,C=N=>{u===void 0&&g(N),f$1&&f$1(N);},P=useCallback(()=>{try{let N=localStorage.getItem(x);if(!N)return [];let D=JSON.parse(N);return Array.isArray(D)?D:[]}catch{return []}},[x]),S=useCallback(N=>{try{localStorage.setItem(x,JSON.stringify(N));}catch{}},[x]),k=useCallback(N=>{v(N);let D=N.find(L=>L.isDefault);D&&!b&&(C(D.id),i(D));},[b,i,C]),I=useCallback(async()=>{if(!t)return [];try{let N=[];if(s)N=await s.getVariants(t,r);else if(l){let D=await fetch(`${l}/api/variants?appId=${encodeURIComponent(t)}&tableKey=${encodeURIComponent(r)}`);if(!D.ok)throw new Error(h("variant.toast.fetchFailed"));N=await D.json();}else N=P();return k(N),N}catch(N){console.error("Error fetching variants",N);let D=P();return k(D),d&&d(h("variant.toast.fetchFailed")),D}},[t,r,s,l,P,k,d,h]);return useEffect(()=>{I();},[t,r]),f(Si,{variants:m,currentVariantId:b,onLoad:N=>{C(N.id),i(N);},onSave:async N=>{let D=Date.now().toString(),L;try{let B=N.scope||"Both",X=m.find(G=>G.name===N.name);D=X?X.id:Date.now().toString();let H=[];if(X&&(Array.isArray(X.filters)?H=[...X.filters]:X.filters&&(H=[{scope:"default",filters:X.filters}])),B==="Search"||B==="Both"){let G=(Array.isArray(o),o);if(G)if(Array.isArray(G)&&G.length>0&&G[0].scope)G.forEach(z=>{let O=H.findIndex(Y=>Y.scope===z.scope);O>=0?H[O]=z:H.push(z);});else {let z={scope:r,filters:G},O=H.findIndex(Y=>Y.scope===r);O>=0?H[O]=z:H.push(z);}}let K=X?.layout||{},W=[];if(X&&Array.isArray(X.layoutRefs)&&(W=[...X.layoutRefs]),B==="Layout"||B==="Both")if(a&&a.length>0)a.forEach(G=>{let z=W.findIndex(O=>O.tableKey===G.tableKey);z>=0?W[z]=G:W.push(G);});else {let G={tableKey:r,layoutId:n||null},z=W.findIndex(O=>O.tableKey===r);z>=0?W[z]=G:W.push(G);}if(L={appId:t,tableKey:r,...N,scope:B,id:D,createdAt:new Date().toISOString(),filters:H,layout:K,layoutRefs:W},s)await s.saveVariant(L,t,r);else if(l){if(!(await fetch(`${l}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(L)})).ok)throw new Error(h("variant.toast.saveFailed"))}else {let z=m.some(O=>O.id===D)?m.map(O=>O.id===D?L:O):[...m,L];v(z),S(z);}p&&p(h("variant.toast.saveSuccess")),(s||l)&&await I(),C(D),i(L);}catch(B){console.error("Error saving variant",B);let H=m.some(K=>K.id===D)?m.map(K=>K.id===D?L:K):[...m,L];v(H),S(H),C(D),i(L),d&&d(h("variant.toast.saveFailed"));}},onDelete:async N=>{try{if(s)await s.deleteVariant(N);else if(l){if(!(await fetch(`${l}/api/variants/${N}`,{method:"DELETE"})).ok)throw new Error(h("variant.toast.deleteFailed"))}else {let D=m.filter(L=>L.id!==N);v(D),S(D);}b===N&&C(""),(s||l)&&I(),p&&p(h("variant.toast.deleteSuccess"));}catch(D){console.error("Error deleting variant",D);let L=m.filter(B=>B.id!==N);v(L),S(L),b===N&&C(""),d&&d(h("variant.toast.deleteFailed"));}},onSetDefault:async N=>{try{let D=m.find(B=>B.id===N);if(!D)return;let L={appId:t,tableKey:r,...D,isDefault:!0};if(s)await s.setDefaultVariant(N,t,r);else if(l){if(!(await fetch(`${l}/api/variants`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(L)})).ok)throw new Error(h("variant.toast.defaultFailed"))}else {let B=m.map(X=>({...X,isDefault:X.id===N}));v(B),S(B);}(s||l)&&await I(),p&&p(h("variant.toast.defaultSuccess"));}catch(D){console.error("Error setting default variant",D);let L=m.map(B=>({...B,isDefault:B.id===N}));v(L),S(L),d&&d(h("variant.toast.defaultFailed"));}}})};eo.extend(Nh);eo.extend(Ah);eo.extend(bf);var Jn="YYYY-MM-DD",Lh=[null,null],Bo="0.85rem",Oh={en:"en",zh:"zh-cn",fr:"fr",de:"de",ja:"ja",ko:"ko"},Fh=({isInRange:t,isStart:r,isEnd:o,isHovered:n,disableMargin:a,sx:i,...s})=>{let l=ar();return f(fd,{...s,sx:[...Array.isArray(i)?i:i?[i]:[],t?{borderRadius:0,backgroundColor:l.palette.primary.light,color:l.palette.primary.contrastText}:{},n&&!t&&!r&&!o?{borderRadius:0,backgroundColor:l.palette.action.hover,border:`1px dashed ${l.palette.primary.main}`}:{},r?{borderRadius:"50% 0 0 50%",backgroundColor:l.palette.primary.main,color:l.palette.primary.contrastText}:{},o?{borderRadius:"0 50% 50% 0",backgroundColor:l.palette.primary.main,color:l.palette.primary.contrastText}:{},r&&o?{borderRadius:"50%"}:{}]})},Mp=({label:t,value:r=Lh,onChange:o})=>{let{t:n,locale:a}=de(),i=Oh[a]||"en",s=t||n("dateRange.label"),[l,d]=useState(null),[p,u]=useState(r),[f$1,h]=useState("start"),[m,v]=useState(null),[y,g$1]=useState((r[0]||eo()).locale(i)),[x,b]=useState(""),[C,P]=useState(""),[S,k]=useState(false),[I,w]=useState(false),A=Qt__default.useRef(r);useEffect(()=>{let[G,z]=r,[O,Y]=A.current,Q=se=>se&&typeof se.isSame=="function",me=!(G===null&&O===null||Q(G)&&Q(O)&&G.isSame(O,"day")),ie=!(z===null&&Y===null||Q(z)&&Q(Y)&&z.isSame(Y,"day"));(me||ie)&&(u(r),r[0]&&Q(r[0])&&g$1(r[0].locale(i))),A.current=r;},[r,i]),useEffect(()=>{b(p[0]?p[0].locale(i).format(Jn):""),P(p[1]?p[1].locale(i).format(Jn):""),k(false),w(false);},[p,i]);let R=(G,z)=>{let O=z.trim(),Y=G==="start"?k:w;if(!O){let ie=G==="start"?[null,p[1]]:[p[0],null];Y(false),u(ie);return}let Q=eo(O,Jn,true).locale(i);if(!Q.isValid()){Y(true);return}Y(false);let me=[...p];if(G==="start")me[0]=Q,me[1]&&Q.isAfter(me[1],"day")&&(me[1]=null),h(me[1]?"start":"end");else {let ie=me[0];ie&&Q.isBefore(ie,"day")?(me=[Q,null],h("end")):(me[1]=Q,h("start"));}u(me),g$1(Q);},T=G=>{d(G.currentTarget);},N=()=>{d(null),h("start"),v(null);},D=!!l,L=G=>{if(!G)return;let z=[...p];if(f$1==="start")z=[G,null],h("end");else {let O=z[0];O&&G.isBefore(O)?(z=[G,null],h("end")):(z=[O,G],h("start"));}u(z);},B=G=>{let z=eo().locale(i),O=[null,null];switch(G){case "today":O=[z,z];break;case "week":O=[z.startOf("week"),z.endOf("week")];break;case "month":O=[z.startOf("month"),z.endOf("month")];break}u(O),h("start"),g$1(z);},X=()=>{o&&o(p),N();},H=()=>{u(r),h("start"),N();},K=useCallback(G=>{let{day:z,...O}=G,[Y,Q]=p,me=Y?z.isSame(Y,"day"):false,ie=Q?z.isSame(Q,"day"):false,se=Y&&Q?z.isBetween(Y,Q,"day","()"):false,fe=false;return f$1==="end"&&Y&&!Q&&m&&z.isAfter(Y,"day")&&z.isBefore(m.add(1,"day"),"day")&&(fe=true),f(Fh,{...O,day:z,disableMargin:true,isStart:me,isEnd:ie,isInRange:se||fe,onMouseEnter:()=>v(z)})},[p,f$1,m]),W=G=>G?G.locale(i).format("YYYY-MM-DD"):"";return g("div",{className:"orb-date-range-picker",children:[f(He,{className:"orb-date-range-field",label:s,value:p[0]?`${W(p[0])} - ${W(p[1])}`:"",onClick:T,fullWidth:true,size:"small",InputLabelProps:{sx:{fontSize:Bo}},InputProps:{readOnly:true,sx:{fontSize:Bo,"& .orb-inp":{fontSize:Bo},paddingRight:"4px"},endAdornment:f(ne,{className:"orb-date-range-calendar-trigger",size:"small",onClick:T,tooltip:s,children:f(Mt,{name:"calendar",size:16})})}}),g(Xa,{open:D,anchorEl:l,onClose:N,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},className:"orb-date-range-popover",children:[f("div",{className:"orb-date-range-inputs",children:g(ae,{className:"orb-date-range-input-row",direction:"row",alignItems:"center",spacing:1.5,justifyContent:"space-between",children:[f(He,{className:"orb-date-range-manual-field",label:n("dateRange.startDate"),placeholder:Jn,value:x,error:S,size:"small",onFocus:()=>h("start"),onChange:G=>{b(G.target.value),S&&k(false);},onBlur:()=>R("start",x),onKeyDown:G=>{G.key==="Enter"&&(G.preventDefault(),R("start",x));},sx:{"& .orb-inp":{fontSize:Bo,py:.75},"& label":{fontSize:Bo}}}),f(yd,{color:"action",fontSize:"small"}),f(He,{className:"orb-date-range-manual-field",label:n("dateRange.endDate"),placeholder:Jn,value:C,error:I,size:"small",onFocus:()=>{p[0]&&h("end");},onChange:G=>{P(G.target.value),I&&w(false);},onBlur:()=>R("end",C),onKeyDown:G=>{G.key==="Enter"&&(G.preventDefault(),R("end",C));},sx:{"& .orb-inp":{fontSize:Bo,py:.75},"& label":{fontSize:Bo}}})]})}),f("div",{className:"orb-date-range-shortcuts",children:g(ae,{direction:"row",spacing:1,justifyContent:"center",children:[f(kt,{label:n("dateRange.today"),onClick:()=>B("today"),clickable:true,size:"small",variant:"outlined"}),f(kt,{label:n("dateRange.thisWeek"),onClick:()=>B("week"),clickable:true,size:"small",variant:"outlined"}),f(kt,{label:n("dateRange.thisMonth"),onClick:()=>B("month"),clickable:true,size:"small",variant:"outlined"})]})}),f("div",{className:"orb-date-range-calendar",children:f(bd,{dateAdapter:_a,adapterLocale:i,children:f(hd,{value:null,referenceDate:y,onMonthChange:g$1,onYearChange:g$1,onChange:L,slots:{day:K},views:["year","month","day"],openTo:"day",showDaysOutsideCurrentMonth:true})})}),f(Nt,{}),g(ae,{direction:"row",justifyContent:"flex-end",spacing:1,sx:{p:2},children:[f(ye,{size:"small",onClick:H,color:"inherit",children:n("common.cancel")}),f(ye,{size:"small",variant:"contained",onClick:X,children:n("common.done")})]})]})]})};var ki={equals:"=",contains:"\u2287",notContains:"\u2285",wildcard:"*","=":"=","!=":"!=",">":">","<":"<",">=":"\u2265","<=":"\u2264",between:"\u2194"},zh={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"},Vh=["contains","notContains",">",">=","<","<=","equals"],Dp=["=","!=",">","<",">=","<=","between"],tr="0.85rem",Wh=({field:t,value:r,onChange:o})=>{let{t:n}=de(),[a,i]=useState(null),[s,l]=useState(null),[d,p]=useState(null),[u,f$1]=useState(""),[h,m]=useState(""),[v,y]=useState(""),[g$1,x]=useState("");useEffect(()=>{let T=setTimeout(()=>{x(v);},1e3);return ()=>clearTimeout(T)},[v]);let b=r?.operator||(t.type==="number"?"=":"equals"),C=r?.value,P=T=>{let N=zh[T];return N?n(N):T},S=T=>{i(a?null:T.currentTarget);},k=T=>{o({...r,operator:T,value:C}),i(null);},I={size:"small",fullWidth:true,variant:"outlined",InputLabelProps:{sx:{fontSize:tr}},InputProps:{sx:{fontSize:tr}},SelectProps:{MenuProps:{PaperProps:{sx:{"& .orb-menu-item, & option":{fontSize:tr,paddingTop:"4px",paddingBottom:"4px",minHeight:"auto"}}}}}},w=t.type||"text";if(w==="date"){let N=(D=>{if(!D)return [null,null];if(Array.isArray(D)&&D.length===2){let L=D[0]?eo.isDayjs(D[0])?D[0]:eo(D[0]):null,B=D[1]?eo.isDayjs(D[1])?D[1]:eo(D[1]):null;return [L,B]}return eo.isDayjs(D)||typeof D=="string"?[eo.isDayjs(D)?D:eo(D),null]:[null,null]})(C);return f(Mp,{label:t.label,value:N,onChange:D=>o({value:D,operator:"between"})})}if(w==="number"&&b==="between"){let T=()=>{o({value:[u,h],operator:"between"}),l(null);},N=Array.isArray(C)?`${C[0]||""} - ${C[1]||""}`:"";return g(e,{children:[f(He,{...I,label:t.label,value:N,placeholder:n("smartFilter.minMaxPlaceholder"),InputProps:{...I.InputProps,startAdornment:f(no,{position:"start",children:f(st,{title:P("between"),children:f(ne,{size:"small",onClick:S,sx:{width:24,height:24,fontSize:tr},children:ki.between})})}),readOnly:true},onClick:D=>l(s?null:D.currentTarget)}),f(Yt,{anchorEl:a,open:!!a,onClose:()=>i(null),PaperProps:{sx:{"& .orb-menu-item, & option":{fontSize:tr,minHeight:"auto",py:.5}}},children:Dp.map(D=>g("option",{selected:D===b,onClick:()=>k(D),children:[f("div",{sx:{width:24,display:"inline-block",fontWeight:"bold"},children:ki[D]}),f($t,{primary:P(D),primaryTypographyProps:{fontSize:tr}})]},D))}),f(Xa,{open:!!s,anchorEl:s,onClose:()=>l(null),anchorOrigin:{vertical:"bottom",horizontal:"left"},children:g("div",{sx:{p:2,display:"flex",gap:1,alignItems:"center"},children:[f(He,{size:"small",label:n("smartFilter.min"),type:"number",value:u,onChange:D=>f$1(D.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:tr}},InputProps:{sx:{fontSize:tr}}}),f(Cd,{color:"action"}),f(He,{size:"small",label:n("smartFilter.max"),type:"number",value:h,onChange:D=>m(D.target.value),sx:{width:100},InputLabelProps:{sx:{fontSize:tr}},InputProps:{sx:{fontSize:tr}}}),f(ye,{variant:"contained",size:"small",onClick:T,children:n("common.ok")})]})})]})}if(t.isValueHelp||w==="value-help"){let T=t.valueHelp?.mode||"single";return f(np,{...I,...t.valueHelp,label:t.label,placeholder:t.placeholder||t.valueHelp?.placeholder,value:C??(T==="multiple"?[]:null),mode:T,onChange:N=>o({value:N,operator:T==="multiple"?"anyOf":"equals"})})}if(w==="select")return g(Vt,{size:"small",fullWidth:true,label:t.label,value:C||"",onChange:T=>o({...r,value:T.target.value,operator:"equals"}),children:[f("option",{value:"",children:n("common.none")}),t.options?.map(T=>f("option",{value:T.value,children:T.label},T.value))]});if(w==="multi-select"){let T=Array.isArray(C)?C:[],N=t.options?.filter(K=>K.label.toLowerCase().includes(g$1.toLowerCase()))||[],D=K=>t.options?.find(W=>W.value===K)?.label||K,L=T.map(D),B=L.length===0?n("common.none"):L.length>2?`${L.slice(0,2).join(", ")} +${L.length-2}`:L.join(", "),X=()=>{p(null),y(""),x("");},H=K=>{let W=T.includes(K)?T.filter(G=>G!==K):[...T,K];o({...r,value:W,operator:"anyOf"});};return g("div",{className:"orb-fld",children:[f("label",{children:t.label}),g(ye,{variant:"outlined",size:"small",onClick:K=>p(d?null:K.currentTarget),sx:{width:"100%",minHeight:36,justifyContent:"space-between",fontSize:tr,fontWeight:400},children:[f("span",{sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:B}),f(Hr,{fontSize:"small"})]}),f(Yt,{anchorEl:d,open:!!d,onClose:X,PaperProps:{sx:{width:280,maxHeight:340,overflowY:"auto",p:.5}},children:g("div",{onClick:K=>K.stopPropagation(),sx:{display:"grid",gap:.35},children:[f(He,{size:"small",autoFocus:true,placeholder:n("smartFilter.searchPlaceholder"),fullWidth:true,InputProps:{startAdornment:f(no,{position:"start",children:f(Fo,{fontSize:"small"})}),sx:{fontSize:tr}},value:v,onChange:K=>y(K.target.value),onKeyDown:K=>K.stopPropagation()}),N.length>0?N.map(K=>{let W=T.includes(K.value);return g("div",{role:"option","aria-selected":W,tabIndex:0,className:`orb-menu-item ${W?"orb-selected":""}`,onClick:()=>H(K.value),onKeyDown:G=>{(G.key==="Enter"||G.key===" ")&&(G.preventDefault(),H(K.value));},children:[f(Rt,{checked:W,size:"small",inputProps:{tabIndex:-1},sx:{pointerEvents:"none"}}),f($t,{primary:K.label})]},String(K.value))}):f("div",{className:"orb-menu-item","aria-disabled":"true",children:n("smartFilter.noOptionsFound")})]})})]})}let A=w==="number"?Dp:Vh;return g(e,{children:[f(He,{...I,className:"orb-filter-operator-field",label:t.label,sx:{minWidth:"120px"},value:C||"",type:w==="number"?"number":"text",onChange:T=>o({...r,value:T.target.value,operator:b}),InputProps:{...I.InputProps,startAdornment:f(no,{position:"start",children:f(st,{title:P(b),children:f(ne,{className:"orb-filter-operator-trigger",size:"small",onClick:S,onMouseDown:T=>T.preventDefault(),sx:{width:24,height:24,fontSize:tr,fontWeight:"bold",color:"primary.main",bgcolor:"action.hover"},children:ki[b]})})}),endAdornment:t.hasSearchIcon?f(no,{position:"end",children:f(Fo,{color:"action"})}):void 0}}),f(Yt,{anchorEl:a,open:!!a,onClose:()=>i(null),PaperProps:{sx:{"& .orb-menu-item, & option":{fontSize:tr,minHeight:"auto",py:.5}}},children:A.map(T=>g("option",{selected:T===b,onClick:()=>k(T),children:[f("span",{className:"orb-filter-operator-symbol",children:ki[T]}),f($t,{primary:P(T),primaryTypographyProps:{fontSize:tr}})]},T))})]})},zr=({fields:t,filters:r,onFilterChange:o,variants:n=[],currentVariantId:a,onVariantLoad:i,onVariantSave:s,onVariantDelete:l,onVariantSetDefault:d,onSearch:p,loading:u=false,appId:f$1,tableKey:h,currentLayout:m,currentLayoutId:v,layoutRefs:y,variantService:g$1,serviceUrl:x})=>{let{t:b}=de(),[C,P]=useState(true),[S,k]=useState(null),[I,w]=useState(t.filter(N=>!N.hidden).map(N=>N.id)),A=(N,D)=>{o({...r,[N]:D});},R=N=>{I.includes(N)?w(I.filter(D=>D!==N)):w([...I,N]);};return g(Ae,{className:`orb-smart-filter ${C?"orb-smart-filter-expanded":"orb-smart-filter-collapsed"}`,sx:{mb:0,display:"flex",flexDirection:"column",overflow:"visible",position:"relative"},children:[C?g(e,{children:[g("div",{className:"orb-smart-filter-header",children:[f$1?f(Tp,{appId:f$1,tableKey:h,currentFilters:{values:r,visibleFields:I},currentLayout:m,currentLayoutId:v,layoutRefs:y,onLoad:N=>{if(!N.filters)return;let D=null;if(Array.isArray(N.filters)){let L=h||"default",B=N.filters.find(X=>X.scope===L);D=B?B.filters:null;}else D=N.filters;D&&(D.values||D.visibleFields?(D.visibleFields&&Array.isArray(D.visibleFields)&&w(D.visibleFields),D.values&&o(D.values)):o(D)),i&&i(N);},variantService:g$1,serviceUrl:x,currentVariantId:a}):f(Si,{variants:n,currentVariantId:a,onLoad:i,onSave:N=>{s&&s({...N,filters:{values:r,visibleFields:I}});},onDelete:l,onSetDefault:d}),g("div",{className:"orb-smart-filter-actions",children:[f(st,{title:b("smartFilter.addFilters"),children:f(ye,{className:"orb-smart-filter-adapt",onClick:N=>k(S?null:N.currentTarget),size:"small",color:"primary",startIcon:f(Kd,{fontSize:"small"}),sx:{textTransform:"none",fontSize:tr,whiteSpace:"nowrap",minWidth:"fit-content"},children:b("smartFilter.adaptFilters")})}),f(ne,{className:"orb-smart-filter-go",tooltip:b("smartFilter.go"),"aria-label":b("smartFilter.go"),onClick:p,disabled:u,children:u?f(Kr,{size:16}):f(Mt,{name:"play",size:16})}),g(Yt,{anchorEl:S,open:!!S,onClose:()=>k(null),slotProps:{paper:{style:{maxHeight:400,width:"25ch"},sx:{"& .orb-menu-item, & option":{fontSize:tr,minHeight:32}}}},children:[f("option",{disabled:true,children:f($t,{primary:b("smartFilter.visibleFilters"),primaryTypographyProps:{fontSize:tr}})}),f(Nt,{}),t.map(N=>g("option",{onClick:()=>R(N.id),children:[f(Rt,{checked:I.includes(N.id),size:"small"}),f($t,{primary:N.label,primaryTypographyProps:{fontSize:tr}})]},N.id))]})]})]}),f("div",{className:"orb-smart-filter-grid",children:f(_s,{container:true,spacing:2,columns:{xs:2,sm:3,md:4,lg:6},children:t.filter(N=>I.includes(N.id)).map(N=>f(_s,{size:1,children:f(Wh,{field:N,value:r[N.id]||{value:"",operator:N.type==="number"?"=":"equals"},onChange:D=>A(N.id,D)})},N.id))})})]}):null,f("div",{className:"orb-smart-filter-toggle",children:f(ne,{className:"orb-smart-filter-toggle-button",size:"small",onClick:()=>P(!C),sx:{bgcolor:"background.paper",boxShadow:2,border:"1px solid",borderColor:"divider",width:30,height:30,minWidth:30,minHeight:0,p:0,"&:hover":{bgcolor:"background.paper"}},children:C?f(ja,{className:"orb-smart-filter-toggle-icon",sx:{fontSize:20},color:"action"}):f(Hr,{className:"orb-smart-filter-toggle-icon",sx:{fontSize:20},color:"action"})})})]})};var Np=({layouts:t,currentLayoutId:r,onLoad:o,onSave:n,onDelete:a,onSetDefault:i})=>{let{t:s}=de(),[l,d]=useState(null),[p,u]=useState(false),[f$1,h]=useState(""),[m,v]=useState(""),[y,g$1]=useState({isDefault:false,isPublic:false}),x=t.find(I=>I.id===r),b=I=>{d(I.currentTarget);},C=()=>{d(null);},P=I=>{o(I),C();},S=()=>{h(""),v(""),g$1({isDefault:false,isPublic:false}),u(true),C();},k=()=>{f$1.trim()&&(n({name:f$1,description:m,...y}),u(false));};return g("div",{className:"orb-layout-actions",sx:{display:"flex",alignItems:"center",gap:.25},children:[f(st,{title:s("layout.layoutOptions"),children:f(ne,{onClick:b,color:x?"primary":"default",size:"small",children:f(jd,{fontSize:"small"})})}),g(Yt,{anchorEl:l,open:!!l,onClose:C,align:"end",PaperProps:{sx:{width:320,maxHeight:400}},children:[f("option",{disabled:true,children:f(E,{variant:"caption",children:s("layout.selectLayout")})}),g("option",{onClick:S,children:[f(Br,{children:f(So,{fontSize:"small"})}),f($t,{children:s("layout.saveCurrentLayout")})]}),f(Nt,{}),t.length===0&&f("option",{disabled:true,children:f(E,{variant:"body2",color:"text.secondary",children:s("layout.noSavedLayouts")})}),t.map((I,w)=>f("option",{onClick:()=>P(I),selected:I.id===r,children:g("div",{sx:{display:"flex",alignItems:"center",width:"100%",justifyContent:"space-between"},children:[g("div",{sx:{display:"flex",flexDirection:"column",overflow:"hidden",mr:1},children:[f("div",{sx:{display:"flex",alignItems:"center",gap:1},children:f(E,{variant:"body2",fontWeight:I.id===r?"bold":"normal",noWrap:true,children:I.name})}),I.description&&f(E,{variant:"caption",color:"text.secondary",noWrap:true,children:I.description})]}),g("div",{sx:{display:"flex",alignItems:"center"},onClick:A=>A.stopPropagation(),children:[f(st,{title:I.isDefault?s("layout.removeDefault"):s("layout.setAsDefault"),children:f(ne,{size:"small",onClick:A=>{A.stopPropagation(),i(I.id);},children:I.isDefault?f(Yd,{fontSize:"small",color:"warning"}):f(Xd,{fontSize:"small"})})}),f(st,{title:s("common.delete"),children:f(ne,{size:"small",color:"error",onClick:A=>{A.stopPropagation(),a(I.id);},children:f(Za,{fontSize:"small"})})})]})]})},I.id||w))]}),f(Ht,{open:p,onClose:()=>u(false),maxWidth:"xs",fullWidth:true,className:"orb-layout-save-dialog",title:s("layout.saveLayout"),actions:g(e,{children:[f(ye,{variant:"ghost",onClick:()=>u(false),children:s("common.cancel")}),f(ye,{onClick:k,variant:"primary",disabled:!f$1.trim(),children:s("common.save")})]}),children:g("div",{className:"orb-layout-save-form",children:[f(He,{label:s("layout.layoutName"),value:f$1,onChange:I=>h(I.target.value),fullWidth:true,autoFocus:true,size:"small",helperText:s("layout.layoutNameHelper")}),t.some(I=>I.name===f$1)&&f(E,{className:"orb-layout-save-warning",variant:"caption",color:"warning.main",children:s("layout.warningOverwrite")}),f(He,{label:s("layout.layoutDescription"),value:m,onChange:I=>v(I.target.value),fullWidth:true,size:"small"}),f(Rt,{className:"orb-layout-save-option",checked:y.isDefault,onChange:I=>g$1({...y,isDefault:I.target.checked}),label:s("layout.useAsDefault")}),f(Rt,{className:"orb-layout-save-option",checked:y.isPublic,onChange:I=>g$1({...y,isPublic:I.target.checked}),label:s("layout.publicAllUsers")})]})})]})};var un=({appId:t,tableKey:r="default",currentLayoutData:o,onLayoutLoad:n,targetLayoutId:a,activeLayoutId:i,serviceUrl:s,onError:l,onSuccess:d})=>{let{t:p}=de(),[u,f$1]=useState([]),[h,m]=useState(""),v=`orbcafe.layouts.${t}.${r}`,y=w=>({id:w.layoutId,name:w.name,description:w.description??"",isDefault:!!w.isDefault,isPublic:!!w.isPublic,createdAt:w.createdAt??new Date().toISOString(),layoutData:w.layout??{}}),g=w=>({appId:t,tableKey:r,layoutId:w.id,name:w.name,description:w.description??"",isDefault:!!w.isDefault,isPublic:!!w.isPublic,createdAt:w.createdAt,layout:w.layoutData}),x=useCallback(()=>{try{let w=localStorage.getItem(v);if(!w)return [];let A=JSON.parse(w);return Array.isArray(A)?A:[]}catch{return []}},[v]),b=useCallback(w=>{try{localStorage.setItem(v,JSON.stringify(w));}catch{}},[v]);useEffect(()=>{i!==void 0&&m(i);},[i]),useEffect(()=>{if(a&&u.length>0){let w=u.find(A=>A.id===a);w&&(m(w.id),n(w));}},[a,u,n]);let C=useCallback(async()=>{if(t){if(!s){let w=x();f$1(w);let A=w.find(R=>R.isDefault);A&&!h&&!a&&(m(A.id),n(A));return}try{let w=await fetch(`${s}/api/layouts?appId=${encodeURIComponent(t)}&tableKey=${encodeURIComponent(r)}`);if(!w.ok)throw new Error("LAYOUT_FETCH_FAILED");let R=(await w.json()).map(y);f$1(R);let T=R.find(N=>N.isDefault);T&&!h&&!a&&(m(T.id),n(T));}catch(w){console.error("Error fetching layouts",w);let A=x();f$1(A);let R=A.find(T=>T.isDefault);R&&!h&&!a&&(m(R.id),n(R)),l&&l(p("layout.toast.loadFallback"));}}},[t,r,s,l,h,n,a,x,p]);return useEffect(()=>{C();},[t,r]),f(Np,{layouts:u,currentLayoutId:h,onLoad:w=>{m(w.id),n(w);},onSave:async w=>{let A=u.find(N=>N.name===w.name),R=A?A.id:Date.now().toString(),T={id:R,...w,createdAt:new Date().toISOString(),layoutData:o,isDefault:w.isDefault??false,isPublic:w.isPublic??false};if(!s){let D=u.some(L=>L.id===R)?u.map(L=>L.id===R?T:L):[...u,T];f$1(D),b(D),m(R),n(T),d&&d(p("layout.toast.saveLocalSuccess"));return}try{if(!(await fetch(`${s}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(g(T))})).ok)throw new Error("LAYOUT_SAVE_FAILED");d&&d(p("layout.toast.saveSuccess")),await C(),m(R),n(T);}catch(N){console.error("Error saving layout",N);let L=u.some(B=>B.id===R)?u.map(B=>B.id===R?T:B):[...u,T];f$1(L),b(L),m(R),n(T),d&&d(p("layout.toast.saveLocalSuccess")),l&&l(p("layout.toast.backendUnavailableSavedLocal"));}},onDelete:async w=>{if(!s){let A=u.filter(R=>R.id!==w);f$1(A),b(A),h===w&&m(""),d&&d(p("layout.toast.deleteLocalSuccess"));return}try{if(!(await fetch(`${s}/api/layouts/${encodeURIComponent(w)}`,{method:"DELETE"})).ok)throw new Error("LAYOUT_DELETE_FAILED");h===w&&m(""),d&&d(p("layout.toast.deleteSuccess")),await C();}catch(A){console.error("Error deleting layout",A);let R=u.filter(T=>T.id!==w);f$1(R),b(R),h===w&&m(""),d&&d(p("layout.toast.deleteLocalSuccess")),l&&l(p("layout.toast.backendUnavailableDeletedLocal"));}},onSetDefault:async w=>{if(!s){let A=u.map(R=>({...R,isDefault:R.id===w}));f$1(A),b(A),d&&d(p("layout.toast.defaultLocalSuccess"));return}try{let A=u.find(T=>T.id===w);if(!A)return;if(!(await fetch(`${s}/api/layouts`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(g({...A,isDefault:!0}))})).ok)throw new Error("LAYOUT_DEFAULT_FAILED");d&&d(p("layout.toast.defaultSuccess")),await C();}catch(A){console.error("Error setting default",A);let R=u.map(T=>({...T,isDefault:T.id===w}));f$1(R),b(R),d&&d(p("layout.toast.defaultLocalSuccess")),l&&l(p("layout.toast.backendUnavailableDefaultLocal"));}}})};var Pi=(t,r)=>{if(!t||!t.filters)return null;if(Array.isArray(t.filters)){let o=t.filters.find(a=>a.scope===r);if(o)return o.filters;let n=t.filters.find(a=>a.scope==="default");return n?n.filters:null}return typeof t.filters=="object"?t.filters:null},Ti=(t,r)=>{if(!t)return {layout:null,layoutId:null};let o=null,n=null;if(Array.isArray(t.layoutRefs)){let a=t.layoutRefs.find(i=>i.tableKey===r);a&&(o=a.layoutId);}return !o&&t.layoutId&&(o=t.layoutId),t.layout&&typeof t.layout=="object"&&!Array.isArray(t.layout)&&(n=t.layout),{layoutId:o,layout:n}};function Ep(t,r,o){return r[o]<t[o]?-1:r[o]>t[o]?1:0}function $h(t,r){return t==="desc"?(o,n)=>Ep(o,n,r):(o,n)=>-Ep(o,n,r)}function Gh(t,r){let o=t.map((n,a)=>[n,a]);return o.sort((n,a)=>{let i=r(n[0],a[0]);return i!==0?i:n[1]-a[1]}),o.map(n=>n[0])}var mn=t=>{let r=!!t.disableGrouping,o=!!t.disableSorting,n=useCallback(V=>{let ee=String(V?.label??V?.id??"").length*9+64,De=typeof V?.minWidth=="number"?V.minWidth:0;return Math.max(100,De,ee)},[]),a=useCallback(()=>(t.columns||[]).filter(V=>!!V?.numeric).map(V=>V.id),[t.columns]),[i,s]=useState(""),[l,d]=useState(t.order||"asc"),[p,u]=useState(t.orderBy||""),[f,h]=useState([]),[m,v]=useState(t.page||0),[y,g]=useState(t.rowsPerPage||20),[x,b]=useState(t.selected||[]),[C,P]=useState(t.columns?t.columns.map(V=>V.id):[]),[S,k]=useState(t.columns?t.columns.map(V=>V.id):[]),[I,w]=useState(t.showSummary||false),[A,R]=useState(()=>a()),[T,N]=useState([]),[D,L]=useState(new Set),[B,X]=useState(()=>{let V={};return (t.columns||[]).forEach(q=>{V[q.id]=n(q);}),V}),[H,K]=useState(null),[W,G]=useState(null),[z,O]=useState(null),[Y,Q]=useState(null),[me,ie]=useState(false),[se,fe]=useState(""),[Ge,Re]=useState(""),ke=r?[]:T,ze=useCallback(V=>{if(r){N([]),L(new Set),G(null);return}N(V);},[r]);useEffect(()=>{r&&(N([]),L(new Set),G(null));},[r]),useEffect(()=>{o&&(d("asc"),u(""),h([]));},[o]),useEffect(()=>{t.layout&&ft(t.layout);},[t.layout]),useEffect(()=>{if(o){d("asc"),u("");return}t.order!==void 0&&d(t.order),t.orderBy!==void 0&&u(t.orderBy);},[t.order,t.orderBy,o]),useEffect(()=>{t.selected!==void 0&&b(t.selected);},[t.selected]),useEffect(()=>{t.page!==void 0&&v(t.page);},[t.page]),useEffect(()=>{t.rowsPerPage!==void 0&&g(t.rowsPerPage);},[t.rowsPerPage]),useEffect(()=>{let V=a();R(q=>q.filter(De=>V.includes(De)));},[a]),useEffect(()=>{X(V=>{let q={...V};return (t.columns||[]).forEach(ee=>{q[ee.id]===void 0&&(q[ee.id]=n(ee));}),q});},[t.columns,n]),useEffect(()=>{k(V=>{let q=(t.columns||[]).map(Je=>Je.id),ee=new Set(q),De=V.filter(Je=>ee.has(Je)),he=new Set(De),Ne=q.filter(Je=>!he.has(Je)),_e=[...De,...Ne];return _e.length===V.length&&_e.every((Je,Ue)=>Je===V[Ue])?V:_e});},[t.columns]);let Pe=useMemo(()=>{let V=t.columns||[];if(S.length===0)return V;let q=new Map(V.map(he=>[he.id,he])),ee=[],De=new Set;return S.forEach(he=>{let Ne=q.get(he);Ne&&(ee.push(Ne),De.add(he));}),V.forEach(he=>{De.has(he.id)||ee.push(he);}),ee},[t.columns,S]),Ce=useMemo(()=>{let V=t.rows||[];return i&&(V=V.filter(q=>Object.keys(q).some(ee=>String(q[ee]).toLowerCase().includes(i.toLowerCase())))),V},[t.rows,i]),Ve=useMemo(()=>{if(o||t.onSortChange)return Ce;if(f.length>0){let V=[...Ce];return V.sort((q,ee)=>{for(let De of f){let he=q?.[De.field],Ne=ee?.[De.field];if(!(he==null&&Ne==null)){if(he==null)return De.direction==="asc"?-1:1;if(Ne==null)return De.direction==="asc"?1:-1;if(he<Ne)return De.direction==="asc"?-1:1;if(he>Ne)return De.direction==="asc"?1:-1}}return 0}),V}return p?Gh(Ce,$h(l,p)):Ce},[Ce,l,p,f,t.onSortChange,o]),rt=useCallback(V=>{if(ke.length===0)return V.map(Ne=>({type:"row",data:Ne,id:Ne[t.rowKey||"id"]}));let q=[...V].sort((Ne,_e)=>{for(let Je of ke){if(Ne[Je]<_e[Je])return -1;if(Ne[Je]>_e[Je])return 1}return 0}),ee=(Ne,_e=0)=>{if(_e>=ke.length)return Ne;let Je=ke[_e],Ue={},vt=[];return Ne.forEach(Dt=>{let St=Dt[Je],yt=`${Je}:${St}`;Ue[yt]||(Ue[yt]={key:yt,field:Je,value:St,children:[],count:0,level:_e},vt.push(Ue[yt])),Ue[yt].children.push(Dt),Ue[yt].count++;}),vt.forEach(Dt=>{Dt.children&&(Dt.children=ee(Dt.children,_e+1));}),vt},De=ee(q),he=(Ne,_e="")=>{let Je=[];return Ne.forEach(Ue=>{if(Ue.children){let vt=_e?`${_e}>${Ue.key}`:Ue.key,Dt=D.has(vt);Je.push({type:"group",id:vt,field:Ue.field,value:Ue.value,level:Ue.level,count:Ue.count,isExpanded:Dt,childIds:(function St(yt){let F=[];return yt.children.forEach(Z=>{Z.children?F=F.concat(St(Z)):F.push(Z[t.rowKey||"id"]);}),F})(Ue)}),Dt&&(Je=Je.concat(he(Ue.children,vt)));}else Je.push({type:"row",data:Ue,id:Ue[t.rowKey||"id"],level:ke.length});}),Je};return he(De)},[ke,D,t.rowKey]),at=useCallback(V=>{if(ke.length===0)return [];let q=[...V].sort((he,Ne)=>{for(let _e of ke){if(he[_e]<Ne[_e])return -1;if(he[_e]>Ne[_e])return 1}return 0}),ee=[],De=(he,Ne,_e)=>{if(Ne>=ke.length)return;let Je=ke[Ne],Ue=new Map;he.forEach(vt=>{let Dt=vt[Je],St=Ue.get(Dt);St?St.push(vt):Ue.set(Dt,[vt]);}),Ue.forEach((vt,Dt)=>{let St=`${Je}:${Dt}`,yt=_e?`${_e}>${St}`:St;ee.push(yt),De(vt,Ne+1,yt);});};return De(q,0,""),ee},[ke]),Ye=useMemo(()=>rt(Ve),[Ve,rt]),_=useMemo(()=>at(Ve),[Ve,at]),Oe=useMemo(()=>{let V=(t.rows||[]).length;return typeof t.count=="number"&&t.count>V},[t.count,t.rows]),ve=useMemo(()=>Oe?Ye:y>0?Ye.slice(m*y,m*y+y):Ye,[Ye,m,y,Oe]),Ee=useMemo(()=>Oe&&typeof t.count=="number"?t.count:Ye.length,[Ye.length,Oe,t.count]),it=V=>{L(q=>{let ee=new Set(q);return ee.has(V)?ee.delete(V):ee.add(V),ee});},je=V=>{let q=_.filter(ee=>ee===V||ee.startsWith(`${V}>`));L(ee=>{let De=new Set(ee);return q.forEach(he=>De.add(he)),De});},ht=V=>{L(q=>{let ee=new Set(q);return Array.from(ee).forEach(De=>{(De===V||De.startsWith(`${V}>`))&&ee.delete(De);}),ee});},xt=V=>{if(!V){L(new Set);return}L(new Set(_));},At=V=>{let q=_.filter(ee=>ee.startsWith(`${V}>`));return q.length===0?D.has(V):D.has(V)&&q.every(ee=>D.has(ee))},Et=V=>{if(o)return;f.length>0&&h([]);let q=p===V&&l==="asc",ee=p===V&&l==="desc";if(t.onSortChange){q?t.onSortChange(V,"desc"):ee?t.onSortChange("","asc"):t.onSortChange(V,"asc");return}q?(d("desc"),u(V)):ee?(d("asc"),u("")):(d("asc"),u(V));},te=V=>{if(o){d("asc"),u(""),h([]);return}let q=V.filter(ee=>ee&&ee.field);h(q),q.length>0&&u("");},ot=()=>{h([]);},Fe=(V,q)=>{X(ee=>({...ee,[V]:q}));},le=V=>{if(V.target.checked){let q=Ce.map(ee=>ee[t.rowKey||"id"]);b(q),t.onSelectionChange&&t.onSelectionChange(q);return}b([]),t.onSelectionChange&&t.onSelectionChange([]);},ge=(V,q)=>{let ee=q[t.rowKey||"id"],De=x.indexOf(ee),he=[];De===-1?he=he.concat(x,ee):De===0?he=he.concat(x.slice(1)):De===x.length-1?he=he.concat(x.slice(0,-1)):De>0&&(he=he.concat(x.slice(0,De),x.slice(De+1))),b(he),t.onSelectionChange&&t.onSelectionChange(he);},J=V=>{v(V),t.onPageChange&&t.onPageChange(V);},Te=V=>{g(V),v(0),t.onPageChange&&t.onPageChange(0),t.onRowsPerPageChange&&t.onRowsPerPageChange(V);},Ie=V=>{let q=C.indexOf(V),ee=[...C];q===-1?ee.push(V):ee.splice(q,1),P(ee);},Ze=V=>{if(r)return;let q=ke.indexOf(V),ee=[...ke];q===-1?ee.push(V):ee.splice(q,1),ze(ee);},ut=V=>{a().includes(V)&&R(ee=>ee.includes(V)?ee.filter(De=>De!==V):[...ee,V]);},dt=(V,q)=>{!V||!q||V===q||k(ee=>{let De=ee.indexOf(V),he=ee.indexOf(q);if(De===-1||he===-1)return ee;let Ne=[...ee];return Ne.splice(De,1),Ne.splice(he,0,V),Ne});},Lt=V=>{let q=V?.active?.id,ee=V?.over?.id;typeof q=="string"&&typeof ee=="string"&&dt(q,ee);},_t=V=>{t.onLayoutSave&&t.onLayoutSave({visibleColumns:C,columnOrder:S,order:o?"asc":l,orderBy:o?"":p,sortBy:o?[]:f,grouping:ke,columnWidths:B,showSummary:I,summaryColumns:A});},bt=V=>{let{layout:q,layoutId:ee}=Ti(V,t.tableKey||"default");ee?(Re(ee),fe(ee)):(Re(""),fe("")),q&&(q.visibleColumns&&P(q.visibleColumns),Array.isArray(q.columnOrder)&&k(q.columnOrder),o?(d("asc"),u(""),h([])):(q.order&&d(q.order),q.orderBy&&u(q.orderBy),Array.isArray(q.sortBy)&&h(q.sortBy)),q.grouping&&ze(q.grouping),q.columnWidths&&X(q.columnWidths),q.showSummary!==void 0&&w(!!q.showSummary),Array.isArray(q.summaryColumns)&&R(q.summaryColumns));},ft=V=>{let q=V?.layoutData||V?.layout||V||{};q.visibleColumns&&P(q.visibleColumns),Array.isArray(q.columnOrder)&&k(q.columnOrder),o?(d("asc"),u(""),h([])):(q.order&&d(q.order),q.orderBy!==void 0&&u(q.orderBy),Array.isArray(q.sortBy)&&h(q.sortBy)),q.grouping&&ze(q.grouping),q.columnWidths&&X(q.columnWidths),q.showSummary!==void 0&&w(!!q.showSummary),Array.isArray(q.summaryColumns)&&R(q.summaryColumns),L(new Set),v(0),V?.id&&fe(V.id),Re("");};useEffect(()=>{t.layout&&bt({layout:t.layout});},[t.layout]);let yr=V=>{V.preventDefault(),Q(Y===null?{mouseX:V.clientX+2,mouseY:V.clientY-6}:null);},Pt=()=>{Q(null);},Ot=useMemo(()=>{if(!I)return {};let V={};t.columns.forEach(ee=>{if(ee.numeric&&A.includes(ee.id)){let De=Ce.reduce((he,Ne)=>{let _e=parseFloat(Ne[ee.id]);return he+(isNaN(_e)?0:_e)},0);V[ee.id]=De.toFixed(2);}else V[ee.id]="";});let q=t.columns.find(ee=>C.includes(ee.id)&&!ee.numeric);return q&&!q.numeric&&(V[q.id]="Total"),V},[Ce,t.columns,I,A,C]),pt=()=>{if(!t.columns||!Ce)return;let V=t.columns.map(Ne=>Ne.label).join(","),q=Ce.map(Ne=>t.columns.map(_e=>{let Je=Ne[_e.id];return `"${(Je==null?"":String(Je)).replace(/"/g,'""')}"`}).join(",")).join(`
2
+ `),ee=`data:text/csv;charset=utf-8,${V}
3
+ ${q}`,De=encodeURI(ee),he=document.createElement("a");he.setAttribute("href",De),he.setAttribute("download",`${t.title||"export"}.csv`),document.body.appendChild(he),he.click(),document.body.removeChild(he);},Ft=()=>{ie(true);},Se=()=>{ie(false);};return {isMobile:false,columns:Pe,order:l,setOrder:d,orderBy:p,setOrderBy:u,sortBy:f,setSortBy:h,applyMultiSort:te,clearMultiSort:ot,columnOrder:S,setColumnOrder:k,filterText:i,setFilterText:s,visibleColumns:C,setVisibleColumns:P,showSummary:I,setShowSummary:w,summaryColumns:A,grouping:ke,setGrouping:ze,expandedGroups:D,setExpandedGroups:L,groupAnchorEl:W,setGroupAnchorEl:G,summaryAnchorEl:z,setSummaryAnchorEl:O,columnWidths:B,setColumnWidths:X,anchorEl:H,setAnchorEl:K,contextMenu:Y,setContextMenu:Q,sensors:void 0,sortedAndFilteredRows:Ve,visibleRows:ve,summaryRow:Ot,page:m,setPage:J,rowsPerPage:y,setRowsPerPage:Te,totalDisplayCount:Ee,selected:x,setSelected:b,isAllExpanded:_.length>0&&_.every(V=>D.has(V)),handleColumnResize:Fe,handleRequestSort:Et,handleSelectAllClick:le,handleClick:ge,toggleSummaryColumn:ut,handleDragEnd:Lt,handleColumnReorder:dt,handleExport:pt,handleContextMenu:yr,handleCloseContextMenu:Pt,toggleColumnVisibility:Ie,toggleGroupExpand:it,toggleGroupField:Ze,handleToggleAll:xt,handleExpandGroupRecursively:je,handleCollapseGroupRecursively:ht,isGroupFullyExpanded:At,handleLayoutLoad:ft,handleVariantLoad:bt,handleLayoutSave:_t,effectiveAppId:t.appId||"",currentLayoutData:{visibleColumns:C,order:o?"asc":l,orderBy:o?"":p,sortBy:o?[]:f,columnOrder:S,grouping:ke,columnWidths:B,showSummary:I,summaryColumns:A},currentLayoutId:se,layoutIdToLoad:Ge,onPageChange:J,onRowsPerPageChange:Te,graphReportOpen:me,handleOpenGraphReport:Ft,handleCloseGraphReport:Se}};var r1=t=>f("tbody",{...t}),o1=({align:t,...r})=>f("td",{align:t==="inherit"?void 0:t,...r}),n1=t=>f("div",{...t}),a1=t=>f("thead",{...t}),i1=t=>f("tr",{...t}),Qr=t=>{let{t:r}=de(),o="0.85rem",{title:n,showToolbar:a=true,selectionMode:i,selected:s=[],onSelectionChange:l,actions:d,extraTools:p,fitContainer:u=false,fullWidth:f$1=false,maxHeight:h,loading:m=false,rowsPerPageOptions:v=[20,50,100,-1],onLayoutSave:y,filterConfig:g$1,rowKey:x,tableKey:b="default",graphReport:C,quickCreate:P,quickEdit:S,quickDelete:k,serviceUrl:I,disableGrouping:w=false,disableSorting:A=false}=t,R=n||r("table.title.default"),{isMobile:T,columns:N,order:D,orderBy:L,filterText:B,setFilterText:X,visibleColumns:H,showSummary:K,setShowSummary:W,summaryColumns:G,grouping:z,setGrouping:O,expandedGroups:Y,groupAnchorEl:Q,setGroupAnchorEl:me,summaryAnchorEl:ie,setSummaryAnchorEl:se,columnWidths:fe,anchorEl:Ge,setAnchorEl:Re,contextMenu:ke,sensors:ze,sortedAndFilteredRows:Pe,summaryRow:Ce,visibleRows:Ve,isAllExpanded:rt,page:at,setPage:Ye,rowsPerPage:_,setRowsPerPage:Oe,totalDisplayCount:ve,setSelected:Ee,handleColumnResize:it,handleRequestSort:je,handleSelectAllClick:ht,handleClick:xt,toggleSummaryColumn:At,handleDragEnd:Et,handleExport:te,handleContextMenu:ot,handleCloseContextMenu:Fe,toggleColumnVisibility:le,toggleGroupExpand:ge,handleToggleAll:J,handleExpandGroupRecursively:Te,handleCollapseGroupRecursively:Ie,isGroupFullyExpanded:Ze,handleLayoutLoad:ut,handleVariantLoad:dt,handleLayoutSave:Lt,effectiveAppId:_t,currentLayoutData:bt,currentLayoutId:ft,layoutIdToLoad:yr,graphReportOpen:Pt,handleOpenGraphReport:Ot,handleCloseGraphReport:pt}=mn(t),Ft=C?.enabled??false,Se=Ft&&(C?.interaction?.enabled??true),V=Ci(),q=!!P?.enabled,ee=!!S?.enabled,De=!!k?.enabled,he=P?.fields,Ne=P?.excludeFields||[],_e=P?.initialValues||{},[Je,Ue]=Qt__default.useState(false),[vt,Dt]=Qt__default.useState(false),[St,yt]=Qt__default.useState({}),[F,Z]=Qt__default.useState(false),[ue,xe]=Qt__default.useState(false),[et,qe]=Qt__default.useState({}),[Tt,gt]=Qt__default.useState(false),[mt,wt]=Qt__default.useState(false),rr=m||vt||ue||mt,Bt=Qt__default.useMemo(()=>{let re=[...N];if(Array.isArray(he)&&he.length>0){let pe=new Set(he);re=re.filter(j=>pe.has(j.id));}if(Ne.length>0){let pe=new Set(Ne);re=re.filter(j=>!pe.has(j.id));}return re.filter(pe=>!!pe?.id)},[N,Ne,he]),qt=x||"id",zt=Qt__default.useMemo(()=>{let re=new Set(s);return Pe.filter(pe=>re.has(pe?.[qt]))},[s,Pe,qt]),Ut=zt.length===1?zt[0]:null,Wt=S?.fields,er=S?.excludeFields||[],or=S?.editableFields||[],ur=S?.nonEditableFields||[],Pr=S?.primaryKeys?.length?S.primaryKeys:[qt],Tr=Qt__default.useMemo(()=>{let re=[...N];if(Array.isArray(Wt)&&Wt.length>0){let pe=new Set(Wt);re=re.filter(j=>pe.has(j.id));}if(er.length>0){let pe=new Set(er);re=re.filter(j=>!pe.has(j.id));}return re.filter(pe=>!!pe?.id)},[N,er,Wt]),to=Qt__default.useMemo(()=>new Set(Pr),[Pr]),hr=Qt__default.useMemo(()=>new Set(or),[or]),Er=Qt__default.useMemo(()=>new Set(ur),[ur]),_o=Qt__default.useCallback(re=>hr.size>0?hr.has(re):!(Er.has(re)||to.has(re)),[hr,Er,to]);Qt__default.useEffect(()=>{!Pt&&V.hasActiveFilters&&V.clearAll();},[Pt,V.hasActiveFilters,V.clearAll]);let Uo=()=>{let re={};Bt.forEach(pe=>{re[pe.id]=_e[pe.id]??"";}),yt(re),Ue(true);},No=()=>{vt||Ue(false);},Ko=(re,pe)=>{yt(j=>({...j,[re]:pe}));},qo=async()=>{if(!P?.onSubmit){Ue(false);return}try{Dt(!0),await P.onSubmit(St),Ue(!1);}finally{Dt(false);}},Ir=()=>{if(!Ut)return;let re={};Tr.forEach(j=>{re[j.id]=Ut[j.id]??"";});let pe=S?.getInitialValues?{...re,...S.getInitialValues(Ut)}:re;qe(pe),Z(true);},Ao=()=>{ue||Z(false);},Xo=(re,pe)=>{qe(j=>({...j,[re]:pe}));},_r=async()=>{if(Ut){if(!S?.onSubmit){Z(false);return}try{xe(!0),await S.onSubmit(et,Ut),Z(!1);}finally{xe(false);}}},ro=()=>{zt.length!==0&&gt(true);},Rn=()=>{mt||gt(false);},Eo=async()=>{if(zt.length===0){gt(false);return}if(!k?.onConfirm){gt(false),Ee([]),l?.([]);return}try{wt(!0),await k.onConfirm(zt),gt(!1),Ee([]),l?.([]);}finally{wt(false);}},M=Pe,{fieldMapping:$}=cn({rows:M,config:{...C,title:C?.title||`${R} ${r("graph.reportTitle")}`}}),U=Qt__default.useMemo(()=>Se?V.applyRows(M,$):M,[Se,V.applyRows,M,$]),{model:ce}=cn({rows:U,config:{...C,title:C?.title||`${R} ${r("graph.reportTitle")}`,fieldMapping:$}}),Be=ce.table.columns.map(re=>({id:re.id,label:re.label,align:re.align||"left",minWidth:120,numeric:re.align==="right"})),nt=_t?f(un,{appId:_t,tableKey:b,currentLayoutData:bt,onLayoutLoad:ut,targetLayoutId:yr,activeLayoutId:ft,serviceUrl:I??g$1?.serviceUrl}):null,We=g(e,{children:[!w&&f(sn,{groupAnchorEl:Q,setGroupAnchorEl:me,grouping:z,setGrouping:O,columns:N}),f(ln,{anchorEl:Ge,setAnchorEl:Re,columns:N,visibleColumns:H,toggleColumnVisibility:le}),f(ui,{anchorEl:ie,setAnchorEl:se,showSummary:K,setShowSummary:W,columns:N,summaryColumns:G,toggleSummaryColumn:At}),f(mi,{contextMenu:ke,handleCloseContextMenu:Fe,columns:N,visibleColumns:H,toggleColumnVisibility:le})]});return T?g("div",{sx:{display:"flex",flexDirection:"column",gap:2,height:"100%"},children:[g$1&&f(zr,{fields:g$1.fields,filters:g$1.filters,onFilterChange:g$1.onFilterChange,onSearch:g$1.onSearch,variants:g$1.variants||[],currentVariantId:g$1.currentVariantId,onVariantLoad:g$1.onVariantLoad,onVariantSave:g$1.onVariantSave,onVariantDelete:g$1.onVariantDelete,onVariantSetDefault:g$1.onVariantSetDefault,appId:g$1.appId,tableKey:b,currentLayout:[{tableKey:b,layoutData:bt}],variantService:g$1.variantService,serviceUrl:I??g$1.serviceUrl}),f(sp,{title:R,loading:m,showSummary:K,setShowSummary:W,setAnchorEl:Re,setSummaryAnchorEl:se,filterText:B,setFilterText:X,sortedAndFilteredRows:Pe,selected:s,columns:N,visibleColumns:H,summaryRow:Ce,handleClick:xt,selectionMode:i}),We]}):g("div",{sx:{width:f$1?"100%":"auto",mb:u?0:2,...u?{flex:1,display:"flex",flexDirection:"column",minHeight:0,height:"100%",overflow:"hidden"}:{}},children:[g$1&&f("div",{sx:{mb:2},children:f(zr,{fields:g$1.fields,filters:g$1.filters,onFilterChange:g$1.onFilterChange,onSearch:g$1.onSearch,variants:g$1.variants||[],currentVariantId:g$1.currentVariantId,onVariantLoad:re=>{dt(re),g$1.onVariantLoad&&g$1.onVariantLoad(re);},onVariantSave:g$1.onVariantSave,onVariantDelete:g$1.onVariantDelete,onVariantSetDefault:g$1.onVariantSetDefault,loading:m,appId:g$1.appId,tableKey:b,currentLayout:[{tableKey:b,layoutData:bt}],currentLayoutId:ft,layoutRefs:[{tableKey:b,layoutId:ft}],variantService:g$1.variantService,serviceUrl:I??g$1.serviceUrl})}),g(Ae,{className:"orb-ctable-surface",sx:{width:f$1?"100%":"auto",mb:u?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative","&::before":rr?{content:'""',position:"absolute",top:0,left:0,width:"100%",height:"3px",background:"linear-gradient(90deg, color-mix(in oklch, var(--orb-primary) 0%, transparent) 0%, color-mix(in oklch, var(--orb-primary) 25%, transparent) 25%, var(--orb-primary) 50%, color-mix(in oklch, var(--orb-primary) 25%, transparent) 75%, color-mix(in oklch, var(--orb-primary) 0%, transparent) 100%)",backgroundSize:"220% 100%",animation:"cTableTopMarquee 1.2s linear infinite",zIndex:6,pointerEvents:"none"}:{},"@keyframes cTableTopMarquee":{"0%":{backgroundPosition:"220% 0"},"100%":{backgroundPosition:"-120% 0"}},...h?{height:h}:u?{flex:1,minHeight:0,height:"100%"}:{}},children:[a&&f(li,{filterText:B,setFilterText:X,onRowsPerPageChange:Oe,rowsPerPage:_,rowsPerPageOptions:v,page:at,count:ve,onPageChange:Ye,actions:d,extraTools:p,grouping:z,disableGrouping:w,groupAnchorEl:Q,setGroupAnchorEl:me,showSummary:K,setShowSummary:W,anchorEl:Ge,setAnchorEl:Re,summaryAnchorEl:ie,setSummaryAnchorEl:se,handleExport:te,showCreateButton:q,onOpenCreateDialog:Uo,showEditButton:ee,onOpenEditDialog:Ir,editDisabled:zt.length!==1,showDeleteButton:De,onOpenDeleteConfirm:ro,deleteDisabled:zt.length===0,onLayoutSave:y||g$1?.variantService&&g$1?.appId?Lt:void 0,loading:m,layoutManager:nt,onOpenGraphReport:Ft?Ot:void 0}),f("div",{sx:{flex:1,...h?{maxHeight:h,height:h}:u?{height:0,maxHeight:"none"}:{maxHeight:"calc(100vh - 320px)"},overflowY:"auto",overflowX:"auto",position:"relative",minHeight:0},children:f(DndContext,{sensors:ze,collisionDetection:closestCenter,onDragEnd:Et,modifiers:[restrictToHorizontalAxis],children:g("table",{className:"orb-tbl orb-ctable",style:{minWidth:f$1?750:void 0,width:f$1?"100%":"auto",tableLayout:Object.keys(fe).length>0?"fixed":"auto",borderCollapse:"separate",borderSpacing:0,fontSize:o},"aria-labelledby":"tableTitle",children:[f(di,{columns:N,visibleColumns:H,order:D,orderBy:L,onRequestSort:je,disableSorting:A,onContextMenu:ot,selectionMode:i,grouping:z,isAllExpanded:rt,handleToggleAll:J,rowCount:Pe.length,numSelected:s.length,onSelectAllClick:ht,columnWidths:fe,onColumnResize:it}),f(pi,{visibleRows:Ve,columns:N,visibleColumns:H,selectionMode:i,selected:s,orderBy:L,loading:m,expandedGroups:Y,toggleGroupExpand:ge,handleExpandGroupRecursively:Te,handleCollapseGroupRecursively:Ie,isGroupFullyExpanded:Ze,handleClick:xt,onSelectionChange:l,grouping:z,rowKeyProp:x,page:at,rowsPerPage:_}),K&&f(ip,{showSummary:K,columns:N,visibleColumns:H,summaryRow:Ce,selectionMode:i?.toString(),grouping:z,columnWidths:fe,orderBy:L,zIndex:3})]})})})]}),q&&g(Ht,{open:Je,onClose:No,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:re=>`1px solid ${re.palette.divider}`,bgcolor:"background.paper"}}},children:[f("div",{className:"orb-dialog-title",sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:P?.title||r("quickCreate.createWithTitle",{title:R})}),f("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:g("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Bt.map(re=>{let pe=re.type==="number"||re.numeric?"number":re.type==="date"?"date":"text",j=re.label||re.id;return f(He,{label:j,value:St[re.id]??"",onChange:Le=>Ko(re.id,Le.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-${re.id}`)}),P?.description&&f(Yr,{severity:"info",sx:{fontSize:"0.85rem","& span":{fontSize:"0.85rem"}},children:P.description})]})}),g("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[f(ye,{onClick:No,sx:{fontSize:"0.85rem"},disabled:vt,children:P?.cancelLabel||r("common.cancel")}),f(ye,{onClick:qo,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:vt,children:P?.submitLabel||r("common.save")})]})]}),ee&&g(Ht,{open:F,onClose:Ao,fullWidth:true,maxWidth:"sm",slotProps:{paper:{sx:{borderRadius:2,border:re=>`1px solid ${re.palette.divider}`,bgcolor:"background.paper"}}},children:[f("div",{className:"orb-dialog-title",sx:{fontSize:"0.85rem",fontWeight:700,pb:1},children:S?.title||r("quickEdit.editWithTitle",{title:R})}),f("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:g("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Tr.map(re=>{let pe=re.type==="number"||re.numeric?"number":re.type==="date"?"date":"text",j=re.label||re.id,Le=_o(re.id);return f(He,{label:j,value:et[re.id]??"",onChange:Qe=>Xo(re.id,Qe.target.value),type:pe,size:"small",fullWidth:true,disabled:!Le,InputLabelProps:{shrink:pe==="date"?true:void 0,sx:{fontSize:"0.85rem"}},InputProps:{sx:{fontSize:"0.85rem"}}},`quick-edit-${re.id}`)}),S?.description&&f(Yr,{severity:"info",sx:{fontSize:"0.85rem","& span":{fontSize:"0.85rem"}},children:S.description})]})}),g("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[f(ye,{onClick:Ao,sx:{fontSize:"0.85rem"},disabled:ue,children:S?.cancelLabel||r("common.cancel")}),f(ye,{onClick:_r,variant:"contained",sx:{fontSize:"0.85rem",fontWeight:700},disabled:ue||!Ut,children:S?.submitLabel||r("common.save")})]})]}),De&&f(Un,{open:Tt,type:"warning",title:k?.title||r("quickDelete.confirmTitle"),message:k?.message||(zt.length>1?r("quickDelete.confirmMessageMultiple",{count:zt.length}):r("quickDelete.confirmMessageSingle")),confirmText:k?.confirmText||r("common.delete"),cancelText:k?.cancelText||r("common.cancel"),onClose:Rn,onConfirm:Eo}),We,Ft&&f(vi,{open:Pt,onClose:pt,model:ce,aiAssistant:C?.aiAssistant,interaction:Se?{enabled:true,filters:V.filters,fieldMapping:$,onPrimaryDimensionClick:re=>V.setFilter("primaryDimension",re),onSecondaryDimensionClick:re=>V.setFilter("secondaryDimension",re),onStatusClick:re=>V.setFilter("status",re),onClearFilter:V.clearFilter,onClearAll:V.clearAll}:void 0,tableContent:f(Qr,{appId:_t||"graph-report-internal",title:r("graph.dataBody"),columns:Be,rows:ce.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false}})})]})},s1=Qr;var g1=({id:t,title:r,hideHeader:o=true,filterConfig:n,tableProps:a,children:i,spacing:s=1,mode:l="separated"})=>{let d=n?{...n,appId:n.appId||t}:void 0,p={...a,appId:a.appId||t};return g(ai,{title:r,hideHeader:o,children:[g(ae,{spacing:s,sx:{height:"100%",overflow:"hidden"},children:[l==="separated"&&d&&f("div",{sx:{flexShrink:0},children:f(zr,{...d})}),f("div",{sx:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:f(Qr,{...p,fitContainer:true,filterConfig:l==="integrated"?d:void 0})})]}),i]})};var C1=({metadata:t,fetchData:r,initialRowsPerPage:o=20,rowsPerPageOptions:n=[20,50,100,-1],tableKey:a="default",mode:i="integrated",serviceUrl:s,variantService:l})=>{let{t:d}=de(),[p,u]=useState(false),[f,h]=useState([]),[m,v]=useState({}),[y,g]=useState(t.variants||[]),[x,b]=useState(t.layout||null),[C,P]=useState(""),[S,k]=useState(0),[I,w]=useState(0),[A,R]=useState(o),[T,N]=useState([]),[D,L]=useState("asc"),[B,X]=useState("");useEffect(()=>{let ie={};t.filters.forEach(se=>{se.defaultValue!==void 0&&(ie[se.id]=se.defaultValue);}),v(ie);},[t.filters]);let H=useCallback(async(ie,se,fe,Ge,Re)=>{u(true);try{let ke={...ie,page:se+1,limit:fe,sort:Re,order:Ge},ze;r?ze=await r(ke):typeof t.api=="function"?ze=await t.api(ke):t.api&&typeof t.api=="object"?(console.log("Fetching from URL:",t.api.url,ke),ze={rows:[],total:0}):(console.warn("No API configured for report"),ze={rows:[],total:0}),ze&&(h(ze.rows||[]),k(ze.total||0));}catch(ke){console.error("Failed to fetch report data",ke);}finally{u(false);}},[t.api,r]);useEffect(()=>{H(m,I,A,D,B);},[H,I,A,D,B]);let K=()=>{w(0),H(m,0,A,D,B);},W=ie=>{w(0),R(ie);},G=(ie,se)=>{L(se),X(ie);},z=ie=>{v(ie);},O=ie=>{P(ie?.id||"");let se=Pi(ie,a);if(se){let Ge=se.values??se;v(Ge),H(Ge,0,A,D,B),w(0);}let{layout:fe}=Ti(ie,a);fe&&b(fe);},Y=ie=>{let se={...ie,id:Date.now().toString(),createdAt:new Date().toISOString()};g(fe=>[...fe,se]);},Q=ie=>{b(ie);};return {pageProps:{id:t.id,title:t.title,mode:i,filterConfig:{appId:t.id,tableKey:a,fields:t.filters,filters:m,onFilterChange:z,onSearch:K,onVariantLoad:O,onVariantSave:Y,onVariantDelete:ie=>g(se=>se.filter(fe=>fe.id!==ie)),onVariantSetDefault:ie=>{g(se=>se.map(fe=>({...fe,isDefault:fe.id===ie})));},variants:y,currentVariantId:C,variantService:l,serviceUrl:s},tableProps:{appId:t.id,tableKey:a,columns:t.columns,rows:f,loading:p,rowKey:"id",count:S,page:I,rowsPerPage:A,rowsPerPageOptions:n,onPageChange:w,onRowsPerPageChange:W,selectionMode:"multiple",selected:T,onSelectionChange:N,onLayoutSave:Q,layout:x,title:t.title,showSummary:true,order:D,orderBy:B,serviceUrl:s,onSortChange:G,graphReport:t.graphReport||{enabled:true,title:`${t.title} ${d("graph.reportTitle")}`}}},filters:m,rows:f,loading:p,refresh:K}};var Zh=new Set(["id","title","description","icon","iconNode","meta"]),Qh=t=>t.replace(/([A-Z])/g," $1").replace(/[._-]+/g," ").replace(/^\w/,r=>r.toUpperCase()).trim(),jh=t=>Object.entries(t).filter(([r,o])=>!Zh.has(r)&&o!==null&&o!==void 0&&["string","number","boolean"].includes(typeof o)).map(([r,o])=>({key:r,label:Qh(r),value:String(o)})),Op=({item:t,open:r,onClose:o,onDownloadClick:n,renderContent:a,downloadTooltip:i,closeTooltip:s})=>{let{t:l}=de(),p=br()==="dark"?"var(--orb-p300)":"var(--orb-primary)";Qt__default.useEffect(()=>{if(!r)return;let f=h=>{h.key==="Escape"&&o();};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[r,o]);let u=jh(t);return typeof document>"u"?null:createPortal(g(e,{children:[f("div",{"aria-hidden":"true",onClick:o,sx:{position:"fixed",inset:0,zIndex:1299,backgroundColor:"rgba(1, 9, 26, 0.4)",opacity:r?1:0,pointerEvents:r?"auto":"none",transition:"opacity 200ms ease"}}),g("div",{role:"dialog","aria-modal":"true","aria-label":t.title,sx:{position:"fixed",top:"50%",left:"50%",zIndex:1300,width:"min(520px, 92vw)",maxHeight:"82vh",display:"flex",flexDirection:"column",bgcolor:"background.paper",border:"1px solid",borderColor:"divider",borderRadius:3,boxShadow:"0 24px 64px rgba(1, 9, 26, 0.3)",transform:r?"translate(-50%, -50%) scale(1)":"translate(-50%, -47%) scale(0.96)",opacity:r?1:0,transition:"transform 200ms ease, opacity 180ms ease"},children:[g(ae,{direction:"row",spacing:1.5,alignItems:"center",sx:{p:2.5,pb:2,borderBottom:"1px solid",borderColor:"divider",flexShrink:0},children:[f("div",{sx:{width:56,height:56,flex:"0 0 auto",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:3,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:t.iconNode??f(Mt,{name:t.icon??"product",size:30,style:{color:p}})}),g("div",{sx:{flex:1,minWidth:0},children:[f(E,{component:"div",sx:{fontWeight:700,fontSize:"1.1rem",lineHeight:1.3,wordBreak:"break-word"},children:t.title}),t.meta?f(E,{component:"div",sx:{fontSize:"0.8rem",color:"text.secondary"},children:t.meta}):null]}),f(ne,{tooltip:s??l("cardPage.close"),"aria-label":s??l("cardPage.close"),onClick:o,children:f(Mt,{name:"decline",size:18})})]}),f("div",{sx:{flex:1,minHeight:0,overflowY:"auto",p:2.5},children:a?a(t):g(e,{children:[t.description?f(E,{component:"div",sx:{fontSize:"0.9rem",lineHeight:1.6,color:"text.primary"},children:t.description}):null,u.length>0?f("div",{sx:{mt:t.description?2.5:0,display:"grid",gap:1.5},children:u.map(f$1=>g("div",{children:[f(E,{component:"div",sx:{fontSize:"0.72rem",fontWeight:600,color:"text.secondary",textTransform:"uppercase",letterSpacing:"0.04em"},children:f$1.label}),f(E,{component:"div",sx:{fontSize:"0.88rem",color:"text.primary",wordBreak:"break-word"},children:f$1.value})]},f$1.key))}):null]})}),n?f("div",{sx:{p:2.5,pt:2,borderTop:"1px solid",borderColor:"divider",flexShrink:0},children:f(ye,{variant:"contained",sx:{width:"100%"},startIcon:f(Mt,{name:"download",size:16}),onClick:()=>n(t),children:i??l("cardPage.download")})}):null]})]}),document.body)};var Jh={display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"3",overflow:"hidden"},eb=({item:t,onDetailClick:r,onDownloadClick:o,detailTooltip:n,downloadTooltip:a})=>{let{t:i}=de(),l=br()==="dark"?"var(--orb-p300)":"var(--orb-primary)",d=t.iconNode??f(Mt,{name:t.icon??"product",size:26,style:{color:l}});return g(Ae,{elevation:0,sx:{p:2,height:"100%",display:"flex",flexDirection:"column",borderRadius:3,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",boxShadow:"0 8px 20px rgba(15, 23, 42, 0.06)",transition:"transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease","&:hover":{transform:"translateY(-2px)",borderColor:"primary.main",boxShadow:"0 14px 32px rgba(15, 23, 42, 0.12)"}},children:[g(ae,{direction:"row",spacing:1.5,alignItems:"center",children:[f("div",{sx:{width:48,height:48,flex:"0 0 auto",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:2.5,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:d}),g("div",{sx:{flex:1,minWidth:0},children:[f(E,{component:"div",noWrap:true,sx:{fontWeight:700,fontSize:"0.98rem",lineHeight:1.3},children:t.title}),t.meta?f(E,{component:"div",noWrap:true,sx:{fontSize:"0.75rem",color:"text.secondary"},children:t.meta}):null]})]}),f("div",{sx:{mt:1.5,flex:1,minHeight:0},children:f(E,{component:"div",sx:{fontSize:"0.84rem",lineHeight:1.45,color:"text.primary",...Jh},children:t.description||"\xA0"})}),g(ae,{direction:"row",spacing:.5,justifyContent:"flex-end",sx:{mt:1.5},children:[f(ne,{tooltip:n??i("cardPage.viewDetails"),"aria-label":n??i("cardPage.viewDetails"),onClick:()=>r?.(t),children:f(Mt,{name:"show",size:18})}),f(ne,{tooltip:a??i("cardPage.download"),"aria-label":a??i("cardPage.download"),onClick:()=>o?.(t),children:f(Mt,{name:"download",size:18})})]})]})},Bp=({items:t,loading:r=false,onDetailClick:o,onDownloadClick:n,minCardWidth:a=260,detailTooltip:i,downloadTooltip:s,emptyText:l,detailPanel:d=true,renderDetailContent:p})=>{let{t:u}=de(),[f$1,h]=Qt__default.useState(null),[m,v]=Qt__default.useState(false),y=x=>{o?.(x),d&&(h(x),requestAnimationFrame(()=>requestAnimationFrame(()=>v(true))));},g$1=()=>{v(false),setTimeout(()=>h(null),260);};return r?f("div",{sx:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",minHeight:240},children:f(Kr,{})}):t.length?g(e,{children:[f("div",{sx:{flex:1,minHeight:0,overflowY:"auto",display:"grid",gridTemplateColumns:`repeat(auto-fill, minmax(${a}px, 1fr))`,gap:2,alignContent:"start",p:.5},children:t.map(x=>f(eb,{item:x,onDetailClick:y,onDownloadClick:n,detailTooltip:i,downloadTooltip:s},x.id))}),d&&f$1?f(Op,{item:f$1,open:m,onClose:g$1,onDownloadClick:n,renderContent:p,downloadTooltip:s}):null]}):f("div",{sx:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",minHeight:240},children:f(E,{sx:{color:"text.secondary"},children:l??u("cardPage.empty")})})};var $1=({id:t,title:r,hideHeader:o=true,filterConfig:n,gridProps:a,children:i,spacing:s=1})=>{let l=n?{...n,appId:n.appId||t}:void 0;return g(ai,{title:r,hideHeader:o,children:[g(ae,{spacing:s,sx:{height:"100%",overflow:"hidden"},children:[l&&f("div",{sx:{flexShrink:0},children:f(zr,{...l})}),f("div",{sx:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:f(Bp,{...a})})]}),i]})};var q1=({metadata:t,fetchData:r,tableKey:o="default",variantService:n,serviceUrl:a,onDetailClick:i,onDownloadClick:s,minCardWidth:l})=>{let[d,p]=useState(false),[u,f]=useState([]),[h,m]=useState(0),[v,y]=useState({}),[g,x]=useState(t.variants||[]),[b,C]=useState("");useEffect(()=>{let R={};t.filters.forEach(T=>{T.defaultValue!==void 0&&(R[T.id]=T.defaultValue);}),y(R);},[t.filters]);let P=useCallback(async R=>{p(true);try{let T=r?await r({...R}):{rows:[],total:0};f(T?.rows||[]),m(T?.total||0);}catch(T){console.error("Failed to fetch card page data",T);}finally{p(false);}},[r]);useEffect(()=>{P(v);},[P]);let S=()=>{P(v);},k=R=>{y(R);},I=R=>{C(R?.id||"");let T=Pi(R,o);if(T){let N=T.values??T;y(N),P(N);}},w=R=>{let T={...R,id:Date.now().toString(),createdAt:new Date().toISOString()};x(N=>[...N,T]);};return {pageProps:{id:t.id,title:t.title,filterConfig:{appId:t.id,tableKey:o,fields:t.filters,filters:v,onFilterChange:k,onSearch:S,onVariantLoad:I,onVariantSave:w,onVariantDelete:R=>x(T=>T.filter(N=>N.id!==R)),onVariantSetDefault:R=>{x(T=>T.map(N=>({...N,isDefault:N.id===R})));},variants:g,currentVariantId:b,variantService:n,serviceUrl:a},gridProps:{items:u,loading:d,onDetailClick:i,onDownloadClick:s,minCardWidth:l}},items:u,total:h,filters:v,loading:d,refresh:S}};var rb=t=>[...t].sort((r,o)=>o.value-r.value),Z1=({bars:t=[],lines:r=[],combos:o=[],heatmap:n=[],pies:a=[],waterfalls:i=[]})=>{let s=useMemo(()=>rb(t),[t]),l=useMemo(()=>[...r],[r]),d=useMemo(()=>[...o],[o]),p=useMemo(()=>[...n],[n]),u=useMemo(()=>{let h=a.reduce((m,v)=>m+v.value,0);return a.map(m=>({...m,percent:h>0?m.value/h*100:m.percent}))},[a]),f=useMemo(()=>[...i],[i]);return {bars:s,lines:l,combos:d,heatmap:p,pies:u,waterfalls:f}};var tD=({apiKey:t,query:r,zoom:o=14,mapType:n="roadmap"})=>useMemo(()=>!t||!r?"":Qn({apiKey:t,query:r,zoom:o,mapType:n}),[t,r,o,n]),rD=({keyword:t,location:r})=>useMemo(()=>hi({keyword:t,location:r?{lng:r.lng,lat:r.lat,name:r.name}:void 0}),[t,r]);var ra=({code:t,language:r="text",copyable:o=true,showLineNumbers:n=false,wrapLongLines:a=false,maxHeight:i})=>{let[s,l]=useState(false),d=useMemo(()=>t.replace(/\n$/,"").split(`
4
+ `),[t]);return g("div",{style:{border:"1px solid var(--orb-border)",borderRadius:12,overflow:"hidden",background:"var(--orb-canvas)"},children:[g("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"4.8px 8px",background:"var(--orb-hover)",borderBottom:"1px solid var(--orb-border)"},children:[f("span",{style:{fontSize:12,fontWeight:500,textTransform:"uppercase",letterSpacing:.5,color:"var(--orb-muted)",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:r}),o&&f(ne,{size:"small",tooltip:s?"Copied":"Copy",onClick:async()=>{try{await navigator.clipboard.writeText(t),l(!0),window.setTimeout(()=>l(!1),1400);}catch{l(false);}},children:s?f(Ur,{size:14,strokeWidth:1.8}):f(fo,{size:14,strokeWidth:1.8})})]}),f("pre",{style:{margin:0,padding:10,fontSize:"0.82rem",lineHeight:1.55,overflow:"auto",maxHeight:i,background:"var(--orb-surface)",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},children:n?d.map((u,f$1)=>g("div",{style:{display:"flex"},children:[f("span",{style:{width:34,flexShrink:0,textAlign:"right",paddingRight:8,color:"var(--orb-disabled-fg)",userSelect:"none"},children:f$1+1}),f("span",{style:{whiteSpace:a?"pre-wrap":"pre",wordBreak:a?"break-word":"normal"},children:u})]},`${f$1}-${u}`)):f("code",{style:{display:"block",whiteSpace:a?"pre-wrap":"pre",wordBreak:a?"break-word":"normal"},children:t})})]})};var lb=t=>{let r=t.trim();return r.startsWith("$$")&&r.endsWith("$$")&&r.length>=4&&(r=r.slice(2,-2).trim()),r.startsWith("$")&&r.endsWith("$")&&r.length>=2&&(r=r.slice(1,-1).trim()),r},cb=async t=>new Function("m","return import(m)")(t),oa=({expression:t,inline:r=false,allowKatex:o=false})=>{let n=useMemo(()=>lb(t),[t]),[a,i]=useState("");return useEffect(()=>{let s=true;return (async()=>{if(!o||!n){i("");return}try{let d=await cb("katex"),u=(d?.default||d)?.renderToString?.(n,{displayMode:!r,throwOnError:!1,strict:"warn"});s&&typeof u=="string"&&i(u);}catch{s&&i("");}})(),()=>{s=false;}},[o,n,r]),n?a?f(we,{component:r?"span":"div",sx:{display:r?"inline-flex":"block",my:r?0:.5,overflowX:"auto"},dangerouslySetInnerHTML:{__html:a}}):r?f(we,{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:n}):f(we,{sx:{my:1,p:1,borderRadius:1.2,border:"1px dashed",borderColor:"divider",bgcolor:"background.paper"},children:f(gr,{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:n})}):null};var ub=async t=>new Function("m","return import(m)")(t),Js=({code:t,title:r="Mermaid Diagram",height:o=320,enabled:n=true})=>{let[a,i]=useState(""),[s,l]=useState(""),[d,p]=useState(false),u=useMemo(()=>t.trim(),[t]);return useEffect(()=>{let f=true;return (async()=>{if(!n||!u){i(""),l("");return}p(true),l(""),i("");try{let m=await ub("mermaid"),v=m?.default||m;if(!v||typeof v.render!="function")throw new Error("Mermaid runtime is not available");v.initialize?.({startOnLoad:!1,securityLevel:"loose",theme:"default"});let y=await v.render(`orbcafe-mermaid-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,u),g=typeof y=="string"?y:y?.svg;f&&typeof g=="string"&&i(g);}catch(m){if(f){let v=m instanceof Error?m.message:"Failed to render Mermaid diagram";l(v);}}finally{f&&p(false);}})(),()=>{f=false;}},[n,u]),g(Lo,{variant:"outlined",sx:{borderRadius:1.5,overflow:"hidden",my:1},children:[f(we,{sx:{px:1,py:.6,borderBottom:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:f(gr,{variant:"caption",color:"text.secondary",sx:{letterSpacing:.4,textTransform:"uppercase"},children:r})}),g(we,{sx:{p:1},children:[d&&f(we,{sx:{minHeight:120,display:"flex",alignItems:"center",justifyContent:"center"},children:f(rd,{size:20})}),!d&&a&&f(we,{sx:{maxHeight:o,overflow:"auto","& svg":{display:"block",mx:"auto",maxWidth:"100%",height:"auto"}},dangerouslySetInnerHTML:{__html:a}}),!d&&!a&&g(we,{children:[s&&f(Yr,{severity:"info",sx:{mb:1},children:s}),f(ra,{code:u,language:"mermaid",copyable:true,showLineNumbers:true,wrapLongLines:true})]})]})]})};var el=t=>t.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(o=>o.trim()),gb=t=>/^:?-{3,}:?$/.test(t.trim()),fb=t=>{let r=t.trim(),o=r.startsWith(":"),n=r.endsWith(":");return o&&n?"center":n?"right":"left"},Ii=t=>{let r=t.split(`
5
+ `).map(s=>s.trim()).filter(Boolean);if(r.length<2)return null;let o=el(r[0]),n=el(r[1]);if(o.length===0||n.length!==o.length||!n.every(gb))return null;let a=n.map(fb),i=r.slice(2).filter(s=>s.includes("|")).map(s=>{let l=el(s);return l.length<o.length?[...l,...Array.from({length:o.length-l.length},()=>"")]:l.slice(0,o.length)});return {headers:o,aligns:a,rows:i}},tl=({markdown:t,table:r,maxHeight:o=360})=>{let n=useMemo(()=>r||(t?Ii(t):null),[r,t]);return !n||n.headers.length===0?f(Lo,{variant:"outlined",sx:{p:1.2,borderRadius:1.5},children:f(gr,{variant:"body2",color:"text.secondary",children:"Invalid table block"})}):f(Lo,{variant:"outlined",sx:{borderRadius:1.5,overflow:"hidden",my:1},children:f(id,{sx:{maxHeight:o},children:g(nd,{size:"small",stickyHeader:true,children:[f(sd,{children:f(Gs,{children:n.headers.map((a,i)=>f($s,{align:n.aligns[i],sx:{fontWeight:700,bgcolor:"background.paper"},children:a},`${a}-${i}`))})}),f(ad,{children:n.rows.map((a,i)=>f(Gs,{hover:true,children:a.map((s,l)=>f($s,{align:n.aligns[l],sx:{whiteSpace:"pre-wrap",wordBreak:"break-word"},children:s||f(we,{component:"span",sx:{color:"text.disabled"},children:"-"})},`cell-${i}-${l}`))},`row-${i}`))})]})})})};var Mi=({content:t,title:r="Thinking",defaultExpanded:o=false,isStreaming:n=false})=>{let[a,i]=useState(o);return g(we,{sx:{borderLeft:"2px solid",borderColor:"divider",pl:1,my:.8},children:[g(Jc,{direction:"row",alignItems:"center",spacing:.6,children:[f(ed,{size:"small",onClick:()=>i(s=>!s),sx:{transform:a?"rotate(180deg)":"rotate(0deg)",transition:"transform .15s ease"},children:f(tn,{fontSize:"inherit"})}),g(gr,{variant:"caption",color:"text.secondary",sx:{fontStyle:"italic"},children:[r,n?" ...":""]})]}),f(en,{in:a,children:f(gr,{variant:"body2",sx:{pl:4,pt:.4,whiteSpace:"pre-wrap",color:"text.secondary",fontStyle:"italic",lineHeight:1.55},children:t})})]})};var rl=/(\*\*[^*]+\*\*|`[^`]+`|\[[^\]]+\]\([^)]+\)|\*[^*]+\*|\$[^$\n]+\$)/g,Ri=t=>t.trim().startsWith("```"),Wp=t=>/^#{1,6}\s+/.test(t.trim()),ol=t=>/^[-*+]\s+/.test(t.trim()),nl=t=>/^\d+\.\s+/.test(t.trim()),$p=t=>/^(?:-{3,}|\*{3,}|_{3,})$/.test(t.trim()),al=t=>t.trim().startsWith(">"),Gp=(t,r)=>{if(r+1>=t.length)return false;let o=t[r],n=t[r+1];return !o.includes("|")||!n.includes("|")?false:/^\s*\|?\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)+\|?\s*$/.test(n.trim())},_p=t=>t.trim().startsWith("<think>")||t.trim()===":::think",na=(t,r,o)=>{let n=[],a=0,i=0;rl.lastIndex=0;let s=rl.exec(t);for(;s;){s.index>a&&n.push(t.slice(a,s.index));let l=s[0],d=`${o}-${i}`;if(l.startsWith("**")&&l.endsWith("**"))n.push(f("strong",{children:l.slice(2,-2)},d));else if(l.startsWith("*")&&l.endsWith("*"))n.push(f("em",{children:l.slice(1,-1)},d));else if(l.startsWith("`")&&l.endsWith("`"))n.push(f(we,{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:l.slice(1,-1)},d));else if(l.startsWith("[")&&l.includes("](")&&l.endsWith(")")){let p=l.match(/^\[([^\]]+)\]\(([^)]+)\)$/);p?n.push(f(jc,{href:p[2],target:"_blank",rel:"noreferrer",children:p[1]},d)):n.push(l);}else l.startsWith("$")&&l.endsWith("$")&&r.enableMath?n.push(f(oa,{expression:l,inline:true,allowKatex:true},d)):n.push(l);a=s.index+l.length,i+=1,s=rl.exec(t);}return a<t.length&&n.push(t.slice(a)),n.length>0?n:[t]},aa=({markdown:t,content:r,className:o,enableMath:n=true,enableMermaid:a=true,enableThinkBlock:i=true,codeCopyable:s=true,codeLineNumbers:l=false})=>{let d=t??r??"",p=useMemo(()=>{let u=[],f$1=d.replace(/\r\n/g,`
6
6
  `).split(`
7
- `),h={enableMath:a},u=0;for(;u<f$1.length;){let v=f$1[u],y=v.trim();if(!y){u+=1;continue}if(i&&Zd(v)){if(y.startsWith("<think>")){let b=[],S=v;for(;;){let k=S.indexOf("<think>"),x=k>=0?S.slice(k+7):S,E=x.indexOf("</think>");if(E>=0){b.push(x.slice(0,E)),u+=1;break}if(b.push(x),u+=1,u>=f$1.length)break;S=f$1[u];}p.push(f(di,{content:b.join(`
8
- `).trim()},`think-tag-${u}`));continue}u+=1;let C=[];for(;u<f$1.length&&f$1[u].trim()!==":::";)C.push(f$1[u]),u+=1;u<f$1.length&&f$1[u].trim()===":::"&&(u+=1),p.push(f(di,{content:C.join(`
9
- `).trim()},`think-fence-${u}`));continue}if(pi(v)){let C=y.slice(3).trim().toLowerCase(),b=[];for(u+=1;u<f$1.length&&!pi(f$1[u]);)b.push(f$1[u]),u+=1;u<f$1.length&&pi(f$1[u])&&(u+=1);let S=b.join(`
10
- `);if(n&&C==="mermaid"){p.push(f(ws,{code:S},`mermaid-${u}`));continue}if(a&&["math","latex","katex"].includes(C)){p.push(f(Ga,{expression:S,allowKatex:true},`math-fence-${u}`));continue}p.push(f($a,{code:S,language:C||"text",copyable:s,showLineNumbers:c,wrapLongLines:true},`code-${u}`));continue}if(a&&y.startsWith("$$")){let C=[];if(y.endsWith("$$")&&y!=="$$")C.push(y.slice(2,-2)),u+=1;else {let S=v.slice(v.indexOf("$$")+2);for(S.trim()&&C.push(S),u+=1;u<f$1.length;){let k=f$1[u],x=k.indexOf("$$");if(x>=0){C.push(k.slice(0,x)),u+=1;break}C.push(k),u+=1;}}p.push(f(Ga,{expression:C.join(`
11
- `).trim(),allowKatex:true},`math-${u}`));continue}if(qd(v)){let C=Math.min(6,v.match(/^#{1,6}/)?.[0]?.length||1),b=v.replace(/^#{1,6}\s+/,""),S=C===1?"h5":C===2?"h6":"subtitle1";p.push(f(mo,{variant:S,sx:{mt:C===1?1.2:.8,mb:.5,fontWeight:700},children:_a(b,h,`h-${u}`)},`heading-${u}`)),u+=1;continue}if(Xd(v)){p.push(f(sc,{sx:{my:1.2}},`hr-${u}`)),u+=1;continue}if(Yd(f$1,u)){let C=u+2;for(;C<f$1.length&&f$1[C].trim()&&f$1[C].includes("|");)C+=1;let b=f$1.slice(u,C).join(`
12
- `),S=ci(b);if(S){p.push(f(Ps,{table:S},`table-${u}`)),u=C;continue}}if(Ms(v)){let C=[];for(;u<f$1.length&&Ms(f$1[u]);)C.push(f$1[u].replace(/^\s*>\s?/,"")),u+=1;p.push(f(Tr,{variant:"outlined",sx:{px:1,py:.8,my:.9,borderLeftWidth:3,borderLeftStyle:"solid",borderLeftColor:"primary.main",bgcolor:"action.hover"},children:f(mo,{variant:"body2",sx:{whiteSpace:"pre-wrap"},children:C.map((b,S)=>g(Fragment,{children:[S>0&&f("br",{}),_a(b,h,`q-${u}-${S}`)]},`quote-line-${S}`))})},`quote-${u}`));continue}if(Is(v)){let C=[];for(;u<f$1.length&&Is(f$1[u]);)C.push(f$1[u].trim().replace(/^[-*+]\s+/,"")),u+=1;p.push(f(Se,{component:"ul",sx:{my:.8,pl:2.5},children:C.map((b,S)=>f(Se,{component:"li",sx:{mb:.45},children:f(mo,{variant:"body2",children:_a(b,h,`ul-${u}-${S}`)})},`ul-item-${S}`))},`ul-${u}`));continue}if(Rs(v)){let C=[];for(;u<f$1.length&&Rs(f$1[u]);)C.push(f$1[u].trim().replace(/^\d+\.\s+/,"")),u+=1;p.push(f(Se,{component:"ol",sx:{my:.8,pl:2.7},children:C.map((b,S)=>f(Se,{component:"li",sx:{mb:.45},children:f(mo,{variant:"body2",children:_a(b,h,`ol-${u}-${S}`)})},`ol-item-${S}`))},`ol-${u}`));continue}let g$1=[];for(;u<f$1.length;){let C=f$1[u],b=C.trim();if(!b||pi(C)||qd(C)||Xd(C)||Is(C)||Rs(C)||Ms(C)||Yd(f$1,u)||i&&Zd(C)||a&&b.startsWith("$$"))break;g$1.push(C),u+=1;}g$1.length>0?p.push(f(mo,{variant:"body2",sx:{my:.65,lineHeight:1.65},children:g$1.map((C,b)=>g(Fragment,{children:[b>0&&f("br",{}),_a(C,h,`p-${u}-${b}`)]},`p-line-${b}`))},`p-${u}`)):u+=1;}return p},[d,a,n,i,s,c]);return f(Se,{className:r,sx:{"& strong":{fontWeight:700},"& em":{fontStyle:"italic"},"& a":{wordBreak:"break-all"}},children:m})};var g1=(t,o)=>f(Ua,{markdown:t,...o});var Qd=({value:t,onChange:o,onSubmit:r,onVoiceInput:a,onClear:n,placeholder:i,statusText:s,loading:c=false,compact:d=false,showStatusText:m=true})=>g(ne,{spacing:.75,children:[g("div",{sx:{display:"flex",alignItems:"center",gap:1,px:1.2,py:d?.25:.4,borderRadius:999,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",minHeight:d?38:44},children:[f(Rr,{sx:{fontSize:d?16:18,color:"text.secondary"}}),f(gc,{fullWidth:true,value:t,onChange:p=>o(p.target.value),onKeyDown:p=>{p.key==="Enter"&&(p.preventDefault(),r());},placeholder:i,sx:{fontSize:d?"0.84rem":"0.9rem"}}),t&&n&&f(ae,{size:"small",onClick:n,children:f(pr,{sx:{fontSize:d?16:18}})}),a&&f(ae,{size:"small",onClick:a,children:f(Uc,{sx:{fontSize:d?16:18}})}),f(ae,{size:"small",onClick:r,disabled:c||!t.trim(),children:f(Zc,{sx:{fontSize:d?16:18}})})]}),m&&s&&f(A,{variant:"caption",color:"text.secondary",children:s})]});var jd=(t,o)=>{let r=o.trim();if(!r)return t;let a=t.toLowerCase(),n=r.toLowerCase(),i=a.indexOf(n);return i<0?t:g(e,{children:[t.slice(0,i),f("div",{component:"mark",sx:{bgcolor:"warning.light",color:"warning.contrastText",px:.15,borderRadius:.4},children:t.slice(i,i+r.length)}),t.slice(i+r.length)]})},ui=({section:t,highlightQuery:o=""})=>{let r=t.columns||2;return g(Ae,{variant:"outlined",sx:{p:1.8,borderRadius:2},children:[f(A,{variant:"subtitle1",sx:{fontWeight:700,mb:1.4},children:t.title}),f("div",{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:t.fields.map(a=>{let n=typeof a.value=="string"||typeof a.value=="number"?String(a.value):null;return g("div",{sx:{minWidth:0},children:[f(A,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:jd(a.label,o)}),f(A,{component:"div",variant:"body2",sx:{mt:.2,fontWeight:500,wordBreak:"break-word"},children:n?jd(n,o):a.value})]},a.id)})})]})};var Ds=t=>t==null?"":typeof t=="string"||typeof t=="number"||typeof t=="boolean"?String(t):"",gi=t=>t.trim().toLowerCase(),Yf=(t,o)=>{let r=[];return t.forEach(a=>{a.fields.forEach(n=>{let i=n.searchableText||Ds(n.value),s={source:"section",sourceId:a.id,sourceSectionId:a.id,sourceTitle:a.title,fieldId:n.id,fieldLabel:n.label,fieldValue:i};r.push({hit:s,text:gi(`${a.title} ${n.label} ${i}`)});});}),o.forEach(a=>{(a.fields||[]).forEach(n=>{let i=n.searchableText||Ds(n.value),s={source:"tab",sourceId:a.id,sourceTitle:a.label,fieldId:n.id,fieldLabel:n.label,fieldValue:i};r.push({hit:s,text:gi(`${a.label} ${n.label} ${i}`)});}),(a.sections||[]).forEach(n=>{n.fields.forEach(i=>{let s=i.searchableText||Ds(i.value),c={source:"tab",sourceId:a.id,sourceSectionId:n.id,sourceTitle:`${a.label} / ${n.title}`,fieldId:i.id,fieldLabel:i.label,fieldValue:s};r.push({hit:c,text:gi(`${a.label} ${n.title} ${i.label} ${s}`)});});});}),r},Jd=({sections:t,tabs:o=[],defaultTabId:r,ai:a})=>{let{t:n}=ce(),[i,s]=useState(""),[c,d]=useState(r||o[0]?.id),[m,p]=useState("idle"),[f,h]=useState([]),[u,v]=useState(""),[y,g]=useState(""),[C,b]=useState(false),S=useMemo(()=>Yf(t,o),[t,o]);useEffect(()=>{if(o.length===0){d(void 0);return}o.some(N=>N.id===c)||d(r||o[0]?.id);},[o,c,r]);let k=useCallback(()=>{p("idle"),h([]),v(""),g("");},[]),x=useCallback(T=>{s(T),T.trim()||(p("idle"),h([]),v(""),g(""));},[]),E=useCallback(T=>{let N=gi(T);return N?S.filter(R=>R.text.includes(N)).map(R=>R.hit):[]},[S]),D=useCallback(async()=>{let T=i.trim();if(!T)return;b(true);let N=E(T);if(h(N),N.length>0){p("search"),g(""),v(n("detail.searchAi.matches",{count:N.length})),b(false);return}if(a?.enabled!==false&&a?.onSubmit){p("ai"),v(n("detail.searchAi.autoAiFallback"));try{let w=await a.onSubmit(T,{query:T,hits:N,activeTabId:c,sections:t,tabs:o});g(typeof w=="string"?w:"");}finally{b(false);}return}p("search"),g(""),v(n("detail.searchAi.noMatch")),b(false);},[i,E,n,a,c,t,o]);return {query:i,setQuery:x,activeTabId:c,setActiveTabId:d,searchMode:m,hits:f,statusText:u,aiResponse:y,searching:C,handleSubmit:D,clearResult:k}};var $1=({title:t,subtitle:o,sections:r,tabs:a=[],defaultTabId:n,table:i,ai:s,rightHeaderSlot:c,searchBarWidth:d=460,onClose:m,closeLabel:p="Close"})=>{let{t:f$1}=ce(),{query:h,setQuery:u,activeTabId:v,setActiveTabId:y,searchMode:g$1,hits:C,statusText:b,aiResponse:S,searching:k,handleSubmit:x,clearResult:E}=Jd({sections:r,tabs:a,defaultTabId:n,ai:s}),D=useMemo(()=>a.find(R=>R.id===v)||a[0],[a,v]),T=useCallback(R=>{let w=M=>{let I=document.getElementById(R);if(I){I.scrollIntoView({behavior:"smooth",block:"center"});return}M<4&&setTimeout(()=>w(M+1),60);};requestAnimationFrame(()=>w(0));},[]),N=useCallback((R,w)=>{if(a.some(M=>M.id===R)){y(R),T(w?`detail-tab-${R}-section-${w}`:`detail-tab-${R}`);return}T(`detail-section-${R}`);},[a,y,T]);return g("div",{sx:{display:"flex",flexDirection:"column",gap:1.5,minHeight:"100%"},children:[g(ne,{direction:{xs:"column",md:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",md:"center"},spacing:1,children:[g("div",{sx:{minWidth:0},children:[f(A,{variant:"h5",sx:{fontWeight:800,color:"text.primary"},children:t}),o&&f(A,{variant:"body2",color:"text.secondary",sx:{mt:.35},children:o})]}),g(ne,{direction:"row",spacing:.6,alignItems:"center",sx:{width:{xs:"100%",md:"auto"},ml:{xs:0,md:"auto"}},children:[f("div",{sx:{width:{xs:"100%",md:d},maxWidth:"100%",minWidth:{md:320}},children:f(Qd,{value:h,onChange:u,onSubmit:x,onVoiceInput:s?.onVoiceInput,onClear:()=>{u(""),E();},placeholder:s?.placeholder||f$1("detail.searchAi.placeholder"),statusText:b,loading:k,compact:true,showStatusText:false})}),m&&f(nt,{title:p,children:f(ae,{size:"small",onClick:m,children:f(Ec,{fontSize:"small"})})}),c]})]}),b&&f(A,{variant:"caption",color:"text.secondary",sx:{mt:-0.7},children:b}),g$1==="search"&&C.length>0&&g(Ae,{variant:"outlined",sx:{p:1.5,borderRadius:2},children:[f(A,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.6},children:f$1("detail.searchAi.matches",{count:C.length})}),f(ne,{spacing:.35,children:C.slice(0,8).map(R=>f("div",{component:"button",type:"button",onClick:()=>N(R.sourceId,R.sourceSectionId),sx:{textAlign:"left",border:0,bgcolor:"transparent",p:.2,cursor:"pointer",color:"text.primary",borderRadius:1,"&:hover":{bgcolor:"action.hover"}},children:g(A,{variant:"body2",sx:{fontSize:"0.84rem"},children:[f("div",{component:"span",sx:{color:"text.secondary"},children:R.sourceTitle})," \xB7 ",f("div",{component:"span",sx:{fontWeight:700},children:R.fieldLabel})," = ",f("div",{component:"span",children:R.fieldValue||"-"})]})},`${R.source}|${R.sourceId}|${R.fieldId}`))})]}),g$1==="ai"&&S&&g(Ae,{variant:"outlined",sx:{p:1.5,borderRadius:2},children:[f(A,{variant:"subtitle2",sx:{fontWeight:700,mb:.7},children:f$1("detail.searchAi.aiResultTitle")}),f("div",{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:f(Ua,{markdown:S})})]}),f("div",{sx:{display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",lg:"repeat(2, minmax(0, 1fr))"}},children:r.map(R=>f("div",{id:`detail-section-${R.id}`,children:f(ui,{section:R,highlightQuery:h})},R.id))}),a.length>0&&g(Ae,{variant:"outlined",sx:{borderRadius:2,overflow:"hidden"},children:[f(yc,{value:D?.id||false,onChange:(R,w)=>y(String(w)),variant:"scrollable",scrollButtons:"auto",sx:{borderBottom:"1px solid",borderColor:"divider"},children:a.map(R=>f(Cc,{value:R.id,label:R.label,sx:{textTransform:"none"}},R.id))}),g("div",{sx:{p:1.5},children:[f("div",{id:`detail-tab-${D?.id||""}`}),D?.description&&f(A,{variant:"body2",color:"text.secondary",sx:{mb:1.2},children:D.description}),D?.content?D.content:g(ne,{spacing:1.5,children:[(D?.sections||[]).map(R=>f("div",{id:`detail-tab-${D?.id}-section-${R.id}`,children:f(ui,{section:R,highlightQuery:h})},R.id)),D?.fields&&D.fields.length>0&&f(ui,{section:{id:`${D.id}-fields`,title:D.label,fields:D.fields,columns:2},highlightQuery:h})]})]})]}),i&&f(qo,{title:i.title||f$1("detail.table.title"),...i.tableProps,filterConfig:void 0,fitContainer:false})]})};var op=({bucket:t,cardCount:o,highlighted:r=false,children:a,emptyLabel:n,height:i,maxHeight:s,onRename:c,renameLabel:d,sx:m})=>{let{t:p}=ce(),[f$1,h]=useState(false),[u,v]=useState(t.title),y=()=>{v(t.title),h(false);},g$1=C=>{C.preventDefault();let b=u.trim();b&&(b!==t.title&&c?.(b),v(b),h(false));};return f(Ae,{elevation:0,sx:[C=>{let b=t.accentColor??C.palette.primary.main;return {position:"relative",display:"flex",flexDirection:"column",minWidth:0,minHeight:0,height:i??s??560,maxHeight:s,borderRadius:"var(--orb-r-container)",overflow:"hidden",border:r?`1px solid ${et(b,.65)}`:"1px solid var(--orb-border)",bgcolor:"var(--orb-canvas)",boxShadow:r?`0 0 0 2px ${et(b,.16)}, var(--orb-shadow-2)`:"none",transition:"border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease","&::before":{content:'""',display:"block",flexShrink:0,height:3,bgcolor:b}}},...Array.isArray(m)?m:m?[m]:[]],children:g(ne,{spacing:1.25,sx:{flex:1,minHeight:0,overflow:"hidden",p:1.5},children:[g(Se,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:1.25},children:[f(Se,{sx:{minWidth:0,flex:1},children:g(Se,{sx:{display:"flex",alignItems:"center",gap:.75,minHeight:28},children:[t.icon&&f(Se,{sx:{display:"inline-flex",flexShrink:0,color:t.accentColor??"var(--orb-primary)"},children:t.icon}),f$1?g(Se,{component:"form",onSubmit:g$1,sx:{display:"flex",alignItems:"center",gap:.5,flex:1,minWidth:0},children:[f(Be,{dense:true,autoFocus:true,value:u,onChange:C=>v(C.target.value),onKeyDown:C=>{C.key==="Escape"&&(C.preventDefault(),y());},inputProps:{"aria-label":d??p("kanban.bucket.rename")},error:!u.trim(),sx:{flex:1,minWidth:0}}),f(ae,{type:"submit",size:"small",tooltip:p("kanban.bucket.saveRename"),"aria-label":p("kanban.bucket.saveRename"),disabled:!u.trim(),children:f(Wr,{size:14})}),f(ae,{size:"small",tooltip:p("kanban.bucket.cancelRename"),"aria-label":p("kanban.bucket.cancelRename"),onClick:y,children:f(to,{size:14})})]}):f(A,{component:"div",sx:{fontSize:15,fontWeight:600,lineHeight:1.35,color:"text.primary"},children:t.title})]})}),!f$1&&g(ne,{direction:"row",spacing:.75,sx:{flexShrink:0},children:[f(kt,{size:"small",label:o,sx:{minWidth:24,justifyContent:"center",fontWeight:600}}),typeof t.limit=="number"&&f(kt,{size:"small",label:`${p("kanban.bucket.limit")} ${t.limit}`,color:o>t.limit?"warning":"default",variant:"outlined"}),c&&f(ae,{size:"small",tooltip:d??p("kanban.bucket.rename"),"aria-label":d??p("kanban.bucket.rename"),onClick:()=>{v(t.title),h(true);},sx:{width:26,height:26},children:f(Sl,{size:14})})]})]}),r&&f(A,{component:"div",sx:{fontSize:12,color:t.accentColor??"var(--orb-primary)",fontWeight:500},children:p("kanban.bucket.dropHere")}),f(Se,{sx:{flex:1,height:0,minHeight:0,overflowY:"auto",overscrollBehavior:"contain",pr:.4,scrollbarGutter:"stable"},children:o>0?a:f(Se,{sx:{minHeight:"100%",borderRadius:"var(--orb-r-container)",border:"1px dashed var(--orb-border)",bgcolor:"transparent",display:"grid",placeItems:"center",px:2,textAlign:"center"},children:f(A,{sx:{fontSize:13,color:"text.secondary"},children:n??t.emptyLabel??p("kanban.empty")})})})]})})};var Qf={success:"success",warning:"warning",info:"info",error:"error"},jf={critical:"error",high:"warning",medium:"info",low:"success"},Jf={default:"var(--orb-primary)",success:"var(--orb-primary)",warning:"var(--orb-accent)",info:"var(--orb-primary)",error:"var(--orb-err)"},eh=(t,o)=>{switch(t){case "critical":return o("kanban.priority.critical");case "high":return o("kanban.priority.high");case "medium":return o("kanban.priority.medium");case "low":return o("kanban.priority.low");default:return t}},th=t=>t?t.split(/\s+/).map(o=>o.charAt(0).toUpperCase()).slice(0,2).join(""):"NA",As=({card:t,bucket:o,dragging:r=false,overlay:a=false,onClick:n,sx:i})=>{let{t:s}=ce(),c=!!(n&&o),d=t.tone??(t.priority?jf[t.priority]:"default"),m=d==="default"?"primary":Qf[d],p=Jf[d],f$1=o?{card:t,bucket:o}:void 0;return f(Ae,{onClick:c?()=>f$1&&n?.(f$1):void 0,onKeyDown:c?h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),f$1&&n?.(f$1));}:void 0,role:c?"button":void 0,tabIndex:c?0:void 0,sx:[{position:"relative",minWidth:0,overflow:"hidden",p:1.5,pl:1.75,borderRadius:"var(--orb-r-container)",border:`1px solid ${et(p,.24)}`,bgcolor:"var(--orb-canvas)",boxShadow:a?"var(--orb-shadow-3)":r?"none":"var(--orb-shadow-1)",transform:a?"rotate(1deg) scale(1.01)":"none",transition:"transform var(--orb-t-fast), box-shadow var(--orb-t-fast), border-color var(--orb-t-fast)",cursor:c?"pointer":"default",opacity:r?.5:1,"&::before":{content:'""',position:"absolute",inset:"0 auto 0 0",width:3,bgcolor:p},"&:hover":c?{transform:"translateY(-1px)",borderColor:et(p,.48),boxShadow:"var(--orb-shadow-2)"}:void 0,"&:focus-visible":c?{outline:"2px solid var(--orb-focus-solid)",outlineOffset:2}:void 0},...Array.isArray(i)?i:i?[i]:[]],elevation:0,children:g(ne,{spacing:1.25,children:[g(Se,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:1},children:[g(Se,{sx:{minWidth:0,flex:1},children:[(t.kicker||o?.title)&&f(A,{component:"div",sx:{fontSize:11,fontWeight:500,color:"text.secondary",textTransform:"uppercase"},children:t.kicker??o?.title}),f(A,{component:"div",sx:{mt:.25,fontSize:14,fontWeight:600,lineHeight:1.4,color:"text.primary"},children:t.title})]}),t.priority&&f(kt,{size:"small",color:m,label:eh(t.priority,s),variant:d==="default"?"outlined":"filled",sx:{height:22,flexShrink:0,fontWeight:500}})]}),t.summary&&f(A,{component:"div",sx:{fontSize:13,fontWeight:300,color:"text.secondary",lineHeight:1.5},children:t.summary}),t.metrics&&t.metrics.length>0&&f(Se,{sx:{display:"grid",gridTemplateColumns:`repeat(${Math.min(t.metrics.length,3)}, minmax(0, 1fr))`,gap:.75},children:t.metrics.slice(0,3).map(h=>g(Se,{sx:{minWidth:0,borderRadius:"var(--orb-r)",px:1,py:.75,bgcolor:"var(--orb-surface)",border:"1px solid var(--orb-border)"},children:[f(A,{component:"div",noWrap:true,sx:{fontSize:11,fontWeight:500,color:"text.secondary",textTransform:"uppercase"},children:h.label}),f(A,{component:"div",noWrap:true,numeric:true,sx:{mt:.25,fontSize:13,fontWeight:600},children:h.value})]},h.id))}),typeof t.progress=="number"&&g(Se,{children:[g(Se,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:.5},children:[f(A,{sx:{fontSize:12,color:"text.secondary"},children:s("kanban.card.progress")}),g(A,{numeric:true,sx:{fontSize:12,fontWeight:600},children:[Math.round(t.progress),"%"]})]}),f(cc,{variant:"determinate",value:Math.max(0,Math.min(100,t.progress)),color:p,sx:{height:4,borderRadius:2}})]}),(t.tags?.length||t.assignee||t.dueDate||t.footer||c)&&g(ne,{spacing:.9,children:[t.tags&&t.tags.length>0&&f(Se,{sx:{display:"flex",flexWrap:"wrap",gap:.75},children:t.tags.map(h=>f(kt,{size:"small",label:h.label,color:h.color??"default",variant:"outlined"},h.id))}),g(Se,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,flexWrap:"wrap"},children:[g(Se,{sx:{display:"flex",alignItems:"center",gap:.75,minWidth:0},children:[t.assignee&&g(e,{children:[f(In,{src:t.assignee.avatarSrc,sx:{width:28,height:28,fontSize:11},children:t.assignee.initials??th(t.assignee.name)}),g(Se,{sx:{minWidth:0},children:[f(A,{component:"div",sx:{fontSize:13,fontWeight:500,lineHeight:1.3},noWrap:true,children:t.assignee.name}),t.dueDate&&f(A,{component:"div",sx:{fontSize:11,color:"text.secondary",lineHeight:1.35},noWrap:true,children:t.dueDate})]})]}),!t.assignee&&t.dueDate&&f(A,{sx:{fontSize:12,color:"text.secondary"},children:t.dueDate})]}),c&&f(A,{sx:{fontSize:12,color:"var(--orb-link)",fontWeight:500,whiteSpace:"nowrap"},children:s("kanban.card.openDetail")})]}),t.footer]})]})})};var rp=(t,o)=>{let r=o.title.trim();return !o.id||!r||t.buckets.some(a=>a.id===o.id)?t:{buckets:[...t.buckets,{...o,title:r,cards:[]}]}},ap=(t,o,r)=>{let a=r.trim();if(!a)return t;let n=t.buckets.find(i=>i.id===o);return !n||n.title===a?t:{buckets:t.buckets.map(i=>i.id===o?{...i,title:a}:i)}},oh=(t,o)=>Number.isNaN(t)||t<0?0:t>o?o:t,np=({buckets:t,cards:o})=>{let r=new Map;return o.forEach((a,n)=>{let i=r.get(a.bucketId)??[];i.push({card:a,sourceIndex:n}),r.set(a.bucketId,i);}),{buckets:t.map(a=>{let n=[...r.get(a.id)??[]].sort((i,s)=>i.card.position===void 0&&s.card.position===void 0?i.sourceIndex-s.sourceIndex:i.card.position===void 0?1:s.card.position===void 0?-1:i.card.position-s.card.position||i.sourceIndex-s.sourceIndex).map(({card:i},s)=>({...i,bucketId:a.id,position:s}));return {...a,cards:n}})}},Vo=(t,o)=>{for(let r=0;r<t.buckets.length;r+=1){let a=t.buckets[r],n=a.cards.findIndex(i=>i.id===o);if(n>=0)return {card:a.cards[n],bucket:a,bucketIndex:r,cardIndex:n}}},fi=(t,o)=>{let r=Vo(t,o.cardId);if(!r)return t;let a=t.buckets.findIndex(m=>m.id===o.toBucketId);if(a<0)return t;let n=t.buckets.map(m=>({...m,cards:m.cards.map(p=>({...p}))})),i=n[r.bucketIndex],[s]=i.cards.splice(r.cardIndex,1);if(!s)return t;let c=n[a],d=oh(o.targetIndex??c.cards.length,c.cards.length);return c.cards.splice(d,0,{...s,bucketId:o.toBucketId}),{buckets:n.map(m=>({...m,cards:m.cards.map((p,f)=>({...p,bucketId:m.id,position:f}))}))}};var Ls="kanban-card|",Fs="kanban-bucket|",lp=t=>`${Ls}${t}`,mh=t=>`${Fs}${t}`,hi=t=>t?.startsWith(Ls)?t.slice(Ls.length):void 0,sp=t=>t?.startsWith(Fs)?t.slice(Fs.length):void 0,gh=({card:t,bucket:o,onCardClick:r})=>{let{setNodeRef:a,attributes:n,listeners:i,transform:s,transition:c,isDragging:d}=useSortable({id:lp(t.id)}),m={transform:s?`translate3d(${s.x}px, ${s.y}px, 0)`:void 0,transition:c,zIndex:d?2:1,touchAction:"none",cursor:d?"grabbing":"grab"};return f("div",{ref:a,style:m,...n,...i,children:f(As,{card:t,bucket:o,dragging:d,onClick:r})})},fh=({bucket:t,highlighted:o,bucketHeight:r,emptyBucketLabel:a,onBucketRename:n,onCardClick:i})=>{let{isOver:s,setNodeRef:c}=useDroppable({id:mh(t.id)});return f(Se,{ref:c,sx:{minWidth:0,minHeight:0,height:r},children:f(op,{bucket:t,cardCount:t.cards.length,highlighted:o||s,emptyLabel:a,height:r,onRename:n,children:f(SortableContext,{items:t.cards.map(d=>lp(d.id)),strategy:verticalListSortingStrategy,children:f(ne,{spacing:1,children:t.cards.map(d=>f(gh,{card:d,bucket:t,onCardClick:i},d.id))})})})})},cp=t=>String(t??"").toLocaleLowerCase(),hh=(t,o)=>[t.id,t.title,t.summary,t.kicker,t.priority,t.tone,t.progress,t.dueDate,t.assignee?.id,t.assignee?.name,...t.tags?.flatMap(a=>[a.id,a.label])??[],...t.metrics?.flatMap(a=>[a.label,a.value])??[]].some(a=>cp(a).includes(o)),hM=({model:t,onCardMove:o,onCardClick:r,cardFilter:a,onBucketAdd:n,onBucketRename:i,addBucketLabel:s,minBucketWidth:c=320,bucketHeight:d,bucketMaxHeight:m,searchable:p=false,searchValue:f$1,defaultSearchValue:h="",onSearchValueChange:u,searchPlaceholder:v,emptyBucketLabel:y,sx:g$1})=>{let{t:C}=ce(),[b,S]=useState(null),[k,x]=useState(),[E,D]=useState(h),T=f$1??E,N=T.trim().toLocaleLowerCase(),R=d??m??560,w=useMemo(()=>({buckets:t.buckets.map(H=>{let V=a?H.cards.filter(j=>a(j,H)):H.cards;if(!N)return {...H,cards:V};let Z=[H.id,H.title,H.description].some(j=>cp(j).includes(N));return {...H,cards:Z?V:V.filter(j=>hh(j,N))}})}),[a,t,N]),M=useMemo(()=>w.buckets.reduce((H,V)=>H+V.cards.length,0),[w]),I=useCallback(H=>{f$1===void 0&&D(H),u?.(H);},[u,f$1]),L=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:6}}),useSensor(TouchSensor,{activationConstraint:{delay:120,tolerance:8}})),O=useMemo(()=>b?Vo(t,b):void 0,[b,t]),U=useCallback(()=>{S(null),x(void 0);},[]),z=useCallback(H=>{if(!H)return;let V=hi(H);return V?Vo(t,V)?.bucket.id:sp(H)},[t]),K=useCallback(H=>{S(hi(String(H.active.id))??null);},[]),W=useCallback(H=>{x(z(H.over?String(H.over.id):void 0));},[z]),q=useCallback(H=>{let V=hi(String(H.active.id)),Z=H.over?String(H.over.id):void 0;if(!V||!Z){U();return}let j=Vo(t,V);if(!j){U();return}let me=j.bucket.id,ie=j.cardIndex,ge=hi(Z);if(ge){let Oe=Vo(t,ge);if(!Oe){U();return}me=Oe.bucket.id,ie=Oe.cardIndex;}else {let Oe=sp(Z),Ie=t.buckets.find(ze=>ze.id===Oe);if(!Oe||!Ie){U();return}me=Oe,ie=Ie.cards.length;}if(j.bucket.id===me&&j.cardIndex===ie){U();return}let ye=fi(t,{cardId:V,fromBucketId:j.bucket.id,toBucketId:me,targetIndex:ie}),Ue=Vo(ye,V);Ue&&!(Ue.bucket.id===j.bucket.id&&Ue.cardIndex===j.cardIndex)&&o?.({cardId:V,fromBucketId:j.bucket.id,toBucketId:Ue.bucket.id,targetIndex:Ue.cardIndex,card:Ue.card,model:ye}),U();},[t,o,U]);return g(DndContext,{sensors:L,collisionDetection:closestCorners,onDragStart:K,onDragOver:W,onDragEnd:q,onDragCancel:U,children:[g(Se,{sx:{display:"flex",flexDirection:"column",minWidth:0,minHeight:0,height:"100%",overflow:"hidden"},children:[(p||n)&&g(Se,{role:p?"search":void 0,sx:{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:1.5,mb:1.25,minWidth:0},children:[p&&f(Se,{sx:{width:"100%",maxWidth:360,flex:"1 1 240px"},children:f(Be,{dense:true,value:T,onChange:H=>I(H.target.value),placeholder:v??C("kanban.search.placeholder"),autoComplete:"off",sx:{"& .orb-inp":{paddingLeft:"38px",paddingRight:T?"42px":"12px"},"& .orb-inp-adornment-end":{pointerEvents:"auto"}},startAdornment:f(Lo,{size:16,"aria-hidden":"true"}),endAdornment:T?f(ae,{size:"small",tooltip:C("kanban.search.clear"),"aria-label":C("kanban.search.clear"),onClick:()=>I(""),sx:{width:26,height:26},children:f(to,{size:15})}):void 0})}),g(Se,{sx:{display:"flex",alignItems:"center",gap:1,ml:"auto"},children:[N&&f(A,{component:"div","aria-live":"polite",sx:{flexShrink:0,fontSize:12,fontWeight:500,color:"text.secondary"},children:M>0?C("kanban.search.results",{count:M}):C("kanban.search.noMatch")}),n&&f(be,{size:"small",variant:"secondary",startIcon:f(dn,{size:15}),onClick:n,children:s??C("kanban.bucket.add")})]})]}),f(Se,{sx:[{display:"grid",gridAutoFlow:"column",gridAutoColumns:`minmax(${c}px, ${Math.max(c,360)}px)`,gap:1.5,gridAutoRows:R==="100%"?"minmax(0, 1fr)":void 0,alignItems:"stretch",justifyContent:"start",flex:"1 1 0",height:"100%",minHeight:0,overflowX:"auto",overflowY:"hidden",overscrollBehavior:"contain",scrollbarGutter:"stable both-edges",pb:.5},...Array.isArray(g$1)?g$1:g$1?[g$1]:[]],children:w.buckets.map(H=>f(fh,{bucket:H,highlighted:H.id===k,bucketHeight:R,emptyBucketLabel:N?C("kanban.search.noMatch"):y,onBucketRename:i?V=>i(H.id,V):void 0,onCardClick:r},H.id))})]}),f(DragOverlay,{children:O?f(Se,{sx:{width:Math.max(c-24,260)},children:f(As,{card:O.card,bucket:O.bucket,overlay:true})}):null})]})};var yh=({initialModel:t,initialBuckets:o,initialCards:r})=>t||np({buckets:o??[],cards:r??[]}),xM=t=>{let{onCardMove:o,onCardClick:r}=t,[a,n]=useState(()=>yh(t)),i=useCallback(h=>{n(u=>typeof h=="function"?h(u):h);},[]),s=useCallback(h=>Vo(a,h),[a]),c=useCallback((h,u,v)=>{let y=Vo(a,h);if(!y)return;let g=fi(a,{cardId:h,fromBucketId:y.bucket.id,toBucketId:u,targetIndex:v}),C=Vo(g,h);if(!C||C.bucket.id===y.bucket.id&&C.cardIndex===y.cardIndex)return;n(g);let b={cardId:h,fromBucketId:y.bucket.id,toBucketId:C.bucket.id,targetIndex:C.cardIndex,card:C.card,model:g};return o?.(b),b},[a,o]),d=useCallback((h,u)=>{n(v=>({buckets:v.buckets.map(y=>({...y,cards:y.cards.map(g=>g.id!==h?g:typeof u=="function"?u(g):{...g,...u})}))}));},[]),m=useCallback(h=>{let u=rp(a,h);return u===a?false:(n(u),true)},[a]),p=useCallback((h,u)=>{let v=ap(a,h,u);return v===a?false:(n(v),true)},[a]),f=useMemo(()=>({model:a,onCardMove:h=>{c(h.cardId,h.toBucketId,h.targetIndex);},onCardClick:r}),[a,c,r]);return {model:a,actions:{replaceModel:i,moveCard:c,updateCard:d,addBucket:m,renameBucket:p,getCard:s},boardProps:f}};function la({onTextUpdate:t,onComplete:o,onError:r,wsUrl:a="ws://localhost:8765",silenceThresholdMs:n=2e3,minVolumeRms:i=.015}){let[s,c]=useState(false),d=useRef(null),m=useRef(null),p=useRef(null),f=useRef(null),h=useRef(null),u=useRef(0),v=useRef(false),y=useRef(false),g=useCallback(()=>{d.current&&(d.current.close(),d.current=null),f.current&&(f.current.disconnect(),f.current=null),h.current&&(h.current.disconnect(),h.current=null),m.current&&(m.current.getTracks().forEach(S=>S.stop()),m.current=null),p.current&&(p.current.close(),p.current=null),y.current=false,c(false);},[]),C=useCallback(()=>{v.current||(v.current=true,d.current?.readyState===WebSocket.OPEN&&d.current.send(JSON.stringify({type:"stop"})),setTimeout(g,500));},[g]),b=useCallback(async()=>{if(!(s||y.current)){y.current=true,v.current=false,u.current=Date.now();try{let S=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,sampleRate:16e3,echoCancellation:!0,noiseSuppression:!0}});m.current=S;let k=new WebSocket(a);d.current=k,k.onopen=()=>{c(!0),y.current=!1;},k.onmessage=N=>{try{let R=JSON.parse(N.data);if(R.type==="recognition")R.is_final?o(R.text):t?.(R.text);else if(R.type==="error"){let w=R.message||"Voice recognition error";r?.(w),C();}}catch{r?.("Failed to parse voice message");}},k.onerror=()=>{r?.("Voice service connection failed"),g();},k.onclose=()=>{g();};let x=window.AudioContext||window.webkitAudioContext;if(!x)throw new Error("AudioContext is not supported in this browser");let E=new x({sampleRate:16e3});p.current=E;let D=E.createMediaStreamSource(S);h.current=D;let T=E.createScriptProcessor(4096,1,1);f.current=T,T.onaudioprocess=N=>{if(d.current?.readyState!==WebSocket.OPEN)return;let R=N.inputBuffer.getChannelData(0),w=0;for(let L=0;L<R.length;L+=1)w+=R[L]*R[L];if(Math.sqrt(w/R.length)>i)u.current=Date.now();else if(Date.now()-u.current>n&&!v.current){C();return}let I=new Int16Array(R.length);for(let L=0;L<R.length;L+=1){let O=Math.max(-1,Math.min(1,R[L]));I[L]=O<0?O*32768:O*32767;}d.current.send(I.buffer);},D.connect(T),T.connect(E.destination);}catch{r?.("Cannot access microphone"),g();}}},[g,s,i,o,r,t,n,C,a]);return useEffect(()=>g,[g]),{isRecording:s,startRecording:b,stopRecording:C}}var wh=["en","zh","fr","de","ja","ko"],pp={en:"EN",zh:"\u4E2D\u6587",fr:"FR",de:"DE",ja:"\u65E5\u672C\u8A9E",ko:"\uD55C\uAD6D\uC5B4"},Os=({searchPlaceholder:t,onSearch:o,onSearchAdd:r,maxWidth:a=540,sx:n})=>{let{t:i}=ce(),[s,c]=useState(""),d=useCallback((g=s)=>{let C=g.trim();C&&(c(""),o?.(C));},[o,s]),m=g=>{g.preventDefault(),d();},{isRecording:p,startRecording:f$1,stopRecording:h}=la({onTextUpdate:c,onComplete:g=>{c(g),d(g);},onError:g=>{console.error("Header voice input error:",g);}}),u=useCallback(async()=>{if(p){h();return}await f$1();},[p,f$1,h]),v=t||i("header.searchPlaceholder"),y=s.trim().length>0;return f("form",{className:"orb-app-header-search",onSubmit:m,style:{width:"100%",maxWidth:typeof a=="number"?`${a}px`:a,...n},children:g("div",{className:"orb-inp-adornment-wrap orb-app-header-search-shell",style:{background:"var(--orb-surface)",border:"1px solid var(--orb-border)",borderRadius:999,paddingRight:4},children:[f("div",{className:"orb-inp-adornment",children:f(ae,{className:"orb-app-header-ai-action",size:"small",onClick:r,tooltip:i("header.searchAddFeature"),children:f(Rt,{name:"add",size:16})})}),f("input",{className:"orb-inp orb-inp-dense orb-app-header-ai-input",value:s,onChange:g=>c(g.target.value),placeholder:v,style:{border:"none",background:"transparent",flex:1,minWidth:0}}),g("div",{className:"orb-inp-adornment orb-inp-adornment-end",children:[f(ae,{className:"orb-app-header-ai-action",size:"small",onClick:()=>{u();},tooltip:i(p?"header.searchStopVoice":"header.searchStartVoice"),sx:{color:p?"var(--orb-err)":void 0},children:f(Rt,{name:"microphone",size:16})}),f(ae,{className:"orb-app-header-ai-action",size:"small",type:"submit",disabled:!y,tooltip:i("header.searchSend"),children:f(Rt,{name:"paperPlane",size:16})})]})]})})},bi=({appTitle:t,logo:o,onToggleMode:r,locale:a,localeLabel:n,localeOptions:i,onLocaleChange:s,searchPlaceholder:c,showSearch:d=false,onSearch:m,onSearchAdd:p,user:f$1,onUserRefresh:h,onUserSetting:u,onUserLogout:v,userMenuItems:y,leftSlot:g$1,rightSlot:C})=>{let{t:b,locale:S}=ce(),k=ho(),x=a||S,E=n||pp[x],D=i||wh,T=k==="dark"?f(Dl,{size:15}):f(Ll,{size:15}),N=b(k==="dark"?"header.theme.dark":"header.theme.light"),R=[...h?[{key:"refresh",label:b("header.menu.refresh"),icon:f(pn,{size:15}),onClick:h}]:[],...u?[{key:"settings",label:b("header.menu.setting"),icon:f(un,{size:16}),onClick:u}]:[],...v?[{key:"logout",label:b("header.menu.logout"),icon:f(Rl,{size:16}),onClick:v}]:[]],w=y||R,M=D.map(I=>({label:pp[I],onClick:()=>{s?.(I),window.requestAnimationFrame(()=>{document.activeElement instanceof HTMLElement&&document.activeElement.blur();});},disabled:I===x}));return g("header",{className:"orb-app-header",children:[g("div",{className:"orb-app-header-brand",children:[g$1,o===null?null:o||f("div",{className:"orb-app-header-default-logo","aria-label":"ORBCAFE",children:f(Rt,{name:"product",size:20})}),t&&f(A,{variant:"h4",sx:{fontWeight:700},children:t})]}),f("div",{className:"orb-app-header-center",children:d&&f(Os,{searchPlaceholder:c,onSearch:m,onSearchAdd:p})}),g("div",{className:"orb-app-header-actions",children:[g("div",{className:"orb-app-header-utilities",children:[s?f(qt,{triggerLabel:E,trigger:g("button",{type:"button",className:"orb-icon-btn orb-app-header-locale",children:[f(Ca,{size:15}),f("span",{className:"orb-label",children:E})]}),items:M,align:"end"}):g("div",{className:"orb-app-header-locale","aria-label":E,children:[f(Ca,{size:15}),f("span",{className:"orb-label",children:E})]}),f(ae,{className:"orb-app-header-theme",size:"small",onClick:r,tooltip:N,children:T})]}),f$1&&f("span",{className:"orb-app-header-divider","aria-hidden":"true"}),f$1&&f(qt,{triggerLabel:f$1.name,trigger:g("button",{type:"button",className:"orb-app-header-user-trigger",children:[g("span",{className:"orb-app-header-user-copy",children:[f(A,{variant:"body2",className:"orb-app-header-user-name",children:f$1.name}),f$1.subtitle&&f(A,{variant:"caption",muted:true,className:"orb-app-header-user-subtitle",title:f$1.subtitle,children:f$1.subtitle})]}),f(Gr,{src:f$1.avatarSrc,alt:f$1.name,size:32,children:f$1.avatarText||f$1.name.slice(0,1).toUpperCase()})]}),items:w.map(I=>({label:I.label,onClick:I.onClick,disabled:I.disabled,icon:I.icon})),align:"end"}),C]})]})};var up=({menuData:t=[],initialNavigationCollapsed:o=false,initialNavigationMode:r="fixed",enableNavigationPinning:a,navigationPinStorageKey:n,pinnedNavigationItemIds:i,defaultPinnedNavigationItemIds:s,onPinnedNavigationItemIdsChange:c,pinnedNavigationSectionTitle:d}={})=>{let{navigationIslandProps:m}=oc({initialCollapsed:o,initialDisplayMode:r,content:t,enablePinning:a,pinStorageKey:n,pinnedItemIds:i,defaultPinnedItemIds:s,onPinnedItemIdsChange:c,pinnedSectionTitle:d}),[p,f]=useState(900);useEffect(()=>{let u=()=>f(window.innerHeight);return u(),window.addEventListener("resize",u),()=>window.removeEventListener("resize",u)},[]);let h=useMemo(()=>Math.max(280,p-100),[p]);return {navigationIslandProps:m,navigationMaxHeight:h}};var Ao=12,gp=56,fp=234,Rh="orbcafe:page-layout-locale",hp=["en","zh","fr","de","ja","ko"],Mh=t=>encodeURIComponent(t.trim().toLowerCase()).replace(/%/g,"").replace(/[^a-z0-9._~-]+/g,"-")||"app",vi=(t,o)=>`orbcafe:page-layout:${Mh(t)}:${o}`,Dh=t=>`orbcafe:page-layout:${t.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-")||"app"}:pinned-navigation-items`,Ah=t=>t==="system"?"dark":t==="dark"?"light":"system",yi=(t,o,r)=>Math.min(Math.max(t,o),Math.max(o,r)),Nh=t=>t instanceof HTMLElement?!!t.closest('button,input,a,textarea,select,[role="button"],[contenteditable="true"]'):false,_M=({appId:t,appTitle:o,menuData:r=[],children:a,showNavigation:n=true,locale:i="en",localeLabel:s,localeOptions:c,onLocaleChange:d,mode:m,defaultMode:p="system",onModeChange:f$1,user:h,onUserRefresh:u,onUserSetting:v,onUserLogout:y,userMenuItems:g$1,logo:C,searchPlaceholder:b,searchPlacement:S="hidden",floatingSearchSx:k,onSearch:x,onSearchAdd:E,rightHeaderSlot:D,leftHeaderSlot:T,contentSx:N,navigationVariant:R="classic",navigationMode:w,defaultNavigationMode:M="fixed",onNavigationModeChange:I,showNavigationModeToggle:L=true,enableNavigationPinning:O=true,navigationPinStorageKey:U,pinnedNavigationItemIds:z,defaultPinnedNavigationItemIds:K,onPinnedNavigationItemIdsChange:W,pinnedNavigationSectionTitle:q})=>{let H=t?vi(t,"mode"):"orbcafe:page-layout-mode",V=t?vi(t,"locale"):Rh,Z=t?vi(t,"navigation-mode"):"orbcafe:page-layout-navigation-mode",[j,me]=useState(p),[ie,ge]=useState("light"),[ye,Ue]=useState(false),[Oe,Ie]=useState(i),[ze,Re]=useState(false),[Ce,Ve]=useState(false),[at,gt]=useState(M),[Je,te]=useState({x:Ao,y:Ao}),[We,Ne]=useState("left"),[Ee,st]=useState(false),Ze=useRef(null),ht=useRef(null),xt=m!==void 0,Nt=m??j,Et=d!==void 0,ee=Et?i:Oe,tt=c?.join("|")??"",Le=w!==void 0,se=w??at,ue=se==="floating",Q=R==="v2"?ss:Zl,we=S==="header",ke=Nt==="system"?ye?ie:"light":Nt;useEffect(()=>{if(!xt)try{let _=window.localStorage.getItem(H);(_==="light"||_==="dark"||_==="system")&&me(_);}catch{}Ue(true);let xe=window.matchMedia("(prefers-color-scheme: dark)"),B=()=>{ge(xe.matches?"dark":"light");};return B(),xe.addEventListener("change",B),()=>xe.removeEventListener("change",B)},[xt,H]),useEffect(()=>{if(!(xt||!ye))try{window.localStorage.setItem(H,Nt);}catch{}},[ye,xt,Nt,H]),useEffect(()=>{if(Et){Re(true);return}try{let xe=window.localStorage.getItem(V),B=c??hp;xe&&hp.includes(xe)&&B.includes(xe)&&Ie(xe);}catch{}finally{Re(true);}},[Et,tt,V]),useEffect(()=>{if(!(Et||!ze))try{window.localStorage.setItem(V,ee);}catch{}},[ee,Et,ze,V]),useEffect(()=>{if(Le){Ve(true);return}try{let xe=window.localStorage.getItem(Z);(xe==="fixed"||xe==="floating")&&gt(xe);}catch{}finally{Ve(true);}},[Le]),useEffect(()=>{if(Ce)try{window.localStorage.setItem(Z,se);}catch{}},[se,Ce]),useEffect(()=>{ke==="dark"?(document.documentElement.classList.add("dark"),document.documentElement.style.colorScheme="dark"):(document.documentElement.classList.remove("dark"),document.documentElement.style.colorScheme="light");},[ke]);let Xe=useCallback(xe=>{Le||gt(xe),I?.(xe);},[Le,I]),dt=useCallback(xe=>{xt||me(xe),f$1?.(xe);},[xt,f$1]),lt=useCallback(xe=>{Et||Ie(xe),d?.(xe);},[Et,d]),{navigationIslandProps:Lt,navigationMaxHeight:$t}=up({menuData:r,initialNavigationCollapsed:false,initialNavigationMode:se,enableNavigationPinning:O,navigationPinStorageKey:U??(t?vi(t,"pinned-navigation-items"):Dh(o)),pinnedNavigationItemIds:z,defaultPinnedNavigationItemIds:K,onPinnedNavigationItemIdsChange:W,pinnedNavigationSectionTitle:q}),bt=Lt.collapsed,ft=useCallback(xe=>{let B=Ze.current,_=B?.parentElement;if(!B||!_)return xe;let J=_.getBoundingClientRect(),Te=B.getBoundingClientRect(),fe=Ao,Me=Ao,$e=Math.max(fe,J.width-Te.width-Ao),Qe=Math.max(Me,J.height-Te.height-Ao);return {x:yi(xe.x,fe,$e),y:yi(xe.y,Me,Qe)}},[]),vo=useCallback(xe=>{let B=Ze.current,_=B?.parentElement;if(!B||!_)return xe;let J=_.getBoundingClientRect(),Te=B.getBoundingClientRect(),fe=Ao,Me=Ao,$e=Math.max(fe,J.width-Te.width-Ao),Qe=Math.max(Me,J.height-Te.height-Ao),Ge={x:yi(xe.x,fe,$e),y:yi(xe.y,Me,Qe)},Dt=[{distance:Math.abs(Ge.x-fe),position:{x:fe,y:Ge.y}},{distance:Math.abs(Ge.x-$e),position:{x:$e,y:Ge.y}},{distance:Math.abs(Ge.y-Me),position:{x:Ge.x,y:Me}},{distance:Math.abs(Ge.y-Qe),position:{x:Ge.x,y:Qe}}].reduce((St,yt)=>yt.distance<St.distance?yt:St).position;return Ne(Dt.x>=(fe+$e)/2?"right":"left"),Dt},[]),Pt=useMemo(()=>{if(!ue||Ee)return Je.x;if(We==="right"){let _=Ze.current?.parentElement?.getBoundingClientRect().width,J=bt?gp:fp;return _?Math.max(Ao,_-J-Ao):bt?Je.x:Je.x-(fp-gp)}return Je.x},[We,Je.x,Ee,ue,bt]),Ft=useCallback(xe=>{if(!ue||!bt||Nh(xe.target))return;xe.preventDefault(),xe.currentTarget.setPointerCapture(xe.pointerId);let B=ft({x:Pt,y:Je.y});Ne("left"),te(B),ht.current={pointerId:xe.pointerId,startClientX:xe.clientX,startClientY:xe.clientY,startX:B.x,startY:B.y,currentX:B.x,currentY:B.y},st(true);},[ft,Pt,Je.y,ue,bt]),ct=useCallback(xe=>{let B=ht.current;if(!B||B.pointerId!==xe.pointerId)return;let _=ft({x:B.startX+xe.clientX-B.startClientX,y:B.startY+xe.clientY-B.startClientY});B.currentX=_.x,B.currentY=_.y,te(_);},[ft]),Bt=useCallback(xe=>{let B=ht.current;if(!(!B||B.pointerId!==xe.pointerId)){try{xe.currentTarget.releasePointerCapture(xe.pointerId);}catch{}ht.current=null,te(vo({x:B.currentX,y:B.currentY})),st(false);}},[vo]);return useEffect(()=>{if(!ue)return;let xe=()=>{te(J=>ft(J));},B=window.requestAnimationFrame(xe),_=window.setTimeout(xe,430);return ()=>{window.cancelAnimationFrame(B),window.clearTimeout(_);}},[ft,ue,bt,$t]),f(ba,{mode:Nt,children:f(yn,{locale:ee,children:g("div",{className:"orb-root",style:{minHeight:"100vh",width:"100%",display:"flex",flexDirection:"column",overflowX:"hidden",background:"var(--orb-canvas)"},children:[f(bi,{appTitle:o,logo:C,mode:Nt,onToggleMode:()=>dt(Ah(Nt)),locale:ee,localeLabel:Et||ee===i?s:void 0,localeOptions:c,onLocaleChange:lt,user:h,onUserRefresh:u,onUserSetting:v,onUserLogout:y,userMenuItems:g$1,searchPlaceholder:b,showSearch:we,onSearch:x,onSearchAdd:E,leftSlot:T,rightSlot:D}),S==="floating"&&f("div",{className:"orb-float-search",style:k,children:f(Os,{searchPlaceholder:b,onSearch:x,onSearchAdd:E,maxWidth:"100%"})}),g("div",{style:{flex:1,minHeight:0,minWidth:0,display:"flex",overflowX:"hidden",position:"relative"},children:[n&&!ue&&f("div",{style:{paddingTop:12,paddingBottom:12,paddingLeft:12,paddingRight:bt?4:12,display:"flex",alignItems:"flex-start",flexShrink:0},children:f(Q,{...Lt,maxHeight:$t,colorMode:ke,displayMode:se,onDisplayModeChange:Xe,showDisplayModeToggle:L&&bt})}),n&&ue&&f("div",{ref:Ze,onPointerDown:Ft,onPointerMove:ct,onPointerUp:Bt,onPointerCancel:Bt,style:{position:"absolute",top:Je.y,left:Pt,zIndex:1205,display:"flex",alignItems:"flex-start",cursor:bt?Ee?"grabbing":"grab":"default",touchAction:bt?"none":"auto",userSelect:Ee?"none":void 0,transition:Ee?"none":"left 180ms ease-out, top 180ms ease-out"},children:f(Q,{...Lt,maxHeight:$t,colorMode:ke,displayMode:se,onDisplayModeChange:Xe,showDisplayModeToggle:L&&bt})}),f("div",{style:{flex:1,minWidth:0,minHeight:0,overflow:"auto",paddingTop:12,paddingBottom:12,paddingRight:12,paddingLeft:n&&!ue&&bt?4:12,...N},children:a})]})]})})})};var Ci="(blank)",bp="Result",vp="Grand Total",yp={sum:"Sum",count:"Count",avg:"Average",min:"Min",max:"Max"},Cp=["sum","count","avg","min","max"];var xp=["palette","rows","columns","filters","values"];var Sp=t=>xp.includes(t),wp=t=>t==="rows"||t==="columns"||t==="filters",xi=t=>{let o=t.split("|");return o.length===2&&o[0]==="container"&&Sp(o[1])?{kind:"container",zone:o[1]}:o.length===3&&o[0]==="item"&&Sp(o[1])&&o[2]?{kind:"item",zone:o[1],key:o[2]}:null},rr=t=>t==null||t===""?Ci:t instanceof Date?t.toISOString().slice(0,10):String(t),Nr=t=>JSON.stringify(t),kp=(t,o)=>{let r=t.join(""),a=o.join("");return r.localeCompare(a,void 0,{sensitivity:"base"})},Eh=t=>{if(typeof t=="number"&&Number.isFinite(t))return t;if(typeof t=="string"&&t.trim()!==""){let o=Number(t);return Number.isFinite(o)?o:null}return null},ca=(t,o,r)=>{if(r==="count")return t.length;let a=t.map(n=>Eh(n[o])).filter(n=>n!==null);return a.length===0?0:r==="sum"?a.reduce((n,i)=>n+i,0):r==="avg"?a.reduce((n,i)=>n+i,0)/a.length:r==="min"?Math.min(...a):Math.max(...a)},ao=(t,o)=>{if(!t||t.length===0)return [];let r=new Set,a=[];return t.forEach(n=>{!o.has(n)||r.has(n)||(r.add(n),a.push(n));}),a},ar=(t,o)=>t.length!==o.length?false:t.every((r,a)=>r===o[a]),Pp=(t,o)=>{let r=Object.keys(t),a=Object.keys(o);return r.length!==a.length?false:r.every(n=>{let i=t[n]??[],s=o[n]??[];return ar(i,s)})},Si=(t,o)=>t.length!==o.length?false:t.every((r,a)=>{let n=o[a];return r.tokenId===n.tokenId&&r.fieldId===n.fieldId&&r.aggregation===n.aggregation}),zs=t=>!t?.aggregations||t.aggregations.length===0?Cp:t.aggregations,go=(t,o)=>{let r=zs(o);return t&&r.includes(t)?t:o?.type==="number"&&r.includes("sum")?"sum":r.includes("count")?"count":r[0]},Ka=(t,o,r)=>{let a=r.get(o.fieldId);return a?.formatValue?a.formatValue(t):o.aggregation==="count"?Math.round(t).toLocaleString():t.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:2})};var Ip=({options:t,selectedValues:o,onChange:r,minWidth:a=96})=>{let{t:n}=ce(),[i,s]=useState(""),[c,d]=useState(null),m=useMemo(()=>{let u=i.trim().toLowerCase();return u?t.filter(v=>v.toLowerCase().includes(u)):t},[t,i]),p=t.length>0&&o.length===t.length,f$1=t.length===0?n("pivot.filter.na"):o.length===0?n("common.none"):p?n("common.all"):`${o.length}/${t.length}`,h=u=>{r(o.includes(u)?o.filter(v=>v!==u):[...o,u]);};return g("div",{sx:{minWidth:a},onClick:u=>u.stopPropagation(),onMouseDown:u=>u.stopPropagation(),children:[f(be,{variant:"outlined",size:"small",onClick:u=>d(u.currentTarget),sx:{minWidth:a,height:26,px:1,py:.35,fontSize:"0.72rem",justifyContent:"space-between"},children:f$1}),f(qt,{anchorEl:c,open:!!c,onClose:()=>d(null),PaperProps:{sx:{width:Math.max(a,220),maxHeight:320,overflowY:"auto",p:.5}},children:g("div",{onClick:u=>u.stopPropagation(),sx:{display:"grid",gap:.4},children:[f(Be,{size:"small",placeholder:`${n("common.search")}...`,fullWidth:true,value:i,onChange:u=>s(u.target.value),onKeyDown:u=>u.stopPropagation(),onClick:u=>u.stopPropagation(),sx:{m:0,"& .orb-inp":{fontSize:"0.75rem",py:.7}}}),f("div",{sx:{px:1,py:.5,borderBottom:"1px solid var(--orb-border)"},children:f(be,{variant:"text",size:"small",onClick:u=>{u.preventDefault(),u.stopPropagation(),r(p?[]:t);},sx:{minWidth:"auto",px:0,py:.2,fontSize:"0.76rem",fontWeight:700,textTransform:"none"},children:n(p?"pivot.filter.deselectAll":"pivot.filter.selectAll")})}),m.length===0&&f("div",{className:"orb-menu-item","aria-disabled":"true",sx:{fontSize:"0.75rem"},children:n("pivot.filter.noResults")}),m.map(u=>{let v=o.includes(u);return g("div",{role:"option","aria-selected":v,tabIndex:0,className:`orb-menu-item ${v?"orb-selected":""}`,onClick:()=>h(u),onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),h(u));},sx:{display:"flex",alignItems:"center",fontSize:"0.75rem",py:.4},children:[f(Mt,{size:"small",checked:v,inputProps:{tabIndex:-1},sx:{p:.5,mr:.5,pointerEvents:"none"}}),f("span",{children:u})]},u)})]})})]})};var da=({size:t=18,subtle:o=false})=>{let r=Math.max(2,Math.round(t/6));return f(Se,{"aria-hidden":"true",sx:{display:"grid",gridTemplateColumns:`repeat(2, ${r}px)`,gridAutoRows:`${r}px`,gap:`${Math.max(2,Math.round(r/1.5))}px`,placeItems:"center",width:t,height:t,flexShrink:0,color:o?"var(--orb-muted)":"var(--orb-primary)"},children:Array.from({length:6},(a,n)=>f(Se,{sx:{width:r,height:r,borderRadius:999,bgcolor:"currentColor"}},n))})};var Vs=({label:t,subtitle:o,isDragging:r,dragRef:a,listeners:n,attributes:i,style:s})=>f(Ae,{ref:a,...n,...i,sx:{p:1,borderRadius:"var(--orb-r-container)",border:"1px solid",borderColor:"var(--orb-border)",bgcolor:"var(--orb-canvas)",boxShadow:"var(--orb-shadow-1)",touchAction:"none",transition:"border-color 140ms ease, background-color 140ms ease, transform 140ms ease","&:hover":{borderColor:"var(--orb-p200)",bgcolor:"var(--orb-p50)",transform:"translateY(-1px)"}},style:{...s,opacity:r?.3:1,cursor:r?"grabbing":"grab"},children:g("div",{sx:{display:"flex",alignItems:"center",gap:.9},children:[f("div",{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:"var(--orb-r)",bgcolor:"var(--orb-p50)",border:"1px solid var(--orb-p100)"},children:f(da,{size:13,subtle:true})}),g("div",{sx:{minWidth:0,display:"flex",flexDirection:"column",gap:.15},children:[f(A,{component:"div",sx:{fontSize:"0.84rem",fontWeight:700,lineHeight:1.2,color:"var(--orb-fg-strong)"},children:t}),o&&f(A,{component:"div",sx:{fontSize:"0.73rem",fontWeight:400,color:"var(--orb-fg)",lineHeight:1.2},children:o})]})]})}),Rp=({id:t,label:o,subtitle:r})=>{let{setNodeRef:a,listeners:n,attributes:i,isDragging:s}=useDraggable({id:t});return f(Vs,{label:o,subtitle:r,isDragging:s,dragRef:a,listeners:n,attributes:i})};var pa=({zone:t,title:o,hint:r,icon:a,children:n,itemCount:i,onClear:s})=>{let c=`container|${t}`,{isOver:d,setNodeRef:m}=useDroppable({id:c}),{t:p}=ce();return g(Ae,{ref:m,sx:f=>({p:1.1,borderRadius:"var(--orb-r-container)",border:"1px dashed",borderColor:d?"var(--orb-primary)":"var(--orb-p200)",bgcolor:d?"var(--orb-p100)":f.palette.mode==="dark"?"var(--orb-surface-2)":"var(--orb-p50)",transition:"border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease",boxShadow:d?"0 0 0 3px var(--orb-focus-ring)":"none",minHeight:120,display:"flex",flexDirection:"column"}),children:[g("div",{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1},children:[g("div",{sx:{display:"flex",alignItems:"center",gap:.8},children:[a,f(A,{component:"div",sx:{fontSize:"0.8rem",fontWeight:700,letterSpacing:.1,color:"var(--orb-fg-strong)"},children:o}),g(A,{component:"div",sx:{fontSize:"0.73rem",fontWeight:500,color:"var(--orb-fg)"},children:["(",i,")"]})]}),i>0&&s&&f(nt,{title:p("pivot.clearArea"),children:f(ae,{size:"small",onClick:s,sx:{width:24,height:24,p:0},children:f(Gc,{size:13})})})]}),f(A,{component:"div",sx:{mt:.5,mb:.9,fontSize:"0.72rem",fontWeight:400,color:"var(--orb-fg)"},children:r}),f("div",{sx:{flex:1},children:n})]})};var Mp={xs:1.2,md:1.6},ua=({title:t,subtitle:o,collapsed:r,onToggleCollapse:a,expandAriaLabel:n,collapseAriaLabel:i,children:s,bodySx:c,unmountOnExit:d=false,headerActions:m})=>g(Ae,{sx:p=>({borderRadius:"var(--orb-r-container)",border:`1px solid ${p.palette.divider}`,overflow:"hidden",bgcolor:"var(--orb-surface)",boxShadow:"var(--orb-shadow-1)"}),children:[g("div",{sx:p=>({px:Mp,py:1.15,display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,bgcolor:"var(--orb-canvas)",borderBottom:r?"none":`1px solid ${p.palette.divider}`}),children:[g("div",{sx:{minWidth:0,flex:1},children:[f(A,{component:"div",sx:{fontSize:"0.92rem",fontWeight:700,color:"var(--orb-fg-strong)"},children:t}),f(A,{component:"div",sx:{fontSize:"0.75rem",fontWeight:400,color:"var(--orb-fg)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:o})]}),g("div",{sx:{display:"flex",alignItems:"center",gap:.75,flexShrink:0},children:[m,f(ae,{size:"small","aria-label":r?n:i,onClick:a,sx:p=>({border:`1px solid ${p.palette.divider}`,bgcolor:"var(--orb-canvas)",color:"var(--orb-primary)",width:24,height:24,padding:0,borderRadius:999,flexShrink:0,"&:hover":{bgcolor:"var(--orb-p50)",borderColor:"var(--orb-p200)"}}),children:f(Ln,{size:13,sx:{transition:"transform 220ms cubic-bezier(0.2, 0, 0, 1)",transform:r?"rotate(180deg)":"rotate(0deg)"}})})]})]}),f(Ur,{in:!r,timeout:260,easing:"cubic-bezier(0.2, 0, 0, 1)",unmountOnExit:d,children:f("div",{sx:[{px:Mp,py:{xs:1.2,md:1.6}},...Array.isArray(c)?c:c?[c]:[]],children:s})})]});var wi=({label:t,caption:o,onRemove:r,trailing:a,isDragging:n,dragRef:i,listeners:s,attributes:c,style:d})=>f(Ae,{ref:i,style:d,sx:{p:1,borderRadius:"var(--orb-r-container)",border:"1px solid",borderColor:"var(--orb-border)",bgcolor:"var(--orb-canvas)",boxShadow:"var(--orb-shadow-1)",touchAction:"none",opacity:n?0:1,transition:"border-color 140ms ease, background-color 140ms ease, transform 140ms ease","&:hover":{borderColor:"var(--orb-p200)",bgcolor:"var(--orb-p50)"}},children:g("div",{sx:{display:"flex",alignItems:"center",gap:.9},children:[f("div",{...c,...s,sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:"var(--orb-r)",bgcolor:"var(--orb-p50)",border:"1px solid var(--orb-p100)",cursor:"grab"},children:f(da,{size:13,subtle:true})}),g("div",{sx:{minWidth:0,flex:1,display:"flex",flexDirection:"column",gap:.15},children:[f(A,{component:"div",sx:{fontSize:"0.82rem",fontWeight:700,lineHeight:1.2,color:"var(--orb-fg-strong)"},children:t}),o&&f(A,{component:"div",sx:{fontSize:"0.72rem",fontWeight:400,color:"var(--orb-fg)",lineHeight:1.2},children:o})]}),a,r&&f(ae,{size:"small",onClick:m=>{m.stopPropagation(),r();},sx:{width:24,height:24,p:0},children:f(pr,{size:13})})]})}),qa=({id:t,label:o,caption:r,onRemove:a,trailing:n})=>{let{setNodeRef:i,attributes:s,listeners:c,transform:d,transition:m,isDragging:p}=useSortable({id:t}),f$1={transform:d?`translate3d(${d.x}px, ${d.y}px, 0)`:void 0,transition:m,zIndex:p?999:"auto"};return f(wi,{label:o,caption:r,onRemove:a,trailing:n,isDragging:p,dragRef:i,listeners:c,attributes:s,style:f$1})};var Ti={rows:f(rd,{size:16,sx:{color:"var(--orb-primary)"}}),columns:f(Xr,{size:16,sx:{color:"var(--orb-primary)"}}),filters:f(zc,{size:16,sx:{color:"var(--orb-primary)"}}),values:f(qr,{size:16,sx:{color:"var(--orb-accent)"}})},Dp=({isConfiguratorCollapsed:t,onToggleCollapse:o,availableFields:r,fieldMap:a,filterFields:n,columnFields:i,rowFields:s,valueFields:c,clearZone:d,removeFieldFromZone:m,getFilterSelectionSummary:p,renderDimensionFilterSelect:f$1,renderAggregationSelect:h,getAggregationLabel:u})=>{let{t:v}=ce(),y=[`${v("pivot.zone.rows")} ${s.length}`,`${v("pivot.zone.columns")} ${i.length}`,`${v("pivot.zone.filters")} ${n.length}`,`${v("pivot.zone.values")} ${c.length}`].join(" \xB7 ");return f(ua,{title:v("pivot.config.title"),subtitle:y,collapsed:t,onToggleCollapse:o,expandAriaLabel:v("pivot.collapse.ariaExpand"),collapseAriaLabel:v("pivot.collapse.ariaCollapse"),unmountOnExit:true,children:g("div",{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",lg:"260px 1fr"},gap:2},children:[f(pa,{zone:"palette",title:v("pivot.fieldList"),hint:v("pivot.availableDimensions"),itemCount:r.length,icon:f(da,{size:18,subtle:true}),children:g(ne,{spacing:.8,sx:{maxHeight:400,overflowY:"auto",pr:.5},children:[r.length===0&&f(A,{component:"div",sx:{fontSize:"0.74rem",fontWeight:400,color:"var(--orb-fg)",py:1},children:v("pivot.allFieldsInUse")}),r.map(g=>f(Rp,{id:`item|palette|${g.id}`,label:g.label,subtitle:g.type??"string"},g.id))]})}),g(ne,{spacing:2,children:[g("div",{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[f(pa,{zone:"filters",title:v("pivot.zone.filters"),hint:v("pivot.hint.filters"),icon:Ti.filters,itemCount:n.length,onClear:()=>d("filters"),children:f(SortableContext,{items:n.map(g=>`item|filters|${g}`),strategy:verticalListSortingStrategy,children:f(ne,{spacing:.7,children:n.map(g=>f(qa,{id:`item|filters|${g}`,label:a.get(g)?.label??g,caption:p(g),trailing:f$1(g),onRemove:()=>m("filters",g)},g))})})}),f(pa,{zone:"columns",title:v("pivot.zone.columns"),hint:v("pivot.hint.columns"),icon:Ti.columns,itemCount:i.length,onClear:()=>d("columns"),children:f(SortableContext,{items:i.map(g=>`item|columns|${g}`),strategy:verticalListSortingStrategy,children:f(ne,{spacing:.7,children:i.map(g=>f(qa,{id:`item|columns|${g}`,label:a.get(g)?.label??g,caption:`${a.get(g)?.type??"dimension"} \u2022 ${p(g)}`,trailing:f$1(g),onRemove:()=>m("columns",g)},g))})})})]}),g("div",{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[f(pa,{zone:"rows",title:v("pivot.zone.rows"),hint:v("pivot.hint.rows"),icon:Ti.rows,itemCount:s.length,onClear:()=>d("rows"),children:f(SortableContext,{items:s.map(g=>`item|rows|${g}`),strategy:verticalListSortingStrategy,children:f(ne,{spacing:.7,children:s.map(g=>f(qa,{id:`item|rows|${g}`,label:a.get(g)?.label??g,caption:`${a.get(g)?.type??"dimension"} \u2022 ${p(g)}`,trailing:f$1(g),onRemove:()=>m("rows",g)},g))})})}),f(pa,{zone:"values",title:v("pivot.zone.values"),hint:v("pivot.hint.values"),icon:Ti.values,itemCount:c.length,onClear:()=>d("values"),children:f(SortableContext,{items:c.map(g=>`item|values|${g.tokenId}`),strategy:verticalListSortingStrategy,children:f(ne,{spacing:.7,children:c.map(g=>{let C=a.get(g.fieldId)?.label??g.fieldId,b=`${u(g.aggregation)}(${C})`;return f(qa,{id:`item|values|${g.tokenId}`,label:C,caption:b,trailing:h(g),onRemove:()=>m("values",g.tokenId)},g.tokenId)})})})})]})]})]})})};var Ap=t=>t.toLocaleString(void 0,{maximumFractionDigits:1}),Np=({data:t,primaryLabel:o,secondaryLabel:r,formatPrimaryValue:a,formatSecondaryValue:n})=>{let i=ro();if(t.length===0)return null;let s=720,c=250,d={top:20,right:24,bottom:40,left:52},m=r?t.map(g=>g.primaryValue):t.map((g,C)=>C+1),p=r?t.map(g=>g.secondaryValue??0):t.map(g=>g.primaryValue),f$1=Math.max(...m,1),h=Math.max(...p,1),u=s-d.left-d.right,v=c-d.top-d.bottom,y=t.map((g,C)=>{let b=r?g.primaryValue:C+1,S=r?g.secondaryValue??0:g.primaryValue,k=d.left+b/f$1*u,x=c-d.bottom-S/h*v;return {...g,x:k,y:x,rawX:b,rawY:S}});return g("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[f("div",{sx:{overflowX:"auto"},children:g("div",{component:"svg",viewBox:`0 0 ${s} ${c}`,sx:{width:"100%",minWidth:s,height:c},children:[f("line",{x1:d.left,y1:c-d.bottom,x2:s-d.right,y2:c-d.bottom,stroke:Mo(i.palette.text.secondary,.35)}),f("line",{x1:d.left,y1:d.top,x2:d.left,y2:c-d.bottom,stroke:Mo(i.palette.text.secondary,.35)}),y.map(g$1=>g("g",{children:[f("circle",{cx:g$1.x,cy:g$1.y,r:7,fill:Mo(i.palette.primary.main,.18)}),f("circle",{cx:g$1.x,cy:g$1.y,r:4.5,fill:i.palette.primary.main,children:g("title",{children:[g$1.name,`
13
- `,r?`${o}: ${a(g$1.primaryValue)}`:`${o}: ${a(g$1.primaryValue)}`,r?`
14
- ${r}: ${(n??a)(g$1.secondaryValue??0)}`:""]})}),f("text",{x:g$1.x,y:Math.max(g$1.y-12,d.top+8),textAnchor:"middle",fontSize:"10",fill:i.palette.text.secondary,children:g$1.name})]},g$1.name)),f("text",{x:s/2,y:c-10,textAnchor:"middle",fontSize:"11",fill:i.palette.text.secondary,children:r?o:"Index"}),f("text",{x:16,y:c/2,textAnchor:"middle",transform:`rotate(-90 16 ${c/2})`,fontSize:"11",fill:i.palette.text.secondary,children:r??o}),f("text",{x:d.left,y:d.top-4,fontSize:"10",fill:i.palette.text.secondary,children:Ap(h)}),f("text",{x:s-d.right,y:c-d.bottom+16,textAnchor:"end",fontSize:"10",fill:i.palette.text.secondary,children:Ap(f$1)})]})}),f("div",{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",lg:"repeat(3, minmax(0, 1fr))"},gap:1},children:t.map(g$1=>g("div",{sx:C=>({borderRadius:"var(--orb-r-container)",px:1.25,py:1,border:`1px solid ${Mo(C.palette.divider,.7)}`,bgcolor:Mo(C.palette.background.default,.35)}),children:[f(A,{component:"div",sx:{fontSize:"0.78rem",fontWeight:700,color:"var(--orb-fg-strong)"},noWrap:true,title:g$1.name,children:g$1.name}),g(A,{component:"div",sx:{fontSize:"0.72rem",color:"var(--orb-fg)"},children:[o,": ",a(g$1.primaryValue)]}),r&&g(A,{component:"div",sx:{fontSize:"0.72rem",color:"var(--orb-fg)"},children:[r,": ",(n??a)(g$1.secondaryValue??0)]})]},g$1.name))})]})};var Hs=t=>Math.max(...t,1),Ep=({data:t,chartType:o,primaryLabel:r,secondaryLabel:a,formatPrimaryValue:n,formatSecondaryValue:i})=>{let s=ro(),c=s.palette.primary.main,d=s.palette.warning.main;if(t.length===0)return null;if(o==="bar-horizontal"){let b=Hs(t.flatMap(S=>[S.primaryValue,S.secondaryValue??0]));return f(ne,{spacing:1.1,children:t.map(S=>g("div",{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",md:"160px 1fr 128px"},gap:1.25,alignItems:"center"},children:[f(A,{component:"div",sx:{fontSize:"0.78rem",fontWeight:700,color:"var(--orb-fg-strong)"},noWrap:true,title:S.name,children:S.name}),g(ne,{spacing:.65,children:[f("div",{sx:{height:10,borderRadius:999,overflow:"hidden",bgcolor:Mo(s.palette.action.active,.08)},children:f("div",{sx:{width:`${S.primaryValue/b*100}%`,height:"100%",bgcolor:c}})}),a&&f("div",{sx:{height:8,borderRadius:999,overflow:"hidden",bgcolor:Mo(s.palette.action.active,.08)},children:f("div",{sx:{width:`${(S.secondaryValue??0)/b*100}%`,height:"100%",bgcolor:d}})})]}),g("div",{sx:{minWidth:0},children:[f(A,{component:"div",sx:{fontSize:"0.72rem",textAlign:{xs:"left",md:"right"},fontWeight:700,color:"var(--orb-fg-strong)"},children:n(S.primaryValue)}),a&&f(A,{component:"div",sx:{fontSize:"0.72rem",textAlign:{xs:"left",md:"right"},color:"var(--orb-fg)"},children:(i??n)(S.secondaryValue??0)})]})]},S.name))})}if(o==="bar-vertical"){let b=Hs(t.flatMap(k=>[k.primaryValue,k.secondaryValue??0])),S=a?92:76;return f("div",{sx:{overflowX:"auto",pb:.5},children:f("div",{sx:{minWidth:Math.max(620,t.length*S),display:"grid",gridTemplateColumns:`repeat(${t.length}, minmax(56px, 1fr))`,gap:1,alignItems:"end"},children:t.map(k=>g("div",{sx:{minWidth:0},children:[g("div",{sx:{height:210,display:"flex",alignItems:"flex-end",justifyContent:"center",gap:.8},children:[f("div",{sx:{width:a?16:26,minHeight:8,height:`${Math.max(k.primaryValue/b*188,8)}px`,borderRadius:"10px 10px 2px 2px",bgcolor:c},title:`${r}: ${n(k.primaryValue)}`}),a&&f("div",{sx:{width:16,minHeight:8,height:`${Math.max((k.secondaryValue??0)/b*188,8)}px`,borderRadius:"10px 10px 2px 2px",bgcolor:d},title:`${a}: ${(i??n)(k.secondaryValue??0)}`})]}),f(A,{component:"div",sx:{fontSize:"0.76rem",fontWeight:700,color:"var(--orb-fg-strong)"},noWrap:true,title:k.name,children:k.name}),f(A,{component:"div",sx:{fontSize:"0.7rem",color:"var(--orb-fg)"},noWrap:true,title:n(k.primaryValue),children:n(k.primaryValue)}),a&&f(A,{component:"div",sx:{fontSize:"0.7rem",color:"var(--orb-fg)"},noWrap:true,title:(i??n)(k.secondaryValue??0),children:(i??n)(k.secondaryValue??0)})]},k.name))})})}let m=Math.max(680,t.length*74),p=240,f$1={top:20,right:18,bottom:36,left:18},h=Hs(t.flatMap(b=>[b.primaryValue,b.secondaryValue??0])),u=m-f$1.left-f$1.right,v=p-f$1.top-f$1.bottom,y=b=>t.map((S,k)=>{let x=f$1.left+k*u/Math.max(t.length-1,1),E=p-f$1.bottom-b(S)/h*v;return {x,y:E,item:S}}),g$1=y(b=>b.primaryValue),C=a?y(b=>b.secondaryValue??0):[];return g("div",{sx:{display:"flex",flexDirection:"column",gap:1.1},children:[f("div",{sx:{overflowX:"auto"},children:g("div",{component:"svg",viewBox:`0 0 ${m} ${p}`,sx:{width:"100%",minWidth:m,height:p},children:[f("line",{x1:f$1.left,y1:p-f$1.bottom,x2:m-f$1.right,y2:p-f$1.bottom,stroke:Mo(s.palette.text.secondary,.35)}),f("polyline",{fill:"none",stroke:c,strokeWidth:3,points:g$1.map(b=>`${b.x},${b.y}`).join(" ")}),g$1.map(b=>f("circle",{cx:b.x,cy:b.y,r:4,fill:c,children:g("title",{children:[b.item.name,`
15
- `,r,": ",n(b.item.primaryValue)]})},`primary-${b.item.name}`)),a&&g(e,{children:[f("polyline",{fill:"none",stroke:d,strokeWidth:2.5,strokeDasharray:"5 5",points:C.map(b=>`${b.x},${b.y}`).join(" ")}),C.map(b=>f("circle",{cx:b.x,cy:b.y,r:3.5,fill:d,children:g("title",{children:[b.item.name,`
16
- `,a,": ",(i??n)(b.item.secondaryValue??0)]})},`secondary-${b.item.name}`))]})]})}),f("div",{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",xl:"repeat(4, minmax(0, 1fr))"},gap:1},children:t.map(b=>g("div",{sx:S=>({borderRadius:"var(--orb-r-container)",px:1.1,py:.9,border:`1px solid ${Mo(S.palette.divider,.7)}`,bgcolor:Mo(S.palette.background.default,.35)}),children:[f(A,{component:"div",sx:{fontSize:"0.76rem",fontWeight:700,color:"var(--orb-fg-strong)"},noWrap:true,title:b.name,children:b.name}),f(A,{component:"div",sx:{fontSize:"0.71rem",color:"var(--orb-fg)"},children:n(b.primaryValue)}),a&&f(A,{component:"div",sx:{fontSize:"0.71rem",color:"var(--orb-fg)"},children:(i??n)(b.secondaryValue??0)})]},b.name))})]})};var Lp=(t,o,r)=>{let a=new Set,n=[];return t.forEach(i=>{a.has(i)||(a.add(i),n.push({fieldId:i,label:r.get(i)?.label??i,zone:"rows"}));}),o.forEach(i=>{a.has(i)||(a.add(i),n.push({fieldId:i,label:r.get(i)?.label??i,zone:"columns"}));}),n},Fp=(t,o,r)=>t.map(a=>{let n=o.get(a.fieldId),i=n?.label??a.fieldId;return {fieldId:a.fieldId,label:`${r(a.aggregation)} \xB7 ${i}`,item:a,field:n}}),Bp=({rows:t,dimensionFieldId:o,primaryValue:r,secondaryValue:a})=>{if(!o)return [];let n=new Map;return t.forEach(i=>{let s=rr(i[o]),c=n.get(s);if(c){c.push(i);return}n.set(s,[i]);}),Array.from(n.entries()).sort((i,s)=>i[0].localeCompare(s[0],void 0,{sensitivity:"base"})).map(([i,s])=>({name:i,primaryValue:ca(s,r.fieldId,r.aggregation),secondaryValue:a?ca(s,a.fieldId,a.aggregation):void 0}))};var Op=({rows:t,fieldMap:o,rowFields:r,columnFields:a,valueFields:n,chartDimensionFieldId:i,chartPrimaryValueFieldId:s,chartSecondaryValueFieldId:c,chartType:d,isCollapsed:m,onChartDimensionFieldIdChange:p,onChartPrimaryValueFieldIdChange:f$1,onChartSecondaryValueFieldIdChange:h,onChartTypeChange:u,onToggleCollapse:v,getAggregationLabel:y})=>{let{t:g$1}=ce(),C=useMemo(()=>Lp(r,a,o),[a,o,r]),b=useMemo(()=>Fp(n,o,y),[o,y,n]),S=b.find(w=>w.fieldId===s)??b[0],k=b.find(w=>w.fieldId===c&&w.fieldId!==S?.fieldId)??null,x=C.find(w=>w.fieldId===i)??C[0],E=x&&S?g$1("pivot.chart.subtitleReady",{dimension:x.label,measure:k?`${S.label} / ${k.label}`:S.label}):g$1("pivot.chart.subtitle"),D=useMemo(()=>!x||!S?[]:Bp({rows:t,dimensionFieldId:x.fieldId,primaryValue:S.item,secondaryValue:k?.item}),[S,t,k,x]),T=w=>S?Ka(w,S.item,o):w.toLocaleString(),N=w=>k?Ka(w,k.item,o):w.toLocaleString(),R=C.length>1||b.length>1;return g(ua,{title:g$1("pivot.chart.title"),subtitle:E,collapsed:m,onToggleCollapse:v,expandAriaLabel:g$1("pivot.chart.collapse.ariaExpand"),collapseAriaLabel:g$1("pivot.chart.collapse.ariaCollapse"),bodySx:{display:"flex",flexDirection:"column",gap:1.1},children:[R&&g("div",{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",xl:"repeat(4, minmax(0, 1fr))"},gap:1,alignItems:"start"},children:[g(lr,{size:"small",sx:{minWidth:0,width:"100%"},children:[f(A,{component:"div",sx:{fontSize:"0.7rem",fontWeight:500,color:"var(--orb-fg)",mb:.45},children:g$1("pivot.chart.dimension")}),f(_t,{value:x?.fieldId??"",onChange:w=>p(String(w.target.value)),sx:{fontSize:"0.75rem",height:32},children:C.map(w=>f("option",{value:w.fieldId,sx:{fontSize:"0.75rem"},children:w.label},w.fieldId))})]}),g(lr,{size:"small",sx:{minWidth:0,width:"100%"},children:[f(A,{component:"div",sx:{fontSize:"0.7rem",fontWeight:500,color:"var(--orb-fg)",mb:.45},children:g$1("pivot.chart.primaryMeasure")}),f(_t,{value:S?.fieldId??"",onChange:w=>f$1(String(w.target.value)),sx:{fontSize:"0.75rem",height:32},children:b.map(w=>f("option",{value:w.fieldId,sx:{fontSize:"0.75rem"},children:w.label},w.fieldId))})]}),g(lr,{size:"small",sx:{minWidth:0,width:"100%"},children:[f(A,{component:"div",sx:{fontSize:"0.7rem",fontWeight:500,color:"var(--orb-fg)",mb:.45},children:g$1("pivot.chart.secondaryMeasure")}),g(_t,{value:k?.fieldId??"",onChange:w=>h(String(w.target.value)),sx:{fontSize:"0.75rem",height:32},children:[f("option",{value:"",sx:{fontSize:"0.75rem",color:"text.secondary"},children:g$1("common.none")}),b.filter(w=>w.fieldId!==S?.fieldId).map(w=>f("option",{value:w.fieldId,sx:{fontSize:"0.75rem"},children:w.label},w.fieldId))]})]}),g(lr,{size:"small",sx:{minWidth:0,width:"100%"},children:[f(A,{component:"div",sx:{fontSize:"0.7rem",fontWeight:500,color:"var(--orb-fg)",mb:.45},children:g$1("pivot.chart.chartType")}),g(_t,{value:d,onChange:w=>u(w.target.value),sx:{fontSize:"0.75rem",height:32},children:[f("option",{value:"bar-vertical",sx:{fontSize:"0.75rem"},children:g$1("pivot.chart.style.barVertical")}),f("option",{value:"bar-horizontal",sx:{fontSize:"0.75rem"},children:g$1("pivot.chart.style.barHorizontal")}),f("option",{value:"line",sx:{fontSize:"0.75rem"},children:g$1("pivot.chart.style.line")}),f("option",{value:"scatter",sx:{fontSize:"0.75rem"},children:g$1("pivot.chart.style.scatter")})]})]})]}),f("div",{children:x?S?D.length===0?f("div",{sx:{py:5,textAlign:"center"},children:f(A,{component:"div",sx:{fontSize:"0.86rem",fontWeight:400,color:"var(--orb-fg)"},children:g$1("pivot.chart.emptyNoData")})}):d==="scatter"?f(Np,{data:D,primaryLabel:S.label,secondaryLabel:k?.label,formatPrimaryValue:T,formatSecondaryValue:N}):f(Ep,{data:D,chartType:d,primaryLabel:S.label,secondaryLabel:k?.label,formatPrimaryValue:T,formatSecondaryValue:N}):f("div",{sx:{py:5,textAlign:"center"},children:f(A,{component:"div",sx:{fontSize:"0.86rem",fontWeight:400,color:"var(--orb-fg)"},children:g$1("pivot.chart.emptyNoValue")})}):f("div",{sx:{py:5,textAlign:"center"},children:f(A,{component:"div",sx:{fontSize:"0.86rem",fontWeight:400,color:"var(--orb-fg)"},children:g$1("pivot.chart.emptyNoDimension")})})})]})};var Ii=({node:t,dataColumns:o,fieldMap:r,level:a,expandedKeys:n,onToggle:i,getValue:s})=>{let c=n.has(t.key),d=t.children.length>0,m=t.isGrandTotal,p=d&&!c&&!m,f$1=m?800:p?700:d?600:500,h=m?800:p?600:500;return g(e,{children:[g("tr",{sx:{bgcolor:m?b()==="dark"?"color-mix(in oklch, var(--orb-primary) 22%, transparent)":"color-mix(in oklch, var(--orb-primary) 8%, transparent)":b()==="dark"?"var(--orb-surface)":"background.paper","&:hover":{bgcolor:m?b()==="dark"?"color-mix(in oklch, var(--orb-primary) 28%, transparent)":"color-mix(in oklch, var(--orb-primary) 12%, transparent)":"var(--orb-hover)"}},children:[g("td",{style:{fontWeight:f$1},sx:u=>({fontSize:"0.76rem",borderBottom:`1px solid ${u.palette.divider}`,whiteSpace:"nowrap",pl:a*2+1,display:"flex",alignItems:"center",height:40}),children:[d&&!m&&f(ae,{size:"small",onClick:()=>i(t.key),sx:{width:22,height:22,p:0,mr:.35,ml:-0.8},children:c?f(Bo,{size:12}):f(ur,{size:12})}),!d&&!m&&a>0&&f("div",{sx:{width:18}}),t.value]}),o.map(u=>f("td",{align:"right",style:{fontWeight:h},sx:{fontSize:"0.76rem",borderBottom:v=>`1px solid ${v.palette.divider}`,whiteSpace:"nowrap"},children:Ka(s?s(t,u.id):t.aggregatedValues[u.id]??0,u.valueItem,r)},`${t.key}-${u.id}`))]}),c&&t.children.map(u=>f(Ii,{node:u,dataColumns:o,fieldMap:r,level:a+1,expandedKeys:n,onToggle:i,getValue:s},u.key))]})};var $s=(t,o,r)=>{let a=[...t,...o];return r&&a.includes(r)?r:a[0]??""},Mi=(t,o)=>o&&t.some(r=>r.fieldId===o)?o:t[0]?.fieldId??"",Gs=(t,o,r)=>r===""?"":r&&r!==o&&t.some(a=>a.fieldId===r)?r:t.find(a=>a.fieldId!==o)?.fieldId??"",Vp=t=>{let o=new Set,r=a=>{a.forEach(n=>{n.children.length>0&&(o.add(n.key),r(n.children));});};return r(t),o},Hp=(t,o,r=0)=>t.length===0?r:t.reduce((a,n)=>n.children.length===0||!o.has(n.key)?Math.max(a,r+1):Math.max(a,Hp(n.children,o,r+1)),r),_h=(t,o)=>{let r=[],a=n=>{n.forEach(i=>{if(i.children.length>0&&o.has(i.key)){a(i.children);return}r.push(i);});};return a(t),r},NA=({title:t,rows:o,fields:r,initialLayout:a,initialChart:n,emptyText:i,maxPreviewHeight:s=520,initialChartCollapsed:c=false,initialTableCollapsed:d=false,model:m,enablePresetManagement:p=false,presets:f$1,defaultPresets:h,onPresetsChange:u,initialPresetId:v,onPresetApplied:y})=>{let{t:g$1}=ce(),C=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:8}})),b$1=useRef(0),S=useRef(false),k=t??g$1("pivot.title.default"),x=i??g$1("pivot.empty"),E=useMemo(()=>({sum:g$1("pivot.agg.sum"),count:g$1("pivot.agg.count"),avg:g$1("pivot.agg.avg"),min:g$1("pivot.agg.min"),max:g$1("pivot.agg.max")}),[g$1]),D=useCallback(P=>E[P]??yp[P],[E]),T=useMemo(()=>new Set(r.map(P=>P.id)),[r]),N=useMemo(()=>new Map(r.map(P=>[P.id,P])),[r]),[R,w]=useState(()=>ao(a?.rows,T)),[M,I]=useState(()=>ao(a?.columns,T)),[L,O]=useState(()=>ao(a?.filters,T)),[U,z]=useState(()=>{let P=a?.values??[],$=new Set,G=[];return P.forEach(le=>{if(!T.has(le.fieldId)||$.has(le.fieldId))return;$.add(le.fieldId),b$1.current+=1;let Fe=N.get(le.fieldId);G.push({tokenId:`v${b$1.current}`,fieldId:le.fieldId,aggregation:go(le.aggregation,Fe)});}),G}),[K,W]=useState({}),[q,H]=useState(true),[V,Z]=useState(false),[j,me]=useState(()=>$s(ao(a?.rows,T),ao(a?.columns,T),n?.dimensionFieldId)),[ie,ge]=useState(()=>{let P=(a?.values??[]).filter(($,G,le)=>T.has($.fieldId)&&le.findIndex(Fe=>Fe.fieldId===$.fieldId)===G).map($=>({tokenId:$.fieldId,fieldId:$.fieldId,aggregation:go($.aggregation,N.get($.fieldId))}));return Mi(P,n?.primaryValueFieldId)}),[ye,Ue]=useState(()=>{let P=(a?.values??[]).filter((G,le,Fe)=>T.has(G.fieldId)&&Fe.findIndex(ot=>ot.fieldId===G.fieldId)===le).map(G=>({tokenId:G.fieldId,fieldId:G.fieldId,aggregation:go(G.aggregation,N.get(G.fieldId))})),$=Mi(P,n?.primaryValueFieldId);return Gs(P,$,n?.secondaryValueFieldId)}),[Oe,Ie]=useState(n?.chartType??"bar-vertical"),[ze,Re]=useState(c),[Ce,Ve]=useState(d),[at,gt]=useState(()=>h??[]),[Je,te]=useState(""),[We,Ne]=useState(false),[Ee,st]=useState(""),[Ze,ht]=useState(null),[xt,Nt]=useState(new Set(["__grand_total__"])),[Et,ee]=useState(new Set),tt=m?.rowFields??R,Le=m?.columnFields??M,se=m?.filterFields??L,ue=m?.valueFields??U,Q=m?.filterSelections??K,we=m?.showGrandTotal??q,ke=m?.isConfiguratorCollapsed??V,Xe=m?.chartDimensionFieldId??j,dt=m?.chartPrimaryValueFieldId??ie,lt=m?.chartSecondaryValueFieldId??ye,Lt=m?.chartType??Oe,$t=m?.isChartCollapsed??ze,bt=m?.isTableCollapsed??Ce,ft=f$1??at,vo=p||ft.length>0||!!u,Pt=useCallback(P=>{if(m?.setRowFields){m.setRowFields(P);return}w(P);},[m]),Ft=useCallback(P=>{if(m?.setColumnFields){m.setColumnFields(P);return}I(P);},[m]),ct=useCallback(P=>{if(m?.setFilterFields){m.setFilterFields(P);return}O(P);},[m]),Bt=useCallback(P=>{if(m?.setValueFields){m.setValueFields(P);return}z(P);},[m]),xe=useCallback(P=>{if(m?.setFilterSelections){m.setFilterSelections(P);return}W(P);},[m]),B=useCallback(P=>{if(m?.setShowGrandTotal){m.setShowGrandTotal(P);return}H(P);},[m]),_=useCallback(P=>{if(m?.setIsConfiguratorCollapsed){m.setIsConfiguratorCollapsed(P);return}Z(P);},[m]),J=useCallback(P=>{if(m?.setChartDimensionFieldId){m.setChartDimensionFieldId(P);return}me(P);},[m]),Te=useCallback(P=>{if(m?.setChartPrimaryValueFieldId){m.setChartPrimaryValueFieldId(P);return}ge(P);},[m]),fe=useCallback(P=>{if(m?.setChartSecondaryValueFieldId){m.setChartSecondaryValueFieldId(P);return}Ue(P);},[m]),Me=useCallback(P=>{if(m?.setChartType){m.setChartType(P);return}Ie(P);},[m]),$e=useCallback(P=>{if(m?.setIsChartCollapsed){m.setIsChartCollapsed(P);return}Re(P);},[m]),Qe=useCallback(P=>{if(m?.setIsTableCollapsed){m.setIsTableCollapsed(P);return}Ve(P);},[m]),Ge=useCallback(P=>{let $=typeof P=="function"?P(ft):P;f$1||gt($),u?.($);},[u,ft,f$1]),vt=useMemo(()=>new Set([...tt,...Le,...se]),[tt,Le,se]),Dt=useMemo(()=>r.filter(P=>!vt.has(P.id)),[r,vt]),St=useMemo(()=>{let P=[...tt,...Le,...se],$=new Set,G=[];return P.forEach(le=>{$.has(le)||($.add(le),G.push(le));}),G},[Le,se,tt]);useEffect(()=>{Pt(P=>{let $=P.filter(G=>T.has(G));return ar(P,$)?P:$}),Ft(P=>{let $=P.filter(G=>T.has(G));return ar(P,$)?P:$}),ct(P=>{let $=P.filter(G=>T.has(G));return ar(P,$)?P:$}),Bt(P=>{let $=P.filter(G=>T.has(G.fieldId)).map(G=>({...G,aggregation:go(G.aggregation,N.get(G.fieldId))}));return Si(P,$)?P:$});},[N,T]);let yt=useMemo(()=>{let P={};return St.forEach($=>{let G=new Set;o.forEach(le=>{G.add(rr(le[$]));}),P[$]=Array.from(G).sort((le,Fe)=>le.localeCompare(Fe));}),P},[St,o]);useEffect(()=>{xe(P=>{let $={};return St.forEach(G=>{let le=yt[G]??[],ot=(P[G]??[]).filter(oe=>le.includes(oe)),He=Object.prototype.hasOwnProperty.call(P,G);$[G]=He?ot:le;}),Pp(P,$)?P:$});},[St,yt]),useEffect(()=>{J(P=>$s(tt,Le,P));},[Le,tt,J]),useEffect(()=>{Te(P=>Mi(ue,P));},[Te,ue]),useEffect(()=>{fe(P=>Gs(ue,dt,P));},[dt,fe,ue]);let F=useMemo(()=>o.filter(P=>St.every($=>{let G=Q[$]??[],le=yt[$]??[];if(G.length===le.length)return true;if(G.length===0)return false;let Fe=rr(P[$]);return G.includes(Fe)})),[St,yt,Q,o]),X=useMemo(()=>{if(ue.length===0)return null;let P=new Map;if(F.forEach(He=>{let oe=Le.length>0?Le.map(Y=>rr(He[Y])):[g$1("pivot.valueLabel")],de=Nr(oe);P.set(de,oe);}),P.size===0){let He=Le.length>0?Le.map(()=>Ci):[g$1("pivot.valueLabel")];P.set(Nr(He),He);}let $=Array.from(P.entries()).sort((He,oe)=>kp(He[1],oe[1])),G=$.flatMap(([He,oe])=>ue.map(de=>{let Y=N.get(de.fieldId),De=`${D(de.aggregation)} ${Y?.label??de.fieldId}`,Ye=Le.length===0||ue.length>1?`${oe.join(" / ")} \u2022 ${De}`:oe.join(" / ");return {id:`${He}::${de.tokenId}`,colKey:He,valueItem:de,label:Ye}})),le=[];Le.length>0&&$.forEach(([He,oe])=>{let de=G.filter(Ye=>Ye.colKey===He),Y=le,De=[];oe.forEach((Ye,Pe)=>{De.push(`d${Pe}:${Ye}`);let qe=`col::${Nr(De)}`,It=Y.find(Hr=>Hr.key===qe);It||(It={key:qe,label:Ye,children:[],leafColumnIds:[],path:oe.slice(0,Pe+1),depth:Pe},Y.push(It)),de.forEach(Hr=>{It.leafColumnIds.includes(Hr.id)||It.leafColumnIds.push(Hr.id);}),Y=It.children;});});let Fe=He=>{let oe={};return G.forEach(de=>{let Y=He.filter(De=>{let Ye=Le.length>0?Le.map(Pe=>rr(De[Pe])):[g$1("pivot.valueLabel")];return Nr(Ye)===de.colKey});oe[de.id]=ca(Y,de.valueItem.fieldId,de.valueItem.aggregation);}),oe},ot=[];if(tt.length===0)ot.push({key:"root",value:g$1("pivot.resultLabel")||bp,children:[],isLeaf:true,aggregatedValues:Fe(F),path:[],depth:0});else {let He=(oe,de,Y)=>{if(de>=tt.length)return [];let De=tt[de],Ye=new Map;return oe.forEach(Pe=>{let qe=rr(Pe[De]);Ye.has(qe)||Ye.set(qe,[]),Ye.get(qe).push(Pe);}),Array.from(Ye.keys()).sort().map(Pe=>{let qe=Ye.get(Pe),It=[...Y,Pe];return {key:Nr(It),value:Pe,fieldId:De,aggregatedValues:Fe(qe),children:He(qe,de+1,It),isLeaf:de===tt.length-1,path:It,depth:de}})};ot.push(...He(F,0,[]));}return {dataColumns:G,columnTree:le,rowTree:ot}},[Le,N,F,D,tt,g$1,ue]),pe=useCallback((P,$)=>(b$1.current+=1,{tokenId:`v${b$1.current}`,fieldId:P,aggregation:go($,N.get(P))}),[N]),ve=useCallback(P=>{if(P==="rows")return Pt([]);if(P==="columns")return Ft([]);if(P==="filters")return ct([]);Bt([]);},[]),je=useCallback((P,$)=>{if(P==="rows")return Pt(G=>G.filter(le=>le!==$));if(P==="columns")return Ft(G=>G.filter(le=>le!==$));if(P==="filters")return ct(G=>G.filter(le=>le!==$));Bt(G=>G.filter(le=>le.tokenId!==$));},[]),Ke=useCallback((P,$)=>{Bt(G=>G.map(le=>le.tokenId===P?{...le,aggregation:go($,N.get(le.fieldId))}:le));},[N]),Tt=useCallback(P=>{ht(String(P.active.id));},[]),mt=useCallback(P=>{if(ht(null),!P.over)return;let $=xi(String(P.active.id)),G=xi(String(P.over.id));if(!$||!G||$.kind!=="item"||!$.key)return;if($.zone===G.zone&&G.kind==="item"){if($.zone==="rows"){let Pe=tt.indexOf($.key),qe=tt.indexOf(G.key??"");Pe!==-1&&qe!==-1&&Pe!==qe&&Pt(It=>arrayMove(It,Pe,qe));return}if($.zone==="columns"){let Pe=Le.indexOf($.key),qe=Le.indexOf(G.key??"");Pe!==-1&&qe!==-1&&Pe!==qe&&Ft(It=>arrayMove(It,Pe,qe));return}if($.zone==="filters"){let Pe=se.indexOf($.key),qe=se.indexOf(G.key??"");Pe!==-1&&qe!==-1&&Pe!==qe&&ct(It=>arrayMove(It,Pe,qe));return}if($.zone==="values"){let Pe=ue.findIndex(It=>It.tokenId===$.key),qe=ue.findIndex(It=>It.tokenId===(G.key??""));Pe!==-1&&qe!==-1&&Pe!==qe&&Bt(It=>arrayMove(It,Pe,qe));}return}let le=G.zone,Fe=[...tt],ot=[...Le],He=[...se],oe=[...ue],de="",Y=null;if($.zone==="palette")de=$.key;else if($.zone==="values"){let Pe=oe.find(qe=>qe.tokenId===$.key);if(!Pe)return;de=Pe.fieldId,Y=Pe,oe=oe.filter(qe=>qe.tokenId!==$.key);}else $.zone==="rows"?(de=$.key,Fe=Fe.filter(Pe=>Pe!==de)):$.zone==="columns"?(de=$.key,ot=ot.filter(Pe=>Pe!==de)):$.zone==="filters"&&(de=$.key,He=He.filter(Pe=>Pe!==de));if(!de)return;let De=()=>{Fe=Fe.filter(Pe=>Pe!==de),ot=ot.filter(Pe=>Pe!==de),He=He.filter(Pe=>Pe!==de);},Ye=Pe=>{if(G.kind!=="item"||!G.key)return Pe==="rows"?Fe.length:Pe==="columns"?ot.length:Pe==="filters"?He.length:Pe==="values"?oe.length:0;if(Pe==="rows"){let qe=Fe.indexOf(G.key);return qe>=0?qe:Fe.length}if(Pe==="columns"){let qe=ot.indexOf(G.key);return qe>=0?qe:ot.length}if(Pe==="filters"){let qe=He.indexOf(G.key);return qe>=0?qe:He.length}if(Pe==="values"){let qe=oe.findIndex(It=>It.tokenId===G.key);return qe>=0?qe:oe.length}return 0};if(le==="palette"){Pt(Fe),Ft(ot),ct(He),Bt(oe);return}if(le==="values"){let Pe=Ye("values"),qe=Y??pe(de);oe.splice(Pe,0,qe),Pt(Fe),Ft(ot),ct(He),Bt(oe);return}if(wp(le)){De();let Pe=Ye(le);le==="rows"?Fe.splice(Pe,0,de):le==="columns"?ot.splice(Pe,0,de):He.splice(Pe,0,de),Pt(Fe),Ft(ot),ct(He),Bt(oe);}},[Le,pe,se,tt,ue]),pt=useCallback((P,$)=>{xe(G=>({...G,[P]:$}));},[]),wt=useCallback(P=>{Nt($=>{let G=new Set($);return G.has(P)?G.delete(P):G.add(P),G});},[]),Jt=useCallback(P=>{ee($=>{let G=new Set($);return G.has(P)?G.delete(P):G.add(P),G});},[]),Ot=useCallback(P=>{let $=N.get(P.fieldId),G=zs($);return f(lr,{size:"small",sx:{minWidth:98},children:f(_t,{value:P.aggregation,onChange:le=>Ke(P.tokenId,le.target.value),onClick:le=>le.stopPropagation(),onMouseDown:le=>le.stopPropagation(),sx:{fontSize:"0.72rem",height:26,"& select.orb-inp":{py:.35}},children:G.map(le=>f("option",{value:le,sx:{fontSize:"0.75rem"},children:D(le)},le))})})},[N,D,Ke]),Kt=useCallback(P=>{let $=yt[P]??[],G=Q[P]??$;return $.length===0?g$1("pivot.filter.noValues"):G.length===0?g$1("pivot.filter.noneSelected"):G.length===$.length?g$1("pivot.filter.allValues"):g$1("pivot.filter.selectedCount",{selected:G.length,total:$.length})},[yt,Q,g$1]),Vt=useCallback(P=>{let $=yt[P]??[],G=Q[P]??$;return f(Ip,{options:$,selectedValues:G,onChange:le=>pt(P,le)})},[yt,Q,pt]),Gt=useCallback(()=>`pivot-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,[]),Ht=useCallback(()=>{let P={};return new Set([...St,...Object.keys(Q)]).forEach(G=>{if(!T.has(G))return;let le=Q[G]??[];P[G]=[...le];}),{layout:{rows:[...tt],columns:[...Le],filters:[...se],values:ue.map(G=>({fieldId:G.fieldId,aggregation:G.aggregation}))},filterSelections:P,showGrandTotal:we,chart:{dimensionFieldId:Xe,primaryValueFieldId:dt,secondaryValueFieldId:lt,chartType:Lt}}},[St,Xe,dt,lt,Lt,Le,se,Q,tt,we,T,ue]),Qt=useCallback(P=>{let $=ao(P.layout.rows,T),G=ao(P.layout.columns,T),le=ao(P.layout.filters,T),Fe=new Set,ot=(P.layout.values??[]).filter(de=>!T.has(de.fieldId)||Fe.has(de.fieldId)?false:(Fe.add(de.fieldId),true)).map(de=>pe(de.fieldId,de.aggregation)),He={};Object.entries(P.filterSelections??{}).forEach(([de,Y])=>{!T.has(de)||!Array.isArray(Y)||(He[de]=Array.from(new Set(Y.map(De=>String(De)))));}),Pt($),Ft(G),ct(le),Bt(ot),xe(He),typeof P.showGrandTotal=="boolean"&&B(P.showGrandTotal),J($s($,G,P.chart?.dimensionFieldId));let oe=Mi(ot,P.chart?.primaryValueFieldId);Te(oe),fe(Gs(ot,oe,P.chart?.secondaryValueFieldId)),Me(P.chart?.chartType??"bar-vertical"),te(P.id),y?.(P);},[pe,y,J,Te,fe,Me,Ft,ct,xe,Pt,B,Bt,T]),eo=useCallback(P=>{if(!P){te("");return}let $=ft.find(G=>G.id===P);if(!$){te("");return}Qt($);},[Qt,ft]),po=useCallback(()=>{let P=g$1("pivot.preset.defaultName",{index:ft.length+1});st(P),Ne(true);},[ft.length,g$1]),ko=useCallback(()=>{let P=Ee.trim();if(!P)return;let $={id:Gt(),name:P,...Ht()};Ge(G=>[...G,$]),te($.id),Ne(false);},[Ht,Gt,Ee,Ge]),Po=useCallback(()=>{Je&&(Ge(P=>P.filter($=>$.id!==Je)),te(""));},[Je,Ge]);useEffect(()=>{if(!v||S.current)return;let P=ft.find($=>$.id===v);P&&(S.current=true,Qt(P));},[Qt,v,ft]),useEffect(()=>{Je&&(ft.some(P=>P.id===Je)||te(""));},[Je,ft]);let Qo=useMemo(()=>{if(!we||!X||!tt.length)return null;let P={};return X.dataColumns.forEach($=>{let G=F.filter(le=>{let Fe=Le.length>0?Le.map(ot=>rr(le[ot])):[g$1("pivot.valueLabel")];return Nr(Fe)===$.colKey});P[$.id]=ca(G,$.valueItem.fieldId,$.valueItem.aggregation);}),{key:"__grand_total__",value:g$1("pivot.grandTotal")||vp,children:[],isLeaf:false,isGrandTotal:true,aggregatedValues:P,path:[],depth:-1}},[we,X,F,Le,tt.length,g$1]),fo=useMemo(()=>Vp(X?.rowTree??[]),[X]),No=useMemo(()=>Vp(X?.columnTree??[]),[X]);useEffect(()=>{Nt(P=>{let $=new Set;return P.has("__grand_total__")&&$.add("__grand_total__"),fo.forEach(G=>{P.has(G)&&$.add(G);}),$});},[fo]),useEffect(()=>{ee(P=>{let $=new Set;return No.forEach(G=>{P.has(G)&&$.add(G);}),$});},[No]);let Fr=useCallback(()=>{Nt(P=>{let $=new Set(P);return fo.forEach(G=>$.add(G)),$});},[fo]),Br=useCallback(()=>{Nt(P=>{let $=new Set;return P.has("__grand_total__")&&$.add("__grand_total__"),$});},[]),Sr=useCallback(()=>{ee(new Set(No));},[No]),Or=useCallback(()=>{ee(new Set);},[]),zr=useMemo(()=>!X||Le.length===0?[]:_h(X.columnTree,Et),[Le.length,Et,X]),To=useMemo(()=>{if(!X)return [];if(Le.length===0)return X.dataColumns.map($=>({id:$.id,label:$.label,leafColumnIds:[$.id],valueItem:$.valueItem}));let P=new Map(X.dataColumns.map($=>[$.id,$]));return zr.flatMap($=>{let G=new Map;return $.leafColumnIds.forEach(le=>{let Fe=P.get(le);if(!Fe)return;let ot=Fe.valueItem.tokenId,He=`${D(Fe.valueItem.aggregation)} ${N.get(Fe.valueItem.fieldId)?.label??Fe.valueItem.fieldId}`,oe=G.get(ot);if(oe){oe.leafColumnIds.push(le);return}G.set(ot,{id:`${$.key}::${ot}`,label:ue.length>1?He:$.label,leafColumnIds:[le],valueItem:Fe.valueItem});}),Array.from(G.values())})},[Le.length,N,D,X,ue.length,zr]),wr=useMemo(()=>new Map(To.map(P=>[P.id,P])),[To]),Vr=useMemo(()=>To.map(P=>({id:P.id,colKey:P.id,valueItem:P.valueItem,label:P.label})),[To]),Wo=useMemo(()=>{if(!X||Le.length===0)return [];let P=[],$=Hp(X.columnTree,Et),G=$+(ue.length>1?1:0),le=(Fe,ot)=>{P[ot]??(P[ot]=[]),Fe.forEach(He=>{let oe=He.children.length>0&&Et.has(He.key),de=To.filter(De=>He.leafColumnIds.some(Ye=>De.leafColumnIds.includes(Ye))).length,Y=oe||ue.length>1?1:G-ot;P[ot].push({key:He.key,label:He.label,colSpan:de,rowSpan:Y,expandable:He.children.length>0,expanded:oe}),oe&&le(He.children,ot+1);});};return le(X.columnTree,0),ue.length>1&&(P[$]=To.map(Fe=>({key:Fe.id,label:Fe.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))),P},[Le.length,Et,X,ue.length,To]),jo=useCallback((P,$)=>$.leafColumnIds.reduce((G,le)=>G+(P.aggregatedValues[le]??0),0),[]),ha=useMemo(()=>g(e,{children:[f(be,{size:"small",variant:"text",onClick:Fr,disabled:fo.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g$1("pivot.table.expandRowsAll")}),f(be,{size:"small",variant:"text",onClick:Br,disabled:fo.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g$1("pivot.table.collapseRowsAll")}),f(At,{orientation:"vertical",flexItem:true}),f(be,{size:"small",variant:"text",onClick:Sr,disabled:No.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g$1("pivot.table.expandColumnsAll")}),f(be,{size:"small",variant:"text",onClick:Or,disabled:Le.length===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g$1("pivot.table.collapseColumnsAll")})]}),[Le.length,No.size,fo.size,Or,Br,Sr,Fr,g$1]),kr=()=>{if(!Ze)return null;let P=xi(Ze);if(!P||P.kind!=="item"||!P.key)return null;if(P.zone==="palette"){let Fe=N.get(P.key);return Fe?f(Vs,{label:Fe.label,subtitle:Fe.type}):null}if(P.zone==="values"){let Fe=ue.find(de=>de.tokenId===P.key);if(!Fe)return null;let He=N.get(Fe.fieldId)?.label??Fe.fieldId,oe=`${D(Fe.aggregation)}(${He})`;return f(wi,{label:He,caption:oe})}let G=N.get(P.key)?.label??P.key,le=Kt(P.key);return f(wi,{label:G,caption:le})};return g(Ae,{sx:P=>({p:{xs:1.2,md:2},borderRadius:"var(--orb-r-container)",border:`1px solid ${P.palette.divider}`,bgcolor:"var(--orb-canvas)",boxShadow:"var(--orb-shadow-2)",display:"flex",flexDirection:"column",gap:2.25}),children:[g("div",{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1.5,flexWrap:"wrap"},children:[g("div",{sx:{minWidth:0,display:"flex",flexDirection:"column",gap:.35},children:[f(A,{component:"div",sx:{fontSize:"1.08rem",fontWeight:700,lineHeight:1.25,color:"var(--orb-fg-strong)"},children:k}),f(A,{component:"div",sx:{fontSize:"0.8rem",fontWeight:400,color:"var(--orb-fg)"},children:g$1("pivot.subtitle.default")})]}),g(ne,{direction:"row",spacing:1.5,alignItems:"center",children:[vo&&g(e,{children:[f(lr,{size:"small",sx:{minWidth:200},children:g(_t,{value:Je,displayEmpty:true,onChange:P=>eo(String(P.target.value)),sx:{fontSize:"0.75rem",height:32},children:[f("option",{value:"",sx:{fontSize:"0.75rem",color:"text.secondary"},children:g$1("pivot.preset.selectPlaceholder")}),ft.map(P=>f("option",{value:P.id,sx:{fontSize:"0.75rem"},children:P.name},P.id))]})}),f(nt,{title:g$1("pivot.preset.save"),children:f(ae,{size:"small",onClick:po,"aria-label":g$1("pivot.preset.save"),sx:{width:28,height:28,p:0},children:f(mr,{size:15})})}),f(nt,{title:g$1("pivot.preset.delete"),children:f("span",{children:f(ae,{size:"small",onClick:Po,disabled:!Je,"aria-label":g$1("pivot.preset.delete"),sx:{width:28,height:28,p:0},children:f(En,{size:15})})})}),f(At,{flexItem:true,orientation:"vertical"})]}),g(A,{component:"div",sx:{fontSize:"0.75rem",fontWeight:400,color:"var(--orb-fg)"},children:[g$1("pivot.records"),": ",f("strong",{children:o.length.toLocaleString()})," / ",g$1("pivot.afterFilter"),":"," ",f("strong",{children:F.length.toLocaleString()})]}),f(At,{flexItem:true,orientation:"vertical"}),g("div",{sx:{display:"flex",alignItems:"center",gap:.6},children:[f(A,{component:"div",sx:{fontSize:"0.75rem",fontWeight:500,color:"var(--orb-fg-strong)"},children:g$1("pivot.grandTotal")}),f(Mn,{size:"small",checked:we,onChange:P=>B(P.target.checked)})]})]})]}),f(At,{}),g(DndContext,{sensors:C,collisionDetection:closestCenter,onDragStart:Tt,onDragEnd:mt,children:[f(Dp,{isConfiguratorCollapsed:ke,onToggleCollapse:()=>_(P=>!P),availableFields:Dt,fieldMap:N,filterFields:se,columnFields:Le,rowFields:tt,valueFields:ue,clearZone:ve,removeFieldFromZone:je,getFilterSelectionSummary:Kt,renderDimensionFilterSelect:Vt,renderAggregationSelect:Ot,getAggregationLabel:D}),f(fc,{children:f(DragOverlay,{dropAnimation:{duration:250,easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)"},children:kr()})})]}),f(Op,{rows:F,fieldMap:N,rowFields:tt,columnFields:Le,valueFields:ue,chartDimensionFieldId:Xe,chartPrimaryValueFieldId:dt,chartSecondaryValueFieldId:lt,chartType:Lt,isCollapsed:$t,onChartDimensionFieldIdChange:P=>J(P),onChartPrimaryValueFieldIdChange:P=>Te(P),onChartSecondaryValueFieldIdChange:P=>fe(P),onChartTypeChange:P=>Me(P),onToggleCollapse:()=>$e(P=>!P),getAggregationLabel:D}),f(ua,{title:g$1("pivot.table.sectionTitle"),subtitle:tt.length>0?tt.map(P=>N.get(P)?.label??P).join(" > "):g$1("pivot.table.dimensions"),collapsed:bt,onToggleCollapse:()=>Qe(P=>!P),expandAriaLabel:g$1("pivot.table.collapse.ariaExpand"),collapseAriaLabel:g$1("pivot.table.collapse.ariaCollapse"),bodySx:{p:0},headerActions:ha,children:X===null?f("div",{sx:{py:5,px:{xs:1.2,md:1.6},textAlign:"center"},children:f(A,{component:"div",sx:{fontSize:"0.86rem",fontWeight:400,color:"var(--orb-fg)"},children:x})}):f("div",{sx:{maxHeight:s},children:g("table",{className:"orb-tbl",size:"small",stickyHeader:true,children:[f("thead",{children:(Wo.length>0?Wo:[[]]).map((P,$)=>g("tr",{children:[$===0&&f("td",{rowSpan:Math.max(Wo.length,1),sx:G=>({fontWeight:800,fontSize:"0.76rem",color:"text.primary",bgcolor:b()==="dark"?"var(--orb-canvas)":"var(--orb-surface)",borderBottom:`1px solid ${G.palette.divider}`,pl:2,minWidth:220,verticalAlign:"middle"}),children:tt.length>0?tt.map(G=>N.get(G)?.label).join(" > "):g$1("pivot.table.dimensions")}),(P.length>0?P:To.map(G=>({key:G.id,label:G.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))).map(G=>f("td",{align:"center",colSpan:G.colSpan,rowSpan:G.rowSpan,sx:le=>({fontWeight:800,fontSize:"0.75rem",color:"text.primary",bgcolor:b()==="dark"?"var(--orb-canvas)":"var(--orb-surface)",borderBottom:`1px solid ${le.palette.divider}`,minWidth:148,verticalAlign:"middle"}),children:g("div",{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:.4},children:[G.expandable&&f(ae,{size:"small",onClick:()=>Jt(G.key),sx:{width:22,height:22,p:0,ml:-0.2},children:G.expanded?f(Bo,{size:12}):f(ur,{size:12})}),f("div",{component:"span",children:G.label})]})},G.key))]},`pivot-header-row-${$}`))}),g("tbody",{children:[X.rowTree.map(P=>f(Ii,{node:P,dataColumns:Vr,fieldMap:N,level:0,expandedKeys:xt,onToggle:wt,getValue:($,G)=>{let le=wr.get(G);return le?jo($,le):0}},P.key)),Qo&&f(Ii,{node:Qo,dataColumns:Vr,fieldMap:N,level:0,expandedKeys:xt,onToggle:wt,getValue:(P,$)=>{let G=wr.get($);return G?jo(P,G):0}})]})]})})}),g(zt,{open:We,onClose:()=>Ne(false),maxWidth:"xs",fullWidth:true,children:[f("div",{className:"orb-dialog-title",children:g$1("pivot.preset.saveDialogTitle")}),f("div",{className:"orb-dialog-content",children:f(Be,{autoFocus:true,fullWidth:true,margin:"dense",label:g$1("pivot.preset.nameLabel"),value:Ee,onChange:P=>st(P.target.value),onKeyDown:P=>{P.key==="Enter"&&(P.preventDefault(),ko());}})}),g("div",{className:"orb-dialog-actions",children:[f(be,{onClick:()=>Ne(false),children:g$1("common.cancel")}),f(be,{variant:"contained",onClick:ko,disabled:!Ee.trim(),children:g$1("common.save")})]})]})]})};var Wp=(t,o,r)=>{let a=[...t,...o];return r&&a.includes(r)?r:a[0]??""},Us=(t,o)=>o&&t.some(r=>r.fieldId===o)?o:t[0]?.fieldId??"",$p=(t,o,r)=>r===""?"":r&&r!==o&&t.some(a=>a.fieldId===r)?r:t.find(a=>a.fieldId!==o)?.fieldId??"",OA=({fields:t,initialLayout:o,initialFilterSelections:r={},initialShowGrandTotal:a=true,initialConfiguratorCollapsed:n=false,initialChart:i,initialChartCollapsed:s=false,initialTableCollapsed:c=false})=>{let d=useRef(0),m=useMemo(()=>new Set(t.map(te=>te.id)),[t]),p=useMemo(()=>new Map(t.map(te=>[te.id,te])),[t]),[f,h]=useState(()=>ao(o?.rows,m)),[u,v]=useState(()=>ao(o?.columns,m)),[y,g]=useState(()=>ao(o?.filters,m)),[C,b]=useState(()=>{let te=o?.values??[],We=new Set,Ne=[];return te.forEach(Ee=>{!m.has(Ee.fieldId)||We.has(Ee.fieldId)||(We.add(Ee.fieldId),d.current+=1,Ne.push({tokenId:`v${d.current}`,fieldId:Ee.fieldId,aggregation:go(Ee.aggregation,p.get(Ee.fieldId))}));}),Ne}),[S,k]=useState(r),[x,E]=useState(a),[D,T]=useState(n),[N,R]=useState(()=>Wp(ao(o?.rows,m),ao(o?.columns,m),i?.dimensionFieldId)),[w,M]=useState(()=>{let te=(()=>{let We=o?.values??[],Ne=new Set,Ee=[];return We.forEach(st=>{!m.has(st.fieldId)||Ne.has(st.fieldId)||(Ne.add(st.fieldId),Ee.push({tokenId:st.fieldId,fieldId:st.fieldId,aggregation:go(st.aggregation,p.get(st.fieldId))}));}),Ee})();return Us(te,i?.primaryValueFieldId)}),[I,L]=useState(()=>{let te=(()=>{let Ne=o?.values??[],Ee=new Set,st=[];return Ne.forEach(Ze=>{!m.has(Ze.fieldId)||Ee.has(Ze.fieldId)||(Ee.add(Ze.fieldId),st.push({tokenId:Ze.fieldId,fieldId:Ze.fieldId,aggregation:go(Ze.aggregation,p.get(Ze.fieldId))}));}),st})(),We=Us(te,i?.primaryValueFieldId);return $p(te,We,i?.secondaryValueFieldId)}),[O,U]=useState(i?.chartType??"bar-vertical"),[z,K]=useState(s),[W,q]=useState(c);useEffect(()=>{h(te=>{let We=te.filter(Ne=>m.has(Ne));return ar(te,We)?te:We}),v(te=>{let We=te.filter(Ne=>m.has(Ne));return ar(te,We)?te:We}),g(te=>{let We=te.filter(Ne=>m.has(Ne));return ar(te,We)?te:We}),b(te=>{let We=te.filter(Ne=>m.has(Ne.fieldId)).map(Ne=>({...Ne,aggregation:go(Ne.aggregation,p.get(Ne.fieldId))}));return Si(te,We)?te:We});},[p,m]),useEffect(()=>{R(te=>Wp(f,u,te));},[u,f]),useEffect(()=>{M(te=>Us(C,te));},[C]),useEffect(()=>{L(te=>$p(C,w,te));},[w,C]);let H=useCallback(te=>{h(ao(te,m));},[m]),V=useCallback(te=>{v(ao(te,m));},[m]),Z=useCallback(te=>{g(ao(te,m));},[m]),j=useCallback(te=>{b(We=>{let Ne=te??[],Ee=new Set,st=[];return Ne.forEach(Ze=>{if(!m.has(Ze.fieldId)||Ee.has(Ze.fieldId))return;Ee.add(Ze.fieldId);let ht=We.find(xt=>xt.fieldId===Ze.fieldId);if(ht){st.push({...ht,aggregation:go(Ze.aggregation??ht.aggregation,p.get(Ze.fieldId))});return}d.current+=1,st.push({tokenId:`v${d.current}`,fieldId:Ze.fieldId,aggregation:go(Ze.aggregation,p.get(Ze.fieldId))});}),st});},[p,m]),me=useCallback(te=>{H(te.rows??[]),V(te.columns??[]),Z(te.filters??[]),j(te.values??[]);},[V,Z,H,j]),ie=useCallback(te=>{if(te==="rows")return h([]);if(te==="columns")return v([]);if(te==="filters")return g([]);b([]);},[]),ge=useCallback((te,We)=>{if(te==="rows")return h(Ne=>Ne.filter(Ee=>Ee!==We));if(te==="columns")return v(Ne=>Ne.filter(Ee=>Ee!==We));if(te==="filters")return g(Ne=>Ne.filter(Ee=>Ee!==We));b(Ne=>Ne.filter(Ee=>Ee.tokenId!==We));},[]),ye=useCallback((te,We)=>{b(Ne=>Ne.map(Ee=>Ee.tokenId===te?{...Ee,aggregation:go(We,p.get(Ee.fieldId))}:Ee));},[p]),Ue=useCallback((te,We)=>{k(Ne=>({...Ne,[te]:We}));},[]),Oe=useCallback(()=>{k({});},[]),Ie=useCallback(()=>{E(te=>!te);},[]),ze=useCallback(()=>{T(te=>!te);},[]),Re=useCallback(te=>{R(te);},[]),Ce=useCallback(te=>{M(te);},[]),Ve=useCallback(te=>{L(te);},[]),at=useCallback(()=>{K(te=>!te);},[]),gt=useCallback(()=>{q(te=>!te);},[]);return {model:useMemo(()=>({rowFields:f,setRowFields:h,columnFields:u,setColumnFields:v,filterFields:y,setFilterFields:g,valueFields:C,setValueFields:b,filterSelections:S,setFilterSelections:k,showGrandTotal:x,setShowGrandTotal:E,isConfiguratorCollapsed:D,setIsConfiguratorCollapsed:T,chartDimensionFieldId:N,setChartDimensionFieldId:R,chartPrimaryValueFieldId:w,setChartPrimaryValueFieldId:M,chartSecondaryValueFieldId:I,setChartSecondaryValueFieldId:L,chartType:O,setChartType:U,isChartCollapsed:z,setIsChartCollapsed:K,isTableCollapsed:W,setIsTableCollapsed:q}),[N,w,I,O,u,y,S,z,D,W,f,x,C]),actions:{setRows:H,setColumns:V,setFilters:Z,setValues:j,setLayout:me,clearZone:ie,removeFieldFromZone:ge,setAggregationForValue:ye,setFilterSelection:Ue,resetFilterSelections:Oe,toggleGrandTotal:Ie,toggleConfigurator:ze,setChartDimension:Re,setChartPrimaryValue:Ce,setChartSecondaryValue:Ve,setChartType:U,toggleChart:at,toggleTable:gt}}};var WA=({orientation:t="auto",defaultNavigationOpen:o,onNavOpenChange:r}={})=>{let a=ro(),n=cr("(orientation: portrait)"),i=cr(a.breakpoints.down("md")),s=useMemo(()=>t==="auto"?n||i?"portrait":"landscape":t,[i,n,t]),[c,d]=useState(o??s==="landscape");useEffect(()=>{d(o??s==="landscape");},[o,s]);let m=f=>{d(f),r?.(f);};return {resolvedOrientation:s,isPortraitViewport:n,isCompactViewport:i,navigationOpen:c,setNavigationOpen:m,toggleNavigationOpen:()=>m(!c)}};var Zh=t=>{let o=Number(t||0);return Number.isFinite(o)?o:0},_A=({rows:t,rowKey:o="id",numericField:r,defaultSelectedId:a})=>{let i=t[0]?.[o],[s,c]=useState(a??i),d=useMemo(()=>t.find(u=>u[o]===s)||t[0],[o,t,s]),[m,p]=useState(()=>{let u=d?.[r];return u==null?"0":String(u)});return {selectedId:s,selectedRecord:d,editorValue:m,setEditorValue:p,selectRecord:u=>{let v=u[o];c(v);let y=u[r];p(y==null?"0":String(y));},applyEditorValue:u=>{if(s===void 0)return;let v=Zh(m),y=t.map(g=>g[o]===s?{...g,[r]:v}:g);u(y);}}};var Qh=["code_128","ean_13","ean_8","qr_code","upc_a","upc_e"],_p=(t,o,r,a)=>{o?.(t),a&&r?.();},ZA=({open:t,onClose:o,title:r="Scan barcode",subtitle:a="Use the rear camera on the device. If scanning is unavailable, enter the code manually.",formats:n=Qh,facingMode:i="environment",manualEntry:s=true,autoCloseOnDetect:c=true,scanIntervalMs:d=600,confirmLabel:m="Use code",cancelLabel:p="Close",manualPlaceholder:f$1="Enter barcode manually",onDetected:h,onError:u,sx:v})=>{let y=Yt__default.useRef(null),g$1=Yt__default.useRef(null),C=Yt__default.useRef(null),b$1=Yt__default.useRef(null),[S,k]=Yt__default.useState("idle"),[x,E]=Yt__default.useState(""),[D,T]=Yt__default.useState(null),[N,R]=Yt__default.useState(null),w=Yt__default.useCallback(()=>{C.current!==null&&(window.clearInterval(C.current),C.current=null),g$1.current&&(g$1.current.getTracks().forEach(L=>L.stop()),g$1.current=null),y.current&&(y.current.srcObject=null);},[]),M=Yt__default.useCallback(L=>{R(L),k("error"),u?.(L);},[u]);Yt__default.useEffect(()=>{if(!t){w(),k("idle"),R(null),E("");return}let L=false;return (async()=>{if(!(typeof window>"u"||typeof navigator>"u")){if(!navigator.mediaDevices?.getUserMedia){k("unsupported"),R("Camera access is not supported in this browser.");return}k("starting"),R(null);try{let U=await navigator.mediaDevices.getUserMedia({audio:!1,video:{facingMode:{ideal:i}}});if(L){U.getTracks().forEach(z=>z.stop());return}if(g$1.current=U,y.current&&(y.current.srcObject=U,await y.current.play()),!window.BarcodeDetector){k("unsupported"),R("BarcodeDetector is not available. Camera preview is ready and manual entry is enabled.");return}b$1.current=new window.BarcodeDetector({formats:n}),k("ready"),C.current=window.setInterval(async()=>{if(!(!y.current||!b$1.current)&&!(y.current.readyState<HTMLMediaElement.HAVE_CURRENT_DATA))try{let K=(await b$1.current.detect(y.current)).find(q=>q.rawValue);if(!K?.rawValue)return;let W={rawValue:K.rawValue,format:K.format};T(W),w(),_p(W,h,o,c);}catch(z){M(z instanceof Error?z.message:"Failed to detect barcode.");}},d);}catch(U){M(U instanceof Error?U.message:"Unable to start camera.");}}})(),()=>{L=true,w();}},[c,i,n,o,h,t,M,d,w]);let I=()=>{let L=x.trim();if(!L)return;let O={rawValue:L,format:"manual"};T(O),_p(O,h,o,c);};return g(zt,{open:t,onClose:o,fullWidth:true,maxWidth:"sm",children:[f("div",{className:"orb-dialog-title",sx:{fontSize:"1rem",fontWeight:900},children:r}),f("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:g(ne,{spacing:2,sx:v,children:[f(A,{sx:{fontSize:"0.88rem",color:"text.secondary",lineHeight:1.55},children:a}),g(Ae,{elevation:0,sx:{position:"relative",overflow:"hidden",borderRadius:4,border:"1px solid",borderColor:"divider",minHeight:280,background:b()==="dark"?"linear-gradient(180deg, color-mix(in oklch, var(--orb-canvas) 92%, transparent), color-mix(in oklch, var(--orb-canvas) 96%, transparent))":"linear-gradient(180deg, var(--orb-surface), color-mix(in oklch, var(--orb-border) 92%, transparent))"},children:[f("video",{ref:y,muted:true,playsInline:true,autoPlay:true,style:{width:"100%",height:280,objectFit:"cover",display:"block"}}),f("div",{sx:{pointerEvents:"none",position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center"},children:f("div",{sx:{width:"72%",maxWidth:320,aspectRatio:"1.7 / 1",borderRadius:3,border:"2px solid rgba(255,255,255,0.95)",boxShadow:"0 0 0 999px rgba(15,23,42,0.24)",position:"relative"},children:f("div",{sx:{position:"absolute",top:"50%",left:0,right:0,height:2,bgcolor:"var(--orb-ai-accent)",boxShadow:"0 0 18px color-mix(in oklch, var(--orb-ai-accent) 85%, transparent)"}})})}),g("div",{sx:{position:"absolute",top:12,left:12,display:"flex",gap:1,flexWrap:"wrap"},children:[f(kt,{icon:f(Rc,{}),label:S==="ready"?"Camera ready":S==="starting"?"Starting camera":S==="unsupported"?"Preview only":S==="error"?"Scanner error":"Idle",size:"small",color:S==="error"?"error":"primary",variant:"filled"}),D?f(kt,{icon:f(Xc,{}),label:`${D.format||"barcode"}: ${D.rawValue}`,size:"small",color:"success",variant:"filled"}):null]})]}),N?f(Uo,{severity:S==="unsupported"?"info":"warning",children:N}):null,s?g(ne,{direction:{xs:"column",sm:"row"},spacing:1.25,children:[f(Be,{fullWidth:true,label:"Barcode",placeholder:f$1,value:x,onChange:L=>E(L.target.value)}),f(be,{variant:"contained",onClick:I,sx:{minHeight:56,px:2.5},children:m})]}):null]})}),f("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:f(be,{onClick:o,children:p})})]})};var jh={default:"var(--orb-status-fg)",primary:"var(--orb-status-primary)",success:"var(--orb-status-success)",warning:"var(--orb-status-warning)",error:"var(--orb-status-error)",info:"var(--orb-status-info)"},rN=({title:t,description:o,kicker:r,icon:a,badges:n=[],metrics:i=[],footer:s,children:c,selected:d=false,draggable:m=false,isDragging:p=false,swipeThreshold:f$1=88,startAction:h,endAction:u,dragHandleProps:v,onClick:y,onSwipe:g$1,sx:C})=>{let[b$1,S]=useState(0),[k,x]=useState(false),E=useRef(null),D=useRef(0),T=useRef(0),N=!!(h||u),R=132,w=()=>{S(0),x(false),E.current=null,D.current=0,T.current=0;},M=z=>{(z==="start"?h:u)?.onTrigger?.(),g$1?.(z),w();},I=z=>{!N||z.target.closest('button, a, input, textarea, [data-no-swipe="true"]')||(E.current=z.pointerId,D.current=z.clientX,T.current=z.clientX,x(true),z.currentTarget.setPointerCapture(z.pointerId));},L=z=>{if(!k||E.current!==z.pointerId)return;T.current=z.clientX;let K=T.current-D.current,W=Math.max(-R,Math.min(R,K));S(W);},O=z=>{if(!k||E.current!==z.pointerId)return;let K=T.current-D.current;if(K>=f$1&&h){M("start");return}if(K<=-f$1&&u){M("end");return}Math.abs(K)<12&&y?.(),w();},U=(z,K)=>{if(!z)return null;let W=z.backgroundColor||jh[z.tone||"default"];return f("div",{sx:{position:"absolute",top:0,bottom:0,[K]:0,width:R,px:2,display:"flex",alignItems:"center",justifyContent:K==="left"?"flex-start":"flex-end",color:"var(--orb-on-primary)",background:`linear-gradient(135deg, ${W}, rgba(15,23,42,0.92))`},children:g(ne,{direction:"row",spacing:1,alignItems:"center",children:[z.icon,f(A,{sx:{fontWeight:700,fontSize:"0.95rem"},children:z.label})]})})};return g("div",{sx:{position:"relative",overflow:"hidden",borderRadius:4,...C},children:[U(h,"left"),U(u,"right"),f(Ae,{elevation:0,onPointerDown:I,onPointerMove:L,onPointerUp:O,onPointerCancel:w,sx:{position:"relative",zIndex:1,p:2,borderRadius:4,border:"1px solid",borderColor:d?"primary.main":"divider",background:b()==="dark"?"linear-gradient(180deg, color-mix(in oklch, var(--orb-surface-3) 96%, transparent), color-mix(in oklch, var(--orb-canvas) 92%, transparent))":"linear-gradient(180deg, var(--orb-canvas), var(--orb-surface))",color:"text.primary",boxShadow:d?"0 18px 42px color-mix(in oklch, var(--orb-primary) 18%, transparent)":"0 12px 28px rgba(15, 23, 42, 0.08)",transform:`translate3d(${b$1}px, 0, 0) scale(${p?.985:1})`,transition:k?"none":"transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease",touchAction:"pan-y",cursor:y?"pointer":"default",opacity:p?.9:1},children:g(ne,{spacing:1.5,children:[g(ne,{direction:"row",spacing:1.5,alignItems:"flex-start",children:[a?f("div",{sx:{mt:.25},children:a}):null,g("div",{sx:{flex:1,minWidth:0},children:[r?f(A,{sx:{fontSize:"0.72rem",fontWeight:700,letterSpacing:"0.08em",color:"text.secondary"},children:r}):null,f(A,{sx:{fontSize:"1.05rem",fontWeight:800,lineHeight:1.25},children:t}),o?f(A,{sx:{mt:.5,fontSize:"0.9rem",color:"text.secondary",lineHeight:1.45},children:o}):null]}),m?f("div",{"data-no-swipe":"true",...v,sx:{alignSelf:"center",display:"inline-flex",touchAction:"none"},children:f(ae,{size:"small",children:f(Bc,{})})}):null]}),n.length>0?f(ne,{direction:"row",spacing:1,useFlexGap:true,flexWrap:"wrap",children:n.map((z,K)=>f(kt,{label:z,size:"small",sx:{borderRadius:999,fontWeight:700,bgcolor:"action.hover",color:"text.primary"}},K))}):null,i.length>0?f("div",{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(110px, 1fr))",gap:1},children:i.map(z=>g(Ae,{elevation:0,sx:{p:1.25,borderRadius:3,bgcolor:"action.hover",border:"1px solid",borderColor:"divider",color:"text.primary"},children:[f(A,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:z.label}),f(A,{sx:{fontSize:"1rem",fontWeight:800,lineHeight:1.2},children:z.value})]},z.id))}):null,c,s]})})]})};var Xa=({label:t,onPress:o,emphasis:r="default"})=>f("div",{component:"button",type:"button",onClick:o,sx:a=>({minHeight:72,borderRadius:3,border:"1px solid",borderColor:r==="primary"?"primary.main":"divider",background:r==="primary"?a.palette.primary.main:r==="danger"?b()==="dark"?"color-mix(in oklch, var(--orb-status-error) 18%, transparent)":"color-mix(in oklch, var(--orb-status-error) 10%, transparent)":b()==="dark"?"rgba(255,255,255,0.04)":"var(--orb-canvas)",color:r==="primary"?"var(--orb-on-primary)":"text.primary",fontSize:"1.25rem",fontWeight:800,transition:"transform 120ms ease, box-shadow 160ms ease, background-color 160ms ease",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent","&:active":{transform:"scale(0.98)"}}),children:t}),pN=({value:t,defaultValue:o="",title:r,subtitle:a,placeholder:n="0",allowDecimal:i=false,allowNegative:s=false,maxLength:c,confirmLabel:d,clearLabel:m,backspaceLabel:p,onChange:f$1,onSubmit:h,onClose:u,sx:v})=>{let{t:y}=ce(),[g$1,C]=useState(o),b=t??g$1,S=w=>{t===void 0&&C(w),f$1?.(w);},k=w=>{c&&b.length>=c||S(`${b}${w}`);},x=w=>{if(w==="00"){if(!b){S("0");return}k("00");return}k(w);},E=()=>{!i||b.includes(".")||S(b?`${b}.`:"0.");},D=()=>{if(s){if(b.startsWith("-")){S(b.slice(1));return}S(b?`-${b}`:"-");}},T=()=>{S(b.slice(0,-1));},N=()=>{S("");},R=()=>{h?.(b);};return f(Ae,{elevation:0,sx:{p:2,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",...v},children:g(ne,{spacing:2,children:[g(ne,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[g("div",{sx:{minWidth:0},children:[r?f(A,{sx:{fontSize:"1rem",fontWeight:800},children:r}):null,a?f(A,{sx:{mt:.5,fontSize:"0.86rem",color:"text.secondary"},children:a}):null]}),u?f(ae,{onClick:u,size:"small",children:f(Lc,{})}):null]}),f(Ae,{elevation:0,sx:{p:2,borderRadius:3,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:f(A,{sx:{minHeight:38,fontSize:b?"1.9rem":"1.25rem",fontWeight:900,letterSpacing:"0.06em",color:b?"text.primary":"text.disabled"},children:b||n})}),g("div",{sx:{display:"grid",gridTemplateColumns:"repeat(3, minmax(0, 1fr))",gap:1.25},children:[["1","2","3","4","5","6","7","8","9"].map(w=>f(Xa,{label:w,onPress:()=>x(w)},w)),f(Xa,{label:s?"+/-":"00",onPress:s?D:()=>x("00")}),f(Xa,{label:"0",onPress:()=>x("0")}),f(Xa,{label:i?".":p?String(p):"DEL",onPress:i?E:T})]}),g("div",{sx:{display:"grid",gridTemplateColumns:"repeat(3, minmax(0, 1fr))",gap:1.25},children:[f("div",{component:"button",type:"button",onClick:T,sx:{minHeight:64,borderRadius:3,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent"},children:g(ne,{direction:"row",spacing:1,justifyContent:"center",alignItems:"center",children:[f(Ic,{}),f(A,{sx:{fontWeight:700},children:p||"DEL"})]})}),f(Xa,{label:String(m||"CLR"),onPress:N,emphasis:"danger"}),f("div",{component:"button",type:"button",onClick:R,sx:w=>({minHeight:64,borderRadius:3,border:"1px solid",borderColor:"primary.main",background:w.palette.primary.main,color:"var(--orb-on-primary)",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent"}),children:g(ne,{direction:"row",spacing:1,justifyContent:"center",alignItems:"center",children:[f(Dc,{}),f(A,{sx:{fontWeight:800},children:d||y("common.ok")})]})})]})]})})};var Kp=({touchMode:t="comfortable",sx:o,...r})=>{let a=t==="expanded";return f("div",{sx:{"& .orb-card":{borderRadius:4},"& .orb-autocomplete":{minWidth:{xs:"100%",md:260}},"& .orb-autocomplete .orb-inp-adornment-wrap, & .orb-inp":{backgroundColor:"transparent !important"},"& .orb-inp-adornment-wrap, & .orb-inp":{minHeight:a?56:50,borderRadius:3,fontSize:a?"0.98rem":"0.92rem"},"& .orb-inp":{py:a?1.6:1.25,fontSize:a?"0.98rem":"0.92rem"},"& label":{fontSize:a?"0.95rem":"0.88rem"},"& .orb-btn":{minHeight:a?48:44,px:a?2.25:1.75,borderRadius:3,fontSize:a?"0.95rem":"0.88rem",fontWeight:700},"& .orb-icon-btn":{width:a?40:36,height:a?40:36},"& .orb-menu-item, & option":{minHeight:a?44:38,fontSize:a?"0.95rem":"0.88rem"},"& .orb-list-subheader":{py:1},"& .orb-chk":{p:a?1:.75},"& .orb-form-control-label > span":{fontSize:a?"0.95rem":"0.88rem"},"& .orb-dialog":{borderRadius:4},"& .orb-dialog-title":{fontSize:a?"1.05rem":"0.98rem",fontWeight:800},"& .orb-dialog-content .orb-inp-adornment-wrap, & .orb-inp":{minHeight:52},"& .orb-grid > *":{minWidth:0},...o},children:f(Oo,{...r})})};var rb=(t,o,r)=>{if(r?.(o),!!o.href){if(o.href.startsWith("http://")||o.href.startsWith("https://")){window.open(o.href,"_blank");return}t.push(o.href);}},qp=({items:t,selectedId:o,orientation:r="auto",onItemSelect:a,sx:n})=>{let i=ro(),[s,c]=useState(false);useEffect(()=>{c(true);},[]);let d=cr("(orientation: portrait)"),m=cr(i.breakpoints.down("md")),p=r==="auto"?d||m?"portrait":"landscape":r,f$1=useRouter();return f("div",{sx:{display:"grid",gridTemplateColumns:!s||p==="portrait"?"repeat(2, minmax(0, 1fr))":"repeat(auto-fit, minmax(180px, 1fr))",gap:1.5,...n},children:t.map(h=>{let u=h.id===o,v=h.color||(u?i.palette.primary.main:i.palette.divider);return f(Ae,{elevation:0,sx:{overflow:"hidden",borderRadius:4,border:"1px solid",borderColor:u?"primary.main":"divider",boxShadow:u?"0 18px 40px color-mix(in oklch, var(--orb-primary) 16%, transparent)":"none",bgcolor:b()==="dark"?"color-mix(in oklch, var(--orb-surface-3) 60%, transparent)":"background.paper"},children:f("div",{component:"button",type:"button",disabled:h.disabled,onClick:()=>rb(f$1,h,a),sx:{width:"100%",p:2,minHeight:p==="portrait"?156:148,display:"block",border:0,background:"transparent",textAlign:"left",cursor:h.disabled?"not-allowed":"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent",color:"text.primary"},children:g(ne,{spacing:1.5,sx:{height:"100%"},children:[g(ne,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[f("div",{sx:{width:44,height:44,borderRadius:3,display:"grid",placeItems:"center",color:u?"var(--orb-on-primary)":"text.primary",background:u?v:"action.hover"},children:h.icon||f(A,{sx:{fontSize:"1rem",fontWeight:900},children:h.title.slice(0,1).toUpperCase()})}),h.badge!==void 0?f("div",{sx:{minWidth:34,px:1,py:.4,borderRadius:999,bgcolor:u?"primary.main":"action.hover",color:u?"var(--orb-on-primary)":"text.secondary",textAlign:"center",fontWeight:800,fontSize:"0.8rem"},children:h.badge}):null]}),g("div",{sx:{flex:1,minWidth:0},children:[f(A,{sx:{fontSize:"1rem",fontWeight:800,lineHeight:1.25},children:h.title}),h.caption?f(A,{sx:{mt:.5,fontSize:"0.74rem",fontWeight:700,color:"text.secondary"},children:h.caption}):null,h.description?f(A,{sx:{mt:.75,fontSize:"0.84rem",lineHeight:1.45,color:"text.secondary"},children:h.description}):null]})]})})},h.id)})})};var Zp=(t,o)=>o.trim()?t.reduce((r,a)=>{let n=a.title?.toLowerCase().includes(o.toLowerCase())||a.label?.toLowerCase().includes(o.toLowerCase())||a.description?.toLowerCase().includes(o.toLowerCase()),i=a.children?Zp(a.children,o):[];return (n||i.length>0)&&r.push({...a,children:i.length>0?i:a.children}),r},[]):t,sb=t=>{let o=new Set,r=a=>{a.forEach(n=>{n.children?.length&&(o.add(n.id),r(n.children));});};return r(t),o},Qp=({collapsed:t=false,onToggle:o,className:r="",maxHeight:a,menuData:n=[],colorMode:i="light",orientation:s="auto",headerSlot:c,footerSlot:d,activeHref:m,onItemSelect:p})=>{let{t:f$1}=ce(),h=ro(),u=Io("(orientation: portrait)"),v=Io(h.breakpoints.down("md")),y=s==="auto"?u||v?"portrait":"landscape":s,g$1=i==="dark",C=useRouter(),b=usePathname(),[S,k]=useState(""),[x,E]=useState(new Set),D=useMemo(()=>Zp(n,S),[n,S]),T=useMemo(()=>S.trim()?sb(D):x,[x,D,S]);useEffect(()=>{t&&E(new Set);},[t]);let N=L=>L.appurl||L.href||"",R=L=>{p?.(L);let O=N(L);if(O){if(O.startsWith("http://")||O.startsWith("https://")){window.open(O,"_blank");return}C.push(O);}},w=L=>{let O=!!L.children?.length;if(t&&O){o?.();return}if(O){E(U=>{let z=new Set(U);return z.has(L.id)?z.delete(L.id):z.add(L.id),z});return}R(L);},M=L=>{let O=m||b,U=N(L);return !!(U&&O===U)},I=(L,O=0)=>{let U=!!L.children?.length,z=T.has(L.id),K=M(L);return f("div",{sx:{pl:O===0?0:1.5},children:g(Ae,{elevation:0,sx:{mb:1,overflow:"hidden",borderRadius:3,border:"1px solid",borderColor:K?"primary.main":"divider",bgcolor:K?"action.selected":"background.paper"},children:[g("div",{component:"button",type:"button",onClick:()=>w(L),sx:{width:"100%",px:1.5,py:1.4,display:"flex",alignItems:"center",gap:1.25,border:0,background:"transparent",textAlign:"left",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent"},children:[f(In,{variant:"rounded",sx:{width:40,height:40,bgcolor:K?"primary.main":"action.hover",color:K?"var(--orb-on-primary)":"text.primary"},children:L.icon||(L.title||L.label||"?").slice(0,1).toUpperCase()}),g("div",{sx:{flex:1,minWidth:0},children:[f(A,{sx:{fontSize:"0.95rem",fontWeight:800,lineHeight:1.2},children:L.title||L.label}),L.description?f(A,{sx:{mt:.4,fontSize:"0.78rem",color:"text.secondary",lineHeight:1.35},children:L.description}):null]}),U?f(Kr,{sx:{transform:z?"rotate(180deg)":"rotate(0deg)",transition:"transform 180ms ease"}}):f(An,{color:"action"})]}),U?f(Ur,{in:z,children:f("div",{sx:{px:1.25,pb:1.25},children:L.children?.map(W=>I(W,O+1))})}):null]})},L.id)};return t?f(Ae,{elevation:0,className:r,sx:{width:y==="portrait"?"100%":88,p:1,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:g$1?"var(--orb-surface)":"color-mix(in oklch, var(--orb-canvas) 88%, transparent)",maxHeight:a?`${a}px`:void 0,overflowY:"auto"},children:g(ne,{spacing:1,children:[f(ae,{onClick:o,sx:{width:48,height:48,alignSelf:"center",bgcolor:"action.hover"},title:f$1("navigation.expand"),children:f(On,{})}),n.map(L=>f(ae,{onClick:()=>w(L),sx:{width:56,height:56,alignSelf:"center",borderRadius:3,bgcolor:M(L)?"primary.main":"action.hover",color:M(L)?"var(--orb-on-primary)":"text.primary"},children:L.icon||(L.title||L.label||"?").slice(0,1).toUpperCase()},L.id))]})}):f(Ae,{elevation:0,className:r,sx:{width:y==="portrait"?"100%":320,p:1.25,borderRadius:5,border:"1px solid",borderColor:"divider",bgcolor:g$1?"var(--orb-surface)":"color-mix(in oklch, var(--orb-canvas) 88%, transparent)",maxHeight:a?`${a}px`:void 0,overflow:"hidden",display:"flex",flexDirection:"column"},children:g(ne,{spacing:1.25,sx:{flex:1,minHeight:0},children:[g(ne,{direction:"row",spacing:1,alignItems:"center",children:[f(Be,{value:S,onChange:L=>k(L.target.value),placeholder:f$1("navigation.searchPlaceholder"),size:"small",fullWidth:true,InputProps:{startAdornment:f(Yc,{fontSize:"small",color:"action"})}}),y==="landscape"&&!t?f(ae,{onClick:o,sx:{bgcolor:"action.hover"},children:f(_c,{})}):null]}),c,f("div",{sx:{flex:1,minHeight:0,overflowY:"auto",pr:.25},children:D.length>0?D.map(L=>I(L)):f(A,{sx:{p:2,fontSize:"0.88rem",color:"text.secondary",textAlign:"center"},children:f$1("navigation.noMatch")})}),d]})})};var jp=(t,o)=>{let r=o[t.id];if(t.render)return t.render(r,o);if(r==null||r==="")return "--";if(t.numeric){if(typeof r=="number")return r.toLocaleString();if(typeof r=="string"&&r.trim()!==""&&!Number.isNaN(Number(r)))return Number(r).toLocaleString()}return String(r)},lb=t=>Yt__default.isValidElement(t)?f("div",{sx:{display:"inline-flex",alignItems:"center"},children:t}):f(A,{sx:{mt:.2,fontSize:"0.88rem",fontWeight:800},children:t}),cb=(t,o)=>{let r=o[t.id];if(r==null||r==="")return "--";if(t.numeric){if(typeof r=="number")return r.toLocaleString();if(typeof r=="string"&&r.trim()!==""&&!Number.isNaN(Number(r)))return Number(r).toLocaleString()}return String(r)},db=({summaryRow:t,visibleColumns:o,columns:r})=>{let a=r.filter(n=>o.includes(n.id)&&t[n.id]!=="");return a.length===0?null:f(Ae,{elevation:0,sx:{p:1.5,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:g(ne,{spacing:1,children:[f(A,{sx:{fontSize:"0.82rem",fontWeight:800,color:"text.secondary"},children:"Summary"}),f("div",{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(132px, 1fr))",gap:1},children:a.map(n=>g(Ae,{elevation:0,sx:{p:1.1,borderRadius:3,border:"1px solid",borderColor:"divider"},children:[f(A,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:n.label}),f(A,{sx:{mt:.25,fontSize:"0.96rem",fontWeight:800},children:t[n.id]})]},`summary-${n.id}`))})]})})},pb=t=>{let{t:o}=ce(),r=ro(),{title:a,showToolbar:n=true,selectionMode:i,selected:s=[],onSelectionChange:c,actions:d,extraTools:m,fitContainer:p=false,fullWidth:f$1=false,maxHeight:h,loading:u=false,rowsPerPageOptions:v=[20,50,100,-1],onLayoutSave:y,filterConfig:g$1,rowKey:C,tableKey:b$1="default",graphReport:S,quickCreate:k,quickEdit:x,quickDelete:E,serviceUrl:D,orientation:T="auto",cardTitleField:N,cardSubtitleFields:R,toolbarSlot:w,emptyState:M,rowHeight:I="comfortable",cardActionSlot:L,renderCardFooter:O,onRowClick:U}=t,z=a||o("table.title.default"),K=Io("(orientation: portrait)"),W=Io(r.breakpoints.down("md")),q=T==="auto"?K||W?"portrait":"landscape":T,{columns:H,filterText:V,setFilterText:Z,visibleColumns:j,showSummary:me,setShowSummary:ie,summaryColumns:ge,grouping:ye,setGrouping:Ue,expandedGroups:Oe,groupAnchorEl:Ie,setGroupAnchorEl:ze,summaryAnchorEl:Re,setSummaryAnchorEl:Ce,anchorEl:Ve,setAnchorEl:at,contextMenu:gt,sortedAndFilteredRows:Je,summaryRow:te,visibleRows:We,page:Ne,setPage:Ee,rowsPerPage:st,setRowsPerPage:Ze,totalDisplayCount:ht,setSelected:xt,handleClick:Nt,toggleSummaryColumn:Et,handleExport:ee,handleCloseContextMenu:tt,toggleColumnVisibility:Le,toggleGroupExpand:se,handleExpandGroupRecursively:ue,handleCollapseGroupRecursively:Q,handleLayoutLoad:we,handleVariantLoad:ke,handleLayoutSave:Xe,effectiveAppId:dt,currentLayoutData:lt,currentLayoutId:Lt,layoutIdToLoad:$t,graphReportOpen:bt,handleOpenGraphReport:ft,handleCloseGraphReport:vo}=ra(t),Pt=S?.enabled??false,Ft=Pt&&(S?.interaction?.enabled??true),ct=oi(),Bt=C||"id",xe=Yt__default.useMemo(()=>({borderRadius:999,fontWeight:700,borderColor:et(r.palette.divider,b()==="dark"?.55:.3),bgcolor:b()==="dark"?et(r.palette.common.white,.06):et(r.palette.background.paper,.92),color:r.palette.text.primary,"& .orb-chip-label":{px:1.05}}),[r]),B=Yt__default.useMemo(()=>({...xe,borderColor:et(r.palette.primary.main,b()==="dark"?.42:.24),bgcolor:b()==="dark"?et(r.palette.primary.main,.16):et(r.palette.primary.main,.08)}),[xe,r]),_=Yt__default.useMemo(()=>{let Y=new Set(s);return Je.filter(De=>Y.has(De?.[Bt]))},[Bt,s,Je]),J=_.length===1?_[0]:null,Te=!!k?.enabled,fe=!!x?.enabled,Me=!!E?.enabled,$e=k?.fields,Qe=k?.excludeFields||[],Ge=k?.initialValues||{},vt=x?.fields,Dt=x?.excludeFields||[],St=x?.editableFields||[],yt=x?.nonEditableFields||[],F=x?.primaryKeys?.length?x.primaryKeys:[Bt],[X,pe]=Yt__default.useState(false),[ve,je]=Yt__default.useState(false),[Ke,Tt]=Yt__default.useState({}),[mt,pt]=Yt__default.useState(false),[wt,Jt]=Yt__default.useState(false),[Ot,Kt]=Yt__default.useState({}),[Vt,Gt]=Yt__default.useState(false),[Ht,Qt]=Yt__default.useState(false),eo=u||ve||wt||Ht,po=Yt__default.useMemo(()=>{let Y=[...H];if(Array.isArray($e)&&$e.length>0){let De=new Set($e);Y=Y.filter(Ye=>De.has(Ye.id));}if(Qe.length>0){let De=new Set(Qe);Y=Y.filter(Ye=>!De.has(Ye.id));}return Y.filter(De=>!!De?.id)},[H,Qe,$e]),ko=Yt__default.useMemo(()=>{let Y=[...H];if(Array.isArray(vt)&&vt.length>0){let De=new Set(vt);Y=Y.filter(Ye=>De.has(Ye.id));}if(Dt.length>0){let De=new Set(Dt);Y=Y.filter(Ye=>!De.has(Ye.id));}return Y.filter(De=>!!De?.id)},[H,Dt,vt]),Po=Yt__default.useMemo(()=>new Set(F),[F]),Qo=Yt__default.useMemo(()=>new Set(St),[St]),fo=Yt__default.useMemo(()=>new Set(yt),[yt]),No=Yt__default.useCallback(Y=>Qo.size>0?Qo.has(Y):!(fo.has(Y)||Po.has(Y)),[Qo,fo,Po]);Yt__default.useEffect(()=>{!bt&&ct.hasActiveFilters&&ct.clearAll();},[ct,bt]);let Fr=()=>{let Y={};po.forEach(De=>{Y[De.id]=Ge[De.id]??"";}),Tt(Y),pe(true);},Br=(Y,De)=>{Tt(Ye=>({...Ye,[Y]:De}));},Sr=async()=>{if(!k?.onSubmit){pe(false);return}try{je(!0),await k.onSubmit(Ke),pe(!1);}finally{je(false);}},Or=()=>{if(!J)return;let Y={};ko.forEach(Ye=>{Y[Ye.id]=J[Ye.id]??"";});let De=x?.getInitialValues?{...Y,...x.getInitialValues(J)}:Y;Kt(De),pt(true);},zr=(Y,De)=>{Kt(Ye=>({...Ye,[Y]:De}));},To=async()=>{if(J){if(!x?.onSubmit){pt(false);return}try{Jt(!0),await x.onSubmit(Ot,J),pt(!1);}finally{Jt(false);}}},wr=()=>{_.length!==0&&Gt(true);},Vr=async()=>{if(_.length===0){Gt(false);return}if(!E?.onConfirm){Gt(false),xt([]),c?.([]);return}try{Qt(!0),await E.onConfirm(_),Gt(!1),xt([]),c?.([]);}finally{Qt(false);}},Wo=Je,{fieldMapping:jo}=Jr({rows:Wo,config:{...S,title:S?.title||`${z} ${o("graph.reportTitle")}`}}),ha=Yt__default.useMemo(()=>Ft?ct.applyRows(Wo,jo):Wo,[jo,ct,Ft,Wo]),{model:kr}=Jr({rows:ha,config:{...S,title:S?.title||`${z} ${o("graph.reportTitle")}`,fieldMapping:jo}}),P=kr.table.columns.map(Y=>({id:Y.id,label:Y.label,align:Y.align||"left",minWidth:120,numeric:Y.align==="right"})),$=dt?f(oa,{appId:dt,tableKey:b$1,currentLayoutData:lt,onLayoutLoad:we,targetLayoutId:$t,activeLayoutId:Lt,serviceUrl:D??g$1?.serviceUrl}):null,G=H.filter(Y=>j.includes(Y.id)),le=G.find(Y=>Y.id===N)||G[0],Fe=R?.map(Y=>G.find(De=>De.id===Y)).filter(Boolean)||G.filter(Y=>Y.id!==le?.id).slice(0,q==="portrait"?2:3),ot=G.filter(Y=>Y.id!==le?.id&&!Fe.some(De=>De.id===Y.id)),He=[w,m].filter(Boolean),oe=g(e,{children:[f(Qr,{groupAnchorEl:Ie,setGroupAnchorEl:ze,grouping:ye,setGrouping:Ue,columns:H}),f(jr,{anchorEl:Ve,setAnchorEl:at,columns:H,visibleColumns:j,toggleColumnVisibility:Le}),f(Xn,{anchorEl:Re,setAnchorEl:Ce,showSummary:me,setShowSummary:ie,columns:H,summaryColumns:ge,toggleSummaryColumn:Et}),f(Yn,{contextMenu:gt,handleCloseContextMenu:tt,columns:H,visibleColumns:j,toggleColumnVisibility:Le})]}),de=(Y,De,Ye)=>{let Pe=s.includes(De),qe=q==="portrait"?"repeat(2, minmax(0, 1fr))":"repeat(auto-fit, minmax(140px, 1fr))",It=Ye%2===0?et(r.palette.primary.main,b()==="dark"?.09:.04):et(r.palette.primary.main,b()==="dark"?.05:.022),Hr=et(r.palette.divider,.22);return f(Ae,{elevation:0,onClick:()=>{Nt({},Y),U?.(Y);},sx:{p:I==="compact"?1.25:1.5,borderRadius:4,border:"0.5px solid",borderColor:Pe?et(r.palette.primary.main,.38):Hr,background:Pe?`linear-gradient(135deg, ${et(r.palette.primary.main,.13)}, ${et(r.palette.primary.main,.06)})`:`linear-gradient(135deg, ${It}, ${et(r.palette.primary.main,.015)})`,boxShadow:Pe?`0 12px 30px ${et(r.palette.primary.main,.2)}`:`0 3px 10px ${et(r.palette.common.black,.045)}`,cursor:"pointer",position:"relative",overflow:"hidden",transition:"border-color 160ms ease, box-shadow 160ms ease, transform 120ms ease, background 160ms ease","&::before":{content:'""',position:"absolute",left:0,top:0,bottom:0,width:4,background:Pe?r.palette.primary.main:Ye%2===0?et(r.palette.primary.main,.26):et(r.palette.text.primary,.16)},"&:hover":{boxShadow:`0 10px 20px ${et(r.palette.primary.main,.12)}`,transform:"translateY(-1px)"},"&:active":{transform:"scale(0.995)"}},children:g(ne,{spacing:1.25,children:[g(ne,{direction:"row",spacing:1.25,alignItems:"flex-start",children:[i?f(Mt,{checked:Pe,onClick:yo=>yo.stopPropagation(),onChange:()=>Nt({},Y),sx:{mt:-0.6,ml:-0.6}}):null,g("div",{sx:{flex:1,minWidth:0},children:[le?f(A,{sx:{fontSize:"1rem",fontWeight:900,lineHeight:1.25},children:jp(le,Y)}):null,Fe.length>0?f(ne,{direction:"row",spacing:.75,useFlexGap:true,flexWrap:"wrap",sx:{mt:.75},children:Fe.map(yo=>f(kt,{label:`${yo.label}: ${cb(yo,Y)}`,size:"small",variant:"outlined",sx:xe},`${De}-${yo.id}`))}):null]}),L?f("div",{onClick:yo=>yo.stopPropagation(),children:L(Y)}):null]}),ot.length>0?f("div",{sx:{display:"grid",gridTemplateColumns:qe,gap:1},children:ot.map(yo=>g(Ae,{elevation:0,sx:{p:1,borderRadius:3,bgcolor:b()==="dark"?et(r.palette.background.default,.7):et(r.palette.background.paper,.92),border:"0.1px solid",borderColor:et(r.palette.divider,.24)},children:[f(A,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:yo.label}),lb(jp(yo,Y))]},`${De}-${yo.id}-detail`))}):null,O?g(e,{children:[f(At,{}),f("div",{onClick:yo=>yo.stopPropagation(),children:O(Y)})]}):null]})},De)};return g("div",{sx:{width:f$1?"100%":"auto",mb:p?0:2,...p?{flex:1,display:"flex",flexDirection:"column",minHeight:0,height:"100%",overflow:"hidden"}:{}},children:[g$1?f("div",{sx:{mb:2},children:f(Kp,{...g$1,onVariantLoad:Y=>{ke(Y),g$1.onVariantLoad?.(Y);},appId:g$1.appId,tableKey:b$1,currentLayout:[{tableKey:b$1,layoutData:lt}],currentLayoutId:Lt,layoutRefs:[{tableKey:b$1,layoutId:Lt}],variantService:g$1.variantService,serviceUrl:D??g$1.serviceUrl,touchMode:q==="portrait"?"expanded":"comfortable"})}):null,g(Ae,{sx:{width:f$1?"100%":"auto",mb:p?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative",bgcolor:"transparent",backgroundImage:"none",boxShadow:"none","&::before":eo?{content:'""',position:"absolute",top:0,left:0,width:"100%",height:"3px",background:"linear-gradient(90deg, color-mix(in oklch, var(--orb-primary) 0%, transparent) 0%, color-mix(in oklch, var(--orb-primary) 25%, transparent) 25%, var(--orb-primary) 50%, color-mix(in oklch, var(--orb-primary) 25%, transparent) 75%, color-mix(in oklch, var(--orb-primary) 0%, transparent) 100%)",backgroundSize:"220% 100%",animation:"cTableTopMarquee 1.2s linear infinite",zIndex:6,pointerEvents:"none"}:{},"@keyframes cTableTopMarquee":{"0%":{backgroundPosition:"220% 0"},"100%":{backgroundPosition:"-120% 0"}},...h?{height:h}:p?{flex:1,minHeight:0,height:"100%"}:{}},children:[n?f("div",{sx:{"& .orb-toolbar":{minHeight:60,alignItems:{xs:"flex-start",md:"center"},flexWrap:"wrap",rowGap:1,columnGap:1},"& .orb-toolbar > :nth-of-type(1)":{width:{xs:"100%",md:"auto"},"& .orb-fld":{width:{xs:"100%",md:300}}},"& .orb-toolbar > :nth-of-type(2)":{flexShrink:0},"& .orb-toolbar > :nth-of-type(3)":{display:{xs:"none",md:"block"}},"& .orb-toolbar > :nth-of-type(4)":{ml:"auto",justifyContent:"flex-end",flexWrap:"wrap"},"& .orb-inp-adornment-wrap, & .orb-inp":{minHeight:46},"& .orb-icon-btn":{width:40,height:40},"& .orb-body, & .orb-body-dense, & .orb-label, & .orb-meta":{fontSize:"0.9rem"},"& button":{borderRadius:2.5}},children:f(_n,{filterText:V,setFilterText:Z,onRowsPerPageChange:Ze,rowsPerPage:st,rowsPerPageOptions:v,page:Ne,count:ht,onPageChange:Ee,actions:d,extraTools:He,grouping:ye,setGroupAnchorEl:ze,showSummary:me,setShowSummary:ie,setAnchorEl:at,setSummaryAnchorEl:Ce,handleExport:ee,showCreateButton:Te,onOpenCreateDialog:Fr,showEditButton:fe,onOpenEditDialog:Or,editDisabled:_.length!==1,showDeleteButton:Me,onOpenDeleteConfirm:wr,deleteDisabled:_.length===0,onLayoutSave:y||g$1?.variantService&&g$1?.appId?Xe:void 0,loading:u,layoutManager:$,onOpenGraphReport:Pt?ft:void 0})}):null,f("div",{sx:{flex:1,minHeight:0,overflow:"auto",p:1.5},children:g(ne,{spacing:1.25,children:[We.length===0&&!u?M||f(Ae,{elevation:0,sx:{p:4,borderRadius:4,border:"1px dashed",borderColor:"divider",textAlign:"center"},children:f(A,{sx:{fontSize:"0.92rem",color:"text.secondary"},children:o("common.noData")})}):null,We.map((Y,De)=>{if(Y.type==="group"){let qe=Oe.has(Y.id);return f(Ae,{elevation:0,sx:{borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:g("div",{component:"button",type:"button",onClick:()=>se(Y.id),sx:{width:"100%",px:1.5,py:1.3,border:0,background:"transparent",display:"flex",alignItems:"center",gap:1,textAlign:"left",cursor:"pointer",appearance:"none",WebkitAppearance:"none",color:"text.primary"},children:[qe?f(Kr,{}):f(An,{}),g("div",{sx:{flex:1,minWidth:0},children:[g(A,{sx:{fontSize:"0.94rem",fontWeight:800},children:[Y.field,": ",Y.value]}),g(A,{sx:{mt:.2,fontSize:"0.76rem",color:"text.secondary"},children:[Y.count," records"]})]}),ye.length>1&&Y.level<ye.length-1?g(ne,{direction:"row",spacing:.5,children:[f(kt,{size:"small",label:o("table.group.expandAll"),onClick:It=>{It.stopPropagation(),ue(Y.id);},sx:B}),f(kt,{size:"small",label:o("table.group.collapseAll"),onClick:It=>{It.stopPropagation(),Q(Y.id);},sx:B})]}):null]})},Y.id)}let Ye=Y.data||Y,Pe=Y.id||Ye[Bt]||De;return de(Ye,Pe,De)}),me?f(db,{summaryRow:te,visibleColumns:j,columns:H}):null,u?f(A,{sx:{py:1,fontSize:"0.84rem",color:"text.secondary",textAlign:"center"},children:o("common.loading")}):null]})})]}),Te?g(zt,{open:X,onClose:()=>!ve&&pe(false),fullWidth:true,maxWidth:"sm",children:[f("div",{className:"orb-dialog-title",sx:{fontSize:"1rem",fontWeight:800},children:k?.title||o("quickCreate.createWithTitle",{title:z})}),f("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:g("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[po.map(Y=>{let De=Y.type==="number"||Y.numeric?"number":Y.type==="date"?"date":"text";return f(Be,{label:Y.label||Y.id,value:Ke[Y.id]??"",onChange:Ye=>Br(Y.id,Ye.target.value),type:De,fullWidth:true,InputLabelProps:{shrink:De==="date"?true:void 0}},`quick-create-${Y.id}`)}),k?.description?f(Uo,{severity:"info",children:k.description}):null]})}),g("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[f(be,{onClick:()=>pe(false),disabled:ve,children:k?.cancelLabel||o("common.cancel")}),f(be,{onClick:Sr,variant:"contained",disabled:ve,children:k?.submitLabel||o("common.save")})]})]}):null,fe?g(zt,{open:mt,onClose:()=>!wt&&pt(false),fullWidth:true,maxWidth:"sm",children:[f("div",{className:"orb-dialog-title",sx:{fontSize:"1rem",fontWeight:800},children:x?.title||o("quickEdit.editWithTitle",{title:z})}),f("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:g("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[ko.map(Y=>{let De=Y.type==="number"||Y.numeric?"number":Y.type==="date"?"date":"text";return f(Be,{label:Y.label||Y.id,value:Ot[Y.id]??"",onChange:Ye=>zr(Y.id,Ye.target.value),type:De,disabled:!No(Y.id),fullWidth:true,InputLabelProps:{shrink:De==="date"?true:void 0}},`quick-edit-${Y.id}`)}),x?.description?f(Uo,{severity:"info",children:x.description}):null]})}),g("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[f(be,{onClick:()=>pt(false),disabled:wt,children:x?.cancelLabel||o("common.cancel")}),f(be,{onClick:To,variant:"contained",disabled:wt||!J,children:x?.submitLabel||o("common.save")})]})]}):null,Me?f(Aa,{open:Vt,type:"warning",title:E?.title||o("quickDelete.confirmTitle"),message:E?.message||(_.length>1?o("quickDelete.confirmMessageMultiple",{count:_.length}):o("quickDelete.confirmMessageSingle")),confirmText:E?.confirmText||o("common.delete"),cancelText:E?.cancelText||o("common.cancel"),onClose:()=>!Ht&&Gt(false),onConfirm:Vr}):null,oe,Pt?f(ei,{open:bt,onClose:vo,model:kr,aiAssistant:S?.aiAssistant,interaction:Ft?{enabled:true,filters:ct.filters,fieldMapping:jo,onPrimaryDimensionClick:Y=>ct.setFilter("primaryDimension",Y),onSecondaryDimensionClick:Y=>ct.setFilter("secondaryDimension",Y),onStatusClick:Y=>ct.setFilter("status",Y),onClearFilter:ct.clearFilter,onClearAll:ct.clearAll}:void 0,tableContent:f(pb,{appId:dt||"graph-report-internal",title:o("graph.dataBody"),columns:P,rows:kr.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false},showSummary:false})}):null]})};var nE=({appTitle:t,children:o,menuData:r=[],workloadItems:a=[],workloadSelectedId:n,showNavigation:i=true,showWorkloadNav:s=true,orientation:c="auto",logo:d,headerSlot:m,actionSlot:p,portraitBottomSlot:f$1,contentSx:h,containerSx:u,user:v,onSearch:y,onSearchAdd:g$1,defaultNavigationOpen:C,navOpen:b,onNavOpenChange:S,onWorkloadSelect:k,locale:x="en",localeLabel:E,localeOptions:D,onLocaleChange:T,onUserSetting:N,onUserLogout:R,userMenuItems:w,leftHeaderSlot:M,rightHeaderSlot:I})=>{let L="orbcafe:page-layout-mode",[O,U]=useState("system"),[z,K]=useState("light"),[W,q]=useState(false),[H,V]=useState(false),Z=O==="system"?H?z:"light":O;useEffect(()=>{q(true);},[]),useEffect(()=>{try{let gt=window.localStorage.getItem(L);(gt==="light"||gt==="dark"||gt==="system")&&U(gt);}catch{}V(true);let Ve=window.matchMedia("(prefers-color-scheme: dark)"),at=()=>{K(Ve.matches?"dark":"light");};return at(),Ve.addEventListener("change",at),()=>Ve.removeEventListener("change",at)},[]),useEffect(()=>{if(H)try{window.localStorage.setItem(L,O);}catch{}},[H,O]),useEffect(()=>{Z==="dark"?(document.documentElement.classList.add("dark"),document.documentElement.classList.add("orb-dark"),document.documentElement.dataset.orbMode="dark",document.documentElement.style.colorScheme="dark"):(document.documentElement.classList.remove("dark"),document.documentElement.classList.remove("orb-dark"),document.documentElement.dataset.orbMode="light",document.documentElement.style.colorScheme="light");},[Z]);let j=Io("(orientation: portrait)"),me=Io("(max-width: 899.95px)"),ie=c==="auto"?!W||j||me?"portrait":"landscape":c,[ge,ye]=useState({landscape:C??true,portrait:false}),Ue=ge[ie],Oe=b??Ue,Ie=Ve=>{b===void 0&&ye(at=>({...at,[ie]:Ve})),S?.(Ve);},ze=g(ne,{direction:"row",spacing:1,alignItems:"center",children:[!W||i&&ie==="portrait"?f(ae,{onClick:()=>Ie(!Oe),sx:{bgcolor:"action.hover"},children:f(On,{})}):null,M]}),Re=g(ne,{direction:"row",spacing:1,alignItems:"center",children:[p,I]}),Ce=f(Qp,{collapsed:ie==="landscape"?!Oe:false,onToggle:()=>Ie(!Oe),menuData:r,orientation:ie,colorMode:Z,maxHeight:ie==="landscape"?900:void 0});return f(ba,{mode:O,children:f(yn,{locale:x,children:g("div",{sx:[Ve=>({minHeight:"100vh",display:"flex",flexDirection:"column",background:Ve.palette.mode==="dark"?"linear-gradient(180deg, var(--orb-canvas) 0%, var(--orb-surface) 55%, var(--orb-surface-2) 100%)":Ve.palette.background.default}),...Array.isArray(u)?u:[u]],children:[f(bi,{appTitle:t,logo:d===void 0?null:d,mode:O,onToggleMode:()=>U(Ve=>Ve==="system"?"dark":Ve==="dark"?"light":"system"),locale:x,localeLabel:E,localeOptions:D,onLocaleChange:T,user:v,onUserSetting:N,onUserLogout:R,userMenuItems:w,onSearch:y,onSearchAdd:g$1,leftSlot:ze,rightSlot:Re}),m?f("div",{sx:{px:{xs:2,md:3},py:1.5,borderBottom:"1px solid",borderColor:"divider"},children:m}):null,g("div",{sx:{flex:1,minHeight:0,display:"flex",position:"relative"},children:[W&&i&&ie==="landscape"?f("div",{sx:{p:1.5,pr:0,flexShrink:0},children:Ce}):null,!W||i&&ie==="portrait"?f(vc,{open:Oe,onClose:()=>Ie(false),PaperProps:{sx:{width:"min(88vw, 360px)",p:1.25,bgcolor:"transparent",boxShadow:"none"}},children:Ce}):null,f("div",{sx:{flex:1,minWidth:0,minHeight:0,overflow:"auto",p:1.5,...h},children:g(ne,{spacing:1.5,children:[s&&a.length>0?f(qp,{items:a,selectedId:n,orientation:ie,onItemSelect:k}):null,f(Ae,{elevation:0,sx:{flex:1,minHeight:ie==="portrait"?420:560,p:{xs:1.25,md:1.5},borderRadius:5,border:"1px solid",borderColor:"divider",bgcolor:"color-mix(in oklch, var(--orb-canvas) 72%, transparent)",backdropFilter:"blur(12px)",color:"text.primary"},children:o})]})})]}),ie==="portrait"&&f$1?g(e,{children:[f(At,{}),f("div",{sx:{p:1.5},children:f$1})]}):null]})})})};var Jp=ub(()=>import('./COrbCanvas-4PZFJUYO.mjs').then(t=>t.COrbCanvas),{ssr:false,loading:()=>f("div",{className:"h-full w-full bg-transparent"})});function qs({isRecording:t}){return f(AnimatePresence,{children:t&&f(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:g("div",{className:"relative flex h-full w-full items-center justify-center",children:[f("div",{className:"absolute inset-0",children:f(Jp,{hue:0,hoverIntensity:.5,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})}),f("div",{className:"relative z-10 h-full w-1/3 mix-blend-overlay opacity-80",children:f(Jp,{hue:10,hoverIntensity:.8,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})})]})})})}var dE=qs;var tu=createContext(null);function yb(t){if(!t||!(t instanceof HTMLElement))return false;let o=t.tagName;return !!(o==="INPUT"||o==="TEXTAREA"||o==="SELECT"||t.isContentEditable||t.closest('[data-voice-hotkey-ignore="true"]'))}function Cb({children:t,onVoiceSubmit:o,onVoicePartial:r,onVoiceError:a,longPressMs:n=200,disableSpaceTrigger:i=false,ignoreWhenFocusedInput:s=true,renderOverlay:c=true,wsUrl:d,silenceThresholdMs:m,minVolumeRms:p}){let[f$1,h]=useState(false),[u,v]=useState(false),y=useRef(null),g$1=useRef(false),C=useRef(false),b=useCallback(()=>{C.current=false,h(false);},[]),{isRecording:S,startRecording:k,stopRecording:x}=la({wsUrl:d,silenceThresholdMs:m,minVolumeRms:p,onTextUpdate:N=>{r?.(N);},onComplete:async N=>{try{N.trim()&&(v(!0),await o(N.trim()));}catch(R){let w=R instanceof Error?R.message:"Failed to process voice command";a?.(w);}finally{v(!1),b();}},onError:N=>{a?.(N),v(!1),g$1.current||b();}}),E=useCallback(async()=>{C.current=false,await k();},[k]),D=useCallback(()=>{x();},[x]);useEffect(()=>{if(i)return;let N=w=>{w.isComposing||(w.code==="Space"||w.key===" ")&&(g$1.current||w.repeat||s&&yb(document.activeElement)||(g$1.current=true,w.preventDefault(),y.current=setTimeout(()=>{C.current=true,h(true),k();},n)));},R=w=>{(w.code==="Space"||w.key===" ")&&(y.current&&(clearTimeout(y.current),y.current=null),g$1.current=false,C.current&&(w.preventDefault(),h(false),x()));};return window.addEventListener("keydown",N),window.addEventListener("keyup",R),()=>{window.removeEventListener("keydown",N),window.removeEventListener("keyup",R),y.current&&(clearTimeout(y.current),y.current=null);}},[i,s,n,k,x]);let T=useMemo(()=>({isRecording:S,isHotkeyRecording:f$1,isSubmitting:u,startRecording:E,stopRecording:D}),[f$1,S,u,E,D]);return g(tu.Provider,{value:T,children:[c?f(qs,{isRecording:f$1}):null,t]})}function xb(){let t=useContext(tu);if(!t)throw new Error("useAINav must be used within CAINavProvider");return t}var hE=Cb,bE=xb;function ut(...t){return twMerge(clsx(t))}var Tb=({content:t,theme:o="light",size:r="base",defaultExpanded:a=false})=>{let[n,i]=useState(a),s=useMemo(()=>`${(r==="sm"?14:r==="lg"?18:16)-2}px`,[r]);return g("div",{className:`my-6 rounded-lg overflow-hidden transition-all duration-200 ${o==="dark"?"bg-[var(--orb-surface-2)]":"bg-[var(--orb-canvas)]"}`,style:{border:"0.5px solid var(--orb-border)"},children:[g("div",{className:"px-4 py-3 cursor-pointer flex items-center justify-between transition-colors duration-200 bg-[var(--orb-surface)] hover:bg-[var(--orb-hover)]",style:{borderBottom:"0.5px solid var(--orb-border)"},onClick:()=>i(!n),children:[g("span",{className:"flex items-center",children:[f(an,{className:"mr-2 h-4 w-4"}),f("span",{className:"font-medium text-[var(--orb-fg)]",style:{fontSize:r==="sm"?"14px":r==="lg"?"18px":"16px"},children:"\u601D\u8003\u8FC7\u7A0B"})]}),f(Pr,{className:`w-4 h-4 transition-transform duration-200 ${n?"rotate-180":""} text-[var(--orb-muted)]`})]}),n&&f("div",{className:"p-4 whitespace-pre-wrap italic font-light text-[var(--orb-muted)]",style:{fontSize:s,lineHeight:"1.3 !important"},children:t})]})},ou=Tb;var Ab=({content:t,language:o="text",isStreaming:r=false,className:a=""})=>{let n=ho(),[i,s]=useState(false),c=async()=>{try{await navigator.clipboard.writeText(t),s(!0),setTimeout(()=>s(!1),2e3);}catch(m){console.error("\u590D\u5236\u5931\u8D25:",m);}},d=n==="dark"?oneDark:oneLight;return g("div",{className:ut("rounded-lg overflow-hidden border border-[var(--orb-border)] my-4",a),children:[g("div",{className:"flex items-center justify-between px-4 py-2 bg-[var(--orb-surface)] border-b border-[var(--orb-border)]",children:[f("span",{className:"text-xs font-medium text-[var(--orb-muted)] uppercase",children:o}),f("button",{onClick:c,className:"p-1 hover:bg-[var(--orb-hover)] rounded transition-colors",disabled:r,title:i?"Copied":"Copy code",children:i?f(Wr,{size:14,className:"text-[var(--orb-status-success)]"}):f(Cl,{size:14,className:"text-[var(--orb-muted)]"})})]}),f("div",{className:"text-sm",children:f(Prism,{language:o,style:d,customStyle:{margin:0,padding:"16px",fontSize:"14px",lineHeight:"1.5",backgroundColor:n==="dark"?"var(--orb-surface-2)":"var(--orb-canvas)"},wrapLongLines:true,children:t})})]})},ru=Ab;var Lb=({content:t,isLoading:o,className:r="",style:a})=>{let n=useRef(null),[i,s]=useState(false),[c,d]=useState(null),m=ho();return useEffect(()=>{let p=false,f=async()=>{if(!(!t.trim()||!n.current)){s(true),d(null);try{nu.initialize({startOnLoad:!1,theme:m==="dark"?"dark":"default",securityLevel:"loose",fontFamily:"inherit",flowchart:{htmlLabels:!1}});let u=`mermaid-${Math.random().toString(36).substr(2,9)}`,v=t.replace(/```mermaid\n?|\n?```/g,"").trim(),{svg:y,bindFunctions:g}=await nu.render(u,v);!p&&n.current&&(n.current.innerHTML=y,g?.(n.current));}catch(u){if(p)return;console.error("Mermaid render failed:",u),d(u instanceof Error?u.message:"Render failed");}finally{p||s(false);}}},h=setTimeout(()=>{f();},100);return ()=>{p=true,clearTimeout(h);}},[t,m]),g("div",{className:`mermaid-block ${r}`,style:a,children:[(o||i)&&g("div",{className:"flex items-center justify-center rounded border border-[var(--orb-border)] bg-[var(--orb-surface)] p-4 dark:bg-[var(--orb-surface-2)]",children:[f("div",{className:"mr-2 h-4 w-4 animate-spin rounded-full border-b-2 border-[var(--orb-primary)]"}),f("span",{className:"text-sm text-[var(--orb-muted)]",children:"Generating Diagram..."})]}),c&&g("div",{className:"overflow-auto rounded border border-[color-mix(in_oklch,var(--orb-status-error)_30%,transparent)] bg-[color-mix(in_oklch,var(--orb-status-error)_8%,transparent)] p-4 text-sm text-[var(--orb-status-error)]",children:[f("p",{className:"mb-2 font-semibold",children:"Mermaid Error:"}),f("pre",{children:c}),f("pre",{className:"mt-4 text-xs text-[var(--orb-muted)]",children:t})]}),f("div",{ref:n,className:`overflow-x-auto ${o||i||c?"hidden":""}`})]})},iu=Lb;var Fb=({title:t="\u53D1\u751F\u9519\u8BEF",content:o,errorCode:r,stack:a,icon:n,closable:i=true,onClose:s,onRetry:c,className:d="",...m})=>{let[p,f$1]=useState(false),[h,u]=useState(false),v=async()=>{if(c){u(true);try{await c();}catch(y){console.error("\u91CD\u8BD5\u5931\u8D25:",y);}finally{u(false);}}};return g("div",{className:`relative w-full overflow-hidden rounded-lg border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-sm transition-all hover:shadow-md ${d}`,...m,children:[g("div",{className:"flex p-4 border-l-4 border-l-[var(--orb-status-error)] bg-[color-mix(in_oklch,var(--orb-status-error)_8%,transparent)]",children:[f("div",{className:"flex-shrink-0 mr-3 text-[var(--orb-status-error)] mt-0.5",children:n||f(bl,{className:"w-5 h-5"})}),g("div",{className:"flex-1 min-w-0",children:[g("div",{className:"flex items-center space-x-2 mb-1",children:[f("h4",{className:"text-base font-semibold text-[var(--orb-fg)]",children:t}),r&&f("span",{className:"text-xs font-mono px-1.5 py-0.5 rounded bg-[color-mix(in_oklch,var(--orb-status-error)_14%,transparent)] text-[var(--orb-status-error)]",children:r})]}),o&&f("div",{className:"text-sm text-[var(--orb-muted)] mb-3 leading-relaxed",children:typeof o=="string"?f("p",{className:"whitespace-pre-wrap",children:o}):o}),(c||a)&&g("div",{className:"flex items-center space-x-4 mt-2",children:[c&&g("button",{onClick:v,disabled:h,className:"flex items-center text-xs font-medium text-[var(--orb-status-error)] hover:opacity-80 transition-colors disabled:opacity-50",children:[f(Nl,{className:`w-3.5 h-3.5 mr-1.5 ${h?"animate-spin":""}`}),h?"\u91CD\u8BD5\u4E2D...":"\u91CD\u8BD5"]}),a&&g("button",{onClick:()=>f$1(!p),className:"flex items-center text-xs font-medium text-[var(--orb-muted)] hover:text-[var(--orb-fg)] dark:text-[var(--orb-muted)] transition-colors",children:[p?f(Pr,{className:"w-3.5 h-3.5 mr-1"}):f(Eo,{className:"w-3.5 h-3.5 mr-1"}),p?"\u9690\u85CF\u8BE6\u60C5":"\u67E5\u770B\u8BE6\u60C5"]})]})]}),i&&s&&f("button",{onClick:s,className:"flex-shrink-0 ml-3 text-[var(--orb-muted)] hover:text-[var(--orb-fg)] transition-colors self-start",children:f(to,{className:"w-4 h-4"})})]}),a&&p&&f("div",{className:"bg-[var(--orb-surface)] dark:bg-[var(--orb-canvas)] p-3 border-t border-[var(--orb-border)]",children:f("pre",{className:"text-xs font-mono text-[var(--orb-muted)] overflow-x-auto whitespace-pre-wrap p-2 bg-[var(--orb-canvas)] rounded border border-[var(--orb-border)]",children:a})})]})},Ni=Fb;var Bb=({title:t="\u8B66\u544A",content:o,warningType:r,severity:a="warning",warnings:n=[],icon:i,closable:s=true,onClose:c,onConfirm:d,actionText:m,className:p="",...f$1})=>{let h=()=>{switch(a){case "info":return {borderLeftColor:"border-l-blue-500",iconColor:"text-[var(--orb-primary)]",bgColor:"bg-[var(--orb-p50)]"};case "error":return {borderLeftColor:"border-l-[var(--orb-status-error)]",iconColor:"text-[var(--orb-status-error)]",bgColor:"bg-[color-mix(in_oklch,var(--orb-status-error)_8%,transparent)]"};case "success":return {borderLeftColor:"border-l-green-500",iconColor:"text-[var(--orb-status-success)]",bgColor:"bg-[color-mix(in_oklch,var(--orb-status-success)_8%,transparent)]"};default:return {borderLeftColor:"border-l-yellow-500",iconColor:"text-[var(--orb-status-warning)]",bgColor:"bg-[color-mix(in_oklch,var(--orb-status-warning)_8%,transparent)]"}}},u=()=>{switch(a){case "info":return f(rn,{className:"w-5 h-5"});case "error":return f(gn,{className:"w-5 h-5"});case "success":return f(en,{className:"w-5 h-5"});default:return f(vl,{className:"w-5 h-5"})}},v=h();return g("div",{className:`relative w-full overflow-hidden rounded-lg border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-sm transition-all hover:shadow-md ${p}`,...f$1,children:[g("div",{className:`flex p-4 border-l-4 ${v.borderLeftColor} ${v.bgColor}`,children:[f("div",{className:`flex-shrink-0 mr-3 ${v.iconColor}`,children:i||u()}),g("div",{className:"flex-1 min-w-0",children:[g("div",{className:"flex items-center justify-between mb-1",children:[f("h4",{className:"text-base font-semibold text-[var(--orb-fg)]",children:t}),r&&f("span",{className:"text-xs font-medium px-2 py-0.5 rounded-full bg-[var(--orb-surface)] text-[var(--orb-muted)]",children:r})]}),o&&f("div",{className:"text-sm text-[var(--orb-muted)] mb-2",children:o}),n&&n.length>0&&f("ul",{className:"mt-2 space-y-1",children:n.map((y,g$1)=>g("li",{className:"flex items-start text-sm text-[var(--orb-muted)]",children:[f("span",{className:"mr-2 mt-1.5 w-1 h-1 rounded-full bg-[var(--orb-muted)] flex-shrink-0"}),f("span",{children:y})]},g$1))})]}),s&&c&&f("button",{onClick:c,className:"flex-shrink-0 ml-3 text-[var(--orb-muted)] hover:text-[var(--orb-fg)] transition-colors",children:f(to,{className:"w-4 h-4"})})]}),d&&f("div",{className:"bg-[color-mix(in_oklch,var(--orb-surface)_50%,transparent)] px-4 py-3 flex justify-end border-t border-[var(--orb-border)]",children:f("button",{onClick:d,className:"px-4 py-1.5 text-sm font-medium text-[var(--orb-on-primary)] bg-[var(--orb-primary)] hover:bg-[var(--orb-p600)] rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-[var(--orb-primary)] focus:ring-offset-2 dark:focus:ring-offset-gray-900",children:m||"\u786E\u8BA4"})})]})},Ei=Bb;var Ob=({title:t="\u76F8\u5173\u63A8\u8350",content:o,suggestions:r,onSuggestionClick:a,maxDisplay:n=5,icon:i,closable:s=false,onClose:c,className:d="",...m})=>{let[p,f$1]=useState(false),[h,u]=useState(""),[v,y]=useState(false),g$1=useMemo(()=>h.trim()?r.filter(S=>S.toLowerCase().includes(h.toLowerCase())):r,[r,h]),C=useMemo(()=>p?g$1:g$1.slice(0,n),[g$1,p,n]),b=S=>{a?.(S);};return !r||r.length===0?null:g("div",{className:`w-full overflow-hidden rounded-lg border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-sm transition-all hover:shadow-md ${d}`,...m,children:[g("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--orb-border)] bg-[var(--orb-p50)]",children:[g("div",{className:"flex items-center space-x-2.5",children:[f("div",{className:"text-[var(--orb-primary)] flex-shrink-0",children:i||f(an,{className:"w-5 h-5"})}),g("div",{className:"flex flex-col",children:[f("h4",{className:"text-sm font-semibold text-[var(--orb-fg)] leading-tight",children:t}),o&&f("span",{className:"text-xs text-[var(--orb-muted)] mt-0.5",children:o})]})]}),g("div",{className:"flex items-center space-x-1",children:[r.length>3&&f("button",{onClick:()=>y(!v),className:`p-1.5 rounded-md transition-colors ${v?"bg-[var(--orb-p100)] text-[var(--orb-status-primary)]":"text-[var(--orb-muted)] hover:text-[var(--orb-fg)] hover:bg-[var(--orb-hover)]"}`,title:v?"\u5173\u95ED\u641C\u7D22":"\u641C\u7D22\u95EE\u9898",children:f(Lo,{className:"w-4 h-4"})}),s&&c&&f("button",{onClick:c,className:"text-[var(--orb-muted)] hover:text-[var(--orb-fg)] p-1.5 rounded-md hover:bg-[var(--orb-hover)] transition-colors",title:"\u5173\u95ED",children:f(to,{className:"w-4 h-4"})})]})]}),v&&f("div",{className:"px-4 py-2 border-b border-[var(--orb-border)] bg-[color-mix(in_oklch,var(--orb-surface)_50%,transparent)]",children:g("div",{className:"relative",children:[f("input",{type:"text",placeholder:"\u641C\u7D22\u76F8\u5173\u95EE\u9898...",value:h,onChange:S=>u(S.target.value),className:"w-full text-sm px-3 py-1.5 pl-8 rounded border border-[var(--orb-border)] bg-[var(--orb-canvas)] text-[var(--orb-fg)] focus:ring-1 focus:ring-[var(--orb-primary)] focus:border-[var(--orb-primary)] outline-none transition-shadow",autoFocus:true}),f(Lo,{className:"absolute left-2.5 top-2 w-3.5 h-3.5 text-[var(--orb-muted)]"})]})}),g("div",{className:"p-2",children:[f("ul",{className:"space-y-1",children:C.map((S,k)=>f("li",{children:g("button",{onClick:()=>b(S),className:"w-full text-left px-3 py-2 rounded-md text-sm text-[var(--orb-fg)] hover:bg-[var(--orb-hover)] hover:text-[var(--orb-status-primary)] transition-colors group flex items-start justify-between",children:[f("span",{children:S}),f(Eo,{className:"w-4 h-4 text-[var(--orb-muted)] group-hover:text-[var(--orb-status-primary)] opacity-0 group-hover:opacity-100 transition-all transform group-hover:translate-x-0.5"})]})},k))}),g$1.length>n&&f("button",{onClick:()=>f$1(!p),className:"w-full text-center py-2 text-xs font-medium text-[var(--orb-muted)] hover:text-[var(--orb-fg)] transition-colors border-t border-[var(--orb-border)] mt-1",children:p?"\u6536\u8D77":`\u67E5\u770B\u5168\u90E8 (${g$1.length})`}),g$1.length===0&&h&&f("div",{className:"text-center py-4 text-sm text-[var(--orb-muted)]",children:"\u6CA1\u6709\u627E\u5230\u5339\u914D\u7684\u5EFA\u8BAE"})]})]})},Li=Ob;var zb=({title:t,content:o,toolName:r,parameters:a,result:n,status:i,duration:s,icon:c,closable:d=false,onClose:m,onAction:p,actionText:f$1,className:h="",...u})=>{let[v,y]=useState(false),[g$1,C]=useState(true),b=()=>{switch(i){case "pending":return {iconColor:"text-[var(--orb-primary)]",badgeBg:"bg-[var(--orb-p50)]",badgeText:"text-[var(--orb-status-primary)]",label:"\u6267\u884C\u4E2D"};case "error":return {iconColor:"text-[var(--orb-status-error)]",badgeBg:"bg-[color-mix(in_oklch,var(--orb-status-error)_10%,transparent)]",badgeText:"text-[var(--orb-status-error)]",label:"\u5931\u8D25"};default:return {iconColor:"text-[var(--orb-status-success)]",badgeBg:"bg-[color-mix(in_oklch,var(--orb-status-success)_8%,transparent)]",badgeText:"text-[var(--orb-status-success)]",label:"\u6210\u529F"}}},S=()=>{switch(i){case "pending":return f(Il,{className:"w-5 h-5 animate-spin"});case "error":return f(gn,{className:"w-5 h-5"});default:return f(en,{className:"w-5 h-5"})}},k=D=>D?D<1e3?`${D}ms`:`${(D/1e3).toFixed(2)}s`:"",x=b(),E=t||r||"\u5DE5\u5177\u8C03\u7528";return g("div",{className:`w-full overflow-hidden rounded-lg border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-sm transition-all hover:shadow-md ${h}`,...u,children:[g("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--orb-border)] bg-[color-mix(in_oklch,var(--orb-surface)_50%,transparent)]",children:[g("div",{className:"flex items-center space-x-3",children:[f("div",{className:`flex-shrink-0 ${x.iconColor}`,children:c||S()}),g("div",{children:[g("div",{className:"flex items-center space-x-2",children:[f("h4",{className:"text-sm font-semibold text-[var(--orb-fg)]",children:E}),f("span",{className:`text-[10px] font-medium px-1.5 py-0.5 rounded ${x.badgeBg} ${x.badgeText}`,children:x.label})]}),r&&t&&g("div",{className:"text-xs text-[var(--orb-muted)] flex items-center mt-0.5",children:[f(ji,{className:"w-3 h-3 mr-1"}),r]})]})]}),g("div",{className:"flex items-center space-x-2 text-xs text-[var(--orb-muted)]",children:[s&&g("div",{className:"flex items-center bg-[var(--orb-surface)] px-2 py-1 rounded",children:[f(xl,{className:"w-3 h-3 mr-1"}),k(s)]}),d&&m&&f("button",{onClick:m,className:"text-[var(--orb-muted)] hover:text-[var(--orb-fg)] transition-colors p-1 rounded",children:f(to,{className:"w-4 h-4"})})]})]}),g("div",{className:"p-4",children:[o&&f("div",{className:"text-sm text-[var(--orb-muted)] mb-4 leading-relaxed",children:o}),a&&g("div",{className:"mb-3",children:[g("button",{onClick:()=>y(!v),className:"flex items-center text-xs font-medium text-[var(--orb-muted)] hover:text-[var(--orb-fg)] dark:text-[var(--orb-muted)] mb-2",children:[v?f(Pr,{className:"w-3.5 h-3.5 mr-1"}):f(Eo,{className:"w-3.5 h-3.5 mr-1"}),f("div",{className:"w-3.5 h-3.5 mr-1.5"}),"\u8F93\u5165\u53C2\u6570"]}),v&&f("div",{className:"bg-[var(--orb-surface)] dark:bg-[var(--orb-canvas)] rounded border border-[var(--orb-border)] overflow-hidden",children:f("pre",{className:"p-3 text-xs font-mono text-[var(--orb-muted)] overflow-x-auto",children:JSON.stringify(a,null,2)})})]}),n&&g("div",{children:[g("button",{onClick:()=>C(!g$1),className:"flex items-center text-xs font-medium text-[var(--orb-muted)] hover:text-[var(--orb-fg)] dark:text-[var(--orb-muted)] mb-2",children:[g$1?f(Pr,{className:"w-3.5 h-3.5 mr-1"}):f(Eo,{className:"w-3.5 h-3.5 mr-1"}),f(ji,{className:"w-3.5 h-3.5 mr-1.5"}),"\u6267\u884C\u7ED3\u679C"]}),g$1&&f("div",{className:"bg-[var(--orb-surface)] dark:bg-[var(--orb-canvas)] rounded border border-[var(--orb-border)] overflow-hidden",children:f("pre",{className:"p-3 text-xs font-mono text-[var(--orb-muted)] overflow-x-auto",children:typeof n=="string"?n:JSON.stringify(n,null,2)})})]}),p&&f("div",{className:"mt-3 pt-3 border-t border-[var(--orb-border)] flex justify-end",children:f("button",{onClick:p,className:"px-4 py-1.5 text-sm font-medium text-[var(--orb-on-primary)] bg-[var(--orb-primary)] hover:bg-[var(--orb-p600)] rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-[var(--orb-primary)] focus:ring-offset-2 dark:focus:ring-offset-gray-900",children:f$1||"\u6267\u884C\u64CD\u4F5C"})})]})]})},Fi=zb;var Hb=({data:t})=>{if(!t)return null;let o=useMemo(()=>{let r=[],a=[],n="\u6570\u636E\u8868\u683C";return Array.isArray(t)?(r=t,r.length>0&&(a=Object.keys(r[0]).map(i=>({id:i,label:i.charAt(0).toUpperCase()+i.slice(1),numeric:typeof r[0][i]=="number"})))):typeof t=="object"&&(n=t.title||n,r=Array.isArray(t.rows)?t.rows:Array.isArray(t.data)?t.data:[],Array.isArray(t.columns)?a=t.columns.map(s=>({id:s.key||s.id,label:s.title||s.label,numeric:s.dataType==="number"||s.numeric})):r.length>0&&(a=Object.keys(r[0]).map(s=>({id:s,label:s,numeric:typeof r[0][s]=="number"})))),r=r.map((i,s)=>({...i,id:i.id||`row_${s}`})),{title:n,columns:a,rows:r}},[t]);return o.rows.length===0?f("div",{className:"w-full my-4 p-4 border border-dashed border-[var(--orb-border)] rounded text-center text-[var(--orb-muted)]",children:"\u6682\u65E0\u8868\u683C\u6570\u636E"}):f("div",{className:"w-full my-4",children:f(qo,{appId:"agent-ui-table-card",title:o.title,columns:o.columns,rows:o.rows,count:o.rows.length,rowKey:"id",fitContainer:false,maxHeight:"500px",rowsPerPage:10,rowsPerPageOptions:[5,10,20,50]})})},Bi=Hb;var Wb=({title:t,subtitle:o,data:r,type:a,config:n={}})=>{let i=()=>{switch(a){case "bar-chart-card":return f(Yi,{className:"w-4 h-4 text-[var(--orb-chart-1)]"});case "line-chart-card":return f(Tl,{className:"w-4 h-4 text-[var(--orb-chart-positive)]"});case "pie-chart-card":return f(Al,{className:"w-4 h-4 text-[var(--orb-chart-2)]"});case "combo-chart-card":return f(hl,{className:"w-4 h-4 text-[var(--orb-chart-5)]"});case "heatmap-chart-card":return f(Pl,{className:"w-4 h-4 text-[var(--orb-chart-negative)]"});case "fishbone-chart-card":return f(kl,{className:"w-4 h-4 text-[var(--orb-chart-4)]"});case "waterfall-chart-card":return f(zl,{className:"w-4 h-4 text-[var(--orb-chart-6)]"});case "google-map-card":return f(Ca,{className:"w-4 h-4 text-[var(--orb-status-primary)]"});case "amap-card":return f(Ml,{className:"w-4 h-4 text-[var(--orb-status-primary)]"});default:return f(Yi,{className:"w-4 h-4"})}},s=()=>{if(!r&&a!=="google-map-card"&&a!=="amap-card")return f("div",{className:"text-[var(--orb-muted)] text-sm p-4 text-center",children:"No data available"});try{switch(a){case "bar-chart-card":return f(Ba,{data:r,orientation:n.orientation||"horizontal",valueSuffix:n.valueSuffix||"",minHeight:n.minHeight});case "line-chart-card":return f(Cd,{data:r,color:n.color,valueSuffix:n.valueSuffix||"",height:n.height});case "pie-chart-card":let c=r.reduce((m,p)=>m+(Number(p.value)||0),0),d=r.map(m=>({name:m.name,value:Number(m.value)||0,percent:typeof m.percent=="number"?m.percent:c>0?(Number(m.value)||0)/c*100:0}));return f(Qn,{data:d,variant:n.variant||"donut",size:n.size,colors:n.colors});case "combo-chart-card":return f(xd,{data:r,barColor:n.barColor,lineColor:n.lineColor});case "heatmap-chart-card":return f(Sd,{data:r});case "fishbone-chart-card":return f(wd,{branches:r,effect:n.effect||t||"Problem"});case "waterfall-chart-card":return f(kd,{data:r,height:n.height});case "google-map-card":return f(Pd,{embedUrl:n.embedUrl||r&&r[0]?.embedUrl,apiKey:n.apiKey,query:n.query||r&&r[0]?.query||t,height:n.height});case "amap-card":return f(Td,{embedUrl:n.embedUrl||r&&r[0]?.embedUrl,keyword:n.keyword||r&&r[0]?.keyword||t,height:n.height});default:return g("div",{className:"text-[var(--orb-muted)] text-sm p-4 text-center",children:["Unsupported chart type: ",a]})}}catch(c){return console.error("Error rendering chart:",c),f("div",{className:"text-[var(--orb-status-error)] text-sm p-4 text-center",children:"Error rendering chart"})}};return g("div",{className:"w-full overflow-hidden rounded-lg border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-sm transition-all hover:shadow-md",children:[g("div",{className:"flex items-center px-4 py-3 border-b border-[var(--orb-border)] bg-[color-mix(in_oklch,var(--orb-surface)_50%,transparent)]",children:[f("div",{className:"mr-2 flex-shrink-0",children:i()}),g("div",{className:"flex-1 min-w-0",children:[f("h3",{className:"text-sm font-semibold text-[var(--orb-fg)] truncate",children:t}),o&&f("p",{className:"text-xs text-[var(--orb-muted)] mt-0.5 truncate",children:o})]})]}),g("div",{className:"p-4",children:[f("div",{className:"overflow-x-auto",children:s()}),f("div",{className:"mt-3",children:g("details",{className:"text-xs text-[var(--orb-muted)]",children:[f("summary",{className:"cursor-pointer hover:text-[var(--orb-fg)] transition-colors select-none font-medium opacity-60 hover:opacity-100",children:"View Raw Data"}),f("pre",{className:"mt-2 p-2 bg-[var(--orb-surface)] dark:bg-[var(--orb-canvas)] rounded border border-[var(--orb-border)] overflow-x-auto max-h-40",children:JSON.stringify(r,null,2)})]})})]})]})},Oi=Wb;var $b=({type:t,manifest:o})=>g("div",{className:"w-full overflow-hidden rounded-lg border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-sm transition-all hover:shadow-md",children:[g("div",{className:"flex items-center px-4 py-3 border-b border-[var(--orb-border)] bg-[var(--orb-p50)]",children:[f("div",{className:"w-4 h-4 mr-2 text-[var(--orb-status-primary)]"}),g("h3",{className:"text-sm font-semibold text-[var(--orb-fg)]",children:["SAP Card: ",t]})]}),f("div",{className:"p-4",children:f("div",{className:"bg-[var(--orb-surface)] dark:bg-[var(--orb-canvas)] p-3 rounded border border-[var(--orb-border)] overflow-x-auto",children:f("pre",{className:"text-xs font-mono text-[var(--orb-muted)] whitespace-pre-wrap",children:JSON.stringify(o,null,2)})})})]}),zi=$b;var Vi=t=>{let o;try{o=JSON.parse(t);}catch{return null}return o&&typeof o=="object"&&((o.type==="bar-chart-card"||o.type==="line-chart-card"||o.type==="pie-chart-card"||o.type==="combo-chart-card"||o.type==="heatmap-chart-card"||o.type==="fishbone-chart-card"||o.type==="waterfall-chart-card"||o.type==="google-map-card"||o.type==="amap-card")&&o.title||(o.type==="sap-analytical-card"||o.type==="sap-list-card"||o.type==="sap-object-card"||o.type==="sap-component-card")&&o.manifest||o.type==="error-card"||o.type==="warning-card"||o.type==="suggestions-card"||o.type==="tool-result-card"||o.type==="table"&&o.data)?o:null};var Xb=({content:t,theme:o,size:r="base",className:a,enableCodeHighlight:n=true,enableMermaid:i=true,messageId:s,cardHooks:c})=>{let d=useMemo(()=>t?t.replace(/<think>([\s\S]*?)<\/think>/g,(h,u)=>`<div data-component="thinkbox" data-think-content="${encodeURIComponent(u.trim())}"></div>`):"",[t]),m=(h,u,v,y,g)=>{c?.onCardEvent?.({messageId:s,cardType:h,action:u,title:v,payload:y,rawData:g});},p=(h,u,v,y,g,C)=>{if(!(!g&&!c?.onCardEvent))return (...b)=>{let S=g?.(...b),k=C?C(...b):void 0;return m(h,u,v,k,y),S}},f$1=useMemo(()=>({div(h){let{"data-component":u,"data-think-content":v,...y}=h;return u==="thinkbox"&&v?f(ou,{content:decodeURIComponent(v),theme:o,size:r,defaultExpanded:false}):f("div",{...y})},table({children:h}){return f("div",{className:"my-4 w-full overflow-x-auto rounded-lg border border-[var(--orb-border)]",children:f("table",{className:"w-full min-w-[520px] border-collapse text-sm",children:h})})},thead({children:h}){return f("thead",{className:"bg-[color-mix(in_oklch,var(--orb-surface)_60%,transparent)]",children:h})},tbody({children:h}){return f("tbody",{className:"bg-[var(--orb-canvas)] dark:bg-[var(--orb-canvas)]",children:h})},tr({children:h}){return f("tr",{className:"border-b border-[var(--orb-border)] last:border-b-0",children:h})},th({children:h,align:u}){return f("th",{className:`px-3 py-2 font-semibold text-[var(--orb-fg)] ${u==="center"?"text-center":u==="right"?"text-right":"text-left"}`,children:h})},td({children:h,align:u}){return f("td",{className:`px-3 py-2 text-[var(--orb-fg)] align-top ${u==="center"?"text-center":u==="right"?"text-right":"text-left"}`,children:h})},code({className:h,children:u,...v}){let y=/language-([\w-]+)/.exec(h||""),g=y?y[1]:"",C=String(u);if(!y&&!C.includes(`
17
- `))return f("code",{children:u});let S=C.replace(/\n$/,"");if(i&&g==="mermaid")return f(iu,{content:S});if(g==="json"){let k=Vi(S);if(k)switch(k.type){case "table":return f(Bi,{data:k.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 f(Oi,{...k});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return f(zi,{...k});case "error-card":{let x=k;return f(Ni,{...x,onClose:p("error-card","close",x.title,x,x.onClose),onRetry:p("error-card","retry",x.title,x,x.onRetry)})}case "warning-card":{let x=k,E=x.onConfirm?p("warning-card","confirm",x.title,x,x.onConfirm):x.actionText&&c?.onCardEvent?p("warning-card","confirm",x.title,x):void 0;return f(Ei,{...x,onClose:p("warning-card","close",x.title,x,x.onClose),onConfirm:E})}case "suggestions-card":{let x=k;return f(Li,{...x,onClose:p("suggestions-card","close",x.title,x,x.onClose),onSuggestionClick:p("suggestions-card","suggestion-click",x.title,x,x.onSuggestionClick,E=>({suggestion:E}))})}case "tool-result-card":{let x=k;return f(Fi,{...x,onClose:p("tool-result-card","close",x.title,x,x.onClose),onAction:p("tool-result-card","action",x.title,x,x.onAction)})}}}return n?f(ru,{content:S,language:g,className:"not-prose"}):f("code",{className:h,...v,children:u})}}),[o,r,i,n,c,s]);return f("div",{className:ut("markdown-body max-w-none",a),children:f(Gb,{remarkPlugins:[_b,Ub],rehypePlugins:[Kb,qb],components:f$1,children:d})})},Hi=Xb;var Yb=({content:t,messageId:o,cardHooks:r})=>{let a=(s,c,d,m,p)=>{r?.onCardEvent?.({messageId:o,cardType:s,action:c,title:d,payload:m,rawData:p});},n=(s,c,d,m,p,f)=>{if(!(!p&&!r?.onCardEvent))return (...h)=>{let u=p?.(...h),v=f?f(...h):void 0;return a(s,c,d,v,m),u}},i=Vi(t);if(i)switch(i.type){case "table":return f(Bi,{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 f(Oi,{...i});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return f(zi,{...i});case "error-card":{let s=i;return f(Ni,{...s,onClose:n("error-card","close",s.title,s,s.onClose),onRetry:n("error-card","retry",s.title,s,s.onRetry)})}case "warning-card":{let s=i,c=s.onConfirm?n("warning-card","confirm",s.title,s,s.onConfirm):s.actionText&&r?.onCardEvent?n("warning-card","confirm",s.title,s):void 0;return f(Ei,{...s,onClose:n("warning-card","close",s.title,s,s.onClose),onConfirm:c})}case "suggestions-card":{let s=i;return f(Li,{...s,onClose:n("suggestions-card","close",s.title,s,s.onClose),onSuggestionClick:n("suggestions-card","suggestion-click",s.title,s,s.onSuggestionClick,c=>({suggestion:c}))})}case "tool-result-card":{let s=i;return f(Fi,{...s,onClose:n("tool-result-card","close",s.title,s,s.onClose),onAction:n("tool-result-card","action",s.title,s,s.onAction)})}}return f("div",{className:"dynamic-card-fallback",children:f(Hi,{content:t,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:o,cardHooks:r})})},pu=Yb;var Qs=class{static analyze(o){if(!o.trim())return {blocks:[],hasComplexContent:false,overallType:"simple"};let a=/```json\s*\{\s*"type":\s*"[^"]+"/g.test(o),n=/<[^>]+>[\s\S]*?<\/[^>]+>/.test(o),i=o.includes("NQ#")||o.includes("data-component");return a||n||i?{blocks:[{type:"mixed",content:o,startIndex:0,endIndex:o.length}],hasComplexContent:true,overallType:"complex"}:{blocks:[{type:"markdown",content:o,startIndex:0,endIndex:o.length}],hasComplexContent:false,overallType:"simple"}}},Qb=({content:t,className:o="",messageId:r,cardHooks:a})=>{let n=Yt__default.useMemo(()=>Qs.analyze(t),[t]);return f("div",{className:`universal-content-renderer ${o}`,children:n.blocks.map((i,s)=>i.type==="mixed"||i.type==="json-card"?f(pu,{content:i.content,messageId:r,cardHooks:a},`block-${s}`):f(Hi,{content:i.content,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:r,cardHooks:a},`block-${s}`))})},uu=Qb;var jb=({content:t,isStreaming:o=true,onComplete:r,className:a="",streamIntervalMs:n=24,streamChunkSize:i=3,messageId:s,cardHooks:c})=>{let[d,m]=useState(o?0:t.length),[p,f$1]=useState(!o);useEffect(()=>{if(o){m(0),f$1(false);return}m(t.length),f$1(true);},[t,o]),useEffect(()=>{if(!o||p)return;if(d>=t.length){f$1(true),r?.();return}let g=window.setTimeout(()=>{m(C=>Math.min(C+i,t.length));},n);return ()=>{window.clearTimeout(g);}},[t.length,p,o,r,i,n,d]);let h=()=>{o&&!p&&(m(t.length),f$1(true),r?.());},u=o?t.slice(0,d):t,v=o&&!p,y=o&&!p;return g("div",{className:`streaming-markdown ${a}`,onClick:h,style:{cursor:o?"pointer":"default"},children:[g("div",{className:"relative",children:[f(uu,{content:u,messageId:s,cardHooks:c}),v&&f("span",{className:"inline-block w-[2px] h-[13px] ml-0.5 animate-pulse",style:{verticalAlign:"text-bottom",backgroundColor:"var(--orb-primary, #154194)"}})]}),y&&f("div",{className:"streaming-hint",style:{fontSize:"9px",color:"var(--orb-muted)",marginTop:"8px",fontStyle:"italic",opacity:.7},children:"\u70B9\u51FB\u6B64\u5904\u663E\u793A\u5B8C\u6574\u5185\u5BB9"})]})},fu=jb;var hu=({buttons:t,className:o})=>{let r=a=>{switch(a){case "copy":return f(on,{size:14});case "refresh":return f(pn,{size:14});case "volume":return f(Hl,{size:14});case "like":return f(Bl,{size:14});case "dislike":return f(Fl,{size:14});default:return null}};return f("div",{className:ut("flex items-center gap-1",o),children:t.map((a,n)=>f("button",{onClick:a.onClick,disabled:a.disabled,"aria-busy":a.loading||void 0,className:ut("p-1.5 rounded-md transition-colors","text-[var(--orb-muted)] hover:text-[var(--orb-fg)] dark:text-[var(--orb-muted)] dark:hover:text-[var(--orb-fg)]","hover:bg-[var(--orb-hover)]","disabled:opacity-50 disabled:cursor-not-allowed",a.active&&"text-[var(--orb-primary)] bg-[var(--orb-p50)]",a.type==="refresh"&&a.loading&&"animate-spin"),title:a.type,type:"button",children:r(a.type)},`${a.type}-${n}`))})};var Wi=({message:t,onStreamingComplete:o,assistantActions:r,streamIntervalMs:a,streamChunkSize:n,cardHooks:i})=>{let s={lineHeight:1.55,fontSize:13,fontWeight:300,fontFamily:'var(--orb-font, "Montserrat", system-ui, sans-serif)',color:"var(--orb-fg, #555555)",borderRadius:"var(--orb-r, 10px)",padding:"10px 14px"},c={marginTop:6,fontSize:11,color:"var(--orb-muted, #8c8c8c)"};if(t.type==="assistant"){let d=!!(r?.isResponding||t.isStreaming);return f("div",{className:"mb-4 flex justify-start",children:g("div",{className:"mr-auto w-full",style:{...s,background:"var(--orb-surface, #f5f5f5)",border:"1px solid var(--orb-border, #dbdbdb)"},children:[f(fu,{content:t.content,isStreaming:t.isStreaming??false,onComplete:o,streamIntervalMs:a,streamChunkSize:n,messageId:t.id,cardHooks:i}),t.content&&r?.isLatestAssistant&&f("div",{className:"mt-3 flex flex-row justify-start gap-2 border-t pt-2",style:{borderColor:"var(--orb-border, #dbdbdb)"},children:f(hu,{buttons:[{type:"refresh",onClick:()=>{r?.onRegenerate?.();},disabled:d||!r?.onRegenerate,loading:d},{type:"copy",onClick:()=>navigator.clipboard.writeText(t.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"})}),f("div",{style:c,children:t.timestamp.toLocaleTimeString()})]})})}return f("div",{className:"mb-4 flex justify-end",children:g("div",{className:"ml-auto max-w-[80%]",style:{...s,background:"var(--orb-p50, #eef2f9)",border:"1px solid var(--orb-p100, #e4e9f5)"},children:[f("div",{className:"whitespace-pre-wrap",children:t.content}),f("div",{style:c,children:t.timestamp.toLocaleTimeString()})]})})};var bu=({onTextUpdate:t,onComplete:o,onCancel:r,disabled:a,className:n})=>{let{isRecording:i,startRecording:s,stopRecording:c}=la({onTextUpdate:t,onComplete:m=>{o?.(m);},onError:m=>{console.error("Voice input error:",m),r?.();}});return f("button",{onClick:async()=>{i?c():await s();},disabled:a,className:ut("transition-all duration-200 flex items-center justify-center rounded-full",i?"bg-[color-mix(in_oklch,var(--orb-status-error)_12%,transparent)] text-[var(--orb-status-error)] hover:bg-[color-mix(in_oklch,var(--orb-status-error)_20%,transparent)] animate-pulse":"bg-transparent hover:bg-[var(--orb-hover)] text-[var(--orb-muted)] active:scale-95",a&&"opacity-50 cursor-not-allowed",n),title:i?"Stop recording":"Start recording",type:"button",children:i?f(Kc,{size:16}):f(qc,{size:16})})};var Zt={container:"w-full max-w-4xl mx-auto",inputContainer:ut("w-full flex flex-col border border-[var(--orb-border,#dbdbdb)] bg-[var(--orb-canvas,#ffffff)] transition-colors duration-200","rounded-[var(--orb-r,10px)]","focus-within:border-[var(--orb-primary,#154194)] focus-within:ring-1 focus-within:ring-[var(--orb-focus-ring,#e4e9f5)]"),dragActive:"border-[var(--orb-primary,#154194)] bg-[var(--orb-p50,#eef2f9)]",textareaWrapper:"flex-1 relative flex items-center",textarea:ut("w-full outline-none appearance-none resize-none bg-transparent border-none text-sm font-normal py-3 px-3","placeholder:text-[var(--orb-muted,#8c8c8c)] placeholder:font-normal","text-[var(--orb-fg,#555555)] selection:bg-[var(--orb-p100,#e4e9f5)]","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-[var(--orb-border)]"),filePreviewArea:"px-4 pt-3 pb-1 flex flex-wrap gap-2",fileTag:ut("flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs font-medium","bg-[var(--orb-surface,#f5f5f5)] text-[var(--orb-fg,#555555)]","border border-[var(--orb-border,#dbdbdb)]","transition-all hover:bg-[var(--orb-hover,#eef2f9)]"),buttonBase:"flex items-center justify-center transition-all duration-200 rounded-full",buttonSmall:"h-[38px] w-[38px] shrink-0 md:h-8 md:w-8",buttonNormal:ut("bg-transparent hover:bg-[var(--orb-hover,#eef2f9)] text-[var(--orb-muted,#8c8c8c)] hover:text-[var(--orb-fg,#555555)]","cursor-pointer active:scale-95"),sendButton:ut("cursor-pointer bg-[var(--orb-primary,#154194)] hover:bg-[var(--orb-p600,#0e2d63)] text-[var(--orb-on-primary)] shadow-none active:scale-95"),sendButtonDisabled:ut("cursor-not-allowed opacity-40 bg-[var(--orb-disabled-bg,#f5f5f5)] text-[var(--orb-disabled-fg,#8c8c8c)]"),stopButton:ut("cursor-pointer bg-[var(--orb-err,#c43f02)] hover:opacity-90 text-[var(--orb-on-primary)] shadow-none active:scale-95")},ev={padding:0,lineHeight:"1.5",border:"none !important",boxShadow:"none !important",backgroundColor:"transparent",height:"auto",fontFeatureSettings:'"liga" 1, "kern" 1',WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},tv=({enabled:t,onClick:o})=>f("button",{className:ut(Zt.buttonBase,Zt.buttonSmall,Zt.buttonNormal),onClick:o,disabled:!t,"aria-label":"Upload file",type:"button",children:f(kc,{size:16})}),ov=()=>g("button",{className:ut(Zt.buttonBase,"h-[38px] gap-1 rounded-full px-2.5 md:h-8 md:px-2",Zt.buttonNormal),"aria-label":"Tools",type:"button",children:[f(Vc,{size:15}),f("span",{className:"text-xs font-medium",children:"Tools"})]}),rv=({canSend:t,isResponding:o,onSend:r,onStop:a})=>o?f("button",{className:ut(Zt.buttonBase,Zt.buttonSmall,Zt.stopButton),onClick:a,"aria-label":"Stop generating",type:"button",children:f(od,{size:15})}):f("button",{className:ut(Zt.buttonBase,Zt.buttonSmall,t?Zt.sendButton:Zt.sendButtonDisabled),onClick:r,disabled:!t,"aria-label":"Send message",type:"button",children:f(Qc,{size:16,className:t?"text-[var(--orb-on-primary,#ffffff)]":"text-[var(--orb-disabled-fg,#8c8c8c)]"})}),vu=({onSend:t,onStop:o,isResponding:r=false,placeholder:a,getText:n})=>{let[i,s]=useState(""),[c,d]=useState([]),[m,p]=useState(false),[f$1,h]=useState(false),u=useRef(null),v=a||(n?n("00019","Type a message..."):"Type a message..."),y=(i.trim().length>0||c.length>0)&&!r,g$1={enabled:true},C=useCallback(O=>{s(O.target.value),O.target.style.height="auto",O.target.style.height=`${Math.min(O.target.scrollHeight,200)}px`;},[]),b=useCallback(O=>{if(O.target.files&&O.target.files.length>0){let U=Array.from(O.target.files);d(z=>{let K=U.filter(q=>z.some(H=>H.name===q.name&&H.size===q.size));K.length>0&&console.warn("Duplicate files ignored:",K.map(q=>q.name));let W=U.filter(q=>!z.some(H=>H.name===q.name&&H.size===q.size));return [...z,...W]}),u.current&&(u.current.value="");}},[]),S=useCallback(O=>{d(U=>U.filter((z,K)=>K!==O));},[]),k=useCallback(()=>{u.current?.click();},[]),x=useCallback(async()=>{if(!y)return;let O=i,U=[...c];s(""),d([]),u.current&&(u.current.value="");try{await t(O,U);}catch(z){console.error("Failed to send message:",z),s(O),d(U);}},[i,y,t,c]),E=useCallback(O=>{O.key==="Enter"&&!O.shiftKey&&!m&&(O.preventDefault(),x());},[x,m]),D=useCallback(()=>{p(true);},[]),T=useCallback(()=>{p(false);},[]),N=useCallback(O=>{s(O);},[]),R=useCallback(O=>{s(O);},[]),w=useCallback(()=>{},[]),M=useCallback(O=>{O.preventDefault(),h(true);},[]),I=useCallback(O=>{O.preventDefault(),h(false);},[]),L=useCallback(O=>{if(O.preventDefault(),h(false),O.dataTransfer.files&&O.dataTransfer.files.length>0){let U=Array.from(O.dataTransfer.files);d(z=>[...z,...U]);}},[]);return f("div",{className:Zt.container,children:g("div",{className:"relative",children:[f("input",{type:"file",multiple:true,className:"hidden",ref:u,onChange:b}),g("div",{className:ut(Zt.inputContainer,f$1&&Zt.dragActive),style:{borderRadius:"24px"},onDragOver:M,onDragLeave:I,onDrop:L,children:[c.length>0&&f("div",{className:Zt.filePreviewArea,children:c.map((O,U)=>g("div",{className:Zt.fileTag,children:[f(Wc,{sx:{fontSize:16},className:"text-[var(--orb-primary)]"}),f("span",{className:"truncate max-w-[150px]",children:O.name}),f("button",{onClick:()=>S(U),className:"ml-1 hover:text-[var(--orb-status-error)] focus:outline-none",type:"button",children:f(Nc,{sx:{fontSize:16}})})]},`${O.name}-${U}`))}),g("div",{className:"flex w-full flex-col p-2",children:[f("div",{className:ut(Zt.textareaWrapper,"min-h-[52px] px-2 pb-2 pt-1.5 md:min-h-[44px]"),children:f("textarea",{className:ut(Zt.textarea,"min-h-[24px] py-0 px-0"),placeholder:v,value:i,onChange:C,onKeyDown:E,onCompositionStart:D,onCompositionEnd:T,style:ev,"aria-label":"Message input",spellCheck:false,rows:1})}),g("div",{className:"flex items-center justify-between px-1 pb-0.5",children:[g("div",{className:"flex items-center gap-1",role:"toolbar","aria-label":"Input tools",children:[f(tv,{enabled:g$1.enabled,onClick:k}),f(ov,{})]}),g("div",{className:"flex items-center gap-1",children:[f(bu,{onTextUpdate:N,onComplete:R,onCancel:w,disabled:r,className:Zt.buttonSmall}),f(rv,{canSend:y,isResponding:r,onSend:x,onStop:o})]})]})]})]})]})})};var Cu=({messages:t,onSend:o,onStop:r,onRegenerate:a,isResponding:n=false,className:i,placeholder:s,streamIntervalMs:c,streamChunkSize:d,onMessageStreamingComplete:m,cardHooks:p,showInput:f$1=true,statusLine:h})=>{let u=useRef(null),v=useRef(t.length);return useEffect(()=>{t.length>v.current&&u.current?.scrollIntoView({behavior:"smooth"}),v.current=t.length;},[t]),g("div",{className:ut("flex flex-col h-full w-full relative",i),children:[g("div",{className:"flex-1 overflow-y-auto px-4 py-4 space-y-6 scrollbar-thin scrollbar-thumb-[var(--orb-border)]",children:[t.map((y,g)=>{let C=y.type==="assistant"&&g===t.length-1,b=y.type==="assistant"?{isLatestAssistant:C,isResponding:n,onRegenerate:a?()=>a(y.id):void 0}:void 0;return f(Wi,{message:y,assistantActions:b,onStreamingComplete:()=>m?.(y.id),streamIntervalMs:c,streamChunkSize:d,cardHooks:p},y.id)}),h,f("div",{ref:u})]}),f$1&&f("div",{className:"border-t border-[var(--orb-border,#dbdbdb)] bg-[var(--orb-canvas,#ffffff)] p-4 z-10",children:f(vu,{onSend:o||(async()=>{}),onStop:r||(()=>{}),isResponding:n,placeholder:s})})]})};var xu={idle:"Idle",running:"Working",success:"Success",error:"Error",pending:"Pending"},Su=({title:t="AI Agent",description:o,headerActions:r,className:a,agentStatus:n,statusText:i,onHeaderPointerDown:s,showInput:c=false,...d})=>{let m=n??(d.isResponding?"running":"idle"),p=m==="running"||m==="pending",f$1=[xu[m],o].filter(Boolean).join(" \xB7 ");return g("div",{className:ut("orb-agent-panel",a),children:[g("div",{className:ut("orb-agent-header",s&&"cursor-grab active:cursor-grabbing"),onPointerDown:s,children:[f("span",{className:"orb-agent-avatar","aria-hidden":"true",children:"AI"}),g("div",{className:"min-w-0 flex-1",children:[f("div",{className:"orb-agent-title",children:t}),g("div",{className:"orb-agent-subtitle",children:[f("span",{className:"orb-agent-dot","data-active":p||void 0}),f("span",{className:"truncate",children:f$1||"Agent"})]})]}),r&&f("div",{className:"ml-auto flex flex-none items-center gap-1",children:r})]}),f("div",{className:"relative min-h-0 flex-1",children:f(Cu,{...d,showInput:c,statusLine:p?g("div",{className:ut("orb-agent-status-line","mb-1"),children:[f("span",{className:"orb-agent-spinner","aria-hidden":"true"}),f("span",{children:i??`${xu[m]}\u2026`})]}):void 0})})]})};var Pu=520,sv=88,lv=88,cv=24,Gi=640,Tu=(t,o,r)=>Math.min(Math.max(t,o),Math.max(o,r)),js=t=>typeof t=="number"?`${t}px`:t,dv=t=>t instanceof HTMLElement?!!t.closest('button,input,a,textarea,select,[role="button"],[contenteditable="true"]'):false,$2=({anchor:t,defaultAnchor:o="right",onAnchorChange:r,width:a=Pu,top:n=sv,bottom:i=lv,inset:s=cv,zIndex:c=1300,shellClassName:d,shellStyle:m,className:p,onHeaderPointerDown:f$1,...h})=>{let u=useRef(null),v=useRef(null),[y,g]=useState(o),[C,b]=useState(0),[S,k]=useState(typeof a=="number"?a:Pu),[x,E]=useState(0),[D,T]=useState(false),N=t??y;useEffect(()=>{let z=()=>b(window.innerWidth);return z(),window.addEventListener("resize",z),()=>window.removeEventListener("resize",z)},[]),useLayoutEffect(()=>{let z=()=>{let W=u.current?.getBoundingClientRect();W?.width?k(W.width):typeof a=="number"&&k(a);};if(z(),!u.current||typeof ResizeObserver>"u")return;let K=new ResizeObserver(z);return K.observe(u.current),()=>K.disconnect()},[a]);let R=useCallback(z=>{if(!C)return s;let K=C<Gi?12:s,W=Math.max(K,C-S-K);return C<Gi||z==="left"?K:z==="center"?Tu((C-S)/2,K,W):W},[s,S,C]),w=useCallback(z=>["left","center","right"].reduce((W,q)=>{let H=Math.abs(z-R(W));return Math.abs(z-R(q))<H?q:W},"right"),[R]),M=useCallback(z=>{t===void 0&&g(z),r?.(z);},[t,r]);useEffect(()=>{D||E(R(N));},[R,D,N]);let I=useCallback(z=>{f$1?.(z),!(z.defaultPrevented||dv(z.target))&&(z.preventDefault(),z.currentTarget.setPointerCapture(z.pointerId),v.current={pointerId:z.pointerId,startClientX:z.clientX,startX:x,currentX:x,captureElement:z.currentTarget},T(true));},[f$1,x]),L=useCallback(z=>{let K=v.current;if(!K||K.pointerId!==z.pointerId)return;let W=C<Gi?12:s,q=Math.max(W,C-S-W),H=Tu(K.startX+z.clientX-K.startClientX,W,q);K.currentX=H,E(H);},[s,S,C]),O=useCallback(z=>{let K=v.current;if(!K||K.pointerId!==z.pointerId)return;try{K.captureElement.releasePointerCapture(z.pointerId);}catch{}let W=w(K.currentX);v.current=null,T(false),M(W),E(R(W));},[R,M,w]),U=useMemo(()=>({position:"fixed",top:js(n),bottom:js(i),left:x,width:js(a),maxWidth:`calc(100vw - ${C<Gi?24:s*2}px)`,zIndex:c,pointerEvents:"auto",transition:D?"none":"left 180ms ease-out",touchAction:"none",...m}),[i,s,D,x,m,n,C,a,c]);return f("div",{ref:u,className:ut("orbcafe-floating-agent-panel min-w-0",d),"data-anchor":N,"data-dragging":D?"true":"false",style:U,onPointerMove:L,onPointerUp:O,onPointerCancel:O,children:f(Su,{...h,className:p,onHeaderPointerDown:I})})};var mv={"top-left":"bottom-right","top-right":"bottom-left","bottom-left":"top-right","bottom-right":"top-left"},Z2=({messages:t,onSend:o,onRegenerate:r,isResponding:a=false,className:n,placeholder:i,title:s="Copilot",corner:c="bottom-right",onCollapse:d,onHeaderPointerDown:m,onPlusClick:p,onMicClick:f$1,streamIntervalMs:h,streamChunkSize:u,onMessageStreamingComplete:v,cardHooks:y})=>{let[g$1,C]=useState(""),[b,S]=useState(false),k=useRef(null),x=mv[c];useEffect(()=>{k.current?.scrollIntoView({behavior:"smooth"});},[t,a]);let E=useCallback(async()=>{let T=g$1.trim();!T||a||(C(""),await o(T));},[a,o,g$1]),D=useCallback(async T=>{T.key==="Enter"&&!b&&(T.preventDefault(),await E());},[E,b]);return g("div",{className:ut("relative flex h-full w-full min-h-[460px] min-w-[340px] flex-col overflow-hidden rounded-3xl border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-none dark:bg-[var(--orb-surface-2)]",n),children:[d&&f("button",{onClick:d,className:ut("absolute z-20 flex h-10 w-10 items-center justify-center rounded-full transition-colors hover:bg-transparent dark:hover:bg-transparent",x==="top-left"&&"-left-2 -top-2",x==="top-right"&&"-right-2 -top-2",x==="bottom-left"&&"-bottom-2 -left-2",x==="bottom-right"&&"-bottom-2 -right-2"),type:"button","aria-label":"Collapse Copilot",children:f("span",{className:ut("block h-4 w-4 border-[var(--orb-ai-accent)]",x==="top-left"&&"rounded-tl-full border-l-[3px] border-t-[3px]",x==="top-right"&&"rounded-tr-full border-r-[3px] border-t-[3px]",x==="bottom-left"&&"rounded-bl-full border-b-[3px] border-l-[3px]",x==="bottom-right"&&"rounded-br-full border-b-[3px] border-r-[3px]")})}),g("div",{className:"flex items-center justify-between border-b border-[var(--orb-border)] px-4 py-3",onPointerDown:m,children:[f("div",{className:"flex items-center",children:f("h3",{className:"text-base font-semibold tracking-tight text-[var(--orb-fg)]",children:s})}),f("div",{})]}),g("div",{className:"flex-1 overflow-y-auto px-3 py-3 space-y-5 scrollbar-thin scrollbar-thumb-[var(--orb-border)]",children:[t.map((T,N)=>{let R=T.type==="assistant"&&N===t.length-1,w=T.type==="assistant"?{isLatestAssistant:R,isResponding:a,onRegenerate:r?()=>r(T.id):void 0}:void 0;return f(Wi,{message:T,assistantActions:w,onStreamingComplete:()=>v?.(T.id),streamIntervalMs:h,streamChunkSize:u,cardHooks:y},T.id)}),f("div",{ref:k})]}),f("div",{className:"border-t border-[var(--orb-border)] px-3 py-3",children:g("div",{className:"flex items-center gap-2 rounded-xl border border-[var(--orb-p300)] bg-[var(--orb-canvas)] px-2 py-1.5 dark:bg-[var(--orb-surface-2)]",children:[f("button",{className:"flex h-8 w-8 items-center justify-center rounded-full text-[var(--orb-muted)] transition-colors hover:bg-[var(--orb-surface)] hover:text-[var(--orb-fg)] dark:text-[var(--orb-muted)] dark:hover:bg-[var(--orb-surface-2)]",onClick:p,type:"button","aria-label":"Add",children:f(dn,{className:"h-4 w-4"})}),f("input",{className:"h-7 flex-1 border-none bg-transparent text-sm text-[var(--orb-fg)] outline-none placeholder:text-[var(--orb-muted)] dark:text-[var(--orb-fg)] dark:placeholder:text-[var(--orb-muted)]",placeholder:i||"Ask Copilot...",value:g$1,onChange:T=>C(T.target.value),onCompositionStart:()=>S(true),onCompositionEnd:()=>S(false),onKeyDown:D,"aria-label":"Copilot input",spellCheck:false}),f("button",{className:"flex h-8 w-8 items-center justify-center rounded-full text-[var(--orb-muted)] transition-colors hover:bg-[var(--orb-surface)] hover:text-[var(--orb-fg)] dark:text-[var(--orb-muted)] dark:hover:bg-[var(--orb-surface-2)]",onClick:f$1,type:"button","aria-label":"Microphone",children:f(sn,{className:"h-4 w-4"})})]})})]})};var gv=["var(--orb-primary)","var(--orb-primary)","var(--orb-primary)"],fv=`
7
+ `),h={enableMath:n},m=0;for(;m<f$1.length;){let v=f$1[m],y=v.trim();if(!y){m+=1;continue}if(i&&_p(v)){if(y.startsWith("<think>")){let b=[],C=v;for(;;){let P=C.indexOf("<think>"),S=P>=0?C.slice(P+7):C,k=S.indexOf("</think>");if(k>=0){b.push(S.slice(0,k)),m+=1;break}if(b.push(S),m+=1,m>=f$1.length)break;C=f$1[m];}u.push(f(Mi,{content:b.join(`
8
+ `).trim()},`think-tag-${m}`));continue}m+=1;let x=[];for(;m<f$1.length&&f$1[m].trim()!==":::";)x.push(f$1[m]),m+=1;m<f$1.length&&f$1[m].trim()===":::"&&(m+=1),u.push(f(Mi,{content:x.join(`
9
+ `).trim()},`think-fence-${m}`));continue}if(Ri(v)){let x=y.slice(3).trim().toLowerCase(),b=[];for(m+=1;m<f$1.length&&!Ri(f$1[m]);)b.push(f$1[m]),m+=1;m<f$1.length&&Ri(f$1[m])&&(m+=1);let C=b.join(`
10
+ `);if(a&&x==="mermaid"){u.push(f(Js,{code:C},`mermaid-${m}`));continue}if(n&&["math","latex","katex"].includes(x)){u.push(f(oa,{expression:C,allowKatex:true},`math-fence-${m}`));continue}u.push(f(ra,{code:C,language:x||"text",copyable:s,showLineNumbers:l,wrapLongLines:true},`code-${m}`));continue}if(n&&y.startsWith("$$")){let x=[];if(y.endsWith("$$")&&y!=="$$")x.push(y.slice(2,-2)),m+=1;else {let C=v.slice(v.indexOf("$$")+2);for(C.trim()&&x.push(C),m+=1;m<f$1.length;){let P=f$1[m],S=P.indexOf("$$");if(S>=0){x.push(P.slice(0,S)),m+=1;break}x.push(P),m+=1;}}u.push(f(oa,{expression:x.join(`
11
+ `).trim(),allowKatex:true},`math-${m}`));continue}if(Wp(v)){let x=Math.min(6,v.match(/^#{1,6}/)?.[0]?.length||1),b=v.replace(/^#{1,6}\s+/,""),C=x===1?"h5":x===2?"h6":"subtitle1";u.push(f(gr,{variant:C,sx:{mt:x===1?1.2:.8,mb:.5,fontWeight:700},children:na(b,h,`h-${m}`)},`heading-${m}`)),m+=1;continue}if($p(v)){u.push(f(td,{sx:{my:1.2}},`hr-${m}`)),m+=1;continue}if(Gp(f$1,m)){let x=m+2;for(;x<f$1.length&&f$1[x].trim()&&f$1[x].includes("|");)x+=1;let b=f$1.slice(m,x).join(`
12
+ `),C=Ii(b);if(C){u.push(f(tl,{table:C},`table-${m}`)),m=x;continue}}if(al(v)){let x=[];for(;m<f$1.length&&al(f$1[m]);)x.push(f$1[m].replace(/^\s*>\s?/,"")),m+=1;u.push(f(Lo,{variant:"outlined",sx:{px:1,py:.8,my:.9,borderLeftWidth:3,borderLeftStyle:"solid",borderLeftColor:"primary.main",bgcolor:"action.hover"},children:f(gr,{variant:"body2",sx:{whiteSpace:"pre-wrap"},children:x.map((b,C)=>g(Fragment,{children:[C>0&&f("br",{}),na(b,h,`q-${m}-${C}`)]},`quote-line-${C}`))})},`quote-${m}`));continue}if(ol(v)){let x=[];for(;m<f$1.length&&ol(f$1[m]);)x.push(f$1[m].trim().replace(/^[-*+]\s+/,"")),m+=1;u.push(f(we,{component:"ul",sx:{my:.8,pl:2.5},children:x.map((b,C)=>f(we,{component:"li",sx:{mb:.45},children:f(gr,{variant:"body2",children:na(b,h,`ul-${m}-${C}`)})},`ul-item-${C}`))},`ul-${m}`));continue}if(nl(v)){let x=[];for(;m<f$1.length&&nl(f$1[m]);)x.push(f$1[m].trim().replace(/^\d+\.\s+/,"")),m+=1;u.push(f(we,{component:"ol",sx:{my:.8,pl:2.7},children:x.map((b,C)=>f(we,{component:"li",sx:{mb:.45},children:f(gr,{variant:"body2",children:na(b,h,`ol-${m}-${C}`)})},`ol-item-${C}`))},`ol-${m}`));continue}let g$1=[];for(;m<f$1.length;){let x=f$1[m],b=x.trim();if(!b||Ri(x)||Wp(x)||$p(x)||ol(x)||nl(x)||al(x)||Gp(f$1,m)||i&&_p(x)||n&&b.startsWith("$$"))break;g$1.push(x),m+=1;}g$1.length>0?u.push(f(gr,{variant:"body2",sx:{my:.65,lineHeight:1.65},children:g$1.map((x,b)=>g(Fragment,{children:[b>0&&f("br",{}),na(x,h,`p-${m}-${b}`)]},`p-line-${b}`))},`p-${m}`)):m+=1;}return u},[d,n,a,i,s,l]);return f(we,{className:o,sx:{"& strong":{fontWeight:700},"& em":{fontStyle:"italic"},"& a":{wordBreak:"break-all"}},children:p})};var FD=(t,r)=>f(aa,{markdown:t,...r});var Up=({value:t,onChange:r,onSubmit:o,onVoiceInput:n,onClear:a,placeholder:i,statusText:s,loading:l=false,compact:d=false,showStatusText:p=true})=>g(ae,{spacing:.75,children:[g("div",{sx:{display:"flex",alignItems:"center",gap:1,px:1.2,py:d?.25:.4,borderRadius:999,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",minHeight:d?38:44},children:[f(Fo,{sx:{fontSize:d?16:18,color:"text.secondary"}}),f(ld,{fullWidth:true,value:t,onChange:u=>r(u.target.value),onKeyDown:u=>{u.key==="Enter"&&(u.preventDefault(),o());},placeholder:i,sx:{fontSize:d?"0.84rem":"0.9rem"}}),t&&a&&f(ne,{size:"small",onClick:a,children:f(Co,{sx:{fontSize:d?16:18}})}),n&&f(ne,{size:"small",onClick:n,children:f(zd,{sx:{fontSize:d?16:18}})}),f(ne,{size:"small",onClick:o,disabled:l||!t.trim(),children:f(_d,{sx:{fontSize:d?16:18}})})]}),p&&s&&f(E,{variant:"caption",color:"text.secondary",children:s})]});var Kp=(t,r)=>{let o=r.trim();if(!o)return t;let n=t.toLowerCase(),a=o.toLowerCase(),i=n.indexOf(a);return i<0?t:g(e,{children:[t.slice(0,i),f("div",{component:"mark",sx:{bgcolor:"warning.light",color:"warning.contrastText",px:.15,borderRadius:.4},children:t.slice(i,i+o.length)}),t.slice(i+o.length)]})},Di=({section:t,highlightQuery:r=""})=>{let o=t.columns||2;return g(Ae,{variant:"outlined",sx:{p:1.8,borderRadius:2},children:[f(E,{variant:"subtitle1",sx:{fontWeight:700,mb:1.4},children:t.title}),f("div",{sx:{display:"grid",gap:1.15,gridTemplateColumns:{xs:"1fr",md:o===3?"repeat(3, minmax(0, 1fr))":o===1?"1fr":"repeat(2, minmax(0, 1fr))"}},children:t.fields.map(n=>{let a=typeof n.value=="string"||typeof n.value=="number"?String(n.value):null;return g("div",{sx:{minWidth:0},children:[f(E,{variant:"caption",color:"text.secondary",sx:{display:"block"},children:Kp(n.label,r)}),f(E,{component:"div",variant:"body2",sx:{mt:.2,fontWeight:500,wordBreak:"break-word"},children:a?Kp(a,r):n.value})]},n.id)})})]})};var il=t=>t==null?"":typeof t=="string"||typeof t=="number"||typeof t=="boolean"?String(t):"",Ai=t=>t.trim().toLowerCase(),Cb=(t,r)=>{let o=[];return t.forEach(n=>{n.fields.forEach(a=>{let i=a.searchableText||il(a.value),s={source:"section",sourceId:n.id,sourceSectionId:n.id,sourceTitle:n.title,fieldId:a.id,fieldLabel:a.label,fieldValue:i};o.push({hit:s,text:Ai(`${n.title} ${a.label} ${i}`)});});}),r.forEach(n=>{(n.fields||[]).forEach(a=>{let i=a.searchableText||il(a.value),s={source:"tab",sourceId:n.id,sourceTitle:n.label,fieldId:a.id,fieldLabel:a.label,fieldValue:i};o.push({hit:s,text:Ai(`${n.label} ${a.label} ${i}`)});}),(n.sections||[]).forEach(a=>{a.fields.forEach(i=>{let s=i.searchableText||il(i.value),l={source:"tab",sourceId:n.id,sourceSectionId:a.id,sourceTitle:`${n.label} / ${a.title}`,fieldId:i.id,fieldLabel:i.label,fieldValue:s};o.push({hit:l,text:Ai(`${n.label} ${a.title} ${i.label} ${s}`)});});});}),o},qp=({sections:t,tabs:r=[],defaultTabId:o,ai:n})=>{let{t:a}=de(),[i,s]=useState(""),[l,d]=useState(o||r[0]?.id),[p,u]=useState("idle"),[f,h]=useState([]),[m,v]=useState(""),[y,g]=useState(""),[x,b]=useState(false),C=useMemo(()=>Cb(t,r),[t,r]);useEffect(()=>{if(r.length===0){d(void 0);return}r.some(A=>A.id===l)||d(o||r[0]?.id);},[r,l,o]);let P=useCallback(()=>{u("idle"),h([]),v(""),g("");},[]),S=useCallback(w=>{s(w),w.trim()||(u("idle"),h([]),v(""),g(""));},[]),k=useCallback(w=>{let A=Ai(w);return A?C.filter(R=>R.text.includes(A)).map(R=>R.hit):[]},[C]),I=useCallback(async()=>{let w=i.trim();if(!w)return;b(true);let A=k(w);if(h(A),A.length>0){u("search"),g(""),v(a("detail.searchAi.matches",{count:A.length})),b(false);return}if(n?.enabled!==false&&n?.onSubmit){u("ai"),v(a("detail.searchAi.autoAiFallback"));try{let T=await n.onSubmit(w,{query:w,hits:A,activeTabId:l,sections:t,tabs:r});g(typeof T=="string"?T:"");}finally{b(false);}return}u("search"),g(""),v(a("detail.searchAi.noMatch")),b(false);},[i,k,a,n,l,t,r]);return {query:i,setQuery:S,activeTabId:l,setActiveTabId:d,searchMode:p,hits:f,statusText:m,aiResponse:y,searching:x,handleSubmit:I,clearResult:P}};var dN=({title:t,subtitle:r,sections:o,tabs:n=[],defaultTabId:a,table:i,ai:s,rightHeaderSlot:l,searchBarWidth:d=460,onClose:p,closeLabel:u="Close"})=>{let{t:f$1}=de(),{query:h,setQuery:m,activeTabId:v,setActiveTabId:y,searchMode:g$1,hits:x,statusText:b,aiResponse:C,searching:P,handleSubmit:S,clearResult:k}=qp({sections:o,tabs:n,defaultTabId:a,ai:s}),I=useMemo(()=>n.find(R=>R.id===v)||n[0],[n,v]),w=useCallback(R=>{let T=N=>{let D=document.getElementById(R);if(D){D.scrollIntoView({behavior:"smooth",block:"center"});return}N<4&&setTimeout(()=>T(N+1),60);};requestAnimationFrame(()=>T(0));},[]),A=useCallback((R,T)=>{if(n.some(N=>N.id===R)){y(R),w(T?`detail-tab-${R}-section-${T}`:`detail-tab-${R}`);return}w(`detail-section-${R}`);},[n,y,w]);return g("div",{sx:{display:"flex",flexDirection:"column",gap:1.5,minHeight:"100%"},children:[g(ae,{direction:{xs:"column",md:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",md:"center"},spacing:1,children:[g("div",{sx:{minWidth:0},children:[f(E,{variant:"h5",sx:{fontWeight:800,color:"text.primary"},children:t}),r&&f(E,{variant:"body2",color:"text.secondary",sx:{mt:.35},children:r})]}),g(ae,{direction:"row",spacing:.6,alignItems:"center",sx:{width:{xs:"100%",md:"auto"},ml:{xs:0,md:"auto"}},children:[f("div",{sx:{width:{xs:"100%",md:d},maxWidth:"100%",minWidth:{md:320}},children:f(Up,{value:h,onChange:m,onSubmit:S,onVoiceInput:s?.onVoiceInput,onClear:()=>{m(""),k();},placeholder:s?.placeholder||f$1("detail.searchAi.placeholder"),statusText:b,loading:P,compact:true,showStatusText:false})}),p&&f(st,{title:u,children:f(ne,{size:"small",onClick:p,children:f(Id,{fontSize:"small"})})}),l]})]}),b&&f(E,{variant:"caption",color:"text.secondary",sx:{mt:-0.7},children:b}),g$1==="search"&&x.length>0&&g(Ae,{variant:"outlined",sx:{p:1.5,borderRadius:2},children:[f(E,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.6},children:f$1("detail.searchAi.matches",{count:x.length})}),f(ae,{spacing:.35,children:x.slice(0,8).map(R=>f("div",{component:"button",type:"button",onClick:()=>A(R.sourceId,R.sourceSectionId),sx:{textAlign:"left",border:0,bgcolor:"transparent",p:.2,cursor:"pointer",color:"text.primary",borderRadius:1,"&:hover":{bgcolor:"action.hover"}},children:g(E,{variant:"body2",sx:{fontSize:"0.84rem"},children:[f("div",{component:"span",sx:{color:"text.secondary"},children:R.sourceTitle})," \xB7 ",f("div",{component:"span",sx:{fontWeight:700},children:R.fieldLabel})," = ",f("div",{component:"span",children:R.fieldValue||"-"})]})},`${R.source}|${R.sourceId}|${R.fieldId}`))})]}),g$1==="ai"&&C&&g(Ae,{variant:"outlined",sx:{p:1.5,borderRadius:2},children:[f(E,{variant:"subtitle2",sx:{fontWeight:700,mb:.7},children:f$1("detail.searchAi.aiResultTitle")}),f("div",{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:f(aa,{markdown:C})})]}),f("div",{sx:{display:"grid",gap:1.5,gridTemplateColumns:{xs:"1fr",lg:"repeat(2, minmax(0, 1fr))"}},children:o.map(R=>f("div",{id:`detail-section-${R.id}`,children:f(Di,{section:R,highlightQuery:h})},R.id))}),n.length>0&&g(Ae,{variant:"outlined",sx:{borderRadius:2,overflow:"hidden"},children:[f(md,{value:I?.id||false,onChange:(R,T)=>y(String(T)),variant:"scrollable",scrollButtons:"auto",sx:{borderBottom:"1px solid",borderColor:"divider"},children:n.map(R=>f(gd,{value:R.id,label:R.label,sx:{textTransform:"none"}},R.id))}),g("div",{sx:{p:1.5},children:[f("div",{id:`detail-tab-${I?.id||""}`}),I?.description&&f(E,{variant:"body2",color:"text.secondary",sx:{mb:1.2},children:I.description}),I?.content?I.content:g(ae,{spacing:1.5,children:[(I?.sections||[]).map(R=>f("div",{id:`detail-tab-${I?.id}-section-${R.id}`,children:f(Di,{section:R,highlightQuery:h})},R.id)),I?.fields&&I.fields.length>0&&f(Di,{section:{id:`${I.id}-fields`,title:I.label,fields:I.fields,columns:2},highlightQuery:h})]})]})]}),i&&f(Qr,{title:i.title||f$1("detail.table.title"),...i.tableProps,filterConfig:void 0,fitContainer:false})]})};var Zp=({bucket:t,cardCount:r,highlighted:o=false,children:n,emptyLabel:a,height:i,maxHeight:s,onRename:l,renameLabel:d,sx:p})=>{let{t:u}=de(),[f$1,h]=useState(false),[m,v]=useState(t.title),y=()=>{v(t.title),h(false);},g$1=x=>{x.preventDefault();let b=m.trim();b&&(b!==t.title&&l?.(b),v(b),h(false));};return f(Ae,{elevation:0,sx:[x=>{let b=t.accentColor??x.palette.primary.main;return {position:"relative",display:"flex",flexDirection:"column",minWidth:0,minHeight:0,height:i??s??560,maxHeight:s,borderRadius:"var(--orb-r-container)",overflow:"hidden",border:o?`1px solid ${tt(b,.65)}`:"1px solid var(--orb-border)",bgcolor:"var(--orb-canvas)",boxShadow:o?`0 0 0 2px ${tt(b,.16)}, var(--orb-shadow-2)`:"none",transition:"border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease","&::before":{content:'""',display:"block",flexShrink:0,height:3,bgcolor:b}}},...Array.isArray(p)?p:p?[p]:[]],children:g(ae,{spacing:1.25,sx:{flex:1,minHeight:0,overflow:"hidden",p:1.5},children:[g(we,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:1.25},children:[f(we,{sx:{minWidth:0,flex:1},children:g(we,{sx:{display:"flex",alignItems:"center",gap:.75,minHeight:28},children:[t.icon&&f(we,{sx:{display:"inline-flex",flexShrink:0,color:t.accentColor??"var(--orb-primary)"},children:t.icon}),f$1?g(we,{component:"form",onSubmit:g$1,sx:{display:"flex",alignItems:"center",gap:.5,flex:1,minWidth:0},children:[f(He,{dense:true,autoFocus:true,value:m,onChange:x=>v(x.target.value),onKeyDown:x=>{x.key==="Escape"&&(x.preventDefault(),y());},inputProps:{"aria-label":d??u("kanban.bucket.rename")},error:!m.trim(),sx:{flex:1,minWidth:0}}),f(ne,{type:"submit",size:"small",tooltip:u("kanban.bucket.saveRename"),"aria-label":u("kanban.bucket.saveRename"),disabled:!m.trim(),children:f(Ur,{size:14})}),f(ne,{size:"small",tooltip:u("kanban.bucket.cancelRename"),"aria-label":u("kanban.bucket.cancelRename"),onClick:y,children:f(Xt,{size:14})})]}):f(E,{component:"div",sx:{fontSize:15,fontWeight:600,lineHeight:1.35,color:"text.primary"},children:t.title})]})}),!f$1&&g(ae,{direction:"row",spacing:.75,sx:{flexShrink:0},children:[f(kt,{size:"small",label:r,sx:{minWidth:24,justifyContent:"center",fontWeight:600}}),typeof t.limit=="number"&&f(kt,{size:"small",label:`${u("kanban.bucket.limit")} ${t.limit}`,color:r>t.limit?"warning":"default",variant:"outlined"}),l&&f(ne,{size:"small",tooltip:d??u("kanban.bucket.rename"),"aria-label":d??u("kanban.bucket.rename"),onClick:()=>{v(t.title),h(true);},sx:{width:26,height:26},children:f(mc,{size:14})})]})]}),o&&f(E,{component:"div",sx:{fontSize:12,color:t.accentColor??"var(--orb-primary)",fontWeight:500},children:u("kanban.bucket.dropHere")}),f(we,{sx:{flex:1,height:0,minHeight:0,overflowY:"auto",overscrollBehavior:"contain",pr:.4,scrollbarGutter:"stable"},children:r>0?n:f(we,{sx:{minHeight:"100%",borderRadius:"var(--orb-r-container)",border:"1px dashed var(--orb-border)",bgcolor:"transparent",display:"grid",placeItems:"center",px:2,textAlign:"center"},children:f(E,{sx:{fontSize:13,color:"text.secondary"},children:a??t.emptyLabel??u("kanban.empty")})})})]})})};var Sb={success:"success",warning:"warning",info:"info",error:"error"},wb={critical:"error",high:"warning",medium:"info",low:"success"},kb={default:"var(--orb-primary)",success:"var(--orb-primary)",warning:"var(--orb-accent)",info:"var(--orb-primary)",error:"var(--orb-err)"},Pb=(t,r)=>{switch(t){case "critical":return r("kanban.priority.critical");case "high":return r("kanban.priority.high");case "medium":return r("kanban.priority.medium");case "low":return r("kanban.priority.low");default:return t}},Tb=t=>t?t.split(/\s+/).map(r=>r.charAt(0).toUpperCase()).slice(0,2).join(""):"NA",sl=({card:t,bucket:r,dragging:o=false,overlay:n=false,onClick:a,sx:i})=>{let{t:s}=de(),l=!!(a&&r),d=t.tone??(t.priority?wb[t.priority]:"default"),p=d==="default"?"primary":Sb[d],u=kb[d],f$1=r?{card:t,bucket:r}:void 0;return f(Ae,{onClick:l?()=>f$1&&a?.(f$1):void 0,onKeyDown:l?h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),f$1&&a?.(f$1));}:void 0,role:l?"button":void 0,tabIndex:l?0:void 0,sx:[{position:"relative",minWidth:0,overflow:"hidden",p:1.5,pl:1.75,borderRadius:"var(--orb-r-container)",border:`1px solid ${tt(u,.24)}`,bgcolor:"var(--orb-canvas)",boxShadow:n?"var(--orb-shadow-3)":o?"none":"var(--orb-shadow-1)",transform:n?"rotate(1deg) scale(1.01)":"none",transition:"transform var(--orb-t-fast), box-shadow var(--orb-t-fast), border-color var(--orb-t-fast)",cursor:l?"pointer":"default",opacity:o?.5:1,"&::before":{content:'""',position:"absolute",inset:"0 auto 0 0",width:3,bgcolor:u},"&:hover":l?{transform:"translateY(-1px)",borderColor:tt(u,.48),boxShadow:"var(--orb-shadow-2)"}:void 0,"&:focus-visible":l?{outline:"2px solid var(--orb-focus-solid)",outlineOffset:2}:void 0},...Array.isArray(i)?i:i?[i]:[]],elevation:0,children:g(ae,{spacing:1.25,children:[g(we,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:1},children:[g(we,{sx:{minWidth:0,flex:1},children:[(t.kicker||r?.title)&&f(E,{component:"div",sx:{fontSize:11,fontWeight:500,color:"text.secondary",textTransform:"uppercase"},children:t.kicker??r?.title}),f(E,{component:"div",sx:{mt:.25,fontSize:14,fontWeight:600,lineHeight:1.4,color:"text.primary"},children:t.title})]}),t.priority&&f(kt,{size:"small",color:p,label:Pb(t.priority,s),variant:d==="default"?"outlined":"filled",sx:{height:22,flexShrink:0,fontWeight:500}})]}),t.summary&&f(E,{component:"div",sx:{fontSize:13,fontWeight:300,color:"text.secondary",lineHeight:1.5},children:t.summary}),t.metrics&&t.metrics.length>0&&f(we,{sx:{display:"grid",gridTemplateColumns:`repeat(${Math.min(t.metrics.length,3)}, minmax(0, 1fr))`,gap:.75},children:t.metrics.slice(0,3).map(h=>g(we,{sx:{minWidth:0,borderRadius:"var(--orb-r)",px:1,py:.75,bgcolor:"var(--orb-surface)",border:"1px solid var(--orb-border)"},children:[f(E,{component:"div",noWrap:true,sx:{fontSize:11,fontWeight:500,color:"text.secondary",textTransform:"uppercase"},children:h.label}),f(E,{component:"div",noWrap:true,numeric:true,sx:{mt:.25,fontSize:13,fontWeight:600},children:h.value})]},h.id))}),typeof t.progress=="number"&&g(we,{children:[g(we,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:.5},children:[f(E,{sx:{fontSize:12,color:"text.secondary"},children:s("kanban.card.progress")}),g(E,{numeric:true,sx:{fontSize:12,fontWeight:600},children:[Math.round(t.progress),"%"]})]}),f(od,{variant:"determinate",value:Math.max(0,Math.min(100,t.progress)),color:u,sx:{height:4,borderRadius:2}})]}),(t.tags?.length||t.assignee||t.dueDate||t.footer||l)&&g(ae,{spacing:.9,children:[t.tags&&t.tags.length>0&&f(we,{sx:{display:"flex",flexWrap:"wrap",gap:.75},children:t.tags.map(h=>f(kt,{size:"small",label:h.label,color:h.color??"default",variant:"outlined"},h.id))}),g(we,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,flexWrap:"wrap"},children:[g(we,{sx:{display:"flex",alignItems:"center",gap:.75,minWidth:0},children:[t.assignee&&g(e,{children:[f(Ua,{src:t.assignee.avatarSrc,sx:{width:28,height:28,fontSize:11},children:t.assignee.initials??Tb(t.assignee.name)}),g(we,{sx:{minWidth:0},children:[f(E,{component:"div",sx:{fontSize:13,fontWeight:500,lineHeight:1.3},noWrap:true,children:t.assignee.name}),t.dueDate&&f(E,{component:"div",sx:{fontSize:11,color:"text.secondary",lineHeight:1.35},noWrap:true,children:t.dueDate})]})]}),!t.assignee&&t.dueDate&&f(E,{sx:{fontSize:12,color:"text.secondary"},children:t.dueDate})]}),l&&f(E,{sx:{fontSize:12,color:"var(--orb-link)",fontWeight:500,whiteSpace:"nowrap"},children:s("kanban.card.openDetail")})]}),t.footer]})]})})};var Qp=(t,r)=>{let o=r.title.trim();return !r.id||!o||t.buckets.some(n=>n.id===r.id)?t:{buckets:[...t.buckets,{...r,title:o,cards:[]}]}},jp=(t,r,o)=>{let n=o.trim();if(!n)return t;let a=t.buckets.find(i=>i.id===r);return !a||a.title===n?t:{buckets:t.buckets.map(i=>i.id===r?{...i,title:n}:i)}},Ib=(t,r)=>Number.isNaN(t)||t<0?0:t>r?r:t,Jp=({buckets:t,cards:r})=>{let o=new Map;return r.forEach((n,a)=>{let i=o.get(n.bucketId)??[];i.push({card:n,sourceIndex:a}),o.set(n.bucketId,i);}),{buckets:t.map(n=>{let a=[...o.get(n.id)??[]].sort((i,s)=>i.card.position===void 0&&s.card.position===void 0?i.sourceIndex-s.sourceIndex:i.card.position===void 0?1:s.card.position===void 0?-1:i.card.position-s.card.position||i.sourceIndex-s.sourceIndex).map(({card:i},s)=>({...i,bucketId:n.id,position:s}));return {...n,cards:a}})}},Wr=(t,r)=>{for(let o=0;o<t.buckets.length;o+=1){let n=t.buckets[o],a=n.cards.findIndex(i=>i.id===r);if(a>=0)return {card:n.cards[a],bucket:n,bucketIndex:o,cardIndex:a}}},Ei=(t,r)=>{let o=Wr(t,r.cardId);if(!o)return t;let n=t.buckets.findIndex(p=>p.id===r.toBucketId);if(n<0)return t;let a=t.buckets.map(p=>({...p,cards:p.cards.map(u=>({...u}))})),i=a[o.bucketIndex],[s]=i.cards.splice(o.cardIndex,1);if(!s)return t;let l=a[n],d=Ib(r.targetIndex??l.cards.length,l.cards.length);return l.cards.splice(d,0,{...s,bucketId:r.toBucketId}),{buckets:a.map(p=>({...p,cards:p.cards.map((u,f)=>({...u,bucketId:p.id,position:f}))}))}};var dl="kanban-card|",pl="kanban-bucket|",ru=t=>`${dl}${t}`,Hb=t=>`${pl}${t}`,Li=t=>t?.startsWith(dl)?t.slice(dl.length):void 0,tu=t=>t?.startsWith(pl)?t.slice(pl.length):void 0,zb=({card:t,bucket:r,onCardClick:o})=>{let{setNodeRef:n,attributes:a,listeners:i,transform:s,transition:l,isDragging:d}=useSortable({id:ru(t.id)}),p={transform:s?`translate3d(${s.x}px, ${s.y}px, 0)`:void 0,transition:l,zIndex:d?2:1,touchAction:"none",cursor:d?"grabbing":"grab"};return f("div",{ref:n,style:p,...a,...i,children:f(sl,{card:t,bucket:r,dragging:d,onClick:o})})},Vb=({bucket:t,highlighted:r,bucketHeight:o,emptyBucketLabel:n,onBucketRename:a,onCardClick:i})=>{let{isOver:s,setNodeRef:l}=useDroppable({id:Hb(t.id)});return f(we,{ref:l,sx:{minWidth:0,minHeight:0,height:o},children:f(Zp,{bucket:t,cardCount:t.cards.length,highlighted:r||s,emptyLabel:n,height:o,onRename:a,children:f(SortableContext,{items:t.cards.map(d=>ru(d.id)),strategy:verticalListSortingStrategy,children:f(ae,{spacing:1,children:t.cards.map(d=>f(zb,{card:d,bucket:t,onCardClick:i},d.id))})})})})},ou=t=>String(t??"").toLocaleLowerCase(),Wb=(t,r)=>[t.id,t.title,t.summary,t.kicker,t.priority,t.tone,t.progress,t.dueDate,t.assignee?.id,t.assignee?.name,...t.tags?.flatMap(n=>[n.id,n.label])??[],...t.metrics?.flatMap(n=>[n.label,n.value])??[]].some(n=>ou(n).includes(r)),HN=({model:t,onCardMove:r,onCardClick:o,cardFilter:n,onBucketAdd:a,onBucketRename:i,addBucketLabel:s,minBucketWidth:l=320,bucketHeight:d,bucketMaxHeight:p,searchable:u=false,searchValue:f$1,defaultSearchValue:h="",onSearchValueChange:m,searchPlaceholder:v,emptyBucketLabel:y,sx:g$1})=>{let{t:x}=de(),[b,C]=useState(null),[P,S]=useState(),[k,I]=useState(h),w=f$1??k,A=w.trim().toLocaleLowerCase(),R=d??p??560,T=useMemo(()=>({buckets:t.buckets.map(z=>{let O=n?z.cards.filter(Q=>n(Q,z)):z.cards;if(!A)return {...z,cards:O};let Y=[z.id,z.title,z.description].some(Q=>ou(Q).includes(A));return {...z,cards:Y?O:O.filter(Q=>Wb(Q,A))}})}),[n,t,A]),N=useMemo(()=>T.buckets.reduce((z,O)=>z+O.cards.length,0),[T]),D=useCallback(z=>{f$1===void 0&&I(z),m?.(z);},[m,f$1]),L=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:6}}),useSensor(TouchSensor,{activationConstraint:{delay:120,tolerance:8}})),B=useMemo(()=>b?Wr(t,b):void 0,[b,t]),X=useCallback(()=>{C(null),S(void 0);},[]),H=useCallback(z=>{if(!z)return;let O=Li(z);return O?Wr(t,O)?.bucket.id:tu(z)},[t]),K=useCallback(z=>{C(Li(String(z.active.id))??null);},[]),W=useCallback(z=>{S(H(z.over?String(z.over.id):void 0));},[H]),G=useCallback(z=>{let O=Li(String(z.active.id)),Y=z.over?String(z.over.id):void 0;if(!O||!Y){X();return}let Q=Wr(t,O);if(!Q){X();return}let me=Q.bucket.id,ie=Q.cardIndex,se=Li(Y);if(se){let Re=Wr(t,se);if(!Re){X();return}me=Re.bucket.id,ie=Re.cardIndex;}else {let Re=tu(Y),ke=t.buckets.find(ze=>ze.id===Re);if(!Re||!ke){X();return}me=Re,ie=ke.cards.length;}if(Q.bucket.id===me&&Q.cardIndex===ie){X();return}let fe=Ei(t,{cardId:O,fromBucketId:Q.bucket.id,toBucketId:me,targetIndex:ie}),Ge=Wr(fe,O);Ge&&!(Ge.bucket.id===Q.bucket.id&&Ge.cardIndex===Q.cardIndex)&&r?.({cardId:O,fromBucketId:Q.bucket.id,toBucketId:Ge.bucket.id,targetIndex:Ge.cardIndex,card:Ge.card,model:fe}),X();},[t,r,X]);return g(DndContext,{sensors:L,collisionDetection:closestCorners,onDragStart:K,onDragOver:W,onDragEnd:G,onDragCancel:X,children:[g(we,{sx:{display:"flex",flexDirection:"column",minWidth:0,minHeight:0,height:"100%",overflow:"hidden"},children:[(u||a)&&g(we,{role:u?"search":void 0,sx:{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:1.5,mb:1.25,minWidth:0},children:[u&&f(we,{sx:{width:"100%",maxWidth:360,flex:"1 1 240px"},children:f(He,{dense:true,value:w,onChange:z=>D(z.target.value),placeholder:v??x("kanban.search.placeholder"),autoComplete:"off",sx:{"& .orb-inp":{paddingLeft:"38px",paddingRight:w?"42px":"12px"},"& .orb-inp-adornment-end":{pointerEvents:"auto"}},startAdornment:f(Fr,{size:16,"aria-hidden":"true"}),endAdornment:w?f(ne,{size:"small",tooltip:x("kanban.search.clear"),"aria-label":x("kanban.search.clear"),onClick:()=>D(""),sx:{width:26,height:26},children:f(Xt,{size:15})}):void 0})}),g(we,{sx:{display:"flex",alignItems:"center",gap:1,ml:"auto"},children:[A&&f(E,{component:"div","aria-live":"polite",sx:{flexShrink:0,fontSize:12,fontWeight:500,color:"text.secondary"},children:N>0?x("kanban.search.results",{count:N}):x("kanban.search.noMatch")}),a&&f(ye,{size:"small",variant:"secondary",startIcon:f(Ra,{size:15}),onClick:a,children:s??x("kanban.bucket.add")})]})]}),f(we,{sx:[{display:"grid",gridAutoFlow:"column",gridAutoColumns:`minmax(${l}px, ${Math.max(l,360)}px)`,gap:1.5,gridAutoRows:R==="100%"?"minmax(0, 1fr)":void 0,alignItems:"stretch",justifyContent:"start",flex:"1 1 0",height:"100%",minHeight:0,overflowX:"auto",overflowY:"hidden",overscrollBehavior:"contain",scrollbarGutter:"stable both-edges",pb:.5},...Array.isArray(g$1)?g$1:g$1?[g$1]:[]],children:T.buckets.map(z=>f(Vb,{bucket:z,highlighted:z.id===P,bucketHeight:R,emptyBucketLabel:A?x("kanban.search.noMatch"):y,onBucketRename:i?O=>i(z.id,O):void 0,onCardClick:o},z.id))})]}),f(DragOverlay,{children:B?f(we,{sx:{width:Math.max(l-24,260)},children:f(sl,{card:B.card,bucket:B.bucket,overlay:true})}):null})]})};var _b=({initialModel:t,initialBuckets:r,initialCards:o})=>t||Jp({buckets:r??[],cards:o??[]}),GN=t=>{let{onCardMove:r,onCardClick:o}=t,[n,a]=useState(()=>_b(t)),i=useCallback(h=>{a(m=>typeof h=="function"?h(m):h);},[]),s=useCallback(h=>Wr(n,h),[n]),l=useCallback((h,m,v)=>{let y=Wr(n,h);if(!y)return;let g=Ei(n,{cardId:h,fromBucketId:y.bucket.id,toBucketId:m,targetIndex:v}),x=Wr(g,h);if(!x||x.bucket.id===y.bucket.id&&x.cardIndex===y.cardIndex)return;a(g);let b={cardId:h,fromBucketId:y.bucket.id,toBucketId:x.bucket.id,targetIndex:x.cardIndex,card:x.card,model:g};return r?.(b),b},[n,r]),d=useCallback((h,m)=>{a(v=>({buckets:v.buckets.map(y=>({...y,cards:y.cards.map(g=>g.id!==h?g:typeof m=="function"?m(g):{...g,...m})}))}));},[]),p=useCallback(h=>{let m=Qp(n,h);return m===n?false:(a(m),true)},[n]),u=useCallback((h,m)=>{let v=jp(n,h,m);return v===n?false:(a(v),true)},[n]),f=useMemo(()=>({model:n,onCardMove:h=>{l(h.cardId,h.toBucketId,h.targetIndex);},onCardClick:o}),[n,l,o]);return {model:n,actions:{replaceModel:i,moveCard:l,updateCard:d,addBucket:p,renameBucket:u,getCard:s},boardProps:f}};function vn({onTextUpdate:t,onComplete:r,onError:o,wsUrl:n="ws://localhost:8765",silenceThresholdMs:a=2e3,minVolumeRms:i=.015}){let[s,l]=useState(false),d=useRef(null),p=useRef(null),u=useRef(null),f=useRef(null),h=useRef(null),m=useRef(0),v=useRef(false),y=useRef(false),g=useCallback(()=>{d.current&&(d.current.close(),d.current=null),f.current&&(f.current.disconnect(),f.current=null),h.current&&(h.current.disconnect(),h.current=null),p.current&&(p.current.getTracks().forEach(C=>C.stop()),p.current=null),u.current&&(u.current.close(),u.current=null),y.current=false,l(false);},[]),x=useCallback(()=>{v.current||(v.current=true,d.current?.readyState===WebSocket.OPEN&&d.current.send(JSON.stringify({type:"stop"})),setTimeout(g,500));},[g]),b=useCallback(async()=>{if(!(s||y.current)){y.current=true,v.current=false,m.current=Date.now();try{let C=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1,sampleRate:16e3,echoCancellation:!0,noiseSuppression:!0}});p.current=C;let P=new WebSocket(n);d.current=P,P.onopen=()=>{l(!0),y.current=!1;},P.onmessage=A=>{try{let R=JSON.parse(A.data);if(R.type==="recognition")R.is_final?r(R.text):t?.(R.text);else if(R.type==="error"){let T=R.message||"Voice recognition error";o?.(T),x();}}catch{o?.("Failed to parse voice message");}},P.onerror=()=>{o?.("Voice service connection failed"),g();},P.onclose=()=>{g();};let S=window.AudioContext||window.webkitAudioContext;if(!S)throw new Error("AudioContext is not supported in this browser");let k=new S({sampleRate:16e3});u.current=k;let I=k.createMediaStreamSource(C);h.current=I;let w=k.createScriptProcessor(4096,1,1);f.current=w,w.onaudioprocess=A=>{if(d.current?.readyState!==WebSocket.OPEN)return;let R=A.inputBuffer.getChannelData(0),T=0;for(let L=0;L<R.length;L+=1)T+=R[L]*R[L];if(Math.sqrt(T/R.length)>i)m.current=Date.now();else if(Date.now()-m.current>a&&!v.current){x();return}let D=new Int16Array(R.length);for(let L=0;L<R.length;L+=1){let B=Math.max(-1,Math.min(1,R[L]));D[L]=B<0?B*32768:B*32767;}d.current.send(D.buffer);},I.connect(w),w.connect(k.destination);}catch{o?.("Cannot access microphone"),g();}}},[g,s,i,r,o,t,a,x,n]);return useEffect(()=>g,[g]),{isRecording:s,startRecording:b,stopRecording:x}}var Xb=["en","zh","fr","de","ja","ko"],au={en:"EN",zh:"\u4E2D\u6587",fr:"FR",de:"DE",ja:"\u65E5\u672C\u8A9E",ko:"\uD55C\uAD6D\uC5B4"},ml=({searchPlaceholder:t,onSearch:r,onSearchAdd:o,maxWidth:n=540,sx:a})=>{let{t:i}=de(),[s,l]=useState(""),d=useCallback((g=s)=>{let x=g.trim();x&&(l(""),r?.(x));},[r,s]),p=g=>{g.preventDefault(),d();},{isRecording:u,startRecording:f$1,stopRecording:h}=vn({onTextUpdate:l,onComplete:g=>{l(g),d(g);},onError:g=>{console.error("Header voice input error:",g);}}),m=useCallback(async()=>{if(u){h();return}await f$1();},[u,f$1,h]),v=t||i("header.searchPlaceholder"),y=s.trim().length>0;return f("form",{className:"orb-app-header-search",onSubmit:p,style:{width:"100%",maxWidth:typeof n=="number"?`${n}px`:n,...a},children:g("div",{className:"orb-inp-adornment-wrap orb-app-header-search-shell",style:{background:"var(--orb-surface)",border:"1px solid var(--orb-border)",borderRadius:999,paddingRight:4},children:[f("div",{className:"orb-inp-adornment",children:f(ne,{className:"orb-app-header-ai-action",size:"small",onClick:o,tooltip:i("header.searchAddFeature"),children:f(Mt,{name:"add",size:16})})}),f("input",{className:"orb-inp orb-inp-dense orb-app-header-ai-input",value:s,onChange:g=>l(g.target.value),placeholder:v,style:{border:"none",background:"transparent",flex:1,minWidth:0}}),g("div",{className:"orb-inp-adornment orb-inp-adornment-end",children:[f(ne,{className:"orb-app-header-ai-action",size:"small",onClick:()=>{m();},tooltip:i(u?"header.searchStopVoice":"header.searchStartVoice"),sx:{color:u?"var(--orb-err)":void 0},children:f(Mt,{name:"microphone",size:16})}),f(ne,{className:"orb-app-header-ai-action",size:"small",type:"submit",disabled:!y,tooltip:i("header.searchSend"),children:f(Mt,{name:"paperPlane",size:16})})]})]})})},Oi=({appTitle:t,logo:r,onToggleMode:o,locale:n,localeLabel:a,localeOptions:i,onLocaleChange:s,searchPlaceholder:l,showSearch:d=false,onSearch:p,onSearchAdd:u,user:f$1,onUserRefresh:h,onUserSetting:m,onUserLogout:v,userMenuItems:y,leftSlot:g$1,rightSlot:x})=>{let{t:b,locale:C}=de(),P=br(),S=n||C,k=a||au[S],I=i||Xb,w=P==="dark"?f(kc,{size:15}):f(Mc,{size:15}),A=b(P==="dark"?"header.theme.dark":"header.theme.light"),R=[...h?[{key:"refresh",label:b("header.menu.refresh"),icon:f(Da,{size:15}),onClick:h}]:[],...m?[{key:"settings",label:b("header.menu.setting"),icon:f(Qo,{size:16}),onClick:m}]:[],...v?[{key:"logout",label:b("header.menu.logout"),icon:f(xc,{size:16}),onClick:v}]:[]],T=y||R,N=I.map(D=>({label:au[D],onClick:()=>{s?.(D),window.requestAnimationFrame(()=>{document.activeElement instanceof HTMLElement&&document.activeElement.blur();});},disabled:D===S}));return g("header",{className:"orb-app-header",children:[g("div",{className:"orb-app-header-brand",children:[g$1,r===null?null:r||f("div",{className:"orb-app-header-default-logo","aria-label":"ORBCAFE",children:f(Mt,{name:"product",size:20})}),t&&f(E,{variant:"h4",sx:{fontWeight:700},children:t})]}),f("div",{className:"orb-app-header-center",children:d&&f(ml,{searchPlaceholder:l,onSearch:p,onSearchAdd:u})}),g("div",{className:"orb-app-header-actions",children:[g("div",{className:"orb-app-header-utilities",children:[s?f(Yt,{triggerLabel:k,trigger:g("button",{type:"button",className:"orb-icon-btn orb-app-header-locale",children:[f(En,{size:15}),f("span",{className:"orb-label",children:k})]}),items:N,align:"end"}):g("div",{className:"orb-app-header-locale","aria-label":k,children:[f(En,{size:15}),f("span",{className:"orb-label",children:k})]}),f(ne,{className:"orb-app-header-theme",size:"small",onClick:o,tooltip:A,children:w})]}),f$1&&f("span",{className:"orb-app-header-divider","aria-hidden":"true"}),f$1&&f(Yt,{triggerLabel:f$1.name,trigger:g("button",{type:"button",className:"orb-app-header-user-trigger",children:[g("span",{className:"orb-app-header-user-copy",children:[f(E,{variant:"body2",className:"orb-app-header-user-name",children:f$1.name}),f$1.subtitle&&f(E,{variant:"caption",muted:true,className:"orb-app-header-user-subtitle",title:f$1.subtitle,children:f$1.subtitle})]}),f(jo,{src:f$1.avatarSrc,alt:f$1.name,size:32,children:f$1.avatarText||f$1.name.slice(0,1).toUpperCase()})]}),items:T.map(D=>({label:D.label,onClick:D.onClick,disabled:D.disabled,icon:D.icon})),align:"end"}),x]})]})};var iu=({menuData:t=[],initialNavigationCollapsed:r=false,initialNavigationMode:o="fixed",enableNavigationPinning:n,navigationPinStorageKey:a,pinnedNavigationItemIds:i,defaultPinnedNavigationItemIds:s,onPinnedNavigationItemIdsChange:l,pinnedNavigationSectionTitle:d}={})=>{let{navigationIslandProps:p}=Zc({initialCollapsed:r,initialDisplayMode:o,content:t,enablePinning:n,pinStorageKey:a,pinnedItemIds:i,defaultPinnedItemIds:s,onPinnedItemIdsChange:l,pinnedSectionTitle:d}),[u,f]=useState(900);useEffect(()=>{let m=()=>f(window.innerHeight);return m(),window.addEventListener("resize",m),()=>window.removeEventListener("resize",m)},[]);let h=useMemo(()=>Math.max(280,u-100),[u]);return {navigationIslandProps:p,navigationMaxHeight:h}};var Ar=12,lu=56,cu=234,Jb="orbcafe:page-layout-locale",du=["en","zh","fr","de","ja","ko"],ev=t=>encodeURIComponent(t.trim().toLowerCase()).replace(/%/g,"").replace(/[^a-z0-9._~-]+/g,"-")||"app",Fi=(t,r)=>`orbcafe:page-layout:${ev(t)}:${r}`,tv=t=>`orbcafe:page-layout:${t.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-")||"app"}:pinned-navigation-items`,rv=t=>t==="system"?"dark":t==="dark"?"light":"system",Bi=(t,r,o)=>Math.min(Math.max(t,r),Math.max(r,o)),ov=t=>t instanceof HTMLElement?!!t.closest('button,input,a,textarea,select,[role="button"],[contenteditable="true"]'):false,uA=({appId:t,appTitle:r,menuData:o=[],children:n,showNavigation:a=true,locale:i="en",localeLabel:s,localeOptions:l,onLocaleChange:d,mode:p,defaultMode:u="system",onModeChange:f$1,user:h,onUserRefresh:m,onUserSetting:v,onUserLogout:y,userMenuItems:g$1,logo:x,searchPlaceholder:b,searchPlacement:C="hidden",floatingSearchSx:P,onSearch:S,onSearchAdd:k,rightHeaderSlot:I,leftHeaderSlot:w,contentSx:A,navigationVariant:R="classic",navigationMode:T,defaultNavigationMode:N="fixed",onNavigationModeChange:D,showNavigationModeToggle:L=true,enableNavigationPinning:B=true,navigationPinStorageKey:X,pinnedNavigationItemIds:H,defaultPinnedNavigationItemIds:K,onPinnedNavigationItemIdsChange:W,pinnedNavigationSectionTitle:G})=>{let z=t?Fi(t,"mode"):"orbcafe:page-layout-mode",O=t?Fi(t,"locale"):Jb,Y=t?Fi(t,"navigation-mode"):"orbcafe:page-layout-navigation-mode",[Q,me]=useState(u),[ie,se]=useState("light"),[fe,Ge]=useState(false),[Re,ke]=useState(i),[ze,Pe]=useState(false),[Ce,Ve]=useState(false),[rt,at]=useState(N),[Ye,_]=useState({x:Ar,y:Ar}),[Oe,ve]=useState("left"),[Ee,it]=useState(false),je=useRef(null),ht=useRef(null),xt=p!==void 0,At=p??Q,Et=d!==void 0,te=Et?i:Re,ot=l?.join("|")??"",Fe=T!==void 0,le=T??rt,ge=le==="floating",J=R==="v2"?Bs:_c,Te=C==="header",Ie=At==="system"?fe?ie:"light":At;useEffect(()=>{if(!xt)try{let q=window.localStorage.getItem(z);(q==="light"||q==="dark"||q==="system")&&me(q);}catch{}Ge(true);let Se=window.matchMedia("(prefers-color-scheme: dark)"),V=()=>{se(Se.matches?"dark":"light");};return V(),Se.addEventListener("change",V),()=>Se.removeEventListener("change",V)},[xt,z]),useEffect(()=>{if(!(xt||!fe))try{window.localStorage.setItem(z,At);}catch{}},[fe,xt,At,z]),useEffect(()=>{if(Et){Pe(true);return}try{let Se=window.localStorage.getItem(O),V=l??du;Se&&du.includes(Se)&&V.includes(Se)&&ke(Se);}catch{}finally{Pe(true);}},[Et,ot,O]),useEffect(()=>{if(!(Et||!ze))try{window.localStorage.setItem(O,te);}catch{}},[te,Et,ze,O]),useEffect(()=>{if(Fe){Ve(true);return}try{let Se=window.localStorage.getItem(Y);(Se==="fixed"||Se==="floating")&&at(Se);}catch{}finally{Ve(true);}},[Fe]),useEffect(()=>{if(Ce)try{window.localStorage.setItem(Y,le);}catch{}},[le,Ce]),useEffect(()=>{Ie==="dark"?(document.documentElement.classList.add("dark"),document.documentElement.style.colorScheme="dark"):(document.documentElement.classList.remove("dark"),document.documentElement.style.colorScheme="light");},[Ie]);let Ze=useCallback(Se=>{Fe||at(Se),D?.(Se);},[Fe,D]),ut=useCallback(Se=>{xt||me(Se),f$1?.(Se);},[xt,f$1]),dt=useCallback(Se=>{Et||ke(Se),d?.(Se);},[Et,d]),{navigationIslandProps:Lt,navigationMaxHeight:_t}=iu({menuData:o,initialNavigationCollapsed:false,initialNavigationMode:le,enableNavigationPinning:B,navigationPinStorageKey:X??(t?Fi(t,"pinned-navigation-items"):tv(r)),pinnedNavigationItemIds:H,defaultPinnedNavigationItemIds:K,onPinnedNavigationItemIdsChange:W,pinnedNavigationSectionTitle:G}),bt=Lt.collapsed,ft=useCallback(Se=>{let V=je.current,q=V?.parentElement;if(!V||!q)return Se;let ee=q.getBoundingClientRect(),De=V.getBoundingClientRect(),he=Ar,Ne=Ar,_e=Math.max(he,ee.width-De.width-Ar),Je=Math.max(Ne,ee.height-De.height-Ar);return {x:Bi(Se.x,he,_e),y:Bi(Se.y,Ne,Je)}},[]),yr=useCallback(Se=>{let V=je.current,q=V?.parentElement;if(!V||!q)return Se;let ee=q.getBoundingClientRect(),De=V.getBoundingClientRect(),he=Ar,Ne=Ar,_e=Math.max(he,ee.width-De.width-Ar),Je=Math.max(Ne,ee.height-De.height-Ar),Ue={x:Bi(Se.x,he,_e),y:Bi(Se.y,Ne,Je)},Dt=[{distance:Math.abs(Ue.x-he),position:{x:he,y:Ue.y}},{distance:Math.abs(Ue.x-_e),position:{x:_e,y:Ue.y}},{distance:Math.abs(Ue.y-Ne),position:{x:Ue.x,y:Ne}},{distance:Math.abs(Ue.y-Je),position:{x:Ue.x,y:Je}}].reduce((St,yt)=>yt.distance<St.distance?yt:St).position;return ve(Dt.x>=(he+_e)/2?"right":"left"),Dt},[]),Pt=useMemo(()=>{if(!ge||Ee)return Ye.x;if(Oe==="right"){let q=je.current?.parentElement?.getBoundingClientRect().width,ee=bt?lu:cu;return q?Math.max(Ar,q-ee-Ar):bt?Ye.x:Ye.x-(cu-lu)}return Ye.x},[Oe,Ye.x,Ee,ge,bt]),Ot=useCallback(Se=>{if(!ge||!bt||ov(Se.target))return;Se.preventDefault(),Se.currentTarget.setPointerCapture(Se.pointerId);let V=ft({x:Pt,y:Ye.y});ve("left"),_(V),ht.current={pointerId:Se.pointerId,startClientX:Se.clientX,startClientY:Se.clientY,startX:V.x,startY:V.y,currentX:V.x,currentY:V.y},it(true);},[ft,Pt,Ye.y,ge,bt]),pt=useCallback(Se=>{let V=ht.current;if(!V||V.pointerId!==Se.pointerId)return;let q=ft({x:V.startX+Se.clientX-V.startClientX,y:V.startY+Se.clientY-V.startClientY});V.currentX=q.x,V.currentY=q.y,_(q);},[ft]),Ft=useCallback(Se=>{let V=ht.current;if(!(!V||V.pointerId!==Se.pointerId)){try{Se.currentTarget.releasePointerCapture(Se.pointerId);}catch{}ht.current=null,_(yr({x:V.currentX,y:V.currentY})),it(false);}},[yr]);return useEffect(()=>{if(!ge)return;let Se=()=>{_(ee=>ft(ee));},V=window.requestAnimationFrame(Se),q=window.setTimeout(Se,430);return ()=>{window.cancelAnimationFrame(V),window.clearTimeout(q);}},[ft,ge,bt,_t]),f(Dn,{mode:At,children:f(Ba,{locale:te,children:g("div",{className:"orb-root",style:{minHeight:"100vh",width:"100%",display:"flex",flexDirection:"column",overflowX:"hidden",background:"var(--orb-canvas)"},children:[f(Oi,{appTitle:r,logo:x,mode:At,onToggleMode:()=>ut(rv(At)),locale:te,localeLabel:Et||te===i?s:void 0,localeOptions:l,onLocaleChange:dt,user:h,onUserRefresh:m,onUserSetting:v,onUserLogout:y,userMenuItems:g$1,searchPlaceholder:b,showSearch:Te,onSearch:S,onSearchAdd:k,leftSlot:w,rightSlot:I}),C==="floating"&&f("div",{className:"orb-float-search",style:P,children:f(ml,{searchPlaceholder:b,onSearch:S,onSearchAdd:k,maxWidth:"100%"})}),g("div",{style:{flex:1,minHeight:0,minWidth:0,display:"flex",overflowX:"hidden",position:"relative"},children:[a&&!ge&&f("div",{style:{paddingTop:12,paddingBottom:12,paddingLeft:12,paddingRight:bt?4:12,display:"flex",alignItems:"flex-start",flexShrink:0},children:f(J,{...Lt,maxHeight:_t,colorMode:Ie,displayMode:le,onDisplayModeChange:Ze,showDisplayModeToggle:L&&bt})}),a&&ge&&f("div",{ref:je,onPointerDown:Ot,onPointerMove:pt,onPointerUp:Ft,onPointerCancel:Ft,style:{position:"absolute",top:Ye.y,left:Pt,zIndex:1205,display:"flex",alignItems:"flex-start",cursor:bt?Ee?"grabbing":"grab":"default",touchAction:bt?"none":"auto",userSelect:Ee?"none":void 0,transition:Ee?"none":"left 180ms ease-out, top 180ms ease-out"},children:f(J,{...Lt,maxHeight:_t,colorMode:Ie,displayMode:le,onDisplayModeChange:Ze,showDisplayModeToggle:L&&bt})}),f("div",{style:{flex:1,minWidth:0,minHeight:0,overflow:"auto",paddingTop:12,paddingBottom:12,paddingRight:12,paddingLeft:a&&!ge&&bt?4:12,...A},children:n})]})]})})})};var Hi="(blank)",pu="Result",uu="Grand Total",mu={sum:"Sum",count:"Count",avg:"Average",min:"Min",max:"Max"},gu=["sum","count","avg","min","max"];var fu=["palette","rows","columns","filters","values"];var hu=t=>fu.includes(t),bu=t=>t==="rows"||t==="columns"||t==="filters",zi=t=>{let r=t.split("|");return r.length===2&&r[0]==="container"&&hu(r[1])?{kind:"container",zone:r[1]}:r.length===3&&r[0]==="item"&&hu(r[1])&&r[2]?{kind:"item",zone:r[1],key:r[2]}:null},so=t=>t==null||t===""?Hi:t instanceof Date?t.toISOString().slice(0,10):String(t),Vo=t=>JSON.stringify(t),vu=(t,r)=>{let o=t.join(""),n=r.join("");return o.localeCompare(n,void 0,{sensitivity:"base"})},nv=t=>{if(typeof t=="number"&&Number.isFinite(t))return t;if(typeof t=="string"&&t.trim()!==""){let r=Number(t);return Number.isFinite(r)?r:null}return null},yn=(t,r,o)=>{if(o==="count")return t.length;let n=t.map(a=>nv(a[r])).filter(a=>a!==null);return n.length===0?0:o==="sum"?n.reduce((a,i)=>a+i,0):o==="avg"?n.reduce((a,i)=>a+i,0)/n.length:o==="min"?Math.min(...n):Math.max(...n)},ir=(t,r)=>{if(!t||t.length===0)return [];let o=new Set,n=[];return t.forEach(a=>{!r.has(a)||o.has(a)||(o.add(a),n.push(a));}),n},lo=(t,r)=>t.length!==r.length?false:t.every((o,n)=>o===r[n]),yu=(t,r)=>{let o=Object.keys(t),n=Object.keys(r);return o.length!==n.length?false:o.every(a=>{let i=t[a]??[],s=r[a]??[];return lo(i,s)})},Vi=(t,r)=>t.length!==r.length?false:t.every((o,n)=>{let a=r[n];return o.tokenId===a.tokenId&&o.fieldId===a.fieldId&&o.aggregation===a.aggregation}),gl=t=>!t?.aggregations||t.aggregations.length===0?gu:t.aggregations,fr=(t,r)=>{let o=gl(r);return t&&o.includes(t)?t:r?.type==="number"&&o.includes("sum")?"sum":o.includes("count")?"count":o[0]},ia=(t,r,o)=>{let n=o.get(r.fieldId);return n?.formatValue?n.formatValue(t):r.aggregation==="count"?Math.round(t).toLocaleString():t.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:2})};var xu=({options:t,selectedValues:r,onChange:o,minWidth:n=96})=>{let{t:a}=de(),[i,s]=useState(""),[l,d]=useState(null),p=useMemo(()=>{let m=i.trim().toLowerCase();return m?t.filter(v=>v.toLowerCase().includes(m)):t},[t,i]),u=t.length>0&&r.length===t.length,f$1=t.length===0?a("pivot.filter.na"):r.length===0?a("common.none"):u?a("common.all"):`${r.length}/${t.length}`,h=m=>{o(r.includes(m)?r.filter(v=>v!==m):[...r,m]);};return g("div",{sx:{minWidth:n},onClick:m=>m.stopPropagation(),onMouseDown:m=>m.stopPropagation(),children:[f(ye,{variant:"outlined",size:"small",onClick:m=>d(m.currentTarget),sx:{minWidth:n,height:26,px:1,py:.35,fontSize:"0.72rem",justifyContent:"space-between"},children:f$1}),f(Yt,{anchorEl:l,open:!!l,onClose:()=>d(null),PaperProps:{sx:{width:Math.max(n,220),maxHeight:320,overflowY:"auto",p:.5}},children:g("div",{onClick:m=>m.stopPropagation(),sx:{display:"grid",gap:.4},children:[f(He,{size:"small",placeholder:`${a("common.search")}...`,fullWidth:true,value:i,onChange:m=>s(m.target.value),onKeyDown:m=>m.stopPropagation(),onClick:m=>m.stopPropagation(),sx:{m:0,"& .orb-inp":{fontSize:"0.75rem",py:.7}}}),f("div",{sx:{px:1,py:.5,borderBottom:"1px solid var(--orb-border)"},children:f(ye,{variant:"text",size:"small",onClick:m=>{m.preventDefault(),m.stopPropagation(),o(u?[]:t);},sx:{minWidth:"auto",px:0,py:.2,fontSize:"0.76rem",fontWeight:700,textTransform:"none"},children:a(u?"pivot.filter.deselectAll":"pivot.filter.selectAll")})}),p.length===0&&f("div",{className:"orb-menu-item","aria-disabled":"true",sx:{fontSize:"0.75rem"},children:a("pivot.filter.noResults")}),p.map(m=>{let v=r.includes(m);return g("div",{role:"option","aria-selected":v,tabIndex:0,className:`orb-menu-item ${v?"orb-selected":""}`,onClick:()=>h(m),onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),h(m));},sx:{display:"flex",alignItems:"center",fontSize:"0.75rem",py:.4},children:[f(Rt,{size:"small",checked:v,inputProps:{tabIndex:-1},sx:{p:.5,mr:.5,pointerEvents:"none"}}),f("span",{children:m})]},m)})]})})]})};var Cn=({size:t=18,subtle:r=false})=>{let o=Math.max(2,Math.round(t/6));return f(we,{"aria-hidden":"true",sx:{display:"grid",gridTemplateColumns:`repeat(2, ${o}px)`,gridAutoRows:`${o}px`,gap:`${Math.max(2,Math.round(o/1.5))}px`,placeItems:"center",width:t,height:t,flexShrink:0,color:r?"var(--orb-muted)":"var(--orb-primary)"},children:Array.from({length:6},(n,a)=>f(we,{sx:{width:o,height:o,borderRadius:999,bgcolor:"currentColor"}},a))})};var fl=({label:t,subtitle:r,isDragging:o,dragRef:n,listeners:a,attributes:i,style:s})=>f(Ae,{ref:n,...a,...i,sx:{p:1,borderRadius:"var(--orb-r-container)",border:"1px solid",borderColor:"var(--orb-border)",bgcolor:"var(--orb-canvas)",boxShadow:"var(--orb-shadow-1)",touchAction:"none",transition:"border-color 140ms ease, background-color 140ms ease, transform 140ms ease","&:hover":{borderColor:"var(--orb-p200)",bgcolor:"var(--orb-p50)",transform:"translateY(-1px)"}},style:{...s,opacity:o?.3:1,cursor:o?"grabbing":"grab"},children:g("div",{sx:{display:"flex",alignItems:"center",gap:.9},children:[f("div",{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:"var(--orb-r)",bgcolor:"var(--orb-p50)",border:"1px solid var(--orb-p100)"},children:f(Cn,{size:13,subtle:true})}),g("div",{sx:{minWidth:0,display:"flex",flexDirection:"column",gap:.15},children:[f(E,{component:"div",sx:{fontSize:"0.84rem",fontWeight:700,lineHeight:1.2,color:"var(--orb-fg-strong)"},children:t}),r&&f(E,{component:"div",sx:{fontSize:"0.73rem",fontWeight:400,color:"var(--orb-fg)",lineHeight:1.2},children:r})]})]})}),Su=({id:t,label:r,subtitle:o})=>{let{setNodeRef:n,listeners:a,attributes:i,isDragging:s}=useDraggable({id:t});return f(fl,{label:r,subtitle:o,isDragging:s,dragRef:n,listeners:a,attributes:i})};var xn=({zone:t,title:r,hint:o,icon:n,children:a,itemCount:i,onClear:s})=>{let l=`container|${t}`,{isOver:d,setNodeRef:p}=useDroppable({id:l}),{t:u}=de();return g(Ae,{ref:p,sx:f=>({p:1.1,borderRadius:"var(--orb-r-container)",border:"1px dashed",borderColor:d?"var(--orb-primary)":"var(--orb-p200)",bgcolor:d?"var(--orb-p100)":f.palette.mode==="dark"?"var(--orb-surface-2)":"var(--orb-p50)",transition:"border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease",boxShadow:d?"0 0 0 3px var(--orb-focus-ring)":"none",minHeight:120,display:"flex",flexDirection:"column"}),children:[g("div",{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1},children:[g("div",{sx:{display:"flex",alignItems:"center",gap:.8},children:[n,f(E,{component:"div",sx:{fontSize:"0.8rem",fontWeight:700,letterSpacing:.1,color:"var(--orb-fg-strong)"},children:r}),g(E,{component:"div",sx:{fontSize:"0.73rem",fontWeight:500,color:"var(--orb-fg)"},children:["(",i,")"]})]}),i>0&&s&&f(st,{title:u("pivot.clearArea"),children:f(ne,{size:"small",onClick:s,sx:{width:24,height:24,p:0},children:f(Bd,{size:13})})})]}),f(E,{component:"div",sx:{mt:.5,mb:.9,fontSize:"0.72rem",fontWeight:400,color:"var(--orb-fg)"},children:o}),f("div",{sx:{flex:1},children:a})]})};var wu={xs:1.2,md:1.6},Sn=({title:t,subtitle:r,collapsed:o,onToggleCollapse:n,expandAriaLabel:a,collapseAriaLabel:i,children:s,bodySx:l,unmountOnExit:d=false,headerActions:p})=>g(Ae,{sx:u=>({borderRadius:"var(--orb-r-container)",border:`1px solid ${u.palette.divider}`,overflow:"hidden",bgcolor:"var(--orb-surface)",boxShadow:"var(--orb-shadow-1)"}),children:[g("div",{sx:u=>({px:wu,py:1.15,display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,bgcolor:"var(--orb-canvas)",borderBottom:o?"none":`1px solid ${u.palette.divider}`}),children:[g("div",{sx:{minWidth:0,flex:1},children:[f(E,{component:"div",sx:{fontSize:"0.92rem",fontWeight:700,color:"var(--orb-fg-strong)"},children:t}),f(E,{component:"div",sx:{fontSize:"0.75rem",fontWeight:400,color:"var(--orb-fg)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:r})]}),g("div",{sx:{display:"flex",alignItems:"center",gap:.75,flexShrink:0},children:[p,f(ne,{size:"small","aria-label":o?a:i,onClick:n,sx:u=>({border:`1px solid ${u.palette.divider}`,bgcolor:"var(--orb-canvas)",color:"var(--orb-primary)",width:24,height:24,padding:0,borderRadius:999,flexShrink:0,"&:hover":{bgcolor:"var(--orb-p50)",borderColor:"var(--orb-p200)"}}),children:f(ja,{size:13,sx:{transition:"transform 220ms cubic-bezier(0.2, 0, 0, 1)",transform:o?"rotate(180deg)":"rotate(0deg)"}})})]})]}),f(en,{in:!o,timeout:260,easing:"cubic-bezier(0.2, 0, 0, 1)",unmountOnExit:d,children:f("div",{sx:[{px:wu,py:{xs:1.2,md:1.6}},...Array.isArray(l)?l:l?[l]:[]],children:s})})]});var Wi=({label:t,caption:r,onRemove:o,trailing:n,isDragging:a,dragRef:i,listeners:s,attributes:l,style:d})=>f(Ae,{ref:i,style:d,sx:{p:1,borderRadius:"var(--orb-r-container)",border:"1px solid",borderColor:"var(--orb-border)",bgcolor:"var(--orb-canvas)",boxShadow:"var(--orb-shadow-1)",touchAction:"none",opacity:a?0:1,transition:"border-color 140ms ease, background-color 140ms ease, transform 140ms ease","&:hover":{borderColor:"var(--orb-p200)",bgcolor:"var(--orb-p50)"}},children:g("div",{sx:{display:"flex",alignItems:"center",gap:.9},children:[f("div",{...l,...s,sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:"var(--orb-r)",bgcolor:"var(--orb-p50)",border:"1px solid var(--orb-p100)",cursor:"grab"},children:f(Cn,{size:13,subtle:true})}),g("div",{sx:{minWidth:0,flex:1,display:"flex",flexDirection:"column",gap:.15},children:[f(E,{component:"div",sx:{fontSize:"0.82rem",fontWeight:700,lineHeight:1.2,color:"var(--orb-fg-strong)"},children:t}),r&&f(E,{component:"div",sx:{fontSize:"0.72rem",fontWeight:400,color:"var(--orb-fg)",lineHeight:1.2},children:r})]}),n,o&&f(ne,{size:"small",onClick:p=>{p.stopPropagation(),o();},sx:{width:24,height:24,p:0},children:f(Co,{size:13})})]})}),sa=({id:t,label:r,caption:o,onRemove:n,trailing:a})=>{let{setNodeRef:i,attributes:s,listeners:l,transform:d,transition:p,isDragging:u}=useSortable({id:t}),f$1={transform:d?`translate3d(${d.x}px, ${d.y}px, 0)`:void 0,transition:p,zIndex:u?999:"auto"};return f(Wi,{label:r,caption:o,onRemove:n,trailing:a,isDragging:u,dragRef:i,listeners:l,attributes:s,style:f$1})};var _i={rows:f(Qd,{size:16,sx:{color:"var(--orb-primary)"}}),columns:f(on,{size:16,sx:{color:"var(--orb-primary)"}}),filters:f(Ad,{size:16,sx:{color:"var(--orb-primary)"}}),values:f(rn,{size:16,sx:{color:"var(--orb-accent)"}})},ku=({isConfiguratorCollapsed:t,onToggleCollapse:r,availableFields:o,fieldMap:n,filterFields:a,columnFields:i,rowFields:s,valueFields:l,clearZone:d,removeFieldFromZone:p,getFilterSelectionSummary:u,renderDimensionFilterSelect:f$1,renderAggregationSelect:h,getAggregationLabel:m})=>{let{t:v}=de(),y=[`${v("pivot.zone.rows")} ${s.length}`,`${v("pivot.zone.columns")} ${i.length}`,`${v("pivot.zone.filters")} ${a.length}`,`${v("pivot.zone.values")} ${l.length}`].join(" \xB7 ");return f(Sn,{title:v("pivot.config.title"),subtitle:y,collapsed:t,onToggleCollapse:r,expandAriaLabel:v("pivot.collapse.ariaExpand"),collapseAriaLabel:v("pivot.collapse.ariaCollapse"),unmountOnExit:true,children:g("div",{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",lg:"260px 1fr"},gap:2},children:[f(xn,{zone:"palette",title:v("pivot.fieldList"),hint:v("pivot.availableDimensions"),itemCount:o.length,icon:f(Cn,{size:18,subtle:true}),children:g(ae,{spacing:.8,sx:{maxHeight:400,overflowY:"auto",pr:.5},children:[o.length===0&&f(E,{component:"div",sx:{fontSize:"0.74rem",fontWeight:400,color:"var(--orb-fg)",py:1},children:v("pivot.allFieldsInUse")}),o.map(g=>f(Su,{id:`item|palette|${g.id}`,label:g.label,subtitle:g.type??"string"},g.id))]})}),g(ae,{spacing:2,children:[g("div",{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[f(xn,{zone:"filters",title:v("pivot.zone.filters"),hint:v("pivot.hint.filters"),icon:_i.filters,itemCount:a.length,onClear:()=>d("filters"),children:f(SortableContext,{items:a.map(g=>`item|filters|${g}`),strategy:verticalListSortingStrategy,children:f(ae,{spacing:.7,children:a.map(g=>f(sa,{id:`item|filters|${g}`,label:n.get(g)?.label??g,caption:u(g),trailing:f$1(g),onRemove:()=>p("filters",g)},g))})})}),f(xn,{zone:"columns",title:v("pivot.zone.columns"),hint:v("pivot.hint.columns"),icon:_i.columns,itemCount:i.length,onClear:()=>d("columns"),children:f(SortableContext,{items:i.map(g=>`item|columns|${g}`),strategy:verticalListSortingStrategy,children:f(ae,{spacing:.7,children:i.map(g=>f(sa,{id:`item|columns|${g}`,label:n.get(g)?.label??g,caption:`${n.get(g)?.type??"dimension"} \u2022 ${u(g)}`,trailing:f$1(g),onRemove:()=>p("columns",g)},g))})})})]}),g("div",{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[f(xn,{zone:"rows",title:v("pivot.zone.rows"),hint:v("pivot.hint.rows"),icon:_i.rows,itemCount:s.length,onClear:()=>d("rows"),children:f(SortableContext,{items:s.map(g=>`item|rows|${g}`),strategy:verticalListSortingStrategy,children:f(ae,{spacing:.7,children:s.map(g=>f(sa,{id:`item|rows|${g}`,label:n.get(g)?.label??g,caption:`${n.get(g)?.type??"dimension"} \u2022 ${u(g)}`,trailing:f$1(g),onRemove:()=>p("rows",g)},g))})})}),f(xn,{zone:"values",title:v("pivot.zone.values"),hint:v("pivot.hint.values"),icon:_i.values,itemCount:l.length,onClear:()=>d("values"),children:f(SortableContext,{items:l.map(g=>`item|values|${g.tokenId}`),strategy:verticalListSortingStrategy,children:f(ae,{spacing:.7,children:l.map(g=>{let x=n.get(g.fieldId)?.label??g.fieldId,b=`${m(g.aggregation)}(${x})`;return f(sa,{id:`item|values|${g.tokenId}`,label:x,caption:b,trailing:h(g),onRemove:()=>p("values",g.tokenId)},g.tokenId)})})})})]})]})]})})};var Pu=t=>t.toLocaleString(void 0,{maximumFractionDigits:1}),Tu=({data:t,primaryLabel:r,secondaryLabel:o,formatPrimaryValue:n,formatSecondaryValue:a})=>{let i=ar();if(t.length===0)return null;let s=720,l=250,d={top:20,right:24,bottom:40,left:52},p=o?t.map(g=>g.primaryValue):t.map((g,x)=>x+1),u=o?t.map(g=>g.secondaryValue??0):t.map(g=>g.primaryValue),f$1=Math.max(...p,1),h=Math.max(...u,1),m=s-d.left-d.right,v=l-d.top-d.bottom,y=t.map((g,x)=>{let b=o?g.primaryValue:x+1,C=o?g.secondaryValue??0:g.primaryValue,P=d.left+b/f$1*m,S=l-d.bottom-C/h*v;return {...g,x:P,y:S,rawX:b,rawY:C}});return g("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[f("div",{sx:{overflowX:"auto"},children:g("div",{component:"svg",viewBox:`0 0 ${s} ${l}`,sx:{width:"100%",minWidth:s,height:l},children:[f("line",{x1:d.left,y1:l-d.bottom,x2:s-d.right,y2:l-d.bottom,stroke:Dr(i.palette.text.secondary,.35)}),f("line",{x1:d.left,y1:d.top,x2:d.left,y2:l-d.bottom,stroke:Dr(i.palette.text.secondary,.35)}),y.map(g$1=>g("g",{children:[f("circle",{cx:g$1.x,cy:g$1.y,r:7,fill:Dr(i.palette.primary.main,.18)}),f("circle",{cx:g$1.x,cy:g$1.y,r:4.5,fill:i.palette.primary.main,children:g("title",{children:[g$1.name,`
13
+ `,o?`${r}: ${n(g$1.primaryValue)}`:`${r}: ${n(g$1.primaryValue)}`,o?`
14
+ ${o}: ${(a??n)(g$1.secondaryValue??0)}`:""]})}),f("text",{x:g$1.x,y:Math.max(g$1.y-12,d.top+8),textAnchor:"middle",fontSize:"10",fill:i.palette.text.secondary,children:g$1.name})]},g$1.name)),f("text",{x:s/2,y:l-10,textAnchor:"middle",fontSize:"11",fill:i.palette.text.secondary,children:o?r:"Index"}),f("text",{x:16,y:l/2,textAnchor:"middle",transform:`rotate(-90 16 ${l/2})`,fontSize:"11",fill:i.palette.text.secondary,children:o??r}),f("text",{x:d.left,y:d.top-4,fontSize:"10",fill:i.palette.text.secondary,children:Pu(h)}),f("text",{x:s-d.right,y:l-d.bottom+16,textAnchor:"end",fontSize:"10",fill:i.palette.text.secondary,children:Pu(f$1)})]})}),f("div",{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",lg:"repeat(3, minmax(0, 1fr))"},gap:1},children:t.map(g$1=>g("div",{sx:x=>({borderRadius:"var(--orb-r-container)",px:1.25,py:1,border:`1px solid ${Dr(x.palette.divider,.7)}`,bgcolor:Dr(x.palette.background.default,.35)}),children:[f(E,{component:"div",sx:{fontSize:"0.78rem",fontWeight:700,color:"var(--orb-fg-strong)"},noWrap:true,title:g$1.name,children:g$1.name}),g(E,{component:"div",sx:{fontSize:"0.72rem",color:"var(--orb-fg)"},children:[r,": ",n(g$1.primaryValue)]}),o&&g(E,{component:"div",sx:{fontSize:"0.72rem",color:"var(--orb-fg)"},children:[o,": ",(a??n)(g$1.secondaryValue??0)]})]},g$1.name))})]})};var hl=t=>Math.max(...t,1),Iu=({data:t,chartType:r,primaryLabel:o,secondaryLabel:n,formatPrimaryValue:a,formatSecondaryValue:i})=>{let s=ar(),l=s.palette.primary.main,d=s.palette.warning.main;if(t.length===0)return null;if(r==="bar-horizontal"){let b=hl(t.flatMap(C=>[C.primaryValue,C.secondaryValue??0]));return f(ae,{spacing:1.1,children:t.map(C=>g("div",{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",md:"160px 1fr 128px"},gap:1.25,alignItems:"center"},children:[f(E,{component:"div",sx:{fontSize:"0.78rem",fontWeight:700,color:"var(--orb-fg-strong)"},noWrap:true,title:C.name,children:C.name}),g(ae,{spacing:.65,children:[f("div",{sx:{height:10,borderRadius:999,overflow:"hidden",bgcolor:Dr(s.palette.action.active,.08)},children:f("div",{sx:{width:`${C.primaryValue/b*100}%`,height:"100%",bgcolor:l}})}),n&&f("div",{sx:{height:8,borderRadius:999,overflow:"hidden",bgcolor:Dr(s.palette.action.active,.08)},children:f("div",{sx:{width:`${(C.secondaryValue??0)/b*100}%`,height:"100%",bgcolor:d}})})]}),g("div",{sx:{minWidth:0},children:[f(E,{component:"div",sx:{fontSize:"0.72rem",textAlign:{xs:"left",md:"right"},fontWeight:700,color:"var(--orb-fg-strong)"},children:a(C.primaryValue)}),n&&f(E,{component:"div",sx:{fontSize:"0.72rem",textAlign:{xs:"left",md:"right"},color:"var(--orb-fg)"},children:(i??a)(C.secondaryValue??0)})]})]},C.name))})}if(r==="bar-vertical"){let b=hl(t.flatMap(P=>[P.primaryValue,P.secondaryValue??0])),C=n?92:76;return f("div",{sx:{overflowX:"auto",pb:.5},children:f("div",{sx:{minWidth:Math.max(620,t.length*C),display:"grid",gridTemplateColumns:`repeat(${t.length}, minmax(56px, 1fr))`,gap:1,alignItems:"end"},children:t.map(P=>g("div",{sx:{minWidth:0},children:[g("div",{sx:{height:210,display:"flex",alignItems:"flex-end",justifyContent:"center",gap:.8},children:[f("div",{sx:{width:n?16:26,minHeight:8,height:`${Math.max(P.primaryValue/b*188,8)}px`,borderRadius:"10px 10px 2px 2px",bgcolor:l},title:`${o}: ${a(P.primaryValue)}`}),n&&f("div",{sx:{width:16,minHeight:8,height:`${Math.max((P.secondaryValue??0)/b*188,8)}px`,borderRadius:"10px 10px 2px 2px",bgcolor:d},title:`${n}: ${(i??a)(P.secondaryValue??0)}`})]}),f(E,{component:"div",sx:{fontSize:"0.76rem",fontWeight:700,color:"var(--orb-fg-strong)"},noWrap:true,title:P.name,children:P.name}),f(E,{component:"div",sx:{fontSize:"0.7rem",color:"var(--orb-fg)"},noWrap:true,title:a(P.primaryValue),children:a(P.primaryValue)}),n&&f(E,{component:"div",sx:{fontSize:"0.7rem",color:"var(--orb-fg)"},noWrap:true,title:(i??a)(P.secondaryValue??0),children:(i??a)(P.secondaryValue??0)})]},P.name))})})}let p=Math.max(680,t.length*74),u=240,f$1={top:20,right:18,bottom:36,left:18},h=hl(t.flatMap(b=>[b.primaryValue,b.secondaryValue??0])),m=p-f$1.left-f$1.right,v=u-f$1.top-f$1.bottom,y=b=>t.map((C,P)=>{let S=f$1.left+P*m/Math.max(t.length-1,1),k=u-f$1.bottom-b(C)/h*v;return {x:S,y:k,item:C}}),g$1=y(b=>b.primaryValue),x=n?y(b=>b.secondaryValue??0):[];return g("div",{sx:{display:"flex",flexDirection:"column",gap:1.1},children:[f("div",{sx:{overflowX:"auto"},children:g("div",{component:"svg",viewBox:`0 0 ${p} ${u}`,sx:{width:"100%",minWidth:p,height:u},children:[f("line",{x1:f$1.left,y1:u-f$1.bottom,x2:p-f$1.right,y2:u-f$1.bottom,stroke:Dr(s.palette.text.secondary,.35)}),f("polyline",{fill:"none",stroke:l,strokeWidth:3,points:g$1.map(b=>`${b.x},${b.y}`).join(" ")}),g$1.map(b=>f("circle",{cx:b.x,cy:b.y,r:4,fill:l,children:g("title",{children:[b.item.name,`
15
+ `,o,": ",a(b.item.primaryValue)]})},`primary-${b.item.name}`)),n&&g(e,{children:[f("polyline",{fill:"none",stroke:d,strokeWidth:2.5,strokeDasharray:"5 5",points:x.map(b=>`${b.x},${b.y}`).join(" ")}),x.map(b=>f("circle",{cx:b.x,cy:b.y,r:3.5,fill:d,children:g("title",{children:[b.item.name,`
16
+ `,n,": ",(i??a)(b.item.secondaryValue??0)]})},`secondary-${b.item.name}`))]})]})}),f("div",{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",xl:"repeat(4, minmax(0, 1fr))"},gap:1},children:t.map(b=>g("div",{sx:C=>({borderRadius:"var(--orb-r-container)",px:1.1,py:.9,border:`1px solid ${Dr(C.palette.divider,.7)}`,bgcolor:Dr(C.palette.background.default,.35)}),children:[f(E,{component:"div",sx:{fontSize:"0.76rem",fontWeight:700,color:"var(--orb-fg-strong)"},noWrap:true,title:b.name,children:b.name}),f(E,{component:"div",sx:{fontSize:"0.71rem",color:"var(--orb-fg)"},children:a(b.primaryValue)}),n&&f(E,{component:"div",sx:{fontSize:"0.71rem",color:"var(--orb-fg)"},children:(i??a)(b.secondaryValue??0)})]},b.name))})]})};var Mu=(t,r,o)=>{let n=new Set,a=[];return t.forEach(i=>{n.has(i)||(n.add(i),a.push({fieldId:i,label:o.get(i)?.label??i,zone:"rows"}));}),r.forEach(i=>{n.has(i)||(n.add(i),a.push({fieldId:i,label:o.get(i)?.label??i,zone:"columns"}));}),a},Ru=(t,r,o)=>t.map(n=>{let a=r.get(n.fieldId),i=a?.label??n.fieldId;return {fieldId:n.fieldId,label:`${o(n.aggregation)} \xB7 ${i}`,item:n,field:a}}),Du=({rows:t,dimensionFieldId:r,primaryValue:o,secondaryValue:n})=>{if(!r)return [];let a=new Map;return t.forEach(i=>{let s=so(i[r]),l=a.get(s);if(l){l.push(i);return}a.set(s,[i]);}),Array.from(a.entries()).sort((i,s)=>i[0].localeCompare(s[0],void 0,{sensitivity:"base"})).map(([i,s])=>({name:i,primaryValue:yn(s,o.fieldId,o.aggregation),secondaryValue:n?yn(s,n.fieldId,n.aggregation):void 0}))};var Nu=({rows:t,fieldMap:r,rowFields:o,columnFields:n,valueFields:a,chartDimensionFieldId:i,chartPrimaryValueFieldId:s,chartSecondaryValueFieldId:l,chartType:d,isCollapsed:p,onChartDimensionFieldIdChange:u,onChartPrimaryValueFieldIdChange:f$1,onChartSecondaryValueFieldIdChange:h,onChartTypeChange:m,onToggleCollapse:v,getAggregationLabel:y})=>{let{t:g$1}=de(),x=useMemo(()=>Mu(o,n,r),[n,r,o]),b=useMemo(()=>Ru(a,r,y),[r,y,a]),C=b.find(T=>T.fieldId===s)??b[0],P=b.find(T=>T.fieldId===l&&T.fieldId!==C?.fieldId)??null,S=x.find(T=>T.fieldId===i)??x[0],k=S&&C?g$1("pivot.chart.subtitleReady",{dimension:S.label,measure:P?`${C.label} / ${P.label}`:C.label}):g$1("pivot.chart.subtitle"),I=useMemo(()=>!S||!C?[]:Du({rows:t,dimensionFieldId:S.fieldId,primaryValue:C.item,secondaryValue:P?.item}),[C,t,P,S]),w=T=>C?ia(T,C.item,r):T.toLocaleString(),A=T=>P?ia(T,P.item,r):T.toLocaleString(),R=x.length>1||b.length>1;return g(Sn,{title:g$1("pivot.chart.title"),subtitle:k,collapsed:p,onToggleCollapse:v,expandAriaLabel:g$1("pivot.chart.collapse.ariaExpand"),collapseAriaLabel:g$1("pivot.chart.collapse.ariaCollapse"),bodySx:{display:"flex",flexDirection:"column",gap:1.1},children:[R&&g("div",{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, minmax(0, 1fr))",xl:"repeat(4, minmax(0, 1fr))"},gap:1,alignItems:"start"},children:[g(bo,{size:"small",sx:{minWidth:0,width:"100%"},children:[f(E,{component:"div",sx:{fontSize:"0.7rem",fontWeight:500,color:"var(--orb-fg)",mb:.45},children:g$1("pivot.chart.dimension")}),f(Vt,{value:S?.fieldId??"",onChange:T=>u(String(T.target.value)),sx:{fontSize:"0.75rem",height:32},children:x.map(T=>f("option",{value:T.fieldId,sx:{fontSize:"0.75rem"},children:T.label},T.fieldId))})]}),g(bo,{size:"small",sx:{minWidth:0,width:"100%"},children:[f(E,{component:"div",sx:{fontSize:"0.7rem",fontWeight:500,color:"var(--orb-fg)",mb:.45},children:g$1("pivot.chart.primaryMeasure")}),f(Vt,{value:C?.fieldId??"",onChange:T=>f$1(String(T.target.value)),sx:{fontSize:"0.75rem",height:32},children:b.map(T=>f("option",{value:T.fieldId,sx:{fontSize:"0.75rem"},children:T.label},T.fieldId))})]}),g(bo,{size:"small",sx:{minWidth:0,width:"100%"},children:[f(E,{component:"div",sx:{fontSize:"0.7rem",fontWeight:500,color:"var(--orb-fg)",mb:.45},children:g$1("pivot.chart.secondaryMeasure")}),g(Vt,{value:P?.fieldId??"",onChange:T=>h(String(T.target.value)),sx:{fontSize:"0.75rem",height:32},children:[f("option",{value:"",sx:{fontSize:"0.75rem",color:"text.secondary"},children:g$1("common.none")}),b.filter(T=>T.fieldId!==C?.fieldId).map(T=>f("option",{value:T.fieldId,sx:{fontSize:"0.75rem"},children:T.label},T.fieldId))]})]}),g(bo,{size:"small",sx:{minWidth:0,width:"100%"},children:[f(E,{component:"div",sx:{fontSize:"0.7rem",fontWeight:500,color:"var(--orb-fg)",mb:.45},children:g$1("pivot.chart.chartType")}),g(Vt,{value:d,onChange:T=>m(T.target.value),sx:{fontSize:"0.75rem",height:32},children:[f("option",{value:"bar-vertical",sx:{fontSize:"0.75rem"},children:g$1("pivot.chart.style.barVertical")}),f("option",{value:"bar-horizontal",sx:{fontSize:"0.75rem"},children:g$1("pivot.chart.style.barHorizontal")}),f("option",{value:"line",sx:{fontSize:"0.75rem"},children:g$1("pivot.chart.style.line")}),f("option",{value:"scatter",sx:{fontSize:"0.75rem"},children:g$1("pivot.chart.style.scatter")})]})]})]}),f("div",{children:S?C?I.length===0?f("div",{sx:{py:5,textAlign:"center"},children:f(E,{component:"div",sx:{fontSize:"0.86rem",fontWeight:400,color:"var(--orb-fg)"},children:g$1("pivot.chart.emptyNoData")})}):d==="scatter"?f(Tu,{data:I,primaryLabel:C.label,secondaryLabel:P?.label,formatPrimaryValue:w,formatSecondaryValue:A}):f(Iu,{data:I,chartType:d,primaryLabel:C.label,secondaryLabel:P?.label,formatPrimaryValue:w,formatSecondaryValue:A}):f("div",{sx:{py:5,textAlign:"center"},children:f(E,{component:"div",sx:{fontSize:"0.86rem",fontWeight:400,color:"var(--orb-fg)"},children:g$1("pivot.chart.emptyNoValue")})}):f("div",{sx:{py:5,textAlign:"center"},children:f(E,{component:"div",sx:{fontSize:"0.86rem",fontWeight:400,color:"var(--orb-fg)"},children:g$1("pivot.chart.emptyNoDimension")})})})]})};var Ui=({node:t,dataColumns:r,fieldMap:o,level:n,expandedKeys:a,onToggle:i,getValue:s})=>{let l=a.has(t.key),d=t.children.length>0,p=t.isGrandTotal,u=d&&!l&&!p,f$1=p?800:u?700:d?600:500,h=p?800:u?600:500;return g(e,{children:[g("tr",{sx:{bgcolor:p?b()==="dark"?"color-mix(in oklch, var(--orb-primary) 22%, transparent)":"color-mix(in oklch, var(--orb-primary) 8%, transparent)":b()==="dark"?"var(--orb-surface)":"background.paper","&:hover":{bgcolor:p?b()==="dark"?"color-mix(in oklch, var(--orb-primary) 28%, transparent)":"color-mix(in oklch, var(--orb-primary) 12%, transparent)":"var(--orb-hover)"}},children:[g("td",{style:{fontWeight:f$1},sx:m=>({fontSize:"0.76rem",borderBottom:`1px solid ${m.palette.divider}`,whiteSpace:"nowrap",pl:n*2+1,display:"flex",alignItems:"center",height:40}),children:[d&&!p&&f(ne,{size:"small",onClick:()=>i(t.key),sx:{width:22,height:22,p:0,mr:.35,ml:-0.8},children:l?f(Hr,{size:12}):f(xo,{size:12})}),!d&&!p&&n>0&&f("div",{sx:{width:18}}),t.value]}),r.map(m=>f("td",{align:"right",style:{fontWeight:h},sx:{fontSize:"0.76rem",borderBottom:v=>`1px solid ${v.palette.divider}`,whiteSpace:"nowrap"},children:ia(s?s(t,m.id):t.aggregatedValues[m.id]??0,m.valueItem,o)},`${t.key}-${m.id}`))]}),l&&t.children.map(m=>f(Ui,{node:m,dataColumns:r,fieldMap:o,level:n+1,expandedKeys:a,onToggle:i,getValue:s},m.key))]})};var vl=(t,r,o)=>{let n=[...t,...r];return o&&n.includes(o)?o:n[0]??""},qi=(t,r)=>r&&t.some(o=>o.fieldId===r)?r:t[0]?.fieldId??"",yl=(t,r,o)=>o===""?"":o&&o!==r&&t.some(n=>n.fieldId===o)?o:t.find(n=>n.fieldId!==r)?.fieldId??"",Eu=t=>{let r=new Set,o=n=>{n.forEach(a=>{a.children.length>0&&(r.add(a.key),o(a.children));});};return o(t),r},Lu=(t,r,o=0)=>t.length===0?o:t.reduce((n,a)=>a.children.length===0||!r.has(a.key)?Math.max(n,o+1):Math.max(n,Lu(a.children,r,o+1)),o),fv=(t,r)=>{let o=[],n=a=>{a.forEach(i=>{if(i.children.length>0&&r.has(i.key)){n(i.children);return}o.push(i);});};return n(t),o},eL=({title:t,rows:r,fields:o,initialLayout:n,initialChart:a,emptyText:i,maxPreviewHeight:s=520,initialChartCollapsed:l=false,initialTableCollapsed:d=false,model:p,enablePresetManagement:u=false,presets:f$1,defaultPresets:h,onPresetsChange:m,initialPresetId:v,onPresetApplied:y})=>{let{t:g$1}=de(),x=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:8}})),b$1=useRef(0),C=useRef(false),P=t??g$1("pivot.title.default"),S=i??g$1("pivot.empty"),k=useMemo(()=>({sum:g$1("pivot.agg.sum"),count:g$1("pivot.agg.count"),avg:g$1("pivot.agg.avg"),min:g$1("pivot.agg.min"),max:g$1("pivot.agg.max")}),[g$1]),I=useCallback(M=>k[M]??mu[M],[k]),w=useMemo(()=>new Set(o.map(M=>M.id)),[o]),A=useMemo(()=>new Map(o.map(M=>[M.id,M])),[o]),[R,T]=useState(()=>ir(n?.rows,w)),[N,D]=useState(()=>ir(n?.columns,w)),[L,B]=useState(()=>ir(n?.filters,w)),[X,H]=useState(()=>{let M=n?.values??[],$=new Set,U=[];return M.forEach(ce=>{if(!w.has(ce.fieldId)||$.has(ce.fieldId))return;$.add(ce.fieldId),b$1.current+=1;let Be=A.get(ce.fieldId);U.push({tokenId:`v${b$1.current}`,fieldId:ce.fieldId,aggregation:fr(ce.aggregation,Be)});}),U}),[K,W]=useState({}),[G,z]=useState(true),[O,Y]=useState(false),[Q,me]=useState(()=>vl(ir(n?.rows,w),ir(n?.columns,w),a?.dimensionFieldId)),[ie,se]=useState(()=>{let M=(n?.values??[]).filter(($,U,ce)=>w.has($.fieldId)&&ce.findIndex(Be=>Be.fieldId===$.fieldId)===U).map($=>({tokenId:$.fieldId,fieldId:$.fieldId,aggregation:fr($.aggregation,A.get($.fieldId))}));return qi(M,a?.primaryValueFieldId)}),[fe,Ge]=useState(()=>{let M=(n?.values??[]).filter((U,ce,Be)=>w.has(U.fieldId)&&Be.findIndex(nt=>nt.fieldId===U.fieldId)===ce).map(U=>({tokenId:U.fieldId,fieldId:U.fieldId,aggregation:fr(U.aggregation,A.get(U.fieldId))})),$=qi(M,a?.primaryValueFieldId);return yl(M,$,a?.secondaryValueFieldId)}),[Re,ke]=useState(a?.chartType??"bar-vertical"),[ze,Pe]=useState(l),[Ce,Ve]=useState(d),[rt,at]=useState(()=>h??[]),[Ye,_]=useState(""),[Oe,ve]=useState(false),[Ee,it]=useState(""),[je,ht]=useState(null),[xt,At]=useState(new Set(["__grand_total__"])),[Et,te]=useState(new Set),ot=p?.rowFields??R,Fe=p?.columnFields??N,le=p?.filterFields??L,ge=p?.valueFields??X,J=p?.filterSelections??K,Te=p?.showGrandTotal??G,Ie=p?.isConfiguratorCollapsed??O,Ze=p?.chartDimensionFieldId??Q,ut=p?.chartPrimaryValueFieldId??ie,dt=p?.chartSecondaryValueFieldId??fe,Lt=p?.chartType??Re,_t=p?.isChartCollapsed??ze,bt=p?.isTableCollapsed??Ce,ft=f$1??rt,yr=u||ft.length>0||!!m,Pt=useCallback(M=>{if(p?.setRowFields){p.setRowFields(M);return}T(M);},[p]),Ot=useCallback(M=>{if(p?.setColumnFields){p.setColumnFields(M);return}D(M);},[p]),pt=useCallback(M=>{if(p?.setFilterFields){p.setFilterFields(M);return}B(M);},[p]),Ft=useCallback(M=>{if(p?.setValueFields){p.setValueFields(M);return}H(M);},[p]),Se=useCallback(M=>{if(p?.setFilterSelections){p.setFilterSelections(M);return}W(M);},[p]),V=useCallback(M=>{if(p?.setShowGrandTotal){p.setShowGrandTotal(M);return}z(M);},[p]),q=useCallback(M=>{if(p?.setIsConfiguratorCollapsed){p.setIsConfiguratorCollapsed(M);return}Y(M);},[p]),ee=useCallback(M=>{if(p?.setChartDimensionFieldId){p.setChartDimensionFieldId(M);return}me(M);},[p]),De=useCallback(M=>{if(p?.setChartPrimaryValueFieldId){p.setChartPrimaryValueFieldId(M);return}se(M);},[p]),he=useCallback(M=>{if(p?.setChartSecondaryValueFieldId){p.setChartSecondaryValueFieldId(M);return}Ge(M);},[p]),Ne=useCallback(M=>{if(p?.setChartType){p.setChartType(M);return}ke(M);},[p]),_e=useCallback(M=>{if(p?.setIsChartCollapsed){p.setIsChartCollapsed(M);return}Pe(M);},[p]),Je=useCallback(M=>{if(p?.setIsTableCollapsed){p.setIsTableCollapsed(M);return}Ve(M);},[p]),Ue=useCallback(M=>{let $=typeof M=="function"?M(ft):M;f$1||at($),m?.($);},[m,ft,f$1]),vt=useMemo(()=>new Set([...ot,...Fe,...le]),[ot,Fe,le]),Dt=useMemo(()=>o.filter(M=>!vt.has(M.id)),[o,vt]),St=useMemo(()=>{let M=[...ot,...Fe,...le],$=new Set,U=[];return M.forEach(ce=>{$.has(ce)||($.add(ce),U.push(ce));}),U},[Fe,le,ot]);useEffect(()=>{Pt(M=>{let $=M.filter(U=>w.has(U));return lo(M,$)?M:$}),Ot(M=>{let $=M.filter(U=>w.has(U));return lo(M,$)?M:$}),pt(M=>{let $=M.filter(U=>w.has(U));return lo(M,$)?M:$}),Ft(M=>{let $=M.filter(U=>w.has(U.fieldId)).map(U=>({...U,aggregation:fr(U.aggregation,A.get(U.fieldId))}));return Vi(M,$)?M:$});},[A,w]);let yt=useMemo(()=>{let M={};return St.forEach($=>{let U=new Set;r.forEach(ce=>{U.add(so(ce[$]));}),M[$]=Array.from(U).sort((ce,Be)=>ce.localeCompare(Be));}),M},[St,r]);useEffect(()=>{Se(M=>{let $={};return St.forEach(U=>{let ce=yt[U]??[],nt=(M[U]??[]).filter(re=>ce.includes(re)),We=Object.prototype.hasOwnProperty.call(M,U);$[U]=We?nt:ce;}),yu(M,$)?M:$});},[St,yt]),useEffect(()=>{ee(M=>vl(ot,Fe,M));},[Fe,ot,ee]),useEffect(()=>{De(M=>qi(ge,M));},[De,ge]),useEffect(()=>{he(M=>yl(ge,ut,M));},[ut,he,ge]);let F=useMemo(()=>r.filter(M=>St.every($=>{let U=J[$]??[],ce=yt[$]??[];if(U.length===ce.length)return true;if(U.length===0)return false;let Be=so(M[$]);return U.includes(Be)})),[St,yt,J,r]),Z=useMemo(()=>{if(ge.length===0)return null;let M=new Map;if(F.forEach(We=>{let re=Fe.length>0?Fe.map(j=>so(We[j])):[g$1("pivot.valueLabel")],pe=Vo(re);M.set(pe,re);}),M.size===0){let We=Fe.length>0?Fe.map(()=>Hi):[g$1("pivot.valueLabel")];M.set(Vo(We),We);}let $=Array.from(M.entries()).sort((We,re)=>vu(We[1],re[1])),U=$.flatMap(([We,re])=>ge.map(pe=>{let j=A.get(pe.fieldId),Le=`${I(pe.aggregation)} ${j?.label??pe.fieldId}`,Qe=Fe.length===0||ge.length>1?`${re.join(" / ")} \u2022 ${Le}`:re.join(" / ");return {id:`${We}::${pe.tokenId}`,colKey:We,valueItem:pe,label:Qe}})),ce=[];Fe.length>0&&$.forEach(([We,re])=>{let pe=U.filter(Qe=>Qe.colKey===We),j=ce,Le=[];re.forEach((Qe,Me)=>{Le.push(`d${Me}:${Qe}`);let Xe=`col::${Vo(Le)}`,It=j.find(Yo=>Yo.key===Xe);It||(It={key:Xe,label:Qe,children:[],leafColumnIds:[],path:re.slice(0,Me+1),depth:Me},j.push(It)),pe.forEach(Yo=>{It.leafColumnIds.includes(Yo.id)||It.leafColumnIds.push(Yo.id);}),j=It.children;});});let Be=We=>{let re={};return U.forEach(pe=>{let j=We.filter(Le=>{let Qe=Fe.length>0?Fe.map(Me=>so(Le[Me])):[g$1("pivot.valueLabel")];return Vo(Qe)===pe.colKey});re[pe.id]=yn(j,pe.valueItem.fieldId,pe.valueItem.aggregation);}),re},nt=[];if(ot.length===0)nt.push({key:"root",value:g$1("pivot.resultLabel")||pu,children:[],isLeaf:true,aggregatedValues:Be(F),path:[],depth:0});else {let We=(re,pe,j)=>{if(pe>=ot.length)return [];let Le=ot[pe],Qe=new Map;return re.forEach(Me=>{let Xe=so(Me[Le]);Qe.has(Xe)||Qe.set(Xe,[]),Qe.get(Xe).push(Me);}),Array.from(Qe.keys()).sort().map(Me=>{let Xe=Qe.get(Me),It=[...j,Me];return {key:Vo(It),value:Me,fieldId:Le,aggregatedValues:Be(Xe),children:We(Xe,pe+1,It),isLeaf:pe===ot.length-1,path:It,depth:pe}})};nt.push(...We(F,0,[]));}return {dataColumns:U,columnTree:ce,rowTree:nt}},[Fe,A,F,I,ot,g$1,ge]),ue=useCallback((M,$)=>(b$1.current+=1,{tokenId:`v${b$1.current}`,fieldId:M,aggregation:fr($,A.get(M))}),[A]),xe=useCallback(M=>{if(M==="rows")return Pt([]);if(M==="columns")return Ot([]);if(M==="filters")return pt([]);Ft([]);},[]),et=useCallback((M,$)=>{if(M==="rows")return Pt(U=>U.filter(ce=>ce!==$));if(M==="columns")return Ot(U=>U.filter(ce=>ce!==$));if(M==="filters")return pt(U=>U.filter(ce=>ce!==$));Ft(U=>U.filter(ce=>ce.tokenId!==$));},[]),qe=useCallback((M,$)=>{Ft(U=>U.map(ce=>ce.tokenId===M?{...ce,aggregation:fr($,A.get(ce.fieldId))}:ce));},[A]),Tt=useCallback(M=>{ht(String(M.active.id));},[]),gt=useCallback(M=>{if(ht(null),!M.over)return;let $=zi(String(M.active.id)),U=zi(String(M.over.id));if(!$||!U||$.kind!=="item"||!$.key)return;if($.zone===U.zone&&U.kind==="item"){if($.zone==="rows"){let Me=ot.indexOf($.key),Xe=ot.indexOf(U.key??"");Me!==-1&&Xe!==-1&&Me!==Xe&&Pt(It=>arrayMove(It,Me,Xe));return}if($.zone==="columns"){let Me=Fe.indexOf($.key),Xe=Fe.indexOf(U.key??"");Me!==-1&&Xe!==-1&&Me!==Xe&&Ot(It=>arrayMove(It,Me,Xe));return}if($.zone==="filters"){let Me=le.indexOf($.key),Xe=le.indexOf(U.key??"");Me!==-1&&Xe!==-1&&Me!==Xe&&pt(It=>arrayMove(It,Me,Xe));return}if($.zone==="values"){let Me=ge.findIndex(It=>It.tokenId===$.key),Xe=ge.findIndex(It=>It.tokenId===(U.key??""));Me!==-1&&Xe!==-1&&Me!==Xe&&Ft(It=>arrayMove(It,Me,Xe));}return}let ce=U.zone,Be=[...ot],nt=[...Fe],We=[...le],re=[...ge],pe="",j=null;if($.zone==="palette")pe=$.key;else if($.zone==="values"){let Me=re.find(Xe=>Xe.tokenId===$.key);if(!Me)return;pe=Me.fieldId,j=Me,re=re.filter(Xe=>Xe.tokenId!==$.key);}else $.zone==="rows"?(pe=$.key,Be=Be.filter(Me=>Me!==pe)):$.zone==="columns"?(pe=$.key,nt=nt.filter(Me=>Me!==pe)):$.zone==="filters"&&(pe=$.key,We=We.filter(Me=>Me!==pe));if(!pe)return;let Le=()=>{Be=Be.filter(Me=>Me!==pe),nt=nt.filter(Me=>Me!==pe),We=We.filter(Me=>Me!==pe);},Qe=Me=>{if(U.kind!=="item"||!U.key)return Me==="rows"?Be.length:Me==="columns"?nt.length:Me==="filters"?We.length:Me==="values"?re.length:0;if(Me==="rows"){let Xe=Be.indexOf(U.key);return Xe>=0?Xe:Be.length}if(Me==="columns"){let Xe=nt.indexOf(U.key);return Xe>=0?Xe:nt.length}if(Me==="filters"){let Xe=We.indexOf(U.key);return Xe>=0?Xe:We.length}if(Me==="values"){let Xe=re.findIndex(It=>It.tokenId===U.key);return Xe>=0?Xe:re.length}return 0};if(ce==="palette"){Pt(Be),Ot(nt),pt(We),Ft(re);return}if(ce==="values"){let Me=Qe("values"),Xe=j??ue(pe);re.splice(Me,0,Xe),Pt(Be),Ot(nt),pt(We),Ft(re);return}if(bu(ce)){Le();let Me=Qe(ce);ce==="rows"?Be.splice(Me,0,pe):ce==="columns"?nt.splice(Me,0,pe):We.splice(Me,0,pe),Pt(Be),Ot(nt),pt(We),Ft(re);}},[Fe,ue,le,ot,ge]),mt=useCallback((M,$)=>{Se(U=>({...U,[M]:$}));},[]),wt=useCallback(M=>{At($=>{let U=new Set($);return U.has(M)?U.delete(M):U.add(M),U});},[]),rr=useCallback(M=>{te($=>{let U=new Set($);return U.has(M)?U.delete(M):U.add(M),U});},[]),Bt=useCallback(M=>{let $=A.get(M.fieldId),U=gl($);return f(bo,{size:"small",sx:{minWidth:98},children:f(Vt,{value:M.aggregation,onChange:ce=>qe(M.tokenId,ce.target.value),onClick:ce=>ce.stopPropagation(),onMouseDown:ce=>ce.stopPropagation(),sx:{fontSize:"0.72rem",height:26,"& select.orb-inp":{py:.35}},children:U.map(ce=>f("option",{value:ce,sx:{fontSize:"0.75rem"},children:I(ce)},ce))})})},[A,I,qe]),qt=useCallback(M=>{let $=yt[M]??[],U=J[M]??$;return $.length===0?g$1("pivot.filter.noValues"):U.length===0?g$1("pivot.filter.noneSelected"):U.length===$.length?g$1("pivot.filter.allValues"):g$1("pivot.filter.selectedCount",{selected:U.length,total:$.length})},[yt,J,g$1]),zt=useCallback(M=>{let $=yt[M]??[],U=J[M]??$;return f(xu,{options:$,selectedValues:U,onChange:ce=>mt(M,ce)})},[yt,J,mt]),Ut=useCallback(()=>`pivot-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,[]),Wt=useCallback(()=>{let M={};return new Set([...St,...Object.keys(J)]).forEach(U=>{if(!w.has(U))return;let ce=J[U]??[];M[U]=[...ce];}),{layout:{rows:[...ot],columns:[...Fe],filters:[...le],values:ge.map(U=>({fieldId:U.fieldId,aggregation:U.aggregation}))},filterSelections:M,showGrandTotal:Te,chart:{dimensionFieldId:Ze,primaryValueFieldId:ut,secondaryValueFieldId:dt,chartType:Lt}}},[St,Ze,ut,dt,Lt,Fe,le,J,ot,Te,w,ge]),er=useCallback(M=>{let $=ir(M.layout.rows,w),U=ir(M.layout.columns,w),ce=ir(M.layout.filters,w),Be=new Set,nt=(M.layout.values??[]).filter(pe=>!w.has(pe.fieldId)||Be.has(pe.fieldId)?false:(Be.add(pe.fieldId),true)).map(pe=>ue(pe.fieldId,pe.aggregation)),We={};Object.entries(M.filterSelections??{}).forEach(([pe,j])=>{!w.has(pe)||!Array.isArray(j)||(We[pe]=Array.from(new Set(j.map(Le=>String(Le)))));}),Pt($),Ot(U),pt(ce),Ft(nt),Se(We),typeof M.showGrandTotal=="boolean"&&V(M.showGrandTotal),ee(vl($,U,M.chart?.dimensionFieldId));let re=qi(nt,M.chart?.primaryValueFieldId);De(re),he(yl(nt,re,M.chart?.secondaryValueFieldId)),Ne(M.chart?.chartType??"bar-vertical"),_(M.id),y?.(M);},[ue,y,ee,De,he,Ne,Ot,pt,Se,Pt,V,Ft,w]),or=useCallback(M=>{if(!M){_("");return}let $=ft.find(U=>U.id===M);if(!$){_("");return}er($);},[er,ft]),ur=useCallback(()=>{let M=g$1("pivot.preset.defaultName",{index:ft.length+1});it(M),ve(true);},[ft.length,g$1]),Pr=useCallback(()=>{let M=Ee.trim();if(!M)return;let $={id:Ut(),name:M,...Wt()};Ue(U=>[...U,$]),_($.id),ve(false);},[Wt,Ut,Ee,Ue]),Tr=useCallback(()=>{Ye&&(Ue(M=>M.filter($=>$.id!==Ye)),_(""));},[Ye,Ue]);useEffect(()=>{if(!v||C.current)return;let M=ft.find($=>$.id===v);M&&(C.current=true,er(M));},[er,v,ft]),useEffect(()=>{Ye&&(ft.some(M=>M.id===Ye)||_(""));},[Ye,ft]);let to=useMemo(()=>{if(!Te||!Z||!ot.length)return null;let M={};return Z.dataColumns.forEach($=>{let U=F.filter(ce=>{let Be=Fe.length>0?Fe.map(nt=>so(ce[nt])):[g$1("pivot.valueLabel")];return Vo(Be)===$.colKey});M[$.id]=yn(U,$.valueItem.fieldId,$.valueItem.aggregation);}),{key:"__grand_total__",value:g$1("pivot.grandTotal")||uu,children:[],isLeaf:false,isGrandTotal:true,aggregatedValues:M,path:[],depth:-1}},[Te,Z,F,Fe,ot.length,g$1]),hr=useMemo(()=>Eu(Z?.rowTree??[]),[Z]),Er=useMemo(()=>Eu(Z?.columnTree??[]),[Z]);useEffect(()=>{At(M=>{let $=new Set;return M.has("__grand_total__")&&$.add("__grand_total__"),hr.forEach(U=>{M.has(U)&&$.add(U);}),$});},[hr]),useEffect(()=>{te(M=>{let $=new Set;return Er.forEach(U=>{M.has(U)&&$.add(U);}),$});},[Er]);let _o=useCallback(()=>{At(M=>{let $=new Set(M);return hr.forEach(U=>$.add(U)),$});},[hr]),Uo=useCallback(()=>{At(M=>{let $=new Set;return M.has("__grand_total__")&&$.add("__grand_total__"),$});},[]),No=useCallback(()=>{te(new Set(Er));},[Er]),Ko=useCallback(()=>{te(new Set);},[]),qo=useMemo(()=>!Z||Fe.length===0?[]:fv(Z.columnTree,Et),[Fe.length,Et,Z]),Ir=useMemo(()=>{if(!Z)return [];if(Fe.length===0)return Z.dataColumns.map($=>({id:$.id,label:$.label,leafColumnIds:[$.id],valueItem:$.valueItem}));let M=new Map(Z.dataColumns.map($=>[$.id,$]));return qo.flatMap($=>{let U=new Map;return $.leafColumnIds.forEach(ce=>{let Be=M.get(ce);if(!Be)return;let nt=Be.valueItem.tokenId,We=`${I(Be.valueItem.aggregation)} ${A.get(Be.valueItem.fieldId)?.label??Be.valueItem.fieldId}`,re=U.get(nt);if(re){re.leafColumnIds.push(ce);return}U.set(nt,{id:`${$.key}::${nt}`,label:ge.length>1?We:$.label,leafColumnIds:[ce],valueItem:Be.valueItem});}),Array.from(U.values())})},[Fe.length,A,I,Z,ge.length,qo]),Ao=useMemo(()=>new Map(Ir.map(M=>[M.id,M])),[Ir]),Xo=useMemo(()=>Ir.map(M=>({id:M.id,colKey:M.id,valueItem:M.valueItem,label:M.label})),[Ir]),_r=useMemo(()=>{if(!Z||Fe.length===0)return [];let M=[],$=Lu(Z.columnTree,Et),U=$+(ge.length>1?1:0),ce=(Be,nt)=>{M[nt]??(M[nt]=[]),Be.forEach(We=>{let re=We.children.length>0&&Et.has(We.key),pe=Ir.filter(Le=>We.leafColumnIds.some(Qe=>Le.leafColumnIds.includes(Qe))).length,j=re||ge.length>1?1:U-nt;M[nt].push({key:We.key,label:We.label,colSpan:pe,rowSpan:j,expandable:We.children.length>0,expanded:re}),re&&ce(We.children,nt+1);});};return ce(Z.columnTree,0),ge.length>1&&(M[$]=Ir.map(Be=>({key:Be.id,label:Be.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))),M},[Fe.length,Et,Z,ge.length,Ir]),ro=useCallback((M,$)=>$.leafColumnIds.reduce((U,ce)=>U+(M.aggregatedValues[ce]??0),0),[]),Rn=useMemo(()=>g(e,{children:[f(ye,{size:"small",variant:"text",onClick:_o,disabled:hr.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g$1("pivot.table.expandRowsAll")}),f(ye,{size:"small",variant:"text",onClick:Uo,disabled:hr.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g$1("pivot.table.collapseRowsAll")}),f(Nt,{orientation:"vertical",flexItem:true}),f(ye,{size:"small",variant:"text",onClick:No,disabled:Er.size===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g$1("pivot.table.expandColumnsAll")}),f(ye,{size:"small",variant:"text",onClick:Ko,disabled:Fe.length===0,sx:{minWidth:"auto",px:.8,fontSize:"0.72rem"},children:g$1("pivot.table.collapseColumnsAll")})]}),[Fe.length,Er.size,hr.size,Ko,Uo,No,_o,g$1]),Eo=()=>{if(!je)return null;let M=zi(je);if(!M||M.kind!=="item"||!M.key)return null;if(M.zone==="palette"){let Be=A.get(M.key);return Be?f(fl,{label:Be.label,subtitle:Be.type}):null}if(M.zone==="values"){let Be=ge.find(pe=>pe.tokenId===M.key);if(!Be)return null;let We=A.get(Be.fieldId)?.label??Be.fieldId,re=`${I(Be.aggregation)}(${We})`;return f(Wi,{label:We,caption:re})}let U=A.get(M.key)?.label??M.key,ce=qt(M.key);return f(Wi,{label:U,caption:ce})};return g(Ae,{sx:M=>({p:{xs:1.2,md:2},borderRadius:"var(--orb-r-container)",border:`1px solid ${M.palette.divider}`,bgcolor:"var(--orb-canvas)",boxShadow:"var(--orb-shadow-2)",display:"flex",flexDirection:"column",gap:2.25}),children:[g("div",{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1.5,flexWrap:"wrap"},children:[g("div",{sx:{minWidth:0,display:"flex",flexDirection:"column",gap:.35},children:[f(E,{component:"div",sx:{fontSize:"1.08rem",fontWeight:700,lineHeight:1.25,color:"var(--orb-fg-strong)"},children:P}),f(E,{component:"div",sx:{fontSize:"0.8rem",fontWeight:400,color:"var(--orb-fg)"},children:g$1("pivot.subtitle.default")})]}),g(ae,{direction:"row",spacing:1.5,alignItems:"center",children:[yr&&g(e,{children:[f(bo,{size:"small",sx:{minWidth:200},children:g(Vt,{value:Ye,displayEmpty:true,onChange:M=>or(String(M.target.value)),sx:{fontSize:"0.75rem",height:32},children:[f("option",{value:"",sx:{fontSize:"0.75rem",color:"text.secondary"},children:g$1("pivot.preset.selectPlaceholder")}),ft.map(M=>f("option",{value:M.id,sx:{fontSize:"0.75rem"},children:M.name},M.id))]})}),f(st,{title:g$1("pivot.preset.save"),children:f(ne,{size:"small",onClick:ur,"aria-label":g$1("pivot.preset.save"),sx:{width:28,height:28,p:0},children:f(So,{size:15})})}),f(st,{title:g$1("pivot.preset.delete"),children:f("span",{children:f(ne,{size:"small",onClick:Tr,disabled:!Ye,"aria-label":g$1("pivot.preset.delete"),sx:{width:28,height:28,p:0},children:f(Qa,{size:15})})})}),f(Nt,{flexItem:true,orientation:"vertical"})]}),g(E,{component:"div",sx:{fontSize:"0.75rem",fontWeight:400,color:"var(--orb-fg)"},children:[g$1("pivot.records"),": ",f("strong",{children:r.length.toLocaleString()})," / ",g$1("pivot.afterFilter"),":"," ",f("strong",{children:F.length.toLocaleString()})]}),f(Nt,{flexItem:true,orientation:"vertical"}),g("div",{sx:{display:"flex",alignItems:"center",gap:.6},children:[f(E,{component:"div",sx:{fontSize:"0.75rem",fontWeight:500,color:"var(--orb-fg-strong)"},children:g$1("pivot.grandTotal")}),f(qa,{size:"small",checked:Te,onChange:M=>V(M.target.checked)})]})]})]}),f(Nt,{}),g(DndContext,{sensors:x,collisionDetection:closestCenter,onDragStart:Tt,onDragEnd:gt,children:[f(ku,{isConfiguratorCollapsed:Ie,onToggleCollapse:()=>q(M=>!M),availableFields:Dt,fieldMap:A,filterFields:le,columnFields:Fe,rowFields:ot,valueFields:ge,clearZone:xe,removeFieldFromZone:et,getFilterSelectionSummary:qt,renderDimensionFilterSelect:zt,renderAggregationSelect:Bt,getAggregationLabel:I}),f(cd,{children:f(DragOverlay,{dropAnimation:{duration:250,easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)"},children:Eo()})})]}),f(Nu,{rows:F,fieldMap:A,rowFields:ot,columnFields:Fe,valueFields:ge,chartDimensionFieldId:Ze,chartPrimaryValueFieldId:ut,chartSecondaryValueFieldId:dt,chartType:Lt,isCollapsed:_t,onChartDimensionFieldIdChange:M=>ee(M),onChartPrimaryValueFieldIdChange:M=>De(M),onChartSecondaryValueFieldIdChange:M=>he(M),onChartTypeChange:M=>Ne(M),onToggleCollapse:()=>_e(M=>!M),getAggregationLabel:I}),f(Sn,{title:g$1("pivot.table.sectionTitle"),subtitle:ot.length>0?ot.map(M=>A.get(M)?.label??M).join(" > "):g$1("pivot.table.dimensions"),collapsed:bt,onToggleCollapse:()=>Je(M=>!M),expandAriaLabel:g$1("pivot.table.collapse.ariaExpand"),collapseAriaLabel:g$1("pivot.table.collapse.ariaCollapse"),bodySx:{p:0},headerActions:Rn,children:Z===null?f("div",{sx:{py:5,px:{xs:1.2,md:1.6},textAlign:"center"},children:f(E,{component:"div",sx:{fontSize:"0.86rem",fontWeight:400,color:"var(--orb-fg)"},children:S})}):f("div",{sx:{maxHeight:s},children:g("table",{className:"orb-tbl",size:"small",stickyHeader:true,children:[f("thead",{children:(_r.length>0?_r:[[]]).map((M,$)=>g("tr",{children:[$===0&&f("td",{rowSpan:Math.max(_r.length,1),sx:U=>({fontWeight:800,fontSize:"0.76rem",color:"text.primary",bgcolor:b()==="dark"?"var(--orb-canvas)":"var(--orb-surface)",borderBottom:`1px solid ${U.palette.divider}`,pl:2,minWidth:220,verticalAlign:"middle"}),children:ot.length>0?ot.map(U=>A.get(U)?.label).join(" > "):g$1("pivot.table.dimensions")}),(M.length>0?M:Ir.map(U=>({key:U.id,label:U.label,colSpan:1,rowSpan:1,expandable:false,expanded:false}))).map(U=>f("td",{align:"center",colSpan:U.colSpan,rowSpan:U.rowSpan,sx:ce=>({fontWeight:800,fontSize:"0.75rem",color:"text.primary",bgcolor:b()==="dark"?"var(--orb-canvas)":"var(--orb-surface)",borderBottom:`1px solid ${ce.palette.divider}`,minWidth:148,verticalAlign:"middle"}),children:g("div",{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:.4},children:[U.expandable&&f(ne,{size:"small",onClick:()=>rr(U.key),sx:{width:22,height:22,p:0,ml:-0.2},children:U.expanded?f(Hr,{size:12}):f(xo,{size:12})}),f("div",{component:"span",children:U.label})]})},U.key))]},`pivot-header-row-${$}`))}),g("tbody",{children:[Z.rowTree.map(M=>f(Ui,{node:M,dataColumns:Xo,fieldMap:A,level:0,expandedKeys:xt,onToggle:wt,getValue:($,U)=>{let ce=Ao.get(U);return ce?ro($,ce):0}},M.key)),to&&f(Ui,{node:to,dataColumns:Xo,fieldMap:A,level:0,expandedKeys:xt,onToggle:wt,getValue:(M,$)=>{let U=Ao.get($);return U?ro(M,U):0}})]})]})})}),g(Ht,{open:Oe,onClose:()=>ve(false),maxWidth:"xs",fullWidth:true,children:[f("div",{className:"orb-dialog-title",children:g$1("pivot.preset.saveDialogTitle")}),f("div",{className:"orb-dialog-content",children:f(He,{autoFocus:true,fullWidth:true,margin:"dense",label:g$1("pivot.preset.nameLabel"),value:Ee,onChange:M=>it(M.target.value),onKeyDown:M=>{M.key==="Enter"&&(M.preventDefault(),Pr());}})}),g("div",{className:"orb-dialog-actions",children:[f(ye,{onClick:()=>ve(false),children:g$1("common.cancel")}),f(ye,{variant:"contained",onClick:Pr,disabled:!Ee.trim(),children:g$1("common.save")})]})]})]})};var Ou=(t,r,o)=>{let n=[...t,...r];return o&&n.includes(o)?o:n[0]??""},xl=(t,r)=>r&&t.some(o=>o.fieldId===r)?r:t[0]?.fieldId??"",Fu=(t,r,o)=>o===""?"":o&&o!==r&&t.some(n=>n.fieldId===o)?o:t.find(n=>n.fieldId!==r)?.fieldId??"",aL=({fields:t,initialLayout:r,initialFilterSelections:o={},initialShowGrandTotal:n=true,initialConfiguratorCollapsed:a=false,initialChart:i,initialChartCollapsed:s=false,initialTableCollapsed:l=false})=>{let d=useRef(0),p=useMemo(()=>new Set(t.map(_=>_.id)),[t]),u=useMemo(()=>new Map(t.map(_=>[_.id,_])),[t]),[f,h]=useState(()=>ir(r?.rows,p)),[m,v]=useState(()=>ir(r?.columns,p)),[y,g]=useState(()=>ir(r?.filters,p)),[x,b]=useState(()=>{let _=r?.values??[],Oe=new Set,ve=[];return _.forEach(Ee=>{!p.has(Ee.fieldId)||Oe.has(Ee.fieldId)||(Oe.add(Ee.fieldId),d.current+=1,ve.push({tokenId:`v${d.current}`,fieldId:Ee.fieldId,aggregation:fr(Ee.aggregation,u.get(Ee.fieldId))}));}),ve}),[C,P]=useState(o),[S,k]=useState(n),[I,w]=useState(a),[A,R]=useState(()=>Ou(ir(r?.rows,p),ir(r?.columns,p),i?.dimensionFieldId)),[T,N]=useState(()=>{let _=(()=>{let Oe=r?.values??[],ve=new Set,Ee=[];return Oe.forEach(it=>{!p.has(it.fieldId)||ve.has(it.fieldId)||(ve.add(it.fieldId),Ee.push({tokenId:it.fieldId,fieldId:it.fieldId,aggregation:fr(it.aggregation,u.get(it.fieldId))}));}),Ee})();return xl(_,i?.primaryValueFieldId)}),[D,L]=useState(()=>{let _=(()=>{let ve=r?.values??[],Ee=new Set,it=[];return ve.forEach(je=>{!p.has(je.fieldId)||Ee.has(je.fieldId)||(Ee.add(je.fieldId),it.push({tokenId:je.fieldId,fieldId:je.fieldId,aggregation:fr(je.aggregation,u.get(je.fieldId))}));}),it})(),Oe=xl(_,i?.primaryValueFieldId);return Fu(_,Oe,i?.secondaryValueFieldId)}),[B,X]=useState(i?.chartType??"bar-vertical"),[H,K]=useState(s),[W,G]=useState(l);useEffect(()=>{h(_=>{let Oe=_.filter(ve=>p.has(ve));return lo(_,Oe)?_:Oe}),v(_=>{let Oe=_.filter(ve=>p.has(ve));return lo(_,Oe)?_:Oe}),g(_=>{let Oe=_.filter(ve=>p.has(ve));return lo(_,Oe)?_:Oe}),b(_=>{let Oe=_.filter(ve=>p.has(ve.fieldId)).map(ve=>({...ve,aggregation:fr(ve.aggregation,u.get(ve.fieldId))}));return Vi(_,Oe)?_:Oe});},[u,p]),useEffect(()=>{R(_=>Ou(f,m,_));},[m,f]),useEffect(()=>{N(_=>xl(x,_));},[x]),useEffect(()=>{L(_=>Fu(x,T,_));},[T,x]);let z=useCallback(_=>{h(ir(_,p));},[p]),O=useCallback(_=>{v(ir(_,p));},[p]),Y=useCallback(_=>{g(ir(_,p));},[p]),Q=useCallback(_=>{b(Oe=>{let ve=_??[],Ee=new Set,it=[];return ve.forEach(je=>{if(!p.has(je.fieldId)||Ee.has(je.fieldId))return;Ee.add(je.fieldId);let ht=Oe.find(xt=>xt.fieldId===je.fieldId);if(ht){it.push({...ht,aggregation:fr(je.aggregation??ht.aggregation,u.get(je.fieldId))});return}d.current+=1,it.push({tokenId:`v${d.current}`,fieldId:je.fieldId,aggregation:fr(je.aggregation,u.get(je.fieldId))});}),it});},[u,p]),me=useCallback(_=>{z(_.rows??[]),O(_.columns??[]),Y(_.filters??[]),Q(_.values??[]);},[O,Y,z,Q]),ie=useCallback(_=>{if(_==="rows")return h([]);if(_==="columns")return v([]);if(_==="filters")return g([]);b([]);},[]),se=useCallback((_,Oe)=>{if(_==="rows")return h(ve=>ve.filter(Ee=>Ee!==Oe));if(_==="columns")return v(ve=>ve.filter(Ee=>Ee!==Oe));if(_==="filters")return g(ve=>ve.filter(Ee=>Ee!==Oe));b(ve=>ve.filter(Ee=>Ee.tokenId!==Oe));},[]),fe=useCallback((_,Oe)=>{b(ve=>ve.map(Ee=>Ee.tokenId===_?{...Ee,aggregation:fr(Oe,u.get(Ee.fieldId))}:Ee));},[u]),Ge=useCallback((_,Oe)=>{P(ve=>({...ve,[_]:Oe}));},[]),Re=useCallback(()=>{P({});},[]),ke=useCallback(()=>{k(_=>!_);},[]),ze=useCallback(()=>{w(_=>!_);},[]),Pe=useCallback(_=>{R(_);},[]),Ce=useCallback(_=>{N(_);},[]),Ve=useCallback(_=>{L(_);},[]),rt=useCallback(()=>{K(_=>!_);},[]),at=useCallback(()=>{G(_=>!_);},[]);return {model:useMemo(()=>({rowFields:f,setRowFields:h,columnFields:m,setColumnFields:v,filterFields:y,setFilterFields:g,valueFields:x,setValueFields:b,filterSelections:C,setFilterSelections:P,showGrandTotal:S,setShowGrandTotal:k,isConfiguratorCollapsed:I,setIsConfiguratorCollapsed:w,chartDimensionFieldId:A,setChartDimensionFieldId:R,chartPrimaryValueFieldId:T,setChartPrimaryValueFieldId:N,chartSecondaryValueFieldId:D,setChartSecondaryValueFieldId:L,chartType:B,setChartType:X,isChartCollapsed:H,setIsChartCollapsed:K,isTableCollapsed:W,setIsTableCollapsed:G}),[A,T,D,B,m,y,C,H,I,W,f,S,x]),actions:{setRows:z,setColumns:O,setFilters:Y,setValues:Q,setLayout:me,clearZone:ie,removeFieldFromZone:se,setAggregationForValue:fe,setFilterSelection:Ge,resetFilterSelections:Re,toggleGrandTotal:ke,toggleConfigurator:ze,setChartDimension:Pe,setChartPrimaryValue:Ce,setChartSecondaryValue:Ve,setChartType:X,toggleChart:rt,toggleTable:at}}};var cL=({orientation:t="auto",defaultNavigationOpen:r,onNavOpenChange:o}={})=>{let n=ar(),a=vo("(orientation: portrait)"),i=vo(n.breakpoints.down("md")),s=useMemo(()=>t==="auto"?a||i?"portrait":"landscape":t,[i,a,t]),[l,d]=useState(r??s==="landscape");useEffect(()=>{d(r??s==="landscape");},[r,s]);let p=f=>{d(f),o?.(f);};return {resolvedOrientation:s,isPortraitViewport:a,isCompactViewport:i,navigationOpen:l,setNavigationOpen:p,toggleNavigationOpen:()=>p(!l)}};var xv=t=>{let r=Number(t||0);return Number.isFinite(r)?r:0},uL=({rows:t,rowKey:r="id",numericField:o,defaultSelectedId:n})=>{let i=t[0]?.[r],[s,l]=useState(n??i),d=useMemo(()=>t.find(m=>m[r]===s)||t[0],[r,t,s]),[p,u]=useState(()=>{let m=d?.[o];return m==null?"0":String(m)});return {selectedId:s,selectedRecord:d,editorValue:p,setEditorValue:u,selectRecord:m=>{let v=m[r];l(v);let y=m[o];u(y==null?"0":String(y));},applyEditorValue:m=>{if(s===void 0)return;let v=xv(p),y=t.map(g=>g[r]===s?{...g,[o]:v}:g);m(y);}}};var Sv=["code_128","ean_13","ean_8","qr_code","upc_a","upc_e"],Hu=(t,r,o,n)=>{r?.(t),n&&o?.();},vL=({open:t,onClose:r,title:o="Scan barcode",subtitle:n="Use the rear camera on the device. If scanning is unavailable, enter the code manually.",formats:a=Sv,facingMode:i="environment",manualEntry:s=true,autoCloseOnDetect:l=true,scanIntervalMs:d=600,confirmLabel:p="Use code",cancelLabel:u="Close",manualPlaceholder:f$1="Enter barcode manually",onDetected:h,onError:m,sx:v})=>{let y=Qt__default.useRef(null),g$1=Qt__default.useRef(null),x=Qt__default.useRef(null),b$1=Qt__default.useRef(null),[C,P]=Qt__default.useState("idle"),[S,k]=Qt__default.useState(""),[I,w]=Qt__default.useState(null),[A,R]=Qt__default.useState(null),T=Qt__default.useCallback(()=>{x.current!==null&&(window.clearInterval(x.current),x.current=null),g$1.current&&(g$1.current.getTracks().forEach(L=>L.stop()),g$1.current=null),y.current&&(y.current.srcObject=null);},[]),N=Qt__default.useCallback(L=>{R(L),P("error"),m?.(L);},[m]);Qt__default.useEffect(()=>{if(!t){T(),P("idle"),R(null),k("");return}let L=false;return (async()=>{if(!(typeof window>"u"||typeof navigator>"u")){if(!navigator.mediaDevices?.getUserMedia){P("unsupported"),R("Camera access is not supported in this browser.");return}P("starting"),R(null);try{let X=await navigator.mediaDevices.getUserMedia({audio:!1,video:{facingMode:{ideal:i}}});if(L){X.getTracks().forEach(H=>H.stop());return}if(g$1.current=X,y.current&&(y.current.srcObject=X,await y.current.play()),!window.BarcodeDetector){P("unsupported"),R("BarcodeDetector is not available. Camera preview is ready and manual entry is enabled.");return}b$1.current=new window.BarcodeDetector({formats:a}),P("ready"),x.current=window.setInterval(async()=>{if(!(!y.current||!b$1.current)&&!(y.current.readyState<HTMLMediaElement.HAVE_CURRENT_DATA))try{let K=(await b$1.current.detect(y.current)).find(G=>G.rawValue);if(!K?.rawValue)return;let W={rawValue:K.rawValue,format:K.format};w(W),T(),Hu(W,h,r,l);}catch(H){N(H instanceof Error?H.message:"Failed to detect barcode.");}},d);}catch(X){N(X instanceof Error?X.message:"Unable to start camera.");}}})(),()=>{L=true,T();}},[l,i,a,r,h,t,N,d,T]);let D=()=>{let L=S.trim();if(!L)return;let B={rawValue:L,format:"manual"};w(B),Hu(B,h,r,l);};return g(Ht,{open:t,onClose:r,fullWidth:true,maxWidth:"sm",children:[f("div",{className:"orb-dialog-title",sx:{fontSize:"1rem",fontWeight:900},children:o}),f("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:g(ae,{spacing:2,sx:v,children:[f(E,{sx:{fontSize:"0.88rem",color:"text.secondary",lineHeight:1.55},children:n}),g(Ae,{elevation:0,sx:{position:"relative",overflow:"hidden",borderRadius:4,border:"1px solid",borderColor:"divider",minHeight:280,background:b()==="dark"?"linear-gradient(180deg, color-mix(in oklch, var(--orb-canvas) 92%, transparent), color-mix(in oklch, var(--orb-canvas) 96%, transparent))":"linear-gradient(180deg, var(--orb-surface), color-mix(in oklch, var(--orb-border) 92%, transparent))"},children:[f("video",{ref:y,muted:true,playsInline:true,autoPlay:true,style:{width:"100%",height:280,objectFit:"cover",display:"block"}}),f("div",{sx:{pointerEvents:"none",position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center"},children:f("div",{sx:{width:"72%",maxWidth:320,aspectRatio:"1.7 / 1",borderRadius:3,border:"2px solid rgba(255,255,255,0.95)",boxShadow:"0 0 0 999px rgba(15,23,42,0.24)",position:"relative"},children:f("div",{sx:{position:"absolute",top:"50%",left:0,right:0,height:2,bgcolor:"var(--orb-ai-accent)",boxShadow:"0 0 18px color-mix(in oklch, var(--orb-ai-accent) 85%, transparent)"}})})}),g("div",{sx:{position:"absolute",top:12,left:12,display:"flex",gap:1,flexWrap:"wrap"},children:[f(kt,{icon:f(Sd,{}),label:C==="ready"?"Camera ready":C==="starting"?"Starting camera":C==="unsupported"?"Preview only":C==="error"?"Scanner error":"Idle",size:"small",color:C==="error"?"error":"primary",variant:"filled"}),I?f(kt,{icon:f($d,{}),label:`${I.format||"barcode"}: ${I.rawValue}`,size:"small",color:"success",variant:"filled"}):null]})]}),A?f(Yr,{severity:C==="unsupported"?"info":"warning",children:A}):null,s?g(ae,{direction:{xs:"column",sm:"row"},spacing:1.25,children:[f(He,{fullWidth:true,label:"Barcode",placeholder:f$1,value:S,onChange:L=>k(L.target.value)}),f(ye,{variant:"contained",onClick:D,sx:{minHeight:56,px:2.5},children:p})]}):null]})}),f("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:f(ye,{onClick:r,children:u})})]})};var wv={default:"var(--orb-status-fg)",primary:"var(--orb-status-primary)",success:"var(--orb-status-success)",warning:"var(--orb-status-warning)",error:"var(--orb-status-error)",info:"var(--orb-status-info)"},PL=({title:t,description:r,kicker:o,icon:n,badges:a=[],metrics:i=[],footer:s,children:l,selected:d=false,draggable:p=false,isDragging:u=false,swipeThreshold:f$1=88,startAction:h,endAction:m,dragHandleProps:v,onClick:y,onSwipe:g$1,sx:x})=>{let[b$1,C]=useState(0),[P,S]=useState(false),k=useRef(null),I=useRef(0),w=useRef(0),A=!!(h||m),R=132,T=()=>{C(0),S(false),k.current=null,I.current=0,w.current=0;},N=H=>{(H==="start"?h:m)?.onTrigger?.(),g$1?.(H),T();},D=H=>{!A||H.target.closest('button, a, input, textarea, [data-no-swipe="true"]')||(k.current=H.pointerId,I.current=H.clientX,w.current=H.clientX,S(true),H.currentTarget.setPointerCapture(H.pointerId));},L=H=>{if(!P||k.current!==H.pointerId)return;w.current=H.clientX;let K=w.current-I.current,W=Math.max(-R,Math.min(R,K));C(W);},B=H=>{if(!P||k.current!==H.pointerId)return;let K=w.current-I.current;if(K>=f$1&&h){N("start");return}if(K<=-f$1&&m){N("end");return}Math.abs(K)<12&&y?.(),T();},X=(H,K)=>{if(!H)return null;let W=H.backgroundColor||wv[H.tone||"default"];return f("div",{sx:{position:"absolute",top:0,bottom:0,[K]:0,width:R,px:2,display:"flex",alignItems:"center",justifyContent:K==="left"?"flex-start":"flex-end",color:"var(--orb-on-primary)",background:`linear-gradient(135deg, ${W}, rgba(15,23,42,0.92))`},children:g(ae,{direction:"row",spacing:1,alignItems:"center",children:[H.icon,f(E,{sx:{fontWeight:700,fontSize:"0.95rem"},children:H.label})]})})};return g("div",{sx:{position:"relative",overflow:"hidden",borderRadius:4,...x},children:[X(h,"left"),X(m,"right"),f(Ae,{elevation:0,onPointerDown:D,onPointerMove:L,onPointerUp:B,onPointerCancel:T,sx:{position:"relative",zIndex:1,p:2,borderRadius:4,border:"1px solid",borderColor:d?"primary.main":"divider",background:b()==="dark"?"linear-gradient(180deg, color-mix(in oklch, var(--orb-surface-3) 96%, transparent), color-mix(in oklch, var(--orb-canvas) 92%, transparent))":"linear-gradient(180deg, var(--orb-canvas), var(--orb-surface))",color:"text.primary",boxShadow:d?"0 18px 42px color-mix(in oklch, var(--orb-primary) 18%, transparent)":"0 12px 28px rgba(15, 23, 42, 0.08)",transform:`translate3d(${b$1}px, 0, 0) scale(${u?.985:1})`,transition:P?"none":"transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease",touchAction:"pan-y",cursor:y?"pointer":"default",opacity:u?.9:1},children:g(ae,{spacing:1.5,children:[g(ae,{direction:"row",spacing:1.5,alignItems:"flex-start",children:[n?f("div",{sx:{mt:.25},children:n}):null,g("div",{sx:{flex:1,minWidth:0},children:[o?f(E,{sx:{fontSize:"0.72rem",fontWeight:700,letterSpacing:"0.08em",color:"text.secondary"},children:o}):null,f(E,{sx:{fontSize:"1.05rem",fontWeight:800,lineHeight:1.25},children:t}),r?f(E,{sx:{mt:.5,fontSize:"0.9rem",color:"text.secondary",lineHeight:1.45},children:r}):null]}),p?f("div",{"data-no-swipe":"true",...v,sx:{alignSelf:"center",display:"inline-flex",touchAction:"none"},children:f(ne,{size:"small",children:f(Dd,{})})}):null]}),a.length>0?f(ae,{direction:"row",spacing:1,useFlexGap:true,flexWrap:"wrap",children:a.map((H,K)=>f(kt,{label:H,size:"small",sx:{borderRadius:999,fontWeight:700,bgcolor:"action.hover",color:"text.primary"}},K))}):null,i.length>0?f("div",{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(110px, 1fr))",gap:1},children:i.map(H=>g(Ae,{elevation:0,sx:{p:1.25,borderRadius:3,bgcolor:"action.hover",border:"1px solid",borderColor:"divider",color:"text.primary"},children:[f(E,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:H.label}),f(E,{sx:{fontSize:"1rem",fontWeight:800,lineHeight:1.2},children:H.value})]},H.id))}):null,l,s]})})]})};var la=({label:t,onPress:r,emphasis:o="default"})=>f("div",{component:"button",type:"button",onClick:r,sx:n=>({minHeight:72,borderRadius:3,border:"1px solid",borderColor:o==="primary"?"primary.main":"divider",background:o==="primary"?n.palette.primary.main:o==="danger"?b()==="dark"?"color-mix(in oklch, var(--orb-status-error) 18%, transparent)":"color-mix(in oklch, var(--orb-status-error) 10%, transparent)":b()==="dark"?"rgba(255,255,255,0.04)":"var(--orb-canvas)",color:o==="primary"?"var(--orb-on-primary)":"text.primary",fontSize:"1.25rem",fontWeight:800,transition:"transform 120ms ease, box-shadow 160ms ease, background-color 160ms ease",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent","&:active":{transform:"scale(0.98)"}}),children:t}),EL=({value:t,defaultValue:r="",title:o,subtitle:n,placeholder:a="0",allowDecimal:i=false,allowNegative:s=false,maxLength:l,confirmLabel:d,clearLabel:p,backspaceLabel:u,onChange:f$1,onSubmit:h,onClose:m,sx:v})=>{let{t:y}=de(),[g$1,x]=useState(r),b=t??g$1,C=T=>{t===void 0&&x(T),f$1?.(T);},P=T=>{l&&b.length>=l||C(`${b}${T}`);},S=T=>{if(T==="00"){if(!b){C("0");return}P("00");return}P(T);},k=()=>{!i||b.includes(".")||C(b?`${b}.`:"0.");},I=()=>{if(s){if(b.startsWith("-")){C(b.slice(1));return}C(b?`-${b}`:"-");}},w=()=>{C(b.slice(0,-1));},A=()=>{C("");},R=()=>{h?.(b);};return f(Ae,{elevation:0,sx:{p:2,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",...v},children:g(ae,{spacing:2,children:[g(ae,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[g("div",{sx:{minWidth:0},children:[o?f(E,{sx:{fontSize:"1rem",fontWeight:800},children:o}):null,n?f(E,{sx:{mt:.5,fontSize:"0.86rem",color:"text.secondary"},children:n}):null]}),m?f(ne,{onClick:m,size:"small",children:f(Md,{})}):null]}),f(Ae,{elevation:0,sx:{p:2,borderRadius:3,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:f(E,{sx:{minHeight:38,fontSize:b?"1.9rem":"1.25rem",fontWeight:900,letterSpacing:"0.06em",color:b?"text.primary":"text.disabled"},children:b||a})}),g("div",{sx:{display:"grid",gridTemplateColumns:"repeat(3, minmax(0, 1fr))",gap:1.25},children:[["1","2","3","4","5","6","7","8","9"].map(T=>f(la,{label:T,onPress:()=>S(T)},T)),f(la,{label:s?"+/-":"00",onPress:s?I:()=>S("00")}),f(la,{label:"0",onPress:()=>S("0")}),f(la,{label:i?".":u?String(u):"DEL",onPress:i?k:w})]}),g("div",{sx:{display:"grid",gridTemplateColumns:"repeat(3, minmax(0, 1fr))",gap:1.25},children:[f("div",{component:"button",type:"button",onClick:w,sx:{minHeight:64,borderRadius:3,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent"},children:g(ae,{direction:"row",spacing:1,justifyContent:"center",alignItems:"center",children:[f(xd,{}),f(E,{sx:{fontWeight:700},children:u||"DEL"})]})}),f(la,{label:String(p||"CLR"),onPress:A,emphasis:"danger"}),f("div",{component:"button",type:"button",onClick:R,sx:T=>({minHeight:64,borderRadius:3,border:"1px solid",borderColor:"primary.main",background:T.palette.primary.main,color:"var(--orb-on-primary)",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent"}),children:g(ae,{direction:"row",spacing:1,justifyContent:"center",alignItems:"center",children:[f(kd,{}),f(E,{sx:{fontWeight:800},children:d||y("common.ok")})]})})]})]})})};var Vu=({touchMode:t="comfortable",sx:r,...o})=>{let n=t==="expanded";return f("div",{sx:{"& .orb-card":{borderRadius:4},"& .orb-autocomplete":{minWidth:{xs:"100%",md:260}},"& .orb-autocomplete .orb-inp-adornment-wrap, & .orb-inp":{backgroundColor:"transparent !important"},"& .orb-inp-adornment-wrap, & .orb-inp":{minHeight:n?56:50,borderRadius:3,fontSize:n?"0.98rem":"0.92rem"},"& .orb-inp":{py:n?1.6:1.25,fontSize:n?"0.98rem":"0.92rem"},"& label":{fontSize:n?"0.95rem":"0.88rem"},"& .orb-btn":{minHeight:n?48:44,px:n?2.25:1.75,borderRadius:3,fontSize:n?"0.95rem":"0.88rem",fontWeight:700},"& .orb-icon-btn":{width:n?40:36,height:n?40:36},"& .orb-menu-item, & option":{minHeight:n?44:38,fontSize:n?"0.95rem":"0.88rem"},"& .orb-list-subheader":{py:1},"& .orb-chk":{p:n?1:.75},"& .orb-form-control-label > span":{fontSize:n?"0.95rem":"0.88rem"},"& .orb-dialog":{borderRadius:4},"& .orb-dialog-title":{fontSize:n?"1.05rem":"0.98rem",fontWeight:800},"& .orb-dialog-content .orb-inp-adornment-wrap, & .orb-inp":{minHeight:52},"& .orb-grid > *":{minWidth:0},...r},children:f(zr,{...o})})};var Mv=(t,r,o)=>{if(o?.(r),!!r.href){if(r.href.startsWith("http://")||r.href.startsWith("https://")){window.open(r.href,"_blank");return}t.push(r.href);}},Wu=({items:t,selectedId:r,orientation:o="auto",onItemSelect:n,sx:a})=>{let i=ar(),[s,l]=useState(false);useEffect(()=>{l(true);},[]);let d=vo("(orientation: portrait)"),p=vo(i.breakpoints.down("md")),u=o==="auto"?d||p?"portrait":"landscape":o,f$1=useRouter();return f("div",{sx:{display:"grid",gridTemplateColumns:!s||u==="portrait"?"repeat(2, minmax(0, 1fr))":"repeat(auto-fit, minmax(180px, 1fr))",gap:1.5,...a},children:t.map(h=>{let m=h.id===r,v=h.color||(m?i.palette.primary.main:i.palette.divider);return f(Ae,{elevation:0,sx:{overflow:"hidden",borderRadius:4,border:"1px solid",borderColor:m?"primary.main":"divider",boxShadow:m?"0 18px 40px color-mix(in oklch, var(--orb-primary) 16%, transparent)":"none",bgcolor:b()==="dark"?"color-mix(in oklch, var(--orb-surface-3) 60%, transparent)":"background.paper"},children:f("div",{component:"button",type:"button",disabled:h.disabled,onClick:()=>Mv(f$1,h,n),sx:{width:"100%",p:2,minHeight:u==="portrait"?156:148,display:"block",border:0,background:"transparent",textAlign:"left",cursor:h.disabled?"not-allowed":"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent",color:"text.primary"},children:g(ae,{spacing:1.5,sx:{height:"100%"},children:[g(ae,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[f("div",{sx:{width:44,height:44,borderRadius:3,display:"grid",placeItems:"center",color:m?"var(--orb-on-primary)":"text.primary",background:m?v:"action.hover"},children:h.icon||f(E,{sx:{fontSize:"1rem",fontWeight:900},children:h.title.slice(0,1).toUpperCase()})}),h.badge!==void 0?f("div",{sx:{minWidth:34,px:1,py:.4,borderRadius:999,bgcolor:m?"primary.main":"action.hover",color:m?"var(--orb-on-primary)":"text.secondary",textAlign:"center",fontWeight:800,fontSize:"0.8rem"},children:h.badge}):null]}),g("div",{sx:{flex:1,minWidth:0},children:[f(E,{sx:{fontSize:"1rem",fontWeight:800,lineHeight:1.25},children:h.title}),h.caption?f(E,{sx:{mt:.5,fontSize:"0.74rem",fontWeight:700,color:"text.secondary"},children:h.caption}):null,h.description?f(E,{sx:{mt:.75,fontSize:"0.84rem",lineHeight:1.45,color:"text.secondary"},children:h.description}):null]})]})})},h.id)})})};var _u=(t,r)=>r.trim()?t.reduce((o,n)=>{let a=n.title?.toLowerCase().includes(r.toLowerCase())||n.label?.toLowerCase().includes(r.toLowerCase())||n.description?.toLowerCase().includes(r.toLowerCase()),i=n.children?_u(n.children,r):[];return (a||i.length>0)&&o.push({...n,children:i.length>0?i:n.children}),o},[]):t,Av=t=>{let r=new Set,o=n=>{n.forEach(a=>{a.children?.length&&(r.add(a.id),o(a.children));});};return o(t),r},Uu=({collapsed:t=false,onToggle:r,className:o="",maxHeight:n,menuData:a=[],colorMode:i="light",orientation:s="auto",headerSlot:l,footerSlot:d,activeHref:p,onItemSelect:u})=>{let{t:f$1}=de(),h=ar(),m=Mr("(orientation: portrait)"),v=Mr(h.breakpoints.down("md")),y=s==="auto"?m||v?"portrait":"landscape":s,g$1=i==="dark",x=useRouter(),b=usePathname(),[C,P]=useState(""),[S,k]=useState(new Set),I=useMemo(()=>_u(a,C),[a,C]),w=useMemo(()=>C.trim()?Av(I):S,[S,I,C]);useEffect(()=>{t&&k(new Set);},[t]);let A=L=>L.appurl||L.href||"",R=L=>{u?.(L);let B=A(L);if(B){if(B.startsWith("http://")||B.startsWith("https://")){window.open(B,"_blank");return}x.push(B);}},T=L=>{let B=!!L.children?.length;if(t&&B){r?.();return}if(B){k(X=>{let H=new Set(X);return H.has(L.id)?H.delete(L.id):H.add(L.id),H});return}R(L);},N=L=>{let B=p||b,X=A(L);return !!(X&&B===X)},D=(L,B=0)=>{let X=!!L.children?.length,H=w.has(L.id),K=N(L);return f("div",{sx:{pl:B===0?0:1.5},children:g(Ae,{elevation:0,sx:{mb:1,overflow:"hidden",borderRadius:3,border:"1px solid",borderColor:K?"primary.main":"divider",bgcolor:K?"action.selected":"background.paper"},children:[g("div",{component:"button",type:"button",onClick:()=>T(L),sx:{width:"100%",px:1.5,py:1.4,display:"flex",alignItems:"center",gap:1.25,border:0,background:"transparent",textAlign:"left",cursor:"pointer",appearance:"none",WebkitAppearance:"none",WebkitTapHighlightColor:"transparent"},children:[f(Ua,{variant:"rounded",sx:{width:40,height:40,bgcolor:K?"primary.main":"action.hover",color:K?"var(--orb-on-primary)":"text.primary"},children:L.icon||(L.title||L.label||"?").slice(0,1).toUpperCase()}),g("div",{sx:{flex:1,minWidth:0},children:[f(E,{sx:{fontSize:"0.95rem",fontWeight:800,lineHeight:1.2},children:L.title||L.label}),L.description?f(E,{sx:{mt:.4,fontSize:"0.78rem",color:"text.secondary",lineHeight:1.35},children:L.description}):null]}),X?f(tn,{sx:{transform:H?"rotate(180deg)":"rotate(0deg)",transition:"transform 180ms ease"}}):f(Ya,{color:"action"})]}),X?f(en,{in:H,children:f("div",{sx:{px:1.25,pb:1.25},children:L.children?.map(W=>D(W,B+1))})}):null]})},L.id)};return t?f(Ae,{elevation:0,className:o,sx:{width:y==="portrait"?"100%":88,p:1,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:g$1?"var(--orb-surface)":"color-mix(in oklch, var(--orb-canvas) 88%, transparent)",maxHeight:n?`${n}px`:void 0,overflowY:"auto"},children:g(ae,{spacing:1,children:[f(ne,{onClick:r,sx:{width:48,height:48,alignSelf:"center",bgcolor:"action.hover"},title:f$1("navigation.expand"),children:f(ti,{})}),a.map(L=>f(ne,{onClick:()=>T(L),sx:{width:56,height:56,alignSelf:"center",borderRadius:3,bgcolor:N(L)?"primary.main":"action.hover",color:N(L)?"var(--orb-on-primary)":"text.primary"},children:L.icon||(L.title||L.label||"?").slice(0,1).toUpperCase()},L.id))]})}):f(Ae,{elevation:0,className:o,sx:{width:y==="portrait"?"100%":320,p:1.25,borderRadius:5,border:"1px solid",borderColor:"divider",bgcolor:g$1?"var(--orb-surface)":"color-mix(in oklch, var(--orb-canvas) 88%, transparent)",maxHeight:n?`${n}px`:void 0,overflow:"hidden",display:"flex",flexDirection:"column"},children:g(ae,{spacing:1.25,sx:{flex:1,minHeight:0},children:[g(ae,{direction:"row",spacing:1,alignItems:"center",children:[f(He,{value:C,onChange:L=>P(L.target.value),placeholder:f$1("navigation.searchPlaceholder"),size:"small",fullWidth:true,InputProps:{startAdornment:f(Gd,{fontSize:"small",color:"action"})}}),y==="landscape"&&!t?f(ne,{onClick:r,sx:{bgcolor:"action.hover"},children:f(Hd,{})}):null]}),l,f("div",{sx:{flex:1,minHeight:0,overflowY:"auto",pr:.25},children:I.length>0?I.map(L=>D(L)):f(E,{sx:{p:2,fontSize:"0.88rem",color:"text.secondary",textAlign:"center"},children:f$1("navigation.noMatch")})}),d]})})};var Ku=(t,r)=>{let o=r[t.id];if(t.render)return t.render(o,r);if(o==null||o==="")return "--";if(t.numeric){if(typeof o=="number")return o.toLocaleString();if(typeof o=="string"&&o.trim()!==""&&!Number.isNaN(Number(o)))return Number(o).toLocaleString()}return String(o)},Ev=t=>Qt__default.isValidElement(t)?f("div",{sx:{display:"inline-flex",alignItems:"center"},children:t}):f(E,{sx:{mt:.2,fontSize:"0.88rem",fontWeight:800},children:t}),Lv=(t,r)=>{let o=r[t.id];if(o==null||o==="")return "--";if(t.numeric){if(typeof o=="number")return o.toLocaleString();if(typeof o=="string"&&o.trim()!==""&&!Number.isNaN(Number(o)))return Number(o).toLocaleString()}return String(o)},Ov=({summaryRow:t,visibleColumns:r,columns:o})=>{let n=o.filter(a=>r.includes(a.id)&&t[a.id]!=="");return n.length===0?null:f(Ae,{elevation:0,sx:{p:1.5,borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:g(ae,{spacing:1,children:[f(E,{sx:{fontSize:"0.82rem",fontWeight:800,color:"text.secondary"},children:"Summary"}),f("div",{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(132px, 1fr))",gap:1},children:n.map(a=>g(Ae,{elevation:0,sx:{p:1.1,borderRadius:3,border:"1px solid",borderColor:"divider"},children:[f(E,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:a.label}),f(E,{sx:{mt:.25,fontSize:"0.96rem",fontWeight:800},children:t[a.id]})]},`summary-${a.id}`))})]})})},Fv=t=>{let{t:r}=de(),o=ar(),{title:n,showToolbar:a=true,selectionMode:i,selected:s=[],onSelectionChange:l,actions:d,extraTools:p,fitContainer:u=false,fullWidth:f$1=false,maxHeight:h,loading:m=false,rowsPerPageOptions:v=[20,50,100,-1],onLayoutSave:y,filterConfig:g$1,rowKey:x,tableKey:b$1="default",graphReport:C,quickCreate:P,quickEdit:S,quickDelete:k,serviceUrl:I,orientation:w="auto",cardTitleField:A,cardSubtitleFields:R,toolbarSlot:T,emptyState:N,rowHeight:D="comfortable",cardActionSlot:L,renderCardFooter:B,onRowClick:X}=t,H=n||r("table.title.default"),K=Mr("(orientation: portrait)"),W=Mr(o.breakpoints.down("md")),G=w==="auto"?K||W?"portrait":"landscape":w,{columns:z,filterText:O,setFilterText:Y,visibleColumns:Q,showSummary:me,setShowSummary:ie,summaryColumns:se,grouping:fe,setGrouping:Ge,expandedGroups:Re,groupAnchorEl:ke,setGroupAnchorEl:ze,summaryAnchorEl:Pe,setSummaryAnchorEl:Ce,anchorEl:Ve,setAnchorEl:rt,contextMenu:at,sortedAndFilteredRows:Ye,summaryRow:_,visibleRows:Oe,page:ve,setPage:Ee,rowsPerPage:it,setRowsPerPage:je,totalDisplayCount:ht,setSelected:xt,handleClick:At,toggleSummaryColumn:Et,handleExport:te,handleCloseContextMenu:ot,toggleColumnVisibility:Fe,toggleGroupExpand:le,handleExpandGroupRecursively:ge,handleCollapseGroupRecursively:J,handleLayoutLoad:Te,handleVariantLoad:Ie,handleLayoutSave:Ze,effectiveAppId:ut,currentLayoutData:dt,currentLayoutId:Lt,layoutIdToLoad:_t,graphReportOpen:bt,handleOpenGraphReport:ft,handleCloseGraphReport:yr}=mn(t),Pt=C?.enabled??false,Ot=Pt&&(C?.interaction?.enabled??true),pt=Ci(),Ft=x||"id",Se=Qt__default.useMemo(()=>({borderRadius:999,fontWeight:700,borderColor:tt(o.palette.divider,b()==="dark"?.55:.3),bgcolor:b()==="dark"?tt(o.palette.common.white,.06):tt(o.palette.background.paper,.92),color:o.palette.text.primary,"& .orb-chip-label":{px:1.05}}),[o]),V=Qt__default.useMemo(()=>({...Se,borderColor:tt(o.palette.primary.main,b()==="dark"?.42:.24),bgcolor:b()==="dark"?tt(o.palette.primary.main,.16):tt(o.palette.primary.main,.08)}),[Se,o]),q=Qt__default.useMemo(()=>{let j=new Set(s);return Ye.filter(Le=>j.has(Le?.[Ft]))},[Ft,s,Ye]),ee=q.length===1?q[0]:null,De=!!P?.enabled,he=!!S?.enabled,Ne=!!k?.enabled,_e=P?.fields,Je=P?.excludeFields||[],Ue=P?.initialValues||{},vt=S?.fields,Dt=S?.excludeFields||[],St=S?.editableFields||[],yt=S?.nonEditableFields||[],F=S?.primaryKeys?.length?S.primaryKeys:[Ft],[Z,ue]=Qt__default.useState(false),[xe,et]=Qt__default.useState(false),[qe,Tt]=Qt__default.useState({}),[gt,mt]=Qt__default.useState(false),[wt,rr]=Qt__default.useState(false),[Bt,qt]=Qt__default.useState({}),[zt,Ut]=Qt__default.useState(false),[Wt,er]=Qt__default.useState(false),or=m||xe||wt||Wt,ur=Qt__default.useMemo(()=>{let j=[...z];if(Array.isArray(_e)&&_e.length>0){let Le=new Set(_e);j=j.filter(Qe=>Le.has(Qe.id));}if(Je.length>0){let Le=new Set(Je);j=j.filter(Qe=>!Le.has(Qe.id));}return j.filter(Le=>!!Le?.id)},[z,Je,_e]),Pr=Qt__default.useMemo(()=>{let j=[...z];if(Array.isArray(vt)&&vt.length>0){let Le=new Set(vt);j=j.filter(Qe=>Le.has(Qe.id));}if(Dt.length>0){let Le=new Set(Dt);j=j.filter(Qe=>!Le.has(Qe.id));}return j.filter(Le=>!!Le?.id)},[z,Dt,vt]),Tr=Qt__default.useMemo(()=>new Set(F),[F]),to=Qt__default.useMemo(()=>new Set(St),[St]),hr=Qt__default.useMemo(()=>new Set(yt),[yt]),Er=Qt__default.useCallback(j=>to.size>0?to.has(j):!(hr.has(j)||Tr.has(j)),[to,hr,Tr]);Qt__default.useEffect(()=>{!bt&&pt.hasActiveFilters&&pt.clearAll();},[pt,bt]);let _o=()=>{let j={};ur.forEach(Le=>{j[Le.id]=Ue[Le.id]??"";}),Tt(j),ue(true);},Uo=(j,Le)=>{Tt(Qe=>({...Qe,[j]:Le}));},No=async()=>{if(!P?.onSubmit){ue(false);return}try{et(!0),await P.onSubmit(qe),ue(!1);}finally{et(false);}},Ko=()=>{if(!ee)return;let j={};Pr.forEach(Qe=>{j[Qe.id]=ee[Qe.id]??"";});let Le=S?.getInitialValues?{...j,...S.getInitialValues(ee)}:j;qt(Le),mt(true);},qo=(j,Le)=>{qt(Qe=>({...Qe,[j]:Le}));},Ir=async()=>{if(ee){if(!S?.onSubmit){mt(false);return}try{rr(!0),await S.onSubmit(Bt,ee),mt(!1);}finally{rr(false);}}},Ao=()=>{q.length!==0&&Ut(true);},Xo=async()=>{if(q.length===0){Ut(false);return}if(!k?.onConfirm){Ut(false),xt([]),l?.([]);return}try{er(!0),await k.onConfirm(q),Ut(!1),xt([]),l?.([]);}finally{er(false);}},_r=Ye,{fieldMapping:ro}=cn({rows:_r,config:{...C,title:C?.title||`${H} ${r("graph.reportTitle")}`}}),Rn=Qt__default.useMemo(()=>Ot?pt.applyRows(_r,ro):_r,[ro,pt,Ot,_r]),{model:Eo}=cn({rows:Rn,config:{...C,title:C?.title||`${H} ${r("graph.reportTitle")}`,fieldMapping:ro}}),M=Eo.table.columns.map(j=>({id:j.id,label:j.label,align:j.align||"left",minWidth:120,numeric:j.align==="right"})),$=ut?f(un,{appId:ut,tableKey:b$1,currentLayoutData:dt,onLayoutLoad:Te,targetLayoutId:_t,activeLayoutId:Lt,serviceUrl:I??g$1?.serviceUrl}):null,U=z.filter(j=>Q.includes(j.id)),ce=U.find(j=>j.id===A)||U[0],Be=R?.map(j=>U.find(Le=>Le.id===j)).filter(Boolean)||U.filter(j=>j.id!==ce?.id).slice(0,G==="portrait"?2:3),nt=U.filter(j=>j.id!==ce?.id&&!Be.some(Le=>Le.id===j.id)),We=[T,p].filter(Boolean),re=g(e,{children:[f(sn,{groupAnchorEl:ke,setGroupAnchorEl:ze,grouping:fe,setGrouping:Ge,columns:z}),f(ln,{anchorEl:Ve,setAnchorEl:rt,columns:z,visibleColumns:Q,toggleColumnVisibility:Fe}),f(ui,{anchorEl:Pe,setAnchorEl:Ce,showSummary:me,setShowSummary:ie,columns:z,summaryColumns:se,toggleSummaryColumn:Et}),f(mi,{contextMenu:at,handleCloseContextMenu:ot,columns:z,visibleColumns:Q,toggleColumnVisibility:Fe})]}),pe=(j,Le,Qe)=>{let Me=s.includes(Le),Xe=G==="portrait"?"repeat(2, minmax(0, 1fr))":"repeat(auto-fit, minmax(140px, 1fr))",It=Qe%2===0?tt(o.palette.primary.main,b()==="dark"?.09:.04):tt(o.palette.primary.main,b()==="dark"?.05:.022),Yo=tt(o.palette.divider,.22);return f(Ae,{elevation:0,onClick:()=>{At({},j),X?.(j);},sx:{p:D==="compact"?1.25:1.5,borderRadius:4,border:"0.5px solid",borderColor:Me?tt(o.palette.primary.main,.38):Yo,background:Me?`linear-gradient(135deg, ${tt(o.palette.primary.main,.13)}, ${tt(o.palette.primary.main,.06)})`:`linear-gradient(135deg, ${It}, ${tt(o.palette.primary.main,.015)})`,boxShadow:Me?`0 12px 30px ${tt(o.palette.primary.main,.2)}`:`0 3px 10px ${tt(o.palette.common.black,.045)}`,cursor:"pointer",position:"relative",overflow:"hidden",transition:"border-color 160ms ease, box-shadow 160ms ease, transform 120ms ease, background 160ms ease","&::before":{content:'""',position:"absolute",left:0,top:0,bottom:0,width:4,background:Me?o.palette.primary.main:Qe%2===0?tt(o.palette.primary.main,.26):tt(o.palette.text.primary,.16)},"&:hover":{boxShadow:`0 10px 20px ${tt(o.palette.primary.main,.12)}`,transform:"translateY(-1px)"},"&:active":{transform:"scale(0.995)"}},children:g(ae,{spacing:1.25,children:[g(ae,{direction:"row",spacing:1.25,alignItems:"flex-start",children:[i?f(Rt,{checked:Me,onClick:Cr=>Cr.stopPropagation(),onChange:()=>At({},j),sx:{mt:-0.6,ml:-0.6}}):null,g("div",{sx:{flex:1,minWidth:0},children:[ce?f(E,{sx:{fontSize:"1rem",fontWeight:900,lineHeight:1.25},children:Ku(ce,j)}):null,Be.length>0?f(ae,{direction:"row",spacing:.75,useFlexGap:true,flexWrap:"wrap",sx:{mt:.75},children:Be.map(Cr=>f(kt,{label:`${Cr.label}: ${Lv(Cr,j)}`,size:"small",variant:"outlined",sx:Se},`${Le}-${Cr.id}`))}):null]}),L?f("div",{onClick:Cr=>Cr.stopPropagation(),children:L(j)}):null]}),nt.length>0?f("div",{sx:{display:"grid",gridTemplateColumns:Xe,gap:1},children:nt.map(Cr=>g(Ae,{elevation:0,sx:{p:1,borderRadius:3,bgcolor:b()==="dark"?tt(o.palette.background.default,.7):tt(o.palette.background.paper,.92),border:"0.1px solid",borderColor:tt(o.palette.divider,.24)},children:[f(E,{sx:{fontSize:"0.72rem",color:"text.secondary"},children:Cr.label}),Ev(Ku(Cr,j))]},`${Le}-${Cr.id}-detail`))}):null,B?g(e,{children:[f(Nt,{}),f("div",{onClick:Cr=>Cr.stopPropagation(),children:B(j)})]}):null]})},Le)};return g("div",{sx:{width:f$1?"100%":"auto",mb:u?0:2,...u?{flex:1,display:"flex",flexDirection:"column",minHeight:0,height:"100%",overflow:"hidden"}:{}},children:[g$1?f("div",{sx:{mb:2},children:f(Vu,{...g$1,onVariantLoad:j=>{Ie(j),g$1.onVariantLoad?.(j);},appId:g$1.appId,tableKey:b$1,currentLayout:[{tableKey:b$1,layoutData:dt}],currentLayoutId:Lt,layoutRefs:[{tableKey:b$1,layoutId:Lt}],variantService:g$1.variantService,serviceUrl:I??g$1.serviceUrl,touchMode:G==="portrait"?"expanded":"comfortable"})}):null,g(Ae,{sx:{width:f$1?"100%":"auto",mb:u?0:2,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative",bgcolor:"transparent",backgroundImage:"none",boxShadow:"none","&::before":or?{content:'""',position:"absolute",top:0,left:0,width:"100%",height:"3px",background:"linear-gradient(90deg, color-mix(in oklch, var(--orb-primary) 0%, transparent) 0%, color-mix(in oklch, var(--orb-primary) 25%, transparent) 25%, var(--orb-primary) 50%, color-mix(in oklch, var(--orb-primary) 25%, transparent) 75%, color-mix(in oklch, var(--orb-primary) 0%, transparent) 100%)",backgroundSize:"220% 100%",animation:"cTableTopMarquee 1.2s linear infinite",zIndex:6,pointerEvents:"none"}:{},"@keyframes cTableTopMarquee":{"0%":{backgroundPosition:"220% 0"},"100%":{backgroundPosition:"-120% 0"}},...h?{height:h}:u?{flex:1,minHeight:0,height:"100%"}:{}},children:[a?f("div",{sx:{"& .orb-toolbar":{minHeight:60,alignItems:{xs:"flex-start",md:"center"},flexWrap:"wrap",rowGap:1,columnGap:1},"& .orb-toolbar > :nth-of-type(1)":{width:{xs:"100%",md:"auto"},"& .orb-fld":{width:{xs:"100%",md:300}}},"& .orb-toolbar > :nth-of-type(2)":{flexShrink:0},"& .orb-toolbar > :nth-of-type(3)":{display:{xs:"none",md:"block"}},"& .orb-toolbar > :nth-of-type(4)":{ml:"auto",justifyContent:"flex-end",flexWrap:"wrap"},"& .orb-inp-adornment-wrap, & .orb-inp":{minHeight:46},"& .orb-icon-btn":{width:40,height:40},"& .orb-body, & .orb-body-dense, & .orb-label, & .orb-meta":{fontSize:"0.9rem"},"& button":{borderRadius:2.5}},children:f(li,{filterText:O,setFilterText:Y,onRowsPerPageChange:je,rowsPerPage:it,rowsPerPageOptions:v,page:ve,count:ht,onPageChange:Ee,actions:d,extraTools:We,grouping:fe,setGroupAnchorEl:ze,showSummary:me,setShowSummary:ie,setAnchorEl:rt,setSummaryAnchorEl:Ce,handleExport:te,showCreateButton:De,onOpenCreateDialog:_o,showEditButton:he,onOpenEditDialog:Ko,editDisabled:q.length!==1,showDeleteButton:Ne,onOpenDeleteConfirm:Ao,deleteDisabled:q.length===0,onLayoutSave:y||g$1?.variantService&&g$1?.appId?Ze:void 0,loading:m,layoutManager:$,onOpenGraphReport:Pt?ft:void 0})}):null,f("div",{sx:{flex:1,minHeight:0,overflow:"auto",p:1.5},children:g(ae,{spacing:1.25,children:[Oe.length===0&&!m?N||f(Ae,{elevation:0,sx:{p:4,borderRadius:4,border:"1px dashed",borderColor:"divider",textAlign:"center"},children:f(E,{sx:{fontSize:"0.92rem",color:"text.secondary"},children:r("common.noData")})}):null,Oe.map((j,Le)=>{if(j.type==="group"){let Xe=Re.has(j.id);return f(Ae,{elevation:0,sx:{borderRadius:4,border:"1px solid",borderColor:"divider",bgcolor:"action.hover"},children:g("div",{component:"button",type:"button",onClick:()=>le(j.id),sx:{width:"100%",px:1.5,py:1.3,border:0,background:"transparent",display:"flex",alignItems:"center",gap:1,textAlign:"left",cursor:"pointer",appearance:"none",WebkitAppearance:"none",color:"text.primary"},children:[Xe?f(tn,{}):f(Ya,{}),g("div",{sx:{flex:1,minWidth:0},children:[g(E,{sx:{fontSize:"0.94rem",fontWeight:800},children:[j.field,": ",j.value]}),g(E,{sx:{mt:.2,fontSize:"0.76rem",color:"text.secondary"},children:[j.count," records"]})]}),fe.length>1&&j.level<fe.length-1?g(ae,{direction:"row",spacing:.5,children:[f(kt,{size:"small",label:r("table.group.expandAll"),onClick:It=>{It.stopPropagation(),ge(j.id);},sx:V}),f(kt,{size:"small",label:r("table.group.collapseAll"),onClick:It=>{It.stopPropagation(),J(j.id);},sx:V})]}):null]})},j.id)}let Qe=j.data||j,Me=j.id||Qe[Ft]||Le;return pe(Qe,Me,Le)}),me?f(Ov,{summaryRow:_,visibleColumns:Q,columns:z}):null,m?f(E,{sx:{py:1,fontSize:"0.84rem",color:"text.secondary",textAlign:"center"},children:r("common.loading")}):null]})})]}),De?g(Ht,{open:Z,onClose:()=>!xe&&ue(false),fullWidth:true,maxWidth:"sm",children:[f("div",{className:"orb-dialog-title",sx:{fontSize:"1rem",fontWeight:800},children:P?.title||r("quickCreate.createWithTitle",{title:H})}),f("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:g("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[ur.map(j=>{let Le=j.type==="number"||j.numeric?"number":j.type==="date"?"date":"text";return f(He,{label:j.label||j.id,value:qe[j.id]??"",onChange:Qe=>Uo(j.id,Qe.target.value),type:Le,fullWidth:true,InputLabelProps:{shrink:Le==="date"?true:void 0}},`quick-create-${j.id}`)}),P?.description?f(Yr,{severity:"info",children:P.description}):null]})}),g("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[f(ye,{onClick:()=>ue(false),disabled:xe,children:P?.cancelLabel||r("common.cancel")}),f(ye,{onClick:No,variant:"contained",disabled:xe,children:P?.submitLabel||r("common.save")})]})]}):null,he?g(Ht,{open:gt,onClose:()=>!wt&&mt(false),fullWidth:true,maxWidth:"sm",children:[f("div",{className:"orb-dialog-title",sx:{fontSize:"1rem",fontWeight:800},children:S?.title||r("quickEdit.editWithTitle",{title:H})}),f("div",{className:"orb-dialog-content",sx:{pt:"8px !important"},children:g("div",{sx:{display:"flex",flexDirection:"column",gap:1.25},children:[Pr.map(j=>{let Le=j.type==="number"||j.numeric?"number":j.type==="date"?"date":"text";return f(He,{label:j.label||j.id,value:Bt[j.id]??"",onChange:Qe=>qo(j.id,Qe.target.value),type:Le,disabled:!Er(j.id),fullWidth:true,InputLabelProps:{shrink:Le==="date"?true:void 0}},`quick-edit-${j.id}`)}),S?.description?f(Yr,{severity:"info",children:S.description}):null]})}),g("div",{className:"orb-dialog-actions",sx:{px:3,pb:2},children:[f(ye,{onClick:()=>mt(false),disabled:wt,children:S?.cancelLabel||r("common.cancel")}),f(ye,{onClick:Ir,variant:"contained",disabled:wt||!ee,children:S?.submitLabel||r("common.save")})]})]}):null,Ne?f(Un,{open:zt,type:"warning",title:k?.title||r("quickDelete.confirmTitle"),message:k?.message||(q.length>1?r("quickDelete.confirmMessageMultiple",{count:q.length}):r("quickDelete.confirmMessageSingle")),confirmText:k?.confirmText||r("common.delete"),cancelText:k?.cancelText||r("common.cancel"),onClose:()=>!Wt&&Ut(false),onConfirm:Xo}):null,re,Pt?f(vi,{open:bt,onClose:yr,model:Eo,aiAssistant:C?.aiAssistant,interaction:Ot?{enabled:true,filters:pt.filters,fieldMapping:ro,onPrimaryDimensionClick:j=>pt.setFilter("primaryDimension",j),onSecondaryDimensionClick:j=>pt.setFilter("secondaryDimension",j),onStatusClick:j=>pt.setFilter("status",j),onClearFilter:pt.clearFilter,onClearAll:pt.clearAll}:void 0,tableContent:f(Fv,{appId:ut||"graph-report-internal",title:r("graph.dataBody"),columns:M,rows:Eo.table.rows,rowKey:"id",fullWidth:true,maxHeight:"420px",rowsPerPage:20,rowsPerPageOptions:[20,50,100],graphReport:{enabled:false},showSummary:false})}):null]})};var IO=({appTitle:t,children:r,menuData:o=[],workloadItems:n=[],workloadSelectedId:a,showNavigation:i=true,showWorkloadNav:s=true,orientation:l="auto",logo:d,headerSlot:p,actionSlot:u,portraitBottomSlot:f$1,contentSx:h,containerSx:m,user:v,onSearch:y,onSearchAdd:g$1,defaultNavigationOpen:x,navOpen:b,onNavOpenChange:C,onWorkloadSelect:P,locale:S="en",localeLabel:k,localeOptions:I,onLocaleChange:w,onUserSetting:A,onUserLogout:R,userMenuItems:T,leftHeaderSlot:N,rightHeaderSlot:D})=>{let L="orbcafe:page-layout-mode",[B,X]=useState("system"),[H,K]=useState("light"),[W,G]=useState(false),[z,O]=useState(false),Y=B==="system"?z?H:"light":B;useEffect(()=>{G(true);},[]),useEffect(()=>{try{let at=window.localStorage.getItem(L);(at==="light"||at==="dark"||at==="system")&&X(at);}catch{}O(true);let Ve=window.matchMedia("(prefers-color-scheme: dark)"),rt=()=>{K(Ve.matches?"dark":"light");};return rt(),Ve.addEventListener("change",rt),()=>Ve.removeEventListener("change",rt)},[]),useEffect(()=>{if(z)try{window.localStorage.setItem(L,B);}catch{}},[z,B]),useEffect(()=>{Y==="dark"?(document.documentElement.classList.add("dark"),document.documentElement.classList.add("orb-dark"),document.documentElement.dataset.orbMode="dark",document.documentElement.style.colorScheme="dark"):(document.documentElement.classList.remove("dark"),document.documentElement.classList.remove("orb-dark"),document.documentElement.dataset.orbMode="light",document.documentElement.style.colorScheme="light");},[Y]);let Q=Mr("(orientation: portrait)"),me=Mr("(max-width: 899.95px)"),ie=l==="auto"?!W||Q||me?"portrait":"landscape":l,[se,fe]=useState({landscape:x??true,portrait:false}),Ge=se[ie],Re=b??Ge,ke=Ve=>{b===void 0&&fe(rt=>({...rt,[ie]:Ve})),C?.(Ve);},ze=g(ae,{direction:"row",spacing:1,alignItems:"center",children:[!W||i&&ie==="portrait"?f(ne,{onClick:()=>ke(!Re),sx:{bgcolor:"action.hover"},children:f(ti,{})}):null,N]}),Pe=g(ae,{direction:"row",spacing:1,alignItems:"center",children:[u,D]}),Ce=f(Uu,{collapsed:ie==="landscape"?!Re:false,onToggle:()=>ke(!Re),menuData:o,orientation:ie,colorMode:Y,maxHeight:ie==="landscape"?900:void 0});return f(Dn,{mode:B,children:f(Ba,{locale:S,children:g("div",{sx:[Ve=>({minHeight:"100vh",display:"flex",flexDirection:"column",background:Ve.palette.mode==="dark"?"linear-gradient(180deg, var(--orb-canvas) 0%, var(--orb-surface) 55%, var(--orb-surface-2) 100%)":Ve.palette.background.default}),...Array.isArray(m)?m:[m]],children:[f(Oi,{appTitle:t,logo:d===void 0?null:d,mode:B,onToggleMode:()=>X(Ve=>Ve==="system"?"dark":Ve==="dark"?"light":"system"),locale:S,localeLabel:k,localeOptions:I,onLocaleChange:w,user:v,onUserSetting:A,onUserLogout:R,userMenuItems:T,onSearch:y,onSearchAdd:g$1,leftSlot:ze,rightSlot:Pe}),p?f("div",{sx:{px:{xs:2,md:3},py:1.5,borderBottom:"1px solid",borderColor:"divider"},children:p}):null,g("div",{sx:{flex:1,minHeight:0,display:"flex",position:"relative"},children:[W&&i&&ie==="landscape"?f("div",{sx:{p:1.5,pr:0,flexShrink:0},children:Ce}):null,!W||i&&ie==="portrait"?f(ud,{open:Re,onClose:()=>ke(false),PaperProps:{sx:{width:"min(88vw, 360px)",p:1.25,bgcolor:"transparent",boxShadow:"none"}},children:Ce}):null,f("div",{sx:{flex:1,minWidth:0,minHeight:0,overflow:"auto",p:1.5,...h},children:g(ae,{spacing:1.5,children:[s&&n.length>0?f(Wu,{items:n,selectedId:a,orientation:ie,onItemSelect:P}):null,f(Ae,{elevation:0,sx:{flex:1,minHeight:ie==="portrait"?420:560,p:{xs:1.25,md:1.5},borderRadius:5,border:"1px solid",borderColor:"divider",bgcolor:"color-mix(in oklch, var(--orb-canvas) 72%, transparent)",backdropFilter:"blur(12px)",color:"text.primary"},children:r})]})})]}),ie==="portrait"&&f$1?g(e,{children:[f(Nt,{}),f("div",{sx:{p:1.5},children:f$1})]}):null]})})})};var qu=Bv(()=>import('./COrbCanvas-4PZFJUYO.mjs').then(t=>t.COrbCanvas),{ssr:false,loading:()=>f("div",{className:"h-full w-full bg-transparent"})});function wl({isRecording:t}){return f(AnimatePresence,{children:t&&f(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:g("div",{className:"relative flex h-full w-full items-center justify-center",children:[f("div",{className:"absolute inset-0",children:f(qu,{hue:0,hoverIntensity:.5,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})}),f("div",{className:"relative z-10 h-full w-1/3 mix-blend-overlay opacity-80",children:f(qu,{hue:10,hoverIntensity:.8,rotateOnHover:true,forceHoverState:true,backgroundColor:"transparent"})})]})})})}var AO=wl;var Yu=createContext(null);function _v(t){if(!t||!(t instanceof HTMLElement))return false;let r=t.tagName;return !!(r==="INPUT"||r==="TEXTAREA"||r==="SELECT"||t.isContentEditable||t.closest('[data-voice-hotkey-ignore="true"]'))}function Uv({children:t,onVoiceSubmit:r,onVoicePartial:o,onVoiceError:n,longPressMs:a=200,disableSpaceTrigger:i=false,ignoreWhenFocusedInput:s=true,renderOverlay:l=true,wsUrl:d,silenceThresholdMs:p,minVolumeRms:u}){let[f$1,h]=useState(false),[m,v]=useState(false),y=useRef(null),g$1=useRef(false),x=useRef(false),b=useCallback(()=>{x.current=false,h(false);},[]),{isRecording:C,startRecording:P,stopRecording:S}=vn({wsUrl:d,silenceThresholdMs:p,minVolumeRms:u,onTextUpdate:A=>{o?.(A);},onComplete:async A=>{try{A.trim()&&(v(!0),await r(A.trim()));}catch(R){let T=R instanceof Error?R.message:"Failed to process voice command";n?.(T);}finally{v(!1),b();}},onError:A=>{n?.(A),v(!1),g$1.current||b();}}),k=useCallback(async()=>{x.current=false,await P();},[P]),I=useCallback(()=>{S();},[S]);useEffect(()=>{if(i)return;let A=T=>{T.isComposing||(T.code==="Space"||T.key===" ")&&(g$1.current||T.repeat||s&&_v(document.activeElement)||(g$1.current=true,T.preventDefault(),y.current=setTimeout(()=>{x.current=true,h(true),P();},a)));},R=T=>{(T.code==="Space"||T.key===" ")&&(y.current&&(clearTimeout(y.current),y.current=null),g$1.current=false,x.current&&(T.preventDefault(),h(false),S()));};return window.addEventListener("keydown",A),window.addEventListener("keyup",R),()=>{window.removeEventListener("keydown",A),window.removeEventListener("keyup",R),y.current&&(clearTimeout(y.current),y.current=null);}},[i,s,a,P,S]);let w=useMemo(()=>({isRecording:C,isHotkeyRecording:f$1,isSubmitting:m,startRecording:k,stopRecording:I}),[f$1,C,m,k,I]);return g(Yu.Provider,{value:w,children:[l?f(wl,{isRecording:f$1}):null,t]})}function Kv(){let t=useContext(Yu);if(!t)throw new Error("useAINav must be used within CAINavProvider");return t}var HO=Uv,zO=Kv;function ct(...t){return twMerge(clsx(t))}var Qv=({content:t,theme:r="light",size:o="base",defaultExpanded:n=false})=>{let[a,i]=useState(n),s=useMemo(()=>`${(o==="sm"?14:o==="lg"?18:16)-2}px`,[o]);return g("div",{className:`my-6 rounded-lg overflow-hidden transition-all duration-200 ${r==="dark"?"bg-[var(--orb-surface-2)]":"bg-[var(--orb-canvas)]"}`,style:{border:"0.5px solid var(--orb-border)"},children:[g("div",{className:"px-4 py-3 cursor-pointer flex items-center justify-between transition-colors duration-200 bg-[var(--orb-surface)] hover:bg-[var(--orb-hover)]",style:{borderBottom:"0.5px solid var(--orb-border)"},onClick:()=>i(!a),children:[g("span",{className:"flex items-center",children:[f(ka,{className:"mr-2 h-4 w-4"}),f("span",{className:"font-medium text-[var(--orb-fg)]",style:{fontSize:o==="sm"?"14px":o==="lg"?"18px":"16px"},children:"\u601D\u8003\u8FC7\u7A0B"})]}),f(Lr,{className:`w-4 h-4 transition-transform duration-200 ${a?"rotate-180":""} text-[var(--orb-muted)]`})]}),a&&f("div",{className:"p-4 whitespace-pre-wrap italic font-light text-[var(--orb-muted)]",style:{fontSize:s,lineHeight:"1.3 !important"},children:t})]})},Zu=Qv;var ry=({content:t,language:r="text",isStreaming:o=false,className:n=""})=>{let a=br(),[i,s]=useState(false),l=async()=>{try{await navigator.clipboard.writeText(t),s(!0),setTimeout(()=>s(!1),2e3);}catch(p){console.error("\u590D\u5236\u5931\u8D25:",p);}},d=a==="dark"?oneDark:oneLight;return g("div",{className:ct("rounded-lg overflow-hidden border border-[var(--orb-border)] my-4",n),children:[g("div",{className:"flex items-center justify-between px-4 py-2 bg-[var(--orb-surface)] border-b border-[var(--orb-border)]",children:[f("span",{className:"text-xs font-medium text-[var(--orb-muted)] uppercase",children:r}),f("button",{onClick:l,className:"p-1 hover:bg-[var(--orb-hover)] rounded transition-colors",disabled:o,title:i?"Copied":"Copy code",children:i?f(Ur,{size:14,className:"text-[var(--orb-status-success)]"}):f(pc,{size:14,className:"text-[var(--orb-muted)]"})})]}),f("div",{className:"text-sm",children:f(Prism,{language:r,style:d,customStyle:{margin:0,padding:"16px",fontSize:"14px",lineHeight:"1.5",backgroundColor:a==="dark"?"var(--orb-surface-2)":"var(--orb-canvas)"},wrapLongLines:true,children:t})})]})},Qu=ry;var ay=({content:t,isLoading:r,className:o="",style:n})=>{let a=useRef(null),[i,s]=useState(false),[l,d]=useState(null),p=br();return useEffect(()=>{let u=false,f=async()=>{if(!(!t.trim()||!a.current)){s(true),d(null);try{Ju.initialize({startOnLoad:!1,theme:p==="dark"?"dark":"default",securityLevel:"loose",fontFamily:"inherit",flowchart:{htmlLabels:!1}});let m=`mermaid-${Math.random().toString(36).substr(2,9)}`,v=t.replace(/```mermaid\n?|\n?```/g,"").trim(),{svg:y,bindFunctions:g}=await Ju.render(m,v);!u&&a.current&&(a.current.innerHTML=y,g?.(a.current));}catch(m){if(u)return;console.error("Mermaid render failed:",m),d(m instanceof Error?m.message:"Render failed");}finally{u||s(false);}}},h=setTimeout(()=>{f();},100);return ()=>{u=true,clearTimeout(h);}},[t,p]),g("div",{className:`mermaid-block ${o}`,style:n,children:[(r||i)&&g("div",{className:"flex items-center justify-center rounded border border-[var(--orb-border)] bg-[var(--orb-surface)] p-4 dark:bg-[var(--orb-surface-2)]",children:[f("div",{className:"mr-2 h-4 w-4 animate-spin rounded-full border-b-2 border-[var(--orb-primary)]"}),f("span",{className:"text-sm text-[var(--orb-muted)]",children:"Generating Diagram..."})]}),l&&g("div",{className:"overflow-auto rounded border border-[color-mix(in_oklch,var(--orb-status-error)_30%,transparent)] bg-[color-mix(in_oklch,var(--orb-status-error)_8%,transparent)] p-4 text-sm text-[var(--orb-status-error)]",children:[f("p",{className:"mb-2 font-semibold",children:"Mermaid Error:"}),f("pre",{children:l}),f("pre",{className:"mt-4 text-xs text-[var(--orb-muted)]",children:t})]}),f("div",{ref:a,className:`overflow-x-auto ${r||i||l?"hidden":""}`})]})},em=ay;var iy=({title:t="\u53D1\u751F\u9519\u8BEF",content:r,errorCode:o,stack:n,icon:a,closable:i=true,onClose:s,onRetry:l,className:d="",...p})=>{let[u,f$1]=useState(false),[h,m]=useState(false),v=async()=>{if(l){m(true);try{await l();}catch(y){console.error("\u91CD\u8BD5\u5931\u8D25:",y);}finally{m(false);}}};return g("div",{className:`relative w-full overflow-hidden rounded-lg border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-sm transition-all hover:shadow-md ${d}`,...p,children:[g("div",{className:"flex p-4 border-l-4 border-l-[var(--orb-status-error)] bg-[color-mix(in_oklch,var(--orb-status-error)_8%,transparent)]",children:[f("div",{className:"flex-shrink-0 mr-3 text-[var(--orb-status-error)] mt-0.5",children:a||f(va,{className:"w-5 h-5"})}),g("div",{className:"flex-1 min-w-0",children:[g("div",{className:"flex items-center space-x-2 mb-1",children:[f("h4",{className:"text-base font-semibold text-[var(--orb-fg)]",children:t}),o&&f("span",{className:"text-xs font-mono px-1.5 py-0.5 rounded bg-[color-mix(in_oklch,var(--orb-status-error)_14%,transparent)] text-[var(--orb-status-error)]",children:o})]}),r&&f("div",{className:"text-sm text-[var(--orb-muted)] mb-3 leading-relaxed",children:typeof r=="string"?f("p",{className:"whitespace-pre-wrap",children:r}):r}),(l||n)&&g("div",{className:"flex items-center space-x-4 mt-2",children:[l&&g("button",{onClick:v,disabled:h,className:"flex items-center text-xs font-medium text-[var(--orb-status-error)] hover:opacity-80 transition-colors disabled:opacity-50",children:[f(Tc,{className:`w-3.5 h-3.5 mr-1.5 ${h?"animate-spin":""}`}),h?"\u91CD\u8BD5\u4E2D...":"\u91CD\u8BD5"]}),n&&g("button",{onClick:()=>f$1(!u),className:"flex items-center text-xs font-medium text-[var(--orb-muted)] hover:text-[var(--orb-fg)] dark:text-[var(--orb-muted)] transition-colors",children:[u?f(Lr,{className:"w-3.5 h-3.5 mr-1"}):f(Or,{className:"w-3.5 h-3.5 mr-1"}),u?"\u9690\u85CF\u8BE6\u60C5":"\u67E5\u770B\u8BE6\u60C5"]})]})]}),i&&s&&f("button",{onClick:s,className:"flex-shrink-0 ml-3 text-[var(--orb-muted)] hover:text-[var(--orb-fg)] transition-colors self-start",children:f(Xt,{className:"w-4 h-4"})})]}),n&&u&&f("div",{className:"bg-[var(--orb-surface)] dark:bg-[var(--orb-canvas)] p-3 border-t border-[var(--orb-border)]",children:f("pre",{className:"text-xs font-mono text-[var(--orb-muted)] overflow-x-auto whitespace-pre-wrap p-2 bg-[var(--orb-canvas)] rounded border border-[var(--orb-border)]",children:n})})]})},Zi=iy;var sy=({title:t="\u8B66\u544A",content:r,warningType:o,severity:n="warning",warnings:a=[],icon:i,closable:s=true,onClose:l,onConfirm:d,actionText:p,className:u="",...f$1})=>{let h=()=>{switch(n){case "info":return {borderLeftColor:"border-l-blue-500",iconColor:"text-[var(--orb-primary)]",bgColor:"bg-[var(--orb-p50)]"};case "error":return {borderLeftColor:"border-l-[var(--orb-status-error)]",iconColor:"text-[var(--orb-status-error)]",bgColor:"bg-[color-mix(in_oklch,var(--orb-status-error)_8%,transparent)]"};case "success":return {borderLeftColor:"border-l-green-500",iconColor:"text-[var(--orb-status-success)]",bgColor:"bg-[color-mix(in_oklch,var(--orb-status-success)_8%,transparent)]"};default:return {borderLeftColor:"border-l-yellow-500",iconColor:"text-[var(--orb-status-warning)]",bgColor:"bg-[color-mix(in_oklch,var(--orb-status-warning)_8%,transparent)]"}}},m=()=>{switch(n){case "info":return f(wa,{className:"w-5 h-5"});case "error":return f(Aa,{className:"w-5 h-5"});case "success":return f(ya,{className:"w-5 h-5"});default:return f(lc,{className:"w-5 h-5"})}},v=h();return g("div",{className:`relative w-full overflow-hidden rounded-lg border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-sm transition-all hover:shadow-md ${u}`,...f$1,children:[g("div",{className:`flex p-4 border-l-4 ${v.borderLeftColor} ${v.bgColor}`,children:[f("div",{className:`flex-shrink-0 mr-3 ${v.iconColor}`,children:i||m()}),g("div",{className:"flex-1 min-w-0",children:[g("div",{className:"flex items-center justify-between mb-1",children:[f("h4",{className:"text-base font-semibold text-[var(--orb-fg)]",children:t}),o&&f("span",{className:"text-xs font-medium px-2 py-0.5 rounded-full bg-[var(--orb-surface)] text-[var(--orb-muted)]",children:o})]}),r&&f("div",{className:"text-sm text-[var(--orb-muted)] mb-2",children:r}),a&&a.length>0&&f("ul",{className:"mt-2 space-y-1",children:a.map((y,g$1)=>g("li",{className:"flex items-start text-sm text-[var(--orb-muted)]",children:[f("span",{className:"mr-2 mt-1.5 w-1 h-1 rounded-full bg-[var(--orb-muted)] flex-shrink-0"}),f("span",{children:y})]},g$1))})]}),s&&l&&f("button",{onClick:l,className:"flex-shrink-0 ml-3 text-[var(--orb-muted)] hover:text-[var(--orb-fg)] transition-colors",children:f(Xt,{className:"w-4 h-4"})})]}),d&&f("div",{className:"bg-[color-mix(in_oklch,var(--orb-surface)_50%,transparent)] px-4 py-3 flex justify-end border-t border-[var(--orb-border)]",children:f("button",{onClick:d,className:"px-4 py-1.5 text-sm font-medium text-[var(--orb-on-primary)] bg-[var(--orb-primary)] hover:bg-[var(--orb-p600)] rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-[var(--orb-primary)] focus:ring-offset-2 dark:focus:ring-offset-gray-900",children:p||"\u786E\u8BA4"})})]})},Qi=sy;var ly=({title:t="\u76F8\u5173\u63A8\u8350",content:r,suggestions:o,onSuggestionClick:n,maxDisplay:a=5,icon:i,closable:s=false,onClose:l,className:d="",...p})=>{let[u,f$1]=useState(false),[h,m]=useState(""),[v,y]=useState(false),g$1=useMemo(()=>h.trim()?o.filter(C=>C.toLowerCase().includes(h.toLowerCase())):o,[o,h]),x=useMemo(()=>u?g$1:g$1.slice(0,a),[g$1,u,a]),b=C=>{n?.(C);};return !o||o.length===0?null:g("div",{className:`w-full overflow-hidden rounded-lg border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-sm transition-all hover:shadow-md ${d}`,...p,children:[g("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--orb-border)] bg-[var(--orb-p50)]",children:[g("div",{className:"flex items-center space-x-2.5",children:[f("div",{className:"text-[var(--orb-primary)] flex-shrink-0",children:i||f(ka,{className:"w-5 h-5"})}),g("div",{className:"flex flex-col",children:[f("h4",{className:"text-sm font-semibold text-[var(--orb-fg)] leading-tight",children:t}),r&&f("span",{className:"text-xs text-[var(--orb-muted)] mt-0.5",children:r})]})]}),g("div",{className:"flex items-center space-x-1",children:[o.length>3&&f("button",{onClick:()=>y(!v),className:`p-1.5 rounded-md transition-colors ${v?"bg-[var(--orb-p100)] text-[var(--orb-status-primary)]":"text-[var(--orb-muted)] hover:text-[var(--orb-fg)] hover:bg-[var(--orb-hover)]"}`,title:v?"\u5173\u95ED\u641C\u7D22":"\u641C\u7D22\u95EE\u9898",children:f(Fr,{className:"w-4 h-4"})}),s&&l&&f("button",{onClick:l,className:"text-[var(--orb-muted)] hover:text-[var(--orb-fg)] p-1.5 rounded-md hover:bg-[var(--orb-hover)] transition-colors",title:"\u5173\u95ED",children:f(Xt,{className:"w-4 h-4"})})]})]}),v&&f("div",{className:"px-4 py-2 border-b border-[var(--orb-border)] bg-[color-mix(in_oklch,var(--orb-surface)_50%,transparent)]",children:g("div",{className:"relative",children:[f("input",{type:"text",placeholder:"\u641C\u7D22\u76F8\u5173\u95EE\u9898...",value:h,onChange:C=>m(C.target.value),className:"w-full text-sm px-3 py-1.5 pl-8 rounded border border-[var(--orb-border)] bg-[var(--orb-canvas)] text-[var(--orb-fg)] focus:ring-1 focus:ring-[var(--orb-primary)] focus:border-[var(--orb-primary)] outline-none transition-shadow",autoFocus:true}),f(Fr,{className:"absolute left-2.5 top-2 w-3.5 h-3.5 text-[var(--orb-muted)]"})]})}),g("div",{className:"p-2",children:[f("ul",{className:"space-y-1",children:x.map((C,P)=>f("li",{children:g("button",{onClick:()=>b(C),className:"w-full text-left px-3 py-2 rounded-md text-sm text-[var(--orb-fg)] hover:bg-[var(--orb-hover)] hover:text-[var(--orb-status-primary)] transition-colors group flex items-start justify-between",children:[f("span",{children:C}),f(Or,{className:"w-4 h-4 text-[var(--orb-muted)] group-hover:text-[var(--orb-status-primary)] opacity-0 group-hover:opacity-100 transition-all transform group-hover:translate-x-0.5"})]})},P))}),g$1.length>a&&f("button",{onClick:()=>f$1(!u),className:"w-full text-center py-2 text-xs font-medium text-[var(--orb-muted)] hover:text-[var(--orb-fg)] transition-colors border-t border-[var(--orb-border)] mt-1",children:u?"\u6536\u8D77":`\u67E5\u770B\u5168\u90E8 (${g$1.length})`}),g$1.length===0&&h&&f("div",{className:"text-center py-4 text-sm text-[var(--orb-muted)]",children:"\u6CA1\u6709\u627E\u5230\u5339\u914D\u7684\u5EFA\u8BAE"})]})]})},ji=ly;var cy=({title:t,content:r,toolName:o,parameters:n,result:a,status:i,duration:s,icon:l,closable:d=false,onClose:p,onAction:u,actionText:f$1,className:h="",...m})=>{let[v,y]=useState(false),[g$1,x]=useState(true),b=()=>{switch(i){case "pending":return {iconColor:"text-[var(--orb-primary)]",badgeBg:"bg-[var(--orb-p50)]",badgeText:"text-[var(--orb-status-primary)]",label:"\u6267\u884C\u4E2D"};case "error":return {iconColor:"text-[var(--orb-status-error)]",badgeBg:"bg-[color-mix(in_oklch,var(--orb-status-error)_10%,transparent)]",badgeText:"text-[var(--orb-status-error)]",label:"\u5931\u8D25"};default:return {iconColor:"text-[var(--orb-status-success)]",badgeBg:"bg-[color-mix(in_oklch,var(--orb-status-success)_8%,transparent)]",badgeText:"text-[var(--orb-status-success)]",label:"\u6210\u529F"}}},C=()=>{switch(i){case "pending":return f(Cc,{className:"w-5 h-5 animate-spin"});case "error":return f(Aa,{className:"w-5 h-5"});default:return f(ya,{className:"w-5 h-5"})}},P=I=>I?I<1e3?`${I}ms`:`${(I/1e3).toFixed(2)}s`:"",S=b(),k=t||o||"\u5DE5\u5177\u8C03\u7528";return g("div",{className:`w-full overflow-hidden rounded-lg border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-sm transition-all hover:shadow-md ${h}`,...m,children:[g("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--orb-border)] bg-[color-mix(in_oklch,var(--orb-surface)_50%,transparent)]",children:[g("div",{className:"flex items-center space-x-3",children:[f("div",{className:`flex-shrink-0 ${S.iconColor}`,children:l||C()}),g("div",{children:[g("div",{className:"flex items-center space-x-2",children:[f("h4",{className:"text-sm font-semibold text-[var(--orb-fg)]",children:k}),f("span",{className:`text-[10px] font-medium px-1.5 py-0.5 rounded ${S.badgeBg} ${S.badgeText}`,children:S.label})]}),o&&t&&g("div",{className:"text-xs text-[var(--orb-muted)] flex items-center mt-0.5",children:[f(Ln,{className:"w-3 h-3 mr-1"}),o]})]})]}),g("div",{className:"flex items-center space-x-2 text-xs text-[var(--orb-muted)]",children:[s&&g("div",{className:"flex items-center bg-[var(--orb-surface)] px-2 py-1 rounded",children:[f(uc,{className:"w-3 h-3 mr-1"}),P(s)]}),d&&p&&f("button",{onClick:p,className:"text-[var(--orb-muted)] hover:text-[var(--orb-fg)] transition-colors p-1 rounded",children:f(Xt,{className:"w-4 h-4"})})]})]}),g("div",{className:"p-4",children:[r&&f("div",{className:"text-sm text-[var(--orb-muted)] mb-4 leading-relaxed",children:r}),n&&g("div",{className:"mb-3",children:[g("button",{onClick:()=>y(!v),className:"flex items-center text-xs font-medium text-[var(--orb-muted)] hover:text-[var(--orb-fg)] dark:text-[var(--orb-muted)] mb-2",children:[v?f(Lr,{className:"w-3.5 h-3.5 mr-1"}):f(Or,{className:"w-3.5 h-3.5 mr-1"}),f("div",{className:"w-3.5 h-3.5 mr-1.5"}),"\u8F93\u5165\u53C2\u6570"]}),v&&f("div",{className:"bg-[var(--orb-surface)] dark:bg-[var(--orb-canvas)] rounded border border-[var(--orb-border)] overflow-hidden",children:f("pre",{className:"p-3 text-xs font-mono text-[var(--orb-muted)] overflow-x-auto",children:JSON.stringify(n,null,2)})})]}),a&&g("div",{children:[g("button",{onClick:()=>x(!g$1),className:"flex items-center text-xs font-medium text-[var(--orb-muted)] hover:text-[var(--orb-fg)] dark:text-[var(--orb-muted)] mb-2",children:[g$1?f(Lr,{className:"w-3.5 h-3.5 mr-1"}):f(Or,{className:"w-3.5 h-3.5 mr-1"}),f(Ln,{className:"w-3.5 h-3.5 mr-1.5"}),"\u6267\u884C\u7ED3\u679C"]}),g$1&&f("div",{className:"bg-[var(--orb-surface)] dark:bg-[var(--orb-canvas)] rounded border border-[var(--orb-border)] overflow-hidden",children:f("pre",{className:"p-3 text-xs font-mono text-[var(--orb-muted)] overflow-x-auto",children:typeof a=="string"?a:JSON.stringify(a,null,2)})})]}),u&&f("div",{className:"mt-3 pt-3 border-t border-[var(--orb-border)] flex justify-end",children:f("button",{onClick:u,className:"px-4 py-1.5 text-sm font-medium text-[var(--orb-on-primary)] bg-[var(--orb-primary)] hover:bg-[var(--orb-p600)] rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-[var(--orb-primary)] focus:ring-offset-2 dark:focus:ring-offset-gray-900",children:f$1||"\u6267\u884C\u64CD\u4F5C"})})]})]})},Ji=cy;var py=({data:t})=>{if(!t)return null;let r=useMemo(()=>{let o=[],n=[],a="\u6570\u636E\u8868\u683C";return Array.isArray(t)?(o=t,o.length>0&&(n=Object.keys(o[0]).map(i=>({id:i,label:i.charAt(0).toUpperCase()+i.slice(1),numeric:typeof o[0][i]=="number"})))):typeof t=="object"&&(a=t.title||a,o=Array.isArray(t.rows)?t.rows:Array.isArray(t.data)?t.data:[],Array.isArray(t.columns)?n=t.columns.map(s=>({id:s.key||s.id,label:s.title||s.label,numeric:s.dataType==="number"||s.numeric})):o.length>0&&(n=Object.keys(o[0]).map(s=>({id:s,label:s,numeric:typeof o[0][s]=="number"})))),o=o.map((i,s)=>({...i,id:i.id||`row_${s}`})),{title:a,columns:n,rows:o}},[t]);return r.rows.length===0?f("div",{className:"w-full my-4 p-4 border border-dashed border-[var(--orb-border)] rounded text-center text-[var(--orb-muted)]",children:"\u6682\u65E0\u8868\u683C\u6570\u636E"}):f("div",{className:"w-full my-4",children:f(Qr,{appId:"agent-ui-table-card",title:r.title,columns:r.columns,rows:r.rows,count:r.rows.length,rowKey:"id",fitContainer:false,maxHeight:"500px",rowsPerPage:10,rowsPerPageOptions:[5,10,20,50]})})},es=py;var uy=({title:t,subtitle:r,data:o,type:n,config:a={}})=>{let i=()=>{switch(n){case "bar-chart-card":return f(Ts,{className:"w-4 h-4 text-[var(--orb-chart-1)]"});case "line-chart-card":return f(yc,{className:"w-4 h-4 text-[var(--orb-chart-positive)]"});case "pie-chart-card":return f(Pc,{className:"w-4 h-4 text-[var(--orb-chart-2)]"});case "combo-chart-card":return f(sc,{className:"w-4 h-4 text-[var(--orb-chart-5)]"});case "heatmap-chart-card":return f(bc,{className:"w-4 h-4 text-[var(--orb-chart-negative)]"});case "fishbone-chart-card":return f(hc,{className:"w-4 h-4 text-[var(--orb-chart-4)]"});case "waterfall-chart-card":return f(Ac,{className:"w-4 h-4 text-[var(--orb-chart-6)]"});case "google-map-card":return f(En,{className:"w-4 h-4 text-[var(--orb-status-primary)]"});case "amap-card":return f(Sc,{className:"w-4 h-4 text-[var(--orb-status-primary)]"});default:return f(Ts,{className:"w-4 h-4"})}},s=()=>{if(!o&&n!=="google-map-card"&&n!=="amap-card")return f("div",{className:"text-[var(--orb-muted)] text-sm p-4 text-center",children:"No data available"});try{switch(n){case "bar-chart-card":return f(Zn,{data:o,orientation:a.orientation||"horizontal",valueSuffix:a.valueSuffix||"",minHeight:a.minHeight});case "line-chart-card":return f(gp,{data:o,color:a.color,valueSuffix:a.valueSuffix||"",height:a.height});case "pie-chart-card":let l=o.reduce((p,u)=>p+(Number(u.value)||0),0),d=o.map(p=>({name:p.name,value:Number(p.value)||0,percent:typeof p.percent=="number"?p.percent:l>0?(Number(p.value)||0)/l*100:0}));return f(fi,{data:d,variant:a.variant||"donut",size:a.size,colors:a.colors});case "combo-chart-card":return f(fp,{data:o,barColor:a.barColor,lineColor:a.lineColor});case "heatmap-chart-card":return f(hp,{data:o});case "fishbone-chart-card":return f(bp,{branches:o,effect:a.effect||t||"Problem"});case "waterfall-chart-card":return f(vp,{data:o,height:a.height});case "google-map-card":return f(yp,{embedUrl:a.embedUrl||o&&o[0]?.embedUrl,apiKey:a.apiKey,query:a.query||o&&o[0]?.query||t,height:a.height});case "amap-card":return f(Cp,{embedUrl:a.embedUrl||o&&o[0]?.embedUrl,keyword:a.keyword||o&&o[0]?.keyword||t,height:a.height});default:return g("div",{className:"text-[var(--orb-muted)] text-sm p-4 text-center",children:["Unsupported chart type: ",n]})}}catch(l){return console.error("Error rendering chart:",l),f("div",{className:"text-[var(--orb-status-error)] text-sm p-4 text-center",children:"Error rendering chart"})}};return g("div",{className:"w-full overflow-hidden rounded-lg border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-sm transition-all hover:shadow-md",children:[g("div",{className:"flex items-center px-4 py-3 border-b border-[var(--orb-border)] bg-[color-mix(in_oklch,var(--orb-surface)_50%,transparent)]",children:[f("div",{className:"mr-2 flex-shrink-0",children:i()}),g("div",{className:"flex-1 min-w-0",children:[f("h3",{className:"text-sm font-semibold text-[var(--orb-fg)] truncate",children:t}),r&&f("p",{className:"text-xs text-[var(--orb-muted)] mt-0.5 truncate",children:r})]})]}),g("div",{className:"p-4",children:[f("div",{className:"overflow-x-auto",children:s()}),f("div",{className:"mt-3",children:g("details",{className:"text-xs text-[var(--orb-muted)]",children:[f("summary",{className:"cursor-pointer hover:text-[var(--orb-fg)] transition-colors select-none font-medium opacity-60 hover:opacity-100",children:"View Raw Data"}),f("pre",{className:"mt-2 p-2 bg-[var(--orb-surface)] dark:bg-[var(--orb-canvas)] rounded border border-[var(--orb-border)] overflow-x-auto max-h-40",children:JSON.stringify(o,null,2)})]})})]})]})},ts=uy;var is=["bar","column","line","pie","donut","scatter","bubble","list","metric","progress"],my={bar:"Bars",column:"Columns",line:"Line",pie:"Pie",donut:"Donut",scatter:"Scatter",bubble:"Bubble",list:"List",metric:"Metric",progress:"Progress"},ns=480,wn=214,Gt={top:18,right:16,bottom:38,left:30},jt=t=>typeof t=="number"&&Number.isFinite(t)?t:0,im=t=>t.toLocaleString(void 0,{maximumFractionDigits:1}),Gr=(t,r)=>`${t.id||t.label}-${r}`,sm=(t,r=13)=>t.length>r?`${t.slice(0,Math.max(1,r-1))}\u2026`:t,as=(t,r,o)=>Math.min(o,Math.max(r,t)),po=(t,r,o)=>t.color??o[r%o.length],uo=(t,r)=>r?{onMouseEnter:()=>r.onItemHoverStart?.(t),onMouseMove:()=>r.onItemHoverStart?.(t),onMouseLeave:()=>r.onItemHoverEnd?.(t),onContextMenu:o=>r.onItemContextMenu?.(o,t)}:{},lm=t=>{let r=t.map(a=>jt(a.value)),o=Math.min(0,...r),n=Math.max(0,...r);return {min:o,max:n===o?o+1:n,range:n===o?1:n-o}},gy=(t,r,o)=>{let n=ns-Gt.left-Gt.right,a=wn-Gt.top-Gt.bottom,{max:i,range:s}=lm(o),l=Gt.left+t*n/Math.max(o.length-1,1),d=Gt.top+(i-jt(r.value))/s*a,p=Gt.top+i/s*a;return {x:l,y:d,zeroY:p}},os=(t,r,o,n)=>{let a=(n-90)*Math.PI/180;return {x:t+o*Math.cos(a),y:r+o*Math.sin(a)}},fy=(t,r,o,n,a,i)=>{let s=os(t,r,o,i),l=os(t,r,o,a),d=i-a>180?1:0;if(n===0)return `M ${t} ${r} L ${s.x} ${s.y} A ${o} ${o} 0 ${d} 0 ${l.x} ${l.y} Z`;let p=os(t,r,n,i),u=os(t,r,n,a);return `M ${s.x} ${s.y} A ${o} ${o} 0 ${d} 0 ${l.x} ${l.y} L ${u.x} ${u.y} A ${n} ${n} 0 ${d} 1 ${p.x} ${p.y} Z`},hy=({children:t})=>g("div",{className:"orb-metric-empty",role:"status",children:[f("span",{className:"orb-metric-empty-mark","aria-hidden":"true",children:"\u2014"}),f(E,{variant:"body2",muted:true,children:t})]}),by=()=>g("div",{className:"orb-metric-loading",role:"status","aria-label":"Loading chart",children:[f("span",{className:"orb-metric-skeleton orb-metric-skeleton-wide"}),f("span",{className:"orb-metric-skeleton"}),f("span",{className:"orb-metric-skeleton orb-metric-skeleton-short"}),f("span",{className:"orb-metric-skeleton orb-metric-skeleton-wide"})]}),Ml=({item:t,onItemClick:r,interactions:o})=>{let n=()=>r?.(t);return {...r?{role:"button",tabIndex:0,onClick:n,onKeyDown:i=>{r&&(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),n());}}:{},...uo(t,o),style:{cursor:r||o?"pointer":"default"}}},vy=({loading:t,error:r,hasData:o,emptyState:n,children:a})=>t?f(by,{}):r?f("div",{className:"orb-metric-error",role:"alert",children:r}):o?f(e,{children:a}):f(hy,{children:n??"No data for the current selection."}),yy=({data:t,activeId:r,onItemClick:o,interactions:n,valueFormatter:a,colors:i})=>{let s=Math.max(...t.map(l=>Math.abs(jt(l.value))),1);return f("div",{className:"orb-metric-bars",role:"list","aria-label":"Chart data",children:t.map((l,d)=>{let p=jt(l.value),u=`${as(Math.abs(p)/s*100,0,100)}%`,f$1=r===l.id,h=g(e,{children:[f("span",{className:"orb-metric-bar-label",title:l.label,children:l.label}),f("span",{className:"orb-metric-bar-track","aria-hidden":"true",children:f("span",{className:`orb-metric-bar-fill${f$1?" is-active":""}`,style:{width:u,backgroundColor:po(l,d,i)}})}),f("span",{className:"orb-metric-bar-value",children:a(p)})]});return o?f("button",{type:"button",className:`orb-metric-bar-row${f$1?" is-active":""}`,onClick:()=>o(l),title:`${l.label}: ${a(p)}`,"aria-pressed":f$1,...uo(l,n),children:h},Gr(l,d)):f("div",{className:`orb-metric-bar-row${f$1?" is-active":""}`,role:"listitem",...uo(l,n),children:h},Gr(l,d))})})},Cy=({data:t,activeId:r,onItemClick:o,interactions:n,valueFormatter:a,colors:i})=>{let s=Math.max(t.reduce((l,d)=>l+Math.max(jt(d.value),0),0),1);return f("div",{className:"orb-metric-progress",role:"list","aria-label":"Chart data",children:t.map((l,d)=>{let p=Math.max(jt(l.value),0),u=as(p/s*100,0,100),f$1=r===l.id,h=g(e,{children:[g("span",{className:"orb-metric-progress-heading",children:[f("span",{title:l.label,children:l.label}),f("strong",{children:a(p)})]}),f("span",{className:"orb-metric-bar-track","aria-hidden":"true",children:f("span",{className:"orb-metric-bar-fill",style:{width:`${u}%`,backgroundColor:po(l,d,i)}})})]});return o?f("button",{type:"button",className:`orb-metric-progress-row${f$1?" is-active":""}`,onClick:()=>o(l),"aria-pressed":f$1,...uo(l,n),children:h},Gr(l,d)):f("div",{className:`orb-metric-progress-row${f$1?" is-active":""}`,role:"listitem",...uo(l,n),children:h},Gr(l,d))})})},xy=({type:t,data:r,activeId:o,onItemClick:n,interactions:a,valueFormatter:i,secondaryValueFormatter:s,colors:l,ariaLabel:d})=>{let{min:p,max:u,range:f$1}=lm(r),h=ns-Gt.left-Gt.right,m=wn-Gt.top-Gt.bottom,v=Gt.top+u/f$1*m,y=Math.max(1,Math.ceil(r.length/6)),g$1=r.map((C,P)=>gy(P,C,r)),x=g$1.map(C=>`${C.x},${C.y}`).join(" "),b=Math.max(...r.map(C=>Math.max(jt(C.secondaryValue),0)),1);return f("div",{className:"orb-metric-svg-wrap",children:g("svg",{className:"orb-metric-svg",viewBox:`0 0 ${ns} ${wn}`,role:"img","aria-label":d,children:[f("line",{className:"orb-metric-axis",x1:Gt.left,y1:v,x2:ns-Gt.right,y2:v}),f("line",{className:"orb-metric-grid",x1:Gt.left,y1:Gt.top,x2:Gt.left,y2:wn-Gt.bottom}),t==="column"&&r.map((C,P)=>{let S=g$1[P],k=jt(C.value),I=Math.max(Math.abs(S.y-v),k===0?2:0),w=S.x-Math.min(18,h/Math.max(r.length*2,1)),A=Math.min(36,Math.max(10,h/Math.max(r.length*1.8,1))),R=o===C.id;return g("g",{...Ml({item:C,onItemClick:n,interactions:a}),"aria-label":`${C.label}: ${i(k)}`,children:[f("rect",{className:`orb-metric-column${R?" is-active":""}`,x:w,y:Math.min(S.y,v),width:A,height:I,rx:4,fill:po(C,P,l)}),g("title",{children:[C.label,": ",i(k)]}),(P%y===0||r.length<=6)&&f("text",{className:"orb-metric-svg-label",x:S.x,y:wn-14,textAnchor:"middle",children:sm(C.label)})]},Gr(C,P))}),(t==="line"||t==="scatter"||t==="bubble")&&g(e,{children:[t==="line"&&f("polyline",{className:"orb-metric-line",fill:"none",points:x,stroke:l[0]}),r.map((C,P)=>{let S=g$1[P],k=o===C.id,I=t==="bubble"?7+Math.max(jt(C.secondaryValue),0)/b*12:t==="scatter"?5:4;return g("g",{...Ml({item:C,onItemClick:n,interactions:a}),"aria-label":`${C.label}: ${i(jt(C.value))}`,children:[t==="line"&&f("circle",{className:`orb-metric-point${k?" is-active":""}`,cx:S.x,cy:S.y,r:k?6:4,fill:po(C,P,l)}),t!=="line"&&f("circle",{className:`orb-metric-point${k?" is-active":""}`,cx:S.x,cy:S.y,r:I,fill:po(C,P,l),opacity:t==="bubble"?.82:.9}),g("title",{children:[C.label,": ",i(jt(C.value)),t==="bubble"&&C.secondaryValue!==void 0?` \xB7 Size: ${s(jt(C.secondaryValue))}`:""]}),(P%y===0||r.length<=6)&&f("text",{className:"orb-metric-svg-label",x:S.x,y:Math.max(Gt.top+8,S.y-I-7),textAnchor:"middle",children:sm(C.label)})]},Gr(C,P))})]}),f("text",{className:"orb-metric-axis-label",x:Gt.left,y:Gt.top-5,children:i(u)}),p<0&&f("text",{className:"orb-metric-axis-label",x:Gt.left,y:wn-Gt.bottom+14,children:i(p)})]})})},Sy=({type:t,data:r,activeId:o,onItemClick:n,interactions:a,valueFormatter:i,colors:s,ariaLabel:l})=>{let d=r.map(m=>({...m,value:Math.max(jt(m.value),0)})),p=d.reduce((m,v)=>m+v.value,0),u=72,f$1=92,h=0;return g("div",{className:"orb-metric-circular",children:[g("svg",{className:"orb-metric-donut",viewBox:"0 0 184 184",role:"img","aria-label":l,children:[d.map((m,v)=>{let y=m.value/p*360,g$1=h;h+=y;let x=o===m.id,b=y>=359.9?void 0:fy(f$1,f$1,u,t==="donut"?46:0,g$1,g$1+y),C=Ml({item:m,onItemClick:n,interactions:a});return b?f("path",{className:`orb-metric-slice${x?" is-active":""}`,d:b,fill:po(m,v,s),...C,children:g("title",{children:[m.label,": ",i(m.value)," (",(m.value/p*100).toFixed(1),"%)"]})},Gr(m,v)):f("circle",{className:`orb-metric-slice${x?" is-active":""}`,cx:f$1,cy:f$1,r:t==="donut"?60:u,fill:t==="donut"?"none":po(m,v,s),stroke:t==="donut"?po(m,v,s):void 0,strokeWidth:28,...C,children:g("title",{children:[m.label,": ",i(m.value)," (100%)"]})},Gr(m,v))}),t==="donut"&&f("circle",{cx:f$1,cy:f$1,r:44,fill:"var(--orb-surface)"}),t==="donut"&&f("text",{className:"orb-metric-donut-total",x:f$1,y:f$1+5,textAnchor:"middle",children:i(p)})]}),f("div",{className:"orb-metric-legend",role:"list","aria-label":"Chart legend",children:d.map((m,v)=>{let y=o===m.id;return g("button",{type:"button",className:`orb-metric-legend-item${y?" is-active":""}`,onClick:()=>n?.(m),disabled:!n,title:m.label,...uo(m,a),children:[f("span",{className:"orb-metric-legend-dot",style:{backgroundColor:po(m,v,s)}}),f("span",{className:"orb-metric-legend-label",children:m.label}),g("strong",{children:[(m.value/p*100).toFixed(0),"%"]})]},Gr(m,v))})})]})},wy=({data:t,activeId:r,onItemClick:o,interactions:n,valueFormatter:a,secondaryValueFormatter:i})=>f("div",{className:"orb-metric-list",role:"list","aria-label":"Chart data",children:t.map((s,l)=>{let d=g(e,{children:[f("span",{className:"orb-metric-list-label",title:s.label,children:s.label}),f("span",{className:"orb-metric-list-value",children:a(jt(s.value))}),s.secondaryValue!==void 0&&f("span",{className:"orb-metric-list-secondary",children:i(jt(s.secondaryValue))})]});return o?f("button",{type:"button",className:`orb-metric-list-row${r===s.id?" is-active":""}`,onClick:()=>o(s),"aria-pressed":r===s.id,...uo(s,n),children:d},Gr(s,l)):f("div",{className:`orb-metric-list-row${r===s.id?" is-active":""}`,role:"listitem",...uo(s,n),children:d},Gr(s,l))})}),ss=({title:t,subtitle:r,data:o=[],chartType:n="bar",onChartTypeChange:a,onItemClick:i,onDataDetails:s,activeId:l,valueFormatter:d=im,secondaryValueFormatter:p=im,valueLabel:u,secondaryValueLabel:f$1,emptyState:h,loading:m=false,error:v,maxItems:y=8,showChartTypeControl:g$1=true,showDataDetails:x=true,dataRevealDelayMs:b=1e3,chartTypeOptions:C,chartTypeLabels:P,footer:S,ariaLabel:k,className:I,style:w,sx:A})=>{let R=Ps(),T=useRef(null),N=useRef(null),[D,L]=useState(n),[B,X]=useState(false),[H,K]=useState(null),[W,G]=useState(null);useEffect(()=>L(n),[n]);let z=useCallback(()=>{N.current!==null&&(window.clearTimeout(N.current),N.current=null);},[]);useEffect(()=>z,[z]),useEffect(()=>{if(!W)return;let _=Oe=>{let ve=Oe.target;ve instanceof HTMLElement&&ve.closest(".orb-metric-context-menu")||G(null);};return document.addEventListener("pointerdown",_),()=>document.removeEventListener("pointerdown",_)},[W]);let O=D,Y=useMemo(()=>[R.chart1,R.chart2,R.chart3,R.chart4,R.chart5,R.chart6],[R]),Q=useMemo(()=>B?o:o.slice(0,Math.max(1,y)),[o,y,B]),me=Math.max(0,o.length-Q.length),ie=Q.some(_=>jt(_.value)>0),se=Q.length>0&&(O!=="pie"&&O!=="donut"?true:ie),fe=(C??[O,"bar","column","line","pie","donut","scatter","bubble","list"]).filter((_,Oe,ve)=>is.includes(_)&&ve.indexOf(_)===Oe),Ge={...my,...P},Re=Q[0],ke=k??`${t} ${Ge[O]} chart`,ze=_=>{L(_),a?.(_);},Pe=useCallback((_,Oe)=>{K({item:_,source:Oe}),G(null),s?.(_,Oe);},[s]),Ce=useCallback(_=>{z(),!(!x||W)&&(N.current=window.setTimeout(()=>{Pe(_,"hover"),N.current=null;},Math.max(0,b)));},[z,W,b,Pe,x]),Ve=useCallback(()=>{z();},[z]),rt=useCallback((_,Oe)=>{if(!x)return;_.preventDefault(),z();let ve=T.current?.getBoundingClientRect(),Ee=ve?as(_.clientX-ve.left,8,Math.max(8,ve.width-164)):8,it=ve?as(_.clientY-ve.top,8,Math.max(8,ve.height-72)):8;G({item:Oe,left:Ee,top:it});},[z,x]),at=x?{onItemHoverStart:Ce,onItemHoverEnd:Ve,onItemContextMenu:rt}:void 0,Ye=O==="metric"?g("div",{className:"orb-metric-kpi",role:i?"button":"img",tabIndex:i?0:void 0,onClick:()=>Re&&i?.(Re),onKeyDown:_=>{Re&&i&&(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),i(Re));},"aria-label":ke,...Re?uo(Re,at):{},children:[f("span",{className:"orb-metric-kpi-label",children:Re?.label??u??"Value"}),f("strong",{children:Re?d(jt(Re.value)):"\u2014"}),Re?.secondaryValue!==void 0&&g("span",{className:"orb-metric-kpi-secondary",children:[f$1??"Compared with"," \xB7 ",p(jt(Re.secondaryValue))]})]}):O==="progress"?f(Cy,{data:Q,activeId:l,onItemClick:i,interactions:at,valueFormatter:d,colors:Y}):O==="bar"?f(yy,{data:Q,activeId:l,onItemClick:i,interactions:at,valueFormatter:d,colors:Y}):O==="list"?f(wy,{data:Q,activeId:l,onItemClick:i,interactions:at,valueFormatter:d,secondaryValueFormatter:p}):O==="pie"||O==="donut"?f(Sy,{type:O,data:Q,activeId:l,onItemClick:i,interactions:at,valueFormatter:d,colors:Y,ariaLabel:ke}):f(xy,{type:O,data:Q,activeId:l,onItemClick:i,interactions:at,valueFormatter:d,secondaryValueFormatter:p,colors:Y,ariaLabel:ke});return g("div",{ref:T,className:"orb-metric-chart-shell",onMouseLeave:()=>{z(),H?.source==="hover"&&K(null);},children:[g(Ae,{elevation:1,variant:"outlined",className:`orb-metric-chart-card ${I??""}`,style:w,sx:A,children:[g("div",{className:"orb-metric-chart-header",children:[g("div",{className:"orb-metric-chart-heading",children:[f(E,{variant:"subtitle1",component:"h3",noWrap:true,title:t,children:t}),r&&f(E,{variant:"caption",muted:true,component:"div",noWrap:true,children:r})]}),g$1&&fe.length>1&&f(Vt,{"aria-label":`${t} chart type`,className:"orb-metric-chart-select",value:O,options:fe.map(_=>({value:_,label:Ge[_]})),onChange:_=>ze(_.target.value),minWidth:108,fullWidth:false,size:"small"})]}),g("div",{className:"orb-metric-chart-body",children:[f(vy,{loading:m,error:v,hasData:se,emptyState:h,children:Ye}),me>0&&!m&&!v&&f("button",{type:"button",className:"orb-metric-more",onClick:()=>X(_=>!_),children:B?"Show fewer":`Show all ${o.length}`})]}),S&&f("div",{className:"orb-metric-chart-footer",children:S})]}),W&&g("div",{className:"orb-metric-context-menu",role:"menu",onMouseEnter:z,onKeyDown:_=>{_.key==="Escape"&&G(null);},style:{left:W.left,top:W.top},onPointerDown:_=>_.stopPropagation(),children:[f("div",{className:"orb-metric-context-label",children:W.item.label}),f("button",{type:"button",role:"menuitem",onClick:_=>{_.preventDefault(),_.stopPropagation(),Pe(W.item,"contextmenu");},children:"Show data"})]}),H&&g("div",{className:"orb-metric-data-details",role:"dialog","aria-label":`${H.item.label} data details`,onPointerDown:_=>_.stopPropagation(),children:[g("div",{className:"orb-metric-data-details-header",children:[f("strong",{children:H.item.label}),f("button",{type:"button","aria-label":"Close data details",onClick:()=>K(null),children:"\xD7"})]}),g("div",{className:"orb-metric-data-details-row",children:[f("span",{children:u??"Value"}),f("strong",{children:d(jt(H.item.value))})]}),H.item.secondaryValue!==void 0&&g("div",{className:"orb-metric-data-details-row",children:[f("span",{children:f$1??"Secondary value"}),f("strong",{children:p(jt(H.item.secondaryValue))})]}),f("span",{className:"orb-metric-data-details-hint",children:H.source==="hover"?`Shown after ${Math.max(0,b)/1e3} seconds of stillness`:"Shown from the context menu"})]})]})};ss.displayName="CMetricChartCard";var ky=({messageId:t,cardHooks:r,valueSuffix:o,secondaryValueSuffix:n,...a})=>{let i=(l,d)=>{r?.onCardEvent?.({messageId:t,cardType:"metric-chart-card",action:l,title:a.title,payload:d,rawData:a});},s=(l,d)=>`${l.toLocaleString()}${d??""}`;return f(ss,{...a,valueFormatter:l=>s(l,o),secondaryValueFormatter:l=>s(l,n),onChartTypeChange:l=>i("action",{chartType:l}),onItemClick:l=>i("action",{item:l}),onDataDetails:(l,d)=>i("show-data",{item:l,source:d})})},ls=ky;var Py=({type:t,manifest:r})=>g("div",{className:"w-full overflow-hidden rounded-lg border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-sm transition-all hover:shadow-md",children:[g("div",{className:"flex items-center px-4 py-3 border-b border-[var(--orb-border)] bg-[var(--orb-p50)]",children:[f("div",{className:"w-4 h-4 mr-2 text-[var(--orb-status-primary)]"}),g("h3",{className:"text-sm font-semibold text-[var(--orb-fg)]",children:["SAP Card: ",t]})]}),f("div",{className:"p-4",children:f("div",{className:"bg-[var(--orb-surface)] dark:bg-[var(--orb-canvas)] p-3 rounded border border-[var(--orb-border)] overflow-x-auto",children:f("pre",{className:"text-xs font-mono text-[var(--orb-muted)] whitespace-pre-wrap",children:JSON.stringify(r,null,2)})})})]}),cs=Py;var Ty=t=>Array.isArray(t)?t.flatMap((r,o)=>{if(!r||typeof r!="object")return [];let n=r,a=String(n.label??n.name??n.id??`Item ${o+1}`),i=Number(n.value),s=Number.isFinite(i)?i:0,l=n.secondaryValue===void 0?void 0:Number(n.secondaryValue);return [{id:String(n.id??n.name??n.label??o),label:a,value:s,...l!==void 0&&Number.isFinite(l)?{secondaryValue:l}:{},...typeof n.color=="string"?{color:n.color}:{}}]}):[],ds=t=>{let r;try{r=JSON.parse(t);}catch{return null}if(r&&typeof r=="object"){if(r.type==="metric-chart-card"&&r.title&&Array.isArray(r.data)){let o=is.includes(r.chartType)?r.chartType:"bar";return {...r,type:"metric-chart-card",chartType:o,data:Ty(r.data)}}if((r.type==="bar-chart-card"||r.type==="line-chart-card"||r.type==="pie-chart-card"||r.type==="combo-chart-card"||r.type==="heatmap-chart-card"||r.type==="fishbone-chart-card"||r.type==="waterfall-chart-card"||r.type==="google-map-card"||r.type==="amap-card")&&r.title||(r.type==="sap-analytical-card"||r.type==="sap-list-card"||r.type==="sap-object-card"||r.type==="sap-component-card")&&r.manifest||r.type==="error-card"||r.type==="warning-card"||r.type==="suggestions-card"||r.type==="tool-result-card"||r.type==="table"&&r.data)return r}return null};var Ey=({content:t,theme:r,size:o="base",className:n,enableCodeHighlight:a=true,enableMermaid:i=true,messageId:s,cardHooks:l})=>{let d=useRef(l);d.current=l;let p=!!l?.onCardEvent,u=useMemo(()=>p?{onCardEvent:y=>d.current?.onCardEvent?.(y)}:void 0,[p]),f$1=useMemo(()=>t?t.replace(/<think>([\s\S]*?)<\/think>/g,(y,g)=>`<div data-component="thinkbox" data-think-content="${encodeURIComponent(g.trim())}"></div>`):"",[t]),h=(y,g,x,b,C)=>{u?.onCardEvent?.({messageId:s,cardType:y,action:g,title:x,payload:b,rawData:C});},m=(y,g,x,b,C,P)=>{if(!(!C&&!u?.onCardEvent))return (...S)=>{let k=C?.(...S),I=P?P(...S):void 0;return h(y,g,x,I,b),k}},v=useMemo(()=>({div(y){let{"data-component":g,"data-think-content":x,...b}=y;return g==="thinkbox"&&x?f(Zu,{content:decodeURIComponent(x),theme:r,size:o,defaultExpanded:false}):f("div",{...b})},table({children:y}){return f("div",{className:"my-4 w-full overflow-x-auto rounded-lg border border-[var(--orb-border)]",children:f("table",{className:"w-full min-w-[520px] border-collapse text-sm",children:y})})},thead({children:y}){return f("thead",{className:"bg-[color-mix(in_oklch,var(--orb-surface)_60%,transparent)]",children:y})},tbody({children:y}){return f("tbody",{className:"bg-[var(--orb-canvas)] dark:bg-[var(--orb-canvas)]",children:y})},tr({children:y}){return f("tr",{className:"border-b border-[var(--orb-border)] last:border-b-0",children:y})},th({children:y,align:g}){return f("th",{className:`px-3 py-2 font-semibold text-[var(--orb-fg)] ${g==="center"?"text-center":g==="right"?"text-right":"text-left"}`,children:y})},td({children:y,align:g}){return f("td",{className:`px-3 py-2 text-[var(--orb-fg)] align-top ${g==="center"?"text-center":g==="right"?"text-right":"text-left"}`,children:y})},code({className:y,children:g,...x}){let b=/language-([\w-]+)/.exec(y||""),C=b?b[1]:"",P=String(g);if(!b&&!P.includes(`
17
+ `))return f("code",{children:g});let k=P.replace(/\n$/,"");if(i&&C==="mermaid")return f(em,{content:k});if(C==="json"){let I=ds(k);if(I)switch(I.type){case "table":return f(es,{data:I.data});case "metric-chart-card":return f(ls,{...I,messageId:s,cardHooks:u});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 f(ts,{...I});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return f(cs,{...I});case "error-card":{let w=I;return f(Zi,{...w,onClose:m("error-card","close",w.title,w,w.onClose),onRetry:m("error-card","retry",w.title,w,w.onRetry)})}case "warning-card":{let w=I,A=w.onConfirm?m("warning-card","confirm",w.title,w,w.onConfirm):w.actionText&&u?.onCardEvent?m("warning-card","confirm",w.title,w):void 0;return f(Qi,{...w,onClose:m("warning-card","close",w.title,w,w.onClose),onConfirm:A})}case "suggestions-card":{let w=I;return f(ji,{...w,onClose:m("suggestions-card","close",w.title,w,w.onClose),onSuggestionClick:m("suggestions-card","suggestion-click",w.title,w,w.onSuggestionClick,A=>({suggestion:A}))})}case "tool-result-card":{let w=I;return f(Ji,{...w,onClose:m("tool-result-card","close",w.title,w,w.onClose),onAction:m("tool-result-card","action",w.title,w,w.onAction)})}}}return a?f(Qu,{content:k,language:C,className:"not-prose"}):f("code",{className:y,...x,children:g})}}),[r,o,i,a,u,s]);return f("div",{className:ct("markdown-body max-w-none",n),children:f(My,{remarkPlugins:[Ry,Dy],rehypePlugins:[Ny,Ay],components:v,children:f$1})})},kn=Ey;var Ly=({content:t,messageId:r,cardHooks:o})=>{let n=(s,l,d,p,u)=>{o?.onCardEvent?.({messageId:r,cardType:s,action:l,title:d,payload:p,rawData:u});},a=(s,l,d,p,u,f)=>{if(!(!u&&!o?.onCardEvent))return (...h)=>{let m=u?.(...h),v=f?f(...h):void 0;return n(s,l,d,v,p),m}},i=ds(t);if(i)switch(i.type){case "table":return f(es,{data:i.data});case "metric-chart-card":return f(ls,{...i,messageId:r,cardHooks:o});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 f(ts,{...i});case "sap-analytical-card":case "sap-list-card":case "sap-object-card":case "sap-component-card":return f(cs,{...i});case "error-card":{let s=i;return f(Zi,{...s,onClose:a("error-card","close",s.title,s,s.onClose),onRetry:a("error-card","retry",s.title,s,s.onRetry)})}case "warning-card":{let s=i,l=s.onConfirm?a("warning-card","confirm",s.title,s,s.onConfirm):s.actionText&&o?.onCardEvent?a("warning-card","confirm",s.title,s):void 0;return f(Qi,{...s,onClose:a("warning-card","close",s.title,s,s.onClose),onConfirm:l})}case "suggestions-card":{let s=i;return f(ji,{...s,onClose:a("suggestions-card","close",s.title,s,s.onClose),onSuggestionClick:a("suggestions-card","suggestion-click",s.title,s,s.onSuggestionClick,l=>({suggestion:l}))})}case "tool-result-card":{let s=i;return f(Ji,{...s,onClose:a("tool-result-card","close",s.title,s,s.onClose),onAction:a("tool-result-card","action",s.title,s,s.onAction)})}}return f("div",{className:"dynamic-card-fallback",children:f(kn,{content:t,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:r,cardHooks:o})})},cm=Ly;var Dl=class{static analyze(r){if(!r.trim())return {blocks:[],hasComplexContent:false,overallType:"simple"};let n=/```json\s*\{\s*"type":\s*"[^"]+"/g.test(r),a=/<[^>]+>[\s\S]*?<\/[^>]+>/.test(r),i=r.includes("NQ#")||r.includes("data-component");return n||a||i?{blocks:[{type:"mixed",content:r,startIndex:0,endIndex:r.length}],hasComplexContent:true,overallType:"complex"}:{blocks:[{type:"markdown",content:r,startIndex:0,endIndex:r.length}],hasComplexContent:false,overallType:"simple"}}},Fy=({content:t,className:r="",messageId:o,cardHooks:n})=>{let a=Qt__default.useMemo(()=>Dl.analyze(t),[t]);return f("div",{className:`universal-content-renderer ${r}`,children:a.blocks.map((i,s)=>i.type==="mixed"||i.type==="json-card"?f(cm,{content:i.content,messageId:o,cardHooks:n},`block-${s}`):f(kn,{content:i.content,enableCodeHighlight:true,enableMath:true,enableMermaid:true,messageId:o,cardHooks:n},`block-${s}`))})},ps=Fy;var By=({content:t,isStreaming:r=true,onComplete:o,className:n="",streamIntervalMs:a=24,streamChunkSize:i=3,messageId:s,cardHooks:l})=>{let[d,p]=useState(r?0:t.length),[u,f$1]=useState(!r);useEffect(()=>{if(r){p(0),f$1(false);return}p(t.length),f$1(true);},[t,r]),useEffect(()=>{if(!r||u)return;if(d>=t.length){f$1(true),o?.();return}let g=window.setTimeout(()=>{p(x=>Math.min(x+i,t.length));},a);return ()=>{window.clearTimeout(g);}},[t.length,u,r,o,i,a,d]);let h=()=>{r&&!u&&(p(t.length),f$1(true),o?.());},m=r?t.slice(0,d):t,v=r&&!u,y=r&&!u;return g("div",{className:`streaming-markdown ${n}`,onClick:h,style:{cursor:r?"pointer":"default"},children:[g("div",{className:"relative",children:[f(ps,{content:m,messageId:s,cardHooks:l}),v&&f("span",{className:"inline-block w-[2px] h-[13px] ml-0.5 animate-pulse",style:{verticalAlign:"text-bottom",backgroundColor:"var(--orb-primary, #154194)"}})]}),y&&f("div",{className:"streaming-hint",style:{fontSize:"9px",color:"var(--orb-muted)",marginTop:"8px",fontStyle:"italic",opacity:.7},children:"\u70B9\u51FB\u6B64\u5904\u663E\u793A\u5B8C\u6574\u5185\u5BB9"})]})},um=By;var mm=({buttons:t,className:r})=>{let o=n=>{switch(n){case "copy":return f(fo,{size:14});case "refresh":return f(Da,{size:14});case "volume":return f(Lc,{size:14});case "like":return f(Dc,{size:14});case "dislike":return f(Rc,{size:14});default:return null}};return f("div",{className:ct("flex items-center gap-1",r),children:t.map((n,a)=>f("button",{onClick:n.onClick,disabled:n.disabled,"aria-busy":n.loading||void 0,className:ct("p-1.5 rounded-md transition-colors","text-[var(--orb-muted)] hover:text-[var(--orb-fg)] dark:text-[var(--orb-muted)] dark:hover:text-[var(--orb-fg)]","hover:bg-[var(--orb-hover)]","disabled:opacity-50 disabled:cursor-not-allowed",n.active&&"text-[var(--orb-primary)] bg-[var(--orb-p50)]",n.type==="refresh"&&n.loading&&"animate-spin"),title:n.type,type:"button",children:o(n.type)},`${n.type}-${a}`))})};var us=({message:t,onStreamingComplete:r,assistantActions:o,streamIntervalMs:n,streamChunkSize:a,cardHooks:i})=>{let s={lineHeight:1.55,fontSize:13,fontWeight:300,fontFamily:'var(--orb-font, "Montserrat", system-ui, sans-serif)',color:"var(--orb-fg, #555555)",borderRadius:"var(--orb-r, 10px)",padding:"10px 14px"},l={marginTop:6,fontSize:11,color:"var(--orb-muted, #8c8c8c)"};if(t.type==="assistant"){let d=!!(o?.isResponding||t.isStreaming);return f("div",{className:"mb-4 flex justify-start",children:g("div",{className:"mr-auto w-full",style:{...s,background:"var(--orb-surface, #f5f5f5)",border:"1px solid var(--orb-border, #dbdbdb)"},children:[f(um,{content:t.content,isStreaming:t.isStreaming??false,onComplete:r,streamIntervalMs:n,streamChunkSize:a,messageId:t.id,cardHooks:i}),t.content&&o?.isLatestAssistant&&f("div",{className:"mt-3 flex flex-row justify-start gap-2 border-t pt-2",style:{borderColor:"var(--orb-border, #dbdbdb)"},children:f(mm,{buttons:[{type:"refresh",onClick:()=>{o?.onRegenerate?.();},disabled:d||!o?.onRegenerate,loading:d},{type:"copy",onClick:()=>navigator.clipboard.writeText(t.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"})}),f("div",{style:l,children:t.timestamp.toLocaleTimeString()})]})})}return f("div",{className:"mb-4 flex justify-end",children:g("div",{className:"ml-auto max-w-[80%]",style:{...s,background:"var(--orb-p50, #eef2f9)",border:"1px solid var(--orb-p100, #e4e9f5)"},children:[f("div",{className:"whitespace-pre-wrap",children:t.content}),f("div",{style:l,children:t.timestamp.toLocaleTimeString()})]})})};var gm=({onTextUpdate:t,onComplete:r,onCancel:o,disabled:n,className:a})=>{let{isRecording:i,startRecording:s,stopRecording:l}=vn({onTextUpdate:t,onComplete:p=>{r?.(p);},onError:p=>{console.error("Voice input error:",p),o?.();}});return f("button",{onClick:async()=>{i?l():await s();},disabled:n,className:ct("transition-all duration-200 flex items-center justify-center rounded-full",i?"bg-[color-mix(in_oklch,var(--orb-status-error)_12%,transparent)] text-[var(--orb-status-error)] hover:bg-[color-mix(in_oklch,var(--orb-status-error)_20%,transparent)] animate-pulse":"bg-transparent hover:bg-[var(--orb-hover)] text-[var(--orb-muted)] active:scale-95",n&&"opacity-50 cursor-not-allowed",a),title:i?"Stop recording":"Start recording",type:"button",children:i?f(Vd,{size:16}):f(Wd,{size:16})})};var Jt={container:"w-full max-w-4xl mx-auto",inputContainer:ct("w-full flex flex-col border border-[var(--orb-border,#dbdbdb)] bg-[var(--orb-canvas,#ffffff)] transition-colors duration-200","orb-agent-input","focus-within:border-[var(--orb-primary,#154194)] focus-within:ring-1 focus-within:ring-[var(--orb-focus-ring,#e4e9f5)]"),dragActive:"border-[var(--orb-primary,#154194)] bg-[var(--orb-p50,#eef2f9)]",textareaWrapper:"flex-1 relative flex items-center",textarea:ct("w-full outline-none appearance-none resize-none bg-transparent border-none text-sm font-normal py-3 px-3","placeholder:text-[var(--orb-muted,#8c8c8c)] placeholder:font-normal","text-[var(--orb-fg,#555555)] selection:bg-[var(--orb-p100,#e4e9f5)]","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-[var(--orb-border)]"),filePreviewArea:"px-4 pt-3 pb-1 flex flex-wrap gap-2",fileTag:ct("flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs font-medium","bg-[var(--orb-surface,#f5f5f5)] text-[var(--orb-fg,#555555)]","border border-[var(--orb-border,#dbdbdb)]","transition-all hover:bg-[var(--orb-hover,#eef2f9)]"),buttonBase:"flex items-center justify-center transition-all duration-200 rounded-full",buttonSmall:"h-[38px] w-[38px] shrink-0 md:h-8 md:w-8",buttonNormal:ct("bg-transparent hover:bg-[var(--orb-hover,#eef2f9)] text-[var(--orb-muted,#8c8c8c)] hover:text-[var(--orb-fg,#555555)]","cursor-pointer active:scale-95"),sendButton:ct("cursor-pointer bg-[var(--orb-primary,#154194)] hover:bg-[var(--orb-p600,#0e2d63)] text-[var(--orb-on-primary)] shadow-none active:scale-95"),sendButtonDisabled:ct("cursor-not-allowed opacity-40 bg-[var(--orb-disabled-bg,#f5f5f5)] text-[var(--orb-disabled-fg,#8c8c8c)]"),stopButton:ct("cursor-pointer bg-[var(--orb-err,#c43f02)] hover:opacity-90 text-[var(--orb-on-primary)] shadow-none active:scale-95")},zy={padding:0,lineHeight:"1.5",border:"none !important",boxShadow:"none !important",backgroundColor:"transparent",height:"auto",fontFeatureSettings:'"liga" 1, "kern" 1',WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},Vy=({enabled:t,onClick:r})=>f("button",{className:ct(Jt.buttonBase,Jt.buttonSmall,Jt.buttonNormal),onClick:r,disabled:!t,"aria-label":"Upload file",type:"button",children:f(vd,{size:16})}),Wy=()=>g("button",{className:ct(Jt.buttonBase,"h-[38px] gap-1 rounded-full px-2.5 md:h-8 md:px-2",Jt.buttonNormal),"aria-label":"Tools",type:"button",children:[f(Ed,{size:15}),f("span",{className:"text-xs font-medium",children:"Tools"})]}),$y=({canSend:t,isResponding:r,onSend:o,onStop:n})=>r?f("button",{className:ct(Jt.buttonBase,Jt.buttonSmall,Jt.stopButton),onClick:n,"aria-label":"Stop generating",type:"button",children:f(Zd,{size:15})}):f("button",{className:ct(Jt.buttonBase,Jt.buttonSmall,t?Jt.sendButton:Jt.sendButtonDisabled),onClick:o,disabled:!t,"aria-label":"Send message",type:"button",children:f(Ud,{size:16,className:t?"text-[var(--orb-on-primary,#ffffff)]":"text-[var(--orb-disabled-fg,#8c8c8c)]"})}),Nl=({onSend:t,onStop:r,isResponding:o=false,placeholder:n,getText:a})=>{let[i,s]=useState(""),[l,d]=useState([]),[p,u]=useState(false),[f$1,h]=useState(false),m=useRef(null),v=n||(a?a("00019","Type a message..."):"Type a message..."),y=(i.trim().length>0||l.length>0)&&!o,g$1={enabled:true},x=useCallback(B=>{s(B.target.value),B.target.style.height="auto",B.target.style.height=`${Math.min(B.target.scrollHeight,200)}px`;},[]),b=useCallback(B=>{if(B.target.files&&B.target.files.length>0){let X=Array.from(B.target.files);d(H=>{let K=X.filter(G=>H.some(z=>z.name===G.name&&z.size===G.size));K.length>0&&console.warn("Duplicate files ignored:",K.map(G=>G.name));let W=X.filter(G=>!H.some(z=>z.name===G.name&&z.size===G.size));return [...H,...W]}),m.current&&(m.current.value="");}},[]),C=useCallback(B=>{d(X=>X.filter((H,K)=>K!==B));},[]),P=useCallback(()=>{m.current?.click();},[]),S=useCallback(async()=>{if(!y)return;let B=i,X=[...l];s(""),d([]),m.current&&(m.current.value="");try{await t(B,X);}catch(H){console.error("Failed to send message:",H),s(B),d(X);}},[i,y,t,l]),k=useCallback(B=>{B.key==="Enter"&&!B.shiftKey&&!p&&(B.preventDefault(),S());},[S,p]),I=useCallback(()=>{u(true);},[]),w=useCallback(()=>{u(false);},[]),A=useCallback(B=>{s(B);},[]),R=useCallback(B=>{s(B);},[]),T=useCallback(()=>{},[]),N=useCallback(B=>{B.preventDefault(),h(true);},[]),D=useCallback(B=>{B.preventDefault(),h(false);},[]),L=useCallback(B=>{if(B.preventDefault(),h(false),B.dataTransfer.files&&B.dataTransfer.files.length>0){let X=Array.from(B.dataTransfer.files);d(H=>[...H,...X]);}},[]);return f("div",{className:Jt.container,children:g("div",{className:"relative",children:[f("input",{type:"file",multiple:true,className:"hidden",ref:m,onChange:b}),g("div",{className:ct(Jt.inputContainer,f$1&&Jt.dragActive),onDragOver:N,onDragLeave:D,onDrop:L,children:[l.length>0&&f("div",{className:Jt.filePreviewArea,children:l.map((B,X)=>g("div",{className:Jt.fileTag,children:[f(Od,{sx:{fontSize:16},className:"text-[var(--orb-primary)]"}),f("span",{className:"truncate max-w-[150px]",children:B.name}),f("button",{onClick:()=>C(X),className:"ml-1 hover:text-[var(--orb-status-error)] focus:outline-none",type:"button",children:f(Td,{sx:{fontSize:16}})})]},`${B.name}-${X}`))}),g("div",{className:"flex w-full flex-col p-2",children:[f("div",{className:ct(Jt.textareaWrapper,"min-h-[52px] px-2 pb-2 pt-1.5 md:min-h-[44px]"),children:f("textarea",{className:ct(Jt.textarea,"min-h-[24px] py-0 px-0"),placeholder:v,value:i,onChange:x,onKeyDown:k,onCompositionStart:I,onCompositionEnd:w,style:zy,"aria-label":"Message input",spellCheck:false,rows:1})}),g("div",{className:"flex items-center justify-between px-1 pb-0.5",children:[g("div",{className:"flex items-center gap-1",role:"toolbar","aria-label":"Input tools",children:[f(Vy,{enabled:g$1.enabled,onClick:P}),f(Wy,{})]}),g("div",{className:"flex items-center gap-1",children:[f(gm,{onTextUpdate:A,onComplete:R,onCancel:T,disabled:o,className:Jt.buttonSmall}),f($y,{canSend:y,isResponding:o,onSend:S,onStop:r})]})]})]})]})]})})};var hm=({messages:t,onSend:r,onStop:o,onRegenerate:n,isResponding:a=false,className:i,placeholder:s,streamIntervalMs:l,streamChunkSize:d,onMessageStreamingComplete:p,cardHooks:u,showInput:f$1=true,statusLine:h})=>{let m=useRef(null),v=useRef(t.length);return useEffect(()=>{t.length>v.current&&m.current?.scrollIntoView({behavior:"smooth"}),v.current=t.length;},[t]),g("div",{className:ct("flex flex-col h-full w-full relative",i),children:[g("div",{className:"flex-1 overflow-y-auto px-4 py-4 space-y-6 scrollbar-thin scrollbar-thumb-[var(--orb-border)]",children:[t.map((y,g)=>{let x=y.type==="assistant"&&g===t.length-1,b=y.type==="assistant"?{isLatestAssistant:x,isResponding:a,onRegenerate:n?()=>n(y.id):void 0}:void 0;return f(us,{message:y,assistantActions:b,onStreamingComplete:()=>p?.(y.id),streamIntervalMs:l,streamChunkSize:d,cardHooks:u},y.id)}),h,f("div",{ref:m})]}),f$1&&f("div",{className:"border-t border-[var(--orb-border,#dbdbdb)] bg-[var(--orb-canvas,#ffffff)] p-4 z-10",children:f(Nl,{onSend:r||(async()=>{}),onStop:o||(()=>{}),isResponding:a,placeholder:s})})]})};var bm={idle:"Idle",running:"Working",success:"Success",error:"Error",pending:"Pending"},vm=({title:t="AI Agent",description:r,headerActions:o,className:n,agentStatus:a,statusText:i,onHeaderPointerDown:s,showInput:l=false,...d})=>{let p=a??(d.isResponding?"running":"idle"),u=p==="running"||p==="pending",f$1=[bm[p],r].filter(Boolean).join(" \xB7 ");return g("div",{className:ct("orb-agent-panel",n),children:[g("div",{className:ct("orb-agent-header",s&&"cursor-grab active:cursor-grabbing"),onPointerDown:s,children:[f("span",{className:"orb-agent-avatar","aria-hidden":"true",children:"AI"}),g("div",{className:"min-w-0 flex-1",children:[f("div",{className:"orb-agent-title",children:t}),g("div",{className:"orb-agent-subtitle",children:[f("span",{className:"orb-agent-dot","data-active":u||void 0}),f("span",{className:"truncate",children:f$1||"Agent"})]})]}),o&&f("div",{className:"ml-auto flex flex-none items-center gap-1",children:o})]}),f("div",{className:"relative min-h-0 flex-1",children:f(hm,{...d,showInput:l,statusLine:u?g("div",{className:ct("orb-agent-status-line","mb-1"),children:[f("span",{className:"orb-agent-spinner","aria-hidden":"true"}),f("span",{children:i??`${bm[p]}\u2026`})]}):void 0})})]})};var Yy=2e3,Zy=1/3,gs=[.25,.5,.75,1,1.5,2,3,4],Qy=100,ym={color:"inherit",background:"transparent",textShadow:"none",fontFamily:"inherit",fontSize:"inherit",lineHeight:"inherit",textAlign:"left",wordSpacing:"normal",wordBreak:"normal",overflowWrap:"normal",tabSize:"inherit",hyphens:"none"},Cm=({text:t,language:r,startLine:o,endLine:n,wrap:a,labels:i})=>{let s=useRef(null),l=useMemo(()=>{let u=t.split(`
18
+ `);u.length>1&&u[u.length-1]===""&&u.pop();let f=Math.min(u.length,Yy);return {shown:u.slice(0,f).join(`
19
+ `),shownCount:f,total:u.length}},[t]),d=useCallback(u=>{let f=n??o,h=o!==void 0&&f!==void 0&&u>=o&&u<=f;return {className:"orb-omph-code-line","data-line":u,...h?{"data-hit":"true"}:{}}},[n,o]);useEffect(()=>{let u=s.current,f=u?.closest(".orb-omph-pv-body");if(!u||!f)return;if(o===void 0){f.scrollTop=0;return}let h=u.querySelector(`[data-line="${o}"]`);if(!h)return;let m=h.getBoundingClientRect().top-f.getBoundingClientRect().top+f.scrollTop;f.scrollTop=Math.max(0,m-f.clientHeight*Zy);},[o,l.shown]);let p={"--orb-omph-digits":String(l.shownCount).length};return g("div",{ref:s,className:"orb-omph-code","data-wrap":a||void 0,style:p,children:[f(Prism,{language:r,useInlineStyles:false,PreTag:"div",CodeTag:"div",showLineNumbers:true,wrapLines:true,lineProps:d,customStyle:ym,codeTagProps:{className:`language-${r}`,style:ym},children:l.shown}),l.total>l.shownCount&&f("div",{className:"orb-omph-pv-note",children:i.previewTruncated(l.shownCount,l.total)})]})},xm=({text:t})=>f("div",{className:"orb-omph-pv-doc",children:f(kn,{content:t})}),Sm=({url:t,alt:r,labels:o})=>{let[n,a]=useState("fit"),[i,s]=useState(null),[l,d]=useState(false),p=n==="fit"?1:n,u=gs.some(v=>v>p),f$1=gs.some(v=>v<p),h=v=>a(y=>{let g=y==="fit"?1:y;return (v>0?gs.find(b=>b>g):[...gs].reverse().find(b=>b<g))??y}),m=n==="fit"||i===null?{maxWidth:"100%",height:"auto"}:{width:i*n,maxWidth:"none",height:"auto"};return l?f("div",{className:"orb-omph-pv-note",role:"alert",children:r?`${o.imageFailed} \xB7 ${r}`:o.imageFailed}):g("div",{className:"orb-omph-img",children:[f("div",{className:"orb-omph-img-stage",children:f("img",{src:t,alt:r??"",draggable:false,style:m,onLoad:v=>s(v.currentTarget.naturalWidth),onError:()=>d(true)})}),g("div",{className:"orb-omph-img-zoom",role:"group","aria-label":o.zoomFit,children:[f("button",{type:"button","aria-label":o.zoomOut,disabled:!f$1,onClick:()=>h(-1),children:"\u2212"}),f("button",{type:"button","aria-label":o.zoomFit,"data-active":n==="fit"||void 0,onClick:()=>a("fit"),children:n==="fit"?o.zoomFit:`${Math.round(n*Qy)}%`}),f("button",{type:"button","aria-label":o.zoomIn,disabled:!u,onClick:()=>h(1),children:"+"})]})]})};var jy=/^[a-z][a-z0-9+.-]*:/i,Jy=/^L(\d+)(?:-L?(\d+))?$/i;var wm=["B","KB","MB","GB"];var eC=t=>{try{return decodeURIComponent(t)}catch{return t}},El=t=>{let r=t.trim();if(!r||r.startsWith("#")||r.startsWith("//")||jy.test(r))return null;let o=r.indexOf("#"),n=o>=0?r.slice(0,o):r,a=o>=0?r.slice(o+1):"",i=n.indexOf("?"),s=eC(i>=0?n.slice(0,i):n);if(!s||s.endsWith("/"))return null;let l=Jy.exec(a);if(!l)return {path:s};let d=Number(l[1]);if(d<1)return {path:s};let p=l[2]?Number(l[2]):d;return {path:s,startLine:d,endLine:Math.max(d,p)}},Ll=t=>t.split("/").filter(Boolean).pop()??t,Pm=t=>{let r=t.split("/");return r.pop(),r.join("/")},Ol=t=>{let r=Ll(t),o=r.lastIndexOf(".");return o>0?r.slice(o+1).toLowerCase():""},Tm={prism:"text",label:"Text"},km={ts:{prism:"typescript",label:"TypeScript"},tsx:{prism:"tsx",label:"TSX"},js:{prism:"javascript",label:"JavaScript"},mjs:{prism:"javascript",label:"JavaScript"},cjs:{prism:"javascript",label:"JavaScript"},jsx:{prism:"jsx",label:"JSX"},json:{prism:"json",label:"JSON"},py:{prism:"python",label:"Python"},java:{prism:"java",label:"Java"},go:{prism:"go",label:"Go"},rs:{prism:"rust",label:"Rust"},c:{prism:"c",label:"C"},h:{prism:"c",label:"C"},cpp:{prism:"cpp",label:"C++"},cs:{prism:"csharp",label:"C#"},sql:{prism:"sql",label:"SQL"},sh:{prism:"bash",label:"Shell"},bash:{prism:"bash",label:"Shell"},yml:{prism:"yaml",label:"YAML"},yaml:{prism:"yaml",label:"YAML"},xml:{prism:"markup",label:"XML"},html:{prism:"markup",label:"HTML"},css:{prism:"css",label:"CSS"},scss:{prism:"scss",label:"SCSS"},abap:{prism:"abap",label:"ABAP"},toml:{prism:"toml",label:"TOML"},ini:{prism:"ini",label:"INI"},md:{prism:"markdown",label:"Markdown"},csv:{prism:"text",label:"CSV"},log:{prism:"text",label:"Log"},txt:Tm},Fl=(t,r)=>r?Object.values(km).find(n=>n.prism===r)??{prism:r,label:r}:km[Ol(t)]??Tm,Im=t=>{let r=t,o=0;for(;r>=1024&&o<wm.length-1;)r/=1024,o+=1;return `${o>0&&r<10?r.toFixed(1):Math.round(r).toString()} ${wm[o]}`};var tC=1e3,rC=9,mo=16,Bl=({tone:t,icon:r,title:o,text:n,action:a})=>g("div",{className:"orb-omph-pv-notice","data-tone":t,role:t==="error"?"alert":void 0,children:[f("span",{className:"orb-omph-pv-notice-icon","aria-hidden":"true",children:r}),f("div",{className:"orb-omph-pv-notice-title",children:o}),n&&f("p",{className:"orb-omph-pv-notice-text",children:n}),a]}),Dm=({state:t,placement:r,expanded:o,canExpand:n,labels:a,gripProps:i,paneRef:s,onClose:l,onRetry:d,onToggleExpand:p,onOpenExternally:u})=>{let[f$1,h]=useState(true),[m,v]=useState(false),{open:y,ref:g$1,phase:x,data:b}=t,C=b?.body;useEffect(()=>{if(!m)return;let L=window.setTimeout(()=>v(false),tC);return ()=>window.clearTimeout(L)},[m]),useEffect(()=>{y&&s.current?.focus({preventScroll:true});},[y,s,g$1?.path]);let P=b?.absolutePath??g$1?.path??"",S=C&&(C.kind==="markdown"||C.kind==="code")?C.text:P,k=S===P?a.previewCopyPath:a.previewCopyContent,I=C?.kind==="code"&&g$1?Fl(g$1.path,C.language):null,w=[];I&&w.push(I.label),C?.kind==="markdown"&&w.push("Markdown"),C?.kind==="image"&&g$1&&w.push(Ol(g$1.path).toUpperCase()),b?.size!==void 0&&w.push(Im(b.size)),C?.kind==="code"&&g$1?.startLine!==void 0&&w.push(a.previewLines(g$1.startLine,g$1.endLine??g$1.startLine));let A=L=>{L.key==="Escape"&&(L.stopPropagation(),l(true));},R=f("button",{type:"button",className:"orb-omph-pv-action",onClick:d,children:a.previewRetry}),T=()=>{if(!g$1)return null;if(x==="loading")return f("div",{className:"orb-omph-pv-skel",role:"status","aria-label":a.previewLoading,children:Array.from({length:rC},(L,B)=>f("span",{},B))});if(x==="error"||!C)return f(Bl,{tone:"error",icon:f(va,{size:mo}),title:a.previewFailed,text:P,action:R});switch(C.kind){case "missing":return f(Bl,{tone:"neutral",icon:f(Sa,{size:mo}),title:a.previewMissing,text:C.message??P});case "unsupported":return f(Bl,{tone:"neutral",icon:f(Sa,{size:mo}),title:a.previewUnsupported,text:C.message??P,action:u&&f("button",{type:"button",className:"orb-omph-pv-action",onClick:()=>u(g$1),children:a.previewOpenExternal})});case "markdown":return f(xm,{text:C.text},g$1.path);case "code":return f(Cm,{text:C.text,language:Fl(g$1.path,C.language).prism,startLine:g$1.startLine,endLine:g$1.endLine,wrap:f$1,labels:a},g$1.path);case "image":return f(Sm,{url:C.url,alt:C.alt,labels:a},C.url);default:return null}},N=r==="overlay",D=C?.kind==="image"?vc:Sa;return g("aside",{ref:s,className:"orb-omph-preview","data-open":y||void 0,"data-placement":r,role:N?"dialog":"complementary","aria-label":a.previewTitle,"aria-hidden":!y||void 0,tabIndex:-1,onKeyDown:A,children:[!N&&y&&f("div",{className:"orb-omph-pv-grip","aria-label":a.previewResize,...i}),g("div",{className:"orb-omph-pv",children:[g("header",{className:"orb-omph-pv-head",children:[N&&f("button",{type:"button",className:"orb-omph-icon-button","aria-label":a.previewBack,onClick:()=>l(true),children:f(Ca,{size:mo})}),f("span",{className:"orb-omph-pv-glyph","aria-hidden":"true",children:f(D,{size:mo})}),g("div",{className:"orb-omph-pv-titles",children:[f("div",{className:"orb-omph-pv-name",title:P,children:g$1?Ll(g$1.path):""}),f("div",{className:"orb-omph-pv-path",title:P,children:f("bdi",{children:Pm(P)})})]}),g("div",{className:"orb-omph-pv-actions",children:[C?.kind==="code"&&f("button",{type:"button",className:"orb-omph-text-button","aria-pressed":f$1,onClick:()=>h(L=>!L),children:a.previewWrap}),g$1&&f("button",{type:"button",className:"orb-omph-icon-button","aria-label":m?a.copied:k,title:m?a.copied:k,onClick:()=>{navigator.clipboard.writeText(S).then(()=>v(true));},children:m?f(Ur,{size:mo}):f(fo,{size:mo})}),n&&f("button",{type:"button",className:"orb-omph-icon-button","aria-pressed":o,"aria-label":o?a.previewCollapse:a.previewExpand,title:o?a.previewCollapse:a.previewExpand,onClick:p,children:f(gc,{size:mo})}),!N&&f("button",{type:"button",className:"orb-omph-icon-button","aria-label":a.previewClose,onClick:()=>l(true),children:f(Xt,{size:mo})})]})]}),f("div",{className:"orb-omph-pv-meta",children:w.join(" \xB7 ")}),f("div",{className:"orb-omph-pv-body","data-kind":x==="ready"?C?.kind:void 0,children:T()})]})]})};var nC=1e3,Nm=50,aC=1e3,iC=t=>t==="tool"?Qo:t==="command"?Ln:wc,Em=t=>!!t.streaming||t.status==="running"||t.status==="pending",sC=(t,r)=>r==="expanded"?true:Em(t),lC=t=>t!==void 0&&(t.inputTokens!==void 0||t.outputTokens!==void 0||t.durationMs!==void 0),cC=(t,r)=>`${Math.max(1,Math.round(t/aC))}${r.secondUnit}`,dC=({content:t})=>{let r=useRef(null),[o,n]=useState(false);return useEffect(()=>{let a=r.current;if(!a)return;let i=()=>n(a.scrollHeight>a.clientHeight+1);i();let s=new ResizeObserver(i);return s.observe(a),()=>s.disconnect()},[t]),f("div",{ref:r,className:"orb-omph-process-body","data-overflow":o||void 0,children:t})},pC=({turn:t,labels:r})=>{let[o,n]=useState(false),[a,i]=useState(false),s=t.assistant?.content??"",l=t.usage;return useEffect(()=>{if(!o)return;let d=window.setTimeout(()=>n(false),nC);return ()=>window.clearTimeout(d)},[o]),g("div",{className:"orb-omph-turn-actions",role:"group","aria-label":r.turnActions,children:[f("span",{className:"orb-omph-actions-time",children:t.assistant?.timestamp.toLocaleTimeString()}),lC(l)&&g(e,{children:[f("span",{className:"orb-omph-actions-divider","aria-hidden":"true"}),f("button",{type:"button",className:"orb-omph-text-button","aria-expanded":a,onClick:()=>i(d=>!d),children:r.usage})]}),f("button",{type:"button",className:"orb-omph-icon-button orb-omph-actions-end","aria-label":o?r.copied:r.copy,onClick:()=>{navigator.clipboard.writeText(s).then(()=>n(true));},children:o?f(Ur,{size:14}):f(fo,{size:14})}),a&&l&&g("div",{className:"orb-omph-usage",children:[l.inputTokens!==void 0&&g("span",{children:[r.inputTokens," ",l.inputTokens.toLocaleString()]}),l.outputTokens!==void 0&&g("span",{children:[r.outputTokens," ",l.outputTokens.toLocaleString()]}),l.durationMs!==void 0&&g("span",{children:[r.duration," ",cC(l.durationMs,r)]})]})]})},uC=({item:t,display:r,open:o,onToggle:n})=>{let a=iC(t.kind),i=Em(t),s=r!=="compact"&&!!t.summary,l=o&&!!t.content;return g("div",{className:"orb-omph-process","data-status":t.status,"data-open":o||void 0,children:[g("button",{type:"button",className:"orb-omph-process-toggle","aria-expanded":o,onClick:n,children:[f(Lr,{size:12,className:"orb-omph-process-chevron"}),f(a,{size:14}),f("span",{className:i?"orb-omph-shimmer":void 0,children:t.title}),s&&f("span",{className:"orb-omph-process-summary",children:t.summary})]}),l&&t.content&&f(dC,{content:t.content}),o&&t.streaming&&f("span",{className:"orb-omph-caret","aria-hidden":"true"})]})},Hl=t=>{let r=t.user?.content||t.assistant?.content||t.id,o=r.split(`
20
+ `).find(n=>n.trim())??r;return o.length>Nm?`${o.slice(0,Nm)}\u2026`:o},mC=0,Lm=({turns:t,labels:r,processDisplay:o,cardHooks:n,resolveFileLink:a,onOpenFile:i})=>{let[s,l]=useState({}),d=p=>{if(!i||p.defaultPrevented||p.button!==mC||p.metaKey||p.ctrlKey||p.shiftKey||p.altKey)return;let u=p.target.closest("a[href]");if(!u)return;let f=a(u.getAttribute("href")??"");f&&(p.preventDefault(),i(f,u));};return f(e,{children:t.map((p,u)=>{let f$1=!!(p.assistant&&!p.assistant.streaming),m=u===t.length-1&&f$1?"always":"hover";return g("article",{className:"orb-omph-turn","data-omph-turn":p.id,"data-actions-reveal":m,children:[p.user&&g("div",{className:"orb-omph-user",children:[f("div",{className:"orb-omph-user-bubble",children:p.user.content}),f("div",{className:"orb-omph-clock",children:p.user.timestamp.toLocaleTimeString()})]}),p.process&&p.process.length>0&&f("div",{className:"orb-omph-process-list",children:p.process.map(v=>{let y=v.id in s?s[v.id]:sC(v,o);return f(uC,{item:v,display:o,open:y,onToggle:()=>l(g=>({...g,[v.id]:!y}))},v.id)})}),p.assistant&&g("div",{className:"orb-omph-assistant","data-file-links":i?"true":void 0,onClick:d,children:[f(ps,{content:p.assistant.content,messageId:p.assistant.id,cardHooks:n}),p.assistant.streaming&&f("span",{className:"orb-omph-caret","aria-hidden":"true"})]}),p.failure&&f("div",{className:"orb-omph-failure","data-severity":p.failure.severity,children:p.failure.content}),f$1&&f(pC,{turn:p,labels:r})]},p.id)})})};var gC={idle:"Idle",pending:"Pending",running:"Working",success:"Success",error:"Error",working:"Working",workingFor:t=>`Working for ${t}`,loadOlder:"Load earlier",loadingOlder:"Loading earlier\u2026",toBottom:"Back to bottom",copy:"Copy",copied:"Copied",turnActions:"Reply actions",usage:"Usage",inputTokens:"Input",outputTokens:"Output",duration:"Duration",send:"Send",stop:"Stop",turnRail:"Turns",secondUnit:"s",minuteUnit:"m",previewTitle:"File preview",previewClose:"Close preview",previewBack:"Back to conversation",previewExpand:"Expand preview",previewCollapse:"Restore preview size",previewCopyContent:"Copy content",previewCopyPath:"Copy path",previewOpenExternal:"Open externally",previewWrap:"Wrap",previewLoading:"Loading file",previewMissing:"File not found",previewFailed:"Could not load this file",previewUnsupported:"No preview for this file type",previewRetry:"Try again",previewResize:"Resize preview",previewLines:(t,r)=>t===r?`Line ${t}`:`Lines ${t}\u2013${r}`,previewTruncated:(t,r)=>`Showing the first ${t.toLocaleString()} of ${r.toLocaleString()} lines`,imageFailed:"The image could not be displayed",zoomIn:"Zoom in",zoomOut:"Zoom out",zoomFit:"Fit to width"},Fm=t=>({...gC,...t}),fC=1e3,Om=60,hC=1e3,Bm=(t,r)=>{let o=Math.max(1,Math.round(Math.max(t,hC)/fC)),n=Math.floor(o/Om),a=o%Om;return n<=0?`${o}${r.secondUnit}`:`${n}${r.minuteUnit} ${a}${r.secondUnit}`};var yC={open:false,ref:null,phase:"loading",data:null},Hm=t=>{let[r,o]=useState(yC),n=useRef(r);n.current=r;let a=useRef(t);a.current=t;let i=useRef(null),s=useRef(0),l=useRef(null),d=useCallback(h=>{let m=a.current;if(!m)return;i.current?.abort();let v=new AbortController;i.current=v,s.current+=1;let y=s.current;o({open:true,ref:h,phase:"loading",data:null}),m(h,v.signal).then(g=>{y===s.current&&o(x=>({...x,phase:"ready",data:g}));},()=>{y!==s.current||v.signal.aborted||o(g=>({...g,phase:"error",data:null}));});},[]),p=useCallback((h,m)=>{l.current=m??null;let v=n.current;if(v.ref?.path===h.path&&v.phase==="ready"){o({...v,open:true,ref:h});return}d(h);},[d]),u=useCallback((h=false)=>{s.current+=1,i.current?.abort(),o(v=>({...v,open:false}));let m=l.current;h&&m?.isConnected&&m.focus({preventScroll:true});},[]),f=useCallback(()=>{let{ref:h}=n.current;h&&d(h);},[d]);return useEffect(()=>()=>{i.current?.abort();},[]),{state:r,open:p,close:u,reload:f}};var Vl="--orb-omph-pv-w",Wl="--orb-omph-pv-pref",SC=880,wC=560,Vm=400,Wo=320,kC=.45,PC=.7,Wm=24,zl=(t,r,o)=>Math.min(Math.max(t,r),Math.max(r,o)),$m=({open:t,layout:r})=>{let o=useRef(null),n=useRef(null),[a,i]=useState(0),[s,l]=useState(null),[d,p]=useState(false),[u,f]=useState(false);useLayoutEffect(()=>{let k=o.current;if(!k)return;let I=()=>i(k.getBoundingClientRect().width);I();let w=new ResizeObserver(I);return w.observe(k),()=>w.disconnect()},[]),useEffect(()=>{t||p(false);},[t]);let h=r==="overlay"?false:r==="split"?a>=Vm+Wo:a>=SC,m=h&&!d?"split":"overlay",v=Math.max(Wo,Math.min(a*PC,a-Vm)),y=zl(s??a*kC,Wo,v),g=a>0&&a<wC,x=useCallback(k=>{let I=o.current;I&&(I.style.setProperty(Wl,`${k}px`),I.dataset.placement==="split"&&I.dataset.open==="true"&&I.style.setProperty(Vl,`${k}px`));},[]),b=useCallback(k=>{k.button===0&&(k.preventDefault(),k.currentTarget.setPointerCapture(k.pointerId),n.current={pointerId:k.pointerId,startX:k.clientX,startWidth:y,latest:y},f(true));},[y]),C=useCallback(k=>{let I=n.current;!I||I.pointerId!==k.pointerId||(I.latest=zl(I.startWidth+(I.startX-k.clientX),Wo,v),x(I.latest));},[v,x]),P=useCallback(k=>{let I=n.current;!I||I.pointerId!==k.pointerId||(n.current=null,k.currentTarget.hasPointerCapture(k.pointerId)&&k.currentTarget.releasePointerCapture(k.pointerId),l(I.latest),f(false));},[]),S=useCallback(k=>{let I={ArrowLeft:y+Wm,ArrowRight:y-Wm,Home:Wo,End:v};k.key in I&&(k.preventDefault(),l(zl(I[k.key],Wo,v)));},[v,y]);return {mainRef:o,placement:m,width:y,compact:g,dragging:u,expanded:d,canExpand:h,toggleExpanded:()=>p(k=>!k),gripProps:{role:"separator","aria-orientation":"vertical","aria-valuemin":Wo,"aria-valuemax":Math.round(v),"aria-valuenow":Math.round(y),tabIndex:0,onPointerDown:b,onPointerMove:C,onPointerUp:P,onPointerCancel:P,onKeyDown:S}}};var vs=48,IC=900,_m=()=>typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,Um=({turns:t,contentVersion:r,hasOlder:o=false,loadingOlder:n=false,onLoadOlder:a})=>{let i=useRef(null),s=useRef(null),l=useRef(true),d=useRef({height:0,top:0}),p=useRef(void 0),u=useRef(false),[f,h]=useState(true),[m,v]=useState(false),[y,g]=useState(t[0]?.id),x=useCallback(()=>{let k=i.current;k&&(d.current={height:k.scrollHeight,top:k.scrollTop});},[]),b=useCallback(()=>{let k=i.current;if(!k)return;let I=k.getBoundingClientRect().top,w=k.querySelector("[data-omph-turn]")?.dataset.omphTurn;k.querySelectorAll("[data-omph-turn]").forEach(A=>{A.getBoundingClientRect().top-I<=vs&&(w=A.dataset.omphTurn);}),g(w);},[]);useEffect(()=>{let k=i.current,I=s.current;if(!k||!I)return;let w=()=>{v(k.clientWidth>IC),l.current&&(k.scrollTop=k.scrollHeight),x();};w();let A=new ResizeObserver(w);return A.observe(k),A.observe(I),()=>A.disconnect()},[x]),useLayoutEffect(()=>{let k=i.current;if(!k)return;let I=t[0]?.id,w=p.current,A=w!==void 0&&I!==void 0&&I!==w;if(p.current=I,A){l.current=false,h(false);let R=k.scrollHeight-d.current.height;k.scrollTop=d.current.top+Math.max(0,R),x(),b();return}l.current&&(k.scrollTop=k.scrollHeight),x(),b();},[r,x,t,b]),useEffect(()=>{n||(u.current=false);},[n]);let C=useCallback(()=>{let k=i.current;if(!k)return;let w=k.scrollHeight-k.scrollTop-k.clientHeight<=vs;w!==l.current&&(l.current=w,h(w)),x(),b();let A=k.scrollHeight-k.clientHeight>vs,R=k.scrollTop<=vs;!A||!R||w||!o||n||!a||u.current||(u.current=true,a());},[o,n,a,x,b]),P=useCallback(()=>{let k=i.current;k&&(l.current=true,h(true),k.scrollTo({top:k.scrollHeight,behavior:_m()?"auto":"smooth"}));},[]),S=useCallback(k=>{let w=i.current?.querySelector(`[data-omph-turn="${CSS.escape(k)}"]`);w&&(l.current=false,h(false),w.scrollIntoView({block:"start",behavior:_m()?"auto":"smooth"}));},[]);return {scrollerRef:i,contentRef:s,following:f,railVisible:m,activeTurnId:y,onScroll:C,returnToBottom:P,scrollToTurn:S}};var RC=1e3,DC=(t,r)=>r[t],NC=t=>t.map(r=>[r.id,r.user?.content.length??0,r.assistant?.content.length??0,r.assistant?.streaming?"1":"0",r.failure?.id??"",(r.process??[]).map(o=>`${o.id}:${o.status}:${o.content?.length??0}`).join(",")].join(":")).join("|"),AC=({startedAt:t,labels:r})=>{let[o,n]=useState(()=>Date.now());useEffect(()=>{n(Date.now());let i=window.setInterval(()=>n(Date.now()),RC);return ()=>window.clearInterval(i)},[t]);let a=t===void 0?r.working:r.workingFor(Bm(Math.max(0,o-t),r));return g("div",{className:"orb-omph-running","data-omph-running":"true",children:[f("span",{className:"orb-visually-hidden",role:"status","aria-live":"polite",children:r.working}),f("span",{className:"orb-omph-running-rule","aria-hidden":"true"}),g("span",{className:"orb-omph-running-body",children:[f("span",{className:"orb-omph-spinner","aria-hidden":"true"}),f("span",{className:"orb-omph-shimmer",children:a})]})]})},JB=({turns:t,title:r="OMPH Agent",description:o,headerActions:n,agentStatus:a,isResponding:i=false,labels:s,processDisplay:l="standard",showInput:d=false,placeholder:p,className:u,cardHooks:f$1,hasOlder:h=false,loadingOlder:m=false,onLoadOlder:v,onSend:y,onStop:g$1,onHeaderPointerDown:x,loadFilePreview:b,resolveFileLink:C=El,filePreviewLayout:P="auto",onOpenFileExternally:S})=>{let k=Fm(s),I=a??(i?"running":"idle"),w=I==="running"||I==="pending",A=[DC(I,k),o].filter(Boolean).join(" \xB7 "),R=useMemo(()=>NC(t),[t]),T=Um({turns:t,contentVersion:R,hasOlder:h,loadingOlder:m,onLoadOlder:v}),[N,D]=useState(""),L=N.trim(),B=i&&L.length===0,X=[...t].reverse().find(se=>!!se.assistant?.streaming||se.process?.some(fe=>fe.streaming||fe.status==="running"||fe.status==="pending")),H=w?X?.startedAt:void 0,K=!!b,W=Hm(b),G=$m({open:W.state.open,layout:P}),z=useRef(null),O=useRef(null),Y=K&&W.state.open&&G.placement==="overlay",Q=G.placement==="split"&&W.state.open,me={[Wl]:`${G.width}px`,[Vl]:Q?`${G.width}px`:"0px"};useEffect(()=>{O.current?.toggleAttribute("inert",Y);},[Y]);let ie=async()=>{if(!L||!y)return;let se=L;D("");try{await y(se);}catch{D(fe=>fe.trim().length===0?se:fe);}};return g("div",{className:ct("orb-omph-panel",u),"data-omph-panel":"","data-status":I,"data-compact":G.compact||void 0,children:[g("div",{className:ct("orb-omph-header",x&&"cursor-grab active:cursor-grabbing"),onPointerDown:x,children:[f("span",{className:"orb-omph-avatar","aria-hidden":"true",children:"AI"}),g("div",{className:"min-w-0 flex-1",children:[f("div",{className:"orb-omph-title",children:r}),g("div",{className:"orb-omph-subtitle",children:[f("span",{className:"orb-omph-dot","data-active":w||void 0}),f("span",{className:"truncate",children:A||k.idle})]})]}),n&&f("div",{className:"ml-auto flex flex-none items-center gap-1",children:n})]}),g("div",{ref:G.mainRef,className:"orb-omph-main","data-placement":G.placement,"data-open":String(W.state.open),"data-dragging":G.dragging||void 0,style:me,children:[g("div",{ref:O,className:"orb-omph-center",children:[g("div",{className:"orb-omph-stage","data-rail":T.railVisible||void 0,children:[f("div",{ref:T.scrollerRef,className:"orb-omph-scroll",onScroll:T.onScroll,children:g("div",{ref:T.contentRef,className:"orb-omph-column",children:[h&&v&&f("button",{type:"button",className:"orb-omph-older",disabled:m,onClick:v,children:m?k.loadingOlder:k.loadOlder}),f(Lm,{turns:t,labels:k,processDisplay:l,cardHooks:f$1,resolveFileLink:C,onOpenFile:K?W.open:void 0}),w&&f(AC,{startedAt:H,labels:k})]})}),T.railVisible&&t.length>0&&f("nav",{className:"orb-omph-rail","aria-label":k.turnRail,children:t.map(se=>f("button",{type:"button",className:"orb-omph-rail-mark","data-active":T.activeTurnId===se.id||void 0,"aria-label":Hl(se),title:Hl(se),onClick:()=>T.scrollToTurn(se.id)},se.id))}),!T.following&&f("button",{type:"button",className:"orb-omph-to-bottom","aria-label":k.toBottom,onClick:T.returnToBottom,children:f(Lr,{size:16})})]}),d&&g("form",{className:"orb-omph-composer",onSubmit:se=>{se.preventDefault(),B?g$1?.():ie();},children:[f("textarea",{className:"orb-omph-input",value:N,placeholder:p,rows:1,onChange:se=>D(se.target.value),onKeyDown:se=>{se.key!=="Enter"||se.shiftKey||se.nativeEvent.isComposing||(se.preventDefault(),B?g$1?.():ie());}}),f("button",{type:"submit",className:B?"orb-omph-stop":"orb-omph-send","aria-label":B?k.stop:k.send,disabled:!B&&L.length===0,children:B?f(dc,{size:16}):f(cc,{size:16})})]})]}),K&&f(Dm,{state:W.state,placement:G.placement,expanded:G.expanded,canExpand:G.canExpand,labels:k,gripProps:G.gripProps,paneRef:z,onClose:W.close,onRetry:W.reload,onToggleExpand:G.toggleExpanded,onOpenExternally:S})]})]})};var Qm=520,OC=88,FC=88,BC=24,ys=640,jm=(t,r,o)=>Math.min(Math.max(t,r),Math.max(r,o)),Gl=t=>typeof t=="number"?`${t}px`:t,HC=t=>t instanceof HTMLElement?!!t.closest('button,input,a,textarea,select,[role="button"],[contenteditable="true"]'):false,iH=({anchor:t,defaultAnchor:r="right",onAnchorChange:o,width:n=Qm,top:a=OC,bottom:i=FC,inset:s=BC,zIndex:l=1300,shellClassName:d,shellStyle:p,className:u,onHeaderPointerDown:f$1,...h})=>{let m=useRef(null),v=useRef(null),[y,g]=useState(r),[x,b]=useState(0),[C,P]=useState(typeof n=="number"?n:Qm),[S,k]=useState(0),[I,w]=useState(false),A=t??y;useEffect(()=>{let H=()=>b(window.innerWidth);return H(),window.addEventListener("resize",H),()=>window.removeEventListener("resize",H)},[]),useLayoutEffect(()=>{let H=()=>{let W=m.current?.getBoundingClientRect();W?.width?P(W.width):typeof n=="number"&&P(n);};if(H(),!m.current||typeof ResizeObserver>"u")return;let K=new ResizeObserver(H);return K.observe(m.current),()=>K.disconnect()},[n]);let R=useCallback(H=>{if(!x)return s;let K=x<ys?12:s,W=Math.max(K,x-C-K);return x<ys||H==="left"?K:H==="center"?jm((x-C)/2,K,W):W},[s,C,x]),T=useCallback(H=>["left","center","right"].reduce((W,G)=>{let z=Math.abs(H-R(W));return Math.abs(H-R(G))<z?G:W},"right"),[R]),N=useCallback(H=>{t===void 0&&g(H),o?.(H);},[t,o]);useEffect(()=>{I||k(R(A));},[R,I,A]);let D=useCallback(H=>{f$1?.(H),!(H.defaultPrevented||HC(H.target))&&(H.preventDefault(),H.currentTarget.setPointerCapture(H.pointerId),v.current={pointerId:H.pointerId,startClientX:H.clientX,startX:S,currentX:S,captureElement:H.currentTarget},w(true));},[f$1,S]),L=useCallback(H=>{let K=v.current;if(!K||K.pointerId!==H.pointerId)return;let W=x<ys?12:s,G=Math.max(W,x-C-W),z=jm(K.startX+H.clientX-K.startClientX,W,G);K.currentX=z,k(z);},[s,C,x]),B=useCallback(H=>{let K=v.current;if(!K||K.pointerId!==H.pointerId)return;try{K.captureElement.releasePointerCapture(H.pointerId);}catch{}let W=T(K.currentX);v.current=null,w(false),N(W),k(R(W));},[R,N,T]),X=useMemo(()=>({position:"fixed",top:Gl(a),bottom:Gl(i),left:S,width:Gl(n),maxWidth:`calc(100vw - ${x<ys?24:s*2}px)`,zIndex:l,pointerEvents:"auto",transition:I?"none":"left 180ms ease-out",touchAction:"none",...p}),[i,s,I,S,p,a,x,n,l]);return f("div",{ref:m,className:ct("orbcafe-floating-agent-panel min-w-0",d),"data-anchor":A,"data-dragging":I?"true":"false",style:X,onPointerMove:L,onPointerUp:B,onPointerCancel:B,children:f(vm,{...h,className:u,onHeaderPointerDown:D})})};var WC={"top-left":"bottom-right","top-right":"bottom-left","bottom-left":"top-right","bottom-right":"top-left"},gH=({messages:t,onSend:r,onRegenerate:o,isResponding:n=false,className:a,placeholder:i,title:s="Copilot",corner:l="bottom-right",onCollapse:d,onHeaderPointerDown:p,onPlusClick:u,onMicClick:f$1,streamIntervalMs:h,streamChunkSize:m,onMessageStreamingComplete:v,cardHooks:y})=>{let[g$1,x]=useState(""),[b,C]=useState(false),P=useRef(null),S=WC[l];useEffect(()=>{P.current?.scrollIntoView({behavior:"smooth"});},[t,n]);let k=useCallback(async()=>{let w=g$1.trim();!w||n||(x(""),await r(w));},[n,r,g$1]),I=useCallback(async w=>{w.key==="Enter"&&!b&&(w.preventDefault(),await k());},[k,b]);return g("div",{className:ct("relative flex h-full w-full min-h-[460px] min-w-[340px] flex-col overflow-hidden rounded-3xl border border-[var(--orb-border)] bg-[var(--orb-canvas)] shadow-none dark:bg-[var(--orb-surface-2)]",a),children:[d&&f("button",{onClick:d,className:ct("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:f("span",{className:ct("block h-4 w-4 border-[var(--orb-ai-accent)]",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]")})}),g("div",{className:"flex items-center justify-between border-b border-[var(--orb-border)] px-4 py-3",onPointerDown:p,children:[f("div",{className:"flex items-center",children:f("h3",{className:"text-base font-semibold tracking-tight text-[var(--orb-fg)]",children:s})}),f("div",{})]}),g("div",{className:"flex-1 overflow-y-auto px-3 py-3 space-y-5 scrollbar-thin scrollbar-thumb-[var(--orb-border)]",children:[t.map((w,A)=>{let R=w.type==="assistant"&&A===t.length-1,T=w.type==="assistant"?{isLatestAssistant:R,isResponding:n,onRegenerate:o?()=>o(w.id):void 0}:void 0;return f(us,{message:w,assistantActions:T,onStreamingComplete:()=>v?.(w.id),streamIntervalMs:h,streamChunkSize:m,cardHooks:y},w.id)}),f("div",{ref:P})]}),f("div",{className:"border-t border-[var(--orb-border)] px-3 py-3",children:g("div",{className:"flex items-center gap-2 rounded-xl border border-[var(--orb-p300)] bg-[var(--orb-canvas)] px-2 py-1.5 dark:bg-[var(--orb-surface-2)]",children:[f("button",{className:"flex h-8 w-8 items-center justify-center rounded-full text-[var(--orb-muted)] transition-colors hover:bg-[var(--orb-surface)] hover:text-[var(--orb-fg)] dark:text-[var(--orb-muted)] dark:hover:bg-[var(--orb-surface-2)]",onClick:u,type:"button","aria-label":"Add",children:f(Ra,{className:"h-4 w-4"})}),f("input",{className:"h-7 flex-1 border-none bg-transparent text-sm text-[var(--orb-fg)] outline-none placeholder:text-[var(--orb-muted)] dark:text-[var(--orb-fg)] dark:placeholder:text-[var(--orb-muted)]",placeholder:i||"Ask Copilot...",value:g$1,onChange:w=>x(w.target.value),onCompositionStart:()=>C(true),onCompositionEnd:()=>C(false),onKeyDown:I,"aria-label":"Copilot input",spellCheck:false}),f("button",{className:"flex h-8 w-8 items-center justify-center rounded-full text-[var(--orb-muted)] transition-colors hover:bg-[var(--orb-surface)] hover:text-[var(--orb-fg)] dark:text-[var(--orb-muted)] dark:hover:bg-[var(--orb-surface-2)]",onClick:f$1,type:"button","aria-label":"Microphone",children:f(Ta,{className:"h-4 w-4"})})]})})]})};var $C=["var(--orb-primary)","var(--orb-primary)","var(--orb-primary)"],GC=`
18
21
  .orbcafe-ai-browser-glow {
19
22
  position: fixed;
20
23
  inset: 0;
@@ -46,4 +49,4 @@ ${r}: ${(n??a)(g$1.secondaryValue??0)}`:""]})}),f("text",{x:g$1.x,y:Math.max(g$1
46
49
  0%, 100% { opacity: 0.5; }
47
50
  50% { opacity: 1; }
48
51
  }
49
- `,J2=({active:t=false,colors:o=gv,zIndex:r=2147483e3})=>{let a={"--orbcafe-ai-glow-line":o[0],"--orbcafe-ai-glow-z-index":r};return g(e,{children:[f("style",{children:fv}),f("div",{className:"orbcafe-ai-browser-glow","data-active":t?"true":"false",style:a,"aria-hidden":"true"})]})};var rF=({defaultMode:t="login",onLogin:o,onRegister:r,onForgotPassword:a}={})=>{let[n,i]=useState(t),[s,c]=useState(false),d=useCallback(async u=>{c(true);try{await u?.();}finally{c(false);}},[]),m=useCallback(u=>d(()=>o?.(u)),[o,d]),p=useCallback(u=>d(()=>r?.(u)),[r,d]),f=useCallback(u=>d(()=>a?.(u)),[a,d]),h=useMemo(()=>({mode:n,loading:s,onModeChange:i,onLogin:m,onRegister:p,onForgotPassword:f}),[f,m,p,s,n]);return {mode:n,loading:s,setMode:i,authPageProps:h}};var vv={productName:"ORBCAFE \u2014 Enterprise suite",headline:"We digitalize you.",subheadline:"One sign-in for planning, production and analytics across your value chain.",brandMeta:"ORBCAFE \xB7 Enterprise manufacturing suite",loginTitle:"Sign in",loginSubtitle:"Use your corporate account to continue.",registerTitle:"Create account",registerSubtitle:"Request a demo workspace user for evaluation.",forgotTitle:"Reset password",forgotSubtitle:"Send a password reset request to your email address."},uF=({mode:t,defaultMode:o="login",onModeChange:r,onLogin:a,onRegister:n,onForgotPassword:i,loading:s=false,logo:c,copy:d,sx:m})=>{let p=t!==void 0,[f$1,h]=useState(o),u=t??f$1,v=useMemo(()=>({...vv,...d}),[d]),[y,g$1]=useState({username:"demo@orbcafe.local",password:"orbcafe-demo",remember:true}),[C,b]=useState({name:"",email:"",password:"",confirmPassword:"",acceptedTerms:false}),[S,k]=useState({email:""}),[x,E]=useState(""),D=I=>{p||h(I),E(""),r?.(I);},T=async I=>{I.preventDefault(),await a?.(y),E("Demo login accepted. No real authentication request was sent.");},N=async I=>{I.preventDefault(),await n?.(C),E("Demo registration saved locally for this screen.");},R=async I=>{I.preventDefault(),await i?.(S),E("Demo reset link request created. No email was sent.");},w=u==="login"?v.loginTitle:u==="register"?v.registerTitle:v.forgotTitle,M=u==="login"?v.loginSubtitle:u==="register"?v.registerSubtitle:v.forgotSubtitle;return g("div",{className:"orb-auth-frame orb-root",style:m,children:[g("div",{className:"orb-auth-brand",children:[f("span",{className:"orb-auth-dia",style:{width:230,height:230,right:-70,bottom:-60}}),f("span",{className:"orb-auth-dia orb-auth-dia-sm-hide",style:{width:140,height:140,right:120,bottom:80,borderColor:"rgba(255,255,255,.09)"}}),f("span",{className:"orb-auth-dia orb-auth-dia-sm-hide",style:{width:76,height:76,right:60,bottom:170,background:"color-mix(in oklch, var(--orb-primary) 35%, transparent)",borderColor:"rgba(255,255,255,.2)"}}),c?f("span",{style:{alignSelf:"flex-start",position:"relative"},children:c}):f("span",{className:"orb-logo-slot",children:"Host logo"}),g("div",{className:"orb-auth-claim",children:[f("div",{className:"orb-auth-rule"}),f("h2",{children:v.headline}),f("p",{children:v.subheadline})]}),f("div",{className:"orb-auth-meta",children:v.brandMeta})]}),f("div",{className:"orb-auth-form",children:g("div",{className:"orb-auth-card",children:[f("span",{className:"orb-overline",style:{letterSpacing:"0.12em"},children:v.productName}),f("h1",{className:"orb-h2",style:{margin:0},children:w}),f("p",{className:"orb-body-dense",style:{color:"var(--orb-muted)",margin:"-10px 0 0"},children:M}),x&&f(_r,{severity:"success",children:x}),u==="login"&&g("form",{onSubmit:T,style:{display:"flex",flexDirection:"column",gap:16},children:[f(Be,{label:"Email",type:"email",autoComplete:"username",value:y.username,onChange:I=>g$1(L=>({...L,username:I.target.value})),startAdornment:f(Ji,{size:15,strokeWidth:1.8})}),f(Be,{label:"Password",type:"password",autoComplete:"current-password",value:y.password,onChange:I=>g$1(L=>({...L,password:I.target.value})),startAdornment:f(nn,{size:15,strokeWidth:1.8})}),g("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12},children:[f(Mt,{label:"Remember me",checked:y.remember,onChange:I=>g$1(L=>({...L,remember:I.target.checked}))}),f("button",{type:"button",className:"orb-link",onClick:()=>D("forgot"),children:"Forgot password?"})]}),f(be,{type:"submit",size:"large",block:true,loading:s,children:s?"Signing in\u2026":"Sign in"}),g("p",{className:"orb-meta",style:{textAlign:"center",margin:0},children:["New user?"," ",f("button",{type:"button",className:"orb-link",onClick:()=>D("register"),children:"Register"})]})]}),u==="register"&&g("form",{onSubmit:N,style:{display:"flex",flexDirection:"column",gap:16},children:[f(Be,{label:"Full name",value:C.name,onChange:I=>b(L=>({...L,name:I.target.value})),startAdornment:f(Ji,{size:15,strokeWidth:1.8})}),f(Be,{label:"Work email",type:"email",autoComplete:"username",value:C.email,onChange:I=>b(L=>({...L,email:I.target.value})),startAdornment:f(Qi,{size:15,strokeWidth:1.8})}),f(Be,{label:"Password",type:"password",autoComplete:"new-password",value:C.password,onChange:I=>b(L=>({...L,password:I.target.value})),startAdornment:f(nn,{size:15,strokeWidth:1.8})}),f(Be,{label:"Confirm password",type:"password",autoComplete:"new-password",value:C.confirmPassword,onChange:I=>b(L=>({...L,confirmPassword:I.target.value}))}),f(Mt,{label:"I accept the demo workspace terms",checked:C.acceptedTerms,onChange:I=>b(L=>({...L,acceptedTerms:I.target.checked}))}),f(be,{type:"submit",size:"large",block:true,loading:s,children:"Create demo account"}),g("p",{className:"orb-meta",style:{textAlign:"center",margin:0},children:["Already have an account?"," ",f("button",{type:"button",className:"orb-link",onClick:()=>D("login"),children:"Sign in"})]})]}),u==="forgot"&&g("form",{onSubmit:R,style:{display:"flex",flexDirection:"column",gap:16},children:[f(Be,{label:"Work email",type:"email",autoComplete:"username",value:S.email,onChange:I=>k({email:I.target.value}),startAdornment:f(Qi,{size:15,strokeWidth:1.8})}),f(be,{type:"submit",size:"large",block:true,loading:s,children:"Send reset request"}),g("p",{className:"orb-meta",style:{textAlign:"center",margin:0},children:["Remember your password?"," ",f("button",{type:"button",className:"orb-link",onClick:()=>D("login"),children:"Back to sign in"})]})]}),g("div",{style:{display:"flex",alignItems:"center",gap:12,font:"500 10px/1 var(--orb-font)",letterSpacing:"0.1em",textTransform:"uppercase",color:"var(--orb-muted)"},children:[f("span",{style:{flex:1,height:1,background:"var(--orb-border)"}}),"or",f("span",{style:{flex:1,height:1,background:"var(--orb-border)"}})]}),f(be,{variant:"neutral",size:"large",block:true,children:"Continue with corporate SSO"}),g("p",{className:"orb-meta",style:{textAlign:"center",fontWeight:300,margin:0},children:["Protected by corporate single sign-on.",f("br",{}),"Demo credentials: demo@orbcafe.local / orbcafe-demo"]})]})})]})};var Cv={keyword:{value:"",operator:"contains"},status:{value:"",operator:"equals"},owner:{value:"",operator:"contains"},workCenter:{value:"",operator:"contains"}},xv=[{id:"keyword",label:"Keyword",type:"text",placeholder:"Task/ID/Project",hasSearchIcon:true},{id:"status",label:"Status",type:"select",options:[{label:"In progress",value:"in-progress"},{label:"Blocked",value:"blocked"},{label:"Planned",value:"planned"},{label:"Not started",value:"not-started"}]},{id:"owner",label:"Owner",type:"text",placeholder:"Owner name"},{id:"workCenter",label:"Work Center",type:"text",placeholder:"CNC-02 / WH-A / ..."},{id:"dateRange",label:"Date Range",type:"date"}],Du=({tasks:t,appId:o,tableKey:r,defaultScale:a="week",defaultSelectedTaskId:n,initialFilters:i,filterFields:s,filterAppId:c,filterTableKey:d,serviceUrl:m,variantService:p,layout:f,columns:h,page:u,rowsPerPage:v,rowsPerPageOptions:y,count:g,onPageChange:C,onRowsPerPageChange:b,onFilterSearch:S,onFilterVariantLoad:k,enableRowReorder:x,onTaskReorder:E,onLayoutIdChange:D,onLayoutSave:T})=>{let N=o??c??"planning-gantt",R=r??d??"planning",[w,M]=useState(a),[I,L]=useState(n??t[0]?.id??""),[O,U]=useState(""),[z,K]=useState(null),[W,q]=useState({...Cv,...i}),H=useMemo(()=>{let ge=String(W.keyword?.value??"").trim().toLowerCase(),ye=String(W.status?.value??"").trim(),Ue=String(W.owner?.value??"").trim().toLowerCase(),Oe=String(W.workCenter?.value??"").trim().toLowerCase(),Ie=W.dateRange?.value,ze=Ie?.[0]?Zo(Ie[0]):null,Re=Ie?.[1]?Zo(Ie[1]):null;return t.filter(Ce=>{if(ge&&![Ce.id,Ce.code,Ce.title,Ce.project,Ce.workCenter,Ce.owner?.name].join(" ").toLowerCase().includes(ge)||ye&&Ce.status!==ye||Ue&&!String(Ce.owner?.name??"").toLowerCase().includes(Ue)||Oe&&!String(Ce.workCenter??"").toLowerCase().includes(Oe))return false;if(ze||Re){let Ve=Zo(Ce.startDate),at=Zo(Ce.endDate),gt=ze?at.isAfter(ze)||at.isSame(ze,"day"):true,Je=Re?Ve.isBefore(Re)||Ve.isSame(Re,"day"):true;if(!gt||!Je)return false}return true})},[W,t]);useEffect(()=>{H.length!==0&&(H.some(ge=>ge.id===I)||L(H[0].id));},[H,I]);let V=useCallback(ge=>{L(ge.id);},[]),Z=useCallback(ge=>{U(ge),D?.(ge);},[D]),j=useCallback(ge=>{K(ye=>({key:(ye?.key??0)+1,variant:ge})),k?.(ge);},[k]),me=useMemo(()=>({appId:N,tableKey:R,fields:s??xv,filters:W,onFilterChange:q,onVariantLoad:j,onSearch:S??(()=>{}),currentLayoutId:O,layoutRefs:[{tableKey:R,layoutId:O||null}],variantService:p,serviceUrl:m}),[O,s,W,j,S,N,R,m,p]),ie=useMemo(()=>({appId:N,tableKey:R,serviceUrl:m,tasks:H,columns:h,scale:w,onScaleChange:M,page:u,rowsPerPage:v,rowsPerPageOptions:y,count:g,onPageChange:C,onRowsPerPageChange:b,selectedTaskId:I,onTaskSelect:V,enableRowReorder:x,onTaskReorder:E,layout:f,layoutVariant:z?.variant,layoutVariantLoadKey:z?.key,onLayoutIdChange:Z,onLayoutSave:T}),[h,g,x,H,Z,f,z?.key,z?.variant,C,b,T,E,V,u,N,R,v,y,w,m,I]);return {scale:w,setScale:M,selectedTaskId:I,setSelectedTaskId:L,filters:W,setFilters:q,filteredTasks:H,smartFilterProps:me,planningGanttProps:ie}};var CF=t=>{let o=Du(t),r=useMemo(()=>({filterProps:o.smartFilterProps,ganttProps:o.planningGanttProps}),[o.planningGanttProps,o.smartFilterProps]);return {...o,layoutProps:r}};Zo.extend(wv);var ol=[{value:"hour",label:"Hour",width:56},{value:"day",label:"Day",width:46},{value:"week",label:"Week",width:78},{value:"month",label:"Month",width:104}],rl=36,al=58,Ja=8,nl=260,Dv=320,Er="220ms cubic-bezier(0.2, 0, 0, 1)",Au={"not-started":{label:"Not started",color:"default"},planned:{label:"Planned",color:"info"},"in-progress":{label:"In progress",color:"primary"},blocked:{label:"Blocked",color:"error"},done:{label:"Done",color:"success"}},Av=t=>t?Au[t]?.label??t:"Planned",Nv=t=>t?Au[t]?.color??"default":"info",Nu=t=>Math.min(100,Math.max(0,t??0)),Eu=(t,o=0)=>t.flatMap(r=>[{...r,level:o},...Eu(r.children??[],o+1)]),Ev=t=>({id:t.id,code:t.code??t.id,title:t.title,titleSub:t.project??t.workCenter??"General",project:t.project??"",workCenter:t.workCenter??"",owner:t.owner?.name??"Unassigned",status:Av(t.status),statusTone:t.status??"planned",progress:Nu(t.progress),startDate:t.startDate,endDate:t.endDate,color:t.color,reorderable:t.reorderable!==false}),Lu=(t,o)=>o==="month"?t.startOf("month"):o==="week"?t.startOf("week"):o==="day"?t.startOf("day"):t.startOf("hour"),Fu=(t,o)=>o==="month"?t.endOf("month"):o==="week"?t.endOf("week"):o==="day"?t.endOf("day"):t.endOf("hour"),Lv=(t,o,r)=>{let a=[],n=Lu(t,r),i=Fu(o,r);for(;n.isBefore(i)||n.isSame(i);){let s=r==="month"?n.add(1,"month"):r==="week"?n.add(1,"week"):r==="day"?n.add(1,"day"):n.add(1,"hour");a.push({key:`${r}-${n.valueOf()}`,label:r==="month"?n.format("MMM YYYY"):r==="week"?n.format("MMM D"):r==="day"?n.format("D"):n.format("HH:mm"),contextLabel:r==="hour"?n.format("MMM D"):r==="day"?n.format("MMM"):r==="week"?`W${n.isoWeek()}`:void 0,title:r==="hour"?n.format("MMM D, YYYY HH:mm"):r==="day"?n.format("MMM D, YYYY"):r==="week"?`${n.format("MMM D, YYYY")} - Week ${n.isoWeek()}`:void 0,start:n,end:s}),n=s;}return a},il=(t,o,r)=>{let a=0;for(let n of o){if(t.isBefore(n.start))return a;if(t.isBefore(n.end)){let i=Math.max(1,n.end.valueOf()-n.start.valueOf()),s=Math.max(0,t.valueOf()-n.start.valueOf());return a+s/i*r}a+=r;}return a},Bu=({appId:t="planning-gantt",tableKey:o="planning",serviceUrl:r,title:a="Project Plan",extraTools:n,bodyHeight:i=560,tasks:s,columns:c,scale:d="week",onScaleChange:m,page:p,rowsPerPage:f$1=20,rowsPerPageOptions:h=[20,50,100,-1],count:u,onPageChange:v,onRowsPerPageChange:y,timelineStart:g$1,timelineEnd:C,selectedTaskId:b$1,onTaskSelect:S,enableRowReorder:k=true,onTaskReorder:x,layout:E,layoutVariant:D,layoutVariantLoadKey:T,onLayoutIdChange:N,onLayoutSave:R,emptyLabel:w="No planning tasks available.",sx:M})=>{let I=ro(),{t:L}=ce(),O=useRef(null),U=useRef(null),z=useRef(null),K=useRef(false),[W,q]=useState(null),[H,V]=useState("content"),[Z,j]=useState(null),[me,ie]=useState(0),[ge,ye]=useState({}),[Ue,Oe]=useState(rl),[Ie,ze]=useState([]),Re=useRef(void 0),[Ce,Ve]=useState({activeId:null,overId:null}),[at,gt]=useState(null),[Je,te]=useState(false),We=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:4}})),Ne=useRef(null),Ee=useMemo(()=>Eu(s),[s]),st=useMemo(()=>{if(Ie.length===0)return Ee;let F=new Map(Ee.map(ve=>[ve.id,ve])),X=Ie.map(ve=>F.get(ve)).filter(ve=>!!ve),pe=new Set(X.map(ve=>ve.id));return [...X,...Ee.filter(ve=>!pe.has(ve.id))]},[Ee,Ie]),Ze=useMemo(()=>new Map(st.map(F=>[F.id,F])),[st]),ht=useMemo(()=>st.map(F=>Ev(F)),[st]),xt=useMemo(()=>new Map(ht.map(F=>[F.id,F])),[ht]),Nt=useMemo(()=>[{id:"code",label:"ID",minWidth:90},{id:"title",label:"Task",minWidth:260,render:(F,X)=>g(ne,{spacing:.2,children:[f(A,{sx:{fontSize:15,fontWeight:700,lineHeight:1.2},children:X.title}),f(A,{sx:{fontSize:13,color:"text.secondary"},children:X.titleSub})]})},{id:"owner",label:"Owner",minWidth:170},{id:"status",label:"Status",minWidth:130,render:(F,X)=>f(kt,{label:X.status,color:Nv(X.statusTone),size:"small"})},{id:"progress",label:"Progress",minWidth:140,numeric:true,render:F=>g(ne,{spacing:.6,children:[g(A,{variant:"caption",sx:{color:"text.secondary"},children:[F,"%"]}),f(Sa,{variant:"determinate",value:F,sx:{height:6,borderRadius:999}})]})},{id:"startDate",label:"Start",minWidth:120},{id:"endDate",label:"End",minWidth:120}],[]),Et=useMemo(()=>{if(!c||c.length===0)return Nt;let F=new Map(Nt.map(X=>[X.id,X]));return c.map(X=>{let pe=F.get(X.id),ve=X.width??pe?.minWidth??120,je={id:X.id,label:X.label,minWidth:ve};if(pe?.numeric&&(je.numeric=true),X.render){let Ke=X.render;return je.render=(Tt,mt)=>{let pt=Ze.get(mt.id);return Ke(pt||mt)},je}return pe?.render?(je.render=pe.render,je):(je.render=(Ke,Tt)=>{let mt=Tt[X.id];if(mt!=null&&String(mt).length>0)return String(mt);let wt=Ze.get(Tt.id)?.[X.id];return wt!=null&&String(wt).length>0?String(wt):"-"},je)})},[c,Nt,Ze]),ee=ra({appId:t,tableKey:o,title:a,columns:Et,rows:ht,rowKey:"id",page:p,rowsPerPage:f$1,rowsPerPageOptions:h,count:u??ht.length,onPageChange:v,onRowsPerPageChange:y,showSummary:false,layout:E,onLayoutSave:R}),tt=t?f(oa,{appId:t,tableKey:o,currentLayoutData:ee.currentLayoutData,onLayoutLoad:ee.handleLayoutLoad,targetLayoutId:ee.layoutIdToLoad,activeLayoutId:ee.currentLayoutId,serviceUrl:r}):null,Le=ee.visibleRows;useEffect(()=>{let F=Ee.map(X=>X.id);ze(X=>{let pe=new Set(F),ve=X.filter(mt=>pe.has(mt)),je=new Set(ve),Ke=F.filter(mt=>!je.has(mt)),Tt=[...ve,...Ke];return Tt.length===X.length&&Tt.every((mt,pt)=>mt===X[pt])?X:Tt});},[Ee]),useEffect(()=>{T===void 0||!D||Re.current!==T&&(Re.current=T,ee.handleVariantLoad(D));},[ee,D,T]),useEffect(()=>{N?.(ee.currentLayoutId);},[ee.currentLayoutId,N]);let se=F=>F.type==="group"?`group-${F.id}`:`row-${(F.data||F)?.id}`,ue=useMemo(()=>{let F=ht.map(pt=>Zo(pt.startDate)),X=ht.map(pt=>Zo(pt.endDate)),pe=g$1?Zo(g$1):F.reduce((pt,wt)=>wt.isBefore(pt)?wt:pt,F[0]??Zo()),ve=C?Zo(C):X.reduce((pt,wt)=>wt.isAfter(pt)?wt:pt,X[0]??Zo().add(30,"day")),je=d==="month"?"month":d==="week"?"week":d==="day"?"day":"hour",Ke=d==="month"?"month":d==="week"?"week":d==="day"?"day":"hour",Tt=d==="hour"?12:1,mt=d==="hour"?12:1;return {start:Lu(pe.subtract(Tt,je),d),end:Fu(ve.add(mt,Ke),d)}},[ht,d,C,g$1]),Q=ol.find(F=>F.value===d)??ol[1],we=Array.isArray(n)?n:n?[n]:[],ke=useMemo(()=>Lv(ue.start,ue.end,d),[ue.end,ue.start,d]),Xe=ke.length*Q.width,dt=ke.length>0?100/ke.length:100,lt=ke.length>0?`repeat(${ke.length}, minmax(${Q.width}px, 1fr))`:"1fr",Lt=ke.length>0?`calc(100% / ${ke.length}) 100%`:"100% 100%",$t=(ee.columns||[]).filter(F=>ee.visibleColumns.includes(F.id)).reduce((F,X)=>F+(ee.columnWidths?.[X.id]||X.minWidth||100),0)+(ee.grouping.length>0?72:0),bt=H==="manual"&&W!==null?W:$t,ft=Z==="table",vo=Z==="timeline",Pt=Z==="timeline",Ft=Z==="table",ct=!Pt&&!Ft,Bt=()=>{let F=me||O.current?.clientWidth||0;return F>0?Math.max(nl,F-Ja-Dv):Math.max(nl,$t)},xe=F=>Math.min(Math.max(F,nl),Bt()),_=(()=>{if(me<=0)return null;let F=ct?Ja:0;if(ft)return {tableWidth:me,splitterWidth:F,timelineWidth:0};if(vo)return {tableWidth:0,splitterWidth:F,timelineWidth:me};if(H==="even"){let pe=Math.max(0,(me-F)/2);return {tableWidth:pe,splitterWidth:F,timelineWidth:Math.max(0,me-F-pe)}}let X=xe(bt);return {tableWidth:X,splitterWidth:F,timelineWidth:Math.max(0,me-F-X)}})(),J=_?`${_.tableWidth}px ${_.splitterWidth}px ${_.timelineWidth}px`:ft?"minmax(0, 1fr) 0px 0px":vo?"0px 0px minmax(0, 1fr)":H==="even"?`minmax(0, 1fr) ${Ja}px minmax(0, 1fr)`:`${bt}px ${Ja}px minmax(0, 1fr)`;useEffect(()=>{H==="manual"&&q(F=>F===null?null:xe(F));},[H,$t,me]);let Te=F=>{F.preventDefault(),F.currentTarget.setPointerCapture(F.pointerId),j(null),V("manual"),Ne.current={startX:F.clientX,startWidth:U.current?.getBoundingClientRect().width??bt};let X=ve=>{let je=Ne.current;if(!je)return;let Ke=xe(je.startWidth+ve.clientX-je.startX);q(Ke);},pe=()=>{Ne.current=null,window.removeEventListener("pointermove",X),window.removeEventListener("pointerup",pe),document.body.style.cursor="",document.body.style.userSelect="";};document.body.style.cursor="col-resize",document.body.style.userSelect="none",window.addEventListener("pointermove",X),window.addEventListener("pointerup",pe);},fe=()=>{j(null),V("even"),q(null);},Me=F=>!k||!F?false:xt.get(F)?.reorderable!==false,$e=(F,X)=>{if(!F||!X||F===X||!Me(F)||!Me(X))return false;if(ee.grouping.length===0)return true;let pe=xt.get(F),ve=xt.get(X);return !pe||!ve?false:ee.grouping.every(je=>pe[je]===ve[je])},Qe=(F,X)=>{if(!$e(F,X))return;let pe=Le.filter(Ot=>Ot.type!=="group").map(Ot=>String((Ot.data||Ot)?.id)),ve=pe.indexOf(F),je=pe.indexOf(X);if(ve<0||je<0)return;let Ke=[...pe];[Ke[ve],Ke[je]]=[Ke[je],Ke[ve]];let Tt=new Set(pe),mt=st.map(Ot=>Ot.id),pt=[...Ke,...mt.filter(Ot=>!Tt.has(Ot))],wt=Ze.get(F),Jt=Ze.get(X);if(ee.setOrder("asc"),ee.setOrderBy(""),ze(pt),wt&&Jt){let{level:Ot,...Kt}=wt,{level:Vt,...Gt}=Jt,Ht=pt.reduce((Qt,eo)=>{let po=Ze.get(eo);if(po){let{level:ko,...Po}=po;Qt.push(Po);}return Qt},[]);x?.(Ht,{activeTask:Kt,targetTask:Gt});}},Ge=(F,X)=>{if(!Me(X.id)){F.preventDefault();return}F.stopPropagation(),F.dataTransfer.effectAllowed="move",F.dataTransfer.setData("text/plain",X.id),Ve({activeId:X.id,overId:null}),S?.(Ze.get(X.id)||X);},vt=(F,X)=>{if(!$e(Ce.activeId,X)){Ve(pe=>pe.overId===null?pe:{...pe,overId:null});return}F.preventDefault(),F.stopPropagation(),F.dataTransfer.dropEffect="move",Ve(pe=>pe.overId===X?pe:{...pe,overId:X});},Dt=(F,X)=>{let pe=Ce.activeId||F.dataTransfer.getData("text/plain");if(!$e(pe,X)){Ve({activeId:null,overId:null});return}F.preventDefault(),F.stopPropagation(),Qe(pe,X),Ve({activeId:null,overId:null});},St=()=>{Ve({activeId:null,overId:null});},yt=F=>{if(K.current)return;let X=F==="table"?U.current:z.current,pe=F==="table"?z.current:U.current;!X||!pe||(K.current=true,pe.scrollTop=X.scrollTop,window.requestAnimationFrame(()=>{K.current=false;}));};return useLayoutEffect(()=>{let F=O.current;if(!F){ie(0);return}let X=0,pe=()=>{window.cancelAnimationFrame(X),X=window.requestAnimationFrame(()=>{let je=F.clientWidth;ie(Ke=>Math.abs(Ke-je)<.5?Ke:je);});};if(pe(),typeof ResizeObserver>"u")return window.addEventListener("resize",pe),()=>{window.cancelAnimationFrame(X),window.removeEventListener("resize",pe);};let ve=new ResizeObserver(pe);return ve.observe(F),window.addEventListener("resize",pe),()=>{window.cancelAnimationFrame(X),ve.disconnect(),window.removeEventListener("resize",pe);}},[ht.length]),useLayoutEffect(()=>{if(!b$1||Ft)return;let F=z.current,X=U.current;if(!F)return;let pe=`row-${b$1}`,ve=Array.from(F.querySelectorAll("[data-planning-timeline-row-key]")).find(Tt=>Tt.dataset.planningTimelineRowKey===pe),je=xt.get(b$1);if(!ve||!je)return;let Ke=window.requestAnimationFrame(()=>{let Tt=F.getBoundingClientRect(),mt=ve.getBoundingClientRect(),pt=Math.max(1,F.clientHeight-Ue),wt=F.scrollTop+mt.top-Tt.top-Ue-(pt-mt.height)/2;K.current=true,F.scrollTop=Math.max(0,wt),X&&!Pt&&(X.scrollTop=F.scrollTop);let Jt=Math.max(1,F.scrollWidth),Ot=ke.length>0?Jt/ke.length:Q.width,Kt=il(Zo(je.startDate),ke,Ot),Vt=Math.max(0,Kt-Ot);F.scrollLeft=Math.min(Vt,Math.max(0,Jt-F.clientWidth)),window.requestAnimationFrame(()=>{K.current=false;});});return ()=>window.cancelAnimationFrame(Ke)},[Q.width,Ue,b$1,Pt,xt,Ft,Le,ke]),useLayoutEffect(()=>{let F=U.current;if(!F)return;let X=0,pe=0,ve=false,je=()=>{if(ve)return;let Vt=F.querySelector("thead"),Gt=Array.from(F.querySelectorAll("tbody tr[data-ctable-row-key]"));if(Gt.length===0)return;let Ht=Vt?.getBoundingClientRect().height||rl,Qt={};Gt.forEach(eo=>{let po=eo.dataset.ctableRowKey;po&&(Qt[po]=eo.getBoundingClientRect().height);}),Oe(eo=>Math.abs(eo-Ht)<.01?eo:Ht),ye(eo=>{let po=Object.keys(eo),ko=Object.keys(Qt);return po.length===ko.length&&ko.every(Po=>Math.abs((eo[Po]??0)-Qt[Po])<.01)?eo:Qt});},Ke=()=>{window.cancelAnimationFrame(X),X=window.requestAnimationFrame(je);};if(je(),window.cancelAnimationFrame(pe),pe=window.requestAnimationFrame(()=>{pe=window.requestAnimationFrame(je);}),typeof document<"u"&&document.fonts?.ready&&document.fonts.ready.then(()=>{ve||Ke();}).catch(()=>{}),typeof ResizeObserver>"u")return window.addEventListener("resize",Ke),()=>{ve=true,window.cancelAnimationFrame(X),window.cancelAnimationFrame(pe),window.removeEventListener("resize",Ke);};let Tt=new ResizeObserver(Ke),mt=F.querySelector("table"),pt=F.querySelector("tbody"),wt=F.querySelector("thead");mt&&Tt.observe(mt),wt&&Tt.observe(wt);let Jt=new WeakSet,Ot=()=>{F.querySelectorAll("tbody tr[data-ctable-row-key]").forEach(Vt=>{Jt.has(Vt)||(Tt.observe(Vt),Jt.add(Vt));});};Ot();let Kt=null;return pt&&typeof MutationObserver<"u"&&(Kt=new MutationObserver(()=>{Ot(),Ke();}),Kt.observe(pt,{childList:true,subtree:true,characterData:true})),window.addEventListener("resize",Ke),()=>{ve=true,window.cancelAnimationFrame(X),window.cancelAnimationFrame(pe),Tt.disconnect(),Kt?.disconnect(),window.removeEventListener("resize",Ke);}},[Le,ee.visibleColumns,ee.grouping,ee.columnWidths]),g(Ae,{className:"orb-ctable-surface orb-planning-gantt",elevation:0,sx:{m:0,p:0,display:"flex",flexDirection:"column",minHeight:0,overflow:"hidden",borderRadius:"var(--orb-r-container)",border:`1px solid ${I.palette.divider}`,...M},children:[f("div",{className:"orb-table-toolbar orb-planning-table-toolbar",role:"toolbar","aria-label":L("table.title.default"),children:g("div",{className:"orb-table-toolbar-primary",children:[f(Gn,{value:ee.filterText,onChange:F=>{ee.setFilterText(F),ee.setPage(0);}}),f($n,{rowsPerPage:ee.rowsPerPage,rowsPerPageOptions:h,page:ee.page,count:ee.totalDisplayCount,onRowsPerPageChange:ee.setRowsPerPage,onPageChange:ee.setPage}),we.length>0&&f("div",{className:"orb-table-toolbar-custom",children:we.map((F,X)=>f("div",{className:"orb-planning-extra-tool",children:F},`planning-extra-tool-${X}`))}),f("span",{className:"orb-table-toolbar-spacer"}),g("div",{className:"orb-table-toolbar-actions",children:[g("div",{className:"orb-table-tool-group",children:[f(ae,{className:"orb-table-tool-button",tooltip:"Column visibility",onClick:F=>ee.setAnchorEl(F.currentTarget),sx:io,children:f(Xr,{fontSize:"small"})}),f(ae,{className:"orb-table-tool-button",tooltip:"Group by",onClick:F=>ee.setGroupAnchorEl(F.currentTarget),sx:io,children:f(dr,{fontSize:"small"})}),f(ae,{className:`orb-table-tool-button ${ee.sortBy.length>0||ee.orderBy?"orb-is-active":""}`,tooltip:"Sort by...",active:ee.sortBy.length>0||!!ee.orderBy,onClick:()=>te(true),sx:io,children:f(Jc,{fontSize:"small"})})]}),tt&&f("div",{className:"orb-table-tool-group",children:tt}),f("div",{className:"orb-table-tool-group orb-planning-pane-controls",children:f(wa,{"aria-label":"Planning pane layout",size:"small",value:Z??(H==="even"?"split":null),options:[{value:"table",label:"Expand task table",icon:f(Bn,{fontSize:"small"})},{value:"split",label:"Split evenly",icon:f(zn,{fontSize:"small"})},{value:"timeline",label:"Expand timeline",icon:f(Fn,{fontSize:"small"})}],onValueChange:F=>{F==="split"?fe():j(F);}})}),f("div",{className:"orb-table-tool-group orb-planning-scale-control",children:f(_t,{label:"",value:d,options:ol.map(F=>({value:F.value,label:F.label})),onChange:F=>m?.(F.target.value)})})]})]})}),ht.length===0?f("div",{sx:{minHeight:240,display:"grid",placeItems:"center",color:"text.secondary"},children:w}):f("div",{sx:{overflow:"hidden",flex:1,minHeight:0},children:g("div",{ref:O,sx:{height:"100%",display:"grid",gridTemplateColumns:J,minWidth:0,transition:`grid-template-columns ${Er}`},children:[f("div",{"data-planning-scroll-pane":"table",ref:U,onScroll:()=>yt("table"),sx:{width:"100%",minWidth:0,maxWidth:"100%",height:i,overflowX:"auto",overflowY:"auto",opacity:Pt?0:1,transform:Pt?"translateX(-10px)":"translateX(0)",pointerEvents:Pt?"none":"auto",transition:`opacity ${Er}, transform ${Er}`},children:f(DndContext,{sensors:We,collisionDetection:closestCenter,modifiers:[restrictToHorizontalAxis],onDragEnd:F=>{let X=F?.active?.id,pe=F?.over?.id;typeof X=="string"&&typeof pe=="string"&&ee.handleColumnReorder(X,pe);},children:g("table",{className:"orb-tbl orb-ctable orb-planning-table",sx:{tableLayout:"fixed",width:$t,"& thead th":{height:rl,py:0,lineHeight:1.15,boxSizing:"border-box"}},children:[f(Kn,{columns:ee.columns,visibleColumns:ee.visibleColumns,order:ee.order,orderBy:ee.orderBy,sortBy:ee.sortBy,onRequestSort:ee.handleRequestSort,onContextMenu:(F,X)=>{F.preventDefault(),F.stopPropagation(),gt({mouseX:F.clientX+2,mouseY:F.clientY-6,columnId:X});},grouping:ee.grouping,isAllExpanded:ee.isAllExpanded,handleToggleAll:ee.handleToggleAll,columnWidths:ee.columnWidths,onColumnResize:ee.handleColumnResize,enableColumnReorder:true}),f(qn,{visibleRows:Le,columns:ee.columns,visibleColumns:ee.visibleColumns,selected:b$1?[b$1]:[],expandedGroups:ee.expandedGroups,toggleGroupExpand:ee.toggleGroupExpand,handleExpandGroupRecursively:ee.handleExpandGroupRecursively,handleCollapseGroupRecursively:ee.handleCollapseGroupRecursively,isGroupFullyExpanded:ee.isGroupFullyExpanded,grouping:ee.grouping,rowKeyProp:"id",page:ee.page,rowsPerPage:ee.rowsPerPage,emptyLabel:w,handleClick:(F,X)=>{S?.(Ze.get(X.id)||X);},getRowDataKey:({entry:F})=>se(F),getGroupRowProps:()=>({style:{height:al}}),getRowProps:({data:F})=>{let X=F,pe=Me(X.id),ve=Ce.activeId===X.id,je=Ce.overId===X.id&&$e(Ce.activeId,X.id);return {draggable:pe,className:je?"orb-is-drop-target":void 0,style:{cursor:ve?"grabbing":pe?"grab":S?"pointer":"default",height:al,opacity:ve?.56:1,transition:"background-color 120ms ease, opacity 120ms ease"},onDragStart:Ke=>Ge(Ke,X),onDragOver:Ke=>vt(Ke,X.id),onDragEnter:Ke=>vt(Ke,X.id),onDrop:Ke=>Dt(Ke,X.id),onDragEnd:St}}})]})})}),f("div",{onPointerDown:ct?Te:void 0,role:"separator","aria-orientation":"vertical",sx:{width:ct?Ja:0,cursor:ct?"col-resize":"default",opacity:ct?1:0,pointerEvents:ct?"auto":"none",borderLeft:ct?`1px solid ${I.palette.divider}`:"0 solid transparent",borderRight:ct?`1px solid ${I.palette.divider}`:"0 solid transparent",backgroundColor:b()==="dark"?"color-mix(in oklch, var(--orb-muted) 10%, transparent)":"color-mix(in oklch, var(--orb-fg) 4%, transparent)",transition:`width ${Er}, opacity ${Er}, background-color 120ms ease`,position:"relative","&:hover":{backgroundColor:I.palette.action.selected},"&::before":{content:'""',position:"absolute",top:0,bottom:0,left:-6,right:-6,cursor:ct?"col-resize":"default"}}}),f("div",{sx:{minWidth:0,overflow:"hidden",opacity:Ft?0:1,transform:Ft?"translateX(10px)":"translateX(0)",pointerEvents:Ft?"none":"auto",transition:`opacity ${Er}, transform ${Er}`},children:f("div",{"data-planning-scroll-pane":"timeline",ref:z,onScroll:()=>yt("timeline"),sx:{width:"100%",height:i,overflowX:"auto",overflowY:"auto"},children:g("div",{sx:{width:"100%",minWidth:Xe||"100%"},children:[f("div",{className:"orb-planning-timeline-header",sx:{display:"grid",gridTemplateColumns:lt,height:Ue,boxSizing:"border-box",borderBottom:`1px solid ${I.palette.divider}`,position:"sticky",top:0,zIndex:2},children:ke.map(F=>g("div",{title:F.title,sx:{px:.75,display:"flex",flexDirection:F.contextLabel?"column":"row",alignItems:"center",justifyContent:"center",gap:F.contextLabel?.15:0,borderRight:`1px solid ${I.palette.divider}`,color:F.contextLabel?"text.primary":"text.secondary",overflow:"hidden"},children:[F.contextLabel&&f(A,{component:"span",sx:{maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"text.secondary",fontSize:11,fontWeight:700,lineHeight:1.1},children:F.contextLabel}),f(A,{component:"span",sx:{maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:12,fontWeight:700,lineHeight:1.15},children:F.label})]},F.key))}),f(ne,{sx:{position:"relative"},children:Le.map(F=>{let X=se(F),pe=ge[X]??al;if(F.type==="group")return f("div",{className:"orb-planning-timeline-row orb-table-group-row","data-planning-timeline-row-key":X,sx:{position:"relative",height:pe,boxSizing:"border-box",borderBottom:`1px solid ${I.palette.divider}`}},F.id);let ve=F.data||F,je=Zo(ve.startDate),Ke=Zo(ve.endDate),Tt=il(je,ke,dt),mt=il(Ke,ke,dt),pt=Math.max(0,mt-Tt),wt=Nu(ve.progress),Jt=ve.id===b$1,Ot=Me(ve.id),Kt=Ce.activeId===ve.id,Vt=Ce.overId===ve.id&&$e(Ce.activeId,ve.id),Gt=ve.color??(ve.statusTone==="blocked"?I.palette.error.main:I.palette.primary.main);return f("div",{className:`orb-planning-timeline-row ${Jt?"orb-is-selected":""}`,"data-planning-timeline-row-key":X,draggable:Ot,onDragStart:Ht=>Ge(Ht,ve),onDragOver:Ht=>vt(Ht,ve.id),onDragEnter:Ht=>vt(Ht,ve.id),onDrop:Ht=>Dt(Ht,ve.id),onDragEnd:St,onClick:()=>S?.(Ze.get(ve.id)||ve),sx:{position:"relative",height:pe,boxSizing:"border-box",borderBottom:`1px solid ${I.palette.divider}`,opacity:Kt?.56:1,"&::before":{content:'""',position:"absolute",top:0,left:0,right:0,height:2,backgroundColor:I.palette.primary.main,opacity:Vt?1:0,transition:"opacity 120ms ease",pointerEvents:"none",zIndex:3},backgroundImage:b()==="dark"?"linear-gradient(90deg, color-mix(in oklch, var(--orb-muted) 8%, transparent) 1px, transparent 1px)":"linear-gradient(90deg, color-mix(in oklch, var(--orb-fg) 6%, transparent) 1px, transparent 1px)",backgroundSize:Lt,cursor:Kt?"grabbing":Ot?"grab":S?"pointer":"default",transition:"opacity 120ms ease"},children:f(nt,{title:`${ve.title}: ${je.format("MMM D HH:mm")} - ${Ke.format("MMM D HH:mm")}`,children:g("div",{sx:{position:"absolute",left:`${Tt}%`,top:Math.max(8,(pe-24)/2),width:`max(18px, ${pt}%)`,height:24,borderRadius:999,overflow:"hidden",backgroundColor:b()==="dark"?"color-mix(in oklch, var(--orb-muted) 18%, transparent)":"color-mix(in oklch, var(--orb-fg) 10%, transparent)",outline:Jt?`2px solid ${I.palette.warning.main}`:"none",outlineOffset:2},children:[f("div",{sx:{height:"100%",width:`${wt}%`,backgroundColor:Gt}}),f(A,{sx:{position:"absolute",inset:0,px:1,display:"flex",alignItems:"center",color:"var(--orb-on-primary)",fontSize:11,fontWeight:800,textShadow:"0 1px 4px rgba(0,0,0,0.45)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:ve.code})]})})},ve.id)})})]})})})]})}),f(Qr,{groupAnchorEl:ee.groupAnchorEl,setGroupAnchorEl:ee.setGroupAnchorEl,grouping:ee.grouping,setGrouping:ee.setGrouping,columns:ee.columns}),f(jr,{anchorEl:ee.anchorEl,setAnchorEl:ee.setAnchorEl,columns:ee.columns,visibleColumns:ee.visibleColumns,toggleColumnVisibility:ee.toggleColumnVisibility}),f(bd,{contextMenu:at,handleClose:()=>gt(null),columns:ee.columns,visibleColumns:ee.visibleColumns,grouping:ee.grouping,summaryColumns:ee.summaryColumns,showSummary:ee.showSummary,sortBy:ee.sortBy,orderBy:ee.orderBy,order:ee.order,onSortAsc:F=>{ee.applyMultiSort([{field:F,direction:"asc"}]);},onSortDesc:F=>{ee.applyMultiSort([{field:F,direction:"desc"}]);},onClearSort:F=>{let X=ee.sortBy.filter(pe=>pe.field!==F);X.length>0?ee.applyMultiSort(X):(ee.clearMultiSort(),ee.orderBy===F&&ee.setOrderBy(""));},onHideColumn:F=>{ee.visibleColumns.includes(F)&&ee.toggleColumnVisibility(F);},onToggleGroup:F=>ee.toggleGroupField(F),onToggleSummary:F=>ee.toggleSummaryColumn(F),onOpenSortDialog:()=>te(true)}),f(vd,{open:Je,onClose:()=>te(false),columns:ee.columns,initialRules:ee.sortBy.length>0?ee.sortBy:ee.orderBy?[{field:ee.orderBy,direction:ee.order}]:[],onApply:F=>ee.applyMultiSort(F),onClear:()=>{ee.clearMultiSort(),ee.setOrderBy("");}})]})};var JF=({filterProps:t,ganttProps:o,spacing:r=2,sx:a,children:n})=>{let i=a?[{height:"100%",overflow:"hidden"},a]:{height:"100%",overflow:"hidden"},s=o.sx?[{height:"100%"},o.sx]:{height:"100%"};return g(ne,{spacing:r,sx:i,children:[f("div",{sx:{flexShrink:0},children:f(Oo,{...t})}),f("div",{sx:{flex:1,minHeight:0,overflow:"hidden"},children:f(Bu,{...o,bodyHeight:o.bodyHeight??"100%",sx:s})}),n]})};var Ou=640,Fv=360,Bv=360,qi=8,fa="220ms cubic-bezier(0.2, 0, 0, 1)",cl=(t,o,r=0,a=[])=>t.flatMap(n=>{let i=n.children??[],s=[{node:n,level:r,hasChildren:i.length>0,parentIds:a}];return o.has(n.id)?[...s,...cl(i,o,r+1,[...a,n.id])]:s}),Vu=t=>t.flatMap(o=>[o,...Vu(o.children??[])]),Hu=(t,o=0,r=[])=>t.flatMap(a=>{let n=a.children??[];return [{node:a,level:o,hasChildren:n.length>0,parentIds:r},...Hu(n,o+1,[...r,a.id])]}),Wu=t=>t.flatMap(o=>{let r=o.children??[];return r.length===0?[]:[o.id,...Wu(r)]}),zu=t=>Object.entries(t).filter(([o])=>o!=="children").map(([,o])=>o==null?"":typeof o=="string"||typeof o=="number"||typeof o=="boolean"?String(o):"").join(" ").toLowerCase(),dB=({title:t,subtitle:o,nodes:r,columns:a,detail:n,selectedNodeId:i,defaultSelectedNodeId:s,onNodeSelect:c,expandedNodeIds:d,defaultExpandedNodeIds:m,onExpandedNodeIdsChange:p,defaultPaneMode:f$1="split",minTreePaneWidth:h=Fv,minDetailPaneWidth:u=Bv,tableAppId:v="ctree-comp",tableKey:y="default",tableTitle:g$1,filterConfig:C,searchQuery:b$1,searchToken:S,defaultRowsPerPage:k=-1,rowsPerPageOptions:x=[20,50,100,-1],serviceUrl:E,emptyLabel:D="No tree items available.",headerAction:T,sx:N,className:R})=>{let w=ro(),M=useRef(null),I=useRef(null),L=useRef(null),[O,U]=useState(s??r[0]?.id??null),[z,K]=useState(m??Wu(r).slice(0,3)),[W,q]=useState(f$1),[H,V]=useState(Ou),[Z,j]=useState(0),[me,ie]=useState(0),[ge,ye]=useState(k),Ue=useMemo(()=>a&&a.length>0?a:[{id:"label",label:"Name",render:se=>g(ne,{spacing:.3,children:[f(A,{sx:{fontSize:15,fontWeight:700,lineHeight:1.15},children:se.label}),se.subtitle&&f(A,{sx:{fontSize:13,color:"text.secondary",lineHeight:1.2},children:se.subtitle})]})}],[a]),Oe=useMemo(()=>new Set(d??z),[d,z]),Ie=useMemo(()=>cl(r,Oe),[r,Oe]),ze=useMemo(()=>Vu(r),[r]),Re=useMemo(()=>Hu(r),[r]),Ce=i===void 0?O:i,Ve=useMemo(()=>ze.find(se=>se.id===Ce)??null,[Ce,ze]),at=se=>{let ue=I.current?.clientWidth??0,Q=ue>0?Math.max(h,ue-qi-u):Math.max(h,se);return Math.min(Math.max(se,h),Q)},gt=W==="detail",Je=W==="tree"||!n,te=W==="split"&&!!n,Ne=(()=>{if(Z<=0)return null;if(W==="tree"||!n)return {treeWidth:Z,splitterWidth:0,detailWidth:0};if(W==="detail")return {treeWidth:0,splitterWidth:0,detailWidth:Z};let se=te?qi:0,ue=at(H);return {treeWidth:ue,splitterWidth:se,detailWidth:Math.max(0,Z-se-ue)}})(),Ee=Ne?`${Ne.treeWidth}px ${Ne.splitterWidth}px ${Ne.detailWidth}px`:W==="tree"||!n?"minmax(0, 1fr) 0px 0px":W==="detail"?"0px 0px minmax(0, 1fr)":`minmax(${h}px, ${H}px) ${qi}px minmax(${u}px, 1fr)`;useEffect(()=>{let se=I.current;if(!se){j(0);return}let ue=0,Q=()=>{window.cancelAnimationFrame(ue),ue=window.requestAnimationFrame(()=>{let ke=se.clientWidth;j(Xe=>Math.abs(Xe-ke)<.5?Xe:ke);});};if(Q(),typeof ResizeObserver>"u")return window.addEventListener("resize",Q),()=>{window.cancelAnimationFrame(ue),window.removeEventListener("resize",Q);};let we=new ResizeObserver(Q);return we.observe(se),window.addEventListener("resize",Q),()=>{window.cancelAnimationFrame(ue),we.disconnect(),window.removeEventListener("resize",Q);}},[]);let st=se=>{d===void 0&&K(se),p?.(se);},Ze=se=>{let ue=new Set(Oe);ue.has(se)?ue.delete(se):ue.add(se),st(Array.from(ue));},ht=se=>{i===void 0&&U(se.id),c?.(se);};useEffect(()=>{ie(0);},[r]),useEffect(()=>{let se=b$1?.trim().toLowerCase();if(!se)return;let ue=Re.find(({node:lt})=>zu(lt).includes(se));if(!ue)return;let Q=new Set(Oe);ue.parentIds.forEach(lt=>Q.add(lt)),st(Array.from(Q)),ht(ue.node);let ke=cl(r,Q).findIndex(({node:lt})=>lt.id===ue.node.id);ke>=0&&ge>0&&ie(Math.floor(ke/ge));let Xe=0,dt=0;return Xe=window.requestAnimationFrame(()=>{dt=window.requestAnimationFrame(()=>{let lt=M.current?.querySelector("tr.orb-selected"),Lt=lt?.closest(".orb-table-container");if(lt&&Lt){let $t=Lt.getBoundingClientRect(),bt=lt.getBoundingClientRect(),ft=bt.top-$t.top+Lt.scrollTop;Lt.scrollTo({top:ft-Lt.clientHeight/2+bt.height/2,behavior:"smooth"});return}lt?.scrollIntoView({block:"center",behavior:"smooth"});});}),()=>{window.cancelAnimationFrame(Xe),window.cancelAnimationFrame(dt);}},[b$1,S,Re,r,ge]);let xt=useMemo(()=>Ie.map(({node:se,level:ue,hasChildren:Q})=>({...se,id:se.id,__node:se,__level:ue,__hasChildren:Q,__expanded:Oe.has(se.id),__searchText:zu(se)})),[Oe,Ie]),Nt=useMemo(()=>Ue.map((se,ue)=>({id:se.id,label:se.label,minWidth:typeof se.width=="number"?se.width:se.minWidth??(ue===0?320:120),numeric:se.numeric??se.align==="right",render:(Q,we)=>{let ke=we.__node,Xe=se.render?se.render(ke):ke[se.id];if(ue!==0)return f(Se,{sx:{minWidth:0,color:se.align==="right"?"text.primary":"text.secondary",fontWeight:se.align==="right"?750:500,textAlign:se.align??"left"},children:Xe});let dt=Number(we.__level??0),lt=!!we.__hasChildren,Lt=!!we.__expanded;return g(ne,{direction:"row",alignItems:"center",spacing:1,sx:{minWidth:0,pl:`${dt*24}px`},children:[f(ae,{tooltip:lt?Lt?"Collapse":"Expand":"",onClick:$t=>{$t.stopPropagation(),lt&&Ze(ke.id);},disabled:!lt,sx:{width:24,height:24,visibility:lt?"visible":"hidden",transform:Lt?"rotate(0deg)":"rotate(-90deg)",transition:"transform 160ms ease"},children:f(Bo,{sx:{fontSize:20}})}),f(Se,{sx:{width:10,height:10,borderRadius:"50%",flexShrink:0,backgroundColor:ke.markerColor??w.palette.primary.main}}),f(Se,{sx:{minWidth:0},children:Xe})]})}})),[Ue,Oe,w.palette.primary.main]),Et=se=>{if(!te)return;se.preventDefault(),se.currentTarget.setPointerCapture(se.pointerId),L.current={startX:se.clientX,startWidth:H};let ue=we=>{let ke=L.current;ke&&V(at(ke.startWidth+we.clientX-ke.startX));},Q=()=>{L.current=null,window.removeEventListener("pointermove",ue),window.removeEventListener("pointerup",Q),document.body.style.cursor="",document.body.style.userSelect="";};document.body.style.cursor="col-resize",document.body.style.userSelect="none",window.addEventListener("pointermove",ue),window.addEventListener("pointerup",Q);},ee=()=>{let se=I.current?.clientWidth??0,ue=se>0?Math.max(h,(se-qi)/2):Ou;q("split"),V(at(ue));},tt=()=>n?typeof n=="function"?n(Ve):n:null,Le=n?f(wa,{"aria-label":"Tree pane layout",value:W,options:[{value:"tree",label:"Expand tree",icon:f(Bn,{fontSize:"small"})},{value:"split",label:"Split evenly",icon:f(zn,{fontSize:"small"})},{value:"detail",label:"Expand detail",icon:f(Fn,{fontSize:"small"})}],onValueChange:se=>{se==="split"?ee():q(se);},sx:{position:"absolute",top:13,right:56,zIndex:3,backdropFilter:"blur(10px)"}}):null;return g(Se,{ref:M,className:["ctree_comp",R].filter(Boolean).join(" "),sx:{position:"relative",height:"100%",minHeight:0,border:`1px solid ${w.palette.divider}`,borderRadius:"var(--orb-r-container)",overflow:"hidden",backgroundColor:"background.paper",boxShadow:`0 18px 42px ${et(w.palette.common.black,b()==="dark"?.24:.08)}`,...N},children:[Le,g(Se,{ref:I,sx:{height:"100%",display:"grid",gridTemplateColumns:Ee,transition:`grid-template-columns ${fa}`,minWidth:0},children:[g(Se,{"aria-hidden":gt?true:void 0,sx:{minWidth:0,overflow:"hidden",display:"flex",flexDirection:"column",opacity:gt?0:1,transform:gt?"translateX(-12px)":"translateX(0)",pointerEvents:gt?"none":"auto",transition:`opacity ${fa}, transform ${fa}`,willChange:"opacity, transform"},children:[g(ne,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:2,sx:{px:2,py:1.5,minHeight:74,borderBottom:`1px solid ${w.palette.divider}`},children:[g(ne,{direction:"row",alignItems:"center",spacing:1.4,sx:{minWidth:0},children:[f(dr,{sx:{color:"primary.main",fontSize:28}}),g(Se,{sx:{minWidth:0},children:[f(A,{sx:{fontSize:20,fontWeight:750,lineHeight:1.12},noWrap:true,children:t}),o&&f(A,{sx:{fontSize:14,color:"text.secondary",mt:.3},noWrap:true,children:o})]})]}),T!==void 0?T:f(ae,{tooltip:"Add node",color:"default",children:f(Ir,{fontSize:"small"})})]}),g(Se,{sx:{flex:1,minHeight:0,overflow:"hidden"},children:[f(qo,{appId:v,tableKey:y,title:g$1??(typeof t=="string"?t:"Tree"),columns:Nt,rows:xt,rowKey:"id",fitContainer:true,fullWidth:true,showSummary:false,selectionMode:"single",selected:Ce?[Ce]:[],onSelectionChange:se=>{let ue=se[se.length-1],Q=ze.find(we=>we.id===ue);Q&&ht(Q);},page:me,rowsPerPage:ge,rowsPerPageOptions:x,count:xt.length,onPageChange:ie,onRowsPerPageChange:se=>{ie(0),ye(se);},filterConfig:C,serviceUrl:E,graphReport:{enabled:false},disableGrouping:true,disableSorting:true,maxHeight:"100%"}),xt.length===0&&f(Se,{sx:{minHeight:220,display:"grid",placeItems:"center",color:"text.secondary"},children:D})]})]}),f(Se,{"data-ctree-splitter":"true",role:"separator","aria-orientation":"vertical",onPointerDown:te?Et:void 0,sx:{width:"100%",cursor:te?"col-resize":"default",backgroundColor:te?et(w.palette.text.primary,b()==="dark"?.16:.08):"transparent",opacity:te?1:0,pointerEvents:te?"auto":"none",position:"relative",transition:`opacity ${fa}, background-color 120ms ease`,"&:hover":{backgroundColor:te?et(w.palette.primary.main,b()==="dark"?.35:.18):"transparent"}}}),g(Se,{"aria-hidden":Je?true:void 0,sx:{minWidth:0,overflow:"hidden",display:"flex",flexDirection:"column",opacity:Je?0:1,transform:Je?"translateX(12px)":"translateX(0)",pointerEvents:Je?"none":"auto",transition:`opacity ${fa}, transform ${fa}`,willChange:"opacity, transform"},children:[f(Se,{sx:{px:2,pt:2,minHeight:74,display:"flex",alignItems:"flex-end"},children:f(At,{sx:{width:"100%"}})}),f(Se,{sx:{flex:1,minHeight:0,overflow:"auto",px:2,pb:2},children:tt()})]})]})]})};var Hv={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)"}}},fB=({children:t,transitionKey:o,variant:r="fade",durationMs:a=220,delayMs:n=0,easing:i="cubic-bezier(0.22, 1, 0.36, 1)",disabled:s=false,sx:c})=>{let d=cr("(prefers-reduced-motion: reduce)"),[m,p]=useState("to"),f$1=!s&&!d&&r!=="none";useEffect(()=>{if(!f$1){p("to");return}p("from");let v=requestAnimationFrame(()=>{v=requestAnimationFrame(()=>{p("to");});});return ()=>cancelAnimationFrame(v)},[o,f$1]);let h=Hv[r],u=useMemo(()=>f$1?m==="from"?h.from:h.to:{opacity:1,transform:"none"},[f$1,m,h.from,h.to]);return f(Se,{sx:{willChange:f$1?"opacity, transform":"auto",transition:f$1?`opacity ${a}ms ${i} ${n}ms, transform ${a}ms ${i} ${n}ms`:"none",backfaceVisibility:"hidden",...u,...c},children:t})},hB={subtle:{variant:"fade",durationMs:180},smooth:{variant:"slide-up",durationMs:220},snappy:{variant:"scale",durationMs:160}};export{J2 as AIBrowserGlow,hl as Activity,Su as AgentPanel,bl as AlertCircle,vl as AlertTriangle,cy as ArrowDown,dy as ArrowRight,py as ArrowUp,Yi as BarChart,uy as Bot,as as Button,Cb as CAINavProvider,_r as CAlert,Td as CAmapChart,bi as CAppHeader,Os as CAppHeaderSearch,_M as CAppPageLayout,uF as CAuthPage,Gr as CAvatar,hn as CBadge,Ba as CBarChart,be as CButton,Pa as CCalendar,Wd as CCardDetailPanel,Gd as CCardGrid,Mf as CCardGridCard,CR as CCardPage,Zn as CChartCard,Mt as CCheckbox,kt as CChip,xd as CComboChart,Rd as CCustomizeAgent,Km as CDatePicker,$1 as CDetailInfoPage,Qd as CDetailSearchAiBar,ui as CDetailSectionCard,zt as CDialog,At as CDivider,Xm as CFileUpload,ow as CFilterField,wd as CFishboneChart,Pd as CGoogleMapChart,Id as CGraphCharts,yd as CGraphKpiCards,ei as CGraphReport,Sd as CHeatmapChart,ae as CIconButton,hM as CKanbanBoard,op as CKanbanBucket,As as CKanbanCard,Od as CLayoutManagement,oa as CLayoutManager,Cd as CLineChart,qS as CList,XS as CListItem,JS as CListItemAvatar,YS as CListItemButton,ZS as CListItemIcon,QS as CListItemText,jS as CListSubheader,qt as CMenu,Aa as CMessageBox,Wn as CPageLayout,fB as CPageTransition,Ae as CPaper,Qn as CPieChart,NA as CPivotTable,Bu as CPlanningGantt,JF as CPlanningLayout,ts as CPopover,Sa as CProgress,vm as CRadioGroup,wa as CSegmentedControl,_t as CSelect,Pm as CSkeleton,Oo as CSmartFilter,VI as CSmartTable,$o as CSpinner,ne as CStack,KI as CStandardPage,_S as CStatusBadge,fn as CSwitch,qo as CTable,LI as CTableBody,FI as CTableCell,BI as CTableContainer,OI as CTableHead,zI as CTableRow,$m as CTabs,xa as CTextArea,Be as CTextField,nt as CTooltip,dB as CTreeComp,A as CTypography,dd as CValueHelp,ai as CVariantManagement,Nd as CVariantManager,qs as CVoiceWaveOverlay,kd as CWaterfallChart,Zi as Calendar,my as CalendarDays,gy as Camera,fy as ChartNoAxesCombined,Wr as Check,en as CheckCircle,Pr as ChevronDown,yl as ChevronLeft,Eo as ChevronRight,hy as ChevronUp,by as ChevronsDown,vy as ChevronsUp,tn as CircleAlert,va as CircleCheck,yy as CircleCheckBig,Cy as CircleStop,Cl as Clipboard,xy as ClipboardCheck,Sy as ClipboardList,xl as Clock,$a as CodeBlock,wy as Columns3,Z2 as CopilotChat,on as Copy,ky as CopyPlus,Py as Delete,Ty as Download,Sl as Edit,Iy as Expand,Ry as Eye,My as EyeOff,Dy as File,wl as FileText,Ay as Filter,$2 as FloatingAgentPanel,ya as FolderTree,kl as GitBranch,VS as GlobalMessage,Ca as Globe,Pl as Grid,Ny as GripVertical,Ey as Hammer,Ly as Image,rn as Info,Fy as Languages,By as Layers,Oy as LayoutDashboard,an as Lightbulb,Tl as LineChart,Il as Loader2,nn as Lock,zy as LockKeyhole,Rl as LogOut,Qi as Mail,Ml as MapPin,Ua as MarkdownRenderer,Ga as MathBlock,Vy as Menu,ws as MermaidBlock,tm as MessageCircle,Hy as MessageSquare,sn as Mic,Wy as MicOff,Dl as Moon,$y as MoreHorizontal,Zl as NavigationIsland,ss as NavigationIsland2,Ia as ORBCAFE_I18N_MESSAGES,Gu as ORB_DARK,$v as ORB_FONT_STACK,$u as ORB_LIGHT,_v as ORB_RADIUS,Xi as ORB_TOKENS,Uv as ORB_TRANSITION_FAST,yn as OrbcafeI18nProvider,ba as OrbisModeProvider,hB as PAGE_TRANSITION_PRESETS,nE as PAppPageLayout,ZA as PBarcodeScanner,Qp as PNavIsland,pN as PNumericKeypad,Kp as PSmartFilter,pb as PTable,rN as PTouchCard,qp as PWorkloadNav,Gy as PackageCheck,_y as PackageSearch,ln as PanelLeftOpen,cn as PanelRight,Uy as PanelsTopLeft,Al as PieChart,$r as Pin,Op as PivotChartPanel,Ky as Play,dn as Plus,qy as QrCode,Xy as ReceiptText,pn as RefreshCw,Yy as Rocket,Zy as RotateCcw,Nl as RotateCw,Qy as Rows3,Rt as SapIcon,jy as Save,Jy as ScanLine,Lo as Search,om as Send,El as SendHorizontal,un as Settings,eC as ShieldCheck,tC as Sigma,oC as SortAsc,rC as SquareSplitHorizontal,aC as Star,Cu as StdChat,Ll as Sun,nC as Table2,Ps as TableBlock,iC as TabletSmartphone,ji as Terminal,di as ThinkBlock,Fl as ThumbsDown,Bl as ThumbsUp,Ol as Trash2,Ra as TreeMenu,sC as TreePine,zl as TrendingDown,mn as TriangleAlert,lC as Truck,Vl as UploadCloud,Ji as User,hE as VoiceNavigatorProvider,dE as VoiceWaveOverlay,Hl as Volume2,cC as Warehouse,dC as Workflow,to as X,gn as XCircle,rp as addKanbanBucket,jn as buildAmapEmbedUrl,Oa as buildGoogleMapEmbedUrl,DP as buildGoogleMapIframe,Jm as buttonVariants,np as createKanbanBoardModel,re as createSapIcon,Vo as findKanbanCard,AS as message,Jo as messageManager,fi as moveKanbanCard,et as orbAlpha,Gv as orbChartSeries,ci as parseMarkdownTable,ap as renameKanbanBucket,g1 as renderMarkdown,si as resolveVariantFilters,li as resolveVariantLayout,xb as useAINav,LR as useAmapEmbedUrl,rF as useAuthPage,PR as useCardPage,Jd as useDetailInfo,ER as useGoogleMapEmbedUrl,RR as useGraphChartData,oi as useGraphInteraction,Jr as useGraphReport,xM as useKanbanBoard,Io as useMediaQuery,oc as useNavigationIsland,ho as useOrbMode,Xu as useOrbTokens,ce as useOrbcafeI18n,WA as usePadLayout,_A as usePadRecordEditor,up as usePageLayout,OA as usePivotTable,Du as usePlanningGantt,CF as usePlanningLayout,jI as useStandardReport,la as useVoiceInput,bE as useVoiceNavigator};
52
+ `,bH=({active:t=false,colors:r=$C,zIndex:o=2147483e3})=>{let n={"--orbcafe-ai-glow-line":r[0],"--orbcafe-ai-glow-z-index":o};return g(e,{children:[f("style",{children:GC}),f("div",{className:"orbcafe-ai-browser-glow","data-active":t?"true":"false",style:n,"aria-hidden":"true"})]})};var DH=({defaultMode:t="login",onLogin:r,onRegister:o,onForgotPassword:n}={})=>{let[a,i]=useState(t),[s,l]=useState(false),d=useCallback(async m=>{l(true);try{await m?.();}finally{l(false);}},[]),p=useCallback(m=>d(()=>r?.(m)),[r,d]),u=useCallback(m=>d(()=>o?.(m)),[o,d]),f=useCallback(m=>d(()=>n?.(m)),[n,d]),h=useMemo(()=>({mode:a,loading:s,onModeChange:i,onLogin:p,onRegister:u,onForgotPassword:f}),[f,p,u,s,a]);return {mode:a,loading:s,setMode:i,authPageProps:h}};var KC={productName:"ORBCAFE \u2014 Enterprise suite",headline:"We digitalize you.",subheadline:"One sign-in for planning, production and analytics across your value chain.",brandMeta:"ORBCAFE \xB7 Enterprise manufacturing suite",loginTitle:"Sign in",loginSubtitle:"Use your corporate account to continue.",registerTitle:"Create account",registerSubtitle:"Request a demo workspace user for evaluation.",forgotTitle:"Reset password",forgotSubtitle:"Send a password reset request to your email address."},zH=({mode:t,defaultMode:r="login",onModeChange:o,onLogin:n,onRegister:a,onForgotPassword:i,loading:s=false,logo:l,copy:d,sx:p})=>{let u=t!==void 0,[f$1,h]=useState(r),m=t??f$1,v=useMemo(()=>({...KC,...d}),[d]),[y,g$1]=useState({username:"demo@orbcafe.local",password:"orbcafe-demo",remember:true}),[x,b]=useState({name:"",email:"",password:"",confirmPassword:"",acceptedTerms:false}),[C,P]=useState({email:""}),[S,k]=useState(""),I=D=>{u||h(D),k(""),o?.(D);},w=async D=>{D.preventDefault(),await n?.(y),k("Demo login accepted. No real authentication request was sent.");},A=async D=>{D.preventDefault(),await a?.(x),k("Demo registration saved locally for this screen.");},R=async D=>{D.preventDefault(),await i?.(C),k("Demo reset link request created. No email was sent.");},T=m==="login"?v.loginTitle:m==="register"?v.registerTitle:v.forgotTitle,N=m==="login"?v.loginSubtitle:m==="register"?v.registerSubtitle:v.forgotSubtitle;return g("div",{className:"orb-auth-frame orb-root",style:p,children:[g("div",{className:"orb-auth-brand",children:[f("span",{className:"orb-auth-dia",style:{width:230,height:230,right:-70,bottom:-60}}),f("span",{className:"orb-auth-dia orb-auth-dia-sm-hide",style:{width:140,height:140,right:120,bottom:80,borderColor:"rgba(255,255,255,.09)"}}),f("span",{className:"orb-auth-dia orb-auth-dia-sm-hide",style:{width:76,height:76,right:60,bottom:170,background:"color-mix(in oklch, var(--orb-primary) 35%, transparent)",borderColor:"rgba(255,255,255,.2)"}}),l?f("span",{style:{alignSelf:"flex-start",position:"relative"},children:l}):f("span",{className:"orb-logo-slot",children:"Host logo"}),g("div",{className:"orb-auth-claim",children:[f("div",{className:"orb-auth-rule"}),f("h2",{children:v.headline}),f("p",{children:v.subheadline})]}),f("div",{className:"orb-auth-meta",children:v.brandMeta})]}),f("div",{className:"orb-auth-form",children:g("div",{className:"orb-auth-card",children:[f("span",{className:"orb-overline",style:{letterSpacing:"0.12em"},children:v.productName}),f("h1",{className:"orb-h2",style:{margin:0},children:T}),f("p",{className:"orb-body-dense",style:{color:"var(--orb-muted)",margin:"-10px 0 0"},children:N}),S&&f(Jo,{severity:"success",children:S}),m==="login"&&g("form",{onSubmit:w,style:{display:"flex",flexDirection:"column",gap:16},children:[f(He,{label:"Email",type:"email",autoComplete:"username",value:y.username,onChange:D=>g$1(L=>({...L,username:D.target.value})),startAdornment:f(Rs,{size:15,strokeWidth:1.8})}),f(He,{label:"Password",type:"password",autoComplete:"current-password",value:y.password,onChange:D=>g$1(L=>({...L,password:D.target.value})),startAdornment:f(Pa,{size:15,strokeWidth:1.8})}),g("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12},children:[f(Rt,{label:"Remember me",checked:y.remember,onChange:D=>g$1(L=>({...L,remember:D.target.checked}))}),f("button",{type:"button",className:"orb-link",onClick:()=>I("forgot"),children:"Forgot password?"})]}),f(ye,{type:"submit",size:"large",block:true,loading:s,children:s?"Signing in\u2026":"Sign in"}),g("p",{className:"orb-meta",style:{textAlign:"center",margin:0},children:["New user?"," ",f("button",{type:"button",className:"orb-link",onClick:()=>I("register"),children:"Register"})]})]}),m==="register"&&g("form",{onSubmit:A,style:{display:"flex",flexDirection:"column",gap:16},children:[f(He,{label:"Full name",value:x.name,onChange:D=>b(L=>({...L,name:D.target.value})),startAdornment:f(Rs,{size:15,strokeWidth:1.8})}),f(He,{label:"Work email",type:"email",autoComplete:"username",value:x.email,onChange:D=>b(L=>({...L,email:D.target.value})),startAdornment:f(Ms,{size:15,strokeWidth:1.8})}),f(He,{label:"Password",type:"password",autoComplete:"new-password",value:x.password,onChange:D=>b(L=>({...L,password:D.target.value})),startAdornment:f(Pa,{size:15,strokeWidth:1.8})}),f(He,{label:"Confirm password",type:"password",autoComplete:"new-password",value:x.confirmPassword,onChange:D=>b(L=>({...L,confirmPassword:D.target.value}))}),f(Rt,{label:"I accept the demo workspace terms",checked:x.acceptedTerms,onChange:D=>b(L=>({...L,acceptedTerms:D.target.checked}))}),f(ye,{type:"submit",size:"large",block:true,loading:s,children:"Create demo account"}),g("p",{className:"orb-meta",style:{textAlign:"center",margin:0},children:["Already have an account?"," ",f("button",{type:"button",className:"orb-link",onClick:()=>I("login"),children:"Sign in"})]})]}),m==="forgot"&&g("form",{onSubmit:R,style:{display:"flex",flexDirection:"column",gap:16},children:[f(He,{label:"Work email",type:"email",autoComplete:"username",value:C.email,onChange:D=>P({email:D.target.value}),startAdornment:f(Ms,{size:15,strokeWidth:1.8})}),f(ye,{type:"submit",size:"large",block:true,loading:s,children:"Send reset request"}),g("p",{className:"orb-meta",style:{textAlign:"center",margin:0},children:["Remember your password?"," ",f("button",{type:"button",className:"orb-link",onClick:()=>I("login"),children:"Back to sign in"})]})]}),g("div",{style:{display:"flex",alignItems:"center",gap:12,font:"500 10px/1 var(--orb-font)",letterSpacing:"0.1em",textTransform:"uppercase",color:"var(--orb-muted)"},children:[f("span",{style:{flex:1,height:1,background:"var(--orb-border)"}}),"or",f("span",{style:{flex:1,height:1,background:"var(--orb-border)"}})]}),f(ye,{variant:"neutral",size:"large",block:true,children:"Continue with corporate SSO"}),g("p",{className:"orb-meta",style:{textAlign:"center",fontWeight:300,margin:0},children:["Protected by corporate single sign-on.",f("br",{}),"Demo credentials: demo@orbcafe.local / orbcafe-demo"]})]})})]})};var XC={keyword:{value:"",operator:"contains"},status:{value:"",operator:"equals"},owner:{value:"",operator:"contains"},workCenter:{value:"",operator:"contains"}},YC=[{id:"keyword",label:"Keyword",type:"text",placeholder:"Task/ID/Project",hasSearchIcon:true},{id:"status",label:"Status",type:"select",options:[{label:"In progress",value:"in-progress"},{label:"Blocked",value:"blocked"},{label:"Planned",value:"planned"},{label:"Not started",value:"not-started"}]},{id:"owner",label:"Owner",type:"text",placeholder:"Owner name"},{id:"workCenter",label:"Work Center",type:"text",placeholder:"CNC-02 / WH-A / ..."},{id:"dateRange",label:"Date Range",type:"date"}],rg=({tasks:t,appId:r,tableKey:o,defaultScale:n="week",defaultSelectedTaskId:a,initialFilters:i,filterFields:s,filterAppId:l,filterTableKey:d,serviceUrl:p,variantService:u,layout:f,columns:h,page:m,rowsPerPage:v,rowsPerPageOptions:y,count:g,onPageChange:x,onRowsPerPageChange:b,onFilterSearch:C,onFilterVariantLoad:P,enableRowReorder:S,onTaskReorder:k,onLayoutIdChange:I,onLayoutSave:w})=>{let A=r??l??"planning-gantt",R=o??d??"planning",[T,N]=useState(n),[D,L]=useState(a??t[0]?.id??""),[B,X]=useState(""),[H,K]=useState(null),[W,G]=useState({...XC,...i}),z=useMemo(()=>{let se=String(W.keyword?.value??"").trim().toLowerCase(),fe=String(W.status?.value??"").trim(),Ge=String(W.owner?.value??"").trim().toLowerCase(),Re=String(W.workCenter?.value??"").trim().toLowerCase(),ke=W.dateRange?.value,ze=ke?.[0]?eo(ke[0]):null,Pe=ke?.[1]?eo(ke[1]):null;return t.filter(Ce=>{if(se&&![Ce.id,Ce.code,Ce.title,Ce.project,Ce.workCenter,Ce.owner?.name].join(" ").toLowerCase().includes(se)||fe&&Ce.status!==fe||Ge&&!String(Ce.owner?.name??"").toLowerCase().includes(Ge)||Re&&!String(Ce.workCenter??"").toLowerCase().includes(Re))return false;if(ze||Pe){let Ve=eo(Ce.startDate),rt=eo(Ce.endDate),at=ze?rt.isAfter(ze)||rt.isSame(ze,"day"):true,Ye=Pe?Ve.isBefore(Pe)||Ve.isSame(Pe,"day"):true;if(!at||!Ye)return false}return true})},[W,t]);useEffect(()=>{z.length!==0&&(z.some(se=>se.id===D)||L(z[0].id));},[z,D]);let O=useCallback(se=>{L(se.id);},[]),Y=useCallback(se=>{X(se),I?.(se);},[I]),Q=useCallback(se=>{K(fe=>({key:(fe?.key??0)+1,variant:se})),P?.(se);},[P]),me=useMemo(()=>({appId:A,tableKey:R,fields:s??YC,filters:W,onFilterChange:G,onVariantLoad:Q,onSearch:C??(()=>{}),currentLayoutId:B,layoutRefs:[{tableKey:R,layoutId:B||null}],variantService:u,serviceUrl:p}),[B,s,W,Q,C,A,R,p,u]),ie=useMemo(()=>({appId:A,tableKey:R,serviceUrl:p,tasks:z,columns:h,scale:T,onScaleChange:N,page:m,rowsPerPage:v,rowsPerPageOptions:y,count:g,onPageChange:x,onRowsPerPageChange:b,selectedTaskId:D,onTaskSelect:O,enableRowReorder:S,onTaskReorder:k,layout:f,layoutVariant:H?.variant,layoutVariantLoadKey:H?.key,onLayoutIdChange:Y,onLayoutSave:w}),[h,g,S,z,Y,f,H?.key,H?.variant,x,b,w,k,O,m,A,R,v,y,T,p,D]);return {scale:T,setScale:N,selectedTaskId:D,setSelectedTaskId:L,filters:W,setFilters:G,filteredTasks:z,smartFilterProps:me,planningGanttProps:ie}};var qH=t=>{let r=rg(t),o=useMemo(()=>({filterProps:r.smartFilterProps,ganttProps:r.planningGanttProps}),[r.planningGanttProps,r.smartFilterProps]);return {...r,layoutProps:o}};eo.extend(QC);var ql=[{value:"hour",label:"Hour",width:56},{value:"day",label:"Day",width:46},{value:"week",label:"Week",width:78},{value:"month",label:"Month",width:104}],Xl=36,Yl=58,ba=8,Zl=260,nx=320,$o="220ms cubic-bezier(0.2, 0, 0, 1)",og={"not-started":{label:"Not started",color:"default"},planned:{label:"Planned",color:"info"},"in-progress":{label:"In progress",color:"primary"},blocked:{label:"Blocked",color:"error"},done:{label:"Done",color:"success"}},ax=t=>t?og[t]?.label??t:"Planned",ix=t=>t?og[t]?.color??"default":"info",ng=t=>Math.min(100,Math.max(0,t??0)),ag=(t,r=0)=>t.flatMap(o=>[{...o,level:r},...ag(o.children??[],r+1)]),sx=t=>({id:t.id,code:t.code??t.id,title:t.title,titleSub:t.project??t.workCenter??"General",project:t.project??"",workCenter:t.workCenter??"",owner:t.owner?.name??"Unassigned",status:ax(t.status),statusTone:t.status??"planned",progress:ng(t.progress),startDate:t.startDate,endDate:t.endDate,color:t.color,reorderable:t.reorderable!==false}),ig=(t,r)=>r==="month"?t.startOf("month"):r==="week"?t.startOf("week"):r==="day"?t.startOf("day"):t.startOf("hour"),sg=(t,r)=>r==="month"?t.endOf("month"):r==="week"?t.endOf("week"):r==="day"?t.endOf("day"):t.endOf("hour"),lx=(t,r,o)=>{let n=[],a=ig(t,o),i=sg(r,o);for(;a.isBefore(i)||a.isSame(i);){let s=o==="month"?a.add(1,"month"):o==="week"?a.add(1,"week"):o==="day"?a.add(1,"day"):a.add(1,"hour");n.push({key:`${o}-${a.valueOf()}`,label:o==="month"?a.format("MMM YYYY"):o==="week"?a.format("MMM D"):o==="day"?a.format("D"):a.format("HH:mm"),contextLabel:o==="hour"?a.format("MMM D"):o==="day"?a.format("MMM"):o==="week"?`W${a.isoWeek()}`:void 0,title:o==="hour"?a.format("MMM D, YYYY HH:mm"):o==="day"?a.format("MMM D, YYYY"):o==="week"?`${a.format("MMM D, YYYY")} - Week ${a.isoWeek()}`:void 0,start:a,end:s}),a=s;}return n},Ql=(t,r,o)=>{let n=0;for(let a of r){if(t.isBefore(a.start))return n;if(t.isBefore(a.end)){let i=Math.max(1,a.end.valueOf()-a.start.valueOf()),s=Math.max(0,t.valueOf()-a.start.valueOf());return n+s/i*o}n+=o;}return n},lg=({appId:t="planning-gantt",tableKey:r="planning",serviceUrl:o,title:n="Project Plan",extraTools:a,bodyHeight:i=560,tasks:s,columns:l,scale:d="week",onScaleChange:p,page:u,rowsPerPage:f$1=20,rowsPerPageOptions:h=[20,50,100,-1],count:m,onPageChange:v,onRowsPerPageChange:y,timelineStart:g$1,timelineEnd:x,selectedTaskId:b$1,onTaskSelect:C,enableRowReorder:P=true,onTaskReorder:S,layout:k,layoutVariant:I,layoutVariantLoadKey:w,onLayoutIdChange:A,onLayoutSave:R,emptyLabel:T="No planning tasks available.",sx:N})=>{let D=ar(),{t:L}=de(),B=useRef(null),X=useRef(null),H=useRef(null),K=useRef(false),[W,G]=useState(null),[z,O]=useState("content"),[Y,Q]=useState(null),[me,ie]=useState(0),[se,fe]=useState({}),[Ge,Re]=useState(Xl),[ke,ze]=useState([]),Pe=useRef(void 0),[Ce,Ve]=useState({activeId:null,overId:null}),[rt,at]=useState(null),[Ye,_]=useState(false),Oe=useSensors(useSensor(PointerSensor,{activationConstraint:{distance:4}})),ve=useRef(null),Ee=useMemo(()=>ag(s),[s]),it=useMemo(()=>{if(ke.length===0)return Ee;let F=new Map(Ee.map(xe=>[xe.id,xe])),Z=ke.map(xe=>F.get(xe)).filter(xe=>!!xe),ue=new Set(Z.map(xe=>xe.id));return [...Z,...Ee.filter(xe=>!ue.has(xe.id))]},[Ee,ke]),je=useMemo(()=>new Map(it.map(F=>[F.id,F])),[it]),ht=useMemo(()=>it.map(F=>sx(F)),[it]),xt=useMemo(()=>new Map(ht.map(F=>[F.id,F])),[ht]),At=useMemo(()=>[{id:"code",label:"ID",minWidth:90},{id:"title",label:"Task",minWidth:260,render:(F,Z)=>g(ae,{spacing:.2,children:[f(E,{sx:{fontSize:15,fontWeight:700,lineHeight:1.2},children:Z.title}),f(E,{sx:{fontSize:13,color:"text.secondary"},children:Z.titleSub})]})},{id:"owner",label:"Owner",minWidth:170},{id:"status",label:"Status",minWidth:130,render:(F,Z)=>f(kt,{label:Z.status,color:ix(Z.statusTone),size:"small"})},{id:"progress",label:"Progress",minWidth:140,numeric:true,render:F=>g(ae,{spacing:.6,children:[g(E,{variant:"caption",sx:{color:"text.secondary"},children:[F,"%"]}),f(Fn,{variant:"determinate",value:F,sx:{height:6,borderRadius:999}})]})},{id:"startDate",label:"Start",minWidth:120},{id:"endDate",label:"End",minWidth:120}],[]),Et=useMemo(()=>{if(!l||l.length===0)return At;let F=new Map(At.map(Z=>[Z.id,Z]));return l.map(Z=>{let ue=F.get(Z.id),xe=Z.width??ue?.minWidth??120,et={id:Z.id,label:Z.label,minWidth:xe};if(ue?.numeric&&(et.numeric=true),Z.render){let qe=Z.render;return et.render=(Tt,gt)=>{let mt=je.get(gt.id);return qe(mt||gt)},et}return ue?.render?(et.render=ue.render,et):(et.render=(qe,Tt)=>{let gt=Tt[Z.id];if(gt!=null&&String(gt).length>0)return String(gt);let wt=je.get(Tt.id)?.[Z.id];return wt!=null&&String(wt).length>0?String(wt):"-"},et)})},[l,At,je]),te=mn({appId:t,tableKey:r,title:n,columns:Et,rows:ht,rowKey:"id",page:u,rowsPerPage:f$1,rowsPerPageOptions:h,count:m??ht.length,onPageChange:v,onRowsPerPageChange:y,showSummary:false,layout:k,onLayoutSave:R}),ot=t?f(un,{appId:t,tableKey:r,currentLayoutData:te.currentLayoutData,onLayoutLoad:te.handleLayoutLoad,targetLayoutId:te.layoutIdToLoad,activeLayoutId:te.currentLayoutId,serviceUrl:o}):null,Fe=te.visibleRows;useEffect(()=>{let F=Ee.map(Z=>Z.id);ze(Z=>{let ue=new Set(F),xe=Z.filter(gt=>ue.has(gt)),et=new Set(xe),qe=F.filter(gt=>!et.has(gt)),Tt=[...xe,...qe];return Tt.length===Z.length&&Tt.every((gt,mt)=>gt===Z[mt])?Z:Tt});},[Ee]),useEffect(()=>{w===void 0||!I||Pe.current!==w&&(Pe.current=w,te.handleVariantLoad(I));},[te,I,w]),useEffect(()=>{A?.(te.currentLayoutId);},[te.currentLayoutId,A]);let le=F=>F.type==="group"?`group-${F.id}`:`row-${(F.data||F)?.id}`,ge=useMemo(()=>{let F=ht.map(mt=>eo(mt.startDate)),Z=ht.map(mt=>eo(mt.endDate)),ue=g$1?eo(g$1):F.reduce((mt,wt)=>wt.isBefore(mt)?wt:mt,F[0]??eo()),xe=x?eo(x):Z.reduce((mt,wt)=>wt.isAfter(mt)?wt:mt,Z[0]??eo().add(30,"day")),et=d==="month"?"month":d==="week"?"week":d==="day"?"day":"hour",qe=d==="month"?"month":d==="week"?"week":d==="day"?"day":"hour",Tt=d==="hour"?12:1,gt=d==="hour"?12:1;return {start:ig(ue.subtract(Tt,et),d),end:sg(xe.add(gt,qe),d)}},[ht,d,x,g$1]),J=ql.find(F=>F.value===d)??ql[1],Te=Array.isArray(a)?a:a?[a]:[],Ie=useMemo(()=>lx(ge.start,ge.end,d),[ge.end,ge.start,d]),Ze=Ie.length*J.width,ut=Ie.length>0?100/Ie.length:100,dt=Ie.length>0?`repeat(${Ie.length}, minmax(${J.width}px, 1fr))`:"1fr",Lt=Ie.length>0?`calc(100% / ${Ie.length}) 100%`:"100% 100%",_t=(te.columns||[]).filter(F=>te.visibleColumns.includes(F.id)).reduce((F,Z)=>F+(te.columnWidths?.[Z.id]||Z.minWidth||100),0)+(te.grouping.length>0?72:0),bt=z==="manual"&&W!==null?W:_t,ft=Y==="table",yr=Y==="timeline",Pt=Y==="timeline",Ot=Y==="table",pt=!Pt&&!Ot,Ft=()=>{let F=me||B.current?.clientWidth||0;return F>0?Math.max(Zl,F-ba-nx):Math.max(Zl,_t)},Se=F=>Math.min(Math.max(F,Zl),Ft()),q=(()=>{if(me<=0)return null;let F=pt?ba:0;if(ft)return {tableWidth:me,splitterWidth:F,timelineWidth:0};if(yr)return {tableWidth:0,splitterWidth:F,timelineWidth:me};if(z==="even"){let ue=Math.max(0,(me-F)/2);return {tableWidth:ue,splitterWidth:F,timelineWidth:Math.max(0,me-F-ue)}}let Z=Se(bt);return {tableWidth:Z,splitterWidth:F,timelineWidth:Math.max(0,me-F-Z)}})(),ee=q?`${q.tableWidth}px ${q.splitterWidth}px ${q.timelineWidth}px`:ft?"minmax(0, 1fr) 0px 0px":yr?"0px 0px minmax(0, 1fr)":z==="even"?`minmax(0, 1fr) ${ba}px minmax(0, 1fr)`:`${bt}px ${ba}px minmax(0, 1fr)`;useEffect(()=>{z==="manual"&&G(F=>F===null?null:Se(F));},[z,_t,me]);let De=F=>{F.preventDefault(),F.currentTarget.setPointerCapture(F.pointerId),Q(null),O("manual"),ve.current={startX:F.clientX,startWidth:X.current?.getBoundingClientRect().width??bt};let Z=xe=>{let et=ve.current;if(!et)return;let qe=Se(et.startWidth+xe.clientX-et.startX);G(qe);},ue=()=>{ve.current=null,window.removeEventListener("pointermove",Z),window.removeEventListener("pointerup",ue),document.body.style.cursor="",document.body.style.userSelect="";};document.body.style.cursor="col-resize",document.body.style.userSelect="none",window.addEventListener("pointermove",Z),window.addEventListener("pointerup",ue);},he=()=>{Q(null),O("even"),G(null);},Ne=F=>!P||!F?false:xt.get(F)?.reorderable!==false,_e=(F,Z)=>{if(!F||!Z||F===Z||!Ne(F)||!Ne(Z))return false;if(te.grouping.length===0)return true;let ue=xt.get(F),xe=xt.get(Z);return !ue||!xe?false:te.grouping.every(et=>ue[et]===xe[et])},Je=(F,Z)=>{if(!_e(F,Z))return;let ue=Fe.filter(Bt=>Bt.type!=="group").map(Bt=>String((Bt.data||Bt)?.id)),xe=ue.indexOf(F),et=ue.indexOf(Z);if(xe<0||et<0)return;let qe=[...ue];[qe[xe],qe[et]]=[qe[et],qe[xe]];let Tt=new Set(ue),gt=it.map(Bt=>Bt.id),mt=[...qe,...gt.filter(Bt=>!Tt.has(Bt))],wt=je.get(F),rr=je.get(Z);if(te.setOrder("asc"),te.setOrderBy(""),ze(mt),wt&&rr){let{level:Bt,...qt}=wt,{level:zt,...Ut}=rr,Wt=mt.reduce((er,or)=>{let ur=je.get(or);if(ur){let{level:Pr,...Tr}=ur;er.push(Tr);}return er},[]);S?.(Wt,{activeTask:qt,targetTask:Ut});}},Ue=(F,Z)=>{if(!Ne(Z.id)){F.preventDefault();return}F.stopPropagation(),F.dataTransfer.effectAllowed="move",F.dataTransfer.setData("text/plain",Z.id),Ve({activeId:Z.id,overId:null}),C?.(je.get(Z.id)||Z);},vt=(F,Z)=>{if(!_e(Ce.activeId,Z)){Ve(ue=>ue.overId===null?ue:{...ue,overId:null});return}F.preventDefault(),F.stopPropagation(),F.dataTransfer.dropEffect="move",Ve(ue=>ue.overId===Z?ue:{...ue,overId:Z});},Dt=(F,Z)=>{let ue=Ce.activeId||F.dataTransfer.getData("text/plain");if(!_e(ue,Z)){Ve({activeId:null,overId:null});return}F.preventDefault(),F.stopPropagation(),Je(ue,Z),Ve({activeId:null,overId:null});},St=()=>{Ve({activeId:null,overId:null});},yt=F=>{if(K.current)return;let Z=F==="table"?X.current:H.current,ue=F==="table"?H.current:X.current;!Z||!ue||(K.current=true,ue.scrollTop=Z.scrollTop,window.requestAnimationFrame(()=>{K.current=false;}));};return useLayoutEffect(()=>{let F=B.current;if(!F){ie(0);return}let Z=0,ue=()=>{window.cancelAnimationFrame(Z),Z=window.requestAnimationFrame(()=>{let et=F.clientWidth;ie(qe=>Math.abs(qe-et)<.5?qe:et);});};if(ue(),typeof ResizeObserver>"u")return window.addEventListener("resize",ue),()=>{window.cancelAnimationFrame(Z),window.removeEventListener("resize",ue);};let xe=new ResizeObserver(ue);return xe.observe(F),window.addEventListener("resize",ue),()=>{window.cancelAnimationFrame(Z),xe.disconnect(),window.removeEventListener("resize",ue);}},[ht.length]),useLayoutEffect(()=>{if(!b$1||Ot)return;let F=H.current,Z=X.current;if(!F)return;let ue=`row-${b$1}`,xe=Array.from(F.querySelectorAll("[data-planning-timeline-row-key]")).find(Tt=>Tt.dataset.planningTimelineRowKey===ue),et=xt.get(b$1);if(!xe||!et)return;let qe=window.requestAnimationFrame(()=>{let Tt=F.getBoundingClientRect(),gt=xe.getBoundingClientRect(),mt=Math.max(1,F.clientHeight-Ge),wt=F.scrollTop+gt.top-Tt.top-Ge-(mt-gt.height)/2;K.current=true,F.scrollTop=Math.max(0,wt),Z&&!Pt&&(Z.scrollTop=F.scrollTop);let rr=Math.max(1,F.scrollWidth),Bt=Ie.length>0?rr/Ie.length:J.width,qt=Ql(eo(et.startDate),Ie,Bt),zt=Math.max(0,qt-Bt);F.scrollLeft=Math.min(zt,Math.max(0,rr-F.clientWidth)),window.requestAnimationFrame(()=>{K.current=false;});});return ()=>window.cancelAnimationFrame(qe)},[J.width,Ge,b$1,Pt,xt,Ot,Fe,Ie]),useLayoutEffect(()=>{let F=X.current;if(!F)return;let Z=0,ue=0,xe=false,et=()=>{if(xe)return;let zt=F.querySelector("thead"),Ut=Array.from(F.querySelectorAll("tbody tr[data-ctable-row-key]"));if(Ut.length===0)return;let Wt=zt?.getBoundingClientRect().height||Xl,er={};Ut.forEach(or=>{let ur=or.dataset.ctableRowKey;ur&&(er[ur]=or.getBoundingClientRect().height);}),Re(or=>Math.abs(or-Wt)<.01?or:Wt),fe(or=>{let ur=Object.keys(or),Pr=Object.keys(er);return ur.length===Pr.length&&Pr.every(Tr=>Math.abs((or[Tr]??0)-er[Tr])<.01)?or:er});},qe=()=>{window.cancelAnimationFrame(Z),Z=window.requestAnimationFrame(et);};if(et(),window.cancelAnimationFrame(ue),ue=window.requestAnimationFrame(()=>{ue=window.requestAnimationFrame(et);}),typeof document<"u"&&document.fonts?.ready&&document.fonts.ready.then(()=>{xe||qe();}).catch(()=>{}),typeof ResizeObserver>"u")return window.addEventListener("resize",qe),()=>{xe=true,window.cancelAnimationFrame(Z),window.cancelAnimationFrame(ue),window.removeEventListener("resize",qe);};let Tt=new ResizeObserver(qe),gt=F.querySelector("table"),mt=F.querySelector("tbody"),wt=F.querySelector("thead");gt&&Tt.observe(gt),wt&&Tt.observe(wt);let rr=new WeakSet,Bt=()=>{F.querySelectorAll("tbody tr[data-ctable-row-key]").forEach(zt=>{rr.has(zt)||(Tt.observe(zt),rr.add(zt));});};Bt();let qt=null;return mt&&typeof MutationObserver<"u"&&(qt=new MutationObserver(()=>{Bt(),qe();}),qt.observe(mt,{childList:true,subtree:true,characterData:true})),window.addEventListener("resize",qe),()=>{xe=true,window.cancelAnimationFrame(Z),window.cancelAnimationFrame(ue),Tt.disconnect(),qt?.disconnect(),window.removeEventListener("resize",qe);}},[Fe,te.visibleColumns,te.grouping,te.columnWidths]),g(Ae,{className:"orb-ctable-surface orb-planning-gantt",elevation:0,sx:{m:0,p:0,display:"flex",flexDirection:"column",minHeight:0,overflow:"hidden",borderRadius:"var(--orb-r-container)",border:`1px solid ${D.palette.divider}`,...N},children:[f("div",{className:"orb-table-toolbar orb-planning-table-toolbar",role:"toolbar","aria-label":L("table.title.default"),children:g("div",{className:"orb-table-toolbar-primary",children:[f(si,{value:te.filterText,onChange:F=>{te.setFilterText(F),te.setPage(0);}}),f(ii,{rowsPerPage:te.rowsPerPage,rowsPerPageOptions:h,page:te.page,count:te.totalDisplayCount,onRowsPerPageChange:te.setRowsPerPage,onPageChange:te.setPage}),Te.length>0&&f("div",{className:"orb-table-toolbar-custom",children:Te.map((F,Z)=>f("div",{className:"orb-planning-extra-tool",children:F},`planning-extra-tool-${Z}`))}),f("span",{className:"orb-table-toolbar-spacer"}),g("div",{className:"orb-table-toolbar-actions",children:[g("div",{className:"orb-table-tool-group",children:[f(ne,{className:"orb-table-tool-button",tooltip:"Column visibility",onClick:F=>te.setAnchorEl(F.currentTarget),sx:lr,children:f(on,{fontSize:"small"})}),f(ne,{className:"orb-table-tool-button",tooltip:"Group by",onClick:F=>te.setGroupAnchorEl(F.currentTarget),sx:lr,children:f(yo,{fontSize:"small"})}),f(ne,{className:`orb-table-tool-button ${te.sortBy.length>0||te.orderBy?"orb-is-active":""}`,tooltip:"Sort by...",active:te.sortBy.length>0||!!te.orderBy,onClick:()=>_(true),sx:lr,children:f(qd,{fontSize:"small"})})]}),ot&&f("div",{className:"orb-table-tool-group",children:ot}),f("div",{className:"orb-table-tool-group orb-planning-pane-controls",children:f(Bn,{"aria-label":"Planning pane layout",size:"small",value:Y??(z==="even"?"split":null),options:[{value:"table",label:"Expand task table",icon:f(ei,{fontSize:"small"})},{value:"split",label:"Split evenly",icon:f(ri,{fontSize:"small"})},{value:"timeline",label:"Expand timeline",icon:f(Ja,{fontSize:"small"})}],onValueChange:F=>{F==="split"?he():Q(F);}})}),f("div",{className:"orb-table-tool-group orb-planning-scale-control",children:f(Vt,{label:"",value:d,options:ql.map(F=>({value:F.value,label:F.label})),onChange:F=>p?.(F.target.value)})})]})]})}),ht.length===0?f("div",{sx:{minHeight:240,display:"grid",placeItems:"center",color:"text.secondary"},children:T}):f("div",{sx:{overflow:"hidden",flex:1,minHeight:0},children:g("div",{ref:B,sx:{height:"100%",display:"grid",gridTemplateColumns:ee,minWidth:0,transition:`grid-template-columns ${$o}`},children:[f("div",{"data-planning-scroll-pane":"table",ref:X,onScroll:()=>yt("table"),sx:{width:"100%",minWidth:0,maxWidth:"100%",height:i,overflowX:"auto",overflowY:"auto",opacity:Pt?0:1,transform:Pt?"translateX(-10px)":"translateX(0)",pointerEvents:Pt?"none":"auto",transition:`opacity ${$o}, transform ${$o}`},children:f(DndContext,{sensors:Oe,collisionDetection:closestCenter,modifiers:[restrictToHorizontalAxis],onDragEnd:F=>{let Z=F?.active?.id,ue=F?.over?.id;typeof Z=="string"&&typeof ue=="string"&&te.handleColumnReorder(Z,ue);},children:g("table",{className:"orb-tbl orb-ctable orb-planning-table",sx:{tableLayout:"fixed",width:_t,"& thead th":{height:Xl,py:0,lineHeight:1.15,boxSizing:"border-box"}},children:[f(di,{columns:te.columns,visibleColumns:te.visibleColumns,order:te.order,orderBy:te.orderBy,sortBy:te.sortBy,onRequestSort:te.handleRequestSort,onContextMenu:(F,Z)=>{F.preventDefault(),F.stopPropagation(),at({mouseX:F.clientX+2,mouseY:F.clientY-6,columnId:Z});},grouping:te.grouping,isAllExpanded:te.isAllExpanded,handleToggleAll:te.handleToggleAll,columnWidths:te.columnWidths,onColumnResize:te.handleColumnResize,enableColumnReorder:true}),f(pi,{visibleRows:Fe,columns:te.columns,visibleColumns:te.visibleColumns,selected:b$1?[b$1]:[],expandedGroups:te.expandedGroups,toggleGroupExpand:te.toggleGroupExpand,handleExpandGroupRecursively:te.handleExpandGroupRecursively,handleCollapseGroupRecursively:te.handleCollapseGroupRecursively,isGroupFullyExpanded:te.isGroupFullyExpanded,grouping:te.grouping,rowKeyProp:"id",page:te.page,rowsPerPage:te.rowsPerPage,emptyLabel:T,handleClick:(F,Z)=>{C?.(je.get(Z.id)||Z);},getRowDataKey:({entry:F})=>le(F),getGroupRowProps:()=>({style:{height:Yl}}),getRowProps:({data:F})=>{let Z=F,ue=Ne(Z.id),xe=Ce.activeId===Z.id,et=Ce.overId===Z.id&&_e(Ce.activeId,Z.id);return {draggable:ue,className:et?"orb-is-drop-target":void 0,style:{cursor:xe?"grabbing":ue?"grab":C?"pointer":"default",height:Yl,opacity:xe?.56:1,transition:"background-color 120ms ease, opacity 120ms ease"},onDragStart:qe=>Ue(qe,Z),onDragOver:qe=>vt(qe,Z.id),onDragEnter:qe=>vt(qe,Z.id),onDrop:qe=>Dt(qe,Z.id),onDragEnd:St}}})]})})}),f("div",{onPointerDown:pt?De:void 0,role:"separator","aria-orientation":"vertical",sx:{width:pt?ba:0,cursor:pt?"col-resize":"default",opacity:pt?1:0,pointerEvents:pt?"auto":"none",borderLeft:pt?`1px solid ${D.palette.divider}`:"0 solid transparent",borderRight:pt?`1px solid ${D.palette.divider}`:"0 solid transparent",backgroundColor:b()==="dark"?"color-mix(in oklch, var(--orb-muted) 10%, transparent)":"color-mix(in oklch, var(--orb-fg) 4%, transparent)",transition:`width ${$o}, opacity ${$o}, background-color 120ms ease`,position:"relative","&:hover":{backgroundColor:D.palette.action.selected},"&::before":{content:'""',position:"absolute",top:0,bottom:0,left:-6,right:-6,cursor:pt?"col-resize":"default"}}}),f("div",{sx:{minWidth:0,overflow:"hidden",opacity:Ot?0:1,transform:Ot?"translateX(10px)":"translateX(0)",pointerEvents:Ot?"none":"auto",transition:`opacity ${$o}, transform ${$o}`},children:f("div",{"data-planning-scroll-pane":"timeline",ref:H,onScroll:()=>yt("timeline"),sx:{width:"100%",height:i,overflowX:"auto",overflowY:"auto"},children:g("div",{sx:{width:"100%",minWidth:Ze||"100%"},children:[f("div",{className:"orb-planning-timeline-header",sx:{display:"grid",gridTemplateColumns:dt,height:Ge,boxSizing:"border-box",borderBottom:`1px solid ${D.palette.divider}`,position:"sticky",top:0,zIndex:2},children:Ie.map(F=>g("div",{title:F.title,sx:{px:.75,display:"flex",flexDirection:F.contextLabel?"column":"row",alignItems:"center",justifyContent:"center",gap:F.contextLabel?.15:0,borderRight:`1px solid ${D.palette.divider}`,color:F.contextLabel?"text.primary":"text.secondary",overflow:"hidden"},children:[F.contextLabel&&f(E,{component:"span",sx:{maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"text.secondary",fontSize:11,fontWeight:700,lineHeight:1.1},children:F.contextLabel}),f(E,{component:"span",sx:{maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:12,fontWeight:700,lineHeight:1.15},children:F.label})]},F.key))}),f(ae,{sx:{position:"relative"},children:Fe.map(F=>{let Z=le(F),ue=se[Z]??Yl;if(F.type==="group")return f("div",{className:"orb-planning-timeline-row orb-table-group-row","data-planning-timeline-row-key":Z,sx:{position:"relative",height:ue,boxSizing:"border-box",borderBottom:`1px solid ${D.palette.divider}`}},F.id);let xe=F.data||F,et=eo(xe.startDate),qe=eo(xe.endDate),Tt=Ql(et,Ie,ut),gt=Ql(qe,Ie,ut),mt=Math.max(0,gt-Tt),wt=ng(xe.progress),rr=xe.id===b$1,Bt=Ne(xe.id),qt=Ce.activeId===xe.id,zt=Ce.overId===xe.id&&_e(Ce.activeId,xe.id),Ut=xe.color??(xe.statusTone==="blocked"?D.palette.error.main:D.palette.primary.main);return f("div",{className:`orb-planning-timeline-row ${rr?"orb-is-selected":""}`,"data-planning-timeline-row-key":Z,draggable:Bt,onDragStart:Wt=>Ue(Wt,xe),onDragOver:Wt=>vt(Wt,xe.id),onDragEnter:Wt=>vt(Wt,xe.id),onDrop:Wt=>Dt(Wt,xe.id),onDragEnd:St,onClick:()=>C?.(je.get(xe.id)||xe),sx:{position:"relative",height:ue,boxSizing:"border-box",borderBottom:`1px solid ${D.palette.divider}`,opacity:qt?.56:1,"&::before":{content:'""',position:"absolute",top:0,left:0,right:0,height:2,backgroundColor:D.palette.primary.main,opacity:zt?1:0,transition:"opacity 120ms ease",pointerEvents:"none",zIndex:3},backgroundImage:b()==="dark"?"linear-gradient(90deg, color-mix(in oklch, var(--orb-muted) 8%, transparent) 1px, transparent 1px)":"linear-gradient(90deg, color-mix(in oklch, var(--orb-fg) 6%, transparent) 1px, transparent 1px)",backgroundSize:Lt,cursor:qt?"grabbing":Bt?"grab":C?"pointer":"default",transition:"opacity 120ms ease"},children:f(st,{title:`${xe.title}: ${et.format("MMM D HH:mm")} - ${qe.format("MMM D HH:mm")}`,children:g("div",{sx:{position:"absolute",left:`${Tt}%`,top:Math.max(8,(ue-24)/2),width:`max(18px, ${mt}%)`,height:24,borderRadius:999,overflow:"hidden",backgroundColor:b()==="dark"?"color-mix(in oklch, var(--orb-muted) 18%, transparent)":"color-mix(in oklch, var(--orb-fg) 10%, transparent)",outline:rr?`2px solid ${D.palette.warning.main}`:"none",outlineOffset:2},children:[f("div",{sx:{height:"100%",width:`${wt}%`,backgroundColor:Ut}}),f(E,{sx:{position:"absolute",inset:0,px:1,display:"flex",alignItems:"center",color:"var(--orb-on-primary)",fontSize:11,fontWeight:800,textShadow:"0 1px 4px rgba(0,0,0,0.45)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:xe.code})]})})},xe.id)})})]})})})]})}),f(sn,{groupAnchorEl:te.groupAnchorEl,setGroupAnchorEl:te.setGroupAnchorEl,grouping:te.grouping,setGrouping:te.setGrouping,columns:te.columns}),f(ln,{anchorEl:te.anchorEl,setAnchorEl:te.setAnchorEl,columns:te.columns,visibleColumns:te.visibleColumns,toggleColumnVisibility:te.toggleColumnVisibility}),f(pp,{contextMenu:rt,handleClose:()=>at(null),columns:te.columns,visibleColumns:te.visibleColumns,grouping:te.grouping,summaryColumns:te.summaryColumns,showSummary:te.showSummary,sortBy:te.sortBy,orderBy:te.orderBy,order:te.order,onSortAsc:F=>{te.applyMultiSort([{field:F,direction:"asc"}]);},onSortDesc:F=>{te.applyMultiSort([{field:F,direction:"desc"}]);},onClearSort:F=>{let Z=te.sortBy.filter(ue=>ue.field!==F);Z.length>0?te.applyMultiSort(Z):(te.clearMultiSort(),te.orderBy===F&&te.setOrderBy(""));},onHideColumn:F=>{te.visibleColumns.includes(F)&&te.toggleColumnVisibility(F);},onToggleGroup:F=>te.toggleGroupField(F),onToggleSummary:F=>te.toggleSummaryColumn(F),onOpenSortDialog:()=>_(true)}),f(up,{open:Ye,onClose:()=>_(false),columns:te.columns,initialRules:te.sortBy.length>0?te.sortBy:te.orderBy?[{field:te.orderBy,direction:te.order}]:[],onApply:F=>te.applyMultiSort(F),onClear:()=>{te.clearMultiSort(),te.setOrderBy("");}})]})};var Tz=({filterProps:t,ganttProps:r,spacing:o=2,sx:n,children:a})=>{let i=n?[{height:"100%",overflow:"hidden"},n]:{height:"100%",overflow:"hidden"},s=r.sx?[{height:"100%"},r.sx]:{height:"100%"};return g(ae,{spacing:o,sx:i,children:[f("div",{sx:{flexShrink:0},children:f(zr,{...t})}),f("div",{sx:{flex:1,minHeight:0,overflow:"hidden"},children:f(lg,{...r,bodyHeight:r.bodyHeight??"100%",sx:s})}),a]})};var cg=640,cx=360,dx=360,ws=8,Mn="220ms cubic-bezier(0.2, 0, 0, 1)",ec=(t,r,o=0,n=[])=>t.flatMap(a=>{let i=a.children??[],s=[{node:a,level:o,hasChildren:i.length>0,parentIds:n}];return r.has(a.id)?[...s,...ec(i,r,o+1,[...n,a.id])]:s}),pg=t=>t.flatMap(r=>[r,...pg(r.children??[])]),ug=(t,r=0,o=[])=>t.flatMap(n=>{let a=n.children??[];return [{node:n,level:r,hasChildren:a.length>0,parentIds:o},...ug(a,r+1,[...o,n.id])]}),mg=t=>t.flatMap(r=>{let o=r.children??[];return o.length===0?[]:[r.id,...mg(o)]}),dg=t=>Object.entries(t).filter(([r])=>r!=="children").map(([,r])=>r==null?"":typeof r=="string"||typeof r=="number"||typeof r=="boolean"?String(r):"").join(" ").toLowerCase(),Bz=({title:t,subtitle:r,nodes:o,columns:n,detail:a,selectedNodeId:i,defaultSelectedNodeId:s,onNodeSelect:l,expandedNodeIds:d,defaultExpandedNodeIds:p,onExpandedNodeIdsChange:u,defaultPaneMode:f$1="split",minTreePaneWidth:h=cx,minDetailPaneWidth:m=dx,tableAppId:v="ctree-comp",tableKey:y="default",tableTitle:g$1,filterConfig:x,searchQuery:b$1,searchToken:C,defaultRowsPerPage:P=-1,rowsPerPageOptions:S=[20,50,100,-1],serviceUrl:k,emptyLabel:I="No tree items available.",headerAction:w,sx:A,className:R})=>{let T=ar(),N=useRef(null),D=useRef(null),L=useRef(null),[B,X]=useState(s??o[0]?.id??null),[H,K]=useState(p??mg(o).slice(0,3)),[W,G]=useState(f$1),[z,O]=useState(cg),[Y,Q]=useState(0),[me,ie]=useState(0),[se,fe]=useState(P),Ge=useMemo(()=>n&&n.length>0?n:[{id:"label",label:"Name",render:le=>g(ae,{spacing:.3,children:[f(E,{sx:{fontSize:15,fontWeight:700,lineHeight:1.15},children:le.label}),le.subtitle&&f(E,{sx:{fontSize:13,color:"text.secondary",lineHeight:1.2},children:le.subtitle})]})}],[n]),Re=useMemo(()=>new Set(d??H),[d,H]),ke=useMemo(()=>ec(o,Re),[o,Re]),ze=useMemo(()=>pg(o),[o]),Pe=useMemo(()=>ug(o),[o]),Ce=i===void 0?B:i,Ve=useMemo(()=>ze.find(le=>le.id===Ce)??null,[Ce,ze]),rt=le=>{let ge=D.current?.clientWidth??0,J=ge>0?Math.max(h,ge-ws-m):Math.max(h,le);return Math.min(Math.max(le,h),J)},at=W==="detail",Ye=W==="tree"||!a,_=W==="split"&&!!a,ve=(()=>{if(Y<=0)return null;if(W==="tree"||!a)return {treeWidth:Y,splitterWidth:0,detailWidth:0};if(W==="detail")return {treeWidth:0,splitterWidth:0,detailWidth:Y};let le=_?ws:0,ge=rt(z);return {treeWidth:ge,splitterWidth:le,detailWidth:Math.max(0,Y-le-ge)}})(),Ee=ve?`${ve.treeWidth}px ${ve.splitterWidth}px ${ve.detailWidth}px`:W==="tree"||!a?"minmax(0, 1fr) 0px 0px":W==="detail"?"0px 0px minmax(0, 1fr)":`minmax(${h}px, ${z}px) ${ws}px minmax(${m}px, 1fr)`;useEffect(()=>{let le=D.current;if(!le){Q(0);return}let ge=0,J=()=>{window.cancelAnimationFrame(ge),ge=window.requestAnimationFrame(()=>{let Ie=le.clientWidth;Q(Ze=>Math.abs(Ze-Ie)<.5?Ze:Ie);});};if(J(),typeof ResizeObserver>"u")return window.addEventListener("resize",J),()=>{window.cancelAnimationFrame(ge),window.removeEventListener("resize",J);};let Te=new ResizeObserver(J);return Te.observe(le),window.addEventListener("resize",J),()=>{window.cancelAnimationFrame(ge),Te.disconnect(),window.removeEventListener("resize",J);}},[]);let it=le=>{d===void 0&&K(le),u?.(le);},je=le=>{let ge=new Set(Re);ge.has(le)?ge.delete(le):ge.add(le),it(Array.from(ge));},ht=le=>{i===void 0&&X(le.id),l?.(le);};useEffect(()=>{ie(0);},[o]),useEffect(()=>{let le=b$1?.trim().toLowerCase();if(!le)return;let ge=Pe.find(({node:dt})=>dg(dt).includes(le));if(!ge)return;let J=new Set(Re);ge.parentIds.forEach(dt=>J.add(dt)),it(Array.from(J)),ht(ge.node);let Ie=ec(o,J).findIndex(({node:dt})=>dt.id===ge.node.id);Ie>=0&&se>0&&ie(Math.floor(Ie/se));let Ze=0,ut=0;return Ze=window.requestAnimationFrame(()=>{ut=window.requestAnimationFrame(()=>{let dt=N.current?.querySelector("tr.orb-selected"),Lt=dt?.closest(".orb-table-container");if(dt&&Lt){let _t=Lt.getBoundingClientRect(),bt=dt.getBoundingClientRect(),ft=bt.top-_t.top+Lt.scrollTop;Lt.scrollTo({top:ft-Lt.clientHeight/2+bt.height/2,behavior:"smooth"});return}dt?.scrollIntoView({block:"center",behavior:"smooth"});});}),()=>{window.cancelAnimationFrame(Ze),window.cancelAnimationFrame(ut);}},[b$1,C,Pe,o,se]);let xt=useMemo(()=>ke.map(({node:le,level:ge,hasChildren:J})=>({...le,id:le.id,__node:le,__level:ge,__hasChildren:J,__expanded:Re.has(le.id),__searchText:dg(le)})),[Re,ke]),At=useMemo(()=>Ge.map((le,ge)=>({id:le.id,label:le.label,minWidth:typeof le.width=="number"?le.width:le.minWidth??(ge===0?320:120),numeric:le.numeric??le.align==="right",render:(J,Te)=>{let Ie=Te.__node,Ze=le.render?le.render(Ie):Ie[le.id];if(ge!==0)return f(we,{sx:{minWidth:0,color:le.align==="right"?"text.primary":"text.secondary",fontWeight:le.align==="right"?750:500,textAlign:le.align??"left"},children:Ze});let ut=Number(Te.__level??0),dt=!!Te.__hasChildren,Lt=!!Te.__expanded;return g(ae,{direction:"row",alignItems:"center",spacing:1,sx:{minWidth:0,pl:`${ut*24}px`},children:[f(ne,{tooltip:dt?Lt?"Collapse":"Expand":"",onClick:_t=>{_t.stopPropagation(),dt&&je(Ie.id);},disabled:!dt,sx:{width:24,height:24,visibility:dt?"visible":"hidden",transform:Lt?"rotate(0deg)":"rotate(-90deg)",transition:"transform 160ms ease"},children:f(Hr,{sx:{fontSize:20}})}),f(we,{sx:{width:10,height:10,borderRadius:"50%",flexShrink:0,backgroundColor:Ie.markerColor??T.palette.primary.main}}),f(we,{sx:{minWidth:0},children:Ze})]})}})),[Ge,Re,T.palette.primary.main]),Et=le=>{if(!_)return;le.preventDefault(),le.currentTarget.setPointerCapture(le.pointerId),L.current={startX:le.clientX,startWidth:z};let ge=Te=>{let Ie=L.current;Ie&&O(rt(Ie.startWidth+Te.clientX-Ie.startX));},J=()=>{L.current=null,window.removeEventListener("pointermove",ge),window.removeEventListener("pointerup",J),document.body.style.cursor="",document.body.style.userSelect="";};document.body.style.cursor="col-resize",document.body.style.userSelect="none",window.addEventListener("pointermove",ge),window.addEventListener("pointerup",J);},te=()=>{let le=D.current?.clientWidth??0,ge=le>0?Math.max(h,(le-ws)/2):cg;G("split"),O(rt(ge));},ot=()=>a?typeof a=="function"?a(Ve):a:null,Fe=a?f(Bn,{"aria-label":"Tree pane layout",value:W,options:[{value:"tree",label:"Expand tree",icon:f(ei,{fontSize:"small"})},{value:"split",label:"Split evenly",icon:f(ri,{fontSize:"small"})},{value:"detail",label:"Expand detail",icon:f(Ja,{fontSize:"small"})}],onValueChange:le=>{le==="split"?te():G(le);},sx:{position:"absolute",top:13,right:56,zIndex:3,backdropFilter:"blur(10px)"}}):null;return g(we,{ref:N,className:["ctree_comp",R].filter(Boolean).join(" "),sx:{position:"relative",height:"100%",minHeight:0,border:`1px solid ${T.palette.divider}`,borderRadius:"var(--orb-r-container)",overflow:"hidden",backgroundColor:"background.paper",boxShadow:`0 18px 42px ${tt(T.palette.common.black,b()==="dark"?.24:.08)}`,...A},children:[Fe,g(we,{ref:D,sx:{height:"100%",display:"grid",gridTemplateColumns:Ee,transition:`grid-template-columns ${Mn}`,minWidth:0},children:[g(we,{"aria-hidden":at?true:void 0,sx:{minWidth:0,overflow:"hidden",display:"flex",flexDirection:"column",opacity:at?0:1,transform:at?"translateX(-12px)":"translateX(0)",pointerEvents:at?"none":"auto",transition:`opacity ${Mn}, transform ${Mn}`,willChange:"opacity, transform"},children:[g(ae,{direction:"row",alignItems:"center",justifyContent:"space-between",spacing:2,sx:{px:2,py:1.5,minHeight:74,borderBottom:`1px solid ${T.palette.divider}`},children:[g(ae,{direction:"row",alignItems:"center",spacing:1.4,sx:{minWidth:0},children:[f(yo,{sx:{color:"primary.main",fontSize:28}}),g(we,{sx:{minWidth:0},children:[f(E,{sx:{fontSize:20,fontWeight:750,lineHeight:1.12},noWrap:true,children:t}),r&&f(E,{sx:{fontSize:14,color:"text.secondary",mt:.3},noWrap:true,children:r})]})]}),w!==void 0?w:f(ne,{tooltip:"Add node",color:"default",children:f(Oo,{fontSize:"small"})})]}),g(we,{sx:{flex:1,minHeight:0,overflow:"hidden"},children:[f(Qr,{appId:v,tableKey:y,title:g$1??(typeof t=="string"?t:"Tree"),columns:At,rows:xt,rowKey:"id",fitContainer:true,fullWidth:true,showSummary:false,selectionMode:"single",selected:Ce?[Ce]:[],onSelectionChange:le=>{let ge=le[le.length-1],J=ze.find(Te=>Te.id===ge);J&&ht(J);},page:me,rowsPerPage:se,rowsPerPageOptions:S,count:xt.length,onPageChange:ie,onRowsPerPageChange:le=>{ie(0),fe(le);},filterConfig:x,serviceUrl:k,graphReport:{enabled:false},disableGrouping:true,disableSorting:true,maxHeight:"100%"}),xt.length===0&&f(we,{sx:{minHeight:220,display:"grid",placeItems:"center",color:"text.secondary"},children:I})]})]}),f(we,{"data-ctree-splitter":"true",role:"separator","aria-orientation":"vertical",onPointerDown:_?Et:void 0,sx:{width:"100%",cursor:_?"col-resize":"default",backgroundColor:_?tt(T.palette.text.primary,b()==="dark"?.16:.08):"transparent",opacity:_?1:0,pointerEvents:_?"auto":"none",position:"relative",transition:`opacity ${Mn}, background-color 120ms ease`,"&:hover":{backgroundColor:_?tt(T.palette.primary.main,b()==="dark"?.35:.18):"transparent"}}}),g(we,{"aria-hidden":Ye?true:void 0,sx:{minWidth:0,overflow:"hidden",display:"flex",flexDirection:"column",opacity:Ye?0:1,transform:Ye?"translateX(12px)":"translateX(0)",pointerEvents:Ye?"none":"auto",transition:`opacity ${Mn}, transform ${Mn}`,willChange:"opacity, transform"},children:[f(we,{sx:{px:2,pt:2,minHeight:74,display:"flex",alignItems:"flex-end"},children:f(Nt,{sx:{width:"100%"}})}),f(we,{sx:{flex:1,minHeight:0,overflow:"auto",px:2,pb:2},children:ot()})]})]})]})};var gx={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)"}}},$z=({children:t,transitionKey:r,variant:o="fade",durationMs:n=220,delayMs:a=0,easing:i="cubic-bezier(0.22, 1, 0.36, 1)",disabled:s=false,sx:l})=>{let d=vo("(prefers-reduced-motion: reduce)"),[p,u]=useState("to"),f$1=!s&&!d&&o!=="none";useEffect(()=>{if(!f$1){u("to");return}u("from");let v=requestAnimationFrame(()=>{v=requestAnimationFrame(()=>{u("to");});});return ()=>cancelAnimationFrame(v)},[r,f$1]);let h=gx[o],m=useMemo(()=>f$1?p==="from"?h.from:h.to:{opacity:1,transform:"none"},[f$1,p,h.from,h.to]);return f(we,{sx:{willChange:f$1?"opacity, transform":"auto",transition:f$1?`opacity ${n}ms ${i} ${a}ms, transform ${n}ms ${i} ${a}ms`:"none",backfaceVisibility:"hidden",...m,...l},children:t})},Gz={subtle:{variant:"fade",durationMs:180},smooth:{variant:"slide-up",durationMs:220},snappy:{variant:"scale",durationMs:160}};export{bH as AIBrowserGlow,sc as Activity,vm as AgentPanel,va as AlertCircle,lc as AlertTriangle,Bx as ArrowDown,Hx as ArrowRight,cc as ArrowUp,Ts as BarChart,zx as Bot,Ls as Button,Uv as CAINavProvider,Jo as CAlert,Cp as CAmapChart,Oi as CAppHeader,ml as CAppHeaderSearch,uA as CAppPageLayout,zH as CAuthPage,jo as CAvatar,La as CBadge,Zn as CBarChart,ye as CButton,zn as CCalendar,Op as CCardDetailPanel,Bp as CCardGrid,eb as CCardGridCard,$1 as CCardPage,gi as CChartCard,Rt as CCheckbox,kt as CChip,fp as CComboChart,Sp as CCustomizeAgent,vf as CDatePicker,dN as CDetailInfoPage,Up as CDetailSearchAiBar,Di as CDetailSectionCard,Ht as CDialog,Nt as CDivider,Cf as CFileUpload,kP as CFilterField,bp as CFishboneChart,yp as CGoogleMapChart,xp as CGraphCharts,mp as CGraphKpiCards,vi as CGraphReport,hp as CHeatmapChart,ne as CIconButton,HN as CKanbanBoard,Zp as CKanbanBucket,sl as CKanbanCard,Np as CLayoutManagement,un as CLayoutManager,gp as CLineChart,fP as CList,hP as CListItem,xP as CListItemAvatar,bP as CListItemButton,vP as CListItemIcon,yP as CListItemText,CP as CListSubheader,Yt as CMenu,Un as CMessageBox,ss as CMetricChartCard,ai as CPageLayout,$z as CPageTransition,Ae as CPaper,fi as CPieChart,eL as CPivotTable,lg as CPlanningGantt,Tz as CPlanningLayout,Ns as CPopover,Fn as CProgress,Gg as CRadioGroup,Bn as CSegmentedControl,Vt as CSelect,Zg as CSkeleton,zr as CSmartFilter,s1 as CSmartTable,Kr as CSpinner,ae as CStack,g1 as CStandardPage,uP as CStatusBadge,Ea as CSwitch,Qr as CTable,r1 as CTableBody,o1 as CTableCell,n1 as CTableContainer,a1 as CTableHead,i1 as CTableRow,gf as CTabs,On as CTextArea,He as CTextField,st as CTooltip,Bz as CTreeComp,E as CTypography,np as CValueHelp,Si as CVariantManagement,Tp as CVariantManager,wl as CVoiceWaveOverlay,vp as CWaterfallChart,Is as Calendar,Vx as CalendarDays,Wx as Camera,$x as ChartNoAxesCombined,Ur as Check,ya as CheckCircle,Lr as ChevronDown,Ca as ChevronLeft,Or as ChevronRight,Gx as ChevronUp,_x as ChevronsDown,Ux as ChevronsUp,xa as CircleAlert,Nn as CircleCheck,Kx as CircleCheckBig,dc as CircleStop,pc as Clipboard,qx as ClipboardCheck,Xx as ClipboardList,uc as Clock,ra as CodeBlock,Yx as Columns3,gH as CopilotChat,fo as Copy,Zx as CopyPlus,Qx as Delete,jx as Download,mc as Edit,gc as Expand,Jx as Eye,e0 as EyeOff,Sa as File,fc as FileText,t0 as Filter,iH as FloatingAgentPanel,An as FolderTree,hc as GitBranch,sP as GlobalMessage,En as Globe,bc as Grid,r0 as GripVertical,o0 as Hammer,vc as Image,wa as Info,Nl as InputArea,n0 as Languages,a0 as Layers,i0 as LayoutDashboard,ka as Lightbulb,yc as LineChart,Cc as Loader2,Pa as Lock,s0 as LockKeyhole,xc as LogOut,is as METRIC_CHART_TYPES,Ms as Mail,Sc as MapPin,aa as MarkdownRenderer,oa as MathBlock,l0 as Menu,Js as MermaidBlock,Tg as MessageCircle,wc as MessageSquare,Ta as Mic,c0 as MicOff,kc as Moon,d0 as MoreHorizontal,_c as NavigationIsland,Bs as NavigationIsland2,JB as OMPHPanel,Wn as ORBCAFE_I18N_MESSAGES,fg as ORB_DARK,hx as ORB_FONT_STACK,gg as ORB_LIGHT,vx as ORB_RADIUS,ks as ORB_TOKENS,yx as ORB_TRANSITION_FAST,Ba as OrbcafeI18nProvider,Dn as OrbisModeProvider,Gz as PAGE_TRANSITION_PRESETS,IO as PAppPageLayout,vL as PBarcodeScanner,Uu as PNavIsland,EL as PNumericKeypad,Vu as PSmartFilter,Fv as PTable,PL as PTouchCard,Wu as PWorkloadNav,p0 as PackageCheck,u0 as PackageSearch,Ia as PanelLeftOpen,Ma as PanelRight,m0 as PanelsTopLeft,Pc as PieChart,Zo as Pin,Nu as PivotChartPanel,g0 as Play,Ra as Plus,f0 as QrCode,h0 as ReceiptText,Da as RefreshCw,b0 as Rocket,v0 as RotateCcw,Tc as RotateCw,y0 as Rows3,Mt as SapIcon,C0 as Save,x0 as ScanLine,Fr as Search,Ig as Send,Ic as SendHorizontal,Qo as Settings,S0 as ShieldCheck,w0 as Sigma,k0 as SortAsc,P0 as SquareSplitHorizontal,T0 as Star,hm as StdChat,Mc as Sun,I0 as Table2,tl as TableBlock,M0 as TabletSmartphone,Ln as Terminal,Mi as ThinkBlock,Rc as ThumbsDown,Dc as ThumbsUp,Nc as Trash2,$n as TreeMenu,R0 as TreePine,Ac as TrendingDown,Na as TriangleAlert,D0 as Truck,Ec as UploadCloud,Rs as User,HO as VoiceNavigatorProvider,AO as VoiceWaveOverlay,Lc as Volume2,N0 as Warehouse,A0 as Workflow,Xt as X,Aa as XCircle,Qp as addKanbanBucket,hi as buildAmapEmbedUrl,Qn as buildGoogleMapEmbedUrl,jI as buildGoogleMapIframe,Pf as buttonVariants,Jp as createKanbanBoardModel,oe as createSapIcon,Wr as findKanbanCard,Jk as message,oo as messageManager,Ei as moveKanbanCard,tt as orbAlpha,bx as orbChartSeries,Ii as parseMarkdownTable,El as parseOmphFileHref,jp as renameKanbanBucket,FD as renderMarkdown,Pi as resolveVariantFilters,Ti as resolveVariantLayout,Kv as useAINav,rD as useAmapEmbedUrl,DH as useAuthPage,q1 as useCardPage,qp as useDetailInfo,tD as useGoogleMapEmbedUrl,Z1 as useGraphChartData,Ci as useGraphInteraction,cn as useGraphReport,GN as useKanbanBoard,Mr as useMediaQuery,Zc as useNavigationIsland,br as useOrbMode,Ps as useOrbTokens,de as useOrbcafeI18n,cL as usePadLayout,uL as usePadRecordEditor,iu as usePageLayout,aL as usePivotTable,rg as usePlanningGantt,qH as usePlanningLayout,C1 as useStandardReport,vn as useVoiceInput,zO as useVoiceNavigator};